aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/include/asm/Kbuild1
-rw-r--r--arch/alpha/include/asm/atomic.h9
-rw-r--r--arch/alpha/include/asm/byteorder.h42
-rw-r--r--arch/alpha/include/asm/smp.h1
-rw-r--r--arch/alpha/include/asm/swab.h42
-rw-r--r--arch/alpha/include/asm/topology.h17
-rw-r--r--arch/alpha/kernel/Makefile2
-rw-r--r--arch/alpha/kernel/binfmt_loader.c51
-rw-r--r--arch/alpha/kernel/irq.c5
-rw-r--r--arch/alpha/kernel/pci.c18
-rw-r--r--arch/alpha/kernel/pci_impl.h13
-rw-r--r--arch/alpha/kernel/process.c2
-rw-r--r--arch/alpha/kernel/setup.c5
-rw-r--r--arch/alpha/kernel/smp.c7
-rw-r--r--arch/alpha/kernel/sys_dp264.c10
-rw-r--r--arch/alpha/kernel/sys_eiger.c2
-rw-r--r--arch/alpha/kernel/sys_miata.c2
-rw-r--r--arch/alpha/kernel/sys_noritake.c2
-rw-r--r--arch/alpha/kernel/sys_ruffian.c2
-rw-r--r--arch/alpha/kernel/sys_sable.c2
-rw-r--r--arch/alpha/kernel/sys_titan.c4
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/common/gic.c4
-rw-r--r--arch/arm/configs/clps7500_defconfig801
-rw-r--r--arch/arm/include/asm/Kbuild1
-rw-r--r--arch/arm/include/asm/atomic.h3
-rw-r--r--arch/arm/include/asm/byteorder.h33
-rw-r--r--arch/arm/include/asm/mach/pci.h2
-rw-r--r--arch/arm/include/asm/mmu.h1
-rw-r--r--arch/arm/include/asm/swab.h50
-rw-r--r--arch/arm/kernel/bios32.c27
-rw-r--r--arch/arm/kernel/ecard.c2
-rw-r--r--arch/arm/kernel/irq.c2
-rw-r--r--arch/arm/kernel/isa.c1
-rw-r--r--arch/arm/kernel/kprobes.c2
-rw-r--r--arch/arm/kernel/smp.c10
-rw-r--r--arch/arm/mach-aaec2000/core.c2
-rw-r--r--arch/arm/mach-at91/at91cap9.c1
-rw-r--r--arch/arm/mach-at91/at91rm9200.c1
-rw-r--r--arch/arm/mach-at91/at91rm9200_time.c3
-rw-r--r--arch/arm/mach-at91/at91sam9260.c1
-rw-r--r--arch/arm/mach-at91/at91sam9261.c1
-rw-r--r--arch/arm/mach-at91/at91sam9263.c1
-rw-r--r--arch/arm/mach-at91/at91sam926x_time.c2
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c1
-rw-r--r--arch/arm/mach-at91/board-sam9rlek.c1
-rw-r--r--arch/arm/mach-clps711x/edb7211-mm.c1
-rw-r--r--arch/arm/mach-clps711x/fortunet.c1
-rw-r--r--arch/arm/mach-davinci/devices.c1
-rw-r--r--arch/arm/mach-davinci/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-davinci/time.c2
-rw-r--r--arch/arm/mach-ep93xx/core.c6
-rw-r--r--arch/arm/mach-footbridge/common.c9
-rw-r--r--arch/arm/mach-footbridge/common.h1
-rw-r--r--arch/arm/mach-footbridge/dc21285.c23
-rw-r--r--arch/arm/mach-footbridge/isa-irq.c2
-rw-r--r--arch/arm/mach-h720x/h7202-eval.c1
-rw-r--r--arch/arm/mach-imx/time.c2
-rw-r--r--arch/arm/mach-integrator/core.c10
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c6
-rw-r--r--arch/arm/mach-integrator/pci.c11
-rw-r--r--arch/arm/mach-ixp4xx/common.c2
-rw-r--r--arch/arm/mach-kirkwood/common.c1
-rw-r--r--arch/arm/mach-kirkwood/pcie.c1
-rw-r--r--arch/arm/mach-ks8695/devices.c1
-rw-r--r--arch/arm/mach-lh7a40x/clcd.c2
-rw-r--r--arch/arm/mach-msm/devices.c1
-rw-r--r--arch/arm/mach-msm/timer.c2
-rw-r--r--arch/arm/mach-mv78xx0/pcie.c1
-rw-r--r--arch/arm/mach-mx2/devices.c1
-rw-r--r--arch/arm/mach-mx3/devices.c1
-rw-r--r--arch/arm/mach-netx/fb.c4
-rw-r--r--arch/arm/mach-netx/time.c2
-rw-r--r--arch/arm/mach-netx/xc.c1
-rw-r--r--arch/arm/mach-ns9xxx/time-ns9360.c2
-rw-r--r--arch/arm/mach-omap1/mcbsp.c1
-rw-r--r--arch/arm/mach-omap1/time.c2
-rw-r--r--arch/arm/mach-omap1/timer32k.c2
-rw-r--r--arch/arm/mach-omap2/clock24xx.h4
-rw-r--r--arch/arm/mach-omap2/mcbsp.c1
-rw-r--r--arch/arm/mach-omap2/timer-gp.c2
-rw-r--r--arch/arm/mach-orion5x/pci.c1
-rw-r--r--arch/arm/mach-pnx4008/gpio.c1
-rw-r--r--arch/arm/mach-pnx4008/i2c.c1
-rw-r--r--arch/arm/mach-pxa/corgi.c54
-rw-r--r--arch/arm/mach-pxa/e350.c1
-rw-r--r--arch/arm/mach-pxa/e400.c1
-rw-r--r--arch/arm/mach-pxa/e740.c1
-rw-r--r--arch/arm/mach-pxa/e750.c53
-rw-r--r--arch/arm/mach-pxa/e800.c1
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa3xx-regs.h2
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa930_rotary.h20
-rw-r--r--arch/arm/mach-pxa/include/mach/pxa930_trkball.h10
-rw-r--r--arch/arm/mach-pxa/poodle.c51
-rw-r--r--arch/arm/mach-pxa/spitz.c77
-rw-r--r--arch/arm/mach-pxa/time.c2
-rw-r--r--arch/arm/mach-realview/core.c2
-rw-r--r--arch/arm/mach-realview/core.h2
-rw-r--r--arch/arm/mach-realview/localtimer.c4
-rw-r--r--arch/arm/mach-realview/platsmp.c1
-rw-r--r--arch/arm/mach-s3c2410/include/mach/gpio.h1
-rw-r--r--arch/arm/mach-s3c2410/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-s3c2410/include/mach/spi.h2
-rw-r--r--arch/arm/mach-s3c2440/mach-at2440evb.c2
-rw-r--r--arch/arm/mach-s3c6400/include/mach/irqs.h4
-rw-r--r--arch/arm/mach-sa1100/time.c2
-rw-r--r--arch/arm/mach-versatile/core.c2
-rw-r--r--arch/arm/mach-versatile/core.h2
-rw-r--r--arch/arm/mm/dma-mapping.c28
-rw-r--r--arch/arm/oprofile/op_model_mpcore.c4
-rw-r--r--arch/arm/plat-mxc/include/mach/usb.h23
-rw-r--r--arch/arm/plat-mxc/time.c2
-rw-r--r--arch/arm/plat-omap/i2c.c1
-rw-r--r--arch/arm/plat-omap/include/mach/memory.h2
-rw-r--r--arch/arm/plat-omap/usb.c32
-rw-r--r--arch/arm/plat-orion/time.c2
-rw-r--r--arch/arm/plat-s3c/dev-fb.c1
-rw-r--r--arch/arm/plat-s3c/dev-i2c0.c1
-rw-r--r--arch/arm/plat-s3c/dev-i2c1.c1
-rw-r--r--arch/arm/plat-s3c24xx/gpiolib.c18
-rw-r--r--arch/arm/plat-s3c24xx/pwm.c2
-rw-r--r--arch/arm/plat-s3c64xx/include/plat/irqs.h2
-rw-r--r--arch/avr32/Kconfig19
-rw-r--r--arch/avr32/Makefile1
-rw-r--r--arch/avr32/boards/atngw100/setup.c2
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c20
-rw-r--r--arch/avr32/boards/atstk1000/atstk1003.c20
-rw-r--r--arch/avr32/boards/atstk1000/atstk1004.c2
-rw-r--r--arch/avr32/boards/favr-32/setup.c31
-rw-r--r--arch/avr32/boards/hammerhead/Kconfig43
-rw-r--r--arch/avr32/boards/hammerhead/Makefile1
-rw-r--r--arch/avr32/boards/hammerhead/flash.c377
-rw-r--r--arch/avr32/boards/hammerhead/flash.h6
-rw-r--r--arch/avr32/boards/hammerhead/setup.c245
-rw-r--r--arch/avr32/boards/mimc200/setup.c4
-rw-r--r--arch/avr32/configs/atngw100_defconfig2
-rw-r--r--arch/avr32/configs/atstk1002_defconfig2
-rw-r--r--arch/avr32/configs/atstk1003_defconfig2
-rw-r--r--arch/avr32/configs/atstk1006_defconfig2
-rw-r--r--arch/avr32/configs/hammerhead_defconfig1467
-rw-r--r--arch/avr32/include/asm/Kbuild1
-rw-r--r--arch/avr32/include/asm/atmel-mci.h39
-rw-r--r--arch/avr32/include/asm/atomic.h2
-rw-r--r--arch/avr32/include/asm/bitops.h5
-rw-r--r--arch/avr32/include/asm/byteorder.h31
-rw-r--r--arch/avr32/include/asm/kdebug.h1
-rw-r--r--arch/avr32/include/asm/swab.h35
-rw-r--r--arch/avr32/include/asm/syscalls.h39
-rw-r--r--arch/avr32/kernel/process.c1
-rw-r--r--arch/avr32/kernel/signal.c1
-rw-r--r--arch/avr32/kernel/sys_avr32.c1
-rw-r--r--arch/avr32/kernel/time.c2
-rw-r--r--arch/avr32/kernel/traps.c1
-rw-r--r--arch/avr32/mach-at32ap/at32ap700x.c21
-rw-r--r--arch/avr32/mach-at32ap/clock.c4
-rw-r--r--arch/avr32/mach-at32ap/clock.h3
-rw-r--r--arch/avr32/mach-at32ap/include/mach/at32ap700x.h3
-rw-r--r--arch/avr32/mach-at32ap/include/mach/portmux.h2
-rw-r--r--arch/avr32/mach-at32ap/pio.c19
-rw-r--r--arch/avr32/mm/cache.c1
-rw-r--r--arch/avr32/mm/init.c1
-rw-r--r--arch/blackfin/Kconfig204
-rw-r--r--arch/blackfin/Kconfig.debug30
-rw-r--r--arch/blackfin/Makefile18
-rw-r--r--arch/blackfin/configs/BF518F-EZBRD_defconfig1191
-rw-r--r--arch/blackfin/configs/BF526-EZBRD_defconfig345
-rw-r--r--arch/blackfin/configs/BF527-EZKIT_defconfig551
-rw-r--r--arch/blackfin/configs/BF533-EZKIT_defconfig316
-rw-r--r--arch/blackfin/configs/BF533-STAMP_defconfig403
-rw-r--r--arch/blackfin/configs/BF537-STAMP_defconfig463
-rw-r--r--arch/blackfin/configs/BF538-EZKIT_defconfig1368
-rw-r--r--arch/blackfin/configs/BF548-EZKIT_defconfig518
-rw-r--r--arch/blackfin/configs/BF561-EZKIT_defconfig321
-rw-r--r--arch/blackfin/configs/BlackStamp_defconfig3
-rw-r--r--arch/blackfin/configs/CM-BF527_defconfig24
-rw-r--r--arch/blackfin/configs/CM-BF533_defconfig6
-rw-r--r--arch/blackfin/configs/CM-BF537E_defconfig22
-rw-r--r--arch/blackfin/configs/CM-BF537U_defconfig22
-rw-r--r--arch/blackfin/configs/CM-BF548_defconfig10
-rw-r--r--arch/blackfin/configs/CM-BF561_defconfig6
-rw-r--r--arch/blackfin/configs/H8606_defconfig3
-rw-r--r--arch/blackfin/configs/IP0X_defconfig3
-rw-r--r--arch/blackfin/configs/PNAV-10_defconfig596
-rw-r--r--arch/blackfin/configs/SRV1_defconfig21
-rw-r--r--arch/blackfin/configs/TCM-BF537_defconfig165
-rw-r--r--arch/blackfin/include/asm/Kbuild1
-rw-r--r--arch/blackfin/include/asm/atomic.h155
-rw-r--r--arch/blackfin/include/asm/bfin-global.h7
-rw-r--r--arch/blackfin/include/asm/bfin5xx_spi.h28
-rw-r--r--arch/blackfin/include/asm/bfin_sdh.h19
-rw-r--r--arch/blackfin/include/asm/bfin_sport.h3
-rw-r--r--arch/blackfin/include/asm/bfrom.h5
-rw-r--r--arch/blackfin/include/asm/bitops.h204
-rw-r--r--arch/blackfin/include/asm/blackfin.h10
-rw-r--r--arch/blackfin/include/asm/byteorder.h43
-rw-r--r--arch/blackfin/include/asm/cache.h29
-rw-r--r--arch/blackfin/include/asm/cacheflush.h20
-rw-r--r--arch/blackfin/include/asm/checksum.h3
-rw-r--r--arch/blackfin/include/asm/context.S47
-rw-r--r--arch/blackfin/include/asm/cplb-mpu.h61
-rw-r--r--arch/blackfin/include/asm/cplb.h25
-rw-r--r--arch/blackfin/include/asm/cplbinit.h83
-rw-r--r--arch/blackfin/include/asm/cpu.h41
-rw-r--r--arch/blackfin/include/asm/dma.h220
-rw-r--r--arch/blackfin/include/asm/entry.h11
-rw-r--r--arch/blackfin/include/asm/gpio.h226
-rw-r--r--arch/blackfin/include/asm/hardirq.h2
-rw-r--r--arch/blackfin/include/asm/io.h14
-rw-r--r--arch/blackfin/include/asm/ipipe.h278
-rw-r--r--arch/blackfin/include/asm/ipipe_base.h80
-rw-r--r--arch/blackfin/include/asm/irq.h296
-rw-r--r--arch/blackfin/include/asm/l1layout.h5
-rw-r--r--arch/blackfin/include/asm/mem_init.h (renamed from arch/blackfin/mach-bf527/include/mach/mem_init.h)164
-rw-r--r--arch/blackfin/include/asm/mem_map.h75
-rw-r--r--arch/blackfin/include/asm/mmu.h1
-rw-r--r--arch/blackfin/include/asm/mmu_context.h27
-rw-r--r--arch/blackfin/include/asm/mutex-dec.h112
-rw-r--r--arch/blackfin/include/asm/mutex.h63
-rw-r--r--arch/blackfin/include/asm/pda.h70
-rw-r--r--arch/blackfin/include/asm/percpu.h12
-rw-r--r--arch/blackfin/include/asm/pgtable.h1
-rw-r--r--arch/blackfin/include/asm/processor.h28
-rw-r--r--arch/blackfin/include/asm/reboot.h4
-rw-r--r--arch/blackfin/include/asm/rwlock.h6
-rw-r--r--arch/blackfin/include/asm/serial.h1
-rw-r--r--arch/blackfin/include/asm/smp.h44
-rw-r--r--arch/blackfin/include/asm/spinlock.h87
-rw-r--r--arch/blackfin/include/asm/spinlock_types.h22
-rw-r--r--arch/blackfin/include/asm/swab.h48
-rw-r--r--arch/blackfin/include/asm/system.h185
-rw-r--r--arch/blackfin/include/asm/thread_info.h5
-rw-r--r--arch/blackfin/include/asm/uaccess.h89
-rw-r--r--arch/blackfin/include/asm/xor.h1
-rw-r--r--arch/blackfin/kernel/Makefile7
-rw-r--r--arch/blackfin/kernel/asm-offsets.c29
-rw-r--r--arch/blackfin/kernel/bfin_dma_5xx.c936
-rw-r--r--arch/blackfin/kernel/bfin_gpio.c448
-rw-r--r--arch/blackfin/kernel/bfin_ksyms.c101
-rw-r--r--arch/blackfin/kernel/cplb-mpu/Makefile6
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cacheinit.c4
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cplbinfo.c136
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cplbinit.c48
-rw-r--r--arch/blackfin/kernel/cplb-mpu/cplbmgr.c119
-rw-r--r--arch/blackfin/kernel/cplb-nompu/Makefile8
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cacheinit.c25
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbhdlr.S130
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbinfo.c195
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbinit.c521
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbmgr.S646
-rw-r--r--arch/blackfin/kernel/cplb-nompu/cplbmgr.c283
-rw-r--r--arch/blackfin/kernel/cplbinfo.c177
-rw-r--r--arch/blackfin/kernel/early_printk.c4
-rw-r--r--arch/blackfin/kernel/entry.S5
-rw-r--r--arch/blackfin/kernel/fixed_code.S6
-rw-r--r--arch/blackfin/kernel/ipipe.c428
-rw-r--r--arch/blackfin/kernel/irqchip.c46
-rw-r--r--arch/blackfin/kernel/kgdb.c127
-rw-r--r--arch/blackfin/kernel/kgdb_test.c123
-rw-r--r--arch/blackfin/kernel/mcount.S70
-rw-r--r--arch/blackfin/kernel/module.c152
-rw-r--r--arch/blackfin/kernel/process.c32
-rw-r--r--arch/blackfin/kernel/ptrace.c23
-rw-r--r--arch/blackfin/kernel/reboot.c24
-rw-r--r--arch/blackfin/kernel/setup.c218
-rw-r--r--arch/blackfin/kernel/time-ts.c2
-rw-r--r--arch/blackfin/kernel/time.c162
-rw-r--r--arch/blackfin/kernel/traps.c86
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S9
-rw-r--r--arch/blackfin/lib/checksum.c4
-rw-r--r--arch/blackfin/lib/ins.S272
-rw-r--r--arch/blackfin/lib/muldi3.S68
-rw-r--r--arch/blackfin/lib/muldi3.c99
-rw-r--r--arch/blackfin/mach-bf518/Kconfig233
-rw-r--r--arch/blackfin/mach-bf518/Makefile5
-rw-r--r--arch/blackfin/mach-bf518/boards/Kconfig12
-rw-r--r--arch/blackfin/mach-bf518/boards/Makefile5
-rw-r--r--arch/blackfin/mach-bf518/boards/ezbrd.c669
-rw-r--r--arch/blackfin/mach-bf518/dma.c118
-rw-r--r--arch/blackfin/mach-bf518/include/mach/anomaly.h79
-rw-r--r--arch/blackfin/mach-bf518/include/mach/bf518.h132
-rw-r--r--arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h169
-rw-r--r--arch/blackfin/mach-bf518/include/mach/blackfin.h105
-rw-r--r--arch/blackfin/mach-bf518/include/mach/cdefBF512.h46
-rw-r--r--arch/blackfin/mach-bf518/include/mach/cdefBF514.h48
-rw-r--r--arch/blackfin/mach-bf518/include/mach/cdefBF516.h213
-rw-r--r--arch/blackfin/mach-bf518/include/mach/cdefBF518.h282
-rw-r--r--arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h1208
-rw-r--r--arch/blackfin/mach-bf518/include/mach/defBF512.h42
-rw-r--r--arch/blackfin/mach-bf518/include/mach/defBF514.h113
-rw-r--r--arch/blackfin/mach-bf518/include/mach/defBF516.h490
-rw-r--r--arch/blackfin/mach-bf518/include/mach/defBF518.h651
-rw-r--r--arch/blackfin/mach-bf518/include/mach/defBF51x_base.h1940
-rw-r--r--arch/blackfin/mach-bf518/include/mach/dma.h33
-rw-r--r--arch/blackfin/mach-bf518/include/mach/gpio.h60
-rw-r--r--arch/blackfin/mach-bf518/include/mach/irq.h260
-rw-r--r--arch/blackfin/mach-bf518/include/mach/mem_map.h108
-rw-r--r--arch/blackfin/mach-bf518/include/mach/portmux.h188
-rw-r--r--arch/blackfin/mach-bf518/ints-priority.c99
-rw-r--r--arch/blackfin/mach-bf527/Kconfig34
-rw-r--r--arch/blackfin/mach-bf527/Makefile2
-rw-r--r--arch/blackfin/mach-bf527/boards/cm_bf527.c111
-rw-r--r--arch/blackfin/mach-bf527/boards/ezbrd.c90
-rw-r--r--arch/blackfin/mach-bf527/boards/ezkit.c176
-rw-r--r--arch/blackfin/mach-bf527/dma.c2
-rw-r--r--arch/blackfin/mach-bf527/head.S146
-rw-r--r--arch/blackfin/mach-bf527/include/mach/anomaly.h10
-rw-r--r--arch/blackfin/mach-bf527/include/mach/bf527.h8
-rw-r--r--arch/blackfin/mach-bf527/include/mach/bfin_sir.h142
-rw-r--r--arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h102
-rw-r--r--arch/blackfin/mach-bf527/include/mach/dma.h32
-rw-r--r--arch/blackfin/mach-bf527/include/mach/gpio.h68
-rw-r--r--arch/blackfin/mach-bf527/include/mach/irq.h32
-rw-r--r--arch/blackfin/mach-bf527/include/mach/mem_map.h6
-rw-r--r--arch/blackfin/mach-bf527/ints-priority.c16
-rw-r--r--arch/blackfin/mach-bf533/Kconfig2
-rw-r--r--arch/blackfin/mach-bf533/Makefile2
-rw-r--r--arch/blackfin/mach-bf533/boards/H8606.c24
-rw-r--r--arch/blackfin/mach-bf533/boards/blackstamp.c24
-rw-r--r--arch/blackfin/mach-bf533/boards/cm_bf533.c39
-rw-r--r--arch/blackfin/mach-bf533/boards/ezkit.c26
-rw-r--r--arch/blackfin/mach-bf533/boards/generic_board.c35
-rw-r--r--arch/blackfin/mach-bf533/boards/ip0x.c24
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c58
-rw-r--r--arch/blackfin/mach-bf533/dma.c2
-rw-r--r--arch/blackfin/mach-bf533/head.S137
-rw-r--r--arch/blackfin/mach-bf533/include/mach/anomaly.h11
-rw-r--r--arch/blackfin/mach-bf533/include/mach/bf533.h4
-rw-r--r--arch/blackfin/mach-bf533/include/mach/bfin_sir.h125
-rw-r--r--arch/blackfin/mach-bf533/include/mach/blackfin.h7
-rw-r--r--arch/blackfin/mach-bf533/include/mach/cdefBF532.h177
-rw-r--r--arch/blackfin/mach-bf533/include/mach/dma.h40
-rw-r--r--arch/blackfin/mach-bf533/include/mach/gpio.h34
-rw-r--r--arch/blackfin/mach-bf533/include/mach/irq.h14
-rw-r--r--arch/blackfin/mach-bf533/include/mach/mem_init.h297
-rw-r--r--arch/blackfin/mach-bf533/include/mach/mem_map.h6
-rw-r--r--arch/blackfin/mach-bf537/Kconfig34
-rw-r--r--arch/blackfin/mach-bf537/Makefile2
-rw-r--r--arch/blackfin/mach-bf537/boards/cm_bf537.c63
-rw-r--r--arch/blackfin/mach-bf537/boards/generic_board.c109
-rw-r--r--arch/blackfin/mach-bf537/boards/minotaur.c48
-rw-r--r--arch/blackfin/mach-bf537/boards/pnav10.c50
-rw-r--r--arch/blackfin/mach-bf537/boards/stamp.c280
-rw-r--r--arch/blackfin/mach-bf537/boards/tcm_bf537.c63
-rw-r--r--arch/blackfin/mach-bf537/dma.c2
-rw-r--r--arch/blackfin/mach-bf537/head.S146
-rw-r--r--arch/blackfin/mach-bf537/include/mach/anomaly.h13
-rw-r--r--arch/blackfin/mach-bf537/include/mach/bf537.h2
-rw-r--r--arch/blackfin/mach-bf537/include/mach/bfin_sir.h142
-rw-r--r--arch/blackfin/mach-bf537/include/mach/blackfin.h2
-rw-r--r--arch/blackfin/mach-bf537/include/mach/cdefBF534.h91
-rw-r--r--arch/blackfin/mach-bf537/include/mach/dma.h32
-rw-r--r--arch/blackfin/mach-bf537/include/mach/gpio.h68
-rw-r--r--arch/blackfin/mach-bf537/include/mach/irq.h32
-rw-r--r--arch/blackfin/mach-bf537/include/mach/mem_init.h303
-rw-r--r--arch/blackfin/mach-bf537/include/mach/mem_map.h6
-rw-r--r--arch/blackfin/mach-bf537/ints-priority.c16
-rw-r--r--arch/blackfin/mach-bf538/Kconfig164
-rw-r--r--arch/blackfin/mach-bf538/Makefile5
-rw-r--r--arch/blackfin/mach-bf538/boards/Kconfig12
-rw-r--r--arch/blackfin/mach-bf538/boards/Makefile5
-rw-r--r--arch/blackfin/mach-bf538/boards/ezkit.c606
-rw-r--r--arch/blackfin/mach-bf538/dma.c161
-rw-r--r--arch/blackfin/mach-bf538/include/mach/anomaly.h132
-rw-r--r--arch/blackfin/mach-bf538/include/mach/bf538.h124
-rw-r--r--arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h183
-rw-r--r--arch/blackfin/mach-bf538/include/mach/blackfin.h101
-rw-r--r--arch/blackfin/mach-bf538/include/mach/cdefBF538.h2108
-rw-r--r--arch/blackfin/mach-bf538/include/mach/cdefBF539.h240
-rw-r--r--arch/blackfin/mach-bf538/include/mach/defBF539.h4243
-rw-r--r--arch/blackfin/mach-bf538/include/mach/dma.h41
-rw-r--r--arch/blackfin/mach-bf538/include/mach/gpio.h79
-rw-r--r--arch/blackfin/mach-bf538/include/mach/irq.h211
-rw-r--r--arch/blackfin/mach-bf538/include/mach/mem_map.h113
-rw-r--r--arch/blackfin/mach-bf538/include/mach/portmux.h106
-rw-r--r--arch/blackfin/mach-bf538/ints-priority.c94
-rw-r--r--arch/blackfin/mach-bf548/Kconfig2
-rw-r--r--arch/blackfin/mach-bf548/Makefile2
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c166
-rw-r--r--arch/blackfin/mach-bf548/boards/ezkit.c156
-rw-r--r--arch/blackfin/mach-bf548/dma.c2
-rw-r--r--arch/blackfin/mach-bf548/head.S158
-rw-r--r--arch/blackfin/mach-bf548/include/mach/anomaly.h5
-rw-r--r--arch/blackfin/mach-bf548/include/mach/bf548.h2
-rw-r--r--arch/blackfin/mach-bf548/include/mach/bfin_sir.h166
-rw-r--r--arch/blackfin/mach-bf548/include/mach/blackfin.h2
-rw-r--r--arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h114
-rw-r--r--arch/blackfin/mach-bf548/include/mach/dma.h32
-rw-r--r--arch/blackfin/mach-bf548/include/mach/irq.h2
-rw-r--r--arch/blackfin/mach-bf548/include/mach/mem_init.h255
-rw-r--r--arch/blackfin/mach-bf548/include/mach/mem_map.h6
-rw-r--r--arch/blackfin/mach-bf561/Kconfig8
-rw-r--r--arch/blackfin/mach-bf561/Makefile3
-rw-r--r--arch/blackfin/mach-bf561/atomic.S919
-rw-r--r--arch/blackfin/mach-bf561/boards/cm_bf561.c39
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c89
-rw-r--r--arch/blackfin/mach-bf561/boards/generic_board.c35
-rw-r--r--arch/blackfin/mach-bf561/boards/tepla.c34
-rw-r--r--arch/blackfin/mach-bf561/dma.c2
-rw-r--r--arch/blackfin/mach-bf561/head.S136
-rw-r--r--arch/blackfin/mach-bf561/include/mach/anomaly.h16
-rw-r--r--arch/blackfin/mach-bf561/include/mach/bf561.h2
-rw-r--r--arch/blackfin/mach-bf561/include/mach/bfin_sir.h125
-rw-r--r--arch/blackfin/mach-bf561/include/mach/blackfin.h4
-rw-r--r--arch/blackfin/mach-bf561/include/mach/cdefBF561.h103
-rw-r--r--arch/blackfin/mach-bf561/include/mach/defBF561.h3
-rw-r--r--arch/blackfin/mach-bf561/include/mach/dma.h16
-rw-r--r--arch/blackfin/mach-bf561/include/mach/gpio.h68
-rw-r--r--arch/blackfin/mach-bf561/include/mach/mem_init.h295
-rw-r--r--arch/blackfin/mach-bf561/include/mach/mem_map.h80
-rw-r--r--arch/blackfin/mach-bf561/include/mach/smp.h22
-rw-r--r--arch/blackfin/mach-bf561/secondary.S215
-rw-r--r--arch/blackfin/mach-bf561/smp.c167
-rw-r--r--arch/blackfin/mach-common/Makefile4
-rw-r--r--arch/blackfin/mach-common/cache-c.c24
-rw-r--r--arch/blackfin/mach-common/cache.S6
-rw-r--r--arch/blackfin/mach-common/clocks-init.c93
-rw-r--r--arch/blackfin/mach-common/cpufreq.c6
-rw-r--r--arch/blackfin/mach-common/dpmc_modes.S3
-rw-r--r--arch/blackfin/mach-common/entry.S132
-rw-r--r--arch/blackfin/mach-common/head.S117
-rw-r--r--arch/blackfin/mach-common/interrupt.S80
-rw-r--r--arch/blackfin/mach-common/ints-priority.c541
-rw-r--r--arch/blackfin/mach-common/irqpanic.c12
-rw-r--r--arch/blackfin/mach-common/lock.S4
-rw-r--r--arch/blackfin/mach-common/pm.c20
-rw-r--r--arch/blackfin/mach-common/smp.c476
-rw-r--r--arch/blackfin/mm/init.c50
-rw-r--r--arch/blackfin/mm/sram-alloc.c339
-rw-r--r--arch/blackfin/oprofile/Makefile3
-rw-r--r--arch/blackfin/oprofile/bfin_oprofile.c18
-rw-r--r--arch/blackfin/oprofile/common.c168
-rw-r--r--arch/blackfin/oprofile/op_blackfin.h98
-rw-r--r--arch/blackfin/oprofile/op_model_bf533.c161
-rw-r--r--arch/blackfin/oprofile/timer_int.c73
-rw-r--r--arch/cris/Kconfig2
-rw-r--r--arch/cris/arch-v32/drivers/iop_fw_load.c6
-rw-r--r--arch/cris/arch-v32/kernel/irq.c4
-rw-r--r--arch/cris/arch-v32/kernel/signal.c2
-rw-r--r--arch/cris/arch-v32/kernel/smp.c4
-rw-r--r--arch/cris/include/asm/atomic.h4
-rw-r--r--arch/cris/include/asm/bitops.h1
-rw-r--r--arch/cris/include/asm/smp.h1
-rw-r--r--arch/frv/kernel/ptrace.c11
-rw-r--r--arch/h8300/Kconfig2
-rw-r--r--arch/h8300/include/asm/Kbuild1
-rw-r--r--arch/h8300/include/asm/atomic.h3
-rw-r--r--arch/h8300/include/asm/bitops.h1
-rw-r--r--arch/h8300/include/asm/byteorder.h8
-rw-r--r--arch/h8300/include/asm/mmu.h1
-rw-r--r--arch/h8300/include/asm/swab.h10
-rw-r--r--arch/ia64/Kconfig3
-rw-r--r--arch/ia64/hp/sim/hpsim_irq.c2
-rw-r--r--arch/ia64/include/asm/Kbuild1
-rw-r--r--arch/ia64/include/asm/acpi-ext.h1
-rw-r--r--arch/ia64/include/asm/atomic.h6
-rw-r--r--arch/ia64/include/asm/byteorder.h37
-rw-r--r--arch/ia64/include/asm/irq.h2
-rw-r--r--arch/ia64/include/asm/kvm.h6
-rw-r--r--arch/ia64/include/asm/kvm_host.h198
-rw-r--r--arch/ia64/include/asm/smp.h1
-rw-r--r--arch/ia64/include/asm/sn/acpi.h2
-rw-r--r--arch/ia64/include/asm/swab.h34
-rw-r--r--arch/ia64/include/asm/swiotlb.h39
-rw-r--r--arch/ia64/include/asm/topology.h11
-rw-r--r--arch/ia64/kernel/acpi.c4
-rw-r--r--arch/ia64/kernel/iosapic.c35
-rw-r--r--arch/ia64/kernel/irq.c26
-rw-r--r--arch/ia64/kernel/kprobes.c10
-rw-r--r--arch/ia64/kernel/msi_ia64.c12
-rw-r--r--arch/ia64/kernel/pci-dma.c2
-rw-r--r--arch/ia64/kernel/smpboot.c10
-rw-r--r--arch/ia64/kernel/time.c18
-rw-r--r--arch/ia64/kernel/topology.c2
-rw-r--r--arch/ia64/kvm/Makefile6
-rw-r--r--arch/ia64/kvm/asm-offsets.c11
-rw-r--r--arch/ia64/kvm/kvm-ia64.c110
-rw-r--r--arch/ia64/kvm/kvm_lib.c15
-rw-r--r--arch/ia64/kvm/kvm_minstate.h4
-rw-r--r--arch/ia64/kvm/misc.h3
-rw-r--r--arch/ia64/kvm/mmio.c38
-rw-r--r--arch/ia64/kvm/process.c29
-rw-r--r--arch/ia64/kvm/vcpu.c76
-rw-r--r--arch/ia64/kvm/vcpu.h5
-rw-r--r--arch/ia64/kvm/vmm.c29
-rw-r--r--arch/ia64/kvm/vmm_ivt.S1469
-rw-r--r--arch/ia64/kvm/vtlb.c4
-rw-r--r--arch/ia64/mm/init.c2
-rw-r--r--arch/ia64/sn/kernel/io_acpi_init.c103
-rw-r--r--arch/ia64/sn/kernel/io_common.c5
-rw-r--r--arch/ia64/sn/kernel/irq.c6
-rw-r--r--arch/ia64/sn/kernel/msi_sn.c7
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c27
-rw-r--r--arch/ia64/sn/kernel/tiocx.c3
-rw-r--r--arch/m32r/Kconfig1
-rw-r--r--arch/m32r/kernel/smpboot.c8
-rw-r--r--arch/m68k/Kconfig3
-rw-r--r--arch/m68k/amiga/amiints.c12
-rw-r--r--arch/m68k/amiga/cia.c4
-rw-r--r--arch/m68k/amiga/config.c3
-rw-r--r--arch/m68k/apollo/config.c7
-rw-r--r--arch/m68k/atari/atakeyb.c10
-rw-r--r--arch/m68k/atari/stdma.c5
-rw-r--r--arch/m68k/atari/time.c5
-rw-r--r--arch/m68k/bvme6000/config.c1
-rw-r--r--arch/m68k/hp300/time.c3
-rw-r--r--arch/m68k/kernel/.gitignore1
-rw-r--r--arch/m68k/kernel/entry.S2
-rw-r--r--arch/m68k/kernel/setup.c11
-rw-r--r--arch/m68k/kernel/signal.c15
-rw-r--r--arch/m68k/kernel/traps.c2
-rw-r--r--arch/m68k/kernel/vmlinux-sun3.lds1
-rw-r--r--arch/m68k/mac/baboon.c3
-rw-r--r--arch/m68k/mac/config.c12
-rw-r--r--arch/m68k/mac/debug.c1
-rw-r--r--arch/m68k/mac/iop.c10
-rw-r--r--arch/m68k/mac/macints.c15
-rw-r--r--arch/m68k/mac/misc.c1
-rw-r--r--arch/m68k/mac/oss.c25
-rw-r--r--arch/m68k/mac/psc.c12
-rw-r--r--arch/m68k/mac/via.c35
-rw-r--r--arch/m68k/math-emu/fp_log.c1
-rw-r--r--arch/m68k/mm/init.c4
-rw-r--r--arch/m68k/mm/motorola.c7
-rw-r--r--arch/m68k/mvme147/config.c6
-rw-r--r--arch/m68k/mvme16x/config.c1
-rw-r--r--arch/m68k/q40/config.c3
-rw-r--r--arch/m68k/sun3/config.c8
-rw-r--r--arch/m68k/sun3/mmu_emu.c1
-rw-r--r--arch/m68k/sun3/sun3ints.c9
-rw-r--r--arch/m68k/sun3x/config.c1
-rw-r--r--arch/m68knommu/include/asm/Kbuild2
-rw-r--r--arch/m68knommu/include/asm/atomic.h2
-rw-r--r--arch/m68knommu/include/asm/bitops.h1
-rw-r--r--arch/m68knommu/include/asm/byteorder.h22
-rw-r--r--arch/m68knommu/include/asm/mmu.h1
-rw-r--r--arch/m68knommu/include/asm/swab.h24
-rw-r--r--arch/m68knommu/platform/coldfire/pit.c2
-rw-r--r--arch/mips/Kconfig71
-rw-r--r--arch/mips/Makefile40
-rw-r--r--arch/mips/alchemy/Kconfig5
-rw-r--r--arch/mips/alchemy/common/Makefile4
-rw-r--r--arch/mips/alchemy/common/au1xxx_irqmap.c205
-rw-r--r--arch/mips/alchemy/common/clocks.c65
-rw-r--r--arch/mips/alchemy/common/cputable.c52
-rw-r--r--arch/mips/alchemy/common/dbdma.c65
-rw-r--r--arch/mips/alchemy/common/irq.c745
-rw-r--r--arch/mips/alchemy/common/power.c406
-rw-r--r--arch/mips/alchemy/common/reset.c2
-rw-r--r--arch/mips/alchemy/common/setup.c71
-rw-r--r--arch/mips/alchemy/common/sleeper.S118
-rw-r--r--arch/mips/alchemy/common/time.c311
-rw-r--r--arch/mips/alchemy/db1x00/init.c62
-rw-r--r--arch/mips/alchemy/devboards/Makefile18
-rw-r--r--arch/mips/alchemy/devboards/db1x00/Makefile (renamed from arch/mips/alchemy/db1x00/Makefile)2
-rw-r--r--arch/mips/alchemy/devboards/db1x00/board_setup.c (renamed from arch/mips/alchemy/db1x00/board_setup.c)37
-rw-r--r--arch/mips/alchemy/devboards/db1x00/irqmap.c (renamed from arch/mips/alchemy/db1x00/irqmap.c)24
-rw-r--r--arch/mips/alchemy/devboards/pb1000/Makefile (renamed from arch/mips/alchemy/pb1000/Makefile)2
-rw-r--r--arch/mips/alchemy/devboards/pb1000/board_setup.c (renamed from arch/mips/alchemy/pb1000/board_setup.c)30
-rw-r--r--arch/mips/alchemy/devboards/pb1100/Makefile (renamed from arch/mips/alchemy/pb1100/Makefile)2
-rw-r--r--arch/mips/alchemy/devboards/pb1100/board_setup.c (renamed from arch/mips/alchemy/pb1100/board_setup.c)47
-rw-r--r--arch/mips/alchemy/devboards/pb1200/Makefile (renamed from arch/mips/alchemy/pb1200/Makefile)3
-rw-r--r--arch/mips/alchemy/devboards/pb1200/board_setup.c (renamed from arch/mips/alchemy/pb1200/board_setup.c)34
-rw-r--r--arch/mips/alchemy/devboards/pb1200/irqmap.c (renamed from arch/mips/alchemy/pb1200/irqmap.c)94
-rw-r--r--arch/mips/alchemy/devboards/pb1200/platform.c (renamed from arch/mips/alchemy/pb1200/platform.c)0
-rw-r--r--arch/mips/alchemy/devboards/pb1500/Makefile (renamed from arch/mips/alchemy/pb1500/Makefile)2
-rw-r--r--arch/mips/alchemy/devboards/pb1500/board_setup.c (renamed from arch/mips/alchemy/pb1500/board_setup.c)44
-rw-r--r--arch/mips/alchemy/devboards/pb1550/Makefile (renamed from arch/mips/alchemy/pb1550/Makefile)2
-rw-r--r--arch/mips/alchemy/devboards/pb1550/board_setup.c (renamed from arch/mips/alchemy/pb1550/board_setup.c)34
-rw-r--r--arch/mips/alchemy/devboards/pm.c229
-rw-r--r--arch/mips/alchemy/devboards/prom.c (renamed from arch/mips/alchemy/pb1500/init.c)26
-rw-r--r--arch/mips/alchemy/mtx-1/board_setup.c12
-rw-r--r--arch/mips/alchemy/mtx-1/init.c2
-rw-r--r--arch/mips/alchemy/mtx-1/irqmap.c18
-rw-r--r--arch/mips/alchemy/pb1000/init.c57
-rw-r--r--arch/mips/alchemy/pb1000/irqmap.c38
-rw-r--r--arch/mips/alchemy/pb1100/init.c60
-rw-r--r--arch/mips/alchemy/pb1100/irqmap.c40
-rw-r--r--arch/mips/alchemy/pb1200/init.c58
-rw-r--r--arch/mips/alchemy/pb1500/irqmap.c46
-rw-r--r--arch/mips/alchemy/pb1550/init.c58
-rw-r--r--arch/mips/alchemy/pb1550/irqmap.c43
-rw-r--r--arch/mips/alchemy/xxs1500/board_setup.c12
-rw-r--r--arch/mips/alchemy/xxs1500/init.c2
-rw-r--r--arch/mips/alchemy/xxs1500/irqmap.c31
-rw-r--r--arch/mips/cavium-octeon/Kconfig85
-rw-r--r--arch/mips/cavium-octeon/Makefile16
-rw-r--r--arch/mips/cavium-octeon/csrc-octeon.c58
-rw-r--r--arch/mips/cavium-octeon/dma-octeon.c32
-rw-r--r--arch/mips/cavium-octeon/executive/Makefile13
-rw-r--r--arch/mips/cavium-octeon/executive/cvmx-bootmem.c586
-rw-r--r--arch/mips/cavium-octeon/executive/cvmx-l2c.c734
-rw-r--r--arch/mips/cavium-octeon/executive/cvmx-sysinfo.c116
-rw-r--r--arch/mips/cavium-octeon/executive/octeon-model.c358
-rw-r--r--arch/mips/cavium-octeon/flash_setup.c84
-rw-r--r--arch/mips/cavium-octeon/octeon-irq.c497
-rw-r--r--arch/mips/cavium-octeon/octeon-memcpy.S521
-rw-r--r--arch/mips/cavium-octeon/serial.c136
-rw-r--r--arch/mips/cavium-octeon/setup.c929
-rw-r--r--arch/mips/cavium-octeon/smp.c211
-rw-r--r--arch/mips/configs/cavium-octeon_defconfig943
-rw-r--r--arch/mips/include/asm/Kbuild1
-rw-r--r--arch/mips/include/asm/atomic.h5
-rw-r--r--arch/mips/include/asm/byteorder.h52
-rw-r--r--arch/mips/include/asm/cpu-features.h3
-rw-r--r--arch/mips/include/asm/cpu.h14
-rw-r--r--arch/mips/include/asm/hazards.h4
-rw-r--r--arch/mips/include/asm/io.h14
-rw-r--r--arch/mips/include/asm/irq.h3
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1000.h89
-rw-r--r--arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h5
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h78
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h64
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/irq.h244
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/kernel-entry-init.h131
-rw-r--r--arch/mips/include/asm/mach-cavium-octeon/war.h26
-rw-r--r--arch/mips/include/asm/mach-generic/dma-coherence.h26
-rw-r--r--arch/mips/include/asm/mach-ip27/dma-coherence.h26
-rw-r--r--arch/mips/include/asm/mach-ip27/topology.h5
-rw-r--r--arch/mips/include/asm/mach-ip32/dma-coherence.h26
-rw-r--r--arch/mips/include/asm/mach-jazz/dma-coherence.h26
-rw-r--r--arch/mips/include/asm/mach-lemote/dma-coherence.h26
-rw-r--r--arch/mips/include/asm/mipsregs.h22
-rw-r--r--arch/mips/include/asm/module.h2
-rw-r--r--arch/mips/include/asm/octeon/cvmx-asm.h128
-rw-r--r--arch/mips/include/asm/octeon/cvmx-bootinfo.h262
-rw-r--r--arch/mips/include/asm/octeon/cvmx-bootmem.h288
-rw-r--r--arch/mips/include/asm/octeon/cvmx-ciu-defs.h1616
-rw-r--r--arch/mips/include/asm/octeon/cvmx-gpio-defs.h219
-rw-r--r--arch/mips/include/asm/octeon/cvmx-iob-defs.h530
-rw-r--r--arch/mips/include/asm/octeon/cvmx-ipd-defs.h877
-rw-r--r--arch/mips/include/asm/octeon/cvmx-l2c-defs.h963
-rw-r--r--arch/mips/include/asm/octeon/cvmx-l2c.h325
-rw-r--r--arch/mips/include/asm/octeon/cvmx-l2d-defs.h369
-rw-r--r--arch/mips/include/asm/octeon/cvmx-l2t-defs.h141
-rw-r--r--arch/mips/include/asm/octeon/cvmx-led-defs.h240
-rw-r--r--arch/mips/include/asm/octeon/cvmx-mio-defs.h2004
-rw-r--r--arch/mips/include/asm/octeon/cvmx-packet.h61
-rw-r--r--arch/mips/include/asm/octeon/cvmx-pow-defs.h698
-rw-r--r--arch/mips/include/asm/octeon/cvmx-spinlock.h232
-rw-r--r--arch/mips/include/asm/octeon/cvmx-sysinfo.h152
-rw-r--r--arch/mips/include/asm/octeon/cvmx.h505
-rw-r--r--arch/mips/include/asm/octeon/octeon-feature.h119
-rw-r--r--arch/mips/include/asm/octeon/octeon-model.h321
-rw-r--r--arch/mips/include/asm/octeon/octeon.h248
-rw-r--r--arch/mips/include/asm/processor.h69
-rw-r--r--arch/mips/include/asm/ptrace.h4
-rw-r--r--arch/mips/include/asm/smp.h4
-rw-r--r--arch/mips/include/asm/stackframe.h17
-rw-r--r--arch/mips/include/asm/swab.h55
-rw-r--r--arch/mips/include/asm/time.h24
-rw-r--r--arch/mips/jazz/irq.c2
-rw-r--r--arch/mips/kernel/Makefile5
-rw-r--r--arch/mips/kernel/asm-offsets.c31
-rw-r--r--arch/mips/kernel/branch.c33
-rw-r--r--arch/mips/kernel/cevt-bcm1480.c4
-rw-r--r--arch/mips/kernel/cevt-ds1287.c2
-rw-r--r--arch/mips/kernel/cevt-gt641xx.c2
-rw-r--r--arch/mips/kernel/cevt-r4k.c4
-rw-r--r--arch/mips/kernel/cevt-sb1250.c4
-rw-r--r--arch/mips/kernel/cevt-smtc.c2
-rw-r--r--arch/mips/kernel/cevt-txx9.c2
-rw-r--r--arch/mips/kernel/cpu-probe.c31
-rw-r--r--arch/mips/kernel/csrc-r4k.c2
-rw-r--r--arch/mips/kernel/genex.S4
-rw-r--r--arch/mips/kernel/i8253.c2
-rw-r--r--arch/mips/kernel/irq-gic.c6
-rw-r--r--arch/mips/kernel/irq.c1
-rw-r--r--arch/mips/kernel/octeon_switch.S506
-rw-r--r--arch/mips/kernel/ptrace32.c64
-rw-r--r--arch/mips/kernel/smp-cmp.c6
-rw-r--r--arch/mips/kernel/smp-mt.c2
-rw-r--r--arch/mips/kernel/smp.c7
-rw-r--r--arch/mips/kernel/smtc.c6
-rw-r--r--arch/mips/kernel/stacktrace.c24
-rw-r--r--arch/mips/kernel/traps.c21
-rw-r--r--arch/mips/kernel/vpe.c2
-rw-r--r--arch/mips/lib/Makefile1
-rw-r--r--arch/mips/mm/Makefile1
-rw-r--r--arch/mips/mm/c-octeon.c307
-rw-r--r--arch/mips/mm/cache.c6
-rw-r--r--arch/mips/mm/cex-oct.S70
-rw-r--r--arch/mips/mm/dma-default.c25
-rw-r--r--arch/mips/mm/tlb-r4k.c5
-rw-r--r--arch/mips/mm/tlbex.c1
-rw-r--r--arch/mips/mti-malta/malta-smtc.c6
-rw-r--r--arch/mips/nxp/pnx8550/common/time.c1
-rw-r--r--arch/mips/pci/pci-ip27.c6
-rw-r--r--arch/mips/pci/pci.c24
-rw-r--r--arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c2
-rw-r--r--arch/mips/pmc-sierra/yosemite/smp.c6
-rw-r--r--arch/mips/sgi-ip27/ip27-smp.c2
-rw-r--r--arch/mips/sgi-ip27/ip27-timer.c2
-rw-r--r--arch/mips/sibyte/bcm1480/irq.c8
-rw-r--r--arch/mips/sibyte/bcm1480/smp.c8
-rw-r--r--arch/mips/sibyte/sb1250/irq.c8
-rw-r--r--arch/mips/sibyte/sb1250/smp.c8
-rw-r--r--arch/mips/sni/time.c2
-rw-r--r--arch/parisc/Kconfig1
-rw-r--r--arch/parisc/Makefile2
-rw-r--r--arch/parisc/include/asm/Kbuild1
-rw-r--r--arch/parisc/include/asm/atomic.h11
-rw-r--r--arch/parisc/include/asm/byteorder.h77
-rw-r--r--arch/parisc/include/asm/checksum.h2
-rw-r--r--arch/parisc/include/asm/io.h12
-rw-r--r--arch/parisc/include/asm/mmu_context.h13
-rw-r--r--arch/parisc/include/asm/module.h6
-rw-r--r--arch/parisc/include/asm/processor.h4
-rw-r--r--arch/parisc/include/asm/smp.h2
-rw-r--r--arch/parisc/include/asm/swab.h66
-rw-r--r--arch/parisc/include/asm/uaccess.h2
-rw-r--r--arch/parisc/kernel/drivers.c40
-rw-r--r--arch/parisc/kernel/hpmc.S8
-rw-r--r--arch/parisc/kernel/irq.c17
-rw-r--r--arch/parisc/kernel/module.c216
-rw-r--r--arch/parisc/kernel/pdc_cons.c2
-rw-r--r--arch/parisc/kernel/perf.c4
-rw-r--r--arch/parisc/kernel/processor.c68
-rw-r--r--arch/parisc/kernel/setup.c11
-rw-r--r--arch/parisc/kernel/smp.c47
-rw-r--r--arch/parisc/kernel/time.c4
-rw-r--r--arch/parisc/kernel/topology.c4
-rw-r--r--arch/parisc/kernel/traps.c9
-rw-r--r--arch/parisc/kernel/unwind.c2
-rw-r--r--arch/parisc/lib/iomap.c2
-rw-r--r--arch/parisc/lib/memcpy.c2
-rw-r--r--arch/parisc/mm/fault.c58
-rw-r--r--arch/powerpc/Kconfig5
-rw-r--r--arch/powerpc/boot/Makefile4
-rw-r--r--arch/powerpc/boot/dts/gef_sbc610.dts15
-rw-r--r--arch/powerpc/boot/dts/mpc836x_mds.dts43
-rw-r--r--arch/powerpc/boot/dts/mpc836x_rdk.dts19
-rw-r--r--arch/powerpc/boot/dts/mpc8641_hpcn.dts56
-rw-r--r--arch/powerpc/boot/dts/sequoia.dts2
-rw-r--r--arch/powerpc/boot/install.sh14
-rw-r--r--arch/powerpc/configs/85xx/mpc8572_ds_defconfig43
-rw-r--r--arch/powerpc/configs/86xx/gef_sbc610_defconfig1
-rw-r--r--arch/powerpc/include/asm/Kbuild1
-rw-r--r--arch/powerpc/include/asm/atomic.h4
-rw-r--r--arch/powerpc/include/asm/byteorder.h83
-rw-r--r--arch/powerpc/include/asm/cell-pmu.h2
-rw-r--r--arch/powerpc/include/asm/disassemble.h80
-rw-r--r--arch/powerpc/include/asm/hugetlb.h6
-rw-r--r--arch/powerpc/include/asm/ioctls.h2
-rw-r--r--arch/powerpc/include/asm/kexec.h55
-rw-r--r--arch/powerpc/include/asm/kvm_44x.h61
-rw-r--r--arch/powerpc/include/asm/kvm_host.h116
-rw-r--r--arch/powerpc/include/asm/kvm_ppc.h83
-rw-r--r--arch/powerpc/include/asm/mmu-44x.h1
-rw-r--r--arch/powerpc/include/asm/oprofile_impl.h6
-rw-r--r--arch/powerpc/include/asm/ps3.h2
-rw-r--r--arch/powerpc/include/asm/qe.h37
-rw-r--r--arch/powerpc/include/asm/qe_ic.h21
-rw-r--r--arch/powerpc/include/asm/spu.h2
-rw-r--r--arch/powerpc/include/asm/swab.h90
-rw-r--r--arch/powerpc/include/asm/topology.h13
-rw-r--r--arch/powerpc/kernel/Makefile2
-rw-r--r--arch/powerpc/kernel/asm-offsets.c21
-rw-r--r--arch/powerpc/kernel/cacheinfo.c837
-rw-r--r--arch/powerpc/kernel/cacheinfo.h8
-rw-r--r--arch/powerpc/kernel/irq.c2
-rw-r--r--arch/powerpc/kernel/kprobes.c9
-rw-r--r--arch/powerpc/kernel/pci-common.c71
-rw-r--r--arch/powerpc/kernel/pci_64.c9
-rw-r--r--arch/powerpc/kernel/ppc_ksyms.c1
-rw-r--r--arch/powerpc/kernel/process.c1
-rw-r--r--arch/powerpc/kernel/prom.c14
-rw-r--r--arch/powerpc/kernel/prom_init.c2
-rw-r--r--arch/powerpc/kernel/prom_parse.c7
-rw-r--r--arch/powerpc/kernel/smp.c4
-rw-r--r--arch/powerpc/kernel/sysfs.c300
-rw-r--r--arch/powerpc/kernel/time.c20
-rw-r--r--arch/powerpc/kvm/44x.c228
-rw-r--r--arch/powerpc/kvm/44x_emulate.c371
-rw-r--r--arch/powerpc/kvm/44x_tlb.c463
-rw-r--r--arch/powerpc/kvm/44x_tlb.h26
-rw-r--r--arch/powerpc/kvm/Kconfig28
-rw-r--r--arch/powerpc/kvm/Makefile12
-rw-r--r--arch/powerpc/kvm/booke.c (renamed from arch/powerpc/kvm/booke_guest.c)418
-rw-r--r--arch/powerpc/kvm/booke.h60
-rw-r--r--arch/powerpc/kvm/booke_host.c83
-rw-r--r--arch/powerpc/kvm/booke_interrupts.S72
-rw-r--r--arch/powerpc/kvm/emulate.c447
-rw-r--r--arch/powerpc/kvm/powerpc.c130
-rw-r--r--arch/powerpc/kvm/timing.c239
-rw-r--r--arch/powerpc/kvm/timing.h102
-rw-r--r--arch/powerpc/mm/hugetlbpage.c7
-rw-r--r--arch/powerpc/mm/mem.c2
-rw-r--r--arch/powerpc/mm/mmu_decl.h6
-rw-r--r--arch/powerpc/mm/numa.c62
-rw-r--r--arch/powerpc/mm/pgtable_32.c3
-rw-r--r--arch/powerpc/mm/tlb_nohash.c3
-rw-r--r--arch/powerpc/oprofile/cell/pr_util.h13
-rw-r--r--arch/powerpc/oprofile/cell/spu_profiler.c58
-rw-r--r--arch/powerpc/oprofile/common.c22
-rw-r--r--arch/powerpc/oprofile/op_model_cell.c748
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_common.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc831x_rdb.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_mds.c9
-rw-r--r--arch/powerpc/platforms/83xx/mpc832x_rdb.c5
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_mds.c81
-rw-r--r--arch/powerpc/platforms/83xx/mpc836x_rdk.c6
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_mds.c1
-rw-r--r--arch/powerpc/platforms/83xx/mpc837x_rdb.c2
-rw-r--r--arch/powerpc/platforms/83xx/mpc83xx.h1
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_ds.c7
-rw-r--r--arch/powerpc/platforms/85xx/smp.c1
-rw-r--r--arch/powerpc/platforms/Kconfig11
-rw-r--r--arch/powerpc/platforms/Kconfig.cputype2
-rw-r--r--arch/powerpc/platforms/cell/beat_htab.c21
-rw-r--r--arch/powerpc/platforms/cell/beat_udbg.c4
-rw-r--r--arch/powerpc/platforms/cell/cbe_cpufreq.c2
-rw-r--r--arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c2
-rw-r--r--arch/powerpc/platforms/cell/cpufreq_spudemand.c4
-rw-r--r--arch/powerpc/platforms/cell/interrupt.c2
-rw-r--r--arch/powerpc/platforms/cell/io-workarounds.c4
-rw-r--r--arch/powerpc/platforms/cell/iommu.c4
-rw-r--r--arch/powerpc/platforms/cell/spu_priv1_mmio.c6
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c1
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/spufs.h2
-rw-r--r--arch/powerpc/platforms/iseries/Kconfig5
-rw-r--r--arch/powerpc/platforms/iseries/setup.c11
-rw-r--r--arch/powerpc/platforms/pasemi/cpufreq.c4
-rw-r--r--arch/powerpc/platforms/pasemi/dma_lib.c2
-rw-r--r--arch/powerpc/platforms/powermac/cpufreq_64.c2
-rw-r--r--arch/powerpc/platforms/powermac/pci.c2
-rw-r--r--arch/powerpc/platforms/powermac/time.c11
-rw-r--r--arch/powerpc/platforms/ps3/device-init.c37
-rw-r--r--arch/powerpc/platforms/pseries/xics.c4
-rw-r--r--arch/powerpc/sysdev/Makefile1
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c7
-rw-r--r--arch/powerpc/sysdev/fsl_soc.h5
-rw-r--r--arch/powerpc/sysdev/mpic.c4
-rw-r--r--arch/powerpc/sysdev/mpic.h2
-rw-r--r--arch/powerpc/sysdev/qe_lib/Kconfig3
-rw-r--r--arch/powerpc/sysdev/qe_lib/gpio.c195
-rw-r--r--arch/powerpc/sysdev/simple_gpio.c155
-rw-r--r--arch/powerpc/sysdev/simple_gpio.h12
-rw-r--r--arch/s390/Kconfig3
-rw-r--r--arch/s390/hypfs/inode.c1
-rw-r--r--arch/s390/include/asm/Kbuild1
-rw-r--r--arch/s390/include/asm/atomic.h7
-rw-r--r--arch/s390/include/asm/byteorder.h92
-rw-r--r--arch/s390/include/asm/chpid.h2
-rw-r--r--arch/s390/include/asm/chsc.h1
-rw-r--r--arch/s390/include/asm/cmb.h3
-rw-r--r--arch/s390/include/asm/cpu.h7
-rw-r--r--arch/s390/include/asm/cputime.h42
-rw-r--r--arch/s390/include/asm/dasd.h2
-rw-r--r--arch/s390/include/asm/kvm.h2
-rw-r--r--arch/s390/include/asm/lowcore.h49
-rw-r--r--arch/s390/include/asm/posix_types.h4
-rw-r--r--arch/s390/include/asm/ptrace.h7
-rw-r--r--arch/s390/include/asm/qeth.h1
-rw-r--r--arch/s390/include/asm/s390_rdev.h15
-rw-r--r--arch/s390/include/asm/schid.h2
-rw-r--r--arch/s390/include/asm/swab.h91
-rw-r--r--arch/s390/include/asm/system.h4
-rw-r--r--arch/s390/include/asm/thread_info.h2
-rw-r--r--arch/s390/include/asm/timer.h16
-rw-r--r--arch/s390/include/asm/topology.h2
-rw-r--r--arch/s390/include/asm/types.h6
-rw-r--r--arch/s390/include/asm/vdso.h15
-rw-r--r--arch/s390/kernel/asm-offsets.c5
-rw-r--r--arch/s390/kernel/entry.S5
-rw-r--r--arch/s390/kernel/entry.h2
-rw-r--r--arch/s390/kernel/entry64.S50
-rw-r--r--arch/s390/kernel/head64.S2
-rw-r--r--arch/s390/kernel/kprobes.c9
-rw-r--r--arch/s390/kernel/process.c43
-rw-r--r--arch/s390/kernel/s390_ext.c2
-rw-r--r--arch/s390/kernel/setup.c2
-rw-r--r--arch/s390/kernel/smp.c41
-rw-r--r--arch/s390/kernel/sys_s390.c19
-rw-r--r--arch/s390/kernel/time.c2
-rw-r--r--arch/s390/kernel/topology.c5
-rw-r--r--arch/s390/kernel/vdso.c124
-rw-r--r--arch/s390/kernel/vdso32/gettimeofday.S4
-rw-r--r--arch/s390/kernel/vdso64/clock_getres.S5
-rw-r--r--arch/s390/kernel/vdso64/clock_gettime.S39
-rw-r--r--arch/s390/kernel/vtime.c486
-rw-r--r--arch/s390/kvm/diag.c2
-rw-r--r--arch/s390/kvm/interrupt.c6
-rw-r--r--arch/s390/kvm/kvm-s390.c41
-rw-r--r--arch/s390/kvm/priv.c2
-rw-r--r--arch/s390/mm/init.c2
-rw-r--r--arch/sh/drivers/pci/ops-cayman.c9
-rw-r--r--arch/sh/drivers/pci/pci.c22
-rw-r--r--arch/sh/include/asm/Kbuild1
-rw-r--r--arch/sh/include/asm/atomic.h7
-rw-r--r--arch/sh/include/asm/byteorder.h62
-rw-r--r--arch/sh/include/asm/mmu.h1
-rw-r--r--arch/sh/include/asm/smp.h2
-rw-r--r--arch/sh/include/asm/swab.h60
-rw-r--r--arch/sh/include/asm/topology.h2
-rw-r--r--arch/sh/kernel/smp.c10
-rw-r--r--arch/sh/kernel/timers/timer-broadcast.c2
-rw-r--r--arch/sh/kernel/timers/timer-tmu.c2
-rw-r--r--arch/sh/kernel/traps_32.c1
-rw-r--r--arch/sh/mm/init.c3
-rw-r--r--arch/sparc/Kconfig57
-rw-r--r--arch/sparc/configs/sparc32_defconfig290
-rw-r--r--arch/sparc/configs/sparc64_defconfig105
-rw-r--r--arch/sparc/include/asm/Kbuild21
-rw-r--r--arch/sparc/include/asm/atomic_32.h2
-rw-r--r--arch/sparc/include/asm/atomic_64.h3
-rw-r--r--arch/sparc/include/asm/byteorder.h48
-rw-r--r--arch/sparc/include/asm/ipcbuf.h38
-rw-r--r--arch/sparc/include/asm/ipcbuf_32.h31
-rw-r--r--arch/sparc/include/asm/ipcbuf_64.h28
-rw-r--r--arch/sparc/include/asm/jsflash.h2
-rw-r--r--arch/sparc/include/asm/openprom.h277
-rw-r--r--arch/sparc/include/asm/openprom_32.h255
-rw-r--r--arch/sparc/include/asm/openprom_64.h280
-rw-r--r--arch/sparc/include/asm/oplib_32.h11
-rw-r--r--arch/sparc/include/asm/oplib_64.h10
-rw-r--r--arch/sparc/include/asm/posix_types.h157
-rw-r--r--arch/sparc/include/asm/posix_types_32.h118
-rw-r--r--arch/sparc/include/asm/posix_types_64.h122
-rw-r--r--arch/sparc/include/asm/processor_32.h2
-rw-r--r--arch/sparc/include/asm/ptrace.h448
-rw-r--r--arch/sparc/include/asm/ptrace_32.h186
-rw-r--r--arch/sparc/include/asm/ptrace_64.h356
-rw-r--r--arch/sparc/include/asm/reg.h8
-rw-r--r--arch/sparc/include/asm/reg_32.h79
-rw-r--r--arch/sparc/include/asm/reg_64.h56
-rw-r--r--arch/sparc/include/asm/sigcontext.h102
-rw-r--r--arch/sparc/include/asm/sigcontext_32.h62
-rw-r--r--arch/sparc/include/asm/sigcontext_64.h87
-rw-r--r--arch/sparc/include/asm/siginfo.h43
-rw-r--r--arch/sparc/include/asm/siginfo_32.h17
-rw-r--r--arch/sparc/include/asm/siginfo_64.h32
-rw-r--r--arch/sparc/include/asm/signal.h216
-rw-r--r--arch/sparc/include/asm/signal_32.h207
-rw-r--r--arch/sparc/include/asm/signal_64.h194
-rw-r--r--arch/sparc/include/asm/smp_32.h5
-rw-r--r--arch/sparc/include/asm/stat.h111
-rw-r--r--arch/sparc/include/asm/stat_32.h76
-rw-r--r--arch/sparc/include/asm/stat_64.h47
-rw-r--r--arch/sparc/include/asm/swab.h45
-rw-r--r--arch/sparc/include/asm/thread_info_32.h2
-rw-r--r--arch/sparc/include/asm/timer_64.h2
-rw-r--r--arch/sparc/include/asm/topology_64.h17
-rw-r--r--arch/sparc/include/asm/traps.h11
-rw-r--r--arch/sparc/include/asm/types.h2
-rw-r--r--arch/sparc/kernel/auxio_32.c3
-rw-r--r--arch/sparc/kernel/auxio_64.c2
-rw-r--r--arch/sparc/kernel/cpu.c2
-rw-r--r--arch/sparc/kernel/ds.c34
-rw-r--r--arch/sparc/kernel/idprom.c3
-rw-r--r--arch/sparc/kernel/iommu.c2
-rw-r--r--arch/sparc/kernel/ioport.c15
-rw-r--r--arch/sparc/kernel/irq_32.c3
-rw-r--r--arch/sparc/kernel/irq_64.c11
-rw-r--r--arch/sparc/kernel/kgdb_32.c12
-rw-r--r--arch/sparc/kernel/kprobes.c2
-rw-r--r--arch/sparc/kernel/ldc.c23
-rw-r--r--arch/sparc/kernel/mdesc.c14
-rw-r--r--arch/sparc/kernel/muldiv.c8
-rw-r--r--arch/sparc/kernel/of_device_64.c6
-rw-r--r--arch/sparc/kernel/pci.c3
-rw-r--r--arch/sparc/kernel/pci_common.c2
-rw-r--r--arch/sparc/kernel/pci_msi.c8
-rw-r--r--arch/sparc/kernel/pci_psycho.c5
-rw-r--r--arch/sparc/kernel/pci_schizo.c2
-rw-r--r--arch/sparc/kernel/pci_sun4v.c2
-rw-r--r--arch/sparc/kernel/pcic.c6
-rw-r--r--arch/sparc/kernel/power.c2
-rw-r--r--arch/sparc/kernel/process_32.c18
-rw-r--r--arch/sparc/kernel/process_64.c2
-rw-r--r--arch/sparc/kernel/prom_common.c14
-rw-r--r--arch/sparc/kernel/prom_irqtrans.c2
-rw-r--r--arch/sparc/kernel/psycho_common.c74
-rw-r--r--arch/sparc/kernel/sbus.c1
-rw-r--r--arch/sparc/kernel/setup_32.c3
-rw-r--r--arch/sparc/kernel/setup_64.c3
-rw-r--r--arch/sparc/kernel/signal_32.c6
-rw-r--r--arch/sparc/kernel/smp_32.c6
-rw-r--r--arch/sparc/kernel/smp_64.c8
-rw-r--r--arch/sparc/kernel/sparc_ksyms_32.c229
-rw-r--r--arch/sparc/kernel/sparc_ksyms_64.c243
-rw-r--r--arch/sparc/kernel/sun4d_smp.c4
-rw-r--r--arch/sparc/kernel/sun4m_smp.c5
-rw-r--r--arch/sparc/kernel/sys_sparc_64.c2
-rw-r--r--arch/sparc/kernel/time_32.c2
-rw-r--r--arch/sparc/kernel/time_64.c16
-rw-r--r--arch/sparc/kernel/traps_32.c5
-rw-r--r--arch/sparc/kernel/traps_64.c22
-rw-r--r--arch/sparc/kernel/unaligned_32.c12
-rw-r--r--arch/sparc/kernel/unaligned_64.c16
-rw-r--r--arch/sparc/kernel/vio.c4
-rw-r--r--arch/sparc/kernel/viohs.c6
-rw-r--r--arch/sparc/kernel/windows.c6
-rw-r--r--arch/sparc/lib/Makefile1
-rw-r--r--arch/sparc/lib/PeeCeeI.c8
-rw-r--r--arch/sparc/lib/ksyms.c196
-rw-r--r--arch/sparc/lib/user_fixup.c5
-rw-r--r--arch/sparc/mm/fault_32.c3
-rw-r--r--arch/sparc/mm/generic_32.c1
-rw-r--r--arch/sparc/mm/generic_64.c1
-rw-r--r--arch/sparc/mm/highmem.c2
-rw-r--r--arch/sparc/mm/init_32.c6
-rw-r--r--arch/sparc/mm/init_64.c52
-rw-r--r--arch/sparc/prom/init_32.c4
-rw-r--r--arch/sparc/prom/misc_32.c3
-rw-r--r--arch/sparc/prom/misc_64.c3
-rw-r--r--arch/sparc/prom/ranges.c3
-rw-r--r--arch/sparc/prom/tree_32.c17
-rw-r--r--arch/sparc/prom/tree_64.c18
-rw-r--r--arch/um/Makefile25
-rw-r--r--arch/um/include/asm/system.h14
-rw-r--r--arch/um/kernel/smp.c7
-rw-r--r--arch/um/kernel/time.c2
-rw-r--r--arch/um/kernel/trap.c24
-rw-r--r--arch/x86/Kconfig27
-rw-r--r--arch/x86/Kconfig.cpu2
-rw-r--r--arch/x86/ia32/ia32_signal.c3
-rw-r--r--arch/x86/ia32/ipc32.c1
-rw-r--r--arch/x86/ia32/sys_ia32.c2
-rw-r--r--arch/x86/include/asm/Kbuild1
-rw-r--r--arch/x86/include/asm/amd_iommu_types.h61
-rw-r--r--arch/x86/include/asm/apic.h3
-rw-r--r--arch/x86/include/asm/atomic_32.h10
-rw-r--r--arch/x86/include/asm/atomic_64.h18
-rw-r--r--arch/x86/include/asm/bigsmp/apic.h32
-rw-r--r--arch/x86/include/asm/bigsmp/ipi.h13
-rw-r--r--arch/x86/include/asm/bitops.h2
-rw-r--r--arch/x86/include/asm/byteorder.h62
-rw-r--r--arch/x86/include/asm/desc.h10
-rw-r--r--arch/x86/include/asm/efi.h1
-rw-r--r--arch/x86/include/asm/es7000/apic.h62
-rw-r--r--arch/x86/include/asm/es7000/ipi.h12
-rw-r--r--arch/x86/include/asm/es7000/mpparse.h3
-rw-r--r--arch/x86/include/asm/genapic_32.h21
-rw-r--r--arch/x86/include/asm/genapic_64.h14
-rw-r--r--arch/x86/include/asm/ipi.h23
-rw-r--r--arch/x86/include/asm/irq.h3
-rw-r--r--arch/x86/include/asm/kvm_host.h47
-rw-r--r--arch/x86/include/asm/kvm_x86_emulate.h11
-rw-r--r--arch/x86/include/asm/lguest.h2
-rw-r--r--arch/x86/include/asm/mach-default/mach_apic.h28
-rw-r--r--arch/x86/include/asm/mach-default/mach_ipi.h18
-rw-r--r--arch/x86/include/asm/mach-default/mach_mpparse.h4
-rw-r--r--arch/x86/include/asm/mach-default/mach_wakecpu.h6
-rw-r--r--arch/x86/include/asm/mach-generic/mach_apic.h1
-rw-r--r--arch/x86/include/asm/mach-generic/mach_mpparse.h5
-rw-r--r--arch/x86/include/asm/mach-generic/mach_mpspec.h4
-rw-r--r--arch/x86/include/asm/mpspec.h2
-rw-r--r--arch/x86/include/asm/mpspec_def.h102
-rw-r--r--arch/x86/include/asm/mtrr.h25
-rw-r--r--arch/x86/include/asm/numaq/apic.h16
-rw-r--r--arch/x86/include/asm/numaq/ipi.h13
-rw-r--r--arch/x86/include/asm/numaq/mpparse.h3
-rw-r--r--arch/x86/include/asm/pci.h10
-rw-r--r--arch/x86/include/asm/pci_x86.h (renamed from arch/x86/pci/pci.h)17
-rw-r--r--arch/x86/include/asm/setup.h14
-rw-r--r--arch/x86/include/asm/smp.h38
-rw-r--r--arch/x86/include/asm/summit/apic.h40
-rw-r--r--arch/x86/include/asm/summit/ipi.h9
-rw-r--r--arch/x86/include/asm/summit/mpparse.h2
-rw-r--r--arch/x86/include/asm/svm.h (renamed from arch/x86/kvm/svm.h)0
-rw-r--r--arch/x86/include/asm/swab.h61
-rw-r--r--arch/x86/include/asm/swiotlb.h38
-rw-r--r--arch/x86/include/asm/sys_ia32.h101
-rw-r--r--arch/x86/include/asm/topology.h38
-rw-r--r--arch/x86/include/asm/unwind.h13
-rw-r--r--arch/x86/include/asm/uv/uv_bau.h46
-rw-r--r--arch/x86/include/asm/virtext.h132
-rw-r--r--arch/x86/include/asm/vmx.h (renamed from arch/x86/kvm/vmx.h)27
-rw-r--r--arch/x86/kernel/acpi/boot.c48
-rw-r--r--arch/x86/kernel/acpi/cstate.c74
-rw-r--r--arch/x86/kernel/acpi/sleep.c2
-rw-r--r--arch/x86/kernel/amd_iommu.c666
-rw-r--r--arch/x86/kernel/amd_iommu_init.c19
-rw-r--r--arch/x86/kernel/apic.c57
-rw-r--r--arch/x86/kernel/apm_32.c4
-rw-r--r--arch/x86/kernel/bios_uv.c2
-rw-r--r--arch/x86/kernel/cpu/common.c28
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c173
-rw-r--r--arch/x86/kernel/cpu/cpufreq/longhaul.c2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/p4-clockmod.c14
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k7.c9
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c30
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.h2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c72
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-ich.c18
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-lib.c9
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c45
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_32.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce_amd_64.c108
-rw-r--r--arch/x86/kernel/cpu/mcheck/p5.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/p6.c2
-rw-r--r--arch/x86/kernel/cpu/mcheck/winchip.c2
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c12
-rw-r--r--arch/x86/kernel/cpu/mtrr/main.c10
-rw-r--r--arch/x86/kernel/cpu/mtrr/mtrr.h18
-rw-r--r--arch/x86/kernel/cpuid.c8
-rw-r--r--arch/x86/kernel/crash.c18
-rw-r--r--arch/x86/kernel/e820.c21
-rw-r--r--arch/x86/kernel/early-quirks.c22
-rw-r--r--arch/x86/kernel/early_printk.c2
-rw-r--r--arch/x86/kernel/genapic_flat_64.c107
-rw-r--r--arch/x86/kernel/genx2apic_cluster.c81
-rw-r--r--arch/x86/kernel/genx2apic_phys.c78
-rw-r--r--arch/x86/kernel/genx2apic_uv_x.c61
-rw-r--r--arch/x86/kernel/head64.c2
-rw-r--r--arch/x86/kernel/head_64.S2
-rw-r--r--arch/x86/kernel/hpet.c8
-rw-r--r--arch/x86/kernel/i8253.c2
-rw-r--r--arch/x86/kernel/i8259.c8
-rw-r--r--arch/x86/kernel/io_apic.c374
-rw-r--r--arch/x86/kernel/ioport.c4
-rw-r--r--arch/x86/kernel/ipi.c28
-rw-r--r--arch/x86/kernel/irq.c5
-rw-r--r--arch/x86/kernel/irq_32.c23
-rw-r--r--arch/x86/kernel/irq_64.c37
-rw-r--r--arch/x86/kernel/irqinit_32.c28
-rw-r--r--arch/x86/kernel/irqinit_64.c21
-rw-r--r--arch/x86/kernel/kprobes.c9
-rw-r--r--arch/x86/kernel/kvmclock.c10
-rw-r--r--arch/x86/kernel/ldt.c4
-rw-r--r--arch/x86/kernel/mfgpt_32.c4
-rw-r--r--arch/x86/kernel/mmconf-fam10h_64.c3
-rw-r--r--arch/x86/kernel/mpparse.c357
-rw-r--r--arch/x86/kernel/msr.c2
-rw-r--r--arch/x86/kernel/nmi.c2
-rw-r--r--arch/x86/kernel/numaq_32.c38
-rw-r--r--arch/x86/kernel/pci-dma.c2
-rw-r--r--arch/x86/kernel/pci-gart_64.c2
-rw-r--r--arch/x86/kernel/pci-swiotlb_64.c4
-rw-r--r--arch/x86/kernel/process_32.c19
-rw-r--r--arch/x86/kernel/reboot.c73
-rw-r--r--arch/x86/kernel/setup_percpu.c72
-rw-r--r--arch/x86/kernel/smp.c25
-rw-r--r--arch/x86/kernel/smpboot.c176
-rw-r--r--arch/x86/kernel/time_32.c4
-rw-r--r--arch/x86/kernel/time_64.c2
-rw-r--r--arch/x86/kernel/tlb_32.c2
-rw-r--r--arch/x86/kernel/tlb_64.c2
-rw-r--r--arch/x86/kernel/tlb_uv.c9
-rw-r--r--arch/x86/kernel/traps.c50
-rw-r--r--arch/x86/kernel/visws_quirks.c32
-rw-r--r--arch/x86/kernel/vmiclock_32.c2
-rw-r--r--arch/x86/kernel/xsave.c2
-rw-r--r--arch/x86/kvm/Makefile4
-rw-r--r--arch/x86/kvm/i8254.c19
-rw-r--r--arch/x86/kvm/i8259.c52
-rw-r--r--arch/x86/kvm/irq.h6
-rw-r--r--arch/x86/kvm/kvm_svm.h2
-rw-r--r--arch/x86/kvm/lapic.c58
-rw-r--r--arch/x86/kvm/mmu.c444
-rw-r--r--arch/x86/kvm/paging_tmpl.h44
-rw-r--r--arch/x86/kvm/svm.c48
-rw-r--r--arch/x86/kvm/vmx.c350
-rw-r--r--arch/x86/kvm/x86.c120
-rw-r--r--arch/x86/kvm/x86_emulate.c297
-rw-r--r--arch/x86/lguest/boot.c2
-rw-r--r--arch/x86/mach-default/setup.c15
-rw-r--r--arch/x86/mach-generic/bigsmp.c5
-rw-r--r--arch/x86/mach-generic/es7000.c15
-rw-r--r--arch/x86/mach-generic/numaq.c8
-rw-r--r--arch/x86/mach-generic/probe.c3
-rw-r--r--arch/x86/mach-generic/summit.c5
-rw-r--r--arch/x86/mach-voyager/voyager_smp.c16
-rw-r--r--arch/x86/mm/fault.c26
-rw-r--r--arch/x86/mm/init_32.c12
-rw-r--r--arch/x86/mm/init_64.c4
-rw-r--r--arch/x86/mm/k8topology_64.c20
-rw-r--r--arch/x86/mm/numa_32.c4
-rw-r--r--arch/x86/mm/numa_64.c4
-rw-r--r--arch/x86/mm/srat_64.c2
-rw-r--r--arch/x86/oprofile/op_model_amd.c149
-rw-r--r--arch/x86/pci/acpi.c9
-rw-r--r--arch/x86/pci/amd_bus.c2
-rw-r--r--arch/x86/pci/common.c15
-rw-r--r--arch/x86/pci/direct.c2
-rw-r--r--arch/x86/pci/early.c2
-rw-r--r--arch/x86/pci/fixup.c3
-rw-r--r--arch/x86/pci/i386.c6
-rw-r--r--arch/x86/pci/init.c5
-rw-r--r--arch/x86/pci/irq.c57
-rw-r--r--arch/x86/pci/legacy.c2
-rw-r--r--arch/x86/pci/mmconfig-shared.c3
-rw-r--r--arch/x86/pci/mmconfig_32.c2
-rw-r--r--arch/x86/pci/mmconfig_64.c3
-rw-r--r--arch/x86/pci/numaq_32.c2
-rw-r--r--arch/x86/pci/olpc.c2
-rw-r--r--arch/x86/pci/pcbios.c5
-rw-r--r--arch/x86/pci/visws.c23
-rw-r--r--arch/x86/xen/mmu.c20
-rw-r--r--arch/x86/xen/smp.c27
-rw-r--r--arch/x86/xen/suspend.c3
-rw-r--r--arch/x86/xen/time.c12
-rw-r--r--arch/x86/xen/xen-ops.h2
-rw-r--r--arch/xtensa/Makefile28
-rw-r--r--arch/xtensa/boot/boot-elf/boot.lds.S2
-rw-r--r--arch/xtensa/boot/boot-redboot/bootstrap.S2
-rw-r--r--arch/xtensa/include/asm/Kbuild3
-rw-r--r--arch/xtensa/include/asm/asmmacro.h153
-rw-r--r--arch/xtensa/include/asm/atomic.h299
-rw-r--r--arch/xtensa/include/asm/auxvec.h4
-rw-r--r--arch/xtensa/include/asm/bitops.h132
-rw-r--r--arch/xtensa/include/asm/bootparam.h61
-rw-r--r--arch/xtensa/include/asm/bug.h18
-rw-r--r--arch/xtensa/include/asm/bugs.h18
-rw-r--r--arch/xtensa/include/asm/byteorder.h14
-rw-r--r--arch/xtensa/include/asm/cache.h33
-rw-r--r--arch/xtensa/include/asm/cacheasm.h177
-rw-r--r--arch/xtensa/include/asm/cacheflush.h155
-rw-r--r--arch/xtensa/include/asm/checksum.h250
-rw-r--r--arch/xtensa/include/asm/coprocessor.h177
-rw-r--r--arch/xtensa/include/asm/cpumask.h16
-rw-r--r--arch/xtensa/include/asm/cputime.h6
-rw-r--r--arch/xtensa/include/asm/current.h38
-rw-r--r--arch/xtensa/include/asm/delay.h49
-rw-r--r--arch/xtensa/include/asm/device.h7
-rw-r--r--arch/xtensa/include/asm/div64.h16
-rw-r--r--arch/xtensa/include/asm/dma-mapping.h179
-rw-r--r--arch/xtensa/include/asm/dma.h61
-rw-r--r--arch/xtensa/include/asm/elf.h205
-rw-r--r--arch/xtensa/include/asm/emergency-restart.h6
-rw-r--r--arch/xtensa/include/asm/errno.h16
-rw-r--r--arch/xtensa/include/asm/fb.h12
-rw-r--r--arch/xtensa/include/asm/fcntl.h1
-rw-r--r--arch/xtensa/include/asm/futex.h1
-rw-r--r--arch/xtensa/include/asm/hardirq.h28
-rw-r--r--arch/xtensa/include/asm/highmem.h17
-rw-r--r--arch/xtensa/include/asm/hw_irq.h14
-rw-r--r--arch/xtensa/include/asm/io.h200
-rw-r--r--arch/xtensa/include/asm/ioctl.h1
-rw-r--r--arch/xtensa/include/asm/ioctls.h116
-rw-r--r--arch/xtensa/include/asm/ipcbuf.h37
-rw-r--r--arch/xtensa/include/asm/irq.h30
-rw-r--r--arch/xtensa/include/asm/irq_regs.h1
-rw-r--r--arch/xtensa/include/asm/kdebug.h1
-rw-r--r--arch/xtensa/include/asm/kmap_types.h31
-rw-r--r--arch/xtensa/include/asm/linkage.h16
-rw-r--r--arch/xtensa/include/asm/local.h16
-rw-r--r--arch/xtensa/include/asm/mman.h84
-rw-r--r--arch/xtensa/include/asm/mmu.h17
-rw-r--r--arch/xtensa/include/asm/mmu_context.h136
-rw-r--r--arch/xtensa/include/asm/module.h27
-rw-r--r--arch/xtensa/include/asm/msgbuf.h48
-rw-r--r--arch/xtensa/include/asm/mutex.h9
-rw-r--r--arch/xtensa/include/asm/page.h174
-rw-r--r--arch/xtensa/include/asm/param.h34
-rw-r--r--arch/xtensa/include/asm/pci-bridge.h88
-rw-r--r--arch/xtensa/include/asm/pci.h82
-rw-r--r--arch/xtensa/include/asm/percpu.h16
-rw-r--r--arch/xtensa/include/asm/pgalloc.h73
-rw-r--r--arch/xtensa/include/asm/pgtable.h416
-rw-r--r--arch/xtensa/include/asm/platform.h89
-rw-r--r--arch/xtensa/include/asm/poll.h20
-rw-r--r--arch/xtensa/include/asm/posix_types.h122
-rw-r--r--arch/xtensa/include/asm/processor.h193
-rw-r--r--arch/xtensa/include/asm/ptrace.h135
-rw-r--r--arch/xtensa/include/asm/regs.h145
-rw-r--r--arch/xtensa/include/asm/resource.h16
-rw-r--r--arch/xtensa/include/asm/rmap.h16
-rw-r--r--arch/xtensa/include/asm/rwsem.h168
-rw-r--r--arch/xtensa/include/asm/scatterlist.h39
-rw-r--r--arch/xtensa/include/asm/sections.h16
-rw-r--r--arch/xtensa/include/asm/segment.h16
-rw-r--r--arch/xtensa/include/asm/sembuf.h44
-rw-r--r--arch/xtensa/include/asm/serial.h18
-rw-r--r--arch/xtensa/include/asm/setup.h16
-rw-r--r--arch/xtensa/include/asm/shmbuf.h71
-rw-r--r--arch/xtensa/include/asm/shmparam.h21
-rw-r--r--arch/xtensa/include/asm/sigcontext.h28
-rw-r--r--arch/xtensa/include/asm/siginfo.h16
-rw-r--r--arch/xtensa/include/asm/signal.h172
-rw-r--r--arch/xtensa/include/asm/smp.h27
-rw-r--r--arch/xtensa/include/asm/socket.h68
-rw-r--r--arch/xtensa/include/asm/sockios.h31
-rw-r--r--arch/xtensa/include/asm/spinlock.h16
-rw-r--r--arch/xtensa/include/asm/stat.h59
-rw-r--r--arch/xtensa/include/asm/statfs.h17
-rw-r--r--arch/xtensa/include/asm/string.h124
-rw-r--r--arch/xtensa/include/asm/swab.h70
-rw-r--r--arch/xtensa/include/asm/syscall.h42
-rw-r--r--arch/xtensa/include/asm/system.h215
-rw-r--r--arch/xtensa/include/asm/termbits.h219
-rw-r--r--arch/xtensa/include/asm/termios.h105
-rw-r--r--arch/xtensa/include/asm/thread_info.h164
-rw-r--r--arch/xtensa/include/asm/timex.h96
-rw-r--r--arch/xtensa/include/asm/tlb.h47
-rw-r--r--arch/xtensa/include/asm/tlbflush.h191
-rw-r--r--arch/xtensa/include/asm/topology.h16
-rw-r--r--arch/xtensa/include/asm/types.h42
-rw-r--r--arch/xtensa/include/asm/uaccess.h500
-rw-r--r--arch/xtensa/include/asm/ucontext.h22
-rw-r--r--arch/xtensa/include/asm/unaligned.h29
-rw-r--r--arch/xtensa/include/asm/unistd.h735
-rw-r--r--arch/xtensa/include/asm/user.h20
-rw-r--r--arch/xtensa/include/asm/vga.h19
-rw-r--r--arch/xtensa/include/asm/xor.h16
-rw-r--r--arch/xtensa/kernel/entry.S2
-rw-r--r--arch/xtensa/kernel/vmlinux.lds.S2
-rw-r--r--arch/xtensa/lib/checksum.S2
-rw-r--r--arch/xtensa/lib/memcopy.S2
-rw-r--r--arch/xtensa/lib/memset.S2
-rw-r--r--arch/xtensa/lib/strncpy_user.S2
-rw-r--r--arch/xtensa/lib/strnlen_user.S2
-rw-r--r--arch/xtensa/lib/usercopy.S2
-rw-r--r--arch/xtensa/platforms/iss/console.c4
-rw-r--r--arch/xtensa/platforms/iss/include/platform/hardware.h29
-rw-r--r--arch/xtensa/platforms/iss/include/platform/simcall.h62
-rw-r--r--arch/xtensa/platforms/iss/io.c2
-rw-r--r--arch/xtensa/platforms/iss/network.c4
-rw-r--r--arch/xtensa/platforms/xt2000/Makefile5
-rw-r--r--arch/xtensa/platforms/xt2000/include/platform/hardware.h55
-rw-r--r--arch/xtensa/platforms/xt2000/include/platform/serial.h28
-rw-r--r--arch/xtensa/platforms/xt2000/setup.c181
-rw-r--r--arch/xtensa/variants/dc232b/include/variant/core.h424
-rw-r--r--arch/xtensa/variants/dc232b/include/variant/tie-asm.h122
-rw-r--r--arch/xtensa/variants/dc232b/include/variant/tie.h131
-rw-r--r--arch/xtensa/variants/fsf/include/variant/core.h359
-rw-r--r--arch/xtensa/variants/fsf/include/variant/tie-asm.h70
-rw-r--r--arch/xtensa/variants/fsf/include/variant/tie.h77
1319 files changed, 76150 insertions, 23201 deletions
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
index b7c8f188b313..4dad27360576 100644
--- a/arch/alpha/include/asm/Kbuild
+++ b/arch/alpha/include/asm/Kbuild
@@ -9,3 +9,4 @@ unifdef-y += console.h
9unifdef-y += fpu.h 9unifdef-y += fpu.h
10unifdef-y += sysinfo.h 10unifdef-y += sysinfo.h
11unifdef-y += compiler.h 11unifdef-y += compiler.h
12unifdef-y += swab.h
diff --git a/arch/alpha/include/asm/atomic.h b/arch/alpha/include/asm/atomic.h
index ca88e54dec93..62b363584b2b 100644
--- a/arch/alpha/include/asm/atomic.h
+++ b/arch/alpha/include/asm/atomic.h
@@ -1,6 +1,7 @@
1#ifndef _ALPHA_ATOMIC_H 1#ifndef _ALPHA_ATOMIC_H
2#define _ALPHA_ATOMIC_H 2#define _ALPHA_ATOMIC_H
3 3
4#include <linux/types.h>
4#include <asm/barrier.h> 5#include <asm/barrier.h>
5#include <asm/system.h> 6#include <asm/system.h>
6 7
@@ -13,14 +14,6 @@
13 */ 14 */
14 15
15 16
16/*
17 * Counter is volatile to make sure gcc doesn't try to be clever
18 * and move things around on us. We need to use _exactly_ the address
19 * the user gave us, not some alias that contains the same information.
20 */
21typedef struct { volatile int counter; } atomic_t;
22typedef struct { volatile long counter; } atomic64_t;
23
24#define ATOMIC_INIT(i) ( (atomic_t) { (i) } ) 17#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
25#define ATOMIC64_INIT(i) ( (atomic64_t) { (i) } ) 18#define ATOMIC64_INIT(i) ( (atomic64_t) { (i) } )
26 19
diff --git a/arch/alpha/include/asm/byteorder.h b/arch/alpha/include/asm/byteorder.h
index 58e958fc7f1b..6772f3168701 100644
--- a/arch/alpha/include/asm/byteorder.h
+++ b/arch/alpha/include/asm/byteorder.h
@@ -1,47 +1,7 @@
1#ifndef _ALPHA_BYTEORDER_H 1#ifndef _ALPHA_BYTEORDER_H
2#define _ALPHA_BYTEORDER_H 2#define _ALPHA_BYTEORDER_H
3 3
4#include <asm/types.h> 4#include <asm/swab.h>
5#include <linux/compiler.h>
6#include <asm/compiler.h>
7
8#ifdef __GNUC__
9
10static inline __attribute_const__ __u32 __arch__swab32(__u32 x)
11{
12 /*
13 * Unfortunately, we can't use the 6 instruction sequence
14 * on ev6 since the latency of the UNPKBW is 3, which is
15 * pretty hard to hide. Just in case a future implementation
16 * has a lower latency, here's the sequence (also by Mike Burrows)
17 *
18 * UNPKBW a0, v0 v0: 00AA00BB00CC00DD
19 * SLL v0, 24, a0 a0: BB00CC00DD000000
20 * BIS v0, a0, a0 a0: BBAACCBBDDCC00DD
21 * EXTWL a0, 6, v0 v0: 000000000000BBAA
22 * ZAP a0, 0xf3, a0 a0: 00000000DDCC0000
23 * ADDL a0, v0, v0 v0: ssssssssDDCCBBAA
24 */
25
26 __u64 t0, t1, t2, t3;
27
28 t0 = __kernel_inslh(x, 7); /* t0 : 0000000000AABBCC */
29 t1 = __kernel_inswl(x, 3); /* t1 : 000000CCDD000000 */
30 t1 |= t0; /* t1 : 000000CCDDAABBCC */
31 t2 = t1 >> 16; /* t2 : 0000000000CCDDAA */
32 t0 = t1 & 0xFF00FF00; /* t0 : 00000000DD00BB00 */
33 t3 = t2 & 0x00FF00FF; /* t3 : 0000000000CC00AA */
34 t1 = t0 + t3; /* t1 : ssssssssDDCCBBAA */
35
36 return t1;
37}
38
39#define __arch__swab32 __arch__swab32
40
41#endif /* __GNUC__ */
42
43#define __BYTEORDER_HAS_U64__
44
45#include <linux/byteorder/little_endian.h> 5#include <linux/byteorder/little_endian.h>
46 6
47#endif /* _ALPHA_BYTEORDER_H */ 7#endif /* _ALPHA_BYTEORDER_H */
diff --git a/arch/alpha/include/asm/smp.h b/arch/alpha/include/asm/smp.h
index 544c69af8168..547e90951cec 100644
--- a/arch/alpha/include/asm/smp.h
+++ b/arch/alpha/include/asm/smp.h
@@ -45,7 +45,6 @@ extern struct cpuinfo_alpha cpu_data[NR_CPUS];
45#define raw_smp_processor_id() (current_thread_info()->cpu) 45#define raw_smp_processor_id() (current_thread_info()->cpu)
46 46
47extern int smp_num_cpus; 47extern int smp_num_cpus;
48#define cpu_possible_map cpu_present_map
49 48
50extern void arch_send_call_function_single_ipi(int cpu); 49extern void arch_send_call_function_single_ipi(int cpu);
51extern void arch_send_call_function_ipi(cpumask_t mask); 50extern void arch_send_call_function_ipi(cpumask_t mask);
diff --git a/arch/alpha/include/asm/swab.h b/arch/alpha/include/asm/swab.h
new file mode 100644
index 000000000000..68e7089e02d5
--- /dev/null
+++ b/arch/alpha/include/asm/swab.h
@@ -0,0 +1,42 @@
1#ifndef _ALPHA_SWAB_H
2#define _ALPHA_SWAB_H
3
4#include <asm/types.h>
5#include <linux/compiler.h>
6#include <asm/compiler.h>
7
8#ifdef __GNUC__
9
10static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
11{
12 /*
13 * Unfortunately, we can't use the 6 instruction sequence
14 * on ev6 since the latency of the UNPKBW is 3, which is
15 * pretty hard to hide. Just in case a future implementation
16 * has a lower latency, here's the sequence (also by Mike Burrows)
17 *
18 * UNPKBW a0, v0 v0: 00AA00BB00CC00DD
19 * SLL v0, 24, a0 a0: BB00CC00DD000000
20 * BIS v0, a0, a0 a0: BBAACCBBDDCC00DD
21 * EXTWL a0, 6, v0 v0: 000000000000BBAA
22 * ZAP a0, 0xf3, a0 a0: 00000000DDCC0000
23 * ADDL a0, v0, v0 v0: ssssssssDDCCBBAA
24 */
25
26 __u64 t0, t1, t2, t3;
27
28 t0 = __kernel_inslh(x, 7); /* t0 : 0000000000AABBCC */
29 t1 = __kernel_inswl(x, 3); /* t1 : 000000CCDD000000 */
30 t1 |= t0; /* t1 : 000000CCDDAABBCC */
31 t2 = t1 >> 16; /* t2 : 0000000000CCDDAA */
32 t0 = t1 & 0xFF00FF00; /* t0 : 00000000DD00BB00 */
33 t3 = t2 & 0x00FF00FF; /* t3 : 0000000000CC00AA */
34 t1 = t0 + t3; /* t1 : ssssssssDDCCBBAA */
35
36 return t1;
37}
38#define __arch_swab32 __arch_swab32
39
40#endif /* __GNUC__ */
41
42#endif /* _ALPHA_SWAB_H */
diff --git a/arch/alpha/include/asm/topology.h b/arch/alpha/include/asm/topology.h
index 149532e162c4..b4f284c72ff3 100644
--- a/arch/alpha/include/asm/topology.h
+++ b/arch/alpha/include/asm/topology.h
@@ -39,7 +39,24 @@ static inline cpumask_t node_to_cpumask(int node)
39 return node_cpu_mask; 39 return node_cpu_mask;
40} 40}
41 41
42extern struct cpumask node_to_cpumask_map[];
43/* FIXME: This is dumb, recalculating every time. But simple. */
44static const struct cpumask *cpumask_of_node(int node)
45{
46 int cpu;
47
48 cpumask_clear(&node_to_cpumask_map[node]);
49
50 for_each_online_cpu(cpu) {
51 if (cpu_to_node(cpu) == node)
52 cpumask_set_cpu(cpu, node_to_cpumask_map[node]);
53 }
54
55 return &node_to_cpumask_map[node];
56}
57
42#define pcibus_to_cpumask(bus) (cpu_online_map) 58#define pcibus_to_cpumask(bus) (cpu_online_map)
59#define cpumask_of_pcibus(bus) (cpu_online_mask)
43 60
44#endif /* !CONFIG_NUMA */ 61#endif /* !CONFIG_NUMA */
45# include <asm-generic/topology.h> 62# include <asm-generic/topology.h>
diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile
index ac706c1d7ada..b4697759a123 100644
--- a/arch/alpha/kernel/Makefile
+++ b/arch/alpha/kernel/Makefile
@@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror -Wno-sign-compare
8 8
9obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \ 9obj-y := entry.o traps.o process.o init_task.o osf_sys.o irq.o \
10 irq_alpha.o signal.o setup.o ptrace.o time.o \ 10 irq_alpha.o signal.o setup.o ptrace.o time.o \
11 alpha_ksyms.o systbls.o err_common.o io.o 11 alpha_ksyms.o systbls.o err_common.o io.o binfmt_loader.o
12 12
13obj-$(CONFIG_VGA_HOSE) += console.o 13obj-$(CONFIG_VGA_HOSE) += console.o
14obj-$(CONFIG_SMP) += smp.o 14obj-$(CONFIG_SMP) += smp.o
diff --git a/arch/alpha/kernel/binfmt_loader.c b/arch/alpha/kernel/binfmt_loader.c
new file mode 100644
index 000000000000..4a0af906b00a
--- /dev/null
+++ b/arch/alpha/kernel/binfmt_loader.c
@@ -0,0 +1,51 @@
1#include <linux/init.h>
2#include <linux/fs.h>
3#include <linux/file.h>
4#include <linux/mm_types.h>
5#include <linux/binfmts.h>
6#include <linux/a.out.h>
7
8static int load_binary(struct linux_binprm *bprm, struct pt_regs *regs)
9{
10 struct exec *eh = (struct exec *)bprm->buf;
11 unsigned long loader;
12 struct file *file;
13 int retval;
14
15 if (eh->fh.f_magic != 0x183 || (eh->fh.f_flags & 0x3000) != 0x3000)
16 return -ENOEXEC;
17
18 if (bprm->loader)
19 return -ENOEXEC;
20
21 allow_write_access(bprm->file);
22 fput(bprm->file);
23 bprm->file = NULL;
24
25 loader = bprm->vma->vm_end - sizeof(void *);
26
27 file = open_exec("/sbin/loader");
28 retval = PTR_ERR(file);
29 if (IS_ERR(file))
30 return retval;
31
32 /* Remember if the application is TASO. */
33 bprm->taso = eh->ah.entry < 0x100000000UL;
34
35 bprm->file = file;
36 bprm->loader = loader;
37 retval = prepare_binprm(bprm);
38 if (retval < 0)
39 return retval;
40 return search_binary_handler(bprm,regs);
41}
42
43static struct linux_binfmt loader_format = {
44 .load_binary = load_binary,
45};
46
47static int __init init_loader_binfmt(void)
48{
49 return register_binfmt(&loader_format);
50}
51arch_initcall(init_loader_binfmt);
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c
index c626a821cdcb..703731accda6 100644
--- a/arch/alpha/kernel/irq.c
+++ b/arch/alpha/kernel/irq.c
@@ -50,12 +50,13 @@ int irq_select_affinity(unsigned int irq)
50 if (!irq_desc[irq].chip->set_affinity || irq_user_affinity[irq]) 50 if (!irq_desc[irq].chip->set_affinity || irq_user_affinity[irq])
51 return 1; 51 return 1;
52 52
53 while (!cpu_possible(cpu) || !cpu_isset(cpu, irq_default_affinity)) 53 while (!cpu_possible(cpu) ||
54 !cpumask_test_cpu(cpu, irq_default_affinity))
54 cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0); 55 cpu = (cpu < (NR_CPUS-1) ? cpu + 1 : 0);
55 last_cpu = cpu; 56 last_cpu = cpu;
56 57
57 irq_desc[irq].affinity = cpumask_of_cpu(cpu); 58 irq_desc[irq].affinity = cpumask_of_cpu(cpu);
58 irq_desc[irq].chip->set_affinity(irq, cpumask_of_cpu(cpu)); 59 irq_desc[irq].chip->set_affinity(irq, cpumask_of(cpu));
59 return 0; 60 return 0;
60} 61}
61#endif /* CONFIG_SMP */ 62#endif /* CONFIG_SMP */
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index ff8cb638472e..a3b938811400 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -320,24 +320,6 @@ pcibios_update_irq(struct pci_dev *dev, int irq)
320 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); 320 pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq);
321} 321}
322 322
323/* Most Alphas have straight-forward swizzling needs. */
324
325u8 __init
326common_swizzle(struct pci_dev *dev, u8 *pinp)
327{
328 u8 pin = *pinp;
329
330 while (dev->bus->parent) {
331 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
332 /* Move up the chain of bridges. */
333 dev = dev->bus->self;
334 }
335 *pinp = pin;
336
337 /* The slot is the slot of the last bridge. */
338 return PCI_SLOT(dev->devfn);
339}
340
341void 323void
342pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 324pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region,
343 struct resource *res) 325 struct resource *res)
diff --git a/arch/alpha/kernel/pci_impl.h b/arch/alpha/kernel/pci_impl.h
index f8b74995a002..00edd04b585e 100644
--- a/arch/alpha/kernel/pci_impl.h
+++ b/arch/alpha/kernel/pci_impl.h
@@ -106,16 +106,11 @@ struct pci_iommu_arena;
106 * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A. 106 * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A.
107 * Thus, each swizzle is ((pin-1) + (device#-4)) % 4 107 * Thus, each swizzle is ((pin-1) + (device#-4)) % 4
108 * 108 *
109 * The following code swizzles for exactly one bridge. The routine 109 * pci_swizzle_interrupt_pin() swizzles for exactly one bridge. The routine
110 * common_swizzle below handles multiple bridges. But there are a 110 * pci_common_swizzle() handles multiple bridges. But there are a
111 * couple boards that do strange things, so we define this here. 111 * couple boards that do strange things.
112 */ 112 */
113 113
114static inline u8 bridge_swizzle(u8 pin, u8 slot)
115{
116 return (((pin-1) + slot) % 4) + 1;
117}
118
119 114
120/* The following macro is used to implement the table-based irq mapping 115/* The following macro is used to implement the table-based irq mapping
121 function for all single-bus Alphas. */ 116 function for all single-bus Alphas. */
@@ -184,7 +179,7 @@ extern int pci_probe_only;
184extern unsigned long alpha_agpgart_size; 179extern unsigned long alpha_agpgart_size;
185 180
186extern void common_init_pci(void); 181extern void common_init_pci(void);
187extern u8 common_swizzle(struct pci_dev *, u8 *); 182#define common_swizzle pci_common_swizzle
188extern struct pci_controller *alloc_pci_controller(void); 183extern struct pci_controller *alloc_pci_controller(void);
189extern struct resource *alloc_resource(void); 184extern struct resource *alloc_resource(void);
190 185
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 351407e07e71..f238370c907d 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -94,6 +94,7 @@ common_shutdown_1(void *generic_ptr)
94 flags |= 0x00040000UL; /* "remain halted" */ 94 flags |= 0x00040000UL; /* "remain halted" */
95 *pflags = flags; 95 *pflags = flags;
96 cpu_clear(cpuid, cpu_present_map); 96 cpu_clear(cpuid, cpu_present_map);
97 cpu_clear(cpuid, cpu_possible_map);
97 halt(); 98 halt();
98 } 99 }
99#endif 100#endif
@@ -120,6 +121,7 @@ common_shutdown_1(void *generic_ptr)
120#ifdef CONFIG_SMP 121#ifdef CONFIG_SMP
121 /* Wait for the secondaries to halt. */ 122 /* Wait for the secondaries to halt. */
122 cpu_clear(boot_cpuid, cpu_present_map); 123 cpu_clear(boot_cpuid, cpu_present_map);
124 cpu_clear(boot_cpuid, cpu_possible_map);
123 while (cpus_weight(cpu_present_map)) 125 while (cpus_weight(cpu_present_map))
124 barrier(); 126 barrier();
125#endif 127#endif
diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c
index a449e999027c..02bee6983ce2 100644
--- a/arch/alpha/kernel/setup.c
+++ b/arch/alpha/kernel/setup.c
@@ -79,6 +79,11 @@ int alpha_l3_cacheshape;
79unsigned long alpha_verbose_mcheck = CONFIG_VERBOSE_MCHECK_ON; 79unsigned long alpha_verbose_mcheck = CONFIG_VERBOSE_MCHECK_ON;
80#endif 80#endif
81 81
82#ifdef CONFIG_NUMA
83struct cpumask node_to_cpumask_map[MAX_NUMNODES] __read_mostly;
84EXPORT_SYMBOL(node_to_cpumask_map);
85#endif
86
82/* Which processor we booted from. */ 87/* Which processor we booted from. */
83int boot_cpuid; 88int boot_cpuid;
84 89
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
index cf7da10097bb..d953e510f68d 100644
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -70,11 +70,6 @@ enum ipi_message_type {
70/* Set to a secondary's cpuid when it comes online. */ 70/* Set to a secondary's cpuid when it comes online. */
71static int smp_secondary_alive __devinitdata = 0; 71static int smp_secondary_alive __devinitdata = 0;
72 72
73/* Which cpus ids came online. */
74cpumask_t cpu_online_map;
75
76EXPORT_SYMBOL(cpu_online_map);
77
78int smp_num_probed; /* Internal processor count */ 73int smp_num_probed; /* Internal processor count */
79int smp_num_cpus = 1; /* Number that came online. */ 74int smp_num_cpus = 1; /* Number that came online. */
80EXPORT_SYMBOL(smp_num_cpus); 75EXPORT_SYMBOL(smp_num_cpus);
@@ -440,6 +435,7 @@ setup_smp(void)
440 ((char *)cpubase + i*hwrpb->processor_size); 435 ((char *)cpubase + i*hwrpb->processor_size);
441 if ((cpu->flags & 0x1cc) == 0x1cc) { 436 if ((cpu->flags & 0x1cc) == 0x1cc) {
442 smp_num_probed++; 437 smp_num_probed++;
438 cpu_set(i, cpu_possible_map);
443 cpu_set(i, cpu_present_map); 439 cpu_set(i, cpu_present_map);
444 cpu->pal_revision = boot_cpu_palrev; 440 cpu->pal_revision = boot_cpu_palrev;
445 } 441 }
@@ -473,6 +469,7 @@ smp_prepare_cpus(unsigned int max_cpus)
473 469
474 /* Nothing to do on a UP box, or when told not to. */ 470 /* Nothing to do on a UP box, or when told not to. */
475 if (smp_num_probed == 1 || max_cpus == 0) { 471 if (smp_num_probed == 1 || max_cpus == 0) {
472 cpu_possible_map = cpumask_of_cpu(boot_cpuid);
476 cpu_present_map = cpumask_of_cpu(boot_cpuid); 473 cpu_present_map = cpumask_of_cpu(boot_cpuid);
477 printk(KERN_INFO "SMP mode deactivated.\n"); 474 printk(KERN_INFO "SMP mode deactivated.\n");
478 return; 475 return;
diff --git a/arch/alpha/kernel/sys_dp264.c b/arch/alpha/kernel/sys_dp264.c
index c71b0fd7a61f..9c9d1fd4155f 100644
--- a/arch/alpha/kernel/sys_dp264.c
+++ b/arch/alpha/kernel/sys_dp264.c
@@ -177,19 +177,19 @@ cpu_set_irq_affinity(unsigned int irq, cpumask_t affinity)
177} 177}
178 178
179static void 179static void
180dp264_set_affinity(unsigned int irq, cpumask_t affinity) 180dp264_set_affinity(unsigned int irq, const struct cpumask *affinity)
181{ 181{
182 spin_lock(&dp264_irq_lock); 182 spin_lock(&dp264_irq_lock);
183 cpu_set_irq_affinity(irq, affinity); 183 cpu_set_irq_affinity(irq, *affinity);
184 tsunami_update_irq_hw(cached_irq_mask); 184 tsunami_update_irq_hw(cached_irq_mask);
185 spin_unlock(&dp264_irq_lock); 185 spin_unlock(&dp264_irq_lock);
186} 186}
187 187
188static void 188static void
189clipper_set_affinity(unsigned int irq, cpumask_t affinity) 189clipper_set_affinity(unsigned int irq, const struct cpumask *affinity)
190{ 190{
191 spin_lock(&dp264_irq_lock); 191 spin_lock(&dp264_irq_lock);
192 cpu_set_irq_affinity(irq - 16, affinity); 192 cpu_set_irq_affinity(irq - 16, *affinity);
193 tsunami_update_irq_hw(cached_irq_mask); 193 tsunami_update_irq_hw(cached_irq_mask);
194 spin_unlock(&dp264_irq_lock); 194 spin_unlock(&dp264_irq_lock);
195} 195}
@@ -481,7 +481,7 @@ monet_swizzle(struct pci_dev *dev, u8 *pinp)
481 slot = PCI_SLOT(dev->devfn); 481 slot = PCI_SLOT(dev->devfn);
482 break; 482 break;
483 } 483 }
484 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)) ; 484 pin = pci_swizzle_interrupt_pin(dev, pin);
485 485
486 /* Move up the chain of bridges. */ 486 /* Move up the chain of bridges. */
487 dev = dev->bus->self; 487 dev = dev->bus->self;
diff --git a/arch/alpha/kernel/sys_eiger.c b/arch/alpha/kernel/sys_eiger.c
index 7ef3b6fb3700..baf60f36cbd7 100644
--- a/arch/alpha/kernel/sys_eiger.c
+++ b/arch/alpha/kernel/sys_eiger.c
@@ -204,7 +204,7 @@ eiger_swizzle(struct pci_dev *dev, u8 *pinp)
204 break; 204 break;
205 } 205 }
206 /* Must be a card-based bridge. */ 206 /* Must be a card-based bridge. */
207 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); 207 pin = pci_swizzle_interrupt_pin(dev, pin);
208 208
209 /* Move up the chain of bridges. */ 209 /* Move up the chain of bridges. */
210 dev = dev->bus->self; 210 dev = dev->bus->self;
diff --git a/arch/alpha/kernel/sys_miata.c b/arch/alpha/kernel/sys_miata.c
index 910b43cd63e8..61ccd95579ec 100644
--- a/arch/alpha/kernel/sys_miata.c
+++ b/arch/alpha/kernel/sys_miata.c
@@ -219,7 +219,7 @@ miata_swizzle(struct pci_dev *dev, u8 *pinp)
219 slot = PCI_SLOT(dev->devfn) + 9; 219 slot = PCI_SLOT(dev->devfn) + 9;
220 break; 220 break;
221 } 221 }
222 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); 222 pin = pci_swizzle_interrupt_pin(dev, pin);
223 223
224 /* Move up the chain of bridges. */ 224 /* Move up the chain of bridges. */
225 dev = dev->bus->self; 225 dev = dev->bus->self;
diff --git a/arch/alpha/kernel/sys_noritake.c b/arch/alpha/kernel/sys_noritake.c
index eb2a1d63f484..538876b62449 100644
--- a/arch/alpha/kernel/sys_noritake.c
+++ b/arch/alpha/kernel/sys_noritake.c
@@ -257,7 +257,7 @@ noritake_swizzle(struct pci_dev *dev, u8 *pinp)
257 slot = PCI_SLOT(dev->devfn) + 15; 257 slot = PCI_SLOT(dev->devfn) + 15;
258 break; 258 break;
259 } 259 }
260 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)) ; 260 pin = pci_swizzle_interrupt_pin(dev, pin);
261 261
262 /* Move up the chain of bridges. */ 262 /* Move up the chain of bridges. */
263 dev = dev->bus->self; 263 dev = dev->bus->self;
diff --git a/arch/alpha/kernel/sys_ruffian.c b/arch/alpha/kernel/sys_ruffian.c
index 5b99cf3cd69c..f15a329b6011 100644
--- a/arch/alpha/kernel/sys_ruffian.c
+++ b/arch/alpha/kernel/sys_ruffian.c
@@ -160,7 +160,7 @@ ruffian_swizzle(struct pci_dev *dev, u8 *pinp)
160 slot = PCI_SLOT(dev->devfn) + 10; 160 slot = PCI_SLOT(dev->devfn) + 10;
161 break; 161 break;
162 } 162 }
163 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); 163 pin = pci_swizzle_interrupt_pin(dev, pin);
164 164
165 /* Move up the chain of bridges. */ 165 /* Move up the chain of bridges. */
166 dev = dev->bus->self; 166 dev = dev->bus->self;
diff --git a/arch/alpha/kernel/sys_sable.c b/arch/alpha/kernel/sys_sable.c
index a4555f497639..d232e42be018 100644
--- a/arch/alpha/kernel/sys_sable.c
+++ b/arch/alpha/kernel/sys_sable.c
@@ -425,7 +425,7 @@ lynx_swizzle(struct pci_dev *dev, u8 *pinp)
425 slot = PCI_SLOT(dev->devfn) + 11; 425 slot = PCI_SLOT(dev->devfn) + 11;
426 break; 426 break;
427 } 427 }
428 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)) ; 428 pin = pci_swizzle_interrupt_pin(dev, pin);
429 429
430 /* Move up the chain of bridges. */ 430 /* Move up the chain of bridges. */
431 dev = dev->bus->self; 431 dev = dev->bus->self;
diff --git a/arch/alpha/kernel/sys_titan.c b/arch/alpha/kernel/sys_titan.c
index 52c91ccc1648..27f840a4ad3d 100644
--- a/arch/alpha/kernel/sys_titan.c
+++ b/arch/alpha/kernel/sys_titan.c
@@ -158,10 +158,10 @@ titan_cpu_set_irq_affinity(unsigned int irq, cpumask_t affinity)
158} 158}
159 159
160static void 160static void
161titan_set_irq_affinity(unsigned int irq, cpumask_t affinity) 161titan_set_irq_affinity(unsigned int irq, const struct cpumask *affinity)
162{ 162{
163 spin_lock(&titan_irq_lock); 163 spin_lock(&titan_irq_lock);
164 titan_cpu_set_irq_affinity(irq - 16, affinity); 164 titan_cpu_set_irq_affinity(irq - 16, *affinity);
165 titan_update_irq_hw(titan_cached_irq_mask); 165 titan_update_irq_hw(titan_cached_irq_mask);
166 spin_unlock(&titan_irq_lock); 166 spin_unlock(&titan_irq_lock);
167} 167}
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d6ebe39934b5..dbfdf87f993f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1325,6 +1325,8 @@ source "drivers/regulator/Kconfig"
1325 1325
1326source "drivers/uio/Kconfig" 1326source "drivers/uio/Kconfig"
1327 1327
1328source "drivers/staging/Kconfig"
1329
1328endmenu 1330endmenu
1329 1331
1330source "fs/Kconfig" 1332source "fs/Kconfig"
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
index 7fc9860a97d7..c6884ba1d5ed 100644
--- a/arch/arm/common/gic.c
+++ b/arch/arm/common/gic.c
@@ -109,11 +109,11 @@ static void gic_unmask_irq(unsigned int irq)
109} 109}
110 110
111#ifdef CONFIG_SMP 111#ifdef CONFIG_SMP
112static void gic_set_cpu(unsigned int irq, cpumask_t mask_val) 112static void gic_set_cpu(unsigned int irq, const struct cpumask *mask_val)
113{ 113{
114 void __iomem *reg = gic_dist_base(irq) + GIC_DIST_TARGET + (gic_irq(irq) & ~3); 114 void __iomem *reg = gic_dist_base(irq) + GIC_DIST_TARGET + (gic_irq(irq) & ~3);
115 unsigned int shift = (irq % 4) * 8; 115 unsigned int shift = (irq % 4) * 8;
116 unsigned int cpu = first_cpu(mask_val); 116 unsigned int cpu = cpumask_first(mask_val);
117 u32 val; 117 u32 val;
118 118
119 spin_lock(&irq_controller_lock); 119 spin_lock(&irq_controller_lock);
diff --git a/arch/arm/configs/clps7500_defconfig b/arch/arm/configs/clps7500_defconfig
deleted file mode 100644
index 49e9f9d8b3d1..000000000000
--- a/arch/arm/configs/clps7500_defconfig
+++ /dev/null
@@ -1,801 +0,0 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.12-rc1-bk2
4# Sun Mar 27 17:20:48 2005
5#
6CONFIG_ARM=y
7CONFIG_MMU=y
8CONFIG_UID16=y
9CONFIG_RWSEM_GENERIC_SPINLOCK=y
10CONFIG_GENERIC_CALIBRATE_DELAY=y
11CONFIG_GENERIC_IOMAP=y
12
13#
14# Code maturity level options
15#
16CONFIG_EXPERIMENTAL=y
17CONFIG_CLEAN_COMPILE=y
18CONFIG_BROKEN_ON_SMP=y
19
20#
21# General setup
22#
23CONFIG_LOCALVERSION=""
24CONFIG_SWAP=y
25CONFIG_SYSVIPC=y
26# CONFIG_POSIX_MQUEUE is not set
27# CONFIG_BSD_PROCESS_ACCT is not set
28# CONFIG_SYSCTL is not set
29# CONFIG_AUDIT is not set
30# CONFIG_HOTPLUG is not set
31CONFIG_KOBJECT_UEVENT=y
32# CONFIG_IKCONFIG is not set
33CONFIG_EMBEDDED=y
34CONFIG_KALLSYMS=y
35# CONFIG_KALLSYMS_EXTRA_PASS is not set
36CONFIG_BASE_FULL=y
37CONFIG_FUTEX=y
38CONFIG_EPOLL=y
39CONFIG_CC_OPTIMIZE_FOR_SIZE=y
40CONFIG_SHMEM=y
41CONFIG_CC_ALIGN_FUNCTIONS=0
42CONFIG_CC_ALIGN_LABELS=0
43CONFIG_CC_ALIGN_LOOPS=0
44CONFIG_CC_ALIGN_JUMPS=0
45# CONFIG_TINY_SHMEM is not set
46CONFIG_BASE_SMALL=0
47
48#
49# Loadable module support
50#
51# CONFIG_MODULES is not set
52
53#
54# System Type
55#
56CONFIG_ARCH_CLPS7500=y
57# CONFIG_ARCH_CLPS711X is not set
58# CONFIG_ARCH_CO285 is not set
59# CONFIG_ARCH_EBSA110 is not set
60# CONFIG_ARCH_FOOTBRIDGE is not set
61# CONFIG_ARCH_INTEGRATOR is not set
62# CONFIG_ARCH_IOP3XX is not set
63# CONFIG_ARCH_IXP4XX is not set
64# CONFIG_ARCH_IXP2000 is not set
65# CONFIG_ARCH_L7200 is not set
66# CONFIG_ARCH_PXA is not set
67# CONFIG_ARCH_RPC is not set
68# CONFIG_ARCH_SA1100 is not set
69# CONFIG_ARCH_S3C2410 is not set
70# CONFIG_ARCH_SHARK is not set
71# CONFIG_ARCH_LH7A40X is not set
72# CONFIG_ARCH_OMAP is not set
73# CONFIG_ARCH_VERSATILE is not set
74# CONFIG_ARCH_IMX is not set
75# CONFIG_ARCH_H720X is not set
76
77#
78# Processor Type
79#
80CONFIG_CPU_32=y
81CONFIG_CPU_ARM710=y
82CONFIG_CPU_32v3=y
83CONFIG_CPU_CACHE_V3=y
84CONFIG_CPU_CACHE_VIVT=y
85CONFIG_CPU_COPY_V3=y
86CONFIG_CPU_TLB_V3=y
87
88#
89# Processor Features
90#
91CONFIG_TIMER_ACORN=y
92
93#
94# Bus support
95#
96CONFIG_ISA=y
97
98#
99# PCCARD (PCMCIA/CardBus) support
100#
101# CONFIG_PCCARD is not set
102
103#
104# Kernel Features
105#
106# CONFIG_PREEMPT is not set
107CONFIG_ALIGNMENT_TRAP=y
108
109#
110# Boot options
111#
112CONFIG_ZBOOT_ROM_TEXT=0x0
113CONFIG_ZBOOT_ROM_BSS=0x0
114CONFIG_CMDLINE="mem=16M root=nfs"
115# CONFIG_XIP_KERNEL is not set
116
117#
118# Floating point emulation
119#
120
121#
122# At least one emulation must be selected
123#
124# CONFIG_FPE_NWFPE is not set
125
126#
127# Userspace binary formats
128#
129CONFIG_BINFMT_ELF=y
130# CONFIG_BINFMT_AOUT is not set
131# CONFIG_BINFMT_MISC is not set
132# CONFIG_ARTHUR is not set
133
134#
135# Power management options
136#
137# CONFIG_PM is not set
138
139#
140# Device Drivers
141#
142
143#
144# Generic Driver Options
145#
146CONFIG_STANDALONE=y
147CONFIG_PREVENT_FIRMWARE_BUILD=y
148# CONFIG_FW_LOADER is not set
149
150#
151# Memory Technology Devices (MTD)
152#
153CONFIG_MTD=y
154# CONFIG_MTD_DEBUG is not set
155# CONFIG_MTD_CONCAT is not set
156# CONFIG_MTD_PARTITIONS is not set
157
158#
159# User Modules And Translation Layers
160#
161# CONFIG_MTD_CHAR is not set
162# CONFIG_MTD_BLOCK is not set
163# CONFIG_MTD_BLOCK_RO is not set
164# CONFIG_FTL is not set
165# CONFIG_NFTL is not set
166# CONFIG_INFTL is not set
167
168#
169# RAM/ROM/Flash chip drivers
170#
171# CONFIG_MTD_CFI is not set
172# CONFIG_MTD_JEDECPROBE is not set
173CONFIG_MTD_MAP_BANK_WIDTH_1=y
174CONFIG_MTD_MAP_BANK_WIDTH_2=y
175CONFIG_MTD_MAP_BANK_WIDTH_4=y
176# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
177# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
178# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
179CONFIG_MTD_CFI_I1=y
180CONFIG_MTD_CFI_I2=y
181# CONFIG_MTD_CFI_I4 is not set
182# CONFIG_MTD_CFI_I8 is not set
183# CONFIG_MTD_RAM is not set
184# CONFIG_MTD_ROM is not set
185# CONFIG_MTD_ABSENT is not set
186
187#
188# Mapping drivers for chip access
189#
190# CONFIG_MTD_COMPLEX_MAPPINGS is not set
191
192#
193# Self-contained MTD device drivers
194#
195# CONFIG_MTD_SLRAM is not set
196# CONFIG_MTD_PHRAM is not set
197# CONFIG_MTD_MTDRAM is not set
198# CONFIG_MTD_BLKMTD is not set
199# CONFIG_MTD_BLOCK2MTD is not set
200
201#
202# Disk-On-Chip Device Drivers
203#
204# CONFIG_MTD_DOC2000 is not set
205# CONFIG_MTD_DOC2001 is not set
206# CONFIG_MTD_DOC2001PLUS is not set
207
208#
209# NAND Flash Device Drivers
210#
211# CONFIG_MTD_NAND is not set
212
213#
214# Parallel port support
215#
216CONFIG_PARPORT=y
217CONFIG_PARPORT_PC=y
218CONFIG_PARPORT_PC_FIFO=y
219# CONFIG_PARPORT_PC_SUPERIO is not set
220# CONFIG_PARPORT_ARC is not set
221# CONFIG_PARPORT_GSC is not set
222CONFIG_PARPORT_1284=y
223
224#
225# Plug and Play support
226#
227# CONFIG_PNP is not set
228
229#
230# Block devices
231#
232# CONFIG_BLK_DEV_FD is not set
233# CONFIG_BLK_DEV_XD is not set
234# CONFIG_PARIDE is not set
235# CONFIG_BLK_DEV_COW_COMMON is not set
236# CONFIG_BLK_DEV_LOOP is not set
237CONFIG_BLK_DEV_NBD=y
238CONFIG_BLK_DEV_RAM=y
239CONFIG_BLK_DEV_RAM_COUNT=16
240CONFIG_BLK_DEV_RAM_SIZE=4096
241# CONFIG_BLK_DEV_INITRD is not set
242CONFIG_INITRAMFS_SOURCE=""
243# CONFIG_CDROM_PKTCDVD is not set
244
245#
246# IO Schedulers
247#
248CONFIG_IOSCHED_NOOP=y
249CONFIG_IOSCHED_AS=y
250CONFIG_IOSCHED_DEADLINE=y
251CONFIG_IOSCHED_CFQ=y
252# CONFIG_ATA_OVER_ETH is not set
253
254#
255# ATA/ATAPI/MFM/RLL support
256#
257# CONFIG_IDE is not set
258
259#
260# SCSI device support
261#
262# CONFIG_SCSI is not set
263
264#
265# Multi-device support (RAID and LVM)
266#
267# CONFIG_MD is not set
268
269#
270# Fusion MPT device support
271#
272
273#
274# IEEE 1394 (FireWire) support
275#
276
277#
278# I2O device support
279#
280
281#
282# Networking support
283#
284CONFIG_NET=y
285
286#
287# Networking options
288#
289# CONFIG_PACKET is not set
290# CONFIG_NETLINK_DEV is not set
291CONFIG_UNIX=y
292# CONFIG_NET_KEY is not set
293CONFIG_INET=y
294# CONFIG_IP_MULTICAST is not set
295# CONFIG_IP_ADVANCED_ROUTER is not set
296CONFIG_IP_PNP=y
297# CONFIG_IP_PNP_DHCP is not set
298CONFIG_IP_PNP_BOOTP=y
299# CONFIG_IP_PNP_RARP is not set
300# CONFIG_NET_IPIP is not set
301# CONFIG_NET_IPGRE is not set
302# CONFIG_ARPD is not set
303# CONFIG_SYN_COOKIES is not set
304# CONFIG_INET_AH is not set
305# CONFIG_INET_ESP is not set
306# CONFIG_INET_IPCOMP is not set
307# CONFIG_INET_TUNNEL is not set
308CONFIG_IP_TCPDIAG=y
309# CONFIG_IP_TCPDIAG_IPV6 is not set
310# CONFIG_IPV6 is not set
311# CONFIG_NETFILTER is not set
312
313#
314# SCTP Configuration (EXPERIMENTAL)
315#
316# CONFIG_IP_SCTP is not set
317# CONFIG_ATM is not set
318# CONFIG_BRIDGE is not set
319# CONFIG_VLAN_8021Q is not set
320# CONFIG_DECNET is not set
321# CONFIG_LLC2 is not set
322# CONFIG_IPX is not set
323# CONFIG_ATALK is not set
324# CONFIG_X25 is not set
325# CONFIG_LAPB is not set
326# CONFIG_NET_DIVERT is not set
327# CONFIG_ECONET is not set
328# CONFIG_WAN_ROUTER is not set
329
330#
331# QoS and/or fair queueing
332#
333# CONFIG_NET_SCHED is not set
334# CONFIG_NET_CLS_ROUTE is not set
335
336#
337# Network testing
338#
339# CONFIG_NET_PKTGEN is not set
340# CONFIG_NETPOLL is not set
341# CONFIG_NET_POLL_CONTROLLER is not set
342# CONFIG_HAMRADIO is not set
343# CONFIG_IRDA is not set
344# CONFIG_BT is not set
345CONFIG_NETDEVICES=y
346CONFIG_DUMMY=y
347# CONFIG_BONDING is not set
348# CONFIG_EQUALIZER is not set
349# CONFIG_TUN is not set
350
351#
352# ARCnet devices
353#
354# CONFIG_ARCNET is not set
355
356#
357# Ethernet (10 or 100Mbit)
358#
359CONFIG_NET_ETHERNET=y
360# CONFIG_MII is not set
361# CONFIG_NET_VENDOR_3COM is not set
362# CONFIG_LANCE is not set
363# CONFIG_NET_VENDOR_SMC is not set
364# CONFIG_SMC91X is not set
365# CONFIG_NET_VENDOR_RACAL is not set
366# CONFIG_AT1700 is not set
367# CONFIG_DEPCA is not set
368# CONFIG_HP100 is not set
369# CONFIG_NET_ISA is not set
370CONFIG_NET_PCI=y
371# CONFIG_AC3200 is not set
372# CONFIG_APRICOT is not set
373CONFIG_CS89x0=y
374# CONFIG_NET_POCKET is not set
375
376#
377# Ethernet (1000 Mbit)
378#
379
380#
381# Ethernet (10000 Mbit)
382#
383
384#
385# Token Ring devices
386#
387# CONFIG_TR is not set
388
389#
390# Wireless LAN (non-hamradio)
391#
392# CONFIG_NET_RADIO is not set
393
394#
395# Wan interfaces
396#
397# CONFIG_WAN is not set
398# CONFIG_PLIP is not set
399CONFIG_PPP=y
400# CONFIG_PPP_MULTILINK is not set
401# CONFIG_PPP_FILTER is not set
402# CONFIG_PPP_ASYNC is not set
403# CONFIG_PPP_SYNC_TTY is not set
404# CONFIG_PPP_DEFLATE is not set
405# CONFIG_PPP_BSDCOMP is not set
406# CONFIG_PPPOE is not set
407CONFIG_SLIP=y
408CONFIG_SLIP_COMPRESSED=y
409# CONFIG_SLIP_SMART is not set
410# CONFIG_SLIP_MODE_SLIP6 is not set
411# CONFIG_SHAPER is not set
412# CONFIG_NETCONSOLE is not set
413
414#
415# ISDN subsystem
416#
417# CONFIG_ISDN is not set
418
419#
420# Input device support
421#
422CONFIG_INPUT=y
423
424#
425# Userland interfaces
426#
427CONFIG_INPUT_MOUSEDEV=y
428CONFIG_INPUT_MOUSEDEV_PSAUX=y
429CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
430CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
431# CONFIG_INPUT_JOYDEV is not set
432# CONFIG_INPUT_TSDEV is not set
433# CONFIG_INPUT_EVDEV is not set
434# CONFIG_INPUT_EVBUG is not set
435
436#
437# Input Device Drivers
438#
439CONFIG_INPUT_KEYBOARD=y
440CONFIG_KEYBOARD_ATKBD=y
441# CONFIG_KEYBOARD_SUNKBD is not set
442# CONFIG_KEYBOARD_LKKBD is not set
443# CONFIG_KEYBOARD_XTKBD is not set
444# CONFIG_KEYBOARD_NEWTON is not set
445CONFIG_INPUT_MOUSE=y
446CONFIG_MOUSE_PS2=y
447# CONFIG_MOUSE_SERIAL is not set
448# CONFIG_MOUSE_INPORT is not set
449# CONFIG_MOUSE_LOGIBM is not set
450# CONFIG_MOUSE_PC110PAD is not set
451# CONFIG_MOUSE_VSXXXAA is not set
452# CONFIG_INPUT_JOYSTICK is not set
453# CONFIG_INPUT_TOUCHSCREEN is not set
454# CONFIG_INPUT_MISC is not set
455
456#
457# Hardware I/O ports
458#
459CONFIG_SERIO=y
460# CONFIG_SERIO_SERPORT is not set
461# CONFIG_SERIO_PARKBD is not set
462CONFIG_SERIO_RPCKBD=y
463CONFIG_SERIO_LIBPS2=y
464# CONFIG_SERIO_RAW is not set
465# CONFIG_GAMEPORT is not set
466CONFIG_SOUND_GAMEPORT=y
467
468#
469# Character devices
470#
471CONFIG_VT=y
472CONFIG_VT_CONSOLE=y
473CONFIG_HW_CONSOLE=y
474# CONFIG_SERIAL_NONSTANDARD is not set
475
476#
477# Serial drivers
478#
479CONFIG_SERIAL_8250=y
480CONFIG_SERIAL_8250_CONSOLE=y
481CONFIG_SERIAL_8250_NR_UARTS=4
482# CONFIG_SERIAL_8250_EXTENDED is not set
483
484#
485# Non-8250 serial port support
486#
487CONFIG_SERIAL_CORE=y
488CONFIG_SERIAL_CORE_CONSOLE=y
489CONFIG_UNIX98_PTYS=y
490CONFIG_LEGACY_PTYS=y
491CONFIG_LEGACY_PTY_COUNT=256
492CONFIG_PRINTER=y
493# CONFIG_LP_CONSOLE is not set
494# CONFIG_PPDEV is not set
495# CONFIG_TIPAR is not set
496
497#
498# IPMI
499#
500# CONFIG_IPMI_HANDLER is not set
501
502#
503# Watchdog Cards
504#
505# CONFIG_WATCHDOG is not set
506# CONFIG_NVRAM is not set
507# CONFIG_RTC is not set
508# CONFIG_DTLK is not set
509# CONFIG_R3964 is not set
510
511#
512# Ftape, the floppy tape device driver
513#
514# CONFIG_DRM is not set
515# CONFIG_RAW_DRIVER is not set
516
517#
518# TPM devices
519#
520# CONFIG_TCG_TPM is not set
521
522#
523# I2C support
524#
525CONFIG_I2C=y
526# CONFIG_I2C_CHARDEV is not set
527
528#
529# I2C Algorithms
530#
531CONFIG_I2C_ALGOBIT=y
532# CONFIG_I2C_ALGOPCF is not set
533# CONFIG_I2C_ALGOPCA is not set
534
535#
536# I2C Hardware Bus support
537#
538# CONFIG_I2C_ELEKTOR is not set
539# CONFIG_I2C_PARPORT is not set
540# CONFIG_I2C_PARPORT_LIGHT is not set
541# CONFIG_I2C_PCA_ISA is not set
542
543#
544# Hardware Sensors Chip support
545#
546# CONFIG_I2C_SENSOR is not set
547# CONFIG_SENSORS_ADM1021 is not set
548# CONFIG_SENSORS_ADM1025 is not set
549# CONFIG_SENSORS_ADM1026 is not set
550# CONFIG_SENSORS_ADM1031 is not set
551# CONFIG_SENSORS_ASB100 is not set
552# CONFIG_SENSORS_DS1621 is not set
553# CONFIG_SENSORS_FSCHER is not set
554# CONFIG_SENSORS_FSCPOS is not set
555# CONFIG_SENSORS_GL518SM is not set
556# CONFIG_SENSORS_GL520SM is not set
557# CONFIG_SENSORS_IT87 is not set
558# CONFIG_SENSORS_LM63 is not set
559# CONFIG_SENSORS_LM75 is not set
560# CONFIG_SENSORS_LM77 is not set
561# CONFIG_SENSORS_LM78 is not set
562# CONFIG_SENSORS_LM80 is not set
563# CONFIG_SENSORS_LM83 is not set
564# CONFIG_SENSORS_LM85 is not set
565# CONFIG_SENSORS_LM87 is not set
566# CONFIG_SENSORS_LM90 is not set
567# CONFIG_SENSORS_MAX1619 is not set
568# CONFIG_SENSORS_PC87360 is not set
569# CONFIG_SENSORS_SMSC47B397 is not set
570# CONFIG_SENSORS_SMSC47M1 is not set
571# CONFIG_SENSORS_W83781D is not set
572# CONFIG_SENSORS_W83L785TS is not set
573# CONFIG_SENSORS_W83627HF is not set
574
575#
576# Other I2C Chip support
577#
578# CONFIG_SENSORS_EEPROM is not set
579# CONFIG_SENSORS_PCF8574 is not set
580# CONFIG_SENSORS_PCF8591 is not set
581# CONFIG_SENSORS_RTC8564 is not set
582# CONFIG_I2C_DEBUG_CORE is not set
583# CONFIG_I2C_DEBUG_ALGO is not set
584# CONFIG_I2C_DEBUG_BUS is not set
585# CONFIG_I2C_DEBUG_CHIP is not set
586
587#
588# Misc devices
589#
590
591#
592# Multimedia devices
593#
594# CONFIG_VIDEO_DEV is not set
595
596#
597# Digital Video Broadcasting Devices
598#
599# CONFIG_DVB is not set
600
601#
602# Graphics support
603#
604CONFIG_FB=y
605CONFIG_FB_CFB_FILLRECT=y
606CONFIG_FB_CFB_COPYAREA=y
607CONFIG_FB_CFB_IMAGEBLIT=y
608CONFIG_FB_SOFT_CURSOR=y
609# CONFIG_FB_MODE_HELPERS is not set
610# CONFIG_FB_TILEBLITTING is not set
611CONFIG_FB_ACORN=y
612# CONFIG_FB_VIRTUAL is not set
613
614#
615# Console display driver support
616#
617# CONFIG_VGA_CONSOLE is not set
618# CONFIG_MDA_CONSOLE is not set
619CONFIG_DUMMY_CONSOLE=y
620CONFIG_FRAMEBUFFER_CONSOLE=y
621CONFIG_FONTS=y
622CONFIG_FONT_8x8=y
623CONFIG_FONT_8x16=y
624# CONFIG_FONT_6x11 is not set
625# CONFIG_FONT_PEARL_8x8 is not set
626# CONFIG_FONT_ACORN_8x8 is not set
627# CONFIG_FONT_MINI_4x6 is not set
628# CONFIG_FONT_SUN8x16 is not set
629# CONFIG_FONT_SUN12x22 is not set
630
631#
632# Logo configuration
633#
634CONFIG_LOGO=y
635CONFIG_LOGO_LINUX_MONO=y
636CONFIG_LOGO_LINUX_VGA16=y
637CONFIG_LOGO_LINUX_CLUT224=y
638# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
639
640#
641# Sound
642#
643# CONFIG_SOUND is not set
644
645#
646# USB support
647#
648CONFIG_USB_ARCH_HAS_HCD=y
649# CONFIG_USB_ARCH_HAS_OHCI is not set
650# CONFIG_USB is not set
651
652#
653# USB Gadget Support
654#
655# CONFIG_USB_GADGET is not set
656
657#
658# MMC/SD Card support
659#
660# CONFIG_MMC is not set
661
662#
663# File systems
664#
665CONFIG_EXT2_FS=y
666# CONFIG_EXT2_FS_XATTR is not set
667# CONFIG_EXT3_FS is not set
668# CONFIG_JBD is not set
669# CONFIG_REISERFS_FS is not set
670# CONFIG_JFS_FS is not set
671
672#
673# XFS support
674#
675# CONFIG_XFS_FS is not set
676CONFIG_MINIX_FS=y
677# CONFIG_ROMFS_FS is not set
678# CONFIG_QUOTA is not set
679CONFIG_DNOTIFY=y
680# CONFIG_AUTOFS_FS is not set
681# CONFIG_AUTOFS4_FS is not set
682
683#
684# CD-ROM/DVD Filesystems
685#
686# CONFIG_ISO9660_FS is not set
687# CONFIG_UDF_FS is not set
688
689#
690# DOS/FAT/NT Filesystems
691#
692# CONFIG_MSDOS_FS is not set
693# CONFIG_VFAT_FS is not set
694# CONFIG_NTFS_FS is not set
695
696#
697# Pseudo filesystems
698#
699CONFIG_PROC_FS=y
700CONFIG_SYSFS=y
701# CONFIG_DEVFS_FS is not set
702# CONFIG_DEVPTS_FS_XATTR is not set
703# CONFIG_TMPFS is not set
704# CONFIG_HUGETLB_PAGE is not set
705CONFIG_RAMFS=y
706
707#
708# Miscellaneous filesystems
709#
710# CONFIG_ADFS_FS is not set
711# CONFIG_AFFS_FS is not set
712# CONFIG_HFS_FS is not set
713# CONFIG_HFSPLUS_FS is not set
714# CONFIG_BEFS_FS is not set
715# CONFIG_BFS_FS is not set
716# CONFIG_EFS_FS is not set
717# CONFIG_JFFS_FS is not set
718# CONFIG_JFFS2_FS is not set
719# CONFIG_CRAMFS is not set
720# CONFIG_VXFS_FS is not set
721# CONFIG_HPFS_FS is not set
722# CONFIG_QNX4FS_FS is not set
723# CONFIG_SYSV_FS is not set
724# CONFIG_UFS_FS is not set
725
726#
727# Network File Systems
728#
729CONFIG_NFS_FS=y
730# CONFIG_NFS_V3 is not set
731# CONFIG_NFS_V4 is not set
732# CONFIG_NFS_DIRECTIO is not set
733# CONFIG_NFSD is not set
734CONFIG_ROOT_NFS=y
735CONFIG_LOCKD=y
736CONFIG_SUNRPC=y
737# CONFIG_RPCSEC_GSS_KRB5 is not set
738# CONFIG_RPCSEC_GSS_SPKM3 is not set
739# CONFIG_SMB_FS is not set
740# CONFIG_CIFS is not set
741# CONFIG_NCP_FS is not set
742# CONFIG_CODA_FS is not set
743# CONFIG_AFS_FS is not set
744
745#
746# Partition Types
747#
748CONFIG_PARTITION_ADVANCED=y
749# CONFIG_ACORN_PARTITION is not set
750# CONFIG_OSF_PARTITION is not set
751# CONFIG_AMIGA_PARTITION is not set
752# CONFIG_ATARI_PARTITION is not set
753# CONFIG_MAC_PARTITION is not set
754# CONFIG_MSDOS_PARTITION is not set
755# CONFIG_LDM_PARTITION is not set
756# CONFIG_SGI_PARTITION is not set
757# CONFIG_ULTRIX_PARTITION is not set
758# CONFIG_SUN_PARTITION is not set
759# CONFIG_EFI_PARTITION is not set
760
761#
762# Native Language Support
763#
764# CONFIG_NLS is not set
765
766#
767# Profiling support
768#
769# CONFIG_PROFILING is not set
770
771#
772# Kernel hacking
773#
774# CONFIG_PRINTK_TIME is not set
775# CONFIG_DEBUG_KERNEL is not set
776CONFIG_LOG_BUF_SHIFT=14
777# CONFIG_DEBUG_BUGVERBOSE is not set
778CONFIG_FRAME_POINTER=y
779# CONFIG_DEBUG_USER is not set
780
781#
782# Security options
783#
784# CONFIG_KEYS is not set
785# CONFIG_SECURITY is not set
786
787#
788# Cryptographic options
789#
790# CONFIG_CRYPTO is not set
791
792#
793# Hardware crypto devices
794#
795
796#
797# Library routines
798#
799# CONFIG_CRC_CCITT is not set
800CONFIG_CRC32=y
801# CONFIG_LIBCRC32C is not set
diff --git a/arch/arm/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 73237bd130a2..43b0b2ba392f 100644
--- a/arch/arm/include/asm/Kbuild
+++ b/arch/arm/include/asm/Kbuild
@@ -1,3 +1,4 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3unifdef-y += hwcap.h 3unifdef-y += hwcap.h
4unifdef-y += swab.h
diff --git a/arch/arm/include/asm/atomic.h b/arch/arm/include/asm/atomic.h
index 325f881ccb50..ee99723b3a6c 100644
--- a/arch/arm/include/asm/atomic.h
+++ b/arch/arm/include/asm/atomic.h
@@ -12,10 +12,9 @@
12#define __ASM_ARM_ATOMIC_H 12#define __ASM_ARM_ATOMIC_H
13 13
14#include <linux/compiler.h> 14#include <linux/compiler.h>
15#include <linux/types.h>
15#include <asm/system.h> 16#include <asm/system.h>
16 17
17typedef struct { volatile int counter; } atomic_t;
18
19#define ATOMIC_INIT(i) { (i) } 18#define ATOMIC_INIT(i) { (i) }
20 19
21#ifdef __KERNEL__ 20#ifdef __KERNEL__
diff --git a/arch/arm/include/asm/byteorder.h b/arch/arm/include/asm/byteorder.h
index 4fbfb22f65a0..c02b6fc28e1a 100644
--- a/arch/arm/include/asm/byteorder.h
+++ b/arch/arm/include/asm/byteorder.h
@@ -15,38 +15,7 @@
15#ifndef __ASM_ARM_BYTEORDER_H 15#ifndef __ASM_ARM_BYTEORDER_H
16#define __ASM_ARM_BYTEORDER_H 16#define __ASM_ARM_BYTEORDER_H
17 17
18#include <linux/compiler.h> 18#include <asm/swab.h>
19#include <asm/types.h>
20
21static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
22{
23 __u32 t;
24
25#ifndef __thumb__
26 if (!__builtin_constant_p(x)) {
27 /*
28 * The compiler needs a bit of a hint here to always do the
29 * right thing and not screw it up to different degrees
30 * depending on the gcc version.
31 */
32 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
33 } else
34#endif
35 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
36
37 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
38 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
39 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
40
41 return x;
42}
43
44#define __arch__swab32(x) ___arch__swab32(x)
45
46#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
47# define __BYTEORDER_HAS_U64__
48# define __SWAB_64_THRU_32__
49#endif
50 19
51#ifdef __ARMEB__ 20#ifdef __ARMEB__
52#include <linux/byteorder/big_endian.h> 21#include <linux/byteorder/big_endian.h>
diff --git a/arch/arm/include/asm/mach/pci.h b/arch/arm/include/asm/mach/pci.h
index 32da1ae17e06..a38bdc7afa34 100644
--- a/arch/arm/include/asm/mach/pci.h
+++ b/arch/arm/include/asm/mach/pci.h
@@ -42,7 +42,7 @@ struct pci_sys_data {
42/* 42/*
43 * This is the standard PCI-PCI bridge swizzling algorithm. 43 * This is the standard PCI-PCI bridge swizzling algorithm.
44 */ 44 */
45u8 pci_std_swizzle(struct pci_dev *dev, u8 *pinp); 45#define pci_std_swizzle pci_common_swizzle
46 46
47/* 47/*
48 * Call this with your hw_pci struct to initialise the PCI system. 48 * Call this with your hw_pci struct to initialise the PCI system.
diff --git a/arch/arm/include/asm/mmu.h b/arch/arm/include/asm/mmu.h
index 53099d4ee421..b561584d04a1 100644
--- a/arch/arm/include/asm/mmu.h
+++ b/arch/arm/include/asm/mmu.h
@@ -24,7 +24,6 @@ typedef struct {
24 * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com> 24 * modified for 2.6 by Hyok S. Choi <hyok.choi@samsung.com>
25 */ 25 */
26typedef struct { 26typedef struct {
27 struct vm_list_struct *vmlist;
28 unsigned long end_brk; 27 unsigned long end_brk;
29} mm_context_t; 28} mm_context_t;
30 29
diff --git a/arch/arm/include/asm/swab.h b/arch/arm/include/asm/swab.h
new file mode 100644
index 000000000000..27a689be0856
--- /dev/null
+++ b/arch/arm/include/asm/swab.h
@@ -0,0 +1,50 @@
1/*
2 * arch/arm/include/asm/byteorder.h
3 *
4 * ARM Endian-ness. In little endian mode, the data bus is connected such
5 * that byte accesses appear as:
6 * 0 = d0...d7, 1 = d8...d15, 2 = d16...d23, 3 = d24...d31
7 * and word accesses (data or instruction) appear as:
8 * d0...d31
9 *
10 * When in big endian mode, byte accesses appear as:
11 * 0 = d24...d31, 1 = d16...d23, 2 = d8...d15, 3 = d0...d7
12 * and word accesses (data or instruction) appear as:
13 * d0...d31
14 */
15#ifndef __ASM_ARM_SWAB_H
16#define __ASM_ARM_SWAB_H
17
18#include <linux/compiler.h>
19#include <asm/types.h>
20
21#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
22# define __SWAB_64_THRU_32__
23#endif
24
25static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
26{
27 __u32 t;
28
29#ifndef __thumb__
30 if (!__builtin_constant_p(x)) {
31 /*
32 * The compiler needs a bit of a hint here to always do the
33 * right thing and not screw it up to different degrees
34 * depending on the gcc version.
35 */
36 asm ("eor\t%0, %1, %1, ror #16" : "=r" (t) : "r" (x));
37 } else
38#endif
39 t = x ^ ((x << 16) | (x >> 16)); /* eor r1,r0,r0,ror #16 */
40
41 x = (x << 24) | (x >> 8); /* mov r0,r0,ror #8 */
42 t &= ~0x00FF0000; /* bic r1,r1,#0x00FF0000 */
43 x ^= (t >> 8); /* eor r0,r0,r1,lsr #8 */
44
45 return x;
46}
47#define __arch_swab32 __arch_swab32
48
49#endif
50
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c
index 17a59b6e521f..809681900ec8 100644
--- a/arch/arm/kernel/bios32.c
+++ b/arch/arm/kernel/bios32.c
@@ -480,33 +480,6 @@ EXPORT_SYMBOL(pcibios_bus_to_resource);
480#endif 480#endif
481 481
482/* 482/*
483 * This is the standard PCI-PCI bridge swizzling algorithm:
484 *
485 * Dev: 0 1 2 3
486 * A A B C D
487 * B B C D A
488 * C C D A B
489 * D D A B C
490 * ^^^^^^^^^^ irq pin on bridge
491 */
492u8 __devinit pci_std_swizzle(struct pci_dev *dev, u8 *pinp)
493{
494 int pin = *pinp - 1;
495
496 while (dev->bus->self) {
497 pin = (pin + PCI_SLOT(dev->devfn)) & 3;
498 /*
499 * move up the chain of bridges,
500 * swizzling as we go.
501 */
502 dev = dev->bus->self;
503 }
504 *pinp = pin + 1;
505
506 return PCI_SLOT(dev->devfn);
507}
508
509/*
510 * Swizzle the device pin each time we cross a bridge. 483 * Swizzle the device pin each time we cross a bridge.
511 * This might update pin and returns the slot number. 484 * This might update pin and returns the slot number.
512 */ 485 */
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index 60c079d85355..eed2f795e1b3 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -817,7 +817,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
817 ec->dma = NO_DMA; 817 ec->dma = NO_DMA;
818 ec->ops = &ecard_default_ops; 818 ec->ops = &ecard_default_ops;
819 819
820 snprintf(ec->dev.bus_id, sizeof(ec->dev.bus_id), "ecard%d", slot); 820 dev_set_name(&ec->dev, "ecard%d", slot);
821 ec->dev.parent = NULL; 821 ec->dev.parent = NULL;
822 ec->dev.bus = &ecard_bus_type; 822 ec->dev.bus = &ecard_bus_type;
823 ec->dev.dma_mask = &ec->dma_mask; 823 ec->dev.dma_mask = &ec->dma_mask;
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 2f3eb795fa6e..7141cee1fab7 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -174,7 +174,7 @@ static void route_irq(struct irq_desc *desc, unsigned int irq, unsigned int cpu)
174 pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->cpu, cpu); 174 pr_debug("IRQ%u: moving from cpu%u to cpu%u\n", irq, desc->cpu, cpu);
175 175
176 spin_lock_irq(&desc->lock); 176 spin_lock_irq(&desc->lock);
177 desc->chip->set_affinity(irq, cpumask_of_cpu(cpu)); 177 desc->chip->set_affinity(irq, cpumask_of(cpu));
178 spin_unlock_irq(&desc->lock); 178 spin_unlock_irq(&desc->lock);
179} 179}
180 180
diff --git a/arch/arm/kernel/isa.c b/arch/arm/kernel/isa.c
index 50a30bc91872..8ac9b8424007 100644
--- a/arch/arm/kernel/isa.c
+++ b/arch/arm/kernel/isa.c
@@ -16,6 +16,7 @@
16#include <linux/fs.h> 16#include <linux/fs.h>
17#include <linux/sysctl.h> 17#include <linux/sysctl.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/io.h>
19 20
20static unsigned int isa_membase, isa_portbase, isa_portshift; 21static unsigned int isa_membase, isa_portbase, isa_portshift;
21 22
diff --git a/arch/arm/kernel/kprobes.c b/arch/arm/kernel/kprobes.c
index 3f9abe0e9aff..f692efddd449 100644
--- a/arch/arm/kernel/kprobes.c
+++ b/arch/arm/kernel/kprobes.c
@@ -92,9 +92,7 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
92void __kprobes arch_remove_kprobe(struct kprobe *p) 92void __kprobes arch_remove_kprobe(struct kprobe *p)
93{ 93{
94 if (p->ainsn.insn) { 94 if (p->ainsn.insn) {
95 mutex_lock(&kprobe_mutex);
96 free_insn_slot(p->ainsn.insn, 0); 95 free_insn_slot(p->ainsn.insn, 0);
97 mutex_unlock(&kprobe_mutex);
98 p->ainsn.insn = NULL; 96 p->ainsn.insn = NULL;
99 } 97 }
100} 98}
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 019237d21622..55fa7ff96a3e 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -34,16 +34,6 @@
34#include <asm/ptrace.h> 34#include <asm/ptrace.h>
35 35
36/* 36/*
37 * bitmask of present and online CPUs.
38 * The present bitmask indicates that the CPU is physically present.
39 * The online bitmask indicates that the CPU is up and running.
40 */
41cpumask_t cpu_possible_map;
42EXPORT_SYMBOL(cpu_possible_map);
43cpumask_t cpu_online_map;
44EXPORT_SYMBOL(cpu_online_map);
45
46/*
47 * as from 2.5, kernels no longer have an init_tasks structure 37 * as from 2.5, kernels no longer have an init_tasks structure
48 * so we need some other way of telling a new secondary core 38 * so we need some other way of telling a new secondary core
49 * where to place its SVC stack 39 * where to place its SVC stack
diff --git a/arch/arm/mach-aaec2000/core.c b/arch/arm/mach-aaec2000/core.c
index 50e13965dfed..b5c5fc6ba3a9 100644
--- a/arch/arm/mach-aaec2000/core.c
+++ b/arch/arm/mach-aaec2000/core.c
@@ -212,7 +212,7 @@ static struct clcd_board clcd_plat_data = {
212 212
213static struct amba_device clcd_device = { 213static struct amba_device clcd_device = {
214 .dev = { 214 .dev = {
215 .bus_id = "mb:16", 215 .init_name = "mb:16",
216 .coherent_dma_mask = ~0, 216 .coherent_dma_mask = ~0,
217 .platform_data = &clcd_plat_data, 217 .platform_data = &clcd_plat_data,
218 }, 218 },
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
index 0a38c69fdbc4..73376170fb91 100644
--- a/arch/arm/mach-at91/at91cap9.c
+++ b/arch/arm/mach-at91/at91cap9.c
@@ -15,6 +15,7 @@
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/pm.h> 16#include <linux/pm.h>
17 17
18#include <asm/irq.h>
18#include <asm/mach/arch.h> 19#include <asm/mach/arch.h>
19#include <asm/mach/map.h> 20#include <asm/mach/map.h>
20 21
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 28594fcc88e3..2e9ecad97f3d 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -12,6 +12,7 @@
12 12
13#include <linux/module.h> 13#include <linux/module.h>
14 14
15#include <asm/irq.h>
15#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
16#include <asm/mach/map.h> 17#include <asm/mach/map.h>
17#include <mach/at91rm9200.h> 18#include <mach/at91rm9200.h>
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index d140eae53ded..1ff1bda0a894 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -178,7 +178,6 @@ static struct clock_event_device clkevt = {
178 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 178 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
179 .shift = 32, 179 .shift = 32,
180 .rating = 150, 180 .rating = 150,
181 .cpumask = CPU_MASK_CPU0,
182 .set_next_event = clkevt32k_next_event, 181 .set_next_event = clkevt32k_next_event,
183 .set_mode = clkevt32k_mode, 182 .set_mode = clkevt32k_mode,
184}; 183};
@@ -206,7 +205,7 @@ void __init at91rm9200_timer_init(void)
206 clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift); 205 clkevt.mult = div_sc(AT91_SLOW_CLOCK, NSEC_PER_SEC, clkevt.shift);
207 clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt); 206 clkevt.max_delta_ns = clockevent_delta2ns(AT91_ST_ALMV, &clkevt);
208 clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1; 207 clkevt.min_delta_ns = clockevent_delta2ns(2, &clkevt) + 1;
209 clkevt.cpumask = cpumask_of_cpu(0); 208 clkevt.cpumask = cpumask_of(0);
210 clockevents_register_device(&clkevt); 209 clockevents_register_device(&clkevt);
211 210
212 /* register clocksource */ 211 /* register clocksource */
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index accb69ec478e..0894f1077be7 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/pm.h> 14#include <linux/pm.h>
15 15
16#include <asm/irq.h>
16#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
17#include <asm/mach/map.h> 18#include <asm/mach/map.h>
18#include <mach/cpu.h> 19#include <mach/cpu.h>
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 7b51a59ae8b3..3acd7d7e6a42 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/pm.h> 14#include <linux/pm.h>
15 15
16#include <asm/irq.h>
16#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
17#include <asm/mach/map.h> 18#include <asm/mach/map.h>
18#include <mach/at91sam9261.h> 19#include <mach/at91sam9261.h>
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index ada4b6769107..942792d630d8 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/pm.h> 14#include <linux/pm.h>
15 15
16#include <asm/irq.h>
16#include <asm/mach/arch.h> 17#include <asm/mach/arch.h>
17#include <asm/mach/map.h> 18#include <asm/mach/map.h>
18#include <mach/at91sam9263.h> 19#include <mach/at91sam9263.h>
diff --git a/arch/arm/mach-at91/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
index 122fd77ed580..b63e1d5f1bad 100644
--- a/arch/arm/mach-at91/at91sam926x_time.c
+++ b/arch/arm/mach-at91/at91sam926x_time.c
@@ -91,7 +91,6 @@ static struct clock_event_device pit_clkevt = {
91 .features = CLOCK_EVT_FEAT_PERIODIC, 91 .features = CLOCK_EVT_FEAT_PERIODIC,
92 .shift = 32, 92 .shift = 32,
93 .rating = 100, 93 .rating = 100,
94 .cpumask = CPU_MASK_CPU0,
95 .set_mode = pit_clkevt_mode, 94 .set_mode = pit_clkevt_mode,
96}; 95};
97 96
@@ -173,6 +172,7 @@ static void __init at91sam926x_pit_init(void)
173 172
174 /* Set up and register clockevents */ 173 /* Set up and register clockevents */
175 pit_clkevt.mult = div_sc(pit_rate, NSEC_PER_SEC, pit_clkevt.shift); 174 pit_clkevt.mult = div_sc(pit_rate, NSEC_PER_SEC, pit_clkevt.shift);
175 pit_clkevt.cpumask = cpumask_of(0);
176 clockevents_register_device(&pit_clkevt); 176 clockevents_register_device(&pit_clkevt);
177} 177}
178 178
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index 252e954b49fd..211c5c14a1e6 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -12,6 +12,7 @@
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/pm.h> 13#include <linux/pm.h>
14 14
15#include <asm/irq.h>
15#include <asm/mach/arch.h> 16#include <asm/mach/arch.h>
16#include <asm/mach/map.h> 17#include <asm/mach/map.h>
17#include <mach/cpu.h> 18#include <mach/cpu.h>
diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
index 9b937ee4815a..35e12a49d1a6 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -29,6 +29,7 @@
29#include <mach/hardware.h> 29#include <mach/hardware.h>
30#include <mach/board.h> 30#include <mach/board.h>
31#include <mach/gpio.h> 31#include <mach/gpio.h>
32#include <mach/at91sam9_smc.h>
32#include <mach/at91_shdwc.h> 33#include <mach/at91_shdwc.h>
33 34
34#include "sam9_smc.h" 35#include "sam9_smc.h"
diff --git a/arch/arm/mach-clps711x/edb7211-mm.c b/arch/arm/mach-clps711x/edb7211-mm.c
index c58e32ec4c5d..0bea1454ae03 100644
--- a/arch/arm/mach-clps711x/edb7211-mm.c
+++ b/arch/arm/mach-clps711x/edb7211-mm.c
@@ -24,7 +24,6 @@
24 24
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26#include <asm/page.h> 26#include <asm/page.h>
27#include <asm/pgtable.h>
28#include <asm/sizes.h> 27#include <asm/sizes.h>
29 28
30#include <asm/mach/map.h> 29#include <asm/mach/map.h>
diff --git a/arch/arm/mach-clps711x/fortunet.c b/arch/arm/mach-clps711x/fortunet.c
index 7122b3d21043..7430e4049d87 100644
--- a/arch/arm/mach-clps711x/fortunet.c
+++ b/arch/arm/mach-clps711x/fortunet.c
@@ -24,7 +24,6 @@
24#include <linux/initrd.h> 24#include <linux/initrd.h>
25 25
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <asm/irq.h>
28#include <asm/setup.h> 27#include <asm/setup.h>
29#include <asm/mach-types.h> 28#include <asm/mach-types.h>
30 29
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 3d4b1de8f898..808633f9f03c 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -20,6 +20,7 @@
20 20
21#include <mach/hardware.h> 21#include <mach/hardware.h>
22#include <mach/i2c.h> 22#include <mach/i2c.h>
23#include <mach/irqs.h>
23 24
24static struct resource i2c_resources[] = { 25static struct resource i2c_resources[] = {
25 { 26 {
diff --git a/arch/arm/mach-davinci/include/mach/gpio.h b/arch/arm/mach-davinci/include/mach/gpio.h
index b3a2961f0f46..b456f079f43f 100644
--- a/arch/arm/mach-davinci/include/mach/gpio.h
+++ b/arch/arm/mach-davinci/include/mach/gpio.h
@@ -16,6 +16,7 @@
16#include <linux/io.h> 16#include <linux/io.h>
17#include <asm-generic/gpio.h> 17#include <asm-generic/gpio.h>
18#include <mach/hardware.h> 18#include <mach/hardware.h>
19#include <mach/irqs.h>
19 20
20/* 21/*
21 * basic gpio routines 22 * basic gpio routines
diff --git a/arch/arm/mach-davinci/time.c b/arch/arm/mach-davinci/time.c
index 3b9a296b5c4b..f8bcd29d17a6 100644
--- a/arch/arm/mach-davinci/time.c
+++ b/arch/arm/mach-davinci/time.c
@@ -322,7 +322,7 @@ static void __init davinci_timer_init(void)
322 clockevent_davinci.min_delta_ns = 322 clockevent_davinci.min_delta_ns =
323 clockevent_delta2ns(1, &clockevent_davinci); 323 clockevent_delta2ns(1, &clockevent_davinci);
324 324
325 clockevent_davinci.cpumask = cpumask_of_cpu(0); 325 clockevent_davinci.cpumask = cpumask_of(0);
326 clockevents_register_device(&clockevent_davinci); 326 clockevents_register_device(&clockevent_davinci);
327} 327}
328 328
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 4781f323703b..6d9152de6074 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -409,7 +409,7 @@ static struct amba_pl010_data ep93xx_uart_data = {
409 409
410static struct amba_device uart1_device = { 410static struct amba_device uart1_device = {
411 .dev = { 411 .dev = {
412 .bus_id = "apb:uart1", 412 .init_name = "apb:uart1",
413 .platform_data = &ep93xx_uart_data, 413 .platform_data = &ep93xx_uart_data,
414 }, 414 },
415 .res = { 415 .res = {
@@ -423,7 +423,7 @@ static struct amba_device uart1_device = {
423 423
424static struct amba_device uart2_device = { 424static struct amba_device uart2_device = {
425 .dev = { 425 .dev = {
426 .bus_id = "apb:uart2", 426 .init_name = "apb:uart2",
427 .platform_data = &ep93xx_uart_data, 427 .platform_data = &ep93xx_uart_data,
428 }, 428 },
429 .res = { 429 .res = {
@@ -437,7 +437,7 @@ static struct amba_device uart2_device = {
437 437
438static struct amba_device uart3_device = { 438static struct amba_device uart3_device = {
439 .dev = { 439 .dev = {
440 .bus_id = "apb:uart3", 440 .init_name = "apb:uart3",
441 .platform_data = &ep93xx_uart_data, 441 .platform_data = &ep93xx_uart_data,
442 }, 442 },
443 .res = { 443 .res = {
diff --git a/arch/arm/mach-footbridge/common.c b/arch/arm/mach-footbridge/common.c
index 36ff06d4df15..b97f529e58e8 100644
--- a/arch/arm/mach-footbridge/common.c
+++ b/arch/arm/mach-footbridge/common.c
@@ -28,12 +28,17 @@
28 28
29#include "common.h" 29#include "common.h"
30 30
31extern void __init isa_init_irq(unsigned int irq);
32
33unsigned int mem_fclk_21285 = 50000000; 31unsigned int mem_fclk_21285 = 50000000;
34 32
35EXPORT_SYMBOL(mem_fclk_21285); 33EXPORT_SYMBOL(mem_fclk_21285);
36 34
35static void __init early_fclk(char **arg)
36{
37 mem_fclk_21285 = simple_strtoul(*arg, arg, 0);
38}
39
40__early_param("mem_fclk_21285=", early_fclk);
41
37static int __init parse_tag_memclk(const struct tag *tag) 42static int __init parse_tag_memclk(const struct tag *tag)
38{ 43{
39 mem_fclk_21285 = tag->u.memclk.fmemclk; 44 mem_fclk_21285 = tag->u.memclk.fmemclk;
diff --git a/arch/arm/mach-footbridge/common.h b/arch/arm/mach-footbridge/common.h
index 580e31bbc711..b05e662d21ad 100644
--- a/arch/arm/mach-footbridge/common.h
+++ b/arch/arm/mach-footbridge/common.h
@@ -7,3 +7,4 @@ extern void isa_rtc_init(void);
7extern void footbridge_map_io(void); 7extern void footbridge_map_io(void);
8extern void footbridge_init_irq(void); 8extern void footbridge_init_irq(void);
9 9
10extern void isa_init_irq(unsigned int irq);
diff --git a/arch/arm/mach-footbridge/dc21285.c b/arch/arm/mach-footbridge/dc21285.c
index 133086019e3e..3ffa54841ec5 100644
--- a/arch/arm/mach-footbridge/dc21285.c
+++ b/arch/arm/mach-footbridge/dc21285.c
@@ -287,6 +287,9 @@ struct pci_bus * __init dc21285_scan_bus(int nr, struct pci_sys_data *sys)
287 return pci_scan_bus(0, &dc21285_ops, sys); 287 return pci_scan_bus(0, &dc21285_ops, sys);
288} 288}
289 289
290#define dc21285_request_irq(_a, _b, _c, _d, _e) \
291 WARN_ON(request_irq(_a, _b, _c, _d, _e) < 0)
292
290void __init dc21285_preinit(void) 293void __init dc21285_preinit(void)
291{ 294{
292 unsigned int mem_size, mem_mask; 295 unsigned int mem_size, mem_mask;
@@ -335,16 +338,16 @@ void __init dc21285_preinit(void)
335 /* 338 /*
336 * We don't care if these fail. 339 * We don't care if these fail.
337 */ 340 */
338 request_irq(IRQ_PCI_SERR, dc21285_serr_irq, IRQF_DISABLED, 341 dc21285_request_irq(IRQ_PCI_SERR, dc21285_serr_irq, IRQF_DISABLED,
339 "PCI system error", &serr_timer); 342 "PCI system error", &serr_timer);
340 request_irq(IRQ_PCI_PERR, dc21285_parity_irq, IRQF_DISABLED, 343 dc21285_request_irq(IRQ_PCI_PERR, dc21285_parity_irq, IRQF_DISABLED,
341 "PCI parity error", &perr_timer); 344 "PCI parity error", &perr_timer);
342 request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, IRQF_DISABLED, 345 dc21285_request_irq(IRQ_PCI_ABORT, dc21285_abort_irq, IRQF_DISABLED,
343 "PCI abort", NULL); 346 "PCI abort", NULL);
344 request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, IRQF_DISABLED, 347 dc21285_request_irq(IRQ_DISCARD_TIMER, dc21285_discard_irq, IRQF_DISABLED,
345 "Discard timer", NULL); 348 "Discard timer", NULL);
346 request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, IRQF_DISABLED, 349 dc21285_request_irq(IRQ_PCI_DPERR, dc21285_dparity_irq, IRQF_DISABLED,
347 "PCI data parity", NULL); 350 "PCI data parity", NULL);
348 351
349 if (cfn_mode) { 352 if (cfn_mode) {
350 static struct resource csrio; 353 static struct resource csrio;
diff --git a/arch/arm/mach-footbridge/isa-irq.c b/arch/arm/mach-footbridge/isa-irq.c
index 9ee80a211d3c..8bfd06aeb64d 100644
--- a/arch/arm/mach-footbridge/isa-irq.c
+++ b/arch/arm/mach-footbridge/isa-irq.c
@@ -28,6 +28,8 @@
28#include <asm/irq.h> 28#include <asm/irq.h>
29#include <asm/mach-types.h> 29#include <asm/mach-types.h>
30 30
31#include "common.h"
32
31static void isa_mask_pic_lo_irq(unsigned int irq) 33static void isa_mask_pic_lo_irq(unsigned int irq)
32{ 34{
33 unsigned int mask = 1 << (irq & 7); 35 unsigned int mask = 1 << (irq & 7);
diff --git a/arch/arm/mach-h720x/h7202-eval.c b/arch/arm/mach-h720x/h7202-eval.c
index 56161d55cf47..8c0ba99d683f 100644
--- a/arch/arm/mach-h720x/h7202-eval.c
+++ b/arch/arm/mach-h720x/h7202-eval.c
@@ -25,6 +25,7 @@
25#include <asm/page.h> 25#include <asm/page.h>
26#include <asm/pgtable.h> 26#include <asm/pgtable.h>
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <mach/irqs.h>
28#include <mach/hardware.h> 29#include <mach/hardware.h>
29#include "common.h" 30#include "common.h"
30 31
diff --git a/arch/arm/mach-imx/time.c b/arch/arm/mach-imx/time.c
index a11765f5f23b..aff0ebcfa847 100644
--- a/arch/arm/mach-imx/time.c
+++ b/arch/arm/mach-imx/time.c
@@ -184,7 +184,7 @@ static int __init imx_clockevent_init(unsigned long rate)
184 clockevent_imx.min_delta_ns = 184 clockevent_imx.min_delta_ns =
185 clockevent_delta2ns(0xf, &clockevent_imx); 185 clockevent_delta2ns(0xf, &clockevent_imx);
186 186
187 clockevent_imx.cpumask = cpumask_of_cpu(0); 187 clockevent_imx.cpumask = cpumask_of(0);
188 188
189 clockevents_register_device(&clockevent_imx); 189 clockevents_register_device(&clockevent_imx);
190 190
diff --git a/arch/arm/mach-integrator/core.c b/arch/arm/mach-integrator/core.c
index c89c949b4d45..6f8872913073 100644
--- a/arch/arm/mach-integrator/core.c
+++ b/arch/arm/mach-integrator/core.c
@@ -37,7 +37,7 @@ static struct amba_pl010_data integrator_uart_data;
37 37
38static struct amba_device rtc_device = { 38static struct amba_device rtc_device = {
39 .dev = { 39 .dev = {
40 .bus_id = "mb:15", 40 .init_name = "mb:15",
41 }, 41 },
42 .res = { 42 .res = {
43 .start = INTEGRATOR_RTC_BASE, 43 .start = INTEGRATOR_RTC_BASE,
@@ -50,7 +50,7 @@ static struct amba_device rtc_device = {
50 50
51static struct amba_device uart0_device = { 51static struct amba_device uart0_device = {
52 .dev = { 52 .dev = {
53 .bus_id = "mb:16", 53 .init_name = "mb:16",
54 .platform_data = &integrator_uart_data, 54 .platform_data = &integrator_uart_data,
55 }, 55 },
56 .res = { 56 .res = {
@@ -64,7 +64,7 @@ static struct amba_device uart0_device = {
64 64
65static struct amba_device uart1_device = { 65static struct amba_device uart1_device = {
66 .dev = { 66 .dev = {
67 .bus_id = "mb:17", 67 .init_name = "mb:17",
68 .platform_data = &integrator_uart_data, 68 .platform_data = &integrator_uart_data,
69 }, 69 },
70 .res = { 70 .res = {
@@ -78,7 +78,7 @@ static struct amba_device uart1_device = {
78 78
79static struct amba_device kmi0_device = { 79static struct amba_device kmi0_device = {
80 .dev = { 80 .dev = {
81 .bus_id = "mb:18", 81 .init_name = "mb:18",
82 }, 82 },
83 .res = { 83 .res = {
84 .start = KMI0_BASE, 84 .start = KMI0_BASE,
@@ -91,7 +91,7 @@ static struct amba_device kmi0_device = {
91 91
92static struct amba_device kmi1_device = { 92static struct amba_device kmi1_device = {
93 .dev = { 93 .dev = {
94 .bus_id = "mb:19", 94 .init_name = "mb:19",
95 }, 95 },
96 .res = { 96 .res = {
97 .start = KMI1_BASE, 97 .start = KMI1_BASE,
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 427c2d8dc123..4ac04055c2ea 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -407,7 +407,7 @@ static struct mmc_platform_data mmc_data = {
407 407
408static struct amba_device mmc_device = { 408static struct amba_device mmc_device = {
409 .dev = { 409 .dev = {
410 .bus_id = "mb:1c", 410 .init_name = "mb:1c",
411 .platform_data = &mmc_data, 411 .platform_data = &mmc_data,
412 }, 412 },
413 .res = { 413 .res = {
@@ -421,7 +421,7 @@ static struct amba_device mmc_device = {
421 421
422static struct amba_device aaci_device = { 422static struct amba_device aaci_device = {
423 .dev = { 423 .dev = {
424 .bus_id = "mb:1d", 424 .init_name = "mb:1d",
425 }, 425 },
426 .res = { 426 .res = {
427 .start = INTCP_PA_AACI_BASE, 427 .start = INTCP_PA_AACI_BASE,
@@ -532,7 +532,7 @@ static struct clcd_board clcd_data = {
532 532
533static struct amba_device clcd_device = { 533static struct amba_device clcd_device = {
534 .dev = { 534 .dev = {
535 .bus_id = "mb:c0", 535 .init_name = "mb:c0",
536 .coherent_dma_mask = ~0, 536 .coherent_dma_mask = ~0,
537 .platform_data = &clcd_data, 537 .platform_data = &clcd_data,
538 }, 538 },
diff --git a/arch/arm/mach-integrator/pci.c b/arch/arm/mach-integrator/pci.c
index af7d3ff013ec..2fdb95433f0a 100644
--- a/arch/arm/mach-integrator/pci.c
+++ b/arch/arm/mach-integrator/pci.c
@@ -63,13 +63,7 @@
63 * 63 *
64 * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A. 64 * Where A = pin 1, B = pin 2 and so on and pin=0 = default = A.
65 * Thus, each swizzle is ((pin-1) + (device#-4)) % 4 65 * Thus, each swizzle is ((pin-1) + (device#-4)) % 4
66 *
67 * The following code swizzles for exactly one bridge.
68 */ 66 */
69static inline int bridge_swizzle(int pin, unsigned int slot)
70{
71 return (pin + slot) & 3;
72}
73 67
74/* 68/*
75 * This routine handles multiple bridges. 69 * This routine handles multiple bridges.
@@ -81,15 +75,14 @@ static u8 __init integrator_swizzle(struct pci_dev *dev, u8 *pinp)
81 if (pin == 0) 75 if (pin == 0)
82 pin = 1; 76 pin = 1;
83 77
84 pin -= 1;
85 while (dev->bus->self) { 78 while (dev->bus->self) {
86 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); 79 pin = pci_swizzle_interrupt_pin(dev, pin);
87 /* 80 /*
88 * move up the chain of bridges, swizzling as we go. 81 * move up the chain of bridges, swizzling as we go.
89 */ 82 */
90 dev = dev->bus->self; 83 dev = dev->bus->self;
91 } 84 }
92 *pinp = pin + 1; 85 *pinp = pin;
93 86
94 return PCI_SLOT(dev->devfn); 87 return PCI_SLOT(dev->devfn);
95} 88}
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 7766f469456b..f4656d2ac8a8 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -487,7 +487,7 @@ static int __init ixp4xx_clockevent_init(void)
487 clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx); 487 clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx);
488 clockevent_ixp4xx.min_delta_ns = 488 clockevent_ixp4xx.min_delta_ns =
489 clockevent_delta2ns(0xf, &clockevent_ixp4xx); 489 clockevent_delta2ns(0xf, &clockevent_ixp4xx);
490 clockevent_ixp4xx.cpumask = cpumask_of_cpu(0); 490 clockevent_ixp4xx.cpumask = cpumask_of(0);
491 491
492 clockevents_register_device(&clockevent_ixp4xx); 492 clockevents_register_device(&clockevent_ixp4xx);
493 return 0; 493 return 0;
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index 7b8ef97fb501..b3404b7775b3 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -698,6 +698,7 @@ void __init kirkwood_init(void)
698 printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n", 698 printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
699 kirkwood_id(), kirkwood_tclk); 699 kirkwood_id(), kirkwood_tclk);
700 kirkwood_ge00_shared_data.t_clk = kirkwood_tclk; 700 kirkwood_ge00_shared_data.t_clk = kirkwood_tclk;
701 kirkwood_ge01_shared_data.t_clk = kirkwood_tclk;
701 kirkwood_spi_plat_data.tclk = kirkwood_tclk; 702 kirkwood_spi_plat_data.tclk = kirkwood_tclk;
702 kirkwood_uart0_data[0].uartclk = kirkwood_tclk; 703 kirkwood_uart0_data[0].uartclk = kirkwood_tclk;
703 kirkwood_uart1_data[0].uartclk = kirkwood_tclk; 704 kirkwood_uart1_data[0].uartclk = kirkwood_tclk;
diff --git a/arch/arm/mach-kirkwood/pcie.c b/arch/arm/mach-kirkwood/pcie.c
index f6b08f207c89..73fccacd1a73 100644
--- a/arch/arm/mach-kirkwood/pcie.c
+++ b/arch/arm/mach-kirkwood/pcie.c
@@ -11,6 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <linux/mbus.h> 13#include <linux/mbus.h>
14#include <asm/irq.h>
14#include <asm/mach/pci.h> 15#include <asm/mach/pci.h>
15#include <plat/pcie.h> 16#include <plat/pcie.h>
16#include "common.h" 17#include "common.h"
diff --git a/arch/arm/mach-ks8695/devices.c b/arch/arm/mach-ks8695/devices.c
index 36ab0fd3d9b6..b89fb6d46ccc 100644
--- a/arch/arm/mach-ks8695/devices.c
+++ b/arch/arm/mach-ks8695/devices.c
@@ -22,6 +22,7 @@
22 22
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24 24
25#include <mach/irqs.h>
25#include <mach/regs-wan.h> 26#include <mach/regs-wan.h>
26#include <mach/regs-lan.h> 27#include <mach/regs-lan.h>
27#include <mach/regs-hpna.h> 28#include <mach/regs-hpna.h>
diff --git a/arch/arm/mach-lh7a40x/clcd.c b/arch/arm/mach-lh7a40x/clcd.c
index a2a543258fc3..c472b9e8b37c 100644
--- a/arch/arm/mach-lh7a40x/clcd.c
+++ b/arch/arm/mach-lh7a40x/clcd.c
@@ -207,7 +207,7 @@ static struct clcd_board clcd_platform_data = {
207static struct amba_device name##_device = { \ 207static struct amba_device name##_device = { \
208 .dev = { \ 208 .dev = { \
209 .coherent_dma_mask = ~0, \ 209 .coherent_dma_mask = ~0, \
210 .bus_id = busid, \ 210 .init_name = busid, \
211 .platform_data = plat, \ 211 .platform_data = plat, \
212 }, \ 212 }, \
213 .res = { \ 213 .res = { \
diff --git a/arch/arm/mach-msm/devices.c b/arch/arm/mach-msm/devices.c
index f2a74b92a97f..31b6b30e98bf 100644
--- a/arch/arm/mach-msm/devices.c
+++ b/arch/arm/mach-msm/devices.c
@@ -16,6 +16,7 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18 18
19#include <mach/irqs.h>
19#include <mach/msm_iomap.h> 20#include <mach/msm_iomap.h>
20#include "devices.h" 21#include "devices.h"
21 22
diff --git a/arch/arm/mach-msm/timer.c b/arch/arm/mach-msm/timer.c
index 345a14cb73c3..444d9c0f5ca6 100644
--- a/arch/arm/mach-msm/timer.c
+++ b/arch/arm/mach-msm/timer.c
@@ -182,7 +182,7 @@ static void __init msm_timer_init(void)
182 clockevent_delta2ns(0xf0000000 >> clock->shift, ce); 182 clockevent_delta2ns(0xf0000000 >> clock->shift, ce);
183 /* 4 gets rounded down to 3 */ 183 /* 4 gets rounded down to 3 */
184 ce->min_delta_ns = clockevent_delta2ns(4, ce); 184 ce->min_delta_ns = clockevent_delta2ns(4, ce);
185 ce->cpumask = cpumask_of_cpu(0); 185 ce->cpumask = cpumask_of(0);
186 186
187 cs->mult = clocksource_hz2mult(clock->freq, cs->shift); 187 cs->mult = clocksource_hz2mult(clock->freq, cs->shift);
188 res = clocksource_register(cs); 188 res = clocksource_register(cs);
diff --git a/arch/arm/mach-mv78xx0/pcie.c b/arch/arm/mach-mv78xx0/pcie.c
index 430ea84d587d..aad3a7a2f830 100644
--- a/arch/arm/mach-mv78xx0/pcie.c
+++ b/arch/arm/mach-mv78xx0/pcie.c
@@ -11,6 +11,7 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/pci.h> 12#include <linux/pci.h>
13#include <linux/mbus.h> 13#include <linux/mbus.h>
14#include <asm/irq.h>
14#include <asm/mach/pci.h> 15#include <asm/mach/pci.h>
15#include <plat/pcie.h> 16#include <plat/pcie.h>
16#include "common.h" 17#include "common.h"
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c
index af121f5ab710..2f9240be1c76 100644
--- a/arch/arm/mach-mx2/devices.c
+++ b/arch/arm/mach-mx2/devices.c
@@ -32,6 +32,7 @@
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/gpio.h> 33#include <linux/gpio.h>
34 34
35#include <mach/irqs.h>
35#include <mach/hardware.h> 36#include <mach/hardware.h>
36 37
37/* 38/*
diff --git a/arch/arm/mach-mx3/devices.c b/arch/arm/mach-mx3/devices.c
index 1d46cb4adf96..f8428800f286 100644
--- a/arch/arm/mach-mx3/devices.c
+++ b/arch/arm/mach-mx3/devices.c
@@ -22,6 +22,7 @@
22#include <linux/serial.h> 22#include <linux/serial.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <mach/hardware.h> 24#include <mach/hardware.h>
25#include <mach/irqs.h>
25#include <mach/imx-uart.h> 26#include <mach/imx-uart.h>
26 27
27static struct resource uart0[] = { 28static struct resource uart0[] = {
diff --git a/arch/arm/mach-netx/fb.c b/arch/arm/mach-netx/fb.c
index 8f1f992f002e..1d844e228ea9 100644
--- a/arch/arm/mach-netx/fb.c
+++ b/arch/arm/mach-netx/fb.c
@@ -24,6 +24,8 @@
24#include <linux/amba/clcd.h> 24#include <linux/amba/clcd.h>
25#include <linux/err.h> 25#include <linux/err.h>
26 26
27#include <asm/irq.h>
28
27#include <mach/netx-regs.h> 29#include <mach/netx-regs.h>
28#include <mach/hardware.h> 30#include <mach/hardware.h>
29 31
@@ -91,7 +93,7 @@ void clk_put(struct clk *clk)
91 93
92static struct amba_device fb_device = { 94static struct amba_device fb_device = {
93 .dev = { 95 .dev = {
94 .bus_id = "fb", 96 .init_name = "fb",
95 .coherent_dma_mask = ~0, 97 .coherent_dma_mask = ~0,
96 }, 98 },
97 .res = { 99 .res = {
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c
index d51d627ce7cf..f201fddb594f 100644
--- a/arch/arm/mach-netx/time.c
+++ b/arch/arm/mach-netx/time.c
@@ -163,7 +163,7 @@ static void __init netx_timer_init(void)
163 * Adding some safety ... */ 163 * Adding some safety ... */
164 netx_clockevent.min_delta_ns = 164 netx_clockevent.min_delta_ns =
165 clockevent_delta2ns(0xa00, &netx_clockevent); 165 clockevent_delta2ns(0xa00, &netx_clockevent);
166 netx_clockevent.cpumask = cpumask_of_cpu(0); 166 netx_clockevent.cpumask = cpumask_of(0);
167 clockevents_register_device(&netx_clockevent); 167 clockevents_register_device(&netx_clockevent);
168} 168}
169 169
diff --git a/arch/arm/mach-netx/xc.c b/arch/arm/mach-netx/xc.c
index 8fc6205dc3a5..181a78ba8165 100644
--- a/arch/arm/mach-netx/xc.c
+++ b/arch/arm/mach-netx/xc.c
@@ -24,6 +24,7 @@
24#include <linux/io.h> 24#include <linux/io.h>
25 25
26#include <mach/hardware.h> 26#include <mach/hardware.h>
27#include <mach/irqs.h>
27#include <mach/netx-regs.h> 28#include <mach/netx-regs.h>
28 29
29#include <mach/xc.h> 30#include <mach/xc.h>
diff --git a/arch/arm/mach-ns9xxx/time-ns9360.c b/arch/arm/mach-ns9xxx/time-ns9360.c
index a63424d083d9..41df69721769 100644
--- a/arch/arm/mach-ns9xxx/time-ns9360.c
+++ b/arch/arm/mach-ns9xxx/time-ns9360.c
@@ -173,7 +173,7 @@ static void __init ns9360_timer_init(void)
173 ns9360_clockevent_device.min_delta_ns = 173 ns9360_clockevent_device.min_delta_ns =
174 clockevent_delta2ns(1, &ns9360_clockevent_device); 174 clockevent_delta2ns(1, &ns9360_clockevent_device);
175 175
176 ns9360_clockevent_device.cpumask = cpumask_of_cpu(0); 176 ns9360_clockevent_device.cpumask = cpumask_of(0);
177 clockevents_register_device(&ns9360_clockevent_device); 177 clockevents_register_device(&ns9360_clockevent_device);
178 178
179 setup_irq(IRQ_NS9360_TIMER0 + TIMER_CLOCKEVENT, 179 setup_irq(IRQ_NS9360_TIMER0 + TIMER_CLOCKEVENT,
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index 7de7c6915584..4474da7bc88a 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -18,6 +18,7 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <mach/dma.h> 20#include <mach/dma.h>
21#include <mach/irqs.h>
21#include <mach/mux.h> 22#include <mach/mux.h>
22#include <mach/cpu.h> 23#include <mach/cpu.h>
23#include <mach/mcbsp.h> 24#include <mach/mcbsp.h>
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 2cf7e32bd293..495a32c287b4 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -173,7 +173,7 @@ static __init void omap_init_mpu_timer(unsigned long rate)
173 clockevent_mpu_timer1.min_delta_ns = 173 clockevent_mpu_timer1.min_delta_ns =
174 clockevent_delta2ns(1, &clockevent_mpu_timer1); 174 clockevent_delta2ns(1, &clockevent_mpu_timer1);
175 175
176 clockevent_mpu_timer1.cpumask = cpumask_of_cpu(0); 176 clockevent_mpu_timer1.cpumask = cpumask_of(0);
177 clockevents_register_device(&clockevent_mpu_timer1); 177 clockevents_register_device(&clockevent_mpu_timer1);
178} 178}
179 179
diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c
index 705367ece174..fd3f7396e162 100644
--- a/arch/arm/mach-omap1/timer32k.c
+++ b/arch/arm/mach-omap1/timer32k.c
@@ -187,7 +187,7 @@ static __init void omap_init_32k_timer(void)
187 clockevent_32k_timer.min_delta_ns = 187 clockevent_32k_timer.min_delta_ns =
188 clockevent_delta2ns(1, &clockevent_32k_timer); 188 clockevent_delta2ns(1, &clockevent_32k_timer);
189 189
190 clockevent_32k_timer.cpumask = cpumask_of_cpu(0); 190 clockevent_32k_timer.cpumask = cpumask_of(0);
191 clockevents_register_device(&clockevent_32k_timer); 191 clockevents_register_device(&clockevent_32k_timer);
192} 192}
193 193
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h
index ff6cd14d254d..ad6d98d177c5 100644
--- a/arch/arm/mach-omap2/clock24xx.h
+++ b/arch/arm/mach-omap2/clock24xx.h
@@ -2321,7 +2321,7 @@ static struct clk i2c2_fck = {
2321}; 2321};
2322 2322
2323static struct clk i2chs2_fck = { 2323static struct clk i2chs2_fck = {
2324 .name = "i2chs_fck", 2324 .name = "i2c_fck",
2325 .id = 2, 2325 .id = 2,
2326 .parent = &func_96m_ck, 2326 .parent = &func_96m_ck,
2327 .flags = CLOCK_IN_OMAP243X, 2327 .flags = CLOCK_IN_OMAP243X,
@@ -2354,7 +2354,7 @@ static struct clk i2c1_fck = {
2354}; 2354};
2355 2355
2356static struct clk i2chs1_fck = { 2356static struct clk i2chs1_fck = {
2357 .name = "i2chs_fck", 2357 .name = "i2c_fck",
2358 .id = 1, 2358 .id = 1,
2359 .parent = &func_96m_ck, 2359 .parent = &func_96m_ck,
2360 .flags = CLOCK_IN_OMAP243X, 2360 .flags = CLOCK_IN_OMAP243X,
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c
index cae3ebe249b3..acdc709901cd 100644
--- a/arch/arm/mach-omap2/mcbsp.c
+++ b/arch/arm/mach-omap2/mcbsp.c
@@ -18,6 +18,7 @@
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19 19
20#include <mach/dma.h> 20#include <mach/dma.h>
21#include <mach/irqs.h>
21#include <mach/mux.h> 22#include <mach/mux.h>
22#include <mach/cpu.h> 23#include <mach/cpu.h>
23#include <mach/mcbsp.h> 24#include <mach/mcbsp.h>
diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 589393bedade..ae6036300f60 100644
--- a/arch/arm/mach-omap2/timer-gp.c
+++ b/arch/arm/mach-omap2/timer-gp.c
@@ -120,7 +120,7 @@ static void __init omap2_gp_clockevent_init(void)
120 clockevent_gpt.min_delta_ns = 120 clockevent_gpt.min_delta_ns =
121 clockevent_delta2ns(1, &clockevent_gpt); 121 clockevent_delta2ns(1, &clockevent_gpt);
122 122
123 clockevent_gpt.cpumask = cpumask_of_cpu(0); 123 clockevent_gpt.cpumask = cpumask_of(0);
124 clockevents_register_device(&clockevent_gpt); 124 clockevents_register_device(&clockevent_gpt);
125} 125}
126 126
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c
index a7b7d77b1b09..d0a785a3b880 100644
--- a/arch/arm/mach-orion5x/pci.c
+++ b/arch/arm/mach-orion5x/pci.c
@@ -13,6 +13,7 @@
13#include <linux/kernel.h> 13#include <linux/kernel.h>
14#include <linux/pci.h> 14#include <linux/pci.h>
15#include <linux/mbus.h> 15#include <linux/mbus.h>
16#include <asm/irq.h>
16#include <asm/mach/pci.h> 17#include <asm/mach/pci.h>
17#include <plat/pcie.h> 18#include <plat/pcie.h>
18#include "common.h" 19#include "common.h"
diff --git a/arch/arm/mach-pnx4008/gpio.c b/arch/arm/mach-pnx4008/gpio.c
index 015cc21d5f55..f219914f5b29 100644
--- a/arch/arm/mach-pnx4008/gpio.c
+++ b/arch/arm/mach-pnx4008/gpio.c
@@ -18,6 +18,7 @@
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <mach/hardware.h>
21#include <mach/platform.h> 22#include <mach/platform.h>
22#include <mach/gpio.h> 23#include <mach/gpio.h>
23 24
diff --git a/arch/arm/mach-pnx4008/i2c.c b/arch/arm/mach-pnx4008/i2c.c
index 87c093286ff9..f3fea29c00d3 100644
--- a/arch/arm/mach-pnx4008/i2c.c
+++ b/arch/arm/mach-pnx4008/i2c.c
@@ -15,6 +15,7 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/err.h> 16#include <linux/err.h>
17#include <mach/platform.h> 17#include <mach/platform.h>
18#include <mach/irqs.h>
18#include <mach/i2c.h> 19#include <mach/i2c.h>
19 20
20static int set_clock_run(struct platform_device *pdev) 21static int set_clock_run(struct platform_device *pdev)
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index c5e28a46b292..a8d91b6c136b 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -27,6 +27,7 @@
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28#include <linux/spi/ads7846.h> 28#include <linux/spi/ads7846.h>
29#include <linux/spi/corgi_lcd.h> 29#include <linux/spi/corgi_lcd.h>
30#include <linux/mtd/sharpsl.h>
30#include <video/w100fb.h> 31#include <video/w100fb.h>
31 32
32#include <asm/setup.h> 33#include <asm/setup.h>
@@ -542,6 +543,55 @@ err_free_1:
542static inline void corgi_init_spi(void) {} 543static inline void corgi_init_spi(void) {}
543#endif 544#endif
544 545
546static struct mtd_partition sharpsl_nand_partitions[] = {
547 {
548 .name = "System Area",
549 .offset = 0,
550 .size = 7 * 1024 * 1024,
551 },
552 {
553 .name = "Root Filesystem",
554 .offset = 7 * 1024 * 1024,
555 .size = 25 * 1024 * 1024,
556 },
557 {
558 .name = "Home Filesystem",
559 .offset = MTDPART_OFS_APPEND,
560 .size = MTDPART_SIZ_FULL,
561 },
562};
563
564static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
565
566static struct nand_bbt_descr sharpsl_bbt = {
567 .options = 0,
568 .offs = 4,
569 .len = 2,
570 .pattern = scan_ff_pattern
571};
572
573static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = {
574 .badblock_pattern = &sharpsl_bbt,
575 .partitions = sharpsl_nand_partitions,
576 .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions),
577};
578
579static struct resource sharpsl_nand_resources[] = {
580 {
581 .start = 0x0C000000,
582 .end = 0x0C000FFF,
583 .flags = IORESOURCE_MEM,
584 },
585};
586
587static struct platform_device sharpsl_nand_device = {
588 .name = "sharpsl-nand",
589 .id = -1,
590 .resource = sharpsl_nand_resources,
591 .num_resources = ARRAY_SIZE(sharpsl_nand_resources),
592 .dev.platform_data = &sharpsl_nand_platform_data,
593};
594
545static struct mtd_partition sharpsl_rom_parts[] = { 595static struct mtd_partition sharpsl_rom_parts[] = {
546 { 596 {
547 .name ="Boot PROM Filesystem", 597 .name ="Boot PROM Filesystem",
@@ -577,6 +627,7 @@ static struct platform_device *devices[] __initdata = {
577 &corgifb_device, 627 &corgifb_device,
578 &corgikbd_device, 628 &corgikbd_device,
579 &corgiled_device, 629 &corgiled_device,
630 &sharpsl_nand_device,
580 &sharpsl_rom_device, 631 &sharpsl_rom_device,
581}; 632};
582 633
@@ -617,6 +668,9 @@ static void __init corgi_init(void)
617 668
618 platform_scoop_config = &corgi_pcmcia_config; 669 platform_scoop_config = &corgi_pcmcia_config;
619 670
671 if (machine_is_husky())
672 sharpsl_nand_partitions[1].size = 53 * 1024 * 1024;
673
620 platform_add_devices(devices, ARRAY_SIZE(devices)); 674 platform_add_devices(devices, ARRAY_SIZE(devices));
621} 675}
622 676
diff --git a/arch/arm/mach-pxa/e350.c b/arch/arm/mach-pxa/e350.c
index 251129391d7d..edcd9d5ce545 100644
--- a/arch/arm/mach-pxa/e350.c
+++ b/arch/arm/mach-pxa/e350.c
@@ -20,6 +20,7 @@
20#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
21#include <asm/mach-types.h> 21#include <asm/mach-types.h>
22 22
23#include <mach/irqs.h>
23#include <mach/mfp-pxa25x.h> 24#include <mach/mfp-pxa25x.h>
24#include <mach/pxa-regs.h> 25#include <mach/pxa-regs.h>
25#include <mach/hardware.h> 26#include <mach/hardware.h>
diff --git a/arch/arm/mach-pxa/e400.c b/arch/arm/mach-pxa/e400.c
index bed0336aca3d..77bb8e2c48c0 100644
--- a/arch/arm/mach-pxa/e400.c
+++ b/arch/arm/mach-pxa/e400.c
@@ -28,6 +28,7 @@
28#include <mach/eseries-gpio.h> 28#include <mach/eseries-gpio.h>
29#include <mach/pxafb.h> 29#include <mach/pxafb.h>
30#include <mach/udc.h> 30#include <mach/udc.h>
31#include <mach/irqs.h>
31 32
32#include "generic.h" 33#include "generic.h"
33#include "eseries.h" 34#include "eseries.h"
diff --git a/arch/arm/mach-pxa/e740.c b/arch/arm/mach-pxa/e740.c
index b00d670b2ea6..6d48e00f4f0b 100644
--- a/arch/arm/mach-pxa/e740.c
+++ b/arch/arm/mach-pxa/e740.c
@@ -30,6 +30,7 @@
30#include <mach/eseries-gpio.h> 30#include <mach/eseries-gpio.h>
31#include <mach/udc.h> 31#include <mach/udc.h>
32#include <mach/irda.h> 32#include <mach/irda.h>
33#include <mach/irqs.h>
33 34
34#include "generic.h" 35#include "generic.h"
35#include "eseries.h" 36#include "eseries.h"
diff --git a/arch/arm/mach-pxa/e750.c b/arch/arm/mach-pxa/e750.c
index 84d7c1aac58d..be1ab8edb973 100644
--- a/arch/arm/mach-pxa/e750.c
+++ b/arch/arm/mach-pxa/e750.c
@@ -29,6 +29,7 @@
29#include <mach/eseries-gpio.h> 29#include <mach/eseries-gpio.h>
30#include <mach/udc.h> 30#include <mach/udc.h>
31#include <mach/irda.h> 31#include <mach/irda.h>
32#include <mach/irqs.h>
32 33
33#include "generic.h" 34#include "generic.h"
34#include "eseries.h" 35#include "eseries.h"
@@ -105,6 +106,57 @@ static struct platform_device e750_fb_device = {
105 .resource = e750_fb_resources, 106 .resource = e750_fb_resources,
106}; 107};
107 108
109/* -------------------- e750 MFP parameters -------------------- */
110
111static unsigned long e750_pin_config[] __initdata = {
112 /* Chip selects */
113 GPIO15_nCS_1, /* CS1 - Flash */
114 GPIO79_nCS_3, /* CS3 - IMAGEON */
115 GPIO80_nCS_4, /* CS4 - TMIO */
116
117 /* Clocks */
118 GPIO11_3_6MHz,
119
120 /* BTUART */
121 GPIO42_BTUART_RXD,
122 GPIO43_BTUART_TXD,
123 GPIO44_BTUART_CTS,
124
125 /* TMIO controller */
126 GPIO19_GPIO, /* t7l66xb #PCLR */
127 GPIO45_GPIO, /* t7l66xb #SUSPEND (NOT BTUART!) */
128
129 /* UDC */
130 GPIO13_GPIO,
131 GPIO3_GPIO,
132
133 /* IrDA */
134 GPIO38_GPIO | MFP_LPM_DRIVE_HIGH,
135
136 /* PC Card */
137 GPIO8_GPIO, /* CD0 */
138 GPIO44_GPIO, /* CD1 */
139 GPIO11_GPIO, /* IRQ0 */
140 GPIO6_GPIO, /* IRQ1 */
141 GPIO27_GPIO, /* RST0 */
142 GPIO24_GPIO, /* RST1 */
143 GPIO20_GPIO, /* PWR0 */
144 GPIO23_GPIO, /* PWR1 */
145 GPIO48_nPOE,
146 GPIO49_nPWE,
147 GPIO50_nPIOR,
148 GPIO51_nPIOW,
149 GPIO52_nPCE_1,
150 GPIO53_nPCE_2,
151 GPIO54_nPSKTSEL,
152 GPIO55_nPREG,
153 GPIO56_nPWAIT,
154 GPIO57_nIOIS16,
155
156 /* wakeup */
157 GPIO0_GPIO | WAKEUP_ON_EDGE_RISE,
158};
159
108/* ----------------- e750 tc6393xb parameters ------------------ */ 160/* ----------------- e750 tc6393xb parameters ------------------ */
109 161
110static struct tc6393xb_platform_data e750_tc6393xb_info = { 162static struct tc6393xb_platform_data e750_tc6393xb_info = {
@@ -137,6 +189,7 @@ static struct platform_device *devices[] __initdata = {
137 189
138static void __init e750_init(void) 190static void __init e750_init(void)
139{ 191{
192 pxa2xx_mfp_config(ARRAY_AND_SIZE(e750_pin_config));
140 clk_add_alias("CLK_CK3P6MI", &e750_tc6393xb_device.dev, 193 clk_add_alias("CLK_CK3P6MI", &e750_tc6393xb_device.dev,
141 "GPIO11_CLK", NULL), 194 "GPIO11_CLK", NULL),
142 eseries_get_tmio_gpios(); 195 eseries_get_tmio_gpios();
diff --git a/arch/arm/mach-pxa/e800.c b/arch/arm/mach-pxa/e800.c
index 9a86a426f924..cc9b1293e866 100644
--- a/arch/arm/mach-pxa/e800.c
+++ b/arch/arm/mach-pxa/e800.c
@@ -28,6 +28,7 @@
28#include <mach/hardware.h> 28#include <mach/hardware.h>
29#include <mach/eseries-gpio.h> 29#include <mach/eseries-gpio.h>
30#include <mach/udc.h> 30#include <mach/udc.h>
31#include <mach/irqs.h>
31 32
32#include "generic.h" 33#include "generic.h"
33#include "eseries.h" 34#include "eseries.h"
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
index b1fcd10ab6c6..bcf3fb2c4b3a 100644
--- a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
+++ b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h
@@ -193,10 +193,8 @@
193#define CKEN_MINI_IM 48 /* < Mini-IM */ 193#define CKEN_MINI_IM 48 /* < Mini-IM */
194#define CKEN_MINI_LCD 49 /* < Mini LCD */ 194#define CKEN_MINI_LCD 49 /* < Mini LCD */
195 195
196#if defined(CONFIG_CPU_PXA310)
197#define CKEN_MMC3 5 /* < MMC3 Clock Enable */ 196#define CKEN_MMC3 5 /* < MMC3 Clock Enable */
198#define CKEN_MVED 43 /* < MVED clock enable */ 197#define CKEN_MVED 43 /* < MVED clock enable */
199#endif
200 198
201/* Note: GCU clock enable bit differs on PXA300/PXA310 and PXA320 */ 199/* Note: GCU clock enable bit differs on PXA300/PXA310 and PXA320 */
202#define PXA300_CKEN_GRAPHICS 42 /* Graphics controller clock enable */ 200#define PXA300_CKEN_GRAPHICS 42 /* Graphics controller clock enable */
diff --git a/arch/arm/mach-pxa/include/mach/pxa930_rotary.h b/arch/arm/mach-pxa/include/mach/pxa930_rotary.h
new file mode 100644
index 000000000000..053587caffdd
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/pxa930_rotary.h
@@ -0,0 +1,20 @@
1#ifndef __ASM_ARCH_PXA930_ROTARY_H
2#define __ASM_ARCH_PXA930_ROTARY_H
3
4/* NOTE:
5 *
6 * rotary can be either interpreted as a ralative input event (e.g.
7 * REL_WHEEL or REL_HWHEEL) or a specific key event (e.g. UP/DOWN
8 * or LEFT/RIGHT), depending on if up_key & down_key are assigned
9 * or rel_code is assigned a non-zero value. When all are non-zero,
10 * up_key and down_key will be preferred.
11 */
12struct pxa930_rotary_platform_data {
13 int up_key;
14 int down_key;
15 int rel_code;
16};
17
18void __init pxa930_set_rotarykey_info(struct pxa930_rotary_platform_data *info);
19
20#endif /* __ASM_ARCH_PXA930_ROTARY_H */
diff --git a/arch/arm/mach-pxa/include/mach/pxa930_trkball.h b/arch/arm/mach-pxa/include/mach/pxa930_trkball.h
new file mode 100644
index 000000000000..5e0789bc4729
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/pxa930_trkball.h
@@ -0,0 +1,10 @@
1#ifndef __ASM_ARCH_PXA930_TRKBALL_H
2#define __ASM_ARCH_PXA930_TRKBALL_H
3
4struct pxa930_trkball_platform_data {
5 int x_filter;
6 int y_filter;
7};
8
9#endif /* __ASM_ARCH_PXA930_TRKBALL_H */
10
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index ae88855bf974..f9093beba752 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -24,6 +24,7 @@
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
26#include <linux/spi/ads7846.h> 26#include <linux/spi/ads7846.h>
27#include <linux/mtd/sharpsl.h>
27 28
28#include <mach/hardware.h> 29#include <mach/hardware.h>
29#include <asm/mach-types.h> 30#include <asm/mach-types.h>
@@ -414,6 +415,55 @@ static struct pxafb_mach_info poodle_fb_info = {
414 .lcd_conn = LCD_COLOR_TFT_16BPP, 415 .lcd_conn = LCD_COLOR_TFT_16BPP,
415}; 416};
416 417
418static struct mtd_partition sharpsl_nand_partitions[] = {
419 {
420 .name = "System Area",
421 .offset = 0,
422 .size = 7 * 1024 * 1024,
423 },
424 {
425 .name = "Root Filesystem",
426 .offset = 7 * 1024 * 1024,
427 .size = 22 * 1024 * 1024,
428 },
429 {
430 .name = "Home Filesystem",
431 .offset = MTDPART_OFS_APPEND,
432 .size = MTDPART_SIZ_FULL,
433 },
434};
435
436static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
437
438static struct nand_bbt_descr sharpsl_bbt = {
439 .options = 0,
440 .offs = 4,
441 .len = 2,
442 .pattern = scan_ff_pattern
443};
444
445static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = {
446 .badblock_pattern = &sharpsl_bbt,
447 .partitions = sharpsl_nand_partitions,
448 .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions),
449};
450
451static struct resource sharpsl_nand_resources[] = {
452 {
453 .start = 0x0C000000,
454 .end = 0x0C000FFF,
455 .flags = IORESOURCE_MEM,
456 },
457};
458
459static struct platform_device sharpsl_nand_device = {
460 .name = "sharpsl-nand",
461 .id = -1,
462 .resource = sharpsl_nand_resources,
463 .num_resources = ARRAY_SIZE(sharpsl_nand_resources),
464 .dev.platform_data = &sharpsl_nand_platform_data,
465};
466
417static struct mtd_partition sharpsl_rom_parts[] = { 467static struct mtd_partition sharpsl_rom_parts[] = {
418 { 468 {
419 .name ="Boot PROM Filesystem", 469 .name ="Boot PROM Filesystem",
@@ -447,6 +497,7 @@ static struct platform_device sharpsl_rom_device = {
447static struct platform_device *devices[] __initdata = { 497static struct platform_device *devices[] __initdata = {
448 &poodle_locomo_device, 498 &poodle_locomo_device,
449 &poodle_scoop_device, 499 &poodle_scoop_device,
500 &sharpsl_nand_device,
450 &sharpsl_rom_device, 501 &sharpsl_rom_device,
451}; 502};
452 503
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 7299d87a1cb3..6d447c9ce8ab 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -31,6 +31,7 @@
31#include <linux/spi/spi.h> 31#include <linux/spi/spi.h>
32#include <linux/spi/ads7846.h> 32#include <linux/spi/ads7846.h>
33#include <linux/spi/corgi_lcd.h> 33#include <linux/spi/corgi_lcd.h>
34#include <linux/mtd/sharpsl.h>
34 35
35#include <asm/setup.h> 36#include <asm/setup.h>
36#include <asm/memory.h> 37#include <asm/memory.h>
@@ -613,6 +614,54 @@ static struct pxafb_mach_info spitz_pxafb_info = {
613 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING, 614 .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_ALTERNATE_MAPPING,
614}; 615};
615 616
617static struct mtd_partition sharpsl_nand_partitions[] = {
618 {
619 .name = "System Area",
620 .offset = 0,
621 .size = 7 * 1024 * 1024,
622 },
623 {
624 .name = "Root Filesystem",
625 .offset = 7 * 1024 * 1024,
626 },
627 {
628 .name = "Home Filesystem",
629 .offset = MTDPART_OFS_APPEND,
630 .size = MTDPART_SIZ_FULL,
631 },
632};
633
634static uint8_t scan_ff_pattern[] = { 0xff, 0xff };
635
636static struct nand_bbt_descr sharpsl_bbt = {
637 .options = 0,
638 .offs = 4,
639 .len = 2,
640 .pattern = scan_ff_pattern
641};
642
643static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = {
644 .badblock_pattern = &sharpsl_bbt,
645 .partitions = sharpsl_nand_partitions,
646 .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions),
647};
648
649static struct resource sharpsl_nand_resources[] = {
650 {
651 .start = 0x0C000000,
652 .end = 0x0C000FFF,
653 .flags = IORESOURCE_MEM,
654 },
655};
656
657static struct platform_device sharpsl_nand_device = {
658 .name = "sharpsl-nand",
659 .id = -1,
660 .resource = sharpsl_nand_resources,
661 .num_resources = ARRAY_SIZE(sharpsl_nand_resources),
662 .dev.platform_data = &sharpsl_nand_platform_data,
663};
664
616 665
617static struct mtd_partition sharpsl_rom_parts[] = { 666static struct mtd_partition sharpsl_rom_parts[] = {
618 { 667 {
@@ -648,6 +697,7 @@ static struct platform_device *devices[] __initdata = {
648 &spitzscoop_device, 697 &spitzscoop_device,
649 &spitzkbd_device, 698 &spitzkbd_device,
650 &spitzled_device, 699 &spitzled_device,
700 &sharpsl_nand_device,
651 &sharpsl_rom_device, 701 &sharpsl_rom_device,
652}; 702};
653 703
@@ -671,6 +721,14 @@ static void __init common_init(void)
671 pm_power_off = spitz_poweroff; 721 pm_power_off = spitz_poweroff;
672 arm_pm_restart = spitz_restart; 722 arm_pm_restart = spitz_restart;
673 723
724 if (machine_is_spitz()) {
725 sharpsl_nand_partitions[1].size = 5 * 1024 * 1024;
726 } else if (machine_is_akita()) {
727 sharpsl_nand_partitions[1].size = 58 * 1024 * 1024;
728 } else if (machine_is_borzoi()) {
729 sharpsl_nand_partitions[1].size = 32 * 1024 * 1024;
730 }
731
674 PMCR = 0x00; 732 PMCR = 0x00;
675 733
676 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ 734 /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */
@@ -715,10 +773,29 @@ static struct i2c_board_info akita_i2c_board_info[] = {
715 }, 773 },
716}; 774};
717 775
776static struct nand_bbt_descr sharpsl_akita_bbt = {
777 .options = 0,
778 .offs = 4,
779 .len = 1,
780 .pattern = scan_ff_pattern
781};
782
783static struct nand_ecclayout akita_oobinfo = {
784 .eccbytes = 24,
785 .eccpos = {
786 0x5, 0x1, 0x2, 0x3, 0x6, 0x7, 0x15, 0x11,
787 0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
788 0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37},
789 .oobfree = {{0x08, 0x09}}
790};
791
718static void __init akita_init(void) 792static void __init akita_init(void)
719{ 793{
720 spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode; 794 spitz_ficp_platform_data.transceiver_mode = akita_irda_transceiver_mode;
721 795
796 sharpsl_nand_platform_data.badblock_pattern = &sharpsl_akita_bbt;
797 sharpsl_nand_platform_data.ecc_layout = &akita_oobinfo;
798
722 /* We just pretend the second element of the array doesn't exist */ 799 /* We just pretend the second element of the array doesn't exist */
723 spitz_pcmcia_config.num_devs = 1; 800 spitz_pcmcia_config.num_devs = 1;
724 platform_scoop_config = &spitz_pcmcia_config; 801 platform_scoop_config = &spitz_pcmcia_config;
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 001624158519..95656a72268d 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -122,7 +122,6 @@ static struct clock_event_device ckevt_pxa_osmr0 = {
122 .features = CLOCK_EVT_FEAT_ONESHOT, 122 .features = CLOCK_EVT_FEAT_ONESHOT,
123 .shift = 32, 123 .shift = 32,
124 .rating = 200, 124 .rating = 200,
125 .cpumask = CPU_MASK_CPU0,
126 .set_next_event = pxa_osmr0_set_next_event, 125 .set_next_event = pxa_osmr0_set_next_event,
127 .set_mode = pxa_osmr0_set_mode, 126 .set_mode = pxa_osmr0_set_mode,
128}; 127};
@@ -163,6 +162,7 @@ static void __init pxa_timer_init(void)
163 clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0); 162 clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0);
164 ckevt_pxa_osmr0.min_delta_ns = 163 ckevt_pxa_osmr0.min_delta_ns =
165 clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1; 164 clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_pxa_osmr0) + 1;
165 ckevt_pxa_osmr0.cpumask = cpumask_of(0);
166 166
167 cksrc_pxa_oscr0.mult = 167 cksrc_pxa_oscr0.mult =
168 clocksource_hz2mult(clock_tick_rate, cksrc_pxa_oscr0.shift); 168 clocksource_hz2mult(clock_tick_rate, cksrc_pxa_oscr0.shift);
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 5f1d55963ced..bd2aa4f16141 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -624,7 +624,7 @@ static struct clock_event_device timer0_clockevent = {
624 .set_mode = timer_set_mode, 624 .set_mode = timer_set_mode,
625 .set_next_event = timer_set_next_event, 625 .set_next_event = timer_set_next_event,
626 .rating = 300, 626 .rating = 300,
627 .cpumask = CPU_MASK_ALL, 627 .cpumask = cpu_all_mask,
628}; 628};
629 629
630static void __init realview_clockevents_init(unsigned int timer_irq) 630static void __init realview_clockevents_init(unsigned int timer_irq)
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 63be2abdc19c..44269b162d49 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -31,7 +31,7 @@
31static struct amba_device name##_device = { \ 31static struct amba_device name##_device = { \
32 .dev = { \ 32 .dev = { \
33 .coherent_dma_mask = ~0, \ 33 .coherent_dma_mask = ~0, \
34 .bus_id = busid, \ 34 .init_name = busid, \
35 .platform_data = plat, \ 35 .platform_data = plat, \
36 }, \ 36 }, \
37 .res = { \ 37 .res = { \
diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c
index 9019ef2e5611..67d6d9cc68b2 100644
--- a/arch/arm/mach-realview/localtimer.c
+++ b/arch/arm/mach-realview/localtimer.c
@@ -154,7 +154,7 @@ void __cpuinit local_timer_setup(void)
154 clk->set_mode = local_timer_set_mode; 154 clk->set_mode = local_timer_set_mode;
155 clk->set_next_event = local_timer_set_next_event; 155 clk->set_next_event = local_timer_set_next_event;
156 clk->irq = IRQ_LOCALTIMER; 156 clk->irq = IRQ_LOCALTIMER;
157 clk->cpumask = cpumask_of_cpu(cpu); 157 clk->cpumask = cpumask_of(cpu);
158 clk->shift = 20; 158 clk->shift = 20;
159 clk->mult = div_sc(mpcore_timer_rate, NSEC_PER_SEC, clk->shift); 159 clk->mult = div_sc(mpcore_timer_rate, NSEC_PER_SEC, clk->shift);
160 clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk); 160 clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
@@ -193,7 +193,7 @@ void __cpuinit local_timer_setup(void)
193 clk->rating = 200; 193 clk->rating = 200;
194 clk->set_mode = dummy_timer_set_mode; 194 clk->set_mode = dummy_timer_set_mode;
195 clk->broadcast = smp_timer_broadcast; 195 clk->broadcast = smp_timer_broadcast;
196 clk->cpumask = cpumask_of_cpu(cpu); 196 clk->cpumask = cpumask_of(cpu);
197 197
198 clockevents_register_device(clk); 198 clockevents_register_device(clk);
199} 199}
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index 8fce85f33033..ea3c75595fa9 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -12,6 +12,7 @@
12#include <linux/errno.h> 12#include <linux/errno.h>
13#include <linux/delay.h> 13#include <linux/delay.h>
14#include <linux/device.h> 14#include <linux/device.h>
15#include <linux/jiffies.h>
15#include <linux/smp.h> 16#include <linux/smp.h>
16#include <linux/io.h> 17#include <linux/io.h>
17 18
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c2410/include/mach/gpio.h
index e0349af8a483..00476a573bbe 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c2410/include/mach/gpio.h
@@ -14,6 +14,7 @@
14#define gpio_get_value __gpio_get_value 14#define gpio_get_value __gpio_get_value
15#define gpio_set_value __gpio_set_value 15#define gpio_set_value __gpio_set_value
16#define gpio_cansleep __gpio_cansleep 16#define gpio_cansleep __gpio_cansleep
17#define gpio_to_irq __gpio_to_irq
17 18
18/* some boards require extra gpio capacity to support external 19/* some boards require extra gpio capacity to support external
19 * devices that need GPIO. 20 * devices that need GPIO.
diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c2410/include/mach/irqs.h
index 9565903d490b..49efce8cd4a7 100644
--- a/arch/arm/mach-s3c2410/include/mach/irqs.h
+++ b/arch/arm/mach-s3c2410/include/mach/irqs.h
@@ -12,10 +12,6 @@
12#ifndef __ASM_ARCH_IRQS_H 12#ifndef __ASM_ARCH_IRQS_H
13#define __ASM_ARCH_IRQS_H __FILE__ 13#define __ASM_ARCH_IRQS_H __FILE__
14 14
15#ifndef __ASM_ARM_IRQ_H
16#error "Do not include this directly, instead #include <asm/irq.h>"
17#endif
18
19/* we keep the first set of CPU IRQs out of the range of 15/* we keep the first set of CPU IRQs out of the range of
20 * the ISA space, so that the PC104 has them to itself 16 * the ISA space, so that the PC104 has them to itself
21 * and we don't end up having to do horrible things to the 17 * and we don't end up having to do horrible things to the
diff --git a/arch/arm/mach-s3c2410/include/mach/spi.h b/arch/arm/mach-s3c2410/include/mach/spi.h
index 774f3adfe8ad..1d300fb112b1 100644
--- a/arch/arm/mach-s3c2410/include/mach/spi.h
+++ b/arch/arm/mach-s3c2410/include/mach/spi.h
@@ -14,7 +14,7 @@
14#define __ASM_ARCH_SPI_H __FILE__ 14#define __ASM_ARCH_SPI_H __FILE__
15 15
16struct s3c2410_spi_info { 16struct s3c2410_spi_info {
17 unsigned long pin_cs; /* simple gpio cs */ 17 int pin_cs; /* simple gpio cs */
18 unsigned int num_cs; /* total chipselects */ 18 unsigned int num_cs; /* total chipselects */
19 int bus_num; /* bus number to use. */ 19 int bus_num; /* bus number to use. */
20 20
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c2440/mach-at2440evb.c
index 0a6d0a5d961b..315c42e31278 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c2440/mach-at2440evb.c
@@ -47,7 +47,7 @@
47#include <plat/clock.h> 47#include <plat/clock.h>
48#include <plat/devs.h> 48#include <plat/devs.h>
49#include <plat/cpu.h> 49#include <plat/cpu.h>
50#include <asm/plat-s3c24xx/mci.h> 50#include <plat/mci.h>
51 51
52static struct map_desc at2440evb_iodesc[] __initdata = { 52static struct map_desc at2440evb_iodesc[] __initdata = {
53 /* Nothing here */ 53 /* Nothing here */
diff --git a/arch/arm/mach-s3c6400/include/mach/irqs.h b/arch/arm/mach-s3c6400/include/mach/irqs.h
index b38c47cffc28..4c97f9a4370b 100644
--- a/arch/arm/mach-s3c6400/include/mach/irqs.h
+++ b/arch/arm/mach-s3c6400/include/mach/irqs.h
@@ -11,10 +11,6 @@
11#ifndef __ASM_ARCH_IRQS_H 11#ifndef __ASM_ARCH_IRQS_H
12#define __ASM_ARCH_IRQS_H __FILE__ 12#define __ASM_ARCH_IRQS_H __FILE__
13 13
14#ifndef __ASM_ARM_IRQ_H
15#error "Do not include this directly, instead #include <asm/irq.h>"
16#endif
17
18#include <plat/irqs.h> 14#include <plat/irqs.h>
19 15
20#endif /* __ASM_ARCH_IRQ_H */ 16#endif /* __ASM_ARCH_IRQ_H */
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 8c5e727f3b75..711c0295c66f 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -73,7 +73,6 @@ static struct clock_event_device ckevt_sa1100_osmr0 = {
73 .features = CLOCK_EVT_FEAT_ONESHOT, 73 .features = CLOCK_EVT_FEAT_ONESHOT,
74 .shift = 32, 74 .shift = 32,
75 .rating = 200, 75 .rating = 200,
76 .cpumask = CPU_MASK_CPU0,
77 .set_next_event = sa1100_osmr0_set_next_event, 76 .set_next_event = sa1100_osmr0_set_next_event,
78 .set_mode = sa1100_osmr0_set_mode, 77 .set_mode = sa1100_osmr0_set_mode,
79}; 78};
@@ -110,6 +109,7 @@ static void __init sa1100_timer_init(void)
110 clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0); 109 clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0);
111 ckevt_sa1100_osmr0.min_delta_ns = 110 ckevt_sa1100_osmr0.min_delta_ns =
112 clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1; 111 clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1;
112 ckevt_sa1100_osmr0.cpumask = cpumask_of(0);
113 113
114 cksrc_sa1100_oscr.mult = 114 cksrc_sa1100_oscr.mult =
115 clocksource_hz2mult(CLOCK_TICK_RATE, cksrc_sa1100_oscr.shift); 115 clocksource_hz2mult(CLOCK_TICK_RATE, cksrc_sa1100_oscr.shift);
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index df25aa138509..1c43494f5c42 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -1005,7 +1005,7 @@ static void __init versatile_timer_init(void)
1005 timer0_clockevent.min_delta_ns = 1005 timer0_clockevent.min_delta_ns =
1006 clockevent_delta2ns(0xf, &timer0_clockevent); 1006 clockevent_delta2ns(0xf, &timer0_clockevent);
1007 1007
1008 timer0_clockevent.cpumask = cpumask_of_cpu(0); 1008 timer0_clockevent.cpumask = cpumask_of(0);
1009 clockevents_register_device(&timer0_clockevent); 1009 clockevents_register_device(&timer0_clockevent);
1010} 1010}
1011 1011
diff --git a/arch/arm/mach-versatile/core.h b/arch/arm/mach-versatile/core.h
index afcaa858eb1f..9d39886a8351 100644
--- a/arch/arm/mach-versatile/core.h
+++ b/arch/arm/mach-versatile/core.h
@@ -34,7 +34,7 @@ extern unsigned int mmc_status(struct device *dev);
34static struct amba_device name##_device = { \ 34static struct amba_device name##_device = { \
35 .dev = { \ 35 .dev = { \
36 .coherent_dma_mask = ~0, \ 36 .coherent_dma_mask = ~0, \
37 .bus_id = busid, \ 37 .init_name = busid, \
38 .platform_data = plat, \ 38 .platform_data = plat, \
39 }, \ 39 }, \
40 .res = { \ 40 .res = { \
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 67960017dc8f..310e479309ef 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -71,7 +71,7 @@ static DEFINE_SPINLOCK(consistent_lock);
71 * the amount of RAM found at boot time.) I would imagine that get_vm_area() 71 * the amount of RAM found at boot time.) I would imagine that get_vm_area()
72 * would have to initialise this each time prior to calling vm_region_alloc(). 72 * would have to initialise this each time prior to calling vm_region_alloc().
73 */ 73 */
74struct vm_region { 74struct arm_vm_region {
75 struct list_head vm_list; 75 struct list_head vm_list;
76 unsigned long vm_start; 76 unsigned long vm_start;
77 unsigned long vm_end; 77 unsigned long vm_end;
@@ -79,20 +79,20 @@ struct vm_region {
79 int vm_active; 79 int vm_active;
80}; 80};
81 81
82static struct vm_region consistent_head = { 82static struct arm_vm_region consistent_head = {
83 .vm_list = LIST_HEAD_INIT(consistent_head.vm_list), 83 .vm_list = LIST_HEAD_INIT(consistent_head.vm_list),
84 .vm_start = CONSISTENT_BASE, 84 .vm_start = CONSISTENT_BASE,
85 .vm_end = CONSISTENT_END, 85 .vm_end = CONSISTENT_END,
86}; 86};
87 87
88static struct vm_region * 88static struct arm_vm_region *
89vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp) 89arm_vm_region_alloc(struct arm_vm_region *head, size_t size, gfp_t gfp)
90{ 90{
91 unsigned long addr = head->vm_start, end = head->vm_end - size; 91 unsigned long addr = head->vm_start, end = head->vm_end - size;
92 unsigned long flags; 92 unsigned long flags;
93 struct vm_region *c, *new; 93 struct arm_vm_region *c, *new;
94 94
95 new = kmalloc(sizeof(struct vm_region), gfp); 95 new = kmalloc(sizeof(struct arm_vm_region), gfp);
96 if (!new) 96 if (!new)
97 goto out; 97 goto out;
98 98
@@ -127,9 +127,9 @@ vm_region_alloc(struct vm_region *head, size_t size, gfp_t gfp)
127 return NULL; 127 return NULL;
128} 128}
129 129
130static struct vm_region *vm_region_find(struct vm_region *head, unsigned long addr) 130static struct arm_vm_region *arm_vm_region_find(struct arm_vm_region *head, unsigned long addr)
131{ 131{
132 struct vm_region *c; 132 struct arm_vm_region *c;
133 133
134 list_for_each_entry(c, &head->vm_list, vm_list) { 134 list_for_each_entry(c, &head->vm_list, vm_list) {
135 if (c->vm_active && c->vm_start == addr) 135 if (c->vm_active && c->vm_start == addr)
@@ -149,7 +149,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
149 pgprot_t prot) 149 pgprot_t prot)
150{ 150{
151 struct page *page; 151 struct page *page;
152 struct vm_region *c; 152 struct arm_vm_region *c;
153 unsigned long order; 153 unsigned long order;
154 u64 mask = ISA_DMA_THRESHOLD, limit; 154 u64 mask = ISA_DMA_THRESHOLD, limit;
155 155
@@ -214,7 +214,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
214 /* 214 /*
215 * Allocate a virtual address in the consistent mapping region. 215 * Allocate a virtual address in the consistent mapping region.
216 */ 216 */
217 c = vm_region_alloc(&consistent_head, size, 217 c = arm_vm_region_alloc(&consistent_head, size,
218 gfp & ~(__GFP_DMA | __GFP_HIGHMEM)); 218 gfp & ~(__GFP_DMA | __GFP_HIGHMEM));
219 if (c) { 219 if (c) {
220 pte_t *pte; 220 pte_t *pte;
@@ -311,13 +311,13 @@ static int dma_mmap(struct device *dev, struct vm_area_struct *vma,
311 void *cpu_addr, dma_addr_t dma_addr, size_t size) 311 void *cpu_addr, dma_addr_t dma_addr, size_t size)
312{ 312{
313 unsigned long flags, user_size, kern_size; 313 unsigned long flags, user_size, kern_size;
314 struct vm_region *c; 314 struct arm_vm_region *c;
315 int ret = -ENXIO; 315 int ret = -ENXIO;
316 316
317 user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 317 user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
318 318
319 spin_lock_irqsave(&consistent_lock, flags); 319 spin_lock_irqsave(&consistent_lock, flags);
320 c = vm_region_find(&consistent_head, (unsigned long)cpu_addr); 320 c = arm_vm_region_find(&consistent_head, (unsigned long)cpu_addr);
321 spin_unlock_irqrestore(&consistent_lock, flags); 321 spin_unlock_irqrestore(&consistent_lock, flags);
322 322
323 if (c) { 323 if (c) {
@@ -359,7 +359,7 @@ EXPORT_SYMBOL(dma_mmap_writecombine);
359 */ 359 */
360void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle) 360void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr_t handle)
361{ 361{
362 struct vm_region *c; 362 struct arm_vm_region *c;
363 unsigned long flags, addr; 363 unsigned long flags, addr;
364 pte_t *ptep; 364 pte_t *ptep;
365 int idx; 365 int idx;
@@ -378,7 +378,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr
378 size = PAGE_ALIGN(size); 378 size = PAGE_ALIGN(size);
379 379
380 spin_lock_irqsave(&consistent_lock, flags); 380 spin_lock_irqsave(&consistent_lock, flags);
381 c = vm_region_find(&consistent_head, (unsigned long)cpu_addr); 381 c = arm_vm_region_find(&consistent_head, (unsigned long)cpu_addr);
382 if (!c) 382 if (!c)
383 goto no_area; 383 goto no_area;
384 384
diff --git a/arch/arm/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c
index 4de366e8b4c5..6d6bd5899240 100644
--- a/arch/arm/oprofile/op_model_mpcore.c
+++ b/arch/arm/oprofile/op_model_mpcore.c
@@ -260,10 +260,10 @@ static void em_stop(void)
260static void em_route_irq(int irq, unsigned int cpu) 260static void em_route_irq(int irq, unsigned int cpu)
261{ 261{
262 struct irq_desc *desc = irq_desc + irq; 262 struct irq_desc *desc = irq_desc + irq;
263 cpumask_t mask = cpumask_of_cpu(cpu); 263 const struct cpumask *mask = cpumask_of(cpu);
264 264
265 spin_lock_irq(&desc->lock); 265 spin_lock_irq(&desc->lock);
266 desc->affinity = mask; 266 desc->affinity = *mask;
267 desc->chip->set_affinity(irq, mask); 267 desc->chip->set_affinity(irq, mask);
268 spin_unlock_irq(&desc->lock); 268 spin_unlock_irq(&desc->lock);
269} 269}
diff --git a/arch/arm/plat-mxc/include/mach/usb.h b/arch/arm/plat-mxc/include/mach/usb.h
new file mode 100644
index 000000000000..2dacb3086f1c
--- /dev/null
+++ b/arch/arm/plat-mxc/include/mach/usb.h
@@ -0,0 +1,23 @@
1/*
2 * Copyright (C) 2008 Darius Augulis <augulis.darius@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef __ASM_ARCH_MXC_USB
16#define __ASM_ARCH_MXC_USB
17
18struct imxusb_platform_data {
19 int (*init)(struct device *);
20 int (*exit)(struct device *);
21};
22
23#endif /* __ASM_ARCH_MXC_USB */
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index fd28f5194f71..758a1293bcfa 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -190,7 +190,7 @@ static int __init mxc_clockevent_init(void)
190 clockevent_mxc.min_delta_ns = 190 clockevent_mxc.min_delta_ns =
191 clockevent_delta2ns(0xff, &clockevent_mxc); 191 clockevent_delta2ns(0xff, &clockevent_mxc);
192 192
193 clockevent_mxc.cpumask = cpumask_of_cpu(0); 193 clockevent_mxc.cpumask = cpumask_of(0);
194 194
195 clockevents_register_device(&clockevent_mxc); 195 clockevents_register_device(&clockevent_mxc);
196 196
diff --git a/arch/arm/plat-omap/i2c.c b/arch/arm/plat-omap/i2c.c
index 89a6ab0b7db8..467531edefd3 100644
--- a/arch/arm/plat-omap/i2c.c
+++ b/arch/arm/plat-omap/i2c.c
@@ -26,6 +26,7 @@
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/platform_device.h> 27#include <linux/platform_device.h>
28#include <linux/i2c.h> 28#include <linux/i2c.h>
29#include <mach/irqs.h>
29#include <mach/mux.h> 30#include <mach/mux.h>
30 31
31#define OMAP_I2C_SIZE 0x3f 32#define OMAP_I2C_SIZE 0x3f
diff --git a/arch/arm/plat-omap/include/mach/memory.h b/arch/arm/plat-omap/include/mach/memory.h
index 211c9f6619e9..d6b5ca6c7da2 100644
--- a/arch/arm/plat-omap/include/mach/memory.h
+++ b/arch/arm/plat-omap/include/mach/memory.h
@@ -59,7 +59,7 @@
59 59
60#define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET) 60#define virt_to_lbus(x) ((x) - PAGE_OFFSET + OMAP1510_LB_OFFSET)
61#define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET) 61#define lbus_to_virt(x) ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
62#define is_lbus_device(dev) (cpu_is_omap15xx() && dev && (strncmp(dev->bus_id, "ohci", 4) == 0)) 62#define is_lbus_device(dev) (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0))
63 63
64#define __arch_page_to_dma(dev, page) ({is_lbus_device(dev) ? \ 64#define __arch_page_to_dma(dev, page) ({is_lbus_device(dev) ? \
65 (dma_addr_t)virt_to_lbus(page_address(page)) : \ 65 (dma_addr_t)virt_to_lbus(page_address(page)) : \
diff --git a/arch/arm/plat-omap/usb.c b/arch/arm/plat-omap/usb.c
index 67ca1e216df7..add0485703b5 100644
--- a/arch/arm/plat-omap/usb.c
+++ b/arch/arm/plat-omap/usb.c
@@ -77,38 +77,6 @@
77 77
78/*-------------------------------------------------------------------------*/ 78/*-------------------------------------------------------------------------*/
79 79
80#if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_USB_MUSB_OTG)
81
82static struct otg_transceiver *xceiv;
83
84/**
85 * otg_get_transceiver - find the (single) OTG transceiver driver
86 *
87 * Returns the transceiver driver, after getting a refcount to it; or
88 * null if there is no such transceiver. The caller is responsible for
89 * releasing that count.
90 */
91struct otg_transceiver *otg_get_transceiver(void)
92{
93 if (xceiv)
94 get_device(xceiv->dev);
95 return xceiv;
96}
97EXPORT_SYMBOL(otg_get_transceiver);
98
99int otg_set_transceiver(struct otg_transceiver *x)
100{
101 if (xceiv && x)
102 return -EBUSY;
103 xceiv = x;
104 return 0;
105}
106EXPORT_SYMBOL(otg_set_transceiver);
107
108#endif
109
110/*-------------------------------------------------------------------------*/
111
112#if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP15XX) 80#if defined(CONFIG_ARCH_OMAP_OTG) || defined(CONFIG_ARCH_OMAP15XX)
113 81
114static void omap2_usb_devconf_clear(u8 port, u32 mask) 82static void omap2_usb_devconf_clear(u8 port, u32 mask)
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index 544d6b327f3a..6fa2923e6dca 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -149,7 +149,6 @@ static struct clock_event_device orion_clkevt = {
149 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC, 149 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
150 .shift = 32, 150 .shift = 32,
151 .rating = 300, 151 .rating = 300,
152 .cpumask = CPU_MASK_CPU0,
153 .set_next_event = orion_clkevt_next_event, 152 .set_next_event = orion_clkevt_next_event,
154 .set_mode = orion_clkevt_mode, 153 .set_mode = orion_clkevt_mode,
155}; 154};
@@ -199,5 +198,6 @@ void __init orion_time_init(unsigned int irq, unsigned int tclk)
199 orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift); 198 orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift);
200 orion_clkevt.max_delta_ns = clockevent_delta2ns(0xfffffffe, &orion_clkevt); 199 orion_clkevt.max_delta_ns = clockevent_delta2ns(0xfffffffe, &orion_clkevt);
201 orion_clkevt.min_delta_ns = clockevent_delta2ns(1, &orion_clkevt); 200 orion_clkevt.min_delta_ns = clockevent_delta2ns(1, &orion_clkevt);
201 orion_clkevt.cpumask = cpumask_of(0);
202 clockevents_register_device(&orion_clkevt); 202 clockevents_register_device(&orion_clkevt);
203} 203}
diff --git a/arch/arm/plat-s3c/dev-fb.c b/arch/arm/plat-s3c/dev-fb.c
index 0454b8ec02e2..a90198fc4b0f 100644
--- a/arch/arm/plat-s3c/dev-fb.c
+++ b/arch/arm/plat-s3c/dev-fb.c
@@ -16,6 +16,7 @@
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/fb.h> 17#include <linux/fb.h>
18 18
19#include <mach/irqs.h>
19#include <mach/map.h> 20#include <mach/map.h>
20#include <mach/regs-fb.h> 21#include <mach/regs-fb.h>
21 22
diff --git a/arch/arm/plat-s3c/dev-i2c0.c b/arch/arm/plat-s3c/dev-i2c0.c
index 2c0128c77c6e..fe327074037e 100644
--- a/arch/arm/plat-s3c/dev-i2c0.c
+++ b/arch/arm/plat-s3c/dev-i2c0.c
@@ -15,6 +15,7 @@
15#include <linux/string.h> 15#include <linux/string.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17 17
18#include <mach/irqs.h>
18#include <mach/map.h> 19#include <mach/map.h>
19 20
20#include <plat/regs-iic.h> 21#include <plat/regs-iic.h>
diff --git a/arch/arm/plat-s3c/dev-i2c1.c b/arch/arm/plat-s3c/dev-i2c1.c
index 9658fb0aec95..2387fbf57af6 100644
--- a/arch/arm/plat-s3c/dev-i2c1.c
+++ b/arch/arm/plat-s3c/dev-i2c1.c
@@ -15,6 +15,7 @@
15#include <linux/string.h> 15#include <linux/string.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17 17
18#include <mach/irqs.h>
18#include <mach/map.h> 19#include <mach/map.h>
19 20
20#include <plat/regs-iic.h> 21#include <plat/regs-iic.h>
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c
index f95c6c9d9f1a..94a341aaa4e4 100644
--- a/arch/arm/plat-s3c24xx/gpiolib.c
+++ b/arch/arm/plat-s3c24xx/gpiolib.c
@@ -59,6 +59,22 @@ static int s3c24xx_gpiolib_banka_output(struct gpio_chip *chip,
59 return 0; 59 return 0;
60} 60}
61 61
62static int s3c24xx_gpiolib_bankf_toirq(struct gpio_chip *chip, unsigned offset)
63{
64 if (offset < 4)
65 return IRQ_EINT0 + offset;
66
67 if (offset < 8)
68 return IRQ_EINT4 + offset - 4;
69
70 return -EINVAL;
71}
72
73static int s3c24xx_gpiolib_bankg_toirq(struct gpio_chip *chip, unsigned offset)
74{
75 return IRQ_EINT8 + offset;
76}
77
62struct s3c_gpio_chip s3c24xx_gpios[] = { 78struct s3c_gpio_chip s3c24xx_gpios[] = {
63 [0] = { 79 [0] = {
64 .base = S3C24XX_GPIO_BASE(S3C2410_GPA0), 80 .base = S3C24XX_GPIO_BASE(S3C2410_GPA0),
@@ -114,6 +130,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
114 .owner = THIS_MODULE, 130 .owner = THIS_MODULE,
115 .label = "GPIOF", 131 .label = "GPIOF",
116 .ngpio = 8, 132 .ngpio = 8,
133 .to_irq = s3c24xx_gpiolib_bankf_toirq,
117 }, 134 },
118 }, 135 },
119 [6] = { 136 [6] = {
@@ -123,6 +140,7 @@ struct s3c_gpio_chip s3c24xx_gpios[] = {
123 .owner = THIS_MODULE, 140 .owner = THIS_MODULE,
124 .label = "GPIOG", 141 .label = "GPIOG",
125 .ngpio = 10, 142 .ngpio = 10,
143 .to_irq = s3c24xx_gpiolib_bankg_toirq,
126 }, 144 },
127 }, 145 },
128}; 146};
diff --git a/arch/arm/plat-s3c24xx/pwm.c b/arch/arm/plat-s3c24xx/pwm.c
index ec56b88866c4..0120b760315b 100644
--- a/arch/arm/plat-s3c24xx/pwm.c
+++ b/arch/arm/plat-s3c24xx/pwm.c
@@ -19,6 +19,8 @@
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/pwm.h> 20#include <linux/pwm.h>
21 21
22#include <mach/irqs.h>
23
22#include <plat/devs.h> 24#include <plat/devs.h>
23#include <plat/regs-timer.h> 25#include <plat/regs-timer.h>
24 26
diff --git a/arch/arm/plat-s3c64xx/include/plat/irqs.h b/arch/arm/plat-s3c64xx/include/plat/irqs.h
index 02e8dd4c97d5..2846f550b727 100644
--- a/arch/arm/plat-s3c64xx/include/plat/irqs.h
+++ b/arch/arm/plat-s3c64xx/include/plat/irqs.h
@@ -191,7 +191,7 @@
191#define IRQ_EINT_GROUP8_BASE (IRQ_EINT_GROUP7_BASE + IRQ_EINT_GROUP7_NR) 191#define IRQ_EINT_GROUP8_BASE (IRQ_EINT_GROUP7_BASE + IRQ_EINT_GROUP7_NR)
192#define IRQ_EINT_GROUP9_BASE (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR) 192#define IRQ_EINT_GROUP9_BASE (IRQ_EINT_GROUP8_BASE + IRQ_EINT_GROUP8_NR)
193 193
194#define IRQ_EINT_GROUP(group, no) (IRQ_EINT_GROUP##group##__BASE + (x)) 194#define IRQ_EINT_GROUP(group, no) (IRQ_EINT_GROUP##group##_BASE + (no))
195 195
196/* Set the default NR_IRQS */ 196/* Set the default NR_IRQS */
197 197
diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 26eca87f6735..b189680d18b0 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -122,6 +122,24 @@ config BOARD_ATNGW100
122 bool "ATNGW100 Network Gateway" 122 bool "ATNGW100 Network Gateway"
123 select CPU_AT32AP7000 123 select CPU_AT32AP7000
124 124
125config BOARD_HAMMERHEAD
126 bool "Hammerhead board"
127 select CPU_AT32AP7000
128 select USB_ARCH_HAS_HCD
129 help
130 The Hammerhead platform is built around a AVR32 32-bit microcontroller from Atmel.
131 It offers versatile peripherals, such as ethernet, usb device, usb host etc.
132
133 The board also incooperates a power supply and is a Power over Ethernet (PoE) Powered
134 Device (PD).
135
136 Additonally, a Cyclone III FPGA from Altera is integrated on the board. The FPGA is
137 mapped into the 32-bit AVR memory bus. The FPGA offers two DDR2 SDRAM interfaces, which
138 will cover even the most exceptional need of memory bandwidth. Together with the onboard
139 video decoder the board is ready for video processing.
140
141 For more information see: http://www.miromico.com/hammerhead
142
125config BOARD_FAVR_32 143config BOARD_FAVR_32
126 bool "Favr-32 LCD-board" 144 bool "Favr-32 LCD-board"
127 select CPU_AT32AP7000 145 select CPU_AT32AP7000
@@ -133,6 +151,7 @@ endchoice
133 151
134source "arch/avr32/boards/atstk1000/Kconfig" 152source "arch/avr32/boards/atstk1000/Kconfig"
135source "arch/avr32/boards/atngw100/Kconfig" 153source "arch/avr32/boards/atngw100/Kconfig"
154source "arch/avr32/boards/hammerhead/Kconfig"
136source "arch/avr32/boards/favr-32/Kconfig" 155source "arch/avr32/boards/favr-32/Kconfig"
137 156
138choice 157choice
diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile
index b088e103e753..f3ef3bbf797c 100644
--- a/arch/avr32/Makefile
+++ b/arch/avr32/Makefile
@@ -33,6 +33,7 @@ head-y += arch/avr32/kernel/head.o
33core-y += $(machdirs) 33core-y += $(machdirs)
34core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/ 34core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/
35core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/ 35core-$(CONFIG_BOARD_ATNGW100) += arch/avr32/boards/atngw100/
36core-$(CONFIG_BOARD_HAMMERHEAD) += arch/avr32/boards/hammerhead/
36core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/ 37core-$(CONFIG_BOARD_FAVR_32) += arch/avr32/boards/favr-32/
37core-$(CONFIG_BOARD_MIMC200) += arch/avr32/boards/mimc200/ 38core-$(CONFIG_BOARD_MIMC200) += arch/avr32/boards/mimc200/
38core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/ 39core-$(CONFIG_LOADER_U_BOOT) += arch/avr32/boot/u-boot/
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c
index 32fb9ba0fbdf..05d3722fff18 100644
--- a/arch/avr32/boards/atngw100/setup.c
+++ b/arch/avr32/boards/atngw100/setup.c
@@ -19,8 +19,8 @@
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/leds.h> 20#include <linux/leds.h>
21#include <linux/spi/spi.h> 21#include <linux/spi/spi.h>
22#include <linux/atmel-mci.h>
22 23
23#include <asm/atmel-mci.h>
24#include <asm/io.h> 24#include <asm/io.h>
25#include <asm/setup.h> 25#include <asm/setup.h>
26 26
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c
index 5c5cdf3b464f..1f33a106905c 100644
--- a/arch/avr32/boards/atstk1000/atstk1002.c
+++ b/arch/avr32/boards/atstk1000/atstk1002.c
@@ -16,12 +16,12 @@
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/spi/spi.h> 17#include <linux/spi/spi.h>
18#include <linux/spi/at73c213.h> 18#include <linux/spi/at73c213.h>
19#include <linux/atmel-mci.h>
19 20
20#include <video/atmel_lcdc.h> 21#include <video/atmel_lcdc.h>
21 22
22#include <asm/io.h> 23#include <asm/io.h>
23#include <asm/setup.h> 24#include <asm/setup.h>
24#include <asm/atmel-mci.h>
25 25
26#include <mach/at32ap700x.h> 26#include <mach/at32ap700x.h>
27#include <mach/board.h> 27#include <mach/board.h>
@@ -287,23 +287,7 @@ static int __init atstk1002_init(void)
287 * ATSTK1000 uses 32-bit SDRAM interface. Reserve the 287 * ATSTK1000 uses 32-bit SDRAM interface. Reserve the
288 * SDRAM-specific pins so that nobody messes with them. 288 * SDRAM-specific pins so that nobody messes with them.
289 */ 289 */
290 at32_reserve_pin(GPIO_PIN_PE(0)); /* DATA[16] */ 290 at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL);
291 at32_reserve_pin(GPIO_PIN_PE(1)); /* DATA[17] */
292 at32_reserve_pin(GPIO_PIN_PE(2)); /* DATA[18] */
293 at32_reserve_pin(GPIO_PIN_PE(3)); /* DATA[19] */
294 at32_reserve_pin(GPIO_PIN_PE(4)); /* DATA[20] */
295 at32_reserve_pin(GPIO_PIN_PE(5)); /* DATA[21] */
296 at32_reserve_pin(GPIO_PIN_PE(6)); /* DATA[22] */
297 at32_reserve_pin(GPIO_PIN_PE(7)); /* DATA[23] */
298 at32_reserve_pin(GPIO_PIN_PE(8)); /* DATA[24] */
299 at32_reserve_pin(GPIO_PIN_PE(9)); /* DATA[25] */
300 at32_reserve_pin(GPIO_PIN_PE(10)); /* DATA[26] */
301 at32_reserve_pin(GPIO_PIN_PE(11)); /* DATA[27] */
302 at32_reserve_pin(GPIO_PIN_PE(12)); /* DATA[28] */
303 at32_reserve_pin(GPIO_PIN_PE(13)); /* DATA[29] */
304 at32_reserve_pin(GPIO_PIN_PE(14)); /* DATA[30] */
305 at32_reserve_pin(GPIO_PIN_PE(15)); /* DATA[31] */
306 at32_reserve_pin(GPIO_PIN_PE(26)); /* SDCS */
307 291
308#ifdef CONFIG_BOARD_ATSTK1006 292#ifdef CONFIG_BOARD_ATSTK1006
309 smc_set_timing(&nand_config, &nand_timing); 293 smc_set_timing(&nand_config, &nand_timing);
diff --git a/arch/avr32/boards/atstk1000/atstk1003.c b/arch/avr32/boards/atstk1000/atstk1003.c
index 134b566630b0..b3a23c88bcfe 100644
--- a/arch/avr32/boards/atstk1000/atstk1003.c
+++ b/arch/avr32/boards/atstk1000/atstk1003.c
@@ -17,9 +17,9 @@
17 17
18#include <linux/spi/at73c213.h> 18#include <linux/spi/at73c213.h>
19#include <linux/spi/spi.h> 19#include <linux/spi/spi.h>
20#include <linux/atmel-mci.h>
20 21
21#include <asm/setup.h> 22#include <asm/setup.h>
22#include <asm/atmel-mci.h>
23 23
24#include <mach/at32ap700x.h> 24#include <mach/at32ap700x.h>
25#include <mach/board.h> 25#include <mach/board.h>
@@ -131,23 +131,7 @@ static int __init atstk1003_init(void)
131 * ATSTK1000 uses 32-bit SDRAM interface. Reserve the 131 * ATSTK1000 uses 32-bit SDRAM interface. Reserve the
132 * SDRAM-specific pins so that nobody messes with them. 132 * SDRAM-specific pins so that nobody messes with them.
133 */ 133 */
134 at32_reserve_pin(GPIO_PIN_PE(0)); /* DATA[16] */ 134 at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL);
135 at32_reserve_pin(GPIO_PIN_PE(1)); /* DATA[17] */
136 at32_reserve_pin(GPIO_PIN_PE(2)); /* DATA[18] */
137 at32_reserve_pin(GPIO_PIN_PE(3)); /* DATA[19] */
138 at32_reserve_pin(GPIO_PIN_PE(4)); /* DATA[20] */
139 at32_reserve_pin(GPIO_PIN_PE(5)); /* DATA[21] */
140 at32_reserve_pin(GPIO_PIN_PE(6)); /* DATA[22] */
141 at32_reserve_pin(GPIO_PIN_PE(7)); /* DATA[23] */
142 at32_reserve_pin(GPIO_PIN_PE(8)); /* DATA[24] */
143 at32_reserve_pin(GPIO_PIN_PE(9)); /* DATA[25] */
144 at32_reserve_pin(GPIO_PIN_PE(10)); /* DATA[26] */
145 at32_reserve_pin(GPIO_PIN_PE(11)); /* DATA[27] */
146 at32_reserve_pin(GPIO_PIN_PE(12)); /* DATA[28] */
147 at32_reserve_pin(GPIO_PIN_PE(13)); /* DATA[29] */
148 at32_reserve_pin(GPIO_PIN_PE(14)); /* DATA[30] */
149 at32_reserve_pin(GPIO_PIN_PE(15)); /* DATA[31] */
150 at32_reserve_pin(GPIO_PIN_PE(26)); /* SDCS */
151 135
152#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM 136#ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM
153 at32_add_device_usart(1); 137 at32_add_device_usart(1);
diff --git a/arch/avr32/boards/atstk1000/atstk1004.c b/arch/avr32/boards/atstk1000/atstk1004.c
index cb32eb844aa7..29b35aca96cd 100644
--- a/arch/avr32/boards/atstk1000/atstk1004.c
+++ b/arch/avr32/boards/atstk1000/atstk1004.c
@@ -17,11 +17,11 @@
17 17
18#include <linux/spi/at73c213.h> 18#include <linux/spi/at73c213.h>
19#include <linux/spi/spi.h> 19#include <linux/spi/spi.h>
20#include <linux/atmel-mci.h>
20 21
21#include <video/atmel_lcdc.h> 22#include <video/atmel_lcdc.h>
22 23
23#include <asm/setup.h> 24#include <asm/setup.h>
24#include <asm/atmel-mci.h>
25 25
26#include <mach/at32ap700x.h> 26#include <mach/at32ap700x.h>
27#include <mach/board.h> 27#include <mach/board.h>
diff --git a/arch/avr32/boards/favr-32/setup.c b/arch/avr32/boards/favr-32/setup.c
index 1ee4faf0742d..745c408c2ac5 100644
--- a/arch/avr32/boards/favr-32/setup.c
+++ b/arch/avr32/boards/favr-32/setup.c
@@ -17,6 +17,7 @@
17#include <linux/linkage.h> 17#include <linux/linkage.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/leds.h> 19#include <linux/leds.h>
20#include <linux/atmel-mci.h>
20#include <linux/atmel-pwm-bl.h> 21#include <linux/atmel-pwm-bl.h>
21#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
22#include <linux/spi/ads7846.h> 23#include <linux/spi/ads7846.h>
@@ -79,6 +80,14 @@ static struct spi_board_info __initdata spi1_board_info[] = {
79 }, 80 },
80}; 81};
81 82
83static struct mci_platform_data __initdata mci0_data = {
84 .slot[0] = {
85 .bus_width = 4,
86 .detect_pin = -ENODEV,
87 .wp_pin = -ENODEV,
88 },
89};
90
82static struct fb_videomode __initdata lb104v03_modes[] = { 91static struct fb_videomode __initdata lb104v03_modes[] = {
83 { 92 {
84 .name = "640x480 @ 50", 93 .name = "640x480 @ 50",
@@ -307,28 +316,10 @@ static int __init favr32_init(void)
307 * Favr-32 uses 32-bit SDRAM interface. Reserve the SDRAM-specific 316 * Favr-32 uses 32-bit SDRAM interface. Reserve the SDRAM-specific
308 * pins so that nobody messes with them. 317 * pins so that nobody messes with them.
309 */ 318 */
310 at32_reserve_pin(GPIO_PIN_PE(0)); /* DATA[16] */ 319 at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL);
311 at32_reserve_pin(GPIO_PIN_PE(1)); /* DATA[17] */
312 at32_reserve_pin(GPIO_PIN_PE(2)); /* DATA[18] */
313 at32_reserve_pin(GPIO_PIN_PE(3)); /* DATA[19] */
314 at32_reserve_pin(GPIO_PIN_PE(4)); /* DATA[20] */
315 at32_reserve_pin(GPIO_PIN_PE(5)); /* DATA[21] */
316 at32_reserve_pin(GPIO_PIN_PE(6)); /* DATA[22] */
317 at32_reserve_pin(GPIO_PIN_PE(7)); /* DATA[23] */
318 at32_reserve_pin(GPIO_PIN_PE(8)); /* DATA[24] */
319 at32_reserve_pin(GPIO_PIN_PE(9)); /* DATA[25] */
320 at32_reserve_pin(GPIO_PIN_PE(10)); /* DATA[26] */
321 at32_reserve_pin(GPIO_PIN_PE(11)); /* DATA[27] */
322 at32_reserve_pin(GPIO_PIN_PE(12)); /* DATA[28] */
323 at32_reserve_pin(GPIO_PIN_PE(13)); /* DATA[29] */
324 at32_reserve_pin(GPIO_PIN_PE(14)); /* DATA[30] */
325 at32_reserve_pin(GPIO_PIN_PE(15)); /* DATA[31] */
326 at32_reserve_pin(GPIO_PIN_PE(26)); /* SDCS */
327 320
328 at32_select_gpio(GPIO_PIN_PB(3), 0); /* IRQ from ADS7843 */ 321 at32_select_gpio(GPIO_PIN_PB(3), 0); /* IRQ from ADS7843 */
329 322
330 at32_add_system_devices();
331
332 at32_add_device_usart(0); 323 at32_add_device_usart(0);
333 324
334 set_hw_addr(at32_add_device_eth(0, &eth_data[0])); 325 set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
@@ -339,7 +330,7 @@ static int __init favr32_init(void)
339 330
340 at32_add_device_pwm(1 << atmel_pwm_bl_pdata.pwm_channel); 331 at32_add_device_pwm(1 << atmel_pwm_bl_pdata.pwm_channel);
341 at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); 332 at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info));
342 at32_add_device_mci(0, NULL); 333 at32_add_device_mci(0, &mci0_data);
343 at32_add_device_usba(0, NULL); 334 at32_add_device_usba(0, NULL);
344 at32_add_device_lcdc(0, &favr32_lcdc_data, fbmem_start, fbmem_size, 0); 335 at32_add_device_lcdc(0, &favr32_lcdc_data, fbmem_start, fbmem_size, 0);
345 336
diff --git a/arch/avr32/boards/hammerhead/Kconfig b/arch/avr32/boards/hammerhead/Kconfig
new file mode 100644
index 000000000000..fda2331f9789
--- /dev/null
+++ b/arch/avr32/boards/hammerhead/Kconfig
@@ -0,0 +1,43 @@
1# Hammerhead customization
2
3if BOARD_HAMMERHEAD
4
5config BOARD_HAMMERHEAD_USB
6 bool "Philips ISP116x-hcd USB support"
7 help
8 This enables USB support for Hammerheads internal ISP116x
9 controller from Philips.
10
11 Choose 'Y' here if you want to have your board USB driven.
12
13config BOARD_HAMMERHEAD_LCD
14 bool "Atmel AT91/AT32 LCD support"
15 help
16 This enables LCD support for the Hammerhead board. You may
17 also add support for framebuffer devices (AT91/AT32 LCD Controller)
18 and framebuffer console support to get the most out of your LCD.
19
20 Choose 'Y' here if you have ordered a Corona daugther board and
21 want to have support for your Hantronix HDA-351T-LV LCD.
22
23config BOARD_HAMMERHEAD_SND
24 bool "Atmel AC97 Sound support"
25 help
26 This enables Sound support for the Hammerhead board. You may
27 also go trough the ALSA settings to get it working.
28
29 Choose 'Y' here if you have ordered a Corona daugther board and
30 want to make your board funky.
31
32config BOARD_HAMMERHEAD_FPGA
33 bool "Hammerhead FPGA Support"
34 default y
35 help
36 This adds support for the Cyclone III FPGA from Altera
37 found on Miromico's Hammerhead board.
38
39 Choose 'Y' here if you want to have FPGA support enabled.
40 You will have to choose the "Hammerhead FPGA Device Support" in
41 Device Drivers->Misc to be able to use FPGA functionality.
42
43endif # BOARD_ATNGW100
diff --git a/arch/avr32/boards/hammerhead/Makefile b/arch/avr32/boards/hammerhead/Makefile
new file mode 100644
index 000000000000..c740aa116755
--- /dev/null
+++ b/arch/avr32/boards/hammerhead/Makefile
@@ -0,0 +1 @@
obj-y += setup.o flash.o
diff --git a/arch/avr32/boards/hammerhead/flash.c b/arch/avr32/boards/hammerhead/flash.c
new file mode 100644
index 000000000000..a98c6dd3a028
--- /dev/null
+++ b/arch/avr32/boards/hammerhead/flash.c
@@ -0,0 +1,377 @@
1/*
2 * Hammerhead board-specific flash initialization
3 *
4 * Copyright (C) 2008 Miromico AG
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#include <linux/init.h>
12#include <linux/platform_device.h>
13#include <linux/mtd/mtd.h>
14#include <linux/mtd/partitions.h>
15#include <linux/mtd/physmap.h>
16#include <linux/usb/isp116x.h>
17#include <linux/dma-mapping.h>
18#include <linux/platform_device.h>
19#include <linux/delay.h>
20
21#include <mach/portmux.h>
22#include <mach/at32ap700x.h>
23#include <mach/smc.h>
24
25#include "../../mach-at32ap/clock.h"
26#include "flash.h"
27
28
29#define HAMMERHEAD_USB_PERIPH_GCLK0 0x40000000
30#define HAMMERHEAD_USB_PERIPH_CS2 0x02000000
31#define HAMMERHEAD_USB_PERIPH_EXTINT0 0x02000000
32
33#define HAMMERHEAD_FPGA_PERIPH_MOSI 0x00000002
34#define HAMMERHEAD_FPGA_PERIPH_SCK 0x00000020
35#define HAMMERHEAD_FPGA_PERIPH_EXTINT3 0x10000000
36
37static struct smc_timing flash_timing __initdata = {
38 .ncs_read_setup = 0,
39 .nrd_setup = 40,
40 .ncs_write_setup = 0,
41 .nwe_setup = 10,
42
43 .ncs_read_pulse = 80,
44 .nrd_pulse = 40,
45 .ncs_write_pulse = 65,
46 .nwe_pulse = 55,
47
48 .read_cycle = 120,
49 .write_cycle = 120,
50};
51
52static struct smc_config flash_config __initdata = {
53 .bus_width = 2,
54 .nrd_controlled = 1,
55 .nwe_controlled = 1,
56 .byte_write = 1,
57};
58
59static struct mtd_partition flash_parts[] = {
60 {
61 .name = "u-boot",
62 .offset = 0x00000000,
63 .size = 0x00020000, /* 128 KiB */
64 .mask_flags = MTD_WRITEABLE,
65 },
66 {
67 .name = "root",
68 .offset = 0x00020000,
69 .size = 0x007d0000,
70 },
71 {
72 .name = "env",
73 .offset = 0x007f0000,
74 .size = 0x00010000,
75 .mask_flags = MTD_WRITEABLE,
76 },
77};
78
79static struct physmap_flash_data flash_data = {
80 .width = 2,
81 .nr_parts = ARRAY_SIZE(flash_parts),
82 .parts = flash_parts,
83};
84
85static struct resource flash_resource = {
86 .start = 0x00000000,
87 .end = 0x007fffff,
88 .flags = IORESOURCE_MEM,
89};
90
91static struct platform_device flash_device = {
92 .name = "physmap-flash",
93 .id = 0,
94 .resource = &flash_resource,
95 .num_resources = 1,
96 .dev = { .platform_data = &flash_data, },
97};
98
99#ifdef CONFIG_BOARD_HAMMERHEAD_USB
100
101static struct smc_timing isp1160_timing __initdata = {
102 .ncs_read_setup = 75,
103 .nrd_setup = 75,
104 .ncs_write_setup = 75,
105 .nwe_setup = 75,
106
107
108 /* We use conservative timing settings, as the minimal settings aren't
109 stable. There may be room for tweaking. */
110 .ncs_read_pulse = 75, /* min. 33ns */
111 .nrd_pulse = 75, /* min. 33ns */
112 .ncs_write_pulse = 75, /* min. 26ns */
113 .nwe_pulse = 75, /* min. 26ns */
114
115 .read_cycle = 225, /* min. 143ns */
116 .write_cycle = 225, /* min. 136ns */
117};
118
119static struct smc_config isp1160_config __initdata = {
120 .bus_width = 2,
121 .nrd_controlled = 1,
122 .nwe_controlled = 1,
123 .byte_write = 0,
124};
125
126/*
127 * The platform delay function is only used to enforce the strange
128 * read to write delay. This can not be configured in the SMC. All other
129 * timings are controlled by the SMC (see timings obove)
130 * So in isp116x-hcd.c we should comment out USE_PLATFORM_DELAY
131 */
132void isp116x_delay(struct device *dev, int delay)
133{
134 if (delay > 150)
135 ndelay(delay - 150);
136}
137
138static struct isp116x_platform_data isp1160_data = {
139 .sel15Kres = 1, /* use internal downstream resistors */
140 .oc_enable = 0, /* external overcurrent detection */
141 .int_edge_triggered = 0, /* interrupt is level triggered */
142 .int_act_high = 0, /* interrupt is active low */
143 .delay = isp116x_delay, /* platform delay function */
144};
145
146static struct resource isp1160_resource[] = {
147 {
148 .start = 0x08000000,
149 .end = 0x08000001,
150 .flags = IORESOURCE_MEM,
151 },
152 {
153 .start = 0x08000002,
154 .end = 0x08000003,
155 .flags = IORESOURCE_MEM,
156 },
157 {
158 .start = 64,
159 .flags = IORESOURCE_IRQ,
160 },
161};
162
163static struct platform_device isp1160_device = {
164 .name = "isp116x-hcd",
165 .id = 0,
166 .resource = isp1160_resource,
167 .num_resources = 3,
168 .dev = {
169 .platform_data = &isp1160_data,
170 },
171};
172#endif
173
174#ifdef CONFIG_BOARD_HAMMERHEAD_USB
175static int __init hammerhead_usbh_init(void)
176{
177 struct clk *gclk;
178 struct clk *osc;
179
180 int ret;
181
182 /* setup smc for usbh */
183 smc_set_timing(&isp1160_config, &isp1160_timing);
184 ret = smc_set_configuration(2, &isp1160_config);
185
186 if (ret < 0) {
187 printk(KERN_ERR
188 "hammerhead: failed to set ISP1160 USBH timing\n");
189 return ret;
190 }
191
192 /* setup gclk0 to run from osc1 */
193 gclk = clk_get(NULL, "gclk0");
194 if (IS_ERR(gclk))
195 goto err_gclk;
196
197 osc = clk_get(NULL, "osc1");
198 if (IS_ERR(osc))
199 goto err_osc;
200
201 if (clk_set_parent(gclk, osc)) {
202 pr_debug("hammerhead: failed to set osc1 for USBH clock\n");
203 goto err_set_clk;
204 }
205
206 /* set clock to 6MHz */
207 clk_set_rate(gclk, 6000000);
208
209 /* and enable */
210 clk_enable(gclk);
211
212 /* select GCLK0 peripheral function */
213 at32_select_periph(GPIO_PIOA_BASE, HAMMERHEAD_USB_PERIPH_GCLK0,
214 GPIO_PERIPH_A, 0);
215
216 /* enable CS2 peripheral function */
217 at32_select_periph(GPIO_PIOE_BASE, HAMMERHEAD_USB_PERIPH_CS2,
218 GPIO_PERIPH_A, 0);
219
220 /* H_WAKEUP must be driven low */
221 at32_select_gpio(GPIO_PIN_PA(8), AT32_GPIOF_OUTPUT);
222
223 /* Select EXTINT0 for PB25 */
224 at32_select_periph(GPIO_PIOB_BASE, HAMMERHEAD_USB_PERIPH_EXTINT0,
225 GPIO_PERIPH_A, 0);
226
227 /* register usbh device driver */
228 platform_device_register(&isp1160_device);
229
230 err_set_clk:
231 clk_put(osc);
232 err_osc:
233 clk_put(gclk);
234 err_gclk:
235 return ret;
236}
237#endif
238
239#ifdef CONFIG_BOARD_HAMMERHEAD_FPGA
240static struct smc_timing fpga_timing __initdata = {
241 .ncs_read_setup = 16,
242 .nrd_setup = 32,
243 .ncs_read_pulse = 48,
244 .nrd_pulse = 32,
245 .read_cycle = 64,
246
247 .ncs_write_setup = 16,
248 .nwe_setup = 16,
249 .ncs_write_pulse = 32,
250 .nwe_pulse = 32,
251 .write_cycle = 64,
252};
253
254static struct smc_config fpga_config __initdata = {
255 .bus_width = 4,
256 .nrd_controlled = 1,
257 .nwe_controlled = 1,
258 .byte_write = 0,
259};
260
261static struct resource hh_fpga0_resource[] = {
262 {
263 .start = 0xffe00400,
264 .end = 0xffe00400 + 0x3ff,
265 .flags = IORESOURCE_MEM,
266 },
267 {
268 .start = 4,
269 .end = 4,
270 .flags = IORESOURCE_IRQ,
271 },
272 {
273 .start = 0x0c000000,
274 .end = 0x0c000100,
275 .flags = IORESOURCE_MEM,
276 },
277 {
278 .start = 67,
279 .end = 67,
280 .flags = IORESOURCE_IRQ,
281 },
282};
283
284static u64 hh_fpga0_dma_mask = DMA_32BIT_MASK;
285static struct platform_device hh_fpga0_device = {
286 .name = "hh_fpga",
287 .id = 0,
288 .dev = {
289 .dma_mask = &hh_fpga0_dma_mask,
290 .coherent_dma_mask = DMA_32BIT_MASK,
291 },
292 .resource = hh_fpga0_resource,
293 .num_resources = ARRAY_SIZE(hh_fpga0_resource),
294};
295
296static struct clk hh_fpga0_spi_clk = {
297 .name = "spi_clk",
298 .dev = &hh_fpga0_device.dev,
299 .mode = pba_clk_mode,
300 .get_rate = pba_clk_get_rate,
301 .index = 1,
302};
303
304struct platform_device *__init at32_add_device_hh_fpga(void)
305{
306 /* Select peripheral functionallity for SPI SCK and MOSI */
307 at32_select_periph(GPIO_PIOB_BASE, HAMMERHEAD_FPGA_PERIPH_SCK,
308 GPIO_PERIPH_B, 0);
309 at32_select_periph(GPIO_PIOB_BASE, HAMMERHEAD_FPGA_PERIPH_MOSI,
310 GPIO_PERIPH_B, 0);
311
312 /* reserve all other needed gpio
313 * We have on board pull ups, so there is no need
314 * to enable gpio pull ups */
315 /* INIT_DONE (input) */
316 at32_select_gpio(GPIO_PIN_PB(0), 0);
317
318 /* nSTATUS (input) */
319 at32_select_gpio(GPIO_PIN_PB(2), 0);
320
321 /* nCONFIG (output, low) */
322 at32_select_gpio(GPIO_PIN_PB(3), AT32_GPIOF_OUTPUT);
323
324 /* CONF_DONE (input) */
325 at32_select_gpio(GPIO_PIN_PB(4), 0);
326
327 /* Select EXTINT3 for PB28 (Interrupt from FPGA) */
328 at32_select_periph(GPIO_PIOB_BASE, HAMMERHEAD_FPGA_PERIPH_EXTINT3,
329 GPIO_PERIPH_A, 0);
330
331 /* Get our parent clock */
332 hh_fpga0_spi_clk.parent = clk_get(NULL, "pba");
333 clk_put(hh_fpga0_spi_clk.parent);
334
335 /* Register clock in at32 clock tree */
336 at32_clk_register(&hh_fpga0_spi_clk);
337
338 platform_device_register(&hh_fpga0_device);
339 return &hh_fpga0_device;
340}
341#endif
342
343/* This needs to be called after the SMC has been initialized */
344static int __init hammerhead_flash_init(void)
345{
346 int ret;
347
348 smc_set_timing(&flash_config, &flash_timing);
349 ret = smc_set_configuration(0, &flash_config);
350
351 if (ret < 0) {
352 printk(KERN_ERR "hammerhead: failed to set NOR flash timing\n");
353 return ret;
354 }
355
356 platform_device_register(&flash_device);
357
358#ifdef CONFIG_BOARD_HAMMERHEAD_USB
359 hammerhead_usbh_init();
360#endif
361
362#ifdef CONFIG_BOARD_HAMMERHEAD_FPGA
363 /* Setup SMC for FPGA interface */
364 smc_set_timing(&fpga_config, &fpga_timing);
365 ret = smc_set_configuration(3, &fpga_config);
366#endif
367
368
369 if (ret < 0) {
370 printk(KERN_ERR "hammerhead: failed to set FPGA timing\n");
371 return ret;
372 }
373
374 return 0;
375}
376
377device_initcall(hammerhead_flash_init);
diff --git a/arch/avr32/boards/hammerhead/flash.h b/arch/avr32/boards/hammerhead/flash.h
new file mode 100644
index 000000000000..ea70c626587b
--- /dev/null
+++ b/arch/avr32/boards/hammerhead/flash.h
@@ -0,0 +1,6 @@
1#ifndef __BOARDS_HAMMERHEAD_FLASH_H
2#define __BOARDS_HAMMERHEAD_FLASH_H
3
4struct platform_device *at32_add_device_hh_fpga(void);
5
6#endif /* __BOARDS_HAMMERHEAD_FLASH_H */
diff --git a/arch/avr32/boards/hammerhead/setup.c b/arch/avr32/boards/hammerhead/setup.c
new file mode 100644
index 000000000000..4d2fe82b2029
--- /dev/null
+++ b/arch/avr32/boards/hammerhead/setup.c
@@ -0,0 +1,245 @@
1/*
2 * Board-specific setup code for the Miromico Hammerhead board
3 *
4 * Copyright (C) 2008 Miromico AG
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/atmel-mci.h>
11#include <linux/clk.h>
12#include <linux/fb.h>
13#include <linux/etherdevice.h>
14#include <linux/i2c.h>
15#include <linux/i2c-gpio.h>
16#include <linux/init.h>
17#include <linux/linkage.h>
18#include <linux/platform_device.h>
19#include <linux/types.h>
20#include <linux/spi/spi.h>
21
22#include <video/atmel_lcdc.h>
23
24#include <linux/io.h>
25#include <asm/setup.h>
26
27#include <mach/at32ap700x.h>
28#include <mach/board.h>
29#include <mach/init.h>
30#include <mach/portmux.h>
31
32#include "../../mach-at32ap/clock.h"
33#include "flash.h"
34
35/* Oscillator frequencies. These are board-specific */
36unsigned long at32_board_osc_rates[3] = {
37 [0] = 32768, /* 32.768 kHz on RTC osc */
38 [1] = 25000000, /* 25MHz on osc0 */
39 [2] = 12000000, /* 12 MHz on osc1 */
40};
41
42/* Initialized by bootloader-specific startup code. */
43struct tag *bootloader_tags __initdata;
44
45#ifdef CONFIG_BOARD_HAMMERHEAD_LCD
46static struct fb_videomode __initdata hda350tlv_modes[] = {
47 {
48 .name = "320x240 @ 75",
49 .refresh = 75,
50 .xres = 320,
51 .yres = 240,
52 .pixclock = KHZ2PICOS(6891),
53
54 .left_margin = 48,
55 .right_margin = 18,
56 .upper_margin = 18,
57 .lower_margin = 4,
58 .hsync_len = 20,
59 .vsync_len = 2,
60
61 .sync = 0,
62 .vmode = FB_VMODE_NONINTERLACED,
63 },
64};
65
66static struct fb_monspecs __initdata hammerhead_hda350t_monspecs = {
67 .manufacturer = "HAN",
68 .monitor = "HDA350T-LV",
69 .modedb = hda350tlv_modes,
70 .modedb_len = ARRAY_SIZE(hda350tlv_modes),
71 .hfmin = 14900,
72 .hfmax = 22350,
73 .vfmin = 60,
74 .vfmax = 90,
75 .dclkmax = 10000000,
76};
77
78struct atmel_lcdfb_info __initdata hammerhead_lcdc_data = {
79 .default_bpp = 24,
80 .default_dmacon = ATMEL_LCDC_DMAEN | ATMEL_LCDC_DMA2DEN,
81 .default_lcdcon2 = (ATMEL_LCDC_DISTYPE_TFT
82 | ATMEL_LCDC_INVCLK
83 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE
84 | ATMEL_LCDC_MEMOR_BIG),
85 .default_monspecs = &hammerhead_hda350t_monspecs,
86 .guard_time = 2,
87};
88#endif
89
90static struct mci_platform_data __initdata mci0_data = {
91 .slot[0] = {
92 .bus_width = 4,
93 .detect_pin = -ENODEV,
94 .wp_pin = -ENODEV,
95 },
96};
97
98struct eth_addr {
99 u8 addr[6];
100};
101
102static struct eth_addr __initdata hw_addr[1];
103static struct eth_platform_data __initdata eth_data[1];
104
105/*
106 * The next two functions should go away as the boot loader is
107 * supposed to initialize the macb address registers with a valid
108 * ethernet address. But we need to keep it around for a while until
109 * we can be reasonably sure the boot loader does this.
110 *
111 * The phy_id is ignored as the driver will probe for it.
112 */
113static int __init parse_tag_ethernet(struct tag *tag)
114{
115 int i = tag->u.ethernet.mac_index;
116
117 if (i < ARRAY_SIZE(hw_addr))
118 memcpy(hw_addr[i].addr, tag->u.ethernet.hw_address,
119 sizeof(hw_addr[i].addr));
120
121 return 0;
122}
123__tagtable(ATAG_ETHERNET, parse_tag_ethernet);
124
125static void __init set_hw_addr(struct platform_device *pdev)
126{
127 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
128 const u8 *addr;
129 void __iomem *regs;
130 struct clk *pclk;
131
132 if (!res)
133 return;
134
135 if (pdev->id >= ARRAY_SIZE(hw_addr))
136 return;
137
138 addr = hw_addr[pdev->id].addr;
139
140 if (!is_valid_ether_addr(addr))
141 return;
142
143 /*
144 * Since this is board-specific code, we'll cheat and use the
145 * physical address directly as we happen to know that it's
146 * the same as the virtual address.
147 */
148 regs = (void __iomem __force *)res->start;
149 pclk = clk_get(&pdev->dev, "pclk");
150
151 if (!pclk)
152 return;
153
154 clk_enable(pclk);
155
156 __raw_writel((addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) |
157 addr[0], regs + 0x98);
158 __raw_writel((addr[5] << 8) | addr[4], regs + 0x9c);
159
160 clk_disable(pclk);
161 clk_put(pclk);
162}
163
164void __init setup_board(void)
165{
166 at32_map_usart(1, 0); /* USART 1: /dev/ttyS0, DB9 */
167 at32_setup_serial_console(0);
168}
169
170static struct i2c_gpio_platform_data i2c_gpio_data = {
171 .sda_pin = GPIO_PIN_PA(6),
172 .scl_pin = GPIO_PIN_PA(7),
173 .sda_is_open_drain = 1,
174 .scl_is_open_drain = 1,
175 .udelay = 2, /* close to 100 kHz */
176};
177
178static struct platform_device i2c_gpio_device = {
179 .name = "i2c-gpio",
180 .id = 0,
181 .dev = { .platform_data = &i2c_gpio_data, },
182};
183
184static struct i2c_board_info __initdata i2c_info[] = {};
185
186#ifdef CONFIG_BOARD_HAMMERHEAD_SND
187static struct ac97c_platform_data ac97c_data = {
188 .reset_pin = GPIO_PIN_PA(16),
189};
190#endif
191
192static int __init hammerhead_init(void)
193{
194 /*
195 * Hammerhead uses 32-bit SDRAM interface. Reserve the
196 * SDRAM-specific pins so that nobody messes with them.
197 */
198 at32_reserve_pin(GPIO_PIOE_BASE, ATMEL_EBI_PE_DATA_ALL);
199
200 at32_add_device_usart(0);
201
202 /* Reserve PB29 (GCLK3). This pin is used as clock source
203 * for ETH PHY (25MHz). GCLK3 setup is done by U-Boot.
204 */
205 at32_reserve_pin(GPIO_PIOB_BASE, (1<<29));
206
207 /*
208 * Hammerhead uses only one ethernet port, so we don't set
209 * address of second port
210 */
211 set_hw_addr(at32_add_device_eth(0, &eth_data[0]));
212
213#ifdef CONFIG_BOARD_HAMMERHEAD_FPGA
214 at32_add_device_hh_fpga();
215#endif
216 at32_add_device_mci(0, &mci0_data);
217
218#ifdef CONFIG_BOARD_HAMMERHEAD_USB
219 at32_add_device_usba(0, NULL);
220#endif
221#ifdef CONFIG_BOARD_HAMMERHEAD_LCD
222 at32_add_device_lcdc(0, &hammerhead_lcdc_data, fbmem_start,
223 fbmem_size, ATMEL_LCDC_PRI_24BIT);
224#endif
225
226 at32_select_gpio(i2c_gpio_data.sda_pin,
227 AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT |
228 AT32_GPIOF_HIGH);
229 at32_select_gpio(i2c_gpio_data.scl_pin,
230 AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT |
231 AT32_GPIOF_HIGH);
232 platform_device_register(&i2c_gpio_device);
233 i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info));
234
235#ifdef CONFIG_BOARD_HAMMERHEAD_SND
236 at32_add_device_ac97c(0, &ac97c_data);
237#endif
238
239 /* Select the Touchscreen interrupt pin mode */
240 at32_select_periph(GPIO_PIOB_BASE, 0x08000000, GPIO_PERIPH_A, 0);
241
242 return 0;
243}
244
245postcore_initcall(hammerhead_init);
diff --git a/arch/avr32/boards/mimc200/setup.c b/arch/avr32/boards/mimc200/setup.c
index 397cbb8f44c8..2b58d61f0afc 100644
--- a/arch/avr32/boards/mimc200/setup.c
+++ b/arch/avr32/boards/mimc200/setup.c
@@ -24,7 +24,7 @@ extern struct atmel_lcdfb_info mimc200_lcdc_data;
24#include <video/atmel_lcdc.h> 24#include <video/atmel_lcdc.h>
25#include <linux/fb.h> 25#include <linux/fb.h>
26 26
27#include <asm/atmel-mci.h> 27#include <linux/atmel-mci.h>
28#include <linux/io.h> 28#include <linux/io.h>
29#include <asm/setup.h> 29#include <asm/setup.h>
30 30
@@ -207,8 +207,6 @@ static int __init mimc200_init(void)
207 * reserve any pins for it. 207 * reserve any pins for it.
208 */ 208 */
209 209
210 at32_add_system_devices();
211
212 at32_add_device_usart(0); 210 at32_add_device_usart(0);
213 at32_add_device_usart(1); 211 at32_add_device_usart(1);
214 at32_add_device_usart(2); 212 at32_add_device_usart(2);
diff --git a/arch/avr32/configs/atngw100_defconfig b/arch/avr32/configs/atngw100_defconfig
index 541520912c55..164e2814ae78 100644
--- a/arch/avr32/configs/atngw100_defconfig
+++ b/arch/avr32/configs/atngw100_defconfig
@@ -892,7 +892,7 @@ CONFIG_DMA_ENGINE=y
892# DMA Clients 892# DMA Clients
893# 893#
894# CONFIG_NET_DMA is not set 894# CONFIG_NET_DMA is not set
895CONFIG_DMATEST=m 895# CONFIG_DMATEST is not set
896# CONFIG_UIO is not set 896# CONFIG_UIO is not set
897 897
898# 898#
diff --git a/arch/avr32/configs/atstk1002_defconfig b/arch/avr32/configs/atstk1002_defconfig
index 69fce6b6a783..c9dc64832a19 100644
--- a/arch/avr32/configs/atstk1002_defconfig
+++ b/arch/avr32/configs/atstk1002_defconfig
@@ -964,7 +964,7 @@ CONFIG_DMA_ENGINE=y
964# DMA Clients 964# DMA Clients
965# 965#
966# CONFIG_NET_DMA is not set 966# CONFIG_NET_DMA is not set
967CONFIG_DMATEST=m 967# CONFIG_DMATEST is not set
968# CONFIG_UIO is not set 968# CONFIG_UIO is not set
969 969
970# 970#
diff --git a/arch/avr32/configs/atstk1003_defconfig b/arch/avr32/configs/atstk1003_defconfig
index 5477ed3183b4..29ea1327b498 100644
--- a/arch/avr32/configs/atstk1003_defconfig
+++ b/arch/avr32/configs/atstk1003_defconfig
@@ -882,7 +882,7 @@ CONFIG_DMA_ENGINE=y
882# DMA Clients 882# DMA Clients
883# 883#
884# CONFIG_NET_DMA is not set 884# CONFIG_NET_DMA is not set
885CONFIG_DMATEST=m 885# CONFIG_DMATEST is not set
886# CONFIG_UIO is not set 886# CONFIG_UIO is not set
887 887
888# 888#
diff --git a/arch/avr32/configs/atstk1006_defconfig b/arch/avr32/configs/atstk1006_defconfig
index 6c45a3b77aa3..361c31c2af10 100644
--- a/arch/avr32/configs/atstk1006_defconfig
+++ b/arch/avr32/configs/atstk1006_defconfig
@@ -1014,7 +1014,7 @@ CONFIG_DMA_ENGINE=y
1014# DMA Clients 1014# DMA Clients
1015# 1015#
1016# CONFIG_NET_DMA is not set 1016# CONFIG_NET_DMA is not set
1017CONFIG_DMATEST=m 1017# CONFIG_DMATEST is not set
1018# CONFIG_UIO is not set 1018# CONFIG_UIO is not set
1019# CONFIG_STAGING is not set 1019# CONFIG_STAGING is not set
1020CONFIG_STAGING_EXCLUDE_BUILD=y 1020CONFIG_STAGING_EXCLUDE_BUILD=y
diff --git a/arch/avr32/configs/hammerhead_defconfig b/arch/avr32/configs/hammerhead_defconfig
new file mode 100644
index 000000000000..0d3d2982c8f5
--- /dev/null
+++ b/arch/avr32/configs/hammerhead_defconfig
@@ -0,0 +1,1467 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.27
4# Tue Dec 9 15:37:30 2008
5#
6CONFIG_AVR32=y
7CONFIG_GENERIC_GPIO=y
8CONFIG_GENERIC_HARDIRQS=y
9CONFIG_STACKTRACE_SUPPORT=y
10CONFIG_LOCKDEP_SUPPORT=y
11CONFIG_TRACE_IRQFLAGS_SUPPORT=y
12CONFIG_HARDIRQS_SW_RESEND=y
13CONFIG_GENERIC_IRQ_PROBE=y
14CONFIG_RWSEM_GENERIC_SPINLOCK=y
15CONFIG_GENERIC_TIME=y
16CONFIG_GENERIC_CLOCKEVENTS=y
17# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
18# CONFIG_ARCH_HAS_ILOG2_U32 is not set
19# CONFIG_ARCH_HAS_ILOG2_U64 is not set
20CONFIG_GENERIC_HWEIGHT=y
21CONFIG_GENERIC_CALIBRATE_DELAY=y
22CONFIG_GENERIC_BUG=y
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24
25#
26# General setup
27#
28CONFIG_EXPERIMENTAL=y
29CONFIG_BROKEN_ON_SMP=y
30CONFIG_INIT_ENV_ARG_LIMIT=32
31CONFIG_LOCALVERSION=""
32# CONFIG_LOCALVERSION_AUTO is not set
33CONFIG_SWAP=y
34CONFIG_SYSVIPC=y
35CONFIG_SYSVIPC_SYSCTL=y
36CONFIG_POSIX_MQUEUE=y
37CONFIG_BSD_PROCESS_ACCT=y
38CONFIG_BSD_PROCESS_ACCT_V3=y
39# CONFIG_TASKSTATS is not set
40# CONFIG_AUDIT is not set
41# CONFIG_IKCONFIG is not set
42CONFIG_LOG_BUF_SHIFT=14
43# CONFIG_CGROUPS is not set
44# CONFIG_GROUP_SCHED is not set
45CONFIG_SYSFS_DEPRECATED=y
46CONFIG_SYSFS_DEPRECATED_V2=y
47# CONFIG_RELAY is not set
48# CONFIG_NAMESPACES is not set
49CONFIG_BLK_DEV_INITRD=y
50CONFIG_INITRAMFS_SOURCE=""
51CONFIG_CC_OPTIMIZE_FOR_SIZE=y
52CONFIG_SYSCTL=y
53CONFIG_EMBEDDED=y
54# CONFIG_SYSCTL_SYSCALL is not set
55CONFIG_KALLSYMS=y
56# CONFIG_KALLSYMS_ALL is not set
57# CONFIG_KALLSYMS_EXTRA_PASS is not set
58CONFIG_HOTPLUG=y
59CONFIG_PRINTK=y
60CONFIG_BUG=y
61CONFIG_ELF_CORE=y
62# CONFIG_COMPAT_BRK is not set
63# CONFIG_BASE_FULL is not set
64CONFIG_FUTEX=y
65CONFIG_ANON_INODES=y
66CONFIG_EPOLL=y
67CONFIG_SIGNALFD=y
68CONFIG_TIMERFD=y
69CONFIG_EVENTFD=y
70CONFIG_SHMEM=y
71CONFIG_AIO=y
72CONFIG_VM_EVENT_COUNTERS=y
73CONFIG_PCI_QUIRKS=y
74CONFIG_SLUB_DEBUG=y
75# CONFIG_SLAB is not set
76CONFIG_SLUB=y
77# CONFIG_SLOB is not set
78CONFIG_PROFILING=y
79# CONFIG_MARKERS is not set
80CONFIG_OPROFILE=m
81CONFIG_HAVE_OPROFILE=y
82CONFIG_KPROBES=y
83CONFIG_HAVE_KPROBES=y
84CONFIG_HAVE_CLK=y
85# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
86CONFIG_SLABINFO=y
87CONFIG_RT_MUTEXES=y
88# CONFIG_TINY_SHMEM is not set
89CONFIG_BASE_SMALL=1
90CONFIG_MODULES=y
91# CONFIG_MODULE_FORCE_LOAD is not set
92CONFIG_MODULE_UNLOAD=y
93CONFIG_MODULE_FORCE_UNLOAD=y
94# CONFIG_MODVERSIONS is not set
95# CONFIG_MODULE_SRCVERSION_ALL is not set
96CONFIG_KMOD=y
97CONFIG_BLOCK=y
98# CONFIG_LBD is not set
99# CONFIG_BLK_DEV_IO_TRACE is not set
100# CONFIG_LSF is not set
101# CONFIG_BLK_DEV_BSG is not set
102# CONFIG_BLK_DEV_INTEGRITY is not set
103
104#
105# IO Schedulers
106#
107CONFIG_IOSCHED_NOOP=y
108# CONFIG_IOSCHED_AS is not set
109# CONFIG_IOSCHED_DEADLINE is not set
110CONFIG_IOSCHED_CFQ=y
111# CONFIG_DEFAULT_AS is not set
112# CONFIG_DEFAULT_DEADLINE is not set
113CONFIG_DEFAULT_CFQ=y
114# CONFIG_DEFAULT_NOOP is not set
115CONFIG_DEFAULT_IOSCHED="cfq"
116CONFIG_CLASSIC_RCU=y
117# CONFIG_FREEZER is not set
118
119#
120# System Type and features
121#
122CONFIG_TICK_ONESHOT=y
123CONFIG_NO_HZ=y
124CONFIG_HIGH_RES_TIMERS=y
125CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
126CONFIG_SUBARCH_AVR32B=y
127CONFIG_MMU=y
128CONFIG_PERFORMANCE_COUNTERS=y
129CONFIG_PLATFORM_AT32AP=y
130CONFIG_CPU_AT32AP700X=y
131CONFIG_CPU_AT32AP7000=y
132# CONFIG_BOARD_ATSTK1000 is not set
133# CONFIG_BOARD_ATNGW100 is not set
134CONFIG_BOARD_HAMMERHEAD=y
135# CONFIG_BOARD_FAVR_32 is not set
136# CONFIG_BOARD_MIMC200 is not set
137CONFIG_BOARD_HAMMERHEAD_USB=y
138CONFIG_BOARD_HAMMERHEAD_LCD=y
139CONFIG_BOARD_HAMMERHEAD_SND=y
140# CONFIG_BOARD_HAMMERHEAD_FPGA is not set
141CONFIG_LOADER_U_BOOT=y
142
143#
144# Atmel AVR32 AP options
145#
146# CONFIG_AP700X_32_BIT_SMC is not set
147CONFIG_AP700X_16_BIT_SMC=y
148# CONFIG_AP700X_8_BIT_SMC is not set
149CONFIG_LOAD_ADDRESS=0x10000000
150CONFIG_ENTRY_ADDRESS=0x90000000
151CONFIG_PHYS_OFFSET=0x10000000
152CONFIG_PREEMPT_NONE=y
153# CONFIG_PREEMPT_VOLUNTARY is not set
154# CONFIG_PREEMPT is not set
155CONFIG_QUICKLIST=y
156# CONFIG_HAVE_ARCH_BOOTMEM_NODE is not set
157# CONFIG_ARCH_HAVE_MEMORY_PRESENT is not set
158# CONFIG_NEED_NODE_MEMMAP_SIZE is not set
159CONFIG_ARCH_FLATMEM_ENABLE=y
160# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
161# CONFIG_ARCH_SPARSEMEM_ENABLE is not set
162CONFIG_SELECT_MEMORY_MODEL=y
163CONFIG_FLATMEM_MANUAL=y
164# CONFIG_DISCONTIGMEM_MANUAL is not set
165# CONFIG_SPARSEMEM_MANUAL is not set
166CONFIG_FLATMEM=y
167CONFIG_FLAT_NODE_MEM_MAP=y
168CONFIG_PAGEFLAGS_EXTENDED=y
169CONFIG_SPLIT_PTLOCK_CPUS=4
170# CONFIG_RESOURCES_64BIT is not set
171# CONFIG_PHYS_ADDR_T_64BIT is not set
172CONFIG_ZONE_DMA_FLAG=0
173CONFIG_NR_QUICK=2
174CONFIG_VIRT_TO_BUS=y
175CONFIG_UNEVICTABLE_LRU=y
176# CONFIG_OWNERSHIP_TRACE is not set
177# CONFIG_NMI_DEBUGGING is not set
178# CONFIG_HZ_100 is not set
179CONFIG_HZ_250=y
180# CONFIG_HZ_300 is not set
181# CONFIG_HZ_1000 is not set
182CONFIG_HZ=250
183CONFIG_SCHED_HRTICK=y
184CONFIG_CMDLINE=""
185
186#
187# Power management options
188#
189# CONFIG_PM is not set
190CONFIG_ARCH_SUSPEND_POSSIBLE=y
191
192#
193# CPU Frequency scaling
194#
195CONFIG_CPU_FREQ=y
196CONFIG_CPU_FREQ_TABLE=y
197# CONFIG_CPU_FREQ_DEBUG is not set
198# CONFIG_CPU_FREQ_STAT is not set
199# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
200# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
201# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
202CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
203# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
204CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
205# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
206CONFIG_CPU_FREQ_GOV_USERSPACE=y
207CONFIG_CPU_FREQ_GOV_ONDEMAND=y
208# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
209CONFIG_CPU_FREQ_AT32AP=y
210
211#
212# Bus options
213#
214# CONFIG_ARCH_SUPPORTS_MSI is not set
215# CONFIG_PCCARD is not set
216
217#
218# Executable file formats
219#
220CONFIG_BINFMT_ELF=y
221# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
222# CONFIG_HAVE_AOUT is not set
223# CONFIG_BINFMT_MISC is not set
224CONFIG_NET=y
225
226#
227# Networking options
228#
229CONFIG_PACKET=y
230CONFIG_PACKET_MMAP=y
231CONFIG_UNIX=y
232CONFIG_XFRM=y
233CONFIG_XFRM_USER=y
234# CONFIG_XFRM_SUB_POLICY is not set
235# CONFIG_XFRM_MIGRATE is not set
236# CONFIG_XFRM_STATISTICS is not set
237CONFIG_XFRM_IPCOMP=y
238CONFIG_NET_KEY=y
239# CONFIG_NET_KEY_MIGRATE is not set
240CONFIG_INET=y
241CONFIG_IP_MULTICAST=y
242CONFIG_IP_ADVANCED_ROUTER=y
243CONFIG_ASK_IP_FIB_HASH=y
244# CONFIG_IP_FIB_TRIE is not set
245CONFIG_IP_FIB_HASH=y
246# CONFIG_IP_MULTIPLE_TABLES is not set
247# CONFIG_IP_ROUTE_MULTIPATH is not set
248# CONFIG_IP_ROUTE_VERBOSE is not set
249CONFIG_IP_PNP=y
250CONFIG_IP_PNP_DHCP=y
251# CONFIG_IP_PNP_BOOTP is not set
252# CONFIG_IP_PNP_RARP is not set
253# CONFIG_NET_IPIP is not set
254# CONFIG_NET_IPGRE is not set
255CONFIG_IP_MROUTE=y
256CONFIG_IP_PIMSM_V1=y
257# CONFIG_IP_PIMSM_V2 is not set
258# CONFIG_ARPD is not set
259CONFIG_SYN_COOKIES=y
260CONFIG_INET_AH=y
261CONFIG_INET_ESP=y
262CONFIG_INET_IPCOMP=y
263CONFIG_INET_XFRM_TUNNEL=y
264CONFIG_INET_TUNNEL=y
265CONFIG_INET_XFRM_MODE_TRANSPORT=y
266CONFIG_INET_XFRM_MODE_TUNNEL=y
267CONFIG_INET_XFRM_MODE_BEET=y
268# CONFIG_INET_LRO is not set
269CONFIG_INET_DIAG=y
270CONFIG_INET_TCP_DIAG=y
271# CONFIG_TCP_CONG_ADVANCED is not set
272CONFIG_TCP_CONG_CUBIC=y
273CONFIG_DEFAULT_TCP_CONG="cubic"
274# CONFIG_TCP_MD5SIG is not set
275# CONFIG_IPV6 is not set
276# CONFIG_NETWORK_SECMARK is not set
277CONFIG_NETFILTER=y
278# CONFIG_NETFILTER_DEBUG is not set
279# CONFIG_NETFILTER_ADVANCED is not set
280
281#
282# Core Netfilter Configuration
283#
284CONFIG_NETFILTER_NETLINK=m
285CONFIG_NETFILTER_NETLINK_LOG=m
286CONFIG_NF_CONNTRACK=m
287CONFIG_NF_CONNTRACK_FTP=m
288CONFIG_NF_CONNTRACK_IRC=m
289CONFIG_NF_CONNTRACK_SIP=m
290CONFIG_NF_CT_NETLINK=m
291CONFIG_NETFILTER_XTABLES=y
292CONFIG_NETFILTER_XT_TARGET_MARK=m
293CONFIG_NETFILTER_XT_TARGET_NFLOG=m
294CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
295CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
296CONFIG_NETFILTER_XT_MATCH_MARK=m
297CONFIG_NETFILTER_XT_MATCH_POLICY=m
298CONFIG_NETFILTER_XT_MATCH_STATE=m
299# CONFIG_IP_VS is not set
300
301#
302# IP: Netfilter Configuration
303#
304CONFIG_NF_DEFRAG_IPV4=m
305CONFIG_NF_CONNTRACK_IPV4=m
306CONFIG_NF_CONNTRACK_PROC_COMPAT=y
307CONFIG_IP_NF_IPTABLES=m
308CONFIG_IP_NF_FILTER=m
309CONFIG_IP_NF_TARGET_REJECT=m
310CONFIG_IP_NF_TARGET_LOG=m
311# CONFIG_IP_NF_TARGET_ULOG is not set
312CONFIG_NF_NAT=m
313CONFIG_NF_NAT_NEEDED=y
314CONFIG_IP_NF_TARGET_MASQUERADE=m
315CONFIG_NF_NAT_FTP=m
316CONFIG_NF_NAT_IRC=m
317# CONFIG_NF_NAT_TFTP is not set
318# CONFIG_NF_NAT_AMANDA is not set
319# CONFIG_NF_NAT_PPTP is not set
320# CONFIG_NF_NAT_H323 is not set
321CONFIG_NF_NAT_SIP=m
322CONFIG_IP_NF_MANGLE=m
323# CONFIG_IP_DCCP is not set
324# CONFIG_IP_SCTP is not set
325# CONFIG_TIPC is not set
326# CONFIG_ATM is not set
327# CONFIG_BRIDGE is not set
328# CONFIG_NET_DSA is not set
329# CONFIG_VLAN_8021Q is not set
330# CONFIG_DECNET is not set
331# CONFIG_LLC2 is not set
332# CONFIG_IPX is not set
333# CONFIG_ATALK is not set
334# CONFIG_X25 is not set
335# CONFIG_LAPB is not set
336# CONFIG_ECONET is not set
337# CONFIG_WAN_ROUTER is not set
338# CONFIG_NET_SCHED is not set
339
340#
341# Network testing
342#
343# CONFIG_NET_PKTGEN is not set
344# CONFIG_NET_TCPPROBE is not set
345# CONFIG_HAMRADIO is not set
346# CONFIG_CAN is not set
347# CONFIG_IRDA is not set
348# CONFIG_BT is not set
349# CONFIG_AF_RXRPC is not set
350# CONFIG_PHONET is not set
351CONFIG_WIRELESS=y
352# CONFIG_CFG80211 is not set
353# CONFIG_WIRELESS_OLD_REGULATORY is not set
354# CONFIG_WIRELESS_EXT is not set
355# CONFIG_MAC80211 is not set
356# CONFIG_IEEE80211 is not set
357# CONFIG_RFKILL is not set
358# CONFIG_NET_9P is not set
359
360#
361# Device Drivers
362#
363
364#
365# Generic Driver Options
366#
367CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
368CONFIG_STANDALONE=y
369# CONFIG_PREVENT_FIRMWARE_BUILD is not set
370# CONFIG_FW_LOADER is not set
371# CONFIG_DEBUG_DRIVER is not set
372# CONFIG_DEBUG_DEVRES is not set
373# CONFIG_SYS_HYPERVISOR is not set
374# CONFIG_CONNECTOR is not set
375CONFIG_MTD=y
376# CONFIG_MTD_DEBUG is not set
377# CONFIG_MTD_CONCAT is not set
378CONFIG_MTD_PARTITIONS=y
379# CONFIG_MTD_REDBOOT_PARTS is not set
380CONFIG_MTD_CMDLINE_PARTS=y
381# CONFIG_MTD_AR7_PARTS is not set
382
383#
384# User Modules And Translation Layers
385#
386CONFIG_MTD_CHAR=y
387CONFIG_MTD_BLKDEVS=y
388CONFIG_MTD_BLOCK=y
389# CONFIG_FTL is not set
390# CONFIG_NFTL is not set
391# CONFIG_INFTL is not set
392# CONFIG_RFD_FTL is not set
393# CONFIG_SSFDC is not set
394# CONFIG_MTD_OOPS is not set
395
396#
397# RAM/ROM/Flash chip drivers
398#
399CONFIG_MTD_CFI=y
400# CONFIG_MTD_JEDECPROBE is not set
401CONFIG_MTD_GEN_PROBE=y
402# CONFIG_MTD_CFI_ADV_OPTIONS is not set
403CONFIG_MTD_MAP_BANK_WIDTH_1=y
404CONFIG_MTD_MAP_BANK_WIDTH_2=y
405CONFIG_MTD_MAP_BANK_WIDTH_4=y
406# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
407# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
408# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
409CONFIG_MTD_CFI_I1=y
410CONFIG_MTD_CFI_I2=y
411# CONFIG_MTD_CFI_I4 is not set
412# CONFIG_MTD_CFI_I8 is not set
413# CONFIG_MTD_CFI_INTELEXT is not set
414CONFIG_MTD_CFI_AMDSTD=y
415# CONFIG_MTD_CFI_STAA is not set
416CONFIG_MTD_CFI_UTIL=y
417# CONFIG_MTD_RAM is not set
418# CONFIG_MTD_ROM is not set
419# CONFIG_MTD_ABSENT is not set
420
421#
422# Mapping drivers for chip access
423#
424# CONFIG_MTD_COMPLEX_MAPPINGS is not set
425CONFIG_MTD_PHYSMAP=y
426CONFIG_MTD_PHYSMAP_START=0x80000000
427CONFIG_MTD_PHYSMAP_LEN=0x0
428CONFIG_MTD_PHYSMAP_BANKWIDTH=2
429# CONFIG_MTD_PLATRAM is not set
430
431#
432# Self-contained MTD device drivers
433#
434CONFIG_MTD_DATAFLASH=y
435# CONFIG_MTD_DATAFLASH_WRITE_VERIFY is not set
436# CONFIG_MTD_DATAFLASH_OTP is not set
437# CONFIG_MTD_M25P80 is not set
438# CONFIG_MTD_SLRAM is not set
439# CONFIG_MTD_PHRAM is not set
440# CONFIG_MTD_MTDRAM is not set
441# CONFIG_MTD_BLOCK2MTD is not set
442
443#
444# Disk-On-Chip Device Drivers
445#
446# CONFIG_MTD_DOC2000 is not set
447# CONFIG_MTD_DOC2001 is not set
448# CONFIG_MTD_DOC2001PLUS is not set
449# CONFIG_MTD_NAND is not set
450# CONFIG_MTD_ONENAND is not set
451
452#
453# UBI - Unsorted block images
454#
455# CONFIG_MTD_UBI is not set
456# CONFIG_PARPORT is not set
457CONFIG_BLK_DEV=y
458# CONFIG_BLK_DEV_COW_COMMON is not set
459# CONFIG_BLK_DEV_LOOP is not set
460# CONFIG_BLK_DEV_NBD is not set
461# CONFIG_BLK_DEV_UB is not set
462CONFIG_BLK_DEV_RAM=m
463CONFIG_BLK_DEV_RAM_COUNT=16
464CONFIG_BLK_DEV_RAM_SIZE=4096
465# CONFIG_BLK_DEV_XIP is not set
466# CONFIG_CDROM_PKTCDVD is not set
467# CONFIG_ATA_OVER_ETH is not set
468CONFIG_MISC_DEVICES=y
469# CONFIG_ATMEL_PWM is not set
470CONFIG_ATMEL_TCLIB=y
471CONFIG_ATMEL_TCB_CLKSRC=y
472CONFIG_ATMEL_TCB_CLKSRC_BLOCK=0
473# CONFIG_EEPROM_93CX6 is not set
474# CONFIG_ATMEL_SSC is not set
475# CONFIG_ENCLOSURE_SERVICES is not set
476
477#
478# SCSI device support
479#
480# CONFIG_RAID_ATTRS is not set
481CONFIG_SCSI=m
482CONFIG_SCSI_DMA=y
483# CONFIG_SCSI_TGT is not set
484# CONFIG_SCSI_NETLINK is not set
485CONFIG_SCSI_PROC_FS=y
486
487#
488# SCSI support type (disk, tape, CD-ROM)
489#
490CONFIG_BLK_DEV_SD=m
491# CONFIG_CHR_DEV_ST is not set
492# CONFIG_CHR_DEV_OSST is not set
493# CONFIG_BLK_DEV_SR is not set
494# CONFIG_CHR_DEV_SG is not set
495# CONFIG_CHR_DEV_SCH is not set
496
497#
498# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
499#
500# CONFIG_SCSI_MULTI_LUN is not set
501# CONFIG_SCSI_CONSTANTS is not set
502# CONFIG_SCSI_LOGGING is not set
503# CONFIG_SCSI_SCAN_ASYNC is not set
504CONFIG_SCSI_WAIT_SCAN=m
505
506#
507# SCSI Transports
508#
509# CONFIG_SCSI_SPI_ATTRS is not set
510# CONFIG_SCSI_FC_ATTRS is not set
511# CONFIG_SCSI_ISCSI_ATTRS is not set
512# CONFIG_SCSI_SAS_LIBSAS is not set
513# CONFIG_SCSI_SRP_ATTRS is not set
514CONFIG_SCSI_LOWLEVEL=y
515# CONFIG_ISCSI_TCP is not set
516# CONFIG_SCSI_DEBUG is not set
517# CONFIG_SCSI_DH is not set
518# CONFIG_ATA is not set
519# CONFIG_MD is not set
520CONFIG_NETDEVICES=y
521# CONFIG_DUMMY is not set
522# CONFIG_BONDING is not set
523# CONFIG_MACVLAN is not set
524# CONFIG_EQUALIZER is not set
525# CONFIG_TUN is not set
526# CONFIG_VETH is not set
527CONFIG_PHYLIB=y
528
529#
530# MII PHY device drivers
531#
532# CONFIG_MARVELL_PHY is not set
533# CONFIG_DAVICOM_PHY is not set
534# CONFIG_QSEMI_PHY is not set
535# CONFIG_LXT_PHY is not set
536# CONFIG_CICADA_PHY is not set
537# CONFIG_VITESSE_PHY is not set
538# CONFIG_SMSC_PHY is not set
539# CONFIG_BROADCOM_PHY is not set
540# CONFIG_ICPLUS_PHY is not set
541# CONFIG_REALTEK_PHY is not set
542# CONFIG_FIXED_PHY is not set
543# CONFIG_MDIO_BITBANG is not set
544CONFIG_NET_ETHERNET=y
545# CONFIG_MII is not set
546CONFIG_MACB=y
547# CONFIG_ENC28J60 is not set
548# CONFIG_IBM_NEW_EMAC_ZMII is not set
549# CONFIG_IBM_NEW_EMAC_RGMII is not set
550# CONFIG_IBM_NEW_EMAC_TAH is not set
551# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
552# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
553# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
554# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
555# CONFIG_B44 is not set
556# CONFIG_NETDEV_1000 is not set
557# CONFIG_NETDEV_10000 is not set
558
559#
560# Wireless LAN
561#
562# CONFIG_WLAN_PRE80211 is not set
563# CONFIG_WLAN_80211 is not set
564# CONFIG_IWLWIFI_LEDS is not set
565
566#
567# USB Network Adapters
568#
569# CONFIG_USB_CATC is not set
570# CONFIG_USB_KAWETH is not set
571# CONFIG_USB_PEGASUS is not set
572# CONFIG_USB_RTL8150 is not set
573# CONFIG_USB_USBNET is not set
574# CONFIG_WAN is not set
575# CONFIG_PPP is not set
576# CONFIG_SLIP is not set
577# CONFIG_NETCONSOLE is not set
578# CONFIG_NETPOLL is not set
579# CONFIG_NET_POLL_CONTROLLER is not set
580# CONFIG_ISDN is not set
581# CONFIG_PHONE is not set
582
583#
584# Input device support
585#
586CONFIG_INPUT=y
587CONFIG_INPUT_FF_MEMLESS=m
588# CONFIG_INPUT_POLLDEV is not set
589
590#
591# Userland interfaces
592#
593CONFIG_INPUT_MOUSEDEV=y
594CONFIG_INPUT_MOUSEDEV_PSAUX=y
595CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
596CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
597# CONFIG_INPUT_JOYDEV is not set
598CONFIG_INPUT_EVDEV=m
599# CONFIG_INPUT_EVBUG is not set
600
601#
602# Input Device Drivers
603#
604CONFIG_INPUT_KEYBOARD=y
605CONFIG_KEYBOARD_ATKBD=y
606# CONFIG_KEYBOARD_SUNKBD is not set
607# CONFIG_KEYBOARD_LKKBD is not set
608# CONFIG_KEYBOARD_XTKBD is not set
609# CONFIG_KEYBOARD_NEWTON is not set
610# CONFIG_KEYBOARD_STOWAWAY is not set
611# CONFIG_KEYBOARD_GPIO is not set
612CONFIG_INPUT_MOUSE=y
613CONFIG_MOUSE_PS2=y
614CONFIG_MOUSE_PS2_ALPS=y
615CONFIG_MOUSE_PS2_LOGIPS2PP=y
616CONFIG_MOUSE_PS2_SYNAPTICS=y
617CONFIG_MOUSE_PS2_LIFEBOOK=y
618CONFIG_MOUSE_PS2_TRACKPOINT=y
619# CONFIG_MOUSE_PS2_TOUCHKIT is not set
620# CONFIG_MOUSE_SERIAL is not set
621# CONFIG_MOUSE_APPLETOUCH is not set
622# CONFIG_MOUSE_BCM5974 is not set
623# CONFIG_MOUSE_VSXXXAA is not set
624# CONFIG_MOUSE_GPIO is not set
625# CONFIG_INPUT_JOYSTICK is not set
626# CONFIG_INPUT_TABLET is not set
627CONFIG_INPUT_TOUCHSCREEN=y
628# CONFIG_TOUCHSCREEN_ADS7846 is not set
629# CONFIG_TOUCHSCREEN_FUJITSU is not set
630# CONFIG_TOUCHSCREEN_GUNZE is not set
631# CONFIG_TOUCHSCREEN_ELO is not set
632# CONFIG_TOUCHSCREEN_MTOUCH is not set
633# CONFIG_TOUCHSCREEN_INEXIO is not set
634# CONFIG_TOUCHSCREEN_MK712 is not set
635# CONFIG_TOUCHSCREEN_PENMOUNT is not set
636# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
637# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
638# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
639# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
640# CONFIG_INPUT_MISC is not set
641
642#
643# Hardware I/O ports
644#
645CONFIG_SERIO=y
646CONFIG_SERIO_I8042=y
647CONFIG_SERIO_SERPORT=y
648# CONFIG_SERIO_AT32PSIF is not set
649CONFIG_SERIO_LIBPS2=y
650# CONFIG_SERIO_RAW is not set
651# CONFIG_GAMEPORT is not set
652
653#
654# Character devices
655#
656CONFIG_VT=y
657CONFIG_CONSOLE_TRANSLATIONS=y
658CONFIG_VT_CONSOLE=y
659CONFIG_HW_CONSOLE=y
660# CONFIG_VT_HW_CONSOLE_BINDING is not set
661CONFIG_DEVKMEM=y
662# CONFIG_SERIAL_NONSTANDARD is not set
663
664#
665# Serial drivers
666#
667# CONFIG_SERIAL_8250 is not set
668
669#
670# Non-8250 serial port support
671#
672CONFIG_SERIAL_ATMEL=y
673CONFIG_SERIAL_ATMEL_CONSOLE=y
674CONFIG_SERIAL_ATMEL_PDC=y
675# CONFIG_SERIAL_ATMEL_TTYAT is not set
676CONFIG_SERIAL_CORE=y
677CONFIG_SERIAL_CORE_CONSOLE=y
678CONFIG_UNIX98_PTYS=y
679# CONFIG_LEGACY_PTYS is not set
680# CONFIG_IPMI_HANDLER is not set
681# CONFIG_HW_RANDOM is not set
682# CONFIG_R3964 is not set
683# CONFIG_RAW_DRIVER is not set
684# CONFIG_TCG_TPM is not set
685CONFIG_I2C=m
686CONFIG_I2C_BOARDINFO=y
687CONFIG_I2C_CHARDEV=m
688CONFIG_I2C_HELPER_AUTO=y
689CONFIG_I2C_ALGOBIT=m
690
691#
692# I2C Hardware Bus support
693#
694
695#
696# I2C system bus drivers (mostly embedded / system-on-chip)
697#
698CONFIG_I2C_GPIO=m
699# CONFIG_I2C_OCORES is not set
700# CONFIG_I2C_SIMTEC is not set
701
702#
703# External I2C/SMBus adapter drivers
704#
705# CONFIG_I2C_PARPORT_LIGHT is not set
706# CONFIG_I2C_TAOS_EVM is not set
707# CONFIG_I2C_TINY_USB is not set
708
709#
710# Other I2C/SMBus bus drivers
711#
712# CONFIG_I2C_PCA_PLATFORM is not set
713# CONFIG_I2C_STUB is not set
714
715#
716# Miscellaneous I2C Chip support
717#
718# CONFIG_DS1682 is not set
719# CONFIG_AT24 is not set
720# CONFIG_SENSORS_EEPROM is not set
721# CONFIG_SENSORS_PCF8574 is not set
722# CONFIG_PCF8575 is not set
723# CONFIG_SENSORS_PCA9539 is not set
724# CONFIG_SENSORS_PCF8591 is not set
725# CONFIG_TPS65010 is not set
726# CONFIG_SENSORS_MAX6875 is not set
727# CONFIG_SENSORS_TSL2550 is not set
728# CONFIG_I2C_DEBUG_CORE is not set
729# CONFIG_I2C_DEBUG_ALGO is not set
730# CONFIG_I2C_DEBUG_BUS is not set
731# CONFIG_I2C_DEBUG_CHIP is not set
732CONFIG_SPI=y
733# CONFIG_SPI_DEBUG is not set
734CONFIG_SPI_MASTER=y
735
736#
737# SPI Master Controller Drivers
738#
739CONFIG_SPI_ATMEL=y
740# CONFIG_SPI_BITBANG is not set
741
742#
743# SPI Protocol Masters
744#
745# CONFIG_SPI_AT25 is not set
746CONFIG_SPI_SPIDEV=m
747# CONFIG_SPI_TLE62X0 is not set
748CONFIG_ARCH_REQUIRE_GPIOLIB=y
749CONFIG_GPIOLIB=y
750# CONFIG_DEBUG_GPIO is not set
751# CONFIG_GPIO_SYSFS is not set
752
753#
754# I2C GPIO expanders:
755#
756# CONFIG_GPIO_MAX732X is not set
757# CONFIG_GPIO_PCA953X is not set
758# CONFIG_GPIO_PCF857X is not set
759
760#
761# PCI GPIO expanders:
762#
763
764#
765# SPI GPIO expanders:
766#
767# CONFIG_GPIO_MAX7301 is not set
768# CONFIG_GPIO_MCP23S08 is not set
769# CONFIG_W1 is not set
770# CONFIG_POWER_SUPPLY is not set
771# CONFIG_HWMON is not set
772# CONFIG_THERMAL is not set
773# CONFIG_THERMAL_HWMON is not set
774CONFIG_WATCHDOG=y
775# CONFIG_WATCHDOG_NOWAYOUT is not set
776
777#
778# Watchdog Device Drivers
779#
780# CONFIG_SOFT_WATCHDOG is not set
781CONFIG_AT32AP700X_WDT=y
782
783#
784# USB-based Watchdog Cards
785#
786# CONFIG_USBPCWATCHDOG is not set
787
788#
789# Sonics Silicon Backplane
790#
791CONFIG_SSB_POSSIBLE=y
792# CONFIG_SSB is not set
793
794#
795# Multifunction device drivers
796#
797# CONFIG_MFD_CORE is not set
798# CONFIG_MFD_SM501 is not set
799# CONFIG_HTC_PASIC3 is not set
800# CONFIG_MFD_TMIO is not set
801# CONFIG_MFD_WM8400 is not set
802# CONFIG_MFD_WM8350_I2C is not set
803
804#
805# Multimedia devices
806#
807
808#
809# Multimedia core support
810#
811# CONFIG_VIDEO_DEV is not set
812# CONFIG_DVB_CORE is not set
813# CONFIG_VIDEO_MEDIA is not set
814
815#
816# Multimedia drivers
817#
818# CONFIG_DAB is not set
819
820#
821# Graphics support
822#
823# CONFIG_VGASTATE is not set
824# CONFIG_VIDEO_OUTPUT_CONTROL is not set
825CONFIG_FB=y
826# CONFIG_FIRMWARE_EDID is not set
827# CONFIG_FB_DDC is not set
828# CONFIG_FB_BOOT_VESA_SUPPORT is not set
829CONFIG_FB_CFB_FILLRECT=y
830CONFIG_FB_CFB_COPYAREA=y
831CONFIG_FB_CFB_IMAGEBLIT=y
832# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
833# CONFIG_FB_SYS_FILLRECT is not set
834# CONFIG_FB_SYS_COPYAREA is not set
835# CONFIG_FB_SYS_IMAGEBLIT is not set
836# CONFIG_FB_FOREIGN_ENDIAN is not set
837# CONFIG_FB_SYS_FOPS is not set
838# CONFIG_FB_SVGALIB is not set
839# CONFIG_FB_MACMODES is not set
840# CONFIG_FB_BACKLIGHT is not set
841# CONFIG_FB_MODE_HELPERS is not set
842# CONFIG_FB_TILEBLITTING is not set
843
844#
845# Frame buffer hardware drivers
846#
847# CONFIG_FB_S1D13XXX is not set
848CONFIG_FB_ATMEL=y
849# CONFIG_FB_VIRTUAL is not set
850# CONFIG_FB_METRONOME is not set
851# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
852
853#
854# Display device support
855#
856# CONFIG_DISPLAY_SUPPORT is not set
857
858#
859# Console display driver support
860#
861CONFIG_DUMMY_CONSOLE=y
862CONFIG_FRAMEBUFFER_CONSOLE=y
863# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
864# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
865# CONFIG_FONTS is not set
866CONFIG_FONT_8x8=y
867CONFIG_FONT_8x16=y
868# CONFIG_LOGO is not set
869CONFIG_SOUND=m
870CONFIG_SOUND_OSS_CORE=y
871CONFIG_SND=m
872CONFIG_SND_TIMER=m
873CONFIG_SND_PCM=m
874CONFIG_SND_SEQUENCER=m
875# CONFIG_SND_SEQ_DUMMY is not set
876CONFIG_SND_OSSEMUL=y
877CONFIG_SND_MIXER_OSS=m
878CONFIG_SND_PCM_OSS=m
879CONFIG_SND_PCM_OSS_PLUGINS=y
880CONFIG_SND_SEQUENCER_OSS=y
881# CONFIG_SND_DYNAMIC_MINORS is not set
882# CONFIG_SND_SUPPORT_OLD_API is not set
883CONFIG_SND_VERBOSE_PROCFS=y
884# CONFIG_SND_VERBOSE_PRINTK is not set
885# CONFIG_SND_DEBUG is not set
886CONFIG_SND_DRIVERS=y
887# CONFIG_SND_DUMMY is not set
888# CONFIG_SND_VIRMIDI is not set
889# CONFIG_SND_MTPAV is not set
890# CONFIG_SND_SERIAL_U16550 is not set
891# CONFIG_SND_MPU401 is not set
892CONFIG_SND_SPI=y
893CONFIG_SND_USB=y
894# CONFIG_SND_USB_AUDIO is not set
895# CONFIG_SND_USB_CAIAQ is not set
896# CONFIG_SND_SOC is not set
897# CONFIG_SOUND_PRIME is not set
898CONFIG_HID_SUPPORT=y
899CONFIG_HID=y
900# CONFIG_HID_DEBUG is not set
901# CONFIG_HIDRAW is not set
902
903#
904# USB Input Devices
905#
906CONFIG_USB_HID=m
907# CONFIG_HID_PID is not set
908# CONFIG_USB_HIDDEV is not set
909
910#
911# USB HID Boot Protocol drivers
912#
913# CONFIG_USB_KBD is not set
914# CONFIG_USB_MOUSE is not set
915
916#
917# Special HID drivers
918#
919CONFIG_HID_COMPAT=y
920CONFIG_HID_A4TECH=m
921CONFIG_HID_APPLE=m
922CONFIG_HID_BELKIN=m
923CONFIG_HID_BRIGHT=m
924CONFIG_HID_CHERRY=m
925CONFIG_HID_CHICONY=m
926CONFIG_HID_CYPRESS=m
927CONFIG_HID_DELL=m
928CONFIG_HID_EZKEY=m
929CONFIG_HID_GYRATION=m
930CONFIG_HID_LOGITECH=m
931# CONFIG_LOGITECH_FF is not set
932# CONFIG_LOGIRUMBLEPAD2_FF is not set
933CONFIG_HID_MICROSOFT=m
934CONFIG_HID_MONTEREY=m
935CONFIG_HID_PANTHERLORD=m
936# CONFIG_PANTHERLORD_FF is not set
937CONFIG_HID_PETALYNX=m
938CONFIG_HID_SAMSUNG=m
939CONFIG_HID_SONY=m
940CONFIG_HID_SUNPLUS=m
941CONFIG_THRUSTMASTER_FF=m
942CONFIG_ZEROPLUS_FF=m
943CONFIG_USB_SUPPORT=y
944CONFIG_USB_ARCH_HAS_HCD=y
945# CONFIG_USB_ARCH_HAS_OHCI is not set
946# CONFIG_USB_ARCH_HAS_EHCI is not set
947CONFIG_USB=m
948# CONFIG_USB_DEBUG is not set
949# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
950
951#
952# Miscellaneous USB options
953#
954CONFIG_USB_DEVICEFS=y
955# CONFIG_USB_DEVICE_CLASS is not set
956# CONFIG_USB_DYNAMIC_MINORS is not set
957# CONFIG_USB_OTG is not set
958# CONFIG_USB_OTG_WHITELIST is not set
959# CONFIG_USB_OTG_BLACKLIST_HUB is not set
960CONFIG_USB_MON=y
961
962#
963# USB Host Controller Drivers
964#
965# CONFIG_USB_C67X00_HCD is not set
966CONFIG_USB_ISP116X_HCD=m
967# CONFIG_USB_ISP1760_HCD is not set
968# CONFIG_USB_SL811_HCD is not set
969# CONFIG_USB_R8A66597_HCD is not set
970# CONFIG_USB_MUSB_HDRC is not set
971# CONFIG_USB_GADGET_MUSB_HDRC is not set
972
973#
974# USB Device Class drivers
975#
976# CONFIG_USB_ACM is not set
977# CONFIG_USB_PRINTER is not set
978# CONFIG_USB_WDM is not set
979# CONFIG_USB_TMC is not set
980
981#
982# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
983#
984
985#
986# may also be needed; see USB_STORAGE Help for more information
987#
988CONFIG_USB_STORAGE=m
989# CONFIG_USB_STORAGE_DEBUG is not set
990# CONFIG_USB_STORAGE_DATAFAB is not set
991# CONFIG_USB_STORAGE_FREECOM is not set
992# CONFIG_USB_STORAGE_ISD200 is not set
993# CONFIG_USB_STORAGE_DPCM is not set
994# CONFIG_USB_STORAGE_USBAT is not set
995# CONFIG_USB_STORAGE_SDDR09 is not set
996# CONFIG_USB_STORAGE_SDDR55 is not set
997# CONFIG_USB_STORAGE_JUMPSHOT is not set
998# CONFIG_USB_STORAGE_ALAUDA is not set
999# CONFIG_USB_STORAGE_ONETOUCH is not set
1000# CONFIG_USB_STORAGE_KARMA is not set
1001# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1002# CONFIG_USB_LIBUSUAL is not set
1003
1004#
1005# USB Imaging devices
1006#
1007# CONFIG_USB_MDC800 is not set
1008# CONFIG_USB_MICROTEK is not set
1009
1010#
1011# USB port drivers
1012#
1013# CONFIG_USB_SERIAL is not set
1014
1015#
1016# USB Miscellaneous drivers
1017#
1018# CONFIG_USB_EMI62 is not set
1019# CONFIG_USB_EMI26 is not set
1020# CONFIG_USB_ADUTUX is not set
1021# CONFIG_USB_SEVSEG is not set
1022# CONFIG_USB_RIO500 is not set
1023# CONFIG_USB_LEGOTOWER is not set
1024# CONFIG_USB_LCD is not set
1025# CONFIG_USB_BERRY_CHARGE is not set
1026# CONFIG_USB_LED is not set
1027# CONFIG_USB_CYPRESS_CY7C63 is not set
1028# CONFIG_USB_CYTHERM is not set
1029# CONFIG_USB_PHIDGET is not set
1030# CONFIG_USB_IDMOUSE is not set
1031# CONFIG_USB_FTDI_ELAN is not set
1032# CONFIG_USB_APPLEDISPLAY is not set
1033# CONFIG_USB_LD is not set
1034# CONFIG_USB_TRANCEVIBRATOR is not set
1035# CONFIG_USB_IOWARRIOR is not set
1036# CONFIG_USB_TEST is not set
1037# CONFIG_USB_ISIGHTFW is not set
1038# CONFIG_USB_VST is not set
1039CONFIG_USB_GADGET=y
1040# CONFIG_USB_GADGET_DEBUG is not set
1041# CONFIG_USB_GADGET_DEBUG_FILES is not set
1042CONFIG_USB_GADGET_VBUS_DRAW=2
1043CONFIG_USB_GADGET_SELECTED=y
1044# CONFIG_USB_GADGET_AT91 is not set
1045CONFIG_USB_GADGET_ATMEL_USBA=y
1046CONFIG_USB_ATMEL_USBA=y
1047# CONFIG_USB_GADGET_FSL_USB2 is not set
1048# CONFIG_USB_GADGET_LH7A40X is not set
1049# CONFIG_USB_GADGET_OMAP is not set
1050# CONFIG_USB_GADGET_PXA25X is not set
1051# CONFIG_USB_GADGET_PXA27X is not set
1052# CONFIG_USB_GADGET_S3C2410 is not set
1053# CONFIG_USB_GADGET_M66592 is not set
1054# CONFIG_USB_GADGET_AMD5536UDC is not set
1055# CONFIG_USB_GADGET_FSL_QE is not set
1056# CONFIG_USB_GADGET_NET2280 is not set
1057# CONFIG_USB_GADGET_GOKU is not set
1058# CONFIG_USB_GADGET_DUMMY_HCD is not set
1059CONFIG_USB_GADGET_DUALSPEED=y
1060CONFIG_USB_ZERO=m
1061CONFIG_USB_ETH=m
1062CONFIG_USB_ETH_RNDIS=y
1063CONFIG_USB_GADGETFS=m
1064CONFIG_USB_FILE_STORAGE=m
1065# CONFIG_USB_FILE_STORAGE_TEST is not set
1066CONFIG_USB_G_SERIAL=m
1067# CONFIG_USB_MIDI_GADGET is not set
1068# CONFIG_USB_G_PRINTER is not set
1069# CONFIG_USB_CDC_COMPOSITE is not set
1070CONFIG_MMC=m
1071# CONFIG_MMC_DEBUG is not set
1072# CONFIG_MMC_UNSAFE_RESUME is not set
1073
1074#
1075# MMC/SD/SDIO Card Drivers
1076#
1077CONFIG_MMC_BLOCK=m
1078CONFIG_MMC_BLOCK_BOUNCE=y
1079# CONFIG_SDIO_UART is not set
1080# CONFIG_MMC_TEST is not set
1081
1082#
1083# MMC/SD/SDIO Host Controller Drivers
1084#
1085# CONFIG_MMC_SDHCI is not set
1086CONFIG_MMC_ATMELMCI=m
1087# CONFIG_MMC_SPI is not set
1088# CONFIG_MEMSTICK is not set
1089# CONFIG_NEW_LEDS is not set
1090# CONFIG_ACCESSIBILITY is not set
1091CONFIG_RTC_LIB=y
1092CONFIG_RTC_CLASS=y
1093CONFIG_RTC_HCTOSYS=y
1094CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
1095# CONFIG_RTC_DEBUG is not set
1096
1097#
1098# RTC interfaces
1099#
1100CONFIG_RTC_INTF_SYSFS=y
1101CONFIG_RTC_INTF_PROC=y
1102CONFIG_RTC_INTF_DEV=y
1103# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1104# CONFIG_RTC_DRV_TEST is not set
1105
1106#
1107# I2C RTC drivers
1108#
1109# CONFIG_RTC_DRV_DS1307 is not set
1110# CONFIG_RTC_DRV_DS1374 is not set
1111# CONFIG_RTC_DRV_DS1672 is not set
1112# CONFIG_RTC_DRV_MAX6900 is not set
1113# CONFIG_RTC_DRV_RS5C372 is not set
1114# CONFIG_RTC_DRV_ISL1208 is not set
1115# CONFIG_RTC_DRV_X1205 is not set
1116# CONFIG_RTC_DRV_PCF8563 is not set
1117# CONFIG_RTC_DRV_PCF8583 is not set
1118# CONFIG_RTC_DRV_M41T80 is not set
1119# CONFIG_RTC_DRV_S35390A is not set
1120# CONFIG_RTC_DRV_FM3130 is not set
1121
1122#
1123# SPI RTC drivers
1124#
1125# CONFIG_RTC_DRV_M41T94 is not set
1126# CONFIG_RTC_DRV_DS1305 is not set
1127# CONFIG_RTC_DRV_MAX6902 is not set
1128# CONFIG_RTC_DRV_R9701 is not set
1129# CONFIG_RTC_DRV_RS5C348 is not set
1130# CONFIG_RTC_DRV_DS3234 is not set
1131
1132#
1133# Platform RTC drivers
1134#
1135# CONFIG_RTC_DRV_DS1286 is not set
1136# CONFIG_RTC_DRV_DS1511 is not set
1137# CONFIG_RTC_DRV_DS1553 is not set
1138# CONFIG_RTC_DRV_DS1742 is not set
1139# CONFIG_RTC_DRV_STK17TA8 is not set
1140# CONFIG_RTC_DRV_M48T86 is not set
1141# CONFIG_RTC_DRV_M48T35 is not set
1142# CONFIG_RTC_DRV_M48T59 is not set
1143# CONFIG_RTC_DRV_BQ4802 is not set
1144# CONFIG_RTC_DRV_V3020 is not set
1145
1146#
1147# on-CPU RTC drivers
1148#
1149CONFIG_RTC_DRV_AT32AP700X=y
1150# CONFIG_DMADEVICES is not set
1151# CONFIG_UIO is not set
1152# CONFIG_STAGING is not set
1153
1154#
1155# File systems
1156#
1157CONFIG_EXT2_FS=m
1158# CONFIG_EXT2_FS_XATTR is not set
1159# CONFIG_EXT2_FS_XIP is not set
1160# CONFIG_EXT3_FS is not set
1161# CONFIG_EXT4_FS is not set
1162# CONFIG_REISERFS_FS is not set
1163# CONFIG_JFS_FS is not set
1164# CONFIG_FS_POSIX_ACL is not set
1165CONFIG_FILE_LOCKING=y
1166# CONFIG_XFS_FS is not set
1167# CONFIG_OCFS2_FS is not set
1168# CONFIG_DNOTIFY is not set
1169CONFIG_INOTIFY=y
1170CONFIG_INOTIFY_USER=y
1171# CONFIG_QUOTA is not set
1172# CONFIG_AUTOFS_FS is not set
1173# CONFIG_AUTOFS4_FS is not set
1174# CONFIG_FUSE_FS is not set
1175
1176#
1177# CD-ROM/DVD Filesystems
1178#
1179# CONFIG_ISO9660_FS is not set
1180# CONFIG_UDF_FS is not set
1181
1182#
1183# DOS/FAT/NT Filesystems
1184#
1185CONFIG_FAT_FS=y
1186CONFIG_MSDOS_FS=y
1187CONFIG_VFAT_FS=m
1188CONFIG_FAT_DEFAULT_CODEPAGE=850
1189CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1190# CONFIG_NTFS_FS is not set
1191
1192#
1193# Pseudo filesystems
1194#
1195CONFIG_PROC_FS=y
1196# CONFIG_PROC_KCORE is not set
1197CONFIG_PROC_SYSCTL=y
1198CONFIG_PROC_PAGE_MONITOR=y
1199CONFIG_SYSFS=y
1200CONFIG_TMPFS=y
1201# CONFIG_TMPFS_POSIX_ACL is not set
1202# CONFIG_HUGETLB_PAGE is not set
1203CONFIG_CONFIGFS_FS=y
1204
1205#
1206# Miscellaneous filesystems
1207#
1208# CONFIG_ADFS_FS is not set
1209# CONFIG_AFFS_FS is not set
1210# CONFIG_HFS_FS is not set
1211# CONFIG_HFSPLUS_FS is not set
1212# CONFIG_BEFS_FS is not set
1213# CONFIG_BFS_FS is not set
1214# CONFIG_EFS_FS is not set
1215CONFIG_JFFS2_FS=y
1216CONFIG_JFFS2_FS_DEBUG=0
1217CONFIG_JFFS2_FS_WRITEBUFFER=y
1218# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1219# CONFIG_JFFS2_SUMMARY is not set
1220# CONFIG_JFFS2_FS_XATTR is not set
1221# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1222CONFIG_JFFS2_ZLIB=y
1223# CONFIG_JFFS2_LZO is not set
1224CONFIG_JFFS2_RTIME=y
1225# CONFIG_JFFS2_RUBIN is not set
1226# CONFIG_CRAMFS is not set
1227# CONFIG_VXFS_FS is not set
1228# CONFIG_MINIX_FS is not set
1229# CONFIG_OMFS_FS is not set
1230# CONFIG_HPFS_FS is not set
1231# CONFIG_QNX4FS_FS is not set
1232# CONFIG_ROMFS_FS is not set
1233# CONFIG_SYSV_FS is not set
1234# CONFIG_UFS_FS is not set
1235CONFIG_NETWORK_FILESYSTEMS=y
1236CONFIG_NFS_FS=y
1237CONFIG_NFS_V3=y
1238# CONFIG_NFS_V3_ACL is not set
1239# CONFIG_NFS_V4 is not set
1240CONFIG_ROOT_NFS=y
1241# CONFIG_NFSD is not set
1242CONFIG_LOCKD=y
1243CONFIG_LOCKD_V4=y
1244CONFIG_NFS_COMMON=y
1245CONFIG_SUNRPC=y
1246# CONFIG_SUNRPC_REGISTER_V4 is not set
1247# CONFIG_RPCSEC_GSS_KRB5 is not set
1248# CONFIG_RPCSEC_GSS_SPKM3 is not set
1249# CONFIG_SMB_FS is not set
1250# CONFIG_CIFS is not set
1251# CONFIG_NCP_FS is not set
1252# CONFIG_CODA_FS is not set
1253# CONFIG_AFS_FS is not set
1254
1255#
1256# Partition Types
1257#
1258# CONFIG_PARTITION_ADVANCED is not set
1259CONFIG_MSDOS_PARTITION=y
1260CONFIG_NLS=y
1261CONFIG_NLS_DEFAULT="iso8859-1"
1262CONFIG_NLS_CODEPAGE_437=m
1263# CONFIG_NLS_CODEPAGE_737 is not set
1264# CONFIG_NLS_CODEPAGE_775 is not set
1265CONFIG_NLS_CODEPAGE_850=m
1266# CONFIG_NLS_CODEPAGE_852 is not set
1267# CONFIG_NLS_CODEPAGE_855 is not set
1268# CONFIG_NLS_CODEPAGE_857 is not set
1269# CONFIG_NLS_CODEPAGE_860 is not set
1270# CONFIG_NLS_CODEPAGE_861 is not set
1271# CONFIG_NLS_CODEPAGE_862 is not set
1272# CONFIG_NLS_CODEPAGE_863 is not set
1273# CONFIG_NLS_CODEPAGE_864 is not set
1274# CONFIG_NLS_CODEPAGE_865 is not set
1275# CONFIG_NLS_CODEPAGE_866 is not set
1276# CONFIG_NLS_CODEPAGE_869 is not set
1277# CONFIG_NLS_CODEPAGE_936 is not set
1278# CONFIG_NLS_CODEPAGE_950 is not set
1279# CONFIG_NLS_CODEPAGE_932 is not set
1280# CONFIG_NLS_CODEPAGE_949 is not set
1281# CONFIG_NLS_CODEPAGE_874 is not set
1282# CONFIG_NLS_ISO8859_8 is not set
1283# CONFIG_NLS_CODEPAGE_1250 is not set
1284# CONFIG_NLS_CODEPAGE_1251 is not set
1285# CONFIG_NLS_ASCII is not set
1286CONFIG_NLS_ISO8859_1=m
1287# CONFIG_NLS_ISO8859_2 is not set
1288# CONFIG_NLS_ISO8859_3 is not set
1289# CONFIG_NLS_ISO8859_4 is not set
1290# CONFIG_NLS_ISO8859_5 is not set
1291# CONFIG_NLS_ISO8859_6 is not set
1292# CONFIG_NLS_ISO8859_7 is not set
1293# CONFIG_NLS_ISO8859_9 is not set
1294# CONFIG_NLS_ISO8859_13 is not set
1295# CONFIG_NLS_ISO8859_14 is not set
1296# CONFIG_NLS_ISO8859_15 is not set
1297# CONFIG_NLS_KOI8_R is not set
1298# CONFIG_NLS_KOI8_U is not set
1299CONFIG_NLS_UTF8=m
1300# CONFIG_DLM is not set
1301
1302#
1303# Kernel hacking
1304#
1305# CONFIG_PRINTK_TIME is not set
1306CONFIG_ENABLE_WARN_DEPRECATED=y
1307CONFIG_ENABLE_MUST_CHECK=y
1308CONFIG_FRAME_WARN=1024
1309CONFIG_MAGIC_SYSRQ=y
1310# CONFIG_UNUSED_SYMBOLS is not set
1311# CONFIG_DEBUG_FS is not set
1312# CONFIG_HEADERS_CHECK is not set
1313CONFIG_DEBUG_KERNEL=y
1314# CONFIG_DEBUG_SHIRQ is not set
1315CONFIG_DETECT_SOFTLOCKUP=y
1316# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1317CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1318CONFIG_SCHED_DEBUG=y
1319# CONFIG_SCHEDSTATS is not set
1320# CONFIG_TIMER_STATS is not set
1321# CONFIG_DEBUG_OBJECTS is not set
1322# CONFIG_SLUB_DEBUG_ON is not set
1323# CONFIG_SLUB_STATS is not set
1324# CONFIG_DEBUG_RT_MUTEXES is not set
1325# CONFIG_RT_MUTEX_TESTER is not set
1326# CONFIG_DEBUG_SPINLOCK is not set
1327# CONFIG_DEBUG_MUTEXES is not set
1328# CONFIG_DEBUG_LOCK_ALLOC is not set
1329# CONFIG_PROVE_LOCKING is not set
1330# CONFIG_LOCK_STAT is not set
1331# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1332# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1333# CONFIG_DEBUG_KOBJECT is not set
1334CONFIG_DEBUG_BUGVERBOSE=y
1335# CONFIG_DEBUG_INFO is not set
1336# CONFIG_DEBUG_VM is not set
1337# CONFIG_DEBUG_WRITECOUNT is not set
1338# CONFIG_DEBUG_MEMORY_INIT is not set
1339# CONFIG_DEBUG_LIST is not set
1340# CONFIG_DEBUG_SG is not set
1341CONFIG_FRAME_POINTER=y
1342# CONFIG_BOOT_PRINTK_DELAY is not set
1343# CONFIG_RCU_TORTURE_TEST is not set
1344# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1345# CONFIG_KPROBES_SANITY_TEST is not set
1346# CONFIG_BACKTRACE_SELF_TEST is not set
1347# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1348# CONFIG_LKDTM is not set
1349# CONFIG_FAULT_INJECTION is not set
1350# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1351# CONFIG_SAMPLES is not set
1352
1353#
1354# Security options
1355#
1356# CONFIG_KEYS is not set
1357# CONFIG_SECURITY is not set
1358# CONFIG_SECURITYFS is not set
1359# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1360CONFIG_CRYPTO=y
1361
1362#
1363# Crypto core or helper
1364#
1365# CONFIG_CRYPTO_FIPS is not set
1366CONFIG_CRYPTO_ALGAPI=y
1367CONFIG_CRYPTO_AEAD=y
1368CONFIG_CRYPTO_BLKCIPHER=y
1369CONFIG_CRYPTO_HASH=y
1370CONFIG_CRYPTO_RNG=y
1371CONFIG_CRYPTO_MANAGER=y
1372# CONFIG_CRYPTO_GF128MUL is not set
1373# CONFIG_CRYPTO_NULL is not set
1374# CONFIG_CRYPTO_CRYPTD is not set
1375CONFIG_CRYPTO_AUTHENC=y
1376# CONFIG_CRYPTO_TEST is not set
1377
1378#
1379# Authenticated Encryption with Associated Data
1380#
1381# CONFIG_CRYPTO_CCM is not set
1382# CONFIG_CRYPTO_GCM is not set
1383# CONFIG_CRYPTO_SEQIV is not set
1384
1385#
1386# Block modes
1387#
1388CONFIG_CRYPTO_CBC=y
1389# CONFIG_CRYPTO_CTR is not set
1390# CONFIG_CRYPTO_CTS is not set
1391CONFIG_CRYPTO_ECB=m
1392# CONFIG_CRYPTO_LRW is not set
1393CONFIG_CRYPTO_PCBC=m
1394# CONFIG_CRYPTO_XTS is not set
1395
1396#
1397# Hash modes
1398#
1399CONFIG_CRYPTO_HMAC=y
1400# CONFIG_CRYPTO_XCBC is not set
1401
1402#
1403# Digest
1404#
1405# CONFIG_CRYPTO_CRC32C is not set
1406# CONFIG_CRYPTO_MD4 is not set
1407CONFIG_CRYPTO_MD5=y
1408# CONFIG_CRYPTO_MICHAEL_MIC is not set
1409# CONFIG_CRYPTO_RMD128 is not set
1410# CONFIG_CRYPTO_RMD160 is not set
1411# CONFIG_CRYPTO_RMD256 is not set
1412# CONFIG_CRYPTO_RMD320 is not set
1413CONFIG_CRYPTO_SHA1=y
1414# CONFIG_CRYPTO_SHA256 is not set
1415# CONFIG_CRYPTO_SHA512 is not set
1416# CONFIG_CRYPTO_TGR192 is not set
1417# CONFIG_CRYPTO_WP512 is not set
1418
1419#
1420# Ciphers
1421#
1422# CONFIG_CRYPTO_AES is not set
1423# CONFIG_CRYPTO_ANUBIS is not set
1424CONFIG_CRYPTO_ARC4=m
1425# CONFIG_CRYPTO_BLOWFISH is not set
1426# CONFIG_CRYPTO_CAMELLIA is not set
1427# CONFIG_CRYPTO_CAST5 is not set
1428# CONFIG_CRYPTO_CAST6 is not set
1429CONFIG_CRYPTO_DES=y
1430# CONFIG_CRYPTO_FCRYPT is not set
1431# CONFIG_CRYPTO_KHAZAD is not set
1432# CONFIG_CRYPTO_SALSA20 is not set
1433# CONFIG_CRYPTO_SEED is not set
1434# CONFIG_CRYPTO_SERPENT is not set
1435# CONFIG_CRYPTO_TEA is not set
1436# CONFIG_CRYPTO_TWOFISH is not set
1437
1438#
1439# Compression
1440#
1441CONFIG_CRYPTO_DEFLATE=y
1442# CONFIG_CRYPTO_LZO is not set
1443
1444#
1445# Random Number Generation
1446#
1447# CONFIG_CRYPTO_ANSI_CPRNG is not set
1448CONFIG_CRYPTO_HW=y
1449
1450#
1451# Library routines
1452#
1453CONFIG_BITREVERSE=y
1454CONFIG_CRC_CCITT=m
1455# CONFIG_CRC16 is not set
1456# CONFIG_CRC_T10DIF is not set
1457CONFIG_CRC_ITU_T=m
1458CONFIG_CRC32=y
1459CONFIG_CRC7=m
1460# CONFIG_LIBCRC32C is not set
1461CONFIG_ZLIB_INFLATE=y
1462CONFIG_ZLIB_DEFLATE=y
1463CONFIG_GENERIC_ALLOCATOR=y
1464CONFIG_PLIST=y
1465CONFIG_HAS_IOMEM=y
1466CONFIG_HAS_IOPORT=y
1467CONFIG_HAS_DMA=y
diff --git a/arch/avr32/include/asm/Kbuild b/arch/avr32/include/asm/Kbuild
index 3136628ba8d2..219822c8ad18 100644
--- a/arch/avr32/include/asm/Kbuild
+++ b/arch/avr32/include/asm/Kbuild
@@ -1,3 +1,4 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += swab.h
3header-y += cachectl.h 4header-y += cachectl.h
diff --git a/arch/avr32/include/asm/atmel-mci.h b/arch/avr32/include/asm/atmel-mci.h
deleted file mode 100644
index 59f3fadd0b68..000000000000
--- a/arch/avr32/include/asm/atmel-mci.h
+++ /dev/null
@@ -1,39 +0,0 @@
1#ifndef __ASM_AVR32_ATMEL_MCI_H
2#define __ASM_AVR32_ATMEL_MCI_H
3
4#define ATMEL_MCI_MAX_NR_SLOTS 2
5
6struct dma_slave;
7
8/**
9 * struct mci_slot_pdata - board-specific per-slot configuration
10 * @bus_width: Number of data lines wired up the slot
11 * @detect_pin: GPIO pin wired to the card detect switch
12 * @wp_pin: GPIO pin wired to the write protect sensor
13 *
14 * If a given slot is not present on the board, @bus_width should be
15 * set to 0. The other fields are ignored in this case.
16 *
17 * Any pins that aren't available should be set to a negative value.
18 *
19 * Note that support for multiple slots is experimental -- some cards
20 * might get upset if we don't get the clock management exactly right.
21 * But in most cases, it should work just fine.
22 */
23struct mci_slot_pdata {
24 unsigned int bus_width;
25 int detect_pin;
26 int wp_pin;
27};
28
29/**
30 * struct mci_platform_data - board-specific MMC/SDcard configuration
31 * @dma_slave: DMA slave interface to use in data transfers, or NULL.
32 * @slot: Per-slot configuration data.
33 */
34struct mci_platform_data {
35 struct dma_slave *dma_slave;
36 struct mci_slot_pdata slot[ATMEL_MCI_MAX_NR_SLOTS];
37};
38
39#endif /* __ASM_AVR32_ATMEL_MCI_H */
diff --git a/arch/avr32/include/asm/atomic.h b/arch/avr32/include/asm/atomic.h
index 7ef3862a73d0..318815107748 100644
--- a/arch/avr32/include/asm/atomic.h
+++ b/arch/avr32/include/asm/atomic.h
@@ -14,9 +14,9 @@
14#ifndef __ASM_AVR32_ATOMIC_H 14#ifndef __ASM_AVR32_ATOMIC_H
15#define __ASM_AVR32_ATOMIC_H 15#define __ASM_AVR32_ATOMIC_H
16 16
17#include <linux/types.h>
17#include <asm/system.h> 18#include <asm/system.h>
18 19
19typedef struct { volatile int counter; } atomic_t;
20#define ATOMIC_INIT(i) { (i) } 20#define ATOMIC_INIT(i) { (i) }
21 21
22#define atomic_read(v) ((v)->counter) 22#define atomic_read(v) ((v)->counter)
diff --git a/arch/avr32/include/asm/bitops.h b/arch/avr32/include/asm/bitops.h
index 1a50b69b1a19..f7dd5f71edf7 100644
--- a/arch/avr32/include/asm/bitops.h
+++ b/arch/avr32/include/asm/bitops.h
@@ -263,6 +263,11 @@ static inline int fls(unsigned long word)
263 return 32 - result; 263 return 32 - result;
264} 264}
265 265
266static inline int __fls(unsigned long word)
267{
268 return fls(word) - 1;
269}
270
266unsigned long find_first_zero_bit(const unsigned long *addr, 271unsigned long find_first_zero_bit(const unsigned long *addr,
267 unsigned long size); 272 unsigned long size);
268unsigned long find_next_zero_bit(const unsigned long *addr, 273unsigned long find_next_zero_bit(const unsigned long *addr,
diff --git a/arch/avr32/include/asm/byteorder.h b/arch/avr32/include/asm/byteorder.h
index 8e3af02076dd..2aba64b4e122 100644
--- a/arch/avr32/include/asm/byteorder.h
+++ b/arch/avr32/include/asm/byteorder.h
@@ -4,34 +4,7 @@
4#ifndef __ASM_AVR32_BYTEORDER_H 4#ifndef __ASM_AVR32_BYTEORDER_H
5#define __ASM_AVR32_BYTEORDER_H 5#define __ASM_AVR32_BYTEORDER_H
6 6
7#include <asm/types.h> 7#include <asm/swab.h>
8#include <linux/compiler.h> 8#include <linux/byteorder/big_endian.h>
9 9
10#define __BIG_ENDIAN
11#define __SWAB_64_THRU_32__
12
13#ifdef __CHECKER__
14extern unsigned long __builtin_bswap_32(unsigned long x);
15extern unsigned short __builtin_bswap_16(unsigned short x);
16#endif
17
18/*
19 * avr32-linux-gcc versions earlier than 4.2 improperly sign-extends
20 * the result.
21 */
22#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 2)
23static inline __attribute_const__ __u16 __arch_swab16(__u16 val)
24{
25 return __builtin_bswap_16(val);
26}
27#define __arch_swab16 __arch_swab16
28
29static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
30{
31 return __builtin_bswap_32(val);
32}
33#define __arch_swab32 __arch_swab32
34#endif
35
36#include <linux/byteorder.h>
37#endif /* __ASM_AVR32_BYTEORDER_H */ 10#endif /* __ASM_AVR32_BYTEORDER_H */
diff --git a/arch/avr32/include/asm/kdebug.h b/arch/avr32/include/asm/kdebug.h
index ca4f9542365a..f930ce286803 100644
--- a/arch/avr32/include/asm/kdebug.h
+++ b/arch/avr32/include/asm/kdebug.h
@@ -6,6 +6,7 @@ enum die_val {
6 DIE_BREAKPOINT, 6 DIE_BREAKPOINT,
7 DIE_SSTEP, 7 DIE_SSTEP,
8 DIE_NMI, 8 DIE_NMI,
9 DIE_OOPS,
9}; 10};
10 11
11#endif /* __ASM_AVR32_KDEBUG_H */ 12#endif /* __ASM_AVR32_KDEBUG_H */
diff --git a/arch/avr32/include/asm/swab.h b/arch/avr32/include/asm/swab.h
new file mode 100644
index 000000000000..a14aa5b46d98
--- /dev/null
+++ b/arch/avr32/include/asm/swab.h
@@ -0,0 +1,35 @@
1/*
2 * AVR32 byteswapping functions.
3 */
4#ifndef __ASM_AVR32_SWAB_H
5#define __ASM_AVR32_SWAB_H
6
7#include <asm/types.h>
8#include <linux/compiler.h>
9
10#define __SWAB_64_THRU_32__
11
12#ifdef __CHECKER__
13extern unsigned long __builtin_bswap_32(unsigned long x);
14extern unsigned short __builtin_bswap_16(unsigned short x);
15#endif
16
17/*
18 * avr32-linux-gcc versions earlier than 4.2 improperly sign-extends
19 * the result.
20 */
21#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 2)
22static inline __attribute_const__ __u16 __arch_swab16(__u16 val)
23{
24 return __builtin_bswap_16(val);
25}
26#define __arch_swab16 __arch_swab16
27
28static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
29{
30 return __builtin_bswap_32(val);
31}
32#define __arch_swab32 __arch_swab32
33#endif
34
35#endif /* __ASM_AVR32_SWAB_H */
diff --git a/arch/avr32/include/asm/syscalls.h b/arch/avr32/include/asm/syscalls.h
new file mode 100644
index 000000000000..483d666c27c0
--- /dev/null
+++ b/arch/avr32/include/asm/syscalls.h
@@ -0,0 +1,39 @@
1/*
2 * syscalls.h - Linux syscall interfaces (arch-specific)
3 *
4 * Copyright (c) 2008 Jaswinder Singh
5 *
6 * This file is released under the GPLv2.
7 * See the file COPYING for more details.
8 */
9
10#ifndef _ASM_AVR32_SYSCALLS_H
11#define _ASM_AVR32_SYSCALLS_H
12
13#include <linux/compiler.h>
14#include <linux/linkage.h>
15#include <linux/types.h>
16#include <linux/signal.h>
17
18/* kernel/process.c */
19asmlinkage int sys_fork(struct pt_regs *);
20asmlinkage int sys_clone(unsigned long, unsigned long,
21 unsigned long, unsigned long,
22 struct pt_regs *);
23asmlinkage int sys_vfork(struct pt_regs *);
24asmlinkage int sys_execve(char __user *, char __user *__user *,
25 char __user *__user *, struct pt_regs *);
26
27/* kernel/signal.c */
28asmlinkage int sys_sigaltstack(const stack_t __user *, stack_t __user *,
29 struct pt_regs *);
30asmlinkage int sys_rt_sigreturn(struct pt_regs *);
31
32/* kernel/sys_avr32.c */
33asmlinkage long sys_mmap2(unsigned long, unsigned long, unsigned long,
34 unsigned long, unsigned long, off_t);
35
36/* mm/cache.c */
37asmlinkage int sys_cacheflush(int, void __user *, size_t);
38
39#endif /* _ASM_AVR32_SYSCALLS_H */
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c
index 134d5302b6dd..43ae555ecb33 100644
--- a/arch/avr32/kernel/process.c
+++ b/arch/avr32/kernel/process.c
@@ -18,6 +18,7 @@
18 18
19#include <asm/sysreg.h> 19#include <asm/sysreg.h>
20#include <asm/ocd.h> 20#include <asm/ocd.h>
21#include <asm/syscalls.h>
21 22
22#include <mach/pm.h> 23#include <mach/pm.h>
23 24
diff --git a/arch/avr32/kernel/signal.c b/arch/avr32/kernel/signal.c
index c5b11f9067f1..803d7be0938f 100644
--- a/arch/avr32/kernel/signal.c
+++ b/arch/avr32/kernel/signal.c
@@ -19,6 +19,7 @@
19 19
20#include <asm/uaccess.h> 20#include <asm/uaccess.h>
21#include <asm/ucontext.h> 21#include <asm/ucontext.h>
22#include <asm/syscalls.h>
22 23
23#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 24#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
24 25
diff --git a/arch/avr32/kernel/sys_avr32.c b/arch/avr32/kernel/sys_avr32.c
index 8e8911e55c8f..5d2daeaf356f 100644
--- a/arch/avr32/kernel/sys_avr32.c
+++ b/arch/avr32/kernel/sys_avr32.c
@@ -13,6 +13,7 @@
13 13
14#include <asm/mman.h> 14#include <asm/mman.h>
15#include <asm/uaccess.h> 15#include <asm/uaccess.h>
16#include <asm/syscalls.h>
16 17
17asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 18asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
18 unsigned long prot, unsigned long flags, 19 unsigned long prot, unsigned long flags,
diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c
index 283481d74a5b..0ff46bf873b0 100644
--- a/arch/avr32/kernel/time.c
+++ b/arch/avr32/kernel/time.c
@@ -106,7 +106,6 @@ static struct clock_event_device comparator = {
106 .features = CLOCK_EVT_FEAT_ONESHOT, 106 .features = CLOCK_EVT_FEAT_ONESHOT,
107 .shift = 16, 107 .shift = 16,
108 .rating = 50, 108 .rating = 50,
109 .cpumask = CPU_MASK_CPU0,
110 .set_next_event = comparator_next_event, 109 .set_next_event = comparator_next_event,
111 .set_mode = comparator_mode, 110 .set_mode = comparator_mode,
112}; 111};
@@ -134,6 +133,7 @@ void __init time_init(void)
134 comparator.mult = div_sc(counter_hz, NSEC_PER_SEC, comparator.shift); 133 comparator.mult = div_sc(counter_hz, NSEC_PER_SEC, comparator.shift);
135 comparator.max_delta_ns = clockevent_delta2ns((u32)~0, &comparator); 134 comparator.max_delta_ns = clockevent_delta2ns((u32)~0, &comparator);
136 comparator.min_delta_ns = clockevent_delta2ns(50, &comparator) + 1; 135 comparator.min_delta_ns = clockevent_delta2ns(50, &comparator) + 1;
136 comparator.cpumask = cpumask_of(0);
137 137
138 sysreg_write(COMPARE, 0); 138 sysreg_write(COMPARE, 0);
139 timer_irqaction.dev_id = &comparator; 139 timer_irqaction.dev_id = &comparator;
diff --git a/arch/avr32/kernel/traps.c b/arch/avr32/kernel/traps.c
index 0d987373bc01..d547c8df157d 100644
--- a/arch/avr32/kernel/traps.c
+++ b/arch/avr32/kernel/traps.c
@@ -7,6 +7,7 @@
7 */ 7 */
8 8
9#include <linux/bug.h> 9#include <linux/bug.h>
10#include <linux/hardirq.h>
10#include <linux/init.h> 11#include <linux/init.h>
11#include <linux/kallsyms.h> 12#include <linux/kallsyms.h>
12#include <linux/kdebug.h> 13#include <linux/kdebug.h>
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c
index 066252eebf61..3fbfd1e32a9e 100644
--- a/arch/avr32/mach-at32ap/at32ap700x.c
+++ b/arch/avr32/mach-at32ap/at32ap700x.c
@@ -15,8 +15,8 @@
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16#include <linux/spi/spi.h> 16#include <linux/spi/spi.h>
17#include <linux/usb/atmel_usba_udc.h> 17#include <linux/usb/atmel_usba_udc.h>
18#include <linux/atmel-mci.h>
18 19
19#include <asm/atmel-mci.h>
20#include <asm/io.h> 20#include <asm/io.h>
21#include <asm/irq.h> 21#include <asm/irq.h>
22 22
@@ -421,7 +421,7 @@ static unsigned long hsb_clk_get_rate(struct clk *clk)
421 return bus_clk_get_rate(clk, shift); 421 return bus_clk_get_rate(clk, shift);
422} 422}
423 423
424static void pba_clk_mode(struct clk *clk, int enabled) 424void pba_clk_mode(struct clk *clk, int enabled)
425{ 425{
426 unsigned long flags; 426 unsigned long flags;
427 u32 mask; 427 u32 mask;
@@ -436,7 +436,7 @@ static void pba_clk_mode(struct clk *clk, int enabled)
436 spin_unlock_irqrestore(&pm_lock, flags); 436 spin_unlock_irqrestore(&pm_lock, flags);
437} 437}
438 438
439static unsigned long pba_clk_get_rate(struct clk *clk) 439unsigned long pba_clk_get_rate(struct clk *clk)
440{ 440{
441 unsigned long cksel, shift = 0; 441 unsigned long cksel, shift = 0;
442 442
@@ -1305,7 +1305,7 @@ struct platform_device *__init
1305at32_add_device_mci(unsigned int id, struct mci_platform_data *data) 1305at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
1306{ 1306{
1307 struct platform_device *pdev; 1307 struct platform_device *pdev;
1308 struct dw_dma_slave *dws; 1308 struct dw_dma_slave *dws = &data->dma_slave;
1309 u32 pioa_mask; 1309 u32 pioa_mask;
1310 u32 piob_mask; 1310 u32 piob_mask;
1311 1311
@@ -1324,22 +1324,13 @@ at32_add_device_mci(unsigned int id, struct mci_platform_data *data)
1324 ARRAY_SIZE(atmel_mci0_resource))) 1324 ARRAY_SIZE(atmel_mci0_resource)))
1325 goto fail; 1325 goto fail;
1326 1326
1327 if (data->dma_slave) 1327 dws->dma_dev = &dw_dmac0_device.dev;
1328 dws = kmemdup(to_dw_dma_slave(data->dma_slave), 1328 dws->reg_width = DW_DMA_SLAVE_WIDTH_32BIT;
1329 sizeof(struct dw_dma_slave), GFP_KERNEL);
1330 else
1331 dws = kzalloc(sizeof(struct dw_dma_slave), GFP_KERNEL);
1332
1333 dws->slave.dev = &pdev->dev;
1334 dws->slave.dma_dev = &dw_dmac0_device.dev;
1335 dws->slave.reg_width = DMA_SLAVE_WIDTH_32BIT;
1336 dws->cfg_hi = (DWC_CFGH_SRC_PER(0) 1329 dws->cfg_hi = (DWC_CFGH_SRC_PER(0)
1337 | DWC_CFGH_DST_PER(1)); 1330 | DWC_CFGH_DST_PER(1));
1338 dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL 1331 dws->cfg_lo &= ~(DWC_CFGL_HS_DST_POL
1339 | DWC_CFGL_HS_SRC_POL); 1332 | DWC_CFGL_HS_SRC_POL);
1340 1333
1341 data->dma_slave = &dws->slave;
1342
1343 if (platform_device_add_data(pdev, data, 1334 if (platform_device_add_data(pdev, data,
1344 sizeof(struct mci_platform_data))) 1335 sizeof(struct mci_platform_data)))
1345 goto fail; 1336 goto fail;
diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c
index 138a00a2a2d0..442f08c5e641 100644
--- a/arch/avr32/mach-at32ap/clock.c
+++ b/arch/avr32/mach-at32ap/clock.c
@@ -198,7 +198,7 @@ dump_clock(struct clk *parent, struct clkinf *r)
198 unsigned i; 198 unsigned i;
199 199
200 /* skip clocks coupled to devices that aren't registered */ 200 /* skip clocks coupled to devices that aren't registered */
201 if (parent->dev && !parent->dev->bus_id[0] && !parent->users) 201 if (parent->dev && !dev_name(parent->dev) && !parent->users)
202 return; 202 return;
203 203
204 /* <nest spaces> name <pad to end> */ 204 /* <nest spaces> name <pad to end> */
@@ -214,7 +214,7 @@ dump_clock(struct clk *parent, struct clkinf *r)
214 parent->users ? "on" : "off", /* NOTE: not-paranoid!! */ 214 parent->users ? "on" : "off", /* NOTE: not-paranoid!! */
215 clk_get_rate(parent)); 215 clk_get_rate(parent));
216 if (parent->dev) 216 if (parent->dev)
217 seq_printf(r->s, ", for %s", parent->dev->bus_id); 217 seq_printf(r->s, ", for %s", dev_name(parent->dev));
218 seq_printf(r->s, "\n"); 218 seq_printf(r->s, "\n");
219 219
220 /* cost of this scan is small, but not linear... */ 220 /* cost of this scan is small, but not linear... */
diff --git a/arch/avr32/mach-at32ap/clock.h b/arch/avr32/mach-at32ap/clock.h
index 623bf0e9a1e7..4c7ebbdc6dfa 100644
--- a/arch/avr32/mach-at32ap/clock.h
+++ b/arch/avr32/mach-at32ap/clock.h
@@ -30,3 +30,6 @@ struct clk {
30 u16 users; /* Enabled if non-zero */ 30 u16 users; /* Enabled if non-zero */
31 u16 index; /* Sibling index */ 31 u16 index; /* Sibling index */
32}; 32};
33
34unsigned long pba_clk_get_rate(struct clk *clk);
35void pba_clk_mode(struct clk *clk, int enabled);
diff --git a/arch/avr32/mach-at32ap/include/mach/at32ap700x.h b/arch/avr32/mach-at32ap/include/mach/at32ap700x.h
index a77d372f6f3e..5c4c971eed8e 100644
--- a/arch/avr32/mach-at32ap/include/mach/at32ap700x.h
+++ b/arch/avr32/mach-at32ap/include/mach/at32ap700x.h
@@ -211,4 +211,7 @@
211 211
212#define ATMEL_LCDC_ALT_15BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_15B_DATA) 212#define ATMEL_LCDC_ALT_15BIT (ATMEL_LCDC_CONTROL | ATMEL_LCDC_ALT_15B_DATA)
213 213
214/* Bitmask for all EBI data (D16..D31) pins on port E */
215#define ATMEL_EBI_PE_DATA_ALL (0x0000FFFF)
216
214#endif /* __ASM_ARCH_AT32AP700X_H__ */ 217#endif /* __ASM_ARCH_AT32AP700X_H__ */
diff --git a/arch/avr32/mach-at32ap/include/mach/portmux.h b/arch/avr32/mach-at32ap/include/mach/portmux.h
index 21c79373b53f..4873024e3b96 100644
--- a/arch/avr32/mach-at32ap/include/mach/portmux.h
+++ b/arch/avr32/mach-at32ap/include/mach/portmux.h
@@ -25,6 +25,6 @@ void at32_select_periph(unsigned int port, unsigned int pin,
25 unsigned int periph, unsigned long flags); 25 unsigned int periph, unsigned long flags);
26void at32_select_gpio(unsigned int pin, unsigned long flags); 26void at32_select_gpio(unsigned int pin, unsigned long flags);
27void at32_deselect_pin(unsigned int pin); 27void at32_deselect_pin(unsigned int pin);
28void at32_reserve_pin(unsigned int pin); 28void at32_reserve_pin(unsigned int port, u32 pin_mask);
29 29
30#endif /* __ASM_ARCH_PORTMUX_H__ */ 30#endif /* __ASM_ARCH_PORTMUX_H__ */
diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c
index ed81a8bcb22d..09a274c9d0b7 100644
--- a/arch/avr32/mach-at32ap/pio.c
+++ b/arch/avr32/mach-at32ap/pio.c
@@ -167,22 +167,29 @@ void at32_deselect_pin(unsigned int pin)
167} 167}
168 168
169/* Reserve a pin, preventing anyone else from changing its configuration. */ 169/* Reserve a pin, preventing anyone else from changing its configuration. */
170void __init at32_reserve_pin(unsigned int pin) 170void __init at32_reserve_pin(unsigned int port, u32 pin_mask)
171{ 171{
172 struct pio_device *pio; 172 struct pio_device *pio;
173 unsigned int pin_index = pin & 0x1f;
174 173
175 pio = gpio_to_pio(pin); 174 /* assign and verify pio */
175 pio = gpio_to_pio(port);
176 if (unlikely(!pio)) { 176 if (unlikely(!pio)) {
177 printk("pio: invalid pin %u\n", pin); 177 printk(KERN_WARNING "pio: invalid port %u\n", port);
178 goto fail; 178 goto fail;
179 } 179 }
180 180
181 if (unlikely(test_and_set_bit(pin_index, &pio->pinmux_mask))) { 181 /* Test if any of the requested pins is already muxed */
182 printk("%s: pin %u is busy\n", pio->name, pin_index); 182 spin_lock(&pio_lock);
183 if (unlikely(pio->pinmux_mask & pin_mask)) {
184 printk(KERN_WARNING "%s: pin(s) busy (req. 0x%x, busy 0x%x)\n",
185 pio->name, pin_mask, pio->pinmux_mask & pin_mask);
186 spin_unlock(&pio_lock);
183 goto fail; 187 goto fail;
184 } 188 }
185 189
190 /* Reserve pins */
191 pio->pinmux_mask |= pin_mask;
192 spin_unlock(&pio_lock);
186 return; 193 return;
187 194
188fail: 195fail:
diff --git a/arch/avr32/mm/cache.c b/arch/avr32/mm/cache.c
index 15a4e5e142c1..24a74d1ca7d9 100644
--- a/arch/avr32/mm/cache.c
+++ b/arch/avr32/mm/cache.c
@@ -13,6 +13,7 @@
13#include <asm/cachectl.h> 13#include <asm/cachectl.h>
14#include <asm/processor.h> 14#include <asm/processor.h>
15#include <asm/uaccess.h> 15#include <asm/uaccess.h>
16#include <asm/syscalls.h>
16 17
17/* 18/*
18 * If you attempt to flush anything more than this, you need superuser 19 * If you attempt to flush anything more than this, you need superuser
diff --git a/arch/avr32/mm/init.c b/arch/avr32/mm/init.c
index fa92ff6d95f7..e819fa69a90e 100644
--- a/arch/avr32/mm/init.c
+++ b/arch/avr32/mm/init.c
@@ -97,7 +97,6 @@ void __init paging_init(void)
97 97
98 mem_map = NODE_DATA(0)->node_mem_map; 98 mem_map = NODE_DATA(0)->node_mem_map;
99 99
100 memset(zero_page, 0, PAGE_SIZE);
101 empty_zero_page = virt_to_page(zero_page); 100 empty_zero_page = virt_to_page(zero_page);
102 flush_dcache_page(empty_zero_page); 101 flush_dcache_page(empty_zero_page);
103} 102}
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 29e71ed6b8a7..a949c4fbbddd 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -26,6 +26,7 @@ config BLACKFIN
26 default y 26 default y
27 select HAVE_IDE 27 select HAVE_IDE
28 select HAVE_OPROFILE 28 select HAVE_OPROFILE
29 select ARCH_WANT_OPTIONAL_GPIOLIB
29 30
30config ZONE_DMA 31config ZONE_DMA
31 bool 32 bool
@@ -59,10 +60,6 @@ config GENERIC_CALIBRATE_DELAY
59 bool 60 bool
60 default y 61 default y
61 62
62config HARDWARE_PM
63 def_bool y
64 depends on OPROFILE
65
66source "init/Kconfig" 63source "init/Kconfig"
67 64
68source "kernel/Kconfig.preempt" 65source "kernel/Kconfig.preempt"
@@ -77,6 +74,26 @@ choice
77 prompt "CPU" 74 prompt "CPU"
78 default BF533 75 default BF533
79 76
77config BF512
78 bool "BF512"
79 help
80 BF512 Processor Support.
81
82config BF514
83 bool "BF514"
84 help
85 BF514 Processor Support.
86
87config BF516
88 bool "BF516"
89 help
90 BF516 Processor Support.
91
92config BF518
93 bool "BF518"
94 help
95 BF518 Processor Support.
96
80config BF522 97config BF522
81 bool "BF522" 98 bool "BF522"
82 help 99 help
@@ -137,6 +154,16 @@ config BF537
137 help 154 help
138 BF537 Processor Support. 155 BF537 Processor Support.
139 156
157config BF538
158 bool "BF538"
159 help
160 BF538 Processor Support.
161
162config BF539
163 bool "BF539"
164 help
165 BF539 Processor Support.
166
140config BF542 167config BF542
141 bool "BF542" 168 bool "BF542"
142 help 169 help
@@ -169,28 +196,55 @@ config BF561
169 196
170endchoice 197endchoice
171 198
199config SMP
200 depends on BF561
201 bool "Symmetric multi-processing support"
202 ---help---
203 This enables support for systems with more than one CPU,
204 like the dual core BF561. If you have a system with only one
205 CPU, say N. If you have a system with more than one CPU, say Y.
206
207 If you don't know what to do here, say N.
208
209config NR_CPUS
210 int
211 depends on SMP
212 default 2 if BF561
213
214config IRQ_PER_CPU
215 bool
216 depends on SMP
217 default y
218
219config TICK_SOURCE_SYSTMR0
220 bool
221 select BFIN_GPTIMERS
222 depends on SMP
223 default y
224
172config BF_REV_MIN 225config BF_REV_MIN
173 int 226 int
174 default 0 if (BF52x || BF54x) 227 default 0 if (BF51x || BF52x || BF54x)
175 default 2 if (BF537 || BF536 || BF534) 228 default 2 if (BF537 || BF536 || BF534)
176 default 3 if (BF561 ||BF533 || BF532 || BF531) 229 default 3 if (BF561 ||BF533 || BF532 || BF531)
230 default 4 if (BF538 || BF539)
177 231
178config BF_REV_MAX 232config BF_REV_MAX
179 int 233 int
180 default 2 if (BF52x || BF54x) 234 default 2 if (BF51x || BF52x || BF54x)
181 default 3 if (BF537 || BF536 || BF534) 235 default 3 if (BF537 || BF536 || BF534)
182 default 5 if (BF561) 236 default 5 if (BF561 || BF538 || BF539)
183 default 6 if (BF533 || BF532 || BF531) 237 default 6 if (BF533 || BF532 || BF531)
184 238
185choice 239choice
186 prompt "Silicon Rev" 240 prompt "Silicon Rev"
187 default BF_REV_0_1 if (BF52x || BF54x) 241 default BF_REV_0_1 if (BF51x || BF52x || BF54x)
188 default BF_REV_0_2 if (BF534 || BF536 || BF537) 242 default BF_REV_0_2 if (BF534 || BF536 || BF537)
189 default BF_REV_0_3 if (BF531 || BF532 || BF533 || BF561) 243 default BF_REV_0_3 if (BF531 || BF532 || BF533 || BF561)
190 244
191config BF_REV_0_0 245config BF_REV_0_0
192 bool "0.0" 246 bool "0.0"
193 depends on (BF52x || BF54x) 247 depends on (BF51x || BF52x || BF54x)
194 248
195config BF_REV_0_1 249config BF_REV_0_1
196 bool "0.1" 250 bool "0.1"
@@ -206,11 +260,11 @@ config BF_REV_0_3
206 260
207config BF_REV_0_4 261config BF_REV_0_4
208 bool "0.4" 262 bool "0.4"
209 depends on (BF561 || BF533 || BF532 || BF531) 263 depends on (BF561 || BF533 || BF532 || BF531 || BF538 || BF539)
210 264
211config BF_REV_0_5 265config BF_REV_0_5
212 bool "0.5" 266 bool "0.5"
213 depends on (BF561 || BF533 || BF532 || BF531) 267 depends on (BF561 || BF533 || BF532 || BF531 || BF538 || BF539)
214 268
215config BF_REV_0_6 269config BF_REV_0_6
216 bool "0.6" 270 bool "0.6"
@@ -224,6 +278,11 @@ config BF_REV_NONE
224 278
225endchoice 279endchoice
226 280
281config BF51x
282 bool
283 depends on (BF512 || BF514 || BF516 || BF518)
284 default y
285
227config BF52x 286config BF52x
228 bool 287 bool
229 depends on (BF522 || BF523 || BF524 || BF525 || BF526 || BF527) 288 depends on (BF522 || BF523 || BF524 || BF525 || BF526 || BF527)
@@ -258,7 +317,7 @@ config MEM_MT48LC16M16A2TG_75
258 317
259config MEM_MT48LC32M8A2_75 318config MEM_MT48LC32M8A2_75
260 bool 319 bool
261 depends on (BFIN537_STAMP || PNAV10) 320 depends on (BFIN537_STAMP || PNAV10 || BFIN538_EZKIT)
262 default y 321 default y
263 322
264config MEM_MT48LC8M32B2B5_7 323config MEM_MT48LC8M32B2B5_7
@@ -271,10 +330,17 @@ config MEM_MT48LC32M16A2TG_75
271 depends on (BFIN527_EZKIT || BFIN532_IP0X || BLACKSTAMP || BFIN526_EZBRD) 330 depends on (BFIN527_EZKIT || BFIN532_IP0X || BLACKSTAMP || BFIN526_EZBRD)
272 default y 331 default y
273 332
333config MEM_MT48LC32M8A2_75
334 bool
335 depends on (BFIN518F_EZBRD)
336 default y
337
338source "arch/blackfin/mach-bf518/Kconfig"
274source "arch/blackfin/mach-bf527/Kconfig" 339source "arch/blackfin/mach-bf527/Kconfig"
275source "arch/blackfin/mach-bf533/Kconfig" 340source "arch/blackfin/mach-bf533/Kconfig"
276source "arch/blackfin/mach-bf561/Kconfig" 341source "arch/blackfin/mach-bf561/Kconfig"
277source "arch/blackfin/mach-bf537/Kconfig" 342source "arch/blackfin/mach-bf537/Kconfig"
343source "arch/blackfin/mach-bf538/Kconfig"
278source "arch/blackfin/mach-bf548/Kconfig" 344source "arch/blackfin/mach-bf548/Kconfig"
279 345
280menu "Board customizations" 346menu "Board customizations"
@@ -307,6 +373,7 @@ config BOOT_LOAD
307 373
308config ROM_BASE 374config ROM_BASE
309 hex "Kernel ROM Base" 375 hex "Kernel ROM Base"
376 depends on ROMKERNEL
310 default "0x20040000" 377 default "0x20040000"
311 range 0x20000000 0x20400000 if !(BF54x || BF561) 378 range 0x20000000 0x20400000 if !(BF54x || BF561)
312 range 0x20000000 0x30000000 if (BF54x || BF561) 379 range 0x20000000 0x30000000 if (BF54x || BF561)
@@ -318,7 +385,7 @@ config CLKIN_HZ
318 int "Frequency of the crystal on the board in Hz" 385 int "Frequency of the crystal on the board in Hz"
319 default "11059200" if BFIN533_STAMP 386 default "11059200" if BFIN533_STAMP
320 default "27000000" if BFIN533_EZKIT 387 default "27000000" if BFIN533_EZKIT
321 default "25000000" if (BFIN537_STAMP || BFIN527_EZKIT || H8606_HVSISTEMAS || BLACKSTAMP || BFIN526_EZBRD) 388 default "25000000" if (BFIN537_STAMP || BFIN527_EZKIT || H8606_HVSISTEMAS || BLACKSTAMP || BFIN526_EZBRD || BFIN538_EZKIT || BFIN518F-EZBRD)
322 default "30000000" if BFIN561_EZKIT 389 default "30000000" if BFIN561_EZKIT
323 default "24576000" if PNAV10 390 default "24576000" if PNAV10
324 default "10000000" if BFIN532_IP0X 391 default "10000000" if BFIN532_IP0X
@@ -354,11 +421,11 @@ config VCO_MULT
354 range 1 64 421 range 1 64
355 default "22" if BFIN533_EZKIT 422 default "22" if BFIN533_EZKIT
356 default "45" if BFIN533_STAMP 423 default "45" if BFIN533_STAMP
357 default "20" if (BFIN537_STAMP || BFIN527_EZKIT || BFIN548_EZKIT || BFIN548_BLUETECHNIX_CM) 424 default "20" if (BFIN537_STAMP || BFIN527_EZKIT || BFIN548_EZKIT || BFIN548_BLUETECHNIX_CM || BFIN538_EZKIT)
358 default "22" if BFIN533_BLUETECHNIX_CM 425 default "22" if BFIN533_BLUETECHNIX_CM
359 default "20" if (BFIN537_BLUETECHNIX_CM || BFIN527_BLUETECHNIX_CM || BFIN561_BLUETECHNIX_CM) 426 default "20" if (BFIN537_BLUETECHNIX_CM || BFIN527_BLUETECHNIX_CM || BFIN561_BLUETECHNIX_CM)
360 default "20" if BFIN561_EZKIT 427 default "20" if BFIN561_EZKIT
361 default "16" if (H8606_HVSISTEMAS || BLACKSTAMP || BFIN526_EZBRD) 428 default "16" if (H8606_HVSISTEMAS || BLACKSTAMP || BFIN526_EZBRD || BFIN518F_EZBRD)
362 help 429 help
363 This controls the frequency of the on-chip PLL. This can be between 1 and 64. 430 This controls the frequency of the on-chip PLL. This can be between 1 and 64.
364 PLL Frequency = (Crystal Frequency) * (this setting) 431 PLL Frequency = (Crystal Frequency) * (this setting)
@@ -407,19 +474,70 @@ config MEM_MT46V32M16_5B
407 bool "MT46V32M16_5B" 474 bool "MT46V32M16_5B"
408endchoice 475endchoice
409 476
410config MAX_MEM_SIZE 477choice
411 int "Max SDRAM Memory Size in MBytes" 478 prompt "DDR/SDRAM Timing"
412 depends on !MPU 479 depends on BFIN_KERNEL_CLOCK
413 default 512 480 default BFIN_KERNEL_CLOCK_MEMINIT_CALC
414 help 481 help
415 This is the max memory size that the kernel will create CPLB 482 This option allows you to specify Blackfin SDRAM/DDR Timing parameters
416 tables for. Your system will not be able to handle any more. 483 The calculated SDRAM timing parameters may not be 100%
484 accurate - This option is therefore marked experimental.
485
486config BFIN_KERNEL_CLOCK_MEMINIT_CALC
487 bool "Calculate Timings (EXPERIMENTAL)"
488 depends on EXPERIMENTAL
489
490config BFIN_KERNEL_CLOCK_MEMINIT_SPEC
491 bool "Provide accurate Timings based on target SCLK"
492 help
493 Please consult the Blackfin Hardware Reference Manuals as well
494 as the memory device datasheet.
495 http://docs.blackfin.uclinux.org/doku.php?id=bfin:sdram
496endchoice
497
498menu "Memory Init Control"
499 depends on BFIN_KERNEL_CLOCK_MEMINIT_SPEC
500
501config MEM_DDRCTL0
502 depends on BF54x
503 hex "DDRCTL0"
504 default 0x0
505
506config MEM_DDRCTL1
507 depends on BF54x
508 hex "DDRCTL1"
509 default 0x0
510
511config MEM_DDRCTL2
512 depends on BF54x
513 hex "DDRCTL2"
514 default 0x0
515
516config MEM_EBIU_DDRQUE
517 depends on BF54x
518 hex "DDRQUE"
519 default 0x0
520
521config MEM_SDRRC
522 depends on !BF54x
523 hex "SDRRC"
524 default 0x0
525
526config MEM_SDGCTL
527 depends on !BF54x
528 hex "SDGCTL"
529 default 0x0
530endmenu
417 531
418# 532#
419# Max & Min Speeds for various Chips 533# Max & Min Speeds for various Chips
420# 534#
421config MAX_VCO_HZ 535config MAX_VCO_HZ
422 int 536 int
537 default 400000000 if BF512
538 default 400000000 if BF514
539 default 400000000 if BF516
540 default 400000000 if BF518
423 default 600000000 if BF522 541 default 600000000 if BF522
424 default 400000000 if BF523 542 default 400000000 if BF523
425 default 400000000 if BF524 543 default 400000000 if BF524
@@ -459,6 +577,7 @@ source kernel/Kconfig.hz
459 577
460config GENERIC_TIME 578config GENERIC_TIME
461 bool "Generic time" 579 bool "Generic time"
580 depends on !SMP
462 default y 581 default y
463 582
464config GENERIC_CLOCKEVENTS 583config GENERIC_CLOCKEVENTS
@@ -533,6 +652,7 @@ endmenu
533 652
534 653
535menu "Blackfin Kernel Optimizations" 654menu "Blackfin Kernel Optimizations"
655 depends on !SMP
536 656
537comment "Memory Optimizations" 657comment "Memory Optimizations"
538 658
@@ -655,6 +775,17 @@ config APP_STACK_L1
655 775
656 Currently only works with FLAT binaries. 776 Currently only works with FLAT binaries.
657 777
778config EXCEPTION_L1_SCRATCH
779 bool "Locate exception stack in L1 Scratch Memory"
780 default n
781 depends on !APP_STACK_L1 && !SYSCALL_TAB_L1
782 help
783 Whenever an exception occurs, use the L1 Scratch memory for
784 stack storage. You cannot place the stacks of FLAT binaries
785 in L1 when using this option.
786
787 If you don't use L1 Scratch, then you should say Y here.
788
658comment "Speed Optimizations" 789comment "Speed Optimizations"
659config BFIN_INS_LOWOVERHEAD 790config BFIN_INS_LOWOVERHEAD
660 bool "ins[bwl] low overhead, higher interrupt latency" 791 bool "ins[bwl] low overhead, higher interrupt latency"
@@ -684,7 +815,6 @@ config BFIN_INS_LOWOVERHEAD
684 815
685endmenu 816endmenu
686 817
687
688choice 818choice
689 prompt "Kernel executes from" 819 prompt "Kernel executes from"
690 help 820 help
@@ -714,17 +844,9 @@ config BFIN_GPTIMERS
714 To compile this driver as a module, choose M here: the module 844 To compile this driver as a module, choose M here: the module
715 will be called gptimers.ko. 845 will be called gptimers.ko.
716 846
717config BFIN_DMA_5XX
718 bool "Enable DMA Support"
719 depends on (BF52x || BF53x || BF561 || BF54x)
720 default y
721 help
722 DMA driver for BF5xx.
723
724choice 847choice
725 prompt "Uncached SDRAM region" 848 prompt "Uncached DMA region"
726 default DMA_UNCACHED_1M 849 default DMA_UNCACHED_1M
727 depends on BFIN_DMA_5XX
728config DMA_UNCACHED_4M 850config DMA_UNCACHED_4M
729 bool "Enable 4M DMA region" 851 bool "Enable 4M DMA region"
730config DMA_UNCACHED_2M 852config DMA_UNCACHED_2M
@@ -751,9 +873,11 @@ config BFIN_ICACHE_LOCK
751choice 873choice
752 prompt "Policy" 874 prompt "Policy"
753 depends on BFIN_DCACHE 875 depends on BFIN_DCACHE
754 default BFIN_WB 876 default BFIN_WB if !SMP
877 default BFIN_WT if SMP
755config BFIN_WB 878config BFIN_WB
756 bool "Write back" 879 bool "Write back"
880 depends on !SMP
757 help 881 help
758 Write Back Policy: 882 Write Back Policy:
759 Cached data will be written back to SDRAM only when needed. 883 Cached data will be written back to SDRAM only when needed.
@@ -790,7 +914,7 @@ endchoice
790 914
791config BFIN_L2_CACHEABLE 915config BFIN_L2_CACHEABLE
792 bool "Cache L2 SRAM" 916 bool "Cache L2 SRAM"
793 depends on (BFIN_DCACHE || BFIN_ICACHE) && (BF54x || BF561) 917 depends on (BFIN_DCACHE || BFIN_ICACHE) && (BF54x || (BF561 && !SMP))
794 default n 918 default n
795 help 919 help
796 Select to make L2 SRAM cacheable in L1 data and instruction cache. 920 Select to make L2 SRAM cacheable in L1 data and instruction cache.
@@ -980,7 +1104,7 @@ config PM_WAKEUP_GPIO_NUMBER
980 int "GPIO number" 1104 int "GPIO number"
981 range 0 47 1105 range 0 47
982 depends on PM_WAKEUP_BY_GPIO 1106 depends on PM_WAKEUP_BY_GPIO
983 default 2 if BFIN537_STAMP 1107 default 2
984 1108
985choice 1109choice
986 prompt "GPIO Polarity" 1110 prompt "GPIO Polarity"
@@ -1003,7 +1127,7 @@ comment "Possible Suspend Mem / Hibernate Wake-Up Sources"
1003 1127
1004config PM_BFIN_WAKE_PH6 1128config PM_BFIN_WAKE_PH6
1005 bool "Allow Wake-Up from on-chip PHY or PH6 GP" 1129 bool "Allow Wake-Up from on-chip PHY or PH6 GP"
1006 depends on PM && (BF52x || BF534 || BF536 || BF537) 1130 depends on PM && (BF51x || BF52x || BF534 || BF536 || BF537)
1007 default n 1131 default n
1008 help 1132 help
1009 Enable PHY and PH6 GP Wake-Up (Voltage Regulator Power-Up) 1133 Enable PHY and PH6 GP Wake-Up (Voltage Regulator Power-Up)
@@ -1020,15 +1144,21 @@ menu "CPU Frequency scaling"
1020 1144
1021source "drivers/cpufreq/Kconfig" 1145source "drivers/cpufreq/Kconfig"
1022 1146
1147config BFIN_CPU_FREQ
1148 bool
1149 depends on CPU_FREQ
1150 select CPU_FREQ_TABLE
1151 default y
1152
1023config CPU_VOLTAGE 1153config CPU_VOLTAGE
1024 bool "CPU Voltage scaling" 1154 bool "CPU Voltage scaling"
1025 depends on EXPERIMENTAL 1155 depends on EXPERIMENTAL
1026 depends on CPU_FREQ 1156 depends on CPU_FREQ
1027 default n 1157 default n
1028 help 1158 help
1029 Say Y here if you want CPU voltage scaling according to the CPU frequency. 1159 Say Y here if you want CPU voltage scaling according to the CPU frequency.
1030 This option violates the PLL BYPASS recommendation in the Blackfin Processor 1160 This option violates the PLL BYPASS recommendation in the Blackfin Processor
1031 manuals. There is a theoretical risk that during VDDINT transitions 1161 manuals. There is a theoretical risk that during VDDINT transitions
1032 the PLL may unlock. 1162 the PLL may unlock.
1033 1163
1034endmenu 1164endmenu
diff --git a/arch/blackfin/Kconfig.debug b/arch/blackfin/Kconfig.debug
index 3ad25983ec97..5f981d9ca625 100644
--- a/arch/blackfin/Kconfig.debug
+++ b/arch/blackfin/Kconfig.debug
@@ -2,8 +2,30 @@ menu "Kernel hacking"
2 2
3source "lib/Kconfig.debug" 3source "lib/Kconfig.debug"
4 4
5config DEBUG_STACKOVERFLOW
6 bool "Check for stack overflows"
7 depends on DEBUG_KERNEL
8 help
9 This option will cause messages to be printed if free stack space
10 drops below a certain limit.
11
12config DEBUG_STACK_USAGE
13 bool "Enable stack utilization instrumentation"
14 depends on DEBUG_KERNEL
15 help
16 Enables the display of the minimum amount of free stack which each
17 task has ever had available in the sysrq-T output.
18
19 This option will slow down process creation somewhat.
20
5config HAVE_ARCH_KGDB 21config HAVE_ARCH_KGDB
6 def_bool y 22 def_bool y
23
24config KGDB_TESTCASE
25 tristate "KGDB: for test case in expect"
26 default n
27 help
28 This is a kgdb test case for automated testing.
7 29
8config DEBUG_VERBOSE 30config DEBUG_VERBOSE
9 bool "Verbose fault messages" 31 bool "Verbose fault messages"
@@ -182,11 +204,11 @@ config DEBUG_BFIN_HWTRACE_EXPAND_LEN
182 4 for (2^4) 16k, or 4096 entries 204 4 for (2^4) 16k, or 4096 entries
183 205
184config DEBUG_BFIN_NO_KERN_HWTRACE 206config DEBUG_BFIN_NO_KERN_HWTRACE
185 bool "Trace user apps (turn off hwtrace in kernel)" 207 bool "Turn off hwtrace in CPLB handlers"
186 depends on DEBUG_BFIN_HWTRACE_ON 208 depends on DEBUG_BFIN_HWTRACE_ON
187 default n 209 default y
188 help 210 help
189 Some pieces of the kernel contain a lot of flow changes which can 211 The CPLB error handler contains a lot of flow changes which can
190 quickly fill up the hardware trace buffer. When debugging crashes, 212 quickly fill up the hardware trace buffer. When debugging crashes,
191 the hardware trace may indicate that the problem lies in kernel 213 the hardware trace may indicate that the problem lies in kernel
192 space when in reality an application is buggy. 214 space when in reality an application is buggy.
diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index 6bf50977850c..e550c8d46066 100644
--- a/arch/blackfin/Makefile
+++ b/arch/blackfin/Makefile
@@ -21,6 +21,10 @@ KALLSYMS += --symbol-prefix=_
21KBUILD_DEFCONFIG := BF537-STAMP_defconfig 21KBUILD_DEFCONFIG := BF537-STAMP_defconfig
22 22
23# setup the machine name and the machine dependent settings 23# setup the machine name and the machine dependent settings
24machine-$(CONFIG_BF512) := bf518
25machine-$(CONFIG_BF514) := bf518
26machine-$(CONFIG_BF516) := bf518
27machine-$(CONFIG_BF518) := bf518
24machine-$(CONFIG_BF522) := bf527 28machine-$(CONFIG_BF522) := bf527
25machine-$(CONFIG_BF523) := bf527 29machine-$(CONFIG_BF523) := bf527
26machine-$(CONFIG_BF524) := bf527 30machine-$(CONFIG_BF524) := bf527
@@ -33,6 +37,8 @@ machine-$(CONFIG_BF533) := bf533
33machine-$(CONFIG_BF534) := bf537 37machine-$(CONFIG_BF534) := bf537
34machine-$(CONFIG_BF536) := bf537 38machine-$(CONFIG_BF536) := bf537
35machine-$(CONFIG_BF537) := bf537 39machine-$(CONFIG_BF537) := bf537
40machine-$(CONFIG_BF538) := bf538
41machine-$(CONFIG_BF539) := bf538
36machine-$(CONFIG_BF542) := bf548 42machine-$(CONFIG_BF542) := bf548
37machine-$(CONFIG_BF544) := bf548 43machine-$(CONFIG_BF544) := bf548
38machine-$(CONFIG_BF547) := bf548 44machine-$(CONFIG_BF547) := bf548
@@ -42,6 +48,10 @@ machine-$(CONFIG_BF561) := bf561
42MACHINE := $(machine-y) 48MACHINE := $(machine-y)
43export MACHINE 49export MACHINE
44 50
51cpu-$(CONFIG_BF512) := bf512
52cpu-$(CONFIG_BF514) := bf514
53cpu-$(CONFIG_BF516) := bf516
54cpu-$(CONFIG_BF518) := bf518
45cpu-$(CONFIG_BF522) := bf522 55cpu-$(CONFIG_BF522) := bf522
46cpu-$(CONFIG_BF523) := bf523 56cpu-$(CONFIG_BF523) := bf523
47cpu-$(CONFIG_BF524) := bf524 57cpu-$(CONFIG_BF524) := bf524
@@ -54,6 +64,8 @@ cpu-$(CONFIG_BF533) := bf533
54cpu-$(CONFIG_BF534) := bf534 64cpu-$(CONFIG_BF534) := bf534
55cpu-$(CONFIG_BF536) := bf536 65cpu-$(CONFIG_BF536) := bf536
56cpu-$(CONFIG_BF537) := bf537 66cpu-$(CONFIG_BF537) := bf537
67cpu-$(CONFIG_BF538) := bf538
68cpu-$(CONFIG_BF539) := bf539
57cpu-$(CONFIG_BF542) := bf542 69cpu-$(CONFIG_BF542) := bf542
58cpu-$(CONFIG_BF544) := bf544 70cpu-$(CONFIG_BF544) := bf544
59cpu-$(CONFIG_BF547) := bf547 71cpu-$(CONFIG_BF547) := bf547
@@ -79,7 +91,7 @@ KBUILD_AFLAGS += -mcpu=$(cpu-y)-$(rev-y)
79CHECKFLAGS_SILICON = $(shell echo "" | $(CPP) $(KBUILD_CFLAGS) -dD - 2>/dev/null | awk '$$2 == "__SILICON_REVISION__" { print $$3 }') 91CHECKFLAGS_SILICON = $(shell echo "" | $(CPP) $(KBUILD_CFLAGS) -dD - 2>/dev/null | awk '$$2 == "__SILICON_REVISION__" { print $$3 }')
80CHECKFLAGS += -D__SILICON_REVISION__=$(CHECKFLAGS_SILICON) -Dl1_text=__used__ 92CHECKFLAGS += -D__SILICON_REVISION__=$(CHECKFLAGS_SILICON) -Dl1_text=__used__
81 93
82head-y := arch/$(ARCH)/mach-$(MACHINE)/head.o arch/$(ARCH)/kernel/init_task.o 94head-y := arch/$(ARCH)/kernel/init_task.o
83 95
84core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/$(ARCH)/mach-common/ 96core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ arch/$(ARCH)/mach-common/
85 97
@@ -95,10 +107,10 @@ else
95core-y += arch/$(ARCH)/kernel/cplb-nompu/ 107core-y += arch/$(ARCH)/kernel/cplb-nompu/
96endif 108endif
97 109
98libs-y += arch/$(ARCH)/lib/
99
100drivers-$(CONFIG_OPROFILE) += arch/$(ARCH)/oprofile/ 110drivers-$(CONFIG_OPROFILE) += arch/$(ARCH)/oprofile/
101 111
112libs-y += arch/$(ARCH)/lib/
113
102machdirs := $(patsubst %,arch/blackfin/mach-%/, $(machine-y)) 114machdirs := $(patsubst %,arch/blackfin/mach-%/, $(machine-y))
103 115
104KBUILD_CFLAGS += -Iarch/$(ARCH)/include/ 116KBUILD_CFLAGS += -Iarch/$(ARCH)/include/
diff --git a/arch/blackfin/configs/BF518F-EZBRD_defconfig b/arch/blackfin/configs/BF518F-EZBRD_defconfig
new file mode 100644
index 000000000000..e0b3f242b555
--- /dev/null
+++ b/arch/blackfin/configs/BF518F-EZBRD_defconfig
@@ -0,0 +1,1191 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2
4#
5# CONFIG_MMU is not set
6# CONFIG_FPU is not set
7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y
11CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_IRQ_PROBE=y
15CONFIG_GENERIC_GPIO=y
16CONFIG_FORCE_MAX_ZONEORDER=14
17CONFIG_GENERIC_CALIBRATE_DELAY=y
18CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
19
20#
21# General setup
22#
23CONFIG_EXPERIMENTAL=y
24CONFIG_BROKEN_ON_SMP=y
25CONFIG_INIT_ENV_ARG_LIMIT=32
26CONFIG_LOCALVERSION=""
27CONFIG_LOCALVERSION_AUTO=y
28CONFIG_SYSVIPC=y
29CONFIG_SYSVIPC_SYSCTL=y
30# CONFIG_POSIX_MQUEUE is not set
31# CONFIG_BSD_PROCESS_ACCT is not set
32# CONFIG_TASKSTATS is not set
33# CONFIG_AUDIT is not set
34CONFIG_IKCONFIG=y
35CONFIG_IKCONFIG_PROC=y
36CONFIG_LOG_BUF_SHIFT=14
37# CONFIG_CGROUPS is not set
38# CONFIG_GROUP_SCHED is not set
39# CONFIG_SYSFS_DEPRECATED_V2 is not set
40# CONFIG_RELAY is not set
41# CONFIG_NAMESPACES is not set
42CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SYSCTL=y
46CONFIG_EMBEDDED=y
47CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y
49CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set
52CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y
54CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y
58CONFIG_FUTEX=y
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y
62CONFIG_TIMERFD=y
63CONFIG_EVENTFD=y
64CONFIG_AIO=y
65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_SLAB=y
67# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set
69# CONFIG_PROFILING is not set
70# CONFIG_MARKERS is not set
71CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y
78# CONFIG_MODULE_FORCE_LOAD is not set
79CONFIG_MODULE_UNLOAD=y
80# CONFIG_MODULE_FORCE_UNLOAD is not set
81# CONFIG_MODVERSIONS is not set
82# CONFIG_MODULE_SRCVERSION_ALL is not set
83CONFIG_KMOD=y
84CONFIG_BLOCK=y
85# CONFIG_LBD is not set
86# CONFIG_BLK_DEV_IO_TRACE is not set
87# CONFIG_LSF is not set
88# CONFIG_BLK_DEV_BSG is not set
89# CONFIG_BLK_DEV_INTEGRITY is not set
90
91#
92# IO Schedulers
93#
94CONFIG_IOSCHED_NOOP=y
95# CONFIG_IOSCHED_AS is not set
96# CONFIG_IOSCHED_DEADLINE is not set
97# CONFIG_IOSCHED_CFQ is not set
98# CONFIG_DEFAULT_AS is not set
99# CONFIG_DEFAULT_DEADLINE is not set
100# CONFIG_DEFAULT_CFQ is not set
101CONFIG_DEFAULT_NOOP=y
102CONFIG_DEFAULT_IOSCHED="noop"
103CONFIG_CLASSIC_RCU=y
104# CONFIG_PREEMPT_NONE is not set
105CONFIG_PREEMPT_VOLUNTARY=y
106# CONFIG_PREEMPT is not set
107# CONFIG_FREEZER is not set
108
109#
110# Blackfin Processor Options
111#
112
113#
114# Processor and Board Settings
115#
116# CONFIG_BF512 is not set
117# CONFIG_BF514 is not set
118# CONFIG_BF516 is not set
119CONFIG_BF518=y
120# CONFIG_BF522 is not set
121# CONFIG_BF523 is not set
122# CONFIG_BF524 is not set
123# CONFIG_BF525 is not set
124# CONFIG_BF526 is not set
125# CONFIG_BF527 is not set
126# CONFIG_BF531 is not set
127# CONFIG_BF532 is not set
128# CONFIG_BF533 is not set
129# CONFIG_BF534 is not set
130# CONFIG_BF536 is not set
131# CONFIG_BF537 is not set
132# CONFIG_BF538 is not set
133# CONFIG_BF539 is not set
134# CONFIG_BF542 is not set
135# CONFIG_BF544 is not set
136# CONFIG_BF547 is not set
137# CONFIG_BF548 is not set
138# CONFIG_BF549 is not set
139# CONFIG_BF561 is not set
140CONFIG_BF_REV_MIN=0
141CONFIG_BF_REV_MAX=2
142CONFIG_BF_REV_0_0=y
143# CONFIG_BF_REV_0_1 is not set
144# CONFIG_BF_REV_0_2 is not set
145# CONFIG_BF_REV_0_3 is not set
146# CONFIG_BF_REV_0_4 is not set
147# CONFIG_BF_REV_0_5 is not set
148# CONFIG_BF_REV_0_6 is not set
149# CONFIG_BF_REV_ANY is not set
150# CONFIG_BF_REV_NONE is not set
151CONFIG_BF51x=y
152CONFIG_BFIN518F_EZBRD=y
153
154#
155# BF518 Specific Configuration
156#
157
158#
159# Alternative Multiplexing Scheme
160#
161# CONFIG_BF518_SPORT0_PORTF is not set
162CONFIG_BF518_SPORT0_PORTG=y
163CONFIG_BF518_SPORT0_TSCLK_PG10=y
164# CONFIG_BF518_SPORT0_TSCLK_PG14 is not set
165CONFIG_BF518_UART1_PORTF=y
166# CONFIG_BF518_UART1_PORTG is not set
167
168#
169# Interrupt Priority Assignment
170#
171
172#
173# Priority
174#
175CONFIG_IRQ_PLL_WAKEUP=7
176CONFIG_IRQ_DMA0_ERROR=7
177CONFIG_IRQ_DMAR0_BLK=7
178CONFIG_IRQ_DMAR1_BLK=7
179CONFIG_IRQ_DMAR0_OVR=7
180CONFIG_IRQ_DMAR1_OVR=7
181CONFIG_IRQ_PPI_ERROR=7
182CONFIG_IRQ_MAC_ERROR=7
183CONFIG_IRQ_SPORT0_ERROR=7
184CONFIG_IRQ_SPORT1_ERROR=7
185CONFIG_IRQ_PTP_ERROR=7
186CONFIG_IRQ_UART0_ERROR=7
187CONFIG_IRQ_UART1_ERROR=7
188CONFIG_IRQ_RTC=8
189CONFIG_IRQ_PPI=8
190CONFIG_IRQ_SPORT0_RX=9
191CONFIG_IRQ_SPORT0_TX=9
192CONFIG_IRQ_SPORT1_RX=9
193CONFIG_IRQ_SPORT1_TX=9
194CONFIG_IRQ_TWI=10
195CONFIG_IRQ_SPI0=10
196CONFIG_IRQ_UART0_RX=10
197CONFIG_IRQ_UART0_TX=10
198CONFIG_IRQ_UART1_RX=10
199CONFIG_IRQ_UART1_TX=10
200CONFIG_IRQ_OPTSEC=11
201CONFIG_IRQ_CNT=11
202CONFIG_IRQ_MAC_RX=11
203CONFIG_IRQ_PORTH_INTA=11
204CONFIG_IRQ_MAC_TX=11
205CONFIG_IRQ_PORTH_INTB=11
206CONFIG_IRQ_TIMER0=12
207CONFIG_IRQ_TIMER1=12
208CONFIG_IRQ_TIMER2=12
209CONFIG_IRQ_TIMER3=12
210CONFIG_IRQ_TIMER4=12
211CONFIG_IRQ_TIMER5=12
212CONFIG_IRQ_TIMER6=12
213CONFIG_IRQ_TIMER7=12
214CONFIG_IRQ_PORTG_INTA=12
215CONFIG_IRQ_PORTG_INTB=12
216CONFIG_IRQ_MEM_DMA0=13
217CONFIG_IRQ_MEM_DMA1=13
218CONFIG_IRQ_WATCH=13
219CONFIG_IRQ_PORTF_INTA=13
220CONFIG_IRQ_PORTF_INTB=13
221CONFIG_IRQ_SPI0_ERROR=7
222CONFIG_IRQ_SPI1_ERROR=7
223CONFIG_IRQ_RSI_INT0=7
224CONFIG_IRQ_RSI_INT1=7
225CONFIG_IRQ_PWM_TRIP=10
226CONFIG_IRQ_PWM_SYNC=10
227CONFIG_IRQ_PTP_STAT=10
228
229#
230# Board customizations
231#
232# CONFIG_CMDLINE_BOOL is not set
233CONFIG_BOOT_LOAD=0x1000
234
235#
236# Clock/PLL Setup
237#
238CONFIG_CLKIN_HZ=25000000
239# CONFIG_BFIN_KERNEL_CLOCK is not set
240CONFIG_MAX_VCO_HZ=400000000
241CONFIG_MIN_VCO_HZ=50000000
242CONFIG_MAX_SCLK_HZ=133333333
243CONFIG_MIN_SCLK_HZ=27000000
244
245#
246# Kernel Timer/Scheduler
247#
248# CONFIG_HZ_100 is not set
249CONFIG_HZ_250=y
250# CONFIG_HZ_300 is not set
251# CONFIG_HZ_1000 is not set
252CONFIG_HZ=250
253# CONFIG_SCHED_HRTICK is not set
254CONFIG_GENERIC_TIME=y
255CONFIG_GENERIC_CLOCKEVENTS=y
256# CONFIG_CYCLES_CLOCKSOURCE is not set
257# CONFIG_NO_HZ is not set
258# CONFIG_HIGH_RES_TIMERS is not set
259CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
260
261#
262# Misc
263#
264CONFIG_BFIN_SCRATCH_REG_RETN=y
265# CONFIG_BFIN_SCRATCH_REG_RETE is not set
266# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
267
268#
269# Blackfin Kernel Optimizations
270#
271
272#
273# Memory Optimizations
274#
275CONFIG_I_ENTRY_L1=y
276CONFIG_EXCPT_IRQ_SYSC_L1=y
277CONFIG_DO_IRQ_L1=y
278CONFIG_CORE_TIMER_IRQ_L1=y
279CONFIG_IDLE_L1=y
280# CONFIG_SCHEDULE_L1 is not set
281CONFIG_ARITHMETIC_OPS_L1=y
282CONFIG_ACCESS_OK_L1=y
283# CONFIG_MEMSET_L1 is not set
284# CONFIG_MEMCPY_L1 is not set
285# CONFIG_SYS_BFIN_SPINLOCK_L1 is not set
286# CONFIG_IP_CHECKSUM_L1 is not set
287CONFIG_CACHELINE_ALIGNED_L1=y
288# CONFIG_SYSCALL_TAB_L1 is not set
289# CONFIG_CPLB_SWITCH_TAB_L1 is not set
290CONFIG_APP_STACK_L1=y
291
292#
293# Speed Optimizations
294#
295CONFIG_BFIN_INS_LOWOVERHEAD=y
296CONFIG_RAMKERNEL=y
297# CONFIG_ROMKERNEL is not set
298CONFIG_SELECT_MEMORY_MODEL=y
299CONFIG_FLATMEM_MANUAL=y
300# CONFIG_DISCONTIGMEM_MANUAL is not set
301# CONFIG_SPARSEMEM_MANUAL is not set
302CONFIG_FLATMEM=y
303CONFIG_FLAT_NODE_MEM_MAP=y
304CONFIG_PAGEFLAGS_EXTENDED=y
305CONFIG_SPLIT_PTLOCK_CPUS=4
306# CONFIG_RESOURCES_64BIT is not set
307# CONFIG_PHYS_ADDR_T_64BIT is not set
308CONFIG_ZONE_DMA_FLAG=1
309CONFIG_VIRT_TO_BUS=y
310CONFIG_BFIN_GPTIMERS=y
311# CONFIG_DMA_UNCACHED_4M is not set
312# CONFIG_DMA_UNCACHED_2M is not set
313CONFIG_DMA_UNCACHED_1M=y
314# CONFIG_DMA_UNCACHED_NONE is not set
315
316#
317# Cache Support
318#
319CONFIG_BFIN_ICACHE=y
320CONFIG_BFIN_DCACHE=y
321# CONFIG_BFIN_DCACHE_BANKA is not set
322# CONFIG_BFIN_ICACHE_LOCK is not set
323CONFIG_BFIN_WB=y
324# CONFIG_BFIN_WT is not set
325# CONFIG_MPU is not set
326
327#
328# Asynchonous Memory Configuration
329#
330
331#
332# EBIU_AMGCTL Global Control
333#
334CONFIG_C_AMCKEN=y
335CONFIG_C_CDPRIO=y
336# CONFIG_C_AMBEN is not set
337# CONFIG_C_AMBEN_B0 is not set
338# CONFIG_C_AMBEN_B0_B1 is not set
339# CONFIG_C_AMBEN_B0_B1_B2 is not set
340CONFIG_C_AMBEN_ALL=y
341
342#
343# EBIU_AMBCTL Control
344#
345CONFIG_BANK_0=0x7BB0
346CONFIG_BANK_1=0x5554
347CONFIG_BANK_2=0x7BB0
348CONFIG_BANK_3=0xFFC0
349
350#
351# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
352#
353# CONFIG_ARCH_SUPPORTS_MSI is not set
354# CONFIG_PCCARD is not set
355
356#
357# Executable file formats
358#
359CONFIG_BINFMT_ELF_FDPIC=y
360CONFIG_BINFMT_FLAT=y
361CONFIG_BINFMT_ZFLAT=y
362# CONFIG_BINFMT_SHARED_FLAT is not set
363# CONFIG_HAVE_AOUT is not set
364# CONFIG_BINFMT_MISC is not set
365
366#
367# Power management options
368#
369# CONFIG_PM is not set
370CONFIG_ARCH_SUSPEND_POSSIBLE=y
371# CONFIG_PM_WAKEUP_BY_GPIO is not set
372
373#
374# CPU Frequency scaling
375#
376# CONFIG_CPU_FREQ is not set
377CONFIG_NET=y
378
379#
380# Networking options
381#
382CONFIG_PACKET=y
383# CONFIG_PACKET_MMAP is not set
384CONFIG_UNIX=y
385CONFIG_XFRM=y
386# CONFIG_XFRM_USER is not set
387# CONFIG_XFRM_SUB_POLICY is not set
388# CONFIG_XFRM_MIGRATE is not set
389# CONFIG_XFRM_STATISTICS is not set
390# CONFIG_NET_KEY is not set
391CONFIG_INET=y
392# CONFIG_IP_MULTICAST is not set
393# CONFIG_IP_ADVANCED_ROUTER is not set
394CONFIG_IP_FIB_HASH=y
395CONFIG_IP_PNP=y
396# CONFIG_IP_PNP_DHCP is not set
397# CONFIG_IP_PNP_BOOTP is not set
398# CONFIG_IP_PNP_RARP is not set
399# CONFIG_NET_IPIP is not set
400# CONFIG_NET_IPGRE is not set
401# CONFIG_ARPD is not set
402CONFIG_SYN_COOKIES=y
403# CONFIG_INET_AH is not set
404# CONFIG_INET_ESP is not set
405# CONFIG_INET_IPCOMP is not set
406# CONFIG_INET_XFRM_TUNNEL is not set
407# CONFIG_INET_TUNNEL is not set
408CONFIG_INET_XFRM_MODE_TRANSPORT=y
409CONFIG_INET_XFRM_MODE_TUNNEL=y
410CONFIG_INET_XFRM_MODE_BEET=y
411# CONFIG_INET_LRO is not set
412CONFIG_INET_DIAG=y
413CONFIG_INET_TCP_DIAG=y
414# CONFIG_TCP_CONG_ADVANCED is not set
415CONFIG_TCP_CONG_CUBIC=y
416CONFIG_DEFAULT_TCP_CONG="cubic"
417# CONFIG_TCP_MD5SIG is not set
418# CONFIG_IPV6 is not set
419# CONFIG_NETLABEL is not set
420# CONFIG_NETWORK_SECMARK is not set
421# CONFIG_NETFILTER is not set
422# CONFIG_IP_DCCP is not set
423# CONFIG_IP_SCTP is not set
424# CONFIG_TIPC is not set
425# CONFIG_ATM is not set
426# CONFIG_BRIDGE is not set
427# CONFIG_NET_DSA is not set
428# CONFIG_VLAN_8021Q is not set
429# CONFIG_DECNET is not set
430# CONFIG_LLC2 is not set
431# CONFIG_IPX is not set
432# CONFIG_ATALK is not set
433# CONFIG_X25 is not set
434# CONFIG_LAPB is not set
435# CONFIG_ECONET is not set
436# CONFIG_WAN_ROUTER is not set
437# CONFIG_NET_SCHED is not set
438
439#
440# Network testing
441#
442# CONFIG_NET_PKTGEN is not set
443# CONFIG_HAMRADIO is not set
444# CONFIG_CAN is not set
445# CONFIG_IRDA is not set
446# CONFIG_BT is not set
447# CONFIG_AF_RXRPC is not set
448# CONFIG_PHONET is not set
449CONFIG_WIRELESS=y
450# CONFIG_CFG80211 is not set
451CONFIG_WIRELESS_OLD_REGULATORY=y
452# CONFIG_WIRELESS_EXT is not set
453# CONFIG_MAC80211 is not set
454# CONFIG_IEEE80211 is not set
455# CONFIG_RFKILL is not set
456# CONFIG_NET_9P is not set
457
458#
459# Device Drivers
460#
461
462#
463# Generic Driver Options
464#
465CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
466CONFIG_STANDALONE=y
467CONFIG_PREVENT_FIRMWARE_BUILD=y
468# CONFIG_FW_LOADER is not set
469# CONFIG_DEBUG_DRIVER is not set
470# CONFIG_DEBUG_DEVRES is not set
471# CONFIG_SYS_HYPERVISOR is not set
472# CONFIG_CONNECTOR is not set
473CONFIG_MTD=y
474# CONFIG_MTD_DEBUG is not set
475# CONFIG_MTD_CONCAT is not set
476CONFIG_MTD_PARTITIONS=y
477# CONFIG_MTD_REDBOOT_PARTS is not set
478# CONFIG_MTD_CMDLINE_PARTS is not set
479# CONFIG_MTD_AR7_PARTS is not set
480
481#
482# User Modules And Translation Layers
483#
484CONFIG_MTD_CHAR=y
485CONFIG_MTD_BLKDEVS=y
486CONFIG_MTD_BLOCK=y
487# CONFIG_FTL is not set
488# CONFIG_NFTL is not set
489# CONFIG_INFTL is not set
490# CONFIG_RFD_FTL is not set
491# CONFIG_SSFDC is not set
492# CONFIG_MTD_OOPS is not set
493
494#
495# RAM/ROM/Flash chip drivers
496#
497# CONFIG_MTD_CFI is not set
498CONFIG_MTD_JEDECPROBE=m
499CONFIG_MTD_GEN_PROBE=m
500# CONFIG_MTD_CFI_ADV_OPTIONS is not set
501CONFIG_MTD_MAP_BANK_WIDTH_1=y
502CONFIG_MTD_MAP_BANK_WIDTH_2=y
503CONFIG_MTD_MAP_BANK_WIDTH_4=y
504# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
505# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
506# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
507CONFIG_MTD_CFI_I1=y
508CONFIG_MTD_CFI_I2=y
509# CONFIG_MTD_CFI_I4 is not set
510# CONFIG_MTD_CFI_I8 is not set
511# CONFIG_MTD_CFI_INTELEXT is not set
512# CONFIG_MTD_CFI_AMDSTD is not set
513# CONFIG_MTD_CFI_STAA is not set
514CONFIG_MTD_RAM=y
515CONFIG_MTD_ROM=m
516# CONFIG_MTD_ABSENT is not set
517
518#
519# Mapping drivers for chip access
520#
521CONFIG_MTD_COMPLEX_MAPPINGS=y
522# CONFIG_MTD_PHYSMAP is not set
523# CONFIG_MTD_GPIO_ADDR is not set
524# CONFIG_MTD_UCLINUX is not set
525# CONFIG_MTD_PLATRAM is not set
526
527#
528# Self-contained MTD device drivers
529#
530# CONFIG_MTD_SLRAM is not set
531# CONFIG_MTD_PHRAM is not set
532# CONFIG_MTD_MTDRAM is not set
533# CONFIG_MTD_BLOCK2MTD is not set
534
535#
536# Disk-On-Chip Device Drivers
537#
538# CONFIG_MTD_DOC2000 is not set
539# CONFIG_MTD_DOC2001 is not set
540# CONFIG_MTD_DOC2001PLUS is not set
541# CONFIG_MTD_NAND is not set
542# CONFIG_MTD_ONENAND is not set
543
544#
545# UBI - Unsorted block images
546#
547# CONFIG_MTD_UBI is not set
548# CONFIG_PARPORT is not set
549CONFIG_BLK_DEV=y
550# CONFIG_BLK_DEV_COW_COMMON is not set
551# CONFIG_BLK_DEV_LOOP is not set
552# CONFIG_BLK_DEV_NBD is not set
553CONFIG_BLK_DEV_RAM=y
554CONFIG_BLK_DEV_RAM_COUNT=16
555CONFIG_BLK_DEV_RAM_SIZE=4096
556# CONFIG_BLK_DEV_XIP is not set
557# CONFIG_CDROM_PKTCDVD is not set
558# CONFIG_ATA_OVER_ETH is not set
559# CONFIG_BLK_DEV_HD is not set
560CONFIG_MISC_DEVICES=y
561# CONFIG_EEPROM_93CX6 is not set
562# CONFIG_ENCLOSURE_SERVICES is not set
563CONFIG_HAVE_IDE=y
564# CONFIG_IDE is not set
565
566#
567# SCSI device support
568#
569# CONFIG_RAID_ATTRS is not set
570# CONFIG_SCSI is not set
571# CONFIG_SCSI_DMA is not set
572# CONFIG_SCSI_NETLINK is not set
573# CONFIG_ATA is not set
574# CONFIG_MD is not set
575CONFIG_NETDEVICES=y
576# CONFIG_DUMMY is not set
577# CONFIG_BONDING is not set
578# CONFIG_MACVLAN is not set
579# CONFIG_EQUALIZER is not set
580# CONFIG_TUN is not set
581# CONFIG_VETH is not set
582CONFIG_PHYLIB=y
583
584#
585# MII PHY device drivers
586#
587# CONFIG_MARVELL_PHY is not set
588# CONFIG_DAVICOM_PHY is not set
589# CONFIG_QSEMI_PHY is not set
590# CONFIG_LXT_PHY is not set
591# CONFIG_CICADA_PHY is not set
592# CONFIG_VITESSE_PHY is not set
593# CONFIG_SMSC_PHY is not set
594# CONFIG_BROADCOM_PHY is not set
595# CONFIG_ICPLUS_PHY is not set
596# CONFIG_REALTEK_PHY is not set
597# CONFIG_FIXED_PHY is not set
598# CONFIG_MDIO_BITBANG is not set
599CONFIG_NET_ETHERNET=y
600CONFIG_MII=y
601# CONFIG_BFIN_MAC is not set
602# CONFIG_SMC91X is not set
603# CONFIG_SMSC911X is not set
604# CONFIG_DM9000 is not set
605# CONFIG_IBM_NEW_EMAC_ZMII is not set
606# CONFIG_IBM_NEW_EMAC_RGMII is not set
607# CONFIG_IBM_NEW_EMAC_TAH is not set
608# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
609# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
610# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
611# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
612# CONFIG_NETDEV_1000 is not set
613# CONFIG_NETDEV_10000 is not set
614
615#
616# Wireless LAN
617#
618# CONFIG_WLAN_PRE80211 is not set
619# CONFIG_WLAN_80211 is not set
620# CONFIG_IWLWIFI_LEDS is not set
621# CONFIG_WAN is not set
622# CONFIG_PPP is not set
623# CONFIG_SLIP is not set
624# CONFIG_NETCONSOLE is not set
625# CONFIG_NETPOLL is not set
626# CONFIG_NET_POLL_CONTROLLER is not set
627# CONFIG_ISDN is not set
628# CONFIG_PHONE is not set
629
630#
631# Input device support
632#
633CONFIG_INPUT=y
634# CONFIG_INPUT_FF_MEMLESS is not set
635# CONFIG_INPUT_POLLDEV is not set
636
637#
638# Userland interfaces
639#
640# CONFIG_INPUT_MOUSEDEV is not set
641# CONFIG_INPUT_JOYDEV is not set
642# CONFIG_INPUT_EVDEV is not set
643# CONFIG_INPUT_EVBUG is not set
644
645#
646# Input Device Drivers
647#
648# CONFIG_INPUT_KEYBOARD is not set
649# CONFIG_INPUT_MOUSE is not set
650# CONFIG_INPUT_JOYSTICK is not set
651# CONFIG_INPUT_TABLET is not set
652# CONFIG_INPUT_TOUCHSCREEN is not set
653CONFIG_INPUT_MISC=y
654# CONFIG_INPUT_UINPUT is not set
655# CONFIG_CONFIG_INPUT_PCF8574 is not set
656
657#
658# Hardware I/O ports
659#
660# CONFIG_SERIO is not set
661# CONFIG_GAMEPORT is not set
662
663#
664# Character devices
665#
666# CONFIG_AD9960 is not set
667# CONFIG_SPI_ADC_BF533 is not set
668# CONFIG_BF5xx_PPIFCD is not set
669# CONFIG_BFIN_SIMPLE_TIMER is not set
670# CONFIG_BF5xx_PPI is not set
671# CONFIG_BFIN_SPORT is not set
672# CONFIG_BFIN_TIMER_LATENCY is not set
673# CONFIG_TWI_LCD is not set
674CONFIG_BFIN_DMA_INTERFACE=m
675CONFIG_SIMPLE_GPIO=m
676CONFIG_VT=y
677CONFIG_CONSOLE_TRANSLATIONS=y
678CONFIG_VT_CONSOLE=y
679CONFIG_HW_CONSOLE=y
680# CONFIG_VT_HW_CONSOLE_BINDING is not set
681# CONFIG_DEVKMEM is not set
682# CONFIG_BFIN_JTAG_COMM is not set
683# CONFIG_SERIAL_NONSTANDARD is not set
684
685#
686# Serial drivers
687#
688# CONFIG_SERIAL_8250 is not set
689
690#
691# Non-8250 serial port support
692#
693CONFIG_SERIAL_BFIN=y
694CONFIG_SERIAL_BFIN_CONSOLE=y
695CONFIG_SERIAL_BFIN_DMA=y
696# CONFIG_SERIAL_BFIN_PIO is not set
697CONFIG_SERIAL_BFIN_UART0=y
698# CONFIG_BFIN_UART0_CTSRTS is not set
699# CONFIG_SERIAL_BFIN_UART1 is not set
700CONFIG_SERIAL_CORE=y
701CONFIG_SERIAL_CORE_CONSOLE=y
702# CONFIG_SERIAL_BFIN_SPORT is not set
703CONFIG_UNIX98_PTYS=y
704# CONFIG_LEGACY_PTYS is not set
705
706#
707# CAN, the car bus and industrial fieldbus
708#
709# CONFIG_CAN4LINUX is not set
710# CONFIG_IPMI_HANDLER is not set
711# CONFIG_HW_RANDOM is not set
712# CONFIG_R3964 is not set
713# CONFIG_RAW_DRIVER is not set
714# CONFIG_TCG_TPM is not set
715CONFIG_I2C=y
716CONFIG_I2C_BOARDINFO=y
717CONFIG_I2C_CHARDEV=y
718CONFIG_I2C_HELPER_AUTO=y
719
720#
721# I2C Hardware Bus support
722#
723
724#
725# I2C system bus drivers (mostly embedded / system-on-chip)
726#
727CONFIG_I2C_BLACKFIN_TWI=y
728CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
729# CONFIG_I2C_GPIO is not set
730# CONFIG_I2C_OCORES is not set
731# CONFIG_I2C_SIMTEC is not set
732
733#
734# External I2C/SMBus adapter drivers
735#
736# CONFIG_I2C_PARPORT_LIGHT is not set
737# CONFIG_I2C_TAOS_EVM is not set
738
739#
740# Other I2C/SMBus bus drivers
741#
742# CONFIG_I2C_PCA_PLATFORM is not set
743# CONFIG_I2C_STUB is not set
744
745#
746# Miscellaneous I2C Chip support
747#
748# CONFIG_DS1682 is not set
749# CONFIG_AT24 is not set
750# CONFIG_SENSORS_AD5252 is not set
751# CONFIG_SENSORS_EEPROM is not set
752# CONFIG_SENSORS_PCF8574 is not set
753# CONFIG_PCF8575 is not set
754# CONFIG_SENSORS_PCA9539 is not set
755# CONFIG_SENSORS_PCF8591 is not set
756# CONFIG_SENSORS_MAX6875 is not set
757# CONFIG_SENSORS_TSL2550 is not set
758# CONFIG_I2C_DEBUG_CORE is not set
759# CONFIG_I2C_DEBUG_ALGO is not set
760# CONFIG_I2C_DEBUG_BUS is not set
761# CONFIG_I2C_DEBUG_CHIP is not set
762# CONFIG_SPI is not set
763CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
764# CONFIG_GPIOLIB is not set
765# CONFIG_W1 is not set
766# CONFIG_POWER_SUPPLY is not set
767# CONFIG_HWMON is not set
768# CONFIG_THERMAL is not set
769# CONFIG_THERMAL_HWMON is not set
770CONFIG_WATCHDOG=y
771# CONFIG_WATCHDOG_NOWAYOUT is not set
772
773#
774# Watchdog Device Drivers
775#
776# CONFIG_SOFT_WATCHDOG is not set
777CONFIG_BFIN_WDT=y
778
779#
780# Multifunction device drivers
781#
782# CONFIG_MFD_CORE is not set
783# CONFIG_MFD_SM501 is not set
784# CONFIG_HTC_PASIC3 is not set
785# CONFIG_MFD_TMIO is not set
786# CONFIG_MFD_WM8400 is not set
787# CONFIG_MFD_WM8350_I2C is not set
788
789#
790# Multimedia devices
791#
792
793#
794# Multimedia core support
795#
796# CONFIG_VIDEO_DEV is not set
797# CONFIG_DVB_CORE is not set
798# CONFIG_VIDEO_MEDIA is not set
799
800#
801# Multimedia drivers
802#
803# CONFIG_DAB is not set
804
805#
806# Graphics support
807#
808# CONFIG_VGASTATE is not set
809# CONFIG_VIDEO_OUTPUT_CONTROL is not set
810# CONFIG_FB is not set
811# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
812
813#
814# Display device support
815#
816# CONFIG_DISPLAY_SUPPORT is not set
817
818#
819# Console display driver support
820#
821CONFIG_DUMMY_CONSOLE=y
822# CONFIG_SOUND is not set
823# CONFIG_HID_SUPPORT is not set
824# CONFIG_USB_SUPPORT is not set
825# CONFIG_MMC is not set
826# CONFIG_MEMSTICK is not set
827# CONFIG_NEW_LEDS is not set
828# CONFIG_ACCESSIBILITY is not set
829CONFIG_RTC_LIB=y
830CONFIG_RTC_CLASS=y
831CONFIG_RTC_HCTOSYS=y
832CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
833# CONFIG_RTC_DEBUG is not set
834
835#
836# RTC interfaces
837#
838CONFIG_RTC_INTF_SYSFS=y
839CONFIG_RTC_INTF_PROC=y
840CONFIG_RTC_INTF_DEV=y
841# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
842# CONFIG_RTC_DRV_TEST is not set
843
844#
845# I2C RTC drivers
846#
847# CONFIG_RTC_DRV_DS1307 is not set
848# CONFIG_RTC_DRV_DS1374 is not set
849# CONFIG_RTC_DRV_DS1672 is not set
850# CONFIG_RTC_DRV_MAX6900 is not set
851# CONFIG_RTC_DRV_RS5C372 is not set
852# CONFIG_RTC_DRV_ISL1208 is not set
853# CONFIG_RTC_DRV_X1205 is not set
854# CONFIG_RTC_DRV_PCF8563 is not set
855# CONFIG_RTC_DRV_PCF8583 is not set
856# CONFIG_RTC_DRV_M41T80 is not set
857# CONFIG_RTC_DRV_S35390A is not set
858# CONFIG_RTC_DRV_FM3130 is not set
859
860#
861# SPI RTC drivers
862#
863
864#
865# Platform RTC drivers
866#
867# CONFIG_RTC_DRV_DS1286 is not set
868# CONFIG_RTC_DRV_DS1511 is not set
869# CONFIG_RTC_DRV_DS1553 is not set
870# CONFIG_RTC_DRV_DS1742 is not set
871# CONFIG_RTC_DRV_STK17TA8 is not set
872# CONFIG_RTC_DRV_M48T86 is not set
873# CONFIG_RTC_DRV_M48T35 is not set
874# CONFIG_RTC_DRV_M48T59 is not set
875# CONFIG_RTC_DRV_BQ4802 is not set
876# CONFIG_RTC_DRV_V3020 is not set
877
878#
879# on-CPU RTC drivers
880#
881CONFIG_RTC_DRV_BFIN=y
882# CONFIG_DMADEVICES is not set
883# CONFIG_UIO is not set
884# CONFIG_STAGING is not set
885
886#
887# File systems
888#
889# CONFIG_EXT2_FS is not set
890# CONFIG_EXT3_FS is not set
891# CONFIG_EXT4_FS is not set
892# CONFIG_REISERFS_FS is not set
893# CONFIG_JFS_FS is not set
894# CONFIG_FS_POSIX_ACL is not set
895CONFIG_FILE_LOCKING=y
896# CONFIG_XFS_FS is not set
897# CONFIG_OCFS2_FS is not set
898# CONFIG_DNOTIFY is not set
899CONFIG_INOTIFY=y
900CONFIG_INOTIFY_USER=y
901# CONFIG_QUOTA is not set
902# CONFIG_AUTOFS_FS is not set
903# CONFIG_AUTOFS4_FS is not set
904# CONFIG_FUSE_FS is not set
905
906#
907# CD-ROM/DVD Filesystems
908#
909# CONFIG_ISO9660_FS is not set
910# CONFIG_UDF_FS is not set
911
912#
913# DOS/FAT/NT Filesystems
914#
915# CONFIG_MSDOS_FS is not set
916# CONFIG_VFAT_FS is not set
917# CONFIG_NTFS_FS is not set
918
919#
920# Pseudo filesystems
921#
922CONFIG_PROC_FS=y
923CONFIG_PROC_SYSCTL=y
924CONFIG_SYSFS=y
925# CONFIG_TMPFS is not set
926# CONFIG_HUGETLB_PAGE is not set
927# CONFIG_CONFIGFS_FS is not set
928
929#
930# Miscellaneous filesystems
931#
932# CONFIG_ADFS_FS is not set
933# CONFIG_AFFS_FS is not set
934# CONFIG_HFS_FS is not set
935# CONFIG_HFSPLUS_FS is not set
936# CONFIG_BEFS_FS is not set
937# CONFIG_BFS_FS is not set
938# CONFIG_EFS_FS is not set
939# CONFIG_YAFFS_FS is not set
940# CONFIG_JFFS2_FS is not set
941# CONFIG_CRAMFS is not set
942# CONFIG_VXFS_FS is not set
943# CONFIG_MINIX_FS is not set
944# CONFIG_OMFS_FS is not set
945# CONFIG_HPFS_FS is not set
946# CONFIG_QNX4FS_FS is not set
947# CONFIG_ROMFS_FS is not set
948# CONFIG_SYSV_FS is not set
949# CONFIG_UFS_FS is not set
950CONFIG_NETWORK_FILESYSTEMS=y
951CONFIG_NFS_FS=m
952CONFIG_NFS_V3=y
953# CONFIG_NFS_V3_ACL is not set
954# CONFIG_NFS_V4 is not set
955# CONFIG_NFSD is not set
956CONFIG_LOCKD=m
957CONFIG_LOCKD_V4=y
958CONFIG_NFS_COMMON=y
959CONFIG_SUNRPC=m
960# CONFIG_SUNRPC_REGISTER_V4 is not set
961# CONFIG_RPCSEC_GSS_KRB5 is not set
962# CONFIG_RPCSEC_GSS_SPKM3 is not set
963CONFIG_SMB_FS=m
964# CONFIG_SMB_NLS_DEFAULT is not set
965# CONFIG_CIFS is not set
966# CONFIG_NCP_FS is not set
967# CONFIG_CODA_FS is not set
968# CONFIG_AFS_FS is not set
969
970#
971# Partition Types
972#
973# CONFIG_PARTITION_ADVANCED is not set
974CONFIG_MSDOS_PARTITION=y
975CONFIG_NLS=y
976CONFIG_NLS_DEFAULT="iso8859-1"
977CONFIG_NLS_CODEPAGE_437=y
978# CONFIG_NLS_CODEPAGE_737 is not set
979# CONFIG_NLS_CODEPAGE_775 is not set
980# CONFIG_NLS_CODEPAGE_850 is not set
981# CONFIG_NLS_CODEPAGE_852 is not set
982# CONFIG_NLS_CODEPAGE_855 is not set
983# CONFIG_NLS_CODEPAGE_857 is not set
984# CONFIG_NLS_CODEPAGE_860 is not set
985# CONFIG_NLS_CODEPAGE_861 is not set
986# CONFIG_NLS_CODEPAGE_862 is not set
987# CONFIG_NLS_CODEPAGE_863 is not set
988# CONFIG_NLS_CODEPAGE_864 is not set
989# CONFIG_NLS_CODEPAGE_865 is not set
990# CONFIG_NLS_CODEPAGE_866 is not set
991# CONFIG_NLS_CODEPAGE_869 is not set
992# CONFIG_NLS_CODEPAGE_936 is not set
993# CONFIG_NLS_CODEPAGE_950 is not set
994# CONFIG_NLS_CODEPAGE_932 is not set
995# CONFIG_NLS_CODEPAGE_949 is not set
996# CONFIG_NLS_CODEPAGE_874 is not set
997# CONFIG_NLS_ISO8859_8 is not set
998# CONFIG_NLS_CODEPAGE_1250 is not set
999# CONFIG_NLS_CODEPAGE_1251 is not set
1000# CONFIG_NLS_ASCII is not set
1001CONFIG_NLS_ISO8859_1=y
1002# CONFIG_NLS_ISO8859_2 is not set
1003# CONFIG_NLS_ISO8859_3 is not set
1004# CONFIG_NLS_ISO8859_4 is not set
1005# CONFIG_NLS_ISO8859_5 is not set
1006# CONFIG_NLS_ISO8859_6 is not set
1007# CONFIG_NLS_ISO8859_7 is not set
1008# CONFIG_NLS_ISO8859_9 is not set
1009# CONFIG_NLS_ISO8859_13 is not set
1010# CONFIG_NLS_ISO8859_14 is not set
1011# CONFIG_NLS_ISO8859_15 is not set
1012# CONFIG_NLS_KOI8_R is not set
1013# CONFIG_NLS_KOI8_U is not set
1014# CONFIG_NLS_UTF8 is not set
1015# CONFIG_DLM is not set
1016
1017#
1018# Kernel hacking
1019#
1020# CONFIG_PRINTK_TIME is not set
1021CONFIG_ENABLE_WARN_DEPRECATED=y
1022CONFIG_ENABLE_MUST_CHECK=y
1023CONFIG_FRAME_WARN=1024
1024# CONFIG_MAGIC_SYSRQ is not set
1025# CONFIG_UNUSED_SYMBOLS is not set
1026CONFIG_DEBUG_FS=y
1027# CONFIG_HEADERS_CHECK is not set
1028CONFIG_DEBUG_KERNEL=y
1029# CONFIG_DEBUG_SHIRQ is not set
1030CONFIG_DETECT_SOFTLOCKUP=y
1031# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1032CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1033CONFIG_SCHED_DEBUG=y
1034# CONFIG_SCHEDSTATS is not set
1035# CONFIG_TIMER_STATS is not set
1036# CONFIG_DEBUG_OBJECTS is not set
1037# CONFIG_DEBUG_SLAB is not set
1038# CONFIG_DEBUG_RT_MUTEXES is not set
1039# CONFIG_RT_MUTEX_TESTER is not set
1040# CONFIG_DEBUG_SPINLOCK is not set
1041# CONFIG_DEBUG_MUTEXES is not set
1042# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1043# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1044# CONFIG_DEBUG_KOBJECT is not set
1045# CONFIG_DEBUG_BUGVERBOSE is not set
1046CONFIG_DEBUG_INFO=y
1047# CONFIG_DEBUG_VM is not set
1048# CONFIG_DEBUG_WRITECOUNT is not set
1049# CONFIG_DEBUG_MEMORY_INIT is not set
1050# CONFIG_DEBUG_LIST is not set
1051# CONFIG_DEBUG_SG is not set
1052# CONFIG_FRAME_POINTER is not set
1053# CONFIG_BOOT_PRINTK_DELAY is not set
1054# CONFIG_RCU_TORTURE_TEST is not set
1055# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1056# CONFIG_BACKTRACE_SELF_TEST is not set
1057# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1058# CONFIG_FAULT_INJECTION is not set
1059CONFIG_SYSCTL_SYSCALL_CHECK=y
1060# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1061# CONFIG_SAMPLES is not set
1062CONFIG_HAVE_ARCH_KGDB=y
1063# CONFIG_KGDB is not set
1064# CONFIG_DEBUG_STACKOVERFLOW is not set
1065# CONFIG_DEBUG_STACK_USAGE is not set
1066CONFIG_DEBUG_VERBOSE=y
1067CONFIG_DEBUG_MMRS=y
1068# CONFIG_DEBUG_HWERR is not set
1069# CONFIG_DEBUG_DOUBLEFAULT is not set
1070CONFIG_DEBUG_HUNT_FOR_ZERO=y
1071CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1072CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
1073# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
1074# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1075CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
1076# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1077# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1078CONFIG_EARLY_PRINTK=y
1079CONFIG_CPLB_INFO=y
1080CONFIG_ACCESS_CHECK=y
1081
1082#
1083# Security options
1084#
1085# CONFIG_KEYS is not set
1086CONFIG_SECURITY=y
1087# CONFIG_SECURITYFS is not set
1088# CONFIG_SECURITY_NETWORK is not set
1089# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1090CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1091CONFIG_CRYPTO=y
1092
1093#
1094# Crypto core or helper
1095#
1096# CONFIG_CRYPTO_FIPS is not set
1097# CONFIG_CRYPTO_MANAGER is not set
1098# CONFIG_CRYPTO_GF128MUL is not set
1099# CONFIG_CRYPTO_NULL is not set
1100# CONFIG_CRYPTO_CRYPTD is not set
1101# CONFIG_CRYPTO_AUTHENC is not set
1102# CONFIG_CRYPTO_TEST is not set
1103
1104#
1105# Authenticated Encryption with Associated Data
1106#
1107# CONFIG_CRYPTO_CCM is not set
1108# CONFIG_CRYPTO_GCM is not set
1109# CONFIG_CRYPTO_SEQIV is not set
1110
1111#
1112# Block modes
1113#
1114# CONFIG_CRYPTO_CBC is not set
1115# CONFIG_CRYPTO_CTR is not set
1116# CONFIG_CRYPTO_CTS is not set
1117# CONFIG_CRYPTO_ECB is not set
1118# CONFIG_CRYPTO_LRW is not set
1119# CONFIG_CRYPTO_PCBC is not set
1120# CONFIG_CRYPTO_XTS is not set
1121
1122#
1123# Hash modes
1124#
1125# CONFIG_CRYPTO_HMAC is not set
1126# CONFIG_CRYPTO_XCBC is not set
1127
1128#
1129# Digest
1130#
1131# CONFIG_CRYPTO_CRC32C is not set
1132# CONFIG_CRYPTO_MD4 is not set
1133# CONFIG_CRYPTO_MD5 is not set
1134# CONFIG_CRYPTO_MICHAEL_MIC is not set
1135# CONFIG_CRYPTO_RMD128 is not set
1136# CONFIG_CRYPTO_RMD160 is not set
1137# CONFIG_CRYPTO_RMD256 is not set
1138# CONFIG_CRYPTO_RMD320 is not set
1139# CONFIG_CRYPTO_SHA1 is not set
1140# CONFIG_CRYPTO_SHA256 is not set
1141# CONFIG_CRYPTO_SHA512 is not set
1142# CONFIG_CRYPTO_TGR192 is not set
1143# CONFIG_CRYPTO_WP512 is not set
1144
1145#
1146# Ciphers
1147#
1148# CONFIG_CRYPTO_AES is not set
1149# CONFIG_CRYPTO_ANUBIS is not set
1150# CONFIG_CRYPTO_ARC4 is not set
1151# CONFIG_CRYPTO_BLOWFISH is not set
1152# CONFIG_CRYPTO_CAMELLIA is not set
1153# CONFIG_CRYPTO_CAST5 is not set
1154# CONFIG_CRYPTO_CAST6 is not set
1155# CONFIG_CRYPTO_DES is not set
1156# CONFIG_CRYPTO_FCRYPT is not set
1157# CONFIG_CRYPTO_KHAZAD is not set
1158# CONFIG_CRYPTO_SALSA20 is not set
1159# CONFIG_CRYPTO_SEED is not set
1160# CONFIG_CRYPTO_SERPENT is not set
1161# CONFIG_CRYPTO_TEA is not set
1162# CONFIG_CRYPTO_TWOFISH is not set
1163
1164#
1165# Compression
1166#
1167# CONFIG_CRYPTO_DEFLATE is not set
1168# CONFIG_CRYPTO_LZO is not set
1169
1170#
1171# Random Number Generation
1172#
1173# CONFIG_CRYPTO_ANSI_CPRNG is not set
1174CONFIG_CRYPTO_HW=y
1175
1176#
1177# Library routines
1178#
1179CONFIG_BITREVERSE=y
1180CONFIG_CRC_CCITT=m
1181# CONFIG_CRC16 is not set
1182# CONFIG_CRC_T10DIF is not set
1183# CONFIG_CRC_ITU_T is not set
1184CONFIG_CRC32=y
1185# CONFIG_CRC7 is not set
1186# CONFIG_LIBCRC32C is not set
1187CONFIG_ZLIB_INFLATE=y
1188CONFIG_PLIST=y
1189CONFIG_HAS_IOMEM=y
1190CONFIG_HAS_IOPORT=y
1191CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF526-EZBRD_defconfig b/arch/blackfin/configs/BF526-EZBRD_defconfig
index 4443a47e516f..69f66c35b2a5 100644
--- a/arch/blackfin/configs/BF526-EZBRD_defconfig
+++ b/arch/blackfin/configs/BF526-EZBRD_defconfig
@@ -1,7 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.26.3 3# Linux kernel version: 2.6.28-rc2
4# Thu Aug 28 16:49:53 2008
5# 4#
6# CONFIG_MMU is not set 5# CONFIG_MMU is not set
7# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -37,8 +36,7 @@ CONFIG_IKCONFIG_PROC=y
37CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
38# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
39# CONFIG_GROUP_SCHED is not set 38# CONFIG_GROUP_SCHED is not set
40CONFIG_SYSFS_DEPRECATED=y 39# CONFIG_SYSFS_DEPRECATED_V2 is not set
41CONFIG_SYSFS_DEPRECATED_V2=y
42# CONFIG_RELAY is not set 40# CONFIG_RELAY is not set
43# CONFIG_NAMESPACES is not set 41# CONFIG_NAMESPACES is not set
44CONFIG_BLK_DEV_INITRD=y 42CONFIG_BLK_DEV_INITRD=y
@@ -48,13 +46,13 @@ CONFIG_SYSCTL=y
48CONFIG_EMBEDDED=y 46CONFIG_EMBEDDED=y
49CONFIG_UID16=y 47CONFIG_UID16=y
50CONFIG_SYSCTL_SYSCALL=y 48CONFIG_SYSCTL_SYSCALL=y
51CONFIG_SYSCTL_SYSCALL_CHECK=y
52CONFIG_KALLSYMS=y 49CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set
53# CONFIG_KALLSYMS_EXTRA_PASS is not set 51# CONFIG_KALLSYMS_EXTRA_PASS is not set
54CONFIG_HOTPLUG=y 52CONFIG_HOTPLUG=y
55CONFIG_PRINTK=y 53CONFIG_PRINTK=y
56CONFIG_BUG=y 54CONFIG_BUG=y
57CONFIG_ELF_CORE=y 55# CONFIG_ELF_CORE is not set
58CONFIG_COMPAT_BRK=y 56CONFIG_COMPAT_BRK=y
59CONFIG_BASE_FULL=y 57CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 58CONFIG_FUTEX=y
@@ -63,6 +61,7 @@ CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 61CONFIG_SIGNALFD=y
64CONFIG_TIMERFD=y 62CONFIG_TIMERFD=y
65CONFIG_EVENTFD=y 63CONFIG_EVENTFD=y
64CONFIG_AIO=y
66CONFIG_VM_EVENT_COUNTERS=y 65CONFIG_VM_EVENT_COUNTERS=y
67CONFIG_SLAB=y 66CONFIG_SLAB=y
68# CONFIG_SLUB is not set 67# CONFIG_SLUB is not set
@@ -70,9 +69,7 @@ CONFIG_SLAB=y
70# CONFIG_PROFILING is not set 69# CONFIG_PROFILING is not set
71# CONFIG_MARKERS is not set 70# CONFIG_MARKERS is not set
72CONFIG_HAVE_OPROFILE=y 71CONFIG_HAVE_OPROFILE=y
73# CONFIG_HAVE_KPROBES is not set 72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
74# CONFIG_HAVE_KRETPROBES is not set
75# CONFIG_HAVE_DMA_ATTRS is not set
76CONFIG_SLABINFO=y 73CONFIG_SLABINFO=y
77CONFIG_RT_MUTEXES=y 74CONFIG_RT_MUTEXES=y
78CONFIG_TINY_SHMEM=y 75CONFIG_TINY_SHMEM=y
@@ -89,6 +86,7 @@ CONFIG_BLOCK=y
89# CONFIG_BLK_DEV_IO_TRACE is not set 86# CONFIG_BLK_DEV_IO_TRACE is not set
90# CONFIG_LSF is not set 87# CONFIG_LSF is not set
91# CONFIG_BLK_DEV_BSG is not set 88# CONFIG_BLK_DEV_BSG is not set
89# CONFIG_BLK_DEV_INTEGRITY is not set
92 90
93# 91#
94# IO Schedulers 92# IO Schedulers
@@ -106,6 +104,7 @@ CONFIG_CLASSIC_RCU=y
106# CONFIG_PREEMPT_NONE is not set 104# CONFIG_PREEMPT_NONE is not set
107CONFIG_PREEMPT_VOLUNTARY=y 105CONFIG_PREEMPT_VOLUNTARY=y
108# CONFIG_PREEMPT is not set 106# CONFIG_PREEMPT is not set
107# CONFIG_FREEZER is not set
109 108
110# 109#
111# Blackfin Processor Options 110# Blackfin Processor Options
@@ -114,6 +113,10 @@ CONFIG_PREEMPT_VOLUNTARY=y
114# 113#
115# Processor and Board Settings 114# Processor and Board Settings
116# 115#
116# CONFIG_BF512 is not set
117# CONFIG_BF514 is not set
118# CONFIG_BF516 is not set
119# CONFIG_BF518 is not set
117# CONFIG_BF522 is not set 120# CONFIG_BF522 is not set
118# CONFIG_BF523 is not set 121# CONFIG_BF523 is not set
119# CONFIG_BF524 is not set 122# CONFIG_BF524 is not set
@@ -126,49 +129,27 @@ CONFIG_BF526=y
126# CONFIG_BF534 is not set 129# CONFIG_BF534 is not set
127# CONFIG_BF536 is not set 130# CONFIG_BF536 is not set
128# CONFIG_BF537 is not set 131# CONFIG_BF537 is not set
132# CONFIG_BF538 is not set
133# CONFIG_BF539 is not set
129# CONFIG_BF542 is not set 134# CONFIG_BF542 is not set
130# CONFIG_BF544 is not set 135# CONFIG_BF544 is not set
131# CONFIG_BF547 is not set 136# CONFIG_BF547 is not set
132# CONFIG_BF548 is not set 137# CONFIG_BF548 is not set
133# CONFIG_BF549 is not set 138# CONFIG_BF549 is not set
134# CONFIG_BF561 is not set 139# CONFIG_BF561 is not set
140CONFIG_BF_REV_MIN=0
141CONFIG_BF_REV_MAX=2
135CONFIG_BF_REV_0_0=y 142CONFIG_BF_REV_0_0=y
136# CONFIG_BF_REV_0_1 is not set 143# CONFIG_BF_REV_0_1 is not set
137# CONFIG_BF_REV_0_2 is not set 144# CONFIG_BF_REV_0_2 is not set
138# CONFIG_BF_REV_0_3 is not set 145# CONFIG_BF_REV_0_3 is not set
139# CONFIG_BF_REV_0_4 is not set 146# CONFIG_BF_REV_0_4 is not set
140# CONFIG_BF_REV_0_5 is not set 147# CONFIG_BF_REV_0_5 is not set
148# CONFIG_BF_REV_0_6 is not set
141# CONFIG_BF_REV_ANY is not set 149# CONFIG_BF_REV_ANY is not set
142# CONFIG_BF_REV_NONE is not set 150# CONFIG_BF_REV_NONE is not set
143CONFIG_BF52x=y 151CONFIG_BF52x=y
144CONFIG_MEM_MT48LC32M16A2TG_75=y 152CONFIG_MEM_MT48LC32M16A2TG_75=y
145# CONFIG_BFIN527_EZKIT is not set
146# CONFIG_BFIN527_BLUETECHNIX_CM is not set
147CONFIG_BFIN526_EZBRD=y
148
149#
150# BF527 Specific Configuration
151#
152
153#
154# Alternative Multiplexing Scheme
155#
156# CONFIG_BF527_SPORT0_PORTF is not set
157CONFIG_BF527_SPORT0_PORTG=y
158CONFIG_BF527_SPORT0_TSCLK_PG10=y
159# CONFIG_BF527_SPORT0_TSCLK_PG14 is not set
160CONFIG_BF527_UART1_PORTF=y
161# CONFIG_BF527_UART1_PORTG is not set
162# CONFIG_BF527_NAND_D_PORTF is not set
163CONFIG_BF527_NAND_D_PORTH=y
164
165#
166# Interrupt Priority Assignment
167#
168
169#
170# Priority
171#
172CONFIG_IRQ_PLL_WAKEUP=7 153CONFIG_IRQ_PLL_WAKEUP=7
173CONFIG_IRQ_DMA0_ERROR=7 154CONFIG_IRQ_DMA0_ERROR=7
174CONFIG_IRQ_DMAR0_BLK=7 155CONFIG_IRQ_DMAR0_BLK=7
@@ -188,7 +169,6 @@ CONFIG_IRQ_SPORT0_TX=9
188CONFIG_IRQ_SPORT1_RX=9 169CONFIG_IRQ_SPORT1_RX=9
189CONFIG_IRQ_SPORT1_TX=9 170CONFIG_IRQ_SPORT1_TX=9
190CONFIG_IRQ_TWI=10 171CONFIG_IRQ_TWI=10
191CONFIG_IRQ_SPI=10
192CONFIG_IRQ_UART0_RX=10 172CONFIG_IRQ_UART0_RX=10
193CONFIG_IRQ_UART0_TX=10 173CONFIG_IRQ_UART0_TX=10
194CONFIG_IRQ_UART1_RX=10 174CONFIG_IRQ_UART1_RX=10
@@ -199,14 +179,14 @@ CONFIG_IRQ_MAC_RX=11
199CONFIG_IRQ_PORTH_INTA=11 179CONFIG_IRQ_PORTH_INTA=11
200CONFIG_IRQ_MAC_TX=11 180CONFIG_IRQ_MAC_TX=11
201CONFIG_IRQ_PORTH_INTB=11 181CONFIG_IRQ_PORTH_INTB=11
202CONFIG_IRQ_TMR0=12 182CONFIG_IRQ_TIMER0=12
203CONFIG_IRQ_TMR1=12 183CONFIG_IRQ_TIMER1=12
204CONFIG_IRQ_TMR2=12 184CONFIG_IRQ_TIMER2=12
205CONFIG_IRQ_TMR3=12 185CONFIG_IRQ_TIMER3=12
206CONFIG_IRQ_TMR4=12 186CONFIG_IRQ_TIMER4=12
207CONFIG_IRQ_TMR5=12 187CONFIG_IRQ_TIMER5=12
208CONFIG_IRQ_TMR6=12 188CONFIG_IRQ_TIMER6=12
209CONFIG_IRQ_TMR7=12 189CONFIG_IRQ_TIMER7=12
210CONFIG_IRQ_PORTG_INTA=12 190CONFIG_IRQ_PORTG_INTA=12
211CONFIG_IRQ_PORTG_INTB=12 191CONFIG_IRQ_PORTG_INTB=12
212CONFIG_IRQ_MEM_DMA0=13 192CONFIG_IRQ_MEM_DMA0=13
@@ -214,6 +194,34 @@ CONFIG_IRQ_MEM_DMA1=13
214CONFIG_IRQ_WATCH=13 194CONFIG_IRQ_WATCH=13
215CONFIG_IRQ_PORTF_INTA=13 195CONFIG_IRQ_PORTF_INTA=13
216CONFIG_IRQ_PORTF_INTB=13 196CONFIG_IRQ_PORTF_INTB=13
197# CONFIG_BFIN527_EZKIT is not set
198# CONFIG_BFIN527_BLUETECHNIX_CM is not set
199CONFIG_BFIN526_EZBRD=y
200
201#
202# BF527 Specific Configuration
203#
204
205#
206# Alternative Multiplexing Scheme
207#
208# CONFIG_BF527_SPORT0_PORTF is not set
209CONFIG_BF527_SPORT0_PORTG=y
210CONFIG_BF527_SPORT0_TSCLK_PG10=y
211# CONFIG_BF527_SPORT0_TSCLK_PG14 is not set
212CONFIG_BF527_UART1_PORTF=y
213# CONFIG_BF527_UART1_PORTG is not set
214# CONFIG_BF527_NAND_D_PORTF is not set
215CONFIG_BF527_NAND_D_PORTH=y
216
217#
218# Interrupt Priority Assignment
219#
220
221#
222# Priority
223#
224CONFIG_IRQ_SPI=10
217CONFIG_IRQ_SPI_ERROR=7 225CONFIG_IRQ_SPI_ERROR=7
218CONFIG_IRQ_NFC_ERROR=7 226CONFIG_IRQ_NFC_ERROR=7
219CONFIG_IRQ_HDMA_ERROR=7 227CONFIG_IRQ_HDMA_ERROR=7
@@ -235,7 +243,6 @@ CONFIG_BOOT_LOAD=0x1000
235# 243#
236CONFIG_CLKIN_HZ=25000000 244CONFIG_CLKIN_HZ=25000000
237# CONFIG_BFIN_KERNEL_CLOCK is not set 245# CONFIG_BFIN_KERNEL_CLOCK is not set
238CONFIG_MAX_MEM_SIZE=512
239CONFIG_MAX_VCO_HZ=400000000 246CONFIG_MAX_VCO_HZ=400000000
240CONFIG_MIN_VCO_HZ=50000000 247CONFIG_MIN_VCO_HZ=50000000
241CONFIG_MAX_SCLK_HZ=133333333 248CONFIG_MAX_SCLK_HZ=133333333
@@ -253,16 +260,11 @@ CONFIG_HZ=250
253CONFIG_GENERIC_TIME=y 260CONFIG_GENERIC_TIME=y
254CONFIG_GENERIC_CLOCKEVENTS=y 261CONFIG_GENERIC_CLOCKEVENTS=y
255# CONFIG_CYCLES_CLOCKSOURCE is not set 262# CONFIG_CYCLES_CLOCKSOURCE is not set
256# CONFIG_TICK_ONESHOT is not set
257# CONFIG_NO_HZ is not set 263# CONFIG_NO_HZ is not set
258# CONFIG_HIGH_RES_TIMERS is not set 264# CONFIG_HIGH_RES_TIMERS is not set
259CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 265CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
260 266
261# 267#
262# Memory Setup
263#
264
265#
266# Misc 268# Misc
267# 269#
268CONFIG_BFIN_SCRATCH_REG_RETN=y 270CONFIG_BFIN_SCRATCH_REG_RETN=y
@@ -291,6 +293,7 @@ CONFIG_ACCESS_OK_L1=y
291CONFIG_CACHELINE_ALIGNED_L1=y 293CONFIG_CACHELINE_ALIGNED_L1=y
292# CONFIG_SYSCALL_TAB_L1 is not set 294# CONFIG_SYSCALL_TAB_L1 is not set
293# CONFIG_CPLB_SWITCH_TAB_L1 is not set 295# CONFIG_CPLB_SWITCH_TAB_L1 is not set
296CONFIG_APP_STACK_L1=y
294 297
295# 298#
296# Speed Optimizations 299# Speed Optimizations
@@ -304,15 +307,13 @@ CONFIG_FLATMEM_MANUAL=y
304# CONFIG_SPARSEMEM_MANUAL is not set 307# CONFIG_SPARSEMEM_MANUAL is not set
305CONFIG_FLATMEM=y 308CONFIG_FLATMEM=y
306CONFIG_FLAT_NODE_MEM_MAP=y 309CONFIG_FLAT_NODE_MEM_MAP=y
307# CONFIG_SPARSEMEM_STATIC is not set
308# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
309CONFIG_PAGEFLAGS_EXTENDED=y 310CONFIG_PAGEFLAGS_EXTENDED=y
310CONFIG_SPLIT_PTLOCK_CPUS=4 311CONFIG_SPLIT_PTLOCK_CPUS=4
311# CONFIG_RESOURCES_64BIT is not set 312# CONFIG_RESOURCES_64BIT is not set
313# CONFIG_PHYS_ADDR_T_64BIT is not set
312CONFIG_ZONE_DMA_FLAG=1 314CONFIG_ZONE_DMA_FLAG=1
313CONFIG_VIRT_TO_BUS=y 315CONFIG_VIRT_TO_BUS=y
314CONFIG_BFIN_GPTIMERS=y 316CONFIG_BFIN_GPTIMERS=y
315CONFIG_BFIN_DMA_5XX=y
316# CONFIG_DMA_UNCACHED_4M is not set 317# CONFIG_DMA_UNCACHED_4M is not set
317# CONFIG_DMA_UNCACHED_2M is not set 318# CONFIG_DMA_UNCACHED_2M is not set
318CONFIG_DMA_UNCACHED_1M=y 319CONFIG_DMA_UNCACHED_1M=y
@@ -365,6 +366,7 @@ CONFIG_BINFMT_ELF_FDPIC=y
365CONFIG_BINFMT_FLAT=y 366CONFIG_BINFMT_FLAT=y
366CONFIG_BINFMT_ZFLAT=y 367CONFIG_BINFMT_ZFLAT=y
367# CONFIG_BINFMT_SHARED_FLAT is not set 368# CONFIG_BINFMT_SHARED_FLAT is not set
369# CONFIG_HAVE_AOUT is not set
368# CONFIG_BINFMT_MISC is not set 370# CONFIG_BINFMT_MISC is not set
369 371
370# 372#
@@ -378,10 +380,6 @@ CONFIG_ARCH_SUSPEND_POSSIBLE=y
378# CPU Frequency scaling 380# CPU Frequency scaling
379# 381#
380# CONFIG_CPU_FREQ is not set 382# CONFIG_CPU_FREQ is not set
381
382#
383# Networking
384#
385CONFIG_NET=y 383CONFIG_NET=y
386 384
387# 385#
@@ -432,6 +430,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
432# CONFIG_TIPC is not set 430# CONFIG_TIPC is not set
433# CONFIG_ATM is not set 431# CONFIG_ATM is not set
434# CONFIG_BRIDGE is not set 432# CONFIG_BRIDGE is not set
433# CONFIG_NET_DSA is not set
435# CONFIG_VLAN_8021Q is not set 434# CONFIG_VLAN_8021Q is not set
436# CONFIG_DECNET is not set 435# CONFIG_DECNET is not set
437# CONFIG_LLC2 is not set 436# CONFIG_LLC2 is not set
@@ -452,11 +451,10 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
452# CONFIG_IRDA is not set 451# CONFIG_IRDA is not set
453# CONFIG_BT is not set 452# CONFIG_BT is not set
454# CONFIG_AF_RXRPC is not set 453# CONFIG_AF_RXRPC is not set
455 454# CONFIG_PHONET is not set
456# 455CONFIG_WIRELESS=y
457# Wireless
458#
459# CONFIG_CFG80211 is not set 456# CONFIG_CFG80211 is not set
457CONFIG_WIRELESS_OLD_REGULATORY=y
460# CONFIG_WIRELESS_EXT is not set 458# CONFIG_WIRELESS_EXT is not set
461# CONFIG_MAC80211 is not set 459# CONFIG_MAC80211 is not set
462# CONFIG_IEEE80211 is not set 460# CONFIG_IEEE80211 is not set
@@ -474,6 +472,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
474CONFIG_STANDALONE=y 472CONFIG_STANDALONE=y
475CONFIG_PREVENT_FIRMWARE_BUILD=y 473CONFIG_PREVENT_FIRMWARE_BUILD=y
476# CONFIG_FW_LOADER is not set 474# CONFIG_FW_LOADER is not set
475# CONFIG_DEBUG_DRIVER is not set
476# CONFIG_DEBUG_DEVRES is not set
477# CONFIG_SYS_HYPERVISOR is not set 477# CONFIG_SYS_HYPERVISOR is not set
478# CONFIG_CONNECTOR is not set 478# CONFIG_CONNECTOR is not set
479CONFIG_MTD=y 479CONFIG_MTD=y
@@ -534,7 +534,8 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
534# Self-contained MTD device drivers 534# Self-contained MTD device drivers
535# 535#
536# CONFIG_MTD_DATAFLASH is not set 536# CONFIG_MTD_DATAFLASH is not set
537# CONFIG_MTD_M25P80 is not set 537CONFIG_MTD_M25P80=y
538CONFIG_M25PXX_USE_FAST_READ=y
538# CONFIG_MTD_SLRAM is not set 539# CONFIG_MTD_SLRAM is not set
539# CONFIG_MTD_PHRAM is not set 540# CONFIG_MTD_PHRAM is not set
540# CONFIG_MTD_MTDRAM is not set 541# CONFIG_MTD_MTDRAM is not set
@@ -579,6 +580,7 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
579# CONFIG_BLK_DEV_XIP is not set 580# CONFIG_BLK_DEV_XIP is not set
580# CONFIG_CDROM_PKTCDVD is not set 581# CONFIG_CDROM_PKTCDVD is not set
581# CONFIG_ATA_OVER_ETH is not set 582# CONFIG_ATA_OVER_ETH is not set
583# CONFIG_BLK_DEV_HD is not set
582CONFIG_MISC_DEVICES=y 584CONFIG_MISC_DEVICES=y
583# CONFIG_EEPROM_93CX6 is not set 585# CONFIG_EEPROM_93CX6 is not set
584# CONFIG_ENCLOSURE_SERVICES is not set 586# CONFIG_ENCLOSURE_SERVICES is not set
@@ -595,7 +597,6 @@ CONFIG_HAVE_IDE=y
595# CONFIG_ATA is not set 597# CONFIG_ATA is not set
596# CONFIG_MD is not set 598# CONFIG_MD is not set
597CONFIG_NETDEVICES=y 599CONFIG_NETDEVICES=y
598# CONFIG_NETDEVICES_MULTIQUEUE is not set
599# CONFIG_DUMMY is not set 600# CONFIG_DUMMY is not set
600# CONFIG_BONDING is not set 601# CONFIG_BONDING is not set
601# CONFIG_MACVLAN is not set 602# CONFIG_MACVLAN is not set
@@ -633,9 +634,10 @@ CONFIG_BFIN_MAC_RMII=y
633# CONFIG_IBM_NEW_EMAC_RGMII is not set 634# CONFIG_IBM_NEW_EMAC_RGMII is not set
634# CONFIG_IBM_NEW_EMAC_TAH is not set 635# CONFIG_IBM_NEW_EMAC_TAH is not set
635# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 636# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
636# CONFIG_B44 is not set 637# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
638# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
639# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
637CONFIG_NETDEV_1000=y 640CONFIG_NETDEV_1000=y
638# CONFIG_E1000E_ENABLED is not set
639# CONFIG_AX88180 is not set 641# CONFIG_AX88180 is not set
640CONFIG_NETDEV_10000=y 642CONFIG_NETDEV_10000=y
641 643
@@ -667,7 +669,7 @@ CONFIG_NETDEV_10000=y
667# Input device support 669# Input device support
668# 670#
669CONFIG_INPUT=y 671CONFIG_INPUT=y
670# CONFIG_INPUT_FF_MEMLESS is not set 672CONFIG_INPUT_FF_MEMLESS=m
671# CONFIG_INPUT_POLLDEV is not set 673# CONFIG_INPUT_POLLDEV is not set
672 674
673# 675#
@@ -692,8 +694,9 @@ CONFIG_INPUT_MISC=y
692# CONFIG_INPUT_KEYSPAN_REMOTE is not set 694# CONFIG_INPUT_KEYSPAN_REMOTE is not set
693# CONFIG_INPUT_POWERMATE is not set 695# CONFIG_INPUT_POWERMATE is not set
694# CONFIG_INPUT_YEALINK is not set 696# CONFIG_INPUT_YEALINK is not set
697# CONFIG_INPUT_CM109 is not set
695# CONFIG_INPUT_UINPUT is not set 698# CONFIG_INPUT_UINPUT is not set
696# CONFIG_TWI_KEYPAD is not set 699# CONFIG_CONFIG_INPUT_PCF8574 is not set
697 700
698# 701#
699# Hardware I/O ports 702# Hardware I/O ports
@@ -712,12 +715,15 @@ CONFIG_INPUT_MISC=y
712# CONFIG_BFIN_SPORT is not set 715# CONFIG_BFIN_SPORT is not set
713# CONFIG_BFIN_TIMER_LATENCY is not set 716# CONFIG_BFIN_TIMER_LATENCY is not set
714# CONFIG_TWI_LCD is not set 717# CONFIG_TWI_LCD is not set
718CONFIG_BFIN_DMA_INTERFACE=m
715CONFIG_SIMPLE_GPIO=m 719CONFIG_SIMPLE_GPIO=m
716CONFIG_VT=y 720CONFIG_VT=y
721CONFIG_CONSOLE_TRANSLATIONS=y
717CONFIG_VT_CONSOLE=y 722CONFIG_VT_CONSOLE=y
718CONFIG_HW_CONSOLE=y 723CONFIG_HW_CONSOLE=y
719# CONFIG_VT_HW_CONSOLE_BINDING is not set 724# CONFIG_VT_HW_CONSOLE_BINDING is not set
720CONFIG_DEVKMEM=y 725# CONFIG_DEVKMEM is not set
726# CONFIG_BFIN_JTAG_COMM is not set
721# CONFIG_SERIAL_NONSTANDARD is not set 727# CONFIG_SERIAL_NONSTANDARD is not set
722 728
723# 729#
@@ -760,25 +766,39 @@ CONFIG_I2C_HELPER_AUTO=y
760# 766#
761# I2C Hardware Bus support 767# I2C Hardware Bus support
762# 768#
769
770#
771# I2C system bus drivers (mostly embedded / system-on-chip)
772#
763CONFIG_I2C_BLACKFIN_TWI=y 773CONFIG_I2C_BLACKFIN_TWI=y
764CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 774CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
765# CONFIG_I2C_GPIO is not set 775# CONFIG_I2C_GPIO is not set
766# CONFIG_I2C_OCORES is not set 776# CONFIG_I2C_OCORES is not set
767# CONFIG_I2C_PARPORT_LIGHT is not set
768# CONFIG_I2C_SIMTEC is not set 777# CONFIG_I2C_SIMTEC is not set
778
779#
780# External I2C/SMBus adapter drivers
781#
782# CONFIG_I2C_PARPORT_LIGHT is not set
769# CONFIG_I2C_TAOS_EVM is not set 783# CONFIG_I2C_TAOS_EVM is not set
770# CONFIG_I2C_STUB is not set
771# CONFIG_I2C_TINY_USB is not set 784# CONFIG_I2C_TINY_USB is not set
785
786#
787# Other I2C/SMBus bus drivers
788#
772# CONFIG_I2C_PCA_PLATFORM is not set 789# CONFIG_I2C_PCA_PLATFORM is not set
790# CONFIG_I2C_STUB is not set
773 791
774# 792#
775# Miscellaneous I2C Chip support 793# Miscellaneous I2C Chip support
776# 794#
777# CONFIG_DS1682 is not set 795# CONFIG_DS1682 is not set
796# CONFIG_AT24 is not set
778# CONFIG_SENSORS_AD5252 is not set 797# CONFIG_SENSORS_AD5252 is not set
779# CONFIG_SENSORS_EEPROM is not set 798# CONFIG_SENSORS_EEPROM is not set
780# CONFIG_SENSORS_PCF8574 is not set 799# CONFIG_SENSORS_PCF8574 is not set
781# CONFIG_PCF8575 is not set 800# CONFIG_PCF8575 is not set
801# CONFIG_SENSORS_PCA9539 is not set
782# CONFIG_SENSORS_PCF8591 is not set 802# CONFIG_SENSORS_PCF8591 is not set
783# CONFIG_SENSORS_MAX6875 is not set 803# CONFIG_SENSORS_MAX6875 is not set
784# CONFIG_SENSORS_TSL2550 is not set 804# CONFIG_SENSORS_TSL2550 is not set
@@ -787,12 +807,14 @@ CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50
787# CONFIG_I2C_DEBUG_BUS is not set 807# CONFIG_I2C_DEBUG_BUS is not set
788# CONFIG_I2C_DEBUG_CHIP is not set 808# CONFIG_I2C_DEBUG_CHIP is not set
789CONFIG_SPI=y 809CONFIG_SPI=y
810# CONFIG_SPI_DEBUG is not set
790CONFIG_SPI_MASTER=y 811CONFIG_SPI_MASTER=y
791 812
792# 813#
793# SPI Master Controller Drivers 814# SPI Master Controller Drivers
794# 815#
795CONFIG_SPI_BFIN=y 816CONFIG_SPI_BFIN=y
817# CONFIG_SPI_BFIN_LOCK is not set
796# CONFIG_SPI_BITBANG is not set 818# CONFIG_SPI_BITBANG is not set
797 819
798# 820#
@@ -801,11 +823,15 @@ CONFIG_SPI_BFIN=y
801# CONFIG_SPI_AT25 is not set 823# CONFIG_SPI_AT25 is not set
802# CONFIG_SPI_SPIDEV is not set 824# CONFIG_SPI_SPIDEV is not set
803# CONFIG_SPI_TLE62X0 is not set 825# CONFIG_SPI_TLE62X0 is not set
826CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
827# CONFIG_GPIOLIB is not set
804# CONFIG_W1 is not set 828# CONFIG_W1 is not set
805# CONFIG_POWER_SUPPLY is not set 829# CONFIG_POWER_SUPPLY is not set
806CONFIG_HWMON=y 830CONFIG_HWMON=y
807# CONFIG_HWMON_VID is not set 831# CONFIG_HWMON_VID is not set
832# CONFIG_SENSORS_AD7414 is not set
808# CONFIG_SENSORS_AD7418 is not set 833# CONFIG_SENSORS_AD7418 is not set
834# CONFIG_SENSORS_ADCXX is not set
809# CONFIG_SENSORS_ADM1021 is not set 835# CONFIG_SENSORS_ADM1021 is not set
810# CONFIG_SENSORS_ADM1025 is not set 836# CONFIG_SENSORS_ADM1025 is not set
811# CONFIG_SENSORS_ADM1026 is not set 837# CONFIG_SENSORS_ADM1026 is not set
@@ -834,6 +860,7 @@ CONFIG_HWMON=y
834# CONFIG_SENSORS_LM90 is not set 860# CONFIG_SENSORS_LM90 is not set
835# CONFIG_SENSORS_LM92 is not set 861# CONFIG_SENSORS_LM92 is not set
836# CONFIG_SENSORS_LM93 is not set 862# CONFIG_SENSORS_LM93 is not set
863# CONFIG_SENSORS_MAX1111 is not set
837# CONFIG_SENSORS_MAX1619 is not set 864# CONFIG_SENSORS_MAX1619 is not set
838# CONFIG_SENSORS_MAX6650 is not set 865# CONFIG_SENSORS_MAX6650 is not set
839# CONFIG_SENSORS_PC87360 is not set 866# CONFIG_SENSORS_PC87360 is not set
@@ -871,16 +898,14 @@ CONFIG_BFIN_WDT=y
871# CONFIG_USBPCWATCHDOG is not set 898# CONFIG_USBPCWATCHDOG is not set
872 899
873# 900#
874# Sonics Silicon Backplane
875#
876CONFIG_SSB_POSSIBLE=y
877# CONFIG_SSB is not set
878
879#
880# Multifunction device drivers 901# Multifunction device drivers
881# 902#
903# CONFIG_MFD_CORE is not set
882# CONFIG_MFD_SM501 is not set 904# CONFIG_MFD_SM501 is not set
883# CONFIG_HTC_PASIC3 is not set 905# CONFIG_HTC_PASIC3 is not set
906# CONFIG_MFD_TMIO is not set
907# CONFIG_MFD_WM8400 is not set
908# CONFIG_MFD_WM8350_I2C is not set
884 909
885# 910#
886# Multimedia devices 911# Multimedia devices
@@ -915,15 +940,8 @@ CONFIG_SSB_POSSIBLE=y
915# Console display driver support 940# Console display driver support
916# 941#
917CONFIG_DUMMY_CONSOLE=y 942CONFIG_DUMMY_CONSOLE=y
918
919#
920# Sound
921#
922CONFIG_SOUND=m 943CONFIG_SOUND=m
923 944CONFIG_SOUND_OSS_CORE=y
924#
925# Advanced Linux Sound Architecture
926#
927CONFIG_SND=m 945CONFIG_SND=m
928CONFIG_SND_TIMER=m 946CONFIG_SND_TIMER=m
929CONFIG_SND_PCM=m 947CONFIG_SND_PCM=m
@@ -937,56 +955,40 @@ CONFIG_SND_SUPPORT_OLD_API=y
937CONFIG_SND_VERBOSE_PROCFS=y 955CONFIG_SND_VERBOSE_PROCFS=y
938# CONFIG_SND_VERBOSE_PRINTK is not set 956# CONFIG_SND_VERBOSE_PRINTK is not set
939# CONFIG_SND_DEBUG is not set 957# CONFIG_SND_DEBUG is not set
940 958CONFIG_SND_DRIVERS=y
941#
942# Generic devices
943#
944# CONFIG_SND_DUMMY is not set 959# CONFIG_SND_DUMMY is not set
945# CONFIG_SND_MTPAV is not set 960# CONFIG_SND_MTPAV is not set
946# CONFIG_SND_SERIAL_U16550 is not set 961# CONFIG_SND_SERIAL_U16550 is not set
947# CONFIG_SND_MPU401 is not set 962# CONFIG_SND_MPU401 is not set
948 963CONFIG_SND_SPI=y
949#
950# SPI devices
951#
952 964
953# 965#
954# ALSA Blackfin devices 966# ALSA Blackfin devices
955# 967#
956# CONFIG_SND_BLACKFIN_AD1836 is not set 968# CONFIG_SND_BLACKFIN_AD1836 is not set
957# CONFIG_SND_BFIN_AD73311 is not set
958# CONFIG_SND_BFIN_AD73322 is not set 969# CONFIG_SND_BFIN_AD73322 is not set
959 970CONFIG_SND_USB=y
960#
961# USB devices
962#
963# CONFIG_SND_USB_AUDIO is not set 971# CONFIG_SND_USB_AUDIO is not set
964# CONFIG_SND_USB_CAIAQ is not set 972# CONFIG_SND_USB_CAIAQ is not set
965
966#
967# System on Chip audio support
968#
969CONFIG_SND_SOC=m 973CONFIG_SND_SOC=m
974CONFIG_SND_SOC_AC97_BUS=y
970CONFIG_SND_BF5XX_I2S=m 975CONFIG_SND_BF5XX_I2S=m
971CONFIG_SND_BF5XX_SOC_SSM2602=m 976CONFIG_SND_BF5XX_SOC_SSM2602=m
972# CONFIG_SND_BF5XX_AC97 is not set 977# CONFIG_SND_BF5XX_SOC_AD73311 is not set
978CONFIG_SND_BF5XX_AC97=m
979CONFIG_SND_BF5XX_MMAP_SUPPORT=y
980# CONFIG_SND_BF5XX_MULTICHAN_SUPPORT is not set
973CONFIG_SND_BF5XX_SOC_SPORT=m 981CONFIG_SND_BF5XX_SOC_SPORT=m
974CONFIG_SND_BF5XX_SOC_I2S=m 982CONFIG_SND_BF5XX_SOC_I2S=m
983CONFIG_SND_BF5XX_SOC_AC97=m
984CONFIG_SND_BF5XX_SOC_AD1980=m
975CONFIG_SND_BF5XX_SPORT_NUM=0 985CONFIG_SND_BF5XX_SPORT_NUM=0
976 986# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
977# 987# CONFIG_SND_SOC_ALL_CODECS is not set
978# ALSA SoC audio for Freescale SOCs 988CONFIG_SND_SOC_AD1980=m
979#
980
981#
982# SoC Audio for the Texas Instruments OMAP
983#
984CONFIG_SND_SOC_SSM2602=m 989CONFIG_SND_SOC_SSM2602=m
985
986#
987# Open Sound System
988#
989# CONFIG_SOUND_PRIME is not set 990# CONFIG_SOUND_PRIME is not set
991CONFIG_AC97_BUS=m
990CONFIG_HID_SUPPORT=y 992CONFIG_HID_SUPPORT=y
991CONFIG_HID=y 993CONFIG_HID=y
992# CONFIG_HID_DEBUG is not set 994# CONFIG_HID_DEBUG is not set
@@ -996,9 +998,36 @@ CONFIG_HID=y
996# USB Input Devices 998# USB Input Devices
997# 999#
998CONFIG_USB_HID=y 1000CONFIG_USB_HID=y
999# CONFIG_USB_HIDINPUT_POWERBOOK is not set 1001# CONFIG_HID_PID is not set
1000# CONFIG_HID_FF is not set
1001# CONFIG_USB_HIDDEV is not set 1002# CONFIG_USB_HIDDEV is not set
1003
1004#
1005# Special HID drivers
1006#
1007CONFIG_HID_COMPAT=y
1008CONFIG_HID_A4TECH=y
1009CONFIG_HID_APPLE=y
1010CONFIG_HID_BELKIN=y
1011CONFIG_HID_BRIGHT=y
1012CONFIG_HID_CHERRY=y
1013CONFIG_HID_CHICONY=y
1014CONFIG_HID_CYPRESS=y
1015CONFIG_HID_DELL=y
1016CONFIG_HID_EZKEY=y
1017CONFIG_HID_GYRATION=y
1018CONFIG_HID_LOGITECH=y
1019# CONFIG_LOGITECH_FF is not set
1020# CONFIG_LOGIRUMBLEPAD2_FF is not set
1021CONFIG_HID_MICROSOFT=y
1022CONFIG_HID_MONTEREY=y
1023CONFIG_HID_PANTHERLORD=y
1024# CONFIG_PANTHERLORD_FF is not set
1025CONFIG_HID_PETALYNX=y
1026CONFIG_HID_SAMSUNG=y
1027CONFIG_HID_SONY=y
1028CONFIG_HID_SUNPLUS=y
1029CONFIG_THRUSTMASTER_FF=m
1030CONFIG_ZEROPLUS_FF=m
1002CONFIG_USB_SUPPORT=y 1031CONFIG_USB_SUPPORT=y
1003CONFIG_USB_ARCH_HAS_HCD=y 1032CONFIG_USB_ARCH_HAS_HCD=y
1004# CONFIG_USB_ARCH_HAS_OHCI is not set 1033# CONFIG_USB_ARCH_HAS_OHCI is not set
@@ -1016,6 +1045,9 @@ CONFIG_USB_DEVICE_CLASS=y
1016# CONFIG_USB_OTG is not set 1045# CONFIG_USB_OTG is not set
1017# CONFIG_USB_OTG_WHITELIST is not set 1046# CONFIG_USB_OTG_WHITELIST is not set
1018CONFIG_USB_OTG_BLACKLIST_HUB=y 1047CONFIG_USB_OTG_BLACKLIST_HUB=y
1048CONFIG_USB_MON=y
1049# CONFIG_USB_WUSB is not set
1050# CONFIG_USB_WUSB_CBAF is not set
1019 1051
1020# 1052#
1021# USB Host Controller Drivers 1053# USB Host Controller Drivers
@@ -1026,6 +1058,7 @@ CONFIG_USB_OTG_BLACKLIST_HUB=y
1026# CONFIG_USB_ISP1362_HCD is not set 1058# CONFIG_USB_ISP1362_HCD is not set
1027# CONFIG_USB_SL811_HCD is not set 1059# CONFIG_USB_SL811_HCD is not set
1028# CONFIG_USB_R8A66597_HCD is not set 1060# CONFIG_USB_R8A66597_HCD is not set
1061# CONFIG_USB_HWA_HCD is not set
1029CONFIG_USB_MUSB_HDRC=y 1062CONFIG_USB_MUSB_HDRC=y
1030CONFIG_USB_MUSB_SOC=y 1063CONFIG_USB_MUSB_SOC=y
1031 1064
@@ -1037,7 +1070,7 @@ CONFIG_USB_MUSB_HOST=y
1037# CONFIG_USB_MUSB_OTG is not set 1070# CONFIG_USB_MUSB_OTG is not set
1038CONFIG_USB_MUSB_HDRC_HCD=y 1071CONFIG_USB_MUSB_HDRC_HCD=y
1039CONFIG_MUSB_PIO_ONLY=y 1072CONFIG_MUSB_PIO_ONLY=y
1040CONFIG_USB_MUSB_LOGLEVEL=0 1073# CONFIG_USB_MUSB_DEBUG is not set
1041 1074
1042# 1075#
1043# USB Device Class drivers 1076# USB Device Class drivers
@@ -1045,6 +1078,7 @@ CONFIG_USB_MUSB_LOGLEVEL=0
1045# CONFIG_USB_ACM is not set 1078# CONFIG_USB_ACM is not set
1046# CONFIG_USB_PRINTER is not set 1079# CONFIG_USB_PRINTER is not set
1047# CONFIG_USB_WDM is not set 1080# CONFIG_USB_WDM is not set
1081# CONFIG_USB_TMC is not set
1048 1082
1049# 1083#
1050# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1084# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -1059,7 +1093,6 @@ CONFIG_USB_MUSB_LOGLEVEL=0
1059# USB Imaging devices 1093# USB Imaging devices
1060# 1094#
1061# CONFIG_USB_MDC800 is not set 1095# CONFIG_USB_MDC800 is not set
1062CONFIG_USB_MON=y
1063 1096
1064# 1097#
1065# USB port drivers 1098# USB port drivers
@@ -1072,7 +1105,7 @@ CONFIG_USB_MON=y
1072# CONFIG_USB_EMI62 is not set 1105# CONFIG_USB_EMI62 is not set
1073# CONFIG_USB_EMI26 is not set 1106# CONFIG_USB_EMI26 is not set
1074# CONFIG_USB_ADUTUX is not set 1107# CONFIG_USB_ADUTUX is not set
1075# CONFIG_USB_AUERSWALD is not set 1108# CONFIG_USB_SEVSEG is not set
1076# CONFIG_USB_RIO500 is not set 1109# CONFIG_USB_RIO500 is not set
1077# CONFIG_USB_LEGOTOWER is not set 1110# CONFIG_USB_LEGOTOWER is not set
1078# CONFIG_USB_LCD is not set 1111# CONFIG_USB_LCD is not set
@@ -1089,6 +1122,7 @@ CONFIG_USB_MON=y
1089# CONFIG_USB_TRANCEVIBRATOR is not set 1122# CONFIG_USB_TRANCEVIBRATOR is not set
1090# CONFIG_USB_IOWARRIOR is not set 1123# CONFIG_USB_IOWARRIOR is not set
1091# CONFIG_USB_ISIGHTFW is not set 1124# CONFIG_USB_ISIGHTFW is not set
1125# CONFIG_USB_VST is not set
1092# CONFIG_USB_GADGET is not set 1126# CONFIG_USB_GADGET is not set
1093# CONFIG_MMC is not set 1127# CONFIG_MMC is not set
1094# CONFIG_MEMSTICK is not set 1128# CONFIG_MEMSTICK is not set
@@ -1128,36 +1162,45 @@ CONFIG_RTC_INTF_DEV=y
1128# 1162#
1129# SPI RTC drivers 1163# SPI RTC drivers
1130# 1164#
1165# CONFIG_RTC_DRV_M41T94 is not set
1166# CONFIG_RTC_DRV_DS1305 is not set
1131# CONFIG_RTC_DRV_MAX6902 is not set 1167# CONFIG_RTC_DRV_MAX6902 is not set
1132# CONFIG_RTC_DRV_R9701 is not set 1168# CONFIG_RTC_DRV_R9701 is not set
1133# CONFIG_RTC_DRV_RS5C348 is not set 1169# CONFIG_RTC_DRV_RS5C348 is not set
1170# CONFIG_RTC_DRV_DS3234 is not set
1134 1171
1135# 1172#
1136# Platform RTC drivers 1173# Platform RTC drivers
1137# 1174#
1175# CONFIG_RTC_DRV_DS1286 is not set
1138# CONFIG_RTC_DRV_DS1511 is not set 1176# CONFIG_RTC_DRV_DS1511 is not set
1139# CONFIG_RTC_DRV_DS1553 is not set 1177# CONFIG_RTC_DRV_DS1553 is not set
1140# CONFIG_RTC_DRV_DS1742 is not set 1178# CONFIG_RTC_DRV_DS1742 is not set
1141# CONFIG_RTC_DRV_STK17TA8 is not set 1179# CONFIG_RTC_DRV_STK17TA8 is not set
1142# CONFIG_RTC_DRV_M48T86 is not set 1180# CONFIG_RTC_DRV_M48T86 is not set
1181# CONFIG_RTC_DRV_M48T35 is not set
1143# CONFIG_RTC_DRV_M48T59 is not set 1182# CONFIG_RTC_DRV_M48T59 is not set
1183# CONFIG_RTC_DRV_BQ4802 is not set
1144# CONFIG_RTC_DRV_V3020 is not set 1184# CONFIG_RTC_DRV_V3020 is not set
1145 1185
1146# 1186#
1147# on-CPU RTC drivers 1187# on-CPU RTC drivers
1148# 1188#
1149CONFIG_RTC_DRV_BFIN=y 1189CONFIG_RTC_DRV_BFIN=y
1190# CONFIG_DMADEVICES is not set
1150# CONFIG_UIO is not set 1191# CONFIG_UIO is not set
1192# CONFIG_STAGING is not set
1151 1193
1152# 1194#
1153# File systems 1195# File systems
1154# 1196#
1155# CONFIG_EXT2_FS is not set 1197# CONFIG_EXT2_FS is not set
1156# CONFIG_EXT3_FS is not set 1198# CONFIG_EXT3_FS is not set
1157# CONFIG_EXT4DEV_FS is not set 1199# CONFIG_EXT4_FS is not set
1158# CONFIG_REISERFS_FS is not set 1200# CONFIG_REISERFS_FS is not set
1159# CONFIG_JFS_FS is not set 1201# CONFIG_JFS_FS is not set
1160# CONFIG_FS_POSIX_ACL is not set 1202# CONFIG_FS_POSIX_ACL is not set
1203CONFIG_FILE_LOCKING=y
1161# CONFIG_XFS_FS is not set 1204# CONFIG_XFS_FS is not set
1162# CONFIG_OCFS2_FS is not set 1205# CONFIG_OCFS2_FS is not set
1163# CONFIG_DNOTIFY is not set 1206# CONFIG_DNOTIFY is not set
@@ -1225,6 +1268,7 @@ CONFIG_JFFS2_RTIME=y
1225# CONFIG_CRAMFS is not set 1268# CONFIG_CRAMFS is not set
1226# CONFIG_VXFS_FS is not set 1269# CONFIG_VXFS_FS is not set
1227# CONFIG_MINIX_FS is not set 1270# CONFIG_MINIX_FS is not set
1271# CONFIG_OMFS_FS is not set
1228# CONFIG_HPFS_FS is not set 1272# CONFIG_HPFS_FS is not set
1229# CONFIG_QNX4FS_FS is not set 1273# CONFIG_QNX4FS_FS is not set
1230# CONFIG_ROMFS_FS is not set 1274# CONFIG_ROMFS_FS is not set
@@ -1240,7 +1284,7 @@ CONFIG_LOCKD=m
1240CONFIG_LOCKD_V4=y 1284CONFIG_LOCKD_V4=y
1241CONFIG_NFS_COMMON=y 1285CONFIG_NFS_COMMON=y
1242CONFIG_SUNRPC=m 1286CONFIG_SUNRPC=m
1243# CONFIG_SUNRPC_BIND34 is not set 1287# CONFIG_SUNRPC_REGISTER_V4 is not set
1244# CONFIG_RPCSEC_GSS_KRB5 is not set 1288# CONFIG_RPCSEC_GSS_KRB5 is not set
1245# CONFIG_RPCSEC_GSS_SPKM3 is not set 1289# CONFIG_RPCSEC_GSS_SPKM3 is not set
1246CONFIG_SMB_FS=m 1290CONFIG_SMB_FS=m
@@ -1308,10 +1352,48 @@ CONFIG_FRAME_WARN=1024
1308# CONFIG_UNUSED_SYMBOLS is not set 1352# CONFIG_UNUSED_SYMBOLS is not set
1309CONFIG_DEBUG_FS=y 1353CONFIG_DEBUG_FS=y
1310# CONFIG_HEADERS_CHECK is not set 1354# CONFIG_HEADERS_CHECK is not set
1311# CONFIG_DEBUG_KERNEL is not set 1355CONFIG_DEBUG_KERNEL=y
1356# CONFIG_DEBUG_SHIRQ is not set
1357CONFIG_DETECT_SOFTLOCKUP=y
1358# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1359CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1360CONFIG_SCHED_DEBUG=y
1361# CONFIG_SCHEDSTATS is not set
1362# CONFIG_TIMER_STATS is not set
1363# CONFIG_DEBUG_OBJECTS is not set
1364# CONFIG_DEBUG_SLAB is not set
1365# CONFIG_DEBUG_RT_MUTEXES is not set
1366# CONFIG_RT_MUTEX_TESTER is not set
1367# CONFIG_DEBUG_SPINLOCK is not set
1368# CONFIG_DEBUG_MUTEXES is not set
1369# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1370# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1371# CONFIG_DEBUG_KOBJECT is not set
1312# CONFIG_DEBUG_BUGVERBOSE is not set 1372# CONFIG_DEBUG_BUGVERBOSE is not set
1373CONFIG_DEBUG_INFO=y
1374# CONFIG_DEBUG_VM is not set
1375# CONFIG_DEBUG_WRITECOUNT is not set
1376# CONFIG_DEBUG_MEMORY_INIT is not set
1377# CONFIG_DEBUG_LIST is not set
1378# CONFIG_DEBUG_SG is not set
1379# CONFIG_FRAME_POINTER is not set
1380# CONFIG_BOOT_PRINTK_DELAY is not set
1381# CONFIG_RCU_TORTURE_TEST is not set
1382# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1383# CONFIG_BACKTRACE_SELF_TEST is not set
1384# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1385# CONFIG_FAULT_INJECTION is not set
1386CONFIG_SYSCTL_SYSCALL_CHECK=y
1387# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1313# CONFIG_SAMPLES is not set 1388# CONFIG_SAMPLES is not set
1389CONFIG_HAVE_ARCH_KGDB=y
1390# CONFIG_KGDB is not set
1391# CONFIG_DEBUG_STACKOVERFLOW is not set
1392# CONFIG_DEBUG_STACK_USAGE is not set
1393CONFIG_DEBUG_VERBOSE=y
1314CONFIG_DEBUG_MMRS=y 1394CONFIG_DEBUG_MMRS=y
1395# CONFIG_DEBUG_HWERR is not set
1396# CONFIG_DEBUG_DOUBLEFAULT is not set
1315CONFIG_DEBUG_HUNT_FOR_ZERO=y 1397CONFIG_DEBUG_HUNT_FOR_ZERO=y
1316CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1398CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1317CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1399CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
@@ -1329,8 +1411,9 @@ CONFIG_ACCESS_CHECK=y
1329# 1411#
1330# CONFIG_KEYS is not set 1412# CONFIG_KEYS is not set
1331CONFIG_SECURITY=y 1413CONFIG_SECURITY=y
1414# CONFIG_SECURITYFS is not set
1332# CONFIG_SECURITY_NETWORK is not set 1415# CONFIG_SECURITY_NETWORK is not set
1333# CONFIG_SECURITY_CAPABILITIES is not set 1416# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1334# CONFIG_SECURITY_ROOTPLUG is not set 1417# CONFIG_SECURITY_ROOTPLUG is not set
1335CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0 1418CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1336CONFIG_CRYPTO=y 1419CONFIG_CRYPTO=y
@@ -1338,6 +1421,7 @@ CONFIG_CRYPTO=y
1338# 1421#
1339# Crypto core or helper 1422# Crypto core or helper
1340# 1423#
1424# CONFIG_CRYPTO_FIPS is not set
1341# CONFIG_CRYPTO_MANAGER is not set 1425# CONFIG_CRYPTO_MANAGER is not set
1342# CONFIG_CRYPTO_GF128MUL is not set 1426# CONFIG_CRYPTO_GF128MUL is not set
1343# CONFIG_CRYPTO_NULL is not set 1427# CONFIG_CRYPTO_NULL is not set
@@ -1376,6 +1460,10 @@ CONFIG_CRYPTO=y
1376# CONFIG_CRYPTO_MD4 is not set 1460# CONFIG_CRYPTO_MD4 is not set
1377# CONFIG_CRYPTO_MD5 is not set 1461# CONFIG_CRYPTO_MD5 is not set
1378# CONFIG_CRYPTO_MICHAEL_MIC is not set 1462# CONFIG_CRYPTO_MICHAEL_MIC is not set
1463# CONFIG_CRYPTO_RMD128 is not set
1464# CONFIG_CRYPTO_RMD160 is not set
1465# CONFIG_CRYPTO_RMD256 is not set
1466# CONFIG_CRYPTO_RMD320 is not set
1379# CONFIG_CRYPTO_SHA1 is not set 1467# CONFIG_CRYPTO_SHA1 is not set
1380# CONFIG_CRYPTO_SHA256 is not set 1468# CONFIG_CRYPTO_SHA256 is not set
1381# CONFIG_CRYPTO_SHA512 is not set 1469# CONFIG_CRYPTO_SHA512 is not set
@@ -1406,15 +1494,20 @@ CONFIG_CRYPTO=y
1406# 1494#
1407# CONFIG_CRYPTO_DEFLATE is not set 1495# CONFIG_CRYPTO_DEFLATE is not set
1408# CONFIG_CRYPTO_LZO is not set 1496# CONFIG_CRYPTO_LZO is not set
1497
1498#
1499# Random Number Generation
1500#
1501# CONFIG_CRYPTO_ANSI_CPRNG is not set
1409CONFIG_CRYPTO_HW=y 1502CONFIG_CRYPTO_HW=y
1410 1503
1411# 1504#
1412# Library routines 1505# Library routines
1413# 1506#
1414CONFIG_BITREVERSE=y 1507CONFIG_BITREVERSE=y
1415# CONFIG_GENERIC_FIND_FIRST_BIT is not set
1416CONFIG_CRC_CCITT=m 1508CONFIG_CRC_CCITT=m
1417# CONFIG_CRC16 is not set 1509# CONFIG_CRC16 is not set
1510# CONFIG_CRC_T10DIF is not set
1418# CONFIG_CRC_ITU_T is not set 1511# CONFIG_CRC_ITU_T is not set
1419CONFIG_CRC32=y 1512CONFIG_CRC32=y
1420# CONFIG_CRC7 is not set 1513# CONFIG_CRC7 is not set
diff --git a/arch/blackfin/configs/BF527-EZKIT_defconfig b/arch/blackfin/configs/BF527-EZKIT_defconfig
index 4a2a660a6b35..f92668af00b0 100644
--- a/arch/blackfin/configs/BF527-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF527-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24.7 3# Linux kernel version: 2.6.28-rc2
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y 9CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y 10CONFIG_ZONE_DMA=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y 11CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
@@ -31,18 +30,16 @@ CONFIG_SYSVIPC_SYSCTL=y
31# CONFIG_POSIX_MQUEUE is not set 30# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
33# CONFIG_TASKSTATS is not set 32# CONFIG_TASKSTATS is not set
34# CONFIG_USER_NS is not set
35# CONFIG_PID_NS is not set
36# CONFIG_AUDIT is not set 33# CONFIG_AUDIT is not set
37CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
38CONFIG_IKCONFIG_PROC=y 35CONFIG_IKCONFIG_PROC=y
39CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
40# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
41CONFIG_FAIR_GROUP_SCHED=y 38# CONFIG_GROUP_SCHED is not set
42CONFIG_FAIR_USER_SCHED=y 39# CONFIG_SYSFS_DEPRECATED is not set
43# CONFIG_FAIR_CGROUP_SCHED is not set 40# CONFIG_SYSFS_DEPRECATED_V2 is not set
44CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 41# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set
46CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
47CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -51,26 +48,35 @@ CONFIG_EMBEDDED=y
51CONFIG_UID16=y 48CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 49CONFIG_SYSCTL_SYSCALL=y
53CONFIG_KALLSYMS=y 50CONFIG_KALLSYMS=y
51# CONFIG_KALLSYMS_ALL is not set
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 52# CONFIG_KALLSYMS_EXTRA_PASS is not set
55CONFIG_HOTPLUG=y 53CONFIG_HOTPLUG=y
56CONFIG_PRINTK=y 54CONFIG_PRINTK=y
57CONFIG_BUG=y 55CONFIG_BUG=y
58CONFIG_ELF_CORE=y 56# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y
59CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 59CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 60CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 61CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 62CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 64CONFIG_EVENTFD=y
65CONFIG_AIO=y
65CONFIG_VM_EVENT_COUNTERS=y 66CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
70# CONFIG_PROFILING is not set
71# CONFIG_MARKERS is not set
72CONFIG_HAVE_OPROFILE=y
73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
69CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
70CONFIG_RT_MUTEXES=y 75CONFIG_RT_MUTEXES=y
71CONFIG_TINY_SHMEM=y 76CONFIG_TINY_SHMEM=y
72CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
73CONFIG_MODULES=y 78CONFIG_MODULES=y
79# CONFIG_MODULE_FORCE_LOAD is not set
74CONFIG_MODULE_UNLOAD=y 80CONFIG_MODULE_UNLOAD=y
75# CONFIG_MODULE_FORCE_UNLOAD is not set 81# CONFIG_MODULE_FORCE_UNLOAD is not set
76# CONFIG_MODVERSIONS is not set 82# CONFIG_MODVERSIONS is not set
@@ -81,6 +87,7 @@ CONFIG_BLOCK=y
81# CONFIG_BLK_DEV_IO_TRACE is not set 87# CONFIG_BLK_DEV_IO_TRACE is not set
82# CONFIG_LSF is not set 88# CONFIG_LSF is not set
83# CONFIG_BLK_DEV_BSG is not set 89# CONFIG_BLK_DEV_BSG is not set
90# CONFIG_BLK_DEV_INTEGRITY is not set
84 91
85# 92#
86# IO Schedulers 93# IO Schedulers
@@ -94,9 +101,11 @@ CONFIG_DEFAULT_AS=y
94# CONFIG_DEFAULT_CFQ is not set 101# CONFIG_DEFAULT_CFQ is not set
95# CONFIG_DEFAULT_NOOP is not set 102# CONFIG_DEFAULT_NOOP is not set
96CONFIG_DEFAULT_IOSCHED="anticipatory" 103CONFIG_DEFAULT_IOSCHED="anticipatory"
104CONFIG_CLASSIC_RCU=y
97# CONFIG_PREEMPT_NONE is not set 105# CONFIG_PREEMPT_NONE is not set
98CONFIG_PREEMPT_VOLUNTARY=y 106CONFIG_PREEMPT_VOLUNTARY=y
99# CONFIG_PREEMPT is not set 107# CONFIG_PREEMPT is not set
108# CONFIG_FREEZER is not set
100 109
101# 110#
102# Blackfin Processor Options 111# Blackfin Processor Options
@@ -105,6 +114,10 @@ CONFIG_PREEMPT_VOLUNTARY=y
105# 114#
106# Processor and Board Settings 115# Processor and Board Settings
107# 116#
117# CONFIG_BF512 is not set
118# CONFIG_BF514 is not set
119# CONFIG_BF516 is not set
120# CONFIG_BF518 is not set
108# CONFIG_BF522 is not set 121# CONFIG_BF522 is not set
109# CONFIG_BF523 is not set 122# CONFIG_BF523 is not set
110# CONFIG_BF524 is not set 123# CONFIG_BF524 is not set
@@ -117,47 +130,27 @@ CONFIG_BF527=y
117# CONFIG_BF534 is not set 130# CONFIG_BF534 is not set
118# CONFIG_BF536 is not set 131# CONFIG_BF536 is not set
119# CONFIG_BF537 is not set 132# CONFIG_BF537 is not set
133# CONFIG_BF538 is not set
134# CONFIG_BF539 is not set
120# CONFIG_BF542 is not set 135# CONFIG_BF542 is not set
121# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
122# CONFIG_BF547 is not set 137# CONFIG_BF547 is not set
123# CONFIG_BF548 is not set 138# CONFIG_BF548 is not set
124# CONFIG_BF549 is not set 139# CONFIG_BF549 is not set
125# CONFIG_BF561 is not set 140# CONFIG_BF561 is not set
141CONFIG_BF_REV_MIN=0
142CONFIG_BF_REV_MAX=2
126CONFIG_BF_REV_0_0=y 143CONFIG_BF_REV_0_0=y
127# CONFIG_BF_REV_0_1 is not set 144# CONFIG_BF_REV_0_1 is not set
128# CONFIG_BF_REV_0_2 is not set 145# CONFIG_BF_REV_0_2 is not set
129# CONFIG_BF_REV_0_3 is not set 146# CONFIG_BF_REV_0_3 is not set
130# CONFIG_BF_REV_0_4 is not set 147# CONFIG_BF_REV_0_4 is not set
131# CONFIG_BF_REV_0_5 is not set 148# CONFIG_BF_REV_0_5 is not set
149# CONFIG_BF_REV_0_6 is not set
132# CONFIG_BF_REV_ANY is not set 150# CONFIG_BF_REV_ANY is not set
133# CONFIG_BF_REV_NONE is not set 151# CONFIG_BF_REV_NONE is not set
134CONFIG_BF52x=y 152CONFIG_BF52x=y
135CONFIG_MEM_MT48LC32M16A2TG_75=y 153CONFIG_MEM_MT48LC32M16A2TG_75=y
136CONFIG_BFIN527_EZKIT=y
137
138#
139# BF527 Specific Configuration
140#
141
142#
143# Alternative Multiplexing Scheme
144#
145# CONFIG_BF527_SPORT0_PORTF is not set
146CONFIG_BF527_SPORT0_PORTG=y
147CONFIG_BF527_SPORT0_TSCLK_PG10=y
148# CONFIG_BF527_SPORT0_TSCLK_PG14 is not set
149CONFIG_BF527_UART1_PORTF=y
150# CONFIG_BF527_UART1_PORTG is not set
151# CONFIG_BF527_NAND_D_PORTF is not set
152CONFIG_BF527_NAND_D_PORTH=y
153
154#
155# Interrupt Priority Assignment
156#
157
158#
159# Priority
160#
161CONFIG_IRQ_PLL_WAKEUP=7 154CONFIG_IRQ_PLL_WAKEUP=7
162CONFIG_IRQ_DMA0_ERROR=7 155CONFIG_IRQ_DMA0_ERROR=7
163CONFIG_IRQ_DMAR0_BLK=7 156CONFIG_IRQ_DMAR0_BLK=7
@@ -177,7 +170,6 @@ CONFIG_IRQ_SPORT0_TX=9
177CONFIG_IRQ_SPORT1_RX=9 170CONFIG_IRQ_SPORT1_RX=9
178CONFIG_IRQ_SPORT1_TX=9 171CONFIG_IRQ_SPORT1_TX=9
179CONFIG_IRQ_TWI=10 172CONFIG_IRQ_TWI=10
180CONFIG_IRQ_SPI=10
181CONFIG_IRQ_UART0_RX=10 173CONFIG_IRQ_UART0_RX=10
182CONFIG_IRQ_UART0_TX=10 174CONFIG_IRQ_UART0_TX=10
183CONFIG_IRQ_UART1_RX=10 175CONFIG_IRQ_UART1_RX=10
@@ -188,14 +180,14 @@ CONFIG_IRQ_MAC_RX=11
188CONFIG_IRQ_PORTH_INTA=11 180CONFIG_IRQ_PORTH_INTA=11
189CONFIG_IRQ_MAC_TX=11 181CONFIG_IRQ_MAC_TX=11
190CONFIG_IRQ_PORTH_INTB=11 182CONFIG_IRQ_PORTH_INTB=11
191CONFIG_IRQ_TMR0=12 183CONFIG_IRQ_TIMER0=8
192CONFIG_IRQ_TMR1=12 184CONFIG_IRQ_TIMER1=12
193CONFIG_IRQ_TMR2=12 185CONFIG_IRQ_TIMER2=12
194CONFIG_IRQ_TMR3=12 186CONFIG_IRQ_TIMER3=12
195CONFIG_IRQ_TMR4=12 187CONFIG_IRQ_TIMER4=12
196CONFIG_IRQ_TMR5=12 188CONFIG_IRQ_TIMER5=12
197CONFIG_IRQ_TMR6=12 189CONFIG_IRQ_TIMER6=12
198CONFIG_IRQ_TMR7=12 190CONFIG_IRQ_TIMER7=12
199CONFIG_IRQ_PORTG_INTA=12 191CONFIG_IRQ_PORTG_INTA=12
200CONFIG_IRQ_PORTG_INTB=12 192CONFIG_IRQ_PORTG_INTB=12
201CONFIG_IRQ_MEM_DMA0=13 193CONFIG_IRQ_MEM_DMA0=13
@@ -203,6 +195,34 @@ CONFIG_IRQ_MEM_DMA1=13
203CONFIG_IRQ_WATCH=13 195CONFIG_IRQ_WATCH=13
204CONFIG_IRQ_PORTF_INTA=13 196CONFIG_IRQ_PORTF_INTA=13
205CONFIG_IRQ_PORTF_INTB=13 197CONFIG_IRQ_PORTF_INTB=13
198CONFIG_BFIN527_EZKIT=y
199# CONFIG_BFIN527_BLUETECHNIX_CM is not set
200# CONFIG_BFIN526_EZBRD is not set
201
202#
203# BF527 Specific Configuration
204#
205
206#
207# Alternative Multiplexing Scheme
208#
209# CONFIG_BF527_SPORT0_PORTF is not set
210CONFIG_BF527_SPORT0_PORTG=y
211CONFIG_BF527_SPORT0_TSCLK_PG10=y
212# CONFIG_BF527_SPORT0_TSCLK_PG14 is not set
213CONFIG_BF527_UART1_PORTF=y
214# CONFIG_BF527_UART1_PORTG is not set
215# CONFIG_BF527_NAND_D_PORTF is not set
216CONFIG_BF527_NAND_D_PORTH=y
217
218#
219# Interrupt Priority Assignment
220#
221
222#
223# Priority
224#
225CONFIG_IRQ_SPI=10
206CONFIG_IRQ_SPI_ERROR=7 226CONFIG_IRQ_SPI_ERROR=7
207CONFIG_IRQ_NFC_ERROR=7 227CONFIG_IRQ_NFC_ERROR=7
208CONFIG_IRQ_HDMA_ERROR=7 228CONFIG_IRQ_HDMA_ERROR=7
@@ -224,7 +244,6 @@ CONFIG_BOOT_LOAD=0x1000
224# 244#
225CONFIG_CLKIN_HZ=25000000 245CONFIG_CLKIN_HZ=25000000
226# CONFIG_BFIN_KERNEL_CLOCK is not set 246# CONFIG_BFIN_KERNEL_CLOCK is not set
227CONFIG_MAX_MEM_SIZE=512
228CONFIG_MAX_VCO_HZ=600000000 247CONFIG_MAX_VCO_HZ=600000000
229CONFIG_MIN_VCO_HZ=50000000 248CONFIG_MIN_VCO_HZ=50000000
230CONFIG_MAX_SCLK_HZ=133333333 249CONFIG_MAX_SCLK_HZ=133333333
@@ -238,10 +257,10 @@ CONFIG_HZ_250=y
238# CONFIG_HZ_300 is not set 257# CONFIG_HZ_300 is not set
239# CONFIG_HZ_1000 is not set 258# CONFIG_HZ_1000 is not set
240CONFIG_HZ=250 259CONFIG_HZ=250
260# CONFIG_SCHED_HRTICK is not set
241CONFIG_GENERIC_TIME=y 261CONFIG_GENERIC_TIME=y
242CONFIG_GENERIC_CLOCKEVENTS=y 262CONFIG_GENERIC_CLOCKEVENTS=y
243# CONFIG_CYCLES_CLOCKSOURCE is not set 263# CONFIG_CYCLES_CLOCKSOURCE is not set
244# CONFIG_TICK_ONESHOT is not set
245# CONFIG_NO_HZ is not set 264# CONFIG_NO_HZ is not set
246# CONFIG_HIGH_RES_TIMERS is not set 265# CONFIG_HIGH_RES_TIMERS is not set
247CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 266CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
@@ -275,6 +294,12 @@ CONFIG_ACCESS_OK_L1=y
275CONFIG_CACHELINE_ALIGNED_L1=y 294CONFIG_CACHELINE_ALIGNED_L1=y
276# CONFIG_SYSCALL_TAB_L1 is not set 295# CONFIG_SYSCALL_TAB_L1 is not set
277# CONFIG_CPLB_SWITCH_TAB_L1 is not set 296# CONFIG_CPLB_SWITCH_TAB_L1 is not set
297CONFIG_APP_STACK_L1=y
298
299#
300# Speed Optimizations
301#
302CONFIG_BFIN_INS_LOWOVERHEAD=y
278CONFIG_RAMKERNEL=y 303CONFIG_RAMKERNEL=y
279# CONFIG_ROMKERNEL is not set 304# CONFIG_ROMKERNEL is not set
280CONFIG_SELECT_MEMORY_MODEL=y 305CONFIG_SELECT_MEMORY_MODEL=y
@@ -283,14 +308,13 @@ CONFIG_FLATMEM_MANUAL=y
283# CONFIG_SPARSEMEM_MANUAL is not set 308# CONFIG_SPARSEMEM_MANUAL is not set
284CONFIG_FLATMEM=y 309CONFIG_FLATMEM=y
285CONFIG_FLAT_NODE_MEM_MAP=y 310CONFIG_FLAT_NODE_MEM_MAP=y
286# CONFIG_SPARSEMEM_STATIC is not set 311CONFIG_PAGEFLAGS_EXTENDED=y
287# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
288CONFIG_SPLIT_PTLOCK_CPUS=4 312CONFIG_SPLIT_PTLOCK_CPUS=4
289# CONFIG_RESOURCES_64BIT is not set 313# CONFIG_RESOURCES_64BIT is not set
314# CONFIG_PHYS_ADDR_T_64BIT is not set
290CONFIG_ZONE_DMA_FLAG=1 315CONFIG_ZONE_DMA_FLAG=1
291CONFIG_VIRT_TO_BUS=y 316CONFIG_VIRT_TO_BUS=y
292CONFIG_BFIN_GPTIMERS=y 317CONFIG_BFIN_GPTIMERS=y
293CONFIG_BFIN_DMA_5XX=y
294# CONFIG_DMA_UNCACHED_4M is not set 318# CONFIG_DMA_UNCACHED_4M is not set
295# CONFIG_DMA_UNCACHED_2M is not set 319# CONFIG_DMA_UNCACHED_2M is not set
296CONFIG_DMA_UNCACHED_1M=y 320CONFIG_DMA_UNCACHED_1M=y
@@ -305,7 +329,6 @@ CONFIG_BFIN_DCACHE=y
305# CONFIG_BFIN_ICACHE_LOCK is not set 329# CONFIG_BFIN_ICACHE_LOCK is not set
306# CONFIG_BFIN_WB is not set 330# CONFIG_BFIN_WB is not set
307CONFIG_BFIN_WT=y 331CONFIG_BFIN_WT=y
308CONFIG_L1_MAX_PIECE=16
309# CONFIG_MPU is not set 332# CONFIG_MPU is not set
310 333
311# 334#
@@ -334,7 +357,6 @@ CONFIG_BANK_3=0xFFC0
334# 357#
335# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 358# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
336# 359#
337# CONFIG_PCI is not set
338# CONFIG_ARCH_SUPPORTS_MSI is not set 360# CONFIG_ARCH_SUPPORTS_MSI is not set
339# CONFIG_PCCARD is not set 361# CONFIG_PCCARD is not set
340 362
@@ -345,23 +367,20 @@ CONFIG_BINFMT_ELF_FDPIC=y
345CONFIG_BINFMT_FLAT=y 367CONFIG_BINFMT_FLAT=y
346CONFIG_BINFMT_ZFLAT=y 368CONFIG_BINFMT_ZFLAT=y
347# CONFIG_BINFMT_SHARED_FLAT is not set 369# CONFIG_BINFMT_SHARED_FLAT is not set
370# CONFIG_HAVE_AOUT is not set
348# CONFIG_BINFMT_MISC is not set 371# CONFIG_BINFMT_MISC is not set
349 372
350# 373#
351# Power management options 374# Power management options
352# 375#
353# CONFIG_PM is not set 376# CONFIG_PM is not set
354CONFIG_SUSPEND_UP_POSSIBLE=y 377CONFIG_ARCH_SUSPEND_POSSIBLE=y
355# CONFIG_PM_WAKEUP_BY_GPIO is not set 378# CONFIG_PM_WAKEUP_BY_GPIO is not set
356 379
357# 380#
358# CPU Frequency scaling 381# CPU Frequency scaling
359# 382#
360# CONFIG_CPU_FREQ is not set 383# CONFIG_CPU_FREQ is not set
361
362#
363# Networking
364#
365CONFIG_NET=y 384CONFIG_NET=y
366 385
367# 386#
@@ -374,6 +393,7 @@ CONFIG_XFRM=y
374# CONFIG_XFRM_USER is not set 393# CONFIG_XFRM_USER is not set
375# CONFIG_XFRM_SUB_POLICY is not set 394# CONFIG_XFRM_SUB_POLICY is not set
376# CONFIG_XFRM_MIGRATE is not set 395# CONFIG_XFRM_MIGRATE is not set
396# CONFIG_XFRM_STATISTICS is not set
377# CONFIG_NET_KEY is not set 397# CONFIG_NET_KEY is not set
378CONFIG_INET=y 398CONFIG_INET=y
379# CONFIG_IP_MULTICAST is not set 399# CONFIG_IP_MULTICAST is not set
@@ -403,8 +423,6 @@ CONFIG_TCP_CONG_CUBIC=y
403CONFIG_DEFAULT_TCP_CONG="cubic" 423CONFIG_DEFAULT_TCP_CONG="cubic"
404# CONFIG_TCP_MD5SIG is not set 424# CONFIG_TCP_MD5SIG is not set
405# CONFIG_IPV6 is not set 425# CONFIG_IPV6 is not set
406# CONFIG_INET6_XFRM_TUNNEL is not set
407# CONFIG_INET6_TUNNEL is not set
408# CONFIG_NETLABEL is not set 426# CONFIG_NETLABEL is not set
409# CONFIG_NETWORK_SECMARK is not set 427# CONFIG_NETWORK_SECMARK is not set
410# CONFIG_NETFILTER is not set 428# CONFIG_NETFILTER is not set
@@ -413,6 +431,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
413# CONFIG_TIPC is not set 431# CONFIG_TIPC is not set
414# CONFIG_ATM is not set 432# CONFIG_ATM is not set
415# CONFIG_BRIDGE is not set 433# CONFIG_BRIDGE is not set
434# CONFIG_NET_DSA is not set
416# CONFIG_VLAN_8021Q is not set 435# CONFIG_VLAN_8021Q is not set
417# CONFIG_DECNET is not set 436# CONFIG_DECNET is not set
418# CONFIG_LLC2 is not set 437# CONFIG_LLC2 is not set
@@ -429,6 +448,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
429# 448#
430# CONFIG_NET_PKTGEN is not set 449# CONFIG_NET_PKTGEN is not set
431# CONFIG_HAMRADIO is not set 450# CONFIG_HAMRADIO is not set
451# CONFIG_CAN is not set
432CONFIG_IRDA=m 452CONFIG_IRDA=m
433 453
434# 454#
@@ -467,15 +487,6 @@ CONFIG_SIR_BFIN_DMA=y
467# CONFIG_KS959_DONGLE is not set 487# CONFIG_KS959_DONGLE is not set
468 488
469# 489#
470# Old SIR device drivers
471#
472# CONFIG_IRPORT_SIR is not set
473
474#
475# Old Serial dongle support
476#
477
478#
479# FIR device drivers 490# FIR device drivers
480# 491#
481# CONFIG_USB_IRDA is not set 492# CONFIG_USB_IRDA is not set
@@ -483,11 +494,10 @@ CONFIG_SIR_BFIN_DMA=y
483# CONFIG_MCS_FIR is not set 494# CONFIG_MCS_FIR is not set
484# CONFIG_BT is not set 495# CONFIG_BT is not set
485# CONFIG_AF_RXRPC is not set 496# CONFIG_AF_RXRPC is not set
486 497# CONFIG_PHONET is not set
487# 498CONFIG_WIRELESS=y
488# Wireless
489#
490# CONFIG_CFG80211 is not set 499# CONFIG_CFG80211 is not set
500CONFIG_WIRELESS_OLD_REGULATORY=y
491# CONFIG_WIRELESS_EXT is not set 501# CONFIG_WIRELESS_EXT is not set
492# CONFIG_MAC80211 is not set 502# CONFIG_MAC80211 is not set
493# CONFIG_IEEE80211 is not set 503# CONFIG_IEEE80211 is not set
@@ -505,6 +515,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
505CONFIG_STANDALONE=y 515CONFIG_STANDALONE=y
506CONFIG_PREVENT_FIRMWARE_BUILD=y 516CONFIG_PREVENT_FIRMWARE_BUILD=y
507# CONFIG_FW_LOADER is not set 517# CONFIG_FW_LOADER is not set
518# CONFIG_DEBUG_DRIVER is not set
519# CONFIG_DEBUG_DEVRES is not set
508# CONFIG_SYS_HYPERVISOR is not set 520# CONFIG_SYS_HYPERVISOR is not set
509# CONFIG_CONNECTOR is not set 521# CONFIG_CONNECTOR is not set
510CONFIG_MTD=y 522CONFIG_MTD=y
@@ -513,6 +525,7 @@ CONFIG_MTD=y
513CONFIG_MTD_PARTITIONS=y 525CONFIG_MTD_PARTITIONS=y
514# CONFIG_MTD_REDBOOT_PARTS is not set 526# CONFIG_MTD_REDBOOT_PARTS is not set
515# CONFIG_MTD_CMDLINE_PARTS is not set 527# CONFIG_MTD_CMDLINE_PARTS is not set
528# CONFIG_MTD_AR7_PARTS is not set
516 529
517# 530#
518# User Modules And Translation Layers 531# User Modules And Translation Layers
@@ -556,6 +569,7 @@ CONFIG_MTD_ROM=m
556# 569#
557CONFIG_MTD_COMPLEX_MAPPINGS=y 570CONFIG_MTD_COMPLEX_MAPPINGS=y
558# CONFIG_MTD_PHYSMAP is not set 571# CONFIG_MTD_PHYSMAP is not set
572# CONFIG_MTD_GPIO_ADDR is not set
559# CONFIG_MTD_UCLINUX is not set 573# CONFIG_MTD_UCLINUX is not set
560# CONFIG_MTD_PLATRAM is not set 574# CONFIG_MTD_PLATRAM is not set
561 575
@@ -563,7 +577,8 @@ CONFIG_MTD_COMPLEX_MAPPINGS=y
563# Self-contained MTD device drivers 577# Self-contained MTD device drivers
564# 578#
565# CONFIG_MTD_DATAFLASH is not set 579# CONFIG_MTD_DATAFLASH is not set
566# CONFIG_MTD_M25P80 is not set 580CONFIG_MTD_M25P80=y
581CONFIG_M25PXX_USE_FAST_READ=y
567# CONFIG_MTD_SLRAM is not set 582# CONFIG_MTD_SLRAM is not set
568# CONFIG_MTD_PHRAM is not set 583# CONFIG_MTD_PHRAM is not set
569# CONFIG_MTD_MTDRAM is not set 584# CONFIG_MTD_MTDRAM is not set
@@ -605,11 +620,14 @@ CONFIG_BLK_DEV=y
605CONFIG_BLK_DEV_RAM=y 620CONFIG_BLK_DEV_RAM=y
606CONFIG_BLK_DEV_RAM_COUNT=16 621CONFIG_BLK_DEV_RAM_COUNT=16
607CONFIG_BLK_DEV_RAM_SIZE=4096 622CONFIG_BLK_DEV_RAM_SIZE=4096
608CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 623# CONFIG_BLK_DEV_XIP is not set
609# CONFIG_CDROM_PKTCDVD is not set 624# CONFIG_CDROM_PKTCDVD is not set
610# CONFIG_ATA_OVER_ETH is not set 625# CONFIG_ATA_OVER_ETH is not set
626# CONFIG_BLK_DEV_HD is not set
611CONFIG_MISC_DEVICES=y 627CONFIG_MISC_DEVICES=y
612# CONFIG_EEPROM_93CX6 is not set 628# CONFIG_EEPROM_93CX6 is not set
629# CONFIG_ENCLOSURE_SERVICES is not set
630CONFIG_HAVE_IDE=y
613# CONFIG_IDE is not set 631# CONFIG_IDE is not set
614 632
615# 633#
@@ -622,7 +640,6 @@ CONFIG_MISC_DEVICES=y
622# CONFIG_ATA is not set 640# CONFIG_ATA is not set
623# CONFIG_MD is not set 641# CONFIG_MD is not set
624CONFIG_NETDEVICES=y 642CONFIG_NETDEVICES=y
625# CONFIG_NETDEVICES_MULTIQUEUE is not set
626# CONFIG_DUMMY is not set 643# CONFIG_DUMMY is not set
627# CONFIG_BONDING is not set 644# CONFIG_BONDING is not set
628# CONFIG_MACVLAN is not set 645# CONFIG_MACVLAN is not set
@@ -643,6 +660,7 @@ CONFIG_PHYLIB=y
643# CONFIG_SMSC_PHY is not set 660# CONFIG_SMSC_PHY is not set
644# CONFIG_BROADCOM_PHY is not set 661# CONFIG_BROADCOM_PHY is not set
645# CONFIG_ICPLUS_PHY is not set 662# CONFIG_ICPLUS_PHY is not set
663# CONFIG_REALTEK_PHY is not set
646# CONFIG_FIXED_PHY is not set 664# CONFIG_FIXED_PHY is not set
647# CONFIG_MDIO_BITBANG is not set 665# CONFIG_MDIO_BITBANG is not set
648CONFIG_NET_ETHERNET=y 666CONFIG_NET_ETHERNET=y
@@ -655,11 +673,14 @@ CONFIG_BFIN_MAC_RMII=y
655# CONFIG_SMC91X is not set 673# CONFIG_SMC91X is not set
656# CONFIG_SMSC911X is not set 674# CONFIG_SMSC911X is not set
657# CONFIG_DM9000 is not set 675# CONFIG_DM9000 is not set
676# CONFIG_ENC28J60 is not set
658# CONFIG_IBM_NEW_EMAC_ZMII is not set 677# CONFIG_IBM_NEW_EMAC_ZMII is not set
659# CONFIG_IBM_NEW_EMAC_RGMII is not set 678# CONFIG_IBM_NEW_EMAC_RGMII is not set
660# CONFIG_IBM_NEW_EMAC_TAH is not set 679# CONFIG_IBM_NEW_EMAC_TAH is not set
661# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 680# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
662# CONFIG_B44 is not set 681# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
682# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
683# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
663CONFIG_NETDEV_1000=y 684CONFIG_NETDEV_1000=y
664# CONFIG_AX88180 is not set 685# CONFIG_AX88180 is not set
665CONFIG_NETDEV_10000=y 686CONFIG_NETDEV_10000=y
@@ -669,6 +690,7 @@ CONFIG_NETDEV_10000=y
669# 690#
670# CONFIG_WLAN_PRE80211 is not set 691# CONFIG_WLAN_PRE80211 is not set
671# CONFIG_WLAN_80211 is not set 692# CONFIG_WLAN_80211 is not set
693# CONFIG_IWLWIFI_LEDS is not set
672 694
673# 695#
674# USB Network Adapters 696# USB Network Adapters
@@ -681,7 +703,6 @@ CONFIG_NETDEV_10000=y
681# CONFIG_WAN is not set 703# CONFIG_WAN is not set
682# CONFIG_PPP is not set 704# CONFIG_PPP is not set
683# CONFIG_SLIP is not set 705# CONFIG_SLIP is not set
684# CONFIG_SHAPER is not set
685# CONFIG_NETCONSOLE is not set 706# CONFIG_NETCONSOLE is not set
686# CONFIG_NETPOLL is not set 707# CONFIG_NETPOLL is not set
687# CONFIG_NET_POLL_CONTROLLER is not set 708# CONFIG_NET_POLL_CONTROLLER is not set
@@ -692,7 +713,7 @@ CONFIG_NETDEV_10000=y
692# Input device support 713# Input device support
693# 714#
694CONFIG_INPUT=y 715CONFIG_INPUT=y
695# CONFIG_INPUT_FF_MEMLESS is not set 716CONFIG_INPUT_FF_MEMLESS=m
696# CONFIG_INPUT_POLLDEV is not set 717# CONFIG_INPUT_POLLDEV is not set
697 718
698# 719#
@@ -717,8 +738,9 @@ CONFIG_INPUT_MISC=y
717# CONFIG_INPUT_KEYSPAN_REMOTE is not set 738# CONFIG_INPUT_KEYSPAN_REMOTE is not set
718# CONFIG_INPUT_POWERMATE is not set 739# CONFIG_INPUT_POWERMATE is not set
719# CONFIG_INPUT_YEALINK is not set 740# CONFIG_INPUT_YEALINK is not set
741# CONFIG_INPUT_CM109 is not set
720# CONFIG_INPUT_UINPUT is not set 742# CONFIG_INPUT_UINPUT is not set
721# CONFIG_TWI_KEYPAD is not set 743# CONFIG_CONFIG_INPUT_PCF8574 is not set
722 744
723# 745#
724# Hardware I/O ports 746# Hardware I/O ports
@@ -734,16 +756,18 @@ CONFIG_INPUT_MISC=y
734# CONFIG_BF5xx_PPIFCD is not set 756# CONFIG_BF5xx_PPIFCD is not set
735# CONFIG_BFIN_SIMPLE_TIMER is not set 757# CONFIG_BFIN_SIMPLE_TIMER is not set
736# CONFIG_BF5xx_PPI is not set 758# CONFIG_BF5xx_PPI is not set
737CONFIG_BFIN_OTP=y
738# CONFIG_BFIN_OTP_WRITE_ENABLE is not set
739# CONFIG_BFIN_SPORT is not set 759# CONFIG_BFIN_SPORT is not set
740# CONFIG_BFIN_TIMER_LATENCY is not set 760# CONFIG_BFIN_TIMER_LATENCY is not set
741# CONFIG_TWI_LCD is not set 761# CONFIG_TWI_LCD is not set
762CONFIG_BFIN_DMA_INTERFACE=m
742CONFIG_SIMPLE_GPIO=m 763CONFIG_SIMPLE_GPIO=m
743CONFIG_VT=y 764CONFIG_VT=y
765CONFIG_CONSOLE_TRANSLATIONS=y
744CONFIG_VT_CONSOLE=y 766CONFIG_VT_CONSOLE=y
745CONFIG_HW_CONSOLE=y 767CONFIG_HW_CONSOLE=y
746# CONFIG_VT_HW_CONSOLE_BINDING is not set 768# CONFIG_VT_HW_CONSOLE_BINDING is not set
769# CONFIG_DEVKMEM is not set
770# CONFIG_BFIN_JTAG_COMM is not set
747# CONFIG_SERIAL_NONSTANDARD is not set 771# CONFIG_SERIAL_NONSTANDARD is not set
748 772
749# 773#
@@ -766,6 +790,8 @@ CONFIG_SERIAL_CORE_CONSOLE=y
766# CONFIG_SERIAL_BFIN_SPORT is not set 790# CONFIG_SERIAL_BFIN_SPORT is not set
767CONFIG_UNIX98_PTYS=y 791CONFIG_UNIX98_PTYS=y
768# CONFIG_LEGACY_PTYS is not set 792# CONFIG_LEGACY_PTYS is not set
793CONFIG_BFIN_OTP=y
794# CONFIG_BFIN_OTP_WRITE_ENABLE is not set
769 795
770# 796#
771# CAN, the car bus and industrial fieldbus 797# CAN, the car bus and industrial fieldbus
@@ -773,44 +799,49 @@ CONFIG_UNIX98_PTYS=y
773# CONFIG_CAN4LINUX is not set 799# CONFIG_CAN4LINUX is not set
774# CONFIG_IPMI_HANDLER is not set 800# CONFIG_IPMI_HANDLER is not set
775# CONFIG_HW_RANDOM is not set 801# CONFIG_HW_RANDOM is not set
776# CONFIG_GEN_RTC is not set
777# CONFIG_R3964 is not set 802# CONFIG_R3964 is not set
778# CONFIG_RAW_DRIVER is not set 803# CONFIG_RAW_DRIVER is not set
779# CONFIG_TCG_TPM is not set 804# CONFIG_TCG_TPM is not set
780CONFIG_I2C=y 805CONFIG_I2C=y
781CONFIG_I2C_BOARDINFO=y 806CONFIG_I2C_BOARDINFO=y
782CONFIG_I2C_CHARDEV=m 807CONFIG_I2C_CHARDEV=m
808CONFIG_I2C_HELPER_AUTO=y
783 809
784# 810#
785# I2C Algorithms 811# I2C Hardware Bus support
786# 812#
787# CONFIG_I2C_ALGOBIT is not set
788# CONFIG_I2C_ALGOPCF is not set
789# CONFIG_I2C_ALGOPCA is not set
790 813
791# 814#
792# I2C Hardware Bus support 815# I2C system bus drivers (mostly embedded / system-on-chip)
793# 816#
794CONFIG_I2C_BLACKFIN_TWI=m 817CONFIG_I2C_BLACKFIN_TWI=m
795CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 818CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
796# CONFIG_I2C_GPIO is not set 819# CONFIG_I2C_GPIO is not set
797# CONFIG_I2C_OCORES is not set 820# CONFIG_I2C_OCORES is not set
798# CONFIG_I2C_PARPORT_LIGHT is not set
799# CONFIG_I2C_SIMTEC is not set 821# CONFIG_I2C_SIMTEC is not set
822
823#
824# External I2C/SMBus adapter drivers
825#
826# CONFIG_I2C_PARPORT_LIGHT is not set
800# CONFIG_I2C_TAOS_EVM is not set 827# CONFIG_I2C_TAOS_EVM is not set
801# CONFIG_I2C_STUB is not set
802# CONFIG_I2C_TINY_USB is not set 828# CONFIG_I2C_TINY_USB is not set
803 829
804# 830#
831# Other I2C/SMBus bus drivers
832#
833# CONFIG_I2C_PCA_PLATFORM is not set
834# CONFIG_I2C_STUB is not set
835
836#
805# Miscellaneous I2C Chip support 837# Miscellaneous I2C Chip support
806# 838#
807# CONFIG_SENSORS_DS1337 is not set
808# CONFIG_SENSORS_DS1374 is not set
809# CONFIG_DS1682 is not set 839# CONFIG_DS1682 is not set
840# CONFIG_AT24 is not set
810# CONFIG_SENSORS_AD5252 is not set 841# CONFIG_SENSORS_AD5252 is not set
811# CONFIG_SENSORS_EEPROM is not set 842# CONFIG_SENSORS_EEPROM is not set
812# CONFIG_SENSORS_PCF8574 is not set 843# CONFIG_SENSORS_PCF8574 is not set
813# CONFIG_SENSORS_PCF8575 is not set 844# CONFIG_PCF8575 is not set
814# CONFIG_SENSORS_PCA9539 is not set 845# CONFIG_SENSORS_PCA9539 is not set
815# CONFIG_SENSORS_PCF8591 is not set 846# CONFIG_SENSORS_PCF8591 is not set
816# CONFIG_SENSORS_MAX6875 is not set 847# CONFIG_SENSORS_MAX6875 is not set
@@ -819,17 +850,15 @@ CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50
819# CONFIG_I2C_DEBUG_ALGO is not set 850# CONFIG_I2C_DEBUG_ALGO is not set
820# CONFIG_I2C_DEBUG_BUS is not set 851# CONFIG_I2C_DEBUG_BUS is not set
821# CONFIG_I2C_DEBUG_CHIP is not set 852# CONFIG_I2C_DEBUG_CHIP is not set
822
823#
824# SPI support
825#
826CONFIG_SPI=y 853CONFIG_SPI=y
854# CONFIG_SPI_DEBUG is not set
827CONFIG_SPI_MASTER=y 855CONFIG_SPI_MASTER=y
828 856
829# 857#
830# SPI Master Controller Drivers 858# SPI Master Controller Drivers
831# 859#
832CONFIG_SPI_BFIN=y 860CONFIG_SPI_BFIN=y
861# CONFIG_SPI_BFIN_LOCK is not set
833# CONFIG_SPI_BITBANG is not set 862# CONFIG_SPI_BITBANG is not set
834 863
835# 864#
@@ -838,11 +867,15 @@ CONFIG_SPI_BFIN=y
838# CONFIG_SPI_AT25 is not set 867# CONFIG_SPI_AT25 is not set
839# CONFIG_SPI_SPIDEV is not set 868# CONFIG_SPI_SPIDEV is not set
840# CONFIG_SPI_TLE62X0 is not set 869# CONFIG_SPI_TLE62X0 is not set
870CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
871# CONFIG_GPIOLIB is not set
841# CONFIG_W1 is not set 872# CONFIG_W1 is not set
842# CONFIG_POWER_SUPPLY is not set 873# CONFIG_POWER_SUPPLY is not set
843CONFIG_HWMON=y 874CONFIG_HWMON=y
844# CONFIG_HWMON_VID is not set 875# CONFIG_HWMON_VID is not set
876# CONFIG_SENSORS_AD7414 is not set
845# CONFIG_SENSORS_AD7418 is not set 877# CONFIG_SENSORS_AD7418 is not set
878# CONFIG_SENSORS_ADCXX is not set
846# CONFIG_SENSORS_ADM1021 is not set 879# CONFIG_SENSORS_ADM1021 is not set
847# CONFIG_SENSORS_ADM1025 is not set 880# CONFIG_SENSORS_ADM1025 is not set
848# CONFIG_SENSORS_ADM1026 is not set 881# CONFIG_SENSORS_ADM1026 is not set
@@ -850,6 +883,7 @@ CONFIG_HWMON=y
850# CONFIG_SENSORS_ADM1031 is not set 883# CONFIG_SENSORS_ADM1031 is not set
851# CONFIG_SENSORS_ADM9240 is not set 884# CONFIG_SENSORS_ADM9240 is not set
852# CONFIG_SENSORS_ADT7470 is not set 885# CONFIG_SENSORS_ADT7470 is not set
886# CONFIG_SENSORS_ADT7473 is not set
853# CONFIG_SENSORS_ATXP1 is not set 887# CONFIG_SENSORS_ATXP1 is not set
854# CONFIG_SENSORS_DS1621 is not set 888# CONFIG_SENSORS_DS1621 is not set
855# CONFIG_SENSORS_F71805F is not set 889# CONFIG_SENSORS_F71805F is not set
@@ -870,6 +904,7 @@ CONFIG_HWMON=y
870# CONFIG_SENSORS_LM90 is not set 904# CONFIG_SENSORS_LM90 is not set
871# CONFIG_SENSORS_LM92 is not set 905# CONFIG_SENSORS_LM92 is not set
872# CONFIG_SENSORS_LM93 is not set 906# CONFIG_SENSORS_LM93 is not set
907# CONFIG_SENSORS_MAX1111 is not set
873# CONFIG_SENSORS_MAX1619 is not set 908# CONFIG_SENSORS_MAX1619 is not set
874# CONFIG_SENSORS_MAX6650 is not set 909# CONFIG_SENSORS_MAX6650 is not set
875# CONFIG_SENSORS_PC87360 is not set 910# CONFIG_SENSORS_PC87360 is not set
@@ -878,6 +913,7 @@ CONFIG_HWMON=y
878# CONFIG_SENSORS_SMSC47M1 is not set 913# CONFIG_SENSORS_SMSC47M1 is not set
879# CONFIG_SENSORS_SMSC47M192 is not set 914# CONFIG_SENSORS_SMSC47M192 is not set
880# CONFIG_SENSORS_SMSC47B397 is not set 915# CONFIG_SENSORS_SMSC47B397 is not set
916# CONFIG_SENSORS_ADS7828 is not set
881# CONFIG_SENSORS_THMC50 is not set 917# CONFIG_SENSORS_THMC50 is not set
882# CONFIG_SENSORS_VT1211 is not set 918# CONFIG_SENSORS_VT1211 is not set
883# CONFIG_SENSORS_W83781D is not set 919# CONFIG_SENSORS_W83781D is not set
@@ -885,9 +921,12 @@ CONFIG_HWMON=y
885# CONFIG_SENSORS_W83792D is not set 921# CONFIG_SENSORS_W83792D is not set
886# CONFIG_SENSORS_W83793 is not set 922# CONFIG_SENSORS_W83793 is not set
887# CONFIG_SENSORS_W83L785TS is not set 923# CONFIG_SENSORS_W83L785TS is not set
924# CONFIG_SENSORS_W83L786NG is not set
888# CONFIG_SENSORS_W83627HF is not set 925# CONFIG_SENSORS_W83627HF is not set
889# CONFIG_SENSORS_W83627EHF is not set 926# CONFIG_SENSORS_W83627EHF is not set
890# CONFIG_HWMON_DEBUG_CHIP is not set 927# CONFIG_HWMON_DEBUG_CHIP is not set
928# CONFIG_THERMAL is not set
929# CONFIG_THERMAL_HWMON is not set
891CONFIG_WATCHDOG=y 930CONFIG_WATCHDOG=y
892# CONFIG_WATCHDOG_NOWAYOUT is not set 931# CONFIG_WATCHDOG_NOWAYOUT is not set
893 932
@@ -903,21 +942,29 @@ CONFIG_BFIN_WDT=y
903# CONFIG_USBPCWATCHDOG is not set 942# CONFIG_USBPCWATCHDOG is not set
904 943
905# 944#
906# Sonics Silicon Backplane
907#
908CONFIG_SSB_POSSIBLE=y
909# CONFIG_SSB is not set
910
911#
912# Multifunction device drivers 945# Multifunction device drivers
913# 946#
947# CONFIG_MFD_CORE is not set
914# CONFIG_MFD_SM501 is not set 948# CONFIG_MFD_SM501 is not set
949# CONFIG_HTC_PASIC3 is not set
950# CONFIG_MFD_TMIO is not set
951# CONFIG_MFD_WM8400 is not set
952# CONFIG_MFD_WM8350_I2C is not set
915 953
916# 954#
917# Multimedia devices 955# Multimedia devices
918# 956#
957
958#
959# Multimedia core support
960#
919# CONFIG_VIDEO_DEV is not set 961# CONFIG_VIDEO_DEV is not set
920# CONFIG_DVB_CORE is not set 962# CONFIG_DVB_CORE is not set
963# CONFIG_VIDEO_MEDIA is not set
964
965#
966# Multimedia drivers
967#
921# CONFIG_DAB is not set 968# CONFIG_DAB is not set
922 969
923# 970#
@@ -928,6 +975,7 @@ CONFIG_SSB_POSSIBLE=y
928CONFIG_FB=y 975CONFIG_FB=y
929# CONFIG_FIRMWARE_EDID is not set 976# CONFIG_FIRMWARE_EDID is not set
930# CONFIG_FB_DDC is not set 977# CONFIG_FB_DDC is not set
978# CONFIG_FB_BOOT_VESA_SUPPORT is not set
931CONFIG_FB_CFB_FILLRECT=y 979CONFIG_FB_CFB_FILLRECT=y
932CONFIG_FB_CFB_COPYAREA=y 980CONFIG_FB_CFB_COPYAREA=y
933CONFIG_FB_CFB_IMAGEBLIT=y 981CONFIG_FB_CFB_IMAGEBLIT=y
@@ -935,8 +983,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
935# CONFIG_FB_SYS_FILLRECT is not set 983# CONFIG_FB_SYS_FILLRECT is not set
936# CONFIG_FB_SYS_COPYAREA is not set 984# CONFIG_FB_SYS_COPYAREA is not set
937# CONFIG_FB_SYS_IMAGEBLIT is not set 985# CONFIG_FB_SYS_IMAGEBLIT is not set
986# CONFIG_FB_FOREIGN_ENDIAN is not set
938# CONFIG_FB_SYS_FOPS is not set 987# CONFIG_FB_SYS_FOPS is not set
939CONFIG_FB_DEFERRED_IO=y
940# CONFIG_FB_SVGALIB is not set 988# CONFIG_FB_SVGALIB is not set
941# CONFIG_FB_MACMODES is not set 989# CONFIG_FB_MACMODES is not set
942# CONFIG_FB_BACKLIGHT is not set 990# CONFIG_FB_BACKLIGHT is not set
@@ -947,12 +995,18 @@ CONFIG_FB_DEFERRED_IO=y
947# Frame buffer hardware drivers 995# Frame buffer hardware drivers
948# 996#
949CONFIG_FB_BFIN_T350MCQB=y 997CONFIG_FB_BFIN_T350MCQB=y
998# CONFIG_FB_BFIN_LQ035Q1 is not set
950# CONFIG_FB_BFIN_7393 is not set 999# CONFIG_FB_BFIN_7393 is not set
951# CONFIG_FB_S1D13XXX is not set 1000# CONFIG_FB_S1D13XXX is not set
952# CONFIG_FB_VIRTUAL is not set 1001# CONFIG_FB_VIRTUAL is not set
1002# CONFIG_FB_METRONOME is not set
953CONFIG_BACKLIGHT_LCD_SUPPORT=y 1003CONFIG_BACKLIGHT_LCD_SUPPORT=y
954CONFIG_LCD_CLASS_DEVICE=m 1004CONFIG_LCD_CLASS_DEVICE=m
955CONFIG_LCD_LTV350QV=m 1005CONFIG_LCD_LTV350QV=m
1006# CONFIG_LCD_ILI9320 is not set
1007# CONFIG_LCD_TDO24M is not set
1008# CONFIG_LCD_VGG2432A4 is not set
1009# CONFIG_LCD_PLATFORM is not set
956CONFIG_BACKLIGHT_CLASS_DEVICE=m 1010CONFIG_BACKLIGHT_CLASS_DEVICE=m
957# CONFIG_BACKLIGHT_CORGI is not set 1011# CONFIG_BACKLIGHT_CORGI is not set
958 1012
@@ -977,15 +1031,8 @@ CONFIG_LOGO=y
977# CONFIG_LOGO_LINUX_CLUT224 is not set 1031# CONFIG_LOGO_LINUX_CLUT224 is not set
978# CONFIG_LOGO_BLACKFIN_VGA16 is not set 1032# CONFIG_LOGO_BLACKFIN_VGA16 is not set
979CONFIG_LOGO_BLACKFIN_CLUT224=y 1033CONFIG_LOGO_BLACKFIN_CLUT224=y
980
981#
982# Sound
983#
984CONFIG_SOUND=m 1034CONFIG_SOUND=m
985 1035# CONFIG_SOUND_OSS_CORE is not set
986#
987# Advanced Linux Sound Architecture
988#
989CONFIG_SND=m 1036CONFIG_SND=m
990CONFIG_SND_TIMER=m 1037CONFIG_SND_TIMER=m
991CONFIG_SND_PCM=m 1038CONFIG_SND_PCM=m
@@ -997,62 +1044,38 @@ CONFIG_SND_SUPPORT_OLD_API=y
997CONFIG_SND_VERBOSE_PROCFS=y 1044CONFIG_SND_VERBOSE_PROCFS=y
998# CONFIG_SND_VERBOSE_PRINTK is not set 1045# CONFIG_SND_VERBOSE_PRINTK is not set
999# CONFIG_SND_DEBUG is not set 1046# CONFIG_SND_DEBUG is not set
1000 1047CONFIG_SND_DRIVERS=y
1001#
1002# Generic devices
1003#
1004# CONFIG_SND_DUMMY is not set 1048# CONFIG_SND_DUMMY is not set
1005# CONFIG_SND_MTPAV is not set 1049# CONFIG_SND_MTPAV is not set
1006# CONFIG_SND_SERIAL_U16550 is not set 1050# CONFIG_SND_SERIAL_U16550 is not set
1007# CONFIG_SND_MPU401 is not set 1051# CONFIG_SND_MPU401 is not set
1008 1052CONFIG_SND_SPI=y
1009#
1010# SPI devices
1011#
1012 1053
1013# 1054#
1014# ALSA Blackfin devices 1055# ALSA Blackfin devices
1015# 1056#
1016# CONFIG_SND_BLACKFIN_AD1836 is not set 1057# CONFIG_SND_BLACKFIN_AD1836 is not set
1017# CONFIG_SND_BLACKFIN_AD1836_TDM is not set
1018# CONFIG_SND_BLACKFIN_AD1836_I2S is not set
1019# CONFIG_SND_BLACKFIN_AD1836_MULSUB is not set
1020# CONFIG_SND_BLACKFIN_AD1836_5P1 is not set
1021# CONFIG_SND_BFIN_AD73311 is not set
1022# CONFIG_SND_BFIN_AD73322 is not set 1058# CONFIG_SND_BFIN_AD73322 is not set
1023 1059CONFIG_SND_USB=y
1024#
1025# USB devices
1026#
1027# CONFIG_SND_USB_AUDIO is not set 1060# CONFIG_SND_USB_AUDIO is not set
1028# CONFIG_SND_USB_CAIAQ is not set 1061# CONFIG_SND_USB_CAIAQ is not set
1029
1030#
1031# System on Chip audio support
1032#
1033CONFIG_SND_SOC_AC97_BUS=y
1034CONFIG_SND_SOC=m 1062CONFIG_SND_SOC=m
1035CONFIG_SND_BF5XX_SOC=m 1063CONFIG_SND_SOC_AC97_BUS=y
1036CONFIG_SND_MMAP_SUPPORT=y 1064CONFIG_SND_BF5XX_I2S=m
1065CONFIG_SND_BF5XX_SOC_SSM2602=m
1066# CONFIG_SND_BF5XX_SOC_AD73311 is not set
1067CONFIG_SND_BF5XX_AC97=m
1068CONFIG_SND_BF5XX_MMAP_SUPPORT=y
1069# CONFIG_SND_BF5XX_MULTICHAN_SUPPORT is not set
1070CONFIG_SND_BF5XX_SOC_SPORT=m
1037CONFIG_SND_BF5XX_SOC_I2S=m 1071CONFIG_SND_BF5XX_SOC_I2S=m
1038CONFIG_SND_BF5XX_SOC_AC97=m 1072CONFIG_SND_BF5XX_SOC_AC97=m
1039# CONFIG_SND_BF5XX_SOC_WM8750 is not set 1073CONFIG_SND_BF5XX_SOC_AD1980=m
1040# CONFIG_SND_BF5XX_SOC_WM8731 is not set
1041CONFIG_SND_BF5XX_SOC_SSM2602=m
1042CONFIG_SND_BF5XX_SOC_BF5xx=m
1043CONFIG_SND_BF5XX_SPORT_NUM=0 1074CONFIG_SND_BF5XX_SPORT_NUM=0
1044# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set 1075# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
1045 1076# CONFIG_SND_SOC_ALL_CODECS is not set
1046#
1047# SoC Audio support for SuperH
1048#
1049CONFIG_SND_SOC_SSM2602=m
1050# CONFIG_SND_SOC_SSM2602_SPI is not set
1051CONFIG_SND_SOC_AD1980=m 1077CONFIG_SND_SOC_AD1980=m
1052 1078CONFIG_SND_SOC_SSM2602=m
1053#
1054# Open Sound System
1055#
1056# CONFIG_SOUND_PRIME is not set 1079# CONFIG_SOUND_PRIME is not set
1057CONFIG_AC97_BUS=m 1080CONFIG_AC97_BUS=m
1058CONFIG_HID_SUPPORT=y 1081CONFIG_HID_SUPPORT=y
@@ -1064,15 +1087,43 @@ CONFIG_HID=y
1064# USB Input Devices 1087# USB Input Devices
1065# 1088#
1066CONFIG_USB_HID=y 1089CONFIG_USB_HID=y
1067# CONFIG_USB_HIDINPUT_POWERBOOK is not set 1090# CONFIG_HID_PID is not set
1068# CONFIG_HID_FF is not set
1069# CONFIG_USB_HIDDEV is not set 1091# CONFIG_USB_HIDDEV is not set
1092
1093#
1094# Special HID drivers
1095#
1096CONFIG_HID_COMPAT=y
1097CONFIG_HID_A4TECH=y
1098CONFIG_HID_APPLE=y
1099CONFIG_HID_BELKIN=y
1100CONFIG_HID_BRIGHT=y
1101CONFIG_HID_CHERRY=y
1102CONFIG_HID_CHICONY=y
1103CONFIG_HID_CYPRESS=y
1104CONFIG_HID_DELL=y
1105CONFIG_HID_EZKEY=y
1106CONFIG_HID_GYRATION=y
1107CONFIG_HID_LOGITECH=y
1108# CONFIG_LOGITECH_FF is not set
1109# CONFIG_LOGIRUMBLEPAD2_FF is not set
1110CONFIG_HID_MICROSOFT=y
1111CONFIG_HID_MONTEREY=y
1112CONFIG_HID_PANTHERLORD=y
1113# CONFIG_PANTHERLORD_FF is not set
1114CONFIG_HID_PETALYNX=y
1115CONFIG_HID_SAMSUNG=y
1116CONFIG_HID_SONY=y
1117CONFIG_HID_SUNPLUS=y
1118CONFIG_THRUSTMASTER_FF=m
1119CONFIG_ZEROPLUS_FF=m
1070CONFIG_USB_SUPPORT=y 1120CONFIG_USB_SUPPORT=y
1071CONFIG_USB_ARCH_HAS_HCD=y 1121CONFIG_USB_ARCH_HAS_HCD=y
1072# CONFIG_USB_ARCH_HAS_OHCI is not set 1122# CONFIG_USB_ARCH_HAS_OHCI is not set
1073# CONFIG_USB_ARCH_HAS_EHCI is not set 1123# CONFIG_USB_ARCH_HAS_EHCI is not set
1074CONFIG_USB=y 1124CONFIG_USB=y
1075# CONFIG_USB_DEBUG is not set 1125# CONFIG_USB_DEBUG is not set
1126# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1076 1127
1077# 1128#
1078# Miscellaneous USB options 1129# Miscellaneous USB options
@@ -1083,15 +1134,20 @@ CONFIG_USB_DEVICE_CLASS=y
1083# CONFIG_USB_OTG is not set 1134# CONFIG_USB_OTG is not set
1084# CONFIG_USB_OTG_WHITELIST is not set 1135# CONFIG_USB_OTG_WHITELIST is not set
1085CONFIG_USB_OTG_BLACKLIST_HUB=y 1136CONFIG_USB_OTG_BLACKLIST_HUB=y
1137CONFIG_USB_MON=y
1138# CONFIG_USB_WUSB is not set
1139# CONFIG_USB_WUSB_CBAF is not set
1086 1140
1087# 1141#
1088# USB Host Controller Drivers 1142# USB Host Controller Drivers
1089# 1143#
1144# CONFIG_USB_C67X00_HCD is not set
1090# CONFIG_USB_ISP116X_HCD is not set 1145# CONFIG_USB_ISP116X_HCD is not set
1091# CONFIG_USB_ISP1362_HCD is not set
1092# CONFIG_USB_ISP1760_HCD is not set 1146# CONFIG_USB_ISP1760_HCD is not set
1147# CONFIG_USB_ISP1362_HCD is not set
1093# CONFIG_USB_SL811_HCD is not set 1148# CONFIG_USB_SL811_HCD is not set
1094# CONFIG_USB_R8A66597_HCD is not set 1149# CONFIG_USB_R8A66597_HCD is not set
1150# CONFIG_USB_HWA_HCD is not set
1095CONFIG_USB_MUSB_HDRC=y 1151CONFIG_USB_MUSB_HDRC=y
1096CONFIG_USB_MUSB_SOC=y 1152CONFIG_USB_MUSB_SOC=y
1097 1153
@@ -1103,13 +1159,15 @@ CONFIG_USB_MUSB_HOST=y
1103# CONFIG_USB_MUSB_OTG is not set 1159# CONFIG_USB_MUSB_OTG is not set
1104CONFIG_USB_MUSB_HDRC_HCD=y 1160CONFIG_USB_MUSB_HDRC_HCD=y
1105CONFIG_MUSB_PIO_ONLY=y 1161CONFIG_MUSB_PIO_ONLY=y
1106CONFIG_USB_MUSB_LOGLEVEL=0 1162# CONFIG_USB_MUSB_DEBUG is not set
1107 1163
1108# 1164#
1109# USB Device Class drivers 1165# USB Device Class drivers
1110# 1166#
1111# CONFIG_USB_ACM is not set 1167# CONFIG_USB_ACM is not set
1112# CONFIG_USB_PRINTER is not set 1168# CONFIG_USB_PRINTER is not set
1169# CONFIG_USB_WDM is not set
1170# CONFIG_USB_TMC is not set
1113 1171
1114# 1172#
1115# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1173# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -1124,15 +1182,10 @@ CONFIG_USB_MUSB_LOGLEVEL=0
1124# USB Imaging devices 1182# USB Imaging devices
1125# 1183#
1126# CONFIG_USB_MDC800 is not set 1184# CONFIG_USB_MDC800 is not set
1127CONFIG_USB_MON=y
1128 1185
1129# 1186#
1130# USB port drivers 1187# USB port drivers
1131# 1188#
1132
1133#
1134# USB Serial Converter support
1135#
1136# CONFIG_USB_SERIAL is not set 1189# CONFIG_USB_SERIAL is not set
1137 1190
1138# 1191#
@@ -1141,7 +1194,7 @@ CONFIG_USB_MON=y
1141# CONFIG_USB_EMI62 is not set 1194# CONFIG_USB_EMI62 is not set
1142# CONFIG_USB_EMI26 is not set 1195# CONFIG_USB_EMI26 is not set
1143# CONFIG_USB_ADUTUX is not set 1196# CONFIG_USB_ADUTUX is not set
1144# CONFIG_USB_AUERSWALD is not set 1197# CONFIG_USB_SEVSEG is not set
1145# CONFIG_USB_RIO500 is not set 1198# CONFIG_USB_RIO500 is not set
1146# CONFIG_USB_LEGOTOWER is not set 1199# CONFIG_USB_LEGOTOWER is not set
1147# CONFIG_USB_LCD is not set 1200# CONFIG_USB_LCD is not set
@@ -1157,17 +1210,13 @@ CONFIG_USB_MON=y
1157# CONFIG_USB_LD is not set 1210# CONFIG_USB_LD is not set
1158# CONFIG_USB_TRANCEVIBRATOR is not set 1211# CONFIG_USB_TRANCEVIBRATOR is not set
1159# CONFIG_USB_IOWARRIOR is not set 1212# CONFIG_USB_IOWARRIOR is not set
1160 1213# CONFIG_USB_ISIGHTFW is not set
1161# 1214# CONFIG_USB_VST is not set
1162# USB DSL modem support
1163#
1164
1165#
1166# USB Gadget Support
1167#
1168# CONFIG_USB_GADGET is not set 1215# CONFIG_USB_GADGET is not set
1169# CONFIG_MMC is not set 1216# CONFIG_MMC is not set
1217# CONFIG_MEMSTICK is not set
1170# CONFIG_NEW_LEDS is not set 1218# CONFIG_NEW_LEDS is not set
1219# CONFIG_ACCESSIBILITY is not set
1171CONFIG_RTC_LIB=y 1220CONFIG_RTC_LIB=y
1172CONFIG_RTC_CLASS=y 1221CONFIG_RTC_CLASS=y
1173CONFIG_RTC_HCTOSYS=y 1222CONFIG_RTC_HCTOSYS=y
@@ -1196,51 +1245,57 @@ CONFIG_RTC_INTF_DEV=y
1196# CONFIG_RTC_DRV_PCF8563 is not set 1245# CONFIG_RTC_DRV_PCF8563 is not set
1197# CONFIG_RTC_DRV_PCF8583 is not set 1246# CONFIG_RTC_DRV_PCF8583 is not set
1198# CONFIG_RTC_DRV_M41T80 is not set 1247# CONFIG_RTC_DRV_M41T80 is not set
1248# CONFIG_RTC_DRV_S35390A is not set
1249# CONFIG_RTC_DRV_FM3130 is not set
1199 1250
1200# 1251#
1201# SPI RTC drivers 1252# SPI RTC drivers
1202# 1253#
1203# CONFIG_RTC_DRV_RS5C348 is not set 1254# CONFIG_RTC_DRV_M41T94 is not set
1255# CONFIG_RTC_DRV_DS1305 is not set
1204# CONFIG_RTC_DRV_MAX6902 is not set 1256# CONFIG_RTC_DRV_MAX6902 is not set
1257# CONFIG_RTC_DRV_R9701 is not set
1258# CONFIG_RTC_DRV_RS5C348 is not set
1259# CONFIG_RTC_DRV_DS3234 is not set
1205 1260
1206# 1261#
1207# Platform RTC drivers 1262# Platform RTC drivers
1208# 1263#
1264# CONFIG_RTC_DRV_DS1286 is not set
1265# CONFIG_RTC_DRV_DS1511 is not set
1209# CONFIG_RTC_DRV_DS1553 is not set 1266# CONFIG_RTC_DRV_DS1553 is not set
1210# CONFIG_RTC_DRV_STK17TA8 is not set
1211# CONFIG_RTC_DRV_DS1742 is not set 1267# CONFIG_RTC_DRV_DS1742 is not set
1268# CONFIG_RTC_DRV_STK17TA8 is not set
1212# CONFIG_RTC_DRV_M48T86 is not set 1269# CONFIG_RTC_DRV_M48T86 is not set
1270# CONFIG_RTC_DRV_M48T35 is not set
1213# CONFIG_RTC_DRV_M48T59 is not set 1271# CONFIG_RTC_DRV_M48T59 is not set
1272# CONFIG_RTC_DRV_BQ4802 is not set
1214# CONFIG_RTC_DRV_V3020 is not set 1273# CONFIG_RTC_DRV_V3020 is not set
1215 1274
1216# 1275#
1217# on-CPU RTC drivers 1276# on-CPU RTC drivers
1218# 1277#
1219CONFIG_RTC_DRV_BFIN=y 1278CONFIG_RTC_DRV_BFIN=y
1220 1279# CONFIG_DMADEVICES is not set
1221#
1222# Userspace I/O
1223#
1224# CONFIG_UIO is not set 1280# CONFIG_UIO is not set
1281# CONFIG_STAGING is not set
1225 1282
1226# 1283#
1227# File systems 1284# File systems
1228# 1285#
1229# CONFIG_EXT2_FS is not set 1286# CONFIG_EXT2_FS is not set
1230# CONFIG_EXT3_FS is not set 1287# CONFIG_EXT3_FS is not set
1231# CONFIG_EXT4DEV_FS is not set 1288# CONFIG_EXT4_FS is not set
1232# CONFIG_REISERFS_FS is not set 1289# CONFIG_REISERFS_FS is not set
1233# CONFIG_JFS_FS is not set 1290# CONFIG_JFS_FS is not set
1234# CONFIG_FS_POSIX_ACL is not set 1291# CONFIG_FS_POSIX_ACL is not set
1292CONFIG_FILE_LOCKING=y
1235# CONFIG_XFS_FS is not set 1293# CONFIG_XFS_FS is not set
1236# CONFIG_GFS2_FS is not set
1237# CONFIG_OCFS2_FS is not set 1294# CONFIG_OCFS2_FS is not set
1238# CONFIG_MINIX_FS is not set 1295# CONFIG_DNOTIFY is not set
1239# CONFIG_ROMFS_FS is not set
1240CONFIG_INOTIFY=y 1296CONFIG_INOTIFY=y
1241CONFIG_INOTIFY_USER=y 1297CONFIG_INOTIFY_USER=y
1242# CONFIG_QUOTA is not set 1298# CONFIG_QUOTA is not set
1243# CONFIG_DNOTIFY is not set
1244# CONFIG_AUTOFS_FS is not set 1299# CONFIG_AUTOFS_FS is not set
1245# CONFIG_AUTOFS4_FS is not set 1300# CONFIG_AUTOFS4_FS is not set
1246# CONFIG_FUSE_FS is not set 1301# CONFIG_FUSE_FS is not set
@@ -1280,11 +1335,11 @@ CONFIG_SYSFS=y
1280# CONFIG_EFS_FS is not set 1335# CONFIG_EFS_FS is not set
1281CONFIG_YAFFS_FS=m 1336CONFIG_YAFFS_FS=m
1282CONFIG_YAFFS_YAFFS1=y 1337CONFIG_YAFFS_YAFFS1=y
1338# CONFIG_YAFFS_9BYTE_TAGS is not set
1283# CONFIG_YAFFS_DOES_ECC is not set 1339# CONFIG_YAFFS_DOES_ECC is not set
1284CONFIG_YAFFS_YAFFS2=y 1340CONFIG_YAFFS_YAFFS2=y
1285CONFIG_YAFFS_AUTO_YAFFS2=y 1341CONFIG_YAFFS_AUTO_YAFFS2=y
1286# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set 1342# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1287CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
1288# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set 1343# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1289# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set 1344# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1290CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y 1345CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
@@ -1301,8 +1356,11 @@ CONFIG_JFFS2_RTIME=y
1301# CONFIG_JFFS2_RUBIN is not set 1356# CONFIG_JFFS2_RUBIN is not set
1302# CONFIG_CRAMFS is not set 1357# CONFIG_CRAMFS is not set
1303# CONFIG_VXFS_FS is not set 1358# CONFIG_VXFS_FS is not set
1359# CONFIG_MINIX_FS is not set
1360# CONFIG_OMFS_FS is not set
1304# CONFIG_HPFS_FS is not set 1361# CONFIG_HPFS_FS is not set
1305# CONFIG_QNX4FS_FS is not set 1362# CONFIG_QNX4FS_FS is not set
1363# CONFIG_ROMFS_FS is not set
1306# CONFIG_SYSV_FS is not set 1364# CONFIG_SYSV_FS is not set
1307# CONFIG_UFS_FS is not set 1365# CONFIG_UFS_FS is not set
1308CONFIG_NETWORK_FILESYSTEMS=y 1366CONFIG_NETWORK_FILESYSTEMS=y
@@ -1310,13 +1368,12 @@ CONFIG_NFS_FS=m
1310CONFIG_NFS_V3=y 1368CONFIG_NFS_V3=y
1311# CONFIG_NFS_V3_ACL is not set 1369# CONFIG_NFS_V3_ACL is not set
1312# CONFIG_NFS_V4 is not set 1370# CONFIG_NFS_V4 is not set
1313# CONFIG_NFS_DIRECTIO is not set
1314# CONFIG_NFSD is not set 1371# CONFIG_NFSD is not set
1315CONFIG_LOCKD=m 1372CONFIG_LOCKD=m
1316CONFIG_LOCKD_V4=y 1373CONFIG_LOCKD_V4=y
1317CONFIG_NFS_COMMON=y 1374CONFIG_NFS_COMMON=y
1318CONFIG_SUNRPC=m 1375CONFIG_SUNRPC=m
1319# CONFIG_SUNRPC_BIND34 is not set 1376# CONFIG_SUNRPC_REGISTER_V4 is not set
1320# CONFIG_RPCSEC_GSS_KRB5 is not set 1377# CONFIG_RPCSEC_GSS_KRB5 is not set
1321# CONFIG_RPCSEC_GSS_SPKM3 is not set 1378# CONFIG_RPCSEC_GSS_SPKM3 is not set
1322CONFIG_SMB_FS=m 1379CONFIG_SMB_FS=m
@@ -1372,9 +1429,6 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1372# CONFIG_NLS_KOI8_U is not set 1429# CONFIG_NLS_KOI8_U is not set
1373# CONFIG_NLS_UTF8 is not set 1430# CONFIG_NLS_UTF8 is not set
1374# CONFIG_DLM is not set 1431# CONFIG_DLM is not set
1375CONFIG_INSTRUMENTATION=y
1376# CONFIG_PROFILING is not set
1377# CONFIG_MARKERS is not set
1378 1432
1379# 1433#
1380# Kernel hacking 1434# Kernel hacking
@@ -1382,14 +1436,53 @@ CONFIG_INSTRUMENTATION=y
1382# CONFIG_PRINTK_TIME is not set 1436# CONFIG_PRINTK_TIME is not set
1383CONFIG_ENABLE_WARN_DEPRECATED=y 1437CONFIG_ENABLE_WARN_DEPRECATED=y
1384CONFIG_ENABLE_MUST_CHECK=y 1438CONFIG_ENABLE_MUST_CHECK=y
1439CONFIG_FRAME_WARN=1024
1385# CONFIG_MAGIC_SYSRQ is not set 1440# CONFIG_MAGIC_SYSRQ is not set
1386# CONFIG_UNUSED_SYMBOLS is not set 1441# CONFIG_UNUSED_SYMBOLS is not set
1387CONFIG_DEBUG_FS=y 1442CONFIG_DEBUG_FS=y
1388# CONFIG_HEADERS_CHECK is not set 1443# CONFIG_HEADERS_CHECK is not set
1389# CONFIG_DEBUG_KERNEL is not set 1444CONFIG_DEBUG_KERNEL=y
1445# CONFIG_DEBUG_SHIRQ is not set
1446CONFIG_DETECT_SOFTLOCKUP=y
1447# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1448CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1449CONFIG_SCHED_DEBUG=y
1450# CONFIG_SCHEDSTATS is not set
1451# CONFIG_TIMER_STATS is not set
1452# CONFIG_DEBUG_OBJECTS is not set
1453# CONFIG_DEBUG_SLAB is not set
1454# CONFIG_DEBUG_RT_MUTEXES is not set
1455# CONFIG_RT_MUTEX_TESTER is not set
1456# CONFIG_DEBUG_SPINLOCK is not set
1457# CONFIG_DEBUG_MUTEXES is not set
1458# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1459# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1460# CONFIG_DEBUG_KOBJECT is not set
1390# CONFIG_DEBUG_BUGVERBOSE is not set 1461# CONFIG_DEBUG_BUGVERBOSE is not set
1462CONFIG_DEBUG_INFO=y
1463# CONFIG_DEBUG_VM is not set
1464# CONFIG_DEBUG_WRITECOUNT is not set
1465# CONFIG_DEBUG_MEMORY_INIT is not set
1466# CONFIG_DEBUG_LIST is not set
1467# CONFIG_DEBUG_SG is not set
1468# CONFIG_FRAME_POINTER is not set
1469# CONFIG_BOOT_PRINTK_DELAY is not set
1470# CONFIG_RCU_TORTURE_TEST is not set
1471# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1472# CONFIG_BACKTRACE_SELF_TEST is not set
1473# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1474# CONFIG_FAULT_INJECTION is not set
1475# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1476# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1391# CONFIG_SAMPLES is not set 1477# CONFIG_SAMPLES is not set
1478CONFIG_HAVE_ARCH_KGDB=y
1479# CONFIG_KGDB is not set
1480# CONFIG_DEBUG_STACKOVERFLOW is not set
1481# CONFIG_DEBUG_STACK_USAGE is not set
1482CONFIG_DEBUG_VERBOSE=y
1392CONFIG_DEBUG_MMRS=y 1483CONFIG_DEBUG_MMRS=y
1484# CONFIG_DEBUG_HWERR is not set
1485# CONFIG_DEBUG_DOUBLEFAULT is not set
1393CONFIG_DEBUG_HUNT_FOR_ZERO=y 1486CONFIG_DEBUG_HUNT_FOR_ZERO=y
1394CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1487CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1395CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1488CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
@@ -1407,10 +1500,95 @@ CONFIG_ACCESS_CHECK=y
1407# 1500#
1408# CONFIG_KEYS is not set 1501# CONFIG_KEYS is not set
1409CONFIG_SECURITY=y 1502CONFIG_SECURITY=y
1503# CONFIG_SECURITYFS is not set
1410# CONFIG_SECURITY_NETWORK is not set 1504# CONFIG_SECURITY_NETWORK is not set
1411# CONFIG_SECURITY_CAPABILITIES is not set 1505# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1412# CONFIG_SECURITY_ROOTPLUG is not set 1506# CONFIG_SECURITY_ROOTPLUG is not set
1413# CONFIG_CRYPTO is not set 1507CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1508CONFIG_CRYPTO=y
1509
1510#
1511# Crypto core or helper
1512#
1513# CONFIG_CRYPTO_FIPS is not set
1514# CONFIG_CRYPTO_MANAGER is not set
1515# CONFIG_CRYPTO_GF128MUL is not set
1516# CONFIG_CRYPTO_NULL is not set
1517# CONFIG_CRYPTO_CRYPTD is not set
1518# CONFIG_CRYPTO_AUTHENC is not set
1519# CONFIG_CRYPTO_TEST is not set
1520
1521#
1522# Authenticated Encryption with Associated Data
1523#
1524# CONFIG_CRYPTO_CCM is not set
1525# CONFIG_CRYPTO_GCM is not set
1526# CONFIG_CRYPTO_SEQIV is not set
1527
1528#
1529# Block modes
1530#
1531# CONFIG_CRYPTO_CBC is not set
1532# CONFIG_CRYPTO_CTR is not set
1533# CONFIG_CRYPTO_CTS is not set
1534# CONFIG_CRYPTO_ECB is not set
1535# CONFIG_CRYPTO_LRW is not set
1536# CONFIG_CRYPTO_PCBC is not set
1537# CONFIG_CRYPTO_XTS is not set
1538
1539#
1540# Hash modes
1541#
1542# CONFIG_CRYPTO_HMAC is not set
1543# CONFIG_CRYPTO_XCBC is not set
1544
1545#
1546# Digest
1547#
1548# CONFIG_CRYPTO_CRC32C is not set
1549# CONFIG_CRYPTO_MD4 is not set
1550# CONFIG_CRYPTO_MD5 is not set
1551# CONFIG_CRYPTO_MICHAEL_MIC is not set
1552# CONFIG_CRYPTO_RMD128 is not set
1553# CONFIG_CRYPTO_RMD160 is not set
1554# CONFIG_CRYPTO_RMD256 is not set
1555# CONFIG_CRYPTO_RMD320 is not set
1556# CONFIG_CRYPTO_SHA1 is not set
1557# CONFIG_CRYPTO_SHA256 is not set
1558# CONFIG_CRYPTO_SHA512 is not set
1559# CONFIG_CRYPTO_TGR192 is not set
1560# CONFIG_CRYPTO_WP512 is not set
1561
1562#
1563# Ciphers
1564#
1565# CONFIG_CRYPTO_AES is not set
1566# CONFIG_CRYPTO_ANUBIS is not set
1567# CONFIG_CRYPTO_ARC4 is not set
1568# CONFIG_CRYPTO_BLOWFISH is not set
1569# CONFIG_CRYPTO_CAMELLIA is not set
1570# CONFIG_CRYPTO_CAST5 is not set
1571# CONFIG_CRYPTO_CAST6 is not set
1572# CONFIG_CRYPTO_DES is not set
1573# CONFIG_CRYPTO_FCRYPT is not set
1574# CONFIG_CRYPTO_KHAZAD is not set
1575# CONFIG_CRYPTO_SALSA20 is not set
1576# CONFIG_CRYPTO_SEED is not set
1577# CONFIG_CRYPTO_SERPENT is not set
1578# CONFIG_CRYPTO_TEA is not set
1579# CONFIG_CRYPTO_TWOFISH is not set
1580
1581#
1582# Compression
1583#
1584# CONFIG_CRYPTO_DEFLATE is not set
1585# CONFIG_CRYPTO_LZO is not set
1586
1587#
1588# Random Number Generation
1589#
1590# CONFIG_CRYPTO_ANSI_CPRNG is not set
1591CONFIG_CRYPTO_HW=y
1414 1592
1415# 1593#
1416# Library routines 1594# Library routines
@@ -1418,6 +1596,7 @@ CONFIG_SECURITY=y
1418CONFIG_BITREVERSE=y 1596CONFIG_BITREVERSE=y
1419CONFIG_CRC_CCITT=m 1597CONFIG_CRC_CCITT=m
1420# CONFIG_CRC16 is not set 1598# CONFIG_CRC16 is not set
1599# CONFIG_CRC_T10DIF is not set
1421# CONFIG_CRC_ITU_T is not set 1600# CONFIG_CRC_ITU_T is not set
1422CONFIG_CRC32=y 1601CONFIG_CRC32=y
1423# CONFIG_CRC7 is not set 1602# CONFIG_CRC7 is not set
diff --git a/arch/blackfin/configs/BF533-EZKIT_defconfig b/arch/blackfin/configs/BF533-EZKIT_defconfig
index deeb5e45effb..92afd988449b 100644
--- a/arch/blackfin/configs/BF533-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF533-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24.7 3# Linux kernel version: 2.6.28-rc2
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y 9CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y 10CONFIG_ZONE_DMA=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y 11CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
@@ -31,18 +30,16 @@ CONFIG_SYSVIPC_SYSCTL=y
31# CONFIG_POSIX_MQUEUE is not set 30# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
33# CONFIG_TASKSTATS is not set 32# CONFIG_TASKSTATS is not set
34# CONFIG_USER_NS is not set
35# CONFIG_PID_NS is not set
36# CONFIG_AUDIT is not set 33# CONFIG_AUDIT is not set
37CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
38CONFIG_IKCONFIG_PROC=y 35CONFIG_IKCONFIG_PROC=y
39CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
40# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
41CONFIG_FAIR_GROUP_SCHED=y 38# CONFIG_GROUP_SCHED is not set
42CONFIG_FAIR_USER_SCHED=y 39# CONFIG_SYSFS_DEPRECATED is not set
43# CONFIG_FAIR_CGROUP_SCHED is not set 40# CONFIG_SYSFS_DEPRECATED_V2 is not set
44CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 41# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set
46CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
47CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -51,26 +48,35 @@ CONFIG_EMBEDDED=y
51CONFIG_UID16=y 48CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 49CONFIG_SYSCTL_SYSCALL=y
53CONFIG_KALLSYMS=y 50CONFIG_KALLSYMS=y
51# CONFIG_KALLSYMS_ALL is not set
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 52# CONFIG_KALLSYMS_EXTRA_PASS is not set
55CONFIG_HOTPLUG=y 53CONFIG_HOTPLUG=y
56CONFIG_PRINTK=y 54CONFIG_PRINTK=y
57CONFIG_BUG=y 55CONFIG_BUG=y
58CONFIG_ELF_CORE=y 56# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y
59CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 59CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 60CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 61CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 62CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 64CONFIG_EVENTFD=y
65CONFIG_AIO=y
65CONFIG_VM_EVENT_COUNTERS=y 66CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
70# CONFIG_PROFILING is not set
71# CONFIG_MARKERS is not set
72CONFIG_HAVE_OPROFILE=y
73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
69CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
70CONFIG_RT_MUTEXES=y 75CONFIG_RT_MUTEXES=y
71CONFIG_TINY_SHMEM=y 76CONFIG_TINY_SHMEM=y
72CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
73CONFIG_MODULES=y 78CONFIG_MODULES=y
79# CONFIG_MODULE_FORCE_LOAD is not set
74CONFIG_MODULE_UNLOAD=y 80CONFIG_MODULE_UNLOAD=y
75# CONFIG_MODULE_FORCE_UNLOAD is not set 81# CONFIG_MODULE_FORCE_UNLOAD is not set
76# CONFIG_MODVERSIONS is not set 82# CONFIG_MODVERSIONS is not set
@@ -81,6 +87,7 @@ CONFIG_BLOCK=y
81# CONFIG_BLK_DEV_IO_TRACE is not set 87# CONFIG_BLK_DEV_IO_TRACE is not set
82# CONFIG_LSF is not set 88# CONFIG_LSF is not set
83# CONFIG_BLK_DEV_BSG is not set 89# CONFIG_BLK_DEV_BSG is not set
90# CONFIG_BLK_DEV_INTEGRITY is not set
84 91
85# 92#
86# IO Schedulers 93# IO Schedulers
@@ -94,9 +101,11 @@ CONFIG_DEFAULT_AS=y
94# CONFIG_DEFAULT_CFQ is not set 101# CONFIG_DEFAULT_CFQ is not set
95# CONFIG_DEFAULT_NOOP is not set 102# CONFIG_DEFAULT_NOOP is not set
96CONFIG_DEFAULT_IOSCHED="anticipatory" 103CONFIG_DEFAULT_IOSCHED="anticipatory"
104CONFIG_CLASSIC_RCU=y
97# CONFIG_PREEMPT_NONE is not set 105# CONFIG_PREEMPT_NONE is not set
98CONFIG_PREEMPT_VOLUNTARY=y 106CONFIG_PREEMPT_VOLUNTARY=y
99# CONFIG_PREEMPT is not set 107# CONFIG_PREEMPT is not set
108CONFIG_FREEZER=y
100 109
101# 110#
102# Blackfin Processor Options 111# Blackfin Processor Options
@@ -105,6 +114,10 @@ CONFIG_PREEMPT_VOLUNTARY=y
105# 114#
106# Processor and Board Settings 115# Processor and Board Settings
107# 116#
117# CONFIG_BF512 is not set
118# CONFIG_BF514 is not set
119# CONFIG_BF516 is not set
120# CONFIG_BF518 is not set
108# CONFIG_BF522 is not set 121# CONFIG_BF522 is not set
109# CONFIG_BF523 is not set 122# CONFIG_BF523 is not set
110# CONFIG_BF524 is not set 123# CONFIG_BF524 is not set
@@ -117,24 +130,30 @@ CONFIG_BF533=y
117# CONFIG_BF534 is not set 130# CONFIG_BF534 is not set
118# CONFIG_BF536 is not set 131# CONFIG_BF536 is not set
119# CONFIG_BF537 is not set 132# CONFIG_BF537 is not set
133# CONFIG_BF538 is not set
134# CONFIG_BF539 is not set
120# CONFIG_BF542 is not set 135# CONFIG_BF542 is not set
121# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
122# CONFIG_BF547 is not set 137# CONFIG_BF547 is not set
123# CONFIG_BF548 is not set 138# CONFIG_BF548 is not set
124# CONFIG_BF549 is not set 139# CONFIG_BF549 is not set
125# CONFIG_BF561 is not set 140# CONFIG_BF561 is not set
141CONFIG_BF_REV_MIN=3
142CONFIG_BF_REV_MAX=6
126# CONFIG_BF_REV_0_0 is not set 143# CONFIG_BF_REV_0_0 is not set
127# CONFIG_BF_REV_0_1 is not set 144# CONFIG_BF_REV_0_1 is not set
128# CONFIG_BF_REV_0_2 is not set 145# CONFIG_BF_REV_0_2 is not set
129CONFIG_BF_REV_0_3=y 146CONFIG_BF_REV_0_3=y
130# CONFIG_BF_REV_0_4 is not set 147# CONFIG_BF_REV_0_4 is not set
131# CONFIG_BF_REV_0_5 is not set 148# CONFIG_BF_REV_0_5 is not set
149# CONFIG_BF_REV_0_6 is not set
132# CONFIG_BF_REV_ANY is not set 150# CONFIG_BF_REV_ANY is not set
133# CONFIG_BF_REV_NONE is not set 151# CONFIG_BF_REV_NONE is not set
134CONFIG_BF53x=y 152CONFIG_BF53x=y
135CONFIG_MEM_MT48LC16M16A2TG_75=y 153CONFIG_MEM_MT48LC16M16A2TG_75=y
136CONFIG_BFIN533_EZKIT=y 154CONFIG_BFIN533_EZKIT=y
137# CONFIG_BFIN533_STAMP is not set 155# CONFIG_BFIN533_STAMP is not set
156# CONFIG_BLACKSTAMP is not set
138# CONFIG_BFIN533_BLUETECHNIX_CM is not set 157# CONFIG_BFIN533_BLUETECHNIX_CM is not set
139# CONFIG_H8606_HVSISTEMAS is not set 158# CONFIG_H8606_HVSISTEMAS is not set
140# CONFIG_BFIN532_IP0X is not set 159# CONFIG_BFIN532_IP0X is not set
@@ -187,7 +206,6 @@ CONFIG_BOOT_LOAD=0x1000
187# 206#
188CONFIG_CLKIN_HZ=27000000 207CONFIG_CLKIN_HZ=27000000
189# CONFIG_BFIN_KERNEL_CLOCK is not set 208# CONFIG_BFIN_KERNEL_CLOCK is not set
190CONFIG_MAX_MEM_SIZE=512
191CONFIG_MAX_VCO_HZ=750000000 209CONFIG_MAX_VCO_HZ=750000000
192CONFIG_MIN_VCO_HZ=50000000 210CONFIG_MIN_VCO_HZ=50000000
193CONFIG_MAX_SCLK_HZ=133333333 211CONFIG_MAX_SCLK_HZ=133333333
@@ -201,6 +219,7 @@ CONFIG_HZ_250=y
201# CONFIG_HZ_300 is not set 219# CONFIG_HZ_300 is not set
202# CONFIG_HZ_1000 is not set 220# CONFIG_HZ_1000 is not set
203CONFIG_HZ=250 221CONFIG_HZ=250
222CONFIG_SCHED_HRTICK=y
204CONFIG_GENERIC_TIME=y 223CONFIG_GENERIC_TIME=y
205CONFIG_GENERIC_CLOCKEVENTS=y 224CONFIG_GENERIC_CLOCKEVENTS=y
206# CONFIG_CYCLES_CLOCKSOURCE is not set 225# CONFIG_CYCLES_CLOCKSOURCE is not set
@@ -238,6 +257,12 @@ CONFIG_SYS_BFIN_SPINLOCK_L1=y
238CONFIG_CACHELINE_ALIGNED_L1=y 257CONFIG_CACHELINE_ALIGNED_L1=y
239# CONFIG_SYSCALL_TAB_L1 is not set 258# CONFIG_SYSCALL_TAB_L1 is not set
240# CONFIG_CPLB_SWITCH_TAB_L1 is not set 259# CONFIG_CPLB_SWITCH_TAB_L1 is not set
260CONFIG_APP_STACK_L1=y
261
262#
263# Speed Optimizations
264#
265CONFIG_BFIN_INS_LOWOVERHEAD=y
241CONFIG_RAMKERNEL=y 266CONFIG_RAMKERNEL=y
242# CONFIG_ROMKERNEL is not set 267# CONFIG_ROMKERNEL is not set
243CONFIG_SELECT_MEMORY_MODEL=y 268CONFIG_SELECT_MEMORY_MODEL=y
@@ -246,14 +271,13 @@ CONFIG_FLATMEM_MANUAL=y
246# CONFIG_SPARSEMEM_MANUAL is not set 271# CONFIG_SPARSEMEM_MANUAL is not set
247CONFIG_FLATMEM=y 272CONFIG_FLATMEM=y
248CONFIG_FLAT_NODE_MEM_MAP=y 273CONFIG_FLAT_NODE_MEM_MAP=y
249# CONFIG_SPARSEMEM_STATIC is not set 274CONFIG_PAGEFLAGS_EXTENDED=y
250# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
251CONFIG_SPLIT_PTLOCK_CPUS=4 275CONFIG_SPLIT_PTLOCK_CPUS=4
252# CONFIG_RESOURCES_64BIT is not set 276# CONFIG_RESOURCES_64BIT is not set
277# CONFIG_PHYS_ADDR_T_64BIT is not set
253CONFIG_ZONE_DMA_FLAG=1 278CONFIG_ZONE_DMA_FLAG=1
254CONFIG_VIRT_TO_BUS=y 279CONFIG_VIRT_TO_BUS=y
255# CONFIG_BFIN_GPTIMERS is not set 280# CONFIG_BFIN_GPTIMERS is not set
256CONFIG_BFIN_DMA_5XX=y
257# CONFIG_DMA_UNCACHED_4M is not set 281# CONFIG_DMA_UNCACHED_4M is not set
258# CONFIG_DMA_UNCACHED_2M is not set 282# CONFIG_DMA_UNCACHED_2M is not set
259CONFIG_DMA_UNCACHED_1M=y 283CONFIG_DMA_UNCACHED_1M=y
@@ -268,7 +292,6 @@ CONFIG_BFIN_DCACHE=y
268# CONFIG_BFIN_ICACHE_LOCK is not set 292# CONFIG_BFIN_ICACHE_LOCK is not set
269# CONFIG_BFIN_WB is not set 293# CONFIG_BFIN_WB is not set
270CONFIG_BFIN_WT=y 294CONFIG_BFIN_WT=y
271CONFIG_L1_MAX_PIECE=16
272# CONFIG_MPU is not set 295# CONFIG_MPU is not set
273 296
274# 297#
@@ -297,7 +320,6 @@ CONFIG_BANK_3=0xAAC2
297# 320#
298# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 321# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
299# 322#
300# CONFIG_PCI is not set
301# CONFIG_ARCH_SUPPORTS_MSI is not set 323# CONFIG_ARCH_SUPPORTS_MSI is not set
302# CONFIG_PCCARD is not set 324# CONFIG_PCCARD is not set
303 325
@@ -308,29 +330,30 @@ CONFIG_BINFMT_ELF_FDPIC=y
308CONFIG_BINFMT_FLAT=y 330CONFIG_BINFMT_FLAT=y
309CONFIG_BINFMT_ZFLAT=y 331CONFIG_BINFMT_ZFLAT=y
310# CONFIG_BINFMT_SHARED_FLAT is not set 332# CONFIG_BINFMT_SHARED_FLAT is not set
333# CONFIG_HAVE_AOUT is not set
311# CONFIG_BINFMT_MISC is not set 334# CONFIG_BINFMT_MISC is not set
312 335
313# 336#
314# Power management options 337# Power management options
315# 338#
316CONFIG_PM=y 339CONFIG_PM=y
317# CONFIG_PM_LEGACY is not set
318# CONFIG_PM_DEBUG is not set 340# CONFIG_PM_DEBUG is not set
319CONFIG_PM_SLEEP=y 341CONFIG_PM_SLEEP=y
320CONFIG_SUSPEND_UP_POSSIBLE=y
321CONFIG_SUSPEND=y 342CONFIG_SUSPEND=y
343CONFIG_SUSPEND_FREEZER=y
344CONFIG_ARCH_SUSPEND_POSSIBLE=y
322CONFIG_PM_BFIN_SLEEP_DEEPER=y 345CONFIG_PM_BFIN_SLEEP_DEEPER=y
323# CONFIG_PM_BFIN_SLEEP is not set 346# CONFIG_PM_BFIN_SLEEP is not set
324# CONFIG_PM_WAKEUP_BY_GPIO is not set 347# CONFIG_PM_WAKEUP_BY_GPIO is not set
325 348
326# 349#
327# CPU Frequency scaling 350# Possible Suspend Mem / Hibernate Wake-Up Sources
328# 351#
329# CONFIG_CPU_FREQ is not set
330 352
331# 353#
332# Networking 354# CPU Frequency scaling
333# 355#
356# CONFIG_CPU_FREQ is not set
334CONFIG_NET=y 357CONFIG_NET=y
335 358
336# 359#
@@ -343,6 +366,7 @@ CONFIG_XFRM=y
343# CONFIG_XFRM_USER is not set 366# CONFIG_XFRM_USER is not set
344# CONFIG_XFRM_SUB_POLICY is not set 367# CONFIG_XFRM_SUB_POLICY is not set
345# CONFIG_XFRM_MIGRATE is not set 368# CONFIG_XFRM_MIGRATE is not set
369# CONFIG_XFRM_STATISTICS is not set
346# CONFIG_NET_KEY is not set 370# CONFIG_NET_KEY is not set
347CONFIG_INET=y 371CONFIG_INET=y
348# CONFIG_IP_MULTICAST is not set 372# CONFIG_IP_MULTICAST is not set
@@ -372,8 +396,6 @@ CONFIG_TCP_CONG_CUBIC=y
372CONFIG_DEFAULT_TCP_CONG="cubic" 396CONFIG_DEFAULT_TCP_CONG="cubic"
373# CONFIG_TCP_MD5SIG is not set 397# CONFIG_TCP_MD5SIG is not set
374# CONFIG_IPV6 is not set 398# CONFIG_IPV6 is not set
375# CONFIG_INET6_XFRM_TUNNEL is not set
376# CONFIG_INET6_TUNNEL is not set
377# CONFIG_NETLABEL is not set 399# CONFIG_NETLABEL is not set
378# CONFIG_NETWORK_SECMARK is not set 400# CONFIG_NETWORK_SECMARK is not set
379# CONFIG_NETFILTER is not set 401# CONFIG_NETFILTER is not set
@@ -382,6 +404,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
382# CONFIG_TIPC is not set 404# CONFIG_TIPC is not set
383# CONFIG_ATM is not set 405# CONFIG_ATM is not set
384# CONFIG_BRIDGE is not set 406# CONFIG_BRIDGE is not set
407# CONFIG_NET_DSA is not set
385# CONFIG_VLAN_8021Q is not set 408# CONFIG_VLAN_8021Q is not set
386# CONFIG_DECNET is not set 409# CONFIG_DECNET is not set
387# CONFIG_LLC2 is not set 410# CONFIG_LLC2 is not set
@@ -398,6 +421,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
398# 421#
399# CONFIG_NET_PKTGEN is not set 422# CONFIG_NET_PKTGEN is not set
400# CONFIG_HAMRADIO is not set 423# CONFIG_HAMRADIO is not set
424# CONFIG_CAN is not set
401CONFIG_IRDA=m 425CONFIG_IRDA=m
402 426
403# 427#
@@ -430,24 +454,14 @@ CONFIG_IRTTY_SIR=m
430# CONFIG_DONGLE is not set 454# CONFIG_DONGLE is not set
431 455
432# 456#
433# Old SIR device drivers
434#
435# CONFIG_IRPORT_SIR is not set
436
437#
438# Old Serial dongle support
439#
440
441#
442# FIR device drivers 457# FIR device drivers
443# 458#
444# CONFIG_BT is not set 459# CONFIG_BT is not set
445# CONFIG_AF_RXRPC is not set 460# CONFIG_AF_RXRPC is not set
446 461# CONFIG_PHONET is not set
447# 462CONFIG_WIRELESS=y
448# Wireless
449#
450# CONFIG_CFG80211 is not set 463# CONFIG_CFG80211 is not set
464CONFIG_WIRELESS_OLD_REGULATORY=y
451# CONFIG_WIRELESS_EXT is not set 465# CONFIG_WIRELESS_EXT is not set
452# CONFIG_MAC80211 is not set 466# CONFIG_MAC80211 is not set
453# CONFIG_IEEE80211 is not set 467# CONFIG_IEEE80211 is not set
@@ -465,6 +479,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
465CONFIG_STANDALONE=y 479CONFIG_STANDALONE=y
466CONFIG_PREVENT_FIRMWARE_BUILD=y 480CONFIG_PREVENT_FIRMWARE_BUILD=y
467# CONFIG_FW_LOADER is not set 481# CONFIG_FW_LOADER is not set
482# CONFIG_DEBUG_DRIVER is not set
483# CONFIG_DEBUG_DEVRES is not set
468# CONFIG_SYS_HYPERVISOR is not set 484# CONFIG_SYS_HYPERVISOR is not set
469# CONFIG_CONNECTOR is not set 485# CONFIG_CONNECTOR is not set
470CONFIG_MTD=y 486CONFIG_MTD=y
@@ -473,6 +489,7 @@ CONFIG_MTD=y
473CONFIG_MTD_PARTITIONS=y 489CONFIG_MTD_PARTITIONS=y
474# CONFIG_MTD_REDBOOT_PARTS is not set 490# CONFIG_MTD_REDBOOT_PARTS is not set
475# CONFIG_MTD_CMDLINE_PARTS is not set 491# CONFIG_MTD_CMDLINE_PARTS is not set
492# CONFIG_MTD_AR7_PARTS is not set
476 493
477# 494#
478# User Modules And Translation Layers 495# User Modules And Translation Layers
@@ -516,6 +533,7 @@ CONFIG_MTD_ROM=m
516# 533#
517CONFIG_MTD_COMPLEX_MAPPINGS=y 534CONFIG_MTD_COMPLEX_MAPPINGS=y
518# CONFIG_MTD_PHYSMAP is not set 535# CONFIG_MTD_PHYSMAP is not set
536# CONFIG_MTD_GPIO_ADDR is not set
519# CONFIG_MTD_UCLINUX is not set 537# CONFIG_MTD_UCLINUX is not set
520# CONFIG_MTD_PLATRAM is not set 538# CONFIG_MTD_PLATRAM is not set
521 539
@@ -550,11 +568,14 @@ CONFIG_BLK_DEV=y
550CONFIG_BLK_DEV_RAM=y 568CONFIG_BLK_DEV_RAM=y
551CONFIG_BLK_DEV_RAM_COUNT=16 569CONFIG_BLK_DEV_RAM_COUNT=16
552CONFIG_BLK_DEV_RAM_SIZE=4096 570CONFIG_BLK_DEV_RAM_SIZE=4096
553CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 571# CONFIG_BLK_DEV_XIP is not set
554# CONFIG_CDROM_PKTCDVD is not set 572# CONFIG_CDROM_PKTCDVD is not set
555# CONFIG_ATA_OVER_ETH is not set 573# CONFIG_ATA_OVER_ETH is not set
574# CONFIG_BLK_DEV_HD is not set
556CONFIG_MISC_DEVICES=y 575CONFIG_MISC_DEVICES=y
557# CONFIG_EEPROM_93CX6 is not set 576# CONFIG_EEPROM_93CX6 is not set
577# CONFIG_ENCLOSURE_SERVICES is not set
578CONFIG_HAVE_IDE=y
558# CONFIG_IDE is not set 579# CONFIG_IDE is not set
559 580
560# 581#
@@ -567,7 +588,6 @@ CONFIG_MISC_DEVICES=y
567# CONFIG_ATA is not set 588# CONFIG_ATA is not set
568# CONFIG_MD is not set 589# CONFIG_MD is not set
569CONFIG_NETDEVICES=y 590CONFIG_NETDEVICES=y
570# CONFIG_NETDEVICES_MULTIQUEUE is not set
571# CONFIG_DUMMY is not set 591# CONFIG_DUMMY is not set
572# CONFIG_BONDING is not set 592# CONFIG_BONDING is not set
573# CONFIG_MACVLAN is not set 593# CONFIG_MACVLAN is not set
@@ -580,11 +600,14 @@ CONFIG_MII=y
580CONFIG_SMC91X=y 600CONFIG_SMC91X=y
581# CONFIG_SMSC911X is not set 601# CONFIG_SMSC911X is not set
582# CONFIG_DM9000 is not set 602# CONFIG_DM9000 is not set
603# CONFIG_ENC28J60 is not set
583# CONFIG_IBM_NEW_EMAC_ZMII is not set 604# CONFIG_IBM_NEW_EMAC_ZMII is not set
584# CONFIG_IBM_NEW_EMAC_RGMII is not set 605# CONFIG_IBM_NEW_EMAC_RGMII is not set
585# CONFIG_IBM_NEW_EMAC_TAH is not set 606# CONFIG_IBM_NEW_EMAC_TAH is not set
586# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 607# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
587# CONFIG_B44 is not set 608# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
609# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
610# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
588CONFIG_NETDEV_1000=y 611CONFIG_NETDEV_1000=y
589# CONFIG_AX88180 is not set 612# CONFIG_AX88180 is not set
590CONFIG_NETDEV_10000=y 613CONFIG_NETDEV_10000=y
@@ -594,10 +617,10 @@ CONFIG_NETDEV_10000=y
594# 617#
595# CONFIG_WLAN_PRE80211 is not set 618# CONFIG_WLAN_PRE80211 is not set
596# CONFIG_WLAN_80211 is not set 619# CONFIG_WLAN_80211 is not set
620# CONFIG_IWLWIFI_LEDS is not set
597# CONFIG_WAN is not set 621# CONFIG_WAN is not set
598# CONFIG_PPP is not set 622# CONFIG_PPP is not set
599# CONFIG_SLIP is not set 623# CONFIG_SLIP is not set
600# CONFIG_SHAPER is not set
601# CONFIG_NETCONSOLE is not set 624# CONFIG_NETCONSOLE is not set
602# CONFIG_NETPOLL is not set 625# CONFIG_NETPOLL is not set
603# CONFIG_NET_POLL_CONTROLLER is not set 626# CONFIG_NET_POLL_CONTROLLER is not set
@@ -645,8 +668,11 @@ CONFIG_INPUT_EVDEV=m
645# CONFIG_BF5xx_PPI is not set 668# CONFIG_BF5xx_PPI is not set
646CONFIG_BFIN_SPORT=y 669CONFIG_BFIN_SPORT=y
647# CONFIG_BFIN_TIMER_LATENCY is not set 670# CONFIG_BFIN_TIMER_LATENCY is not set
671CONFIG_BFIN_DMA_INTERFACE=m
648CONFIG_SIMPLE_GPIO=m 672CONFIG_SIMPLE_GPIO=m
649# CONFIG_VT is not set 673# CONFIG_VT is not set
674# CONFIG_DEVKMEM is not set
675# CONFIG_BFIN_JTAG_COMM is not set
650# CONFIG_SERIAL_NONSTANDARD is not set 676# CONFIG_SERIAL_NONSTANDARD is not set
651 677
652# 678#
@@ -675,22 +701,19 @@ CONFIG_UNIX98_PTYS=y
675# CONFIG_CAN4LINUX is not set 701# CONFIG_CAN4LINUX is not set
676# CONFIG_IPMI_HANDLER is not set 702# CONFIG_IPMI_HANDLER is not set
677# CONFIG_HW_RANDOM is not set 703# CONFIG_HW_RANDOM is not set
678# CONFIG_GEN_RTC is not set
679# CONFIG_R3964 is not set 704# CONFIG_R3964 is not set
680# CONFIG_RAW_DRIVER is not set 705# CONFIG_RAW_DRIVER is not set
681# CONFIG_TCG_TPM is not set 706# CONFIG_TCG_TPM is not set
682# CONFIG_I2C is not set 707# CONFIG_I2C is not set
683
684#
685# SPI support
686#
687CONFIG_SPI=y 708CONFIG_SPI=y
709# CONFIG_SPI_DEBUG is not set
688CONFIG_SPI_MASTER=y 710CONFIG_SPI_MASTER=y
689 711
690# 712#
691# SPI Master Controller Drivers 713# SPI Master Controller Drivers
692# 714#
693CONFIG_SPI_BFIN=y 715CONFIG_SPI_BFIN=y
716# CONFIG_SPI_BFIN_LOCK is not set
694# CONFIG_SPI_BITBANG is not set 717# CONFIG_SPI_BITBANG is not set
695 718
696# 719#
@@ -699,14 +722,18 @@ CONFIG_SPI_BFIN=y
699# CONFIG_SPI_AT25 is not set 722# CONFIG_SPI_AT25 is not set
700# CONFIG_SPI_SPIDEV is not set 723# CONFIG_SPI_SPIDEV is not set
701# CONFIG_SPI_TLE62X0 is not set 724# CONFIG_SPI_TLE62X0 is not set
725CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
726# CONFIG_GPIOLIB is not set
702# CONFIG_W1 is not set 727# CONFIG_W1 is not set
703# CONFIG_POWER_SUPPLY is not set 728# CONFIG_POWER_SUPPLY is not set
704CONFIG_HWMON=y 729CONFIG_HWMON=y
705# CONFIG_HWMON_VID is not set 730# CONFIG_HWMON_VID is not set
731# CONFIG_SENSORS_ADCXX is not set
706# CONFIG_SENSORS_F71805F is not set 732# CONFIG_SENSORS_F71805F is not set
707# CONFIG_SENSORS_F71882FG is not set 733# CONFIG_SENSORS_F71882FG is not set
708# CONFIG_SENSORS_IT87 is not set 734# CONFIG_SENSORS_IT87 is not set
709# CONFIG_SENSORS_LM70 is not set 735# CONFIG_SENSORS_LM70 is not set
736# CONFIG_SENSORS_MAX1111 is not set
710# CONFIG_SENSORS_PC87360 is not set 737# CONFIG_SENSORS_PC87360 is not set
711# CONFIG_SENSORS_PC87427 is not set 738# CONFIG_SENSORS_PC87427 is not set
712# CONFIG_SENSORS_SMSC47M1 is not set 739# CONFIG_SENSORS_SMSC47M1 is not set
@@ -715,6 +742,8 @@ CONFIG_HWMON=y
715# CONFIG_SENSORS_W83627HF is not set 742# CONFIG_SENSORS_W83627HF is not set
716# CONFIG_SENSORS_W83627EHF is not set 743# CONFIG_SENSORS_W83627EHF is not set
717# CONFIG_HWMON_DEBUG_CHIP is not set 744# CONFIG_HWMON_DEBUG_CHIP is not set
745# CONFIG_THERMAL is not set
746# CONFIG_THERMAL_HWMON is not set
718CONFIG_WATCHDOG=y 747CONFIG_WATCHDOG=y
719# CONFIG_WATCHDOG_NOWAYOUT is not set 748# CONFIG_WATCHDOG_NOWAYOUT is not set
720 749
@@ -725,21 +754,28 @@ CONFIG_WATCHDOG=y
725CONFIG_BFIN_WDT=y 754CONFIG_BFIN_WDT=y
726 755
727# 756#
728# Sonics Silicon Backplane
729#
730CONFIG_SSB_POSSIBLE=y
731# CONFIG_SSB is not set
732
733#
734# Multifunction device drivers 757# Multifunction device drivers
735# 758#
759# CONFIG_MFD_CORE is not set
736# CONFIG_MFD_SM501 is not set 760# CONFIG_MFD_SM501 is not set
761# CONFIG_HTC_PASIC3 is not set
762# CONFIG_MFD_TMIO is not set
763# CONFIG_MFD_WM8400 is not set
737 764
738# 765#
739# Multimedia devices 766# Multimedia devices
740# 767#
768
769#
770# Multimedia core support
771#
741# CONFIG_VIDEO_DEV is not set 772# CONFIG_VIDEO_DEV is not set
742# CONFIG_DVB_CORE is not set 773# CONFIG_DVB_CORE is not set
774# CONFIG_VIDEO_MEDIA is not set
775
776#
777# Multimedia drivers
778#
743# CONFIG_DAB is not set 779# CONFIG_DAB is not set
744 780
745# 781#
@@ -754,18 +790,22 @@ CONFIG_SSB_POSSIBLE=y
754# Display device support 790# Display device support
755# 791#
756# CONFIG_DISPLAY_SUPPORT is not set 792# CONFIG_DISPLAY_SUPPORT is not set
757
758#
759# Sound
760#
761# CONFIG_SOUND is not set 793# CONFIG_SOUND is not set
762CONFIG_HID_SUPPORT=y 794CONFIG_HID_SUPPORT=y
763CONFIG_HID=m 795CONFIG_HID=m
764# CONFIG_HID_DEBUG is not set 796# CONFIG_HID_DEBUG is not set
765# CONFIG_HIDRAW is not set 797# CONFIG_HIDRAW is not set
798# CONFIG_HID_PID is not set
799
800#
801# Special HID drivers
802#
803CONFIG_HID_COMPAT=y
766# CONFIG_USB_SUPPORT is not set 804# CONFIG_USB_SUPPORT is not set
767# CONFIG_MMC is not set 805# CONFIG_MMC is not set
806# CONFIG_MEMSTICK is not set
768# CONFIG_NEW_LEDS is not set 807# CONFIG_NEW_LEDS is not set
808# CONFIG_ACCESSIBILITY is not set
769CONFIG_RTC_LIB=y 809CONFIG_RTC_LIB=y
770CONFIG_RTC_CLASS=y 810CONFIG_RTC_CLASS=y
771CONFIG_RTC_HCTOSYS=y 811CONFIG_RTC_HCTOSYS=y
@@ -784,47 +824,51 @@ CONFIG_RTC_INTF_DEV=y
784# 824#
785# SPI RTC drivers 825# SPI RTC drivers
786# 826#
787# CONFIG_RTC_DRV_RS5C348 is not set 827# CONFIG_RTC_DRV_M41T94 is not set
828# CONFIG_RTC_DRV_DS1305 is not set
788# CONFIG_RTC_DRV_MAX6902 is not set 829# CONFIG_RTC_DRV_MAX6902 is not set
830# CONFIG_RTC_DRV_R9701 is not set
831# CONFIG_RTC_DRV_RS5C348 is not set
832# CONFIG_RTC_DRV_DS3234 is not set
789 833
790# 834#
791# Platform RTC drivers 835# Platform RTC drivers
792# 836#
837# CONFIG_RTC_DRV_DS1286 is not set
838# CONFIG_RTC_DRV_DS1511 is not set
793# CONFIG_RTC_DRV_DS1553 is not set 839# CONFIG_RTC_DRV_DS1553 is not set
794# CONFIG_RTC_DRV_STK17TA8 is not set
795# CONFIG_RTC_DRV_DS1742 is not set 840# CONFIG_RTC_DRV_DS1742 is not set
841# CONFIG_RTC_DRV_STK17TA8 is not set
796# CONFIG_RTC_DRV_M48T86 is not set 842# CONFIG_RTC_DRV_M48T86 is not set
843# CONFIG_RTC_DRV_M48T35 is not set
797# CONFIG_RTC_DRV_M48T59 is not set 844# CONFIG_RTC_DRV_M48T59 is not set
845# CONFIG_RTC_DRV_BQ4802 is not set
798# CONFIG_RTC_DRV_V3020 is not set 846# CONFIG_RTC_DRV_V3020 is not set
799 847
800# 848#
801# on-CPU RTC drivers 849# on-CPU RTC drivers
802# 850#
803CONFIG_RTC_DRV_BFIN=y 851CONFIG_RTC_DRV_BFIN=y
804 852# CONFIG_DMADEVICES is not set
805#
806# Userspace I/O
807#
808# CONFIG_UIO is not set 853# CONFIG_UIO is not set
854# CONFIG_STAGING is not set
809 855
810# 856#
811# File systems 857# File systems
812# 858#
813# CONFIG_EXT2_FS is not set 859# CONFIG_EXT2_FS is not set
814# CONFIG_EXT3_FS is not set 860# CONFIG_EXT3_FS is not set
815# CONFIG_EXT4DEV_FS is not set 861# CONFIG_EXT4_FS is not set
816# CONFIG_REISERFS_FS is not set 862# CONFIG_REISERFS_FS is not set
817# CONFIG_JFS_FS is not set 863# CONFIG_JFS_FS is not set
818# CONFIG_FS_POSIX_ACL is not set 864# CONFIG_FS_POSIX_ACL is not set
865CONFIG_FILE_LOCKING=y
819# CONFIG_XFS_FS is not set 866# CONFIG_XFS_FS is not set
820# CONFIG_GFS2_FS is not set
821# CONFIG_OCFS2_FS is not set 867# CONFIG_OCFS2_FS is not set
822# CONFIG_MINIX_FS is not set 868# CONFIG_DNOTIFY is not set
823# CONFIG_ROMFS_FS is not set
824CONFIG_INOTIFY=y 869CONFIG_INOTIFY=y
825CONFIG_INOTIFY_USER=y 870CONFIG_INOTIFY_USER=y
826# CONFIG_QUOTA is not set 871# CONFIG_QUOTA is not set
827# CONFIG_DNOTIFY is not set
828# CONFIG_AUTOFS_FS is not set 872# CONFIG_AUTOFS_FS is not set
829# CONFIG_AUTOFS4_FS is not set 873# CONFIG_AUTOFS4_FS is not set
830# CONFIG_FUSE_FS is not set 874# CONFIG_FUSE_FS is not set
@@ -864,11 +908,11 @@ CONFIG_SYSFS=y
864# CONFIG_EFS_FS is not set 908# CONFIG_EFS_FS is not set
865CONFIG_YAFFS_FS=m 909CONFIG_YAFFS_FS=m
866CONFIG_YAFFS_YAFFS1=y 910CONFIG_YAFFS_YAFFS1=y
911# CONFIG_YAFFS_9BYTE_TAGS is not set
867# CONFIG_YAFFS_DOES_ECC is not set 912# CONFIG_YAFFS_DOES_ECC is not set
868CONFIG_YAFFS_YAFFS2=y 913CONFIG_YAFFS_YAFFS2=y
869CONFIG_YAFFS_AUTO_YAFFS2=y 914CONFIG_YAFFS_AUTO_YAFFS2=y
870# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set 915# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
871CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
872# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set 916# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
873# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set 917# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
874CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y 918CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
@@ -885,8 +929,11 @@ CONFIG_JFFS2_RTIME=y
885# CONFIG_JFFS2_RUBIN is not set 929# CONFIG_JFFS2_RUBIN is not set
886# CONFIG_CRAMFS is not set 930# CONFIG_CRAMFS is not set
887# CONFIG_VXFS_FS is not set 931# CONFIG_VXFS_FS is not set
932# CONFIG_MINIX_FS is not set
933# CONFIG_OMFS_FS is not set
888# CONFIG_HPFS_FS is not set 934# CONFIG_HPFS_FS is not set
889# CONFIG_QNX4FS_FS is not set 935# CONFIG_QNX4FS_FS is not set
936# CONFIG_ROMFS_FS is not set
890# CONFIG_SYSV_FS is not set 937# CONFIG_SYSV_FS is not set
891# CONFIG_UFS_FS is not set 938# CONFIG_UFS_FS is not set
892CONFIG_NETWORK_FILESYSTEMS=y 939CONFIG_NETWORK_FILESYSTEMS=y
@@ -894,13 +941,12 @@ CONFIG_NFS_FS=m
894CONFIG_NFS_V3=y 941CONFIG_NFS_V3=y
895# CONFIG_NFS_V3_ACL is not set 942# CONFIG_NFS_V3_ACL is not set
896# CONFIG_NFS_V4 is not set 943# CONFIG_NFS_V4 is not set
897# CONFIG_NFS_DIRECTIO is not set
898# CONFIG_NFSD is not set 944# CONFIG_NFSD is not set
899CONFIG_LOCKD=m 945CONFIG_LOCKD=m
900CONFIG_LOCKD_V4=y 946CONFIG_LOCKD_V4=y
901CONFIG_NFS_COMMON=y 947CONFIG_NFS_COMMON=y
902CONFIG_SUNRPC=m 948CONFIG_SUNRPC=m
903# CONFIG_SUNRPC_BIND34 is not set 949# CONFIG_SUNRPC_REGISTER_V4 is not set
904# CONFIG_RPCSEC_GSS_KRB5 is not set 950# CONFIG_RPCSEC_GSS_KRB5 is not set
905# CONFIG_RPCSEC_GSS_SPKM3 is not set 951# CONFIG_RPCSEC_GSS_SPKM3 is not set
906CONFIG_SMB_FS=m 952CONFIG_SMB_FS=m
@@ -956,9 +1002,6 @@ CONFIG_NLS_DEFAULT="iso8859-1"
956# CONFIG_NLS_KOI8_U is not set 1002# CONFIG_NLS_KOI8_U is not set
957# CONFIG_NLS_UTF8 is not set 1003# CONFIG_NLS_UTF8 is not set
958# CONFIG_DLM is not set 1004# CONFIG_DLM is not set
959CONFIG_INSTRUMENTATION=y
960# CONFIG_PROFILING is not set
961# CONFIG_MARKERS is not set
962 1005
963# 1006#
964# Kernel hacking 1007# Kernel hacking
@@ -966,14 +1009,53 @@ CONFIG_INSTRUMENTATION=y
966# CONFIG_PRINTK_TIME is not set 1009# CONFIG_PRINTK_TIME is not set
967CONFIG_ENABLE_WARN_DEPRECATED=y 1010CONFIG_ENABLE_WARN_DEPRECATED=y
968CONFIG_ENABLE_MUST_CHECK=y 1011CONFIG_ENABLE_MUST_CHECK=y
1012CONFIG_FRAME_WARN=1024
969# CONFIG_MAGIC_SYSRQ is not set 1013# CONFIG_MAGIC_SYSRQ is not set
970# CONFIG_UNUSED_SYMBOLS is not set 1014# CONFIG_UNUSED_SYMBOLS is not set
971CONFIG_DEBUG_FS=y 1015CONFIG_DEBUG_FS=y
972# CONFIG_HEADERS_CHECK is not set 1016# CONFIG_HEADERS_CHECK is not set
973# CONFIG_DEBUG_KERNEL is not set 1017CONFIG_DEBUG_KERNEL=y
1018# CONFIG_DEBUG_SHIRQ is not set
1019CONFIG_DETECT_SOFTLOCKUP=y
1020# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1021CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1022CONFIG_SCHED_DEBUG=y
1023# CONFIG_SCHEDSTATS is not set
1024# CONFIG_TIMER_STATS is not set
1025# CONFIG_DEBUG_OBJECTS is not set
1026# CONFIG_DEBUG_SLAB is not set
1027# CONFIG_DEBUG_RT_MUTEXES is not set
1028# CONFIG_RT_MUTEX_TESTER is not set
1029# CONFIG_DEBUG_SPINLOCK is not set
1030# CONFIG_DEBUG_MUTEXES is not set
1031# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1032# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1033# CONFIG_DEBUG_KOBJECT is not set
974# CONFIG_DEBUG_BUGVERBOSE is not set 1034# CONFIG_DEBUG_BUGVERBOSE is not set
1035CONFIG_DEBUG_INFO=y
1036# CONFIG_DEBUG_VM is not set
1037# CONFIG_DEBUG_WRITECOUNT is not set
1038# CONFIG_DEBUG_MEMORY_INIT is not set
1039# CONFIG_DEBUG_LIST is not set
1040# CONFIG_DEBUG_SG is not set
1041# CONFIG_FRAME_POINTER is not set
1042# CONFIG_BOOT_PRINTK_DELAY is not set
1043# CONFIG_RCU_TORTURE_TEST is not set
1044# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1045# CONFIG_BACKTRACE_SELF_TEST is not set
1046# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1047# CONFIG_FAULT_INJECTION is not set
1048# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1049# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
975# CONFIG_SAMPLES is not set 1050# CONFIG_SAMPLES is not set
1051CONFIG_HAVE_ARCH_KGDB=y
1052# CONFIG_KGDB is not set
1053# CONFIG_DEBUG_STACKOVERFLOW is not set
1054# CONFIG_DEBUG_STACK_USAGE is not set
1055CONFIG_DEBUG_VERBOSE=y
976CONFIG_DEBUG_MMRS=y 1056CONFIG_DEBUG_MMRS=y
1057# CONFIG_DEBUG_HWERR is not set
1058# CONFIG_DEBUG_DOUBLEFAULT is not set
977CONFIG_DEBUG_HUNT_FOR_ZERO=y 1059CONFIG_DEBUG_HUNT_FOR_ZERO=y
978CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1060CONFIG_DEBUG_BFIN_HWTRACE_ON=y
979CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1061CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
@@ -991,9 +1073,94 @@ CONFIG_ACCESS_CHECK=y
991# 1073#
992# CONFIG_KEYS is not set 1074# CONFIG_KEYS is not set
993CONFIG_SECURITY=y 1075CONFIG_SECURITY=y
1076# CONFIG_SECURITYFS is not set
994# CONFIG_SECURITY_NETWORK is not set 1077# CONFIG_SECURITY_NETWORK is not set
995# CONFIG_SECURITY_CAPABILITIES is not set 1078# CONFIG_SECURITY_FILE_CAPABILITIES is not set
996# CONFIG_CRYPTO is not set 1079CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1080CONFIG_CRYPTO=y
1081
1082#
1083# Crypto core or helper
1084#
1085# CONFIG_CRYPTO_FIPS is not set
1086# CONFIG_CRYPTO_MANAGER is not set
1087# CONFIG_CRYPTO_GF128MUL is not set
1088# CONFIG_CRYPTO_NULL is not set
1089# CONFIG_CRYPTO_CRYPTD is not set
1090# CONFIG_CRYPTO_AUTHENC is not set
1091# CONFIG_CRYPTO_TEST is not set
1092
1093#
1094# Authenticated Encryption with Associated Data
1095#
1096# CONFIG_CRYPTO_CCM is not set
1097# CONFIG_CRYPTO_GCM is not set
1098# CONFIG_CRYPTO_SEQIV is not set
1099
1100#
1101# Block modes
1102#
1103# CONFIG_CRYPTO_CBC is not set
1104# CONFIG_CRYPTO_CTR is not set
1105# CONFIG_CRYPTO_CTS is not set
1106# CONFIG_CRYPTO_ECB is not set
1107# CONFIG_CRYPTO_LRW is not set
1108# CONFIG_CRYPTO_PCBC is not set
1109# CONFIG_CRYPTO_XTS is not set
1110
1111#
1112# Hash modes
1113#
1114# CONFIG_CRYPTO_HMAC is not set
1115# CONFIG_CRYPTO_XCBC is not set
1116
1117#
1118# Digest
1119#
1120# CONFIG_CRYPTO_CRC32C is not set
1121# CONFIG_CRYPTO_MD4 is not set
1122# CONFIG_CRYPTO_MD5 is not set
1123# CONFIG_CRYPTO_MICHAEL_MIC is not set
1124# CONFIG_CRYPTO_RMD128 is not set
1125# CONFIG_CRYPTO_RMD160 is not set
1126# CONFIG_CRYPTO_RMD256 is not set
1127# CONFIG_CRYPTO_RMD320 is not set
1128# CONFIG_CRYPTO_SHA1 is not set
1129# CONFIG_CRYPTO_SHA256 is not set
1130# CONFIG_CRYPTO_SHA512 is not set
1131# CONFIG_CRYPTO_TGR192 is not set
1132# CONFIG_CRYPTO_WP512 is not set
1133
1134#
1135# Ciphers
1136#
1137# CONFIG_CRYPTO_AES is not set
1138# CONFIG_CRYPTO_ANUBIS is not set
1139# CONFIG_CRYPTO_ARC4 is not set
1140# CONFIG_CRYPTO_BLOWFISH is not set
1141# CONFIG_CRYPTO_CAMELLIA is not set
1142# CONFIG_CRYPTO_CAST5 is not set
1143# CONFIG_CRYPTO_CAST6 is not set
1144# CONFIG_CRYPTO_DES is not set
1145# CONFIG_CRYPTO_FCRYPT is not set
1146# CONFIG_CRYPTO_KHAZAD is not set
1147# CONFIG_CRYPTO_SALSA20 is not set
1148# CONFIG_CRYPTO_SEED is not set
1149# CONFIG_CRYPTO_SERPENT is not set
1150# CONFIG_CRYPTO_TEA is not set
1151# CONFIG_CRYPTO_TWOFISH is not set
1152
1153#
1154# Compression
1155#
1156# CONFIG_CRYPTO_DEFLATE is not set
1157# CONFIG_CRYPTO_LZO is not set
1158
1159#
1160# Random Number Generation
1161#
1162# CONFIG_CRYPTO_ANSI_CPRNG is not set
1163CONFIG_CRYPTO_HW=y
997 1164
998# 1165#
999# Library routines 1166# Library routines
@@ -1001,6 +1168,7 @@ CONFIG_SECURITY=y
1001CONFIG_BITREVERSE=y 1168CONFIG_BITREVERSE=y
1002CONFIG_CRC_CCITT=m 1169CONFIG_CRC_CCITT=m
1003# CONFIG_CRC16 is not set 1170# CONFIG_CRC16 is not set
1171# CONFIG_CRC_T10DIF is not set
1004# CONFIG_CRC_ITU_T is not set 1172# CONFIG_CRC_ITU_T is not set
1005CONFIG_CRC32=y 1173CONFIG_CRC32=y
1006# CONFIG_CRC7 is not set 1174# CONFIG_CRC7 is not set
diff --git a/arch/blackfin/configs/BF533-STAMP_defconfig b/arch/blackfin/configs/BF533-STAMP_defconfig
index c23267ed880b..49eabb41e9e5 100644
--- a/arch/blackfin/configs/BF533-STAMP_defconfig
+++ b/arch/blackfin/configs/BF533-STAMP_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24.7 3# Linux kernel version: 2.6.28-rc2
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y 9CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y 10CONFIG_ZONE_DMA=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y 11CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
@@ -31,18 +30,16 @@ CONFIG_SYSVIPC_SYSCTL=y
31# CONFIG_POSIX_MQUEUE is not set 30# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
33# CONFIG_TASKSTATS is not set 32# CONFIG_TASKSTATS is not set
34# CONFIG_USER_NS is not set
35# CONFIG_PID_NS is not set
36# CONFIG_AUDIT is not set 33# CONFIG_AUDIT is not set
37CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
38CONFIG_IKCONFIG_PROC=y 35CONFIG_IKCONFIG_PROC=y
39CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
40# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
41CONFIG_FAIR_GROUP_SCHED=y 38# CONFIG_GROUP_SCHED is not set
42CONFIG_FAIR_USER_SCHED=y 39# CONFIG_SYSFS_DEPRECATED is not set
43# CONFIG_FAIR_CGROUP_SCHED is not set 40# CONFIG_SYSFS_DEPRECATED_V2 is not set
44CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 41# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set
46CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
47CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -51,26 +48,35 @@ CONFIG_EMBEDDED=y
51CONFIG_UID16=y 48CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 49CONFIG_SYSCTL_SYSCALL=y
53CONFIG_KALLSYMS=y 50CONFIG_KALLSYMS=y
51# CONFIG_KALLSYMS_ALL is not set
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 52# CONFIG_KALLSYMS_EXTRA_PASS is not set
55CONFIG_HOTPLUG=y 53CONFIG_HOTPLUG=y
56CONFIG_PRINTK=y 54CONFIG_PRINTK=y
57CONFIG_BUG=y 55CONFIG_BUG=y
58CONFIG_ELF_CORE=y 56# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y
59CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 59CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 60CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 61CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 62CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 64CONFIG_EVENTFD=y
65CONFIG_AIO=y
65CONFIG_VM_EVENT_COUNTERS=y 66CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
70# CONFIG_PROFILING is not set
71# CONFIG_MARKERS is not set
72CONFIG_HAVE_OPROFILE=y
73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
69CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
70CONFIG_RT_MUTEXES=y 75CONFIG_RT_MUTEXES=y
71CONFIG_TINY_SHMEM=y 76CONFIG_TINY_SHMEM=y
72CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
73CONFIG_MODULES=y 78CONFIG_MODULES=y
79# CONFIG_MODULE_FORCE_LOAD is not set
74CONFIG_MODULE_UNLOAD=y 80CONFIG_MODULE_UNLOAD=y
75# CONFIG_MODULE_FORCE_UNLOAD is not set 81# CONFIG_MODULE_FORCE_UNLOAD is not set
76# CONFIG_MODVERSIONS is not set 82# CONFIG_MODVERSIONS is not set
@@ -81,6 +87,7 @@ CONFIG_BLOCK=y
81# CONFIG_BLK_DEV_IO_TRACE is not set 87# CONFIG_BLK_DEV_IO_TRACE is not set
82# CONFIG_LSF is not set 88# CONFIG_LSF is not set
83# CONFIG_BLK_DEV_BSG is not set 89# CONFIG_BLK_DEV_BSG is not set
90# CONFIG_BLK_DEV_INTEGRITY is not set
84 91
85# 92#
86# IO Schedulers 93# IO Schedulers
@@ -94,9 +101,11 @@ CONFIG_DEFAULT_AS=y
94# CONFIG_DEFAULT_CFQ is not set 101# CONFIG_DEFAULT_CFQ is not set
95# CONFIG_DEFAULT_NOOP is not set 102# CONFIG_DEFAULT_NOOP is not set
96CONFIG_DEFAULT_IOSCHED="anticipatory" 103CONFIG_DEFAULT_IOSCHED="anticipatory"
104CONFIG_CLASSIC_RCU=y
97# CONFIG_PREEMPT_NONE is not set 105# CONFIG_PREEMPT_NONE is not set
98CONFIG_PREEMPT_VOLUNTARY=y 106CONFIG_PREEMPT_VOLUNTARY=y
99# CONFIG_PREEMPT is not set 107# CONFIG_PREEMPT is not set
108CONFIG_FREEZER=y
100 109
101# 110#
102# Blackfin Processor Options 111# Blackfin Processor Options
@@ -105,6 +114,10 @@ CONFIG_PREEMPT_VOLUNTARY=y
105# 114#
106# Processor and Board Settings 115# Processor and Board Settings
107# 116#
117# CONFIG_BF512 is not set
118# CONFIG_BF514 is not set
119# CONFIG_BF516 is not set
120# CONFIG_BF518 is not set
108# CONFIG_BF522 is not set 121# CONFIG_BF522 is not set
109# CONFIG_BF523 is not set 122# CONFIG_BF523 is not set
110# CONFIG_BF524 is not set 123# CONFIG_BF524 is not set
@@ -117,24 +130,30 @@ CONFIG_BF533=y
117# CONFIG_BF534 is not set 130# CONFIG_BF534 is not set
118# CONFIG_BF536 is not set 131# CONFIG_BF536 is not set
119# CONFIG_BF537 is not set 132# CONFIG_BF537 is not set
133# CONFIG_BF538 is not set
134# CONFIG_BF539 is not set
120# CONFIG_BF542 is not set 135# CONFIG_BF542 is not set
121# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
122# CONFIG_BF547 is not set 137# CONFIG_BF547 is not set
123# CONFIG_BF548 is not set 138# CONFIG_BF548 is not set
124# CONFIG_BF549 is not set 139# CONFIG_BF549 is not set
125# CONFIG_BF561 is not set 140# CONFIG_BF561 is not set
141CONFIG_BF_REV_MIN=3
142CONFIG_BF_REV_MAX=6
126# CONFIG_BF_REV_0_0 is not set 143# CONFIG_BF_REV_0_0 is not set
127# CONFIG_BF_REV_0_1 is not set 144# CONFIG_BF_REV_0_1 is not set
128# CONFIG_BF_REV_0_2 is not set 145# CONFIG_BF_REV_0_2 is not set
129CONFIG_BF_REV_0_3=y 146CONFIG_BF_REV_0_3=y
130# CONFIG_BF_REV_0_4 is not set 147# CONFIG_BF_REV_0_4 is not set
131# CONFIG_BF_REV_0_5 is not set 148# CONFIG_BF_REV_0_5 is not set
149# CONFIG_BF_REV_0_6 is not set
132# CONFIG_BF_REV_ANY is not set 150# CONFIG_BF_REV_ANY is not set
133# CONFIG_BF_REV_NONE is not set 151# CONFIG_BF_REV_NONE is not set
134CONFIG_BF53x=y 152CONFIG_BF53x=y
135CONFIG_MEM_MT48LC64M4A2FB_7E=y 153CONFIG_MEM_MT48LC64M4A2FB_7E=y
136# CONFIG_BFIN533_EZKIT is not set 154# CONFIG_BFIN533_EZKIT is not set
137CONFIG_BFIN533_STAMP=y 155CONFIG_BFIN533_STAMP=y
156# CONFIG_BLACKSTAMP is not set
138# CONFIG_BFIN533_BLUETECHNIX_CM is not set 157# CONFIG_BFIN533_BLUETECHNIX_CM is not set
139# CONFIG_H8606_HVSISTEMAS is not set 158# CONFIG_H8606_HVSISTEMAS is not set
140# CONFIG_BFIN532_IP0X is not set 159# CONFIG_BFIN532_IP0X is not set
@@ -187,7 +206,6 @@ CONFIG_BOOT_LOAD=0x1000
187# 206#
188CONFIG_CLKIN_HZ=11059200 207CONFIG_CLKIN_HZ=11059200
189# CONFIG_BFIN_KERNEL_CLOCK is not set 208# CONFIG_BFIN_KERNEL_CLOCK is not set
190CONFIG_MAX_MEM_SIZE=512
191CONFIG_MAX_VCO_HZ=750000000 209CONFIG_MAX_VCO_HZ=750000000
192CONFIG_MIN_VCO_HZ=50000000 210CONFIG_MIN_VCO_HZ=50000000
193CONFIG_MAX_SCLK_HZ=133333333 211CONFIG_MAX_SCLK_HZ=133333333
@@ -201,6 +219,7 @@ CONFIG_HZ_250=y
201# CONFIG_HZ_300 is not set 219# CONFIG_HZ_300 is not set
202# CONFIG_HZ_1000 is not set 220# CONFIG_HZ_1000 is not set
203CONFIG_HZ=250 221CONFIG_HZ=250
222CONFIG_SCHED_HRTICK=y
204CONFIG_GENERIC_TIME=y 223CONFIG_GENERIC_TIME=y
205CONFIG_GENERIC_CLOCKEVENTS=y 224CONFIG_GENERIC_CLOCKEVENTS=y
206# CONFIG_CYCLES_CLOCKSOURCE is not set 225# CONFIG_CYCLES_CLOCKSOURCE is not set
@@ -238,6 +257,12 @@ CONFIG_SYS_BFIN_SPINLOCK_L1=y
238CONFIG_CACHELINE_ALIGNED_L1=y 257CONFIG_CACHELINE_ALIGNED_L1=y
239# CONFIG_SYSCALL_TAB_L1 is not set 258# CONFIG_SYSCALL_TAB_L1 is not set
240# CONFIG_CPLB_SWITCH_TAB_L1 is not set 259# CONFIG_CPLB_SWITCH_TAB_L1 is not set
260CONFIG_APP_STACK_L1=y
261
262#
263# Speed Optimizations
264#
265CONFIG_BFIN_INS_LOWOVERHEAD=y
241CONFIG_RAMKERNEL=y 266CONFIG_RAMKERNEL=y
242# CONFIG_ROMKERNEL is not set 267# CONFIG_ROMKERNEL is not set
243CONFIG_SELECT_MEMORY_MODEL=y 268CONFIG_SELECT_MEMORY_MODEL=y
@@ -246,14 +271,13 @@ CONFIG_FLATMEM_MANUAL=y
246# CONFIG_SPARSEMEM_MANUAL is not set 271# CONFIG_SPARSEMEM_MANUAL is not set
247CONFIG_FLATMEM=y 272CONFIG_FLATMEM=y
248CONFIG_FLAT_NODE_MEM_MAP=y 273CONFIG_FLAT_NODE_MEM_MAP=y
249# CONFIG_SPARSEMEM_STATIC is not set 274CONFIG_PAGEFLAGS_EXTENDED=y
250# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
251CONFIG_SPLIT_PTLOCK_CPUS=4 275CONFIG_SPLIT_PTLOCK_CPUS=4
252# CONFIG_RESOURCES_64BIT is not set 276# CONFIG_RESOURCES_64BIT is not set
277# CONFIG_PHYS_ADDR_T_64BIT is not set
253CONFIG_ZONE_DMA_FLAG=1 278CONFIG_ZONE_DMA_FLAG=1
254CONFIG_VIRT_TO_BUS=y 279CONFIG_VIRT_TO_BUS=y
255# CONFIG_BFIN_GPTIMERS is not set 280# CONFIG_BFIN_GPTIMERS is not set
256CONFIG_BFIN_DMA_5XX=y
257# CONFIG_DMA_UNCACHED_4M is not set 281# CONFIG_DMA_UNCACHED_4M is not set
258# CONFIG_DMA_UNCACHED_2M is not set 282# CONFIG_DMA_UNCACHED_2M is not set
259CONFIG_DMA_UNCACHED_1M=y 283CONFIG_DMA_UNCACHED_1M=y
@@ -268,7 +292,6 @@ CONFIG_BFIN_DCACHE=y
268# CONFIG_BFIN_ICACHE_LOCK is not set 292# CONFIG_BFIN_ICACHE_LOCK is not set
269# CONFIG_BFIN_WB is not set 293# CONFIG_BFIN_WB is not set
270CONFIG_BFIN_WT=y 294CONFIG_BFIN_WT=y
271CONFIG_L1_MAX_PIECE=16
272# CONFIG_MPU is not set 295# CONFIG_MPU is not set
273 296
274# 297#
@@ -297,7 +320,6 @@ CONFIG_BANK_3=0xAAC2
297# 320#
298# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 321# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
299# 322#
300# CONFIG_PCI is not set
301# CONFIG_ARCH_SUPPORTS_MSI is not set 323# CONFIG_ARCH_SUPPORTS_MSI is not set
302# CONFIG_PCCARD is not set 324# CONFIG_PCCARD is not set
303 325
@@ -308,29 +330,30 @@ CONFIG_BINFMT_ELF_FDPIC=y
308CONFIG_BINFMT_FLAT=y 330CONFIG_BINFMT_FLAT=y
309CONFIG_BINFMT_ZFLAT=y 331CONFIG_BINFMT_ZFLAT=y
310# CONFIG_BINFMT_SHARED_FLAT is not set 332# CONFIG_BINFMT_SHARED_FLAT is not set
333# CONFIG_HAVE_AOUT is not set
311# CONFIG_BINFMT_MISC is not set 334# CONFIG_BINFMT_MISC is not set
312 335
313# 336#
314# Power management options 337# Power management options
315# 338#
316CONFIG_PM=y 339CONFIG_PM=y
317# CONFIG_PM_LEGACY is not set
318# CONFIG_PM_DEBUG is not set 340# CONFIG_PM_DEBUG is not set
319CONFIG_PM_SLEEP=y 341CONFIG_PM_SLEEP=y
320CONFIG_SUSPEND_UP_POSSIBLE=y
321CONFIG_SUSPEND=y 342CONFIG_SUSPEND=y
343CONFIG_SUSPEND_FREEZER=y
344CONFIG_ARCH_SUSPEND_POSSIBLE=y
322CONFIG_PM_BFIN_SLEEP_DEEPER=y 345CONFIG_PM_BFIN_SLEEP_DEEPER=y
323# CONFIG_PM_BFIN_SLEEP is not set 346# CONFIG_PM_BFIN_SLEEP is not set
324# CONFIG_PM_WAKEUP_BY_GPIO is not set 347# CONFIG_PM_WAKEUP_BY_GPIO is not set
325 348
326# 349#
327# CPU Frequency scaling 350# Possible Suspend Mem / Hibernate Wake-Up Sources
328# 351#
329# CONFIG_CPU_FREQ is not set
330 352
331# 353#
332# Networking 354# CPU Frequency scaling
333# 355#
356# CONFIG_CPU_FREQ is not set
334CONFIG_NET=y 357CONFIG_NET=y
335 358
336# 359#
@@ -343,6 +366,7 @@ CONFIG_XFRM=y
343# CONFIG_XFRM_USER is not set 366# CONFIG_XFRM_USER is not set
344# CONFIG_XFRM_SUB_POLICY is not set 367# CONFIG_XFRM_SUB_POLICY is not set
345# CONFIG_XFRM_MIGRATE is not set 368# CONFIG_XFRM_MIGRATE is not set
369# CONFIG_XFRM_STATISTICS is not set
346# CONFIG_NET_KEY is not set 370# CONFIG_NET_KEY is not set
347CONFIG_INET=y 371CONFIG_INET=y
348# CONFIG_IP_MULTICAST is not set 372# CONFIG_IP_MULTICAST is not set
@@ -372,8 +396,6 @@ CONFIG_TCP_CONG_CUBIC=y
372CONFIG_DEFAULT_TCP_CONG="cubic" 396CONFIG_DEFAULT_TCP_CONG="cubic"
373# CONFIG_TCP_MD5SIG is not set 397# CONFIG_TCP_MD5SIG is not set
374# CONFIG_IPV6 is not set 398# CONFIG_IPV6 is not set
375# CONFIG_INET6_XFRM_TUNNEL is not set
376# CONFIG_INET6_TUNNEL is not set
377# CONFIG_NETLABEL is not set 399# CONFIG_NETLABEL is not set
378# CONFIG_NETWORK_SECMARK is not set 400# CONFIG_NETWORK_SECMARK is not set
379# CONFIG_NETFILTER is not set 401# CONFIG_NETFILTER is not set
@@ -382,6 +404,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
382# CONFIG_TIPC is not set 404# CONFIG_TIPC is not set
383# CONFIG_ATM is not set 405# CONFIG_ATM is not set
384# CONFIG_BRIDGE is not set 406# CONFIG_BRIDGE is not set
407# CONFIG_NET_DSA is not set
385# CONFIG_VLAN_8021Q is not set 408# CONFIG_VLAN_8021Q is not set
386# CONFIG_DECNET is not set 409# CONFIG_DECNET is not set
387# CONFIG_LLC2 is not set 410# CONFIG_LLC2 is not set
@@ -398,6 +421,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
398# 421#
399# CONFIG_NET_PKTGEN is not set 422# CONFIG_NET_PKTGEN is not set
400# CONFIG_HAMRADIO is not set 423# CONFIG_HAMRADIO is not set
424# CONFIG_CAN is not set
401CONFIG_IRDA=m 425CONFIG_IRDA=m
402 426
403# 427#
@@ -432,24 +456,14 @@ CONFIG_SIR_BFIN_DMA=y
432# CONFIG_DONGLE is not set 456# CONFIG_DONGLE is not set
433 457
434# 458#
435# Old SIR device drivers
436#
437# CONFIG_IRPORT_SIR is not set
438
439#
440# Old Serial dongle support
441#
442
443#
444# FIR device drivers 459# FIR device drivers
445# 460#
446# CONFIG_BT is not set 461# CONFIG_BT is not set
447# CONFIG_AF_RXRPC is not set 462# CONFIG_AF_RXRPC is not set
448 463# CONFIG_PHONET is not set
449# 464CONFIG_WIRELESS=y
450# Wireless
451#
452# CONFIG_CFG80211 is not set 465# CONFIG_CFG80211 is not set
466CONFIG_WIRELESS_OLD_REGULATORY=y
453# CONFIG_WIRELESS_EXT is not set 467# CONFIG_WIRELESS_EXT is not set
454# CONFIG_MAC80211 is not set 468# CONFIG_MAC80211 is not set
455# CONFIG_IEEE80211 is not set 469# CONFIG_IEEE80211 is not set
@@ -467,6 +481,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
467CONFIG_STANDALONE=y 481CONFIG_STANDALONE=y
468CONFIG_PREVENT_FIRMWARE_BUILD=y 482CONFIG_PREVENT_FIRMWARE_BUILD=y
469# CONFIG_FW_LOADER is not set 483# CONFIG_FW_LOADER is not set
484# CONFIG_DEBUG_DRIVER is not set
485# CONFIG_DEBUG_DEVRES is not set
470# CONFIG_SYS_HYPERVISOR is not set 486# CONFIG_SYS_HYPERVISOR is not set
471# CONFIG_CONNECTOR is not set 487# CONFIG_CONNECTOR is not set
472CONFIG_MTD=y 488CONFIG_MTD=y
@@ -475,6 +491,7 @@ CONFIG_MTD=y
475CONFIG_MTD_PARTITIONS=y 491CONFIG_MTD_PARTITIONS=y
476# CONFIG_MTD_REDBOOT_PARTS is not set 492# CONFIG_MTD_REDBOOT_PARTS is not set
477CONFIG_MTD_CMDLINE_PARTS=y 493CONFIG_MTD_CMDLINE_PARTS=y
494# CONFIG_MTD_AR7_PARTS is not set
478 495
479# 496#
480# User Modules And Translation Layers 497# User Modules And Translation Layers
@@ -520,6 +537,7 @@ CONFIG_MTD_ROM=m
520CONFIG_MTD_COMPLEX_MAPPINGS=y 537CONFIG_MTD_COMPLEX_MAPPINGS=y
521# CONFIG_MTD_PHYSMAP is not set 538# CONFIG_MTD_PHYSMAP is not set
522CONFIG_MTD_BFIN_ASYNC=m 539CONFIG_MTD_BFIN_ASYNC=m
540# CONFIG_MTD_GPIO_ADDR is not set
523# CONFIG_MTD_UCLINUX is not set 541# CONFIG_MTD_UCLINUX is not set
524# CONFIG_MTD_PLATRAM is not set 542# CONFIG_MTD_PLATRAM is not set
525 543
@@ -554,11 +572,14 @@ CONFIG_BLK_DEV=y
554CONFIG_BLK_DEV_RAM=y 572CONFIG_BLK_DEV_RAM=y
555CONFIG_BLK_DEV_RAM_COUNT=16 573CONFIG_BLK_DEV_RAM_COUNT=16
556CONFIG_BLK_DEV_RAM_SIZE=4096 574CONFIG_BLK_DEV_RAM_SIZE=4096
557CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 575# CONFIG_BLK_DEV_XIP is not set
558# CONFIG_CDROM_PKTCDVD is not set 576# CONFIG_CDROM_PKTCDVD is not set
559# CONFIG_ATA_OVER_ETH is not set 577# CONFIG_ATA_OVER_ETH is not set
578# CONFIG_BLK_DEV_HD is not set
560CONFIG_MISC_DEVICES=y 579CONFIG_MISC_DEVICES=y
561# CONFIG_EEPROM_93CX6 is not set 580# CONFIG_EEPROM_93CX6 is not set
581# CONFIG_ENCLOSURE_SERVICES is not set
582CONFIG_HAVE_IDE=y
562# CONFIG_IDE is not set 583# CONFIG_IDE is not set
563 584
564# 585#
@@ -571,7 +592,6 @@ CONFIG_MISC_DEVICES=y
571# CONFIG_ATA is not set 592# CONFIG_ATA is not set
572# CONFIG_MD is not set 593# CONFIG_MD is not set
573CONFIG_NETDEVICES=y 594CONFIG_NETDEVICES=y
574# CONFIG_NETDEVICES_MULTIQUEUE is not set
575# CONFIG_DUMMY is not set 595# CONFIG_DUMMY is not set
576# CONFIG_BONDING is not set 596# CONFIG_BONDING is not set
577# CONFIG_MACVLAN is not set 597# CONFIG_MACVLAN is not set
@@ -584,11 +604,14 @@ CONFIG_MII=y
584CONFIG_SMC91X=y 604CONFIG_SMC91X=y
585# CONFIG_SMSC911X is not set 605# CONFIG_SMSC911X is not set
586# CONFIG_DM9000 is not set 606# CONFIG_DM9000 is not set
607# CONFIG_ENC28J60 is not set
587# CONFIG_IBM_NEW_EMAC_ZMII is not set 608# CONFIG_IBM_NEW_EMAC_ZMII is not set
588# CONFIG_IBM_NEW_EMAC_RGMII is not set 609# CONFIG_IBM_NEW_EMAC_RGMII is not set
589# CONFIG_IBM_NEW_EMAC_TAH is not set 610# CONFIG_IBM_NEW_EMAC_TAH is not set
590# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 611# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
591# CONFIG_B44 is not set 612# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
613# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
614# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
592CONFIG_NETDEV_1000=y 615CONFIG_NETDEV_1000=y
593# CONFIG_AX88180 is not set 616# CONFIG_AX88180 is not set
594CONFIG_NETDEV_10000=y 617CONFIG_NETDEV_10000=y
@@ -598,10 +621,10 @@ CONFIG_NETDEV_10000=y
598# 621#
599# CONFIG_WLAN_PRE80211 is not set 622# CONFIG_WLAN_PRE80211 is not set
600# CONFIG_WLAN_80211 is not set 623# CONFIG_WLAN_80211 is not set
624# CONFIG_IWLWIFI_LEDS is not set
601# CONFIG_WAN is not set 625# CONFIG_WAN is not set
602# CONFIG_PPP is not set 626# CONFIG_PPP is not set
603# CONFIG_SLIP is not set 627# CONFIG_SLIP is not set
604# CONFIG_SHAPER is not set
605# CONFIG_NETCONSOLE is not set 628# CONFIG_NETCONSOLE is not set
606# CONFIG_NETPOLL is not set 629# CONFIG_NETPOLL is not set
607# CONFIG_NET_POLL_CONTROLLER is not set 630# CONFIG_NET_POLL_CONTROLLER is not set
@@ -633,7 +656,7 @@ CONFIG_INPUT_EVDEV=m
633# CONFIG_INPUT_TOUCHSCREEN is not set 656# CONFIG_INPUT_TOUCHSCREEN is not set
634CONFIG_INPUT_MISC=y 657CONFIG_INPUT_MISC=y
635# CONFIG_INPUT_UINPUT is not set 658# CONFIG_INPUT_UINPUT is not set
636CONFIG_TWI_KEYPAD=m 659CONFIG_CONFIG_INPUT_PCF8574=m
637 660
638# 661#
639# Hardware I/O ports 662# Hardware I/O ports
@@ -652,8 +675,11 @@ CONFIG_TWI_KEYPAD=m
652CONFIG_BFIN_SPORT=y 675CONFIG_BFIN_SPORT=y
653# CONFIG_BFIN_TIMER_LATENCY is not set 676# CONFIG_BFIN_TIMER_LATENCY is not set
654CONFIG_TWI_LCD=m 677CONFIG_TWI_LCD=m
678CONFIG_BFIN_DMA_INTERFACE=m
655CONFIG_SIMPLE_GPIO=m 679CONFIG_SIMPLE_GPIO=m
656# CONFIG_VT is not set 680# CONFIG_VT is not set
681# CONFIG_DEVKMEM is not set
682# CONFIG_BFIN_JTAG_COMM is not set
657# CONFIG_SERIAL_NONSTANDARD is not set 683# CONFIG_SERIAL_NONSTANDARD is not set
658 684
659# 685#
@@ -682,41 +708,46 @@ CONFIG_UNIX98_PTYS=y
682# CONFIG_CAN4LINUX is not set 708# CONFIG_CAN4LINUX is not set
683# CONFIG_IPMI_HANDLER is not set 709# CONFIG_IPMI_HANDLER is not set
684# CONFIG_HW_RANDOM is not set 710# CONFIG_HW_RANDOM is not set
685# CONFIG_GEN_RTC is not set
686# CONFIG_R3964 is not set 711# CONFIG_R3964 is not set
687# CONFIG_RAW_DRIVER is not set 712# CONFIG_RAW_DRIVER is not set
688# CONFIG_TCG_TPM is not set 713# CONFIG_TCG_TPM is not set
689CONFIG_I2C=m 714CONFIG_I2C=m
690CONFIG_I2C_BOARDINFO=y 715CONFIG_I2C_BOARDINFO=y
691CONFIG_I2C_CHARDEV=m 716CONFIG_I2C_CHARDEV=m
717CONFIG_I2C_HELPER_AUTO=y
692 718
693# 719#
694# I2C Algorithms 720# I2C Hardware Bus support
695# 721#
696CONFIG_I2C_ALGOBIT=m
697# CONFIG_I2C_ALGOPCF is not set
698# CONFIG_I2C_ALGOPCA is not set
699 722
700# 723#
701# I2C Hardware Bus support 724# I2C system bus drivers (mostly embedded / system-on-chip)
702# 725#
703# CONFIG_I2C_GPIO is not set 726# CONFIG_I2C_GPIO is not set
704# CONFIG_I2C_OCORES is not set 727# CONFIG_I2C_OCORES is not set
705# CONFIG_I2C_PARPORT_LIGHT is not set
706# CONFIG_I2C_SIMTEC is not set 728# CONFIG_I2C_SIMTEC is not set
729
730#
731# External I2C/SMBus adapter drivers
732#
733# CONFIG_I2C_PARPORT_LIGHT is not set
707# CONFIG_I2C_TAOS_EVM is not set 734# CONFIG_I2C_TAOS_EVM is not set
735
736#
737# Other I2C/SMBus bus drivers
738#
739# CONFIG_I2C_PCA_PLATFORM is not set
708# CONFIG_I2C_STUB is not set 740# CONFIG_I2C_STUB is not set
709 741
710# 742#
711# Miscellaneous I2C Chip support 743# Miscellaneous I2C Chip support
712# 744#
713# CONFIG_SENSORS_DS1337 is not set
714# CONFIG_SENSORS_DS1374 is not set
715# CONFIG_DS1682 is not set 745# CONFIG_DS1682 is not set
746# CONFIG_AT24 is not set
716# CONFIG_SENSORS_AD5252 is not set 747# CONFIG_SENSORS_AD5252 is not set
717# CONFIG_SENSORS_EEPROM is not set 748# CONFIG_SENSORS_EEPROM is not set
718# CONFIG_SENSORS_PCF8574 is not set 749# CONFIG_SENSORS_PCF8574 is not set
719# CONFIG_SENSORS_PCF8575 is not set 750# CONFIG_PCF8575 is not set
720# CONFIG_SENSORS_PCA9539 is not set 751# CONFIG_SENSORS_PCA9539 is not set
721# CONFIG_SENSORS_PCF8591 is not set 752# CONFIG_SENSORS_PCF8591 is not set
722# CONFIG_SENSORS_MAX6875 is not set 753# CONFIG_SENSORS_MAX6875 is not set
@@ -725,17 +756,15 @@ CONFIG_I2C_ALGOBIT=m
725# CONFIG_I2C_DEBUG_ALGO is not set 756# CONFIG_I2C_DEBUG_ALGO is not set
726# CONFIG_I2C_DEBUG_BUS is not set 757# CONFIG_I2C_DEBUG_BUS is not set
727# CONFIG_I2C_DEBUG_CHIP is not set 758# CONFIG_I2C_DEBUG_CHIP is not set
728
729#
730# SPI support
731#
732CONFIG_SPI=y 759CONFIG_SPI=y
760# CONFIG_SPI_DEBUG is not set
733CONFIG_SPI_MASTER=y 761CONFIG_SPI_MASTER=y
734 762
735# 763#
736# SPI Master Controller Drivers 764# SPI Master Controller Drivers
737# 765#
738CONFIG_SPI_BFIN=y 766CONFIG_SPI_BFIN=y
767# CONFIG_SPI_BFIN_LOCK is not set
739# CONFIG_SPI_BITBANG is not set 768# CONFIG_SPI_BITBANG is not set
740 769
741# 770#
@@ -744,11 +773,15 @@ CONFIG_SPI_BFIN=y
744# CONFIG_SPI_AT25 is not set 773# CONFIG_SPI_AT25 is not set
745# CONFIG_SPI_SPIDEV is not set 774# CONFIG_SPI_SPIDEV is not set
746# CONFIG_SPI_TLE62X0 is not set 775# CONFIG_SPI_TLE62X0 is not set
776CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
777# CONFIG_GPIOLIB is not set
747# CONFIG_W1 is not set 778# CONFIG_W1 is not set
748# CONFIG_POWER_SUPPLY is not set 779# CONFIG_POWER_SUPPLY is not set
749CONFIG_HWMON=y 780CONFIG_HWMON=y
750# CONFIG_HWMON_VID is not set 781# CONFIG_HWMON_VID is not set
782# CONFIG_SENSORS_AD7414 is not set
751# CONFIG_SENSORS_AD7418 is not set 783# CONFIG_SENSORS_AD7418 is not set
784# CONFIG_SENSORS_ADCXX is not set
752# CONFIG_SENSORS_ADM1021 is not set 785# CONFIG_SENSORS_ADM1021 is not set
753# CONFIG_SENSORS_ADM1025 is not set 786# CONFIG_SENSORS_ADM1025 is not set
754# CONFIG_SENSORS_ADM1026 is not set 787# CONFIG_SENSORS_ADM1026 is not set
@@ -756,6 +789,7 @@ CONFIG_HWMON=y
756# CONFIG_SENSORS_ADM1031 is not set 789# CONFIG_SENSORS_ADM1031 is not set
757# CONFIG_SENSORS_ADM9240 is not set 790# CONFIG_SENSORS_ADM9240 is not set
758# CONFIG_SENSORS_ADT7470 is not set 791# CONFIG_SENSORS_ADT7470 is not set
792# CONFIG_SENSORS_ADT7473 is not set
759# CONFIG_SENSORS_ATXP1 is not set 793# CONFIG_SENSORS_ATXP1 is not set
760# CONFIG_SENSORS_DS1621 is not set 794# CONFIG_SENSORS_DS1621 is not set
761# CONFIG_SENSORS_F71805F is not set 795# CONFIG_SENSORS_F71805F is not set
@@ -776,6 +810,7 @@ CONFIG_HWMON=y
776# CONFIG_SENSORS_LM90 is not set 810# CONFIG_SENSORS_LM90 is not set
777# CONFIG_SENSORS_LM92 is not set 811# CONFIG_SENSORS_LM92 is not set
778# CONFIG_SENSORS_LM93 is not set 812# CONFIG_SENSORS_LM93 is not set
813# CONFIG_SENSORS_MAX1111 is not set
779# CONFIG_SENSORS_MAX1619 is not set 814# CONFIG_SENSORS_MAX1619 is not set
780# CONFIG_SENSORS_MAX6650 is not set 815# CONFIG_SENSORS_MAX6650 is not set
781# CONFIG_SENSORS_PC87360 is not set 816# CONFIG_SENSORS_PC87360 is not set
@@ -784,6 +819,7 @@ CONFIG_HWMON=y
784# CONFIG_SENSORS_SMSC47M1 is not set 819# CONFIG_SENSORS_SMSC47M1 is not set
785# CONFIG_SENSORS_SMSC47M192 is not set 820# CONFIG_SENSORS_SMSC47M192 is not set
786# CONFIG_SENSORS_SMSC47B397 is not set 821# CONFIG_SENSORS_SMSC47B397 is not set
822# CONFIG_SENSORS_ADS7828 is not set
787# CONFIG_SENSORS_THMC50 is not set 823# CONFIG_SENSORS_THMC50 is not set
788# CONFIG_SENSORS_VT1211 is not set 824# CONFIG_SENSORS_VT1211 is not set
789# CONFIG_SENSORS_W83781D is not set 825# CONFIG_SENSORS_W83781D is not set
@@ -791,9 +827,12 @@ CONFIG_HWMON=y
791# CONFIG_SENSORS_W83792D is not set 827# CONFIG_SENSORS_W83792D is not set
792# CONFIG_SENSORS_W83793 is not set 828# CONFIG_SENSORS_W83793 is not set
793# CONFIG_SENSORS_W83L785TS is not set 829# CONFIG_SENSORS_W83L785TS is not set
830# CONFIG_SENSORS_W83L786NG is not set
794# CONFIG_SENSORS_W83627HF is not set 831# CONFIG_SENSORS_W83627HF is not set
795# CONFIG_SENSORS_W83627EHF is not set 832# CONFIG_SENSORS_W83627EHF is not set
796# CONFIG_HWMON_DEBUG_CHIP is not set 833# CONFIG_HWMON_DEBUG_CHIP is not set
834# CONFIG_THERMAL is not set
835# CONFIG_THERMAL_HWMON is not set
797CONFIG_WATCHDOG=y 836CONFIG_WATCHDOG=y
798# CONFIG_WATCHDOG_NOWAYOUT is not set 837# CONFIG_WATCHDOG_NOWAYOUT is not set
799 838
@@ -804,21 +843,29 @@ CONFIG_WATCHDOG=y
804CONFIG_BFIN_WDT=y 843CONFIG_BFIN_WDT=y
805 844
806# 845#
807# Sonics Silicon Backplane
808#
809CONFIG_SSB_POSSIBLE=y
810# CONFIG_SSB is not set
811
812#
813# Multifunction device drivers 846# Multifunction device drivers
814# 847#
848# CONFIG_MFD_CORE is not set
815# CONFIG_MFD_SM501 is not set 849# CONFIG_MFD_SM501 is not set
850# CONFIG_HTC_PASIC3 is not set
851# CONFIG_MFD_TMIO is not set
852# CONFIG_MFD_WM8400 is not set
853# CONFIG_MFD_WM8350_I2C is not set
816 854
817# 855#
818# Multimedia devices 856# Multimedia devices
819# 857#
858
859#
860# Multimedia core support
861#
820# CONFIG_VIDEO_DEV is not set 862# CONFIG_VIDEO_DEV is not set
821# CONFIG_DVB_CORE is not set 863# CONFIG_DVB_CORE is not set
864# CONFIG_VIDEO_MEDIA is not set
865
866#
867# Multimedia drivers
868#
822# CONFIG_DAB is not set 869# CONFIG_DAB is not set
823 870
824# 871#
@@ -829,6 +876,7 @@ CONFIG_SSB_POSSIBLE=y
829CONFIG_FB=m 876CONFIG_FB=m
830CONFIG_FIRMWARE_EDID=y 877CONFIG_FIRMWARE_EDID=y
831# CONFIG_FB_DDC is not set 878# CONFIG_FB_DDC is not set
879# CONFIG_FB_BOOT_VESA_SUPPORT is not set
832CONFIG_FB_CFB_FILLRECT=m 880CONFIG_FB_CFB_FILLRECT=m
833CONFIG_FB_CFB_COPYAREA=m 881CONFIG_FB_CFB_COPYAREA=m
834CONFIG_FB_CFB_IMAGEBLIT=m 882CONFIG_FB_CFB_IMAGEBLIT=m
@@ -836,8 +884,8 @@ CONFIG_FB_CFB_IMAGEBLIT=m
836# CONFIG_FB_SYS_FILLRECT is not set 884# CONFIG_FB_SYS_FILLRECT is not set
837# CONFIG_FB_SYS_COPYAREA is not set 885# CONFIG_FB_SYS_COPYAREA is not set
838# CONFIG_FB_SYS_IMAGEBLIT is not set 886# CONFIG_FB_SYS_IMAGEBLIT is not set
887# CONFIG_FB_FOREIGN_ENDIAN is not set
839# CONFIG_FB_SYS_FOPS is not set 888# CONFIG_FB_SYS_FOPS is not set
840CONFIG_FB_DEFERRED_IO=y
841# CONFIG_FB_SVGALIB is not set 889# CONFIG_FB_SVGALIB is not set
842# CONFIG_FB_MACMODES is not set 890# CONFIG_FB_MACMODES is not set
843# CONFIG_FB_BACKLIGHT is not set 891# CONFIG_FB_BACKLIGHT is not set
@@ -848,6 +896,7 @@ CONFIG_FB_DEFERRED_IO=y
848# Frame buffer hardware drivers 896# Frame buffer hardware drivers
849# 897#
850# CONFIG_FB_BFIN_T350MCQB is not set 898# CONFIG_FB_BFIN_T350MCQB is not set
899# CONFIG_FB_BFIN_LQ035Q1 is not set
851CONFIG_FB_BFIN_7393=m 900CONFIG_FB_BFIN_7393=m
852CONFIG_NTSC=y 901CONFIG_NTSC=y
853# CONFIG_PAL is not set 902# CONFIG_PAL is not set
@@ -859,6 +908,7 @@ CONFIG_ADV7393_1XMEM=y
859# CONFIG_ADV7393_2XMEM is not set 908# CONFIG_ADV7393_2XMEM is not set
860# CONFIG_FB_S1D13XXX is not set 909# CONFIG_FB_S1D13XXX is not set
861# CONFIG_FB_VIRTUAL is not set 910# CONFIG_FB_VIRTUAL is not set
911# CONFIG_FB_METRONOME is not set
862# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 912# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
863 913
864# 914#
@@ -866,15 +916,8 @@ CONFIG_ADV7393_1XMEM=y
866# 916#
867# CONFIG_DISPLAY_SUPPORT is not set 917# CONFIG_DISPLAY_SUPPORT is not set
868# CONFIG_LOGO is not set 918# CONFIG_LOGO is not set
869
870#
871# Sound
872#
873CONFIG_SOUND=m 919CONFIG_SOUND=m
874 920CONFIG_SOUND_OSS_CORE=y
875#
876# Advanced Linux Sound Architecture
877#
878CONFIG_SND=m 921CONFIG_SND=m
879CONFIG_SND_TIMER=m 922CONFIG_SND_TIMER=m
880CONFIG_SND_PCM=m 923CONFIG_SND_PCM=m
@@ -888,18 +931,12 @@ CONFIG_SND_SUPPORT_OLD_API=y
888CONFIG_SND_VERBOSE_PROCFS=y 931CONFIG_SND_VERBOSE_PROCFS=y
889# CONFIG_SND_VERBOSE_PRINTK is not set 932# CONFIG_SND_VERBOSE_PRINTK is not set
890# CONFIG_SND_DEBUG is not set 933# CONFIG_SND_DEBUG is not set
891 934CONFIG_SND_DRIVERS=y
892#
893# Generic devices
894#
895# CONFIG_SND_DUMMY is not set 935# CONFIG_SND_DUMMY is not set
896# CONFIG_SND_MTPAV is not set 936# CONFIG_SND_MTPAV is not set
897# CONFIG_SND_SERIAL_U16550 is not set 937# CONFIG_SND_SERIAL_U16550 is not set
898# CONFIG_SND_MPU401 is not set 938# CONFIG_SND_MPU401 is not set
899 939CONFIG_SND_SPI=y
900#
901# SPI devices
902#
903 940
904# 941#
905# ALSA Blackfin devices 942# ALSA Blackfin devices
@@ -911,46 +948,46 @@ CONFIG_SND_BLACKFIN_AD1836_MULSUB=y
911# CONFIG_SND_BLACKFIN_AD1836_5P1 is not set 948# CONFIG_SND_BLACKFIN_AD1836_5P1 is not set
912CONFIG_SND_BLACKFIN_SPORT=0 949CONFIG_SND_BLACKFIN_SPORT=0
913CONFIG_SND_BLACKFIN_SPI_PFBIT=4 950CONFIG_SND_BLACKFIN_SPI_PFBIT=4
914CONFIG_SND_BFIN_AD73311=m
915CONFIG_SND_BFIN_SPORT=0 951CONFIG_SND_BFIN_SPORT=0
916CONFIG_SND_BFIN_AD73311_SE=4
917CONFIG_SND_BFIN_AD73322=m 952CONFIG_SND_BFIN_AD73322=m
918CONFIG_SND_BFIN_AD73322_SPORT0_SE=10 953CONFIG_SND_BFIN_AD73322_SPORT0_SE=10
919CONFIG_SND_BFIN_AD73322_SPORT1_SE=14 954CONFIG_SND_BFIN_AD73322_SPORT1_SE=14
920CONFIG_SND_BFIN_AD73322_RESET=12 955CONFIG_SND_BFIN_AD73322_RESET=12
921
922#
923# System on Chip audio support
924#
925CONFIG_SND_SOC_AC97_BUS=y
926CONFIG_SND_SOC=m 956CONFIG_SND_SOC=m
927CONFIG_SND_BF5XX_SOC=m 957CONFIG_SND_SOC_AC97_BUS=y
928CONFIG_SND_MMAP_SUPPORT=y 958CONFIG_SND_BF5XX_I2S=m
929CONFIG_SND_BF5XX_SOC_AC97=m
930# CONFIG_SND_BF5XX_SOC_WM8750 is not set
931# CONFIG_SND_BF5XX_SOC_WM8731 is not set
932# CONFIG_SND_BF5XX_SOC_SSM2602 is not set 959# CONFIG_SND_BF5XX_SOC_SSM2602 is not set
933CONFIG_SND_BF5XX_SOC_BF5xx=m 960CONFIG_SND_BF5XX_SOC_AD73311=m
961CONFIG_SND_BFIN_AD73311_SE=4
962CONFIG_SND_BF5XX_AC97=m
963CONFIG_SND_BF5XX_MMAP_SUPPORT=y
964# CONFIG_SND_BF5XX_MULTICHAN_SUPPORT is not set
965CONFIG_SND_BF5XX_SOC_SPORT=m
966CONFIG_SND_BF5XX_SOC_I2S=m
967CONFIG_SND_BF5XX_SOC_AC97=m
968CONFIG_SND_BF5XX_SOC_AD1980=m
934CONFIG_SND_BF5XX_SPORT_NUM=0 969CONFIG_SND_BF5XX_SPORT_NUM=0
935# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set 970# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
936 971# CONFIG_SND_SOC_ALL_CODECS is not set
937#
938# SoC Audio support for SuperH
939#
940CONFIG_SND_SOC_AD1980=m 972CONFIG_SND_SOC_AD1980=m
941 973CONFIG_SND_SOC_AD73311=m
942#
943# Open Sound System
944#
945# CONFIG_SOUND_PRIME is not set 974# CONFIG_SOUND_PRIME is not set
946CONFIG_AC97_BUS=m 975CONFIG_AC97_BUS=m
947CONFIG_HID_SUPPORT=y 976CONFIG_HID_SUPPORT=y
948CONFIG_HID=y 977CONFIG_HID=y
949# CONFIG_HID_DEBUG is not set 978# CONFIG_HID_DEBUG is not set
950# CONFIG_HIDRAW is not set 979# CONFIG_HIDRAW is not set
980# CONFIG_HID_PID is not set
981
982#
983# Special HID drivers
984#
985CONFIG_HID_COMPAT=y
951# CONFIG_USB_SUPPORT is not set 986# CONFIG_USB_SUPPORT is not set
952# CONFIG_MMC is not set 987# CONFIG_MMC is not set
988# CONFIG_MEMSTICK is not set
953# CONFIG_NEW_LEDS is not set 989# CONFIG_NEW_LEDS is not set
990# CONFIG_ACCESSIBILITY is not set
954CONFIG_RTC_LIB=y 991CONFIG_RTC_LIB=y
955CONFIG_RTC_CLASS=y 992CONFIG_RTC_CLASS=y
956CONFIG_RTC_HCTOSYS=y 993CONFIG_RTC_HCTOSYS=y
@@ -979,51 +1016,57 @@ CONFIG_RTC_INTF_DEV=y
979# CONFIG_RTC_DRV_PCF8563 is not set 1016# CONFIG_RTC_DRV_PCF8563 is not set
980# CONFIG_RTC_DRV_PCF8583 is not set 1017# CONFIG_RTC_DRV_PCF8583 is not set
981# CONFIG_RTC_DRV_M41T80 is not set 1018# CONFIG_RTC_DRV_M41T80 is not set
1019# CONFIG_RTC_DRV_S35390A is not set
1020# CONFIG_RTC_DRV_FM3130 is not set
982 1021
983# 1022#
984# SPI RTC drivers 1023# SPI RTC drivers
985# 1024#
986# CONFIG_RTC_DRV_RS5C348 is not set 1025# CONFIG_RTC_DRV_M41T94 is not set
1026# CONFIG_RTC_DRV_DS1305 is not set
987# CONFIG_RTC_DRV_MAX6902 is not set 1027# CONFIG_RTC_DRV_MAX6902 is not set
1028# CONFIG_RTC_DRV_R9701 is not set
1029# CONFIG_RTC_DRV_RS5C348 is not set
1030# CONFIG_RTC_DRV_DS3234 is not set
988 1031
989# 1032#
990# Platform RTC drivers 1033# Platform RTC drivers
991# 1034#
1035# CONFIG_RTC_DRV_DS1286 is not set
1036# CONFIG_RTC_DRV_DS1511 is not set
992# CONFIG_RTC_DRV_DS1553 is not set 1037# CONFIG_RTC_DRV_DS1553 is not set
993# CONFIG_RTC_DRV_STK17TA8 is not set
994# CONFIG_RTC_DRV_DS1742 is not set 1038# CONFIG_RTC_DRV_DS1742 is not set
1039# CONFIG_RTC_DRV_STK17TA8 is not set
995# CONFIG_RTC_DRV_M48T86 is not set 1040# CONFIG_RTC_DRV_M48T86 is not set
1041# CONFIG_RTC_DRV_M48T35 is not set
996# CONFIG_RTC_DRV_M48T59 is not set 1042# CONFIG_RTC_DRV_M48T59 is not set
1043# CONFIG_RTC_DRV_BQ4802 is not set
997# CONFIG_RTC_DRV_V3020 is not set 1044# CONFIG_RTC_DRV_V3020 is not set
998 1045
999# 1046#
1000# on-CPU RTC drivers 1047# on-CPU RTC drivers
1001# 1048#
1002CONFIG_RTC_DRV_BFIN=y 1049CONFIG_RTC_DRV_BFIN=y
1003 1050# CONFIG_DMADEVICES is not set
1004#
1005# Userspace I/O
1006#
1007# CONFIG_UIO is not set 1051# CONFIG_UIO is not set
1052# CONFIG_STAGING is not set
1008 1053
1009# 1054#
1010# File systems 1055# File systems
1011# 1056#
1012# CONFIG_EXT2_FS is not set 1057# CONFIG_EXT2_FS is not set
1013# CONFIG_EXT3_FS is not set 1058# CONFIG_EXT3_FS is not set
1014# CONFIG_EXT4DEV_FS is not set 1059# CONFIG_EXT4_FS is not set
1015# CONFIG_REISERFS_FS is not set 1060# CONFIG_REISERFS_FS is not set
1016# CONFIG_JFS_FS is not set 1061# CONFIG_JFS_FS is not set
1017# CONFIG_FS_POSIX_ACL is not set 1062# CONFIG_FS_POSIX_ACL is not set
1063CONFIG_FILE_LOCKING=y
1018# CONFIG_XFS_FS is not set 1064# CONFIG_XFS_FS is not set
1019# CONFIG_GFS2_FS is not set
1020# CONFIG_OCFS2_FS is not set 1065# CONFIG_OCFS2_FS is not set
1021# CONFIG_MINIX_FS is not set 1066# CONFIG_DNOTIFY is not set
1022# CONFIG_ROMFS_FS is not set
1023CONFIG_INOTIFY=y 1067CONFIG_INOTIFY=y
1024CONFIG_INOTIFY_USER=y 1068CONFIG_INOTIFY_USER=y
1025# CONFIG_QUOTA is not set 1069# CONFIG_QUOTA is not set
1026# CONFIG_DNOTIFY is not set
1027# CONFIG_AUTOFS_FS is not set 1070# CONFIG_AUTOFS_FS is not set
1028# CONFIG_AUTOFS4_FS is not set 1071# CONFIG_AUTOFS4_FS is not set
1029# CONFIG_FUSE_FS is not set 1072# CONFIG_FUSE_FS is not set
@@ -1063,11 +1106,11 @@ CONFIG_SYSFS=y
1063# CONFIG_EFS_FS is not set 1106# CONFIG_EFS_FS is not set
1064CONFIG_YAFFS_FS=m 1107CONFIG_YAFFS_FS=m
1065CONFIG_YAFFS_YAFFS1=y 1108CONFIG_YAFFS_YAFFS1=y
1109# CONFIG_YAFFS_9BYTE_TAGS is not set
1066# CONFIG_YAFFS_DOES_ECC is not set 1110# CONFIG_YAFFS_DOES_ECC is not set
1067CONFIG_YAFFS_YAFFS2=y 1111CONFIG_YAFFS_YAFFS2=y
1068CONFIG_YAFFS_AUTO_YAFFS2=y 1112CONFIG_YAFFS_AUTO_YAFFS2=y
1069# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set 1113# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1070CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
1071# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set 1114# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1072# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set 1115# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1073CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y 1116CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
@@ -1084,8 +1127,11 @@ CONFIG_JFFS2_RTIME=y
1084# CONFIG_JFFS2_RUBIN is not set 1127# CONFIG_JFFS2_RUBIN is not set
1085# CONFIG_CRAMFS is not set 1128# CONFIG_CRAMFS is not set
1086# CONFIG_VXFS_FS is not set 1129# CONFIG_VXFS_FS is not set
1130# CONFIG_MINIX_FS is not set
1131# CONFIG_OMFS_FS is not set
1087# CONFIG_HPFS_FS is not set 1132# CONFIG_HPFS_FS is not set
1088# CONFIG_QNX4FS_FS is not set 1133# CONFIG_QNX4FS_FS is not set
1134# CONFIG_ROMFS_FS is not set
1089# CONFIG_SYSV_FS is not set 1135# CONFIG_SYSV_FS is not set
1090# CONFIG_UFS_FS is not set 1136# CONFIG_UFS_FS is not set
1091CONFIG_NETWORK_FILESYSTEMS=y 1137CONFIG_NETWORK_FILESYSTEMS=y
@@ -1093,13 +1139,12 @@ CONFIG_NFS_FS=m
1093CONFIG_NFS_V3=y 1139CONFIG_NFS_V3=y
1094# CONFIG_NFS_V3_ACL is not set 1140# CONFIG_NFS_V3_ACL is not set
1095# CONFIG_NFS_V4 is not set 1141# CONFIG_NFS_V4 is not set
1096# CONFIG_NFS_DIRECTIO is not set
1097# CONFIG_NFSD is not set 1142# CONFIG_NFSD is not set
1098CONFIG_LOCKD=m 1143CONFIG_LOCKD=m
1099CONFIG_LOCKD_V4=y 1144CONFIG_LOCKD_V4=y
1100CONFIG_NFS_COMMON=y 1145CONFIG_NFS_COMMON=y
1101CONFIG_SUNRPC=m 1146CONFIG_SUNRPC=m
1102# CONFIG_SUNRPC_BIND34 is not set 1147# CONFIG_SUNRPC_REGISTER_V4 is not set
1103# CONFIG_RPCSEC_GSS_KRB5 is not set 1148# CONFIG_RPCSEC_GSS_KRB5 is not set
1104# CONFIG_RPCSEC_GSS_SPKM3 is not set 1149# CONFIG_RPCSEC_GSS_SPKM3 is not set
1105CONFIG_SMB_FS=m 1150CONFIG_SMB_FS=m
@@ -1155,9 +1200,6 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1155# CONFIG_NLS_KOI8_U is not set 1200# CONFIG_NLS_KOI8_U is not set
1156# CONFIG_NLS_UTF8 is not set 1201# CONFIG_NLS_UTF8 is not set
1157# CONFIG_DLM is not set 1202# CONFIG_DLM is not set
1158CONFIG_INSTRUMENTATION=y
1159# CONFIG_PROFILING is not set
1160# CONFIG_MARKERS is not set
1161 1203
1162# 1204#
1163# Kernel hacking 1205# Kernel hacking
@@ -1165,14 +1207,53 @@ CONFIG_INSTRUMENTATION=y
1165# CONFIG_PRINTK_TIME is not set 1207# CONFIG_PRINTK_TIME is not set
1166CONFIG_ENABLE_WARN_DEPRECATED=y 1208CONFIG_ENABLE_WARN_DEPRECATED=y
1167CONFIG_ENABLE_MUST_CHECK=y 1209CONFIG_ENABLE_MUST_CHECK=y
1210CONFIG_FRAME_WARN=1024
1168# CONFIG_MAGIC_SYSRQ is not set 1211# CONFIG_MAGIC_SYSRQ is not set
1169# CONFIG_UNUSED_SYMBOLS is not set 1212# CONFIG_UNUSED_SYMBOLS is not set
1170CONFIG_DEBUG_FS=y 1213CONFIG_DEBUG_FS=y
1171# CONFIG_HEADERS_CHECK is not set 1214# CONFIG_HEADERS_CHECK is not set
1172# CONFIG_DEBUG_KERNEL is not set 1215CONFIG_DEBUG_KERNEL=y
1216# CONFIG_DEBUG_SHIRQ is not set
1217CONFIG_DETECT_SOFTLOCKUP=y
1218# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1219CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1220CONFIG_SCHED_DEBUG=y
1221# CONFIG_SCHEDSTATS is not set
1222# CONFIG_TIMER_STATS is not set
1223# CONFIG_DEBUG_OBJECTS is not set
1224# CONFIG_DEBUG_SLAB is not set
1225# CONFIG_DEBUG_RT_MUTEXES is not set
1226# CONFIG_RT_MUTEX_TESTER is not set
1227# CONFIG_DEBUG_SPINLOCK is not set
1228# CONFIG_DEBUG_MUTEXES is not set
1229# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1230# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1231# CONFIG_DEBUG_KOBJECT is not set
1173# CONFIG_DEBUG_BUGVERBOSE is not set 1232# CONFIG_DEBUG_BUGVERBOSE is not set
1233CONFIG_DEBUG_INFO=y
1234# CONFIG_DEBUG_VM is not set
1235# CONFIG_DEBUG_WRITECOUNT is not set
1236# CONFIG_DEBUG_MEMORY_INIT is not set
1237# CONFIG_DEBUG_LIST is not set
1238# CONFIG_DEBUG_SG is not set
1239# CONFIG_FRAME_POINTER is not set
1240# CONFIG_BOOT_PRINTK_DELAY is not set
1241# CONFIG_RCU_TORTURE_TEST is not set
1242# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1243# CONFIG_BACKTRACE_SELF_TEST is not set
1244# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1245# CONFIG_FAULT_INJECTION is not set
1246# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1247# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1174# CONFIG_SAMPLES is not set 1248# CONFIG_SAMPLES is not set
1249CONFIG_HAVE_ARCH_KGDB=y
1250# CONFIG_KGDB is not set
1251# CONFIG_DEBUG_STACKOVERFLOW is not set
1252# CONFIG_DEBUG_STACK_USAGE is not set
1253CONFIG_DEBUG_VERBOSE=y
1175CONFIG_DEBUG_MMRS=y 1254CONFIG_DEBUG_MMRS=y
1255# CONFIG_DEBUG_HWERR is not set
1256# CONFIG_DEBUG_DOUBLEFAULT is not set
1176CONFIG_DEBUG_HUNT_FOR_ZERO=y 1257CONFIG_DEBUG_HUNT_FOR_ZERO=y
1177CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1258CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1178CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1259CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
@@ -1190,9 +1271,94 @@ CONFIG_ACCESS_CHECK=y
1190# 1271#
1191# CONFIG_KEYS is not set 1272# CONFIG_KEYS is not set
1192CONFIG_SECURITY=y 1273CONFIG_SECURITY=y
1274# CONFIG_SECURITYFS is not set
1193# CONFIG_SECURITY_NETWORK is not set 1275# CONFIG_SECURITY_NETWORK is not set
1194# CONFIG_SECURITY_CAPABILITIES is not set 1276# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1195# CONFIG_CRYPTO is not set 1277CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1278CONFIG_CRYPTO=y
1279
1280#
1281# Crypto core or helper
1282#
1283# CONFIG_CRYPTO_FIPS is not set
1284# CONFIG_CRYPTO_MANAGER is not set
1285# CONFIG_CRYPTO_GF128MUL is not set
1286# CONFIG_CRYPTO_NULL is not set
1287# CONFIG_CRYPTO_CRYPTD is not set
1288# CONFIG_CRYPTO_AUTHENC is not set
1289# CONFIG_CRYPTO_TEST is not set
1290
1291#
1292# Authenticated Encryption with Associated Data
1293#
1294# CONFIG_CRYPTO_CCM is not set
1295# CONFIG_CRYPTO_GCM is not set
1296# CONFIG_CRYPTO_SEQIV is not set
1297
1298#
1299# Block modes
1300#
1301# CONFIG_CRYPTO_CBC is not set
1302# CONFIG_CRYPTO_CTR is not set
1303# CONFIG_CRYPTO_CTS is not set
1304# CONFIG_CRYPTO_ECB is not set
1305# CONFIG_CRYPTO_LRW is not set
1306# CONFIG_CRYPTO_PCBC is not set
1307# CONFIG_CRYPTO_XTS is not set
1308
1309#
1310# Hash modes
1311#
1312# CONFIG_CRYPTO_HMAC is not set
1313# CONFIG_CRYPTO_XCBC is not set
1314
1315#
1316# Digest
1317#
1318# CONFIG_CRYPTO_CRC32C is not set
1319# CONFIG_CRYPTO_MD4 is not set
1320# CONFIG_CRYPTO_MD5 is not set
1321# CONFIG_CRYPTO_MICHAEL_MIC is not set
1322# CONFIG_CRYPTO_RMD128 is not set
1323# CONFIG_CRYPTO_RMD160 is not set
1324# CONFIG_CRYPTO_RMD256 is not set
1325# CONFIG_CRYPTO_RMD320 is not set
1326# CONFIG_CRYPTO_SHA1 is not set
1327# CONFIG_CRYPTO_SHA256 is not set
1328# CONFIG_CRYPTO_SHA512 is not set
1329# CONFIG_CRYPTO_TGR192 is not set
1330# CONFIG_CRYPTO_WP512 is not set
1331
1332#
1333# Ciphers
1334#
1335# CONFIG_CRYPTO_AES is not set
1336# CONFIG_CRYPTO_ANUBIS is not set
1337# CONFIG_CRYPTO_ARC4 is not set
1338# CONFIG_CRYPTO_BLOWFISH is not set
1339# CONFIG_CRYPTO_CAMELLIA is not set
1340# CONFIG_CRYPTO_CAST5 is not set
1341# CONFIG_CRYPTO_CAST6 is not set
1342# CONFIG_CRYPTO_DES is not set
1343# CONFIG_CRYPTO_FCRYPT is not set
1344# CONFIG_CRYPTO_KHAZAD is not set
1345# CONFIG_CRYPTO_SALSA20 is not set
1346# CONFIG_CRYPTO_SEED is not set
1347# CONFIG_CRYPTO_SERPENT is not set
1348# CONFIG_CRYPTO_TEA is not set
1349# CONFIG_CRYPTO_TWOFISH is not set
1350
1351#
1352# Compression
1353#
1354# CONFIG_CRYPTO_DEFLATE is not set
1355# CONFIG_CRYPTO_LZO is not set
1356
1357#
1358# Random Number Generation
1359#
1360# CONFIG_CRYPTO_ANSI_CPRNG is not set
1361CONFIG_CRYPTO_HW=y
1196 1362
1197# 1363#
1198# Library routines 1364# Library routines
@@ -1200,6 +1366,7 @@ CONFIG_SECURITY=y
1200CONFIG_BITREVERSE=y 1366CONFIG_BITREVERSE=y
1201CONFIG_CRC_CCITT=m 1367CONFIG_CRC_CCITT=m
1202# CONFIG_CRC16 is not set 1368# CONFIG_CRC16 is not set
1369# CONFIG_CRC_T10DIF is not set
1203# CONFIG_CRC_ITU_T is not set 1370# CONFIG_CRC_ITU_T is not set
1204CONFIG_CRC32=y 1371CONFIG_CRC32=y
1205# CONFIG_CRC7 is not set 1372# CONFIG_CRC7 is not set
diff --git a/arch/blackfin/configs/BF537-STAMP_defconfig b/arch/blackfin/configs/BF537-STAMP_defconfig
index 63a0f854745c..332142f7f9b4 100644
--- a/arch/blackfin/configs/BF537-STAMP_defconfig
+++ b/arch/blackfin/configs/BF537-STAMP_defconfig
@@ -1,6 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24.7 3# Linux kernel version: 2.6.28-rc2
4# Tue Dec 30 17:24:37 2008
4# 5#
5# CONFIG_MMU is not set 6# CONFIG_MMU is not set
6# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -8,7 +9,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 9# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y 10CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y 11CONFIG_ZONE_DMA=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y 12CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y 13CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 14CONFIG_GENERIC_HARDIRQS=y
@@ -31,18 +31,16 @@ CONFIG_SYSVIPC_SYSCTL=y
31# CONFIG_POSIX_MQUEUE is not set 31# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set 32# CONFIG_BSD_PROCESS_ACCT is not set
33# CONFIG_TASKSTATS is not set 33# CONFIG_TASKSTATS is not set
34# CONFIG_USER_NS is not set
35# CONFIG_PID_NS is not set
36# CONFIG_AUDIT is not set 34# CONFIG_AUDIT is not set
37CONFIG_IKCONFIG=y 35CONFIG_IKCONFIG=y
38CONFIG_IKCONFIG_PROC=y 36CONFIG_IKCONFIG_PROC=y
39CONFIG_LOG_BUF_SHIFT=14 37CONFIG_LOG_BUF_SHIFT=14
40# CONFIG_CGROUPS is not set 38# CONFIG_CGROUPS is not set
41CONFIG_FAIR_GROUP_SCHED=y 39# CONFIG_GROUP_SCHED is not set
42CONFIG_FAIR_USER_SCHED=y 40# CONFIG_SYSFS_DEPRECATED is not set
43# CONFIG_FAIR_CGROUP_SCHED is not set 41# CONFIG_SYSFS_DEPRECATED_V2 is not set
44CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 42# CONFIG_RELAY is not set
43# CONFIG_NAMESPACES is not set
46CONFIG_BLK_DEV_INITRD=y 44CONFIG_BLK_DEV_INITRD=y
47CONFIG_INITRAMFS_SOURCE="" 45CONFIG_INITRAMFS_SOURCE=""
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 46# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -51,26 +49,35 @@ CONFIG_EMBEDDED=y
51CONFIG_UID16=y 49CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 50CONFIG_SYSCTL_SYSCALL=y
53CONFIG_KALLSYMS=y 51CONFIG_KALLSYMS=y
52# CONFIG_KALLSYMS_ALL is not set
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 53# CONFIG_KALLSYMS_EXTRA_PASS is not set
55CONFIG_HOTPLUG=y 54CONFIG_HOTPLUG=y
56CONFIG_PRINTK=y 55CONFIG_PRINTK=y
57CONFIG_BUG=y 56CONFIG_BUG=y
58CONFIG_ELF_CORE=y 57# CONFIG_ELF_CORE is not set
58CONFIG_COMPAT_BRK=y
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 62CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 63CONFIG_SIGNALFD=y
64CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 65CONFIG_EVENTFD=y
66CONFIG_AIO=y
65CONFIG_VM_EVENT_COUNTERS=y 67CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_SLAB=y 68CONFIG_SLAB=y
67# CONFIG_SLUB is not set 69# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 70# CONFIG_SLOB is not set
71# CONFIG_PROFILING is not set
72# CONFIG_MARKERS is not set
73CONFIG_HAVE_OPROFILE=y
74# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
69CONFIG_SLABINFO=y 75CONFIG_SLABINFO=y
70CONFIG_RT_MUTEXES=y 76CONFIG_RT_MUTEXES=y
71CONFIG_TINY_SHMEM=y 77CONFIG_TINY_SHMEM=y
72CONFIG_BASE_SMALL=0 78CONFIG_BASE_SMALL=0
73CONFIG_MODULES=y 79CONFIG_MODULES=y
80# CONFIG_MODULE_FORCE_LOAD is not set
74CONFIG_MODULE_UNLOAD=y 81CONFIG_MODULE_UNLOAD=y
75# CONFIG_MODULE_FORCE_UNLOAD is not set 82# CONFIG_MODULE_FORCE_UNLOAD is not set
76# CONFIG_MODVERSIONS is not set 83# CONFIG_MODVERSIONS is not set
@@ -81,6 +88,7 @@ CONFIG_BLOCK=y
81# CONFIG_BLK_DEV_IO_TRACE is not set 88# CONFIG_BLK_DEV_IO_TRACE is not set
82# CONFIG_LSF is not set 89# CONFIG_LSF is not set
83# CONFIG_BLK_DEV_BSG is not set 90# CONFIG_BLK_DEV_BSG is not set
91# CONFIG_BLK_DEV_INTEGRITY is not set
84 92
85# 93#
86# IO Schedulers 94# IO Schedulers
@@ -94,9 +102,11 @@ CONFIG_DEFAULT_AS=y
94# CONFIG_DEFAULT_CFQ is not set 102# CONFIG_DEFAULT_CFQ is not set
95# CONFIG_DEFAULT_NOOP is not set 103# CONFIG_DEFAULT_NOOP is not set
96CONFIG_DEFAULT_IOSCHED="anticipatory" 104CONFIG_DEFAULT_IOSCHED="anticipatory"
105CONFIG_CLASSIC_RCU=y
97# CONFIG_PREEMPT_NONE is not set 106# CONFIG_PREEMPT_NONE is not set
98CONFIG_PREEMPT_VOLUNTARY=y 107CONFIG_PREEMPT_VOLUNTARY=y
99# CONFIG_PREEMPT is not set 108# CONFIG_PREEMPT is not set
109CONFIG_FREEZER=y
100 110
101# 111#
102# Blackfin Processor Options 112# Blackfin Processor Options
@@ -105,6 +115,10 @@ CONFIG_PREEMPT_VOLUNTARY=y
105# 115#
106# Processor and Board Settings 116# Processor and Board Settings
107# 117#
118# CONFIG_BF512 is not set
119# CONFIG_BF514 is not set
120# CONFIG_BF516 is not set
121# CONFIG_BF518 is not set
108# CONFIG_BF522 is not set 122# CONFIG_BF522 is not set
109# CONFIG_BF523 is not set 123# CONFIG_BF523 is not set
110# CONFIG_BF524 is not set 124# CONFIG_BF524 is not set
@@ -117,18 +131,23 @@ CONFIG_PREEMPT_VOLUNTARY=y
117# CONFIG_BF534 is not set 131# CONFIG_BF534 is not set
118# CONFIG_BF536 is not set 132# CONFIG_BF536 is not set
119CONFIG_BF537=y 133CONFIG_BF537=y
134# CONFIG_BF538 is not set
135# CONFIG_BF539 is not set
120# CONFIG_BF542 is not set 136# CONFIG_BF542 is not set
121# CONFIG_BF544 is not set 137# CONFIG_BF544 is not set
122# CONFIG_BF547 is not set 138# CONFIG_BF547 is not set
123# CONFIG_BF548 is not set 139# CONFIG_BF548 is not set
124# CONFIG_BF549 is not set 140# CONFIG_BF549 is not set
125# CONFIG_BF561 is not set 141# CONFIG_BF561 is not set
142CONFIG_BF_REV_MIN=2
143CONFIG_BF_REV_MAX=3
126# CONFIG_BF_REV_0_0 is not set 144# CONFIG_BF_REV_0_0 is not set
127# CONFIG_BF_REV_0_1 is not set 145# CONFIG_BF_REV_0_1 is not set
128CONFIG_BF_REV_0_2=y 146CONFIG_BF_REV_0_2=y
129# CONFIG_BF_REV_0_3 is not set 147# CONFIG_BF_REV_0_3 is not set
130# CONFIG_BF_REV_0_4 is not set 148# CONFIG_BF_REV_0_4 is not set
131# CONFIG_BF_REV_0_5 is not set 149# CONFIG_BF_REV_0_5 is not set
150# CONFIG_BF_REV_0_6 is not set
132# CONFIG_BF_REV_ANY is not set 151# CONFIG_BF_REV_ANY is not set
133# CONFIG_BF_REV_NONE is not set 152# CONFIG_BF_REV_NONE is not set
134CONFIG_BF53x=y 153CONFIG_BF53x=y
@@ -141,27 +160,28 @@ CONFIG_IRQ_SPORT0_TX=9
141CONFIG_IRQ_SPORT1_RX=9 160CONFIG_IRQ_SPORT1_RX=9
142CONFIG_IRQ_SPORT1_TX=9 161CONFIG_IRQ_SPORT1_TX=9
143CONFIG_IRQ_TWI=10 162CONFIG_IRQ_TWI=10
144CONFIG_IRQ_SPI=10
145CONFIG_IRQ_UART0_RX=10 163CONFIG_IRQ_UART0_RX=10
146CONFIG_IRQ_UART0_TX=10 164CONFIG_IRQ_UART0_TX=10
147CONFIG_IRQ_UART1_RX=10 165CONFIG_IRQ_UART1_RX=10
148CONFIG_IRQ_UART1_TX=10 166CONFIG_IRQ_UART1_TX=10
149CONFIG_IRQ_MAC_RX=11 167CONFIG_IRQ_MAC_RX=11
150CONFIG_IRQ_MAC_TX=11 168CONFIG_IRQ_MAC_TX=11
151CONFIG_IRQ_TMR0=12 169CONFIG_IRQ_TIMER0=8
152CONFIG_IRQ_TMR1=12 170CONFIG_IRQ_TIMER1=12
153CONFIG_IRQ_TMR2=12 171CONFIG_IRQ_TIMER2=12
154CONFIG_IRQ_TMR3=12 172CONFIG_IRQ_TIMER3=12
155CONFIG_IRQ_TMR4=12 173CONFIG_IRQ_TIMER4=12
156CONFIG_IRQ_TMR5=12 174CONFIG_IRQ_TIMER5=12
157CONFIG_IRQ_TMR6=12 175CONFIG_IRQ_TIMER6=12
158CONFIG_IRQ_TMR7=12 176CONFIG_IRQ_TIMER7=12
159CONFIG_IRQ_PORTG_INTB=12 177CONFIG_IRQ_PORTG_INTB=12
160CONFIG_IRQ_MEM_DMA0=13 178CONFIG_IRQ_MEM_DMA0=13
161CONFIG_IRQ_MEM_DMA1=13 179CONFIG_IRQ_MEM_DMA1=13
162CONFIG_IRQ_WATCH=13 180CONFIG_IRQ_WATCH=13
181CONFIG_IRQ_SPI=10
163CONFIG_BFIN537_STAMP=y 182CONFIG_BFIN537_STAMP=y
164# CONFIG_BFIN537_BLUETECHNIX_CM is not set 183# CONFIG_BFIN537_BLUETECHNIX_CM is not set
184# CONFIG_BFIN537_BLUETECHNIX_TCM is not set
165# CONFIG_PNAV10 is not set 185# CONFIG_PNAV10 is not set
166# CONFIG_CAMSIG_MINOTAUR is not set 186# CONFIG_CAMSIG_MINOTAUR is not set
167# CONFIG_GENERIC_BF537_BOARD is not set 187# CONFIG_GENERIC_BF537_BOARD is not set
@@ -194,7 +214,6 @@ CONFIG_BOOT_LOAD=0x1000
194# 214#
195CONFIG_CLKIN_HZ=25000000 215CONFIG_CLKIN_HZ=25000000
196# CONFIG_BFIN_KERNEL_CLOCK is not set 216# CONFIG_BFIN_KERNEL_CLOCK is not set
197CONFIG_MAX_MEM_SIZE=512
198CONFIG_MAX_VCO_HZ=600000000 217CONFIG_MAX_VCO_HZ=600000000
199CONFIG_MIN_VCO_HZ=50000000 218CONFIG_MIN_VCO_HZ=50000000
200CONFIG_MAX_SCLK_HZ=133333333 219CONFIG_MAX_SCLK_HZ=133333333
@@ -208,6 +227,7 @@ CONFIG_HZ_250=y
208# CONFIG_HZ_300 is not set 227# CONFIG_HZ_300 is not set
209# CONFIG_HZ_1000 is not set 228# CONFIG_HZ_1000 is not set
210CONFIG_HZ=250 229CONFIG_HZ=250
230CONFIG_SCHED_HRTICK=y
211CONFIG_GENERIC_TIME=y 231CONFIG_GENERIC_TIME=y
212CONFIG_GENERIC_CLOCKEVENTS=y 232CONFIG_GENERIC_CLOCKEVENTS=y
213# CONFIG_CYCLES_CLOCKSOURCE is not set 233# CONFIG_CYCLES_CLOCKSOURCE is not set
@@ -245,6 +265,12 @@ CONFIG_SYS_BFIN_SPINLOCK_L1=y
245CONFIG_CACHELINE_ALIGNED_L1=y 265CONFIG_CACHELINE_ALIGNED_L1=y
246# CONFIG_SYSCALL_TAB_L1 is not set 266# CONFIG_SYSCALL_TAB_L1 is not set
247# CONFIG_CPLB_SWITCH_TAB_L1 is not set 267# CONFIG_CPLB_SWITCH_TAB_L1 is not set
268CONFIG_APP_STACK_L1=y
269
270#
271# Speed Optimizations
272#
273CONFIG_BFIN_INS_LOWOVERHEAD=y
248CONFIG_RAMKERNEL=y 274CONFIG_RAMKERNEL=y
249# CONFIG_ROMKERNEL is not set 275# CONFIG_ROMKERNEL is not set
250CONFIG_SELECT_MEMORY_MODEL=y 276CONFIG_SELECT_MEMORY_MODEL=y
@@ -253,14 +279,13 @@ CONFIG_FLATMEM_MANUAL=y
253# CONFIG_SPARSEMEM_MANUAL is not set 279# CONFIG_SPARSEMEM_MANUAL is not set
254CONFIG_FLATMEM=y 280CONFIG_FLATMEM=y
255CONFIG_FLAT_NODE_MEM_MAP=y 281CONFIG_FLAT_NODE_MEM_MAP=y
256# CONFIG_SPARSEMEM_STATIC is not set 282CONFIG_PAGEFLAGS_EXTENDED=y
257# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
258CONFIG_SPLIT_PTLOCK_CPUS=4 283CONFIG_SPLIT_PTLOCK_CPUS=4
259# CONFIG_RESOURCES_64BIT is not set 284# CONFIG_RESOURCES_64BIT is not set
285# CONFIG_PHYS_ADDR_T_64BIT is not set
260CONFIG_ZONE_DMA_FLAG=1 286CONFIG_ZONE_DMA_FLAG=1
261CONFIG_VIRT_TO_BUS=y 287CONFIG_VIRT_TO_BUS=y
262# CONFIG_BFIN_GPTIMERS is not set 288CONFIG_BFIN_GPTIMERS=m
263CONFIG_BFIN_DMA_5XX=y
264# CONFIG_DMA_UNCACHED_4M is not set 289# CONFIG_DMA_UNCACHED_4M is not set
265# CONFIG_DMA_UNCACHED_2M is not set 290# CONFIG_DMA_UNCACHED_2M is not set
266CONFIG_DMA_UNCACHED_1M=y 291CONFIG_DMA_UNCACHED_1M=y
@@ -275,7 +300,6 @@ CONFIG_BFIN_DCACHE=y
275# CONFIG_BFIN_ICACHE_LOCK is not set 300# CONFIG_BFIN_ICACHE_LOCK is not set
276# CONFIG_BFIN_WB is not set 301# CONFIG_BFIN_WB is not set
277CONFIG_BFIN_WT=y 302CONFIG_BFIN_WT=y
278CONFIG_L1_MAX_PIECE=16
279# CONFIG_MPU is not set 303# CONFIG_MPU is not set
280 304
281# 305#
@@ -304,7 +328,6 @@ CONFIG_BANK_3=0x99B2
304# 328#
305# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 329# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
306# 330#
307# CONFIG_PCI is not set
308# CONFIG_ARCH_SUPPORTS_MSI is not set 331# CONFIG_ARCH_SUPPORTS_MSI is not set
309# CONFIG_PCCARD is not set 332# CONFIG_PCCARD is not set
310 333
@@ -315,29 +338,31 @@ CONFIG_BINFMT_ELF_FDPIC=y
315CONFIG_BINFMT_FLAT=y 338CONFIG_BINFMT_FLAT=y
316CONFIG_BINFMT_ZFLAT=y 339CONFIG_BINFMT_ZFLAT=y
317# CONFIG_BINFMT_SHARED_FLAT is not set 340# CONFIG_BINFMT_SHARED_FLAT is not set
341# CONFIG_HAVE_AOUT is not set
318# CONFIG_BINFMT_MISC is not set 342# CONFIG_BINFMT_MISC is not set
319 343
320# 344#
321# Power management options 345# Power management options
322# 346#
323CONFIG_PM=y 347CONFIG_PM=y
324# CONFIG_PM_LEGACY is not set
325# CONFIG_PM_DEBUG is not set 348# CONFIG_PM_DEBUG is not set
326CONFIG_PM_SLEEP=y 349CONFIG_PM_SLEEP=y
327CONFIG_SUSPEND_UP_POSSIBLE=y
328CONFIG_SUSPEND=y 350CONFIG_SUSPEND=y
351CONFIG_SUSPEND_FREEZER=y
352CONFIG_ARCH_SUSPEND_POSSIBLE=y
329CONFIG_PM_BFIN_SLEEP_DEEPER=y 353CONFIG_PM_BFIN_SLEEP_DEEPER=y
330# CONFIG_PM_BFIN_SLEEP is not set 354# CONFIG_PM_BFIN_SLEEP is not set
331# CONFIG_PM_WAKEUP_BY_GPIO is not set 355# CONFIG_PM_WAKEUP_BY_GPIO is not set
332 356
333# 357#
334# CPU Frequency scaling 358# Possible Suspend Mem / Hibernate Wake-Up Sources
335# 359#
336# CONFIG_CPU_FREQ is not set 360# CONFIG_PM_BFIN_WAKE_PH6 is not set
337 361
338# 362#
339# Networking 363# CPU Frequency scaling
340# 364#
365# CONFIG_CPU_FREQ is not set
341CONFIG_NET=y 366CONFIG_NET=y
342 367
343# 368#
@@ -350,6 +375,7 @@ CONFIG_XFRM=y
350# CONFIG_XFRM_USER is not set 375# CONFIG_XFRM_USER is not set
351# CONFIG_XFRM_SUB_POLICY is not set 376# CONFIG_XFRM_SUB_POLICY is not set
352# CONFIG_XFRM_MIGRATE is not set 377# CONFIG_XFRM_MIGRATE is not set
378# CONFIG_XFRM_STATISTICS is not set
353# CONFIG_NET_KEY is not set 379# CONFIG_NET_KEY is not set
354CONFIG_INET=y 380CONFIG_INET=y
355# CONFIG_IP_MULTICAST is not set 381# CONFIG_IP_MULTICAST is not set
@@ -379,8 +405,6 @@ CONFIG_TCP_CONG_CUBIC=y
379CONFIG_DEFAULT_TCP_CONG="cubic" 405CONFIG_DEFAULT_TCP_CONG="cubic"
380# CONFIG_TCP_MD5SIG is not set 406# CONFIG_TCP_MD5SIG is not set
381# CONFIG_IPV6 is not set 407# CONFIG_IPV6 is not set
382# CONFIG_INET6_XFRM_TUNNEL is not set
383# CONFIG_INET6_TUNNEL is not set
384# CONFIG_NETLABEL is not set 408# CONFIG_NETLABEL is not set
385# CONFIG_NETWORK_SECMARK is not set 409# CONFIG_NETWORK_SECMARK is not set
386# CONFIG_NETFILTER is not set 410# CONFIG_NETFILTER is not set
@@ -389,6 +413,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
389# CONFIG_TIPC is not set 413# CONFIG_TIPC is not set
390# CONFIG_ATM is not set 414# CONFIG_ATM is not set
391# CONFIG_BRIDGE is not set 415# CONFIG_BRIDGE is not set
416# CONFIG_NET_DSA is not set
392# CONFIG_VLAN_8021Q is not set 417# CONFIG_VLAN_8021Q is not set
393# CONFIG_DECNET is not set 418# CONFIG_DECNET is not set
394# CONFIG_LLC2 is not set 419# CONFIG_LLC2 is not set
@@ -405,6 +430,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
405# 430#
406# CONFIG_NET_PKTGEN is not set 431# CONFIG_NET_PKTGEN is not set
407# CONFIG_HAMRADIO is not set 432# CONFIG_HAMRADIO is not set
433# CONFIG_CAN is not set
408CONFIG_IRDA=m 434CONFIG_IRDA=m
409 435
410# 436#
@@ -440,24 +466,14 @@ CONFIG_SIR_BFIN_DMA=y
440# CONFIG_DONGLE is not set 466# CONFIG_DONGLE is not set
441 467
442# 468#
443# Old SIR device drivers
444#
445# CONFIG_IRPORT_SIR is not set
446
447#
448# Old Serial dongle support
449#
450
451#
452# FIR device drivers 469# FIR device drivers
453# 470#
454# CONFIG_BT is not set 471# CONFIG_BT is not set
455# CONFIG_AF_RXRPC is not set 472# CONFIG_AF_RXRPC is not set
456 473# CONFIG_PHONET is not set
457# 474CONFIG_WIRELESS=y
458# Wireless
459#
460# CONFIG_CFG80211 is not set 475# CONFIG_CFG80211 is not set
476CONFIG_WIRELESS_OLD_REGULATORY=y
461# CONFIG_WIRELESS_EXT is not set 477# CONFIG_WIRELESS_EXT is not set
462# CONFIG_MAC80211 is not set 478# CONFIG_MAC80211 is not set
463# CONFIG_IEEE80211 is not set 479# CONFIG_IEEE80211 is not set
@@ -475,6 +491,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
475CONFIG_STANDALONE=y 491CONFIG_STANDALONE=y
476CONFIG_PREVENT_FIRMWARE_BUILD=y 492CONFIG_PREVENT_FIRMWARE_BUILD=y
477# CONFIG_FW_LOADER is not set 493# CONFIG_FW_LOADER is not set
494# CONFIG_DEBUG_DRIVER is not set
495# CONFIG_DEBUG_DEVRES is not set
478# CONFIG_SYS_HYPERVISOR is not set 496# CONFIG_SYS_HYPERVISOR is not set
479# CONFIG_CONNECTOR is not set 497# CONFIG_CONNECTOR is not set
480CONFIG_MTD=y 498CONFIG_MTD=y
@@ -483,6 +501,7 @@ CONFIG_MTD=y
483CONFIG_MTD_PARTITIONS=y 501CONFIG_MTD_PARTITIONS=y
484# CONFIG_MTD_REDBOOT_PARTS is not set 502# CONFIG_MTD_REDBOOT_PARTS is not set
485CONFIG_MTD_CMDLINE_PARTS=y 503CONFIG_MTD_CMDLINE_PARTS=y
504# CONFIG_MTD_AR7_PARTS is not set
486 505
487# 506#
488# User Modules And Translation Layers 507# User Modules And Translation Layers
@@ -553,15 +572,11 @@ CONFIG_MTD_NAND=m
553# CONFIG_MTD_NAND_VERIFY_WRITE is not set 572# CONFIG_MTD_NAND_VERIFY_WRITE is not set
554# CONFIG_MTD_NAND_ECC_SMC is not set 573# CONFIG_MTD_NAND_ECC_SMC is not set
555# CONFIG_MTD_NAND_MUSEUM_IDS is not set 574# CONFIG_MTD_NAND_MUSEUM_IDS is not set
556CONFIG_MTD_NAND_BFIN=m 575# CONFIG_MTD_NAND_BFIN is not set
557CONFIG_BFIN_NAND_BASE=0x20212000
558CONFIG_BFIN_NAND_CLE=2
559CONFIG_BFIN_NAND_ALE=1
560CONFIG_BFIN_NAND_READY=3
561CONFIG_MTD_NAND_IDS=m 576CONFIG_MTD_NAND_IDS=m
562# CONFIG_MTD_NAND_DISKONCHIP is not set 577# CONFIG_MTD_NAND_DISKONCHIP is not set
563# CONFIG_MTD_NAND_NANDSIM is not set 578# CONFIG_MTD_NAND_NANDSIM is not set
564# CONFIG_MTD_NAND_PLATFORM is not set 579CONFIG_MTD_NAND_PLATFORM=m
565# CONFIG_MTD_ONENAND is not set 580# CONFIG_MTD_ONENAND is not set
566 581
567# 582#
@@ -576,11 +591,14 @@ CONFIG_BLK_DEV=y
576CONFIG_BLK_DEV_RAM=y 591CONFIG_BLK_DEV_RAM=y
577CONFIG_BLK_DEV_RAM_COUNT=16 592CONFIG_BLK_DEV_RAM_COUNT=16
578CONFIG_BLK_DEV_RAM_SIZE=4096 593CONFIG_BLK_DEV_RAM_SIZE=4096
579CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 594# CONFIG_BLK_DEV_XIP is not set
580# CONFIG_CDROM_PKTCDVD is not set 595# CONFIG_CDROM_PKTCDVD is not set
581# CONFIG_ATA_OVER_ETH is not set 596# CONFIG_ATA_OVER_ETH is not set
597# CONFIG_BLK_DEV_HD is not set
582CONFIG_MISC_DEVICES=y 598CONFIG_MISC_DEVICES=y
583# CONFIG_EEPROM_93CX6 is not set 599# CONFIG_EEPROM_93CX6 is not set
600# CONFIG_ENCLOSURE_SERVICES is not set
601CONFIG_HAVE_IDE=y
584# CONFIG_IDE is not set 602# CONFIG_IDE is not set
585 603
586# 604#
@@ -593,7 +611,6 @@ CONFIG_MISC_DEVICES=y
593# CONFIG_ATA is not set 611# CONFIG_ATA is not set
594# CONFIG_MD is not set 612# CONFIG_MD is not set
595CONFIG_NETDEVICES=y 613CONFIG_NETDEVICES=y
596# CONFIG_NETDEVICES_MULTIQUEUE is not set
597# CONFIG_DUMMY is not set 614# CONFIG_DUMMY is not set
598# CONFIG_BONDING is not set 615# CONFIG_BONDING is not set
599# CONFIG_MACVLAN is not set 616# CONFIG_MACVLAN is not set
@@ -614,6 +631,7 @@ CONFIG_PHYLIB=y
614CONFIG_SMSC_PHY=y 631CONFIG_SMSC_PHY=y
615# CONFIG_BROADCOM_PHY is not set 632# CONFIG_BROADCOM_PHY is not set
616# CONFIG_ICPLUS_PHY is not set 633# CONFIG_ICPLUS_PHY is not set
634# CONFIG_REALTEK_PHY is not set
617# CONFIG_FIXED_PHY is not set 635# CONFIG_FIXED_PHY is not set
618# CONFIG_MDIO_BITBANG is not set 636# CONFIG_MDIO_BITBANG is not set
619CONFIG_NET_ETHERNET=y 637CONFIG_NET_ETHERNET=y
@@ -626,11 +644,14 @@ CONFIG_BFIN_RX_DESC_NUM=20
626# CONFIG_SMC91X is not set 644# CONFIG_SMC91X is not set
627# CONFIG_SMSC911X is not set 645# CONFIG_SMSC911X is not set
628# CONFIG_DM9000 is not set 646# CONFIG_DM9000 is not set
647# CONFIG_ENC28J60 is not set
629# CONFIG_IBM_NEW_EMAC_ZMII is not set 648# CONFIG_IBM_NEW_EMAC_ZMII is not set
630# CONFIG_IBM_NEW_EMAC_RGMII is not set 649# CONFIG_IBM_NEW_EMAC_RGMII is not set
631# CONFIG_IBM_NEW_EMAC_TAH is not set 650# CONFIG_IBM_NEW_EMAC_TAH is not set
632# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 651# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
633# CONFIG_B44 is not set 652# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
653# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
654# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
634CONFIG_NETDEV_1000=y 655CONFIG_NETDEV_1000=y
635# CONFIG_AX88180 is not set 656# CONFIG_AX88180 is not set
636CONFIG_NETDEV_10000=y 657CONFIG_NETDEV_10000=y
@@ -640,10 +661,10 @@ CONFIG_NETDEV_10000=y
640# 661#
641# CONFIG_WLAN_PRE80211 is not set 662# CONFIG_WLAN_PRE80211 is not set
642# CONFIG_WLAN_80211 is not set 663# CONFIG_WLAN_80211 is not set
664# CONFIG_IWLWIFI_LEDS is not set
643# CONFIG_WAN is not set 665# CONFIG_WAN is not set
644# CONFIG_PPP is not set 666# CONFIG_PPP is not set
645# CONFIG_SLIP is not set 667# CONFIG_SLIP is not set
646# CONFIG_SHAPER is not set
647# CONFIG_NETCONSOLE is not set 668# CONFIG_NETCONSOLE is not set
648# CONFIG_NETPOLL is not set 669# CONFIG_NETPOLL is not set
649# CONFIG_NET_POLL_CONTROLLER is not set 670# CONFIG_NET_POLL_CONTROLLER is not set
@@ -675,12 +696,15 @@ CONFIG_INPUT_EVDEV=m
675# CONFIG_INPUT_TOUCHSCREEN is not set 696# CONFIG_INPUT_TOUCHSCREEN is not set
676CONFIG_INPUT_MISC=y 697CONFIG_INPUT_MISC=y
677# CONFIG_INPUT_UINPUT is not set 698# CONFIG_INPUT_UINPUT is not set
678CONFIG_TWI_KEYPAD=m 699CONFIG_CONFIG_INPUT_PCF8574=m
679 700
680# 701#
681# Hardware I/O ports 702# Hardware I/O ports
682# 703#
683# CONFIG_SERIO is not set 704CONFIG_SERIO=y
705CONFIG_SERIO_SERPORT=y
706CONFIG_SERIO_LIBPS2=y
707# CONFIG_SERIO_RAW is not set
684# CONFIG_GAMEPORT is not set 708# CONFIG_GAMEPORT is not set
685 709
686# 710#
@@ -691,11 +715,14 @@ CONFIG_TWI_KEYPAD=m
691# CONFIG_BF5xx_PPIFCD is not set 715# CONFIG_BF5xx_PPIFCD is not set
692# CONFIG_BFIN_SIMPLE_TIMER is not set 716# CONFIG_BFIN_SIMPLE_TIMER is not set
693# CONFIG_BF5xx_PPI is not set 717# CONFIG_BF5xx_PPI is not set
694CONFIG_BFIN_SPORT=y 718CONFIG_BFIN_SPORT=m
695# CONFIG_BFIN_TIMER_LATENCY is not set 719# CONFIG_BFIN_TIMER_LATENCY is not set
696CONFIG_TWI_LCD=m 720CONFIG_TWI_LCD=m
721CONFIG_BFIN_DMA_INTERFACE=m
697CONFIG_SIMPLE_GPIO=m 722CONFIG_SIMPLE_GPIO=m
698# CONFIG_VT is not set 723# CONFIG_VT is not set
724# CONFIG_DEVKMEM is not set
725# CONFIG_BFIN_JTAG_COMM is not set
699# CONFIG_SERIAL_NONSTANDARD is not set 726# CONFIG_SERIAL_NONSTANDARD is not set
700 727
701# 728#
@@ -727,48 +754,51 @@ CONFIG_CAN4LINUX=y
727# 754#
728# linux embedded drivers 755# linux embedded drivers
729# 756#
730# CONFIG_CAN_MCF5282 is not set
731# CONFIG_CAN_UNCTWINCAN is not set
732CONFIG_CAN_BLACKFIN=m 757CONFIG_CAN_BLACKFIN=m
733# CONFIG_IPMI_HANDLER is not set 758# CONFIG_IPMI_HANDLER is not set
734# CONFIG_HW_RANDOM is not set 759# CONFIG_HW_RANDOM is not set
735# CONFIG_GEN_RTC is not set
736# CONFIG_R3964 is not set 760# CONFIG_R3964 is not set
737# CONFIG_RAW_DRIVER is not set 761# CONFIG_RAW_DRIVER is not set
738# CONFIG_TCG_TPM is not set 762# CONFIG_TCG_TPM is not set
739CONFIG_I2C=m 763CONFIG_I2C=m
740CONFIG_I2C_BOARDINFO=y 764CONFIG_I2C_BOARDINFO=y
741CONFIG_I2C_CHARDEV=m 765CONFIG_I2C_CHARDEV=m
766CONFIG_I2C_HELPER_AUTO=y
742 767
743# 768#
744# I2C Algorithms 769# I2C Hardware Bus support
745# 770#
746# CONFIG_I2C_ALGOBIT is not set
747# CONFIG_I2C_ALGOPCF is not set
748# CONFIG_I2C_ALGOPCA is not set
749 771
750# 772#
751# I2C Hardware Bus support 773# I2C system bus drivers (mostly embedded / system-on-chip)
752# 774#
753CONFIG_I2C_BLACKFIN_TWI=m 775CONFIG_I2C_BLACKFIN_TWI=m
754CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 776CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
755# CONFIG_I2C_GPIO is not set 777# CONFIG_I2C_GPIO is not set
756# CONFIG_I2C_OCORES is not set 778# CONFIG_I2C_OCORES is not set
757# CONFIG_I2C_PARPORT_LIGHT is not set
758# CONFIG_I2C_SIMTEC is not set 779# CONFIG_I2C_SIMTEC is not set
780
781#
782# External I2C/SMBus adapter drivers
783#
784# CONFIG_I2C_PARPORT_LIGHT is not set
759# CONFIG_I2C_TAOS_EVM is not set 785# CONFIG_I2C_TAOS_EVM is not set
786
787#
788# Other I2C/SMBus bus drivers
789#
790# CONFIG_I2C_PCA_PLATFORM is not set
760# CONFIG_I2C_STUB is not set 791# CONFIG_I2C_STUB is not set
761 792
762# 793#
763# Miscellaneous I2C Chip support 794# Miscellaneous I2C Chip support
764# 795#
765# CONFIG_SENSORS_DS1337 is not set
766# CONFIG_SENSORS_DS1374 is not set
767# CONFIG_DS1682 is not set 796# CONFIG_DS1682 is not set
797# CONFIG_AT24 is not set
768CONFIG_SENSORS_AD5252=m 798CONFIG_SENSORS_AD5252=m
769# CONFIG_SENSORS_EEPROM is not set 799# CONFIG_SENSORS_EEPROM is not set
770# CONFIG_SENSORS_PCF8574 is not set 800# CONFIG_SENSORS_PCF8574 is not set
771# CONFIG_SENSORS_PCF8575 is not set 801# CONFIG_PCF8575 is not set
772# CONFIG_SENSORS_PCA9539 is not set 802# CONFIG_SENSORS_PCA9539 is not set
773# CONFIG_SENSORS_PCF8591 is not set 803# CONFIG_SENSORS_PCF8591 is not set
774# CONFIG_SENSORS_MAX6875 is not set 804# CONFIG_SENSORS_MAX6875 is not set
@@ -777,17 +807,15 @@ CONFIG_SENSORS_AD5252=m
777# CONFIG_I2C_DEBUG_ALGO is not set 807# CONFIG_I2C_DEBUG_ALGO is not set
778# CONFIG_I2C_DEBUG_BUS is not set 808# CONFIG_I2C_DEBUG_BUS is not set
779# CONFIG_I2C_DEBUG_CHIP is not set 809# CONFIG_I2C_DEBUG_CHIP is not set
780
781#
782# SPI support
783#
784CONFIG_SPI=y 810CONFIG_SPI=y
811# CONFIG_SPI_DEBUG is not set
785CONFIG_SPI_MASTER=y 812CONFIG_SPI_MASTER=y
786 813
787# 814#
788# SPI Master Controller Drivers 815# SPI Master Controller Drivers
789# 816#
790CONFIG_SPI_BFIN=y 817CONFIG_SPI_BFIN=y
818# CONFIG_SPI_BFIN_LOCK is not set
791# CONFIG_SPI_BITBANG is not set 819# CONFIG_SPI_BITBANG is not set
792 820
793# 821#
@@ -796,11 +824,15 @@ CONFIG_SPI_BFIN=y
796# CONFIG_SPI_AT25 is not set 824# CONFIG_SPI_AT25 is not set
797# CONFIG_SPI_SPIDEV is not set 825# CONFIG_SPI_SPIDEV is not set
798# CONFIG_SPI_TLE62X0 is not set 826# CONFIG_SPI_TLE62X0 is not set
827CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
828# CONFIG_GPIOLIB is not set
799# CONFIG_W1 is not set 829# CONFIG_W1 is not set
800# CONFIG_POWER_SUPPLY is not set 830# CONFIG_POWER_SUPPLY is not set
801CONFIG_HWMON=y 831CONFIG_HWMON=y
802# CONFIG_HWMON_VID is not set 832# CONFIG_HWMON_VID is not set
833# CONFIG_SENSORS_AD7414 is not set
803# CONFIG_SENSORS_AD7418 is not set 834# CONFIG_SENSORS_AD7418 is not set
835# CONFIG_SENSORS_ADCXX is not set
804# CONFIG_SENSORS_ADM1021 is not set 836# CONFIG_SENSORS_ADM1021 is not set
805# CONFIG_SENSORS_ADM1025 is not set 837# CONFIG_SENSORS_ADM1025 is not set
806# CONFIG_SENSORS_ADM1026 is not set 838# CONFIG_SENSORS_ADM1026 is not set
@@ -808,6 +840,7 @@ CONFIG_HWMON=y
808# CONFIG_SENSORS_ADM1031 is not set 840# CONFIG_SENSORS_ADM1031 is not set
809# CONFIG_SENSORS_ADM9240 is not set 841# CONFIG_SENSORS_ADM9240 is not set
810# CONFIG_SENSORS_ADT7470 is not set 842# CONFIG_SENSORS_ADT7470 is not set
843# CONFIG_SENSORS_ADT7473 is not set
811# CONFIG_SENSORS_ATXP1 is not set 844# CONFIG_SENSORS_ATXP1 is not set
812# CONFIG_SENSORS_DS1621 is not set 845# CONFIG_SENSORS_DS1621 is not set
813# CONFIG_SENSORS_F71805F is not set 846# CONFIG_SENSORS_F71805F is not set
@@ -828,6 +861,7 @@ CONFIG_HWMON=y
828# CONFIG_SENSORS_LM90 is not set 861# CONFIG_SENSORS_LM90 is not set
829# CONFIG_SENSORS_LM92 is not set 862# CONFIG_SENSORS_LM92 is not set
830# CONFIG_SENSORS_LM93 is not set 863# CONFIG_SENSORS_LM93 is not set
864# CONFIG_SENSORS_MAX1111 is not set
831# CONFIG_SENSORS_MAX1619 is not set 865# CONFIG_SENSORS_MAX1619 is not set
832# CONFIG_SENSORS_MAX6650 is not set 866# CONFIG_SENSORS_MAX6650 is not set
833# CONFIG_SENSORS_PC87360 is not set 867# CONFIG_SENSORS_PC87360 is not set
@@ -836,6 +870,7 @@ CONFIG_HWMON=y
836# CONFIG_SENSORS_SMSC47M1 is not set 870# CONFIG_SENSORS_SMSC47M1 is not set
837# CONFIG_SENSORS_SMSC47M192 is not set 871# CONFIG_SENSORS_SMSC47M192 is not set
838# CONFIG_SENSORS_SMSC47B397 is not set 872# CONFIG_SENSORS_SMSC47B397 is not set
873# CONFIG_SENSORS_ADS7828 is not set
839# CONFIG_SENSORS_THMC50 is not set 874# CONFIG_SENSORS_THMC50 is not set
840# CONFIG_SENSORS_VT1211 is not set 875# CONFIG_SENSORS_VT1211 is not set
841# CONFIG_SENSORS_W83781D is not set 876# CONFIG_SENSORS_W83781D is not set
@@ -843,9 +878,12 @@ CONFIG_HWMON=y
843# CONFIG_SENSORS_W83792D is not set 878# CONFIG_SENSORS_W83792D is not set
844# CONFIG_SENSORS_W83793 is not set 879# CONFIG_SENSORS_W83793 is not set
845# CONFIG_SENSORS_W83L785TS is not set 880# CONFIG_SENSORS_W83L785TS is not set
881# CONFIG_SENSORS_W83L786NG is not set
846# CONFIG_SENSORS_W83627HF is not set 882# CONFIG_SENSORS_W83627HF is not set
847# CONFIG_SENSORS_W83627EHF is not set 883# CONFIG_SENSORS_W83627EHF is not set
848# CONFIG_HWMON_DEBUG_CHIP is not set 884# CONFIG_HWMON_DEBUG_CHIP is not set
885# CONFIG_THERMAL is not set
886# CONFIG_THERMAL_HWMON is not set
849CONFIG_WATCHDOG=y 887CONFIG_WATCHDOG=y
850# CONFIG_WATCHDOG_NOWAYOUT is not set 888# CONFIG_WATCHDOG_NOWAYOUT is not set
851 889
@@ -856,21 +894,29 @@ CONFIG_WATCHDOG=y
856CONFIG_BFIN_WDT=y 894CONFIG_BFIN_WDT=y
857 895
858# 896#
859# Sonics Silicon Backplane
860#
861CONFIG_SSB_POSSIBLE=y
862# CONFIG_SSB is not set
863
864#
865# Multifunction device drivers 897# Multifunction device drivers
866# 898#
899# CONFIG_MFD_CORE is not set
867# CONFIG_MFD_SM501 is not set 900# CONFIG_MFD_SM501 is not set
901# CONFIG_HTC_PASIC3 is not set
902# CONFIG_MFD_TMIO is not set
903# CONFIG_MFD_WM8400 is not set
904# CONFIG_MFD_WM8350_I2C is not set
868 905
869# 906#
870# Multimedia devices 907# Multimedia devices
871# 908#
909
910#
911# Multimedia core support
912#
872# CONFIG_VIDEO_DEV is not set 913# CONFIG_VIDEO_DEV is not set
873# CONFIG_DVB_CORE is not set 914# CONFIG_DVB_CORE is not set
915# CONFIG_VIDEO_MEDIA is not set
916
917#
918# Multimedia drivers
919#
874# CONFIG_DAB is not set 920# CONFIG_DAB is not set
875 921
876# 922#
@@ -881,6 +927,7 @@ CONFIG_SSB_POSSIBLE=y
881CONFIG_FB=m 927CONFIG_FB=m
882CONFIG_FIRMWARE_EDID=y 928CONFIG_FIRMWARE_EDID=y
883# CONFIG_FB_DDC is not set 929# CONFIG_FB_DDC is not set
930# CONFIG_FB_BOOT_VESA_SUPPORT is not set
884CONFIG_FB_CFB_FILLRECT=m 931CONFIG_FB_CFB_FILLRECT=m
885CONFIG_FB_CFB_COPYAREA=m 932CONFIG_FB_CFB_COPYAREA=m
886CONFIG_FB_CFB_IMAGEBLIT=m 933CONFIG_FB_CFB_IMAGEBLIT=m
@@ -888,8 +935,8 @@ CONFIG_FB_CFB_IMAGEBLIT=m
888# CONFIG_FB_SYS_FILLRECT is not set 935# CONFIG_FB_SYS_FILLRECT is not set
889# CONFIG_FB_SYS_COPYAREA is not set 936# CONFIG_FB_SYS_COPYAREA is not set
890# CONFIG_FB_SYS_IMAGEBLIT is not set 937# CONFIG_FB_SYS_IMAGEBLIT is not set
938# CONFIG_FB_FOREIGN_ENDIAN is not set
891# CONFIG_FB_SYS_FOPS is not set 939# CONFIG_FB_SYS_FOPS is not set
892CONFIG_FB_DEFERRED_IO=y
893# CONFIG_FB_SVGALIB is not set 940# CONFIG_FB_SVGALIB is not set
894# CONFIG_FB_MACMODES is not set 941# CONFIG_FB_MACMODES is not set
895# CONFIG_FB_BACKLIGHT is not set 942# CONFIG_FB_BACKLIGHT is not set
@@ -899,8 +946,12 @@ CONFIG_FB_DEFERRED_IO=y
899# 946#
900# Frame buffer hardware drivers 947# Frame buffer hardware drivers
901# 948#
902# CONFIG_FB_HITACHI_TX09 is not set
903# CONFIG_FB_BFIN_T350MCQB is not set 949# CONFIG_FB_BFIN_T350MCQB is not set
950# CONFIG_FB_BFIN_LQ035Q1 is not set
951CONFIG_FB_BF537_LQ035=m
952CONFIG_LQ035_SLAVE_ADDR=0x58
953# CONFIG_FB_BFIN_LANDSCAPE is not set
954# CONFIG_FB_BFIN_BGR is not set
904CONFIG_FB_BFIN_7393=m 955CONFIG_FB_BFIN_7393=m
905CONFIG_NTSC=y 956CONFIG_NTSC=y
906# CONFIG_PAL is not set 957# CONFIG_PAL is not set
@@ -910,15 +961,17 @@ CONFIG_NTSC=y
910# CONFIG_PAL_YCBCR is not set 961# CONFIG_PAL_YCBCR is not set
911CONFIG_ADV7393_1XMEM=y 962CONFIG_ADV7393_1XMEM=y
912# CONFIG_ADV7393_2XMEM is not set 963# CONFIG_ADV7393_2XMEM is not set
913CONFIG_FB_BF537_LQ035=m 964# CONFIG_FB_HITACHI_TX09 is not set
914CONFIG_LQ035_SLAVE_ADDR=0x58
915# CONFIG_FB_BFIN_LANDSCAPE is not set
916# CONFIG_FB_BFIN_BGR is not set
917# CONFIG_FB_S1D13XXX is not set 965# CONFIG_FB_S1D13XXX is not set
918# CONFIG_FB_VIRTUAL is not set 966# CONFIG_FB_VIRTUAL is not set
967# CONFIG_FB_METRONOME is not set
919CONFIG_BACKLIGHT_LCD_SUPPORT=y 968CONFIG_BACKLIGHT_LCD_SUPPORT=y
920CONFIG_LCD_CLASS_DEVICE=m 969CONFIG_LCD_CLASS_DEVICE=m
921# CONFIG_LCD_LTV350QV is not set 970# CONFIG_LCD_LTV350QV is not set
971# CONFIG_LCD_ILI9320 is not set
972# CONFIG_LCD_TDO24M is not set
973# CONFIG_LCD_VGG2432A4 is not set
974# CONFIG_LCD_PLATFORM is not set
922CONFIG_BACKLIGHT_CLASS_DEVICE=m 975CONFIG_BACKLIGHT_CLASS_DEVICE=m
923CONFIG_BACKLIGHT_CORGI=m 976CONFIG_BACKLIGHT_CORGI=m
924 977
@@ -927,15 +980,8 @@ CONFIG_BACKLIGHT_CORGI=m
927# 980#
928# CONFIG_DISPLAY_SUPPORT is not set 981# CONFIG_DISPLAY_SUPPORT is not set
929# CONFIG_LOGO is not set 982# CONFIG_LOGO is not set
930
931#
932# Sound
933#
934CONFIG_SOUND=m 983CONFIG_SOUND=m
935 984CONFIG_SOUND_OSS_CORE=y
936#
937# Advanced Linux Sound Architecture
938#
939CONFIG_SND=m 985CONFIG_SND=m
940CONFIG_SND_TIMER=m 986CONFIG_SND_TIMER=m
941CONFIG_SND_PCM=m 987CONFIG_SND_PCM=m
@@ -949,18 +995,12 @@ CONFIG_SND_SUPPORT_OLD_API=y
949CONFIG_SND_VERBOSE_PROCFS=y 995CONFIG_SND_VERBOSE_PROCFS=y
950# CONFIG_SND_VERBOSE_PRINTK is not set 996# CONFIG_SND_VERBOSE_PRINTK is not set
951# CONFIG_SND_DEBUG is not set 997# CONFIG_SND_DEBUG is not set
952 998CONFIG_SND_DRIVERS=y
953#
954# Generic devices
955#
956# CONFIG_SND_DUMMY is not set 999# CONFIG_SND_DUMMY is not set
957# CONFIG_SND_MTPAV is not set 1000# CONFIG_SND_MTPAV is not set
958# CONFIG_SND_SERIAL_U16550 is not set 1001# CONFIG_SND_SERIAL_U16550 is not set
959# CONFIG_SND_MPU401 is not set 1002# CONFIG_SND_MPU401 is not set
960 1003CONFIG_SND_SPI=y
961#
962# SPI devices
963#
964 1004
965# 1005#
966# ALSA Blackfin devices 1006# ALSA Blackfin devices
@@ -972,51 +1012,46 @@ CONFIG_SND_BLACKFIN_AD1836_MULSUB=y
972# CONFIG_SND_BLACKFIN_AD1836_5P1 is not set 1012# CONFIG_SND_BLACKFIN_AD1836_5P1 is not set
973CONFIG_SND_BLACKFIN_SPORT=0 1013CONFIG_SND_BLACKFIN_SPORT=0
974CONFIG_SND_BLACKFIN_SPI_PFBIT=4 1014CONFIG_SND_BLACKFIN_SPI_PFBIT=4
975CONFIG_SND_BFIN_AD73311=m
976CONFIG_SND_BFIN_SPORT=0 1015CONFIG_SND_BFIN_SPORT=0
977CONFIG_SND_BFIN_AD73311_SE=4
978CONFIG_SND_BFIN_AD73322=m 1016CONFIG_SND_BFIN_AD73322=m
979CONFIG_SND_BFIN_AD73322_SPORT0_SE=10 1017CONFIG_SND_BFIN_AD73322_SPORT0_SE=10
980CONFIG_SND_BFIN_AD73322_SPORT1_SE=14 1018CONFIG_SND_BFIN_AD73322_SPORT1_SE=14
981CONFIG_SND_BFIN_AD73322_RESET=12 1019CONFIG_SND_BFIN_AD73322_RESET=12
982
983#
984# System on Chip audio support
985#
986CONFIG_SND_SOC_AC97_BUS=y
987CONFIG_SND_SOC=m 1020CONFIG_SND_SOC=m
988CONFIG_SND_BF5XX_SOC=m 1021CONFIG_SND_SOC_AC97_BUS=y
989CONFIG_SND_MMAP_SUPPORT=y 1022CONFIG_SND_BF5XX_I2S=m
990CONFIG_SND_BF5XX_SOC_AC97=m
991# CONFIG_SND_BF5XX_SOC_WM8750 is not set
992# CONFIG_SND_BF5XX_SOC_WM8731 is not set
993# CONFIG_SND_BF5XX_SOC_SSM2602 is not set 1023# CONFIG_SND_BF5XX_SOC_SSM2602 is not set
994CONFIG_SND_BF5XX_SOC_BF5xx=m 1024CONFIG_SND_BF5XX_SOC_AD73311=m
1025CONFIG_SND_BFIN_AD73311_SE=4
1026CONFIG_SND_BF5XX_AC97=m
1027CONFIG_SND_BF5XX_MMAP_SUPPORT=y
1028# CONFIG_SND_BF5XX_MULTICHAN_SUPPORT is not set
1029CONFIG_SND_BF5XX_SOC_SPORT=m
1030CONFIG_SND_BF5XX_SOC_I2S=m
1031CONFIG_SND_BF5XX_SOC_AC97=m
1032CONFIG_SND_BF5XX_SOC_AD1980=m
995CONFIG_SND_BF5XX_SPORT_NUM=0 1033CONFIG_SND_BF5XX_SPORT_NUM=0
996# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set 1034# CONFIG_SND_BF5XX_HAVE_COLD_RESET is not set
997 1035# CONFIG_SND_SOC_ALL_CODECS is not set
998#
999# SoC Audio support for SuperH
1000#
1001CONFIG_SND_SOC_AD1980=m 1036CONFIG_SND_SOC_AD1980=m
1002 1037CONFIG_SND_SOC_AD73311=m
1003#
1004# Open Sound System
1005#
1006# CONFIG_SOUND_PRIME is not set 1038# CONFIG_SOUND_PRIME is not set
1007CONFIG_AC97_BUS=m 1039CONFIG_AC97_BUS=m
1008CONFIG_HID_SUPPORT=y 1040CONFIG_HID_SUPPORT=y
1009CONFIG_HID=y 1041CONFIG_HID=y
1010# CONFIG_HID_DEBUG is not set 1042# CONFIG_HID_DEBUG is not set
1011# CONFIG_HIDRAW is not set 1043# CONFIG_HIDRAW is not set
1044# CONFIG_HID_PID is not set
1045
1046#
1047# Special HID drivers
1048#
1049CONFIG_HID_COMPAT=y
1012# CONFIG_USB_SUPPORT is not set 1050# CONFIG_USB_SUPPORT is not set
1013# CONFIG_NO_DUMMY_DELAY is not set
1014# CONFIG_DUMMY_DELAY_BANK0 is not set
1015# CONFIG_DUMMY_DELAY_BANK1 is not set
1016# CONFIG_DUMMY_DELAY_BANK2 is not set
1017# CONFIG_DUMMY_DELAY_BANK3 is not set
1018# CONFIG_MMC is not set 1051# CONFIG_MMC is not set
1052# CONFIG_MEMSTICK is not set
1019# CONFIG_NEW_LEDS is not set 1053# CONFIG_NEW_LEDS is not set
1054# CONFIG_ACCESSIBILITY is not set
1020CONFIG_RTC_LIB=y 1055CONFIG_RTC_LIB=y
1021CONFIG_RTC_CLASS=y 1056CONFIG_RTC_CLASS=y
1022CONFIG_RTC_HCTOSYS=y 1057CONFIG_RTC_HCTOSYS=y
@@ -1045,51 +1080,57 @@ CONFIG_RTC_INTF_DEV=y
1045# CONFIG_RTC_DRV_PCF8563 is not set 1080# CONFIG_RTC_DRV_PCF8563 is not set
1046# CONFIG_RTC_DRV_PCF8583 is not set 1081# CONFIG_RTC_DRV_PCF8583 is not set
1047# CONFIG_RTC_DRV_M41T80 is not set 1082# CONFIG_RTC_DRV_M41T80 is not set
1083# CONFIG_RTC_DRV_S35390A is not set
1084# CONFIG_RTC_DRV_FM3130 is not set
1048 1085
1049# 1086#
1050# SPI RTC drivers 1087# SPI RTC drivers
1051# 1088#
1052# CONFIG_RTC_DRV_RS5C348 is not set 1089# CONFIG_RTC_DRV_M41T94 is not set
1090# CONFIG_RTC_DRV_DS1305 is not set
1053# CONFIG_RTC_DRV_MAX6902 is not set 1091# CONFIG_RTC_DRV_MAX6902 is not set
1092# CONFIG_RTC_DRV_R9701 is not set
1093# CONFIG_RTC_DRV_RS5C348 is not set
1094# CONFIG_RTC_DRV_DS3234 is not set
1054 1095
1055# 1096#
1056# Platform RTC drivers 1097# Platform RTC drivers
1057# 1098#
1099# CONFIG_RTC_DRV_DS1286 is not set
1100# CONFIG_RTC_DRV_DS1511 is not set
1058# CONFIG_RTC_DRV_DS1553 is not set 1101# CONFIG_RTC_DRV_DS1553 is not set
1059# CONFIG_RTC_DRV_STK17TA8 is not set
1060# CONFIG_RTC_DRV_DS1742 is not set 1102# CONFIG_RTC_DRV_DS1742 is not set
1103# CONFIG_RTC_DRV_STK17TA8 is not set
1061# CONFIG_RTC_DRV_M48T86 is not set 1104# CONFIG_RTC_DRV_M48T86 is not set
1105# CONFIG_RTC_DRV_M48T35 is not set
1062# CONFIG_RTC_DRV_M48T59 is not set 1106# CONFIG_RTC_DRV_M48T59 is not set
1107# CONFIG_RTC_DRV_BQ4802 is not set
1063# CONFIG_RTC_DRV_V3020 is not set 1108# CONFIG_RTC_DRV_V3020 is not set
1064 1109
1065# 1110#
1066# on-CPU RTC drivers 1111# on-CPU RTC drivers
1067# 1112#
1068CONFIG_RTC_DRV_BFIN=y 1113CONFIG_RTC_DRV_BFIN=y
1069 1114# CONFIG_DMADEVICES is not set
1070#
1071# Userspace I/O
1072#
1073# CONFIG_UIO is not set 1115# CONFIG_UIO is not set
1116# CONFIG_STAGING is not set
1074 1117
1075# 1118#
1076# File systems 1119# File systems
1077# 1120#
1078# CONFIG_EXT2_FS is not set 1121# CONFIG_EXT2_FS is not set
1079# CONFIG_EXT3_FS is not set 1122# CONFIG_EXT3_FS is not set
1080# CONFIG_EXT4DEV_FS is not set 1123# CONFIG_EXT4_FS is not set
1081# CONFIG_REISERFS_FS is not set 1124# CONFIG_REISERFS_FS is not set
1082# CONFIG_JFS_FS is not set 1125# CONFIG_JFS_FS is not set
1083# CONFIG_FS_POSIX_ACL is not set 1126# CONFIG_FS_POSIX_ACL is not set
1127CONFIG_FILE_LOCKING=y
1084# CONFIG_XFS_FS is not set 1128# CONFIG_XFS_FS is not set
1085# CONFIG_GFS2_FS is not set
1086# CONFIG_OCFS2_FS is not set 1129# CONFIG_OCFS2_FS is not set
1087# CONFIG_MINIX_FS is not set 1130# CONFIG_DNOTIFY is not set
1088# CONFIG_ROMFS_FS is not set
1089CONFIG_INOTIFY=y 1131CONFIG_INOTIFY=y
1090CONFIG_INOTIFY_USER=y 1132CONFIG_INOTIFY_USER=y
1091# CONFIG_QUOTA is not set 1133# CONFIG_QUOTA is not set
1092# CONFIG_DNOTIFY is not set
1093# CONFIG_AUTOFS_FS is not set 1134# CONFIG_AUTOFS_FS is not set
1094# CONFIG_AUTOFS4_FS is not set 1135# CONFIG_AUTOFS4_FS is not set
1095# CONFIG_FUSE_FS is not set 1136# CONFIG_FUSE_FS is not set
@@ -1129,11 +1170,11 @@ CONFIG_SYSFS=y
1129# CONFIG_EFS_FS is not set 1170# CONFIG_EFS_FS is not set
1130CONFIG_YAFFS_FS=m 1171CONFIG_YAFFS_FS=m
1131CONFIG_YAFFS_YAFFS1=y 1172CONFIG_YAFFS_YAFFS1=y
1173# CONFIG_YAFFS_9BYTE_TAGS is not set
1132# CONFIG_YAFFS_DOES_ECC is not set 1174# CONFIG_YAFFS_DOES_ECC is not set
1133CONFIG_YAFFS_YAFFS2=y 1175CONFIG_YAFFS_YAFFS2=y
1134CONFIG_YAFFS_AUTO_YAFFS2=y 1176CONFIG_YAFFS_AUTO_YAFFS2=y
1135# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set 1177# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1136CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
1137# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set 1178# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1138# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set 1179# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1139CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y 1180CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
@@ -1150,8 +1191,11 @@ CONFIG_JFFS2_RTIME=y
1150# CONFIG_JFFS2_RUBIN is not set 1191# CONFIG_JFFS2_RUBIN is not set
1151# CONFIG_CRAMFS is not set 1192# CONFIG_CRAMFS is not set
1152# CONFIG_VXFS_FS is not set 1193# CONFIG_VXFS_FS is not set
1194# CONFIG_MINIX_FS is not set
1195# CONFIG_OMFS_FS is not set
1153# CONFIG_HPFS_FS is not set 1196# CONFIG_HPFS_FS is not set
1154# CONFIG_QNX4FS_FS is not set 1197# CONFIG_QNX4FS_FS is not set
1198# CONFIG_ROMFS_FS is not set
1155# CONFIG_SYSV_FS is not set 1199# CONFIG_SYSV_FS is not set
1156# CONFIG_UFS_FS is not set 1200# CONFIG_UFS_FS is not set
1157CONFIG_NETWORK_FILESYSTEMS=y 1201CONFIG_NETWORK_FILESYSTEMS=y
@@ -1159,13 +1203,12 @@ CONFIG_NFS_FS=m
1159CONFIG_NFS_V3=y 1203CONFIG_NFS_V3=y
1160# CONFIG_NFS_V3_ACL is not set 1204# CONFIG_NFS_V3_ACL is not set
1161# CONFIG_NFS_V4 is not set 1205# CONFIG_NFS_V4 is not set
1162# CONFIG_NFS_DIRECTIO is not set
1163# CONFIG_NFSD is not set 1206# CONFIG_NFSD is not set
1164CONFIG_LOCKD=m 1207CONFIG_LOCKD=m
1165CONFIG_LOCKD_V4=y 1208CONFIG_LOCKD_V4=y
1166CONFIG_NFS_COMMON=y 1209CONFIG_NFS_COMMON=y
1167CONFIG_SUNRPC=m 1210CONFIG_SUNRPC=m
1168# CONFIG_SUNRPC_BIND34 is not set 1211# CONFIG_SUNRPC_REGISTER_V4 is not set
1169# CONFIG_RPCSEC_GSS_KRB5 is not set 1212# CONFIG_RPCSEC_GSS_KRB5 is not set
1170# CONFIG_RPCSEC_GSS_SPKM3 is not set 1213# CONFIG_RPCSEC_GSS_SPKM3 is not set
1171CONFIG_SMB_FS=m 1214CONFIG_SMB_FS=m
@@ -1221,9 +1264,6 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1221# CONFIG_NLS_KOI8_U is not set 1264# CONFIG_NLS_KOI8_U is not set
1222# CONFIG_NLS_UTF8 is not set 1265# CONFIG_NLS_UTF8 is not set
1223# CONFIG_DLM is not set 1266# CONFIG_DLM is not set
1224CONFIG_INSTRUMENTATION=y
1225# CONFIG_PROFILING is not set
1226# CONFIG_MARKERS is not set
1227 1267
1228# 1268#
1229# Kernel hacking 1269# Kernel hacking
@@ -1231,14 +1271,53 @@ CONFIG_INSTRUMENTATION=y
1231# CONFIG_PRINTK_TIME is not set 1271# CONFIG_PRINTK_TIME is not set
1232CONFIG_ENABLE_WARN_DEPRECATED=y 1272CONFIG_ENABLE_WARN_DEPRECATED=y
1233CONFIG_ENABLE_MUST_CHECK=y 1273CONFIG_ENABLE_MUST_CHECK=y
1274CONFIG_FRAME_WARN=1024
1234# CONFIG_MAGIC_SYSRQ is not set 1275# CONFIG_MAGIC_SYSRQ is not set
1235# CONFIG_UNUSED_SYMBOLS is not set 1276# CONFIG_UNUSED_SYMBOLS is not set
1236CONFIG_DEBUG_FS=y 1277CONFIG_DEBUG_FS=y
1237# CONFIG_HEADERS_CHECK is not set 1278# CONFIG_HEADERS_CHECK is not set
1238# CONFIG_DEBUG_KERNEL is not set 1279CONFIG_DEBUG_KERNEL=y
1280# CONFIG_DEBUG_SHIRQ is not set
1281CONFIG_DETECT_SOFTLOCKUP=y
1282# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1283CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1284CONFIG_SCHED_DEBUG=y
1285# CONFIG_SCHEDSTATS is not set
1286# CONFIG_TIMER_STATS is not set
1287# CONFIG_DEBUG_OBJECTS is not set
1288# CONFIG_DEBUG_SLAB is not set
1289# CONFIG_DEBUG_RT_MUTEXES is not set
1290# CONFIG_RT_MUTEX_TESTER is not set
1291# CONFIG_DEBUG_SPINLOCK is not set
1292# CONFIG_DEBUG_MUTEXES is not set
1293# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1294# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1295# CONFIG_DEBUG_KOBJECT is not set
1239# CONFIG_DEBUG_BUGVERBOSE is not set 1296# CONFIG_DEBUG_BUGVERBOSE is not set
1297CONFIG_DEBUG_INFO=y
1298# CONFIG_DEBUG_VM is not set
1299# CONFIG_DEBUG_WRITECOUNT is not set
1300# CONFIG_DEBUG_MEMORY_INIT is not set
1301# CONFIG_DEBUG_LIST is not set
1302# CONFIG_DEBUG_SG is not set
1303# CONFIG_FRAME_POINTER is not set
1304# CONFIG_BOOT_PRINTK_DELAY is not set
1305# CONFIG_RCU_TORTURE_TEST is not set
1306# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1307# CONFIG_BACKTRACE_SELF_TEST is not set
1308# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1309# CONFIG_FAULT_INJECTION is not set
1310# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1311# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1240# CONFIG_SAMPLES is not set 1312# CONFIG_SAMPLES is not set
1313CONFIG_HAVE_ARCH_KGDB=y
1314# CONFIG_KGDB is not set
1315# CONFIG_DEBUG_STACKOVERFLOW is not set
1316# CONFIG_DEBUG_STACK_USAGE is not set
1317CONFIG_DEBUG_VERBOSE=y
1241CONFIG_DEBUG_MMRS=y 1318CONFIG_DEBUG_MMRS=y
1319# CONFIG_DEBUG_HWERR is not set
1320# CONFIG_DEBUG_DOUBLEFAULT is not set
1242CONFIG_DEBUG_HUNT_FOR_ZERO=y 1321CONFIG_DEBUG_HUNT_FOR_ZERO=y
1243CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1322CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1244CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1323CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
@@ -1256,9 +1335,94 @@ CONFIG_ACCESS_CHECK=y
1256# 1335#
1257# CONFIG_KEYS is not set 1336# CONFIG_KEYS is not set
1258CONFIG_SECURITY=y 1337CONFIG_SECURITY=y
1338# CONFIG_SECURITYFS is not set
1259# CONFIG_SECURITY_NETWORK is not set 1339# CONFIG_SECURITY_NETWORK is not set
1260# CONFIG_SECURITY_CAPABILITIES is not set 1340# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1261# CONFIG_CRYPTO is not set 1341CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1342CONFIG_CRYPTO=y
1343
1344#
1345# Crypto core or helper
1346#
1347# CONFIG_CRYPTO_FIPS is not set
1348# CONFIG_CRYPTO_MANAGER is not set
1349# CONFIG_CRYPTO_GF128MUL is not set
1350# CONFIG_CRYPTO_NULL is not set
1351# CONFIG_CRYPTO_CRYPTD is not set
1352# CONFIG_CRYPTO_AUTHENC is not set
1353# CONFIG_CRYPTO_TEST is not set
1354
1355#
1356# Authenticated Encryption with Associated Data
1357#
1358# CONFIG_CRYPTO_CCM is not set
1359# CONFIG_CRYPTO_GCM is not set
1360# CONFIG_CRYPTO_SEQIV is not set
1361
1362#
1363# Block modes
1364#
1365# CONFIG_CRYPTO_CBC is not set
1366# CONFIG_CRYPTO_CTR is not set
1367# CONFIG_CRYPTO_CTS is not set
1368# CONFIG_CRYPTO_ECB is not set
1369# CONFIG_CRYPTO_LRW is not set
1370# CONFIG_CRYPTO_PCBC is not set
1371# CONFIG_CRYPTO_XTS is not set
1372
1373#
1374# Hash modes
1375#
1376# CONFIG_CRYPTO_HMAC is not set
1377# CONFIG_CRYPTO_XCBC is not set
1378
1379#
1380# Digest
1381#
1382# CONFIG_CRYPTO_CRC32C is not set
1383# CONFIG_CRYPTO_MD4 is not set
1384# CONFIG_CRYPTO_MD5 is not set
1385# CONFIG_CRYPTO_MICHAEL_MIC is not set
1386# CONFIG_CRYPTO_RMD128 is not set
1387# CONFIG_CRYPTO_RMD160 is not set
1388# CONFIG_CRYPTO_RMD256 is not set
1389# CONFIG_CRYPTO_RMD320 is not set
1390# CONFIG_CRYPTO_SHA1 is not set
1391# CONFIG_CRYPTO_SHA256 is not set
1392# CONFIG_CRYPTO_SHA512 is not set
1393# CONFIG_CRYPTO_TGR192 is not set
1394# CONFIG_CRYPTO_WP512 is not set
1395
1396#
1397# Ciphers
1398#
1399# CONFIG_CRYPTO_AES is not set
1400# CONFIG_CRYPTO_ANUBIS is not set
1401# CONFIG_CRYPTO_ARC4 is not set
1402# CONFIG_CRYPTO_BLOWFISH is not set
1403# CONFIG_CRYPTO_CAMELLIA is not set
1404# CONFIG_CRYPTO_CAST5 is not set
1405# CONFIG_CRYPTO_CAST6 is not set
1406# CONFIG_CRYPTO_DES is not set
1407# CONFIG_CRYPTO_FCRYPT is not set
1408# CONFIG_CRYPTO_KHAZAD is not set
1409# CONFIG_CRYPTO_SALSA20 is not set
1410# CONFIG_CRYPTO_SEED is not set
1411# CONFIG_CRYPTO_SERPENT is not set
1412# CONFIG_CRYPTO_TEA is not set
1413# CONFIG_CRYPTO_TWOFISH is not set
1414
1415#
1416# Compression
1417#
1418# CONFIG_CRYPTO_DEFLATE is not set
1419# CONFIG_CRYPTO_LZO is not set
1420
1421#
1422# Random Number Generation
1423#
1424# CONFIG_CRYPTO_ANSI_CPRNG is not set
1425CONFIG_CRYPTO_HW=y
1262 1426
1263# 1427#
1264# Library routines 1428# Library routines
@@ -1266,6 +1430,7 @@ CONFIG_SECURITY=y
1266CONFIG_BITREVERSE=y 1430CONFIG_BITREVERSE=y
1267CONFIG_CRC_CCITT=m 1431CONFIG_CRC_CCITT=m
1268# CONFIG_CRC16 is not set 1432# CONFIG_CRC16 is not set
1433# CONFIG_CRC_T10DIF is not set
1269# CONFIG_CRC_ITU_T is not set 1434# CONFIG_CRC_ITU_T is not set
1270CONFIG_CRC32=y 1435CONFIG_CRC32=y
1271# CONFIG_CRC7 is not set 1436# CONFIG_CRC7 is not set
diff --git a/arch/blackfin/configs/BF538-EZKIT_defconfig b/arch/blackfin/configs/BF538-EZKIT_defconfig
new file mode 100644
index 000000000000..ed15934c67c2
--- /dev/null
+++ b/arch/blackfin/configs/BF538-EZKIT_defconfig
@@ -0,0 +1,1368 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc2
4#
5# CONFIG_MMU is not set
6# CONFIG_FPU is not set
7CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y
11CONFIG_GENERIC_FIND_NEXT_BIT=y
12CONFIG_GENERIC_HWEIGHT=y
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_GENERIC_IRQ_PROBE=y
15CONFIG_GENERIC_GPIO=y
16CONFIG_FORCE_MAX_ZONEORDER=14
17CONFIG_GENERIC_CALIBRATE_DELAY=y
18CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
19
20#
21# General setup
22#
23CONFIG_EXPERIMENTAL=y
24CONFIG_BROKEN_ON_SMP=y
25CONFIG_INIT_ENV_ARG_LIMIT=32
26CONFIG_LOCALVERSION=""
27CONFIG_LOCALVERSION_AUTO=y
28CONFIG_SYSVIPC=y
29CONFIG_SYSVIPC_SYSCTL=y
30# CONFIG_POSIX_MQUEUE is not set
31# CONFIG_BSD_PROCESS_ACCT is not set
32# CONFIG_TASKSTATS is not set
33# CONFIG_AUDIT is not set
34CONFIG_IKCONFIG=y
35CONFIG_IKCONFIG_PROC=y
36CONFIG_LOG_BUF_SHIFT=14
37# CONFIG_CGROUPS is not set
38# CONFIG_GROUP_SCHED is not set
39# CONFIG_SYSFS_DEPRECATED_V2 is not set
40# CONFIG_RELAY is not set
41# CONFIG_NAMESPACES is not set
42CONFIG_BLK_DEV_INITRD=y
43CONFIG_INITRAMFS_SOURCE=""
44# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
45CONFIG_SYSCTL=y
46CONFIG_EMBEDDED=y
47CONFIG_UID16=y
48CONFIG_SYSCTL_SYSCALL=y
49CONFIG_KALLSYMS=y
50# CONFIG_KALLSYMS_ALL is not set
51# CONFIG_KALLSYMS_EXTRA_PASS is not set
52CONFIG_HOTPLUG=y
53CONFIG_PRINTK=y
54CONFIG_BUG=y
55# CONFIG_ELF_CORE is not set
56CONFIG_COMPAT_BRK=y
57CONFIG_BASE_FULL=y
58CONFIG_FUTEX=y
59CONFIG_ANON_INODES=y
60CONFIG_EPOLL=y
61CONFIG_SIGNALFD=y
62CONFIG_TIMERFD=y
63CONFIG_EVENTFD=y
64CONFIG_AIO=y
65CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_SLAB=y
67# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set
69# CONFIG_PROFILING is not set
70# CONFIG_MARKERS is not set
71CONFIG_HAVE_OPROFILE=y
72# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
73CONFIG_SLABINFO=y
74CONFIG_RT_MUTEXES=y
75CONFIG_TINY_SHMEM=y
76CONFIG_BASE_SMALL=0
77CONFIG_MODULES=y
78# CONFIG_MODULE_FORCE_LOAD is not set
79CONFIG_MODULE_UNLOAD=y
80# CONFIG_MODULE_FORCE_UNLOAD is not set
81# CONFIG_MODVERSIONS is not set
82# CONFIG_MODULE_SRCVERSION_ALL is not set
83CONFIG_KMOD=y
84CONFIG_BLOCK=y
85# CONFIG_LBD is not set
86# CONFIG_BLK_DEV_IO_TRACE is not set
87# CONFIG_LSF is not set
88# CONFIG_BLK_DEV_BSG is not set
89# CONFIG_BLK_DEV_INTEGRITY is not set
90
91#
92# IO Schedulers
93#
94CONFIG_IOSCHED_NOOP=y
95CONFIG_IOSCHED_AS=y
96# CONFIG_IOSCHED_DEADLINE is not set
97CONFIG_IOSCHED_CFQ=y
98CONFIG_DEFAULT_AS=y
99# CONFIG_DEFAULT_DEADLINE is not set
100# CONFIG_DEFAULT_CFQ is not set
101# CONFIG_DEFAULT_NOOP is not set
102CONFIG_DEFAULT_IOSCHED="anticipatory"
103CONFIG_CLASSIC_RCU=y
104# CONFIG_PREEMPT_NONE is not set
105CONFIG_PREEMPT_VOLUNTARY=y
106# CONFIG_PREEMPT is not set
107# CONFIG_FREEZER is not set
108
109#
110# Blackfin Processor Options
111#
112
113#
114# Processor and Board Settings
115#
116# CONFIG_BF512 is not set
117# CONFIG_BF514 is not set
118# CONFIG_BF516 is not set
119# CONFIG_BF518 is not set
120# CONFIG_BF522 is not set
121# CONFIG_BF523 is not set
122# CONFIG_BF524 is not set
123# CONFIG_BF525 is not set
124# CONFIG_BF526 is not set
125# CONFIG_BF527 is not set
126# CONFIG_BF531 is not set
127# CONFIG_BF532 is not set
128# CONFIG_BF533 is not set
129# CONFIG_BF534 is not set
130# CONFIG_BF536 is not set
131# CONFIG_BF537 is not set
132CONFIG_BF538=y
133# CONFIG_BF539 is not set
134# CONFIG_BF542 is not set
135# CONFIG_BF544 is not set
136# CONFIG_BF547 is not set
137# CONFIG_BF548 is not set
138# CONFIG_BF549 is not set
139# CONFIG_BF561 is not set
140CONFIG_BF_REV_MIN=4
141CONFIG_BF_REV_MAX=5
142# CONFIG_BF_REV_0_0 is not set
143# CONFIG_BF_REV_0_1 is not set
144# CONFIG_BF_REV_0_2 is not set
145# CONFIG_BF_REV_0_3 is not set
146CONFIG_BF_REV_0_4=y
147# CONFIG_BF_REV_0_5 is not set
148# CONFIG_BF_REV_0_6 is not set
149# CONFIG_BF_REV_ANY is not set
150# CONFIG_BF_REV_NONE is not set
151CONFIG_MEM_MT48LC32M8A2_75=y
152CONFIG_IRQ_PLL_WAKEUP=7
153CONFIG_IRQ_DMA0_ERROR=7
154CONFIG_IRQ_PPI_ERROR=7
155CONFIG_IRQ_SPORT0_ERROR=7
156CONFIG_IRQ_SPORT1_ERROR=7
157CONFIG_IRQ_UART0_ERROR=7
158CONFIG_IRQ_UART1_ERROR=7
159CONFIG_IRQ_RTC=8
160CONFIG_IRQ_PPI=8
161CONFIG_IRQ_SPORT0_RX=9
162CONFIG_IRQ_SPORT0_TX=9
163CONFIG_IRQ_SPORT1_RX=9
164CONFIG_IRQ_SPORT1_TX=9
165CONFIG_IRQ_SPI0=10
166CONFIG_IRQ_UART0_RX=10
167CONFIG_IRQ_UART0_TX=10
168CONFIG_IRQ_UART1_RX=10
169CONFIG_IRQ_UART1_TX=10
170CONFIG_IRQ_TIMER0=12
171CONFIG_IRQ_TIMER1=12
172CONFIG_IRQ_TIMER2=12
173CONFIG_IRQ_WATCH=13
174CONFIG_IRQ_PORTF_INTA=12
175CONFIG_IRQ_PORTF_INTB=12
176CONFIG_IRQ_SPI0_ERROR=7
177CONFIG_IRQ_SPI1_ERROR=7
178CONFIG_IRQ_DMA1_ERROR=7
179CONFIG_IRQ_CAN_RX=11
180CONFIG_IRQ_CAN_TX=11
181CONFIG_BFIN538_EZKIT=y
182
183#
184# BF538 Specific Configuration
185#
186
187#
188# Interrupt Priority Assignment
189#
190
191#
192# Priority
193#
194CONFIG_IRQ_MEM0_DMA0=13
195CONFIG_IRQ_MEM0_DMA1=13
196CONFIG_IRQ_SPORT2_ERROR=7
197CONFIG_IRQ_SPORT3_ERROR=7
198CONFIG_IRQ_SPI2_ERROR=7
199CONFIG_IRQ_UART2_ERROR=7
200CONFIG_IRQ_CAN_ERROR=7
201CONFIG_IRQ_SPORT2_RX=9
202CONFIG_IRQ_SPORT2_TX=9
203CONFIG_IRQ_SPORT3_RX=9
204CONFIG_IRQ_SPORT3_TX=9
205CONFIG_IRQ_SPI1=10
206CONFIG_IRQ_SPI2=10
207CONFIG_IRQ_UART2_RX=10
208CONFIG_IRQ_UART2_TX=10
209CONFIG_IRQ_TWI0=11
210CONFIG_IRQ_TWI1=11
211CONFIG_IRQ_MEM1_DMA0=13
212CONFIG_IRQ_MEM1_DMA1=13
213
214#
215# Board customizations
216#
217# CONFIG_CMDLINE_BOOL is not set
218CONFIG_BOOT_LOAD=0x1000
219
220#
221# Clock/PLL Setup
222#
223CONFIG_CLKIN_HZ=25000000
224# CONFIG_BFIN_KERNEL_CLOCK is not set
225CONFIG_MAX_VCO_HZ=533333333
226CONFIG_MIN_VCO_HZ=50000000
227CONFIG_MAX_SCLK_HZ=133333333
228CONFIG_MIN_SCLK_HZ=27000000
229
230#
231# Kernel Timer/Scheduler
232#
233# CONFIG_HZ_100 is not set
234CONFIG_HZ_250=y
235# CONFIG_HZ_300 is not set
236# CONFIG_HZ_1000 is not set
237CONFIG_HZ=250
238CONFIG_SCHED_HRTICK=y
239CONFIG_GENERIC_TIME=y
240CONFIG_GENERIC_CLOCKEVENTS=y
241# CONFIG_CYCLES_CLOCKSOURCE is not set
242CONFIG_TICK_ONESHOT=y
243# CONFIG_NO_HZ is not set
244CONFIG_HIGH_RES_TIMERS=y
245CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
246
247#
248# Misc
249#
250CONFIG_BFIN_SCRATCH_REG_RETN=y
251# CONFIG_BFIN_SCRATCH_REG_RETE is not set
252# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
253
254#
255# Blackfin Kernel Optimizations
256#
257
258#
259# Memory Optimizations
260#
261CONFIG_I_ENTRY_L1=y
262CONFIG_EXCPT_IRQ_SYSC_L1=y
263CONFIG_DO_IRQ_L1=y
264CONFIG_CORE_TIMER_IRQ_L1=y
265CONFIG_IDLE_L1=y
266CONFIG_SCHEDULE_L1=y
267CONFIG_ARITHMETIC_OPS_L1=y
268CONFIG_ACCESS_OK_L1=y
269CONFIG_MEMSET_L1=y
270CONFIG_MEMCPY_L1=y
271CONFIG_SYS_BFIN_SPINLOCK_L1=y
272# CONFIG_IP_CHECKSUM_L1 is not set
273CONFIG_CACHELINE_ALIGNED_L1=y
274# CONFIG_SYSCALL_TAB_L1 is not set
275# CONFIG_CPLB_SWITCH_TAB_L1 is not set
276CONFIG_APP_STACK_L1=y
277
278#
279# Speed Optimizations
280#
281CONFIG_BFIN_INS_LOWOVERHEAD=y
282CONFIG_RAMKERNEL=y
283# CONFIG_ROMKERNEL is not set
284CONFIG_SELECT_MEMORY_MODEL=y
285CONFIG_FLATMEM_MANUAL=y
286# CONFIG_DISCONTIGMEM_MANUAL is not set
287# CONFIG_SPARSEMEM_MANUAL is not set
288CONFIG_FLATMEM=y
289CONFIG_FLAT_NODE_MEM_MAP=y
290CONFIG_PAGEFLAGS_EXTENDED=y
291CONFIG_SPLIT_PTLOCK_CPUS=4
292# CONFIG_RESOURCES_64BIT is not set
293# CONFIG_PHYS_ADDR_T_64BIT is not set
294CONFIG_ZONE_DMA_FLAG=1
295CONFIG_VIRT_TO_BUS=y
296CONFIG_BFIN_GPTIMERS=y
297# CONFIG_DMA_UNCACHED_4M is not set
298# CONFIG_DMA_UNCACHED_2M is not set
299CONFIG_DMA_UNCACHED_1M=y
300# CONFIG_DMA_UNCACHED_NONE is not set
301
302#
303# Cache Support
304#
305CONFIG_BFIN_ICACHE=y
306CONFIG_BFIN_DCACHE=y
307# CONFIG_BFIN_DCACHE_BANKA is not set
308# CONFIG_BFIN_ICACHE_LOCK is not set
309# CONFIG_BFIN_WB is not set
310CONFIG_BFIN_WT=y
311# CONFIG_MPU is not set
312
313#
314# Asynchonous Memory Configuration
315#
316
317#
318# EBIU_AMGCTL Global Control
319#
320CONFIG_C_AMCKEN=y
321CONFIG_C_CDPRIO=y
322# CONFIG_C_AMBEN is not set
323# CONFIG_C_AMBEN_B0 is not set
324# CONFIG_C_AMBEN_B0_B1 is not set
325# CONFIG_C_AMBEN_B0_B1_B2 is not set
326CONFIG_C_AMBEN_ALL=y
327
328#
329# EBIU_AMBCTL Control
330#
331CONFIG_BANK_0=0x7BB0
332CONFIG_BANK_1=0x7BB0
333CONFIG_BANK_2=0x7BB0
334CONFIG_BANK_3=0x99B2
335
336#
337# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
338#
339# CONFIG_ARCH_SUPPORTS_MSI is not set
340# CONFIG_PCCARD is not set
341
342#
343# Executable file formats
344#
345CONFIG_BINFMT_ELF_FDPIC=y
346CONFIG_BINFMT_FLAT=y
347CONFIG_BINFMT_ZFLAT=y
348# CONFIG_BINFMT_SHARED_FLAT is not set
349# CONFIG_HAVE_AOUT is not set
350# CONFIG_BINFMT_MISC is not set
351
352#
353# Power management options
354#
355# CONFIG_PM is not set
356CONFIG_ARCH_SUSPEND_POSSIBLE=y
357# CONFIG_PM_WAKEUP_BY_GPIO is not set
358
359#
360# CPU Frequency scaling
361#
362# CONFIG_CPU_FREQ is not set
363CONFIG_NET=y
364
365#
366# Networking options
367#
368CONFIG_PACKET=y
369# CONFIG_PACKET_MMAP is not set
370CONFIG_UNIX=y
371CONFIG_XFRM=y
372# CONFIG_XFRM_USER is not set
373# CONFIG_XFRM_SUB_POLICY is not set
374# CONFIG_XFRM_MIGRATE is not set
375# CONFIG_XFRM_STATISTICS is not set
376# CONFIG_NET_KEY is not set
377CONFIG_INET=y
378# CONFIG_IP_MULTICAST is not set
379# CONFIG_IP_ADVANCED_ROUTER is not set
380CONFIG_IP_FIB_HASH=y
381CONFIG_IP_PNP=y
382# CONFIG_IP_PNP_DHCP is not set
383# CONFIG_IP_PNP_BOOTP is not set
384# CONFIG_IP_PNP_RARP is not set
385# CONFIG_NET_IPIP is not set
386# CONFIG_NET_IPGRE is not set
387# CONFIG_ARPD is not set
388CONFIG_SYN_COOKIES=y
389# CONFIG_INET_AH is not set
390# CONFIG_INET_ESP is not set
391# CONFIG_INET_IPCOMP is not set
392# CONFIG_INET_XFRM_TUNNEL is not set
393# CONFIG_INET_TUNNEL is not set
394CONFIG_INET_XFRM_MODE_TRANSPORT=y
395CONFIG_INET_XFRM_MODE_TUNNEL=y
396CONFIG_INET_XFRM_MODE_BEET=y
397# CONFIG_INET_LRO is not set
398CONFIG_INET_DIAG=y
399CONFIG_INET_TCP_DIAG=y
400# CONFIG_TCP_CONG_ADVANCED is not set
401CONFIG_TCP_CONG_CUBIC=y
402CONFIG_DEFAULT_TCP_CONG="cubic"
403# CONFIG_TCP_MD5SIG is not set
404# CONFIG_IPV6 is not set
405# CONFIG_NETLABEL is not set
406# CONFIG_NETWORK_SECMARK is not set
407# CONFIG_NETFILTER is not set
408# CONFIG_IP_DCCP is not set
409# CONFIG_IP_SCTP is not set
410# CONFIG_TIPC is not set
411# CONFIG_ATM is not set
412# CONFIG_BRIDGE is not set
413# CONFIG_NET_DSA is not set
414# CONFIG_VLAN_8021Q is not set
415# CONFIG_DECNET is not set
416# CONFIG_LLC2 is not set
417# CONFIG_IPX is not set
418# CONFIG_ATALK is not set
419# CONFIG_X25 is not set
420# CONFIG_LAPB is not set
421# CONFIG_ECONET is not set
422# CONFIG_WAN_ROUTER is not set
423# CONFIG_NET_SCHED is not set
424
425#
426# Network testing
427#
428# CONFIG_NET_PKTGEN is not set
429# CONFIG_HAMRADIO is not set
430# CONFIG_CAN is not set
431CONFIG_IRDA=m
432
433#
434# IrDA protocols
435#
436CONFIG_IRLAN=m
437CONFIG_IRCOMM=m
438# CONFIG_IRDA_ULTRA is not set
439
440#
441# IrDA options
442#
443CONFIG_IRDA_CACHE_LAST_LSAP=y
444# CONFIG_IRDA_FAST_RR is not set
445# CONFIG_IRDA_DEBUG is not set
446
447#
448# Infrared-port device drivers
449#
450
451#
452# SIR device drivers
453#
454CONFIG_IRTTY_SIR=m
455CONFIG_BFIN_SIR=m
456CONFIG_SIR_BFIN_DMA=y
457# CONFIG_SIR_BFIN_PIO is not set
458
459#
460# Dongle support
461#
462# CONFIG_DONGLE is not set
463
464#
465# FIR device drivers
466#
467# CONFIG_BT is not set
468# CONFIG_AF_RXRPC is not set
469# CONFIG_PHONET is not set
470CONFIG_WIRELESS=y
471# CONFIG_CFG80211 is not set
472CONFIG_WIRELESS_OLD_REGULATORY=y
473# CONFIG_WIRELESS_EXT is not set
474# CONFIG_MAC80211 is not set
475# CONFIG_IEEE80211 is not set
476# CONFIG_RFKILL is not set
477# CONFIG_NET_9P is not set
478
479#
480# Device Drivers
481#
482
483#
484# Generic Driver Options
485#
486CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
487CONFIG_STANDALONE=y
488CONFIG_PREVENT_FIRMWARE_BUILD=y
489# CONFIG_FW_LOADER is not set
490# CONFIG_DEBUG_DRIVER is not set
491# CONFIG_DEBUG_DEVRES is not set
492# CONFIG_SYS_HYPERVISOR is not set
493# CONFIG_CONNECTOR is not set
494CONFIG_MTD=y
495# CONFIG_MTD_DEBUG is not set
496# CONFIG_MTD_CONCAT is not set
497CONFIG_MTD_PARTITIONS=y
498# CONFIG_MTD_REDBOOT_PARTS is not set
499CONFIG_MTD_CMDLINE_PARTS=y
500# CONFIG_MTD_AR7_PARTS is not set
501
502#
503# User Modules And Translation Layers
504#
505CONFIG_MTD_CHAR=m
506CONFIG_MTD_BLKDEVS=y
507CONFIG_MTD_BLOCK=y
508# CONFIG_FTL is not set
509# CONFIG_NFTL is not set
510# CONFIG_INFTL is not set
511# CONFIG_RFD_FTL is not set
512# CONFIG_SSFDC is not set
513# CONFIG_MTD_OOPS is not set
514
515#
516# RAM/ROM/Flash chip drivers
517#
518CONFIG_MTD_CFI=m
519# CONFIG_MTD_JEDECPROBE is not set
520CONFIG_MTD_GEN_PROBE=m
521# CONFIG_MTD_CFI_ADV_OPTIONS is not set
522CONFIG_MTD_MAP_BANK_WIDTH_1=y
523CONFIG_MTD_MAP_BANK_WIDTH_2=y
524CONFIG_MTD_MAP_BANK_WIDTH_4=y
525# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
526# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
527# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
528CONFIG_MTD_CFI_I1=y
529CONFIG_MTD_CFI_I2=y
530# CONFIG_MTD_CFI_I4 is not set
531# CONFIG_MTD_CFI_I8 is not set
532# CONFIG_MTD_CFI_INTELEXT is not set
533CONFIG_MTD_CFI_AMDSTD=m
534# CONFIG_MTD_CFI_STAA is not set
535CONFIG_MTD_CFI_UTIL=m
536CONFIG_MTD_RAM=y
537CONFIG_MTD_ROM=m
538# CONFIG_MTD_ABSENT is not set
539
540#
541# Mapping drivers for chip access
542#
543# CONFIG_MTD_COMPLEX_MAPPINGS is not set
544CONFIG_MTD_PHYSMAP=m
545CONFIG_MTD_PHYSMAP_START=0x20000000
546CONFIG_MTD_PHYSMAP_LEN=0x0
547CONFIG_MTD_PHYSMAP_BANKWIDTH=2
548# CONFIG_MTD_UCLINUX is not set
549# CONFIG_MTD_PLATRAM is not set
550
551#
552# Self-contained MTD device drivers
553#
554# CONFIG_MTD_DATAFLASH is not set
555# CONFIG_MTD_M25P80 is not set
556# CONFIG_MTD_SLRAM is not set
557# CONFIG_MTD_PHRAM is not set
558# CONFIG_MTD_MTDRAM is not set
559# CONFIG_MTD_BLOCK2MTD is not set
560
561#
562# Disk-On-Chip Device Drivers
563#
564# CONFIG_MTD_DOC2000 is not set
565# CONFIG_MTD_DOC2001 is not set
566# CONFIG_MTD_DOC2001PLUS is not set
567CONFIG_MTD_NAND=m
568# CONFIG_MTD_NAND_VERIFY_WRITE is not set
569# CONFIG_MTD_NAND_ECC_SMC is not set
570# CONFIG_MTD_NAND_MUSEUM_IDS is not set
571CONFIG_MTD_NAND_BFIN=m
572CONFIG_BFIN_NAND_BASE=0x20212000
573CONFIG_BFIN_NAND_CLE=2
574CONFIG_BFIN_NAND_ALE=1
575CONFIG_BFIN_NAND_READY=3
576CONFIG_MTD_NAND_IDS=m
577# CONFIG_MTD_NAND_DISKONCHIP is not set
578# CONFIG_MTD_NAND_NANDSIM is not set
579# CONFIG_MTD_NAND_PLATFORM is not set
580# CONFIG_MTD_ONENAND is not set
581
582#
583# UBI - Unsorted block images
584#
585# CONFIG_MTD_UBI is not set
586# CONFIG_PARPORT is not set
587CONFIG_BLK_DEV=y
588# CONFIG_BLK_DEV_COW_COMMON is not set
589# CONFIG_BLK_DEV_LOOP is not set
590# CONFIG_BLK_DEV_NBD is not set
591CONFIG_BLK_DEV_RAM=y
592CONFIG_BLK_DEV_RAM_COUNT=16
593CONFIG_BLK_DEV_RAM_SIZE=4096
594# CONFIG_BLK_DEV_XIP is not set
595# CONFIG_CDROM_PKTCDVD is not set
596# CONFIG_ATA_OVER_ETH is not set
597# CONFIG_BLK_DEV_HD is not set
598# CONFIG_MISC_DEVICES is not set
599CONFIG_HAVE_IDE=y
600# CONFIG_IDE is not set
601
602#
603# SCSI device support
604#
605# CONFIG_RAID_ATTRS is not set
606# CONFIG_SCSI is not set
607# CONFIG_SCSI_DMA is not set
608# CONFIG_SCSI_NETLINK is not set
609# CONFIG_ATA is not set
610# CONFIG_MD is not set
611CONFIG_NETDEVICES=y
612# CONFIG_DUMMY is not set
613# CONFIG_BONDING is not set
614# CONFIG_MACVLAN is not set
615# CONFIG_EQUALIZER is not set
616# CONFIG_TUN is not set
617# CONFIG_VETH is not set
618CONFIG_PHYLIB=y
619
620#
621# MII PHY device drivers
622#
623# CONFIG_MARVELL_PHY is not set
624# CONFIG_DAVICOM_PHY is not set
625# CONFIG_QSEMI_PHY is not set
626# CONFIG_LXT_PHY is not set
627# CONFIG_CICADA_PHY is not set
628# CONFIG_VITESSE_PHY is not set
629CONFIG_SMSC_PHY=y
630# CONFIG_BROADCOM_PHY is not set
631# CONFIG_ICPLUS_PHY is not set
632# CONFIG_REALTEK_PHY is not set
633# CONFIG_FIXED_PHY is not set
634# CONFIG_MDIO_BITBANG is not set
635CONFIG_NET_ETHERNET=y
636CONFIG_MII=y
637CONFIG_SMC91X=y
638# CONFIG_SMSC911X is not set
639# CONFIG_DM9000 is not set
640# CONFIG_ENC28J60 is not set
641# CONFIG_IBM_NEW_EMAC_ZMII is not set
642# CONFIG_IBM_NEW_EMAC_RGMII is not set
643# CONFIG_IBM_NEW_EMAC_TAH is not set
644# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
645# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
646# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
647# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
648# CONFIG_NETDEV_1000 is not set
649# CONFIG_NETDEV_10000 is not set
650
651#
652# Wireless LAN
653#
654# CONFIG_WLAN_PRE80211 is not set
655# CONFIG_WLAN_80211 is not set
656# CONFIG_IWLWIFI_LEDS is not set
657# CONFIG_WAN is not set
658# CONFIG_PPP is not set
659# CONFIG_SLIP is not set
660# CONFIG_NETCONSOLE is not set
661# CONFIG_NETPOLL is not set
662# CONFIG_NET_POLL_CONTROLLER is not set
663# CONFIG_ISDN is not set
664# CONFIG_PHONE is not set
665
666#
667# Input device support
668#
669CONFIG_INPUT=y
670# CONFIG_INPUT_FF_MEMLESS is not set
671# CONFIG_INPUT_POLLDEV is not set
672
673#
674# Userland interfaces
675#
676# CONFIG_INPUT_MOUSEDEV is not set
677# CONFIG_INPUT_JOYDEV is not set
678CONFIG_INPUT_EVDEV=m
679# CONFIG_INPUT_EVBUG is not set
680
681#
682# Input Device Drivers
683#
684# CONFIG_INPUT_KEYBOARD is not set
685# CONFIG_INPUT_MOUSE is not set
686# CONFIG_INPUT_JOYSTICK is not set
687# CONFIG_INPUT_TABLET is not set
688CONFIG_INPUT_TOUCHSCREEN=y
689# CONFIG_TOUCHSCREEN_ADS7846 is not set
690# CONFIG_TOUCHSCREEN_AD7877 is not set
691# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
692CONFIG_TOUCHSCREEN_AD7879_SPI=y
693CONFIG_TOUCHSCREEN_AD7879=m
694# CONFIG_TOUCHSCREEN_FUJITSU is not set
695# CONFIG_TOUCHSCREEN_GUNZE is not set
696# CONFIG_TOUCHSCREEN_ELO is not set
697# CONFIG_TOUCHSCREEN_MTOUCH is not set
698# CONFIG_TOUCHSCREEN_INEXIO is not set
699# CONFIG_TOUCHSCREEN_MK712 is not set
700# CONFIG_TOUCHSCREEN_PENMOUNT is not set
701# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
702# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
703# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
704CONFIG_INPUT_MISC=y
705# CONFIG_INPUT_UINPUT is not set
706# CONFIG_CONFIG_INPUT_PCF8574 is not set
707
708#
709# Hardware I/O ports
710#
711# CONFIG_SERIO is not set
712# CONFIG_GAMEPORT is not set
713
714#
715# Character devices
716#
717# CONFIG_AD9960 is not set
718# CONFIG_SPI_ADC_BF533 is not set
719# CONFIG_BF5xx_PPIFCD is not set
720# CONFIG_BFIN_SIMPLE_TIMER is not set
721# CONFIG_BF5xx_PPI is not set
722CONFIG_BFIN_SPORT=y
723# CONFIG_BFIN_TIMER_LATENCY is not set
724# CONFIG_TWI_LCD is not set
725CONFIG_BFIN_DMA_INTERFACE=m
726CONFIG_SIMPLE_GPIO=m
727# CONFIG_VT is not set
728# CONFIG_DEVKMEM is not set
729# CONFIG_BFIN_JTAG_COMM is not set
730# CONFIG_SERIAL_NONSTANDARD is not set
731
732#
733# Serial drivers
734#
735# CONFIG_SERIAL_8250 is not set
736
737#
738# Non-8250 serial port support
739#
740CONFIG_SERIAL_BFIN=y
741CONFIG_SERIAL_BFIN_CONSOLE=y
742CONFIG_SERIAL_BFIN_DMA=y
743# CONFIG_SERIAL_BFIN_PIO is not set
744CONFIG_SERIAL_BFIN_UART0=y
745# CONFIG_BFIN_UART0_CTSRTS is not set
746CONFIG_SERIAL_BFIN_UART1=y
747# CONFIG_BFIN_UART1_CTSRTS is not set
748CONFIG_SERIAL_BFIN_UART2=y
749# CONFIG_BFIN_UART2_CTSRTS is not set
750CONFIG_SERIAL_CORE=y
751CONFIG_SERIAL_CORE_CONSOLE=y
752# CONFIG_SERIAL_BFIN_SPORT is not set
753CONFIG_UNIX98_PTYS=y
754# CONFIG_LEGACY_PTYS is not set
755
756#
757# CAN, the car bus and industrial fieldbus
758#
759# CONFIG_CAN4LINUX is not set
760# CONFIG_IPMI_HANDLER is not set
761# CONFIG_HW_RANDOM is not set
762# CONFIG_R3964 is not set
763# CONFIG_RAW_DRIVER is not set
764# CONFIG_TCG_TPM is not set
765CONFIG_I2C=y
766CONFIG_I2C_BOARDINFO=y
767# CONFIG_I2C_CHARDEV is not set
768CONFIG_I2C_HELPER_AUTO=y
769
770#
771# I2C Hardware Bus support
772#
773
774#
775# I2C system bus drivers (mostly embedded / system-on-chip)
776#
777CONFIG_I2C_BLACKFIN_TWI=y
778CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
779# CONFIG_I2C_GPIO is not set
780# CONFIG_I2C_OCORES is not set
781# CONFIG_I2C_SIMTEC is not set
782
783#
784# External I2C/SMBus adapter drivers
785#
786# CONFIG_I2C_PARPORT_LIGHT is not set
787# CONFIG_I2C_TAOS_EVM is not set
788
789#
790# Other I2C/SMBus bus drivers
791#
792# CONFIG_I2C_PCA_PLATFORM is not set
793# CONFIG_I2C_STUB is not set
794
795#
796# Miscellaneous I2C Chip support
797#
798# CONFIG_DS1682 is not set
799# CONFIG_AT24 is not set
800# CONFIG_SENSORS_AD5252 is not set
801# CONFIG_SENSORS_EEPROM is not set
802# CONFIG_SENSORS_PCF8574 is not set
803# CONFIG_PCF8575 is not set
804# CONFIG_SENSORS_PCA9539 is not set
805# CONFIG_SENSORS_PCF8591 is not set
806# CONFIG_SENSORS_MAX6875 is not set
807# CONFIG_SENSORS_TSL2550 is not set
808# CONFIG_I2C_DEBUG_CORE is not set
809# CONFIG_I2C_DEBUG_ALGO is not set
810# CONFIG_I2C_DEBUG_BUS is not set
811# CONFIG_I2C_DEBUG_CHIP is not set
812CONFIG_SPI=y
813# CONFIG_SPI_DEBUG is not set
814CONFIG_SPI_MASTER=y
815
816#
817# SPI Master Controller Drivers
818#
819CONFIG_SPI_BFIN=y
820# CONFIG_SPI_BFIN_LOCK is not set
821# CONFIG_SPI_BITBANG is not set
822
823#
824# SPI Protocol Masters
825#
826# CONFIG_SPI_AT25 is not set
827# CONFIG_SPI_SPIDEV is not set
828# CONFIG_SPI_TLE62X0 is not set
829CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
830# CONFIG_GPIOLIB is not set
831# CONFIG_W1 is not set
832# CONFIG_POWER_SUPPLY is not set
833CONFIG_HWMON=y
834# CONFIG_HWMON_VID is not set
835# CONFIG_SENSORS_AD7414 is not set
836# CONFIG_SENSORS_AD7418 is not set
837# CONFIG_SENSORS_ADCXX is not set
838# CONFIG_SENSORS_ADM1021 is not set
839# CONFIG_SENSORS_ADM1025 is not set
840# CONFIG_SENSORS_ADM1026 is not set
841# CONFIG_SENSORS_ADM1029 is not set
842# CONFIG_SENSORS_ADM1031 is not set
843# CONFIG_SENSORS_ADM9240 is not set
844# CONFIG_SENSORS_ADT7470 is not set
845# CONFIG_SENSORS_ADT7473 is not set
846# CONFIG_SENSORS_ATXP1 is not set
847# CONFIG_SENSORS_DS1621 is not set
848# CONFIG_SENSORS_F71805F is not set
849# CONFIG_SENSORS_F71882FG is not set
850# CONFIG_SENSORS_F75375S is not set
851# CONFIG_SENSORS_GL518SM is not set
852# CONFIG_SENSORS_GL520SM is not set
853# CONFIG_SENSORS_IT87 is not set
854# CONFIG_SENSORS_LM63 is not set
855# CONFIG_SENSORS_LM70 is not set
856# CONFIG_SENSORS_LM75 is not set
857# CONFIG_SENSORS_LM77 is not set
858# CONFIG_SENSORS_LM78 is not set
859# CONFIG_SENSORS_LM80 is not set
860# CONFIG_SENSORS_LM83 is not set
861# CONFIG_SENSORS_LM85 is not set
862# CONFIG_SENSORS_LM87 is not set
863# CONFIG_SENSORS_LM90 is not set
864# CONFIG_SENSORS_LM92 is not set
865# CONFIG_SENSORS_LM93 is not set
866# CONFIG_SENSORS_MAX1111 is not set
867# CONFIG_SENSORS_MAX1619 is not set
868# CONFIG_SENSORS_MAX6650 is not set
869# CONFIG_SENSORS_PC87360 is not set
870# CONFIG_SENSORS_PC87427 is not set
871# CONFIG_SENSORS_DME1737 is not set
872# CONFIG_SENSORS_SMSC47M1 is not set
873# CONFIG_SENSORS_SMSC47M192 is not set
874# CONFIG_SENSORS_SMSC47B397 is not set
875# CONFIG_SENSORS_ADS7828 is not set
876# CONFIG_SENSORS_THMC50 is not set
877# CONFIG_SENSORS_VT1211 is not set
878# CONFIG_SENSORS_W83781D is not set
879# CONFIG_SENSORS_W83791D is not set
880# CONFIG_SENSORS_W83792D is not set
881# CONFIG_SENSORS_W83793 is not set
882# CONFIG_SENSORS_W83L785TS is not set
883# CONFIG_SENSORS_W83L786NG is not set
884# CONFIG_SENSORS_W83627HF is not set
885# CONFIG_SENSORS_W83627EHF is not set
886# CONFIG_HWMON_DEBUG_CHIP is not set
887# CONFIG_THERMAL is not set
888# CONFIG_THERMAL_HWMON is not set
889CONFIG_WATCHDOG=y
890# CONFIG_WATCHDOG_NOWAYOUT is not set
891
892#
893# Watchdog Device Drivers
894#
895# CONFIG_SOFT_WATCHDOG is not set
896CONFIG_BFIN_WDT=y
897
898#
899# Multifunction device drivers
900#
901# CONFIG_MFD_CORE is not set
902# CONFIG_MFD_SM501 is not set
903# CONFIG_HTC_PASIC3 is not set
904# CONFIG_MFD_TMIO is not set
905# CONFIG_MFD_WM8400 is not set
906# CONFIG_MFD_WM8350_I2C is not set
907
908#
909# Multimedia devices
910#
911
912#
913# Multimedia core support
914#
915# CONFIG_VIDEO_DEV is not set
916# CONFIG_DVB_CORE is not set
917# CONFIG_VIDEO_MEDIA is not set
918
919#
920# Multimedia drivers
921#
922# CONFIG_DAB is not set
923
924#
925# Graphics support
926#
927# CONFIG_VGASTATE is not set
928# CONFIG_VIDEO_OUTPUT_CONTROL is not set
929CONFIG_FB=m
930# CONFIG_FIRMWARE_EDID is not set
931# CONFIG_FB_DDC is not set
932# CONFIG_FB_BOOT_VESA_SUPPORT is not set
933CONFIG_FB_CFB_FILLRECT=m
934CONFIG_FB_CFB_COPYAREA=m
935CONFIG_FB_CFB_IMAGEBLIT=m
936# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
937# CONFIG_FB_SYS_FILLRECT is not set
938# CONFIG_FB_SYS_COPYAREA is not set
939# CONFIG_FB_SYS_IMAGEBLIT is not set
940# CONFIG_FB_FOREIGN_ENDIAN is not set
941# CONFIG_FB_SYS_FOPS is not set
942# CONFIG_FB_SVGALIB is not set
943# CONFIG_FB_MACMODES is not set
944# CONFIG_FB_BACKLIGHT is not set
945# CONFIG_FB_MODE_HELPERS is not set
946# CONFIG_FB_TILEBLITTING is not set
947
948#
949# Frame buffer hardware drivers
950#
951# CONFIG_FB_BFIN_T350MCQB is not set
952CONFIG_FB_BFIN_LQ035Q1=m
953# CONFIG_FB_BFIN_7393 is not set
954# CONFIG_FB_S1D13XXX is not set
955# CONFIG_FB_VIRTUAL is not set
956# CONFIG_FB_METRONOME is not set
957# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
958
959#
960# Display device support
961#
962# CONFIG_DISPLAY_SUPPORT is not set
963# CONFIG_LOGO is not set
964# CONFIG_SOUND is not set
965CONFIG_HID_SUPPORT=y
966CONFIG_HID=y
967# CONFIG_HID_DEBUG is not set
968# CONFIG_HIDRAW is not set
969# CONFIG_HID_PID is not set
970
971#
972# Special HID drivers
973#
974CONFIG_HID_COMPAT=y
975# CONFIG_USB_SUPPORT is not set
976# CONFIG_MMC is not set
977# CONFIG_MEMSTICK is not set
978# CONFIG_NEW_LEDS is not set
979# CONFIG_ACCESSIBILITY is not set
980CONFIG_RTC_LIB=y
981CONFIG_RTC_CLASS=y
982CONFIG_RTC_HCTOSYS=y
983CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
984# CONFIG_RTC_DEBUG is not set
985
986#
987# RTC interfaces
988#
989CONFIG_RTC_INTF_SYSFS=y
990CONFIG_RTC_INTF_PROC=y
991CONFIG_RTC_INTF_DEV=y
992# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
993# CONFIG_RTC_DRV_TEST is not set
994
995#
996# I2C RTC drivers
997#
998# CONFIG_RTC_DRV_DS1307 is not set
999# CONFIG_RTC_DRV_DS1374 is not set
1000# CONFIG_RTC_DRV_DS1672 is not set
1001# CONFIG_RTC_DRV_MAX6900 is not set
1002# CONFIG_RTC_DRV_RS5C372 is not set
1003# CONFIG_RTC_DRV_ISL1208 is not set
1004# CONFIG_RTC_DRV_X1205 is not set
1005# CONFIG_RTC_DRV_PCF8563 is not set
1006# CONFIG_RTC_DRV_PCF8583 is not set
1007# CONFIG_RTC_DRV_M41T80 is not set
1008# CONFIG_RTC_DRV_S35390A is not set
1009# CONFIG_RTC_DRV_FM3130 is not set
1010
1011#
1012# SPI RTC drivers
1013#
1014# CONFIG_RTC_DRV_M41T94 is not set
1015# CONFIG_RTC_DRV_DS1305 is not set
1016# CONFIG_RTC_DRV_MAX6902 is not set
1017# CONFIG_RTC_DRV_R9701 is not set
1018# CONFIG_RTC_DRV_RS5C348 is not set
1019# CONFIG_RTC_DRV_DS3234 is not set
1020
1021#
1022# Platform RTC drivers
1023#
1024# CONFIG_RTC_DRV_DS1286 is not set
1025# CONFIG_RTC_DRV_DS1511 is not set
1026# CONFIG_RTC_DRV_DS1553 is not set
1027# CONFIG_RTC_DRV_DS1742 is not set
1028# CONFIG_RTC_DRV_STK17TA8 is not set
1029# CONFIG_RTC_DRV_M48T86 is not set
1030# CONFIG_RTC_DRV_M48T35 is not set
1031# CONFIG_RTC_DRV_M48T59 is not set
1032# CONFIG_RTC_DRV_BQ4802 is not set
1033# CONFIG_RTC_DRV_V3020 is not set
1034
1035#
1036# on-CPU RTC drivers
1037#
1038CONFIG_RTC_DRV_BFIN=y
1039# CONFIG_DMADEVICES is not set
1040# CONFIG_UIO is not set
1041# CONFIG_STAGING is not set
1042
1043#
1044# File systems
1045#
1046# CONFIG_EXT2_FS is not set
1047# CONFIG_EXT3_FS is not set
1048# CONFIG_EXT4_FS is not set
1049# CONFIG_REISERFS_FS is not set
1050# CONFIG_JFS_FS is not set
1051# CONFIG_FS_POSIX_ACL is not set
1052CONFIG_FILE_LOCKING=y
1053# CONFIG_XFS_FS is not set
1054# CONFIG_OCFS2_FS is not set
1055# CONFIG_DNOTIFY is not set
1056CONFIG_INOTIFY=y
1057CONFIG_INOTIFY_USER=y
1058# CONFIG_QUOTA is not set
1059# CONFIG_AUTOFS_FS is not set
1060# CONFIG_AUTOFS4_FS is not set
1061# CONFIG_FUSE_FS is not set
1062
1063#
1064# CD-ROM/DVD Filesystems
1065#
1066# CONFIG_ISO9660_FS is not set
1067# CONFIG_UDF_FS is not set
1068
1069#
1070# DOS/FAT/NT Filesystems
1071#
1072# CONFIG_MSDOS_FS is not set
1073# CONFIG_VFAT_FS is not set
1074# CONFIG_NTFS_FS is not set
1075
1076#
1077# Pseudo filesystems
1078#
1079CONFIG_PROC_FS=y
1080CONFIG_PROC_SYSCTL=y
1081CONFIG_SYSFS=y
1082# CONFIG_TMPFS is not set
1083# CONFIG_HUGETLB_PAGE is not set
1084# CONFIG_CONFIGFS_FS is not set
1085
1086#
1087# Miscellaneous filesystems
1088#
1089# CONFIG_ADFS_FS is not set
1090# CONFIG_AFFS_FS is not set
1091# CONFIG_HFS_FS is not set
1092# CONFIG_HFSPLUS_FS is not set
1093# CONFIG_BEFS_FS is not set
1094# CONFIG_BFS_FS is not set
1095# CONFIG_EFS_FS is not set
1096CONFIG_YAFFS_FS=m
1097CONFIG_YAFFS_YAFFS1=y
1098# CONFIG_YAFFS_9BYTE_TAGS is not set
1099# CONFIG_YAFFS_DOES_ECC is not set
1100CONFIG_YAFFS_YAFFS2=y
1101CONFIG_YAFFS_AUTO_YAFFS2=y
1102# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1103# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1104# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1105CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1106CONFIG_JFFS2_FS=m
1107CONFIG_JFFS2_FS_DEBUG=0
1108CONFIG_JFFS2_FS_WRITEBUFFER=y
1109# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
1110# CONFIG_JFFS2_SUMMARY is not set
1111# CONFIG_JFFS2_FS_XATTR is not set
1112# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
1113CONFIG_JFFS2_ZLIB=y
1114# CONFIG_JFFS2_LZO is not set
1115CONFIG_JFFS2_RTIME=y
1116# CONFIG_JFFS2_RUBIN is not set
1117# CONFIG_CRAMFS is not set
1118# CONFIG_VXFS_FS is not set
1119# CONFIG_MINIX_FS is not set
1120# CONFIG_OMFS_FS is not set
1121# CONFIG_HPFS_FS is not set
1122# CONFIG_QNX4FS_FS is not set
1123# CONFIG_ROMFS_FS is not set
1124# CONFIG_SYSV_FS is not set
1125# CONFIG_UFS_FS is not set
1126CONFIG_NETWORK_FILESYSTEMS=y
1127CONFIG_NFS_FS=m
1128CONFIG_NFS_V3=y
1129# CONFIG_NFS_V3_ACL is not set
1130# CONFIG_NFS_V4 is not set
1131# CONFIG_NFSD is not set
1132CONFIG_LOCKD=m
1133CONFIG_LOCKD_V4=y
1134CONFIG_NFS_COMMON=y
1135CONFIG_SUNRPC=m
1136# CONFIG_SUNRPC_REGISTER_V4 is not set
1137# CONFIG_RPCSEC_GSS_KRB5 is not set
1138# CONFIG_RPCSEC_GSS_SPKM3 is not set
1139CONFIG_SMB_FS=m
1140# CONFIG_SMB_NLS_DEFAULT is not set
1141# CONFIG_CIFS is not set
1142# CONFIG_NCP_FS is not set
1143# CONFIG_CODA_FS is not set
1144# CONFIG_AFS_FS is not set
1145
1146#
1147# Partition Types
1148#
1149# CONFIG_PARTITION_ADVANCED is not set
1150CONFIG_MSDOS_PARTITION=y
1151CONFIG_NLS=m
1152CONFIG_NLS_DEFAULT="iso8859-1"
1153# CONFIG_NLS_CODEPAGE_437 is not set
1154# CONFIG_NLS_CODEPAGE_737 is not set
1155# CONFIG_NLS_CODEPAGE_775 is not set
1156# CONFIG_NLS_CODEPAGE_850 is not set
1157# CONFIG_NLS_CODEPAGE_852 is not set
1158# CONFIG_NLS_CODEPAGE_855 is not set
1159# CONFIG_NLS_CODEPAGE_857 is not set
1160# CONFIG_NLS_CODEPAGE_860 is not set
1161# CONFIG_NLS_CODEPAGE_861 is not set
1162# CONFIG_NLS_CODEPAGE_862 is not set
1163# CONFIG_NLS_CODEPAGE_863 is not set
1164# CONFIG_NLS_CODEPAGE_864 is not set
1165# CONFIG_NLS_CODEPAGE_865 is not set
1166# CONFIG_NLS_CODEPAGE_866 is not set
1167# CONFIG_NLS_CODEPAGE_869 is not set
1168# CONFIG_NLS_CODEPAGE_936 is not set
1169# CONFIG_NLS_CODEPAGE_950 is not set
1170# CONFIG_NLS_CODEPAGE_932 is not set
1171# CONFIG_NLS_CODEPAGE_949 is not set
1172# CONFIG_NLS_CODEPAGE_874 is not set
1173# CONFIG_NLS_ISO8859_8 is not set
1174# CONFIG_NLS_CODEPAGE_1250 is not set
1175# CONFIG_NLS_CODEPAGE_1251 is not set
1176# CONFIG_NLS_ASCII is not set
1177# CONFIG_NLS_ISO8859_1 is not set
1178# CONFIG_NLS_ISO8859_2 is not set
1179# CONFIG_NLS_ISO8859_3 is not set
1180# CONFIG_NLS_ISO8859_4 is not set
1181# CONFIG_NLS_ISO8859_5 is not set
1182# CONFIG_NLS_ISO8859_6 is not set
1183# CONFIG_NLS_ISO8859_7 is not set
1184# CONFIG_NLS_ISO8859_9 is not set
1185# CONFIG_NLS_ISO8859_13 is not set
1186# CONFIG_NLS_ISO8859_14 is not set
1187# CONFIG_NLS_ISO8859_15 is not set
1188# CONFIG_NLS_KOI8_R is not set
1189# CONFIG_NLS_KOI8_U is not set
1190# CONFIG_NLS_UTF8 is not set
1191# CONFIG_DLM is not set
1192
1193#
1194# Kernel hacking
1195#
1196# CONFIG_PRINTK_TIME is not set
1197CONFIG_ENABLE_WARN_DEPRECATED=y
1198CONFIG_ENABLE_MUST_CHECK=y
1199CONFIG_FRAME_WARN=1024
1200# CONFIG_MAGIC_SYSRQ is not set
1201# CONFIG_UNUSED_SYMBOLS is not set
1202CONFIG_DEBUG_FS=y
1203# CONFIG_HEADERS_CHECK is not set
1204CONFIG_DEBUG_KERNEL=y
1205# CONFIG_DEBUG_SHIRQ is not set
1206CONFIG_DETECT_SOFTLOCKUP=y
1207# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1208CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1209CONFIG_SCHED_DEBUG=y
1210# CONFIG_SCHEDSTATS is not set
1211# CONFIG_TIMER_STATS is not set
1212# CONFIG_DEBUG_OBJECTS is not set
1213# CONFIG_DEBUG_SLAB is not set
1214# CONFIG_DEBUG_RT_MUTEXES is not set
1215# CONFIG_RT_MUTEX_TESTER is not set
1216# CONFIG_DEBUG_SPINLOCK is not set
1217# CONFIG_DEBUG_MUTEXES is not set
1218# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1219# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1220# CONFIG_DEBUG_KOBJECT is not set
1221# CONFIG_DEBUG_BUGVERBOSE is not set
1222CONFIG_DEBUG_INFO=y
1223# CONFIG_DEBUG_VM is not set
1224# CONFIG_DEBUG_WRITECOUNT is not set
1225# CONFIG_DEBUG_MEMORY_INIT is not set
1226# CONFIG_DEBUG_LIST is not set
1227# CONFIG_DEBUG_SG is not set
1228# CONFIG_FRAME_POINTER is not set
1229# CONFIG_BOOT_PRINTK_DELAY is not set
1230# CONFIG_RCU_TORTURE_TEST is not set
1231# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1232# CONFIG_BACKTRACE_SELF_TEST is not set
1233# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1234# CONFIG_FAULT_INJECTION is not set
1235CONFIG_SYSCTL_SYSCALL_CHECK=y
1236# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1237# CONFIG_SAMPLES is not set
1238CONFIG_HAVE_ARCH_KGDB=y
1239# CONFIG_KGDB is not set
1240# CONFIG_DEBUG_STACKOVERFLOW is not set
1241# CONFIG_DEBUG_STACK_USAGE is not set
1242CONFIG_DEBUG_VERBOSE=y
1243CONFIG_DEBUG_MMRS=y
1244# CONFIG_DEBUG_HWERR is not set
1245# CONFIG_DEBUG_DOUBLEFAULT is not set
1246CONFIG_DEBUG_HUNT_FOR_ZERO=y
1247CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1248CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
1249# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_ONE is not set
1250# CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_TWO is not set
1251CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
1252# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
1253# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
1254CONFIG_EARLY_PRINTK=y
1255CONFIG_CPLB_INFO=y
1256CONFIG_ACCESS_CHECK=y
1257
1258#
1259# Security options
1260#
1261# CONFIG_KEYS is not set
1262CONFIG_SECURITY=y
1263# CONFIG_SECURITYFS is not set
1264# CONFIG_SECURITY_NETWORK is not set
1265# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1266CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1267CONFIG_CRYPTO=y
1268
1269#
1270# Crypto core or helper
1271#
1272# CONFIG_CRYPTO_FIPS is not set
1273# CONFIG_CRYPTO_MANAGER is not set
1274# CONFIG_CRYPTO_GF128MUL is not set
1275# CONFIG_CRYPTO_NULL is not set
1276# CONFIG_CRYPTO_CRYPTD is not set
1277# CONFIG_CRYPTO_AUTHENC is not set
1278# CONFIG_CRYPTO_TEST is not set
1279
1280#
1281# Authenticated Encryption with Associated Data
1282#
1283# CONFIG_CRYPTO_CCM is not set
1284# CONFIG_CRYPTO_GCM is not set
1285# CONFIG_CRYPTO_SEQIV is not set
1286
1287#
1288# Block modes
1289#
1290# CONFIG_CRYPTO_CBC is not set
1291# CONFIG_CRYPTO_CTR is not set
1292# CONFIG_CRYPTO_CTS is not set
1293# CONFIG_CRYPTO_ECB is not set
1294# CONFIG_CRYPTO_LRW is not set
1295# CONFIG_CRYPTO_PCBC is not set
1296# CONFIG_CRYPTO_XTS is not set
1297
1298#
1299# Hash modes
1300#
1301# CONFIG_CRYPTO_HMAC is not set
1302# CONFIG_CRYPTO_XCBC is not set
1303
1304#
1305# Digest
1306#
1307# CONFIG_CRYPTO_CRC32C is not set
1308# CONFIG_CRYPTO_MD4 is not set
1309# CONFIG_CRYPTO_MD5 is not set
1310# CONFIG_CRYPTO_MICHAEL_MIC is not set
1311# CONFIG_CRYPTO_RMD128 is not set
1312# CONFIG_CRYPTO_RMD160 is not set
1313# CONFIG_CRYPTO_RMD256 is not set
1314# CONFIG_CRYPTO_RMD320 is not set
1315# CONFIG_CRYPTO_SHA1 is not set
1316# CONFIG_CRYPTO_SHA256 is not set
1317# CONFIG_CRYPTO_SHA512 is not set
1318# CONFIG_CRYPTO_TGR192 is not set
1319# CONFIG_CRYPTO_WP512 is not set
1320
1321#
1322# Ciphers
1323#
1324# CONFIG_CRYPTO_AES is not set
1325# CONFIG_CRYPTO_ANUBIS is not set
1326# CONFIG_CRYPTO_ARC4 is not set
1327# CONFIG_CRYPTO_BLOWFISH is not set
1328# CONFIG_CRYPTO_CAMELLIA is not set
1329# CONFIG_CRYPTO_CAST5 is not set
1330# CONFIG_CRYPTO_CAST6 is not set
1331# CONFIG_CRYPTO_DES is not set
1332# CONFIG_CRYPTO_FCRYPT is not set
1333# CONFIG_CRYPTO_KHAZAD is not set
1334# CONFIG_CRYPTO_SALSA20 is not set
1335# CONFIG_CRYPTO_SEED is not set
1336# CONFIG_CRYPTO_SERPENT is not set
1337# CONFIG_CRYPTO_TEA is not set
1338# CONFIG_CRYPTO_TWOFISH is not set
1339
1340#
1341# Compression
1342#
1343# CONFIG_CRYPTO_DEFLATE is not set
1344# CONFIG_CRYPTO_LZO is not set
1345
1346#
1347# Random Number Generation
1348#
1349# CONFIG_CRYPTO_ANSI_CPRNG is not set
1350CONFIG_CRYPTO_HW=y
1351
1352#
1353# Library routines
1354#
1355CONFIG_BITREVERSE=y
1356CONFIG_CRC_CCITT=m
1357# CONFIG_CRC16 is not set
1358# CONFIG_CRC_T10DIF is not set
1359# CONFIG_CRC_ITU_T is not set
1360CONFIG_CRC32=y
1361# CONFIG_CRC7 is not set
1362# CONFIG_LIBCRC32C is not set
1363CONFIG_ZLIB_INFLATE=y
1364CONFIG_ZLIB_DEFLATE=m
1365CONFIG_PLIST=y
1366CONFIG_HAS_IOMEM=y
1367CONFIG_HAS_IOPORT=y
1368CONFIG_HAS_DMA=y
diff --git a/arch/blackfin/configs/BF548-EZKIT_defconfig b/arch/blackfin/configs/BF548-EZKIT_defconfig
index bf63660815b9..d4ed9ce1f62f 100644
--- a/arch/blackfin/configs/BF548-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF548-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24.7 3# Linux kernel version: 2.6.28-rc2
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y 9CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y 10CONFIG_ZONE_DMA=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y 11CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
@@ -31,18 +30,16 @@ CONFIG_SYSVIPC_SYSCTL=y
31# CONFIG_POSIX_MQUEUE is not set 30# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
33# CONFIG_TASKSTATS is not set 32# CONFIG_TASKSTATS is not set
34# CONFIG_USER_NS is not set
35# CONFIG_PID_NS is not set
36# CONFIG_AUDIT is not set 33# CONFIG_AUDIT is not set
37CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
38CONFIG_IKCONFIG_PROC=y 35CONFIG_IKCONFIG_PROC=y
39CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
40# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
41CONFIG_FAIR_GROUP_SCHED=y 38# CONFIG_GROUP_SCHED is not set
42CONFIG_FAIR_USER_SCHED=y 39# CONFIG_SYSFS_DEPRECATED is not set
43# CONFIG_FAIR_CGROUP_SCHED is not set 40# CONFIG_SYSFS_DEPRECATED_V2 is not set
44CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 41# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set
46CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
47CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -51,26 +48,35 @@ CONFIG_EMBEDDED=y
51CONFIG_UID16=y 48CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 49CONFIG_SYSCTL_SYSCALL=y
53CONFIG_KALLSYMS=y 50CONFIG_KALLSYMS=y
51# CONFIG_KALLSYMS_ALL is not set
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 52# CONFIG_KALLSYMS_EXTRA_PASS is not set
55CONFIG_HOTPLUG=y 53CONFIG_HOTPLUG=y
56CONFIG_PRINTK=y 54CONFIG_PRINTK=y
57CONFIG_BUG=y 55CONFIG_BUG=y
58CONFIG_ELF_CORE=y 56# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y
59CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 59CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 60CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 61CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 62CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 64CONFIG_EVENTFD=y
65CONFIG_AIO=y
65CONFIG_VM_EVENT_COUNTERS=y 66CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
70# CONFIG_PROFILING is not set
71# CONFIG_MARKERS is not set
72CONFIG_HAVE_OPROFILE=y
73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
69CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
70CONFIG_RT_MUTEXES=y 75CONFIG_RT_MUTEXES=y
71CONFIG_TINY_SHMEM=y 76CONFIG_TINY_SHMEM=y
72CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
73CONFIG_MODULES=y 78CONFIG_MODULES=y
79# CONFIG_MODULE_FORCE_LOAD is not set
74CONFIG_MODULE_UNLOAD=y 80CONFIG_MODULE_UNLOAD=y
75# CONFIG_MODULE_FORCE_UNLOAD is not set 81# CONFIG_MODULE_FORCE_UNLOAD is not set
76# CONFIG_MODVERSIONS is not set 82# CONFIG_MODVERSIONS is not set
@@ -81,6 +87,7 @@ CONFIG_BLOCK=y
81# CONFIG_BLK_DEV_IO_TRACE is not set 87# CONFIG_BLK_DEV_IO_TRACE is not set
82# CONFIG_LSF is not set 88# CONFIG_LSF is not set
83# CONFIG_BLK_DEV_BSG is not set 89# CONFIG_BLK_DEV_BSG is not set
90# CONFIG_BLK_DEV_INTEGRITY is not set
84 91
85# 92#
86# IO Schedulers 93# IO Schedulers
@@ -94,9 +101,11 @@ CONFIG_DEFAULT_AS=y
94# CONFIG_DEFAULT_CFQ is not set 101# CONFIG_DEFAULT_CFQ is not set
95# CONFIG_DEFAULT_NOOP is not set 102# CONFIG_DEFAULT_NOOP is not set
96CONFIG_DEFAULT_IOSCHED="anticipatory" 103CONFIG_DEFAULT_IOSCHED="anticipatory"
104CONFIG_CLASSIC_RCU=y
97# CONFIG_PREEMPT_NONE is not set 105# CONFIG_PREEMPT_NONE is not set
98CONFIG_PREEMPT_VOLUNTARY=y 106CONFIG_PREEMPT_VOLUNTARY=y
99# CONFIG_PREEMPT is not set 107# CONFIG_PREEMPT is not set
108# CONFIG_FREEZER is not set
100 109
101# 110#
102# Blackfin Processor Options 111# Blackfin Processor Options
@@ -105,6 +114,10 @@ CONFIG_PREEMPT_VOLUNTARY=y
105# 114#
106# Processor and Board Settings 115# Processor and Board Settings
107# 116#
117# CONFIG_BF512 is not set
118# CONFIG_BF514 is not set
119# CONFIG_BF516 is not set
120# CONFIG_BF518 is not set
108# CONFIG_BF522 is not set 121# CONFIG_BF522 is not set
109# CONFIG_BF523 is not set 122# CONFIG_BF523 is not set
110# CONFIG_BF524 is not set 123# CONFIG_BF524 is not set
@@ -117,18 +130,23 @@ CONFIG_PREEMPT_VOLUNTARY=y
117# CONFIG_BF534 is not set 130# CONFIG_BF534 is not set
118# CONFIG_BF536 is not set 131# CONFIG_BF536 is not set
119# CONFIG_BF537 is not set 132# CONFIG_BF537 is not set
133# CONFIG_BF538 is not set
134# CONFIG_BF539 is not set
120# CONFIG_BF542 is not set 135# CONFIG_BF542 is not set
121# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
122# CONFIG_BF547 is not set 137# CONFIG_BF547 is not set
123CONFIG_BF548=y 138CONFIG_BF548=y
124# CONFIG_BF549 is not set 139# CONFIG_BF549 is not set
125# CONFIG_BF561 is not set 140# CONFIG_BF561 is not set
141CONFIG_BF_REV_MIN=0
142CONFIG_BF_REV_MAX=2
126CONFIG_BF_REV_0_0=y 143CONFIG_BF_REV_0_0=y
127# CONFIG_BF_REV_0_1 is not set 144# CONFIG_BF_REV_0_1 is not set
128# CONFIG_BF_REV_0_2 is not set 145# CONFIG_BF_REV_0_2 is not set
129# CONFIG_BF_REV_0_3 is not set 146# CONFIG_BF_REV_0_3 is not set
130# CONFIG_BF_REV_0_4 is not set 147# CONFIG_BF_REV_0_4 is not set
131# CONFIG_BF_REV_0_5 is not set 148# CONFIG_BF_REV_0_5 is not set
149# CONFIG_BF_REV_0_6 is not set
132# CONFIG_BF_REV_ANY is not set 150# CONFIG_BF_REV_ANY is not set
133# CONFIG_BF_REV_NONE is not set 151# CONFIG_BF_REV_NONE is not set
134CONFIG_BF54x=y 152CONFIG_BF54x=y
@@ -138,15 +156,12 @@ CONFIG_IRQ_SPORT0_RX=9
138CONFIG_IRQ_SPORT0_TX=9 156CONFIG_IRQ_SPORT0_TX=9
139CONFIG_IRQ_SPORT1_RX=9 157CONFIG_IRQ_SPORT1_RX=9
140CONFIG_IRQ_SPORT1_TX=9 158CONFIG_IRQ_SPORT1_TX=9
159CONFIG_IRQ_SPI0=10
141CONFIG_IRQ_UART0_RX=10 160CONFIG_IRQ_UART0_RX=10
142CONFIG_IRQ_UART0_TX=10 161CONFIG_IRQ_UART0_TX=10
143CONFIG_IRQ_UART1_RX=10 162CONFIG_IRQ_UART1_RX=10
144CONFIG_IRQ_UART1_TX=10 163CONFIG_IRQ_UART1_TX=10
145CONFIG_IRQ_CNT=8 164CONFIG_IRQ_CNT=8
146CONFIG_IRQ_USB_INT0=11
147CONFIG_IRQ_USB_INT1=11
148CONFIG_IRQ_USB_INT2=11
149CONFIG_IRQ_USB_DMA=11
150CONFIG_IRQ_TIMER0=11 165CONFIG_IRQ_TIMER0=11
151CONFIG_IRQ_TIMER1=11 166CONFIG_IRQ_TIMER1=11
152CONFIG_IRQ_TIMER2=11 167CONFIG_IRQ_TIMER2=11
@@ -155,9 +170,21 @@ CONFIG_IRQ_TIMER4=11
155CONFIG_IRQ_TIMER5=11 170CONFIG_IRQ_TIMER5=11
156CONFIG_IRQ_TIMER6=11 171CONFIG_IRQ_TIMER6=11
157CONFIG_IRQ_TIMER7=11 172CONFIG_IRQ_TIMER7=11
173CONFIG_IRQ_USB_INT0=11
174CONFIG_IRQ_USB_INT1=11
175CONFIG_IRQ_USB_INT2=11
176CONFIG_IRQ_USB_DMA=11
158CONFIG_IRQ_TIMER8=11 177CONFIG_IRQ_TIMER8=11
159CONFIG_IRQ_TIMER9=11 178CONFIG_IRQ_TIMER9=11
160CONFIG_IRQ_TIMER10=11 179CONFIG_IRQ_TIMER10=11
180CONFIG_IRQ_SPORT2_RX=9
181CONFIG_IRQ_SPORT2_TX=9
182CONFIG_IRQ_SPORT3_RX=9
183CONFIG_IRQ_SPORT3_TX=9
184CONFIG_IRQ_SPI1=10
185CONFIG_IRQ_SPI2=10
186CONFIG_IRQ_TWI0=11
187CONFIG_IRQ_TWI1=11
161CONFIG_BFIN548_EZKIT=y 188CONFIG_BFIN548_EZKIT=y
162# CONFIG_BFIN548_BLUETECHNIX_CM is not set 189# CONFIG_BFIN548_BLUETECHNIX_CM is not set
163 190
@@ -180,7 +207,6 @@ CONFIG_IRQ_SPORT1_ERR=7
180CONFIG_IRQ_SPI0_ERR=7 207CONFIG_IRQ_SPI0_ERR=7
181CONFIG_IRQ_UART0_ERR=7 208CONFIG_IRQ_UART0_ERR=7
182CONFIG_IRQ_EPPI0=8 209CONFIG_IRQ_EPPI0=8
183CONFIG_IRQ_SPI0=10
184CONFIG_IRQ_PINT0=12 210CONFIG_IRQ_PINT0=12
185CONFIG_IRQ_PINT1=12 211CONFIG_IRQ_PINT1=12
186CONFIG_IRQ_MDMAS0=13 212CONFIG_IRQ_MDMAS0=13
@@ -195,18 +221,10 @@ CONFIG_IRQ_SPI2_ERR=7
195CONFIG_IRQ_UART1_ERR=7 221CONFIG_IRQ_UART1_ERR=7
196CONFIG_IRQ_UART2_ERR=7 222CONFIG_IRQ_UART2_ERR=7
197CONFIG_IRQ_CAN0_ERR=7 223CONFIG_IRQ_CAN0_ERR=7
198CONFIG_IRQ_SPORT2_RX=9
199CONFIG_IRQ_SPORT2_TX=9
200CONFIG_IRQ_SPORT3_RX=9
201CONFIG_IRQ_SPORT3_TX=9
202CONFIG_IRQ_EPPI1=9 224CONFIG_IRQ_EPPI1=9
203CONFIG_IRQ_EPPI2=9 225CONFIG_IRQ_EPPI2=9
204CONFIG_IRQ_SPI1=10
205CONFIG_IRQ_SPI2=10
206CONFIG_IRQ_ATAPI_RX=10 226CONFIG_IRQ_ATAPI_RX=10
207CONFIG_IRQ_ATAPI_TX=10 227CONFIG_IRQ_ATAPI_TX=10
208CONFIG_IRQ_TWI0=11
209CONFIG_IRQ_TWI1=11
210CONFIG_IRQ_CAN0_RX=11 228CONFIG_IRQ_CAN0_RX=11
211CONFIG_IRQ_CAN0_TX=11 229CONFIG_IRQ_CAN0_TX=11
212CONFIG_IRQ_MDMAS2=13 230CONFIG_IRQ_MDMAS2=13
@@ -260,7 +278,6 @@ CONFIG_BOOT_LOAD=0x1000
260# 278#
261CONFIG_CLKIN_HZ=25000000 279CONFIG_CLKIN_HZ=25000000
262# CONFIG_BFIN_KERNEL_CLOCK is not set 280# CONFIG_BFIN_KERNEL_CLOCK is not set
263CONFIG_MAX_MEM_SIZE=512
264CONFIG_MAX_VCO_HZ=600000000 281CONFIG_MAX_VCO_HZ=600000000
265CONFIG_MIN_VCO_HZ=50000000 282CONFIG_MIN_VCO_HZ=50000000
266CONFIG_MAX_SCLK_HZ=133333333 283CONFIG_MAX_SCLK_HZ=133333333
@@ -274,10 +291,10 @@ CONFIG_HZ_250=y
274# CONFIG_HZ_300 is not set 291# CONFIG_HZ_300 is not set
275# CONFIG_HZ_1000 is not set 292# CONFIG_HZ_1000 is not set
276CONFIG_HZ=250 293CONFIG_HZ=250
294# CONFIG_SCHED_HRTICK is not set
277CONFIG_GENERIC_TIME=y 295CONFIG_GENERIC_TIME=y
278CONFIG_GENERIC_CLOCKEVENTS=y 296CONFIG_GENERIC_CLOCKEVENTS=y
279# CONFIG_CYCLES_CLOCKSOURCE is not set 297# CONFIG_CYCLES_CLOCKSOURCE is not set
280# CONFIG_TICK_ONESHOT is not set
281# CONFIG_NO_HZ is not set 298# CONFIG_NO_HZ is not set
282# CONFIG_HIGH_RES_TIMERS is not set 299# CONFIG_HIGH_RES_TIMERS is not set
283CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 300CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
@@ -311,6 +328,12 @@ CONFIG_ACCESS_OK_L1=y
311CONFIG_CACHELINE_ALIGNED_L1=y 328CONFIG_CACHELINE_ALIGNED_L1=y
312# CONFIG_SYSCALL_TAB_L1 is not set 329# CONFIG_SYSCALL_TAB_L1 is not set
313# CONFIG_CPLB_SWITCH_TAB_L1 is not set 330# CONFIG_CPLB_SWITCH_TAB_L1 is not set
331CONFIG_APP_STACK_L1=y
332
333#
334# Speed Optimizations
335#
336CONFIG_BFIN_INS_LOWOVERHEAD=y
314CONFIG_RAMKERNEL=y 337CONFIG_RAMKERNEL=y
315# CONFIG_ROMKERNEL is not set 338# CONFIG_ROMKERNEL is not set
316CONFIG_SELECT_MEMORY_MODEL=y 339CONFIG_SELECT_MEMORY_MODEL=y
@@ -319,14 +342,13 @@ CONFIG_FLATMEM_MANUAL=y
319# CONFIG_SPARSEMEM_MANUAL is not set 342# CONFIG_SPARSEMEM_MANUAL is not set
320CONFIG_FLATMEM=y 343CONFIG_FLATMEM=y
321CONFIG_FLAT_NODE_MEM_MAP=y 344CONFIG_FLAT_NODE_MEM_MAP=y
322# CONFIG_SPARSEMEM_STATIC is not set 345CONFIG_PAGEFLAGS_EXTENDED=y
323# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
324CONFIG_SPLIT_PTLOCK_CPUS=4 346CONFIG_SPLIT_PTLOCK_CPUS=4
325# CONFIG_RESOURCES_64BIT is not set 347# CONFIG_RESOURCES_64BIT is not set
348# CONFIG_PHYS_ADDR_T_64BIT is not set
326CONFIG_ZONE_DMA_FLAG=1 349CONFIG_ZONE_DMA_FLAG=1
327CONFIG_VIRT_TO_BUS=y 350CONFIG_VIRT_TO_BUS=y
328# CONFIG_BFIN_GPTIMERS is not set 351# CONFIG_BFIN_GPTIMERS is not set
329CONFIG_BFIN_DMA_5XX=y
330# CONFIG_DMA_UNCACHED_4M is not set 352# CONFIG_DMA_UNCACHED_4M is not set
331CONFIG_DMA_UNCACHED_2M=y 353CONFIG_DMA_UNCACHED_2M=y
332# CONFIG_DMA_UNCACHED_1M is not set 354# CONFIG_DMA_UNCACHED_1M is not set
@@ -341,7 +363,7 @@ CONFIG_BFIN_DCACHE=y
341# CONFIG_BFIN_ICACHE_LOCK is not set 363# CONFIG_BFIN_ICACHE_LOCK is not set
342# CONFIG_BFIN_WB is not set 364# CONFIG_BFIN_WB is not set
343CONFIG_BFIN_WT=y 365CONFIG_BFIN_WT=y
344CONFIG_L1_MAX_PIECE=16 366# CONFIG_BFIN_L2_CACHEABLE is not set
345# CONFIG_MPU is not set 367# CONFIG_MPU is not set
346 368
347# 369#
@@ -373,7 +395,6 @@ CONFIG_EBIU_FCTLVAL=0x6
373# 395#
374# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 396# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
375# 397#
376# CONFIG_PCI is not set
377# CONFIG_ARCH_SUPPORTS_MSI is not set 398# CONFIG_ARCH_SUPPORTS_MSI is not set
378# CONFIG_PCCARD is not set 399# CONFIG_PCCARD is not set
379 400
@@ -384,23 +405,20 @@ CONFIG_BINFMT_ELF_FDPIC=y
384CONFIG_BINFMT_FLAT=y 405CONFIG_BINFMT_FLAT=y
385CONFIG_BINFMT_ZFLAT=y 406CONFIG_BINFMT_ZFLAT=y
386# CONFIG_BINFMT_SHARED_FLAT is not set 407# CONFIG_BINFMT_SHARED_FLAT is not set
408# CONFIG_HAVE_AOUT is not set
387# CONFIG_BINFMT_MISC is not set 409# CONFIG_BINFMT_MISC is not set
388 410
389# 411#
390# Power management options 412# Power management options
391# 413#
392# CONFIG_PM is not set 414# CONFIG_PM is not set
393CONFIG_SUSPEND_UP_POSSIBLE=y 415CONFIG_ARCH_SUSPEND_POSSIBLE=y
394# CONFIG_PM_WAKEUP_BY_GPIO is not set 416# CONFIG_PM_WAKEUP_BY_GPIO is not set
395 417
396# 418#
397# CPU Frequency scaling 419# CPU Frequency scaling
398# 420#
399# CONFIG_CPU_FREQ is not set 421# CONFIG_CPU_FREQ is not set
400
401#
402# Networking
403#
404CONFIG_NET=y 422CONFIG_NET=y
405 423
406# 424#
@@ -413,6 +431,7 @@ CONFIG_XFRM=y
413# CONFIG_XFRM_USER is not set 431# CONFIG_XFRM_USER is not set
414# CONFIG_XFRM_SUB_POLICY is not set 432# CONFIG_XFRM_SUB_POLICY is not set
415# CONFIG_XFRM_MIGRATE is not set 433# CONFIG_XFRM_MIGRATE is not set
434# CONFIG_XFRM_STATISTICS is not set
416# CONFIG_NET_KEY is not set 435# CONFIG_NET_KEY is not set
417CONFIG_INET=y 436CONFIG_INET=y
418# CONFIG_IP_MULTICAST is not set 437# CONFIG_IP_MULTICAST is not set
@@ -442,8 +461,6 @@ CONFIG_TCP_CONG_CUBIC=y
442CONFIG_DEFAULT_TCP_CONG="cubic" 461CONFIG_DEFAULT_TCP_CONG="cubic"
443# CONFIG_TCP_MD5SIG is not set 462# CONFIG_TCP_MD5SIG is not set
444# CONFIG_IPV6 is not set 463# CONFIG_IPV6 is not set
445# CONFIG_INET6_XFRM_TUNNEL is not set
446# CONFIG_INET6_TUNNEL is not set
447# CONFIG_NETLABEL is not set 464# CONFIG_NETLABEL is not set
448# CONFIG_NETWORK_SECMARK is not set 465# CONFIG_NETWORK_SECMARK is not set
449# CONFIG_NETFILTER is not set 466# CONFIG_NETFILTER is not set
@@ -452,6 +469,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
452# CONFIG_TIPC is not set 469# CONFIG_TIPC is not set
453# CONFIG_ATM is not set 470# CONFIG_ATM is not set
454# CONFIG_BRIDGE is not set 471# CONFIG_BRIDGE is not set
472# CONFIG_NET_DSA is not set
455# CONFIG_VLAN_8021Q is not set 473# CONFIG_VLAN_8021Q is not set
456# CONFIG_DECNET is not set 474# CONFIG_DECNET is not set
457# CONFIG_LLC2 is not set 475# CONFIG_LLC2 is not set
@@ -468,6 +486,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
468# 486#
469# CONFIG_NET_PKTGEN is not set 487# CONFIG_NET_PKTGEN is not set
470# CONFIG_HAMRADIO is not set 488# CONFIG_HAMRADIO is not set
489# CONFIG_CAN is not set
471CONFIG_IRDA=m 490CONFIG_IRDA=m
472 491
473# 492#
@@ -493,9 +512,9 @@ CONFIG_IRCOMM=m
493# 512#
494CONFIG_IRTTY_SIR=m 513CONFIG_IRTTY_SIR=m
495CONFIG_BFIN_SIR=m 514CONFIG_BFIN_SIR=m
515CONFIG_BFIN_SIR3=y
496# CONFIG_BFIN_SIR0 is not set 516# CONFIG_BFIN_SIR0 is not set
497# CONFIG_BFIN_SIR2 is not set 517# CONFIG_BFIN_SIR2 is not set
498CONFIG_BFIN_SIR3=y
499CONFIG_SIR_BFIN_DMA=y 518CONFIG_SIR_BFIN_DMA=y
500# CONFIG_SIR_BFIN_PIO is not set 519# CONFIG_SIR_BFIN_PIO is not set
501 520
@@ -508,15 +527,6 @@ CONFIG_SIR_BFIN_DMA=y
508# CONFIG_KS959_DONGLE is not set 527# CONFIG_KS959_DONGLE is not set
509 528
510# 529#
511# Old SIR device drivers
512#
513# CONFIG_IRPORT_SIR is not set
514
515#
516# Old Serial dongle support
517#
518
519#
520# FIR device drivers 530# FIR device drivers
521# 531#
522# CONFIG_USB_IRDA is not set 532# CONFIG_USB_IRDA is not set
@@ -524,11 +534,10 @@ CONFIG_SIR_BFIN_DMA=y
524# CONFIG_MCS_FIR is not set 534# CONFIG_MCS_FIR is not set
525# CONFIG_BT is not set 535# CONFIG_BT is not set
526# CONFIG_AF_RXRPC is not set 536# CONFIG_AF_RXRPC is not set
527 537# CONFIG_PHONET is not set
528# 538CONFIG_WIRELESS=y
529# Wireless
530#
531# CONFIG_CFG80211 is not set 539# CONFIG_CFG80211 is not set
540CONFIG_WIRELESS_OLD_REGULATORY=y
532# CONFIG_WIRELESS_EXT is not set 541# CONFIG_WIRELESS_EXT is not set
533# CONFIG_MAC80211 is not set 542# CONFIG_MAC80211 is not set
534# CONFIG_IEEE80211 is not set 543# CONFIG_IEEE80211 is not set
@@ -546,6 +555,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
546CONFIG_STANDALONE=y 555CONFIG_STANDALONE=y
547CONFIG_PREVENT_FIRMWARE_BUILD=y 556CONFIG_PREVENT_FIRMWARE_BUILD=y
548# CONFIG_FW_LOADER is not set 557# CONFIG_FW_LOADER is not set
558# CONFIG_DEBUG_DRIVER is not set
559# CONFIG_DEBUG_DEVRES is not set
549# CONFIG_SYS_HYPERVISOR is not set 560# CONFIG_SYS_HYPERVISOR is not set
550# CONFIG_CONNECTOR is not set 561# CONFIG_CONNECTOR is not set
551CONFIG_MTD=y 562CONFIG_MTD=y
@@ -554,6 +565,7 @@ CONFIG_MTD=y
554CONFIG_MTD_PARTITIONS=y 565CONFIG_MTD_PARTITIONS=y
555# CONFIG_MTD_REDBOOT_PARTS is not set 566# CONFIG_MTD_REDBOOT_PARTS is not set
556CONFIG_MTD_CMDLINE_PARTS=y 567CONFIG_MTD_CMDLINE_PARTS=y
568# CONFIG_MTD_AR7_PARTS is not set
557 569
558# 570#
559# User Modules And Translation Layers 571# User Modules And Translation Layers
@@ -601,6 +613,7 @@ CONFIG_MTD_PHYSMAP=y
601CONFIG_MTD_PHYSMAP_START=0x20000000 613CONFIG_MTD_PHYSMAP_START=0x20000000
602CONFIG_MTD_PHYSMAP_LEN=0 614CONFIG_MTD_PHYSMAP_LEN=0
603CONFIG_MTD_PHYSMAP_BANKWIDTH=2 615CONFIG_MTD_PHYSMAP_BANKWIDTH=2
616# CONFIG_MTD_GPIO_ADDR is not set
604# CONFIG_MTD_UCLINUX is not set 617# CONFIG_MTD_UCLINUX is not set
605# CONFIG_MTD_PLATRAM is not set 618# CONFIG_MTD_PLATRAM is not set
606 619
@@ -608,7 +621,8 @@ CONFIG_MTD_PHYSMAP_BANKWIDTH=2
608# Self-contained MTD device drivers 621# Self-contained MTD device drivers
609# 622#
610# CONFIG_MTD_DATAFLASH is not set 623# CONFIG_MTD_DATAFLASH is not set
611# CONFIG_MTD_M25P80 is not set 624CONFIG_MTD_M25P80=y
625CONFIG_M25PXX_USE_FAST_READ=y
612# CONFIG_MTD_SLRAM is not set 626# CONFIG_MTD_SLRAM is not set
613# CONFIG_MTD_PHRAM is not set 627# CONFIG_MTD_PHRAM is not set
614# CONFIG_MTD_MTDRAM is not set 628# CONFIG_MTD_MTDRAM is not set
@@ -648,11 +662,14 @@ CONFIG_BLK_DEV=y
648CONFIG_BLK_DEV_RAM=y 662CONFIG_BLK_DEV_RAM=y
649CONFIG_BLK_DEV_RAM_COUNT=16 663CONFIG_BLK_DEV_RAM_COUNT=16
650CONFIG_BLK_DEV_RAM_SIZE=4096 664CONFIG_BLK_DEV_RAM_SIZE=4096
651CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 665# CONFIG_BLK_DEV_XIP is not set
652# CONFIG_CDROM_PKTCDVD is not set 666# CONFIG_CDROM_PKTCDVD is not set
653# CONFIG_ATA_OVER_ETH is not set 667# CONFIG_ATA_OVER_ETH is not set
668# CONFIG_BLK_DEV_HD is not set
654CONFIG_MISC_DEVICES=y 669CONFIG_MISC_DEVICES=y
655# CONFIG_EEPROM_93CX6 is not set 670# CONFIG_EEPROM_93CX6 is not set
671# CONFIG_ENCLOSURE_SERVICES is not set
672CONFIG_HAVE_IDE=y
656# CONFIG_IDE is not set 673# CONFIG_IDE is not set
657 674
658# 675#
@@ -696,13 +713,16 @@ CONFIG_SCSI_WAIT_SCAN=m
696CONFIG_SCSI_LOWLEVEL=y 713CONFIG_SCSI_LOWLEVEL=y
697# CONFIG_ISCSI_TCP is not set 714# CONFIG_ISCSI_TCP is not set
698# CONFIG_SCSI_DEBUG is not set 715# CONFIG_SCSI_DEBUG is not set
716# CONFIG_SCSI_DH is not set
699CONFIG_ATA=y 717CONFIG_ATA=y
700# CONFIG_ATA_NONSTANDARD is not set 718# CONFIG_ATA_NONSTANDARD is not set
719CONFIG_SATA_PMP=y
720CONFIG_ATA_SFF=y
721# CONFIG_SATA_MV is not set
701# CONFIG_PATA_PLATFORM is not set 722# CONFIG_PATA_PLATFORM is not set
702CONFIG_PATA_BF54X=y 723CONFIG_PATA_BF54X=y
703# CONFIG_MD is not set 724# CONFIG_MD is not set
704CONFIG_NETDEVICES=y 725CONFIG_NETDEVICES=y
705# CONFIG_NETDEVICES_MULTIQUEUE is not set
706# CONFIG_DUMMY is not set 726# CONFIG_DUMMY is not set
707# CONFIG_BONDING is not set 727# CONFIG_BONDING is not set
708# CONFIG_MACVLAN is not set 728# CONFIG_MACVLAN is not set
@@ -715,11 +735,14 @@ CONFIG_MII=y
715# CONFIG_SMC91X is not set 735# CONFIG_SMC91X is not set
716CONFIG_SMSC911X=y 736CONFIG_SMSC911X=y
717# CONFIG_DM9000 is not set 737# CONFIG_DM9000 is not set
738# CONFIG_ENC28J60 is not set
718# CONFIG_IBM_NEW_EMAC_ZMII is not set 739# CONFIG_IBM_NEW_EMAC_ZMII is not set
719# CONFIG_IBM_NEW_EMAC_RGMII is not set 740# CONFIG_IBM_NEW_EMAC_RGMII is not set
720# CONFIG_IBM_NEW_EMAC_TAH is not set 741# CONFIG_IBM_NEW_EMAC_TAH is not set
721# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 742# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
722# CONFIG_B44 is not set 743# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
744# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
745# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
723CONFIG_NETDEV_1000=y 746CONFIG_NETDEV_1000=y
724# CONFIG_AX88180 is not set 747# CONFIG_AX88180 is not set
725CONFIG_NETDEV_10000=y 748CONFIG_NETDEV_10000=y
@@ -729,6 +752,7 @@ CONFIG_NETDEV_10000=y
729# 752#
730# CONFIG_WLAN_PRE80211 is not set 753# CONFIG_WLAN_PRE80211 is not set
731# CONFIG_WLAN_80211 is not set 754# CONFIG_WLAN_80211 is not set
755# CONFIG_IWLWIFI_LEDS is not set
732 756
733# 757#
734# USB Network Adapters 758# USB Network Adapters
@@ -741,7 +765,6 @@ CONFIG_NETDEV_10000=y
741# CONFIG_WAN is not set 765# CONFIG_WAN is not set
742# CONFIG_PPP is not set 766# CONFIG_PPP is not set
743# CONFIG_SLIP is not set 767# CONFIG_SLIP is not set
744# CONFIG_SHAPER is not set
745# CONFIG_NETCONSOLE is not set 768# CONFIG_NETCONSOLE is not set
746# CONFIG_NETPOLL is not set 769# CONFIG_NETPOLL is not set
747# CONFIG_NET_POLL_CONTROLLER is not set 770# CONFIG_NET_POLL_CONTROLLER is not set
@@ -752,7 +775,7 @@ CONFIG_NETDEV_10000=y
752# Input device support 775# Input device support
753# 776#
754CONFIG_INPUT=y 777CONFIG_INPUT=y
755# CONFIG_INPUT_FF_MEMLESS is not set 778CONFIG_INPUT_FF_MEMLESS=m
756# CONFIG_INPUT_POLLDEV is not set 779# CONFIG_INPUT_POLLDEV is not set
757 780
758# 781#
@@ -776,30 +799,37 @@ CONFIG_INPUT_KEYBOARD=y
776# CONFIG_KEYBOARD_GPIO is not set 799# CONFIG_KEYBOARD_GPIO is not set
777CONFIG_KEYBOARD_BFIN=y 800CONFIG_KEYBOARD_BFIN=y
778# CONFIG_KEYBOARD_OPENCORES is not set 801# CONFIG_KEYBOARD_OPENCORES is not set
802# CONFIG_KEYBOARD_ADP5588 is not set
779# CONFIG_INPUT_MOUSE is not set 803# CONFIG_INPUT_MOUSE is not set
780# CONFIG_INPUT_JOYSTICK is not set 804# CONFIG_INPUT_JOYSTICK is not set
781# CONFIG_INPUT_TABLET is not set 805# CONFIG_INPUT_TABLET is not set
782CONFIG_INPUT_TOUCHSCREEN=y 806CONFIG_INPUT_TOUCHSCREEN=y
783# CONFIG_TOUCHSCREEN_ADS7846 is not set 807# CONFIG_TOUCHSCREEN_ADS7846 is not set
784CONFIG_TOUCHSCREEN_AD7877=m 808CONFIG_TOUCHSCREEN_AD7877=m
809# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
810# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
811# CONFIG_TOUCHSCREEN_AD7879 is not set
785# CONFIG_TOUCHSCREEN_FUJITSU is not set 812# CONFIG_TOUCHSCREEN_FUJITSU is not set
786# CONFIG_TOUCHSCREEN_GUNZE is not set 813# CONFIG_TOUCHSCREEN_GUNZE is not set
787# CONFIG_TOUCHSCREEN_ELO is not set 814# CONFIG_TOUCHSCREEN_ELO is not set
788# CONFIG_TOUCHSCREEN_MTOUCH is not set 815# CONFIG_TOUCHSCREEN_MTOUCH is not set
816# CONFIG_TOUCHSCREEN_INEXIO is not set
789# CONFIG_TOUCHSCREEN_MK712 is not set 817# CONFIG_TOUCHSCREEN_MK712 is not set
790# CONFIG_TOUCHSCREEN_PENMOUNT is not set 818# CONFIG_TOUCHSCREEN_PENMOUNT is not set
791# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 819# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
792# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 820# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
793# CONFIG_TOUCHSCREEN_UCB1400 is not set 821# CONFIG_TOUCHSCREEN_WM97XX is not set
794# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 822# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
823# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
795CONFIG_INPUT_MISC=y 824CONFIG_INPUT_MISC=y
796# CONFIG_INPUT_ATI_REMOTE is not set 825# CONFIG_INPUT_ATI_REMOTE is not set
797# CONFIG_INPUT_ATI_REMOTE2 is not set 826# CONFIG_INPUT_ATI_REMOTE2 is not set
798# CONFIG_INPUT_KEYSPAN_REMOTE is not set 827# CONFIG_INPUT_KEYSPAN_REMOTE is not set
799# CONFIG_INPUT_POWERMATE is not set 828# CONFIG_INPUT_POWERMATE is not set
800# CONFIG_INPUT_YEALINK is not set 829# CONFIG_INPUT_YEALINK is not set
830# CONFIG_INPUT_CM109 is not set
801# CONFIG_INPUT_UINPUT is not set 831# CONFIG_INPUT_UINPUT is not set
802# CONFIG_TWI_KEYPAD is not set 832# CONFIG_CONFIG_INPUT_PCF8574 is not set
803 833
804# 834#
805# Hardware I/O ports 835# Hardware I/O ports
@@ -815,16 +845,18 @@ CONFIG_INPUT_MISC=y
815# CONFIG_BF5xx_PPIFCD is not set 845# CONFIG_BF5xx_PPIFCD is not set
816# CONFIG_BFIN_SIMPLE_TIMER is not set 846# CONFIG_BFIN_SIMPLE_TIMER is not set
817# CONFIG_BF5xx_PPI is not set 847# CONFIG_BF5xx_PPI is not set
818CONFIG_BFIN_OTP=y
819# CONFIG_BFIN_OTP_WRITE_ENABLE is not set
820# CONFIG_BFIN_SPORT is not set 848# CONFIG_BFIN_SPORT is not set
821# CONFIG_BFIN_TIMER_LATENCY is not set 849# CONFIG_BFIN_TIMER_LATENCY is not set
822# CONFIG_TWI_LCD is not set 850# CONFIG_TWI_LCD is not set
851CONFIG_BFIN_DMA_INTERFACE=m
823CONFIG_SIMPLE_GPIO=m 852CONFIG_SIMPLE_GPIO=m
824CONFIG_VT=y 853CONFIG_VT=y
854CONFIG_CONSOLE_TRANSLATIONS=y
825CONFIG_VT_CONSOLE=y 855CONFIG_VT_CONSOLE=y
826CONFIG_HW_CONSOLE=y 856CONFIG_HW_CONSOLE=y
827# CONFIG_VT_HW_CONSOLE_BINDING is not set 857# CONFIG_VT_HW_CONSOLE_BINDING is not set
858# CONFIG_DEVKMEM is not set
859# CONFIG_BFIN_JTAG_COMM is not set
828# CONFIG_SERIAL_NONSTANDARD is not set 860# CONFIG_SERIAL_NONSTANDARD is not set
829 861
830# 862#
@@ -849,6 +881,8 @@ CONFIG_SERIAL_CORE_CONSOLE=y
849# CONFIG_SERIAL_BFIN_SPORT is not set 881# CONFIG_SERIAL_BFIN_SPORT is not set
850CONFIG_UNIX98_PTYS=y 882CONFIG_UNIX98_PTYS=y
851# CONFIG_LEGACY_PTYS is not set 883# CONFIG_LEGACY_PTYS is not set
884CONFIG_BFIN_OTP=y
885# CONFIG_BFIN_OTP_WRITE_ENABLE is not set
852 886
853# 887#
854# CAN, the car bus and industrial fieldbus 888# CAN, the car bus and industrial fieldbus
@@ -856,44 +890,49 @@ CONFIG_UNIX98_PTYS=y
856# CONFIG_CAN4LINUX is not set 890# CONFIG_CAN4LINUX is not set
857# CONFIG_IPMI_HANDLER is not set 891# CONFIG_IPMI_HANDLER is not set
858# CONFIG_HW_RANDOM is not set 892# CONFIG_HW_RANDOM is not set
859# CONFIG_GEN_RTC is not set
860# CONFIG_R3964 is not set 893# CONFIG_R3964 is not set
861# CONFIG_RAW_DRIVER is not set 894# CONFIG_RAW_DRIVER is not set
862# CONFIG_TCG_TPM is not set 895# CONFIG_TCG_TPM is not set
863CONFIG_I2C=y 896CONFIG_I2C=y
864CONFIG_I2C_BOARDINFO=y 897CONFIG_I2C_BOARDINFO=y
865CONFIG_I2C_CHARDEV=y 898CONFIG_I2C_CHARDEV=y
899CONFIG_I2C_HELPER_AUTO=y
866 900
867# 901#
868# I2C Algorithms 902# I2C Hardware Bus support
869# 903#
870# CONFIG_I2C_ALGOBIT is not set
871# CONFIG_I2C_ALGOPCF is not set
872# CONFIG_I2C_ALGOPCA is not set
873 904
874# 905#
875# I2C Hardware Bus support 906# I2C system bus drivers (mostly embedded / system-on-chip)
876# 907#
877CONFIG_I2C_BLACKFIN_TWI=y 908CONFIG_I2C_BLACKFIN_TWI=y
878CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 909CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
879# CONFIG_I2C_GPIO is not set 910# CONFIG_I2C_GPIO is not set
880# CONFIG_I2C_OCORES is not set 911# CONFIG_I2C_OCORES is not set
881# CONFIG_I2C_PARPORT_LIGHT is not set
882# CONFIG_I2C_SIMTEC is not set 912# CONFIG_I2C_SIMTEC is not set
913
914#
915# External I2C/SMBus adapter drivers
916#
917# CONFIG_I2C_PARPORT_LIGHT is not set
883# CONFIG_I2C_TAOS_EVM is not set 918# CONFIG_I2C_TAOS_EVM is not set
884# CONFIG_I2C_STUB is not set
885# CONFIG_I2C_TINY_USB is not set 919# CONFIG_I2C_TINY_USB is not set
886 920
887# 921#
922# Other I2C/SMBus bus drivers
923#
924# CONFIG_I2C_PCA_PLATFORM is not set
925# CONFIG_I2C_STUB is not set
926
927#
888# Miscellaneous I2C Chip support 928# Miscellaneous I2C Chip support
889# 929#
890# CONFIG_SENSORS_DS1337 is not set
891# CONFIG_SENSORS_DS1374 is not set
892# CONFIG_DS1682 is not set 930# CONFIG_DS1682 is not set
931# CONFIG_AT24 is not set
893# CONFIG_SENSORS_AD5252 is not set 932# CONFIG_SENSORS_AD5252 is not set
894# CONFIG_SENSORS_EEPROM is not set 933# CONFIG_SENSORS_EEPROM is not set
895# CONFIG_SENSORS_PCF8574 is not set 934# CONFIG_SENSORS_PCF8574 is not set
896# CONFIG_SENSORS_PCF8575 is not set 935# CONFIG_PCF8575 is not set
897# CONFIG_SENSORS_PCA9539 is not set 936# CONFIG_SENSORS_PCA9539 is not set
898# CONFIG_SENSORS_PCF8591 is not set 937# CONFIG_SENSORS_PCF8591 is not set
899# CONFIG_SENSORS_MAX6875 is not set 938# CONFIG_SENSORS_MAX6875 is not set
@@ -902,17 +941,15 @@ CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50
902# CONFIG_I2C_DEBUG_ALGO is not set 941# CONFIG_I2C_DEBUG_ALGO is not set
903# CONFIG_I2C_DEBUG_BUS is not set 942# CONFIG_I2C_DEBUG_BUS is not set
904# CONFIG_I2C_DEBUG_CHIP is not set 943# CONFIG_I2C_DEBUG_CHIP is not set
905
906#
907# SPI support
908#
909CONFIG_SPI=y 944CONFIG_SPI=y
945# CONFIG_SPI_DEBUG is not set
910CONFIG_SPI_MASTER=y 946CONFIG_SPI_MASTER=y
911 947
912# 948#
913# SPI Master Controller Drivers 949# SPI Master Controller Drivers
914# 950#
915CONFIG_SPI_BFIN=y 951CONFIG_SPI_BFIN=y
952# CONFIG_SPI_BFIN_LOCK is not set
916# CONFIG_SPI_BITBANG is not set 953# CONFIG_SPI_BITBANG is not set
917 954
918# 955#
@@ -921,11 +958,15 @@ CONFIG_SPI_BFIN=y
921# CONFIG_SPI_AT25 is not set 958# CONFIG_SPI_AT25 is not set
922# CONFIG_SPI_SPIDEV is not set 959# CONFIG_SPI_SPIDEV is not set
923# CONFIG_SPI_TLE62X0 is not set 960# CONFIG_SPI_TLE62X0 is not set
961CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
962# CONFIG_GPIOLIB is not set
924# CONFIG_W1 is not set 963# CONFIG_W1 is not set
925# CONFIG_POWER_SUPPLY is not set 964# CONFIG_POWER_SUPPLY is not set
926CONFIG_HWMON=y 965CONFIG_HWMON=y
927# CONFIG_HWMON_VID is not set 966# CONFIG_HWMON_VID is not set
967# CONFIG_SENSORS_AD7414 is not set
928# CONFIG_SENSORS_AD7418 is not set 968# CONFIG_SENSORS_AD7418 is not set
969# CONFIG_SENSORS_ADCXX is not set
929# CONFIG_SENSORS_ADM1021 is not set 970# CONFIG_SENSORS_ADM1021 is not set
930# CONFIG_SENSORS_ADM1025 is not set 971# CONFIG_SENSORS_ADM1025 is not set
931# CONFIG_SENSORS_ADM1026 is not set 972# CONFIG_SENSORS_ADM1026 is not set
@@ -933,6 +974,7 @@ CONFIG_HWMON=y
933# CONFIG_SENSORS_ADM1031 is not set 974# CONFIG_SENSORS_ADM1031 is not set
934# CONFIG_SENSORS_ADM9240 is not set 975# CONFIG_SENSORS_ADM9240 is not set
935# CONFIG_SENSORS_ADT7470 is not set 976# CONFIG_SENSORS_ADT7470 is not set
977# CONFIG_SENSORS_ADT7473 is not set
936# CONFIG_SENSORS_ATXP1 is not set 978# CONFIG_SENSORS_ATXP1 is not set
937# CONFIG_SENSORS_DS1621 is not set 979# CONFIG_SENSORS_DS1621 is not set
938# CONFIG_SENSORS_F71805F is not set 980# CONFIG_SENSORS_F71805F is not set
@@ -953,6 +995,7 @@ CONFIG_HWMON=y
953# CONFIG_SENSORS_LM90 is not set 995# CONFIG_SENSORS_LM90 is not set
954# CONFIG_SENSORS_LM92 is not set 996# CONFIG_SENSORS_LM92 is not set
955# CONFIG_SENSORS_LM93 is not set 997# CONFIG_SENSORS_LM93 is not set
998# CONFIG_SENSORS_MAX1111 is not set
956# CONFIG_SENSORS_MAX1619 is not set 999# CONFIG_SENSORS_MAX1619 is not set
957# CONFIG_SENSORS_MAX6650 is not set 1000# CONFIG_SENSORS_MAX6650 is not set
958# CONFIG_SENSORS_PC87360 is not set 1001# CONFIG_SENSORS_PC87360 is not set
@@ -961,6 +1004,7 @@ CONFIG_HWMON=y
961# CONFIG_SENSORS_SMSC47M1 is not set 1004# CONFIG_SENSORS_SMSC47M1 is not set
962# CONFIG_SENSORS_SMSC47M192 is not set 1005# CONFIG_SENSORS_SMSC47M192 is not set
963# CONFIG_SENSORS_SMSC47B397 is not set 1006# CONFIG_SENSORS_SMSC47B397 is not set
1007# CONFIG_SENSORS_ADS7828 is not set
964# CONFIG_SENSORS_THMC50 is not set 1008# CONFIG_SENSORS_THMC50 is not set
965# CONFIG_SENSORS_VT1211 is not set 1009# CONFIG_SENSORS_VT1211 is not set
966# CONFIG_SENSORS_W83781D is not set 1010# CONFIG_SENSORS_W83781D is not set
@@ -968,9 +1012,12 @@ CONFIG_HWMON=y
968# CONFIG_SENSORS_W83792D is not set 1012# CONFIG_SENSORS_W83792D is not set
969# CONFIG_SENSORS_W83793 is not set 1013# CONFIG_SENSORS_W83793 is not set
970# CONFIG_SENSORS_W83L785TS is not set 1014# CONFIG_SENSORS_W83L785TS is not set
1015# CONFIG_SENSORS_W83L786NG is not set
971# CONFIG_SENSORS_W83627HF is not set 1016# CONFIG_SENSORS_W83627HF is not set
972# CONFIG_SENSORS_W83627EHF is not set 1017# CONFIG_SENSORS_W83627EHF is not set
973# CONFIG_HWMON_DEBUG_CHIP is not set 1018# CONFIG_HWMON_DEBUG_CHIP is not set
1019# CONFIG_THERMAL is not set
1020# CONFIG_THERMAL_HWMON is not set
974CONFIG_WATCHDOG=y 1021CONFIG_WATCHDOG=y
975# CONFIG_WATCHDOG_NOWAYOUT is not set 1022# CONFIG_WATCHDOG_NOWAYOUT is not set
976 1023
@@ -986,23 +1033,30 @@ CONFIG_BFIN_WDT=y
986# CONFIG_USBPCWATCHDOG is not set 1033# CONFIG_USBPCWATCHDOG is not set
987 1034
988# 1035#
989# Sonics Silicon Backplane
990#
991CONFIG_SSB_POSSIBLE=y
992# CONFIG_SSB is not set
993
994#
995# Multifunction device drivers 1036# Multifunction device drivers
996# 1037#
1038# CONFIG_MFD_CORE is not set
997# CONFIG_MFD_SM501 is not set 1039# CONFIG_MFD_SM501 is not set
1040# CONFIG_HTC_PASIC3 is not set
1041# CONFIG_MFD_TMIO is not set
1042# CONFIG_MFD_WM8400 is not set
1043# CONFIG_MFD_WM8350_I2C is not set
998 1044
999# 1045#
1000# Multimedia devices 1046# Multimedia devices
1001# 1047#
1048
1049#
1050# Multimedia core support
1051#
1002# CONFIG_VIDEO_DEV is not set 1052# CONFIG_VIDEO_DEV is not set
1003# CONFIG_DVB_CORE is not set 1053# CONFIG_DVB_CORE is not set
1054# CONFIG_VIDEO_MEDIA is not set
1055
1056#
1057# Multimedia drivers
1058#
1004# CONFIG_DAB is not set 1059# CONFIG_DAB is not set
1005# CONFIG_USB_DABUSB is not set
1006 1060
1007# 1061#
1008# Graphics support 1062# Graphics support
@@ -1012,6 +1066,7 @@ CONFIG_SSB_POSSIBLE=y
1012CONFIG_FB=y 1066CONFIG_FB=y
1013CONFIG_FIRMWARE_EDID=y 1067CONFIG_FIRMWARE_EDID=y
1014# CONFIG_FB_DDC is not set 1068# CONFIG_FB_DDC is not set
1069# CONFIG_FB_BOOT_VESA_SUPPORT is not set
1015CONFIG_FB_CFB_FILLRECT=y 1070CONFIG_FB_CFB_FILLRECT=y
1016CONFIG_FB_CFB_COPYAREA=y 1071CONFIG_FB_CFB_COPYAREA=y
1017CONFIG_FB_CFB_IMAGEBLIT=y 1072CONFIG_FB_CFB_IMAGEBLIT=y
@@ -1019,8 +1074,8 @@ CONFIG_FB_CFB_IMAGEBLIT=y
1019# CONFIG_FB_SYS_FILLRECT is not set 1074# CONFIG_FB_SYS_FILLRECT is not set
1020# CONFIG_FB_SYS_COPYAREA is not set 1075# CONFIG_FB_SYS_COPYAREA is not set
1021# CONFIG_FB_SYS_IMAGEBLIT is not set 1076# CONFIG_FB_SYS_IMAGEBLIT is not set
1077# CONFIG_FB_FOREIGN_ENDIAN is not set
1022# CONFIG_FB_SYS_FOPS is not set 1078# CONFIG_FB_SYS_FOPS is not set
1023CONFIG_FB_DEFERRED_IO=y
1024# CONFIG_FB_SVGALIB is not set 1079# CONFIG_FB_SVGALIB is not set
1025# CONFIG_FB_MACMODES is not set 1080# CONFIG_FB_MACMODES is not set
1026# CONFIG_FB_BACKLIGHT is not set 1081# CONFIG_FB_BACKLIGHT is not set
@@ -1032,9 +1087,11 @@ CONFIG_FB_DEFERRED_IO=y
1032# 1087#
1033CONFIG_FB_BF54X_LQ043=y 1088CONFIG_FB_BF54X_LQ043=y
1034# CONFIG_FB_BFIN_T350MCQB is not set 1089# CONFIG_FB_BFIN_T350MCQB is not set
1090# CONFIG_FB_BFIN_LQ035Q1 is not set
1035# CONFIG_FB_BFIN_7393 is not set 1091# CONFIG_FB_BFIN_7393 is not set
1036# CONFIG_FB_S1D13XXX is not set 1092# CONFIG_FB_S1D13XXX is not set
1037# CONFIG_FB_VIRTUAL is not set 1093# CONFIG_FB_VIRTUAL is not set
1094# CONFIG_FB_METRONOME is not set
1038# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 1095# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
1039 1096
1040# 1097#
@@ -1066,15 +1123,8 @@ CONFIG_LOGO=y
1066# CONFIG_LOGO_LINUX_CLUT224 is not set 1123# CONFIG_LOGO_LINUX_CLUT224 is not set
1067# CONFIG_LOGO_BLACKFIN_VGA16 is not set 1124# CONFIG_LOGO_BLACKFIN_VGA16 is not set
1068CONFIG_LOGO_BLACKFIN_CLUT224=y 1125CONFIG_LOGO_BLACKFIN_CLUT224=y
1069
1070#
1071# Sound
1072#
1073CONFIG_SOUND=y 1126CONFIG_SOUND=y
1074 1127CONFIG_SOUND_OSS_CORE=y
1075#
1076# Advanced Linux Sound Architecture
1077#
1078CONFIG_SND=y 1128CONFIG_SND=y
1079CONFIG_SND_TIMER=y 1129CONFIG_SND_TIMER=y
1080CONFIG_SND_PCM=y 1130CONFIG_SND_PCM=y
@@ -1088,56 +1138,35 @@ CONFIG_SND_SUPPORT_OLD_API=y
1088CONFIG_SND_VERBOSE_PROCFS=y 1138CONFIG_SND_VERBOSE_PROCFS=y
1089# CONFIG_SND_VERBOSE_PRINTK is not set 1139# CONFIG_SND_VERBOSE_PRINTK is not set
1090# CONFIG_SND_DEBUG is not set 1140# CONFIG_SND_DEBUG is not set
1091 1141CONFIG_SND_DRIVERS=y
1092#
1093# Generic devices
1094#
1095# CONFIG_SND_DUMMY is not set 1142# CONFIG_SND_DUMMY is not set
1096# CONFIG_SND_MTPAV is not set 1143# CONFIG_SND_MTPAV is not set
1097# CONFIG_SND_SERIAL_U16550 is not set 1144# CONFIG_SND_SERIAL_U16550 is not set
1098# CONFIG_SND_MPU401 is not set 1145# CONFIG_SND_MPU401 is not set
1099 1146CONFIG_SND_SPI=y
1100#
1101# SPI devices
1102#
1103 1147
1104# 1148#
1105# ALSA Blackfin devices 1149# ALSA Blackfin devices
1106# 1150#
1107# CONFIG_SND_BLACKFIN_AD1836 is not set 1151# CONFIG_SND_BLACKFIN_AD1836 is not set
1108# CONFIG_SND_BFIN_AD73311 is not set
1109# CONFIG_SND_BFIN_AD73322 is not set 1152# CONFIG_SND_BFIN_AD73322 is not set
1110 1153CONFIG_SND_USB=y
1111#
1112# USB devices
1113#
1114# CONFIG_SND_USB_AUDIO is not set 1154# CONFIG_SND_USB_AUDIO is not set
1115# CONFIG_SND_USB_CAIAQ is not set 1155# CONFIG_SND_USB_CAIAQ is not set
1116
1117#
1118# System on Chip audio support
1119#
1120CONFIG_SND_SOC_AC97_BUS=y
1121CONFIG_SND_SOC=y 1156CONFIG_SND_SOC=y
1122CONFIG_SND_BF5XX_SOC=y 1157CONFIG_SND_SOC_AC97_BUS=y
1123CONFIG_SND_MMAP_SUPPORT=y 1158# CONFIG_SND_BF5XX_I2S is not set
1159CONFIG_SND_BF5XX_AC97=y
1160CONFIG_SND_BF5XX_MMAP_SUPPORT=y
1161# CONFIG_SND_BF5XX_MULTICHAN_SUPPORT is not set
1162CONFIG_SND_BF5XX_SOC_SPORT=y
1124CONFIG_SND_BF5XX_SOC_AC97=y 1163CONFIG_SND_BF5XX_SOC_AC97=y
1125CONFIG_SND_BF5XX_SOC_BF548_EZKIT=y 1164CONFIG_SND_BF5XX_SOC_AD1980=y
1126# CONFIG_SND_BF5XX_SOC_WM8750 is not set
1127# CONFIG_SND_BF5XX_SOC_WM8731 is not set
1128# CONFIG_SND_BF5XX_SOC_SSM2602 is not set
1129CONFIG_SND_BF5XX_SPORT_NUM=0 1165CONFIG_SND_BF5XX_SPORT_NUM=0
1130CONFIG_SND_BF5XX_HAVE_COLD_RESET=y 1166CONFIG_SND_BF5XX_HAVE_COLD_RESET=y
1131CONFIG_SND_BF5XX_RESET_GPIO_NUM=19 1167CONFIG_SND_BF5XX_RESET_GPIO_NUM=19
1132 1168# CONFIG_SND_SOC_ALL_CODECS is not set
1133#
1134# SoC Audio support for SuperH
1135#
1136CONFIG_SND_SOC_AD1980=y 1169CONFIG_SND_SOC_AD1980=y
1137
1138#
1139# Open Sound System
1140#
1141# CONFIG_SOUND_PRIME is not set 1170# CONFIG_SOUND_PRIME is not set
1142CONFIG_AC97_BUS=y 1171CONFIG_AC97_BUS=y
1143CONFIG_HID_SUPPORT=y 1172CONFIG_HID_SUPPORT=y
@@ -1149,15 +1178,43 @@ CONFIG_HID=y
1149# USB Input Devices 1178# USB Input Devices
1150# 1179#
1151CONFIG_USB_HID=y 1180CONFIG_USB_HID=y
1152# CONFIG_USB_HIDINPUT_POWERBOOK is not set 1181# CONFIG_HID_PID is not set
1153# CONFIG_HID_FF is not set
1154# CONFIG_USB_HIDDEV is not set 1182# CONFIG_USB_HIDDEV is not set
1183
1184#
1185# Special HID drivers
1186#
1187CONFIG_HID_COMPAT=y
1188CONFIG_HID_A4TECH=y
1189CONFIG_HID_APPLE=y
1190CONFIG_HID_BELKIN=y
1191CONFIG_HID_BRIGHT=y
1192CONFIG_HID_CHERRY=y
1193CONFIG_HID_CHICONY=y
1194CONFIG_HID_CYPRESS=y
1195CONFIG_HID_DELL=y
1196CONFIG_HID_EZKEY=y
1197CONFIG_HID_GYRATION=y
1198CONFIG_HID_LOGITECH=y
1199# CONFIG_LOGITECH_FF is not set
1200# CONFIG_LOGIRUMBLEPAD2_FF is not set
1201CONFIG_HID_MICROSOFT=y
1202CONFIG_HID_MONTEREY=y
1203CONFIG_HID_PANTHERLORD=y
1204# CONFIG_PANTHERLORD_FF is not set
1205CONFIG_HID_PETALYNX=y
1206CONFIG_HID_SAMSUNG=y
1207CONFIG_HID_SONY=y
1208CONFIG_HID_SUNPLUS=y
1209CONFIG_THRUSTMASTER_FF=m
1210CONFIG_ZEROPLUS_FF=m
1155CONFIG_USB_SUPPORT=y 1211CONFIG_USB_SUPPORT=y
1156CONFIG_USB_ARCH_HAS_HCD=y 1212CONFIG_USB_ARCH_HAS_HCD=y
1157# CONFIG_USB_ARCH_HAS_OHCI is not set 1213# CONFIG_USB_ARCH_HAS_OHCI is not set
1158# CONFIG_USB_ARCH_HAS_EHCI is not set 1214# CONFIG_USB_ARCH_HAS_EHCI is not set
1159CONFIG_USB=y 1215CONFIG_USB=y
1160# CONFIG_USB_DEBUG is not set 1216# CONFIG_USB_DEBUG is not set
1217# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
1161 1218
1162# 1219#
1163# Miscellaneous USB options 1220# Miscellaneous USB options
@@ -1168,15 +1225,20 @@ CONFIG_USB_DEVICE_CLASS=y
1168# CONFIG_USB_OTG is not set 1225# CONFIG_USB_OTG is not set
1169# CONFIG_USB_OTG_WHITELIST is not set 1226# CONFIG_USB_OTG_WHITELIST is not set
1170CONFIG_USB_OTG_BLACKLIST_HUB=y 1227CONFIG_USB_OTG_BLACKLIST_HUB=y
1228CONFIG_USB_MON=y
1229# CONFIG_USB_WUSB is not set
1230# CONFIG_USB_WUSB_CBAF is not set
1171 1231
1172# 1232#
1173# USB Host Controller Drivers 1233# USB Host Controller Drivers
1174# 1234#
1235# CONFIG_USB_C67X00_HCD is not set
1175# CONFIG_USB_ISP116X_HCD is not set 1236# CONFIG_USB_ISP116X_HCD is not set
1176# CONFIG_USB_ISP1362_HCD is not set
1177# CONFIG_USB_ISP1760_HCD is not set 1237# CONFIG_USB_ISP1760_HCD is not set
1238# CONFIG_USB_ISP1362_HCD is not set
1178# CONFIG_USB_SL811_HCD is not set 1239# CONFIG_USB_SL811_HCD is not set
1179# CONFIG_USB_R8A66597_HCD is not set 1240# CONFIG_USB_R8A66597_HCD is not set
1241# CONFIG_USB_HWA_HCD is not set
1180CONFIG_USB_MUSB_HDRC=y 1242CONFIG_USB_MUSB_HDRC=y
1181CONFIG_USB_MUSB_SOC=y 1243CONFIG_USB_MUSB_SOC=y
1182 1244
@@ -1190,13 +1252,15 @@ CONFIG_USB_MUSB_HDRC_HCD=y
1190# CONFIG_MUSB_PIO_ONLY is not set 1252# CONFIG_MUSB_PIO_ONLY is not set
1191CONFIG_USB_INVENTRA_DMA=y 1253CONFIG_USB_INVENTRA_DMA=y
1192# CONFIG_USB_TI_CPPI_DMA is not set 1254# CONFIG_USB_TI_CPPI_DMA is not set
1193CONFIG_USB_MUSB_LOGLEVEL=0 1255# CONFIG_USB_MUSB_DEBUG is not set
1194 1256
1195# 1257#
1196# USB Device Class drivers 1258# USB Device Class drivers
1197# 1259#
1198# CONFIG_USB_ACM is not set 1260# CONFIG_USB_ACM is not set
1199# CONFIG_USB_PRINTER is not set 1261# CONFIG_USB_PRINTER is not set
1262# CONFIG_USB_WDM is not set
1263# CONFIG_USB_TMC is not set
1200 1264
1201# 1265#
1202# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1266# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
@@ -1218,6 +1282,7 @@ CONFIG_USB_STORAGE=m
1218# CONFIG_USB_STORAGE_ALAUDA is not set 1282# CONFIG_USB_STORAGE_ALAUDA is not set
1219# CONFIG_USB_STORAGE_ONETOUCH is not set 1283# CONFIG_USB_STORAGE_ONETOUCH is not set
1220# CONFIG_USB_STORAGE_KARMA is not set 1284# CONFIG_USB_STORAGE_KARMA is not set
1285# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
1221# CONFIG_USB_LIBUSUAL is not set 1286# CONFIG_USB_LIBUSUAL is not set
1222 1287
1223# 1288#
@@ -1225,15 +1290,10 @@ CONFIG_USB_STORAGE=m
1225# 1290#
1226# CONFIG_USB_MDC800 is not set 1291# CONFIG_USB_MDC800 is not set
1227# CONFIG_USB_MICROTEK is not set 1292# CONFIG_USB_MICROTEK is not set
1228CONFIG_USB_MON=y
1229 1293
1230# 1294#
1231# USB port drivers 1295# USB port drivers
1232# 1296#
1233
1234#
1235# USB Serial Converter support
1236#
1237# CONFIG_USB_SERIAL is not set 1297# CONFIG_USB_SERIAL is not set
1238 1298
1239# 1299#
@@ -1242,7 +1302,7 @@ CONFIG_USB_MON=y
1242# CONFIG_USB_EMI62 is not set 1302# CONFIG_USB_EMI62 is not set
1243# CONFIG_USB_EMI26 is not set 1303# CONFIG_USB_EMI26 is not set
1244# CONFIG_USB_ADUTUX is not set 1304# CONFIG_USB_ADUTUX is not set
1245# CONFIG_USB_AUERSWALD is not set 1305# CONFIG_USB_SEVSEG is not set
1246# CONFIG_USB_RIO500 is not set 1306# CONFIG_USB_RIO500 is not set
1247# CONFIG_USB_LEGOTOWER is not set 1307# CONFIG_USB_LEGOTOWER is not set
1248# CONFIG_USB_LCD is not set 1308# CONFIG_USB_LCD is not set
@@ -1258,34 +1318,31 @@ CONFIG_USB_MON=y
1258# CONFIG_USB_LD is not set 1318# CONFIG_USB_LD is not set
1259# CONFIG_USB_TRANCEVIBRATOR is not set 1319# CONFIG_USB_TRANCEVIBRATOR is not set
1260# CONFIG_USB_IOWARRIOR is not set 1320# CONFIG_USB_IOWARRIOR is not set
1261 1321# CONFIG_USB_ISIGHTFW is not set
1262# 1322# CONFIG_USB_VST is not set
1263# USB DSL modem support
1264#
1265
1266#
1267# USB Gadget Support
1268#
1269# CONFIG_USB_GADGET is not set 1323# CONFIG_USB_GADGET is not set
1270CONFIG_MMC=m 1324CONFIG_MMC=m
1271# CONFIG_MMC_DEBUG is not set 1325# CONFIG_MMC_DEBUG is not set
1272# CONFIG_MMC_UNSAFE_RESUME is not set 1326# CONFIG_MMC_UNSAFE_RESUME is not set
1273 1327
1274# 1328#
1275# MMC/SD Card Drivers 1329# MMC/SD/SDIO Card Drivers
1276# 1330#
1277CONFIG_MMC_BLOCK=m 1331CONFIG_MMC_BLOCK=m
1278CONFIG_MMC_BLOCK_BOUNCE=y 1332CONFIG_MMC_BLOCK_BOUNCE=y
1279# CONFIG_SDIO_UART is not set 1333# CONFIG_SDIO_UART is not set
1334# CONFIG_MMC_TEST is not set
1280 1335
1281# 1336#
1282# MMC/SD Host Controller Drivers 1337# MMC/SD/SDIO Host Controller Drivers
1283# 1338#
1339# CONFIG_MMC_SDHCI is not set
1284CONFIG_SDH_BFIN=m 1340CONFIG_SDH_BFIN=m
1285# CONFIG_SDH_BFIN_MISSING_CMD_PULLUP_WORKAROUND is not set 1341# CONFIG_SDH_BFIN_MISSING_CMD_PULLUP_WORKAROUND is not set
1286# CONFIG_MMC_SPI is not set 1342# CONFIG_MMC_SPI is not set
1287# CONFIG_SPI_MMC is not set 1343# CONFIG_MEMSTICK is not set
1288# CONFIG_NEW_LEDS is not set 1344# CONFIG_NEW_LEDS is not set
1345# CONFIG_ACCESSIBILITY is not set
1289CONFIG_RTC_LIB=y 1346CONFIG_RTC_LIB=y
1290CONFIG_RTC_CLASS=y 1347CONFIG_RTC_CLASS=y
1291CONFIG_RTC_HCTOSYS=y 1348CONFIG_RTC_HCTOSYS=y
@@ -1314,32 +1371,40 @@ CONFIG_RTC_INTF_DEV=y
1314# CONFIG_RTC_DRV_PCF8563 is not set 1371# CONFIG_RTC_DRV_PCF8563 is not set
1315# CONFIG_RTC_DRV_PCF8583 is not set 1372# CONFIG_RTC_DRV_PCF8583 is not set
1316# CONFIG_RTC_DRV_M41T80 is not set 1373# CONFIG_RTC_DRV_M41T80 is not set
1374# CONFIG_RTC_DRV_S35390A is not set
1375# CONFIG_RTC_DRV_FM3130 is not set
1317 1376
1318# 1377#
1319# SPI RTC drivers 1378# SPI RTC drivers
1320# 1379#
1321# CONFIG_RTC_DRV_RS5C348 is not set 1380# CONFIG_RTC_DRV_M41T94 is not set
1381# CONFIG_RTC_DRV_DS1305 is not set
1322# CONFIG_RTC_DRV_MAX6902 is not set 1382# CONFIG_RTC_DRV_MAX6902 is not set
1383# CONFIG_RTC_DRV_R9701 is not set
1384# CONFIG_RTC_DRV_RS5C348 is not set
1385# CONFIG_RTC_DRV_DS3234 is not set
1323 1386
1324# 1387#
1325# Platform RTC drivers 1388# Platform RTC drivers
1326# 1389#
1390# CONFIG_RTC_DRV_DS1286 is not set
1391# CONFIG_RTC_DRV_DS1511 is not set
1327# CONFIG_RTC_DRV_DS1553 is not set 1392# CONFIG_RTC_DRV_DS1553 is not set
1328# CONFIG_RTC_DRV_STK17TA8 is not set
1329# CONFIG_RTC_DRV_DS1742 is not set 1393# CONFIG_RTC_DRV_DS1742 is not set
1394# CONFIG_RTC_DRV_STK17TA8 is not set
1330# CONFIG_RTC_DRV_M48T86 is not set 1395# CONFIG_RTC_DRV_M48T86 is not set
1396# CONFIG_RTC_DRV_M48T35 is not set
1331# CONFIG_RTC_DRV_M48T59 is not set 1397# CONFIG_RTC_DRV_M48T59 is not set
1398# CONFIG_RTC_DRV_BQ4802 is not set
1332# CONFIG_RTC_DRV_V3020 is not set 1399# CONFIG_RTC_DRV_V3020 is not set
1333 1400
1334# 1401#
1335# on-CPU RTC drivers 1402# on-CPU RTC drivers
1336# 1403#
1337CONFIG_RTC_DRV_BFIN=y 1404CONFIG_RTC_DRV_BFIN=y
1338 1405# CONFIG_DMADEVICES is not set
1339#
1340# Userspace I/O
1341#
1342# CONFIG_UIO is not set 1406# CONFIG_UIO is not set
1407# CONFIG_STAGING is not set
1343 1408
1344# 1409#
1345# File systems 1410# File systems
@@ -1352,22 +1417,20 @@ CONFIG_EXT3_FS=y
1352CONFIG_EXT3_FS_XATTR=y 1417CONFIG_EXT3_FS_XATTR=y
1353# CONFIG_EXT3_FS_POSIX_ACL is not set 1418# CONFIG_EXT3_FS_POSIX_ACL is not set
1354# CONFIG_EXT3_FS_SECURITY is not set 1419# CONFIG_EXT3_FS_SECURITY is not set
1355# CONFIG_EXT4DEV_FS is not set 1420# CONFIG_EXT4_FS is not set
1356CONFIG_JBD=y 1421CONFIG_JBD=y
1357# CONFIG_JBD_DEBUG is not set 1422# CONFIG_JBD_DEBUG is not set
1358CONFIG_FS_MBCACHE=y 1423CONFIG_FS_MBCACHE=y
1359# CONFIG_REISERFS_FS is not set 1424# CONFIG_REISERFS_FS is not set
1360# CONFIG_JFS_FS is not set 1425# CONFIG_JFS_FS is not set
1361# CONFIG_FS_POSIX_ACL is not set 1426# CONFIG_FS_POSIX_ACL is not set
1427CONFIG_FILE_LOCKING=y
1362# CONFIG_XFS_FS is not set 1428# CONFIG_XFS_FS is not set
1363# CONFIG_GFS2_FS is not set
1364# CONFIG_OCFS2_FS is not set 1429# CONFIG_OCFS2_FS is not set
1365# CONFIG_MINIX_FS is not set 1430# CONFIG_DNOTIFY is not set
1366# CONFIG_ROMFS_FS is not set
1367CONFIG_INOTIFY=y 1431CONFIG_INOTIFY=y
1368CONFIG_INOTIFY_USER=y 1432CONFIG_INOTIFY_USER=y
1369# CONFIG_QUOTA is not set 1433# CONFIG_QUOTA is not set
1370# CONFIG_DNOTIFY is not set
1371# CONFIG_AUTOFS_FS is not set 1434# CONFIG_AUTOFS_FS is not set
1372# CONFIG_AUTOFS4_FS is not set 1435# CONFIG_AUTOFS4_FS is not set
1373# CONFIG_FUSE_FS is not set 1436# CONFIG_FUSE_FS is not set
@@ -1414,11 +1477,11 @@ CONFIG_SYSFS=y
1414# CONFIG_EFS_FS is not set 1477# CONFIG_EFS_FS is not set
1415CONFIG_YAFFS_FS=m 1478CONFIG_YAFFS_FS=m
1416CONFIG_YAFFS_YAFFS1=y 1479CONFIG_YAFFS_YAFFS1=y
1480# CONFIG_YAFFS_9BYTE_TAGS is not set
1417# CONFIG_YAFFS_DOES_ECC is not set 1481# CONFIG_YAFFS_DOES_ECC is not set
1418CONFIG_YAFFS_YAFFS2=y 1482CONFIG_YAFFS_YAFFS2=y
1419CONFIG_YAFFS_AUTO_YAFFS2=y 1483CONFIG_YAFFS_AUTO_YAFFS2=y
1420# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set 1484# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1421CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
1422# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set 1485# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1423# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set 1486# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1424CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y 1487CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
@@ -1435,8 +1498,11 @@ CONFIG_JFFS2_RTIME=y
1435# CONFIG_JFFS2_RUBIN is not set 1498# CONFIG_JFFS2_RUBIN is not set
1436# CONFIG_CRAMFS is not set 1499# CONFIG_CRAMFS is not set
1437# CONFIG_VXFS_FS is not set 1500# CONFIG_VXFS_FS is not set
1501# CONFIG_MINIX_FS is not set
1502# CONFIG_OMFS_FS is not set
1438# CONFIG_HPFS_FS is not set 1503# CONFIG_HPFS_FS is not set
1439# CONFIG_QNX4FS_FS is not set 1504# CONFIG_QNX4FS_FS is not set
1505# CONFIG_ROMFS_FS is not set
1440# CONFIG_SYSV_FS is not set 1506# CONFIG_SYSV_FS is not set
1441# CONFIG_UFS_FS is not set 1507# CONFIG_UFS_FS is not set
1442CONFIG_NETWORK_FILESYSTEMS=y 1508CONFIG_NETWORK_FILESYSTEMS=y
@@ -1444,18 +1510,16 @@ CONFIG_NFS_FS=m
1444CONFIG_NFS_V3=y 1510CONFIG_NFS_V3=y
1445# CONFIG_NFS_V3_ACL is not set 1511# CONFIG_NFS_V3_ACL is not set
1446# CONFIG_NFS_V4 is not set 1512# CONFIG_NFS_V4 is not set
1447# CONFIG_NFS_DIRECTIO is not set
1448CONFIG_NFSD=m 1513CONFIG_NFSD=m
1449CONFIG_NFSD_V3=y 1514CONFIG_NFSD_V3=y
1450# CONFIG_NFSD_V3_ACL is not set 1515# CONFIG_NFSD_V3_ACL is not set
1451# CONFIG_NFSD_V4 is not set 1516# CONFIG_NFSD_V4 is not set
1452CONFIG_NFSD_TCP=y
1453CONFIG_LOCKD=m 1517CONFIG_LOCKD=m
1454CONFIG_LOCKD_V4=y 1518CONFIG_LOCKD_V4=y
1455CONFIG_EXPORTFS=m 1519CONFIG_EXPORTFS=m
1456CONFIG_NFS_COMMON=y 1520CONFIG_NFS_COMMON=y
1457CONFIG_SUNRPC=m 1521CONFIG_SUNRPC=m
1458# CONFIG_SUNRPC_BIND34 is not set 1522# CONFIG_SUNRPC_REGISTER_V4 is not set
1459# CONFIG_RPCSEC_GSS_KRB5 is not set 1523# CONFIG_RPCSEC_GSS_KRB5 is not set
1460# CONFIG_RPCSEC_GSS_SPKM3 is not set 1524# CONFIG_RPCSEC_GSS_SPKM3 is not set
1461CONFIG_SMB_FS=m 1525CONFIG_SMB_FS=m
@@ -1533,9 +1597,6 @@ CONFIG_NLS_KOI8_R=m
1533CONFIG_NLS_KOI8_U=m 1597CONFIG_NLS_KOI8_U=m
1534CONFIG_NLS_UTF8=m 1598CONFIG_NLS_UTF8=m
1535# CONFIG_DLM is not set 1599# CONFIG_DLM is not set
1536CONFIG_INSTRUMENTATION=y
1537# CONFIG_PROFILING is not set
1538# CONFIG_MARKERS is not set
1539 1600
1540# 1601#
1541# Kernel hacking 1602# Kernel hacking
@@ -1543,14 +1604,53 @@ CONFIG_INSTRUMENTATION=y
1543# CONFIG_PRINTK_TIME is not set 1604# CONFIG_PRINTK_TIME is not set
1544CONFIG_ENABLE_WARN_DEPRECATED=y 1605CONFIG_ENABLE_WARN_DEPRECATED=y
1545CONFIG_ENABLE_MUST_CHECK=y 1606CONFIG_ENABLE_MUST_CHECK=y
1607CONFIG_FRAME_WARN=1024
1546# CONFIG_MAGIC_SYSRQ is not set 1608# CONFIG_MAGIC_SYSRQ is not set
1547# CONFIG_UNUSED_SYMBOLS is not set 1609# CONFIG_UNUSED_SYMBOLS is not set
1548CONFIG_DEBUG_FS=y 1610CONFIG_DEBUG_FS=y
1549# CONFIG_HEADERS_CHECK is not set 1611# CONFIG_HEADERS_CHECK is not set
1550# CONFIG_DEBUG_KERNEL is not set 1612CONFIG_DEBUG_KERNEL=y
1613# CONFIG_DEBUG_SHIRQ is not set
1614CONFIG_DETECT_SOFTLOCKUP=y
1615# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1616CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1617CONFIG_SCHED_DEBUG=y
1618# CONFIG_SCHEDSTATS is not set
1619# CONFIG_TIMER_STATS is not set
1620# CONFIG_DEBUG_OBJECTS is not set
1621# CONFIG_DEBUG_SLAB is not set
1622# CONFIG_DEBUG_RT_MUTEXES is not set
1623# CONFIG_RT_MUTEX_TESTER is not set
1624# CONFIG_DEBUG_SPINLOCK is not set
1625# CONFIG_DEBUG_MUTEXES is not set
1626# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1627# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1628# CONFIG_DEBUG_KOBJECT is not set
1551# CONFIG_DEBUG_BUGVERBOSE is not set 1629# CONFIG_DEBUG_BUGVERBOSE is not set
1630CONFIG_DEBUG_INFO=y
1631# CONFIG_DEBUG_VM is not set
1632# CONFIG_DEBUG_WRITECOUNT is not set
1633# CONFIG_DEBUG_MEMORY_INIT is not set
1634# CONFIG_DEBUG_LIST is not set
1635# CONFIG_DEBUG_SG is not set
1636# CONFIG_FRAME_POINTER is not set
1637# CONFIG_BOOT_PRINTK_DELAY is not set
1638# CONFIG_RCU_TORTURE_TEST is not set
1639# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1640# CONFIG_BACKTRACE_SELF_TEST is not set
1641# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1642# CONFIG_FAULT_INJECTION is not set
1643# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1644# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1552# CONFIG_SAMPLES is not set 1645# CONFIG_SAMPLES is not set
1646CONFIG_HAVE_ARCH_KGDB=y
1647# CONFIG_KGDB is not set
1648# CONFIG_DEBUG_STACKOVERFLOW is not set
1649# CONFIG_DEBUG_STACK_USAGE is not set
1650CONFIG_DEBUG_VERBOSE=y
1553CONFIG_DEBUG_MMRS=y 1651CONFIG_DEBUG_MMRS=y
1652# CONFIG_DEBUG_HWERR is not set
1653# CONFIG_DEBUG_DOUBLEFAULT is not set
1554CONFIG_DEBUG_HUNT_FOR_ZERO=y 1654CONFIG_DEBUG_HUNT_FOR_ZERO=y
1555CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1655CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1556CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1656CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
@@ -1568,10 +1668,95 @@ CONFIG_ACCESS_CHECK=y
1568# 1668#
1569# CONFIG_KEYS is not set 1669# CONFIG_KEYS is not set
1570CONFIG_SECURITY=y 1670CONFIG_SECURITY=y
1671# CONFIG_SECURITYFS is not set
1571# CONFIG_SECURITY_NETWORK is not set 1672# CONFIG_SECURITY_NETWORK is not set
1572# CONFIG_SECURITY_CAPABILITIES is not set 1673# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1573# CONFIG_SECURITY_ROOTPLUG is not set 1674# CONFIG_SECURITY_ROOTPLUG is not set
1574# CONFIG_CRYPTO is not set 1675CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1676CONFIG_CRYPTO=y
1677
1678#
1679# Crypto core or helper
1680#
1681# CONFIG_CRYPTO_FIPS is not set
1682# CONFIG_CRYPTO_MANAGER is not set
1683# CONFIG_CRYPTO_GF128MUL is not set
1684# CONFIG_CRYPTO_NULL is not set
1685# CONFIG_CRYPTO_CRYPTD is not set
1686# CONFIG_CRYPTO_AUTHENC is not set
1687# CONFIG_CRYPTO_TEST is not set
1688
1689#
1690# Authenticated Encryption with Associated Data
1691#
1692# CONFIG_CRYPTO_CCM is not set
1693# CONFIG_CRYPTO_GCM is not set
1694# CONFIG_CRYPTO_SEQIV is not set
1695
1696#
1697# Block modes
1698#
1699# CONFIG_CRYPTO_CBC is not set
1700# CONFIG_CRYPTO_CTR is not set
1701# CONFIG_CRYPTO_CTS is not set
1702# CONFIG_CRYPTO_ECB is not set
1703# CONFIG_CRYPTO_LRW is not set
1704# CONFIG_CRYPTO_PCBC is not set
1705# CONFIG_CRYPTO_XTS is not set
1706
1707#
1708# Hash modes
1709#
1710# CONFIG_CRYPTO_HMAC is not set
1711# CONFIG_CRYPTO_XCBC is not set
1712
1713#
1714# Digest
1715#
1716# CONFIG_CRYPTO_CRC32C is not set
1717# CONFIG_CRYPTO_MD4 is not set
1718# CONFIG_CRYPTO_MD5 is not set
1719# CONFIG_CRYPTO_MICHAEL_MIC is not set
1720# CONFIG_CRYPTO_RMD128 is not set
1721# CONFIG_CRYPTO_RMD160 is not set
1722# CONFIG_CRYPTO_RMD256 is not set
1723# CONFIG_CRYPTO_RMD320 is not set
1724# CONFIG_CRYPTO_SHA1 is not set
1725# CONFIG_CRYPTO_SHA256 is not set
1726# CONFIG_CRYPTO_SHA512 is not set
1727# CONFIG_CRYPTO_TGR192 is not set
1728# CONFIG_CRYPTO_WP512 is not set
1729
1730#
1731# Ciphers
1732#
1733# CONFIG_CRYPTO_AES is not set
1734# CONFIG_CRYPTO_ANUBIS is not set
1735# CONFIG_CRYPTO_ARC4 is not set
1736# CONFIG_CRYPTO_BLOWFISH is not set
1737# CONFIG_CRYPTO_CAMELLIA is not set
1738# CONFIG_CRYPTO_CAST5 is not set
1739# CONFIG_CRYPTO_CAST6 is not set
1740# CONFIG_CRYPTO_DES is not set
1741# CONFIG_CRYPTO_FCRYPT is not set
1742# CONFIG_CRYPTO_KHAZAD is not set
1743# CONFIG_CRYPTO_SALSA20 is not set
1744# CONFIG_CRYPTO_SEED is not set
1745# CONFIG_CRYPTO_SERPENT is not set
1746# CONFIG_CRYPTO_TEA is not set
1747# CONFIG_CRYPTO_TWOFISH is not set
1748
1749#
1750# Compression
1751#
1752# CONFIG_CRYPTO_DEFLATE is not set
1753# CONFIG_CRYPTO_LZO is not set
1754
1755#
1756# Random Number Generation
1757#
1758# CONFIG_CRYPTO_ANSI_CPRNG is not set
1759CONFIG_CRYPTO_HW=y
1575 1760
1576# 1761#
1577# Library routines 1762# Library routines
@@ -1579,6 +1764,7 @@ CONFIG_SECURITY=y
1579CONFIG_BITREVERSE=y 1764CONFIG_BITREVERSE=y
1580CONFIG_CRC_CCITT=m 1765CONFIG_CRC_CCITT=m
1581# CONFIG_CRC16 is not set 1766# CONFIG_CRC16 is not set
1767# CONFIG_CRC_T10DIF is not set
1582# CONFIG_CRC_ITU_T is not set 1768# CONFIG_CRC_ITU_T is not set
1583CONFIG_CRC32=y 1769CONFIG_CRC32=y
1584# CONFIG_CRC7 is not set 1770# CONFIG_CRC7 is not set
diff --git a/arch/blackfin/configs/BF561-EZKIT_defconfig b/arch/blackfin/configs/BF561-EZKIT_defconfig
index 3c70d6230a12..1ecb7a38c905 100644
--- a/arch/blackfin/configs/BF561-EZKIT_defconfig
+++ b/arch/blackfin/configs/BF561-EZKIT_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24.7 3# Linux kernel version: 2.6.28-rc2
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -8,7 +8,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y 9CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y 10CONFIG_ZONE_DMA=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y 11CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
@@ -31,18 +30,16 @@ CONFIG_SYSVIPC_SYSCTL=y
31# CONFIG_POSIX_MQUEUE is not set 30# CONFIG_POSIX_MQUEUE is not set
32# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
33# CONFIG_TASKSTATS is not set 32# CONFIG_TASKSTATS is not set
34# CONFIG_USER_NS is not set
35# CONFIG_PID_NS is not set
36# CONFIG_AUDIT is not set 33# CONFIG_AUDIT is not set
37CONFIG_IKCONFIG=y 34CONFIG_IKCONFIG=y
38CONFIG_IKCONFIG_PROC=y 35CONFIG_IKCONFIG_PROC=y
39CONFIG_LOG_BUF_SHIFT=14 36CONFIG_LOG_BUF_SHIFT=14
40# CONFIG_CGROUPS is not set 37# CONFIG_CGROUPS is not set
41CONFIG_FAIR_GROUP_SCHED=y 38# CONFIG_GROUP_SCHED is not set
42CONFIG_FAIR_USER_SCHED=y 39# CONFIG_SYSFS_DEPRECATED is not set
43# CONFIG_FAIR_CGROUP_SCHED is not set 40# CONFIG_SYSFS_DEPRECATED_V2 is not set
44CONFIG_SYSFS_DEPRECATED=y
45# CONFIG_RELAY is not set 41# CONFIG_RELAY is not set
42# CONFIG_NAMESPACES is not set
46CONFIG_BLK_DEV_INITRD=y 43CONFIG_BLK_DEV_INITRD=y
47CONFIG_INITRAMFS_SOURCE="" 44CONFIG_INITRAMFS_SOURCE=""
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -51,26 +48,35 @@ CONFIG_EMBEDDED=y
51CONFIG_UID16=y 48CONFIG_UID16=y
52CONFIG_SYSCTL_SYSCALL=y 49CONFIG_SYSCTL_SYSCALL=y
53CONFIG_KALLSYMS=y 50CONFIG_KALLSYMS=y
51# CONFIG_KALLSYMS_ALL is not set
54# CONFIG_KALLSYMS_EXTRA_PASS is not set 52# CONFIG_KALLSYMS_EXTRA_PASS is not set
55CONFIG_HOTPLUG=y 53CONFIG_HOTPLUG=y
56CONFIG_PRINTK=y 54CONFIG_PRINTK=y
57CONFIG_BUG=y 55CONFIG_BUG=y
58CONFIG_ELF_CORE=y 56# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y
59CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 59CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 60CONFIG_ANON_INODES=y
62CONFIG_EPOLL=y 61CONFIG_EPOLL=y
63CONFIG_SIGNALFD=y 62CONFIG_SIGNALFD=y
63CONFIG_TIMERFD=y
64CONFIG_EVENTFD=y 64CONFIG_EVENTFD=y
65CONFIG_AIO=y
65CONFIG_VM_EVENT_COUNTERS=y 66CONFIG_VM_EVENT_COUNTERS=y
66CONFIG_SLAB=y 67CONFIG_SLAB=y
67# CONFIG_SLUB is not set 68# CONFIG_SLUB is not set
68# CONFIG_SLOB is not set 69# CONFIG_SLOB is not set
70# CONFIG_PROFILING is not set
71# CONFIG_MARKERS is not set
72CONFIG_HAVE_OPROFILE=y
73# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
69CONFIG_SLABINFO=y 74CONFIG_SLABINFO=y
70CONFIG_RT_MUTEXES=y 75CONFIG_RT_MUTEXES=y
71CONFIG_TINY_SHMEM=y 76CONFIG_TINY_SHMEM=y
72CONFIG_BASE_SMALL=0 77CONFIG_BASE_SMALL=0
73CONFIG_MODULES=y 78CONFIG_MODULES=y
79# CONFIG_MODULE_FORCE_LOAD is not set
74CONFIG_MODULE_UNLOAD=y 80CONFIG_MODULE_UNLOAD=y
75# CONFIG_MODULE_FORCE_UNLOAD is not set 81# CONFIG_MODULE_FORCE_UNLOAD is not set
76# CONFIG_MODVERSIONS is not set 82# CONFIG_MODVERSIONS is not set
@@ -81,6 +87,7 @@ CONFIG_BLOCK=y
81# CONFIG_BLK_DEV_IO_TRACE is not set 87# CONFIG_BLK_DEV_IO_TRACE is not set
82# CONFIG_LSF is not set 88# CONFIG_LSF is not set
83# CONFIG_BLK_DEV_BSG is not set 89# CONFIG_BLK_DEV_BSG is not set
90# CONFIG_BLK_DEV_INTEGRITY is not set
84 91
85# 92#
86# IO Schedulers 93# IO Schedulers
@@ -94,9 +101,11 @@ CONFIG_DEFAULT_AS=y
94# CONFIG_DEFAULT_CFQ is not set 101# CONFIG_DEFAULT_CFQ is not set
95# CONFIG_DEFAULT_NOOP is not set 102# CONFIG_DEFAULT_NOOP is not set
96CONFIG_DEFAULT_IOSCHED="anticipatory" 103CONFIG_DEFAULT_IOSCHED="anticipatory"
104CONFIG_CLASSIC_RCU=y
97# CONFIG_PREEMPT_NONE is not set 105# CONFIG_PREEMPT_NONE is not set
98CONFIG_PREEMPT_VOLUNTARY=y 106CONFIG_PREEMPT_VOLUNTARY=y
99# CONFIG_PREEMPT is not set 107# CONFIG_PREEMPT is not set
108# CONFIG_FREEZER is not set
100 109
101# 110#
102# Blackfin Processor Options 111# Blackfin Processor Options
@@ -105,6 +114,10 @@ CONFIG_PREEMPT_VOLUNTARY=y
105# 114#
106# Processor and Board Settings 115# Processor and Board Settings
107# 116#
117# CONFIG_BF512 is not set
118# CONFIG_BF514 is not set
119# CONFIG_BF516 is not set
120# CONFIG_BF518 is not set
108# CONFIG_BF522 is not set 121# CONFIG_BF522 is not set
109# CONFIG_BF523 is not set 122# CONFIG_BF523 is not set
110# CONFIG_BF524 is not set 123# CONFIG_BF524 is not set
@@ -117,24 +130,38 @@ CONFIG_PREEMPT_VOLUNTARY=y
117# CONFIG_BF534 is not set 130# CONFIG_BF534 is not set
118# CONFIG_BF536 is not set 131# CONFIG_BF536 is not set
119# CONFIG_BF537 is not set 132# CONFIG_BF537 is not set
133# CONFIG_BF538 is not set
134# CONFIG_BF539 is not set
120# CONFIG_BF542 is not set 135# CONFIG_BF542 is not set
121# CONFIG_BF544 is not set 136# CONFIG_BF544 is not set
122# CONFIG_BF547 is not set 137# CONFIG_BF547 is not set
123# CONFIG_BF548 is not set 138# CONFIG_BF548 is not set
124# CONFIG_BF549 is not set 139# CONFIG_BF549 is not set
125CONFIG_BF561=y 140CONFIG_BF561=y
141# CONFIG_SMP is not set
142CONFIG_BF_REV_MIN=3
143CONFIG_BF_REV_MAX=5
126# CONFIG_BF_REV_0_0 is not set 144# CONFIG_BF_REV_0_0 is not set
127# CONFIG_BF_REV_0_1 is not set 145# CONFIG_BF_REV_0_1 is not set
128# CONFIG_BF_REV_0_2 is not set 146# CONFIG_BF_REV_0_2 is not set
129CONFIG_BF_REV_0_3=y 147CONFIG_BF_REV_0_3=y
130# CONFIG_BF_REV_0_4 is not set 148# CONFIG_BF_REV_0_4 is not set
131# CONFIG_BF_REV_0_5 is not set 149# CONFIG_BF_REV_0_5 is not set
150# CONFIG_BF_REV_0_6 is not set
132# CONFIG_BF_REV_ANY is not set 151# CONFIG_BF_REV_ANY is not set
133# CONFIG_BF_REV_NONE is not set 152# CONFIG_BF_REV_NONE is not set
134CONFIG_MEM_MT48LC16M16A2TG_75=y 153CONFIG_MEM_MT48LC16M16A2TG_75=y
135CONFIG_IRQ_PLL_WAKEUP=7 154CONFIG_IRQ_PLL_WAKEUP=7
136CONFIG_IRQ_SPORT0_ERROR=7 155CONFIG_IRQ_SPORT0_ERROR=7
137CONFIG_IRQ_SPORT1_ERROR=7 156CONFIG_IRQ_SPORT1_ERROR=7
157CONFIG_IRQ_TIMER0=10
158CONFIG_IRQ_TIMER1=10
159CONFIG_IRQ_TIMER2=10
160CONFIG_IRQ_TIMER3=10
161CONFIG_IRQ_TIMER4=10
162CONFIG_IRQ_TIMER5=10
163CONFIG_IRQ_TIMER6=10
164CONFIG_IRQ_TIMER7=10
138CONFIG_IRQ_SPI_ERROR=7 165CONFIG_IRQ_SPI_ERROR=7
139CONFIG_BFIN561_EZKIT=y 166CONFIG_BFIN561_EZKIT=y
140# CONFIG_BFIN561_TEPLA is not set 167# CONFIG_BFIN561_TEPLA is not set
@@ -148,10 +175,6 @@ CONFIG_BFIN561_EZKIT=y
148# 175#
149# Core B Support 176# Core B Support
150# 177#
151
152#
153# Core B Support
154#
155CONFIG_BF561_COREB=y 178CONFIG_BF561_COREB=y
156CONFIG_BF561_COREB_RESET=y 179CONFIG_BF561_COREB_RESET=y
157 180
@@ -193,14 +216,6 @@ CONFIG_IRQ_DMA2_8=9
193CONFIG_IRQ_DMA2_9=9 216CONFIG_IRQ_DMA2_9=9
194CONFIG_IRQ_DMA2_10=9 217CONFIG_IRQ_DMA2_10=9
195CONFIG_IRQ_DMA2_11=9 218CONFIG_IRQ_DMA2_11=9
196CONFIG_IRQ_TIMER0=10
197CONFIG_IRQ_TIMER1=10
198CONFIG_IRQ_TIMER2=10
199CONFIG_IRQ_TIMER3=10
200CONFIG_IRQ_TIMER4=10
201CONFIG_IRQ_TIMER5=10
202CONFIG_IRQ_TIMER6=10
203CONFIG_IRQ_TIMER7=10
204CONFIG_IRQ_TIMER8=10 219CONFIG_IRQ_TIMER8=10
205CONFIG_IRQ_TIMER9=10 220CONFIG_IRQ_TIMER9=10
206CONFIG_IRQ_TIMER10=10 221CONFIG_IRQ_TIMER10=10
@@ -230,7 +245,6 @@ CONFIG_BOOT_LOAD=0x1000
230# 245#
231CONFIG_CLKIN_HZ=30000000 246CONFIG_CLKIN_HZ=30000000
232# CONFIG_BFIN_KERNEL_CLOCK is not set 247# CONFIG_BFIN_KERNEL_CLOCK is not set
233CONFIG_MAX_MEM_SIZE=512
234CONFIG_MAX_VCO_HZ=600000000 248CONFIG_MAX_VCO_HZ=600000000
235CONFIG_MIN_VCO_HZ=50000000 249CONFIG_MIN_VCO_HZ=50000000
236CONFIG_MAX_SCLK_HZ=133333333 250CONFIG_MAX_SCLK_HZ=133333333
@@ -244,6 +258,7 @@ CONFIG_HZ_250=y
244# CONFIG_HZ_300 is not set 258# CONFIG_HZ_300 is not set
245# CONFIG_HZ_1000 is not set 259# CONFIG_HZ_1000 is not set
246CONFIG_HZ=250 260CONFIG_HZ=250
261CONFIG_SCHED_HRTICK=y
247CONFIG_GENERIC_TIME=y 262CONFIG_GENERIC_TIME=y
248CONFIG_GENERIC_CLOCKEVENTS=y 263CONFIG_GENERIC_CLOCKEVENTS=y
249# CONFIG_CYCLES_CLOCKSOURCE is not set 264# CONFIG_CYCLES_CLOCKSOURCE is not set
@@ -281,6 +296,12 @@ CONFIG_SYS_BFIN_SPINLOCK_L1=y
281CONFIG_CACHELINE_ALIGNED_L1=y 296CONFIG_CACHELINE_ALIGNED_L1=y
282# CONFIG_SYSCALL_TAB_L1 is not set 297# CONFIG_SYSCALL_TAB_L1 is not set
283# CONFIG_CPLB_SWITCH_TAB_L1 is not set 298# CONFIG_CPLB_SWITCH_TAB_L1 is not set
299CONFIG_APP_STACK_L1=y
300
301#
302# Speed Optimizations
303#
304CONFIG_BFIN_INS_LOWOVERHEAD=y
284CONFIG_RAMKERNEL=y 305CONFIG_RAMKERNEL=y
285# CONFIG_ROMKERNEL is not set 306# CONFIG_ROMKERNEL is not set
286CONFIG_SELECT_MEMORY_MODEL=y 307CONFIG_SELECT_MEMORY_MODEL=y
@@ -289,14 +310,13 @@ CONFIG_FLATMEM_MANUAL=y
289# CONFIG_SPARSEMEM_MANUAL is not set 310# CONFIG_SPARSEMEM_MANUAL is not set
290CONFIG_FLATMEM=y 311CONFIG_FLATMEM=y
291CONFIG_FLAT_NODE_MEM_MAP=y 312CONFIG_FLAT_NODE_MEM_MAP=y
292# CONFIG_SPARSEMEM_STATIC is not set 313CONFIG_PAGEFLAGS_EXTENDED=y
293# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
294CONFIG_SPLIT_PTLOCK_CPUS=4 314CONFIG_SPLIT_PTLOCK_CPUS=4
295# CONFIG_RESOURCES_64BIT is not set 315# CONFIG_RESOURCES_64BIT is not set
316# CONFIG_PHYS_ADDR_T_64BIT is not set
296CONFIG_ZONE_DMA_FLAG=1 317CONFIG_ZONE_DMA_FLAG=1
297CONFIG_VIRT_TO_BUS=y 318CONFIG_VIRT_TO_BUS=y
298# CONFIG_BFIN_GPTIMERS is not set 319# CONFIG_BFIN_GPTIMERS is not set
299CONFIG_BFIN_DMA_5XX=y
300# CONFIG_DMA_UNCACHED_4M is not set 320# CONFIG_DMA_UNCACHED_4M is not set
301# CONFIG_DMA_UNCACHED_2M is not set 321# CONFIG_DMA_UNCACHED_2M is not set
302CONFIG_DMA_UNCACHED_1M=y 322CONFIG_DMA_UNCACHED_1M=y
@@ -311,7 +331,7 @@ CONFIG_BFIN_DCACHE=y
311# CONFIG_BFIN_ICACHE_LOCK is not set 331# CONFIG_BFIN_ICACHE_LOCK is not set
312# CONFIG_BFIN_WB is not set 332# CONFIG_BFIN_WB is not set
313CONFIG_BFIN_WT=y 333CONFIG_BFIN_WT=y
314CONFIG_L1_MAX_PIECE=16 334# CONFIG_BFIN_L2_CACHEABLE is not set
315# CONFIG_MPU is not set 335# CONFIG_MPU is not set
316 336
317# 337#
@@ -344,7 +364,6 @@ CONFIG_BANK_3=0xAAC2
344# 364#
345# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 365# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
346# 366#
347# CONFIG_PCI is not set
348# CONFIG_ARCH_SUPPORTS_MSI is not set 367# CONFIG_ARCH_SUPPORTS_MSI is not set
349# CONFIG_PCCARD is not set 368# CONFIG_PCCARD is not set
350 369
@@ -355,23 +374,20 @@ CONFIG_BINFMT_ELF_FDPIC=y
355CONFIG_BINFMT_FLAT=y 374CONFIG_BINFMT_FLAT=y
356CONFIG_BINFMT_ZFLAT=y 375CONFIG_BINFMT_ZFLAT=y
357# CONFIG_BINFMT_SHARED_FLAT is not set 376# CONFIG_BINFMT_SHARED_FLAT is not set
377# CONFIG_HAVE_AOUT is not set
358# CONFIG_BINFMT_MISC is not set 378# CONFIG_BINFMT_MISC is not set
359 379
360# 380#
361# Power management options 381# Power management options
362# 382#
363# CONFIG_PM is not set 383# CONFIG_PM is not set
364CONFIG_SUSPEND_UP_POSSIBLE=y 384CONFIG_ARCH_SUSPEND_POSSIBLE=y
365# CONFIG_PM_WAKEUP_BY_GPIO is not set 385# CONFIG_PM_WAKEUP_BY_GPIO is not set
366 386
367# 387#
368# CPU Frequency scaling 388# CPU Frequency scaling
369# 389#
370# CONFIG_CPU_FREQ is not set 390# CONFIG_CPU_FREQ is not set
371
372#
373# Networking
374#
375CONFIG_NET=y 391CONFIG_NET=y
376 392
377# 393#
@@ -384,6 +400,7 @@ CONFIG_XFRM=y
384# CONFIG_XFRM_USER is not set 400# CONFIG_XFRM_USER is not set
385# CONFIG_XFRM_SUB_POLICY is not set 401# CONFIG_XFRM_SUB_POLICY is not set
386# CONFIG_XFRM_MIGRATE is not set 402# CONFIG_XFRM_MIGRATE is not set
403# CONFIG_XFRM_STATISTICS is not set
387# CONFIG_NET_KEY is not set 404# CONFIG_NET_KEY is not set
388CONFIG_INET=y 405CONFIG_INET=y
389# CONFIG_IP_MULTICAST is not set 406# CONFIG_IP_MULTICAST is not set
@@ -413,8 +430,6 @@ CONFIG_TCP_CONG_CUBIC=y
413CONFIG_DEFAULT_TCP_CONG="cubic" 430CONFIG_DEFAULT_TCP_CONG="cubic"
414# CONFIG_TCP_MD5SIG is not set 431# CONFIG_TCP_MD5SIG is not set
415# CONFIG_IPV6 is not set 432# CONFIG_IPV6 is not set
416# CONFIG_INET6_XFRM_TUNNEL is not set
417# CONFIG_INET6_TUNNEL is not set
418# CONFIG_NETLABEL is not set 433# CONFIG_NETLABEL is not set
419# CONFIG_NETWORK_SECMARK is not set 434# CONFIG_NETWORK_SECMARK is not set
420# CONFIG_NETFILTER is not set 435# CONFIG_NETFILTER is not set
@@ -423,6 +438,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
423# CONFIG_TIPC is not set 438# CONFIG_TIPC is not set
424# CONFIG_ATM is not set 439# CONFIG_ATM is not set
425# CONFIG_BRIDGE is not set 440# CONFIG_BRIDGE is not set
441# CONFIG_NET_DSA is not set
426# CONFIG_VLAN_8021Q is not set 442# CONFIG_VLAN_8021Q is not set
427# CONFIG_DECNET is not set 443# CONFIG_DECNET is not set
428# CONFIG_LLC2 is not set 444# CONFIG_LLC2 is not set
@@ -439,6 +455,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
439# 455#
440# CONFIG_NET_PKTGEN is not set 456# CONFIG_NET_PKTGEN is not set
441# CONFIG_HAMRADIO is not set 457# CONFIG_HAMRADIO is not set
458# CONFIG_CAN is not set
442CONFIG_IRDA=m 459CONFIG_IRDA=m
443 460
444# 461#
@@ -471,24 +488,14 @@ CONFIG_IRTTY_SIR=m
471# CONFIG_DONGLE is not set 488# CONFIG_DONGLE is not set
472 489
473# 490#
474# Old SIR device drivers
475#
476# CONFIG_IRPORT_SIR is not set
477
478#
479# Old Serial dongle support
480#
481
482#
483# FIR device drivers 491# FIR device drivers
484# 492#
485# CONFIG_BT is not set 493# CONFIG_BT is not set
486# CONFIG_AF_RXRPC is not set 494# CONFIG_AF_RXRPC is not set
487 495# CONFIG_PHONET is not set
488# 496CONFIG_WIRELESS=y
489# Wireless
490#
491# CONFIG_CFG80211 is not set 497# CONFIG_CFG80211 is not set
498CONFIG_WIRELESS_OLD_REGULATORY=y
492# CONFIG_WIRELESS_EXT is not set 499# CONFIG_WIRELESS_EXT is not set
493# CONFIG_MAC80211 is not set 500# CONFIG_MAC80211 is not set
494# CONFIG_IEEE80211 is not set 501# CONFIG_IEEE80211 is not set
@@ -506,6 +513,8 @@ CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
506CONFIG_STANDALONE=y 513CONFIG_STANDALONE=y
507CONFIG_PREVENT_FIRMWARE_BUILD=y 514CONFIG_PREVENT_FIRMWARE_BUILD=y
508# CONFIG_FW_LOADER is not set 515# CONFIG_FW_LOADER is not set
516# CONFIG_DEBUG_DRIVER is not set
517# CONFIG_DEBUG_DEVRES is not set
509# CONFIG_SYS_HYPERVISOR is not set 518# CONFIG_SYS_HYPERVISOR is not set
510# CONFIG_CONNECTOR is not set 519# CONFIG_CONNECTOR is not set
511CONFIG_MTD=y 520CONFIG_MTD=y
@@ -514,6 +523,7 @@ CONFIG_MTD=y
514CONFIG_MTD_PARTITIONS=y 523CONFIG_MTD_PARTITIONS=y
515# CONFIG_MTD_REDBOOT_PARTS is not set 524# CONFIG_MTD_REDBOOT_PARTS is not set
516CONFIG_MTD_CMDLINE_PARTS=y 525CONFIG_MTD_CMDLINE_PARTS=y
526# CONFIG_MTD_AR7_PARTS is not set
517 527
518# 528#
519# User Modules And Translation Layers 529# User Modules And Translation Layers
@@ -595,11 +605,14 @@ CONFIG_BLK_DEV=y
595CONFIG_BLK_DEV_RAM=y 605CONFIG_BLK_DEV_RAM=y
596CONFIG_BLK_DEV_RAM_COUNT=16 606CONFIG_BLK_DEV_RAM_COUNT=16
597CONFIG_BLK_DEV_RAM_SIZE=4096 607CONFIG_BLK_DEV_RAM_SIZE=4096
598CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 608# CONFIG_BLK_DEV_XIP is not set
599# CONFIG_CDROM_PKTCDVD is not set 609# CONFIG_CDROM_PKTCDVD is not set
600# CONFIG_ATA_OVER_ETH is not set 610# CONFIG_ATA_OVER_ETH is not set
611# CONFIG_BLK_DEV_HD is not set
601CONFIG_MISC_DEVICES=y 612CONFIG_MISC_DEVICES=y
602# CONFIG_EEPROM_93CX6 is not set 613# CONFIG_EEPROM_93CX6 is not set
614# CONFIG_ENCLOSURE_SERVICES is not set
615CONFIG_HAVE_IDE=y
603# CONFIG_IDE is not set 616# CONFIG_IDE is not set
604 617
605# 618#
@@ -612,7 +625,6 @@ CONFIG_MISC_DEVICES=y
612# CONFIG_ATA is not set 625# CONFIG_ATA is not set
613# CONFIG_MD is not set 626# CONFIG_MD is not set
614CONFIG_NETDEVICES=y 627CONFIG_NETDEVICES=y
615# CONFIG_NETDEVICES_MULTIQUEUE is not set
616# CONFIG_DUMMY is not set 628# CONFIG_DUMMY is not set
617# CONFIG_BONDING is not set 629# CONFIG_BONDING is not set
618# CONFIG_MACVLAN is not set 630# CONFIG_MACVLAN is not set
@@ -625,11 +637,14 @@ CONFIG_MII=y
625CONFIG_SMC91X=y 637CONFIG_SMC91X=y
626# CONFIG_SMSC911X is not set 638# CONFIG_SMSC911X is not set
627# CONFIG_DM9000 is not set 639# CONFIG_DM9000 is not set
640# CONFIG_ENC28J60 is not set
628# CONFIG_IBM_NEW_EMAC_ZMII is not set 641# CONFIG_IBM_NEW_EMAC_ZMII is not set
629# CONFIG_IBM_NEW_EMAC_RGMII is not set 642# CONFIG_IBM_NEW_EMAC_RGMII is not set
630# CONFIG_IBM_NEW_EMAC_TAH is not set 643# CONFIG_IBM_NEW_EMAC_TAH is not set
631# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 644# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
632# CONFIG_B44 is not set 645# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
646# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
647# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
633CONFIG_NETDEV_1000=y 648CONFIG_NETDEV_1000=y
634# CONFIG_AX88180 is not set 649# CONFIG_AX88180 is not set
635CONFIG_NETDEV_10000=y 650CONFIG_NETDEV_10000=y
@@ -639,10 +654,10 @@ CONFIG_NETDEV_10000=y
639# 654#
640# CONFIG_WLAN_PRE80211 is not set 655# CONFIG_WLAN_PRE80211 is not set
641# CONFIG_WLAN_80211 is not set 656# CONFIG_WLAN_80211 is not set
657# CONFIG_IWLWIFI_LEDS is not set
642# CONFIG_WAN is not set 658# CONFIG_WAN is not set
643# CONFIG_PPP is not set 659# CONFIG_PPP is not set
644# CONFIG_SLIP is not set 660# CONFIG_SLIP is not set
645# CONFIG_SHAPER is not set
646# CONFIG_NETCONSOLE is not set 661# CONFIG_NETCONSOLE is not set
647# CONFIG_NETPOLL is not set 662# CONFIG_NETPOLL is not set
648# CONFIG_NET_POLL_CONTROLLER is not set 663# CONFIG_NET_POLL_CONTROLLER is not set
@@ -690,8 +705,11 @@ CONFIG_INPUT_EVDEV=m
690# CONFIG_BF5xx_PPI is not set 705# CONFIG_BF5xx_PPI is not set
691# CONFIG_BFIN_SPORT is not set 706# CONFIG_BFIN_SPORT is not set
692# CONFIG_BFIN_TIMER_LATENCY is not set 707# CONFIG_BFIN_TIMER_LATENCY is not set
708CONFIG_BFIN_DMA_INTERFACE=m
693CONFIG_SIMPLE_GPIO=m 709CONFIG_SIMPLE_GPIO=m
694# CONFIG_VT is not set 710# CONFIG_VT is not set
711# CONFIG_DEVKMEM is not set
712# CONFIG_BFIN_JTAG_COMM is not set
695# CONFIG_SERIAL_NONSTANDARD is not set 713# CONFIG_SERIAL_NONSTANDARD is not set
696 714
697# 715#
@@ -720,22 +738,19 @@ CONFIG_UNIX98_PTYS=y
720# CONFIG_CAN4LINUX is not set 738# CONFIG_CAN4LINUX is not set
721# CONFIG_IPMI_HANDLER is not set 739# CONFIG_IPMI_HANDLER is not set
722# CONFIG_HW_RANDOM is not set 740# CONFIG_HW_RANDOM is not set
723# CONFIG_GEN_RTC is not set
724# CONFIG_R3964 is not set 741# CONFIG_R3964 is not set
725# CONFIG_RAW_DRIVER is not set 742# CONFIG_RAW_DRIVER is not set
726# CONFIG_TCG_TPM is not set 743# CONFIG_TCG_TPM is not set
727# CONFIG_I2C is not set 744# CONFIG_I2C is not set
728
729#
730# SPI support
731#
732CONFIG_SPI=y 745CONFIG_SPI=y
746# CONFIG_SPI_DEBUG is not set
733CONFIG_SPI_MASTER=y 747CONFIG_SPI_MASTER=y
734 748
735# 749#
736# SPI Master Controller Drivers 750# SPI Master Controller Drivers
737# 751#
738CONFIG_SPI_BFIN=y 752CONFIG_SPI_BFIN=y
753# CONFIG_SPI_BFIN_LOCK is not set
739# CONFIG_SPI_BITBANG is not set 754# CONFIG_SPI_BITBANG is not set
740 755
741# 756#
@@ -744,14 +759,18 @@ CONFIG_SPI_BFIN=y
744# CONFIG_SPI_AT25 is not set 759# CONFIG_SPI_AT25 is not set
745# CONFIG_SPI_SPIDEV is not set 760# CONFIG_SPI_SPIDEV is not set
746# CONFIG_SPI_TLE62X0 is not set 761# CONFIG_SPI_TLE62X0 is not set
762CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
763# CONFIG_GPIOLIB is not set
747# CONFIG_W1 is not set 764# CONFIG_W1 is not set
748# CONFIG_POWER_SUPPLY is not set 765# CONFIG_POWER_SUPPLY is not set
749CONFIG_HWMON=y 766CONFIG_HWMON=y
750# CONFIG_HWMON_VID is not set 767# CONFIG_HWMON_VID is not set
768# CONFIG_SENSORS_ADCXX is not set
751# CONFIG_SENSORS_F71805F is not set 769# CONFIG_SENSORS_F71805F is not set
752# CONFIG_SENSORS_F71882FG is not set 770# CONFIG_SENSORS_F71882FG is not set
753# CONFIG_SENSORS_IT87 is not set 771# CONFIG_SENSORS_IT87 is not set
754# CONFIG_SENSORS_LM70 is not set 772# CONFIG_SENSORS_LM70 is not set
773# CONFIG_SENSORS_MAX1111 is not set
755# CONFIG_SENSORS_PC87360 is not set 774# CONFIG_SENSORS_PC87360 is not set
756# CONFIG_SENSORS_PC87427 is not set 775# CONFIG_SENSORS_PC87427 is not set
757# CONFIG_SENSORS_SMSC47M1 is not set 776# CONFIG_SENSORS_SMSC47M1 is not set
@@ -760,6 +779,8 @@ CONFIG_HWMON=y
760# CONFIG_SENSORS_W83627HF is not set 779# CONFIG_SENSORS_W83627HF is not set
761# CONFIG_SENSORS_W83627EHF is not set 780# CONFIG_SENSORS_W83627EHF is not set
762# CONFIG_HWMON_DEBUG_CHIP is not set 781# CONFIG_HWMON_DEBUG_CHIP is not set
782# CONFIG_THERMAL is not set
783# CONFIG_THERMAL_HWMON is not set
763CONFIG_WATCHDOG=y 784CONFIG_WATCHDOG=y
764# CONFIG_WATCHDOG_NOWAYOUT is not set 785# CONFIG_WATCHDOG_NOWAYOUT is not set
765 786
@@ -770,21 +791,28 @@ CONFIG_WATCHDOG=y
770CONFIG_BFIN_WDT=y 791CONFIG_BFIN_WDT=y
771 792
772# 793#
773# Sonics Silicon Backplane
774#
775CONFIG_SSB_POSSIBLE=y
776# CONFIG_SSB is not set
777
778#
779# Multifunction device drivers 794# Multifunction device drivers
780# 795#
796# CONFIG_MFD_CORE is not set
781# CONFIG_MFD_SM501 is not set 797# CONFIG_MFD_SM501 is not set
798# CONFIG_HTC_PASIC3 is not set
799# CONFIG_MFD_TMIO is not set
800# CONFIG_MFD_WM8400 is not set
782 801
783# 802#
784# Multimedia devices 803# Multimedia devices
785# 804#
805
806#
807# Multimedia core support
808#
786# CONFIG_VIDEO_DEV is not set 809# CONFIG_VIDEO_DEV is not set
787# CONFIG_DVB_CORE is not set 810# CONFIG_DVB_CORE is not set
811# CONFIG_VIDEO_MEDIA is not set
812
813#
814# Multimedia drivers
815#
788# CONFIG_DAB is not set 816# CONFIG_DAB is not set
789 817
790# 818#
@@ -799,43 +827,43 @@ CONFIG_SSB_POSSIBLE=y
799# Display device support 827# Display device support
800# 828#
801# CONFIG_DISPLAY_SUPPORT is not set 829# CONFIG_DISPLAY_SUPPORT is not set
802
803#
804# Sound
805#
806# CONFIG_SOUND is not set 830# CONFIG_SOUND is not set
807CONFIG_HID_SUPPORT=y 831CONFIG_HID_SUPPORT=y
808CONFIG_HID=m 832CONFIG_HID=m
809# CONFIG_HID_DEBUG is not set 833# CONFIG_HID_DEBUG is not set
810# CONFIG_HIDRAW is not set 834# CONFIG_HIDRAW is not set
835# CONFIG_HID_PID is not set
836
837#
838# Special HID drivers
839#
840CONFIG_HID_COMPAT=y
811# CONFIG_USB_SUPPORT is not set 841# CONFIG_USB_SUPPORT is not set
812# CONFIG_MMC is not set 842# CONFIG_MMC is not set
843# CONFIG_MEMSTICK is not set
813# CONFIG_NEW_LEDS is not set 844# CONFIG_NEW_LEDS is not set
845# CONFIG_ACCESSIBILITY is not set
814# CONFIG_RTC_CLASS is not set 846# CONFIG_RTC_CLASS is not set
815 847# CONFIG_DMADEVICES is not set
816#
817# Userspace I/O
818#
819# CONFIG_UIO is not set 848# CONFIG_UIO is not set
849# CONFIG_STAGING is not set
820 850
821# 851#
822# File systems 852# File systems
823# 853#
824# CONFIG_EXT2_FS is not set 854# CONFIG_EXT2_FS is not set
825# CONFIG_EXT3_FS is not set 855# CONFIG_EXT3_FS is not set
826# CONFIG_EXT4DEV_FS is not set 856# CONFIG_EXT4_FS is not set
827# CONFIG_REISERFS_FS is not set 857# CONFIG_REISERFS_FS is not set
828# CONFIG_JFS_FS is not set 858# CONFIG_JFS_FS is not set
829# CONFIG_FS_POSIX_ACL is not set 859# CONFIG_FS_POSIX_ACL is not set
860CONFIG_FILE_LOCKING=y
830# CONFIG_XFS_FS is not set 861# CONFIG_XFS_FS is not set
831# CONFIG_GFS2_FS is not set
832# CONFIG_OCFS2_FS is not set 862# CONFIG_OCFS2_FS is not set
833# CONFIG_MINIX_FS is not set 863# CONFIG_DNOTIFY is not set
834# CONFIG_ROMFS_FS is not set
835CONFIG_INOTIFY=y 864CONFIG_INOTIFY=y
836CONFIG_INOTIFY_USER=y 865CONFIG_INOTIFY_USER=y
837# CONFIG_QUOTA is not set 866# CONFIG_QUOTA is not set
838# CONFIG_DNOTIFY is not set
839# CONFIG_AUTOFS_FS is not set 867# CONFIG_AUTOFS_FS is not set
840# CONFIG_AUTOFS4_FS is not set 868# CONFIG_AUTOFS4_FS is not set
841# CONFIG_FUSE_FS is not set 869# CONFIG_FUSE_FS is not set
@@ -875,11 +903,11 @@ CONFIG_SYSFS=y
875# CONFIG_EFS_FS is not set 903# CONFIG_EFS_FS is not set
876CONFIG_YAFFS_FS=m 904CONFIG_YAFFS_FS=m
877CONFIG_YAFFS_YAFFS1=y 905CONFIG_YAFFS_YAFFS1=y
906# CONFIG_YAFFS_9BYTE_TAGS is not set
878# CONFIG_YAFFS_DOES_ECC is not set 907# CONFIG_YAFFS_DOES_ECC is not set
879CONFIG_YAFFS_YAFFS2=y 908CONFIG_YAFFS_YAFFS2=y
880CONFIG_YAFFS_AUTO_YAFFS2=y 909CONFIG_YAFFS_AUTO_YAFFS2=y
881# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set 910# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
882CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
883# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set 911# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
884# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set 912# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
885CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y 913CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
@@ -896,8 +924,11 @@ CONFIG_JFFS2_RTIME=y
896# CONFIG_JFFS2_RUBIN is not set 924# CONFIG_JFFS2_RUBIN is not set
897# CONFIG_CRAMFS is not set 925# CONFIG_CRAMFS is not set
898# CONFIG_VXFS_FS is not set 926# CONFIG_VXFS_FS is not set
927# CONFIG_MINIX_FS is not set
928# CONFIG_OMFS_FS is not set
899# CONFIG_HPFS_FS is not set 929# CONFIG_HPFS_FS is not set
900# CONFIG_QNX4FS_FS is not set 930# CONFIG_QNX4FS_FS is not set
931# CONFIG_ROMFS_FS is not set
901# CONFIG_SYSV_FS is not set 932# CONFIG_SYSV_FS is not set
902# CONFIG_UFS_FS is not set 933# CONFIG_UFS_FS is not set
903CONFIG_NETWORK_FILESYSTEMS=y 934CONFIG_NETWORK_FILESYSTEMS=y
@@ -905,13 +936,12 @@ CONFIG_NFS_FS=m
905CONFIG_NFS_V3=y 936CONFIG_NFS_V3=y
906# CONFIG_NFS_V3_ACL is not set 937# CONFIG_NFS_V3_ACL is not set
907# CONFIG_NFS_V4 is not set 938# CONFIG_NFS_V4 is not set
908# CONFIG_NFS_DIRECTIO is not set
909# CONFIG_NFSD is not set 939# CONFIG_NFSD is not set
910CONFIG_LOCKD=m 940CONFIG_LOCKD=m
911CONFIG_LOCKD_V4=y 941CONFIG_LOCKD_V4=y
912CONFIG_NFS_COMMON=y 942CONFIG_NFS_COMMON=y
913CONFIG_SUNRPC=m 943CONFIG_SUNRPC=m
914# CONFIG_SUNRPC_BIND34 is not set 944# CONFIG_SUNRPC_REGISTER_V4 is not set
915# CONFIG_RPCSEC_GSS_KRB5 is not set 945# CONFIG_RPCSEC_GSS_KRB5 is not set
916# CONFIG_RPCSEC_GSS_SPKM3 is not set 946# CONFIG_RPCSEC_GSS_SPKM3 is not set
917CONFIG_SMB_FS=m 947CONFIG_SMB_FS=m
@@ -967,9 +997,6 @@ CONFIG_NLS_DEFAULT="iso8859-1"
967# CONFIG_NLS_KOI8_U is not set 997# CONFIG_NLS_KOI8_U is not set
968# CONFIG_NLS_UTF8 is not set 998# CONFIG_NLS_UTF8 is not set
969# CONFIG_DLM is not set 999# CONFIG_DLM is not set
970CONFIG_INSTRUMENTATION=y
971# CONFIG_PROFILING is not set
972# CONFIG_MARKERS is not set
973 1000
974# 1001#
975# Kernel hacking 1002# Kernel hacking
@@ -977,14 +1004,53 @@ CONFIG_INSTRUMENTATION=y
977# CONFIG_PRINTK_TIME is not set 1004# CONFIG_PRINTK_TIME is not set
978CONFIG_ENABLE_WARN_DEPRECATED=y 1005CONFIG_ENABLE_WARN_DEPRECATED=y
979CONFIG_ENABLE_MUST_CHECK=y 1006CONFIG_ENABLE_MUST_CHECK=y
1007CONFIG_FRAME_WARN=1024
980# CONFIG_MAGIC_SYSRQ is not set 1008# CONFIG_MAGIC_SYSRQ is not set
981# CONFIG_UNUSED_SYMBOLS is not set 1009# CONFIG_UNUSED_SYMBOLS is not set
982CONFIG_DEBUG_FS=y 1010CONFIG_DEBUG_FS=y
983# CONFIG_HEADERS_CHECK is not set 1011# CONFIG_HEADERS_CHECK is not set
984# CONFIG_DEBUG_KERNEL is not set 1012CONFIG_DEBUG_KERNEL=y
1013# CONFIG_DEBUG_SHIRQ is not set
1014CONFIG_DETECT_SOFTLOCKUP=y
1015# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
1016CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
1017CONFIG_SCHED_DEBUG=y
1018# CONFIG_SCHEDSTATS is not set
1019# CONFIG_TIMER_STATS is not set
1020# CONFIG_DEBUG_OBJECTS is not set
1021# CONFIG_DEBUG_SLAB is not set
1022# CONFIG_DEBUG_RT_MUTEXES is not set
1023# CONFIG_RT_MUTEX_TESTER is not set
1024# CONFIG_DEBUG_SPINLOCK is not set
1025# CONFIG_DEBUG_MUTEXES is not set
1026# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1027# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1028# CONFIG_DEBUG_KOBJECT is not set
985# CONFIG_DEBUG_BUGVERBOSE is not set 1029# CONFIG_DEBUG_BUGVERBOSE is not set
1030CONFIG_DEBUG_INFO=y
1031# CONFIG_DEBUG_VM is not set
1032# CONFIG_DEBUG_WRITECOUNT is not set
1033# CONFIG_DEBUG_MEMORY_INIT is not set
1034# CONFIG_DEBUG_LIST is not set
1035# CONFIG_DEBUG_SG is not set
1036# CONFIG_FRAME_POINTER is not set
1037# CONFIG_BOOT_PRINTK_DELAY is not set
1038# CONFIG_RCU_TORTURE_TEST is not set
1039# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1040# CONFIG_BACKTRACE_SELF_TEST is not set
1041# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1042# CONFIG_FAULT_INJECTION is not set
1043# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1044# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
986# CONFIG_SAMPLES is not set 1045# CONFIG_SAMPLES is not set
1046CONFIG_HAVE_ARCH_KGDB=y
1047# CONFIG_KGDB is not set
1048# CONFIG_DEBUG_STACKOVERFLOW is not set
1049# CONFIG_DEBUG_STACK_USAGE is not set
1050CONFIG_DEBUG_VERBOSE=y
987CONFIG_DEBUG_MMRS=y 1051CONFIG_DEBUG_MMRS=y
1052# CONFIG_DEBUG_HWERR is not set
1053# CONFIG_DEBUG_DOUBLEFAULT is not set
988CONFIG_DEBUG_HUNT_FOR_ZERO=y 1054CONFIG_DEBUG_HUNT_FOR_ZERO=y
989CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1055CONFIG_DEBUG_BFIN_HWTRACE_ON=y
990CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1056CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
@@ -994,7 +1060,6 @@ CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
994# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set 1060# CONFIG_DEBUG_BFIN_HWTRACE_EXPAND is not set
995# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set 1061# CONFIG_DEBUG_BFIN_NO_KERN_HWTRACE is not set
996CONFIG_EARLY_PRINTK=y 1062CONFIG_EARLY_PRINTK=y
997# CONFIG_DUAL_CORE_TEST_MODULE is not set
998CONFIG_CPLB_INFO=y 1063CONFIG_CPLB_INFO=y
999CONFIG_ACCESS_CHECK=y 1064CONFIG_ACCESS_CHECK=y
1000 1065
@@ -1003,9 +1068,94 @@ CONFIG_ACCESS_CHECK=y
1003# 1068#
1004# CONFIG_KEYS is not set 1069# CONFIG_KEYS is not set
1005CONFIG_SECURITY=y 1070CONFIG_SECURITY=y
1071# CONFIG_SECURITYFS is not set
1006# CONFIG_SECURITY_NETWORK is not set 1072# CONFIG_SECURITY_NETWORK is not set
1007# CONFIG_SECURITY_CAPABILITIES is not set 1073# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1008# CONFIG_CRYPTO is not set 1074CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1075CONFIG_CRYPTO=y
1076
1077#
1078# Crypto core or helper
1079#
1080# CONFIG_CRYPTO_FIPS is not set
1081# CONFIG_CRYPTO_MANAGER is not set
1082# CONFIG_CRYPTO_GF128MUL is not set
1083# CONFIG_CRYPTO_NULL is not set
1084# CONFIG_CRYPTO_CRYPTD is not set
1085# CONFIG_CRYPTO_AUTHENC is not set
1086# CONFIG_CRYPTO_TEST is not set
1087
1088#
1089# Authenticated Encryption with Associated Data
1090#
1091# CONFIG_CRYPTO_CCM is not set
1092# CONFIG_CRYPTO_GCM is not set
1093# CONFIG_CRYPTO_SEQIV is not set
1094
1095#
1096# Block modes
1097#
1098# CONFIG_CRYPTO_CBC is not set
1099# CONFIG_CRYPTO_CTR is not set
1100# CONFIG_CRYPTO_CTS is not set
1101# CONFIG_CRYPTO_ECB is not set
1102# CONFIG_CRYPTO_LRW is not set
1103# CONFIG_CRYPTO_PCBC is not set
1104# CONFIG_CRYPTO_XTS is not set
1105
1106#
1107# Hash modes
1108#
1109# CONFIG_CRYPTO_HMAC is not set
1110# CONFIG_CRYPTO_XCBC is not set
1111
1112#
1113# Digest
1114#
1115# CONFIG_CRYPTO_CRC32C is not set
1116# CONFIG_CRYPTO_MD4 is not set
1117# CONFIG_CRYPTO_MD5 is not set
1118# CONFIG_CRYPTO_MICHAEL_MIC is not set
1119# CONFIG_CRYPTO_RMD128 is not set
1120# CONFIG_CRYPTO_RMD160 is not set
1121# CONFIG_CRYPTO_RMD256 is not set
1122# CONFIG_CRYPTO_RMD320 is not set
1123# CONFIG_CRYPTO_SHA1 is not set
1124# CONFIG_CRYPTO_SHA256 is not set
1125# CONFIG_CRYPTO_SHA512 is not set
1126# CONFIG_CRYPTO_TGR192 is not set
1127# CONFIG_CRYPTO_WP512 is not set
1128
1129#
1130# Ciphers
1131#
1132# CONFIG_CRYPTO_AES is not set
1133# CONFIG_CRYPTO_ANUBIS is not set
1134# CONFIG_CRYPTO_ARC4 is not set
1135# CONFIG_CRYPTO_BLOWFISH is not set
1136# CONFIG_CRYPTO_CAMELLIA is not set
1137# CONFIG_CRYPTO_CAST5 is not set
1138# CONFIG_CRYPTO_CAST6 is not set
1139# CONFIG_CRYPTO_DES is not set
1140# CONFIG_CRYPTO_FCRYPT is not set
1141# CONFIG_CRYPTO_KHAZAD is not set
1142# CONFIG_CRYPTO_SALSA20 is not set
1143# CONFIG_CRYPTO_SEED is not set
1144# CONFIG_CRYPTO_SERPENT is not set
1145# CONFIG_CRYPTO_TEA is not set
1146# CONFIG_CRYPTO_TWOFISH is not set
1147
1148#
1149# Compression
1150#
1151# CONFIG_CRYPTO_DEFLATE is not set
1152# CONFIG_CRYPTO_LZO is not set
1153
1154#
1155# Random Number Generation
1156#
1157# CONFIG_CRYPTO_ANSI_CPRNG is not set
1158CONFIG_CRYPTO_HW=y
1009 1159
1010# 1160#
1011# Library routines 1161# Library routines
@@ -1013,6 +1163,7 @@ CONFIG_SECURITY=y
1013CONFIG_BITREVERSE=y 1163CONFIG_BITREVERSE=y
1014CONFIG_CRC_CCITT=m 1164CONFIG_CRC_CCITT=m
1015# CONFIG_CRC16 is not set 1165# CONFIG_CRC16 is not set
1166# CONFIG_CRC_T10DIF is not set
1016# CONFIG_CRC_ITU_T is not set 1167# CONFIG_CRC_ITU_T is not set
1017CONFIG_CRC32=y 1168CONFIG_CRC32=y
1018# CONFIG_CRC7 is not set 1169# CONFIG_CRC7 is not set
diff --git a/arch/blackfin/configs/BlackStamp_defconfig b/arch/blackfin/configs/BlackStamp_defconfig
index 2921f9952d5f..9683b2e13097 100644
--- a/arch/blackfin/configs/BlackStamp_defconfig
+++ b/arch/blackfin/configs/BlackStamp_defconfig
@@ -53,7 +53,7 @@ CONFIG_KALLSYMS=y
53CONFIG_HOTPLUG=y 53CONFIG_HOTPLUG=y
54CONFIG_PRINTK=y 54CONFIG_PRINTK=y
55CONFIG_BUG=y 55CONFIG_BUG=y
56CONFIG_ELF_CORE=y 56# CONFIG_ELF_CORE is not set
57CONFIG_COMPAT_BRK=y 57CONFIG_COMPAT_BRK=y
58CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 59CONFIG_FUTEX=y
@@ -276,7 +276,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
276CONFIG_ZONE_DMA_FLAG=1 276CONFIG_ZONE_DMA_FLAG=1
277CONFIG_VIRT_TO_BUS=y 277CONFIG_VIRT_TO_BUS=y
278CONFIG_BFIN_GPTIMERS=y 278CONFIG_BFIN_GPTIMERS=y
279CONFIG_BFIN_DMA_5XX=y
280# CONFIG_DMA_UNCACHED_4M is not set 279# CONFIG_DMA_UNCACHED_4M is not set
281# CONFIG_DMA_UNCACHED_2M is not set 280# CONFIG_DMA_UNCACHED_2M is not set
282CONFIG_DMA_UNCACHED_1M=y 281CONFIG_DMA_UNCACHED_1M=y
diff --git a/arch/blackfin/configs/CM-BF527_defconfig b/arch/blackfin/configs/CM-BF527_defconfig
index b6a14635fb91..a041e7eba770 100644
--- a/arch/blackfin/configs/CM-BF527_defconfig
+++ b/arch/blackfin/configs/CM-BF527_defconfig
@@ -42,7 +42,7 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_FAIR_GROUP_SCHED=y 42CONFIG_FAIR_GROUP_SCHED=y
43CONFIG_FAIR_USER_SCHED=y 43CONFIG_FAIR_USER_SCHED=y
44# CONFIG_FAIR_CGROUP_SCHED is not set 44# CONFIG_FAIR_CGROUP_SCHED is not set
45CONFIG_SYSFS_DEPRECATED=y 45# CONFIG_SYSFS_DEPRECATED is not set
46# CONFIG_RELAY is not set 46# CONFIG_RELAY is not set
47CONFIG_BLK_DEV_INITRD=y 47CONFIG_BLK_DEV_INITRD=y
48CONFIG_INITRAMFS_SOURCE="" 48CONFIG_INITRAMFS_SOURCE=""
@@ -56,7 +56,7 @@ CONFIG_KALLSYMS=y
56CONFIG_HOTPLUG=y 56CONFIG_HOTPLUG=y
57CONFIG_PRINTK=y 57CONFIG_PRINTK=y
58CONFIG_BUG=y 58CONFIG_BUG=y
59CONFIG_ELF_CORE=y 59# CONFIG_ELF_CORE is not set
60CONFIG_BASE_FULL=y 60CONFIG_BASE_FULL=y
61CONFIG_FUTEX=y 61CONFIG_FUTEX=y
62CONFIG_ANON_INODES=y 62CONFIG_ANON_INODES=y
@@ -190,14 +190,14 @@ CONFIG_IRQ_MAC_RX=11
190CONFIG_IRQ_PORTH_INTA=11 190CONFIG_IRQ_PORTH_INTA=11
191CONFIG_IRQ_MAC_TX=11 191CONFIG_IRQ_MAC_TX=11
192CONFIG_IRQ_PORTH_INTB=11 192CONFIG_IRQ_PORTH_INTB=11
193CONFIG_IRQ_TMR0=12 193CONFIG_IRQ_TIMER0=12
194CONFIG_IRQ_TMR1=12 194CONFIG_IRQ_TIMER1=12
195CONFIG_IRQ_TMR2=12 195CONFIG_IRQ_TIMER2=12
196CONFIG_IRQ_TMR3=12 196CONFIG_IRQ_TIMER3=12
197CONFIG_IRQ_TMR4=12 197CONFIG_IRQ_TIMER4=12
198CONFIG_IRQ_TMR5=12 198CONFIG_IRQ_TIMER5=12
199CONFIG_IRQ_TMR6=12 199CONFIG_IRQ_TIMER6=12
200CONFIG_IRQ_TMR7=12 200CONFIG_IRQ_TIMER7=12
201CONFIG_IRQ_PORTG_INTA=12 201CONFIG_IRQ_PORTG_INTA=12
202CONFIG_IRQ_PORTG_INTB=12 202CONFIG_IRQ_PORTG_INTB=12
203CONFIG_IRQ_MEM_DMA0=13 203CONFIG_IRQ_MEM_DMA0=13
@@ -292,7 +292,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
292CONFIG_ZONE_DMA_FLAG=1 292CONFIG_ZONE_DMA_FLAG=1
293CONFIG_VIRT_TO_BUS=y 293CONFIG_VIRT_TO_BUS=y
294CONFIG_BFIN_GPTIMERS=y 294CONFIG_BFIN_GPTIMERS=y
295CONFIG_BFIN_DMA_5XX=y
296# CONFIG_DMA_UNCACHED_4M is not set 295# CONFIG_DMA_UNCACHED_4M is not set
297# CONFIG_DMA_UNCACHED_2M is not set 296# CONFIG_DMA_UNCACHED_2M is not set
298CONFIG_DMA_UNCACHED_1M=y 297CONFIG_DMA_UNCACHED_1M=y
@@ -650,6 +649,7 @@ CONFIG_BFIN_OTP=y
650# CONFIG_TWI_LCD is not set 649# CONFIG_TWI_LCD is not set
651CONFIG_SIMPLE_GPIO=m 650CONFIG_SIMPLE_GPIO=m
652# CONFIG_VT is not set 651# CONFIG_VT is not set
652# CONFIG_DEVKMEM is not set
653# CONFIG_SERIAL_NONSTANDARD is not set 653# CONFIG_SERIAL_NONSTANDARD is not set
654 654
655# 655#
@@ -699,7 +699,7 @@ CONFIG_I2C_CHARDEV=m
699# I2C Hardware Bus support 699# I2C Hardware Bus support
700# 700#
701CONFIG_I2C_BLACKFIN_TWI=m 701CONFIG_I2C_BLACKFIN_TWI=m
702CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 702CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
703# CONFIG_I2C_GPIO is not set 703# CONFIG_I2C_GPIO is not set
704# CONFIG_I2C_OCORES is not set 704# CONFIG_I2C_OCORES is not set
705# CONFIG_I2C_PARPORT_LIGHT is not set 705# CONFIG_I2C_PARPORT_LIGHT is not set
diff --git a/arch/blackfin/configs/CM-BF533_defconfig b/arch/blackfin/configs/CM-BF533_defconfig
index c3ba9066b935..085211b9e4e4 100644
--- a/arch/blackfin/configs/CM-BF533_defconfig
+++ b/arch/blackfin/configs/CM-BF533_defconfig
@@ -42,7 +42,7 @@ CONFIG_SYSVIPC_SYSCTL=y
42CONFIG_IKCONFIG=y 42CONFIG_IKCONFIG=y
43CONFIG_IKCONFIG_PROC=y 43CONFIG_IKCONFIG_PROC=y
44CONFIG_LOG_BUF_SHIFT=14 44CONFIG_LOG_BUF_SHIFT=14
45CONFIG_SYSFS_DEPRECATED=y 45# CONFIG_SYSFS_DEPRECATED is not set
46# CONFIG_RELAY is not set 46# CONFIG_RELAY is not set
47# CONFIG_BLK_DEV_INITRD is not set 47# CONFIG_BLK_DEV_INITRD is not set
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -55,7 +55,7 @@ CONFIG_KALLSYMS=y
55# CONFIG_HOTPLUG is not set 55# CONFIG_HOTPLUG is not set
56CONFIG_PRINTK=y 56CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58CONFIG_ELF_CORE=y 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
@@ -254,7 +254,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
254CONFIG_ZONE_DMA_FLAG=1 254CONFIG_ZONE_DMA_FLAG=1
255CONFIG_LARGE_ALLOCS=y 255CONFIG_LARGE_ALLOCS=y
256# CONFIG_BFIN_GPTIMERS is not set 256# CONFIG_BFIN_GPTIMERS is not set
257CONFIG_BFIN_DMA_5XX=y
258# CONFIG_DMA_UNCACHED_2M is not set 257# CONFIG_DMA_UNCACHED_2M is not set
259CONFIG_DMA_UNCACHED_1M=y 258CONFIG_DMA_UNCACHED_1M=y
260# CONFIG_DMA_UNCACHED_NONE is not set 259# CONFIG_DMA_UNCACHED_NONE is not set
@@ -598,6 +597,7 @@ CONFIG_NETDEV_10000=y
598CONFIG_BFIN_SPORT=y 597CONFIG_BFIN_SPORT=y
599# CONFIG_BFIN_TIMER_LATENCY is not set 598# CONFIG_BFIN_TIMER_LATENCY is not set
600# CONFIG_VT is not set 599# CONFIG_VT is not set
600# CONFIG_DEVKMEM is not set
601# CONFIG_SERIAL_NONSTANDARD is not set 601# CONFIG_SERIAL_NONSTANDARD is not set
602 602
603# 603#
diff --git a/arch/blackfin/configs/CM-BF537E_defconfig b/arch/blackfin/configs/CM-BF537E_defconfig
index cdc6b7feb59e..750203e27a46 100644
--- a/arch/blackfin/configs/CM-BF537E_defconfig
+++ b/arch/blackfin/configs/CM-BF537E_defconfig
@@ -42,7 +42,7 @@ CONFIG_SYSVIPC_SYSCTL=y
42CONFIG_IKCONFIG=y 42CONFIG_IKCONFIG=y
43CONFIG_IKCONFIG_PROC=y 43CONFIG_IKCONFIG_PROC=y
44CONFIG_LOG_BUF_SHIFT=14 44CONFIG_LOG_BUF_SHIFT=14
45CONFIG_SYSFS_DEPRECATED=y 45# CONFIG_SYSFS_DEPRECATED is not set
46# CONFIG_RELAY is not set 46# CONFIG_RELAY is not set
47# CONFIG_BLK_DEV_INITRD is not set 47# CONFIG_BLK_DEV_INITRD is not set
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -55,7 +55,7 @@ CONFIG_KALLSYMS=y
55# CONFIG_HOTPLUG is not set 55# CONFIG_HOTPLUG is not set
56CONFIG_PRINTK=y 56CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58CONFIG_ELF_CORE=y 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
@@ -157,14 +157,14 @@ CONFIG_IRQ_UART1_RX=10
157CONFIG_IRQ_UART1_TX=10 157CONFIG_IRQ_UART1_TX=10
158CONFIG_IRQ_MAC_RX=11 158CONFIG_IRQ_MAC_RX=11
159CONFIG_IRQ_MAC_TX=11 159CONFIG_IRQ_MAC_TX=11
160CONFIG_IRQ_TMR0=12 160CONFIG_IRQ_TIMER0=12
161CONFIG_IRQ_TMR1=12 161CONFIG_IRQ_TIMER1=12
162CONFIG_IRQ_TMR2=12 162CONFIG_IRQ_TIMER2=12
163CONFIG_IRQ_TMR3=12 163CONFIG_IRQ_TIMER3=12
164CONFIG_IRQ_TMR4=12 164CONFIG_IRQ_TIMER4=12
165CONFIG_IRQ_TMR5=12 165CONFIG_IRQ_TIMER5=12
166CONFIG_IRQ_TMR6=12 166CONFIG_IRQ_TIMER6=12
167CONFIG_IRQ_TMR7=12 167CONFIG_IRQ_TIMER7=12
168CONFIG_IRQ_PORTG_INTB=12 168CONFIG_IRQ_PORTG_INTB=12
169CONFIG_IRQ_MEM_DMA0=13 169CONFIG_IRQ_MEM_DMA0=13
170CONFIG_IRQ_MEM_DMA1=13 170CONFIG_IRQ_MEM_DMA1=13
@@ -262,7 +262,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
262CONFIG_ZONE_DMA_FLAG=1 262CONFIG_ZONE_DMA_FLAG=1
263CONFIG_LARGE_ALLOCS=y 263CONFIG_LARGE_ALLOCS=y
264# CONFIG_BFIN_GPTIMERS is not set 264# CONFIG_BFIN_GPTIMERS is not set
265CONFIG_BFIN_DMA_5XX=y
266# CONFIG_DMA_UNCACHED_2M is not set 265# CONFIG_DMA_UNCACHED_2M is not set
267CONFIG_DMA_UNCACHED_1M=y 266CONFIG_DMA_UNCACHED_1M=y
268# CONFIG_DMA_UNCACHED_NONE is not set 267# CONFIG_DMA_UNCACHED_NONE is not set
@@ -627,6 +626,7 @@ CONFIG_NETDEV_10000=y
627CONFIG_BFIN_SPORT=y 626CONFIG_BFIN_SPORT=y
628# CONFIG_BFIN_TIMER_LATENCY is not set 627# CONFIG_BFIN_TIMER_LATENCY is not set
629# CONFIG_VT is not set 628# CONFIG_VT is not set
629# CONFIG_DEVKMEM is not set
630# CONFIG_SERIAL_NONSTANDARD is not set 630# CONFIG_SERIAL_NONSTANDARD is not set
631 631
632# 632#
diff --git a/arch/blackfin/configs/CM-BF537U_defconfig b/arch/blackfin/configs/CM-BF537U_defconfig
index f074bdcd1ce5..dec8a7d5cc0e 100644
--- a/arch/blackfin/configs/CM-BF537U_defconfig
+++ b/arch/blackfin/configs/CM-BF537U_defconfig
@@ -42,7 +42,7 @@ CONFIG_SYSVIPC_SYSCTL=y
42CONFIG_IKCONFIG=y 42CONFIG_IKCONFIG=y
43CONFIG_IKCONFIG_PROC=y 43CONFIG_IKCONFIG_PROC=y
44CONFIG_LOG_BUF_SHIFT=14 44CONFIG_LOG_BUF_SHIFT=14
45CONFIG_SYSFS_DEPRECATED=y 45# CONFIG_SYSFS_DEPRECATED is not set
46# CONFIG_RELAY is not set 46# CONFIG_RELAY is not set
47# CONFIG_BLK_DEV_INITRD is not set 47# CONFIG_BLK_DEV_INITRD is not set
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -55,7 +55,7 @@ CONFIG_KALLSYMS=y
55# CONFIG_HOTPLUG is not set 55# CONFIG_HOTPLUG is not set
56CONFIG_PRINTK=y 56CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58CONFIG_ELF_CORE=y 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
@@ -157,14 +157,14 @@ CONFIG_IRQ_UART1_RX=10
157CONFIG_IRQ_UART1_TX=10 157CONFIG_IRQ_UART1_TX=10
158CONFIG_IRQ_MAC_RX=11 158CONFIG_IRQ_MAC_RX=11
159CONFIG_IRQ_MAC_TX=11 159CONFIG_IRQ_MAC_TX=11
160CONFIG_IRQ_TMR0=12 160CONFIG_IRQ_TIMER0=12
161CONFIG_IRQ_TMR1=12 161CONFIG_IRQ_TIMER1=12
162CONFIG_IRQ_TMR2=12 162CONFIG_IRQ_TIMER2=12
163CONFIG_IRQ_TMR3=12 163CONFIG_IRQ_TIMER3=12
164CONFIG_IRQ_TMR4=12 164CONFIG_IRQ_TIMER4=12
165CONFIG_IRQ_TMR5=12 165CONFIG_IRQ_TIMER5=12
166CONFIG_IRQ_TMR6=12 166CONFIG_IRQ_TIMER6=12
167CONFIG_IRQ_TMR7=12 167CONFIG_IRQ_TIMER7=12
168CONFIG_IRQ_PORTG_INTB=12 168CONFIG_IRQ_PORTG_INTB=12
169CONFIG_IRQ_MEM_DMA0=13 169CONFIG_IRQ_MEM_DMA0=13
170CONFIG_IRQ_MEM_DMA1=13 170CONFIG_IRQ_MEM_DMA1=13
@@ -262,7 +262,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
262CONFIG_ZONE_DMA_FLAG=1 262CONFIG_ZONE_DMA_FLAG=1
263CONFIG_LARGE_ALLOCS=y 263CONFIG_LARGE_ALLOCS=y
264# CONFIG_BFIN_GPTIMERS is not set 264# CONFIG_BFIN_GPTIMERS is not set
265CONFIG_BFIN_DMA_5XX=y
266# CONFIG_DMA_UNCACHED_2M is not set 265# CONFIG_DMA_UNCACHED_2M is not set
267CONFIG_DMA_UNCACHED_1M=y 266CONFIG_DMA_UNCACHED_1M=y
268# CONFIG_DMA_UNCACHED_NONE is not set 267# CONFIG_DMA_UNCACHED_NONE is not set
@@ -607,6 +606,7 @@ CONFIG_NETDEV_10000=y
607CONFIG_BFIN_SPORT=y 606CONFIG_BFIN_SPORT=y
608# CONFIG_BFIN_TIMER_LATENCY is not set 607# CONFIG_BFIN_TIMER_LATENCY is not set
609# CONFIG_VT is not set 608# CONFIG_VT is not set
609# CONFIG_DEVKMEM is not set
610# CONFIG_SERIAL_NONSTANDARD is not set 610# CONFIG_SERIAL_NONSTANDARD is not set
611 611
612# 612#
diff --git a/arch/blackfin/configs/CM-BF548_defconfig b/arch/blackfin/configs/CM-BF548_defconfig
index 5c44fdb8e6e3..efd68bc78f35 100644
--- a/arch/blackfin/configs/CM-BF548_defconfig
+++ b/arch/blackfin/configs/CM-BF548_defconfig
@@ -41,7 +41,7 @@ CONFIG_LOG_BUF_SHIFT=14
41CONFIG_FAIR_GROUP_SCHED=y 41CONFIG_FAIR_GROUP_SCHED=y
42CONFIG_FAIR_USER_SCHED=y 42CONFIG_FAIR_USER_SCHED=y
43# CONFIG_FAIR_CGROUP_SCHED is not set 43# CONFIG_FAIR_CGROUP_SCHED is not set
44CONFIG_SYSFS_DEPRECATED=y 44# CONFIG_SYSFS_DEPRECATED is not set
45# CONFIG_RELAY is not set 45# CONFIG_RELAY is not set
46CONFIG_BLK_DEV_INITRD=y 46CONFIG_BLK_DEV_INITRD=y
47CONFIG_INITRAMFS_SOURCE="" 47CONFIG_INITRAMFS_SOURCE=""
@@ -55,7 +55,7 @@ CONFIG_KALLSYMS=y
55CONFIG_HOTPLUG=y 55CONFIG_HOTPLUG=y
56CONFIG_PRINTK=y 56CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58CONFIG_ELF_CORE=y 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
@@ -325,7 +325,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
325CONFIG_ZONE_DMA_FLAG=1 325CONFIG_ZONE_DMA_FLAG=1
326CONFIG_VIRT_TO_BUS=y 326CONFIG_VIRT_TO_BUS=y
327# CONFIG_BFIN_GPTIMERS is not set 327# CONFIG_BFIN_GPTIMERS is not set
328CONFIG_BFIN_DMA_5XX=y
329# CONFIG_DMA_UNCACHED_2M is not set 328# CONFIG_DMA_UNCACHED_2M is not set
330CONFIG_DMA_UNCACHED_1M=y 329CONFIG_DMA_UNCACHED_1M=y
331# CONFIG_DMA_UNCACHED_NONE is not set 330# CONFIG_DMA_UNCACHED_NONE is not set
@@ -544,7 +543,7 @@ CONFIG_MTD_RAM=y
544CONFIG_MTD_COMPLEX_MAPPINGS=y 543CONFIG_MTD_COMPLEX_MAPPINGS=y
545CONFIG_MTD_PHYSMAP=y 544CONFIG_MTD_PHYSMAP=y
546CONFIG_MTD_PHYSMAP_START=0x20000000 545CONFIG_MTD_PHYSMAP_START=0x20000000
547CONFIG_MTD_PHYSMAP_LEN=0x800000 546CONFIG_MTD_PHYSMAP_LEN=0
548CONFIG_MTD_PHYSMAP_BANKWIDTH=2 547CONFIG_MTD_PHYSMAP_BANKWIDTH=2
549# CONFIG_MTD_UCLINUX is not set 548# CONFIG_MTD_UCLINUX is not set
550# CONFIG_MTD_PLATRAM is not set 549# CONFIG_MTD_PLATRAM is not set
@@ -732,6 +731,7 @@ CONFIG_BFIN_OTP=y
732# CONFIG_TWI_LCD is not set 731# CONFIG_TWI_LCD is not set
733# CONFIG_SIMPLE_GPIO is not set 732# CONFIG_SIMPLE_GPIO is not set
734# CONFIG_VT is not set 733# CONFIG_VT is not set
734# CONFIG_DEVKMEM is not set
735# CONFIG_SERIAL_NONSTANDARD is not set 735# CONFIG_SERIAL_NONSTANDARD is not set
736 736
737# 737#
@@ -782,7 +782,7 @@ CONFIG_I2C_CHARDEV=y
782# I2C Hardware Bus support 782# I2C Hardware Bus support
783# 783#
784CONFIG_I2C_BLACKFIN_TWI=y 784CONFIG_I2C_BLACKFIN_TWI=y
785CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 785CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
786# CONFIG_I2C_GPIO is not set 786# CONFIG_I2C_GPIO is not set
787# CONFIG_I2C_OCORES is not set 787# CONFIG_I2C_OCORES is not set
788# CONFIG_I2C_PARPORT_LIGHT is not set 788# CONFIG_I2C_PARPORT_LIGHT is not set
diff --git a/arch/blackfin/configs/CM-BF561_defconfig b/arch/blackfin/configs/CM-BF561_defconfig
index 086fe5dda495..346bc7af8f42 100644
--- a/arch/blackfin/configs/CM-BF561_defconfig
+++ b/arch/blackfin/configs/CM-BF561_defconfig
@@ -42,7 +42,7 @@ CONFIG_LOG_BUF_SHIFT=14
42CONFIG_FAIR_GROUP_SCHED=y 42CONFIG_FAIR_GROUP_SCHED=y
43CONFIG_FAIR_USER_SCHED=y 43CONFIG_FAIR_USER_SCHED=y
44# CONFIG_FAIR_CGROUP_SCHED is not set 44# CONFIG_FAIR_CGROUP_SCHED is not set
45CONFIG_SYSFS_DEPRECATED=y 45# CONFIG_SYSFS_DEPRECATED is not set
46# CONFIG_RELAY is not set 46# CONFIG_RELAY is not set
47# CONFIG_BLK_DEV_INITRD is not set 47# CONFIG_BLK_DEV_INITRD is not set
48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 48# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
@@ -55,7 +55,7 @@ CONFIG_KALLSYMS=y
55# CONFIG_HOTPLUG is not set 55# CONFIG_HOTPLUG is not set
56CONFIG_PRINTK=y 56CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58CONFIG_ELF_CORE=y 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
@@ -300,7 +300,6 @@ CONFIG_ZONE_DMA_FLAG=1
300CONFIG_VIRT_TO_BUS=y 300CONFIG_VIRT_TO_BUS=y
301CONFIG_LARGE_ALLOCS=y 301CONFIG_LARGE_ALLOCS=y
302# CONFIG_BFIN_GPTIMERS is not set 302# CONFIG_BFIN_GPTIMERS is not set
303CONFIG_BFIN_DMA_5XX=y
304# CONFIG_DMA_UNCACHED_2M is not set 303# CONFIG_DMA_UNCACHED_2M is not set
305CONFIG_DMA_UNCACHED_1M=y 304CONFIG_DMA_UNCACHED_1M=y
306# CONFIG_DMA_UNCACHED_NONE is not set 305# CONFIG_DMA_UNCACHED_NONE is not set
@@ -612,6 +611,7 @@ CONFIG_NETDEV_10000=y
612# CONFIG_BFIN_TIMER_LATENCY is not set 611# CONFIG_BFIN_TIMER_LATENCY is not set
613# CONFIG_SIMPLE_GPIO is not set 612# CONFIG_SIMPLE_GPIO is not set
614# CONFIG_VT is not set 613# CONFIG_VT is not set
614# CONFIG_DEVKMEM is not set
615# CONFIG_SERIAL_NONSTANDARD is not set 615# CONFIG_SERIAL_NONSTANDARD is not set
616 616
617# 617#
diff --git a/arch/blackfin/configs/H8606_defconfig b/arch/blackfin/configs/H8606_defconfig
index 1fc31f1b762b..5d3901d23fd1 100644
--- a/arch/blackfin/configs/H8606_defconfig
+++ b/arch/blackfin/configs/H8606_defconfig
@@ -54,7 +54,7 @@ CONFIG_KALLSYMS=y
54CONFIG_HOTPLUG=y 54CONFIG_HOTPLUG=y
55CONFIG_PRINTK=y 55CONFIG_PRINTK=y
56CONFIG_BUG=y 56CONFIG_BUG=y
57CONFIG_ELF_CORE=y 57# CONFIG_ELF_CORE is not set
58CONFIG_BASE_FULL=y 58CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 59CONFIG_FUTEX=y
60CONFIG_ANON_INODES=y 60CONFIG_ANON_INODES=y
@@ -250,7 +250,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
250CONFIG_ZONE_DMA_FLAG=1 250CONFIG_ZONE_DMA_FLAG=1
251CONFIG_LARGE_ALLOCS=y 251CONFIG_LARGE_ALLOCS=y
252CONFIG_BFIN_GPTIMERS=y 252CONFIG_BFIN_GPTIMERS=y
253CONFIG_BFIN_DMA_5XX=y
254# CONFIG_DMA_UNCACHED_2M is not set 253# CONFIG_DMA_UNCACHED_2M is not set
255CONFIG_DMA_UNCACHED_1M=y 254CONFIG_DMA_UNCACHED_1M=y
256# CONFIG_DMA_UNCACHED_NONE is not set 255# CONFIG_DMA_UNCACHED_NONE is not set
diff --git a/arch/blackfin/configs/IP0X_defconfig b/arch/blackfin/configs/IP0X_defconfig
index 285d2241df26..e66f5daaa828 100644
--- a/arch/blackfin/configs/IP0X_defconfig
+++ b/arch/blackfin/configs/IP0X_defconfig
@@ -55,7 +55,7 @@ CONFIG_KALLSYMS=y
55# CONFIG_HOTPLUG is not set 55# CONFIG_HOTPLUG is not set
56CONFIG_PRINTK=y 56CONFIG_PRINTK=y
57CONFIG_BUG=y 57CONFIG_BUG=y
58CONFIG_ELF_CORE=y 58# CONFIG_ELF_CORE is not set
59CONFIG_BASE_FULL=y 59CONFIG_BASE_FULL=y
60CONFIG_FUTEX=y 60CONFIG_FUTEX=y
61CONFIG_ANON_INODES=y 61CONFIG_ANON_INODES=y
@@ -262,7 +262,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
262CONFIG_ZONE_DMA_FLAG=1 262CONFIG_ZONE_DMA_FLAG=1
263CONFIG_LARGE_ALLOCS=y 263CONFIG_LARGE_ALLOCS=y
264# CONFIG_BFIN_GPTIMERS is not set 264# CONFIG_BFIN_GPTIMERS is not set
265CONFIG_BFIN_DMA_5XX=y
266# CONFIG_DMA_UNCACHED_2M is not set 265# CONFIG_DMA_UNCACHED_2M is not set
267CONFIG_DMA_UNCACHED_1M=y 266CONFIG_DMA_UNCACHED_1M=y
268# CONFIG_DMA_UNCACHED_NONE is not set 267# CONFIG_DMA_UNCACHED_NONE is not set
diff --git a/arch/blackfin/configs/PNAV-10_defconfig b/arch/blackfin/configs/PNAV-10_defconfig
index bffca7de65d4..ce5dde9de9db 100644
--- a/arch/blackfin/configs/PNAV-10_defconfig
+++ b/arch/blackfin/configs/PNAV-10_defconfig
@@ -1,6 +1,6 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.22.12 3# Linux kernel version: 2.6.28-rc2
4# 4#
5# CONFIG_MMU is not set 5# CONFIG_MMU is not set
6# CONFIG_FPU is not set 6# CONFIG_FPU is not set
@@ -8,41 +8,37 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 8# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
9CONFIG_BLACKFIN=y 9CONFIG_BLACKFIN=y
10CONFIG_ZONE_DMA=y 10CONFIG_ZONE_DMA=y
11CONFIG_SEMAPHORE_SLEEPERS=y
12CONFIG_GENERIC_FIND_NEXT_BIT=y 11CONFIG_GENERIC_FIND_NEXT_BIT=y
13CONFIG_GENERIC_HWEIGHT=y 12CONFIG_GENERIC_HWEIGHT=y
14CONFIG_GENERIC_HARDIRQS=y 13CONFIG_GENERIC_HARDIRQS=y
15CONFIG_GENERIC_IRQ_PROBE=y 14CONFIG_GENERIC_IRQ_PROBE=y
16CONFIG_GENERIC_TIME=y
17CONFIG_GENERIC_GPIO=y 15CONFIG_GENERIC_GPIO=y
18CONFIG_FORCE_MAX_ZONEORDER=14 16CONFIG_FORCE_MAX_ZONEORDER=14
19CONFIG_GENERIC_CALIBRATE_DELAY=y 17CONFIG_GENERIC_CALIBRATE_DELAY=y
20CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 18CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
21 19
22# 20#
23# Code maturity level options 21# General setup
24# 22#
25CONFIG_EXPERIMENTAL=y 23CONFIG_EXPERIMENTAL=y
26CONFIG_BROKEN_ON_SMP=y 24CONFIG_BROKEN_ON_SMP=y
27CONFIG_INIT_ENV_ARG_LIMIT=32 25CONFIG_INIT_ENV_ARG_LIMIT=32
28
29#
30# General setup
31#
32CONFIG_LOCALVERSION="" 26CONFIG_LOCALVERSION=""
33CONFIG_LOCALVERSION_AUTO=y 27CONFIG_LOCALVERSION_AUTO=y
34CONFIG_SYSVIPC=y 28CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set
36CONFIG_SYSVIPC_SYSCTL=y 29CONFIG_SYSVIPC_SYSCTL=y
37# CONFIG_POSIX_MQUEUE is not set 30# CONFIG_POSIX_MQUEUE is not set
38# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
39# CONFIG_TASKSTATS is not set 32# CONFIG_TASKSTATS is not set
40# CONFIG_UTS_NS is not set
41# CONFIG_AUDIT is not set 33# CONFIG_AUDIT is not set
42# CONFIG_IKCONFIG is not set 34# CONFIG_IKCONFIG is not set
43CONFIG_LOG_BUF_SHIFT=14 35CONFIG_LOG_BUF_SHIFT=14
44CONFIG_SYSFS_DEPRECATED=y 36# CONFIG_CGROUPS is not set
37# CONFIG_GROUP_SCHED is not set
38# CONFIG_SYSFS_DEPRECATED is not set
39# CONFIG_SYSFS_DEPRECATED_V2 is not set
45# CONFIG_RELAY is not set 40# CONFIG_RELAY is not set
41# CONFIG_NAMESPACES is not set
46# CONFIG_BLK_DEV_INITRD is not set 42# CONFIG_BLK_DEV_INITRD is not set
47# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 43# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
48CONFIG_SYSCTL=y 44CONFIG_SYSCTL=y
@@ -54,40 +50,41 @@ CONFIG_KALLSYMS=y
54CONFIG_HOTPLUG=y 50CONFIG_HOTPLUG=y
55CONFIG_PRINTK=y 51CONFIG_PRINTK=y
56CONFIG_BUG=y 52CONFIG_BUG=y
57CONFIG_ELF_CORE=y 53# CONFIG_ELF_CORE is not set
54CONFIG_COMPAT_BRK=y
58CONFIG_BASE_FULL=y 55CONFIG_BASE_FULL=y
59CONFIG_FUTEX=y 56CONFIG_FUTEX=y
60CONFIG_ANON_INODES=y 57CONFIG_ANON_INODES=y
61CONFIG_EPOLL=y 58CONFIG_EPOLL=y
62CONFIG_SIGNALFD=y 59CONFIG_SIGNALFD=y
60CONFIG_TIMERFD=y
63CONFIG_EVENTFD=y 61CONFIG_EVENTFD=y
62CONFIG_AIO=y
64CONFIG_VM_EVENT_COUNTERS=y 63CONFIG_VM_EVENT_COUNTERS=y
65CONFIG_BIG_ORDER_ALLOC_NOFAIL_MAGIC=9
66# CONFIG_NP2 is not set
67CONFIG_SLAB=y 64CONFIG_SLAB=y
68# CONFIG_SLUB is not set 65# CONFIG_SLUB is not set
69# CONFIG_SLOB is not set 66# CONFIG_SLOB is not set
67# CONFIG_PROFILING is not set
68# CONFIG_MARKERS is not set
69CONFIG_HAVE_OPROFILE=y
70# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
71CONFIG_SLABINFO=y
70CONFIG_RT_MUTEXES=y 72CONFIG_RT_MUTEXES=y
71CONFIG_TINY_SHMEM=y 73CONFIG_TINY_SHMEM=y
72CONFIG_BASE_SMALL=0 74CONFIG_BASE_SMALL=0
73
74#
75# Loadable module support
76#
77CONFIG_MODULES=y 75CONFIG_MODULES=y
76# CONFIG_MODULE_FORCE_LOAD is not set
78CONFIG_MODULE_UNLOAD=y 77CONFIG_MODULE_UNLOAD=y
79# CONFIG_MODULE_FORCE_UNLOAD is not set 78# CONFIG_MODULE_FORCE_UNLOAD is not set
80# CONFIG_MODVERSIONS is not set 79# CONFIG_MODVERSIONS is not set
81# CONFIG_MODULE_SRCVERSION_ALL is not set 80# CONFIG_MODULE_SRCVERSION_ALL is not set
82CONFIG_KMOD=y 81CONFIG_KMOD=y
83
84#
85# Block layer
86#
87CONFIG_BLOCK=y 82CONFIG_BLOCK=y
88# CONFIG_LBD is not set 83# CONFIG_LBD is not set
89# CONFIG_BLK_DEV_IO_TRACE is not set 84# CONFIG_BLK_DEV_IO_TRACE is not set
90# CONFIG_LSF is not set 85# CONFIG_LSF is not set
86# CONFIG_BLK_DEV_BSG is not set
87# CONFIG_BLK_DEV_INTEGRITY is not set
91 88
92# 89#
93# IO Schedulers 90# IO Schedulers
@@ -101,9 +98,11 @@ CONFIG_DEFAULT_AS=y
101# CONFIG_DEFAULT_CFQ is not set 98# CONFIG_DEFAULT_CFQ is not set
102# CONFIG_DEFAULT_NOOP is not set 99# CONFIG_DEFAULT_NOOP is not set
103CONFIG_DEFAULT_IOSCHED="anticipatory" 100CONFIG_DEFAULT_IOSCHED="anticipatory"
101CONFIG_CLASSIC_RCU=y
104# CONFIG_PREEMPT_NONE is not set 102# CONFIG_PREEMPT_NONE is not set
105CONFIG_PREEMPT_VOLUNTARY=y 103CONFIG_PREEMPT_VOLUNTARY=y
106# CONFIG_PREEMPT is not set 104# CONFIG_PREEMPT is not set
105# CONFIG_FREEZER is not set
107 106
108# 107#
109# Blackfin Processor Options 108# Blackfin Processor Options
@@ -112,8 +111,15 @@ CONFIG_PREEMPT_VOLUNTARY=y
112# 111#
113# Processor and Board Settings 112# Processor and Board Settings
114# 113#
114# CONFIG_BF512 is not set
115# CONFIG_BF514 is not set
116# CONFIG_BF516 is not set
117# CONFIG_BF518 is not set
115# CONFIG_BF522 is not set 118# CONFIG_BF522 is not set
119# CONFIG_BF523 is not set
120# CONFIG_BF524 is not set
116# CONFIG_BF525 is not set 121# CONFIG_BF525 is not set
122# CONFIG_BF526 is not set
117# CONFIG_BF527 is not set 123# CONFIG_BF527 is not set
118# CONFIG_BF531 is not set 124# CONFIG_BF531 is not set
119# CONFIG_BF532 is not set 125# CONFIG_BF532 is not set
@@ -121,22 +127,26 @@ CONFIG_PREEMPT_VOLUNTARY=y
121# CONFIG_BF534 is not set 127# CONFIG_BF534 is not set
122# CONFIG_BF536 is not set 128# CONFIG_BF536 is not set
123CONFIG_BF537=y 129CONFIG_BF537=y
130# CONFIG_BF538 is not set
131# CONFIG_BF539 is not set
124# CONFIG_BF542 is not set 132# CONFIG_BF542 is not set
125# CONFIG_BF544 is not set 133# CONFIG_BF544 is not set
126# CONFIG_BF547 is not set 134# CONFIG_BF547 is not set
127# CONFIG_BF548 is not set 135# CONFIG_BF548 is not set
128# CONFIG_BF549 is not set 136# CONFIG_BF549 is not set
129# CONFIG_BF561 is not set 137# CONFIG_BF561 is not set
138CONFIG_BF_REV_MIN=2
139CONFIG_BF_REV_MAX=3
130# CONFIG_BF_REV_0_0 is not set 140# CONFIG_BF_REV_0_0 is not set
131# CONFIG_BF_REV_0_1 is not set 141# CONFIG_BF_REV_0_1 is not set
132CONFIG_BF_REV_0_2=y 142CONFIG_BF_REV_0_2=y
133# CONFIG_BF_REV_0_3 is not set 143# CONFIG_BF_REV_0_3 is not set
134# CONFIG_BF_REV_0_4 is not set 144# CONFIG_BF_REV_0_4 is not set
135# CONFIG_BF_REV_0_5 is not set 145# CONFIG_BF_REV_0_5 is not set
146# CONFIG_BF_REV_0_6 is not set
136# CONFIG_BF_REV_ANY is not set 147# CONFIG_BF_REV_ANY is not set
137# CONFIG_BF_REV_NONE is not set 148# CONFIG_BF_REV_NONE is not set
138CONFIG_BF53x=y 149CONFIG_BF53x=y
139CONFIG_BFIN_SINGLE_CORE=y
140CONFIG_MEM_MT48LC32M8A2_75=y 150CONFIG_MEM_MT48LC32M8A2_75=y
141CONFIG_IRQ_PLL_WAKEUP=7 151CONFIG_IRQ_PLL_WAKEUP=7
142CONFIG_IRQ_RTC=8 152CONFIG_IRQ_RTC=8
@@ -146,28 +156,30 @@ CONFIG_IRQ_SPORT0_TX=9
146CONFIG_IRQ_SPORT1_RX=9 156CONFIG_IRQ_SPORT1_RX=9
147CONFIG_IRQ_SPORT1_TX=9 157CONFIG_IRQ_SPORT1_TX=9
148CONFIG_IRQ_TWI=10 158CONFIG_IRQ_TWI=10
149CONFIG_IRQ_SPI=10
150CONFIG_IRQ_UART0_RX=10 159CONFIG_IRQ_UART0_RX=10
151CONFIG_IRQ_UART0_TX=10 160CONFIG_IRQ_UART0_TX=10
152CONFIG_IRQ_UART1_RX=10 161CONFIG_IRQ_UART1_RX=10
153CONFIG_IRQ_UART1_TX=10 162CONFIG_IRQ_UART1_TX=10
154CONFIG_IRQ_MAC_RX=11 163CONFIG_IRQ_MAC_RX=11
155CONFIG_IRQ_MAC_TX=11 164CONFIG_IRQ_MAC_TX=11
156CONFIG_IRQ_TMR0=12 165CONFIG_IRQ_TIMER0=12
157CONFIG_IRQ_TMR1=12 166CONFIG_IRQ_TIMER1=12
158CONFIG_IRQ_TMR2=12 167CONFIG_IRQ_TIMER2=12
159CONFIG_IRQ_TMR3=12 168CONFIG_IRQ_TIMER3=12
160CONFIG_IRQ_TMR4=12 169CONFIG_IRQ_TIMER4=12
161CONFIG_IRQ_TMR5=12 170CONFIG_IRQ_TIMER5=12
162CONFIG_IRQ_TMR6=12 171CONFIG_IRQ_TIMER6=12
163CONFIG_IRQ_TMR7=12 172CONFIG_IRQ_TIMER7=12
164CONFIG_IRQ_PORTG_INTB=12 173CONFIG_IRQ_PORTG_INTB=12
165CONFIG_IRQ_MEM_DMA0=13 174CONFIG_IRQ_MEM_DMA0=13
166CONFIG_IRQ_MEM_DMA1=13 175CONFIG_IRQ_MEM_DMA1=13
167CONFIG_IRQ_WATCH=13 176CONFIG_IRQ_WATCH=13
177CONFIG_IRQ_SPI=10
168# CONFIG_BFIN537_STAMP is not set 178# CONFIG_BFIN537_STAMP is not set
169# CONFIG_BFIN537_BLUETECHNIX_CM is not set 179# CONFIG_BFIN537_BLUETECHNIX_CM is not set
180# CONFIG_BFIN537_BLUETECHNIX_TCM is not set
170CONFIG_PNAV10=y 181CONFIG_PNAV10=y
182# CONFIG_CAMSIG_MINOTAUR is not set
171# CONFIG_GENERIC_BF537_BOARD is not set 183# CONFIG_GENERIC_BF537_BOARD is not set
172 184
173# 185#
@@ -191,6 +203,7 @@ CONFIG_IRQ_PROG_INTA=12
191# Board customizations 203# Board customizations
192# 204#
193# CONFIG_CMDLINE_BOOL is not set 205# CONFIG_CMDLINE_BOOL is not set
206CONFIG_BOOT_LOAD=0x1000
194 207
195# 208#
196# Clock/PLL Setup 209# Clock/PLL Setup
@@ -199,7 +212,7 @@ CONFIG_CLKIN_HZ=24576000
199# CONFIG_BFIN_KERNEL_CLOCK is not set 212# CONFIG_BFIN_KERNEL_CLOCK is not set
200CONFIG_MAX_VCO_HZ=600000000 213CONFIG_MAX_VCO_HZ=600000000
201CONFIG_MIN_VCO_HZ=50000000 214CONFIG_MIN_VCO_HZ=50000000
202CONFIG_MAX_SCLK_HZ=133000000 215CONFIG_MAX_SCLK_HZ=133333333
203CONFIG_MIN_SCLK_HZ=27000000 216CONFIG_MIN_SCLK_HZ=27000000
204 217
205# 218#
@@ -210,13 +223,17 @@ CONFIG_HZ_250=y
210# CONFIG_HZ_300 is not set 223# CONFIG_HZ_300 is not set
211# CONFIG_HZ_1000 is not set 224# CONFIG_HZ_1000 is not set
212CONFIG_HZ=250 225CONFIG_HZ=250
226# CONFIG_SCHED_HRTICK is not set
227CONFIG_GENERIC_TIME=y
228CONFIG_GENERIC_CLOCKEVENTS=y
229# CONFIG_CYCLES_CLOCKSOURCE is not set
230# CONFIG_NO_HZ is not set
231# CONFIG_HIGH_RES_TIMERS is not set
232CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
213 233
214# 234#
215# Memory Setup 235# Misc
216# 236#
217CONFIG_MAX_MEM_SIZE=64
218CONFIG_MEM_ADD_WIDTH=10
219CONFIG_BOOT_LOAD=0x1000
220CONFIG_BFIN_SCRATCH_REG_RETN=y 237CONFIG_BFIN_SCRATCH_REG_RETN=y
221# CONFIG_BFIN_SCRATCH_REG_RETE is not set 238# CONFIG_BFIN_SCRATCH_REG_RETE is not set
222# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set 239# CONFIG_BFIN_SCRATCH_REG_CYCLES is not set
@@ -243,6 +260,12 @@ CONFIG_IP_CHECKSUM_L1=y
243CONFIG_CACHELINE_ALIGNED_L1=y 260CONFIG_CACHELINE_ALIGNED_L1=y
244CONFIG_SYSCALL_TAB_L1=y 261CONFIG_SYSCALL_TAB_L1=y
245CONFIG_CPLB_SWITCH_TAB_L1=y 262CONFIG_CPLB_SWITCH_TAB_L1=y
263CONFIG_APP_STACK_L1=y
264
265#
266# Speed Optimizations
267#
268CONFIG_BFIN_INS_LOWOVERHEAD=y
246CONFIG_RAMKERNEL=y 269CONFIG_RAMKERNEL=y
247# CONFIG_ROMKERNEL is not set 270# CONFIG_ROMKERNEL is not set
248CONFIG_SELECT_MEMORY_MODEL=y 271CONFIG_SELECT_MEMORY_MODEL=y
@@ -251,13 +274,14 @@ CONFIG_FLATMEM_MANUAL=y
251# CONFIG_SPARSEMEM_MANUAL is not set 274# CONFIG_SPARSEMEM_MANUAL is not set
252CONFIG_FLATMEM=y 275CONFIG_FLATMEM=y
253CONFIG_FLAT_NODE_MEM_MAP=y 276CONFIG_FLAT_NODE_MEM_MAP=y
254# CONFIG_SPARSEMEM_STATIC is not set 277CONFIG_PAGEFLAGS_EXTENDED=y
255CONFIG_SPLIT_PTLOCK_CPUS=4 278CONFIG_SPLIT_PTLOCK_CPUS=4
256# CONFIG_RESOURCES_64BIT is not set 279# CONFIG_RESOURCES_64BIT is not set
280# CONFIG_PHYS_ADDR_T_64BIT is not set
257CONFIG_ZONE_DMA_FLAG=1 281CONFIG_ZONE_DMA_FLAG=1
258CONFIG_LARGE_ALLOCS=y 282CONFIG_VIRT_TO_BUS=y
259# CONFIG_BFIN_GPTIMERS is not set 283CONFIG_BFIN_GPTIMERS=y
260CONFIG_BFIN_DMA_5XX=y 284# CONFIG_DMA_UNCACHED_4M is not set
261# CONFIG_DMA_UNCACHED_2M is not set 285# CONFIG_DMA_UNCACHED_2M is not set
262CONFIG_DMA_UNCACHED_1M=y 286CONFIG_DMA_UNCACHED_1M=y
263# CONFIG_DMA_UNCACHED_NONE is not set 287# CONFIG_DMA_UNCACHED_NONE is not set
@@ -271,7 +295,7 @@ CONFIG_BFIN_DCACHE=y
271# CONFIG_BFIN_ICACHE_LOCK is not set 295# CONFIG_BFIN_ICACHE_LOCK is not set
272CONFIG_BFIN_WB=y 296CONFIG_BFIN_WB=y
273# CONFIG_BFIN_WT is not set 297# CONFIG_BFIN_WT is not set
274CONFIG_L1_MAX_PIECE=16 298# CONFIG_MPU is not set
275 299
276# 300#
277# Asynchonous Memory Configuration 301# Asynchonous Memory Configuration
@@ -299,12 +323,7 @@ CONFIG_BANK_3=0x99B2
299# 323#
300# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 324# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
301# 325#
302# CONFIG_PCI is not set
303# CONFIG_ARCH_SUPPORTS_MSI is not set 326# CONFIG_ARCH_SUPPORTS_MSI is not set
304
305#
306# PCCARD (PCMCIA/CardBus) support
307#
308# CONFIG_PCCARD is not set 327# CONFIG_PCCARD is not set
309 328
310# 329#
@@ -314,21 +333,20 @@ CONFIG_BINFMT_ELF_FDPIC=y
314CONFIG_BINFMT_FLAT=y 333CONFIG_BINFMT_FLAT=y
315CONFIG_BINFMT_ZFLAT=y 334CONFIG_BINFMT_ZFLAT=y
316# CONFIG_BINFMT_SHARED_FLAT is not set 335# CONFIG_BINFMT_SHARED_FLAT is not set
336# CONFIG_HAVE_AOUT is not set
317# CONFIG_BINFMT_MISC is not set 337# CONFIG_BINFMT_MISC is not set
318 338
319# 339#
320# Power management options 340# Power management options
321# 341#
322# CONFIG_PM is not set 342# CONFIG_PM is not set
343CONFIG_ARCH_SUSPEND_POSSIBLE=y
344# CONFIG_PM_WAKEUP_BY_GPIO is not set
323 345
324# 346#
325# CPU Frequency scaling 347# CPU Frequency scaling
326# 348#
327# CONFIG_CPU_FREQ is not set 349# CONFIG_CPU_FREQ is not set
328
329#
330# Networking
331#
332CONFIG_NET=y 350CONFIG_NET=y
333 351
334# 352#
@@ -341,6 +359,7 @@ CONFIG_XFRM=y
341# CONFIG_XFRM_USER is not set 359# CONFIG_XFRM_USER is not set
342# CONFIG_XFRM_SUB_POLICY is not set 360# CONFIG_XFRM_SUB_POLICY is not set
343# CONFIG_XFRM_MIGRATE is not set 361# CONFIG_XFRM_MIGRATE is not set
362# CONFIG_XFRM_STATISTICS is not set
344# CONFIG_NET_KEY is not set 363# CONFIG_NET_KEY is not set
345CONFIG_INET=y 364CONFIG_INET=y
346# CONFIG_IP_MULTICAST is not set 365# CONFIG_IP_MULTICAST is not set
@@ -362,6 +381,7 @@ CONFIG_SYN_COOKIES=y
362CONFIG_INET_XFRM_MODE_TRANSPORT=y 381CONFIG_INET_XFRM_MODE_TRANSPORT=y
363CONFIG_INET_XFRM_MODE_TUNNEL=y 382CONFIG_INET_XFRM_MODE_TUNNEL=y
364CONFIG_INET_XFRM_MODE_BEET=y 383CONFIG_INET_XFRM_MODE_BEET=y
384# CONFIG_INET_LRO is not set
365CONFIG_INET_DIAG=y 385CONFIG_INET_DIAG=y
366CONFIG_INET_TCP_DIAG=y 386CONFIG_INET_TCP_DIAG=y
367# CONFIG_TCP_CONG_ADVANCED is not set 387# CONFIG_TCP_CONG_ADVANCED is not set
@@ -369,8 +389,6 @@ CONFIG_TCP_CONG_CUBIC=y
369CONFIG_DEFAULT_TCP_CONG="cubic" 389CONFIG_DEFAULT_TCP_CONG="cubic"
370# CONFIG_TCP_MD5SIG is not set 390# CONFIG_TCP_MD5SIG is not set
371# CONFIG_IPV6 is not set 391# CONFIG_IPV6 is not set
372# CONFIG_INET6_XFRM_TUNNEL is not set
373# CONFIG_INET6_TUNNEL is not set
374# CONFIG_NETLABEL is not set 392# CONFIG_NETLABEL is not set
375# CONFIG_NETWORK_SECMARK is not set 393# CONFIG_NETWORK_SECMARK is not set
376# CONFIG_NETFILTER is not set 394# CONFIG_NETFILTER is not set
@@ -379,6 +397,7 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
379# CONFIG_TIPC is not set 397# CONFIG_TIPC is not set
380# CONFIG_ATM is not set 398# CONFIG_ATM is not set
381# CONFIG_BRIDGE is not set 399# CONFIG_BRIDGE is not set
400# CONFIG_NET_DSA is not set
382# CONFIG_VLAN_8021Q is not set 401# CONFIG_VLAN_8021Q is not set
383# CONFIG_DECNET is not set 402# CONFIG_DECNET is not set
384# CONFIG_LLC2 is not set 403# CONFIG_LLC2 is not set
@@ -388,10 +407,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
388# CONFIG_LAPB is not set 407# CONFIG_LAPB is not set
389# CONFIG_ECONET is not set 408# CONFIG_ECONET is not set
390# CONFIG_WAN_ROUTER is not set 409# CONFIG_WAN_ROUTER is not set
391
392#
393# QoS and/or fair queueing
394#
395# CONFIG_NET_SCHED is not set 410# CONFIG_NET_SCHED is not set
396 411
397# 412#
@@ -399,18 +414,19 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
399# 414#
400# CONFIG_NET_PKTGEN is not set 415# CONFIG_NET_PKTGEN is not set
401# CONFIG_HAMRADIO is not set 416# CONFIG_HAMRADIO is not set
417# CONFIG_CAN is not set
402# CONFIG_IRDA is not set 418# CONFIG_IRDA is not set
403# CONFIG_BT is not set 419# CONFIG_BT is not set
404# CONFIG_AF_RXRPC is not set 420# CONFIG_AF_RXRPC is not set
405 421# CONFIG_PHONET is not set
406# 422CONFIG_WIRELESS=y
407# Wireless
408#
409# CONFIG_CFG80211 is not set 423# CONFIG_CFG80211 is not set
424CONFIG_WIRELESS_OLD_REGULATORY=y
410# CONFIG_WIRELESS_EXT is not set 425# CONFIG_WIRELESS_EXT is not set
411# CONFIG_MAC80211 is not set 426# CONFIG_MAC80211 is not set
412# CONFIG_IEEE80211 is not set 427# CONFIG_IEEE80211 is not set
413# CONFIG_RFKILL is not set 428# CONFIG_RFKILL is not set
429# CONFIG_NET_9P is not set
414 430
415# 431#
416# Device Drivers 432# Device Drivers
@@ -419,14 +435,11 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
419# 435#
420# Generic Driver Options 436# Generic Driver Options
421# 437#
438CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
422CONFIG_STANDALONE=y 439CONFIG_STANDALONE=y
423CONFIG_PREVENT_FIRMWARE_BUILD=y 440CONFIG_PREVENT_FIRMWARE_BUILD=y
424# CONFIG_FW_LOADER is not set 441# CONFIG_FW_LOADER is not set
425# CONFIG_SYS_HYPERVISOR is not set 442# CONFIG_SYS_HYPERVISOR is not set
426
427#
428# Connector - unified userspace <-> kernelspace linker
429#
430# CONFIG_CONNECTOR is not set 443# CONFIG_CONNECTOR is not set
431CONFIG_MTD=y 444CONFIG_MTD=y
432# CONFIG_MTD_DEBUG is not set 445# CONFIG_MTD_DEBUG is not set
@@ -434,6 +447,7 @@ CONFIG_MTD=y
434CONFIG_MTD_PARTITIONS=y 447CONFIG_MTD_PARTITIONS=y
435# CONFIG_MTD_REDBOOT_PARTS is not set 448# CONFIG_MTD_REDBOOT_PARTS is not set
436# CONFIG_MTD_CMDLINE_PARTS is not set 449# CONFIG_MTD_CMDLINE_PARTS is not set
450# CONFIG_MTD_AR7_PARTS is not set
437 451
438# 452#
439# User Modules And Translation Layers 453# User Modules And Translation Layers
@@ -446,6 +460,7 @@ CONFIG_MTD_BLOCK=y
446# CONFIG_INFTL is not set 460# CONFIG_INFTL is not set
447# CONFIG_RFD_FTL is not set 461# CONFIG_RFD_FTL is not set
448# CONFIG_SSFDC is not set 462# CONFIG_SSFDC is not set
463# CONFIG_MTD_OOPS is not set
449 464
450# 465#
451# RAM/ROM/Flash chip drivers 466# RAM/ROM/Flash chip drivers
@@ -470,7 +485,7 @@ CONFIG_MTD_RAM=y
470# Mapping drivers for chip access 485# Mapping drivers for chip access
471# 486#
472CONFIG_MTD_COMPLEX_MAPPINGS=y 487CONFIG_MTD_COMPLEX_MAPPINGS=y
473# CONFIG_MTD_BF5xx is not set 488# CONFIG_MTD_GPIO_ADDR is not set
474CONFIG_MTD_UCLINUX=y 489CONFIG_MTD_UCLINUX=y
475# CONFIG_MTD_PLATRAM is not set 490# CONFIG_MTD_PLATRAM is not set
476 491
@@ -509,33 +524,22 @@ CONFIG_MTD_NAND_IDS=y
509# UBI - Unsorted block images 524# UBI - Unsorted block images
510# 525#
511# CONFIG_MTD_UBI is not set 526# CONFIG_MTD_UBI is not set
512
513#
514# Parallel port support
515#
516# CONFIG_PARPORT is not set 527# CONFIG_PARPORT is not set
517 528CONFIG_BLK_DEV=y
518#
519# Plug and Play support
520#
521# CONFIG_PNPACPI is not set
522
523#
524# Block devices
525#
526# CONFIG_BLK_DEV_COW_COMMON is not set 529# CONFIG_BLK_DEV_COW_COMMON is not set
527# CONFIG_BLK_DEV_LOOP is not set 530# CONFIG_BLK_DEV_LOOP is not set
528# CONFIG_BLK_DEV_NBD is not set 531# CONFIG_BLK_DEV_NBD is not set
529CONFIG_BLK_DEV_RAM=y 532CONFIG_BLK_DEV_RAM=y
530CONFIG_BLK_DEV_RAM_COUNT=16 533CONFIG_BLK_DEV_RAM_COUNT=16
531CONFIG_BLK_DEV_RAM_SIZE=4096 534CONFIG_BLK_DEV_RAM_SIZE=4096
532CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 535# CONFIG_BLK_DEV_XIP is not set
533# CONFIG_CDROM_PKTCDVD is not set 536# CONFIG_CDROM_PKTCDVD is not set
534# CONFIG_ATA_OVER_ETH is not set 537# CONFIG_ATA_OVER_ETH is not set
535 538# CONFIG_BLK_DEV_HD is not set
536# 539CONFIG_MISC_DEVICES=y
537# Misc devices 540# CONFIG_EEPROM_93CX6 is not set
538# 541# CONFIG_ENCLOSURE_SERVICES is not set
542CONFIG_HAVE_IDE=y
539# CONFIG_IDE is not set 543# CONFIG_IDE is not set
540 544
541# 545#
@@ -543,22 +547,17 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
543# 547#
544# CONFIG_RAID_ATTRS is not set 548# CONFIG_RAID_ATTRS is not set
545# CONFIG_SCSI is not set 549# CONFIG_SCSI is not set
550# CONFIG_SCSI_DMA is not set
546# CONFIG_SCSI_NETLINK is not set 551# CONFIG_SCSI_NETLINK is not set
547# CONFIG_ATA is not set 552# CONFIG_ATA is not set
548
549#
550# Multi-device support (RAID and LVM)
551#
552# CONFIG_MD is not set 553# CONFIG_MD is not set
553
554#
555# Network device support
556#
557CONFIG_NETDEVICES=y 554CONFIG_NETDEVICES=y
558# CONFIG_DUMMY is not set 555# CONFIG_DUMMY is not set
559# CONFIG_BONDING is not set 556# CONFIG_BONDING is not set
557# CONFIG_MACVLAN is not set
560# CONFIG_EQUALIZER is not set 558# CONFIG_EQUALIZER is not set
561# CONFIG_TUN is not set 559# CONFIG_TUN is not set
560# CONFIG_VETH is not set
562CONFIG_PHYLIB=y 561CONFIG_PHYLIB=y
563 562
564# 563#
@@ -572,46 +571,45 @@ CONFIG_PHYLIB=y
572# CONFIG_VITESSE_PHY is not set 571# CONFIG_VITESSE_PHY is not set
573# CONFIG_SMSC_PHY is not set 572# CONFIG_SMSC_PHY is not set
574# CONFIG_BROADCOM_PHY is not set 573# CONFIG_BROADCOM_PHY is not set
574# CONFIG_ICPLUS_PHY is not set
575# CONFIG_REALTEK_PHY is not set
575# CONFIG_FIXED_PHY is not set 576# CONFIG_FIXED_PHY is not set
576 577# CONFIG_MDIO_BITBANG is not set
577#
578# Ethernet (10 or 100Mbit)
579#
580CONFIG_NET_ETHERNET=y 578CONFIG_NET_ETHERNET=y
581CONFIG_MII=y 579CONFIG_MII=y
582# CONFIG_SMC91X is not set
583CONFIG_BFIN_MAC=y 580CONFIG_BFIN_MAC=y
584# CONFIG_BFIN_MAC_USE_L1 is not set 581# CONFIG_BFIN_MAC_USE_L1 is not set
585CONFIG_BFIN_TX_DESC_NUM=100 582CONFIG_BFIN_TX_DESC_NUM=100
586CONFIG_BFIN_RX_DESC_NUM=100 583CONFIG_BFIN_RX_DESC_NUM=100
587CONFIG_BFIN_MAC_RMII=y 584CONFIG_BFIN_MAC_RMII=y
585# CONFIG_SMC91X is not set
588# CONFIG_SMSC911X is not set 586# CONFIG_SMSC911X is not set
589# CONFIG_DM9000 is not set 587# CONFIG_DM9000 is not set
588# CONFIG_ENC28J60 is not set
589# CONFIG_IBM_NEW_EMAC_ZMII is not set
590# CONFIG_IBM_NEW_EMAC_RGMII is not set
591# CONFIG_IBM_NEW_EMAC_TAH is not set
592# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
593# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
594# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
595# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
590CONFIG_NETDEV_1000=y 596CONFIG_NETDEV_1000=y
591CONFIG_NETDEV_10000=y
592# CONFIG_AX88180 is not set 597# CONFIG_AX88180 is not set
598CONFIG_NETDEV_10000=y
593 599
594# 600#
595# Wireless LAN 601# Wireless LAN
596# 602#
597# CONFIG_WLAN_PRE80211 is not set 603# CONFIG_WLAN_PRE80211 is not set
598# CONFIG_WLAN_80211 is not set 604# CONFIG_WLAN_80211 is not set
605# CONFIG_IWLWIFI_LEDS is not set
599# CONFIG_WAN is not set 606# CONFIG_WAN is not set
600# CONFIG_PPP is not set 607# CONFIG_PPP is not set
601# CONFIG_SLIP is not set 608# CONFIG_SLIP is not set
602# CONFIG_SHAPER is not set
603# CONFIG_NETCONSOLE is not set 609# CONFIG_NETCONSOLE is not set
604# CONFIG_NETPOLL is not set 610# CONFIG_NETPOLL is not set
605# CONFIG_NET_POLL_CONTROLLER is not set 611# CONFIG_NET_POLL_CONTROLLER is not set
606
607#
608# ISDN subsystem
609#
610# CONFIG_ISDN is not set 612# CONFIG_ISDN is not set
611
612#
613# Telephony Support
614#
615# CONFIG_PHONE is not set 613# CONFIG_PHONE is not set
616 614
617# 615#
@@ -626,9 +624,6 @@ CONFIG_INPUT=y
626# 624#
627# CONFIG_INPUT_MOUSEDEV is not set 625# CONFIG_INPUT_MOUSEDEV is not set
628# CONFIG_INPUT_JOYDEV is not set 626# CONFIG_INPUT_JOYDEV is not set
629CONFIG_INPUT_TSDEV=y
630CONFIG_INPUT_TSDEV_SCREEN_X=240
631CONFIG_INPUT_TSDEV_SCREEN_Y=320
632CONFIG_INPUT_EVDEV=y 627CONFIG_INPUT_EVDEV=y
633# CONFIG_INPUT_EVBUG is not set 628# CONFIG_INPUT_EVBUG is not set
634 629
@@ -642,24 +637,29 @@ CONFIG_INPUT_EVDEV=y
642CONFIG_INPUT_TOUCHSCREEN=y 637CONFIG_INPUT_TOUCHSCREEN=y
643# CONFIG_TOUCHSCREEN_ADS7846 is not set 638# CONFIG_TOUCHSCREEN_ADS7846 is not set
644CONFIG_TOUCHSCREEN_AD7877=y 639CONFIG_TOUCHSCREEN_AD7877=y
640# CONFIG_TOUCHSCREEN_AD7879_I2C is not set
641# CONFIG_TOUCHSCREEN_AD7879_SPI is not set
642# CONFIG_TOUCHSCREEN_AD7879 is not set
643# CONFIG_TOUCHSCREEN_FUJITSU is not set
645# CONFIG_TOUCHSCREEN_GUNZE is not set 644# CONFIG_TOUCHSCREEN_GUNZE is not set
646# CONFIG_TOUCHSCREEN_ELO is not set 645# CONFIG_TOUCHSCREEN_ELO is not set
647# CONFIG_TOUCHSCREEN_MTOUCH is not set 646# CONFIG_TOUCHSCREEN_MTOUCH is not set
647# CONFIG_TOUCHSCREEN_INEXIO is not set
648# CONFIG_TOUCHSCREEN_MK712 is not set 648# CONFIG_TOUCHSCREEN_MK712 is not set
649# CONFIG_TOUCHSCREEN_PENMOUNT is not set 649# CONFIG_TOUCHSCREEN_PENMOUNT is not set
650# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set 650# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
651# CONFIG_TOUCHSCREEN_TOUCHWIN is not set 651# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
652# CONFIG_TOUCHSCREEN_UCB1400 is not set
653# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set 652# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
653# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
654CONFIG_INPUT_MISC=y 654CONFIG_INPUT_MISC=y
655# CONFIG_INPUT_ATI_REMOTE is not set 655# CONFIG_INPUT_ATI_REMOTE is not set
656# CONFIG_INPUT_ATI_REMOTE2 is not set 656# CONFIG_INPUT_ATI_REMOTE2 is not set
657# CONFIG_INPUT_KEYSPAN_REMOTE is not set 657# CONFIG_INPUT_KEYSPAN_REMOTE is not set
658# CONFIG_INPUT_POWERMATE is not set 658# CONFIG_INPUT_POWERMATE is not set
659# CONFIG_INPUT_YEALINK is not set 659# CONFIG_INPUT_YEALINK is not set
660# CONFIG_INPUT_CM109 is not set
660CONFIG_INPUT_UINPUT=y 661CONFIG_INPUT_UINPUT=y
661# CONFIG_BF53X_PFBUTTONS is not set 662# CONFIG_CONFIG_INPUT_PCF8574 is not set
662# CONFIG_TWI_KEYPAD is not set
663 663
664# 664#
665# Hardware I/O ports 665# Hardware I/O ports
@@ -672,18 +672,17 @@ CONFIG_INPUT_UINPUT=y
672# 672#
673# CONFIG_AD9960 is not set 673# CONFIG_AD9960 is not set
674# CONFIG_SPI_ADC_BF533 is not set 674# CONFIG_SPI_ADC_BF533 is not set
675# CONFIG_BF5xx_PFLAGS is not set
676# CONFIG_BF5xx_PPIFCD is not set 675# CONFIG_BF5xx_PPIFCD is not set
677# CONFIG_BFIN_SIMPLE_TIMER is not set 676# CONFIG_BFIN_SIMPLE_TIMER is not set
678# CONFIG_BF5xx_PPI is not set 677# CONFIG_BF5xx_PPI is not set
679CONFIG_BFIN_SPORT=y 678CONFIG_BFIN_SPORT=y
680# CONFIG_BFIN_TIMER_LATENCY is not set 679# CONFIG_BFIN_TIMER_LATENCY is not set
681CONFIG_TWI_LCD=m 680CONFIG_TWI_LCD=m
682CONFIG_TWI_LCD_SLAVE_ADDR=34 681CONFIG_BFIN_DMA_INTERFACE=m
683# CONFIG_AD5304 is not set 682# CONFIG_SIMPLE_GPIO is not set
684# CONFIG_BF5xx_TEA5764 is not set
685# CONFIG_BF5xx_FBDMA is not set
686# CONFIG_VT is not set 683# CONFIG_VT is not set
684CONFIG_DEVKMEM=y
685# CONFIG_BFIN_JTAG_COMM is not set
687# CONFIG_SERIAL_NONSTANDARD is not set 686# CONFIG_SERIAL_NONSTANDARD is not set
688 687
689# 688#
@@ -716,68 +715,59 @@ CONFIG_CAN4LINUX=y
716# 715#
717# linux embedded drivers 716# linux embedded drivers
718# 717#
719# CONFIG_CAN_MCF5282 is not set
720# CONFIG_CAN_UNCTWINCAN is not set
721CONFIG_CAN_BLACKFIN=m 718CONFIG_CAN_BLACKFIN=m
722
723#
724# IPMI
725#
726# CONFIG_IPMI_HANDLER is not set 719# CONFIG_IPMI_HANDLER is not set
727# CONFIG_WATCHDOG is not set
728CONFIG_HW_RANDOM=y 720CONFIG_HW_RANDOM=y
729# CONFIG_GEN_RTC is not set
730# CONFIG_R3964 is not set 721# CONFIG_R3964 is not set
731# CONFIG_RAW_DRIVER is not set 722# CONFIG_RAW_DRIVER is not set
732
733#
734# TPM devices
735#
736# CONFIG_TCG_TPM is not set 723# CONFIG_TCG_TPM is not set
737CONFIG_I2C=y 724CONFIG_I2C=y
738CONFIG_I2C_BOARDINFO=y 725CONFIG_I2C_BOARDINFO=y
739CONFIG_I2C_CHARDEV=y 726CONFIG_I2C_CHARDEV=y
727CONFIG_I2C_HELPER_AUTO=y
740 728
741# 729#
742# I2C Algorithms 730# I2C Hardware Bus support
743# 731#
744# CONFIG_I2C_ALGOBIT is not set
745# CONFIG_I2C_ALGOPCF is not set
746# CONFIG_I2C_ALGOPCA is not set
747 732
748# 733#
749# I2C Hardware Bus support 734# I2C system bus drivers (mostly embedded / system-on-chip)
750# 735#
751# CONFIG_I2C_BLACKFIN_GPIO is not set
752CONFIG_I2C_BLACKFIN_TWI=y 736CONFIG_I2C_BLACKFIN_TWI=y
753CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 737CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
754# CONFIG_I2C_GPIO is not set 738# CONFIG_I2C_GPIO is not set
755# CONFIG_I2C_OCORES is not set 739# CONFIG_I2C_OCORES is not set
756# CONFIG_I2C_PARPORT_LIGHT is not set
757# CONFIG_I2C_SIMTEC is not set 740# CONFIG_I2C_SIMTEC is not set
741
742#
743# External I2C/SMBus adapter drivers
744#
745# CONFIG_I2C_PARPORT_LIGHT is not set
746# CONFIG_I2C_TAOS_EVM is not set
747
748#
749# Other I2C/SMBus bus drivers
750#
751# CONFIG_I2C_PCA_PLATFORM is not set
758# CONFIG_I2C_STUB is not set 752# CONFIG_I2C_STUB is not set
759 753
760# 754#
761# Miscellaneous I2C Chip support 755# Miscellaneous I2C Chip support
762# 756#
763# CONFIG_SENSORS_DS1337 is not set 757# CONFIG_DS1682 is not set
764# CONFIG_SENSORS_DS1374 is not set 758# CONFIG_AT24 is not set
765# CONFIG_SENSORS_AD5252 is not set 759# CONFIG_SENSORS_AD5252 is not set
766# CONFIG_SENSORS_EEPROM is not set 760# CONFIG_SENSORS_EEPROM is not set
767CONFIG_SENSORS_PCF8574=m 761CONFIG_SENSORS_PCF8574=m
768CONFIG_SENSORS_PCF8575=y 762# CONFIG_PCF8575 is not set
769# CONFIG_SENSORS_PCA9543 is not set
770# CONFIG_SENSORS_PCA9539 is not set 763# CONFIG_SENSORS_PCA9539 is not set
771# CONFIG_SENSORS_PCF8591 is not set 764# CONFIG_SENSORS_PCF8591 is not set
772# CONFIG_SENSORS_MAX6875 is not set 765# CONFIG_SENSORS_MAX6875 is not set
766# CONFIG_SENSORS_TSL2550 is not set
773# CONFIG_I2C_DEBUG_CORE is not set 767# CONFIG_I2C_DEBUG_CORE is not set
774# CONFIG_I2C_DEBUG_ALGO is not set 768# CONFIG_I2C_DEBUG_ALGO is not set
775# CONFIG_I2C_DEBUG_BUS is not set 769# CONFIG_I2C_DEBUG_BUS is not set
776# CONFIG_I2C_DEBUG_CHIP is not set 770# CONFIG_I2C_DEBUG_CHIP is not set
777
778#
779# SPI support
780#
781CONFIG_SPI=y 771CONFIG_SPI=y
782CONFIG_SPI_MASTER=y 772CONFIG_SPI_MASTER=y
783 773
@@ -785,6 +775,7 @@ CONFIG_SPI_MASTER=y
785# SPI Master Controller Drivers 775# SPI Master Controller Drivers
786# 776#
787CONFIG_SPI_BFIN=y 777CONFIG_SPI_BFIN=y
778# CONFIG_SPI_BFIN_LOCK is not set
788# CONFIG_SPI_BITBANG is not set 779# CONFIG_SPI_BITBANG is not set
789 780
790# 781#
@@ -792,27 +783,29 @@ CONFIG_SPI_BFIN=y
792# 783#
793# CONFIG_SPI_AT25 is not set 784# CONFIG_SPI_AT25 is not set
794# CONFIG_SPI_SPIDEV is not set 785# CONFIG_SPI_SPIDEV is not set
795 786# CONFIG_SPI_TLE62X0 is not set
796# 787CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
797# Dallas's 1-wire bus 788# CONFIG_GPIOLIB is not set
798#
799# CONFIG_W1 is not set 789# CONFIG_W1 is not set
790# CONFIG_POWER_SUPPLY is not set
800CONFIG_HWMON=y 791CONFIG_HWMON=y
801# CONFIG_HWMON_VID is not set 792# CONFIG_HWMON_VID is not set
802# CONFIG_SENSORS_ABITUGURU is not set 793# CONFIG_SENSORS_AD7414 is not set
803# CONFIG_SENSORS_AD7418 is not set 794# CONFIG_SENSORS_AD7418 is not set
795# CONFIG_SENSORS_ADCXX is not set
804# CONFIG_SENSORS_ADM1021 is not set 796# CONFIG_SENSORS_ADM1021 is not set
805# CONFIG_SENSORS_ADM1025 is not set 797# CONFIG_SENSORS_ADM1025 is not set
806# CONFIG_SENSORS_ADM1026 is not set 798# CONFIG_SENSORS_ADM1026 is not set
807# CONFIG_SENSORS_ADM1029 is not set 799# CONFIG_SENSORS_ADM1029 is not set
808# CONFIG_SENSORS_ADM1031 is not set 800# CONFIG_SENSORS_ADM1031 is not set
809# CONFIG_SENSORS_ADM9240 is not set 801# CONFIG_SENSORS_ADM9240 is not set
810# CONFIG_SENSORS_ASB100 is not set 802# CONFIG_SENSORS_ADT7470 is not set
803# CONFIG_SENSORS_ADT7473 is not set
811# CONFIG_SENSORS_ATXP1 is not set 804# CONFIG_SENSORS_ATXP1 is not set
812# CONFIG_SENSORS_DS1621 is not set 805# CONFIG_SENSORS_DS1621 is not set
813# CONFIG_SENSORS_F71805F is not set 806# CONFIG_SENSORS_F71805F is not set
814# CONFIG_SENSORS_FSCHER is not set 807# CONFIG_SENSORS_F71882FG is not set
815# CONFIG_SENSORS_FSCPOS is not set 808# CONFIG_SENSORS_F75375S is not set
816# CONFIG_SENSORS_GL518SM is not set 809# CONFIG_SENSORS_GL518SM is not set
817# CONFIG_SENSORS_GL520SM is not set 810# CONFIG_SENSORS_GL520SM is not set
818# CONFIG_SENSORS_IT87 is not set 811# CONFIG_SENSORS_IT87 is not set
@@ -827,58 +820,76 @@ CONFIG_HWMON=y
827# CONFIG_SENSORS_LM87 is not set 820# CONFIG_SENSORS_LM87 is not set
828# CONFIG_SENSORS_LM90 is not set 821# CONFIG_SENSORS_LM90 is not set
829# CONFIG_SENSORS_LM92 is not set 822# CONFIG_SENSORS_LM92 is not set
823# CONFIG_SENSORS_LM93 is not set
824# CONFIG_SENSORS_MAX1111 is not set
830# CONFIG_SENSORS_MAX1619 is not set 825# CONFIG_SENSORS_MAX1619 is not set
831# CONFIG_SENSORS_MAX6650 is not set 826# CONFIG_SENSORS_MAX6650 is not set
832# CONFIG_SENSORS_PC87360 is not set 827# CONFIG_SENSORS_PC87360 is not set
833# CONFIG_SENSORS_PC87427 is not set 828# CONFIG_SENSORS_PC87427 is not set
829# CONFIG_SENSORS_DME1737 is not set
834# CONFIG_SENSORS_SMSC47M1 is not set 830# CONFIG_SENSORS_SMSC47M1 is not set
835# CONFIG_SENSORS_SMSC47M192 is not set 831# CONFIG_SENSORS_SMSC47M192 is not set
836# CONFIG_SENSORS_SMSC47B397 is not set 832# CONFIG_SENSORS_SMSC47B397 is not set
833# CONFIG_SENSORS_ADS7828 is not set
834# CONFIG_SENSORS_THMC50 is not set
837# CONFIG_SENSORS_VT1211 is not set 835# CONFIG_SENSORS_VT1211 is not set
838# CONFIG_SENSORS_W83781D is not set 836# CONFIG_SENSORS_W83781D is not set
839# CONFIG_SENSORS_W83791D is not set 837# CONFIG_SENSORS_W83791D is not set
840# CONFIG_SENSORS_W83792D is not set 838# CONFIG_SENSORS_W83792D is not set
841# CONFIG_SENSORS_W83793 is not set 839# CONFIG_SENSORS_W83793 is not set
842# CONFIG_SENSORS_W83L785TS is not set 840# CONFIG_SENSORS_W83L785TS is not set
841# CONFIG_SENSORS_W83L786NG is not set
843# CONFIG_SENSORS_W83627HF is not set 842# CONFIG_SENSORS_W83627HF is not set
844# CONFIG_SENSORS_W83627EHF is not set 843# CONFIG_SENSORS_W83627EHF is not set
845# CONFIG_HWMON_DEBUG_CHIP is not set 844# CONFIG_HWMON_DEBUG_CHIP is not set
845# CONFIG_THERMAL is not set
846# CONFIG_THERMAL_HWMON is not set
847# CONFIG_WATCHDOG is not set
846 848
847# 849#
848# Multifunction device drivers 850# Multifunction device drivers
849# 851#
852# CONFIG_MFD_CORE is not set
850# CONFIG_MFD_SM501 is not set 853# CONFIG_MFD_SM501 is not set
854# CONFIG_HTC_PASIC3 is not set
855# CONFIG_MFD_TMIO is not set
856# CONFIG_MFD_WM8400 is not set
857# CONFIG_MFD_WM8350_I2C is not set
851 858
852# 859#
853# Multimedia devices 860# Multimedia devices
854# 861#
862
863#
864# Multimedia core support
865#
855# CONFIG_VIDEO_DEV is not set 866# CONFIG_VIDEO_DEV is not set
856# CONFIG_DVB_CORE is not set 867# CONFIG_DVB_CORE is not set
857CONFIG_DAB=y 868# CONFIG_VIDEO_MEDIA is not set
858 869
859# 870#
860# Graphics support 871# Multimedia drivers
861# 872#
862CONFIG_BACKLIGHT_LCD_SUPPORT=y 873CONFIG_DAB=y
863CONFIG_BACKLIGHT_CLASS_DEVICE=y
864CONFIG_LCD_CLASS_DEVICE=y
865 874
866# 875#
867# Display device support 876# Graphics support
868# 877#
869# CONFIG_DISPLAY_SUPPORT is not set
870# CONFIG_VGASTATE is not set 878# CONFIG_VGASTATE is not set
879# CONFIG_VIDEO_OUTPUT_CONTROL is not set
871CONFIG_FB=y 880CONFIG_FB=y
872CONFIG_FIRMWARE_EDID=y 881CONFIG_FIRMWARE_EDID=y
873# CONFIG_FB_DDC is not set 882# CONFIG_FB_DDC is not set
883# CONFIG_FB_BOOT_VESA_SUPPORT is not set
874CONFIG_FB_CFB_FILLRECT=y 884CONFIG_FB_CFB_FILLRECT=y
875CONFIG_FB_CFB_COPYAREA=y 885CONFIG_FB_CFB_COPYAREA=y
876CONFIG_FB_CFB_IMAGEBLIT=y 886CONFIG_FB_CFB_IMAGEBLIT=y
887# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
877# CONFIG_FB_SYS_FILLRECT is not set 888# CONFIG_FB_SYS_FILLRECT is not set
878# CONFIG_FB_SYS_COPYAREA is not set 889# CONFIG_FB_SYS_COPYAREA is not set
879# CONFIG_FB_SYS_IMAGEBLIT is not set 890# CONFIG_FB_SYS_IMAGEBLIT is not set
891# CONFIG_FB_FOREIGN_ENDIAN is not set
880# CONFIG_FB_SYS_FOPS is not set 892# CONFIG_FB_SYS_FOPS is not set
881CONFIG_FB_DEFERRED_IO=y
882# CONFIG_FB_SVGALIB is not set 893# CONFIG_FB_SVGALIB is not set
883# CONFIG_FB_MACMODES is not set 894# CONFIG_FB_MACMODES is not set
884# CONFIG_FB_BACKLIGHT is not set 895# CONFIG_FB_BACKLIGHT is not set
@@ -888,25 +899,34 @@ CONFIG_FB_DEFERRED_IO=y
888# 899#
889# Frame buffer hardware drivers 900# Frame buffer hardware drivers
890# 901#
891# CONFIG_FB_BFIN_7171 is not set 902# CONFIG_FB_BFIN_T350MCQB is not set
892# CONFIG_FB_BFIN_7393 is not set 903# CONFIG_FB_BFIN_LQ035Q1 is not set
893CONFIG_FB_BF537_LQ035=y 904CONFIG_FB_BF537_LQ035=y
894CONFIG_LQ035_SLAVE_ADDR=0x58 905CONFIG_LQ035_SLAVE_ADDR=0x58
895CONFIG_FB_BFIN_LANDSCAPE=y 906CONFIG_FB_BFIN_LANDSCAPE=y
896# CONFIG_FB_BFIN_BGR is not set 907# CONFIG_FB_BFIN_BGR is not set
897# CONFIG_FB_BFIN_T350MCQB is not set 908# CONFIG_FB_BFIN_7393 is not set
909# CONFIG_FB_HITACHI_TX09 is not set
898# CONFIG_FB_S1D13XXX is not set 910# CONFIG_FB_S1D13XXX is not set
899# CONFIG_FB_VIRTUAL is not set 911# CONFIG_FB_VIRTUAL is not set
900# CONFIG_LOGO is not set 912# CONFIG_FB_METRONOME is not set
913CONFIG_BACKLIGHT_LCD_SUPPORT=y
914CONFIG_LCD_CLASS_DEVICE=y
915# CONFIG_LCD_LTV350QV is not set
916# CONFIG_LCD_ILI9320 is not set
917# CONFIG_LCD_TDO24M is not set
918# CONFIG_LCD_VGG2432A4 is not set
919# CONFIG_LCD_PLATFORM is not set
920CONFIG_BACKLIGHT_CLASS_DEVICE=y
921# CONFIG_BACKLIGHT_CORGI is not set
901 922
902# 923#
903# Sound 924# Display device support
904# 925#
926# CONFIG_DISPLAY_SUPPORT is not set
927# CONFIG_LOGO is not set
905CONFIG_SOUND=y 928CONFIG_SOUND=y
906 929CONFIG_SOUND_OSS_CORE=y
907#
908# Advanced Linux Sound Architecture
909#
910CONFIG_SND=m 930CONFIG_SND=m
911# CONFIG_SND_SEQUENCER is not set 931# CONFIG_SND_SEQUENCER is not set
912# CONFIG_SND_MIXER_OSS is not set 932# CONFIG_SND_MIXER_OSS is not set
@@ -916,46 +936,30 @@ CONFIG_SND=m
916# CONFIG_SND_VERBOSE_PROCFS is not set 936# CONFIG_SND_VERBOSE_PROCFS is not set
917# CONFIG_SND_VERBOSE_PRINTK is not set 937# CONFIG_SND_VERBOSE_PRINTK is not set
918# CONFIG_SND_DEBUG is not set 938# CONFIG_SND_DEBUG is not set
919 939CONFIG_SND_DRIVERS=y
920#
921# Generic devices
922#
923# CONFIG_SND_DUMMY is not set 940# CONFIG_SND_DUMMY is not set
924# CONFIG_SND_MTPAV is not set 941# CONFIG_SND_MTPAV is not set
925# CONFIG_SND_SERIAL_U16550 is not set 942# CONFIG_SND_SERIAL_U16550 is not set
926# CONFIG_SND_MPU401 is not set 943# CONFIG_SND_MPU401 is not set
944CONFIG_SND_SPI=y
927 945
928# 946#
929# ALSA Blackfin devices 947# ALSA Blackfin devices
930# 948#
931# CONFIG_SND_BLACKFIN_AD1836 is not set 949# CONFIG_SND_BLACKFIN_AD1836 is not set
932# CONFIG_SND_BFIN_AD73311 is not set 950# CONFIG_SND_BFIN_AD73322 is not set
933
934#
935# System on Chip audio support
936#
937# CONFIG_SND_SOC is not set 951# CONFIG_SND_SOC is not set
938
939#
940# Open Sound System
941#
942CONFIG_SOUND_PRIME=y 952CONFIG_SOUND_PRIME=y
943# CONFIG_OSS_OBSOLETE is not set 953CONFIG_HID_SUPPORT=y
944# CONFIG_SOUND_MSNDCLAS is not set
945# CONFIG_SOUND_MSNDPIN is not set
946
947#
948# HID Devices
949#
950# CONFIG_HID is not set 954# CONFIG_HID is not set
951 955# CONFIG_HID_PID is not set
952# 956CONFIG_USB_SUPPORT=y
953# USB support
954#
955CONFIG_USB_ARCH_HAS_HCD=y 957CONFIG_USB_ARCH_HAS_HCD=y
956# CONFIG_USB_ARCH_HAS_OHCI is not set 958# CONFIG_USB_ARCH_HAS_OHCI is not set
957# CONFIG_USB_ARCH_HAS_EHCI is not set 959# CONFIG_USB_ARCH_HAS_EHCI is not set
958# CONFIG_USB is not set 960# CONFIG_USB is not set
961# CONFIG_USB_OTG_WHITELIST is not set
962# CONFIG_USB_OTG_BLACKLIST_HUB is not set
959 963
960# 964#
961# Enable Host or Gadget support to see Inventra options 965# Enable Host or Gadget support to see Inventra options
@@ -964,37 +968,11 @@ CONFIG_USB_ARCH_HAS_HCD=y
964# 968#
965# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 969# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
966# 970#
967
968#
969# USB Gadget Support
970#
971# CONFIG_USB_GADGET is not set 971# CONFIG_USB_GADGET is not set
972# CONFIG_MMC is not set 972# CONFIG_MMC is not set
973 973# CONFIG_MEMSTICK is not set
974#
975# LED devices
976#
977# CONFIG_NEW_LEDS is not set 974# CONFIG_NEW_LEDS is not set
978 975# CONFIG_ACCESSIBILITY is not set
979#
980# LED drivers
981#
982
983#
984# LED Triggers
985#
986
987#
988# InfiniBand support
989#
990
991#
992# EDAC - error detection and reporting (RAS) (EXPERIMENTAL)
993#
994
995#
996# Real Time Clock
997#
998CONFIG_RTC_LIB=y 976CONFIG_RTC_LIB=y
999CONFIG_RTC_CLASS=y 977CONFIG_RTC_CLASS=y
1000CONFIG_RTC_HCTOSYS=y 978CONFIG_RTC_HCTOSYS=y
@@ -1014,6 +992,7 @@ CONFIG_RTC_INTF_DEV=y
1014# I2C RTC drivers 992# I2C RTC drivers
1015# 993#
1016# CONFIG_RTC_DRV_DS1307 is not set 994# CONFIG_RTC_DRV_DS1307 is not set
995# CONFIG_RTC_DRV_DS1374 is not set
1017# CONFIG_RTC_DRV_DS1672 is not set 996# CONFIG_RTC_DRV_DS1672 is not set
1018# CONFIG_RTC_DRV_MAX6900 is not set 997# CONFIG_RTC_DRV_MAX6900 is not set
1019# CONFIG_RTC_DRV_RS5C372 is not set 998# CONFIG_RTC_DRV_RS5C372 is not set
@@ -1021,43 +1000,41 @@ CONFIG_RTC_INTF_DEV=y
1021# CONFIG_RTC_DRV_X1205 is not set 1000# CONFIG_RTC_DRV_X1205 is not set
1022# CONFIG_RTC_DRV_PCF8563 is not set 1001# CONFIG_RTC_DRV_PCF8563 is not set
1023# CONFIG_RTC_DRV_PCF8583 is not set 1002# CONFIG_RTC_DRV_PCF8583 is not set
1003# CONFIG_RTC_DRV_M41T80 is not set
1004# CONFIG_RTC_DRV_S35390A is not set
1005# CONFIG_RTC_DRV_FM3130 is not set
1024 1006
1025# 1007#
1026# SPI RTC drivers 1008# SPI RTC drivers
1027# 1009#
1028# CONFIG_RTC_DRV_RS5C348 is not set 1010# CONFIG_RTC_DRV_M41T94 is not set
1011# CONFIG_RTC_DRV_DS1305 is not set
1029# CONFIG_RTC_DRV_MAX6902 is not set 1012# CONFIG_RTC_DRV_MAX6902 is not set
1013# CONFIG_RTC_DRV_R9701 is not set
1014# CONFIG_RTC_DRV_RS5C348 is not set
1015# CONFIG_RTC_DRV_DS3234 is not set
1030 1016
1031# 1017#
1032# Platform RTC drivers 1018# Platform RTC drivers
1033# 1019#
1020# CONFIG_RTC_DRV_DS1286 is not set
1021# CONFIG_RTC_DRV_DS1511 is not set
1034# CONFIG_RTC_DRV_DS1553 is not set 1022# CONFIG_RTC_DRV_DS1553 is not set
1035# CONFIG_RTC_DRV_DS1742 is not set 1023# CONFIG_RTC_DRV_DS1742 is not set
1024# CONFIG_RTC_DRV_STK17TA8 is not set
1036# CONFIG_RTC_DRV_M48T86 is not set 1025# CONFIG_RTC_DRV_M48T86 is not set
1026# CONFIG_RTC_DRV_M48T35 is not set
1027# CONFIG_RTC_DRV_M48T59 is not set
1028# CONFIG_RTC_DRV_BQ4802 is not set
1037# CONFIG_RTC_DRV_V3020 is not set 1029# CONFIG_RTC_DRV_V3020 is not set
1038 1030
1039# 1031#
1040# on-CPU RTC drivers 1032# on-CPU RTC drivers
1041# 1033#
1042CONFIG_RTC_DRV_BFIN=y 1034CONFIG_RTC_DRV_BFIN=y
1043 1035# CONFIG_DMADEVICES is not set
1044# 1036# CONFIG_UIO is not set
1045# DMA Engine support 1037# CONFIG_STAGING is not set
1046#
1047# CONFIG_DMA_ENGINE is not set
1048
1049#
1050# DMA Clients
1051#
1052
1053#
1054# DMA Devices
1055#
1056
1057#
1058# PBX support
1059#
1060# CONFIG_PBX is not set
1061 1038
1062# 1039#
1063# File systems 1040# File systems
@@ -1067,20 +1044,18 @@ CONFIG_EXT2_FS_XATTR=y
1067# CONFIG_EXT2_FS_POSIX_ACL is not set 1044# CONFIG_EXT2_FS_POSIX_ACL is not set
1068# CONFIG_EXT2_FS_SECURITY is not set 1045# CONFIG_EXT2_FS_SECURITY is not set
1069# CONFIG_EXT3_FS is not set 1046# CONFIG_EXT3_FS is not set
1070# CONFIG_EXT4DEV_FS is not set 1047# CONFIG_EXT4_FS is not set
1071CONFIG_FS_MBCACHE=y 1048CONFIG_FS_MBCACHE=y
1072# CONFIG_REISERFS_FS is not set 1049# CONFIG_REISERFS_FS is not set
1073# CONFIG_JFS_FS is not set 1050# CONFIG_JFS_FS is not set
1074# CONFIG_FS_POSIX_ACL is not set 1051# CONFIG_FS_POSIX_ACL is not set
1052CONFIG_FILE_LOCKING=y
1075# CONFIG_XFS_FS is not set 1053# CONFIG_XFS_FS is not set
1076# CONFIG_GFS2_FS is not set
1077# CONFIG_OCFS2_FS is not set 1054# CONFIG_OCFS2_FS is not set
1078# CONFIG_MINIX_FS is not set 1055# CONFIG_DNOTIFY is not set
1079# CONFIG_ROMFS_FS is not set
1080CONFIG_INOTIFY=y 1056CONFIG_INOTIFY=y
1081CONFIG_INOTIFY_USER=y 1057CONFIG_INOTIFY_USER=y
1082# CONFIG_QUOTA is not set 1058# CONFIG_QUOTA is not set
1083# CONFIG_DNOTIFY is not set
1084# CONFIG_AUTOFS_FS is not set 1059# CONFIG_AUTOFS_FS is not set
1085# CONFIG_AUTOFS4_FS is not set 1060# CONFIG_AUTOFS4_FS is not set
1086# CONFIG_FUSE_FS is not set 1061# CONFIG_FUSE_FS is not set
@@ -1106,7 +1081,6 @@ CONFIG_PROC_SYSCTL=y
1106CONFIG_SYSFS=y 1081CONFIG_SYSFS=y
1107# CONFIG_TMPFS is not set 1082# CONFIG_TMPFS is not set
1108# CONFIG_HUGETLB_PAGE is not set 1083# CONFIG_HUGETLB_PAGE is not set
1109CONFIG_RAMFS=y
1110# CONFIG_CONFIGFS_FS is not set 1084# CONFIG_CONFIGFS_FS is not set
1111 1085
1112# 1086#
@@ -1121,36 +1095,35 @@ CONFIG_RAMFS=y
1121# CONFIG_EFS_FS is not set 1095# CONFIG_EFS_FS is not set
1122CONFIG_YAFFS_FS=y 1096CONFIG_YAFFS_FS=y
1123CONFIG_YAFFS_YAFFS1=y 1097CONFIG_YAFFS_YAFFS1=y
1098# CONFIG_YAFFS_9BYTE_TAGS is not set
1124# CONFIG_YAFFS_DOES_ECC is not set 1099# CONFIG_YAFFS_DOES_ECC is not set
1125CONFIG_YAFFS_YAFFS2=y 1100CONFIG_YAFFS_YAFFS2=y
1126CONFIG_YAFFS_AUTO_YAFFS2=y 1101CONFIG_YAFFS_AUTO_YAFFS2=y
1127# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set 1102# CONFIG_YAFFS_DISABLE_LAZY_LOAD is not set
1128CONFIG_YAFFS_CHECKPOINT_RESERVED_BLOCKS=10
1129# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set 1103# CONFIG_YAFFS_DISABLE_WIDE_TNODES is not set
1130# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set 1104# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
1131CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y 1105CONFIG_YAFFS_SHORT_NAMES_IN_RAM=y
1132# CONFIG_JFFS2_FS is not set 1106# CONFIG_JFFS2_FS is not set
1133# CONFIG_CRAMFS is not set 1107# CONFIG_CRAMFS is not set
1134# CONFIG_VXFS_FS is not set 1108# CONFIG_VXFS_FS is not set
1109# CONFIG_MINIX_FS is not set
1110# CONFIG_OMFS_FS is not set
1135# CONFIG_HPFS_FS is not set 1111# CONFIG_HPFS_FS is not set
1136# CONFIG_QNX4FS_FS is not set 1112# CONFIG_QNX4FS_FS is not set
1113# CONFIG_ROMFS_FS is not set
1137# CONFIG_SYSV_FS is not set 1114# CONFIG_SYSV_FS is not set
1138# CONFIG_UFS_FS is not set 1115# CONFIG_UFS_FS is not set
1139 1116CONFIG_NETWORK_FILESYSTEMS=y
1140#
1141# Network File Systems
1142#
1143CONFIG_NFS_FS=m 1117CONFIG_NFS_FS=m
1144CONFIG_NFS_V3=y 1118CONFIG_NFS_V3=y
1145# CONFIG_NFS_V3_ACL is not set 1119# CONFIG_NFS_V3_ACL is not set
1146# CONFIG_NFS_V4 is not set 1120# CONFIG_NFS_V4 is not set
1147# CONFIG_NFS_DIRECTIO is not set
1148# CONFIG_NFSD is not set 1121# CONFIG_NFSD is not set
1149CONFIG_LOCKD=m 1122CONFIG_LOCKD=m
1150CONFIG_LOCKD_V4=y 1123CONFIG_LOCKD_V4=y
1151CONFIG_NFS_COMMON=y 1124CONFIG_NFS_COMMON=y
1152CONFIG_SUNRPC=m 1125CONFIG_SUNRPC=m
1153# CONFIG_SUNRPC_BIND34 is not set 1126# CONFIG_SUNRPC_REGISTER_V4 is not set
1154# CONFIG_RPCSEC_GSS_KRB5 is not set 1127# CONFIG_RPCSEC_GSS_KRB5 is not set
1155# CONFIG_RPCSEC_GSS_SPKM3 is not set 1128# CONFIG_RPCSEC_GSS_SPKM3 is not set
1156CONFIG_SMB_FS=m 1129CONFIG_SMB_FS=m
@@ -1159,17 +1132,12 @@ CONFIG_SMB_FS=m
1159# CONFIG_NCP_FS is not set 1132# CONFIG_NCP_FS is not set
1160# CONFIG_CODA_FS is not set 1133# CONFIG_CODA_FS is not set
1161# CONFIG_AFS_FS is not set 1134# CONFIG_AFS_FS is not set
1162# CONFIG_9P_FS is not set
1163 1135
1164# 1136#
1165# Partition Types 1137# Partition Types
1166# 1138#
1167# CONFIG_PARTITION_ADVANCED is not set 1139# CONFIG_PARTITION_ADVANCED is not set
1168CONFIG_MSDOS_PARTITION=y 1140CONFIG_MSDOS_PARTITION=y
1169
1170#
1171# Native Language Support
1172#
1173CONFIG_NLS=m 1141CONFIG_NLS=m
1174CONFIG_NLS_DEFAULT="iso8859-1" 1142CONFIG_NLS_DEFAULT="iso8859-1"
1175# CONFIG_NLS_CODEPAGE_437 is not set 1143# CONFIG_NLS_CODEPAGE_437 is not set
@@ -1210,29 +1178,30 @@ CONFIG_NLS_DEFAULT="iso8859-1"
1210# CONFIG_NLS_KOI8_R is not set 1178# CONFIG_NLS_KOI8_R is not set
1211# CONFIG_NLS_KOI8_U is not set 1179# CONFIG_NLS_KOI8_U is not set
1212# CONFIG_NLS_UTF8 is not set 1180# CONFIG_NLS_UTF8 is not set
1213
1214#
1215# Distributed Lock Manager
1216#
1217# CONFIG_DLM is not set 1181# CONFIG_DLM is not set
1218 1182
1219# 1183#
1220# Profiling support
1221#
1222# CONFIG_PROFILING is not set
1223
1224#
1225# Kernel hacking 1184# Kernel hacking
1226# 1185#
1227# CONFIG_PRINTK_TIME is not set 1186# CONFIG_PRINTK_TIME is not set
1187CONFIG_ENABLE_WARN_DEPRECATED=y
1228CONFIG_ENABLE_MUST_CHECK=y 1188CONFIG_ENABLE_MUST_CHECK=y
1189CONFIG_FRAME_WARN=1024
1229# CONFIG_MAGIC_SYSRQ is not set 1190# CONFIG_MAGIC_SYSRQ is not set
1230# CONFIG_UNUSED_SYMBOLS is not set 1191# CONFIG_UNUSED_SYMBOLS is not set
1231# CONFIG_DEBUG_FS is not set 1192# CONFIG_DEBUG_FS is not set
1232# CONFIG_HEADERS_CHECK is not set 1193# CONFIG_HEADERS_CHECK is not set
1233# CONFIG_DEBUG_KERNEL is not set 1194# CONFIG_DEBUG_KERNEL is not set
1234# CONFIG_DEBUG_BUGVERBOSE is not set 1195# CONFIG_DEBUG_BUGVERBOSE is not set
1196# CONFIG_DEBUG_MEMORY_INIT is not set
1197# CONFIG_RCU_CPU_STALL_DETECTOR is not set
1198# CONFIG_SYSCTL_SYSCALL_CHECK is not set
1199# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1200# CONFIG_SAMPLES is not set
1201CONFIG_HAVE_ARCH_KGDB=y
1202CONFIG_DEBUG_VERBOSE=y
1235# CONFIG_DEBUG_MMRS is not set 1203# CONFIG_DEBUG_MMRS is not set
1204# CONFIG_DEBUG_DOUBLEFAULT is not set
1236# CONFIG_DEBUG_HUNT_FOR_ZERO is not set 1205# CONFIG_DEBUG_HUNT_FOR_ZERO is not set
1237CONFIG_DEBUG_BFIN_HWTRACE_ON=y 1206CONFIG_DEBUG_BFIN_HWTRACE_ON=y
1238CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 1207CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
@@ -1250,13 +1219,94 @@ CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION=0
1250# 1219#
1251# CONFIG_KEYS is not set 1220# CONFIG_KEYS is not set
1252CONFIG_SECURITY=y 1221CONFIG_SECURITY=y
1222# CONFIG_SECURITYFS is not set
1253# CONFIG_SECURITY_NETWORK is not set 1223# CONFIG_SECURITY_NETWORK is not set
1254CONFIG_SECURITY_CAPABILITIES=y 1224# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1225CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
1226CONFIG_CRYPTO=y
1227
1228#
1229# Crypto core or helper
1230#
1231# CONFIG_CRYPTO_FIPS is not set
1232# CONFIG_CRYPTO_MANAGER is not set
1233# CONFIG_CRYPTO_GF128MUL is not set
1234# CONFIG_CRYPTO_NULL is not set
1235# CONFIG_CRYPTO_CRYPTD is not set
1236# CONFIG_CRYPTO_AUTHENC is not set
1237# CONFIG_CRYPTO_TEST is not set
1238
1239#
1240# Authenticated Encryption with Associated Data
1241#
1242# CONFIG_CRYPTO_CCM is not set
1243# CONFIG_CRYPTO_GCM is not set
1244# CONFIG_CRYPTO_SEQIV is not set
1245
1246#
1247# Block modes
1248#
1249# CONFIG_CRYPTO_CBC is not set
1250# CONFIG_CRYPTO_CTR is not set
1251# CONFIG_CRYPTO_CTS is not set
1252# CONFIG_CRYPTO_ECB is not set
1253# CONFIG_CRYPTO_LRW is not set
1254# CONFIG_CRYPTO_PCBC is not set
1255# CONFIG_CRYPTO_XTS is not set
1256
1257#
1258# Hash modes
1259#
1260# CONFIG_CRYPTO_HMAC is not set
1261# CONFIG_CRYPTO_XCBC is not set
1262
1263#
1264# Digest
1265#
1266# CONFIG_CRYPTO_CRC32C is not set
1267# CONFIG_CRYPTO_MD4 is not set
1268# CONFIG_CRYPTO_MD5 is not set
1269# CONFIG_CRYPTO_MICHAEL_MIC is not set
1270# CONFIG_CRYPTO_RMD128 is not set
1271# CONFIG_CRYPTO_RMD160 is not set
1272# CONFIG_CRYPTO_RMD256 is not set
1273# CONFIG_CRYPTO_RMD320 is not set
1274# CONFIG_CRYPTO_SHA1 is not set
1275# CONFIG_CRYPTO_SHA256 is not set
1276# CONFIG_CRYPTO_SHA512 is not set
1277# CONFIG_CRYPTO_TGR192 is not set
1278# CONFIG_CRYPTO_WP512 is not set
1279
1280#
1281# Ciphers
1282#
1283# CONFIG_CRYPTO_AES is not set
1284# CONFIG_CRYPTO_ANUBIS is not set
1285# CONFIG_CRYPTO_ARC4 is not set
1286# CONFIG_CRYPTO_BLOWFISH is not set
1287# CONFIG_CRYPTO_CAMELLIA is not set
1288# CONFIG_CRYPTO_CAST5 is not set
1289# CONFIG_CRYPTO_CAST6 is not set
1290# CONFIG_CRYPTO_DES is not set
1291# CONFIG_CRYPTO_FCRYPT is not set
1292# CONFIG_CRYPTO_KHAZAD is not set
1293# CONFIG_CRYPTO_SALSA20 is not set
1294# CONFIG_CRYPTO_SEED is not set
1295# CONFIG_CRYPTO_SERPENT is not set
1296# CONFIG_CRYPTO_TEA is not set
1297# CONFIG_CRYPTO_TWOFISH is not set
1298
1299#
1300# Compression
1301#
1302# CONFIG_CRYPTO_DEFLATE is not set
1303# CONFIG_CRYPTO_LZO is not set
1255 1304
1256# 1305#
1257# Cryptographic options 1306# Random Number Generation
1258# 1307#
1259# CONFIG_CRYPTO is not set 1308# CONFIG_CRYPTO_ANSI_CPRNG is not set
1309CONFIG_CRYPTO_HW=y
1260 1310
1261# 1311#
1262# Library routines 1312# Library routines
@@ -1264,8 +1314,10 @@ CONFIG_SECURITY_CAPABILITIES=y
1264CONFIG_BITREVERSE=y 1314CONFIG_BITREVERSE=y
1265CONFIG_CRC_CCITT=m 1315CONFIG_CRC_CCITT=m
1266# CONFIG_CRC16 is not set 1316# CONFIG_CRC16 is not set
1317# CONFIG_CRC_T10DIF is not set
1267# CONFIG_CRC_ITU_T is not set 1318# CONFIG_CRC_ITU_T is not set
1268CONFIG_CRC32=y 1319CONFIG_CRC32=y
1320# CONFIG_CRC7 is not set
1269# CONFIG_LIBCRC32C is not set 1321# CONFIG_LIBCRC32C is not set
1270CONFIG_ZLIB_INFLATE=y 1322CONFIG_ZLIB_INFLATE=y
1271CONFIG_PLIST=y 1323CONFIG_PLIST=y
diff --git a/arch/blackfin/configs/SRV1_defconfig b/arch/blackfin/configs/SRV1_defconfig
index b1309f878fcd..7c8250d6fa66 100644
--- a/arch/blackfin/configs/SRV1_defconfig
+++ b/arch/blackfin/configs/SRV1_defconfig
@@ -59,7 +59,7 @@ CONFIG_KALLSYMS_ALL=y
59CONFIG_HOTPLUG=y 59CONFIG_HOTPLUG=y
60CONFIG_PRINTK=y 60CONFIG_PRINTK=y
61CONFIG_BUG=y 61CONFIG_BUG=y
62CONFIG_ELF_CORE=y 62# CONFIG_ELF_CORE is not set
63CONFIG_BASE_FULL=y 63CONFIG_BASE_FULL=y
64CONFIG_FUTEX=y 64CONFIG_FUTEX=y
65CONFIG_ANON_INODES=y 65CONFIG_ANON_INODES=y
@@ -172,14 +172,14 @@ CONFIG_IRQ_UART1_RX=10
172CONFIG_IRQ_UART1_TX=10 172CONFIG_IRQ_UART1_TX=10
173CONFIG_IRQ_MAC_RX=11 173CONFIG_IRQ_MAC_RX=11
174CONFIG_IRQ_MAC_TX=11 174CONFIG_IRQ_MAC_TX=11
175CONFIG_IRQ_TMR0=12 175CONFIG_IRQ_TIMER0=12
176CONFIG_IRQ_TMR1=12 176CONFIG_IRQ_TIMER1=12
177CONFIG_IRQ_TMR2=12 177CONFIG_IRQ_TIMER2=12
178CONFIG_IRQ_TMR3=12 178CONFIG_IRQ_TIMER3=12
179CONFIG_IRQ_TMR4=12 179CONFIG_IRQ_TIMER4=12
180CONFIG_IRQ_TMR5=12 180CONFIG_IRQ_TIMER5=12
181CONFIG_IRQ_TMR6=12 181CONFIG_IRQ_TIMER6=12
182CONFIG_IRQ_TMR7=12 182CONFIG_IRQ_TIMER7=12
183CONFIG_IRQ_PORTG_INTB=12 183CONFIG_IRQ_PORTG_INTB=12
184CONFIG_IRQ_MEM_DMA0=13 184CONFIG_IRQ_MEM_DMA0=13
185CONFIG_IRQ_MEM_DMA1=13 185CONFIG_IRQ_MEM_DMA1=13
@@ -271,7 +271,6 @@ CONFIG_SPLIT_PTLOCK_CPUS=4
271# CONFIG_RESOURCES_64BIT is not set 271# CONFIG_RESOURCES_64BIT is not set
272CONFIG_ZONE_DMA_FLAG=1 272CONFIG_ZONE_DMA_FLAG=1
273CONFIG_LARGE_ALLOCS=y 273CONFIG_LARGE_ALLOCS=y
274CONFIG_BFIN_DMA_5XX=y
275CONFIG_DMA_UNCACHED_2M=y 274CONFIG_DMA_UNCACHED_2M=y
276# CONFIG_DMA_UNCACHED_1M is not set 275# CONFIG_DMA_UNCACHED_1M is not set
277# CONFIG_DMA_UNCACHED_NONE is not set 276# CONFIG_DMA_UNCACHED_NONE is not set
@@ -786,7 +785,7 @@ CONFIG_I2C_CHARDEV=y
786# 785#
787# CONFIG_I2C_BLACKFIN_GPIO is not set 786# CONFIG_I2C_BLACKFIN_GPIO is not set
788CONFIG_I2C_BLACKFIN_TWI=y 787CONFIG_I2C_BLACKFIN_TWI=y
789CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=50 788CONFIG_I2C_BLACKFIN_TWI_CLK_KHZ=100
790# CONFIG_I2C_GPIO is not set 789# CONFIG_I2C_GPIO is not set
791# CONFIG_I2C_OCORES is not set 790# CONFIG_I2C_OCORES is not set
792# CONFIG_I2C_PARPORT_LIGHT is not set 791# CONFIG_I2C_PARPORT_LIGHT is not set
diff --git a/arch/blackfin/configs/TCM-BF537_defconfig b/arch/blackfin/configs/TCM-BF537_defconfig
index c482ee171f9e..9af522c7dadf 100644
--- a/arch/blackfin/configs/TCM-BF537_defconfig
+++ b/arch/blackfin/configs/TCM-BF537_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24.7 3# Linux kernel version: 2.6.28-rc2
4# Thu Jul 31 00:53:15 2008 4# Tue Jan 6 09:22:17 2009
5# 5#
6# CONFIG_MMU is not set 6# CONFIG_MMU is not set
7# CONFIG_FPU is not set 7# CONFIG_FPU is not set
@@ -9,7 +9,6 @@ CONFIG_RWSEM_GENERIC_SPINLOCK=y
9# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set 9# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
10CONFIG_BLACKFIN=y 10CONFIG_BLACKFIN=y
11CONFIG_ZONE_DMA=y 11CONFIG_ZONE_DMA=y
12CONFIG_SEMAPHORE_SLEEPERS=y
13CONFIG_GENERIC_FIND_NEXT_BIT=y 12CONFIG_GENERIC_FIND_NEXT_BIT=y
14CONFIG_GENERIC_HWEIGHT=y 13CONFIG_GENERIC_HWEIGHT=y
15CONFIG_GENERIC_HARDIRQS=y 14CONFIG_GENERIC_HARDIRQS=y
@@ -30,17 +29,14 @@ CONFIG_LOCALVERSION_AUTO=y
30CONFIG_SYSVIPC=y 29CONFIG_SYSVIPC=y
31CONFIG_SYSVIPC_SYSCTL=y 30CONFIG_SYSVIPC_SYSCTL=y
32# CONFIG_BSD_PROCESS_ACCT is not set 31# CONFIG_BSD_PROCESS_ACCT is not set
33# CONFIG_USER_NS is not set
34# CONFIG_PID_NS is not set
35CONFIG_IKCONFIG=y 32CONFIG_IKCONFIG=y
36CONFIG_IKCONFIG_PROC=y 33CONFIG_IKCONFIG_PROC=y
37CONFIG_LOG_BUF_SHIFT=14 34CONFIG_LOG_BUF_SHIFT=14
38# CONFIG_CGROUPS is not set 35# CONFIG_CGROUPS is not set
39CONFIG_FAIR_GROUP_SCHED=y 36# CONFIG_GROUP_SCHED is not set
40CONFIG_FAIR_USER_SCHED=y 37# CONFIG_SYSFS_DEPRECATED_V2 is not set
41# CONFIG_FAIR_CGROUP_SCHED is not set
42CONFIG_SYSFS_DEPRECATED=y
43# CONFIG_RELAY is not set 38# CONFIG_RELAY is not set
39# CONFIG_NAMESPACES is not set
44# CONFIG_BLK_DEV_INITRD is not set 40# CONFIG_BLK_DEV_INITRD is not set
45# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set 41# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
46CONFIG_SYSCTL=y 42CONFIG_SYSCTL=y
@@ -52,22 +48,30 @@ CONFIG_KALLSYMS=y
52# CONFIG_HOTPLUG is not set 48# CONFIG_HOTPLUG is not set
53CONFIG_PRINTK=y 49CONFIG_PRINTK=y
54CONFIG_BUG=y 50CONFIG_BUG=y
55CONFIG_ELF_CORE=y 51# CONFIG_ELF_CORE is not set
52CONFIG_COMPAT_BRK=y
56CONFIG_BASE_FULL=y 53CONFIG_BASE_FULL=y
57CONFIG_FUTEX=y 54CONFIG_FUTEX=y
58CONFIG_ANON_INODES=y 55CONFIG_ANON_INODES=y
59CONFIG_EPOLL=y 56CONFIG_EPOLL=y
60CONFIG_SIGNALFD=y 57CONFIG_SIGNALFD=y
58CONFIG_TIMERFD=y
61CONFIG_EVENTFD=y 59CONFIG_EVENTFD=y
60CONFIG_AIO=y
62CONFIG_VM_EVENT_COUNTERS=y 61CONFIG_VM_EVENT_COUNTERS=y
63CONFIG_SLAB=y 62CONFIG_SLAB=y
64# CONFIG_SLUB is not set 63# CONFIG_SLUB is not set
65# CONFIG_SLOB is not set 64# CONFIG_SLOB is not set
65# CONFIG_PROFILING is not set
66# CONFIG_MARKERS is not set
67CONFIG_HAVE_OPROFILE=y
68# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
66CONFIG_SLABINFO=y 69CONFIG_SLABINFO=y
67CONFIG_RT_MUTEXES=y 70CONFIG_RT_MUTEXES=y
68CONFIG_TINY_SHMEM=y 71CONFIG_TINY_SHMEM=y
69CONFIG_BASE_SMALL=0 72CONFIG_BASE_SMALL=0
70CONFIG_MODULES=y 73CONFIG_MODULES=y
74# CONFIG_MODULE_FORCE_LOAD is not set
71CONFIG_MODULE_UNLOAD=y 75CONFIG_MODULE_UNLOAD=y
72# CONFIG_MODULE_FORCE_UNLOAD is not set 76# CONFIG_MODULE_FORCE_UNLOAD is not set
73# CONFIG_MODVERSIONS is not set 77# CONFIG_MODVERSIONS is not set
@@ -78,6 +82,7 @@ CONFIG_BLOCK=y
78# CONFIG_BLK_DEV_IO_TRACE is not set 82# CONFIG_BLK_DEV_IO_TRACE is not set
79# CONFIG_LSF is not set 83# CONFIG_LSF is not set
80# CONFIG_BLK_DEV_BSG is not set 84# CONFIG_BLK_DEV_BSG is not set
85# CONFIG_BLK_DEV_INTEGRITY is not set
81 86
82# 87#
83# IO Schedulers 88# IO Schedulers
@@ -91,9 +96,11 @@ CONFIG_IOSCHED_CFQ=y
91# CONFIG_DEFAULT_CFQ is not set 96# CONFIG_DEFAULT_CFQ is not set
92CONFIG_DEFAULT_NOOP=y 97CONFIG_DEFAULT_NOOP=y
93CONFIG_DEFAULT_IOSCHED="noop" 98CONFIG_DEFAULT_IOSCHED="noop"
99CONFIG_CLASSIC_RCU=y
94CONFIG_PREEMPT_NONE=y 100CONFIG_PREEMPT_NONE=y
95# CONFIG_PREEMPT_VOLUNTARY is not set 101# CONFIG_PREEMPT_VOLUNTARY is not set
96# CONFIG_PREEMPT is not set 102# CONFIG_PREEMPT is not set
103# CONFIG_FREEZER is not set
97 104
98# 105#
99# Blackfin Processor Options 106# Blackfin Processor Options
@@ -102,6 +109,10 @@ CONFIG_PREEMPT_NONE=y
102# 109#
103# Processor and Board Settings 110# Processor and Board Settings
104# 111#
112# CONFIG_BF512 is not set
113# CONFIG_BF514 is not set
114# CONFIG_BF516 is not set
115# CONFIG_BF518 is not set
105# CONFIG_BF522 is not set 116# CONFIG_BF522 is not set
106# CONFIG_BF523 is not set 117# CONFIG_BF523 is not set
107# CONFIG_BF524 is not set 118# CONFIG_BF524 is not set
@@ -114,18 +125,23 @@ CONFIG_PREEMPT_NONE=y
114# CONFIG_BF534 is not set 125# CONFIG_BF534 is not set
115# CONFIG_BF536 is not set 126# CONFIG_BF536 is not set
116CONFIG_BF537=y 127CONFIG_BF537=y
128# CONFIG_BF538 is not set
129# CONFIG_BF539 is not set
117# CONFIG_BF542 is not set 130# CONFIG_BF542 is not set
118# CONFIG_BF544 is not set 131# CONFIG_BF544 is not set
119# CONFIG_BF547 is not set 132# CONFIG_BF547 is not set
120# CONFIG_BF548 is not set 133# CONFIG_BF548 is not set
121# CONFIG_BF549 is not set 134# CONFIG_BF549 is not set
122# CONFIG_BF561 is not set 135# CONFIG_BF561 is not set
136CONFIG_BF_REV_MIN=2
137CONFIG_BF_REV_MAX=3
123# CONFIG_BF_REV_0_0 is not set 138# CONFIG_BF_REV_0_0 is not set
124# CONFIG_BF_REV_0_1 is not set 139# CONFIG_BF_REV_0_1 is not set
125CONFIG_BF_REV_0_2=y 140CONFIG_BF_REV_0_2=y
126# CONFIG_BF_REV_0_3 is not set 141# CONFIG_BF_REV_0_3 is not set
127# CONFIG_BF_REV_0_4 is not set 142# CONFIG_BF_REV_0_4 is not set
128# CONFIG_BF_REV_0_5 is not set 143# CONFIG_BF_REV_0_5 is not set
144# CONFIG_BF_REV_0_6 is not set
129# CONFIG_BF_REV_ANY is not set 145# CONFIG_BF_REV_ANY is not set
130# CONFIG_BF_REV_NONE is not set 146# CONFIG_BF_REV_NONE is not set
131CONFIG_BF53x=y 147CONFIG_BF53x=y
@@ -137,25 +153,25 @@ CONFIG_IRQ_SPORT0_TX=9
137CONFIG_IRQ_SPORT1_RX=9 153CONFIG_IRQ_SPORT1_RX=9
138CONFIG_IRQ_SPORT1_TX=9 154CONFIG_IRQ_SPORT1_TX=9
139CONFIG_IRQ_TWI=10 155CONFIG_IRQ_TWI=10
140CONFIG_IRQ_SPI=10
141CONFIG_IRQ_UART0_RX=10 156CONFIG_IRQ_UART0_RX=10
142CONFIG_IRQ_UART0_TX=10 157CONFIG_IRQ_UART0_TX=10
143CONFIG_IRQ_UART1_RX=10 158CONFIG_IRQ_UART1_RX=10
144CONFIG_IRQ_UART1_TX=10 159CONFIG_IRQ_UART1_TX=10
145CONFIG_IRQ_MAC_RX=11 160CONFIG_IRQ_MAC_RX=11
146CONFIG_IRQ_MAC_TX=11 161CONFIG_IRQ_MAC_TX=11
147CONFIG_IRQ_TMR0=12 162CONFIG_IRQ_TIMER0=12
148CONFIG_IRQ_TMR1=12 163CONFIG_IRQ_TIMER1=12
149CONFIG_IRQ_TMR2=12 164CONFIG_IRQ_TIMER2=12
150CONFIG_IRQ_TMR3=12 165CONFIG_IRQ_TIMER3=12
151CONFIG_IRQ_TMR4=12 166CONFIG_IRQ_TIMER4=12
152CONFIG_IRQ_TMR5=12 167CONFIG_IRQ_TIMER5=12
153CONFIG_IRQ_TMR6=12 168CONFIG_IRQ_TIMER6=12
154CONFIG_IRQ_TMR7=12 169CONFIG_IRQ_TIMER7=12
155CONFIG_IRQ_PORTG_INTB=12 170CONFIG_IRQ_PORTG_INTB=12
156CONFIG_IRQ_MEM_DMA0=13 171CONFIG_IRQ_MEM_DMA0=13
157CONFIG_IRQ_MEM_DMA1=13 172CONFIG_IRQ_MEM_DMA1=13
158CONFIG_IRQ_WATCH=13 173CONFIG_IRQ_WATCH=13
174CONFIG_IRQ_SPI=10
159# CONFIG_BFIN537_STAMP is not set 175# CONFIG_BFIN537_STAMP is not set
160# CONFIG_BFIN537_BLUETECHNIX_CM is not set 176# CONFIG_BFIN537_BLUETECHNIX_CM is not set
161CONFIG_BFIN537_BLUETECHNIX_TCM=y 177CONFIG_BFIN537_BLUETECHNIX_TCM=y
@@ -191,7 +207,6 @@ CONFIG_BOOT_LOAD=0x1000
191# 207#
192CONFIG_CLKIN_HZ=25000000 208CONFIG_CLKIN_HZ=25000000
193# CONFIG_BFIN_KERNEL_CLOCK is not set 209# CONFIG_BFIN_KERNEL_CLOCK is not set
194CONFIG_MAX_MEM_SIZE=32
195CONFIG_MAX_VCO_HZ=600000000 210CONFIG_MAX_VCO_HZ=600000000
196CONFIG_MIN_VCO_HZ=50000000 211CONFIG_MIN_VCO_HZ=50000000
197CONFIG_MAX_SCLK_HZ=133333333 212CONFIG_MAX_SCLK_HZ=133333333
@@ -205,10 +220,10 @@ CONFIG_HZ_250=y
205# CONFIG_HZ_300 is not set 220# CONFIG_HZ_300 is not set
206# CONFIG_HZ_1000 is not set 221# CONFIG_HZ_1000 is not set
207CONFIG_HZ=250 222CONFIG_HZ=250
223# CONFIG_SCHED_HRTICK is not set
208CONFIG_GENERIC_TIME=y 224CONFIG_GENERIC_TIME=y
209CONFIG_GENERIC_CLOCKEVENTS=y 225CONFIG_GENERIC_CLOCKEVENTS=y
210# CONFIG_CYCLES_CLOCKSOURCE is not set 226# CONFIG_CYCLES_CLOCKSOURCE is not set
211# CONFIG_TICK_ONESHOT is not set
212# CONFIG_NO_HZ is not set 227# CONFIG_NO_HZ is not set
213# CONFIG_HIGH_RES_TIMERS is not set 228# CONFIG_HIGH_RES_TIMERS is not set
214CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 229CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
@@ -242,6 +257,12 @@ CONFIG_IP_CHECKSUM_L1=y
242CONFIG_CACHELINE_ALIGNED_L1=y 257CONFIG_CACHELINE_ALIGNED_L1=y
243CONFIG_SYSCALL_TAB_L1=y 258CONFIG_SYSCALL_TAB_L1=y
244CONFIG_CPLB_SWITCH_TAB_L1=y 259CONFIG_CPLB_SWITCH_TAB_L1=y
260CONFIG_APP_STACK_L1=y
261
262#
263# Speed Optimizations
264#
265CONFIG_BFIN_INS_LOWOVERHEAD=y
245CONFIG_RAMKERNEL=y 266CONFIG_RAMKERNEL=y
246# CONFIG_ROMKERNEL is not set 267# CONFIG_ROMKERNEL is not set
247CONFIG_SELECT_MEMORY_MODEL=y 268CONFIG_SELECT_MEMORY_MODEL=y
@@ -250,14 +271,13 @@ CONFIG_FLATMEM_MANUAL=y
250# CONFIG_SPARSEMEM_MANUAL is not set 271# CONFIG_SPARSEMEM_MANUAL is not set
251CONFIG_FLATMEM=y 272CONFIG_FLATMEM=y
252CONFIG_FLAT_NODE_MEM_MAP=y 273CONFIG_FLAT_NODE_MEM_MAP=y
253# CONFIG_SPARSEMEM_STATIC is not set 274CONFIG_PAGEFLAGS_EXTENDED=y
254# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
255CONFIG_SPLIT_PTLOCK_CPUS=4 275CONFIG_SPLIT_PTLOCK_CPUS=4
256# CONFIG_RESOURCES_64BIT is not set 276# CONFIG_RESOURCES_64BIT is not set
277# CONFIG_PHYS_ADDR_T_64BIT is not set
257CONFIG_ZONE_DMA_FLAG=1 278CONFIG_ZONE_DMA_FLAG=1
258CONFIG_VIRT_TO_BUS=y 279CONFIG_VIRT_TO_BUS=y
259# CONFIG_BFIN_GPTIMERS is not set 280# CONFIG_BFIN_GPTIMERS is not set
260CONFIG_BFIN_DMA_5XX=y
261# CONFIG_DMA_UNCACHED_4M is not set 281# CONFIG_DMA_UNCACHED_4M is not set
262# CONFIG_DMA_UNCACHED_2M is not set 282# CONFIG_DMA_UNCACHED_2M is not set
263CONFIG_DMA_UNCACHED_1M=y 283CONFIG_DMA_UNCACHED_1M=y
@@ -300,7 +320,6 @@ CONFIG_BANK_3=0xFFC2
300# 320#
301# Bus options (PCI, PCMCIA, EISA, MCA, ISA) 321# Bus options (PCI, PCMCIA, EISA, MCA, ISA)
302# 322#
303# CONFIG_PCI is not set
304# CONFIG_ARCH_SUPPORTS_MSI is not set 323# CONFIG_ARCH_SUPPORTS_MSI is not set
305 324
306# 325#
@@ -310,23 +329,20 @@ CONFIG_BINFMT_ELF_FDPIC=y
310CONFIG_BINFMT_FLAT=y 329CONFIG_BINFMT_FLAT=y
311CONFIG_BINFMT_ZFLAT=y 330CONFIG_BINFMT_ZFLAT=y
312CONFIG_BINFMT_SHARED_FLAT=y 331CONFIG_BINFMT_SHARED_FLAT=y
332# CONFIG_HAVE_AOUT is not set
313# CONFIG_BINFMT_MISC is not set 333# CONFIG_BINFMT_MISC is not set
314 334
315# 335#
316# Power management options 336# Power management options
317# 337#
318# CONFIG_PM is not set 338# CONFIG_PM is not set
319CONFIG_SUSPEND_UP_POSSIBLE=y 339CONFIG_ARCH_SUSPEND_POSSIBLE=y
320# CONFIG_PM_WAKEUP_BY_GPIO is not set 340# CONFIG_PM_WAKEUP_BY_GPIO is not set
321 341
322# 342#
323# CPU Frequency scaling 343# CPU Frequency scaling
324# 344#
325# CONFIG_CPU_FREQ is not set 345# CONFIG_CPU_FREQ is not set
326
327#
328# Networking
329#
330# CONFIG_NET is not set 346# CONFIG_NET is not set
331 347
332# 348#
@@ -345,6 +361,7 @@ CONFIG_MTD=y
345CONFIG_MTD_PARTITIONS=y 361CONFIG_MTD_PARTITIONS=y
346# CONFIG_MTD_REDBOOT_PARTS is not set 362# CONFIG_MTD_REDBOOT_PARTS is not set
347# CONFIG_MTD_CMDLINE_PARTS is not set 363# CONFIG_MTD_CMDLINE_PARTS is not set
364# CONFIG_MTD_AR7_PARTS is not set
348 365
349# 366#
350# User Modules And Translation Layers 367# User Modules And Translation Layers
@@ -362,8 +379,10 @@ CONFIG_MTD_BLOCK=y
362# 379#
363# RAM/ROM/Flash chip drivers 380# RAM/ROM/Flash chip drivers
364# 381#
365# CONFIG_MTD_CFI is not set 382CONFIG_MTD_CFI=y
366# CONFIG_MTD_JEDECPROBE is not set 383# CONFIG_MTD_JEDECPROBE is not set
384CONFIG_MTD_GEN_PROBE=y
385# CONFIG_MTD_CFI_ADV_OPTIONS is not set
367CONFIG_MTD_MAP_BANK_WIDTH_1=y 386CONFIG_MTD_MAP_BANK_WIDTH_1=y
368CONFIG_MTD_MAP_BANK_WIDTH_2=y 387CONFIG_MTD_MAP_BANK_WIDTH_2=y
369CONFIG_MTD_MAP_BANK_WIDTH_4=y 388CONFIG_MTD_MAP_BANK_WIDTH_4=y
@@ -374,6 +393,10 @@ CONFIG_MTD_CFI_I1=y
374CONFIG_MTD_CFI_I2=y 393CONFIG_MTD_CFI_I2=y
375# CONFIG_MTD_CFI_I4 is not set 394# CONFIG_MTD_CFI_I4 is not set
376# CONFIG_MTD_CFI_I8 is not set 395# CONFIG_MTD_CFI_I8 is not set
396CONFIG_MTD_CFI_INTELEXT=y
397# CONFIG_MTD_CFI_AMDSTD is not set
398# CONFIG_MTD_CFI_STAA is not set
399CONFIG_MTD_CFI_UTIL=y
377CONFIG_MTD_RAM=y 400CONFIG_MTD_RAM=y
378# CONFIG_MTD_ROM is not set 401# CONFIG_MTD_ROM is not set
379# CONFIG_MTD_ABSENT is not set 402# CONFIG_MTD_ABSENT is not set
@@ -381,8 +404,9 @@ CONFIG_MTD_RAM=y
381# 404#
382# Mapping drivers for chip access 405# Mapping drivers for chip access
383# 406#
384# CONFIG_MTD_COMPLEX_MAPPINGS is not set 407CONFIG_MTD_COMPLEX_MAPPINGS=y
385# CONFIG_MTD_GPIO_ADDR is not set 408# CONFIG_MTD_PHYSMAP is not set
409CONFIG_MTD_GPIO_ADDR=y
386CONFIG_MTD_UCLINUX=y 410CONFIG_MTD_UCLINUX=y
387# CONFIG_MTD_PLATRAM is not set 411# CONFIG_MTD_PLATRAM is not set
388 412
@@ -416,10 +440,13 @@ CONFIG_BLK_DEV=y
416CONFIG_BLK_DEV_RAM=y 440CONFIG_BLK_DEV_RAM=y
417CONFIG_BLK_DEV_RAM_COUNT=16 441CONFIG_BLK_DEV_RAM_COUNT=16
418CONFIG_BLK_DEV_RAM_SIZE=4096 442CONFIG_BLK_DEV_RAM_SIZE=4096
419CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 443# CONFIG_BLK_DEV_XIP is not set
420# CONFIG_CDROM_PKTCDVD is not set 444# CONFIG_CDROM_PKTCDVD is not set
445# CONFIG_BLK_DEV_HD is not set
421CONFIG_MISC_DEVICES=y 446CONFIG_MISC_DEVICES=y
422# CONFIG_EEPROM_93CX6 is not set 447# CONFIG_EEPROM_93CX6 is not set
448# CONFIG_ENCLOSURE_SERVICES is not set
449CONFIG_HAVE_IDE=y
423# CONFIG_IDE is not set 450# CONFIG_IDE is not set
424 451
425# 452#
@@ -454,8 +481,11 @@ CONFIG_MISC_DEVICES=y
454# CONFIG_BF5xx_PPI is not set 481# CONFIG_BF5xx_PPI is not set
455CONFIG_BFIN_SPORT=y 482CONFIG_BFIN_SPORT=y
456# CONFIG_BFIN_TIMER_LATENCY is not set 483# CONFIG_BFIN_TIMER_LATENCY is not set
484CONFIG_BFIN_DMA_INTERFACE=m
457# CONFIG_SIMPLE_GPIO is not set 485# CONFIG_SIMPLE_GPIO is not set
458# CONFIG_VT is not set 486# CONFIG_VT is not set
487# CONFIG_DEVKMEM is not set
488# CONFIG_BFIN_JTAG_COMM is not set
459# CONFIG_SERIAL_NONSTANDARD is not set 489# CONFIG_SERIAL_NONSTANDARD is not set
460 490
461# 491#
@@ -486,15 +516,10 @@ CONFIG_UNIX98_PTYS=y
486# CONFIG_CAN4LINUX is not set 516# CONFIG_CAN4LINUX is not set
487# CONFIG_IPMI_HANDLER is not set 517# CONFIG_IPMI_HANDLER is not set
488# CONFIG_HW_RANDOM is not set 518# CONFIG_HW_RANDOM is not set
489# CONFIG_GEN_RTC is not set
490# CONFIG_R3964 is not set 519# CONFIG_R3964 is not set
491# CONFIG_RAW_DRIVER is not set 520# CONFIG_RAW_DRIVER is not set
492# CONFIG_TCG_TPM is not set 521# CONFIG_TCG_TPM is not set
493# CONFIG_I2C is not set 522# CONFIG_I2C is not set
494
495#
496# SPI support
497#
498CONFIG_SPI=y 523CONFIG_SPI=y
499CONFIG_SPI_MASTER=y 524CONFIG_SPI_MASTER=y
500 525
@@ -502,6 +527,7 @@ CONFIG_SPI_MASTER=y
502# SPI Master Controller Drivers 527# SPI Master Controller Drivers
503# 528#
504CONFIG_SPI_BFIN=y 529CONFIG_SPI_BFIN=y
530# CONFIG_SPI_BFIN_LOCK is not set
505# CONFIG_SPI_BITBANG is not set 531# CONFIG_SPI_BITBANG is not set
506 532
507# 533#
@@ -510,9 +536,13 @@ CONFIG_SPI_BFIN=y
510# CONFIG_SPI_AT25 is not set 536# CONFIG_SPI_AT25 is not set
511# CONFIG_SPI_SPIDEV is not set 537# CONFIG_SPI_SPIDEV is not set
512# CONFIG_SPI_TLE62X0 is not set 538# CONFIG_SPI_TLE62X0 is not set
539CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
540# CONFIG_GPIOLIB is not set
513# CONFIG_W1 is not set 541# CONFIG_W1 is not set
514# CONFIG_POWER_SUPPLY is not set 542# CONFIG_POWER_SUPPLY is not set
515# CONFIG_HWMON is not set 543# CONFIG_HWMON is not set
544# CONFIG_THERMAL is not set
545# CONFIG_THERMAL_HWMON is not set
516CONFIG_WATCHDOG=y 546CONFIG_WATCHDOG=y
517# CONFIG_WATCHDOG_NOWAYOUT is not set 547# CONFIG_WATCHDOG_NOWAYOUT is not set
518 548
@@ -523,20 +553,27 @@ CONFIG_WATCHDOG=y
523CONFIG_BFIN_WDT=y 553CONFIG_BFIN_WDT=y
524 554
525# 555#
526# Sonics Silicon Backplane
527#
528CONFIG_SSB_POSSIBLE=y
529# CONFIG_SSB is not set
530
531#
532# Multifunction device drivers 556# Multifunction device drivers
533# 557#
558# CONFIG_MFD_CORE is not set
534# CONFIG_MFD_SM501 is not set 559# CONFIG_MFD_SM501 is not set
560# CONFIG_HTC_PASIC3 is not set
561# CONFIG_MFD_TMIO is not set
562# CONFIG_MFD_WM8400 is not set
535 563
536# 564#
537# Multimedia devices 565# Multimedia devices
538# 566#
567
568#
569# Multimedia core support
570#
539# CONFIG_VIDEO_DEV is not set 571# CONFIG_VIDEO_DEV is not set
572# CONFIG_VIDEO_MEDIA is not set
573
574#
575# Multimedia drivers
576#
540# CONFIG_DAB is not set 577# CONFIG_DAB is not set
541 578
542# 579#
@@ -551,20 +588,16 @@ CONFIG_SSB_POSSIBLE=y
551# Display device support 588# Display device support
552# 589#
553# CONFIG_DISPLAY_SUPPORT is not set 590# CONFIG_DISPLAY_SUPPORT is not set
554
555#
556# Sound
557#
558# CONFIG_SOUND is not set 591# CONFIG_SOUND is not set
559# CONFIG_USB_SUPPORT is not set 592# CONFIG_USB_SUPPORT is not set
560# CONFIG_MMC is not set 593# CONFIG_MMC is not set
594# CONFIG_MEMSTICK is not set
561# CONFIG_NEW_LEDS is not set 595# CONFIG_NEW_LEDS is not set
596# CONFIG_ACCESSIBILITY is not set
562# CONFIG_RTC_CLASS is not set 597# CONFIG_RTC_CLASS is not set
563 598# CONFIG_DMADEVICES is not set
564#
565# Userspace I/O
566#
567# CONFIG_UIO is not set 599# CONFIG_UIO is not set
600# CONFIG_STAGING is not set
568 601
569# 602#
570# File systems 603# File systems
@@ -574,19 +607,17 @@ CONFIG_EXT2_FS_XATTR=y
574# CONFIG_EXT2_FS_POSIX_ACL is not set 607# CONFIG_EXT2_FS_POSIX_ACL is not set
575# CONFIG_EXT2_FS_SECURITY is not set 608# CONFIG_EXT2_FS_SECURITY is not set
576# CONFIG_EXT3_FS is not set 609# CONFIG_EXT3_FS is not set
577# CONFIG_EXT4DEV_FS is not set 610# CONFIG_EXT4_FS is not set
578CONFIG_FS_MBCACHE=y 611CONFIG_FS_MBCACHE=y
579# CONFIG_REISERFS_FS is not set 612# CONFIG_REISERFS_FS is not set
580# CONFIG_JFS_FS is not set 613# CONFIG_JFS_FS is not set
581# CONFIG_FS_POSIX_ACL is not set 614# CONFIG_FS_POSIX_ACL is not set
615CONFIG_FILE_LOCKING=y
582# CONFIG_XFS_FS is not set 616# CONFIG_XFS_FS is not set
583# CONFIG_GFS2_FS is not set 617# CONFIG_DNOTIFY is not set
584# CONFIG_MINIX_FS is not set
585# CONFIG_ROMFS_FS is not set
586CONFIG_INOTIFY=y 618CONFIG_INOTIFY=y
587CONFIG_INOTIFY_USER=y 619CONFIG_INOTIFY_USER=y
588# CONFIG_QUOTA is not set 620# CONFIG_QUOTA is not set
589# CONFIG_DNOTIFY is not set
590# CONFIG_AUTOFS_FS is not set 621# CONFIG_AUTOFS_FS is not set
591# CONFIG_AUTOFS4_FS is not set 622# CONFIG_AUTOFS4_FS is not set
592# CONFIG_FUSE_FS is not set 623# CONFIG_FUSE_FS is not set
@@ -628,8 +659,11 @@ CONFIG_SYSFS=y
628# CONFIG_JFFS2_FS is not set 659# CONFIG_JFFS2_FS is not set
629# CONFIG_CRAMFS is not set 660# CONFIG_CRAMFS is not set
630# CONFIG_VXFS_FS is not set 661# CONFIG_VXFS_FS is not set
662# CONFIG_MINIX_FS is not set
663# CONFIG_OMFS_FS is not set
631# CONFIG_HPFS_FS is not set 664# CONFIG_HPFS_FS is not set
632# CONFIG_QNX4FS_FS is not set 665# CONFIG_QNX4FS_FS is not set
666# CONFIG_ROMFS_FS is not set
633# CONFIG_SYSV_FS is not set 667# CONFIG_SYSV_FS is not set
634# CONFIG_UFS_FS is not set 668# CONFIG_UFS_FS is not set
635 669
@@ -639,7 +673,6 @@ CONFIG_SYSFS=y
639# CONFIG_PARTITION_ADVANCED is not set 673# CONFIG_PARTITION_ADVANCED is not set
640CONFIG_MSDOS_PARTITION=y 674CONFIG_MSDOS_PARTITION=y
641# CONFIG_NLS is not set 675# CONFIG_NLS is not set
642# CONFIG_INSTRUMENTATION is not set
643 676
644# 677#
645# Kernel hacking 678# Kernel hacking
@@ -647,14 +680,22 @@ CONFIG_MSDOS_PARTITION=y
647# CONFIG_PRINTK_TIME is not set 680# CONFIG_PRINTK_TIME is not set
648CONFIG_ENABLE_WARN_DEPRECATED=y 681CONFIG_ENABLE_WARN_DEPRECATED=y
649CONFIG_ENABLE_MUST_CHECK=y 682CONFIG_ENABLE_MUST_CHECK=y
683CONFIG_FRAME_WARN=1024
650# CONFIG_MAGIC_SYSRQ is not set 684# CONFIG_MAGIC_SYSRQ is not set
651# CONFIG_UNUSED_SYMBOLS is not set 685# CONFIG_UNUSED_SYMBOLS is not set
652CONFIG_DEBUG_FS=y 686CONFIG_DEBUG_FS=y
653# CONFIG_HEADERS_CHECK is not set 687# CONFIG_HEADERS_CHECK is not set
654# CONFIG_DEBUG_KERNEL is not set 688# CONFIG_DEBUG_KERNEL is not set
655# CONFIG_DEBUG_BUGVERBOSE is not set 689# CONFIG_DEBUG_BUGVERBOSE is not set
690# CONFIG_DEBUG_MEMORY_INIT is not set
691# CONFIG_RCU_CPU_STALL_DETECTOR is not set
692# CONFIG_SYSCTL_SYSCALL_CHECK is not set
693# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
656# CONFIG_SAMPLES is not set 694# CONFIG_SAMPLES is not set
695CONFIG_HAVE_ARCH_KGDB=y
696CONFIG_DEBUG_VERBOSE=y
657CONFIG_DEBUG_MMRS=y 697CONFIG_DEBUG_MMRS=y
698# CONFIG_DEBUG_DOUBLEFAULT is not set
658CONFIG_DEBUG_HUNT_FOR_ZERO=y 699CONFIG_DEBUG_HUNT_FOR_ZERO=y
659CONFIG_DEBUG_BFIN_HWTRACE_ON=y 700CONFIG_DEBUG_BFIN_HWTRACE_ON=y
660CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y 701CONFIG_DEBUG_BFIN_HWTRACE_COMPRESSION_OFF=y
@@ -671,9 +712,8 @@ CONFIG_ACCESS_CHECK=y
671# Security options 712# Security options
672# 713#
673# CONFIG_KEYS is not set 714# CONFIG_KEYS is not set
674CONFIG_SECURITY=y 715# CONFIG_SECURITY is not set
675# CONFIG_SECURITY_NETWORK is not set 716# CONFIG_SECURITYFS is not set
676CONFIG_SECURITY_CAPABILITIES=y
677# CONFIG_SECURITY_FILE_CAPABILITIES is not set 717# CONFIG_SECURITY_FILE_CAPABILITIES is not set
678# CONFIG_CRYPTO is not set 718# CONFIG_CRYPTO is not set
679 719
@@ -682,6 +722,7 @@ CONFIG_SECURITY_CAPABILITIES=y
682# 722#
683# CONFIG_CRC_CCITT is not set 723# CONFIG_CRC_CCITT is not set
684# CONFIG_CRC16 is not set 724# CONFIG_CRC16 is not set
725# CONFIG_CRC_T10DIF is not set
685# CONFIG_CRC_ITU_T is not set 726# CONFIG_CRC_ITU_T is not set
686# CONFIG_CRC32 is not set 727# CONFIG_CRC32 is not set
687# CONFIG_CRC7 is not set 728# CONFIG_CRC7 is not set
diff --git a/arch/blackfin/include/asm/Kbuild b/arch/blackfin/include/asm/Kbuild
index 606ecfdcc962..d0d1ac435544 100644
--- a/arch/blackfin/include/asm/Kbuild
+++ b/arch/blackfin/include/asm/Kbuild
@@ -1,3 +1,4 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3unifdef-y += fixed_code.h 3unifdef-y += fixed_code.h
4unifdef-y += swab.h
diff --git a/arch/blackfin/include/asm/atomic.h b/arch/blackfin/include/asm/atomic.h
index 7cf508718605..94b2a9b19451 100644
--- a/arch/blackfin/include/asm/atomic.h
+++ b/arch/blackfin/include/asm/atomic.h
@@ -1,6 +1,7 @@
1#ifndef __ARCH_BLACKFIN_ATOMIC__ 1#ifndef __ARCH_BLACKFIN_ATOMIC__
2#define __ARCH_BLACKFIN_ATOMIC__ 2#define __ARCH_BLACKFIN_ATOMIC__
3 3
4#include <linux/types.h>
4#include <asm/system.h> /* local_irq_XXX() */ 5#include <asm/system.h> /* local_irq_XXX() */
5 6
6/* 7/*
@@ -13,108 +14,160 @@
13 * Tony Kou (tonyko@lineo.ca) Lineo Inc. 2001 14 * Tony Kou (tonyko@lineo.ca) Lineo Inc. 2001
14 */ 15 */
15 16
16typedef struct {
17 int counter;
18} atomic_t;
19#define ATOMIC_INIT(i) { (i) } 17#define ATOMIC_INIT(i) { (i) }
20
21#define atomic_read(v) ((v)->counter)
22#define atomic_set(v, i) (((v)->counter) = i) 18#define atomic_set(v, i) (((v)->counter) = i)
23 19
24static __inline__ void atomic_add(int i, atomic_t * v) 20#ifdef CONFIG_SMP
21
22#define atomic_read(v) __raw_uncached_fetch_asm(&(v)->counter)
23
24asmlinkage int __raw_uncached_fetch_asm(const volatile int *ptr);
25
26asmlinkage int __raw_atomic_update_asm(volatile int *ptr, int value);
27
28asmlinkage int __raw_atomic_clear_asm(volatile int *ptr, int value);
29
30asmlinkage int __raw_atomic_set_asm(volatile int *ptr, int value);
31
32asmlinkage int __raw_atomic_xor_asm(volatile int *ptr, int value);
33
34asmlinkage int __raw_atomic_test_asm(const volatile int *ptr, int value);
35
36static inline void atomic_add(int i, atomic_t *v)
37{
38 __raw_atomic_update_asm(&v->counter, i);
39}
40
41static inline void atomic_sub(int i, atomic_t *v)
42{
43 __raw_atomic_update_asm(&v->counter, -i);
44}
45
46static inline int atomic_add_return(int i, atomic_t *v)
47{
48 return __raw_atomic_update_asm(&v->counter, i);
49}
50
51static inline int atomic_sub_return(int i, atomic_t *v)
52{
53 return __raw_atomic_update_asm(&v->counter, -i);
54}
55
56static inline void atomic_inc(volatile atomic_t *v)
57{
58 __raw_atomic_update_asm(&v->counter, 1);
59}
60
61static inline void atomic_dec(volatile atomic_t *v)
62{
63 __raw_atomic_update_asm(&v->counter, -1);
64}
65
66static inline void atomic_clear_mask(int mask, atomic_t *v)
67{
68 __raw_atomic_clear_asm(&v->counter, mask);
69}
70
71static inline void atomic_set_mask(int mask, atomic_t *v)
72{
73 __raw_atomic_set_asm(&v->counter, mask);
74}
75
76static inline int atomic_test_mask(int mask, atomic_t *v)
77{
78 return __raw_atomic_test_asm(&v->counter, mask);
79}
80
81/* Atomic operations are already serializing */
82#define smp_mb__before_atomic_dec() barrier()
83#define smp_mb__after_atomic_dec() barrier()
84#define smp_mb__before_atomic_inc() barrier()
85#define smp_mb__after_atomic_inc() barrier()
86
87#else /* !CONFIG_SMP */
88
89#define atomic_read(v) ((v)->counter)
90
91static inline void atomic_add(int i, atomic_t *v)
25{ 92{
26 long flags; 93 long flags;
27 94
28 local_irq_save(flags); 95 local_irq_save_hw(flags);
29 v->counter += i; 96 v->counter += i;
30 local_irq_restore(flags); 97 local_irq_restore_hw(flags);
31} 98}
32 99
33static __inline__ void atomic_sub(int i, atomic_t * v) 100static inline void atomic_sub(int i, atomic_t *v)
34{ 101{
35 long flags; 102 long flags;
36 103
37 local_irq_save(flags); 104 local_irq_save_hw(flags);
38 v->counter -= i; 105 v->counter -= i;
39 local_irq_restore(flags); 106 local_irq_restore_hw(flags);
40 107
41} 108}
42 109
43static inline int atomic_add_return(int i, atomic_t * v) 110static inline int atomic_add_return(int i, atomic_t *v)
44{ 111{
45 int __temp = 0; 112 int __temp = 0;
46 long flags; 113 long flags;
47 114
48 local_irq_save(flags); 115 local_irq_save_hw(flags);
49 v->counter += i; 116 v->counter += i;
50 __temp = v->counter; 117 __temp = v->counter;
51 local_irq_restore(flags); 118 local_irq_restore_hw(flags);
52 119
53 120
54 return __temp; 121 return __temp;
55} 122}
56 123
57#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0) 124static inline int atomic_sub_return(int i, atomic_t *v)
58static inline int atomic_sub_return(int i, atomic_t * v)
59{ 125{
60 int __temp = 0; 126 int __temp = 0;
61 long flags; 127 long flags;
62 128
63 local_irq_save(flags); 129 local_irq_save_hw(flags);
64 v->counter -= i; 130 v->counter -= i;
65 __temp = v->counter; 131 __temp = v->counter;
66 local_irq_restore(flags); 132 local_irq_restore_hw(flags);
67 133
68 return __temp; 134 return __temp;
69} 135}
70 136
71static __inline__ void atomic_inc(volatile atomic_t * v) 137static inline void atomic_inc(volatile atomic_t *v)
72{ 138{
73 long flags; 139 long flags;
74 140
75 local_irq_save(flags); 141 local_irq_save_hw(flags);
76 v->counter++; 142 v->counter++;
77 local_irq_restore(flags); 143 local_irq_restore_hw(flags);
78} 144}
79 145
80#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n))) 146static inline void atomic_dec(volatile atomic_t *v)
81#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
82
83#define atomic_add_unless(v, a, u) \
84({ \
85 int c, old; \
86 c = atomic_read(v); \
87 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
88 c = old; \
89 c != (u); \
90})
91#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
92
93static __inline__ void atomic_dec(volatile atomic_t * v)
94{ 147{
95 long flags; 148 long flags;
96 149
97 local_irq_save(flags); 150 local_irq_save_hw(flags);
98 v->counter--; 151 v->counter--;
99 local_irq_restore(flags); 152 local_irq_restore_hw(flags);
100} 153}
101 154
102static __inline__ void atomic_clear_mask(unsigned int mask, atomic_t * v) 155static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
103{ 156{
104 long flags; 157 long flags;
105 158
106 local_irq_save(flags); 159 local_irq_save_hw(flags);
107 v->counter &= ~mask; 160 v->counter &= ~mask;
108 local_irq_restore(flags); 161 local_irq_restore_hw(flags);
109} 162}
110 163
111static __inline__ void atomic_set_mask(unsigned int mask, atomic_t * v) 164static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
112{ 165{
113 long flags; 166 long flags;
114 167
115 local_irq_save(flags); 168 local_irq_save_hw(flags);
116 v->counter |= mask; 169 v->counter |= mask;
117 local_irq_restore(flags); 170 local_irq_restore_hw(flags);
118} 171}
119 172
120/* Atomic operations are already serializing */ 173/* Atomic operations are already serializing */
@@ -123,9 +176,25 @@ static __inline__ void atomic_set_mask(unsigned int mask, atomic_t * v)
123#define smp_mb__before_atomic_inc() barrier() 176#define smp_mb__before_atomic_inc() barrier()
124#define smp_mb__after_atomic_inc() barrier() 177#define smp_mb__after_atomic_inc() barrier()
125 178
179#endif /* !CONFIG_SMP */
180
181#define atomic_add_negative(a, v) (atomic_add_return((a), (v)) < 0)
126#define atomic_dec_return(v) atomic_sub_return(1,(v)) 182#define atomic_dec_return(v) atomic_sub_return(1,(v))
127#define atomic_inc_return(v) atomic_add_return(1,(v)) 183#define atomic_inc_return(v) atomic_add_return(1,(v))
128 184
185#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
186#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
187
188#define atomic_add_unless(v, a, u) \
189({ \
190 int c, old; \
191 c = atomic_read(v); \
192 while (c != (u) && (old = atomic_cmpxchg((v), c, c + (a))) != c) \
193 c = old; \
194 c != (u); \
195})
196#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
197
129/* 198/*
130 * atomic_inc_and_test - increment and test 199 * atomic_inc_and_test - increment and test
131 * @v: pointer of type atomic_t 200 * @v: pointer of type atomic_t
diff --git a/arch/blackfin/include/asm/bfin-global.h b/arch/blackfin/include/asm/bfin-global.h
index 77295666c34b..daffc0684e75 100644
--- a/arch/blackfin/include/asm/bfin-global.h
+++ b/arch/blackfin/include/asm/bfin-global.h
@@ -47,6 +47,9 @@
47# define DMA_UNCACHED_REGION (0) 47# define DMA_UNCACHED_REGION (0)
48#endif 48#endif
49 49
50extern void bfin_setup_caches(unsigned int cpu);
51extern void bfin_setup_cpudata(unsigned int cpu);
52
50extern unsigned long get_cclk(void); 53extern unsigned long get_cclk(void);
51extern unsigned long get_sclk(void); 54extern unsigned long get_sclk(void);
52extern unsigned long sclk_to_usecs(unsigned long sclk); 55extern unsigned long sclk_to_usecs(unsigned long sclk);
@@ -58,8 +61,6 @@ extern void dump_bfin_trace_buffer(void);
58 61
59/* init functions only */ 62/* init functions only */
60extern int init_arch_irq(void); 63extern int init_arch_irq(void);
61extern void bfin_icache_init(void);
62extern void bfin_dcache_init(void);
63extern void init_exception_vectors(void); 64extern void init_exception_vectors(void);
64extern void program_IAR(void); 65extern void program_IAR(void);
65 66
@@ -110,7 +111,7 @@ extern unsigned long memory_mtd_start, memory_mtd_end, mtd_size;
110 111
111#ifdef CONFIG_BFIN_ICACHE_LOCK 112#ifdef CONFIG_BFIN_ICACHE_LOCK
112extern void cache_grab_lock(int way); 113extern void cache_grab_lock(int way);
113extern void cache_lock(int way); 114extern void bfin_cache_lock(int way);
114#endif 115#endif
115 116
116#endif 117#endif
diff --git a/arch/blackfin/include/asm/bfin5xx_spi.h b/arch/blackfin/include/asm/bfin5xx_spi.h
index 9fa19158e38d..1306e6b22946 100644
--- a/arch/blackfin/include/asm/bfin5xx_spi.h
+++ b/arch/blackfin/include/asm/bfin5xx_spi.h
@@ -1,22 +1,12 @@
1/************************************************************ 1/*
2 2 * Blackfin On-Chip SPI Driver
3* Copyright (C) 2006-2008, Analog Devices. All Rights Reserved 3 *
4* 4 * Copyright 2004-2008 Analog Devices Inc.
5* FILE bfin5xx_spi.h 5 *
6* PROGRAMMER(S): Luke Yang (Analog Devices Inc.) 6 * Enter bugs at http://blackfin.uclinux.org/
7* 7 *
8* 8 * Licensed under the GPL-2 or later.
9* DATE OF CREATION: March. 10th 2006 9 */
10*
11* SYNOPSIS:
12*
13* DESCRIPTION: header file for SPI controller driver for Blackfin5xx.
14**************************************************************
15
16* MODIFICATION HISTORY:
17* March 10, 2006 bfin5xx_spi.h Created. (Luke Yang)
18
19************************************************************/
20 10
21#ifndef _SPI_CHANNEL_H_ 11#ifndef _SPI_CHANNEL_H_
22#define _SPI_CHANNEL_H_ 12#define _SPI_CHANNEL_H_
diff --git a/arch/blackfin/include/asm/bfin_sdh.h b/arch/blackfin/include/asm/bfin_sdh.h
new file mode 100644
index 000000000000..d61d5497c590
--- /dev/null
+++ b/arch/blackfin/include/asm/bfin_sdh.h
@@ -0,0 +1,19 @@
1/*
2 * bfin_sdh.h - Blackfin SDH definitions
3 *
4 * Copyright 2008 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#ifndef __BFIN_SDH_H__
10#define __BFIN_SDH_H__
11
12struct bfin_sd_host {
13 int dma_chan;
14 int irq_int0;
15 int irq_int1;
16 u16 pin_req[7];
17};
18
19#endif
diff --git a/arch/blackfin/include/asm/bfin_sport.h b/arch/blackfin/include/asm/bfin_sport.h
index c76ed8def302..fe88a2c19213 100644
--- a/arch/blackfin/include/asm/bfin_sport.h
+++ b/arch/blackfin/include/asm/bfin_sport.h
@@ -120,9 +120,6 @@ struct sport_register {
120#define SPORT_IOC_MAGIC 'P' 120#define SPORT_IOC_MAGIC 'P'
121#define SPORT_IOC_CONFIG _IOWR('P', 0x01, struct sport_config) 121#define SPORT_IOC_CONFIG _IOWR('P', 0x01, struct sport_config)
122 122
123/* Test purpose */
124#define ENABLE_AD73311 _IOWR('P', 0x02, int)
125
126struct sport_dev { 123struct sport_dev {
127 struct cdev cdev; /* Char device structure */ 124 struct cdev cdev; /* Char device structure */
128 125
diff --git a/arch/blackfin/include/asm/bfrom.h b/arch/blackfin/include/asm/bfrom.h
index cfe8024c3b2f..9e4be5e5e767 100644
--- a/arch/blackfin/include/asm/bfrom.h
+++ b/arch/blackfin/include/asm/bfrom.h
@@ -43,6 +43,11 @@ __attribute__((__noreturn__))
43static inline void bfrom_SoftReset(void *new_stack) 43static inline void bfrom_SoftReset(void *new_stack)
44{ 44{
45 while (1) 45 while (1)
46 /*
47 * We don't declare the SP as clobbered on purpose, since
48 * it confuses the heck out of the compiler, and this function
49 * never returns
50 */
46 __asm__ __volatile__( 51 __asm__ __volatile__(
47 "sp = %[stack];" 52 "sp = %[stack];"
48 "jump (%[bfrom_syscontrol]);" 53 "jump (%[bfrom_syscontrol]);"
diff --git a/arch/blackfin/include/asm/bitops.h b/arch/blackfin/include/asm/bitops.h
index b39a175c79c1..21b036eadab1 100644
--- a/arch/blackfin/include/asm/bitops.h
+++ b/arch/blackfin/include/asm/bitops.h
@@ -7,7 +7,6 @@
7 7
8#include <linux/compiler.h> 8#include <linux/compiler.h>
9#include <asm/byteorder.h> /* swab32 */ 9#include <asm/byteorder.h> /* swab32 */
10#include <asm/system.h> /* save_flags */
11 10
12#ifdef __KERNEL__ 11#ifdef __KERNEL__
13 12
@@ -20,80 +19,107 @@
20#include <asm-generic/bitops/sched.h> 19#include <asm-generic/bitops/sched.h>
21#include <asm-generic/bitops/ffz.h> 20#include <asm-generic/bitops/ffz.h>
22 21
23static __inline__ void set_bit(int nr, volatile unsigned long *addr) 22#ifdef CONFIG_SMP
23
24#include <linux/linkage.h>
25
26asmlinkage int __raw_bit_set_asm(volatile unsigned long *addr, int nr);
27
28asmlinkage int __raw_bit_clear_asm(volatile unsigned long *addr, int nr);
29
30asmlinkage int __raw_bit_toggle_asm(volatile unsigned long *addr, int nr);
31
32asmlinkage int __raw_bit_test_set_asm(volatile unsigned long *addr, int nr);
33
34asmlinkage int __raw_bit_test_clear_asm(volatile unsigned long *addr, int nr);
35
36asmlinkage int __raw_bit_test_toggle_asm(volatile unsigned long *addr, int nr);
37
38asmlinkage int __raw_bit_test_asm(const volatile unsigned long *addr, int nr);
39
40static inline void set_bit(int nr, volatile unsigned long *addr)
24{ 41{
25 int *a = (int *)addr; 42 volatile unsigned long *a = addr + (nr >> 5);
26 int mask; 43 __raw_bit_set_asm(a, nr & 0x1f);
27 unsigned long flags; 44}
28 45
29 a += nr >> 5; 46static inline void clear_bit(int nr, volatile unsigned long *addr)
30 mask = 1 << (nr & 0x1f); 47{
31 local_irq_save(flags); 48 volatile unsigned long *a = addr + (nr >> 5);
32 *a |= mask; 49 __raw_bit_clear_asm(a, nr & 0x1f);
33 local_irq_restore(flags);
34} 50}
35 51
36static __inline__ void __set_bit(int nr, volatile unsigned long *addr) 52static inline void change_bit(int nr, volatile unsigned long *addr)
37{ 53{
38 int *a = (int *)addr; 54 volatile unsigned long *a = addr + (nr >> 5);
39 int mask; 55 __raw_bit_toggle_asm(a, nr & 0x1f);
56}
40 57
41 a += nr >> 5; 58static inline int test_bit(int nr, const volatile unsigned long *addr)
42 mask = 1 << (nr & 0x1f); 59{
43 *a |= mask; 60 volatile const unsigned long *a = addr + (nr >> 5);
61 return __raw_bit_test_asm(a, nr & 0x1f) != 0;
44} 62}
45 63
46/* 64static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
47 * clear_bit() doesn't provide any barrier for the compiler. 65{
48 */ 66 volatile unsigned long *a = addr + (nr >> 5);
49#define smp_mb__before_clear_bit() barrier() 67 return __raw_bit_test_set_asm(a, nr & 0x1f);
50#define smp_mb__after_clear_bit() barrier() 68}
69
70static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
71{
72 volatile unsigned long *a = addr + (nr >> 5);
73 return __raw_bit_test_clear_asm(a, nr & 0x1f);
74}
75
76static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
77{
78 volatile unsigned long *a = addr + (nr >> 5);
79 return __raw_bit_test_toggle_asm(a, nr & 0x1f);
80}
81
82#else /* !CONFIG_SMP */
83
84#include <asm/system.h> /* save_flags */
51 85
52static __inline__ void clear_bit(int nr, volatile unsigned long *addr) 86static inline void set_bit(int nr, volatile unsigned long *addr)
53{ 87{
54 int *a = (int *)addr; 88 int *a = (int *)addr;
55 int mask; 89 int mask;
56 unsigned long flags; 90 unsigned long flags;
57 a += nr >> 5; 91 a += nr >> 5;
58 mask = 1 << (nr & 0x1f); 92 mask = 1 << (nr & 0x1f);
59 local_irq_save(flags); 93 local_irq_save_hw(flags);
60 *a &= ~mask; 94 *a |= mask;
61 local_irq_restore(flags); 95 local_irq_restore_hw(flags);
62} 96}
63 97
64static __inline__ void __clear_bit(int nr, volatile unsigned long *addr) 98static inline void clear_bit(int nr, volatile unsigned long *addr)
65{ 99{
66 int *a = (int *)addr; 100 int *a = (int *)addr;
67 int mask; 101 int mask;
68 102 unsigned long flags;
69 a += nr >> 5; 103 a += nr >> 5;
70 mask = 1 << (nr & 0x1f); 104 mask = 1 << (nr & 0x1f);
105 local_irq_save_hw(flags);
71 *a &= ~mask; 106 *a &= ~mask;
107 local_irq_restore_hw(flags);
72} 108}
73 109
74static __inline__ void change_bit(int nr, volatile unsigned long *addr) 110static inline void change_bit(int nr, volatile unsigned long *addr)
75{ 111{
76 int mask, flags; 112 int mask, flags;
77 unsigned long *ADDR = (unsigned long *)addr; 113 unsigned long *ADDR = (unsigned long *)addr;
78 114
79 ADDR += nr >> 5; 115 ADDR += nr >> 5;
80 mask = 1 << (nr & 31); 116 mask = 1 << (nr & 31);
81 local_irq_save(flags); 117 local_irq_save_hw(flags);
82 *ADDR ^= mask;
83 local_irq_restore(flags);
84}
85
86static __inline__ void __change_bit(int nr, volatile unsigned long *addr)
87{
88 int mask;
89 unsigned long *ADDR = (unsigned long *)addr;
90
91 ADDR += nr >> 5;
92 mask = 1 << (nr & 31);
93 *ADDR ^= mask; 118 *ADDR ^= mask;
119 local_irq_restore_hw(flags);
94} 120}
95 121
96static __inline__ int test_and_set_bit(int nr, void *addr) 122static inline int test_and_set_bit(int nr, volatile unsigned long *addr)
97{ 123{
98 int mask, retval; 124 int mask, retval;
99 volatile unsigned int *a = (volatile unsigned int *)addr; 125 volatile unsigned int *a = (volatile unsigned int *)addr;
@@ -101,27 +127,31 @@ static __inline__ int test_and_set_bit(int nr, void *addr)
101 127
102 a += nr >> 5; 128 a += nr >> 5;
103 mask = 1 << (nr & 0x1f); 129 mask = 1 << (nr & 0x1f);
104 local_irq_save(flags); 130 local_irq_save_hw(flags);
105 retval = (mask & *a) != 0; 131 retval = (mask & *a) != 0;
106 *a |= mask; 132 *a |= mask;
107 local_irq_restore(flags); 133 local_irq_restore_hw(flags);
108 134
109 return retval; 135 return retval;
110} 136}
111 137
112static __inline__ int __test_and_set_bit(int nr, volatile unsigned long *addr) 138static inline int test_and_clear_bit(int nr, volatile unsigned long *addr)
113{ 139{
114 int mask, retval; 140 int mask, retval;
115 volatile unsigned int *a = (volatile unsigned int *)addr; 141 volatile unsigned int *a = (volatile unsigned int *)addr;
142 unsigned long flags;
116 143
117 a += nr >> 5; 144 a += nr >> 5;
118 mask = 1 << (nr & 0x1f); 145 mask = 1 << (nr & 0x1f);
146 local_irq_save_hw(flags);
119 retval = (mask & *a) != 0; 147 retval = (mask & *a) != 0;
120 *a |= mask; 148 *a &= ~mask;
149 local_irq_restore_hw(flags);
150
121 return retval; 151 return retval;
122} 152}
123 153
124static __inline__ int test_and_clear_bit(int nr, volatile unsigned long *addr) 154static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
125{ 155{
126 int mask, retval; 156 int mask, retval;
127 volatile unsigned int *a = (volatile unsigned int *)addr; 157 volatile unsigned int *a = (volatile unsigned int *)addr;
@@ -129,15 +159,52 @@ static __inline__ int test_and_clear_bit(int nr, volatile unsigned long *addr)
129 159
130 a += nr >> 5; 160 a += nr >> 5;
131 mask = 1 << (nr & 0x1f); 161 mask = 1 << (nr & 0x1f);
132 local_irq_save(flags); 162 local_irq_save_hw(flags);
133 retval = (mask & *a) != 0; 163 retval = (mask & *a) != 0;
164 *a ^= mask;
165 local_irq_restore_hw(flags);
166 return retval;
167}
168
169#endif /* CONFIG_SMP */
170
171/*
172 * clear_bit() doesn't provide any barrier for the compiler.
173 */
174#define smp_mb__before_clear_bit() barrier()
175#define smp_mb__after_clear_bit() barrier()
176
177static inline void __set_bit(int nr, volatile unsigned long *addr)
178{
179 int *a = (int *)addr;
180 int mask;
181
182 a += nr >> 5;
183 mask = 1 << (nr & 0x1f);
184 *a |= mask;
185}
186
187static inline void __clear_bit(int nr, volatile unsigned long *addr)
188{
189 int *a = (int *)addr;
190 int mask;
191
192 a += nr >> 5;
193 mask = 1 << (nr & 0x1f);
134 *a &= ~mask; 194 *a &= ~mask;
135 local_irq_restore(flags); 195}
136 196
137 return retval; 197static inline void __change_bit(int nr, volatile unsigned long *addr)
198{
199 int mask;
200 unsigned long *ADDR = (unsigned long *)addr;
201
202 ADDR += nr >> 5;
203 mask = 1 << (nr & 31);
204 *ADDR ^= mask;
138} 205}
139 206
140static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr) 207static inline int __test_and_set_bit(int nr, volatile unsigned long *addr)
141{ 208{
142 int mask, retval; 209 int mask, retval;
143 volatile unsigned int *a = (volatile unsigned int *)addr; 210 volatile unsigned int *a = (volatile unsigned int *)addr;
@@ -145,26 +212,23 @@ static __inline__ int __test_and_clear_bit(int nr, volatile unsigned long *addr)
145 a += nr >> 5; 212 a += nr >> 5;
146 mask = 1 << (nr & 0x1f); 213 mask = 1 << (nr & 0x1f);
147 retval = (mask & *a) != 0; 214 retval = (mask & *a) != 0;
148 *a &= ~mask; 215 *a |= mask;
149 return retval; 216 return retval;
150} 217}
151 218
152static __inline__ int test_and_change_bit(int nr, volatile unsigned long *addr) 219static inline int __test_and_clear_bit(int nr, volatile unsigned long *addr)
153{ 220{
154 int mask, retval; 221 int mask, retval;
155 volatile unsigned int *a = (volatile unsigned int *)addr; 222 volatile unsigned int *a = (volatile unsigned int *)addr;
156 unsigned long flags;
157 223
158 a += nr >> 5; 224 a += nr >> 5;
159 mask = 1 << (nr & 0x1f); 225 mask = 1 << (nr & 0x1f);
160 local_irq_save(flags);
161 retval = (mask & *a) != 0; 226 retval = (mask & *a) != 0;
162 *a ^= mask; 227 *a &= ~mask;
163 local_irq_restore(flags);
164 return retval; 228 return retval;
165} 229}
166 230
167static __inline__ int __test_and_change_bit(int nr, 231static inline int __test_and_change_bit(int nr,
168 volatile unsigned long *addr) 232 volatile unsigned long *addr)
169{ 233{
170 int mask, retval; 234 int mask, retval;
@@ -177,16 +241,7 @@ static __inline__ int __test_and_change_bit(int nr,
177 return retval; 241 return retval;
178} 242}
179 243
180/* 244static inline int __test_bit(int nr, const void *addr)
181 * This routine doesn't need to be atomic.
182 */
183static __inline__ int __constant_test_bit(int nr, const void *addr)
184{
185 return ((1UL << (nr & 31)) &
186 (((const volatile unsigned int *)addr)[nr >> 5])) != 0;
187}
188
189static __inline__ int __test_bit(int nr, const void *addr)
190{ 245{
191 int *a = (int *)addr; 246 int *a = (int *)addr;
192 int mask; 247 int mask;
@@ -196,10 +251,16 @@ static __inline__ int __test_bit(int nr, const void *addr)
196 return ((mask & *a) != 0); 251 return ((mask & *a) != 0);
197} 252}
198 253
199#define test_bit(nr,addr) \ 254#ifndef CONFIG_SMP
200(__builtin_constant_p(nr) ? \ 255/*
201 __constant_test_bit((nr),(addr)) : \ 256 * This routine doesn't need irq save and restore ops in UP
202 __test_bit((nr),(addr))) 257 * context.
258 */
259static inline int test_bit(int nr, const void *addr)
260{
261 return __test_bit(nr, addr);
262}
263#endif
203 264
204#include <asm-generic/bitops/find.h> 265#include <asm-generic/bitops/find.h>
205#include <asm-generic/bitops/hweight.h> 266#include <asm-generic/bitops/hweight.h>
@@ -213,6 +274,7 @@ static __inline__ int __test_bit(int nr, const void *addr)
213#endif /* __KERNEL__ */ 274#endif /* __KERNEL__ */
214 275
215#include <asm-generic/bitops/fls.h> 276#include <asm-generic/bitops/fls.h>
277#include <asm-generic/bitops/__fls.h>
216#include <asm-generic/bitops/fls64.h> 278#include <asm-generic/bitops/fls64.h>
217 279
218#endif /* _BLACKFIN_BITOPS_H */ 280#endif /* _BLACKFIN_BITOPS_H */
diff --git a/arch/blackfin/include/asm/blackfin.h b/arch/blackfin/include/asm/blackfin.h
index 8749b0e321ab..8bb2cb139756 100644
--- a/arch/blackfin/include/asm/blackfin.h
+++ b/arch/blackfin/include/asm/blackfin.h
@@ -6,11 +6,6 @@
6#ifndef _BLACKFIN_H_ 6#ifndef _BLACKFIN_H_
7#define _BLACKFIN_H_ 7#define _BLACKFIN_H_
8 8
9#define LO(con32) ((con32) & 0xFFFF)
10#define lo(con32) ((con32) & 0xFFFF)
11#define HI(con32) (((con32) >> 16) & 0xFFFF)
12#define hi(con32) (((con32) >> 16) & 0xFFFF)
13
14#include <mach/anomaly.h> 9#include <mach/anomaly.h>
15 10
16#ifndef __ASSEMBLY__ 11#ifndef __ASSEMBLY__
@@ -65,6 +60,11 @@ static inline void CSYNC(void)
65 60
66#else /* __ASSEMBLY__ */ 61#else /* __ASSEMBLY__ */
67 62
63#define LO(con32) ((con32) & 0xFFFF)
64#define lo(con32) ((con32) & 0xFFFF)
65#define HI(con32) (((con32) >> 16) & 0xFFFF)
66#define hi(con32) (((con32) >> 16) & 0xFFFF)
67
68/* SSYNC & CSYNC implementations for assembly files */ 68/* SSYNC & CSYNC implementations for assembly files */
69 69
70#define ssync(x) SSYNC(x) 70#define ssync(x) SSYNC(x)
diff --git a/arch/blackfin/include/asm/byteorder.h b/arch/blackfin/include/asm/byteorder.h
index 6a673d42da18..b9e797a497b4 100644
--- a/arch/blackfin/include/asm/byteorder.h
+++ b/arch/blackfin/include/asm/byteorder.h
@@ -1,48 +1,7 @@
1#ifndef _BLACKFIN_BYTEORDER_H 1#ifndef _BLACKFIN_BYTEORDER_H
2#define _BLACKFIN_BYTEORDER_H 2#define _BLACKFIN_BYTEORDER_H
3 3
4#include <asm/types.h> 4#include <asm/swab.h>
5#include <linux/compiler.h>
6
7#ifdef __GNUC__
8
9static __inline__ __attribute_const__ __u32 ___arch__swahb32(__u32 xx)
10{
11 __u32 tmp;
12 __asm__("%1 = %0 >> 8 (V);\n\t"
13 "%0 = %0 << 8 (V);\n\t"
14 "%0 = %0 | %1;\n\t"
15 : "+d"(xx), "=&d"(tmp));
16 return xx;
17}
18
19static __inline__ __attribute_const__ __u32 ___arch__swahw32(__u32 xx)
20{
21 __u32 rv;
22 __asm__("%0 = PACK(%1.L, %1.H);\n\t": "=d"(rv): "d"(xx));
23 return rv;
24}
25
26#define __arch__swahb32(x) ___arch__swahb32(x)
27#define __arch__swahw32(x) ___arch__swahw32(x)
28#define __arch__swab32(x) ___arch__swahb32(___arch__swahw32(x))
29
30static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 xx)
31{
32 __u32 xw = xx;
33 __asm__("%0 <<= 8;\n %0.L = %0.L + %0.H (NS);\n": "+d"(xw));
34 return (__u16)xw;
35}
36
37#define __arch__swab16(x) ___arch__swab16(x)
38
39#endif
40
41#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
42# define __BYTEORDER_HAS_U64__
43# define __SWAB_64_THRU_32__
44#endif
45
46#include <linux/byteorder/little_endian.h> 5#include <linux/byteorder/little_endian.h>
47 6
48#endif /* _BLACKFIN_BYTEORDER_H */ 7#endif /* _BLACKFIN_BYTEORDER_H */
diff --git a/arch/blackfin/include/asm/cache.h b/arch/blackfin/include/asm/cache.h
index 023d72133b5a..86637814cf25 100644
--- a/arch/blackfin/include/asm/cache.h
+++ b/arch/blackfin/include/asm/cache.h
@@ -12,6 +12,11 @@
12#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) 12#define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
13#define SMP_CACHE_BYTES L1_CACHE_BYTES 13#define SMP_CACHE_BYTES L1_CACHE_BYTES
14 14
15#ifdef CONFIG_SMP
16#define __cacheline_aligned
17#else
18#define ____cacheline_aligned
19
15/* 20/*
16 * Put cacheline_aliged data to L1 data memory 21 * Put cacheline_aliged data to L1 data memory
17 */ 22 */
@@ -21,9 +26,33 @@
21 __section__(".data_l1.cacheline_aligned"))) 26 __section__(".data_l1.cacheline_aligned")))
22#endif 27#endif
23 28
29#endif
30
24/* 31/*
25 * largest L1 which this arch supports 32 * largest L1 which this arch supports
26 */ 33 */
27#define L1_CACHE_SHIFT_MAX 5 34#define L1_CACHE_SHIFT_MAX 5
28 35
36#if defined(CONFIG_SMP) && \
37 !defined(CONFIG_BFIN_CACHE_COHERENT) && \
38 defined(CONFIG_BFIN_DCACHE)
39#define __ARCH_SYNC_CORE_DCACHE
40#ifndef __ASSEMBLY__
41asmlinkage void __raw_smp_mark_barrier_asm(void);
42asmlinkage void __raw_smp_check_barrier_asm(void);
43
44static inline void smp_mark_barrier(void)
45{
46 __raw_smp_mark_barrier_asm();
47}
48static inline void smp_check_barrier(void)
49{
50 __raw_smp_check_barrier_asm();
51}
52
53void resync_core_dcache(void);
54#endif
55#endif
56
57
29#endif 58#endif
diff --git a/arch/blackfin/include/asm/cacheflush.h b/arch/blackfin/include/asm/cacheflush.h
index 4403415583fa..1b040f5b4feb 100644
--- a/arch/blackfin/include/asm/cacheflush.h
+++ b/arch/blackfin/include/asm/cacheflush.h
@@ -35,6 +35,7 @@ extern void blackfin_icache_flush_range(unsigned long start_address, unsigned lo
35extern void blackfin_dcache_flush_range(unsigned long start_address, unsigned long end_address); 35extern void blackfin_dcache_flush_range(unsigned long start_address, unsigned long end_address);
36extern void blackfin_dcache_invalidate_range(unsigned long start_address, unsigned long end_address); 36extern void blackfin_dcache_invalidate_range(unsigned long start_address, unsigned long end_address);
37extern void blackfin_dflush_page(void *page); 37extern void blackfin_dflush_page(void *page);
38extern void blackfin_invalidate_entire_dcache(void);
38 39
39#define flush_dcache_mmap_lock(mapping) do { } while (0) 40#define flush_dcache_mmap_lock(mapping) do { } while (0)
40#define flush_dcache_mmap_unlock(mapping) do { } while (0) 41#define flush_dcache_mmap_unlock(mapping) do { } while (0)
@@ -44,12 +45,20 @@ extern void blackfin_dflush_page(void *page);
44#define flush_cache_vmap(start, end) do { } while (0) 45#define flush_cache_vmap(start, end) do { } while (0)
45#define flush_cache_vunmap(start, end) do { } while (0) 46#define flush_cache_vunmap(start, end) do { } while (0)
46 47
48#ifdef CONFIG_SMP
49#define flush_icache_range_others(start, end) \
50 smp_icache_flush_range_others((start), (end))
51#else
52#define flush_icache_range_others(start, end) do { } while (0)
53#endif
54
47static inline void flush_icache_range(unsigned start, unsigned end) 55static inline void flush_icache_range(unsigned start, unsigned end)
48{ 56{
49#if defined(CONFIG_BFIN_DCACHE) && defined(CONFIG_BFIN_ICACHE) 57#if defined(CONFIG_BFIN_DCACHE) && defined(CONFIG_BFIN_ICACHE)
50 58
51# if defined(CONFIG_BFIN_WT) 59# if defined(CONFIG_BFIN_WT)
52 blackfin_icache_flush_range((start), (end)); 60 blackfin_icache_flush_range((start), (end));
61 flush_icache_range_others(start, end);
53# else 62# else
54 blackfin_icache_dcache_flush_range((start), (end)); 63 blackfin_icache_dcache_flush_range((start), (end));
55# endif 64# endif
@@ -58,6 +67,7 @@ static inline void flush_icache_range(unsigned start, unsigned end)
58 67
59# if defined(CONFIG_BFIN_ICACHE) 68# if defined(CONFIG_BFIN_ICACHE)
60 blackfin_icache_flush_range((start), (end)); 69 blackfin_icache_flush_range((start), (end));
70 flush_icache_range_others(start, end);
61# endif 71# endif
62# if defined(CONFIG_BFIN_DCACHE) 72# if defined(CONFIG_BFIN_DCACHE)
63 blackfin_dcache_flush_range((start), (end)); 73 blackfin_dcache_flush_range((start), (end));
@@ -66,10 +76,12 @@ static inline void flush_icache_range(unsigned start, unsigned end)
66#endif 76#endif
67} 77}
68 78
69#define copy_to_user_page(vma, page, vaddr, dst, src, len) \ 79#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
70do { memcpy(dst, src, len); \ 80do { memcpy(dst, src, len); \
71 flush_icache_range ((unsigned) (dst), (unsigned) (dst) + (len)); \ 81 flush_icache_range((unsigned) (dst), (unsigned) (dst) + (len)); \
82 flush_icache_range_others((unsigned long) (dst), (unsigned long) (dst) + (len));\
72} while (0) 83} while (0)
84
73#define copy_from_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len) 85#define copy_from_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len)
74 86
75#if defined(CONFIG_BFIN_DCACHE) 87#if defined(CONFIG_BFIN_DCACHE)
@@ -82,7 +94,7 @@ do { memcpy(dst, src, len); \
82# define flush_dcache_page(page) blackfin_dflush_page(page_address(page)) 94# define flush_dcache_page(page) blackfin_dflush_page(page_address(page))
83#else 95#else
84# define flush_dcache_range(start,end) do { } while (0) 96# define flush_dcache_range(start,end) do { } while (0)
85# define flush_dcache_page(page) do { } while (0) 97# define flush_dcache_page(page) do { } while (0)
86#endif 98#endif
87 99
88extern unsigned long reserved_mem_dcache_on; 100extern unsigned long reserved_mem_dcache_on;
diff --git a/arch/blackfin/include/asm/checksum.h b/arch/blackfin/include/asm/checksum.h
index 6f6af2b8e9e0..f67289a0d8d2 100644
--- a/arch/blackfin/include/asm/checksum.h
+++ b/arch/blackfin/include/asm/checksum.h
@@ -78,7 +78,8 @@ csum_tcpudp_nofold(__be32 saddr, __be32 daddr, unsigned short len,
78 "%0 = %0 + %4;\n\t" 78 "%0 = %0 + %4;\n\t"
79 "NOP;\n\t" 79 "NOP;\n\t"
80 : "=d" (sum) 80 : "=d" (sum)
81 : "d" (daddr), "d" (saddr), "d" ((ntohs(len)<<16)+proto*256), "d" (1), "0"(sum)); 81 : "d" (daddr), "d" (saddr), "d" ((ntohs(len)<<16)+proto*256), "d" (1), "0"(sum)
82 : "CC");
82 83
83 return (sum); 84 return (sum);
84} 85}
diff --git a/arch/blackfin/include/asm/context.S b/arch/blackfin/include/asm/context.S
index c0e630edfb9a..16561ab18b38 100644
--- a/arch/blackfin/include/asm/context.S
+++ b/arch/blackfin/include/asm/context.S
@@ -303,9 +303,14 @@
303 RETI = [sp++]; 303 RETI = [sp++];
304 RETS = [sp++]; 304 RETS = [sp++];
305 305
306 p0.h = _irq_flags; 306#ifdef CONFIG_SMP
307 p0.l = _irq_flags; 307 GET_PDA(p0, r0);
308 r0 = [p0 + PDA_IRQFLAGS];
309#else
310 p0.h = _bfin_irq_flags;
311 p0.l = _bfin_irq_flags;
308 r0 = [p0]; 312 r0 = [p0];
313#endif
309 sti r0; 314 sti r0;
310 315
311 sp += 4; /* Skip Reserved */ 316 sp += 4; /* Skip Reserved */
@@ -353,3 +358,41 @@
353 csync; 358 csync;
354.endm 359.endm
355 360
361.macro save_context_cplb
362 [--sp] = (R7:0, P5:0);
363 [--sp] = fp;
364
365 [--sp] = a0.x;
366 [--sp] = a0.w;
367 [--sp] = a1.x;
368 [--sp] = a1.w;
369
370 [--sp] = LC0;
371 [--sp] = LC1;
372 [--sp] = LT0;
373 [--sp] = LT1;
374 [--sp] = LB0;
375 [--sp] = LB1;
376
377 [--sp] = RETS;
378.endm
379
380.macro restore_context_cplb
381 RETS = [sp++];
382
383 LB1 = [sp++];
384 LB0 = [sp++];
385 LT1 = [sp++];
386 LT0 = [sp++];
387 LC1 = [sp++];
388 LC0 = [sp++];
389
390 a1.w = [sp++];
391 a1.x = [sp++];
392 a0.w = [sp++];
393 a0.x = [sp++];
394
395 fp = [sp++];
396
397 (R7:0, P5:0) = [SP++];
398.endm
diff --git a/arch/blackfin/include/asm/cplb-mpu.h b/arch/blackfin/include/asm/cplb-mpu.h
deleted file mode 100644
index 75c67b99d607..000000000000
--- a/arch/blackfin/include/asm/cplb-mpu.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * File: include/asm-blackfin/cplbinit.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29#ifndef __ASM_BFIN_CPLB_MPU_H
30#define __ASM_BFIN_CPLB_MPU_H
31
32struct cplb_entry {
33 unsigned long data, addr;
34};
35
36struct mem_region {
37 unsigned long start, end;
38 unsigned long dcplb_data;
39 unsigned long icplb_data;
40};
41
42extern struct cplb_entry dcplb_tbl[MAX_CPLBS];
43extern struct cplb_entry icplb_tbl[MAX_CPLBS];
44extern int first_switched_icplb;
45extern int first_mask_dcplb;
46extern int first_switched_dcplb;
47
48extern int nr_dcplb_miss, nr_icplb_miss, nr_icplb_supv_miss, nr_dcplb_prot;
49extern int nr_cplb_flush;
50
51extern int page_mask_order;
52extern int page_mask_nelts;
53
54extern unsigned long *current_rwx_mask;
55
56extern void flush_switched_cplbs(void);
57extern void set_mask_dcplbs(unsigned long *);
58
59extern void __noreturn panic_cplb_error(int seqstat, struct pt_regs *);
60
61#endif /* __ASM_BFIN_CPLB_MPU_H */
diff --git a/arch/blackfin/include/asm/cplb.h b/arch/blackfin/include/asm/cplb.h
index 9e8b4035fcec..ad566ff9ad16 100644
--- a/arch/blackfin/include/asm/cplb.h
+++ b/arch/blackfin/include/asm/cplb.h
@@ -30,7 +30,6 @@
30#ifndef _CPLB_H 30#ifndef _CPLB_H
31#define _CPLB_H 31#define _CPLB_H
32 32
33#include <asm/blackfin.h>
34#include <mach/anomaly.h> 33#include <mach/anomaly.h>
35 34
36#define SDRAM_IGENERIC (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_PORTPRIO) 35#define SDRAM_IGENERIC (CPLB_L1_CHBL | CPLB_USER_RD | CPLB_VALID | CPLB_PORTPRIO)
@@ -55,13 +54,24 @@
55#endif 54#endif
56 55
57#define L1_DMEMORY (CPLB_LOCK | CPLB_COMMON) 56#define L1_DMEMORY (CPLB_LOCK | CPLB_COMMON)
57
58#ifdef CONFIG_SMP
59#define L2_ATTR (INITIAL_T | I_CPLB | D_CPLB)
60#define L2_IMEMORY (CPLB_COMMON | CPLB_LOCK)
61#define L2_DMEMORY (CPLB_COMMON | CPLB_LOCK)
62
63#else
58#ifdef CONFIG_BFIN_L2_CACHEABLE 64#ifdef CONFIG_BFIN_L2_CACHEABLE
59#define L2_IMEMORY (SDRAM_IGENERIC) 65#define L2_IMEMORY (SDRAM_IGENERIC)
60#define L2_DMEMORY (SDRAM_DGENERIC) 66#define L2_DMEMORY (SDRAM_DGENERIC)
61#else 67#else
62#define L2_IMEMORY (CPLB_COMMON) 68#define L2_IMEMORY (CPLB_COMMON)
63#define L2_DMEMORY (CPLB_COMMON) 69#define L2_DMEMORY (CPLB_COMMON)
64#endif 70#endif /* CONFIG_BFIN_L2_CACHEABLE */
71
72#define L2_ATTR (INITIAL_T | SWITCH_T | I_CPLB | D_CPLB)
73#endif /* CONFIG_SMP */
74
65#define SDRAM_DNON_CHBL (CPLB_COMMON) 75#define SDRAM_DNON_CHBL (CPLB_COMMON)
66#define SDRAM_EBIU (CPLB_COMMON) 76#define SDRAM_EBIU (CPLB_COMMON)
67#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY) 77#define SDRAM_OOPS (CPLB_VALID | ANOMALY_05000158_WORKAROUND | CPLB_LOCK | CPLB_DIRTY)
@@ -71,14 +81,7 @@
71#define SIZE_1M 0x00100000 /* 1M */ 81#define SIZE_1M 0x00100000 /* 1M */
72#define SIZE_4M 0x00400000 /* 4M */ 82#define SIZE_4M 0x00400000 /* 4M */
73 83
74#ifdef CONFIG_MPU
75#define MAX_CPLBS 16 84#define MAX_CPLBS 16
76#else
77#define MAX_CPLBS (16 * 2)
78#endif
79
80#define ASYNC_MEMORY_CPLB_COVERAGE ((ASYNC_BANK0_SIZE + ASYNC_BANK1_SIZE + \
81 ASYNC_BANK2_SIZE + ASYNC_BANK3_SIZE) / SIZE_4M)
82 85
83#define CPLB_ENABLE_ICACHE_P 0 86#define CPLB_ENABLE_ICACHE_P 0
84#define CPLB_ENABLE_DCACHE_P 1 87#define CPLB_ENABLE_DCACHE_P 1
@@ -113,4 +116,8 @@
113#define CPLB_INOCACHE CPLB_USER_RD | CPLB_VALID 116#define CPLB_INOCACHE CPLB_USER_RD | CPLB_VALID
114#define CPLB_IDOCACHE CPLB_INOCACHE | CPLB_L1_CHBL 117#define CPLB_IDOCACHE CPLB_INOCACHE | CPLB_L1_CHBL
115 118
119#define FAULT_RW (1 << 16)
120#define FAULT_USERSUPV (1 << 17)
121#define FAULT_CPLBBITS 0x0000ffff
122
116#endif /* _CPLB_H */ 123#endif /* _CPLB_H */
diff --git a/arch/blackfin/include/asm/cplbinit.h b/arch/blackfin/include/asm/cplbinit.h
index f845b41147ba..05b14a631d0c 100644
--- a/arch/blackfin/include/asm/cplbinit.h
+++ b/arch/blackfin/include/asm/cplbinit.h
@@ -32,61 +32,56 @@
32 32
33#include <asm/blackfin.h> 33#include <asm/blackfin.h>
34#include <asm/cplb.h> 34#include <asm/cplb.h>
35#include <linux/threads.h>
35 36
36#ifdef CONFIG_MPU 37#ifdef CONFIG_CPLB_SWITCH_TAB_L1
37 38# define PDT_ATTR __attribute__((l1_data))
38#include <asm/cplb-mpu.h>
39
40#else 39#else
40# define PDT_ATTR
41#endif
41 42
42#define INITIAL_T 0x1 43struct cplb_entry {
43#define SWITCH_T 0x2 44 unsigned long data, addr;
44#define I_CPLB 0x4
45#define D_CPLB 0x8
46
47#define IN_KERNEL 1
48
49enum
50{ZERO_P, L1I_MEM, L1D_MEM, SDRAM_KERN , SDRAM_RAM_MTD, SDRAM_DMAZ, RES_MEM, ASYNC_MEM, L2_MEM};
51
52struct cplb_desc {
53 u32 start; /* start address */
54 u32 end; /* end address */
55 u32 psize; /* prefered size if any otherwise 1MB or 4MB*/
56 u16 attr;/* attributes */
57 u16 i_conf;/* I-CPLB DATA */
58 u16 d_conf;/* D-CPLB DATA */
59 u16 valid;/* valid */
60 const s8 name[30];/* name */
61}; 45};
62 46
63struct cplb_tab { 47struct cplb_boundary {
64 u_long *tab; 48 unsigned long eaddr; /* End of this region. */
65 u16 pos; 49 unsigned long data; /* CPLB data value. */
66 u16 size;
67}; 50};
68 51
69extern u_long icplb_table[]; 52extern struct cplb_boundary dcplb_bounds[];
70extern u_long dcplb_table[]; 53extern struct cplb_boundary icplb_bounds[];
54extern int dcplb_nr_bounds, icplb_nr_bounds;
71 55
72/* Till here we are discussing about the static memory management model. 56extern struct cplb_entry dcplb_tbl[NR_CPUS][MAX_CPLBS];
73 * However, the operating envoronments commonly define more CPLB 57extern struct cplb_entry icplb_tbl[NR_CPUS][MAX_CPLBS];
74 * descriptors to cover the entire addressable memory than will fit into 58extern int first_switched_icplb;
75 * the available on-chip 16 CPLB MMRs. When this happens, the below table 59extern int first_switched_dcplb;
76 * will be used which will hold all the potentially required CPLB descriptors
77 *
78 * This is how Page descriptor Table is implemented in uClinux/Blackfin.
79 */
80 60
81extern u_long ipdt_table[]; 61extern int nr_dcplb_miss[], nr_icplb_miss[], nr_icplb_supv_miss[];
82extern u_long dpdt_table[]; 62extern int nr_dcplb_prot[], nr_cplb_flush[];
83#ifdef CONFIG_CPLB_INFO 63
84extern u_long ipdt_swapcount_table[]; 64#ifdef CONFIG_MPU
85extern u_long dpdt_swapcount_table[]; 65
86#endif 66extern int first_mask_dcplb;
67
68extern int page_mask_order;
69extern int page_mask_nelts;
70
71extern unsigned long *current_rwx_mask[NR_CPUS];
72
73extern void flush_switched_cplbs(unsigned int);
74extern void set_mask_dcplbs(unsigned long *, unsigned int);
75
76extern void __noreturn panic_cplb_error(int seqstat, struct pt_regs *);
87 77
88#endif /* CONFIG_MPU */ 78#endif /* CONFIG_MPU */
89 79
90extern void generate_cplb_tables(void); 80extern void bfin_icache_init(struct cplb_entry *icplb_tbl);
81extern void bfin_dcache_init(struct cplb_entry *icplb_tbl);
91 82
83#if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE)
84extern void generate_cplb_tables_all(void);
85extern void generate_cplb_tables_cpu(unsigned int cpu);
86#endif
92#endif 87#endif
diff --git a/arch/blackfin/include/asm/cpu.h b/arch/blackfin/include/asm/cpu.h
new file mode 100644
index 000000000000..c2594ef877f6
--- /dev/null
+++ b/arch/blackfin/include/asm/cpu.h
@@ -0,0 +1,41 @@
1/*
2 * File: arch/blackfin/include/asm/cpu.h.
3 * Author: Philippe Gerum <rpm@xenomai.org>
4 *
5 * Copyright 2007 Analog Devices Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see the file COPYING, or write
19 * to the Free Software Foundation, Inc.,
20 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#ifndef __ASM_BLACKFIN_CPU_H
24#define __ASM_BLACKFIN_CPU_H
25
26#include <linux/percpu.h>
27
28struct task_struct;
29
30struct blackfin_cpudata {
31 struct cpu cpu;
32 struct task_struct *idle;
33 unsigned int imemctl;
34 unsigned int dmemctl;
35 unsigned long loops_per_jiffy;
36 unsigned long dcache_invld_count;
37};
38
39DECLARE_PER_CPU(struct blackfin_cpudata, cpu_data);
40
41#endif
diff --git a/arch/blackfin/include/asm/dma.h b/arch/blackfin/include/asm/dma.h
index 6509733bb0f6..e4f7b8043f02 100644
--- a/arch/blackfin/include/asm/dma.h
+++ b/arch/blackfin/include/asm/dma.h
@@ -1,44 +1,17 @@
1/* 1/*
2 * File: include/asm-blackfin/simple_bf533_dma.h 2 * dma.h - Blackfin DMA defines/structures/etc...
3 * Based on: none - original work
4 * Author: LG Soft India
5 * Copyright (C) 2004-2005 Analog Devices Inc.
6 * Created: Tue Sep 21 2004
7 * Description: This file contains the major Data structures and constants
8 * used for DMA Implementation in BF533
9 * Modified:
10 * 3 *
11 * Bugs: Enter bugs at http://blackfin.uclinux.org/ 4 * Copyright 2004-2008 Analog Devices Inc.
12 * 5 * Licensed under the GPL-2 or later.
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2, or (at your option)
16 * any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; see the file COPYING.
25 * If not, write to the Free Software Foundation,
26 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 */ 6 */
28 7
29#ifndef _BLACKFIN_DMA_H_ 8#ifndef _BLACKFIN_DMA_H_
30#define _BLACKFIN_DMA_H_ 9#define _BLACKFIN_DMA_H_
31 10
32#include <asm/io.h>
33#include <linux/slab.h>
34#include <asm/irq.h>
35#include <asm/signal.h>
36
37#include <linux/kernel.h>
38#include <mach/dma.h>
39#include <linux/mm.h>
40#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <mach/dma.h>
41#include <asm/blackfin.h> 13#include <asm/blackfin.h>
14#include <asm/page.h>
42 15
43#define MAX_DMA_ADDRESS PAGE_OFFSET 16#define MAX_DMA_ADDRESS PAGE_OFFSET
44 17
@@ -79,7 +52,7 @@ enum dma_chan_status {
79#define DMA_SYNC_RESTART 1 52#define DMA_SYNC_RESTART 1
80 53
81struct dmasg { 54struct dmasg {
82 unsigned long next_desc_addr; 55 void *next_desc_addr;
83 unsigned long start_addr; 56 unsigned long start_addr;
84 unsigned short cfg; 57 unsigned short cfg;
85 unsigned short x_count; 58 unsigned short x_count;
@@ -89,7 +62,7 @@ struct dmasg {
89} __attribute__((packed)); 62} __attribute__((packed));
90 63
91struct dma_register { 64struct dma_register {
92 unsigned long next_desc_ptr; /* DMA Next Descriptor Pointer register */ 65 void *next_desc_ptr; /* DMA Next Descriptor Pointer register */
93 unsigned long start_addr; /* DMA Start address register */ 66 unsigned long start_addr; /* DMA Start address register */
94 67
95 unsigned short cfg; /* DMA Configuration register */ 68 unsigned short cfg; /* DMA Configuration register */
@@ -109,7 +82,7 @@ struct dma_register {
109 short y_modify; /* DMA y_modify register */ 82 short y_modify; /* DMA y_modify register */
110 unsigned short dummy5; 83 unsigned short dummy5;
111 84
112 unsigned long curr_desc_ptr; /* DMA Current Descriptor Pointer 85 void *curr_desc_ptr; /* DMA Current Descriptor Pointer
113 register */ 86 register */
114 unsigned long curr_addr_ptr; /* DMA Current Address Pointer 87 unsigned long curr_addr_ptr; /* DMA Current Address Pointer
115 register */ 88 register */
@@ -131,19 +104,15 @@ struct dma_register {
131 104
132}; 105};
133 106
134typedef irqreturn_t(*dma_interrupt_t) (int irq, void *dev_id); 107struct mutex;
135
136struct dma_channel { 108struct dma_channel {
137 struct mutex dmalock; 109 struct mutex dmalock;
138 char *device_id; 110 const char *device_id;
139 enum dma_chan_status chan_status; 111 enum dma_chan_status chan_status;
140 struct dma_register *regs; 112 volatile struct dma_register *regs;
141 struct dmasg *sg; /* large mode descriptor */ 113 struct dmasg *sg; /* large mode descriptor */
142 unsigned int ctrl_num; /* controller number */ 114 unsigned int irq;
143 dma_interrupt_t irq_callback;
144 void *data; 115 void *data;
145 unsigned int dma_enable_flag;
146 unsigned int loopback_flag;
147#ifdef CONFIG_PM 116#ifdef CONFIG_PM
148 unsigned short saved_peripheral_map; 117 unsigned short saved_peripheral_map;
149#endif 118#endif
@@ -157,49 +126,132 @@ void blackfin_dma_resume(void);
157/******************************************************************************* 126/*******************************************************************************
158* DMA API's 127* DMA API's
159*******************************************************************************/ 128*******************************************************************************/
160/* functions to set register mode */ 129extern struct dma_channel dma_ch[MAX_DMA_CHANNELS];
161void set_dma_start_addr(unsigned int channel, unsigned long addr); 130extern struct dma_register *dma_io_base_addr[MAX_DMA_CHANNELS];
162void set_dma_next_desc_addr(unsigned int channel, unsigned long addr); 131extern int channel2irq(unsigned int channel);
163void set_dma_curr_desc_addr(unsigned int channel, unsigned long addr); 132
164void set_dma_x_count(unsigned int channel, unsigned short x_count); 133static inline void set_dma_start_addr(unsigned int channel, unsigned long addr)
165void set_dma_x_modify(unsigned int channel, short x_modify); 134{
166void set_dma_y_count(unsigned int channel, unsigned short y_count); 135 dma_ch[channel].regs->start_addr = addr;
167void set_dma_y_modify(unsigned int channel, short y_modify); 136}
168void set_dma_config(unsigned int channel, unsigned short config); 137static inline void set_dma_next_desc_addr(unsigned int channel, void *addr)
169unsigned short set_bfin_dma_config(char direction, char flow_mode, 138{
170 char intr_mode, char dma_mode, char width, 139 dma_ch[channel].regs->next_desc_ptr = addr;
171 char syncmode); 140}
172void set_dma_curr_addr(unsigned int channel, unsigned long addr); 141static inline void set_dma_curr_desc_addr(unsigned int channel, void *addr)
173 142{
174/* get curr status for polling */ 143 dma_ch[channel].regs->curr_desc_ptr = addr;
175unsigned short get_dma_curr_irqstat(unsigned int channel); 144}
176unsigned short get_dma_curr_xcount(unsigned int channel); 145static inline void set_dma_x_count(unsigned int channel, unsigned short x_count)
177unsigned short get_dma_curr_ycount(unsigned int channel); 146{
178unsigned long get_dma_next_desc_ptr(unsigned int channel); 147 dma_ch[channel].regs->x_count = x_count;
179unsigned long get_dma_curr_desc_ptr(unsigned int channel); 148}
180unsigned long get_dma_curr_addr(unsigned int channel); 149static inline void set_dma_y_count(unsigned int channel, unsigned short y_count)
181 150{
182/* set large DMA mode descriptor */ 151 dma_ch[channel].regs->y_count = y_count;
183void set_dma_sg(unsigned int channel, struct dmasg *sg, int nr_sg); 152}
184 153static inline void set_dma_x_modify(unsigned int channel, short x_modify)
185/* check if current channel is in use */ 154{
186int dma_channel_active(unsigned int channel); 155 dma_ch[channel].regs->x_modify = x_modify;
187 156}
188/* common functions must be called in any mode */ 157static inline void set_dma_y_modify(unsigned int channel, short y_modify)
158{
159 dma_ch[channel].regs->y_modify = y_modify;
160}
161static inline void set_dma_config(unsigned int channel, unsigned short config)
162{
163 dma_ch[channel].regs->cfg = config;
164}
165static inline void set_dma_curr_addr(unsigned int channel, unsigned long addr)
166{
167 dma_ch[channel].regs->curr_addr_ptr = addr;
168}
169
170static inline unsigned short
171set_bfin_dma_config(char direction, char flow_mode,
172 char intr_mode, char dma_mode, char width, char syncmode)
173{
174 return (direction << 1) | (width << 2) | (dma_mode << 4) |
175 (intr_mode << 6) | (flow_mode << 12) | (syncmode << 5);
176}
177
178static inline unsigned short get_dma_curr_irqstat(unsigned int channel)
179{
180 return dma_ch[channel].regs->irq_status;
181}
182static inline unsigned short get_dma_curr_xcount(unsigned int channel)
183{
184 return dma_ch[channel].regs->curr_x_count;
185}
186static inline unsigned short get_dma_curr_ycount(unsigned int channel)
187{
188 return dma_ch[channel].regs->curr_y_count;
189}
190static inline void *get_dma_next_desc_ptr(unsigned int channel)
191{
192 return dma_ch[channel].regs->next_desc_ptr;
193}
194static inline void *get_dma_curr_desc_ptr(unsigned int channel)
195{
196 return dma_ch[channel].regs->curr_desc_ptr;
197}
198static inline unsigned short get_dma_config(unsigned int channel)
199{
200 return dma_ch[channel].regs->cfg;
201}
202static inline unsigned long get_dma_curr_addr(unsigned int channel)
203{
204 return dma_ch[channel].regs->curr_addr_ptr;
205}
206
207static inline void set_dma_sg(unsigned int channel, struct dmasg *sg, int ndsize)
208{
209 dma_ch[channel].regs->cfg =
210 (dma_ch[channel].regs->cfg & ~(0xf << 8)) |
211 ((ndsize & 0xf) << 8);
212 dma_ch[channel].regs->next_desc_ptr = sg;
213}
214
215static inline int dma_channel_active(unsigned int channel)
216{
217 if (dma_ch[channel].chan_status == DMA_CHANNEL_FREE)
218 return 0;
219 else
220 return 1;
221}
222
223static inline void disable_dma(unsigned int channel)
224{
225 dma_ch[channel].regs->cfg &= ~DMAEN;
226 SSYNC();
227 dma_ch[channel].chan_status = DMA_CHANNEL_REQUESTED;
228}
229static inline void enable_dma(unsigned int channel)
230{
231 dma_ch[channel].regs->curr_x_count = 0;
232 dma_ch[channel].regs->curr_y_count = 0;
233 dma_ch[channel].regs->cfg |= DMAEN;
234 dma_ch[channel].chan_status = DMA_CHANNEL_ENABLED;
235}
189void free_dma(unsigned int channel); 236void free_dma(unsigned int channel);
190int dma_channel_active(unsigned int channel); /* check if a channel is in use */ 237int request_dma(unsigned int channel, const char *device_id);
191void disable_dma(unsigned int channel); 238int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data);
192void enable_dma(unsigned int channel); 239
193int request_dma(unsigned int channel, char *device_id); 240static inline void dma_disable_irq(unsigned int channel)
194int set_dma_callback(unsigned int channel, dma_interrupt_t callback, 241{
195 void *data); 242 disable_irq(dma_ch[channel].irq);
196void dma_disable_irq(unsigned int channel); 243}
197void dma_enable_irq(unsigned int channel); 244static inline void dma_enable_irq(unsigned int channel)
198void clear_dma_irqstat(unsigned int channel); 245{
246 enable_irq(dma_ch[channel].irq);
247}
248static inline void clear_dma_irqstat(unsigned int channel)
249{
250 dma_ch[channel].regs->irq_status = DMA_DONE | DMA_ERR;
251}
252
199void *dma_memcpy(void *dest, const void *src, size_t count); 253void *dma_memcpy(void *dest, const void *src, size_t count);
200void *safe_dma_memcpy(void *dest, const void *src, size_t count); 254void *safe_dma_memcpy(void *dest, const void *src, size_t count);
201 255void blackfin_dma_early_init(void);
202extern int channel2irq(unsigned int channel);
203extern struct dma_register *dma_io_base_addr[MAX_BLACKFIN_DMA_CHANNEL];
204 256
205#endif 257#endif
diff --git a/arch/blackfin/include/asm/entry.h b/arch/blackfin/include/asm/entry.h
index c4f721e0d00d..b30a2968e274 100644
--- a/arch/blackfin/include/asm/entry.h
+++ b/arch/blackfin/include/asm/entry.h
@@ -27,6 +27,14 @@
27#define SAVE_ALL_SYS save_context_no_interrupts 27#define SAVE_ALL_SYS save_context_no_interrupts
28/* This is used for all normal interrupts. It saves a minimum of registers 28/* This is used for all normal interrupts. It saves a minimum of registers
29 to the stack, loads the IRQ number, and jumps to common code. */ 29 to the stack, loads the IRQ number, and jumps to common code. */
30#ifdef CONFIG_IPIPE
31# define LOAD_IPIPE_IPEND \
32 P0.l = lo(IPEND); \
33 P0.h = hi(IPEND); \
34 R1 = [P0];
35#else
36# define LOAD_IPIPE_IPEND
37#endif
30#define INTERRUPT_ENTRY(N) \ 38#define INTERRUPT_ENTRY(N) \
31 [--sp] = SYSCFG; \ 39 [--sp] = SYSCFG; \
32 \ 40 \
@@ -34,6 +42,7 @@
34 [--sp] = R0; /*orig_r0*/ \ 42 [--sp] = R0; /*orig_r0*/ \
35 [--sp] = (R7:0,P5:0); \ 43 [--sp] = (R7:0,P5:0); \
36 R0 = (N); \ 44 R0 = (N); \
45 LOAD_IPIPE_IPEND \
37 jump __common_int_entry; 46 jump __common_int_entry;
38 47
39/* For timer interrupts, we need to save IPEND, since the user_mode 48/* For timer interrupts, we need to save IPEND, since the user_mode
@@ -53,9 +62,11 @@
53/* This one pushes RETI without using CLI. Interrupts are enabled. */ 62/* This one pushes RETI without using CLI. Interrupts are enabled. */
54#define SAVE_CONTEXT_SYSCALL save_context_syscall 63#define SAVE_CONTEXT_SYSCALL save_context_syscall
55#define SAVE_CONTEXT save_context_with_interrupts 64#define SAVE_CONTEXT save_context_with_interrupts
65#define SAVE_CONTEXT_CPLB save_context_cplb
56 66
57#define RESTORE_ALL_SYS restore_context_no_interrupts 67#define RESTORE_ALL_SYS restore_context_no_interrupts
58#define RESTORE_CONTEXT restore_context_with_interrupts 68#define RESTORE_CONTEXT restore_context_with_interrupts
69#define RESTORE_CONTEXT_CPLB restore_context_cplb
59 70
60#endif /* __ASSEMBLY__ */ 71#endif /* __ASSEMBLY__ */
61#endif /* __BFIN_ENTRY_H */ 72#endif /* __BFIN_ENTRY_H */
diff --git a/arch/blackfin/include/asm/gpio.h b/arch/blackfin/include/asm/gpio.h
index ad33ac271fd9..9477d82fcad2 100644
--- a/arch/blackfin/include/asm/gpio.h
+++ b/arch/blackfin/include/asm/gpio.h
@@ -84,11 +84,14 @@
84#ifndef __ARCH_BLACKFIN_GPIO_H__ 84#ifndef __ARCH_BLACKFIN_GPIO_H__
85#define __ARCH_BLACKFIN_GPIO_H__ 85#define __ARCH_BLACKFIN_GPIO_H__
86 86
87#define gpio_bank(x) ((x) >> 4) 87#define gpio_bank(x) ((x) >> 4)
88#define gpio_bit(x) (1<<((x) & 0xF)) 88#define gpio_bit(x) (1<<((x) & 0xF))
89#define gpio_sub_n(x) ((x) & 0xF) 89#define gpio_sub_n(x) ((x) & 0xF)
90 90
91#define GPIO_BANKSIZE 16 91#define GPIO_BANKSIZE 16
92#define GPIO_BANK_NUM DIV_ROUND_UP(MAX_BLACKFIN_GPIOS, GPIO_BANKSIZE)
93
94#include <mach/gpio.h>
92 95
93#define GPIO_0 0 96#define GPIO_0 0
94#define GPIO_1 1 97#define GPIO_1 1
@@ -139,151 +142,9 @@
139#define GPIO_46 46 142#define GPIO_46 46
140#define GPIO_47 47 143#define GPIO_47 47
141 144
142
143#define PERIPHERAL_USAGE 1 145#define PERIPHERAL_USAGE 1
144#define GPIO_USAGE 0 146#define GPIO_USAGE 0
145 147
146#ifdef BF533_FAMILY
147#define MAX_BLACKFIN_GPIOS 16
148
149#define GPIO_PF0 0
150#define GPIO_PF1 1
151#define GPIO_PF2 2
152#define GPIO_PF3 3
153#define GPIO_PF4 4
154#define GPIO_PF5 5
155#define GPIO_PF6 6
156#define GPIO_PF7 7
157#define GPIO_PF8 8
158#define GPIO_PF9 9
159#define GPIO_PF10 10
160#define GPIO_PF11 11
161#define GPIO_PF12 12
162#define GPIO_PF13 13
163#define GPIO_PF14 14
164#define GPIO_PF15 15
165
166#endif
167
168#if defined(BF527_FAMILY) || defined(BF537_FAMILY)
169#define MAX_BLACKFIN_GPIOS 48
170
171#define GPIO_PF0 0
172#define GPIO_PF1 1
173#define GPIO_PF2 2
174#define GPIO_PF3 3
175#define GPIO_PF4 4
176#define GPIO_PF5 5
177#define GPIO_PF6 6
178#define GPIO_PF7 7
179#define GPIO_PF8 8
180#define GPIO_PF9 9
181#define GPIO_PF10 10
182#define GPIO_PF11 11
183#define GPIO_PF12 12
184#define GPIO_PF13 13
185#define GPIO_PF14 14
186#define GPIO_PF15 15
187#define GPIO_PG0 16
188#define GPIO_PG1 17
189#define GPIO_PG2 18
190#define GPIO_PG3 19
191#define GPIO_PG4 20
192#define GPIO_PG5 21
193#define GPIO_PG6 22
194#define GPIO_PG7 23
195#define GPIO_PG8 24
196#define GPIO_PG9 25
197#define GPIO_PG10 26
198#define GPIO_PG11 27
199#define GPIO_PG12 28
200#define GPIO_PG13 29
201#define GPIO_PG14 30
202#define GPIO_PG15 31
203#define GPIO_PH0 32
204#define GPIO_PH1 33
205#define GPIO_PH2 34
206#define GPIO_PH3 35
207#define GPIO_PH4 36
208#define GPIO_PH5 37
209#define GPIO_PH6 38
210#define GPIO_PH7 39
211#define GPIO_PH8 40
212#define GPIO_PH9 41
213#define GPIO_PH10 42
214#define GPIO_PH11 43
215#define GPIO_PH12 44
216#define GPIO_PH13 45
217#define GPIO_PH14 46
218#define GPIO_PH15 47
219
220#define PORT_F GPIO_PF0
221#define PORT_G GPIO_PG0
222#define PORT_H GPIO_PH0
223
224#endif
225
226#ifdef BF548_FAMILY
227#include <mach/gpio.h>
228#endif
229
230#ifdef BF561_FAMILY
231#define MAX_BLACKFIN_GPIOS 48
232
233#define GPIO_PF0 0
234#define GPIO_PF1 1
235#define GPIO_PF2 2
236#define GPIO_PF3 3
237#define GPIO_PF4 4
238#define GPIO_PF5 5
239#define GPIO_PF6 6
240#define GPIO_PF7 7
241#define GPIO_PF8 8
242#define GPIO_PF9 9
243#define GPIO_PF10 10
244#define GPIO_PF11 11
245#define GPIO_PF12 12
246#define GPIO_PF13 13
247#define GPIO_PF14 14
248#define GPIO_PF15 15
249#define GPIO_PF16 16
250#define GPIO_PF17 17
251#define GPIO_PF18 18
252#define GPIO_PF19 19
253#define GPIO_PF20 20
254#define GPIO_PF21 21
255#define GPIO_PF22 22
256#define GPIO_PF23 23
257#define GPIO_PF24 24
258#define GPIO_PF25 25
259#define GPIO_PF26 26
260#define GPIO_PF27 27
261#define GPIO_PF28 28
262#define GPIO_PF29 29
263#define GPIO_PF30 30
264#define GPIO_PF31 31
265#define GPIO_PF32 32
266#define GPIO_PF33 33
267#define GPIO_PF34 34
268#define GPIO_PF35 35
269#define GPIO_PF36 36
270#define GPIO_PF37 37
271#define GPIO_PF38 38
272#define GPIO_PF39 39
273#define GPIO_PF40 40
274#define GPIO_PF41 41
275#define GPIO_PF42 42
276#define GPIO_PF43 43
277#define GPIO_PF44 44
278#define GPIO_PF45 45
279#define GPIO_PF46 46
280#define GPIO_PF47 47
281
282#define PORT_FIO0 GPIO_0
283#define PORT_FIO1 GPIO_16
284#define PORT_FIO2 GPIO_32
285#endif
286
287#ifndef __ASSEMBLY__ 148#ifndef __ASSEMBLY__
288 149
289/*********************************************************** 150/***********************************************************
@@ -425,20 +286,77 @@ struct gpio_port_s {
425* MODIFICATION HISTORY : 286* MODIFICATION HISTORY :
426**************************************************************/ 287**************************************************************/
427 288
428int gpio_request(unsigned, const char *); 289int bfin_gpio_request(unsigned gpio, const char *label);
429void gpio_free(unsigned); 290void bfin_gpio_free(unsigned gpio);
430 291int bfin_gpio_irq_request(unsigned gpio, const char *label);
431void gpio_set_value(unsigned gpio, int arg); 292void bfin_gpio_irq_free(unsigned gpio);
432int gpio_get_value(unsigned gpio); 293int bfin_gpio_direction_input(unsigned gpio);
294int bfin_gpio_direction_output(unsigned gpio, int value);
295int bfin_gpio_get_value(unsigned gpio);
296void bfin_gpio_set_value(unsigned gpio, int value);
433 297
434#ifndef BF548_FAMILY 298#ifndef BF548_FAMILY
435#define gpio_set_value(gpio, value) set_gpio_data(gpio, value) 299#define bfin_gpio_set_value(gpio, value) set_gpio_data(gpio, value)
436#endif 300#endif
437 301
438int gpio_direction_input(unsigned gpio); 302#ifdef CONFIG_GPIOLIB
439int gpio_direction_output(unsigned gpio, int value); 303#include <asm-generic/gpio.h> /* cansleep wrappers */
304
305static inline int gpio_get_value(unsigned int gpio)
306{
307 if (gpio < MAX_BLACKFIN_GPIOS)
308 return bfin_gpio_get_value(gpio);
309 else
310 return __gpio_get_value(gpio);
311}
312
313static inline void gpio_set_value(unsigned int gpio, int value)
314{
315 if (gpio < MAX_BLACKFIN_GPIOS)
316 bfin_gpio_set_value(gpio, value);
317 else
318 __gpio_set_value(gpio, value);
319}
320
321static inline int gpio_cansleep(unsigned int gpio)
322{
323 return __gpio_cansleep(gpio);
324}
325
326#else /* !CONFIG_GPIOLIB */
327
328static inline int gpio_request(unsigned gpio, const char *label)
329{
330 return bfin_gpio_request(gpio, label);
331}
332
333static inline void gpio_free(unsigned gpio)
334{
335 return bfin_gpio_free(gpio);
336}
337
338static inline int gpio_direction_input(unsigned gpio)
339{
340 return bfin_gpio_direction_input(gpio);
341}
342
343static inline int gpio_direction_output(unsigned gpio, int value)
344{
345 return bfin_gpio_direction_output(gpio, value);
346}
347
348static inline int gpio_get_value(unsigned gpio)
349{
350 return bfin_gpio_get_value(gpio);
351}
352
353static inline void gpio_set_value(unsigned gpio, int value)
354{
355 return bfin_gpio_set_value(gpio, value);
356}
440 357
441#include <asm-generic/gpio.h> /* cansleep wrappers */ 358#include <asm-generic/gpio.h> /* cansleep wrappers */
359#endif /* !CONFIG_GPIOLIB */
442#include <asm/irq.h> 360#include <asm/irq.h>
443 361
444static inline int gpio_to_irq(unsigned gpio) 362static inline int gpio_to_irq(unsigned gpio)
diff --git a/arch/blackfin/include/asm/hardirq.h b/arch/blackfin/include/asm/hardirq.h
index b6b19f1b9dab..717181a1749b 100644
--- a/arch/blackfin/include/asm/hardirq.h
+++ b/arch/blackfin/include/asm/hardirq.h
@@ -42,4 +42,6 @@ typedef struct {
42 42
43#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1 43#define __ARCH_IRQ_EXIT_IRQS_DISABLED 1
44 44
45extern void ack_bad_irq(unsigned int irq);
46
45#endif 47#endif
diff --git a/arch/blackfin/include/asm/io.h b/arch/blackfin/include/asm/io.h
index 7dc77a21fdf3..63b2d8c78570 100644
--- a/arch/blackfin/include/asm/io.h
+++ b/arch/blackfin/include/asm/io.h
@@ -94,12 +94,12 @@ static inline unsigned int readl(const volatile void __iomem *addr)
94#define outw_p(x,addr) outw(x,addr) 94#define outw_p(x,addr) outw(x,addr)
95#define outl_p(x,addr) outl(x,addr) 95#define outl_p(x,addr) outl(x,addr)
96 96
97#define ioread8_rep(a,d,c) insb(a,d,c) 97#define ioread8_rep(a,d,c) readsb(a,d,c)
98#define ioread16_rep(a,d,c) insw(a,d,c) 98#define ioread16_rep(a,d,c) readsw(a,d,c)
99#define ioread32_rep(a,d,c) insl(a,d,c) 99#define ioread32_rep(a,d,c) readsl(a,d,c)
100#define iowrite8_rep(a,s,c) outsb(a,s,c) 100#define iowrite8_rep(a,s,c) writesb(a,s,c)
101#define iowrite16_rep(a,s,c) outsw(a,s,c) 101#define iowrite16_rep(a,s,c) writesw(a,s,c)
102#define iowrite32_rep(a,s,c) outsl(a,s,c) 102#define iowrite32_rep(a,s,c) writesl(a,s,c)
103 103
104#define ioread8(X) readb(X) 104#define ioread8(X) readb(X)
105#define ioread16(X) readw(X) 105#define ioread16(X) readw(X)
@@ -108,6 +108,8 @@ static inline unsigned int readl(const volatile void __iomem *addr)
108#define iowrite16(val,X) writew(val,X) 108#define iowrite16(val,X) writew(val,X)
109#define iowrite32(val,X) writel(val,X) 109#define iowrite32(val,X) writel(val,X)
110 110
111#define mmiowb() wmb()
112
111#define IO_SPACE_LIMIT 0xffffffff 113#define IO_SPACE_LIMIT 0xffffffff
112 114
113/* Values for nocacheflag and cmode */ 115/* Values for nocacheflag and cmode */
diff --git a/arch/blackfin/include/asm/ipipe.h b/arch/blackfin/include/asm/ipipe.h
new file mode 100644
index 000000000000..76f53d8b9a0d
--- /dev/null
+++ b/arch/blackfin/include/asm/ipipe.h
@@ -0,0 +1,278 @@
1/* -*- linux-c -*-
2 * include/asm-blackfin/ipipe.h
3 *
4 * Copyright (C) 2002-2007 Philippe Gerum.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
9 * USA; either version 2 of the License, or (at your option) any later
10 * version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21
22#ifndef __ASM_BLACKFIN_IPIPE_H
23#define __ASM_BLACKFIN_IPIPE_H
24
25#ifdef CONFIG_IPIPE
26
27#include <linux/cpumask.h>
28#include <linux/list.h>
29#include <linux/threads.h>
30#include <linux/irq.h>
31#include <linux/ipipe_percpu.h>
32#include <asm/ptrace.h>
33#include <asm/irq.h>
34#include <asm/bitops.h>
35#include <asm/atomic.h>
36#include <asm/traps.h>
37
38#define IPIPE_ARCH_STRING "1.8-00"
39#define IPIPE_MAJOR_NUMBER 1
40#define IPIPE_MINOR_NUMBER 8
41#define IPIPE_PATCH_NUMBER 0
42
43#ifdef CONFIG_SMP
44#error "I-pipe/blackfin: SMP not implemented"
45#else /* !CONFIG_SMP */
46#define ipipe_processor_id() 0
47#endif /* CONFIG_SMP */
48
49#define prepare_arch_switch(next) \
50do { \
51 ipipe_schedule_notify(current, next); \
52 local_irq_disable_hw(); \
53} while (0)
54
55#define task_hijacked(p) \
56 ({ \
57 int __x__ = ipipe_current_domain != ipipe_root_domain; \
58 /* We would need to clear the SYNC flag for the root domain */ \
59 /* over the current processor in SMP mode. */ \
60 local_irq_enable_hw(); __x__; \
61 })
62
63struct ipipe_domain;
64
65struct ipipe_sysinfo {
66
67 int ncpus; /* Number of CPUs on board */
68 u64 cpufreq; /* CPU frequency (in Hz) */
69
70 /* Arch-dependent block */
71
72 struct {
73 unsigned tmirq; /* Timer tick IRQ */
74 u64 tmfreq; /* Timer frequency */
75 } archdep;
76};
77
78#define ipipe_read_tsc(t) \
79 ({ \
80 unsigned long __cy2; \
81 __asm__ __volatile__ ("1: %0 = CYCLES2\n" \
82 "%1 = CYCLES\n" \
83 "%2 = CYCLES2\n" \
84 "CC = %2 == %0\n" \
85 "if ! CC jump 1b\n" \
86 : "=r" (((unsigned long *)&t)[1]), \
87 "=r" (((unsigned long *)&t)[0]), \
88 "=r" (__cy2) \
89 : /*no input*/ : "CC"); \
90 t; \
91 })
92
93#define ipipe_cpu_freq() __ipipe_core_clock
94#define ipipe_tsc2ns(_t) (((unsigned long)(_t)) * __ipipe_freq_scale)
95#define ipipe_tsc2us(_t) (ipipe_tsc2ns(_t) / 1000 + 1)
96
97/* Private interface -- Internal use only */
98
99#define __ipipe_check_platform() do { } while (0)
100
101#define __ipipe_init_platform() do { } while (0)
102
103extern atomic_t __ipipe_irq_lvdepth[IVG15 + 1];
104
105extern unsigned long __ipipe_irq_lvmask;
106
107extern struct ipipe_domain ipipe_root;
108
109/* enable/disable_irqdesc _must_ be used in pairs. */
110
111void __ipipe_enable_irqdesc(struct ipipe_domain *ipd,
112 unsigned irq);
113
114void __ipipe_disable_irqdesc(struct ipipe_domain *ipd,
115 unsigned irq);
116
117#define __ipipe_enable_irq(irq) (irq_desc[irq].chip->unmask(irq))
118
119#define __ipipe_disable_irq(irq) (irq_desc[irq].chip->mask(irq))
120
121#define __ipipe_lock_root() \
122 set_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags)
123
124#define __ipipe_unlock_root() \
125 clear_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags)
126
127void __ipipe_enable_pipeline(void);
128
129#define __ipipe_hook_critical_ipi(ipd) do { } while (0)
130
131#define __ipipe_sync_pipeline(syncmask) \
132 do { \
133 struct ipipe_domain *ipd = ipipe_current_domain; \
134 if (likely(ipd != ipipe_root_domain || !test_bit(IPIPE_ROOTLOCK_FLAG, &ipd->flags))) \
135 __ipipe_sync_stage(syncmask); \
136 } while (0)
137
138void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs);
139
140int __ipipe_get_irq_priority(unsigned irq);
141
142int __ipipe_get_irqthread_priority(unsigned irq);
143
144void __ipipe_stall_root_raw(void);
145
146void __ipipe_unstall_root_raw(void);
147
148void __ipipe_serial_debug(const char *fmt, ...);
149
150DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
151
152extern unsigned long __ipipe_core_clock;
153
154extern unsigned long __ipipe_freq_scale;
155
156extern unsigned long __ipipe_irq_tail_hook;
157
158static inline unsigned long __ipipe_ffnz(unsigned long ul)
159{
160 return ffs(ul) - 1;
161}
162
163#define __ipipe_run_irqtail() /* Must be a macro */ \
164 do { \
165 asmlinkage void __ipipe_call_irqtail(void); \
166 unsigned long __pending; \
167 CSYNC(); \
168 __pending = bfin_read_IPEND(); \
169 if (__pending & 0x8000) { \
170 __pending &= ~0x8010; \
171 if (__pending && (__pending & (__pending - 1)) == 0) \
172 __ipipe_call_irqtail(); \
173 } \
174 } while (0)
175
176#define __ipipe_run_isr(ipd, irq) \
177 do { \
178 if (ipd == ipipe_root_domain) { \
179 /* \
180 * Note: the I-pipe implements a threaded interrupt model on \
181 * this arch for Linux external IRQs. The interrupt handler we \
182 * call here only wakes up the associated IRQ thread. \
183 */ \
184 if (ipipe_virtual_irq_p(irq)) { \
185 /* No irqtail here; virtual interrupts have no effect \
186 on IPEND so there is no need for processing \
187 deferral. */ \
188 local_irq_enable_nohead(ipd); \
189 ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \
190 local_irq_disable_nohead(ipd); \
191 } else \
192 /* \
193 * No need to run the irqtail here either; \
194 * we can't be preempted by hw IRQs, so \
195 * non-Linux IRQs cannot stack over the short \
196 * thread wakeup code. Which in turn means \
197 * that no irqtail condition could be pending \
198 * for domains above Linux in the pipeline. \
199 */ \
200 ipd->irqs[irq].handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs)); \
201 } else { \
202 __clear_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \
203 local_irq_enable_nohead(ipd); \
204 ipd->irqs[irq].handler(irq, ipd->irqs[irq].cookie); \
205 /* Attempt to exit the outer interrupt level before \
206 * starting the deferred IRQ processing. */ \
207 local_irq_disable_nohead(ipd); \
208 __ipipe_run_irqtail(); \
209 __set_bit(IPIPE_SYNC_FLAG, &ipipe_cpudom_var(ipd, status)); \
210 } \
211 } while (0)
212
213#define __ipipe_syscall_watched_p(p, sc) \
214 (((p)->flags & PF_EVNOTIFY) || (unsigned long)sc >= NR_syscalls)
215
216void ipipe_init_irq_threads(void);
217
218int ipipe_start_irq_thread(unsigned irq, struct irq_desc *desc);
219
220#define IS_SYSIRQ(irq) ((irq) > IRQ_CORETMR && (irq) <= SYS_IRQS)
221#define IS_GPIOIRQ(irq) ((irq) >= GPIO_IRQ_BASE && (irq) < NR_IRQS)
222
223#define IRQ_SYSTMR IRQ_TIMER0
224#define IRQ_PRIOTMR CONFIG_IRQ_TIMER0
225
226#if defined(CONFIG_BF531) || defined(CONFIG_BF532) || defined(CONFIG_BF533)
227#define PRIO_GPIODEMUX(irq) CONFIG_PFA
228#elif defined(CONFIG_BF534) || defined(CONFIG_BF536) || defined(CONFIG_BF537)
229#define PRIO_GPIODEMUX(irq) CONFIG_IRQ_PROG_INTA
230#elif defined(CONFIG_BF52x)
231#define PRIO_GPIODEMUX(irq) ((irq) == IRQ_PORTF_INTA ? CONFIG_IRQ_PORTF_INTA : \
232 (irq) == IRQ_PORTG_INTA ? CONFIG_IRQ_PORTG_INTA : \
233 (irq) == IRQ_PORTH_INTA ? CONFIG_IRQ_PORTH_INTA : \
234 -1)
235#elif defined(CONFIG_BF561)
236#define PRIO_GPIODEMUX(irq) ((irq) == IRQ_PROG0_INTA ? CONFIG_IRQ_PROG0_INTA : \
237 (irq) == IRQ_PROG1_INTA ? CONFIG_IRQ_PROG1_INTA : \
238 (irq) == IRQ_PROG2_INTA ? CONFIG_IRQ_PROG2_INTA : \
239 -1)
240#define bfin_write_TIMER_DISABLE(val) bfin_write_TMRS8_DISABLE(val)
241#define bfin_write_TIMER_ENABLE(val) bfin_write_TMRS8_ENABLE(val)
242#define bfin_write_TIMER_STATUS(val) bfin_write_TMRS8_STATUS(val)
243#define bfin_read_TIMER_STATUS() bfin_read_TMRS8_STATUS()
244#elif defined(CONFIG_BF54x)
245#define PRIO_GPIODEMUX(irq) ((irq) == IRQ_PINT0 ? CONFIG_IRQ_PINT0 : \
246 (irq) == IRQ_PINT1 ? CONFIG_IRQ_PINT1 : \
247 (irq) == IRQ_PINT2 ? CONFIG_IRQ_PINT2 : \
248 (irq) == IRQ_PINT3 ? CONFIG_IRQ_PINT3 : \
249 -1)
250#define bfin_write_TIMER_DISABLE(val) bfin_write_TIMER_DISABLE0(val)
251#define bfin_write_TIMER_ENABLE(val) bfin_write_TIMER_ENABLE0(val)
252#define bfin_write_TIMER_STATUS(val) bfin_write_TIMER_STATUS0(val)
253#define bfin_read_TIMER_STATUS(val) bfin_read_TIMER_STATUS0(val)
254#else
255# error "no PRIO_GPIODEMUX() for this part"
256#endif
257
258#define __ipipe_root_tick_p(regs) ((regs->ipend & 0x10) != 0)
259
260#else /* !CONFIG_IPIPE */
261
262#define task_hijacked(p) 0
263#define ipipe_trap_notify(t, r) 0
264
265#define __ipipe_stall_root_raw() do { } while (0)
266#define __ipipe_unstall_root_raw() do { } while (0)
267
268#define ipipe_init_irq_threads() do { } while (0)
269#define ipipe_start_irq_thread(irq, desc) 0
270
271#define IRQ_SYSTMR IRQ_CORETMR
272#define IRQ_PRIOTMR IRQ_CORETMR
273
274#define __ipipe_root_tick_p(regs) 1
275
276#endif /* !CONFIG_IPIPE */
277
278#endif /* !__ASM_BLACKFIN_IPIPE_H */
diff --git a/arch/blackfin/include/asm/ipipe_base.h b/arch/blackfin/include/asm/ipipe_base.h
new file mode 100644
index 000000000000..cb1025aeabcf
--- /dev/null
+++ b/arch/blackfin/include/asm/ipipe_base.h
@@ -0,0 +1,80 @@
1/* -*- linux-c -*-
2 * include/asm-blackfin/_baseipipe.h
3 *
4 * Copyright (C) 2007 Philippe Gerum.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
9 * USA; either version 2 of the License, or (at your option) any later
10 * version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21
22#ifndef __ASM_BLACKFIN_IPIPE_BASE_H
23#define __ASM_BLACKFIN_IPIPE_BASE_H
24
25#ifdef CONFIG_IPIPE
26
27#define IPIPE_NR_XIRQS NR_IRQS
28#define IPIPE_IRQ_ISHIFT 5 /* 2^5 for 32bits arch. */
29
30/* Blackfin-specific, global domain flags */
31#define IPIPE_ROOTLOCK_FLAG 1 /* Lock pipeline for root */
32
33 /* Blackfin traps -- i.e. exception vector numbers */
34#define IPIPE_NR_FAULTS 52 /* We leave a gap after VEC_ILL_RES. */
35/* Pseudo-vectors used for kernel events */
36#define IPIPE_FIRST_EVENT IPIPE_NR_FAULTS
37#define IPIPE_EVENT_SYSCALL (IPIPE_FIRST_EVENT)
38#define IPIPE_EVENT_SCHEDULE (IPIPE_FIRST_EVENT + 1)
39#define IPIPE_EVENT_SIGWAKE (IPIPE_FIRST_EVENT + 2)
40#define IPIPE_EVENT_SETSCHED (IPIPE_FIRST_EVENT + 3)
41#define IPIPE_EVENT_INIT (IPIPE_FIRST_EVENT + 4)
42#define IPIPE_EVENT_EXIT (IPIPE_FIRST_EVENT + 5)
43#define IPIPE_EVENT_CLEANUP (IPIPE_FIRST_EVENT + 6)
44#define IPIPE_LAST_EVENT IPIPE_EVENT_CLEANUP
45#define IPIPE_NR_EVENTS (IPIPE_LAST_EVENT + 1)
46
47#define IPIPE_TIMER_IRQ IRQ_CORETMR
48
49#ifndef __ASSEMBLY__
50
51#include <linux/bitops.h>
52
53extern int test_bit(int nr, const void *addr);
54
55
56extern unsigned long __ipipe_root_status; /* Alias to ipipe_root_cpudom_var(status) */
57
58static inline void __ipipe_stall_root(void)
59{
60 volatile unsigned long *p = &__ipipe_root_status;
61 set_bit(0, p);
62}
63
64static inline unsigned long __ipipe_test_and_stall_root(void)
65{
66 volatile unsigned long *p = &__ipipe_root_status;
67 return test_and_set_bit(0, p);
68}
69
70static inline unsigned long __ipipe_test_root(void)
71{
72 const unsigned long *p = &__ipipe_root_status;
73 return test_bit(0, p);
74}
75
76#endif /* !__ASSEMBLY__ */
77
78#endif /* CONFIG_IPIPE */
79
80#endif /* !__ASM_BLACKFIN_IPIPE_BASE_H */
diff --git a/arch/blackfin/include/asm/irq.h b/arch/blackfin/include/asm/irq.h
index 89f59e18af93..3d977909ce7d 100644
--- a/arch/blackfin/include/asm/irq.h
+++ b/arch/blackfin/include/asm/irq.h
@@ -17,56 +17,272 @@
17#ifndef _BFIN_IRQ_H_ 17#ifndef _BFIN_IRQ_H_
18#define _BFIN_IRQ_H_ 18#define _BFIN_IRQ_H_
19 19
20/* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h>*/
20#include <mach/irq.h> 21#include <mach/irq.h>
21#include <asm/ptrace.h> 22#include <asm/pda.h>
22 23#include <asm/processor.h>
23/*******************************************************************************
24 ***** INTRODUCTION ***********
25 * On the Blackfin, the interrupt structure allows remmapping of the hardware
26 * levels.
27 * - I'm going to assume that the H/W level is going to stay at the default
28 * settings. If someone wants to go through and abstart this out, feel free
29 * to mod the interrupt numbering scheme.
30 * - I'm abstracting the interrupts so that uClinux does not know anything
31 * about the H/W levels. If you want to change the H/W AND keep the abstracted
32 * levels that uClinux sees, you should be able to do most of it here.
33 * - I've left the "abstract" numbering sparce in case someone wants to pull the
34 * interrupts apart (just the TX/RX for the various devices)
35 *******************************************************************************/
36 24
37/* SYS_IRQS and NR_IRQS are defined in <mach-bf5xx/irq.h>*/ 25#ifdef CONFIG_SMP
26/* Forward decl needed due to cdef inter dependencies */
27static inline uint32_t __pure bfin_dspid(void);
28# define blackfin_core_id() (bfin_dspid() & 0xff)
29# define bfin_irq_flags cpu_pda[blackfin_core_id()].imask
30#else
31extern unsigned long bfin_irq_flags;
32#endif
38 33
39/* 34#ifdef CONFIG_IPIPE
40 * Machine specific interrupt sources. 35
41 * 36#include <linux/ipipe_trace.h>
42 * Adding an interrupt service routine for a source with this bit 37
43 * set indicates a special machine specific interrupt source. 38void __ipipe_unstall_root(void);
44 * The machine specific files define these sources. 39
45 * 40void __ipipe_restore_root(unsigned long flags);
46 * The IRQ_MACHSPEC bit is now gone - the only thing it did was to 41
47 * introduce unnecessary overhead. 42#ifdef CONFIG_DEBUG_HWERR
48 * 43# define __all_masked_irq_flags 0x3f
49 * All interrupt handling is actually machine specific so it is better 44# define __save_and_cli_hw(x) \
50 * to use function pointers, as used by the Sparc port, and select the 45 __asm__ __volatile__( \
51 * interrupt handling functions when initializing the kernel. This way 46 "cli %0;" \
52 * we save some unnecessary overhead at run-time. 47 "sti %1;" \
53 * 01/11/97 - Jes 48 : "=&d"(x) \
54 */ 49 : "d" (0x3F) \
50 )
51#else
52# define __all_masked_irq_flags 0x1f
53# define __save_and_cli_hw(x) \
54 __asm__ __volatile__( \
55 "cli %0;" \
56 : "=&d"(x) \
57 )
58#endif
59
60#define irqs_enabled_from_flags_hw(x) ((x) != __all_masked_irq_flags)
61#define raw_irqs_disabled_flags(flags) (!irqs_enabled_from_flags_hw(flags))
62#define local_test_iflag_hw(x) irqs_enabled_from_flags_hw(x)
55 63
56extern void ack_bad_irq(unsigned int irq); 64#define local_save_flags(x) \
65 do { \
66 (x) = __ipipe_test_root() ? \
67 __all_masked_irq_flags : bfin_irq_flags; \
68 } while (0)
57 69
58static __inline__ int irq_canonicalize(int irq) 70#define local_irq_save(x) \
71 do { \
72 (x) = __ipipe_test_and_stall_root(); \
73 } while (0)
74
75#define local_irq_restore(x) __ipipe_restore_root(x)
76#define local_irq_disable() __ipipe_stall_root()
77#define local_irq_enable() __ipipe_unstall_root()
78#define irqs_disabled() __ipipe_test_root()
79
80#define local_save_flags_hw(x) \
81 __asm__ __volatile__( \
82 "cli %0;" \
83 "sti %0;" \
84 : "=d"(x) \
85 )
86
87#define irqs_disabled_hw() \
88 ({ \
89 unsigned long flags; \
90 local_save_flags_hw(flags); \
91 !irqs_enabled_from_flags_hw(flags); \
92 })
93
94static inline unsigned long raw_mangle_irq_bits(int virt, unsigned long real)
59{ 95{
60 return irq; 96 /* Merge virtual and real interrupt mask bits into a single
97 32bit word. */
98 return (real & ~(1 << 31)) | ((virt != 0) << 31);
99}
100
101static inline int raw_demangle_irq_bits(unsigned long *x)
102{
103 int virt = (*x & (1 << 31)) != 0;
104 *x &= ~(1L << 31);
105 return virt;
61} 106}
62 107
63/* count of spurious interrupts */ 108#ifdef CONFIG_IPIPE_TRACE_IRQSOFF
64/* extern volatile unsigned int num_spurious; */ 109
110#define local_irq_disable_hw() \
111 do { \
112 int _tmp_dummy; \
113 if (!irqs_disabled_hw()) \
114 ipipe_trace_begin(0x80000000); \
115 __asm__ __volatile__ ("cli %0;" : "=d" (_tmp_dummy) : ); \
116 } while (0)
117
118#define local_irq_enable_hw() \
119 do { \
120 if (irqs_disabled_hw()) \
121 ipipe_trace_end(0x80000000); \
122 __asm__ __volatile__ ("sti %0;" : : "d"(bfin_irq_flags)); \
123 } while (0)
124
125#define local_irq_save_hw(x) \
126 do { \
127 __save_and_cli_hw(x); \
128 if (local_test_iflag_hw(x)) \
129 ipipe_trace_begin(0x80000001); \
130 } while (0)
131
132#define local_irq_restore_hw(x) \
133 do { \
134 if (local_test_iflag_hw(x)) { \
135 ipipe_trace_end(0x80000001); \
136 local_irq_enable_hw_notrace(); \
137 } \
138 } while (0)
139
140#define local_irq_disable_hw_notrace() \
141 do { \
142 int _tmp_dummy; \
143 __asm__ __volatile__ ("cli %0;" : "=d" (_tmp_dummy) : ); \
144 } while (0)
145
146#define local_irq_enable_hw_notrace() \
147 __asm__ __volatile__( \
148 "sti %0;" \
149 : \
150 : "d"(bfin_irq_flags) \
151 )
65 152
66#ifndef NO_IRQ 153#define local_irq_save_hw_notrace(x) __save_and_cli_hw(x)
67#define NO_IRQ ((unsigned int)(-1)) 154
155#define local_irq_restore_hw_notrace(x) \
156 do { \
157 if (local_test_iflag_hw(x)) \
158 local_irq_enable_hw_notrace(); \
159 } while (0)
160
161#else /* CONFIG_IPIPE_TRACE_IRQSOFF */
162
163#define local_irq_enable_hw() \
164 __asm__ __volatile__( \
165 "sti %0;" \
166 : \
167 : "d"(bfin_irq_flags) \
168 )
169
170#define local_irq_disable_hw() \
171 do { \
172 int _tmp_dummy; \
173 __asm__ __volatile__ ( \
174 "cli %0;" \
175 : "=d" (_tmp_dummy)); \
176 } while (0)
177
178#define local_irq_restore_hw(x) \
179 do { \
180 if (irqs_enabled_from_flags_hw(x)) \
181 local_irq_enable_hw(); \
182 } while (0)
183
184#define local_irq_save_hw(x) __save_and_cli_hw(x)
185
186#define local_irq_disable_hw_notrace() local_irq_disable_hw()
187#define local_irq_enable_hw_notrace() local_irq_enable_hw()
188#define local_irq_save_hw_notrace(x) local_irq_save_hw(x)
189#define local_irq_restore_hw_notrace(x) local_irq_restore_hw(x)
190
191#endif /* CONFIG_IPIPE_TRACE_IRQSOFF */
192
193#else /* !CONFIG_IPIPE */
194
195/*
196 * Interrupt configuring macros.
197 */
198#define local_irq_disable() \
199 do { \
200 int __tmp_dummy; \
201 __asm__ __volatile__( \
202 "cli %0;" \
203 : "=d" (__tmp_dummy) \
204 ); \
205 } while (0)
206
207#define local_irq_enable() \
208 __asm__ __volatile__( \
209 "sti %0;" \
210 : \
211 : "d" (bfin_irq_flags) \
212 )
213
214#ifdef CONFIG_DEBUG_HWERR
215# define __save_and_cli(x) \
216 __asm__ __volatile__( \
217 "cli %0;" \
218 "sti %1;" \
219 : "=&d" (x) \
220 : "d" (0x3F) \
221 )
222#else
223# define __save_and_cli(x) \
224 __asm__ __volatile__( \
225 "cli %0;" \
226 : "=&d" (x) \
227 )
68#endif 228#endif
69 229
70#define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1)) 230#define local_save_flags(x) \
231 __asm__ __volatile__( \
232 "cli %0;" \
233 "sti %0;" \
234 : "=d" (x) \
235 )
236
237#ifdef CONFIG_DEBUG_HWERR
238#define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0)
239#else
240#define irqs_enabled_from_flags(x) ((x) != 0x1f)
241#endif
242
243#define local_irq_restore(x) \
244 do { \
245 if (irqs_enabled_from_flags(x)) \
246 local_irq_enable(); \
247 } while (0)
248
249/* For spinlocks etc */
250#define local_irq_save(x) __save_and_cli(x)
251
252#define irqs_disabled() \
253({ \
254 unsigned long flags; \
255 local_save_flags(flags); \
256 !irqs_enabled_from_flags(flags); \
257})
258
259#define local_irq_save_hw(x) local_irq_save(x)
260#define local_irq_restore_hw(x) local_irq_restore(x)
261#define local_irq_enable_hw() local_irq_enable()
262#define local_irq_disable_hw() local_irq_disable()
263#define irqs_disabled_hw() irqs_disabled()
264
265#endif /* !CONFIG_IPIPE */
266
267#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE)
268# define NOP_PAD_ANOMALY_05000244 "nop; nop;"
269#else
270# define NOP_PAD_ANOMALY_05000244
271#endif
272
273#define idle_with_irq_disabled() \
274 __asm__ __volatile__( \
275 NOP_PAD_ANOMALY_05000244 \
276 ".align 8;" \
277 "sti %0;" \
278 "idle;" \
279 : \
280 : "d" (bfin_irq_flags) \
281 )
282
283static inline int irq_canonicalize(int irq)
284{
285 return irq;
286}
71 287
72#endif /* _BFIN_IRQ_H_ */ 288#endif /* _BFIN_IRQ_H_ */
diff --git a/arch/blackfin/include/asm/l1layout.h b/arch/blackfin/include/asm/l1layout.h
index c13ded777828..79dbefaa5bef 100644
--- a/arch/blackfin/include/asm/l1layout.h
+++ b/arch/blackfin/include/asm/l1layout.h
@@ -8,6 +8,7 @@
8 8
9#include <asm/blackfin.h> 9#include <asm/blackfin.h>
10 10
11#ifndef CONFIG_SMP
11#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
12 13
13/* Data that is "mapped" into the process VM at the start of the L1 scratch 14/* Data that is "mapped" into the process VM at the start of the L1 scratch
@@ -24,8 +25,10 @@ struct l1_scratch_task_info
24}; 25};
25 26
26/* A pointer to the structure in memory. */ 27/* A pointer to the structure in memory. */
27#define L1_SCRATCH_TASK_INFO ((struct l1_scratch_task_info *)L1_SCRATCH_START) 28#define L1_SCRATCH_TASK_INFO ((struct l1_scratch_task_info *)\
29 get_l1_scratch_start())
28 30
29#endif 31#endif
32#endif
30 33
31#endif 34#endif
diff --git a/arch/blackfin/mach-bf527/include/mach/mem_init.h b/arch/blackfin/include/asm/mem_init.h
index cbe03f4a5698..255a9316ad36 100644
--- a/arch/blackfin/mach-bf527/include/mach/mem_init.h
+++ b/arch/blackfin/include/asm/mem_init.h
@@ -1,35 +1,20 @@
1/* 1/*
2 * File: include/asm-blackfin/mach-bf527/mem_init.h 2 * arch/blackfin/include/asm/mem_init.h - reprogram clocks / memory
3 * Based on:
4 * Author:
5 * 3 *
6 * Created: 4 * Copyright 2004-2008 Analog Devices Inc.
7 * Description:
8 * 5 *
9 * Rev: 6 * Licensed under the GPL-2 or later.
10 *
11 * Modified:
12 * Copyright 2004-2007 Analog Devices Inc.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */ 7 */
31 8
32#if (CONFIG_MEM_MT48LC16M16A2TG_75 || CONFIG_MEM_MT48LC64M4A2FB_7E || CONFIG_MEM_MT48LC16M8A2TG_75 || CONFIG_MEM_GENERIC_BOARD || CONFIG_MEM_MT48LC32M8A2_75 || CONFIG_MEM_MT48LC32M16A2TG_75) 9#if defined(EBIU_SDGCTL)
10#if defined(CONFIG_MEM_MT48LC16M16A2TG_75) || \
11 defined(CONFIG_MEM_MT48LC64M4A2FB_7E) || \
12 defined(CONFIG_MEM_MT48LC16M8A2TG_75) || \
13 defined(CONFIG_MEM_GENERIC_BOARD) || \
14 defined(CONFIG_MEM_MT48LC32M8A2_75) || \
15 defined(CONFIG_MEM_MT48LC8M32B2B5_7) || \
16 defined(CONFIG_MEM_MT48LC32M16A2TG_75) || \
17 defined(CONFIG_MEM_MT48LC32M8A2_75)
33#if (CONFIG_SCLK_HZ > 119402985) 18#if (CONFIG_SCLK_HZ > 119402985)
34#define SDRAM_tRP TRP_2 19#define SDRAM_tRP TRP_2
35#define SDRAM_tRP_num 2 20#define SDRAM_tRP_num 2
@@ -104,53 +89,114 @@
104#endif 89#endif
105#endif 90#endif
106 91
107#if (CONFIG_MEM_MT48LC16M16A2TG_75) 92#if defined(CONFIG_MEM_MT48LC16M8A2TG_75) || \
108 /*SDRAM INFORMATION: */ 93 defined(CONFIG_MEM_MT48LC8M32B2B5_7)
109#define SDRAM_Tref 64 /* Refresh period in milliseconds */
110#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
111#define SDRAM_CL CL_3
112#endif
113
114#if (CONFIG_MEM_MT48LC16M8A2TG_75)
115 /*SDRAM INFORMATION: */ 94 /*SDRAM INFORMATION: */
116#define SDRAM_Tref 64 /* Refresh period in milliseconds */ 95#define SDRAM_Tref 64 /* Refresh period in milliseconds */
117#define SDRAM_NRA 4096 /* Number of row addresses in SDRAM */ 96#define SDRAM_NRA 4096 /* Number of row addresses in SDRAM */
118#define SDRAM_CL CL_3 97#define SDRAM_CL CL_3
119#endif 98#endif
120 99
121#if (CONFIG_MEM_MT48LC32M8A2_75) 100#if defined(CONFIG_MEM_MT48LC32M8A2_75) || \
101 defined(CONFIG_MEM_MT48LC64M4A2FB_7E) || \
102 defined(CONFIG_MEM_GENERIC_BOARD) || \
103 defined(CONFIG_MEM_MT48LC32M16A2TG_75) || \
104 defined(CONFIG_MEM_MT48LC16M16A2TG_75) || \
105 defined(CONFIG_MEM_MT48LC32M8A2_75)
122 /*SDRAM INFORMATION: */ 106 /*SDRAM INFORMATION: */
123#define SDRAM_Tref 64 /* Refresh period in milliseconds */ 107#define SDRAM_Tref 64 /* Refresh period in milliseconds */
124#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */ 108#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
125#define SDRAM_CL CL_3 109#define SDRAM_CL CL_3
126#endif 110#endif
127 111
128#if (CONFIG_MEM_MT48LC64M4A2FB_7E) 112
129 /*SDRAM INFORMATION: */ 113#ifdef CONFIG_BFIN_KERNEL_CLOCK_MEMINIT_CALC
130#define SDRAM_Tref 64 /* Refresh period in milliseconds */ 114/* Equation from section 17 (p17-46) of BF533 HRM */
131#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */ 115#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
132#define SDRAM_CL CL_3 116
117/* Enable SCLK Out */
118#define mem_SDGCTL (0x80000000 | SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
119#else
120#define mem_SDRRC CONFIG_MEM_SDRRC
121#define mem_SDGCTL CONFIG_MEM_SDGCTL
122#endif
133#endif 123#endif
134 124
135#if (CONFIG_MEM_GENERIC_BOARD) 125
136 /*SDRAM INFORMATION: Modify this for your board */ 126#if defined(EBIU_DDRCTL0)
137#define SDRAM_Tref 64 /* Refresh period in milliseconds */ 127#define MIN_DDR_SCLK(x) (x*(CONFIG_SCLK_HZ/1000/1000)/1000 + 1)
138#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */ 128#define MAX_DDR_SCLK(x) (x*(CONFIG_SCLK_HZ/1000/1000)/1000)
139#define SDRAM_CL CL_3 129#define DDR_CLK_HZ(x) (1000*1000*1000/x)
130
131#if defined(CONFIG_MEM_MT46V32M16_6T)
132#define DDR_SIZE DEVSZ_512
133#define DDR_WIDTH DEVWD_16
134#define DDR_MAX_tCK 13
135
136#define DDR_tRC DDR_TRC(MIN_DDR_SCLK(60))
137#define DDR_tRAS DDR_TRAS(MIN_DDR_SCLK(42))
138#define DDR_tRP DDR_TRP(MIN_DDR_SCLK(15))
139#define DDR_tRFC DDR_TRFC(MIN_DDR_SCLK(72))
140#define DDR_tREFI DDR_TREFI(MAX_DDR_SCLK(7800))
141
142#define DDR_tRCD DDR_TRCD(MIN_DDR_SCLK(15))
143#define DDR_tWTR DDR_TWTR(1)
144#define DDR_tMRD DDR_TMRD(MIN_DDR_SCLK(12))
145#define DDR_tWR DDR_TWR(MIN_DDR_SCLK(15))
140#endif 146#endif
141 147
142#if (CONFIG_MEM_MT48LC32M16A2TG_75) 148#if defined(CONFIG_MEM_MT46V32M16_5B)
143 /*SDRAM INFORMATION: */ 149#define DDR_SIZE DEVSZ_512
144#define SDRAM_Tref 64 /* Refresh period in milliseconds */ 150#define DDR_WIDTH DEVWD_16
145#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */ 151#define DDR_MAX_tCK 13
146#define SDRAM_CL CL_3 152
153#define DDR_tRC DDR_TRC(MIN_DDR_SCLK(55))
154#define DDR_tRAS DDR_TRAS(MIN_DDR_SCLK(40))
155#define DDR_tRP DDR_TRP(MIN_DDR_SCLK(15))
156#define DDR_tRFC DDR_TRFC(MIN_DDR_SCLK(70))
157#define DDR_tREFI DDR_TREFI(MAX_DDR_SCLK(7800))
158
159#define DDR_tRCD DDR_TRCD(MIN_DDR_SCLK(15))
160#define DDR_tWTR DDR_TWTR(2)
161#define DDR_tMRD DDR_TMRD(MIN_DDR_SCLK(10))
162#define DDR_tWR DDR_TWR(MIN_DDR_SCLK(15))
147#endif 163#endif
148 164
149/* Equation from section 17 (p17-46) of BF533 HRM */ 165#if defined(CONFIG_MEM_GENERIC_BOARD)
150#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num) 166#define DDR_SIZE DEVSZ_512
167#define DDR_WIDTH DEVWD_16
168#define DDR_MAX_tCK 13
151 169
152/* Enable SCLK Out */ 170#define DDR_tRCD DDR_TRCD(3)
153#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS) 171#define DDR_tWTR DDR_TWTR(2)
172#define DDR_tWR DDR_TWR(2)
173#define DDR_tMRD DDR_TMRD(2)
174#define DDR_tRP DDR_TRP(3)
175#define DDR_tRAS DDR_TRAS(7)
176#define DDR_tRC DDR_TRC(10)
177#define DDR_tRFC DDR_TRFC(12)
178#define DDR_tREFI DDR_TREFI(1288)
179#endif
180
181#if (CONFIG_SCLK_HZ < DDR_CLK_HZ(DDR_MAX_tCK))
182# error "CONFIG_SCLK_HZ is too small (<DDR_CLK_HZ(DDR_MAX_tCK) Hz)."
183#elif(CONFIG_SCLK_HZ <= 133333333)
184# define DDR_CL CL_2
185#else
186# error "CONFIG_SCLK_HZ is too large (>133333333 Hz)."
187#endif
188
189#ifdef CONFIG_BFIN_KERNEL_CLOCK_MEMINIT_CALC
190#define mem_DDRCTL0 (DDR_tRP | DDR_tRAS | DDR_tRC | DDR_tRFC | DDR_tREFI)
191#define mem_DDRCTL1 (DDR_DATWIDTH | EXTBANK_1 | DDR_SIZE | DDR_WIDTH | DDR_tWTR \
192 | DDR_tMRD | DDR_tWR | DDR_tRCD)
193#define mem_DDRCTL2 DDR_CL
194#else
195#define mem_DDRCTL0 CONFIG_MEM_DDRCTL0
196#define mem_DDRCTL1 CONFIG_MEM_DDRCTL1
197#define mem_DDRCTL2 CONFIG_MEM_DDRCTL2
198#endif
199#endif
154 200
155#if defined CONFIG_CLKIN_HALF 201#if defined CONFIG_CLKIN_HALF
156#define CLKIN_HALF 1 202#define CLKIN_HALF 1
@@ -165,6 +211,13 @@
165#endif 211#endif
166 212
167/***************************************Currently Not Being Used *********************************/ 213/***************************************Currently Not Being Used *********************************/
214
215#if defined(CONFIG_FLASH_SPEED_BWAT) && \
216defined(CONFIG_FLASH_SPEED_BRAT) && \
217defined(CONFIG_FLASH_SPEED_BHT) && \
218defined(CONFIG_FLASH_SPEED_BST) && \
219defined(CONFIG_FLASH_SPEED_BTT)
220
168#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1 221#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
169#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1 222#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
170#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ)) 223#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
@@ -308,3 +361,4 @@
308#define flash_EBIU_AMBCTL0 \ 361#define flash_EBIU_AMBCTL0 \
309 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \ 362 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
310 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN) 363 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
364#endif
diff --git a/arch/blackfin/include/asm/mem_map.h b/arch/blackfin/include/asm/mem_map.h
index 88d04a707708..e92b31051bb7 100644
--- a/arch/blackfin/include/asm/mem_map.h
+++ b/arch/blackfin/include/asm/mem_map.h
@@ -9,4 +9,79 @@
9 9
10#include <mach/mem_map.h> 10#include <mach/mem_map.h>
11 11
12#ifndef __ASSEMBLY__
13
14#ifdef CONFIG_SMP
15static inline ulong get_l1_scratch_start_cpu(int cpu)
16{
17 return (cpu) ? COREB_L1_SCRATCH_START : COREA_L1_SCRATCH_START;
18}
19static inline ulong get_l1_code_start_cpu(int cpu)
20{
21 return (cpu) ? COREB_L1_CODE_START : COREA_L1_CODE_START;
22}
23static inline ulong get_l1_data_a_start_cpu(int cpu)
24{
25 return (cpu) ? COREB_L1_DATA_A_START : COREA_L1_DATA_A_START;
26}
27static inline ulong get_l1_data_b_start_cpu(int cpu)
28{
29 return (cpu) ? COREB_L1_DATA_B_START : COREA_L1_DATA_B_START;
30}
31
32static inline ulong get_l1_scratch_start(void)
33{
34 return get_l1_scratch_start_cpu(blackfin_core_id());
35}
36static inline ulong get_l1_code_start(void)
37{
38 return get_l1_code_start_cpu(blackfin_core_id());
39}
40static inline ulong get_l1_data_a_start(void)
41{
42 return get_l1_data_a_start_cpu(blackfin_core_id());
43}
44static inline ulong get_l1_data_b_start(void)
45{
46 return get_l1_data_b_start_cpu(blackfin_core_id());
47}
48
49#else /* !CONFIG_SMP */
50
51static inline ulong get_l1_scratch_start_cpu(int cpu)
52{
53 return L1_SCRATCH_START;
54}
55static inline ulong get_l1_code_start_cpu(int cpu)
56{
57 return L1_CODE_START;
58}
59static inline ulong get_l1_data_a_start_cpu(int cpu)
60{
61 return L1_DATA_A_START;
62}
63static inline ulong get_l1_data_b_start_cpu(int cpu)
64{
65 return L1_DATA_B_START;
66}
67static inline ulong get_l1_scratch_start(void)
68{
69 return get_l1_scratch_start_cpu(0);
70}
71static inline ulong get_l1_code_start(void)
72{
73 return get_l1_code_start_cpu(0);
74}
75static inline ulong get_l1_data_a_start(void)
76{
77 return get_l1_data_a_start_cpu(0);
78}
79static inline ulong get_l1_data_b_start(void)
80{
81 return get_l1_data_b_start_cpu(0);
82}
83
84#endif /* CONFIG_SMP */
85#endif /* __ASSEMBLY__ */
86
12#endif /* _MEM_MAP_H_ */ 87#endif /* _MEM_MAP_H_ */
diff --git a/arch/blackfin/include/asm/mmu.h b/arch/blackfin/include/asm/mmu.h
index 757e43906ed4..dbfd686360e6 100644
--- a/arch/blackfin/include/asm/mmu.h
+++ b/arch/blackfin/include/asm/mmu.h
@@ -10,7 +10,6 @@ struct sram_list_struct {
10}; 10};
11 11
12typedef struct { 12typedef struct {
13 struct vm_list_struct *vmlist;
14 unsigned long end_brk; 13 unsigned long end_brk;
15 unsigned long stack_start; 14 unsigned long stack_start;
16 15
diff --git a/arch/blackfin/include/asm/mmu_context.h b/arch/blackfin/include/asm/mmu_context.h
index 35593dda2a4d..944e29faae48 100644
--- a/arch/blackfin/include/asm/mmu_context.h
+++ b/arch/blackfin/include/asm/mmu_context.h
@@ -37,6 +37,10 @@
37#include <asm/pgalloc.h> 37#include <asm/pgalloc.h>
38#include <asm/cplbinit.h> 38#include <asm/cplbinit.h>
39 39
40/* Note: L1 stacks are CPU-private things, so we bluntly disable this
41 feature in SMP mode, and use the per-CPU scratch SRAM bank only to
42 store the PDA instead. */
43
40extern void *current_l1_stack_save; 44extern void *current_l1_stack_save;
41extern int nr_l1stack_tasks; 45extern int nr_l1stack_tasks;
42extern void *l1_stack_base; 46extern void *l1_stack_base;
@@ -88,12 +92,15 @@ activate_l1stack(struct mm_struct *mm, unsigned long sp_base)
88static inline void switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm, 92static inline void switch_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm,
89 struct task_struct *tsk) 93 struct task_struct *tsk)
90{ 94{
95#ifdef CONFIG_MPU
96 unsigned int cpu = smp_processor_id();
97#endif
91 if (prev_mm == next_mm) 98 if (prev_mm == next_mm)
92 return; 99 return;
93#ifdef CONFIG_MPU 100#ifdef CONFIG_MPU
94 if (prev_mm->context.page_rwx_mask == current_rwx_mask) { 101 if (prev_mm->context.page_rwx_mask == current_rwx_mask[cpu]) {
95 flush_switched_cplbs(); 102 flush_switched_cplbs(cpu);
96 set_mask_dcplbs(next_mm->context.page_rwx_mask); 103 set_mask_dcplbs(next_mm->context.page_rwx_mask, cpu);
97 } 104 }
98#endif 105#endif
99 106
@@ -138,9 +145,10 @@ static inline void protect_page(struct mm_struct *mm, unsigned long addr,
138 145
139static inline void update_protections(struct mm_struct *mm) 146static inline void update_protections(struct mm_struct *mm)
140{ 147{
141 if (mm->context.page_rwx_mask == current_rwx_mask) { 148 unsigned int cpu = smp_processor_id();
142 flush_switched_cplbs(); 149 if (mm->context.page_rwx_mask == current_rwx_mask[cpu]) {
143 set_mask_dcplbs(mm->context.page_rwx_mask); 150 flush_switched_cplbs(cpu);
151 set_mask_dcplbs(mm->context.page_rwx_mask, cpu);
144 } 152 }
145} 153}
146#endif 154#endif
@@ -165,6 +173,9 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
165static inline void destroy_context(struct mm_struct *mm) 173static inline void destroy_context(struct mm_struct *mm)
166{ 174{
167 struct sram_list_struct *tmp; 175 struct sram_list_struct *tmp;
176#ifdef CONFIG_MPU
177 unsigned int cpu = smp_processor_id();
178#endif
168 179
169#ifdef CONFIG_APP_STACK_L1 180#ifdef CONFIG_APP_STACK_L1
170 if (current_l1_stack_save == mm->context.l1_stack_save) 181 if (current_l1_stack_save == mm->context.l1_stack_save)
@@ -179,8 +190,8 @@ static inline void destroy_context(struct mm_struct *mm)
179 kfree(tmp); 190 kfree(tmp);
180 } 191 }
181#ifdef CONFIG_MPU 192#ifdef CONFIG_MPU
182 if (current_rwx_mask == mm->context.page_rwx_mask) 193 if (current_rwx_mask[cpu] == mm->context.page_rwx_mask)
183 current_rwx_mask = NULL; 194 current_rwx_mask[cpu] = NULL;
184 free_pages((unsigned long)mm->context.page_rwx_mask, page_mask_order); 195 free_pages((unsigned long)mm->context.page_rwx_mask, page_mask_order);
185#endif 196#endif
186} 197}
diff --git a/arch/blackfin/include/asm/mutex-dec.h b/arch/blackfin/include/asm/mutex-dec.h
new file mode 100644
index 000000000000..0134151656af
--- /dev/null
+++ b/arch/blackfin/include/asm/mutex-dec.h
@@ -0,0 +1,112 @@
1/*
2 * include/asm-generic/mutex-dec.h
3 *
4 * Generic implementation of the mutex fastpath, based on atomic
5 * decrement/increment.
6 */
7#ifndef _ASM_GENERIC_MUTEX_DEC_H
8#define _ASM_GENERIC_MUTEX_DEC_H
9
10/**
11 * __mutex_fastpath_lock - try to take the lock by moving the count
12 * from 1 to a 0 value
13 * @count: pointer of type atomic_t
14 * @fail_fn: function to call if the original value was not 1
15 *
16 * Change the count from 1 to a value lower than 1, and call <fail_fn> if
17 * it wasn't 1 originally. This function MUST leave the value lower than
18 * 1 even when the "1" assertion wasn't true.
19 */
20static inline void
21__mutex_fastpath_lock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
22{
23 if (unlikely(atomic_dec_return(count) < 0))
24 fail_fn(count);
25 else
26 smp_mb();
27}
28
29/**
30 * __mutex_fastpath_lock_retval - try to take the lock by moving the count
31 * from 1 to a 0 value
32 * @count: pointer of type atomic_t
33 * @fail_fn: function to call if the original value was not 1
34 *
35 * Change the count from 1 to a value lower than 1, and call <fail_fn> if
36 * it wasn't 1 originally. This function returns 0 if the fastpath succeeds,
37 * or anything the slow path function returns.
38 */
39static inline int
40__mutex_fastpath_lock_retval(atomic_t *count, fastcall int (*fail_fn)(atomic_t *))
41{
42 if (unlikely(atomic_dec_return(count) < 0))
43 return fail_fn(count);
44 else {
45 smp_mb();
46 return 0;
47 }
48}
49
50/**
51 * __mutex_fastpath_unlock - try to promote the count from 0 to 1
52 * @count: pointer of type atomic_t
53 * @fail_fn: function to call if the original value was not 0
54 *
55 * Try to promote the count from 0 to 1. If it wasn't 0, call <fail_fn>.
56 * In the failure case, this function is allowed to either set the value to
57 * 1, or to set it to a value lower than 1.
58 *
59 * If the implementation sets it to a value of lower than 1, then the
60 * __mutex_slowpath_needs_to_unlock() macro needs to return 1, it needs
61 * to return 0 otherwise.
62 */
63static inline void
64__mutex_fastpath_unlock(atomic_t *count, fastcall void (*fail_fn)(atomic_t *))
65{
66 smp_mb();
67 if (unlikely(atomic_inc_return(count) <= 0))
68 fail_fn(count);
69}
70
71#define __mutex_slowpath_needs_to_unlock() 1
72
73/**
74 * __mutex_fastpath_trylock - try to acquire the mutex, without waiting
75 *
76 * @count: pointer of type atomic_t
77 * @fail_fn: fallback function
78 *
79 * Change the count from 1 to a value lower than 1, and return 0 (failure)
80 * if it wasn't 1 originally, or return 1 (success) otherwise. This function
81 * MUST leave the value lower than 1 even when the "1" assertion wasn't true.
82 * Additionally, if the value was < 0 originally, this function must not leave
83 * it to 0 on failure.
84 *
85 * If the architecture has no effective trylock variant, it should call the
86 * <fail_fn> spinlock-based trylock variant unconditionally.
87 */
88static inline int
89__mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
90{
91 /*
92 * We have two variants here. The cmpxchg based one is the best one
93 * because it never induce a false contention state. It is included
94 * here because architectures using the inc/dec algorithms over the
95 * xchg ones are much more likely to support cmpxchg natively.
96 *
97 * If not we fall back to the spinlock based variant - that is
98 * just as efficient (and simpler) as a 'destructive' probing of
99 * the mutex state would be.
100 */
101#ifdef __HAVE_ARCH_CMPXCHG
102 if (likely(atomic_cmpxchg(count, 1, 0) == 1)) {
103 smp_mb();
104 return 1;
105 }
106 return 0;
107#else
108 return fail_fn(count);
109#endif
110}
111
112#endif
diff --git a/arch/blackfin/include/asm/mutex.h b/arch/blackfin/include/asm/mutex.h
index 458c1f7fbc18..5d399256bf06 100644
--- a/arch/blackfin/include/asm/mutex.h
+++ b/arch/blackfin/include/asm/mutex.h
@@ -6,4 +6,67 @@
6 * implementation. (see asm-generic/mutex-xchg.h for details) 6 * implementation. (see asm-generic/mutex-xchg.h for details)
7 */ 7 */
8 8
9#ifndef _ASM_MUTEX_H
10#define _ASM_MUTEX_H
11
12#ifndef CONFIG_SMP
9#include <asm-generic/mutex-dec.h> 13#include <asm-generic/mutex-dec.h>
14#else
15
16static inline void
17__mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *))
18{
19 if (unlikely(atomic_dec_return(count) < 0))
20 fail_fn(count);
21 else
22 smp_mb();
23}
24
25static inline int
26__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
27{
28 if (unlikely(atomic_dec_return(count) < 0))
29 return fail_fn(count);
30 else {
31 smp_mb();
32 return 0;
33 }
34}
35
36static inline void
37__mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *))
38{
39 smp_mb();
40 if (unlikely(atomic_inc_return(count) <= 0))
41 fail_fn(count);
42}
43
44#define __mutex_slowpath_needs_to_unlock() 1
45
46static inline int
47__mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
48{
49 /*
50 * We have two variants here. The cmpxchg based one is the best one
51 * because it never induce a false contention state. It is included
52 * here because architectures using the inc/dec algorithms over the
53 * xchg ones are much more likely to support cmpxchg natively.
54 *
55 * If not we fall back to the spinlock based variant - that is
56 * just as efficient (and simpler) as a 'destructive' probing of
57 * the mutex state would be.
58 */
59#ifdef __HAVE_ARCH_CMPXCHG
60 if (likely(atomic_cmpxchg(count, 1, 0) == 1)) {
61 smp_mb();
62 return 1;
63 }
64 return 0;
65#else
66 return fail_fn(count);
67#endif
68}
69
70#endif
71
72#endif
diff --git a/arch/blackfin/include/asm/pda.h b/arch/blackfin/include/asm/pda.h
new file mode 100644
index 000000000000..bd8d4a7efeb2
--- /dev/null
+++ b/arch/blackfin/include/asm/pda.h
@@ -0,0 +1,70 @@
1/*
2 * File: arch/blackfin/include/asm/pda.h
3 * Author: Philippe Gerum <rpm@xenomai.org>
4 *
5 * Copyright 2007 Analog Devices Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see the file COPYING, or write
19 * to the Free Software Foundation, Inc.,
20 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#ifndef _ASM_BLACKFIN_PDA_H
24#define _ASM_BLACKFIN_PDA_H
25
26#include <mach/anomaly.h>
27
28#ifndef __ASSEMBLY__
29
30struct blackfin_pda { /* Per-processor Data Area */
31 struct blackfin_pda *next;
32
33 unsigned long syscfg;
34#ifdef CONFIG_SMP
35 unsigned long imask; /* Current IMASK value */
36#endif
37
38 unsigned long *ipdt; /* Start of switchable I-CPLB table */
39 unsigned long *ipdt_swapcount; /* Number of swaps in ipdt */
40 unsigned long *dpdt; /* Start of switchable D-CPLB table */
41 unsigned long *dpdt_swapcount; /* Number of swaps in dpdt */
42
43 /*
44 * Single instructions can have multiple faults, which
45 * need to be handled by traps.c, in irq5. We store
46 * the exception cause to ensure we don't miss a
47 * double fault condition
48 */
49 unsigned long ex_iptr;
50 unsigned long ex_optr;
51 unsigned long ex_buf[4];
52 unsigned long ex_imask; /* Saved imask from exception */
53 unsigned long *ex_stack; /* Exception stack space */
54
55#ifdef ANOMALY_05000261
56 unsigned long last_cplb_fault_retx;
57#endif
58 unsigned long dcplb_fault_addr;
59 unsigned long icplb_fault_addr;
60 unsigned long retx;
61 unsigned long seqstat;
62};
63
64extern struct blackfin_pda cpu_pda[];
65
66void reserve_pda(void);
67
68#endif /* __ASSEMBLY__ */
69
70#endif /* _ASM_BLACKFIN_PDA_H */
diff --git a/arch/blackfin/include/asm/percpu.h b/arch/blackfin/include/asm/percpu.h
index 78dd61f6b39f..797c0c165069 100644
--- a/arch/blackfin/include/asm/percpu.h
+++ b/arch/blackfin/include/asm/percpu.h
@@ -3,4 +3,14 @@
3 3
4#include <asm-generic/percpu.h> 4#include <asm-generic/percpu.h>
5 5
6#endif /* __ARCH_BLACKFIN_PERCPU__ */ 6#ifdef CONFIG_MODULES
7#define PERCPU_MODULE_RESERVE 8192
8#else
9#define PERCPU_MODULE_RESERVE 0
10#endif
11
12#define PERCPU_ENOUGH_ROOM \
13 (ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES) + \
14 PERCPU_MODULE_RESERVE)
15
16#endif /* __ARCH_BLACKFIN_PERCPU__ */
diff --git a/arch/blackfin/include/asm/pgtable.h b/arch/blackfin/include/asm/pgtable.h
index f11684e4ade7..783c8f7f8f8c 100644
--- a/arch/blackfin/include/asm/pgtable.h
+++ b/arch/blackfin/include/asm/pgtable.h
@@ -29,6 +29,7 @@ typedef pte_t *pte_addr_t;
29#define PAGE_COPY __pgprot(0) /* these mean nothing to NO_MM */ 29#define PAGE_COPY __pgprot(0) /* these mean nothing to NO_MM */
30#define PAGE_READONLY __pgprot(0) /* these mean nothing to NO_MM */ 30#define PAGE_READONLY __pgprot(0) /* these mean nothing to NO_MM */
31#define PAGE_KERNEL __pgprot(0) /* these mean nothing to NO_MM */ 31#define PAGE_KERNEL __pgprot(0) /* these mean nothing to NO_MM */
32#define pgprot_noncached(prot) (prot)
32 33
33extern void paging_init(void); 34extern void paging_init(void);
34 35
diff --git a/arch/blackfin/include/asm/processor.h b/arch/blackfin/include/asm/processor.h
index e3e9b41fa8db..0eece23b41c7 100644
--- a/arch/blackfin/include/asm/processor.h
+++ b/arch/blackfin/include/asm/processor.h
@@ -24,6 +24,14 @@ static inline void wrusp(unsigned long usp)
24 __asm__ __volatile__("usp = %0;\n\t"::"da"(usp)); 24 __asm__ __volatile__("usp = %0;\n\t"::"da"(usp));
25} 25}
26 26
27static inline unsigned long __get_SP(void)
28{
29 unsigned long sp;
30
31 __asm__ __volatile__("%0 = sp;\n\t" : "=da"(sp));
32 return sp;
33}
34
27/* 35/*
28 * User space process size: 1st byte beyond user address space. 36 * User space process size: 1st byte beyond user address space.
29 * Fairly meaningless on nommu. Parts of user programs can be scattered 37 * Fairly meaningless on nommu. Parts of user programs can be scattered
@@ -57,6 +65,7 @@ struct thread_struct {
57 * pass the data segment into user programs if it exists, 65 * pass the data segment into user programs if it exists,
58 * it can't hurt anything as far as I can tell 66 * it can't hurt anything as far as I can tell
59 */ 67 */
68#ifndef CONFIG_SMP
60#define start_thread(_regs, _pc, _usp) \ 69#define start_thread(_regs, _pc, _usp) \
61do { \ 70do { \
62 set_fs(USER_DS); \ 71 set_fs(USER_DS); \
@@ -70,6 +79,16 @@ do { \
70 sizeof(*L1_SCRATCH_TASK_INFO)); \ 79 sizeof(*L1_SCRATCH_TASK_INFO)); \
71 wrusp(_usp); \ 80 wrusp(_usp); \
72} while(0) 81} while(0)
82#else
83#define start_thread(_regs, _pc, _usp) \
84do { \
85 set_fs(USER_DS); \
86 (_regs)->pc = (_pc); \
87 if (current->mm) \
88 (_regs)->p5 = current->mm->start_data; \
89 wrusp(_usp); \
90} while (0)
91#endif
73 92
74/* Forward declaration, a strange C thing */ 93/* Forward declaration, a strange C thing */
75struct task_struct; 94struct task_struct;
@@ -106,7 +125,8 @@ unsigned long get_wchan(struct task_struct *p);
106 eip; }) 125 eip; })
107#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp) 126#define KSTK_ESP(tsk) ((tsk) == current ? rdusp() : (tsk)->thread.usp)
108 127
109#define cpu_relax() barrier() 128#define cpu_relax() smp_mb()
129
110 130
111/* Get the Silicon Revision of the chip */ 131/* Get the Silicon Revision of the chip */
112static inline uint32_t __pure bfin_revid(void) 132static inline uint32_t __pure bfin_revid(void)
@@ -137,7 +157,11 @@ static inline uint32_t __pure bfin_revid(void)
137static inline uint16_t __pure bfin_cpuid(void) 157static inline uint16_t __pure bfin_cpuid(void)
138{ 158{
139 return (bfin_read_CHIPID() & CHIPID_FAMILY) >> 12; 159 return (bfin_read_CHIPID() & CHIPID_FAMILY) >> 12;
160}
140 161
162static inline uint32_t __pure bfin_dspid(void)
163{
164 return bfin_read_DSPID();
141} 165}
142 166
143static inline uint32_t __pure bfin_compiled_revid(void) 167static inline uint32_t __pure bfin_compiled_revid(void)
@@ -154,6 +178,8 @@ static inline uint32_t __pure bfin_compiled_revid(void)
154 return 4; 178 return 4;
155#elif defined(CONFIG_BF_REV_0_5) 179#elif defined(CONFIG_BF_REV_0_5)
156 return 5; 180 return 5;
181#elif defined(CONFIG_BF_REV_0_6)
182 return 6;
157#elif defined(CONFIG_BF_REV_ANY) 183#elif defined(CONFIG_BF_REV_ANY)
158 return 0xffff; 184 return 0xffff;
159#else 185#else
diff --git a/arch/blackfin/include/asm/reboot.h b/arch/blackfin/include/asm/reboot.h
index 6d448b5f5985..4856d62b7467 100644
--- a/arch/blackfin/include/asm/reboot.h
+++ b/arch/blackfin/include/asm/reboot.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * include/asm-blackfin/reboot.h - shutdown/reboot header 2 * reboot.h - shutdown/reboot header
3 * 3 *
4 * Copyright 2004-2007 Analog Devices Inc. 4 * Copyright 2004-2008 Analog Devices Inc.
5 * 5 *
6 * Licensed under the GPL-2 or later. 6 * Licensed under the GPL-2 or later.
7 */ 7 */
diff --git a/arch/blackfin/include/asm/rwlock.h b/arch/blackfin/include/asm/rwlock.h
new file mode 100644
index 000000000000..4a724b378971
--- /dev/null
+++ b/arch/blackfin/include/asm/rwlock.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_BLACKFIN_RWLOCK_H
2#define _ASM_BLACKFIN_RWLOCK_H
3
4#define RW_LOCK_BIAS 0x01000000
5
6#endif
diff --git a/arch/blackfin/include/asm/serial.h b/arch/blackfin/include/asm/serial.h
index 994dd869558c..3a47606c858b 100644
--- a/arch/blackfin/include/asm/serial.h
+++ b/arch/blackfin/include/asm/serial.h
@@ -3,3 +3,4 @@
3 */ 3 */
4 4
5#define SERIAL_EXTRA_IRQ_FLAGS IRQF_TRIGGER_HIGH 5#define SERIAL_EXTRA_IRQ_FLAGS IRQF_TRIGGER_HIGH
6#define BASE_BAUD (1843200 / 16)
diff --git a/arch/blackfin/include/asm/smp.h b/arch/blackfin/include/asm/smp.h
new file mode 100644
index 000000000000..118deeeae7c0
--- /dev/null
+++ b/arch/blackfin/include/asm/smp.h
@@ -0,0 +1,44 @@
1/*
2 * File: arch/blackfin/include/asm/smp.h
3 * Author: Philippe Gerum <rpm@xenomai.org>
4 *
5 * Copyright 2007 Analog Devices Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see the file COPYING, or write
19 * to the Free Software Foundation, Inc.,
20 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#ifndef __ASM_BLACKFIN_SMP_H
24#define __ASM_BLACKFIN_SMP_H
25
26#include <linux/kernel.h>
27#include <linux/threads.h>
28#include <linux/cpumask.h>
29#include <linux/cache.h>
30#include <asm/blackfin.h>
31#include <mach/smp.h>
32
33#define raw_smp_processor_id() blackfin_core_id()
34
35extern char coreb_trampoline_start, coreb_trampoline_end;
36
37struct corelock_slot {
38 int lock;
39};
40
41void smp_icache_flush_range_others(unsigned long start,
42 unsigned long end);
43
44#endif /* !__ASM_BLACKFIN_SMP_H */
diff --git a/arch/blackfin/include/asm/spinlock.h b/arch/blackfin/include/asm/spinlock.h
index 64e908a50646..0249ac319476 100644
--- a/arch/blackfin/include/asm/spinlock.h
+++ b/arch/blackfin/include/asm/spinlock.h
@@ -1,6 +1,89 @@
1#ifndef __BFIN_SPINLOCK_H 1#ifndef __BFIN_SPINLOCK_H
2#define __BFIN_SPINLOCK_H 2#define __BFIN_SPINLOCK_H
3 3
4#error blackfin architecture does not support SMP spin lock yet 4#include <asm/atomic.h>
5 5
6#endif 6asmlinkage int __raw_spin_is_locked_asm(volatile int *ptr);
7asmlinkage void __raw_spin_lock_asm(volatile int *ptr);
8asmlinkage int __raw_spin_trylock_asm(volatile int *ptr);
9asmlinkage void __raw_spin_unlock_asm(volatile int *ptr);
10asmlinkage void __raw_read_lock_asm(volatile int *ptr);
11asmlinkage int __raw_read_trylock_asm(volatile int *ptr);
12asmlinkage void __raw_read_unlock_asm(volatile int *ptr);
13asmlinkage void __raw_write_lock_asm(volatile int *ptr);
14asmlinkage int __raw_write_trylock_asm(volatile int *ptr);
15asmlinkage void __raw_write_unlock_asm(volatile int *ptr);
16
17static inline int __raw_spin_is_locked(raw_spinlock_t *lock)
18{
19 return __raw_spin_is_locked_asm(&lock->lock);
20}
21
22static inline void __raw_spin_lock(raw_spinlock_t *lock)
23{
24 __raw_spin_lock_asm(&lock->lock);
25}
26
27#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
28
29static inline int __raw_spin_trylock(raw_spinlock_t *lock)
30{
31 return __raw_spin_trylock_asm(&lock->lock);
32}
33
34static inline void __raw_spin_unlock(raw_spinlock_t *lock)
35{
36 __raw_spin_unlock_asm(&lock->lock);
37}
38
39static inline void __raw_spin_unlock_wait(raw_spinlock_t *lock)
40{
41 while (__raw_spin_is_locked(lock))
42 cpu_relax();
43}
44
45static inline int __raw_read_can_lock(raw_rwlock_t *rw)
46{
47 return __raw_uncached_fetch_asm(&rw->lock) > 0;
48}
49
50static inline int __raw_write_can_lock(raw_rwlock_t *rw)
51{
52 return __raw_uncached_fetch_asm(&rw->lock) == RW_LOCK_BIAS;
53}
54
55static inline void __raw_read_lock(raw_rwlock_t *rw)
56{
57 __raw_read_lock_asm(&rw->lock);
58}
59
60static inline int __raw_read_trylock(raw_rwlock_t *rw)
61{
62 return __raw_read_trylock_asm(&rw->lock);
63}
64
65static inline void __raw_read_unlock(raw_rwlock_t *rw)
66{
67 __raw_read_unlock_asm(&rw->lock);
68}
69
70static inline void __raw_write_lock(raw_rwlock_t *rw)
71{
72 __raw_write_lock_asm(&rw->lock);
73}
74
75static inline int __raw_write_trylock(raw_rwlock_t *rw)
76{
77 return __raw_write_trylock_asm(&rw->lock);
78}
79
80static inline void __raw_write_unlock(raw_rwlock_t *rw)
81{
82 __raw_write_unlock_asm(&rw->lock);
83}
84
85#define _raw_spin_relax(lock) cpu_relax()
86#define _raw_read_relax(lock) cpu_relax()
87#define _raw_write_relax(lock) cpu_relax()
88
89#endif /* !__BFIN_SPINLOCK_H */
diff --git a/arch/blackfin/include/asm/spinlock_types.h b/arch/blackfin/include/asm/spinlock_types.h
new file mode 100644
index 000000000000..b1e3c4c7b382
--- /dev/null
+++ b/arch/blackfin/include/asm/spinlock_types.h
@@ -0,0 +1,22 @@
1#ifndef __ASM_SPINLOCK_TYPES_H
2#define __ASM_SPINLOCK_TYPES_H
3
4#ifndef __LINUX_SPINLOCK_TYPES_H
5# error "please don't include this file directly"
6#endif
7
8#include <asm/rwlock.h>
9
10typedef struct {
11 volatile unsigned int lock;
12} raw_spinlock_t;
13
14#define __RAW_SPIN_LOCK_UNLOCKED { 0 }
15
16typedef struct {
17 volatile unsigned int lock;
18} raw_rwlock_t;
19
20#define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS }
21
22#endif
diff --git a/arch/blackfin/include/asm/swab.h b/arch/blackfin/include/asm/swab.h
new file mode 100644
index 000000000000..69a051b612bd
--- /dev/null
+++ b/arch/blackfin/include/asm/swab.h
@@ -0,0 +1,48 @@
1#ifndef _BLACKFIN_SWAB_H
2#define _BLACKFIN_SWAB_H
3
4#include <asm/types.h>
5#include <linux/compiler.h>
6
7#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
8# define __SWAB_64_THRU_32__
9#endif
10
11#ifdef __GNUC__
12
13static __inline__ __attribute_const__ __u32 __arch_swahb32(__u32 xx)
14{
15 __u32 tmp;
16 __asm__("%1 = %0 >> 8 (V);\n\t"
17 "%0 = %0 << 8 (V);\n\t"
18 "%0 = %0 | %1;\n\t"
19 : "+d"(xx), "=&d"(tmp));
20 return xx;
21}
22#define __arch_swahb32 __arch_swahb32
23
24static __inline__ __attribute_const__ __u32 __arch_swahw32(__u32 xx)
25{
26 __u32 rv;
27 __asm__("%0 = PACK(%1.L, %1.H);\n\t": "=d"(rv): "d"(xx));
28 return rv;
29}
30#define __arch_swahw32 __arch_swahw32
31
32static __inline__ __attribute_const__ __u32 __arch_swab32(__u32 xx)
33{
34 return __arch_swahb32(__arch_swahw32(xx));
35}
36#define __arch_swab32 __arch_swab32
37
38static __inline__ __attribute_const__ __u16 __arch_swab16(__u16 xx)
39{
40 __u32 xw = xx;
41 __asm__("%0 <<= 8;\n %0.L = %0.L + %0.H (NS);\n": "+d"(xw));
42 return (__u16)xw;
43}
44#define __arch_swab16 __arch_swab16
45
46#endif /* __GNUC__ */
47
48#endif /* _BLACKFIN_SWAB_H */
diff --git a/arch/blackfin/include/asm/system.h b/arch/blackfin/include/asm/system.h
index 8f1627d8bf09..a4c8254bec55 100644
--- a/arch/blackfin/include/asm/system.h
+++ b/arch/blackfin/include/asm/system.h
@@ -37,114 +37,98 @@
37#include <linux/linkage.h> 37#include <linux/linkage.h>
38#include <linux/compiler.h> 38#include <linux/compiler.h>
39#include <mach/anomaly.h> 39#include <mach/anomaly.h>
40#include <asm/pda.h>
41#include <asm/processor.h>
42#include <asm/irq.h>
40 43
41/* 44/*
42 * Interrupt configuring macros. 45 * Force strict CPU ordering.
43 */ 46 */
47#define nop() __asm__ __volatile__ ("nop;\n\t" : : )
48#define mb() __asm__ __volatile__ ("" : : : "memory")
49#define rmb() __asm__ __volatile__ ("" : : : "memory")
50#define wmb() __asm__ __volatile__ ("" : : : "memory")
51#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
52#define read_barrier_depends() do { } while(0)
44 53
45extern unsigned long irq_flags; 54#ifdef CONFIG_SMP
46 55asmlinkage unsigned long __raw_xchg_1_asm(volatile void *ptr, unsigned long value);
47#define local_irq_enable() \ 56asmlinkage unsigned long __raw_xchg_2_asm(volatile void *ptr, unsigned long value);
48 __asm__ __volatile__( \ 57asmlinkage unsigned long __raw_xchg_4_asm(volatile void *ptr, unsigned long value);
49 "sti %0;" \ 58asmlinkage unsigned long __raw_cmpxchg_1_asm(volatile void *ptr,
50 : \ 59 unsigned long new, unsigned long old);
51 : "d" (irq_flags) \ 60asmlinkage unsigned long __raw_cmpxchg_2_asm(volatile void *ptr,
52 ) 61 unsigned long new, unsigned long old);
53 62asmlinkage unsigned long __raw_cmpxchg_4_asm(volatile void *ptr,
54#define local_irq_disable() \ 63 unsigned long new, unsigned long old);
55 do { \ 64
56 int __tmp_dummy; \ 65#ifdef __ARCH_SYNC_CORE_DCACHE
57 __asm__ __volatile__( \ 66# define smp_mb() do { barrier(); smp_check_barrier(); smp_mark_barrier(); } while (0)
58 "cli %0;" \ 67# define smp_rmb() do { barrier(); smp_check_barrier(); } while (0)
59 : "=d" (__tmp_dummy) \ 68# define smp_wmb() do { barrier(); smp_mark_barrier(); } while (0)
60 ); \ 69#define smp_read_barrier_depends() do { barrier(); smp_check_barrier(); } while (0)
61 } while (0)
62
63#if ANOMALY_05000244 && defined(CONFIG_BFIN_ICACHE)
64# define NOP_PAD_ANOMALY_05000244 "nop; nop;"
65#else
66# define NOP_PAD_ANOMALY_05000244
67#endif
68
69#define idle_with_irq_disabled() \
70 __asm__ __volatile__( \
71 NOP_PAD_ANOMALY_05000244 \
72 ".align 8;" \
73 "sti %0;" \
74 "idle;" \
75 : \
76 : "d" (irq_flags) \
77 )
78
79#ifdef CONFIG_DEBUG_HWERR
80# define __save_and_cli(x) \
81 __asm__ __volatile__( \
82 "cli %0;" \
83 "sti %1;" \
84 : "=&d" (x) \
85 : "d" (0x3F) \
86 )
87#else
88# define __save_and_cli(x) \
89 __asm__ __volatile__( \
90 "cli %0;" \
91 : "=&d" (x) \
92 )
93#endif
94
95#define local_save_flags(x) \
96 __asm__ __volatile__( \
97 "cli %0;" \
98 "sti %0;" \
99 : "=d" (x) \
100 )
101 70
102#ifdef CONFIG_DEBUG_HWERR
103#define irqs_enabled_from_flags(x) (((x) & ~0x3f) != 0)
104#else 71#else
105#define irqs_enabled_from_flags(x) ((x) != 0x1f) 72# define smp_mb() barrier()
73# define smp_rmb() barrier()
74# define smp_wmb() barrier()
75#define smp_read_barrier_depends() barrier()
106#endif 76#endif
107 77
108#define local_irq_restore(x) \ 78static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
109 do { \ 79 int size)
110 if (irqs_enabled_from_flags(x)) \ 80{
111 local_irq_enable(); \ 81 unsigned long tmp;
112 } while (0)
113 82
114/* For spinlocks etc */ 83 switch (size) {
115#define local_irq_save(x) __save_and_cli(x) 84 case 1:
85 tmp = __raw_xchg_1_asm(ptr, x);
86 break;
87 case 2:
88 tmp = __raw_xchg_2_asm(ptr, x);
89 break;
90 case 4:
91 tmp = __raw_xchg_4_asm(ptr, x);
92 break;
93 }
116 94
117#define irqs_disabled() \ 95 return tmp;
118({ \ 96}
119 unsigned long flags; \
120 local_save_flags(flags); \
121 !irqs_enabled_from_flags(flags); \
122})
123 97
124/* 98/*
125 * Force strict CPU ordering. 99 * Atomic compare and exchange. Compare OLD with MEM, if identical,
100 * store NEW in MEM. Return the initial value in MEM. Success is
101 * indicated by comparing RETURN with OLD.
126 */ 102 */
127#define nop() asm volatile ("nop;\n\t"::) 103static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
128#define mb() asm volatile ("" : : :"memory") 104 unsigned long new, int size)
129#define rmb() asm volatile ("" : : :"memory") 105{
130#define wmb() asm volatile ("" : : :"memory") 106 unsigned long tmp;
131#define set_mb(var, value) do { (void) xchg(&var, value); } while (0)
132 107
133#define read_barrier_depends() do { } while(0) 108 switch (size) {
109 case 1:
110 tmp = __raw_cmpxchg_1_asm(ptr, new, old);
111 break;
112 case 2:
113 tmp = __raw_cmpxchg_2_asm(ptr, new, old);
114 break;
115 case 4:
116 tmp = __raw_cmpxchg_4_asm(ptr, new, old);
117 break;
118 }
119
120 return tmp;
121}
122#define cmpxchg(ptr, o, n) \
123 ((__typeof__(*(ptr)))__cmpxchg((ptr), (unsigned long)(o), \
124 (unsigned long)(n), sizeof(*(ptr))))
125
126#else /* !CONFIG_SMP */
134 127
135#ifdef CONFIG_SMP
136#define smp_mb() mb()
137#define smp_rmb() rmb()
138#define smp_wmb() wmb()
139#define smp_read_barrier_depends() read_barrier_depends()
140#else
141#define smp_mb() barrier() 128#define smp_mb() barrier()
142#define smp_rmb() barrier() 129#define smp_rmb() barrier()
143#define smp_wmb() barrier() 130#define smp_wmb() barrier()
144#define smp_read_barrier_depends() do { } while(0) 131#define smp_read_barrier_depends() do { } while(0)
145#endif
146
147#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
148 132
149struct __xchg_dummy { 133struct __xchg_dummy {
150 unsigned long a[100]; 134 unsigned long a[100];
@@ -157,7 +141,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
157 unsigned long tmp = 0; 141 unsigned long tmp = 0;
158 unsigned long flags = 0; 142 unsigned long flags = 0;
159 143
160 local_irq_save(flags); 144 local_irq_save_hw(flags);
161 145
162 switch (size) { 146 switch (size) {
163 case 1: 147 case 1:
@@ -179,7 +163,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
179 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory"); 163 : "=&d" (tmp) : "d" (x), "m" (*__xg(ptr)) : "memory");
180 break; 164 break;
181 } 165 }
182 local_irq_restore(flags); 166 local_irq_restore_hw(flags);
183 return tmp; 167 return tmp;
184} 168}
185 169
@@ -194,9 +178,12 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
194 (unsigned long)(n), sizeof(*(ptr)))) 178 (unsigned long)(n), sizeof(*(ptr))))
195#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 179#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
196 180
197#ifndef CONFIG_SMP
198#include <asm-generic/cmpxchg.h> 181#include <asm-generic/cmpxchg.h>
199#endif 182
183#endif /* !CONFIG_SMP */
184
185#define xchg(ptr, x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
186#define tas(ptr) ((void)xchg((ptr), 1))
200 187
201#define prepare_to_switch() do { } while(0) 188#define prepare_to_switch() do { } while(0)
202 189
@@ -205,10 +192,12 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr,
205 * ptr isn't the current task, in which case it does nothing. 192 * ptr isn't the current task, in which case it does nothing.
206 */ 193 */
207 194
208#include <asm/blackfin.h> 195#include <asm/l1layout.h>
196#include <asm/mem_map.h>
209 197
210asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next); 198asmlinkage struct task_struct *resume(struct task_struct *prev, struct task_struct *next);
211 199
200#ifndef CONFIG_SMP
212#define switch_to(prev,next,last) \ 201#define switch_to(prev,next,last) \
213do { \ 202do { \
214 memcpy (&task_thread_info(prev)->l1_task_info, L1_SCRATCH_TASK_INFO, \ 203 memcpy (&task_thread_info(prev)->l1_task_info, L1_SCRATCH_TASK_INFO, \
@@ -217,5 +206,11 @@ do { \
217 sizeof *L1_SCRATCH_TASK_INFO); \ 206 sizeof *L1_SCRATCH_TASK_INFO); \
218 (last) = resume (prev, next); \ 207 (last) = resume (prev, next); \
219} while (0) 208} while (0)
209#else
210#define switch_to(prev, next, last) \
211do { \
212 (last) = resume(prev, next); \
213} while (0)
214#endif
220 215
221#endif /* _BLACKFIN_SYSTEM_H */ 216#endif /* _BLACKFIN_SYSTEM_H */
diff --git a/arch/blackfin/include/asm/thread_info.h b/arch/blackfin/include/asm/thread_info.h
index 642769329d12..e721ce55956c 100644
--- a/arch/blackfin/include/asm/thread_info.h
+++ b/arch/blackfin/include/asm/thread_info.h
@@ -44,6 +44,7 @@
44 */ 44 */
45#define THREAD_SIZE_ORDER 1 45#define THREAD_SIZE_ORDER 1
46#define THREAD_SIZE 8192 /* 2 pages */ 46#define THREAD_SIZE 8192 /* 2 pages */
47#define STACK_WARN (THREAD_SIZE/8)
47 48
48#ifndef __ASSEMBLY__ 49#ifndef __ASSEMBLY__
49 50
@@ -62,7 +63,9 @@ struct thread_info {
62 int preempt_count; /* 0 => preemptable, <0 => BUG */ 63 int preempt_count; /* 0 => preemptable, <0 => BUG */
63 mm_segment_t addr_limit; /* address limit */ 64 mm_segment_t addr_limit; /* address limit */
64 struct restart_block restart_block; 65 struct restart_block restart_block;
66#ifndef CONFIG_SMP
65 struct l1_scratch_task_info l1_task_info; 67 struct l1_scratch_task_info l1_task_info;
68#endif
66}; 69};
67 70
68/* 71/*
@@ -90,7 +93,7 @@ __attribute_const__
90static inline struct thread_info *current_thread_info(void) 93static inline struct thread_info *current_thread_info(void)
91{ 94{
92 struct thread_info *ti; 95 struct thread_info *ti;
93 __asm__("%0 = sp;": "=&d"(ti): 96 __asm__("%0 = sp;" : "=da"(ti) :
94 ); 97 );
95 return (struct thread_info *)((long)ti & ~((long)THREAD_SIZE-1)); 98 return (struct thread_info *)((long)ti & ~((long)THREAD_SIZE-1));
96} 99}
diff --git a/arch/blackfin/include/asm/uaccess.h b/arch/blackfin/include/asm/uaccess.h
index d928b8099056..3248033531e6 100644
--- a/arch/blackfin/include/asm/uaccess.h
+++ b/arch/blackfin/include/asm/uaccess.h
@@ -149,54 +149,42 @@ static inline int bad_user_access_length(void)
149 : /* no outputs */ \ 149 : /* no outputs */ \
150 :"d" (x),"a" (__ptr(p)) : "memory") 150 :"d" (x),"a" (__ptr(p)) : "memory")
151 151
152#define get_user(x,p) \ 152#define get_user(x, ptr) \
153 ({ \ 153({ \
154 int _err = 0; \ 154 int _err = 0; \
155 typeof(*(p)) *_p = (p); \ 155 unsigned long _val = 0; \
156 if (!access_ok(VERIFY_READ, _p, sizeof(*(_p)))) { \ 156 const typeof(*(ptr)) __user *_p = (ptr); \
157 _err = -EFAULT; \ 157 const size_t ptr_size = sizeof(*(_p)); \
158 } \ 158 if (likely(access_ok(VERIFY_READ, _p, ptr_size))) { \
159 else { \ 159 BUILD_BUG_ON(ptr_size >= 8); \
160 switch (sizeof(*(_p))) { \ 160 switch (ptr_size) { \
161 case 1: \ 161 case 1: \
162 __get_user_asm(x, _p, B,(Z)); \ 162 __get_user_asm(_val, _p, B,(Z)); \
163 break; \ 163 break; \
164 case 2: \ 164 case 2: \
165 __get_user_asm(x, _p, W,(Z)); \ 165 __get_user_asm(_val, _p, W,(Z)); \
166 break; \ 166 break; \
167 case 4: \ 167 case 4: \
168 __get_user_asm(x, _p, , ); \ 168 __get_user_asm(_val, _p, , ); \
169 break; \ 169 break; \
170 case 8: { \ 170 } \
171 unsigned long _xl, _xh; \ 171 } else \
172 __get_user_asm(_xl, ((unsigned long *)_p)+0, , ); \ 172 _err = -EFAULT; \
173 __get_user_asm(_xh, ((unsigned long *)_p)+1, , ); \ 173 x = (typeof(*(ptr)))_val; \
174 ((unsigned long *)&x)[0] = _xl; \ 174 _err; \
175 ((unsigned long *)&x)[1] = _xh; \ 175})
176 } break; \
177 default: \
178 x = 0; \
179 printk(KERN_INFO "get_user_bad: %s:%d %s\n", \
180 __FILE__, __LINE__, __func__); \
181 _err = __get_user_bad(); \
182 break; \
183 } \
184 } \
185 _err; \
186 })
187 176
188#define __get_user(x,p) get_user(x,p) 177#define __get_user(x,p) get_user(x,p)
189 178
190#define __get_user_bad() (bad_user_access_length(), (-EFAULT)) 179#define __get_user_bad() (bad_user_access_length(), (-EFAULT))
191 180
192#define __get_user_asm(x,p,bhw,option) \ 181#define __get_user_asm(x, ptr, bhw, option) \
193 { \ 182({ \
194 unsigned long _tmp; \ 183 __asm__ __volatile__ ( \
195 __asm__ ("%0 =" #bhw "[%1]"#option";\n\t" \ 184 "%0 =" #bhw "[%1]" #option ";" \
196 : "=d" (_tmp) \ 185 : "=d" (x) \
197 : "a" (__ptr(p))); \ 186 : "a" (__ptr(ptr))); \
198 (x) = (__typeof__(*(p))) _tmp; \ 187})
199 }
200 188
201#define __copy_from_user(to, from, n) copy_from_user(to, from, n) 189#define __copy_from_user(to, from, n) copy_from_user(to, from, n)
202#define __copy_to_user(to, from, n) copy_to_user(to, from, n) 190#define __copy_to_user(to, from, n) copy_to_user(to, from, n)
@@ -209,8 +197,8 @@ static inline int bad_user_access_length(void)
209#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n))\ 197#define copy_from_user_ret(to,from,n,retval) ({ if (copy_from_user(to,from,n))\
210 return retval; }) 198 return retval; })
211 199
212static inline long copy_from_user(void *to, 200static inline unsigned long __must_check
213 const void __user * from, unsigned long n) 201copy_from_user(void *to, const void __user *from, unsigned long n)
214{ 202{
215 if (access_ok(VERIFY_READ, from, n)) 203 if (access_ok(VERIFY_READ, from, n))
216 memcpy(to, from, n); 204 memcpy(to, from, n);
@@ -219,8 +207,8 @@ static inline long copy_from_user(void *to,
219 return 0; 207 return 0;
220} 208}
221 209
222static inline long copy_to_user(void *to, 210static inline unsigned long __must_check
223 const void __user * from, unsigned long n) 211copy_to_user(void *to, const void __user *from, unsigned long n)
224{ 212{
225 if (access_ok(VERIFY_WRITE, to, n)) 213 if (access_ok(VERIFY_WRITE, to, n))
226 memcpy(to, from, n); 214 memcpy(to, from, n);
@@ -233,8 +221,8 @@ static inline long copy_to_user(void *to,
233 * Copy a null terminated string from userspace. 221 * Copy a null terminated string from userspace.
234 */ 222 */
235 223
236static inline long strncpy_from_user(char *dst, 224static inline long __must_check
237 const char *src, long count) 225strncpy_from_user(char *dst, const char *src, long count)
238{ 226{
239 char *tmp; 227 char *tmp;
240 if (!access_ok(VERIFY_READ, src, 1)) 228 if (!access_ok(VERIFY_READ, src, 1))
@@ -260,7 +248,8 @@ static inline long strnlen_user(const char *src, long n)
260 * Zero Userspace 248 * Zero Userspace
261 */ 249 */
262 250
263static inline unsigned long __clear_user(void *to, unsigned long n) 251static inline unsigned long __must_check
252__clear_user(void *to, unsigned long n)
264{ 253{
265 memset(to, 0, n); 254 memset(to, 0, n);
266 return 0; 255 return 0;
diff --git a/arch/blackfin/include/asm/xor.h b/arch/blackfin/include/asm/xor.h
new file mode 100644
index 000000000000..c82eb12a5b18
--- /dev/null
+++ b/arch/blackfin/include/asm/xor.h
@@ -0,0 +1 @@
#include <asm-generic/xor.h>
diff --git a/arch/blackfin/kernel/Makefile b/arch/blackfin/kernel/Makefile
index 606adc78aa85..38a233374f07 100644
--- a/arch/blackfin/kernel/Makefile
+++ b/arch/blackfin/kernel/Makefile
@@ -7,7 +7,7 @@ extra-y := init_task.o vmlinux.lds
7obj-y := \ 7obj-y := \
8 entry.o process.o bfin_ksyms.o ptrace.o setup.o signal.o \ 8 entry.o process.o bfin_ksyms.o ptrace.o setup.o signal.o \
9 sys_bfin.o traps.o irqchip.o dma-mapping.o flat.o \ 9 sys_bfin.o traps.o irqchip.o dma-mapping.o flat.o \
10 fixed_code.o reboot.o bfin_gpio.o 10 fixed_code.o reboot.o bfin_gpio.o bfin_dma_5xx.o
11 11
12ifeq ($(CONFIG_GENERIC_CLOCKEVENTS),y) 12ifeq ($(CONFIG_GENERIC_CLOCKEVENTS),y)
13 obj-y += time-ts.o 13 obj-y += time-ts.o
@@ -15,8 +15,11 @@ else
15 obj-y += time.o 15 obj-y += time.o
16endif 16endif
17 17
18obj-$(CONFIG_IPIPE) += ipipe.o
19obj-$(CONFIG_IPIPE_TRACE_MCOUNT) += mcount.o
18obj-$(CONFIG_BFIN_GPTIMERS) += gptimers.o 20obj-$(CONFIG_BFIN_GPTIMERS) += gptimers.o
21obj-$(CONFIG_CPLB_INFO) += cplbinfo.o
19obj-$(CONFIG_MODULES) += module.o 22obj-$(CONFIG_MODULES) += module.o
20obj-$(CONFIG_BFIN_DMA_5XX) += bfin_dma_5xx.o
21obj-$(CONFIG_KGDB) += kgdb.o 23obj-$(CONFIG_KGDB) += kgdb.o
24obj-$(CONFIG_KGDB_TESTCASE) += kgdb_test.o
22obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 25obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
diff --git a/arch/blackfin/kernel/asm-offsets.c b/arch/blackfin/kernel/asm-offsets.c
index 9bb85dd5ccb3..b5df9459d6d5 100644
--- a/arch/blackfin/kernel/asm-offsets.c
+++ b/arch/blackfin/kernel/asm-offsets.c
@@ -56,6 +56,9 @@ int main(void)
56 /* offsets into the thread struct */ 56 /* offsets into the thread struct */
57 DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp)); 57 DEFINE(THREAD_KSP, offsetof(struct thread_struct, ksp));
58 DEFINE(THREAD_USP, offsetof(struct thread_struct, usp)); 58 DEFINE(THREAD_USP, offsetof(struct thread_struct, usp));
59 DEFINE(THREAD_SR, offsetof(struct thread_struct, seqstat));
60 DEFINE(PT_SR, offsetof(struct thread_struct, seqstat));
61 DEFINE(THREAD_ESP0, offsetof(struct thread_struct, esp0));
59 DEFINE(THREAD_PC, offsetof(struct thread_struct, pc)); 62 DEFINE(THREAD_PC, offsetof(struct thread_struct, pc));
60 DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE); 63 DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE);
61 64
@@ -128,5 +131,31 @@ int main(void)
128 DEFINE(SIGSEGV, SIGSEGV); 131 DEFINE(SIGSEGV, SIGSEGV);
129 DEFINE(SIGTRAP, SIGTRAP); 132 DEFINE(SIGTRAP, SIGTRAP);
130 133
134 /* PDA management (in L1 scratchpad) */
135 DEFINE(PDA_SYSCFG, offsetof(struct blackfin_pda, syscfg));
136#ifdef CONFIG_SMP
137 DEFINE(PDA_IRQFLAGS, offsetof(struct blackfin_pda, imask));
138#endif
139 DEFINE(PDA_IPDT, offsetof(struct blackfin_pda, ipdt));
140 DEFINE(PDA_IPDT_SWAPCOUNT, offsetof(struct blackfin_pda, ipdt_swapcount));
141 DEFINE(PDA_DPDT, offsetof(struct blackfin_pda, dpdt));
142 DEFINE(PDA_DPDT_SWAPCOUNT, offsetof(struct blackfin_pda, dpdt_swapcount));
143 DEFINE(PDA_EXIPTR, offsetof(struct blackfin_pda, ex_iptr));
144 DEFINE(PDA_EXOPTR, offsetof(struct blackfin_pda, ex_optr));
145 DEFINE(PDA_EXBUF, offsetof(struct blackfin_pda, ex_buf));
146 DEFINE(PDA_EXIMASK, offsetof(struct blackfin_pda, ex_imask));
147 DEFINE(PDA_EXSTACK, offsetof(struct blackfin_pda, ex_stack));
148#ifdef ANOMALY_05000261
149 DEFINE(PDA_LFRETX, offsetof(struct blackfin_pda, last_cplb_fault_retx));
150#endif
151 DEFINE(PDA_DCPLB, offsetof(struct blackfin_pda, dcplb_fault_addr));
152 DEFINE(PDA_ICPLB, offsetof(struct blackfin_pda, icplb_fault_addr));
153 DEFINE(PDA_RETX, offsetof(struct blackfin_pda, retx));
154 DEFINE(PDA_SEQSTAT, offsetof(struct blackfin_pda, seqstat));
155#ifdef CONFIG_SMP
156 /* Inter-core lock (in L2 SRAM) */
157 DEFINE(SIZEOF_CORELOCK, sizeof(struct corelock_slot));
158#endif
159
131 return 0; 160 return 0;
132} 161}
diff --git a/arch/blackfin/kernel/bfin_dma_5xx.c b/arch/blackfin/kernel/bfin_dma_5xx.c
index 339293d677cc..07e02c0d1c07 100644
--- a/arch/blackfin/kernel/bfin_dma_5xx.c
+++ b/arch/blackfin/kernel/bfin_dma_5xx.c
@@ -1,63 +1,27 @@
1/* 1/*
2 * File: arch/blackfin/kernel/bfin_dma_5xx.c 2 * bfin_dma_5xx.c - Blackfin DMA implementation
3 * Based on:
4 * Author:
5 * 3 *
6 * Created: 4 * Copyright 2004-2008 Analog Devices Inc.
7 * Description: This file contains the simple DMA Implementation for Blackfin 5 * Licensed under the GPL-2 or later.
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */ 6 */
29 7
30#include <linux/errno.h> 8#include <linux/errno.h>
31#include <linux/module.h>
32#include <linux/sched.h>
33#include <linux/interrupt.h> 9#include <linux/interrupt.h>
34#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/module.h>
35#include <linux/param.h> 12#include <linux/param.h>
13#include <linux/proc_fs.h>
14#include <linux/sched.h>
15#include <linux/seq_file.h>
16#include <linux/spinlock.h>
36 17
37#include <asm/blackfin.h> 18#include <asm/blackfin.h>
38#include <asm/dma.h>
39#include <asm/cacheflush.h> 19#include <asm/cacheflush.h>
20#include <asm/dma.h>
21#include <asm/uaccess.h>
40 22
41/* Remove unused code not exported by symbol or internally called */ 23struct dma_channel dma_ch[MAX_DMA_CHANNELS];
42#define REMOVE_DEAD_CODE 24EXPORT_SYMBOL(dma_ch);
43
44/**************************************************************************
45 * Global Variables
46***************************************************************************/
47
48static struct dma_channel dma_ch[MAX_BLACKFIN_DMA_CHANNEL];
49
50/*------------------------------------------------------------------------------
51 * Set the Buffer Clear bit in the Configuration register of specific DMA
52 * channel. This will stop the descriptor based DMA operation.
53 *-----------------------------------------------------------------------------*/
54static void clear_dma_buffer(unsigned int channel)
55{
56 dma_ch[channel].regs->cfg |= RESTART;
57 SSYNC();
58 dma_ch[channel].regs->cfg &= ~RESTART;
59 SSYNC();
60}
61 25
62static int __init blackfin_dma_init(void) 26static int __init blackfin_dma_init(void)
63{ 27{
@@ -65,32 +29,67 @@ static int __init blackfin_dma_init(void)
65 29
66 printk(KERN_INFO "Blackfin DMA Controller\n"); 30 printk(KERN_INFO "Blackfin DMA Controller\n");
67 31
68 for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++) { 32 for (i = 0; i < MAX_DMA_CHANNELS; i++) {
69 dma_ch[i].chan_status = DMA_CHANNEL_FREE; 33 dma_ch[i].chan_status = DMA_CHANNEL_FREE;
70 dma_ch[i].regs = dma_io_base_addr[i]; 34 dma_ch[i].regs = dma_io_base_addr[i];
71 mutex_init(&(dma_ch[i].dmalock)); 35 mutex_init(&(dma_ch[i].dmalock));
72 } 36 }
73 /* Mark MEMDMA Channel 0 as requested since we're using it internally */ 37 /* Mark MEMDMA Channel 0 as requested since we're using it internally */
74 dma_ch[CH_MEM_STREAM0_DEST].chan_status = DMA_CHANNEL_REQUESTED; 38 request_dma(CH_MEM_STREAM0_DEST, "Blackfin dma_memcpy");
75 dma_ch[CH_MEM_STREAM0_SRC].chan_status = DMA_CHANNEL_REQUESTED; 39 request_dma(CH_MEM_STREAM0_SRC, "Blackfin dma_memcpy");
76 40
77#if defined(CONFIG_DEB_DMA_URGENT) 41#if defined(CONFIG_DEB_DMA_URGENT)
78 bfin_write_EBIU_DDRQUE(bfin_read_EBIU_DDRQUE() 42 bfin_write_EBIU_DDRQUE(bfin_read_EBIU_DDRQUE()
79 | DEB1_URGENT | DEB2_URGENT | DEB3_URGENT); 43 | DEB1_URGENT | DEB2_URGENT | DEB3_URGENT);
80#endif 44#endif
45
81 return 0; 46 return 0;
82} 47}
83
84arch_initcall(blackfin_dma_init); 48arch_initcall(blackfin_dma_init);
85 49
86/*------------------------------------------------------------------------------ 50#ifdef CONFIG_PROC_FS
87 * Request the specific DMA channel from the system. 51static int proc_dma_show(struct seq_file *m, void *v)
88 *-----------------------------------------------------------------------------*/
89int request_dma(unsigned int channel, char *device_id)
90{ 52{
53 int i;
54
55 for (i = 0; i < MAX_DMA_CHANNELS; ++i)
56 if (dma_ch[i].chan_status != DMA_CHANNEL_FREE)
57 seq_printf(m, "%2d: %s\n", i, dma_ch[i].device_id);
58
59 return 0;
60}
91 61
62static int proc_dma_open(struct inode *inode, struct file *file)
63{
64 return single_open(file, proc_dma_show, NULL);
65}
66
67static const struct file_operations proc_dma_operations = {
68 .open = proc_dma_open,
69 .read = seq_read,
70 .llseek = seq_lseek,
71 .release = single_release,
72};
73
74static int __init proc_dma_init(void)
75{
76 return proc_create("dma", 0, NULL, &proc_dma_operations) != NULL;
77}
78late_initcall(proc_dma_init);
79#endif
80
81/**
82 * request_dma - request a DMA channel
83 *
84 * Request the specific DMA channel from the system if it's available.
85 */
86int request_dma(unsigned int channel, const char *device_id)
87{
92 pr_debug("request_dma() : BEGIN \n"); 88 pr_debug("request_dma() : BEGIN \n");
93 89
90 if (device_id == NULL)
91 printk(KERN_WARNING "request_dma(%u): no device_id given\n", channel);
92
94#if defined(CONFIG_BF561) && ANOMALY_05000182 93#if defined(CONFIG_BF561) && ANOMALY_05000182
95 if (channel >= CH_IMEM_STREAM0_DEST && channel <= CH_IMEM_STREAM1_DEST) { 94 if (channel >= CH_IMEM_STREAM0_DEST && channel <= CH_IMEM_STREAM1_DEST) {
96 if (get_cclk() > 500000000) { 95 if (get_cclk() > 500000000) {
@@ -129,60 +128,63 @@ int request_dma(unsigned int channel, char *device_id)
129#endif 128#endif
130 129
131 dma_ch[channel].device_id = device_id; 130 dma_ch[channel].device_id = device_id;
132 dma_ch[channel].irq_callback = NULL; 131 dma_ch[channel].irq = 0;
133 132
134 /* This is to be enabled by putting a restriction - 133 /* This is to be enabled by putting a restriction -
135 * you have to request DMA, before doing any operations on 134 * you have to request DMA, before doing any operations on
136 * descriptor/channel 135 * descriptor/channel
137 */ 136 */
138 pr_debug("request_dma() : END \n"); 137 pr_debug("request_dma() : END \n");
139 return channel; 138 return 0;
140} 139}
141EXPORT_SYMBOL(request_dma); 140EXPORT_SYMBOL(request_dma);
142 141
143int set_dma_callback(unsigned int channel, dma_interrupt_t callback, void *data) 142int set_dma_callback(unsigned int channel, irq_handler_t callback, void *data)
144{ 143{
145 int ret_irq = 0;
146
147 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE 144 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
148 && channel < MAX_BLACKFIN_DMA_CHANNEL)); 145 && channel < MAX_DMA_CHANNELS));
149 146
150 if (callback != NULL) { 147 if (callback != NULL) {
151 int ret_val; 148 int ret;
152 ret_irq = channel2irq(channel); 149 unsigned int irq = channel2irq(channel);
153 150
154 dma_ch[channel].data = data; 151 ret = request_irq(irq, callback, IRQF_DISABLED,
152 dma_ch[channel].device_id, data);
153 if (ret)
154 return ret;
155 155
156 ret_val = 156 dma_ch[channel].irq = irq;
157 request_irq(ret_irq, (void *)callback, IRQF_DISABLED, 157 dma_ch[channel].data = data;
158 dma_ch[channel].device_id, data);
159 if (ret_val) {
160 printk(KERN_NOTICE
161 "Request irq in DMA engine failed.\n");
162 return -EPERM;
163 }
164 dma_ch[channel].irq_callback = callback;
165 } 158 }
166 return 0; 159 return 0;
167} 160}
168EXPORT_SYMBOL(set_dma_callback); 161EXPORT_SYMBOL(set_dma_callback);
169 162
170void free_dma(unsigned int channel) 163/**
164 * clear_dma_buffer - clear DMA fifos for specified channel
165 *
166 * Set the Buffer Clear bit in the Configuration register of specific DMA
167 * channel. This will stop the descriptor based DMA operation.
168 */
169static void clear_dma_buffer(unsigned int channel)
171{ 170{
172 int ret_irq; 171 dma_ch[channel].regs->cfg |= RESTART;
172 SSYNC();
173 dma_ch[channel].regs->cfg &= ~RESTART;
174}
173 175
176void free_dma(unsigned int channel)
177{
174 pr_debug("freedma() : BEGIN \n"); 178 pr_debug("freedma() : BEGIN \n");
175 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE 179 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
176 && channel < MAX_BLACKFIN_DMA_CHANNEL)); 180 && channel < MAX_DMA_CHANNELS));
177 181
178 /* Halt the DMA */ 182 /* Halt the DMA */
179 disable_dma(channel); 183 disable_dma(channel);
180 clear_dma_buffer(channel); 184 clear_dma_buffer(channel);
181 185
182 if (dma_ch[channel].irq_callback != NULL) { 186 if (dma_ch[channel].irq)
183 ret_irq = channel2irq(channel); 187 free_irq(dma_ch[channel].irq, dma_ch[channel].data);
184 free_irq(ret_irq, dma_ch[channel].data);
185 }
186 188
187 /* Clear the DMA Variable in the Channel */ 189 /* Clear the DMA Variable in the Channel */
188 mutex_lock(&(dma_ch[channel].dmalock)); 190 mutex_lock(&(dma_ch[channel].dmalock));
@@ -193,294 +195,15 @@ void free_dma(unsigned int channel)
193} 195}
194EXPORT_SYMBOL(free_dma); 196EXPORT_SYMBOL(free_dma);
195 197
196void dma_enable_irq(unsigned int channel)
197{
198 int ret_irq;
199
200 pr_debug("dma_enable_irq() : BEGIN \n");
201 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
202 && channel < MAX_BLACKFIN_DMA_CHANNEL));
203
204 ret_irq = channel2irq(channel);
205 enable_irq(ret_irq);
206}
207EXPORT_SYMBOL(dma_enable_irq);
208
209void dma_disable_irq(unsigned int channel)
210{
211 int ret_irq;
212
213 pr_debug("dma_disable_irq() : BEGIN \n");
214 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
215 && channel < MAX_BLACKFIN_DMA_CHANNEL));
216
217 ret_irq = channel2irq(channel);
218 disable_irq(ret_irq);
219}
220EXPORT_SYMBOL(dma_disable_irq);
221
222int dma_channel_active(unsigned int channel)
223{
224 if (dma_ch[channel].chan_status == DMA_CHANNEL_FREE) {
225 return 0;
226 } else {
227 return 1;
228 }
229}
230EXPORT_SYMBOL(dma_channel_active);
231
232/*------------------------------------------------------------------------------
233* stop the specific DMA channel.
234*-----------------------------------------------------------------------------*/
235void disable_dma(unsigned int channel)
236{
237 pr_debug("stop_dma() : BEGIN \n");
238
239 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
240 && channel < MAX_BLACKFIN_DMA_CHANNEL));
241
242 dma_ch[channel].regs->cfg &= ~DMAEN; /* Clean the enable bit */
243 SSYNC();
244 dma_ch[channel].chan_status = DMA_CHANNEL_REQUESTED;
245 /* Needs to be enabled Later */
246 pr_debug("stop_dma() : END \n");
247 return;
248}
249EXPORT_SYMBOL(disable_dma);
250
251void enable_dma(unsigned int channel)
252{
253 pr_debug("enable_dma() : BEGIN \n");
254
255 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
256 && channel < MAX_BLACKFIN_DMA_CHANNEL));
257
258 dma_ch[channel].chan_status = DMA_CHANNEL_ENABLED;
259 dma_ch[channel].regs->curr_x_count = 0;
260 dma_ch[channel].regs->curr_y_count = 0;
261
262 dma_ch[channel].regs->cfg |= DMAEN; /* Set the enable bit */
263 SSYNC();
264 pr_debug("enable_dma() : END \n");
265 return;
266}
267EXPORT_SYMBOL(enable_dma);
268
269/*------------------------------------------------------------------------------
270* Set the Start Address register for the specific DMA channel
271* This function can be used for register based DMA,
272* to setup the start address
273* addr: Starting address of the DMA Data to be transferred.
274*-----------------------------------------------------------------------------*/
275void set_dma_start_addr(unsigned int channel, unsigned long addr)
276{
277 pr_debug("set_dma_start_addr() : BEGIN \n");
278
279 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
280 && channel < MAX_BLACKFIN_DMA_CHANNEL));
281
282 dma_ch[channel].regs->start_addr = addr;
283 SSYNC();
284 pr_debug("set_dma_start_addr() : END\n");
285}
286EXPORT_SYMBOL(set_dma_start_addr);
287
288void set_dma_next_desc_addr(unsigned int channel, unsigned long addr)
289{
290 pr_debug("set_dma_next_desc_addr() : BEGIN \n");
291
292 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
293 && channel < MAX_BLACKFIN_DMA_CHANNEL));
294
295 dma_ch[channel].regs->next_desc_ptr = addr;
296 SSYNC();
297 pr_debug("set_dma_next_desc_addr() : END\n");
298}
299EXPORT_SYMBOL(set_dma_next_desc_addr);
300
301void set_dma_curr_desc_addr(unsigned int channel, unsigned long addr)
302{
303 pr_debug("set_dma_curr_desc_addr() : BEGIN \n");
304
305 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
306 && channel < MAX_BLACKFIN_DMA_CHANNEL));
307
308 dma_ch[channel].regs->curr_desc_ptr = addr;
309 SSYNC();
310 pr_debug("set_dma_curr_desc_addr() : END\n");
311}
312EXPORT_SYMBOL(set_dma_curr_desc_addr);
313
314void set_dma_x_count(unsigned int channel, unsigned short x_count)
315{
316 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
317 && channel < MAX_BLACKFIN_DMA_CHANNEL));
318
319 dma_ch[channel].regs->x_count = x_count;
320 SSYNC();
321}
322EXPORT_SYMBOL(set_dma_x_count);
323
324void set_dma_y_count(unsigned int channel, unsigned short y_count)
325{
326 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
327 && channel < MAX_BLACKFIN_DMA_CHANNEL));
328
329 dma_ch[channel].regs->y_count = y_count;
330 SSYNC();
331}
332EXPORT_SYMBOL(set_dma_y_count);
333
334void set_dma_x_modify(unsigned int channel, short x_modify)
335{
336 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
337 && channel < MAX_BLACKFIN_DMA_CHANNEL));
338
339 dma_ch[channel].regs->x_modify = x_modify;
340 SSYNC();
341}
342EXPORT_SYMBOL(set_dma_x_modify);
343
344void set_dma_y_modify(unsigned int channel, short y_modify)
345{
346 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
347 && channel < MAX_BLACKFIN_DMA_CHANNEL));
348
349 dma_ch[channel].regs->y_modify = y_modify;
350 SSYNC();
351}
352EXPORT_SYMBOL(set_dma_y_modify);
353
354void set_dma_config(unsigned int channel, unsigned short config)
355{
356 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
357 && channel < MAX_BLACKFIN_DMA_CHANNEL));
358
359 dma_ch[channel].regs->cfg = config;
360 SSYNC();
361}
362EXPORT_SYMBOL(set_dma_config);
363
364unsigned short
365set_bfin_dma_config(char direction, char flow_mode,
366 char intr_mode, char dma_mode, char width, char syncmode)
367{
368 unsigned short config;
369
370 config =
371 ((direction << 1) | (width << 2) | (dma_mode << 4) |
372 (intr_mode << 6) | (flow_mode << 12) | (syncmode << 5));
373 return config;
374}
375EXPORT_SYMBOL(set_bfin_dma_config);
376
377void set_dma_sg(unsigned int channel, struct dmasg *sg, int nr_sg)
378{
379 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
380 && channel < MAX_BLACKFIN_DMA_CHANNEL));
381
382 dma_ch[channel].regs->cfg |= ((nr_sg & 0x0F) << 8);
383
384 dma_ch[channel].regs->next_desc_ptr = (unsigned int)sg;
385
386 SSYNC();
387}
388EXPORT_SYMBOL(set_dma_sg);
389
390void set_dma_curr_addr(unsigned int channel, unsigned long addr)
391{
392 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
393 && channel < MAX_BLACKFIN_DMA_CHANNEL));
394
395 dma_ch[channel].regs->curr_addr_ptr = addr;
396 SSYNC();
397}
398EXPORT_SYMBOL(set_dma_curr_addr);
399
400/*------------------------------------------------------------------------------
401 * Get the DMA status of a specific DMA channel from the system.
402 *-----------------------------------------------------------------------------*/
403unsigned short get_dma_curr_irqstat(unsigned int channel)
404{
405 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
406 && channel < MAX_BLACKFIN_DMA_CHANNEL));
407
408 return dma_ch[channel].regs->irq_status;
409}
410EXPORT_SYMBOL(get_dma_curr_irqstat);
411
412/*------------------------------------------------------------------------------
413 * Clear the DMA_DONE bit in DMA status. Stop the DMA completion interrupt.
414 *-----------------------------------------------------------------------------*/
415void clear_dma_irqstat(unsigned int channel)
416{
417 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
418 && channel < MAX_BLACKFIN_DMA_CHANNEL));
419 dma_ch[channel].regs->irq_status |= 3;
420}
421EXPORT_SYMBOL(clear_dma_irqstat);
422
423/*------------------------------------------------------------------------------
424 * Get current DMA xcount of a specific DMA channel from the system.
425 *-----------------------------------------------------------------------------*/
426unsigned short get_dma_curr_xcount(unsigned int channel)
427{
428 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
429 && channel < MAX_BLACKFIN_DMA_CHANNEL));
430
431 return dma_ch[channel].regs->curr_x_count;
432}
433EXPORT_SYMBOL(get_dma_curr_xcount);
434
435/*------------------------------------------------------------------------------
436 * Get current DMA ycount of a specific DMA channel from the system.
437 *-----------------------------------------------------------------------------*/
438unsigned short get_dma_curr_ycount(unsigned int channel)
439{
440 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
441 && channel < MAX_BLACKFIN_DMA_CHANNEL));
442
443 return dma_ch[channel].regs->curr_y_count;
444}
445EXPORT_SYMBOL(get_dma_curr_ycount);
446
447unsigned long get_dma_next_desc_ptr(unsigned int channel)
448{
449 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
450 && channel < MAX_BLACKFIN_DMA_CHANNEL));
451
452 return dma_ch[channel].regs->next_desc_ptr;
453}
454EXPORT_SYMBOL(get_dma_next_desc_ptr);
455
456unsigned long get_dma_curr_desc_ptr(unsigned int channel)
457{
458 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
459 && channel < MAX_BLACKFIN_DMA_CHANNEL));
460
461 return dma_ch[channel].regs->curr_desc_ptr;
462}
463EXPORT_SYMBOL(get_dma_curr_desc_ptr);
464
465unsigned long get_dma_curr_addr(unsigned int channel)
466{
467 BUG_ON(!(dma_ch[channel].chan_status != DMA_CHANNEL_FREE
468 && channel < MAX_BLACKFIN_DMA_CHANNEL));
469
470 return dma_ch[channel].regs->curr_addr_ptr;
471}
472EXPORT_SYMBOL(get_dma_curr_addr);
473
474#ifdef CONFIG_PM 198#ifdef CONFIG_PM
199# ifndef MAX_DMA_SUSPEND_CHANNELS
200# define MAX_DMA_SUSPEND_CHANNELS MAX_DMA_CHANNELS
201# endif
475int blackfin_dma_suspend(void) 202int blackfin_dma_suspend(void)
476{ 203{
477 int i; 204 int i;
478 205
479#ifdef CONFIG_BF561 /* IMDMA channels doesn't have a PERIPHERAL_MAP */ 206 for (i = 0; i < MAX_DMA_SUSPEND_CHANNELS; ++i) {
480 for (i = 0; i <= CH_MEM_STREAM3_SRC; i++) {
481#else
482 for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++) {
483#endif
484 if (dma_ch[i].chan_status == DMA_CHANNEL_ENABLED) { 207 if (dma_ch[i].chan_status == DMA_CHANNEL_ENABLED) {
485 printk(KERN_ERR "DMA Channel %d failed to suspend\n", i); 208 printk(KERN_ERR "DMA Channel %d failed to suspend\n", i);
486 return -EBUSY; 209 return -EBUSY;
@@ -495,388 +218,201 @@ int blackfin_dma_suspend(void)
495void blackfin_dma_resume(void) 218void blackfin_dma_resume(void)
496{ 219{
497 int i; 220 int i;
498 221 for (i = 0; i < MAX_DMA_SUSPEND_CHANNELS; ++i)
499#ifdef CONFIG_BF561 /* IMDMA channels doesn't have a PERIPHERAL_MAP */
500 for (i = 0; i <= CH_MEM_STREAM3_SRC; i++)
501#else
502 for (i = 0; i < MAX_BLACKFIN_DMA_CHANNEL; i++)
503#endif
504 dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map; 222 dma_ch[i].regs->peripheral_map = dma_ch[i].saved_peripheral_map;
505} 223}
506#endif 224#endif
507 225
508static void *__dma_memcpy(void *dest, const void *src, size_t size) 226/**
227 * blackfin_dma_early_init - minimal DMA init
228 *
229 * Setup a few DMA registers so we can safely do DMA transfers early on in
230 * the kernel booting process. Really this just means using dma_memcpy().
231 */
232void __init blackfin_dma_early_init(void)
509{ 233{
510 int direction; /* 1 - address decrease, 0 - address increase */
511 int flag_align; /* 1 - address aligned, 0 - address unaligned */
512 int flag_2D; /* 1 - 2D DMA needed, 0 - 1D DMA needed */
513 unsigned long flags;
514
515 if (size <= 0)
516 return NULL;
517
518 local_irq_save(flags);
519
520 if ((unsigned long)src < memory_end)
521 blackfin_dcache_flush_range((unsigned int)src,
522 (unsigned int)(src + size));
523
524 if ((unsigned long)dest < memory_end)
525 blackfin_dcache_invalidate_range((unsigned int)dest,
526 (unsigned int)(dest + size));
527
528 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
529
530 if ((unsigned long)src < (unsigned long)dest)
531 direction = 1;
532 else
533 direction = 0;
534
535 if ((((unsigned long)dest % 2) == 0) && (((unsigned long)src % 2) == 0)
536 && ((size % 2) == 0))
537 flag_align = 1;
538 else
539 flag_align = 0;
540
541 if (size > 0x10000) /* size > 64K */
542 flag_2D = 1;
543 else
544 flag_2D = 0;
545
546 /* Setup destination and source start address */
547 if (direction) {
548 if (flag_align) {
549 bfin_write_MDMA_D0_START_ADDR(dest + size - 2);
550 bfin_write_MDMA_S0_START_ADDR(src + size - 2);
551 } else {
552 bfin_write_MDMA_D0_START_ADDR(dest + size - 1);
553 bfin_write_MDMA_S0_START_ADDR(src + size - 1);
554 }
555 } else {
556 bfin_write_MDMA_D0_START_ADDR(dest);
557 bfin_write_MDMA_S0_START_ADDR(src);
558 }
559
560 /* Setup destination and source xcount */
561 if (flag_2D) {
562 if (flag_align) {
563 bfin_write_MDMA_D0_X_COUNT(1024 / 2);
564 bfin_write_MDMA_S0_X_COUNT(1024 / 2);
565 } else {
566 bfin_write_MDMA_D0_X_COUNT(1024);
567 bfin_write_MDMA_S0_X_COUNT(1024);
568 }
569 bfin_write_MDMA_D0_Y_COUNT(size >> 10);
570 bfin_write_MDMA_S0_Y_COUNT(size >> 10);
571 } else {
572 if (flag_align) {
573 bfin_write_MDMA_D0_X_COUNT(size / 2);
574 bfin_write_MDMA_S0_X_COUNT(size / 2);
575 } else {
576 bfin_write_MDMA_D0_X_COUNT(size);
577 bfin_write_MDMA_S0_X_COUNT(size);
578 }
579 }
580
581 /* Setup destination and source xmodify and ymodify */
582 if (direction) {
583 if (flag_align) {
584 bfin_write_MDMA_D0_X_MODIFY(-2);
585 bfin_write_MDMA_S0_X_MODIFY(-2);
586 if (flag_2D) {
587 bfin_write_MDMA_D0_Y_MODIFY(-2);
588 bfin_write_MDMA_S0_Y_MODIFY(-2);
589 }
590 } else {
591 bfin_write_MDMA_D0_X_MODIFY(-1);
592 bfin_write_MDMA_S0_X_MODIFY(-1);
593 if (flag_2D) {
594 bfin_write_MDMA_D0_Y_MODIFY(-1);
595 bfin_write_MDMA_S0_Y_MODIFY(-1);
596 }
597 }
598 } else {
599 if (flag_align) {
600 bfin_write_MDMA_D0_X_MODIFY(2);
601 bfin_write_MDMA_S0_X_MODIFY(2);
602 if (flag_2D) {
603 bfin_write_MDMA_D0_Y_MODIFY(2);
604 bfin_write_MDMA_S0_Y_MODIFY(2);
605 }
606 } else {
607 bfin_write_MDMA_D0_X_MODIFY(1);
608 bfin_write_MDMA_S0_X_MODIFY(1);
609 if (flag_2D) {
610 bfin_write_MDMA_D0_Y_MODIFY(1);
611 bfin_write_MDMA_S0_Y_MODIFY(1);
612 }
613 }
614 }
615
616 /* Enable source DMA */
617 if (flag_2D) {
618 if (flag_align) {
619 bfin_write_MDMA_S0_CONFIG(DMAEN | DMA2D | WDSIZE_16);
620 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | DMA2D | WDSIZE_16);
621 } else {
622 bfin_write_MDMA_S0_CONFIG(DMAEN | DMA2D);
623 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | DMA2D);
624 }
625 } else {
626 if (flag_align) {
627 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16);
628 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16);
629 } else {
630 bfin_write_MDMA_S0_CONFIG(DMAEN);
631 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN);
632 }
633 }
634
635 SSYNC();
636
637 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE))
638 ;
639
640 bfin_write_MDMA_D0_IRQ_STATUS(bfin_read_MDMA_D0_IRQ_STATUS() |
641 (DMA_DONE | DMA_ERR));
642
643 bfin_write_MDMA_S0_CONFIG(0); 234 bfin_write_MDMA_S0_CONFIG(0);
644 bfin_write_MDMA_D0_CONFIG(0);
645
646 local_irq_restore(flags);
647
648 return dest;
649} 235}
650 236
651void *dma_memcpy(void *dest, const void *src, size_t size) 237/**
652{ 238 * __dma_memcpy - program the MDMA registers
653 size_t bulk; 239 *
654 size_t rest; 240 * Actually program MDMA0 and wait for the transfer to finish. Disable IRQs
655 void * addr; 241 * while programming registers so that everything is fully configured. Wait
656 242 * for DMA to finish with IRQs enabled. If interrupted, the initial DMA_DONE
657 bulk = (size >> 16) << 16; 243 * check will make sure we don't clobber any existing transfer.
658 rest = size - bulk; 244 */
659 if (bulk) 245static void __dma_memcpy(u32 daddr, s16 dmod, u32 saddr, s16 smod, size_t cnt, u32 conf)
660 __dma_memcpy(dest, src, bulk);
661 addr = __dma_memcpy(dest+bulk, src+bulk, rest);
662 return addr;
663}
664EXPORT_SYMBOL(dma_memcpy);
665
666void *safe_dma_memcpy(void *dest, const void *src, size_t size)
667{
668 void *addr;
669 addr = dma_memcpy(dest, src, size);
670 return addr;
671}
672EXPORT_SYMBOL(safe_dma_memcpy);
673
674void dma_outsb(unsigned long addr, const void *buf, unsigned short len)
675{ 246{
247 static DEFINE_SPINLOCK(mdma_lock);
676 unsigned long flags; 248 unsigned long flags;
677 249
678 local_irq_save(flags); 250 spin_lock_irqsave(&mdma_lock, flags);
679 251
680 blackfin_dcache_flush_range((unsigned int)buf, 252 if (bfin_read_MDMA_S0_CONFIG())
681 (unsigned int)(buf) + len); 253 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE))
254 continue;
255
256 if (conf & DMA2D) {
257 /* For larger bit sizes, we've already divided down cnt so it
258 * is no longer a multiple of 64k. So we have to break down
259 * the limit here so it is a multiple of the incoming size.
260 * There is no limitation here in terms of total size other
261 * than the hardware though as the bits lost in the shift are
262 * made up by MODIFY (== we can hit the whole address space).
263 * X: (2^(16 - 0)) * 1 == (2^(16 - 1)) * 2 == (2^(16 - 2)) * 4
264 */
265 u32 shift = abs(dmod) >> 1;
266 size_t ycnt = cnt >> (16 - shift);
267 cnt = 1 << (16 - shift);
268 bfin_write_MDMA_D0_Y_COUNT(ycnt);
269 bfin_write_MDMA_S0_Y_COUNT(ycnt);
270 bfin_write_MDMA_D0_Y_MODIFY(dmod);
271 bfin_write_MDMA_S0_Y_MODIFY(smod);
272 }
682 273
683 bfin_write_MDMA_D0_START_ADDR(addr); 274 bfin_write_MDMA_D0_START_ADDR(daddr);
684 bfin_write_MDMA_D0_X_COUNT(len); 275 bfin_write_MDMA_D0_X_COUNT(cnt);
685 bfin_write_MDMA_D0_X_MODIFY(0); 276 bfin_write_MDMA_D0_X_MODIFY(dmod);
686 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR); 277 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
687 278
688 bfin_write_MDMA_S0_START_ADDR(buf); 279 bfin_write_MDMA_S0_START_ADDR(saddr);
689 bfin_write_MDMA_S0_X_COUNT(len); 280 bfin_write_MDMA_S0_X_COUNT(cnt);
690 bfin_write_MDMA_S0_X_MODIFY(1); 281 bfin_write_MDMA_S0_X_MODIFY(smod);
691 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR); 282 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
692 283
693 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_8); 284 bfin_write_MDMA_S0_CONFIG(DMAEN | conf);
694 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_8); 285 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | conf);
286
287 spin_unlock_irqrestore(&mdma_lock, flags);
695 288
696 SSYNC(); 289 SSYNC();
697 290
698 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)); 291 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE))
292 if (bfin_read_MDMA_S0_CONFIG())
293 continue;
294 else
295 return;
699 296
700 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR); 297 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
701 298
702 bfin_write_MDMA_S0_CONFIG(0); 299 bfin_write_MDMA_S0_CONFIG(0);
703 bfin_write_MDMA_D0_CONFIG(0); 300 bfin_write_MDMA_D0_CONFIG(0);
704 local_irq_restore(flags);
705
706} 301}
707EXPORT_SYMBOL(dma_outsb);
708
709 302
710void dma_insb(unsigned long addr, void *buf, unsigned short len) 303/**
304 * _dma_memcpy - translate C memcpy settings into MDMA settings
305 *
306 * Handle all the high level steps before we touch the MDMA registers. So
307 * handle direction, tweaking of sizes, and formatting of addresses.
308 */
309static void *_dma_memcpy(void *pdst, const void *psrc, size_t size)
711{ 310{
712 unsigned long flags; 311 u32 conf, shift;
713 312 s16 mod;
714 blackfin_dcache_invalidate_range((unsigned int)buf, 313 unsigned long dst = (unsigned long)pdst;
715 (unsigned int)(buf) + len); 314 unsigned long src = (unsigned long)psrc;
716
717 local_irq_save(flags);
718 bfin_write_MDMA_D0_START_ADDR(buf);
719 bfin_write_MDMA_D0_X_COUNT(len);
720 bfin_write_MDMA_D0_X_MODIFY(1);
721 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
722
723 bfin_write_MDMA_S0_START_ADDR(addr);
724 bfin_write_MDMA_S0_X_COUNT(len);
725 bfin_write_MDMA_S0_X_MODIFY(0);
726 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
727 315
728 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_8); 316 if (size == 0)
729 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_8); 317 return NULL;
730 318
731 SSYNC(); 319 if (dst % 4 == 0 && src % 4 == 0 && size % 4 == 0) {
320 conf = WDSIZE_32;
321 shift = 2;
322 } else if (dst % 2 == 0 && src % 2 == 0 && size % 2 == 0) {
323 conf = WDSIZE_16;
324 shift = 1;
325 } else {
326 conf = WDSIZE_8;
327 shift = 0;
328 }
732 329
733 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE)); 330 /* If the two memory regions have a chance of overlapping, make
331 * sure the memcpy still works as expected. Do this by having the
332 * copy run backwards instead.
333 */
334 mod = 1 << shift;
335 if (src < dst) {
336 mod *= -1;
337 dst += size + mod;
338 src += size + mod;
339 }
340 size >>= shift;
734 341
735 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR); 342 if (size > 0x10000)
343 conf |= DMA2D;
736 344
737 bfin_write_MDMA_S0_CONFIG(0); 345 __dma_memcpy(dst, mod, src, mod, size, conf);
738 bfin_write_MDMA_D0_CONFIG(0);
739 local_irq_restore(flags);
740 346
347 return pdst;
741} 348}
742EXPORT_SYMBOL(dma_insb);
743 349
744void dma_outsw(unsigned long addr, const void *buf, unsigned short len) 350/**
351 * dma_memcpy - DMA memcpy under mutex lock
352 *
353 * Do not check arguments before starting the DMA memcpy. Break the transfer
354 * up into two pieces. The first transfer is in multiples of 64k and the
355 * second transfer is the piece smaller than 64k.
356 */
357void *dma_memcpy(void *pdst, const void *psrc, size_t size)
745{ 358{
746 unsigned long flags; 359 unsigned long dst = (unsigned long)pdst;
747 360 unsigned long src = (unsigned long)psrc;
748 local_irq_save(flags); 361 size_t bulk, rest;
749 362
750 blackfin_dcache_flush_range((unsigned int)buf, 363 if (bfin_addr_dcachable(src))
751 (unsigned int)(buf) + len * sizeof(short)); 364 blackfin_dcache_flush_range(src, src + size);
752 365
753 bfin_write_MDMA_D0_START_ADDR(addr); 366 if (bfin_addr_dcachable(dst))
754 bfin_write_MDMA_D0_X_COUNT(len); 367 blackfin_dcache_invalidate_range(dst, dst + size);
755 bfin_write_MDMA_D0_X_MODIFY(0);
756 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
757
758 bfin_write_MDMA_S0_START_ADDR(buf);
759 bfin_write_MDMA_S0_X_COUNT(len);
760 bfin_write_MDMA_S0_X_MODIFY(2);
761 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
762
763 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16);
764 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16);
765
766 SSYNC();
767
768 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
769
770 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
771
772 bfin_write_MDMA_S0_CONFIG(0);
773 bfin_write_MDMA_D0_CONFIG(0);
774 local_irq_restore(flags);
775 368
369 bulk = size & ~0xffff;
370 rest = size - bulk;
371 if (bulk)
372 _dma_memcpy(pdst, psrc, bulk);
373 _dma_memcpy(pdst + bulk, psrc + bulk, rest);
374 return pdst;
776} 375}
777EXPORT_SYMBOL(dma_outsw); 376EXPORT_SYMBOL(dma_memcpy);
778 377
779void dma_insw(unsigned long addr, void *buf, unsigned short len) 378/**
379 * safe_dma_memcpy - DMA memcpy w/argument checking
380 *
381 * Verify arguments are safe before heading to dma_memcpy().
382 */
383void *safe_dma_memcpy(void *dst, const void *src, size_t size)
780{ 384{
781 unsigned long flags; 385 if (!access_ok(VERIFY_WRITE, dst, size))
782 386 return NULL;
783 blackfin_dcache_invalidate_range((unsigned int)buf, 387 if (!access_ok(VERIFY_READ, src, size))
784 (unsigned int)(buf) + len * sizeof(short)); 388 return NULL;
785 389 return dma_memcpy(dst, src, size);
786 local_irq_save(flags);
787
788 bfin_write_MDMA_D0_START_ADDR(buf);
789 bfin_write_MDMA_D0_X_COUNT(len);
790 bfin_write_MDMA_D0_X_MODIFY(2);
791 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
792
793 bfin_write_MDMA_S0_START_ADDR(addr);
794 bfin_write_MDMA_S0_X_COUNT(len);
795 bfin_write_MDMA_S0_X_MODIFY(0);
796 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
797
798 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_16);
799 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_16);
800
801 SSYNC();
802
803 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
804
805 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
806
807 bfin_write_MDMA_S0_CONFIG(0);
808 bfin_write_MDMA_D0_CONFIG(0);
809 local_irq_restore(flags);
810
811} 390}
812EXPORT_SYMBOL(dma_insw); 391EXPORT_SYMBOL(safe_dma_memcpy);
813 392
814void dma_outsl(unsigned long addr, const void *buf, unsigned short len) 393static void _dma_out(unsigned long addr, unsigned long buf, unsigned short len,
394 u16 size, u16 dma_size)
815{ 395{
816 unsigned long flags; 396 blackfin_dcache_flush_range(buf, buf + len * size);
817 397 __dma_memcpy(addr, 0, buf, size, len, dma_size);
818 local_irq_save(flags);
819
820 blackfin_dcache_flush_range((unsigned int)buf,
821 (unsigned int)(buf) + len * sizeof(long));
822
823 bfin_write_MDMA_D0_START_ADDR(addr);
824 bfin_write_MDMA_D0_X_COUNT(len);
825 bfin_write_MDMA_D0_X_MODIFY(0);
826 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
827
828 bfin_write_MDMA_S0_START_ADDR(buf);
829 bfin_write_MDMA_S0_X_COUNT(len);
830 bfin_write_MDMA_S0_X_MODIFY(4);
831 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
832
833 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_32);
834 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_32);
835
836 SSYNC();
837
838 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
839
840 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
841
842 bfin_write_MDMA_S0_CONFIG(0);
843 bfin_write_MDMA_D0_CONFIG(0);
844 local_irq_restore(flags);
845
846} 398}
847EXPORT_SYMBOL(dma_outsl);
848 399
849void dma_insl(unsigned long addr, void *buf, unsigned short len) 400static void _dma_in(unsigned long addr, unsigned long buf, unsigned short len,
401 u16 size, u16 dma_size)
850{ 402{
851 unsigned long flags; 403 blackfin_dcache_invalidate_range(buf, buf + len * size);
852 404 __dma_memcpy(buf, size, addr, 0, len, dma_size);
853 blackfin_dcache_invalidate_range((unsigned int)buf,
854 (unsigned int)(buf) + len * sizeof(long));
855
856 local_irq_save(flags);
857
858 bfin_write_MDMA_D0_START_ADDR(buf);
859 bfin_write_MDMA_D0_X_COUNT(len);
860 bfin_write_MDMA_D0_X_MODIFY(4);
861 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
862
863 bfin_write_MDMA_S0_START_ADDR(addr);
864 bfin_write_MDMA_S0_X_COUNT(len);
865 bfin_write_MDMA_S0_X_MODIFY(0);
866 bfin_write_MDMA_S0_IRQ_STATUS(DMA_DONE | DMA_ERR);
867
868 bfin_write_MDMA_S0_CONFIG(DMAEN | WDSIZE_32);
869 bfin_write_MDMA_D0_CONFIG(WNR | DI_EN | DMAEN | WDSIZE_32);
870
871 SSYNC();
872
873 while (!(bfin_read_MDMA_D0_IRQ_STATUS() & DMA_DONE));
874
875 bfin_write_MDMA_D0_IRQ_STATUS(DMA_DONE | DMA_ERR);
876
877 bfin_write_MDMA_S0_CONFIG(0);
878 bfin_write_MDMA_D0_CONFIG(0);
879 local_irq_restore(flags);
880
881} 405}
882EXPORT_SYMBOL(dma_insl); 406
407#define MAKE_DMA_IO(io, bwl, isize, dmasize, cnst) \
408void dma_##io##s##bwl(unsigned long addr, cnst void *buf, unsigned short len) \
409{ \
410 _dma_##io(addr, (unsigned long)buf, len, isize, WDSIZE_##dmasize); \
411} \
412EXPORT_SYMBOL(dma_##io##s##bwl)
413MAKE_DMA_IO(out, b, 1, 8, const);
414MAKE_DMA_IO(in, b, 1, 8, );
415MAKE_DMA_IO(out, w, 2, 16, const);
416MAKE_DMA_IO(in, w, 2, 16, );
417MAKE_DMA_IO(out, l, 4, 32, const);
418MAKE_DMA_IO(in, l, 4, 32, );
diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c
index 5c0800adb4dd..4c14331978f6 100644
--- a/arch/blackfin/kernel/bfin_gpio.c
+++ b/arch/blackfin/kernel/bfin_gpio.c
@@ -119,28 +119,28 @@ enum {
119#define AWA_DUMMY_READ(...) do { } while (0) 119#define AWA_DUMMY_READ(...) do { } while (0)
120#endif 120#endif
121 121
122#ifdef BF533_FAMILY 122#if defined(BF533_FAMILY) || defined(BF538_FAMILY)
123static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = { 123static struct gpio_port_t *gpio_bankb[] = {
124 (struct gpio_port_t *) FIO_FLAG_D, 124 (struct gpio_port_t *) FIO_FLAG_D,
125}; 125};
126#endif 126#endif
127 127
128#if defined(BF527_FAMILY) || defined(BF537_FAMILY) 128#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
129static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = { 129static struct gpio_port_t *gpio_bankb[] = {
130 (struct gpio_port_t *) PORTFIO, 130 (struct gpio_port_t *) PORTFIO,
131 (struct gpio_port_t *) PORTGIO, 131 (struct gpio_port_t *) PORTGIO,
132 (struct gpio_port_t *) PORTHIO, 132 (struct gpio_port_t *) PORTHIO,
133}; 133};
134 134
135static unsigned short *port_fer[gpio_bank(MAX_BLACKFIN_GPIOS)] = { 135static unsigned short *port_fer[] = {
136 (unsigned short *) PORTF_FER, 136 (unsigned short *) PORTF_FER,
137 (unsigned short *) PORTG_FER, 137 (unsigned short *) PORTG_FER,
138 (unsigned short *) PORTH_FER, 138 (unsigned short *) PORTH_FER,
139}; 139};
140#endif 140#endif
141 141
142#ifdef BF527_FAMILY 142#if defined(BF527_FAMILY) || defined(BF518_FAMILY)
143static unsigned short *port_mux[gpio_bank(MAX_BLACKFIN_GPIOS)] = { 143static unsigned short *port_mux[] = {
144 (unsigned short *) PORTF_MUX, 144 (unsigned short *) PORTF_MUX,
145 (unsigned short *) PORTG_MUX, 145 (unsigned short *) PORTG_MUX,
146 (unsigned short *) PORTH_MUX, 146 (unsigned short *) PORTH_MUX,
@@ -155,7 +155,7 @@ u8 pmux_offset[][16] =
155#endif 155#endif
156 156
157#ifdef BF561_FAMILY 157#ifdef BF561_FAMILY
158static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = { 158static struct gpio_port_t *gpio_bankb[] = {
159 (struct gpio_port_t *) FIO0_FLAG_D, 159 (struct gpio_port_t *) FIO0_FLAG_D,
160 (struct gpio_port_t *) FIO1_FLAG_D, 160 (struct gpio_port_t *) FIO1_FLAG_D,
161 (struct gpio_port_t *) FIO2_FLAG_D, 161 (struct gpio_port_t *) FIO2_FLAG_D,
@@ -163,7 +163,7 @@ static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
163#endif 163#endif
164 164
165#ifdef BF548_FAMILY 165#ifdef BF548_FAMILY
166static struct gpio_port_t *gpio_array[gpio_bank(MAX_BLACKFIN_GPIOS)] = { 166static struct gpio_port_t *gpio_array[] = {
167 (struct gpio_port_t *)PORTA_FER, 167 (struct gpio_port_t *)PORTA_FER,
168 (struct gpio_port_t *)PORTB_FER, 168 (struct gpio_port_t *)PORTB_FER,
169 (struct gpio_port_t *)PORTC_FER, 169 (struct gpio_port_t *)PORTC_FER,
@@ -177,8 +177,9 @@ static struct gpio_port_t *gpio_array[gpio_bank(MAX_BLACKFIN_GPIOS)] = {
177}; 177};
178#endif 178#endif
179 179
180static unsigned short reserved_gpio_map[gpio_bank(MAX_BLACKFIN_GPIOS)]; 180static unsigned short reserved_gpio_map[GPIO_BANK_NUM];
181static unsigned short reserved_peri_map[gpio_bank(MAX_RESOURCES)]; 181static unsigned short reserved_peri_map[gpio_bank(MAX_RESOURCES)];
182static unsigned short reserved_gpio_irq_map[GPIO_BANK_NUM];
182 183
183#define RESOURCE_LABEL_SIZE 16 184#define RESOURCE_LABEL_SIZE 16
184 185
@@ -188,48 +189,46 @@ static struct str_ident {
188 189
189#if defined(CONFIG_PM) 190#if defined(CONFIG_PM)
190#if defined(CONFIG_BF54x) 191#if defined(CONFIG_BF54x)
191static struct gpio_port_s gpio_bank_saved[gpio_bank(MAX_BLACKFIN_GPIOS)]; 192static struct gpio_port_s gpio_bank_saved[GPIO_BANK_NUM];
192#else 193#else
193static unsigned short wakeup_map[gpio_bank(MAX_BLACKFIN_GPIOS)]; 194static unsigned short wakeup_map[GPIO_BANK_NUM];
194static unsigned char wakeup_flags_map[MAX_BLACKFIN_GPIOS]; 195static unsigned char wakeup_flags_map[MAX_BLACKFIN_GPIOS];
195static struct gpio_port_s gpio_bank_saved[gpio_bank(MAX_BLACKFIN_GPIOS)]; 196static struct gpio_port_s gpio_bank_saved[GPIO_BANK_NUM];
196 197
197#ifdef BF533_FAMILY 198#ifdef BF533_FAMILY
198static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG_INTB}; 199static unsigned int sic_iwr_irqs[] = {IRQ_PROG_INTB};
199#endif 200#endif
200 201
201#ifdef BF537_FAMILY 202#ifdef BF537_FAMILY
202static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX}; 203static unsigned int sic_iwr_irqs[] = {IRQ_PROG_INTB, IRQ_PORTG_INTB, IRQ_MAC_TX};
204#endif
205
206#ifdef BF538_FAMILY
207static unsigned int sic_iwr_irqs[] = {IRQ_PORTF_INTB};
203#endif 208#endif
204 209
205#ifdef BF527_FAMILY 210#if defined(BF527_FAMILY) || defined(BF518_FAMILY)
206static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PORTF_INTB, IRQ_PORTG_INTB, IRQ_PORTH_INTB}; 211static unsigned int sic_iwr_irqs[] = {IRQ_PORTF_INTB, IRQ_PORTG_INTB, IRQ_PORTH_INTB};
207#endif 212#endif
208 213
209#ifdef BF561_FAMILY 214#ifdef BF561_FAMILY
210static unsigned int sic_iwr_irqs[gpio_bank(MAX_BLACKFIN_GPIOS)] = {IRQ_PROG0_INTB, IRQ_PROG1_INTB, IRQ_PROG2_INTB}; 215static unsigned int sic_iwr_irqs[] = {IRQ_PROG0_INTB, IRQ_PROG1_INTB, IRQ_PROG2_INTB};
211#endif 216#endif
212#endif 217#endif
213#endif /* CONFIG_PM */ 218#endif /* CONFIG_PM */
214 219
215#if defined(BF548_FAMILY)
216inline int check_gpio(unsigned gpio) 220inline int check_gpio(unsigned gpio)
217{ 221{
222#if defined(BF548_FAMILY)
218 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15 223 if (gpio == GPIO_PB15 || gpio == GPIO_PC14 || gpio == GPIO_PC15
219 || gpio == GPIO_PH14 || gpio == GPIO_PH15 224 || gpio == GPIO_PH14 || gpio == GPIO_PH15
220 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15 225 || gpio == GPIO_PJ14 || gpio == GPIO_PJ15)
221 || gpio >= MAX_BLACKFIN_GPIOS)
222 return -EINVAL; 226 return -EINVAL;
223 return 0; 227#endif
224}
225#else
226inline int check_gpio(unsigned gpio)
227{
228 if (gpio >= MAX_BLACKFIN_GPIOS) 228 if (gpio >= MAX_BLACKFIN_GPIOS)
229 return -EINVAL; 229 return -EINVAL;
230 return 0; 230 return 0;
231} 231}
232#endif
233 232
234static void gpio_error(unsigned gpio) 233static void gpio_error(unsigned gpio)
235{ 234{
@@ -258,35 +257,30 @@ static int cmp_label(unsigned short ident, const char *label)
258 } 257 }
259 258
260 if (label) 259 if (label)
261 return strncmp(str_ident[ident].name, 260 return strcmp(str_ident[ident].name, label);
262 label, strlen(label));
263 else 261 else
264 return -EINVAL; 262 return -EINVAL;
265} 263}
266 264
267#if defined(BF527_FAMILY) || defined(BF537_FAMILY)
268static void port_setup(unsigned gpio, unsigned short usage) 265static void port_setup(unsigned gpio, unsigned short usage)
269{ 266{
270 if (!check_gpio(gpio)) { 267 if (check_gpio(gpio))
271 if (usage == GPIO_USAGE) 268 return;
272 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); 269
273 else 270#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
274 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); 271 if (usage == GPIO_USAGE)
275 SSYNC(); 272 *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio);
276 } 273 else
277} 274 *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio);
275 SSYNC();
278#elif defined(BF548_FAMILY) 276#elif defined(BF548_FAMILY)
279static void port_setup(unsigned gpio, unsigned short usage)
280{
281 if (usage == GPIO_USAGE) 277 if (usage == GPIO_USAGE)
282 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio); 278 gpio_array[gpio_bank(gpio)]->port_fer &= ~gpio_bit(gpio);
283 else 279 else
284 gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio); 280 gpio_array[gpio_bank(gpio)]->port_fer |= gpio_bit(gpio);
285 SSYNC(); 281 SSYNC();
286}
287#else
288# define port_setup(...) do { } while (0)
289#endif 282#endif
283}
290 284
291#ifdef BF537_FAMILY 285#ifdef BF537_FAMILY
292static struct { 286static struct {
@@ -379,7 +373,7 @@ inline u16 get_portmux(unsigned short portno)
379 373
380 return (pmux >> (2 * gpio_sub_n(portno)) & 0x3); 374 return (pmux >> (2 * gpio_sub_n(portno)) & 0x3);
381} 375}
382#elif defined(BF527_FAMILY) 376#elif defined(BF527_FAMILY) || defined(BF518_FAMILY)
383inline void portmux_setup(unsigned short portno, unsigned short function) 377inline void portmux_setup(unsigned short portno, unsigned short function)
384{ 378{
385 u16 pmux, ident = P_IDENT(portno); 379 u16 pmux, ident = P_IDENT(portno);
@@ -428,13 +422,13 @@ arch_initcall(bfin_gpio_init);
428void set_gpio_ ## name(unsigned gpio, unsigned short arg) \ 422void set_gpio_ ## name(unsigned gpio, unsigned short arg) \
429{ \ 423{ \
430 unsigned long flags; \ 424 unsigned long flags; \
431 local_irq_save(flags); \ 425 local_irq_save_hw(flags); \
432 if (arg) \ 426 if (arg) \
433 gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \ 427 gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \
434 else \ 428 else \
435 gpio_bankb[gpio_bank(gpio)]->name &= ~gpio_bit(gpio); \ 429 gpio_bankb[gpio_bank(gpio)]->name &= ~gpio_bit(gpio); \
436 AWA_DUMMY_READ(name); \ 430 AWA_DUMMY_READ(name); \
437 local_irq_restore(flags); \ 431 local_irq_restore_hw(flags); \
438} \ 432} \
439EXPORT_SYMBOL(set_gpio_ ## name); 433EXPORT_SYMBOL(set_gpio_ ## name);
440 434
@@ -450,13 +444,13 @@ SET_GPIO(both)
450void set_gpio_ ## name(unsigned gpio, unsigned short arg) \ 444void set_gpio_ ## name(unsigned gpio, unsigned short arg) \
451{ \ 445{ \
452 unsigned long flags; \ 446 unsigned long flags; \
453 local_irq_save(flags); \ 447 local_irq_save_hw(flags); \
454 if (arg) \ 448 if (arg) \
455 gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \ 449 gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \
456 else \ 450 else \
457 gpio_bankb[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \ 451 gpio_bankb[gpio_bank(gpio)]->name ## _clear = gpio_bit(gpio); \
458 AWA_DUMMY_READ(name); \ 452 AWA_DUMMY_READ(name); \
459 local_irq_restore(flags); \ 453 local_irq_restore_hw(flags); \
460} \ 454} \
461EXPORT_SYMBOL(set_gpio_ ## name); 455EXPORT_SYMBOL(set_gpio_ ## name);
462#else 456#else
@@ -479,10 +473,10 @@ SET_GPIO_SC(data)
479void set_gpio_toggle(unsigned gpio) 473void set_gpio_toggle(unsigned gpio)
480{ 474{
481 unsigned long flags; 475 unsigned long flags;
482 local_irq_save(flags); 476 local_irq_save_hw(flags);
483 gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); 477 gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio);
484 AWA_DUMMY_READ(toggle); 478 AWA_DUMMY_READ(toggle);
485 local_irq_restore(flags); 479 local_irq_restore_hw(flags);
486} 480}
487#else 481#else
488void set_gpio_toggle(unsigned gpio) 482void set_gpio_toggle(unsigned gpio)
@@ -500,10 +494,10 @@ EXPORT_SYMBOL(set_gpio_toggle);
500void set_gpiop_ ## name(unsigned gpio, unsigned short arg) \ 494void set_gpiop_ ## name(unsigned gpio, unsigned short arg) \
501{ \ 495{ \
502 unsigned long flags; \ 496 unsigned long flags; \
503 local_irq_save(flags); \ 497 local_irq_save_hw(flags); \
504 gpio_bankb[gpio_bank(gpio)]->name = arg; \ 498 gpio_bankb[gpio_bank(gpio)]->name = arg; \
505 AWA_DUMMY_READ(name); \ 499 AWA_DUMMY_READ(name); \
506 local_irq_restore(flags); \ 500 local_irq_restore_hw(flags); \
507} \ 501} \
508EXPORT_SYMBOL(set_gpiop_ ## name); 502EXPORT_SYMBOL(set_gpiop_ ## name);
509#else 503#else
@@ -531,10 +525,10 @@ unsigned short get_gpio_ ## name(unsigned gpio) \
531{ \ 525{ \
532 unsigned long flags; \ 526 unsigned long flags; \
533 unsigned short ret; \ 527 unsigned short ret; \
534 local_irq_save(flags); \ 528 local_irq_save_hw(flags); \
535 ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio)); \ 529 ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->name >> gpio_sub_n(gpio)); \
536 AWA_DUMMY_READ(name); \ 530 AWA_DUMMY_READ(name); \
537 local_irq_restore(flags); \ 531 local_irq_restore_hw(flags); \
538 return ret; \ 532 return ret; \
539} \ 533} \
540EXPORT_SYMBOL(get_gpio_ ## name); 534EXPORT_SYMBOL(get_gpio_ ## name);
@@ -564,10 +558,10 @@ unsigned short get_gpiop_ ## name(unsigned gpio) \
564{ \ 558{ \
565 unsigned long flags; \ 559 unsigned long flags; \
566 unsigned short ret; \ 560 unsigned short ret; \
567 local_irq_save(flags); \ 561 local_irq_save_hw(flags); \
568 ret = (gpio_bankb[gpio_bank(gpio)]->name); \ 562 ret = (gpio_bankb[gpio_bank(gpio)]->name); \
569 AWA_DUMMY_READ(name); \ 563 AWA_DUMMY_READ(name); \
570 local_irq_restore(flags); \ 564 local_irq_restore_hw(flags); \
571 return ret; \ 565 return ret; \
572} \ 566} \
573EXPORT_SYMBOL(get_gpiop_ ## name); 567EXPORT_SYMBOL(get_gpiop_ ## name);
@@ -617,10 +611,10 @@ int gpio_pm_wakeup_request(unsigned gpio, unsigned char type)
617 if ((check_gpio(gpio) < 0) || !type) 611 if ((check_gpio(gpio) < 0) || !type)
618 return -EINVAL; 612 return -EINVAL;
619 613
620 local_irq_save(flags); 614 local_irq_save_hw(flags);
621 wakeup_map[gpio_bank(gpio)] |= gpio_bit(gpio); 615 wakeup_map[gpio_bank(gpio)] |= gpio_bit(gpio);
622 wakeup_flags_map[gpio] = type; 616 wakeup_flags_map[gpio] = type;
623 local_irq_restore(flags); 617 local_irq_restore_hw(flags);
624 618
625 return 0; 619 return 0;
626} 620}
@@ -633,11 +627,11 @@ void gpio_pm_wakeup_free(unsigned gpio)
633 if (check_gpio(gpio) < 0) 627 if (check_gpio(gpio) < 0)
634 return; 628 return;
635 629
636 local_irq_save(flags); 630 local_irq_save_hw(flags);
637 631
638 wakeup_map[gpio_bank(gpio)] &= ~gpio_bit(gpio); 632 wakeup_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
639 633
640 local_irq_restore(flags); 634 local_irq_restore_hw(flags);
641} 635}
642EXPORT_SYMBOL(gpio_pm_wakeup_free); 636EXPORT_SYMBOL(gpio_pm_wakeup_free);
643 637
@@ -679,7 +673,7 @@ u32 bfin_pm_standby_setup(void)
679 gpio_bankb[bank]->maskb = 0; 673 gpio_bankb[bank]->maskb = 0;
680 674
681 if (mask) { 675 if (mask) {
682#if defined(BF527_FAMILY) || defined(BF537_FAMILY) 676#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
683 gpio_bank_saved[bank].fer = *port_fer[bank]; 677 gpio_bank_saved[bank].fer = *port_fer[bank];
684#endif 678#endif
685 gpio_bank_saved[bank].inen = gpio_bankb[bank]->inen; 679 gpio_bank_saved[bank].inen = gpio_bankb[bank]->inen;
@@ -724,7 +718,7 @@ void bfin_pm_standby_restore(void)
724 bank = gpio_bank(i); 718 bank = gpio_bank(i);
725 719
726 if (mask) { 720 if (mask) {
727#if defined(BF527_FAMILY) || defined(BF537_FAMILY) 721#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
728 *port_fer[bank] = gpio_bank_saved[bank].fer; 722 *port_fer[bank] = gpio_bank_saved[bank].fer;
729#endif 723#endif
730 gpio_bankb[bank]->inen = gpio_bank_saved[bank].inen; 724 gpio_bankb[bank]->inen = gpio_bank_saved[bank].inen;
@@ -750,9 +744,9 @@ void bfin_gpio_pm_hibernate_suspend(void)
750 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { 744 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
751 bank = gpio_bank(i); 745 bank = gpio_bank(i);
752 746
753#if defined(BF527_FAMILY) || defined(BF537_FAMILY) 747#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
754 gpio_bank_saved[bank].fer = *port_fer[bank]; 748 gpio_bank_saved[bank].fer = *port_fer[bank];
755#ifdef BF527_FAMILY 749#if defined(BF527_FAMILY) || defined(BF518_FAMILY)
756 gpio_bank_saved[bank].mux = *port_mux[bank]; 750 gpio_bank_saved[bank].mux = *port_mux[bank];
757#else 751#else
758 if (bank == 0) 752 if (bank == 0)
@@ -778,8 +772,8 @@ void bfin_gpio_pm_hibernate_restore(void)
778 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { 772 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
779 bank = gpio_bank(i); 773 bank = gpio_bank(i);
780 774
781#if defined(BF527_FAMILY) || defined(BF537_FAMILY) 775#if defined(BF527_FAMILY) || defined(BF537_FAMILY) || defined(BF518_FAMILY)
782#ifdef BF527_FAMILY 776#if defined(BF527_FAMILY) || defined(BF518_FAMILY)
783 *port_mux[bank] = gpio_bank_saved[bank].mux; 777 *port_mux[bank] = gpio_bank_saved[bank].mux;
784#else 778#else
785 if (bank == 0) 779 if (bank == 0)
@@ -873,7 +867,6 @@ EXPORT_SYMBOL(get_gpio_dir);
873* MODIFICATION HISTORY : 867* MODIFICATION HISTORY :
874**************************************************************/ 868**************************************************************/
875 869
876#ifdef BF548_FAMILY
877int peripheral_request(unsigned short per, const char *label) 870int peripheral_request(unsigned short per, const char *label)
878{ 871{
879 unsigned long flags; 872 unsigned long flags;
@@ -889,31 +882,35 @@ int peripheral_request(unsigned short per, const char *label)
889 if (!(per & P_DEFINED)) 882 if (!(per & P_DEFINED))
890 return -ENODEV; 883 return -ENODEV;
891 884
892 if (check_gpio(ident) < 0) 885 local_irq_save_hw(flags);
893 return -EINVAL;
894 886
895 local_irq_save(flags); 887 /* If a pin can be muxed as either GPIO or peripheral, make
896 888 * sure it is not already a GPIO pin when we request it.
897 if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) { 889 */
890 if (unlikely(!check_gpio(ident) &&
891 reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
898 dump_stack(); 892 dump_stack();
899 printk(KERN_ERR 893 printk(KERN_ERR
900 "%s: Peripheral %d is already reserved as GPIO by %s !\n", 894 "%s: Peripheral %d is already reserved as GPIO by %s !\n",
901 __func__, ident, get_label(ident)); 895 __func__, ident, get_label(ident));
902 local_irq_restore(flags); 896 local_irq_restore_hw(flags);
903 return -EBUSY; 897 return -EBUSY;
904 } 898 }
905 899
906 if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) { 900 if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) {
907 901
908 u16 funct = get_portmux(ident);
909
910 /* 902 /*
911 * Pin functions like AMC address strobes my 903 * Pin functions like AMC address strobes my
912 * be requested and used by several drivers 904 * be requested and used by several drivers
913 */ 905 */
914 906
915 if (!((per & P_MAYSHARE) && (funct == P_FUNCT2MUX(per)))) { 907#ifdef BF548_FAMILY
908 u16 funct = get_portmux(ident);
916 909
910 if (!((per & P_MAYSHARE) && (funct == P_FUNCT2MUX(per)))) {
911#else
912 if (!(per & P_MAYSHARE)) {
913#endif
917 /* 914 /*
918 * Allow that the identical pin function can 915 * Allow that the identical pin function can
919 * be requested from the same driver twice 916 * be requested from the same driver twice
@@ -926,7 +923,7 @@ int peripheral_request(unsigned short per, const char *label)
926 printk(KERN_ERR 923 printk(KERN_ERR
927 "%s: Peripheral %d function %d is already reserved by %s !\n", 924 "%s: Peripheral %d function %d is already reserved by %s !\n",
928 __func__, ident, P_FUNCT2MUX(per), get_label(ident)); 925 __func__, ident, P_FUNCT2MUX(per), get_label(ident));
929 local_irq_restore(flags); 926 local_irq_restore_hw(flags);
930 return -EBUSY; 927 return -EBUSY;
931 } 928 }
932 } 929 }
@@ -934,89 +931,19 @@ int peripheral_request(unsigned short per, const char *label)
934 anyway: 931 anyway:
935 reserved_peri_map[gpio_bank(ident)] |= gpio_bit(ident); 932 reserved_peri_map[gpio_bank(ident)] |= gpio_bit(ident);
936 933
934#ifdef BF548_FAMILY
937 portmux_setup(ident, P_FUNCT2MUX(per)); 935 portmux_setup(ident, P_FUNCT2MUX(per));
938 port_setup(ident, PERIPHERAL_USAGE);
939
940 local_irq_restore(flags);
941 set_label(ident, label);
942
943 return 0;
944}
945EXPORT_SYMBOL(peripheral_request);
946#else 936#else
947
948int peripheral_request(unsigned short per, const char *label)
949{
950 unsigned long flags;
951 unsigned short ident = P_IDENT(per);
952
953 /*
954 * Don't cares are pins with only one dedicated function
955 */
956
957 if (per & P_DONTCARE)
958 return 0;
959
960 if (!(per & P_DEFINED))
961 return -ENODEV;
962
963 local_irq_save(flags);
964
965 if (!check_gpio(ident)) {
966
967 if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) {
968 dump_stack();
969 printk(KERN_ERR
970 "%s: Peripheral %d is already reserved as GPIO by %s !\n",
971 __func__, ident, get_label(ident));
972 local_irq_restore(flags);
973 return -EBUSY;
974 }
975
976 }
977
978 if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) {
979
980 /*
981 * Pin functions like AMC address strobes my
982 * be requested and used by several drivers
983 */
984
985 if (!(per & P_MAYSHARE)) {
986
987 /*
988 * Allow that the identical pin function can
989 * be requested from the same driver twice
990 */
991
992 if (cmp_label(ident, label) == 0)
993 goto anyway;
994
995 dump_stack();
996 printk(KERN_ERR
997 "%s: Peripheral %d function %d is already"
998 " reserved by %s !\n",
999 __func__, ident, P_FUNCT2MUX(per),
1000 get_label(ident));
1001 local_irq_restore(flags);
1002 return -EBUSY;
1003 }
1004
1005 }
1006
1007 anyway:
1008 portmux_setup(per, P_FUNCT2MUX(per)); 937 portmux_setup(per, P_FUNCT2MUX(per));
1009 938#endif
1010 port_setup(ident, PERIPHERAL_USAGE); 939 port_setup(ident, PERIPHERAL_USAGE);
1011 940
1012 reserved_peri_map[gpio_bank(ident)] |= gpio_bit(ident); 941 local_irq_restore_hw(flags);
1013 local_irq_restore(flags);
1014 set_label(ident, label); 942 set_label(ident, label);
1015 943
1016 return 0; 944 return 0;
1017} 945}
1018EXPORT_SYMBOL(peripheral_request); 946EXPORT_SYMBOL(peripheral_request);
1019#endif
1020 947
1021int peripheral_request_list(const unsigned short per[], const char *label) 948int peripheral_request_list(const unsigned short per[], const char *label)
1022{ 949{
@@ -1053,10 +980,10 @@ void peripheral_free(unsigned short per)
1053 if (check_gpio(ident) < 0) 980 if (check_gpio(ident) < 0)
1054 return; 981 return;
1055 982
1056 local_irq_save(flags); 983 local_irq_save_hw(flags);
1057 984
1058 if (unlikely(!(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident)))) { 985 if (unlikely(!(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident)))) {
1059 local_irq_restore(flags); 986 local_irq_restore_hw(flags);
1060 return; 987 return;
1061 } 988 }
1062 989
@@ -1067,7 +994,7 @@ void peripheral_free(unsigned short per)
1067 994
1068 set_label(ident, "free"); 995 set_label(ident, "free");
1069 996
1070 local_irq_restore(flags); 997 local_irq_restore_hw(flags);
1071} 998}
1072EXPORT_SYMBOL(peripheral_free); 999EXPORT_SYMBOL(peripheral_free);
1073 1000
@@ -1094,14 +1021,14 @@ EXPORT_SYMBOL(peripheral_free_list);
1094* MODIFICATION HISTORY : 1021* MODIFICATION HISTORY :
1095**************************************************************/ 1022**************************************************************/
1096 1023
1097int gpio_request(unsigned gpio, const char *label) 1024int bfin_gpio_request(unsigned gpio, const char *label)
1098{ 1025{
1099 unsigned long flags; 1026 unsigned long flags;
1100 1027
1101 if (check_gpio(gpio) < 0) 1028 if (check_gpio(gpio) < 0)
1102 return -EINVAL; 1029 return -EINVAL;
1103 1030
1104 local_irq_save(flags); 1031 local_irq_save_hw(flags);
1105 1032
1106 /* 1033 /*
1107 * Allow that the identical GPIO can 1034 * Allow that the identical GPIO can
@@ -1110,15 +1037,15 @@ int gpio_request(unsigned gpio, const char *label)
1110 */ 1037 */
1111 1038
1112 if (cmp_label(gpio, label) == 0) { 1039 if (cmp_label(gpio, label) == 0) {
1113 local_irq_restore(flags); 1040 local_irq_restore_hw(flags);
1114 return 0; 1041 return 0;
1115 } 1042 }
1116 1043
1117 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) { 1044 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
1118 dump_stack(); 1045 dump_stack();
1119 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n", 1046 printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved by %s !\n",
1120 gpio, get_label(gpio)); 1047 gpio, get_label(gpio));
1121 local_irq_restore(flags); 1048 local_irq_restore_hw(flags);
1122 return -EBUSY; 1049 return -EBUSY;
1123 } 1050 }
1124 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) { 1051 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
@@ -1126,34 +1053,37 @@ int gpio_request(unsigned gpio, const char *label)
1126 printk(KERN_ERR 1053 printk(KERN_ERR
1127 "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n", 1054 "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n",
1128 gpio, get_label(gpio)); 1055 gpio, get_label(gpio));
1129 local_irq_restore(flags); 1056 local_irq_restore_hw(flags);
1130 return -EBUSY; 1057 return -EBUSY;
1131 } 1058 }
1059 if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio)))
1060 printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved as gpio-irq!"
1061 " (Documentation/blackfin/bfin-gpio-notes.txt)\n", gpio);
1132 1062
1133 reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio); 1063 reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio);
1064 set_label(gpio, label);
1134 1065
1135 local_irq_restore(flags); 1066 local_irq_restore_hw(flags);
1136 1067
1137 port_setup(gpio, GPIO_USAGE); 1068 port_setup(gpio, GPIO_USAGE);
1138 set_label(gpio, label);
1139 1069
1140 return 0; 1070 return 0;
1141} 1071}
1142EXPORT_SYMBOL(gpio_request); 1072EXPORT_SYMBOL(bfin_gpio_request);
1143 1073
1144void gpio_free(unsigned gpio) 1074void bfin_gpio_free(unsigned gpio)
1145{ 1075{
1146 unsigned long flags; 1076 unsigned long flags;
1147 1077
1148 if (check_gpio(gpio) < 0) 1078 if (check_gpio(gpio) < 0)
1149 return; 1079 return;
1150 1080
1151 local_irq_save(flags); 1081 local_irq_save_hw(flags);
1152 1082
1153 if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { 1083 if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) {
1154 dump_stack(); 1084 dump_stack();
1155 gpio_error(gpio); 1085 gpio_error(gpio);
1156 local_irq_restore(flags); 1086 local_irq_restore_hw(flags);
1157 return; 1087 return;
1158 } 1088 }
1159 1089
@@ -1161,13 +1091,76 @@ void gpio_free(unsigned gpio)
1161 1091
1162 set_label(gpio, "free"); 1092 set_label(gpio, "free");
1163 1093
1164 local_irq_restore(flags); 1094 local_irq_restore_hw(flags);
1095}
1096EXPORT_SYMBOL(bfin_gpio_free);
1097
1098int bfin_gpio_irq_request(unsigned gpio, const char *label)
1099{
1100 unsigned long flags;
1101
1102 if (check_gpio(gpio) < 0)
1103 return -EINVAL;
1104
1105 local_irq_save_hw(flags);
1106
1107 if (unlikely(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
1108 dump_stack();
1109 printk(KERN_ERR
1110 "bfin-gpio: GPIO %d is already reserved as gpio-irq !\n",
1111 gpio);
1112 local_irq_restore_hw(flags);
1113 return -EBUSY;
1114 }
1115 if (unlikely(reserved_peri_map[gpio_bank(gpio)] & gpio_bit(gpio))) {
1116 dump_stack();
1117 printk(KERN_ERR
1118 "bfin-gpio: GPIO %d is already reserved as Peripheral by %s !\n",
1119 gpio, get_label(gpio));
1120 local_irq_restore_hw(flags);
1121 return -EBUSY;
1122 }
1123 if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))
1124 printk(KERN_NOTICE "bfin-gpio: GPIO %d is already reserved by %s! "
1125 "(Documentation/blackfin/bfin-gpio-notes.txt)\n",
1126 gpio, get_label(gpio));
1127
1128 reserved_gpio_irq_map[gpio_bank(gpio)] |= gpio_bit(gpio);
1129 set_label(gpio, label);
1130
1131 local_irq_restore_hw(flags);
1132
1133 port_setup(gpio, GPIO_USAGE);
1134
1135 return 0;
1136}
1137
1138void bfin_gpio_irq_free(unsigned gpio)
1139{
1140 unsigned long flags;
1141
1142 if (check_gpio(gpio) < 0)
1143 return;
1144
1145 local_irq_save_hw(flags);
1146
1147 if (unlikely(!(reserved_gpio_irq_map[gpio_bank(gpio)] & gpio_bit(gpio)))) {
1148 dump_stack();
1149 gpio_error(gpio);
1150 local_irq_restore_hw(flags);
1151 return;
1152 }
1153
1154 reserved_gpio_irq_map[gpio_bank(gpio)] &= ~gpio_bit(gpio);
1155
1156 set_label(gpio, "free");
1157
1158 local_irq_restore_hw(flags);
1165} 1159}
1166EXPORT_SYMBOL(gpio_free);
1167 1160
1168 1161
1169#ifdef BF548_FAMILY 1162#ifdef BF548_FAMILY
1170int gpio_direction_input(unsigned gpio) 1163int bfin_gpio_direction_input(unsigned gpio)
1171{ 1164{
1172 unsigned long flags; 1165 unsigned long flags;
1173 1166
@@ -1176,16 +1169,16 @@ int gpio_direction_input(unsigned gpio)
1176 return -EINVAL; 1169 return -EINVAL;
1177 } 1170 }
1178 1171
1179 local_irq_save(flags); 1172 local_irq_save_hw(flags);
1180 gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio); 1173 gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio);
1181 gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio); 1174 gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio);
1182 local_irq_restore(flags); 1175 local_irq_restore_hw(flags);
1183 1176
1184 return 0; 1177 return 0;
1185} 1178}
1186EXPORT_SYMBOL(gpio_direction_input); 1179EXPORT_SYMBOL(bfin_gpio_direction_input);
1187 1180
1188int gpio_direction_output(unsigned gpio, int value) 1181int bfin_gpio_direction_output(unsigned gpio, int value)
1189{ 1182{
1190 unsigned long flags; 1183 unsigned long flags;
1191 1184
@@ -1194,30 +1187,30 @@ int gpio_direction_output(unsigned gpio, int value)
1194 return -EINVAL; 1187 return -EINVAL;
1195 } 1188 }
1196 1189
1197 local_irq_save(flags); 1190 local_irq_save_hw(flags);
1198 gpio_array[gpio_bank(gpio)]->port_inen &= ~gpio_bit(gpio); 1191 gpio_array[gpio_bank(gpio)]->port_inen &= ~gpio_bit(gpio);
1199 gpio_set_value(gpio, value); 1192 gpio_set_value(gpio, value);
1200 gpio_array[gpio_bank(gpio)]->port_dir_set = gpio_bit(gpio); 1193 gpio_array[gpio_bank(gpio)]->port_dir_set = gpio_bit(gpio);
1201 local_irq_restore(flags); 1194 local_irq_restore_hw(flags);
1202 1195
1203 return 0; 1196 return 0;
1204} 1197}
1205EXPORT_SYMBOL(gpio_direction_output); 1198EXPORT_SYMBOL(bfin_gpio_direction_output);
1206 1199
1207void gpio_set_value(unsigned gpio, int arg) 1200void bfin_gpio_set_value(unsigned gpio, int arg)
1208{ 1201{
1209 if (arg) 1202 if (arg)
1210 gpio_array[gpio_bank(gpio)]->port_set = gpio_bit(gpio); 1203 gpio_array[gpio_bank(gpio)]->port_set = gpio_bit(gpio);
1211 else 1204 else
1212 gpio_array[gpio_bank(gpio)]->port_clear = gpio_bit(gpio); 1205 gpio_array[gpio_bank(gpio)]->port_clear = gpio_bit(gpio);
1213} 1206}
1214EXPORT_SYMBOL(gpio_set_value); 1207EXPORT_SYMBOL(bfin_gpio_set_value);
1215 1208
1216int gpio_get_value(unsigned gpio) 1209int bfin_gpio_get_value(unsigned gpio)
1217{ 1210{
1218 return (1 & (gpio_array[gpio_bank(gpio)]->port_data >> gpio_sub_n(gpio))); 1211 return (1 & (gpio_array[gpio_bank(gpio)]->port_data >> gpio_sub_n(gpio)));
1219} 1212}
1220EXPORT_SYMBOL(gpio_get_value); 1213EXPORT_SYMBOL(bfin_gpio_get_value);
1221 1214
1222void bfin_gpio_irq_prepare(unsigned gpio) 1215void bfin_gpio_irq_prepare(unsigned gpio)
1223{ 1216{
@@ -1225,34 +1218,34 @@ void bfin_gpio_irq_prepare(unsigned gpio)
1225 1218
1226 port_setup(gpio, GPIO_USAGE); 1219 port_setup(gpio, GPIO_USAGE);
1227 1220
1228 local_irq_save(flags); 1221 local_irq_save_hw(flags);
1229 gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio); 1222 gpio_array[gpio_bank(gpio)]->port_dir_clear = gpio_bit(gpio);
1230 gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio); 1223 gpio_array[gpio_bank(gpio)]->port_inen |= gpio_bit(gpio);
1231 local_irq_restore(flags); 1224 local_irq_restore_hw(flags);
1232} 1225}
1233 1226
1234#else 1227#else
1235 1228
1236int gpio_get_value(unsigned gpio) 1229int bfin_gpio_get_value(unsigned gpio)
1237{ 1230{
1238 unsigned long flags; 1231 unsigned long flags;
1239 int ret; 1232 int ret;
1240 1233
1241 if (unlikely(get_gpio_edge(gpio))) { 1234 if (unlikely(get_gpio_edge(gpio))) {
1242 local_irq_save(flags); 1235 local_irq_save_hw(flags);
1243 set_gpio_edge(gpio, 0); 1236 set_gpio_edge(gpio, 0);
1244 ret = get_gpio_data(gpio); 1237 ret = get_gpio_data(gpio);
1245 set_gpio_edge(gpio, 1); 1238 set_gpio_edge(gpio, 1);
1246 local_irq_restore(flags); 1239 local_irq_restore_hw(flags);
1247 1240
1248 return ret; 1241 return ret;
1249 } else 1242 } else
1250 return get_gpio_data(gpio); 1243 return get_gpio_data(gpio);
1251} 1244}
1252EXPORT_SYMBOL(gpio_get_value); 1245EXPORT_SYMBOL(bfin_gpio_get_value);
1253 1246
1254 1247
1255int gpio_direction_input(unsigned gpio) 1248int bfin_gpio_direction_input(unsigned gpio)
1256{ 1249{
1257 unsigned long flags; 1250 unsigned long flags;
1258 1251
@@ -1261,17 +1254,17 @@ int gpio_direction_input(unsigned gpio)
1261 return -EINVAL; 1254 return -EINVAL;
1262 } 1255 }
1263 1256
1264 local_irq_save(flags); 1257 local_irq_save_hw(flags);
1265 gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); 1258 gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio);
1266 gpio_bankb[gpio_bank(gpio)]->inen |= gpio_bit(gpio); 1259 gpio_bankb[gpio_bank(gpio)]->inen |= gpio_bit(gpio);
1267 AWA_DUMMY_READ(inen); 1260 AWA_DUMMY_READ(inen);
1268 local_irq_restore(flags); 1261 local_irq_restore_hw(flags);
1269 1262
1270 return 0; 1263 return 0;
1271} 1264}
1272EXPORT_SYMBOL(gpio_direction_input); 1265EXPORT_SYMBOL(bfin_gpio_direction_input);
1273 1266
1274int gpio_direction_output(unsigned gpio, int value) 1267int bfin_gpio_direction_output(unsigned gpio, int value)
1275{ 1268{
1276 unsigned long flags; 1269 unsigned long flags;
1277 1270
@@ -1280,7 +1273,7 @@ int gpio_direction_output(unsigned gpio, int value)
1280 return -EINVAL; 1273 return -EINVAL;
1281 } 1274 }
1282 1275
1283 local_irq_save(flags); 1276 local_irq_save_hw(flags);
1284 gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); 1277 gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio);
1285 1278
1286 if (value) 1279 if (value)
@@ -1290,11 +1283,11 @@ int gpio_direction_output(unsigned gpio, int value)
1290 1283
1291 gpio_bankb[gpio_bank(gpio)]->dir |= gpio_bit(gpio); 1284 gpio_bankb[gpio_bank(gpio)]->dir |= gpio_bit(gpio);
1292 AWA_DUMMY_READ(dir); 1285 AWA_DUMMY_READ(dir);
1293 local_irq_restore(flags); 1286 local_irq_restore_hw(flags);
1294 1287
1295 return 0; 1288 return 0;
1296} 1289}
1297EXPORT_SYMBOL(gpio_direction_output); 1290EXPORT_SYMBOL(bfin_gpio_direction_output);
1298 1291
1299/* If we are booting from SPI and our board lacks a strong enough pull up, 1292/* If we are booting from SPI and our board lacks a strong enough pull up,
1300 * the core can reset and execute the bootrom faster than the resistor can 1293 * the core can reset and execute the bootrom faster than the resistor can
@@ -1327,14 +1320,17 @@ void bfin_gpio_irq_prepare(unsigned gpio)
1327static int gpio_proc_read(char *buf, char **start, off_t offset, 1320static int gpio_proc_read(char *buf, char **start, off_t offset,
1328 int len, int *unused_i, void *unused_v) 1321 int len, int *unused_i, void *unused_v)
1329{ 1322{
1330 int c, outlen = 0; 1323 int c, irq, gpio, outlen = 0;
1331 1324
1332 for (c = 0; c < MAX_RESOURCES; c++) { 1325 for (c = 0; c < MAX_RESOURCES; c++) {
1333 if (!check_gpio(c) && (reserved_gpio_map[gpio_bank(c)] & gpio_bit(c))) 1326 irq = reserved_gpio_irq_map[gpio_bank(c)] & gpio_bit(c);
1334 len = sprintf(buf, "GPIO_%d: %s \t\tGPIO %s\n", c, 1327 gpio = reserved_gpio_map[gpio_bank(c)] & gpio_bit(c);
1335 get_label(c), get_gpio_dir(c) ? "OUTPUT" : "INPUT"); 1328 if (!check_gpio(c) && (gpio || irq))
1329 len = sprintf(buf, "GPIO_%d: \t%s%s \t\tGPIO %s\n", c,
1330 get_label(c), (gpio && irq) ? " *" : "",
1331 get_gpio_dir(c) ? "OUTPUT" : "INPUT");
1336 else if (reserved_peri_map[gpio_bank(c)] & gpio_bit(c)) 1332 else if (reserved_peri_map[gpio_bank(c)] & gpio_bit(c))
1337 len = sprintf(buf, "GPIO_%d: %s \t\tPeripheral\n", c, get_label(c)); 1333 len = sprintf(buf, "GPIO_%d: \t%s \t\tPeripheral\n", c, get_label(c));
1338 else 1334 else
1339 continue; 1335 continue;
1340 buf += len; 1336 buf += len;
@@ -1354,3 +1350,57 @@ static __init int gpio_register_proc(void)
1354} 1350}
1355__initcall(gpio_register_proc); 1351__initcall(gpio_register_proc);
1356#endif 1352#endif
1353
1354#ifdef CONFIG_GPIOLIB
1355int bfin_gpiolib_direction_input(struct gpio_chip *chip, unsigned gpio)
1356{
1357 return bfin_gpio_direction_input(gpio);
1358}
1359
1360int bfin_gpiolib_direction_output(struct gpio_chip *chip, unsigned gpio, int level)
1361{
1362 return bfin_gpio_direction_output(gpio, level);
1363}
1364
1365int bfin_gpiolib_get_value(struct gpio_chip *chip, unsigned gpio)
1366{
1367 return bfin_gpio_get_value(gpio);
1368}
1369
1370void bfin_gpiolib_set_value(struct gpio_chip *chip, unsigned gpio, int value)
1371{
1372#ifdef BF548_FAMILY
1373 return bfin_gpio_set_value(gpio, value);
1374#else
1375 return set_gpio_data(gpio, value);
1376#endif
1377}
1378
1379int bfin_gpiolib_gpio_request(struct gpio_chip *chip, unsigned gpio)
1380{
1381 return bfin_gpio_request(gpio, chip->label);
1382}
1383
1384void bfin_gpiolib_gpio_free(struct gpio_chip *chip, unsigned gpio)
1385{
1386 return bfin_gpio_free(gpio);
1387}
1388
1389static struct gpio_chip bfin_chip = {
1390 .label = "Blackfin-GPIOlib",
1391 .direction_input = bfin_gpiolib_direction_input,
1392 .get = bfin_gpiolib_get_value,
1393 .direction_output = bfin_gpiolib_direction_output,
1394 .set = bfin_gpiolib_set_value,
1395 .request = bfin_gpiolib_gpio_request,
1396 .free = bfin_gpiolib_gpio_free,
1397 .base = 0,
1398 .ngpio = MAX_BLACKFIN_GPIOS,
1399};
1400
1401static int __init bfin_gpiolib_setup(void)
1402{
1403 return gpiochip_add(&bfin_chip);
1404}
1405arch_initcall(bfin_gpiolib_setup);
1406#endif
diff --git a/arch/blackfin/kernel/bfin_ksyms.c b/arch/blackfin/kernel/bfin_ksyms.c
index 4367330909b2..01f917d58b59 100644
--- a/arch/blackfin/kernel/bfin_ksyms.c
+++ b/arch/blackfin/kernel/bfin_ksyms.c
@@ -1,52 +1,25 @@
1/* 1/*
2 * File: arch/blackfin/kernel/bfin_ksyms.c 2 * arch/blackfin/kernel/bfin_ksyms.c - exports for random symbols
3 * Based on: none - original work
4 * Author:
5 * 3 *
6 * Created: 4 * Copyright 2004-2008 Analog Devices Inc.
7 * Description:
8 * 5 *
9 * Modified: 6 * Licensed under the GPL-2 or later.
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */ 7 */
29 8
30#include <linux/module.h> 9#include <linux/module.h>
31#include <linux/irq.h>
32#include <linux/uaccess.h> 10#include <linux/uaccess.h>
33 11
34#include <asm/checksum.h>
35#include <asm/cacheflush.h> 12#include <asm/cacheflush.h>
36 13
37/* platform dependent support */ 14/* Allow people to have their own Blackfin exception handler in a module */
38
39EXPORT_SYMBOL(__ioremap);
40
41EXPORT_SYMBOL(ip_fast_csum);
42
43EXPORT_SYMBOL(kernel_thread);
44
45EXPORT_SYMBOL(is_in_rom);
46EXPORT_SYMBOL(bfin_return_from_exception); 15EXPORT_SYMBOL(bfin_return_from_exception);
47 16
48/* Networking helper routines. */ 17/* All the Blackfin cache functions: mach-common/cache.S */
49EXPORT_SYMBOL(csum_partial_copy); 18EXPORT_SYMBOL(blackfin_dcache_invalidate_range);
19EXPORT_SYMBOL(blackfin_icache_dcache_flush_range);
20EXPORT_SYMBOL(blackfin_icache_flush_range);
21EXPORT_SYMBOL(blackfin_dcache_flush_range);
22EXPORT_SYMBOL(blackfin_dflush_page);
50 23
51/* The following are special because they're not called 24/* The following are special because they're not called
52 * explicitly (the C compiler generates them). Fortunately, 25 * explicitly (the C compiler generates them). Fortunately,
@@ -74,8 +47,6 @@ extern void __modsi3(void);
74extern void __muldi3(void); 47extern void __muldi3(void);
75extern void __udivsi3(void); 48extern void __udivsi3(void);
76extern void __umodsi3(void); 49extern void __umodsi3(void);
77
78/* gcc lib functions */
79EXPORT_SYMBOL(__ashldi3); 50EXPORT_SYMBOL(__ashldi3);
80EXPORT_SYMBOL(__ashrdi3); 51EXPORT_SYMBOL(__ashrdi3);
81EXPORT_SYMBOL(__umulsi3_highpart); 52EXPORT_SYMBOL(__umulsi3_highpart);
@@ -87,6 +58,7 @@ EXPORT_SYMBOL(__muldi3);
87EXPORT_SYMBOL(__udivsi3); 58EXPORT_SYMBOL(__udivsi3);
88EXPORT_SYMBOL(__umodsi3); 59EXPORT_SYMBOL(__umodsi3);
89 60
61/* Input/output symbols: lib/{in,out}s.S */
90EXPORT_SYMBOL(outsb); 62EXPORT_SYMBOL(outsb);
91EXPORT_SYMBOL(insb); 63EXPORT_SYMBOL(insb);
92EXPORT_SYMBOL(outsw); 64EXPORT_SYMBOL(outsw);
@@ -96,20 +68,39 @@ EXPORT_SYMBOL(insw_8);
96EXPORT_SYMBOL(outsl); 68EXPORT_SYMBOL(outsl);
97EXPORT_SYMBOL(insl); 69EXPORT_SYMBOL(insl);
98EXPORT_SYMBOL(insl_16); 70EXPORT_SYMBOL(insl_16);
99EXPORT_SYMBOL(irq_flags);
100EXPORT_SYMBOL(iounmap);
101EXPORT_SYMBOL(blackfin_dcache_invalidate_range);
102EXPORT_SYMBOL(blackfin_icache_dcache_flush_range);
103EXPORT_SYMBOL(blackfin_icache_flush_range);
104EXPORT_SYMBOL(blackfin_dcache_flush_range);
105EXPORT_SYMBOL(blackfin_dflush_page);
106 71
107EXPORT_SYMBOL(csum_partial); 72#ifdef CONFIG_SMP
108EXPORT_SYMBOL(__init_begin); 73EXPORT_SYMBOL(__raw_atomic_update_asm);
109EXPORT_SYMBOL(__init_end); 74EXPORT_SYMBOL(__raw_atomic_clear_asm);
110EXPORT_SYMBOL(_ebss_l1); 75EXPORT_SYMBOL(__raw_atomic_set_asm);
111EXPORT_SYMBOL(_stext_l1); 76EXPORT_SYMBOL(__raw_atomic_xor_asm);
112EXPORT_SYMBOL(_etext_l1); 77EXPORT_SYMBOL(__raw_atomic_test_asm);
113EXPORT_SYMBOL(_sdata_l1); 78EXPORT_SYMBOL(__raw_xchg_1_asm);
114EXPORT_SYMBOL(_ebss_b_l1); 79EXPORT_SYMBOL(__raw_xchg_2_asm);
115EXPORT_SYMBOL(_sdata_b_l1); 80EXPORT_SYMBOL(__raw_xchg_4_asm);
81EXPORT_SYMBOL(__raw_cmpxchg_1_asm);
82EXPORT_SYMBOL(__raw_cmpxchg_2_asm);
83EXPORT_SYMBOL(__raw_cmpxchg_4_asm);
84EXPORT_SYMBOL(__raw_spin_is_locked_asm);
85EXPORT_SYMBOL(__raw_spin_lock_asm);
86EXPORT_SYMBOL(__raw_spin_trylock_asm);
87EXPORT_SYMBOL(__raw_spin_unlock_asm);
88EXPORT_SYMBOL(__raw_read_lock_asm);
89EXPORT_SYMBOL(__raw_read_trylock_asm);
90EXPORT_SYMBOL(__raw_read_unlock_asm);
91EXPORT_SYMBOL(__raw_write_lock_asm);
92EXPORT_SYMBOL(__raw_write_trylock_asm);
93EXPORT_SYMBOL(__raw_write_unlock_asm);
94EXPORT_SYMBOL(__raw_bit_set_asm);
95EXPORT_SYMBOL(__raw_bit_clear_asm);
96EXPORT_SYMBOL(__raw_bit_toggle_asm);
97EXPORT_SYMBOL(__raw_bit_test_asm);
98EXPORT_SYMBOL(__raw_bit_test_set_asm);
99EXPORT_SYMBOL(__raw_bit_test_clear_asm);
100EXPORT_SYMBOL(__raw_bit_test_toggle_asm);
101EXPORT_SYMBOL(__raw_uncached_fetch_asm);
102#ifdef __ARCH_SYNC_CORE_DCACHE
103EXPORT_SYMBOL(__raw_smp_mark_barrier_asm);
104EXPORT_SYMBOL(__raw_smp_check_barrier_asm);
105#endif
106#endif
diff --git a/arch/blackfin/kernel/cplb-mpu/Makefile b/arch/blackfin/kernel/cplb-mpu/Makefile
index 286b69357f97..7d70d3bf3212 100644
--- a/arch/blackfin/kernel/cplb-mpu/Makefile
+++ b/arch/blackfin/kernel/cplb-mpu/Makefile
@@ -4,5 +4,7 @@
4 4
5obj-y := cplbinit.o cacheinit.o cplbmgr.o 5obj-y := cplbinit.o cacheinit.o cplbmgr.o
6 6
7obj-$(CONFIG_CPLB_INFO) += cplbinfo.o 7CFLAGS_cplbmgr.o := -ffixed-I0 -ffixed-I1 -ffixed-I2 -ffixed-I3 \
8 8 -ffixed-L0 -ffixed-L1 -ffixed-L2 -ffixed-L3 \
9 -ffixed-M0 -ffixed-M1 -ffixed-M2 -ffixed-M3 \
10 -ffixed-B0 -ffixed-B1 -ffixed-B2 -ffixed-B3
diff --git a/arch/blackfin/kernel/cplb-mpu/cacheinit.c b/arch/blackfin/kernel/cplb-mpu/cacheinit.c
index a8b712a24c59..c6ff947f9d37 100644
--- a/arch/blackfin/kernel/cplb-mpu/cacheinit.c
+++ b/arch/blackfin/kernel/cplb-mpu/cacheinit.c
@@ -25,7 +25,7 @@
25#include <asm/cplbinit.h> 25#include <asm/cplbinit.h>
26 26
27#if defined(CONFIG_BFIN_ICACHE) 27#if defined(CONFIG_BFIN_ICACHE)
28void __init bfin_icache_init(void) 28void __cpuinit bfin_icache_init(struct cplb_entry *icplb_tbl)
29{ 29{
30 unsigned long ctrl; 30 unsigned long ctrl;
31 int i; 31 int i;
@@ -43,7 +43,7 @@ void __init bfin_icache_init(void)
43#endif 43#endif
44 44
45#if defined(CONFIG_BFIN_DCACHE) 45#if defined(CONFIG_BFIN_DCACHE)
46void __init bfin_dcache_init(void) 46void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)
47{ 47{
48 unsigned long ctrl; 48 unsigned long ctrl;
49 int i; 49 int i;
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinfo.c b/arch/blackfin/kernel/cplb-mpu/cplbinfo.c
deleted file mode 100644
index 822beefa3a4b..000000000000
--- a/arch/blackfin/kernel/cplb-mpu/cplbinfo.c
+++ /dev/null
@@ -1,136 +0,0 @@
1/*
2 * File: arch/blackfin/mach-common/cplbinfo.c
3 * Based on:
4 * Author: Sonic Zhang <sonic.zhang@analog.com>
5 *
6 * Created: Jan. 2005
7 * Description: Display CPLB status
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/module.h>
31#include <linux/kernel.h>
32#include <linux/init.h>
33#include <linux/proc_fs.h>
34#include <linux/uaccess.h>
35
36#include <asm/current.h>
37#include <asm/system.h>
38#include <asm/cplb.h>
39#include <asm/cplbinit.h>
40#include <asm/blackfin.h>
41
42static char page_size_string_table[][4] = { "1K", "4K", "1M", "4M" };
43
44static char *cplb_print_entry(char *buf, struct cplb_entry *tbl, int switched)
45{
46 int i;
47 buf += sprintf(buf, "Index\tAddress\t\tData\tSize\tU/RD\tU/WR\tS/WR\tSwitch\n");
48 for (i = 0; i < MAX_CPLBS; i++) {
49 unsigned long data = tbl[i].data;
50 unsigned long addr = tbl[i].addr;
51 if (!(data & CPLB_VALID))
52 continue;
53
54 buf +=
55 sprintf(buf,
56 "%d\t0x%08lx\t%06lx\t%s\t%c\t%c\t%c\t%c\n",
57 i, addr, data,
58 page_size_string_table[(data & 0x30000) >> 16],
59 (data & CPLB_USER_RD) ? 'Y' : 'N',
60 (data & CPLB_USER_WR) ? 'Y' : 'N',
61 (data & CPLB_SUPV_WR) ? 'Y' : 'N',
62 i < switched ? 'N' : 'Y');
63 }
64 buf += sprintf(buf, "\n");
65
66 return buf;
67}
68
69int cplbinfo_proc_output(char *buf)
70{
71 char *p;
72
73 p = buf;
74
75 p += sprintf(p, "------------------ CPLB Information ------------------\n\n");
76
77 if (bfin_read_IMEM_CONTROL() & ENICPLB) {
78 p += sprintf(p, "Instruction CPLB entry:\n");
79 p = cplb_print_entry(p, icplb_tbl, first_switched_icplb);
80 } else
81 p += sprintf(p, "Instruction CPLB is disabled.\n\n");
82
83 if (1 || bfin_read_DMEM_CONTROL() & ENDCPLB) {
84 p += sprintf(p, "Data CPLB entry:\n");
85 p = cplb_print_entry(p, dcplb_tbl, first_switched_dcplb);
86 } else
87 p += sprintf(p, "Data CPLB is disabled.\n");
88
89 p += sprintf(p, "ICPLB miss: %d\nICPLB supervisor miss: %d\n",
90 nr_icplb_miss, nr_icplb_supv_miss);
91 p += sprintf(p, "DCPLB miss: %d\nDCPLB protection fault:%d\n",
92 nr_dcplb_miss, nr_dcplb_prot);
93 p += sprintf(p, "CPLB flushes: %d\n",
94 nr_cplb_flush);
95
96 return p - buf;
97}
98
99static int cplbinfo_read_proc(char *page, char **start, off_t off,
100 int count, int *eof, void *data)
101{
102 int len;
103
104 len = cplbinfo_proc_output(page);
105 if (len <= off + count)
106 *eof = 1;
107 *start = page + off;
108 len -= off;
109 if (len > count)
110 len = count;
111 if (len < 0)
112 len = 0;
113 return len;
114}
115
116static int __init cplbinfo_init(void)
117{
118 struct proc_dir_entry *entry;
119
120 entry = create_proc_entry("cplbinfo", 0, NULL);
121 if (!entry)
122 return -ENOMEM;
123
124 entry->read_proc = cplbinfo_read_proc;
125 entry->data = NULL;
126
127 return 0;
128}
129
130static void __exit cplbinfo_exit(void)
131{
132 remove_proc_entry("cplbinfo", NULL);
133}
134
135module_init(cplbinfo_init);
136module_exit(cplbinfo_exit);
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbinit.c b/arch/blackfin/kernel/cplb-mpu/cplbinit.c
index 55af729f8495..bdb958486e76 100644
--- a/arch/blackfin/kernel/cplb-mpu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-mpu/cplbinit.c
@@ -25,18 +25,19 @@
25#include <asm/blackfin.h> 25#include <asm/blackfin.h>
26#include <asm/cplb.h> 26#include <asm/cplb.h>
27#include <asm/cplbinit.h> 27#include <asm/cplbinit.h>
28#include <asm/mem_map.h>
28 29
29#if ANOMALY_05000263 30#if ANOMALY_05000263
30# error the MPU will not function safely while Anomaly 05000263 applies 31# error the MPU will not function safely while Anomaly 05000263 applies
31#endif 32#endif
32 33
33struct cplb_entry icplb_tbl[MAX_CPLBS]; 34struct cplb_entry icplb_tbl[NR_CPUS][MAX_CPLBS];
34struct cplb_entry dcplb_tbl[MAX_CPLBS]; 35struct cplb_entry dcplb_tbl[NR_CPUS][MAX_CPLBS];
35 36
36int first_switched_icplb, first_switched_dcplb; 37int first_switched_icplb, first_switched_dcplb;
37int first_mask_dcplb; 38int first_mask_dcplb;
38 39
39void __init generate_cplb_tables(void) 40void __init generate_cplb_tables_cpu(unsigned int cpu)
40{ 41{
41 int i_d, i_i; 42 int i_d, i_i;
42 unsigned long addr; 43 unsigned long addr;
@@ -55,15 +56,16 @@ void __init generate_cplb_tables(void)
55 d_cache |= CPLB_L1_AOW | CPLB_WT; 56 d_cache |= CPLB_L1_AOW | CPLB_WT;
56#endif 57#endif
57#endif 58#endif
59
58 i_d = i_i = 0; 60 i_d = i_i = 0;
59 61
60 /* Set up the zero page. */ 62 /* Set up the zero page. */
61 dcplb_tbl[i_d].addr = 0; 63 dcplb_tbl[cpu][i_d].addr = 0;
62 dcplb_tbl[i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB; 64 dcplb_tbl[cpu][i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB;
63 65
64#if 0 66#if 0
65 icplb_tbl[i_i].addr = 0; 67 icplb_tbl[cpu][i_i].addr = 0;
66 icplb_tbl[i_i++].data = i_cache | CPLB_USER_RD | PAGE_SIZE_4KB; 68 icplb_tbl[cpu][i_i++].data = i_cache | CPLB_USER_RD | PAGE_SIZE_4KB;
67#endif 69#endif
68 70
69 /* Cover kernel memory with 4M pages. */ 71 /* Cover kernel memory with 4M pages. */
@@ -72,28 +74,28 @@ void __init generate_cplb_tables(void)
72 i_data = i_cache | CPLB_VALID | CPLB_PORTPRIO | PAGE_SIZE_4MB; 74 i_data = i_cache | CPLB_VALID | CPLB_PORTPRIO | PAGE_SIZE_4MB;
73 75
74 for (; addr < memory_start; addr += 4 * 1024 * 1024) { 76 for (; addr < memory_start; addr += 4 * 1024 * 1024) {
75 dcplb_tbl[i_d].addr = addr; 77 dcplb_tbl[cpu][i_d].addr = addr;
76 dcplb_tbl[i_d++].data = d_data; 78 dcplb_tbl[cpu][i_d++].data = d_data;
77 icplb_tbl[i_i].addr = addr; 79 icplb_tbl[cpu][i_i].addr = addr;
78 icplb_tbl[i_i++].data = i_data | (addr == 0 ? CPLB_USER_RD : 0); 80 icplb_tbl[cpu][i_i++].data = i_data | (addr == 0 ? CPLB_USER_RD : 0);
79 } 81 }
80 82
81 /* Cover L1 memory. One 4M area for code and data each is enough. */ 83 /* Cover L1 memory. One 4M area for code and data each is enough. */
82#if L1_DATA_A_LENGTH > 0 || L1_DATA_B_LENGTH > 0 84#if L1_DATA_A_LENGTH > 0 || L1_DATA_B_LENGTH > 0
83 dcplb_tbl[i_d].addr = L1_DATA_A_START; 85 dcplb_tbl[cpu][i_d].addr = get_l1_data_a_start_cpu(cpu);
84 dcplb_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB; 86 dcplb_tbl[cpu][i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB;
85#endif 87#endif
86#if L1_CODE_LENGTH > 0 88#if L1_CODE_LENGTH > 0
87 icplb_tbl[i_i].addr = L1_CODE_START; 89 icplb_tbl[cpu][i_i].addr = get_l1_code_start_cpu(cpu);
88 icplb_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB; 90 icplb_tbl[cpu][i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB;
89#endif 91#endif
90 92
91 /* Cover L2 memory */ 93 /* Cover L2 memory */
92#if L2_LENGTH > 0 94#if L2_LENGTH > 0
93 dcplb_tbl[i_d].addr = L2_START; 95 dcplb_tbl[cpu][i_d].addr = L2_START;
94 dcplb_tbl[i_d++].data = L2_DMEMORY | PAGE_SIZE_1MB; 96 dcplb_tbl[cpu][i_d++].data = L2_DMEMORY | PAGE_SIZE_1MB;
95 icplb_tbl[i_i].addr = L2_START; 97 icplb_tbl[cpu][i_i].addr = L2_START;
96 icplb_tbl[i_i++].data = L2_IMEMORY | PAGE_SIZE_1MB; 98 icplb_tbl[cpu][i_i++].data = L2_IMEMORY | PAGE_SIZE_1MB;
97#endif 99#endif
98 100
99 first_mask_dcplb = i_d; 101 first_mask_dcplb = i_d;
@@ -101,7 +103,11 @@ void __init generate_cplb_tables(void)
101 first_switched_icplb = i_i; 103 first_switched_icplb = i_i;
102 104
103 while (i_d < MAX_CPLBS) 105 while (i_d < MAX_CPLBS)
104 dcplb_tbl[i_d++].data = 0; 106 dcplb_tbl[cpu][i_d++].data = 0;
105 while (i_i < MAX_CPLBS) 107 while (i_i < MAX_CPLBS)
106 icplb_tbl[i_i++].data = 0; 108 icplb_tbl[cpu][i_i++].data = 0;
109}
110
111void generate_cplb_tables_all(void)
112{
107} 113}
diff --git a/arch/blackfin/kernel/cplb-mpu/cplbmgr.c b/arch/blackfin/kernel/cplb-mpu/cplbmgr.c
index baa52e261f0d..87463ce87f5a 100644
--- a/arch/blackfin/kernel/cplb-mpu/cplbmgr.c
+++ b/arch/blackfin/kernel/cplb-mpu/cplbmgr.c
@@ -25,15 +25,21 @@
25#include <asm/cplbinit.h> 25#include <asm/cplbinit.h>
26#include <asm/mmu_context.h> 26#include <asm/mmu_context.h>
27 27
28#define FAULT_RW (1 << 16) 28/*
29#define FAULT_USERSUPV (1 << 17) 29 * WARNING
30 *
31 * This file is compiled with certain -ffixed-reg options. We have to
32 * make sure not to call any functions here that could clobber these
33 * registers.
34 */
30 35
31int page_mask_nelts; 36int page_mask_nelts;
32int page_mask_order; 37int page_mask_order;
33unsigned long *current_rwx_mask; 38unsigned long *current_rwx_mask[NR_CPUS];
34 39
35int nr_dcplb_miss, nr_icplb_miss, nr_icplb_supv_miss, nr_dcplb_prot; 40int nr_dcplb_miss[NR_CPUS], nr_icplb_miss[NR_CPUS];
36int nr_cplb_flush; 41int nr_icplb_supv_miss[NR_CPUS], nr_dcplb_prot[NR_CPUS];
42int nr_cplb_flush[NR_CPUS];
37 43
38static inline void disable_dcplb(void) 44static inline void disable_dcplb(void)
39{ 45{
@@ -98,42 +104,42 @@ static inline int write_permitted(int status, unsigned long data)
98} 104}
99 105
100/* Counters to implement round-robin replacement. */ 106/* Counters to implement round-robin replacement. */
101static int icplb_rr_index, dcplb_rr_index; 107static int icplb_rr_index[NR_CPUS], dcplb_rr_index[NR_CPUS];
102 108
103/* 109/*
104 * Find an ICPLB entry to be evicted and return its index. 110 * Find an ICPLB entry to be evicted and return its index.
105 */ 111 */
106static int evict_one_icplb(void) 112static int evict_one_icplb(unsigned int cpu)
107{ 113{
108 int i; 114 int i;
109 for (i = first_switched_icplb; i < MAX_CPLBS; i++) 115 for (i = first_switched_icplb; i < MAX_CPLBS; i++)
110 if ((icplb_tbl[i].data & CPLB_VALID) == 0) 116 if ((icplb_tbl[cpu][i].data & CPLB_VALID) == 0)
111 return i; 117 return i;
112 i = first_switched_icplb + icplb_rr_index; 118 i = first_switched_icplb + icplb_rr_index[cpu];
113 if (i >= MAX_CPLBS) { 119 if (i >= MAX_CPLBS) {
114 i -= MAX_CPLBS - first_switched_icplb; 120 i -= MAX_CPLBS - first_switched_icplb;
115 icplb_rr_index -= MAX_CPLBS - first_switched_icplb; 121 icplb_rr_index[cpu] -= MAX_CPLBS - first_switched_icplb;
116 } 122 }
117 icplb_rr_index++; 123 icplb_rr_index[cpu]++;
118 return i; 124 return i;
119} 125}
120 126
121static int evict_one_dcplb(void) 127static int evict_one_dcplb(unsigned int cpu)
122{ 128{
123 int i; 129 int i;
124 for (i = first_switched_dcplb; i < MAX_CPLBS; i++) 130 for (i = first_switched_dcplb; i < MAX_CPLBS; i++)
125 if ((dcplb_tbl[i].data & CPLB_VALID) == 0) 131 if ((dcplb_tbl[cpu][i].data & CPLB_VALID) == 0)
126 return i; 132 return i;
127 i = first_switched_dcplb + dcplb_rr_index; 133 i = first_switched_dcplb + dcplb_rr_index[cpu];
128 if (i >= MAX_CPLBS) { 134 if (i >= MAX_CPLBS) {
129 i -= MAX_CPLBS - first_switched_dcplb; 135 i -= MAX_CPLBS - first_switched_dcplb;
130 dcplb_rr_index -= MAX_CPLBS - first_switched_dcplb; 136 dcplb_rr_index[cpu] -= MAX_CPLBS - first_switched_dcplb;
131 } 137 }
132 dcplb_rr_index++; 138 dcplb_rr_index[cpu]++;
133 return i; 139 return i;
134} 140}
135 141
136static noinline int dcplb_miss(void) 142static noinline int dcplb_miss(unsigned int cpu)
137{ 143{
138 unsigned long addr = bfin_read_DCPLB_FAULT_ADDR(); 144 unsigned long addr = bfin_read_DCPLB_FAULT_ADDR();
139 int status = bfin_read_DCPLB_STATUS(); 145 int status = bfin_read_DCPLB_STATUS();
@@ -141,7 +147,7 @@ static noinline int dcplb_miss(void)
141 int idx; 147 int idx;
142 unsigned long d_data; 148 unsigned long d_data;
143 149
144 nr_dcplb_miss++; 150 nr_dcplb_miss[cpu]++;
145 151
146 d_data = CPLB_SUPV_WR | CPLB_VALID | CPLB_DIRTY | PAGE_SIZE_4KB; 152 d_data = CPLB_SUPV_WR | CPLB_VALID | CPLB_DIRTY | PAGE_SIZE_4KB;
147#ifdef CONFIG_BFIN_DCACHE 153#ifdef CONFIG_BFIN_DCACHE
@@ -168,25 +174,25 @@ static noinline int dcplb_miss(void)
168 } else if (addr >= _ramend) { 174 } else if (addr >= _ramend) {
169 d_data |= CPLB_USER_RD | CPLB_USER_WR; 175 d_data |= CPLB_USER_RD | CPLB_USER_WR;
170 } else { 176 } else {
171 mask = current_rwx_mask; 177 mask = current_rwx_mask[cpu];
172 if (mask) { 178 if (mask) {
173 int page = addr >> PAGE_SHIFT; 179 int page = addr >> PAGE_SHIFT;
174 int offs = page >> 5; 180 int idx = page >> 5;
175 int bit = 1 << (page & 31); 181 int bit = 1 << (page & 31);
176 182
177 if (mask[offs] & bit) 183 if (mask[idx] & bit)
178 d_data |= CPLB_USER_RD; 184 d_data |= CPLB_USER_RD;
179 185
180 mask += page_mask_nelts; 186 mask += page_mask_nelts;
181 if (mask[offs] & bit) 187 if (mask[idx] & bit)
182 d_data |= CPLB_USER_WR; 188 d_data |= CPLB_USER_WR;
183 } 189 }
184 } 190 }
185 idx = evict_one_dcplb(); 191 idx = evict_one_dcplb(cpu);
186 192
187 addr &= PAGE_MASK; 193 addr &= PAGE_MASK;
188 dcplb_tbl[idx].addr = addr; 194 dcplb_tbl[cpu][idx].addr = addr;
189 dcplb_tbl[idx].data = d_data; 195 dcplb_tbl[cpu][idx].data = d_data;
190 196
191 disable_dcplb(); 197 disable_dcplb();
192 bfin_write32(DCPLB_DATA0 + idx * 4, d_data); 198 bfin_write32(DCPLB_DATA0 + idx * 4, d_data);
@@ -196,21 +202,21 @@ static noinline int dcplb_miss(void)
196 return 0; 202 return 0;
197} 203}
198 204
199static noinline int icplb_miss(void) 205static noinline int icplb_miss(unsigned int cpu)
200{ 206{
201 unsigned long addr = bfin_read_ICPLB_FAULT_ADDR(); 207 unsigned long addr = bfin_read_ICPLB_FAULT_ADDR();
202 int status = bfin_read_ICPLB_STATUS(); 208 int status = bfin_read_ICPLB_STATUS();
203 int idx; 209 int idx;
204 unsigned long i_data; 210 unsigned long i_data;
205 211
206 nr_icplb_miss++; 212 nr_icplb_miss[cpu]++;
207 213
208 /* If inside the uncached DMA region, fault. */ 214 /* If inside the uncached DMA region, fault. */
209 if (addr >= _ramend - DMA_UNCACHED_REGION && addr < _ramend) 215 if (addr >= _ramend - DMA_UNCACHED_REGION && addr < _ramend)
210 return CPLB_PROT_VIOL; 216 return CPLB_PROT_VIOL;
211 217
212 if (status & FAULT_USERSUPV) 218 if (status & FAULT_USERSUPV)
213 nr_icplb_supv_miss++; 219 nr_icplb_supv_miss[cpu]++;
214 220
215 /* 221 /*
216 * First, try to find a CPLB that matches this address. If we 222 * First, try to find a CPLB that matches this address. If we
@@ -218,8 +224,8 @@ static noinline int icplb_miss(void)
218 * that the instruction crosses a page boundary. 224 * that the instruction crosses a page boundary.
219 */ 225 */
220 for (idx = first_switched_icplb; idx < MAX_CPLBS; idx++) { 226 for (idx = first_switched_icplb; idx < MAX_CPLBS; idx++) {
221 if (icplb_tbl[idx].data & CPLB_VALID) { 227 if (icplb_tbl[cpu][idx].data & CPLB_VALID) {
222 unsigned long this_addr = icplb_tbl[idx].addr; 228 unsigned long this_addr = icplb_tbl[cpu][idx].addr;
223 if (this_addr <= addr && this_addr + PAGE_SIZE > addr) { 229 if (this_addr <= addr && this_addr + PAGE_SIZE > addr) {
224 addr += PAGE_SIZE; 230 addr += PAGE_SIZE;
225 break; 231 break;
@@ -257,23 +263,23 @@ static noinline int icplb_miss(void)
257 * Otherwise, check the x bitmap of the current process. 263 * Otherwise, check the x bitmap of the current process.
258 */ 264 */
259 if (!(status & FAULT_USERSUPV)) { 265 if (!(status & FAULT_USERSUPV)) {
260 unsigned long *mask = current_rwx_mask; 266 unsigned long *mask = current_rwx_mask[cpu];
261 267
262 if (mask) { 268 if (mask) {
263 int page = addr >> PAGE_SHIFT; 269 int page = addr >> PAGE_SHIFT;
264 int offs = page >> 5; 270 int idx = page >> 5;
265 int bit = 1 << (page & 31); 271 int bit = 1 << (page & 31);
266 272
267 mask += 2 * page_mask_nelts; 273 mask += 2 * page_mask_nelts;
268 if (mask[offs] & bit) 274 if (mask[idx] & bit)
269 i_data |= CPLB_USER_RD; 275 i_data |= CPLB_USER_RD;
270 } 276 }
271 } 277 }
272 } 278 }
273 idx = evict_one_icplb(); 279 idx = evict_one_icplb(cpu);
274 addr &= PAGE_MASK; 280 addr &= PAGE_MASK;
275 icplb_tbl[idx].addr = addr; 281 icplb_tbl[cpu][idx].addr = addr;
276 icplb_tbl[idx].data = i_data; 282 icplb_tbl[cpu][idx].data = i_data;
277 283
278 disable_icplb(); 284 disable_icplb();
279 bfin_write32(ICPLB_DATA0 + idx * 4, i_data); 285 bfin_write32(ICPLB_DATA0 + idx * 4, i_data);
@@ -283,19 +289,19 @@ static noinline int icplb_miss(void)
283 return 0; 289 return 0;
284} 290}
285 291
286static noinline int dcplb_protection_fault(void) 292static noinline int dcplb_protection_fault(unsigned int cpu)
287{ 293{
288 int status = bfin_read_DCPLB_STATUS(); 294 int status = bfin_read_DCPLB_STATUS();
289 295
290 nr_dcplb_prot++; 296 nr_dcplb_prot[cpu]++;
291 297
292 if (status & FAULT_RW) { 298 if (status & FAULT_RW) {
293 int idx = faulting_cplb_index(status); 299 int idx = faulting_cplb_index(status);
294 unsigned long data = dcplb_tbl[idx].data; 300 unsigned long data = dcplb_tbl[cpu][idx].data;
295 if (!(data & CPLB_WT) && !(data & CPLB_DIRTY) && 301 if (!(data & CPLB_WT) && !(data & CPLB_DIRTY) &&
296 write_permitted(status, data)) { 302 write_permitted(status, data)) {
297 data |= CPLB_DIRTY; 303 data |= CPLB_DIRTY;
298 dcplb_tbl[idx].data = data; 304 dcplb_tbl[cpu][idx].data = data;
299 bfin_write32(DCPLB_DATA0 + idx * 4, data); 305 bfin_write32(DCPLB_DATA0 + idx * 4, data);
300 return 0; 306 return 0;
301 } 307 }
@@ -306,44 +312,45 @@ static noinline int dcplb_protection_fault(void)
306int cplb_hdr(int seqstat, struct pt_regs *regs) 312int cplb_hdr(int seqstat, struct pt_regs *regs)
307{ 313{
308 int cause = seqstat & 0x3f; 314 int cause = seqstat & 0x3f;
315 unsigned int cpu = smp_processor_id();
309 switch (cause) { 316 switch (cause) {
310 case 0x23: 317 case 0x23:
311 return dcplb_protection_fault(); 318 return dcplb_protection_fault(cpu);
312 case 0x2C: 319 case 0x2C:
313 return icplb_miss(); 320 return icplb_miss(cpu);
314 case 0x26: 321 case 0x26:
315 return dcplb_miss(); 322 return dcplb_miss(cpu);
316 default: 323 default:
317 return 1; 324 return 1;
318 } 325 }
319} 326}
320 327
321void flush_switched_cplbs(void) 328void flush_switched_cplbs(unsigned int cpu)
322{ 329{
323 int i; 330 int i;
324 unsigned long flags; 331 unsigned long flags;
325 332
326 nr_cplb_flush++; 333 nr_cplb_flush[cpu]++;
327 334
328 local_irq_save(flags); 335 local_irq_save_hw(flags);
329 disable_icplb(); 336 disable_icplb();
330 for (i = first_switched_icplb; i < MAX_CPLBS; i++) { 337 for (i = first_switched_icplb; i < MAX_CPLBS; i++) {
331 icplb_tbl[i].data = 0; 338 icplb_tbl[cpu][i].data = 0;
332 bfin_write32(ICPLB_DATA0 + i * 4, 0); 339 bfin_write32(ICPLB_DATA0 + i * 4, 0);
333 } 340 }
334 enable_icplb(); 341 enable_icplb();
335 342
336 disable_dcplb(); 343 disable_dcplb();
337 for (i = first_switched_dcplb; i < MAX_CPLBS; i++) { 344 for (i = first_switched_dcplb; i < MAX_CPLBS; i++) {
338 dcplb_tbl[i].data = 0; 345 dcplb_tbl[cpu][i].data = 0;
339 bfin_write32(DCPLB_DATA0 + i * 4, 0); 346 bfin_write32(DCPLB_DATA0 + i * 4, 0);
340 } 347 }
341 enable_dcplb(); 348 enable_dcplb();
342 local_irq_restore(flags); 349 local_irq_restore_hw(flags);
343 350
344} 351}
345 352
346void set_mask_dcplbs(unsigned long *masks) 353void set_mask_dcplbs(unsigned long *masks, unsigned int cpu)
347{ 354{
348 int i; 355 int i;
349 unsigned long addr = (unsigned long)masks; 356 unsigned long addr = (unsigned long)masks;
@@ -351,12 +358,12 @@ void set_mask_dcplbs(unsigned long *masks)
351 unsigned long flags; 358 unsigned long flags;
352 359
353 if (!masks) { 360 if (!masks) {
354 current_rwx_mask = masks; 361 current_rwx_mask[cpu] = masks;
355 return; 362 return;
356 } 363 }
357 364
358 local_irq_save(flags); 365 local_irq_save_hw(flags);
359 current_rwx_mask = masks; 366 current_rwx_mask[cpu] = masks;
360 367
361 d_data = CPLB_SUPV_WR | CPLB_VALID | CPLB_DIRTY | PAGE_SIZE_4KB; 368 d_data = CPLB_SUPV_WR | CPLB_VALID | CPLB_DIRTY | PAGE_SIZE_4KB;
362#ifdef CONFIG_BFIN_DCACHE 369#ifdef CONFIG_BFIN_DCACHE
@@ -368,12 +375,12 @@ void set_mask_dcplbs(unsigned long *masks)
368 375
369 disable_dcplb(); 376 disable_dcplb();
370 for (i = first_mask_dcplb; i < first_switched_dcplb; i++) { 377 for (i = first_mask_dcplb; i < first_switched_dcplb; i++) {
371 dcplb_tbl[i].addr = addr; 378 dcplb_tbl[cpu][i].addr = addr;
372 dcplb_tbl[i].data = d_data; 379 dcplb_tbl[cpu][i].data = d_data;
373 bfin_write32(DCPLB_DATA0 + i * 4, d_data); 380 bfin_write32(DCPLB_DATA0 + i * 4, d_data);
374 bfin_write32(DCPLB_ADDR0 + i * 4, addr); 381 bfin_write32(DCPLB_ADDR0 + i * 4, addr);
375 addr += PAGE_SIZE; 382 addr += PAGE_SIZE;
376 } 383 }
377 enable_dcplb(); 384 enable_dcplb();
378 local_irq_restore(flags); 385 local_irq_restore_hw(flags);
379} 386}
diff --git a/arch/blackfin/kernel/cplb-nompu/Makefile b/arch/blackfin/kernel/cplb-nompu/Makefile
index d36ea9b5382e..7d70d3bf3212 100644
--- a/arch/blackfin/kernel/cplb-nompu/Makefile
+++ b/arch/blackfin/kernel/cplb-nompu/Makefile
@@ -2,7 +2,9 @@
2# arch/blackfin/kernel/cplb-nompu/Makefile 2# arch/blackfin/kernel/cplb-nompu/Makefile
3# 3#
4 4
5obj-y := cplbinit.o cacheinit.o cplbhdlr.o cplbmgr.o 5obj-y := cplbinit.o cacheinit.o cplbmgr.o
6
7obj-$(CONFIG_CPLB_INFO) += cplbinfo.o
8 6
7CFLAGS_cplbmgr.o := -ffixed-I0 -ffixed-I1 -ffixed-I2 -ffixed-I3 \
8 -ffixed-L0 -ffixed-L1 -ffixed-L2 -ffixed-L3 \
9 -ffixed-M0 -ffixed-M1 -ffixed-M2 -ffixed-M3 \
10 -ffixed-B0 -ffixed-B1 -ffixed-B2 -ffixed-B3
diff --git a/arch/blackfin/kernel/cplb-nompu/cacheinit.c b/arch/blackfin/kernel/cplb-nompu/cacheinit.c
index bd0831592c2c..c6ff947f9d37 100644
--- a/arch/blackfin/kernel/cplb-nompu/cacheinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cacheinit.c
@@ -25,19 +25,15 @@
25#include <asm/cplbinit.h> 25#include <asm/cplbinit.h>
26 26
27#if defined(CONFIG_BFIN_ICACHE) 27#if defined(CONFIG_BFIN_ICACHE)
28void __init bfin_icache_init(void) 28void __cpuinit bfin_icache_init(struct cplb_entry *icplb_tbl)
29{ 29{
30 unsigned long *table = icplb_table;
31 unsigned long ctrl; 30 unsigned long ctrl;
32 int i; 31 int i;
33 32
33 SSYNC();
34 for (i = 0; i < MAX_CPLBS; i++) { 34 for (i = 0; i < MAX_CPLBS; i++) {
35 unsigned long addr = *table++; 35 bfin_write32(ICPLB_ADDR0 + i * 4, icplb_tbl[i].addr);
36 unsigned long data = *table++; 36 bfin_write32(ICPLB_DATA0 + i * 4, icplb_tbl[i].data);
37 if (addr == (unsigned long)-1)
38 break;
39 bfin_write32(ICPLB_ADDR0 + i * 4, addr);
40 bfin_write32(ICPLB_DATA0 + i * 4, data);
41 } 37 }
42 ctrl = bfin_read_IMEM_CONTROL(); 38 ctrl = bfin_read_IMEM_CONTROL();
43 ctrl |= IMC | ENICPLB; 39 ctrl |= IMC | ENICPLB;
@@ -47,20 +43,17 @@ void __init bfin_icache_init(void)
47#endif 43#endif
48 44
49#if defined(CONFIG_BFIN_DCACHE) 45#if defined(CONFIG_BFIN_DCACHE)
50void __init bfin_dcache_init(void) 46void __cpuinit bfin_dcache_init(struct cplb_entry *dcplb_tbl)
51{ 47{
52 unsigned long *table = dcplb_table;
53 unsigned long ctrl; 48 unsigned long ctrl;
54 int i; 49 int i;
55 50
51 SSYNC();
56 for (i = 0; i < MAX_CPLBS; i++) { 52 for (i = 0; i < MAX_CPLBS; i++) {
57 unsigned long addr = *table++; 53 bfin_write32(DCPLB_ADDR0 + i * 4, dcplb_tbl[i].addr);
58 unsigned long data = *table++; 54 bfin_write32(DCPLB_DATA0 + i * 4, dcplb_tbl[i].data);
59 if (addr == (unsigned long)-1)
60 break;
61 bfin_write32(DCPLB_ADDR0 + i * 4, addr);
62 bfin_write32(DCPLB_DATA0 + i * 4, data);
63 } 55 }
56
64 ctrl = bfin_read_DMEM_CONTROL(); 57 ctrl = bfin_read_DMEM_CONTROL();
65 ctrl |= DMEM_CNTR; 58 ctrl |= DMEM_CNTR;
66 bfin_write_DMEM_CONTROL(ctrl); 59 bfin_write_DMEM_CONTROL(ctrl);
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbhdlr.S b/arch/blackfin/kernel/cplb-nompu/cplbhdlr.S
deleted file mode 100644
index ecbabc0a1fed..000000000000
--- a/arch/blackfin/kernel/cplb-nompu/cplbhdlr.S
+++ /dev/null
@@ -1,130 +0,0 @@
1/*
2 * File: arch/blackfin/mach-common/cplbhdlr.S
3 * Based on:
4 * Author: LG Soft India
5 *
6 * Created: ?
7 * Description: CPLB exception handler
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/linkage.h>
31#include <asm/cplb.h>
32#include <asm/entry.h>
33
34#ifdef CONFIG_EXCPT_IRQ_SYSC_L1
35.section .l1.text
36#else
37.text
38#endif
39
40.type _cplb_mgr, STT_FUNC;
41.type _panic_cplb_error, STT_FUNC;
42
43.align 2
44
45ENTRY(__cplb_hdr)
46 R2 = SEQSTAT;
47
48 /* Mask the contents of SEQSTAT and leave only EXCAUSE in R2 */
49 R2 <<= 26;
50 R2 >>= 26;
51
52 R1 = 0x23; /* Data access CPLB protection violation */
53 CC = R2 == R1;
54 IF !CC JUMP .Lnot_data_write;
55 R0 = 2; /* is a write to data space*/
56 JUMP .Lis_icplb_miss;
57
58.Lnot_data_write:
59 R1 = 0x2C; /* CPLB miss on an instruction fetch */
60 CC = R2 == R1;
61 R0 = 0; /* is_data_miss == False*/
62 IF CC JUMP .Lis_icplb_miss;
63
64 R1 = 0x26;
65 CC = R2 == R1;
66 IF !CC JUMP .Lunknown;
67
68 R0 = 1; /* is_data_miss == True*/
69
70.Lis_icplb_miss:
71
72#if defined(CONFIG_BFIN_ICACHE) || defined(CONFIG_BFIN_DCACHE)
73# if defined(CONFIG_BFIN_ICACHE) && !defined(CONFIG_BFIN_DCACHE)
74 R1 = CPLB_ENABLE_ICACHE;
75# endif
76# if !defined(CONFIG_BFIN_ICACHE) && defined(CONFIG_BFIN_DCACHE)
77 R1 = CPLB_ENABLE_DCACHE;
78# endif
79# if defined(CONFIG_BFIN_ICACHE) && defined(CONFIG_BFIN_DCACHE)
80 R1 = CPLB_ENABLE_DCACHE | CPLB_ENABLE_ICACHE;
81# endif
82#else
83 R1 = 0;
84#endif
85
86 [--SP] = RETS;
87 CALL _cplb_mgr;
88 RETS = [SP++];
89 CC = R0 == 0;
90 IF !CC JUMP .Lnot_replaced;
91 RTS;
92
93/*
94 * Diagnostic exception handlers
95 */
96.Lunknown:
97 R0 = CPLB_UNKNOWN_ERR;
98 JUMP .Lcplb_error;
99
100.Lnot_replaced:
101 CC = R0 == CPLB_NO_UNLOCKED;
102 IF !CC JUMP .Lnext_check;
103 R0 = CPLB_NO_UNLOCKED;
104 JUMP .Lcplb_error;
105
106.Lnext_check:
107 CC = R0 == CPLB_NO_ADDR_MATCH;
108 IF !CC JUMP .Lnext_check2;
109 R0 = CPLB_NO_ADDR_MATCH;
110 JUMP .Lcplb_error;
111
112.Lnext_check2:
113 CC = R0 == CPLB_PROT_VIOL;
114 IF !CC JUMP .Lstrange_return_from_cplb_mgr;
115 R0 = CPLB_PROT_VIOL;
116 JUMP .Lcplb_error;
117
118.Lstrange_return_from_cplb_mgr:
119 IDLE;
120 CSYNC;
121 JUMP .Lstrange_return_from_cplb_mgr;
122
123.Lcplb_error:
124 R1 = sp;
125 SP += -12;
126 call _panic_cplb_error;
127 SP += 12;
128 JUMP.L _handle_bad_cplb;
129
130ENDPROC(__cplb_hdr)
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinfo.c b/arch/blackfin/kernel/cplb-nompu/cplbinfo.c
deleted file mode 100644
index 1e74f0b97996..000000000000
--- a/arch/blackfin/kernel/cplb-nompu/cplbinfo.c
+++ /dev/null
@@ -1,195 +0,0 @@
1/*
2 * File: arch/blackfin/mach-common/cplbinfo.c
3 * Based on:
4 * Author: Sonic Zhang <sonic.zhang@analog.com>
5 *
6 * Created: Jan. 2005
7 * Description: Display CPLB status
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/module.h>
31#include <linux/kernel.h>
32#include <linux/init.h>
33#include <linux/proc_fs.h>
34#include <linux/uaccess.h>
35
36#include <asm/cplbinit.h>
37#include <asm/blackfin.h>
38
39#define CPLB_I 1
40#define CPLB_D 2
41
42#define SYNC_SYS SSYNC()
43#define SYNC_CORE CSYNC()
44
45#define CPLB_BIT_PAGESIZE 0x30000
46
47static int page_size_table[4] = {
48 0x00000400, /* 1K */
49 0x00001000, /* 4K */
50 0x00100000, /* 1M */
51 0x00400000 /* 4M */
52};
53
54static char page_size_string_table[][4] = { "1K", "4K", "1M", "4M" };
55
56static int cplb_find_entry(unsigned long *cplb_addr,
57 unsigned long *cplb_data, unsigned long addr,
58 unsigned long data)
59{
60 int ii;
61
62 for (ii = 0; ii < 16; ii++)
63 if (addr >= cplb_addr[ii] && addr < cplb_addr[ii] +
64 page_size_table[(cplb_data[ii] & CPLB_BIT_PAGESIZE) >> 16]
65 && (cplb_data[ii] == data))
66 return ii;
67
68 return -1;
69}
70
71static char *cplb_print_entry(char *buf, int type)
72{
73 unsigned long *p_addr = dpdt_table;
74 unsigned long *p_data = dpdt_table + 1;
75 unsigned long *p_icount = dpdt_swapcount_table;
76 unsigned long *p_ocount = dpdt_swapcount_table + 1;
77 unsigned long *cplb_addr = (unsigned long *)DCPLB_ADDR0;
78 unsigned long *cplb_data = (unsigned long *)DCPLB_DATA0;
79 int entry = 0, used_cplb = 0;
80
81 if (type == CPLB_I) {
82 buf += sprintf(buf, "Instruction CPLB entry:\n");
83 p_addr = ipdt_table;
84 p_data = ipdt_table + 1;
85 p_icount = ipdt_swapcount_table;
86 p_ocount = ipdt_swapcount_table + 1;
87 cplb_addr = (unsigned long *)ICPLB_ADDR0;
88 cplb_data = (unsigned long *)ICPLB_DATA0;
89 } else
90 buf += sprintf(buf, "Data CPLB entry:\n");
91
92 buf += sprintf(buf, "Address\t\tData\tSize\tValid\tLocked\tSwapin\tiCount\toCount\n");
93
94 while (*p_addr != 0xffffffff) {
95 entry = cplb_find_entry(cplb_addr, cplb_data, *p_addr, *p_data);
96 if (entry >= 0)
97 used_cplb |= 1 << entry;
98
99 buf +=
100 sprintf(buf,
101 "0x%08lx\t0x%05lx\t%s\t%c\t%c\t%2d\t%ld\t%ld\n",
102 *p_addr, *p_data,
103 page_size_string_table[(*p_data & 0x30000) >> 16],
104 (*p_data & CPLB_VALID) ? 'Y' : 'N',
105 (*p_data & CPLB_LOCK) ? 'Y' : 'N', entry, *p_icount,
106 *p_ocount);
107
108 p_addr += 2;
109 p_data += 2;
110 p_icount += 2;
111 p_ocount += 2;
112 }
113
114 if (used_cplb != 0xffff) {
115 buf += sprintf(buf, "Unused/mismatched CPLBs:\n");
116
117 for (entry = 0; entry < 16; entry++)
118 if (0 == ((1 << entry) & used_cplb)) {
119 int flags = cplb_data[entry];
120 buf +=
121 sprintf(buf,
122 "%2d: 0x%08lx\t0x%05x\t%s\t%c\t%c\n",
123 entry, cplb_addr[entry], flags,
124 page_size_string_table[(flags &
125 0x30000) >>
126 16],
127 (flags & CPLB_VALID) ? 'Y' : 'N',
128 (flags & CPLB_LOCK) ? 'Y' : 'N');
129 }
130 }
131
132 buf += sprintf(buf, "\n");
133
134 return buf;
135}
136
137static int cplbinfo_proc_output(char *buf)
138{
139 char *p;
140
141 p = buf;
142
143 p += sprintf(p, "------------------ CPLB Information ------------------\n\n");
144
145 if (bfin_read_IMEM_CONTROL() & ENICPLB)
146 p = cplb_print_entry(p, CPLB_I);
147 else
148 p += sprintf(p, "Instruction CPLB is disabled.\n\n");
149
150 if (bfin_read_DMEM_CONTROL() & ENDCPLB)
151 p = cplb_print_entry(p, CPLB_D);
152 else
153 p += sprintf(p, "Data CPLB is disabled.\n");
154
155 return p - buf;
156}
157
158static int cplbinfo_read_proc(char *page, char **start, off_t off,
159 int count, int *eof, void *data)
160{
161 int len;
162
163 len = cplbinfo_proc_output(page);
164 if (len <= off + count)
165 *eof = 1;
166 *start = page + off;
167 len -= off;
168 if (len > count)
169 len = count;
170 if (len < 0)
171 len = 0;
172 return len;
173}
174
175static int __init cplbinfo_init(void)
176{
177 struct proc_dir_entry *entry;
178
179 entry = create_proc_entry("cplbinfo", 0, NULL);
180 if (!entry)
181 return -ENOMEM;
182
183 entry->read_proc = cplbinfo_read_proc;
184 entry->data = NULL;
185
186 return 0;
187}
188
189static void __exit cplbinfo_exit(void)
190{
191 remove_proc_entry("cplbinfo", NULL);
192}
193
194module_init(cplbinfo_init);
195module_exit(cplbinfo_exit);
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
index 2debc900e246..0e28f7595733 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
@@ -20,445 +20,152 @@
20 * to the Free Software Foundation, Inc., 20 * to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */ 22 */
23
23#include <linux/module.h> 24#include <linux/module.h>
24 25
25#include <asm/blackfin.h> 26#include <asm/blackfin.h>
26#include <asm/cacheflush.h> 27#include <asm/cacheflush.h>
27#include <asm/cplb.h> 28#include <asm/cplb.h>
28#include <asm/cplbinit.h> 29#include <asm/cplbinit.h>
30#include <asm/mem_map.h>
29 31
30#define CPLB_MEM CONFIG_MAX_MEM_SIZE 32struct cplb_entry icplb_tbl[NR_CPUS][MAX_CPLBS] PDT_ATTR;
31 33struct cplb_entry dcplb_tbl[NR_CPUS][MAX_CPLBS] PDT_ATTR;
32/*
33* Number of required data CPLB switchtable entries
34* MEMSIZE / 4 (we mostly install 4M page size CPLBs
35* approx 16 for smaller 1MB page size CPLBs for allignment purposes
36* 1 for L1 Data Memory
37* possibly 1 for L2 Data Memory
38* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
39* 1 for ASYNC Memory
40*/
41#define MAX_SWITCH_D_CPLBS (((CPLB_MEM / 4) + 16 + 1 + 1 + 1 \
42 + ASYNC_MEMORY_CPLB_COVERAGE) * 2)
43
44/*
45* Number of required instruction CPLB switchtable entries
46* MEMSIZE / 4 (we mostly install 4M page size CPLBs
47* approx 12 for smaller 1MB page size CPLBs for allignment purposes
48* 1 for L1 Instruction Memory
49* possibly 1 for L2 Instruction Memory
50* 1 for CONFIG_DEBUG_HUNT_FOR_ZERO
51*/
52#define MAX_SWITCH_I_CPLBS (((CPLB_MEM / 4) + 12 + 1 + 1 + 1) * 2)
53
54
55u_long icplb_table[MAX_CPLBS + 1];
56u_long dcplb_table[MAX_CPLBS + 1];
57
58#ifdef CONFIG_CPLB_SWITCH_TAB_L1
59# define PDT_ATTR __attribute__((l1_data))
60#else
61# define PDT_ATTR
62#endif
63
64u_long ipdt_table[MAX_SWITCH_I_CPLBS + 1] PDT_ATTR;
65u_long dpdt_table[MAX_SWITCH_D_CPLBS + 1] PDT_ATTR;
66 34
67#ifdef CONFIG_CPLB_INFO 35int first_switched_icplb PDT_ATTR;
68u_long ipdt_swapcount_table[MAX_SWITCH_I_CPLBS] PDT_ATTR; 36int first_switched_dcplb PDT_ATTR;
69u_long dpdt_swapcount_table[MAX_SWITCH_D_CPLBS] PDT_ATTR;
70#endif
71 37
72struct s_cplb { 38struct cplb_boundary dcplb_bounds[9] PDT_ATTR;
73 struct cplb_tab init_i; 39struct cplb_boundary icplb_bounds[7] PDT_ATTR;
74 struct cplb_tab init_d;
75 struct cplb_tab switch_i;
76 struct cplb_tab switch_d;
77};
78 40
79#if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE) 41int icplb_nr_bounds PDT_ATTR;
80static struct cplb_desc cplb_data[] = { 42int dcplb_nr_bounds PDT_ATTR;
81 {
82 .start = 0,
83 .end = SIZE_1K,
84 .psize = SIZE_1K,
85 .attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB,
86 .i_conf = SDRAM_OOPS,
87 .d_conf = SDRAM_OOPS,
88#if defined(CONFIG_DEBUG_HUNT_FOR_ZERO)
89 .valid = 1,
90#else
91 .valid = 0,
92#endif
93 .name = "Zero Pointer Guard Page",
94 },
95 {
96 .start = L1_CODE_START,
97 .end = L1_CODE_START + L1_CODE_LENGTH,
98 .psize = SIZE_4M,
99 .attr = INITIAL_T | SWITCH_T | I_CPLB,
100 .i_conf = L1_IMEMORY,
101 .d_conf = 0,
102 .valid = 1,
103 .name = "L1 I-Memory",
104 },
105 {
106 .start = L1_DATA_A_START,
107 .end = L1_DATA_B_START + L1_DATA_B_LENGTH,
108 .psize = SIZE_4M,
109 .attr = INITIAL_T | SWITCH_T | D_CPLB,
110 .i_conf = 0,
111 .d_conf = L1_DMEMORY,
112#if ((L1_DATA_A_LENGTH > 0) || (L1_DATA_B_LENGTH > 0))
113 .valid = 1,
114#else
115 .valid = 0,
116#endif
117 .name = "L1 D-Memory",
118 },
119 {
120 .start = 0,
121 .end = 0, /* dynamic */
122 .psize = 0,
123 .attr = INITIAL_T | SWITCH_T | I_CPLB | D_CPLB,
124 .i_conf = SDRAM_IGENERIC,
125 .d_conf = SDRAM_DGENERIC,
126 .valid = 1,
127 .name = "Kernel Memory",
128 },
129 {
130 .start = 0, /* dynamic */
131 .end = 0, /* dynamic */
132 .psize = 0,
133 .attr = INITIAL_T | SWITCH_T | D_CPLB,
134 .i_conf = SDRAM_IGENERIC,
135 .d_conf = SDRAM_DNON_CHBL,
136 .valid = 1,
137 .name = "uClinux MTD Memory",
138 },
139 {
140 .start = 0, /* dynamic */
141 .end = 0, /* dynamic */
142 .psize = SIZE_1M,
143 .attr = INITIAL_T | SWITCH_T | D_CPLB,
144 .d_conf = SDRAM_DNON_CHBL,
145 .valid = 1,
146 .name = "Uncached DMA Zone",
147 },
148 {
149 .start = 0, /* dynamic */
150 .end = 0, /* dynamic */
151 .psize = 0,
152 .attr = SWITCH_T | D_CPLB,
153 .i_conf = 0, /* dynamic */
154 .d_conf = 0, /* dynamic */
155 .valid = 1,
156 .name = "Reserved Memory",
157 },
158 {
159 .start = ASYNC_BANK0_BASE,
160 .end = ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE,
161 .psize = 0,
162 .attr = SWITCH_T | D_CPLB,
163 .d_conf = SDRAM_EBIU,
164 .valid = 1,
165 .name = "Asynchronous Memory Banks",
166 },
167 {
168 .start = L2_START,
169 .end = L2_START + L2_LENGTH,
170 .psize = SIZE_1M,
171 .attr = SWITCH_T | I_CPLB | D_CPLB,
172 .i_conf = L2_IMEMORY,
173 .d_conf = L2_DMEMORY,
174 .valid = (L2_LENGTH > 0),
175 .name = "L2 Memory",
176 },
177 {
178 .start = BOOT_ROM_START,
179 .end = BOOT_ROM_START + BOOT_ROM_LENGTH,
180 .psize = SIZE_1M,
181 .attr = SWITCH_T | I_CPLB | D_CPLB,
182 .i_conf = SDRAM_IGENERIC,
183 .d_conf = SDRAM_DGENERIC,
184 .valid = 1,
185 .name = "On-Chip BootROM",
186 },
187};
188 43
189static u16 __init lock_kernel_check(u32 start, u32 end) 44void __init generate_cplb_tables_cpu(unsigned int cpu)
190{ 45{
191 if (start >= (u32)_end || end <= (u32)_stext) 46 int i_d, i_i;
192 return 0; 47 unsigned long addr;
193 48
194 /* This cplb block overlapped with kernel area. */ 49 struct cplb_entry *d_tbl = dcplb_tbl[cpu];
195 return IN_KERNEL; 50 struct cplb_entry *i_tbl = icplb_tbl[cpu];
196}
197 51
198static unsigned short __init 52 printk(KERN_INFO "NOMPU: setting up cplb tables\n");
199fill_cplbtab(struct cplb_tab *table,
200 unsigned long start, unsigned long end,
201 unsigned long block_size, unsigned long cplb_data)
202{
203 int i;
204 53
205 switch (block_size) { 54 i_d = i_i = 0;
206 case SIZE_4M:
207 i = 3;
208 break;
209 case SIZE_1M:
210 i = 2;
211 break;
212 case SIZE_4K:
213 i = 1;
214 break;
215 case SIZE_1K:
216 default:
217 i = 0;
218 break;
219 }
220
221 cplb_data = (cplb_data & ~(3 << 16)) | (i << 16);
222
223 while ((start < end) && (table->pos < table->size)) {
224 55
225 table->tab[table->pos++] = start; 56 /* Set up the zero page. */
57 d_tbl[i_d].addr = 0;
58 d_tbl[i_d++].data = SDRAM_OOPS | PAGE_SIZE_1KB;
226 59
227 if (lock_kernel_check(start, start + block_size) == IN_KERNEL) 60 /* Cover kernel memory with 4M pages. */
228 table->tab[table->pos++] = 61 addr = 0;
229 cplb_data | CPLB_LOCK | CPLB_DIRTY;
230 else
231 table->tab[table->pos++] = cplb_data;
232 62
233 start += block_size; 63 for (; addr < memory_start; addr += 4 * 1024 * 1024) {
64 d_tbl[i_d].addr = addr;
65 d_tbl[i_d++].data = SDRAM_DGENERIC | PAGE_SIZE_4MB;
66 i_tbl[i_i].addr = addr;
67 i_tbl[i_i++].data = SDRAM_IGENERIC | PAGE_SIZE_4MB;
234 } 68 }
235 return 0;
236}
237 69
238static unsigned short __init 70 /* Cover L1 memory. One 4M area for code and data each is enough. */
239close_cplbtab(struct cplb_tab *table) 71 if (L1_DATA_A_LENGTH || L1_DATA_B_LENGTH) {
240{ 72 d_tbl[i_d].addr = L1_DATA_A_START;
241 73 d_tbl[i_d++].data = L1_DMEMORY | PAGE_SIZE_4MB;
242 while (table->pos < table->size) {
243
244 table->tab[table->pos++] = 0;
245 table->tab[table->pos++] = 0; /* !CPLB_VALID */
246 } 74 }
247 return 0; 75 i_tbl[i_i].addr = L1_CODE_START;
248} 76 i_tbl[i_i++].data = L1_IMEMORY | PAGE_SIZE_4MB;
249 77
250/* helper function */ 78 first_switched_dcplb = i_d;
251static void __init 79 first_switched_icplb = i_i;
252__fill_code_cplbtab(struct cplb_tab *t, int i, u32 a_start, u32 a_end)
253{
254 if (cplb_data[i].psize) {
255 fill_cplbtab(t,
256 cplb_data[i].start,
257 cplb_data[i].end,
258 cplb_data[i].psize,
259 cplb_data[i].i_conf);
260 } else {
261#if defined(CONFIG_BFIN_ICACHE)
262 if (ANOMALY_05000263 && i == SDRAM_KERN) {
263 fill_cplbtab(t,
264 cplb_data[i].start,
265 cplb_data[i].end,
266 SIZE_4M,
267 cplb_data[i].i_conf);
268 } else
269#endif
270 {
271 fill_cplbtab(t,
272 cplb_data[i].start,
273 a_start,
274 SIZE_1M,
275 cplb_data[i].i_conf);
276 fill_cplbtab(t,
277 a_start,
278 a_end,
279 SIZE_4M,
280 cplb_data[i].i_conf);
281 fill_cplbtab(t, a_end,
282 cplb_data[i].end,
283 SIZE_1M,
284 cplb_data[i].i_conf);
285 }
286 }
287}
288 80
289static void __init 81 BUG_ON(first_switched_dcplb > MAX_CPLBS);
290__fill_data_cplbtab(struct cplb_tab *t, int i, u32 a_start, u32 a_end) 82 BUG_ON(first_switched_icplb > MAX_CPLBS);
291{ 83
292 if (cplb_data[i].psize) { 84 while (i_d < MAX_CPLBS)
293 fill_cplbtab(t, 85 d_tbl[i_d++].data = 0;
294 cplb_data[i].start, 86 while (i_i < MAX_CPLBS)
295 cplb_data[i].end, 87 i_tbl[i_i++].data = 0;
296 cplb_data[i].psize,
297 cplb_data[i].d_conf);
298 } else {
299 fill_cplbtab(t,
300 cplb_data[i].start,
301 a_start, SIZE_1M,
302 cplb_data[i].d_conf);
303 fill_cplbtab(t, a_start,
304 a_end, SIZE_4M,
305 cplb_data[i].d_conf);
306 fill_cplbtab(t, a_end,
307 cplb_data[i].end,
308 SIZE_1M,
309 cplb_data[i].d_conf);
310 }
311} 88}
312 89
313void __init generate_cplb_tables(void) 90void __init generate_cplb_tables_all(void)
314{ 91{
92 int i_d, i_i;
315 93
316 u16 i, j, process; 94 i_d = 0;
317 u32 a_start, a_end, as, ae, as_1m; 95 /* Normal RAM, including MTD FS. */
318
319 struct cplb_tab *t_i = NULL;
320 struct cplb_tab *t_d = NULL;
321 struct s_cplb cplb;
322
323 printk(KERN_INFO "NOMPU: setting up cplb tables for global access\n");
324
325 cplb.init_i.size = MAX_CPLBS;
326 cplb.init_d.size = MAX_CPLBS;
327 cplb.switch_i.size = MAX_SWITCH_I_CPLBS;
328 cplb.switch_d.size = MAX_SWITCH_D_CPLBS;
329
330 cplb.init_i.pos = 0;
331 cplb.init_d.pos = 0;
332 cplb.switch_i.pos = 0;
333 cplb.switch_d.pos = 0;
334
335 cplb.init_i.tab = icplb_table;
336 cplb.init_d.tab = dcplb_table;
337 cplb.switch_i.tab = ipdt_table;
338 cplb.switch_d.tab = dpdt_table;
339
340 cplb_data[SDRAM_KERN].end = memory_end;
341
342#ifdef CONFIG_MTD_UCLINUX 96#ifdef CONFIG_MTD_UCLINUX
343 cplb_data[SDRAM_RAM_MTD].start = memory_mtd_start; 97 dcplb_bounds[i_d].eaddr = memory_mtd_start + mtd_size;
344 cplb_data[SDRAM_RAM_MTD].end = memory_mtd_start + mtd_size;
345 cplb_data[SDRAM_RAM_MTD].valid = mtd_size > 0;
346# if defined(CONFIG_ROMFS_FS)
347 cplb_data[SDRAM_RAM_MTD].attr |= I_CPLB;
348
349 /*
350 * The ROMFS_FS size is often not multiple of 1MB.
351 * This can cause multiple CPLB sets covering the same memory area.
352 * This will then cause multiple CPLB hit exceptions.
353 * Workaround: We ensure a contiguous memory area by extending the kernel
354 * memory section over the mtd section.
355 * For ROMFS_FS memory must be covered with ICPLBs anyways.
356 * So there is no difference between kernel and mtd memory setup.
357 */
358
359 cplb_data[SDRAM_KERN].end = memory_mtd_start + mtd_size;;
360 cplb_data[SDRAM_RAM_MTD].valid = 0;
361
362# endif
363#else 98#else
364 cplb_data[SDRAM_RAM_MTD].valid = 0; 99 dcplb_bounds[i_d].eaddr = memory_end;
365#endif 100#endif
101 dcplb_bounds[i_d++].data = SDRAM_DGENERIC;
102 /* DMA uncached region. */
103 if (DMA_UNCACHED_REGION) {
104 dcplb_bounds[i_d].eaddr = _ramend;
105 dcplb_bounds[i_d++].data = SDRAM_DNON_CHBL;
106 }
107 if (_ramend != physical_mem_end) {
108 /* Reserved memory. */
109 dcplb_bounds[i_d].eaddr = physical_mem_end;
110 dcplb_bounds[i_d++].data = (reserved_mem_dcache_on ?
111 SDRAM_DGENERIC : SDRAM_DNON_CHBL);
112 }
113 /* Addressing hole up to the async bank. */
114 dcplb_bounds[i_d].eaddr = ASYNC_BANK0_BASE;
115 dcplb_bounds[i_d++].data = 0;
116 /* ASYNC banks. */
117 dcplb_bounds[i_d].eaddr = ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE;
118 dcplb_bounds[i_d++].data = SDRAM_EBIU;
119 /* Addressing hole up to BootROM. */
120 dcplb_bounds[i_d].eaddr = BOOT_ROM_START;
121 dcplb_bounds[i_d++].data = 0;
122 /* BootROM -- largest one should be less than 1 meg. */
123 dcplb_bounds[i_d].eaddr = BOOT_ROM_START + (1 * 1024 * 1024);
124 dcplb_bounds[i_d++].data = SDRAM_DGENERIC;
125 if (L2_LENGTH) {
126 /* Addressing hole up to L2 SRAM. */
127 dcplb_bounds[i_d].eaddr = L2_START;
128 dcplb_bounds[i_d++].data = 0;
129 /* L2 SRAM. */
130 dcplb_bounds[i_d].eaddr = L2_START + L2_LENGTH;
131 dcplb_bounds[i_d++].data = L2_DMEMORY;
132 }
133 dcplb_nr_bounds = i_d;
134 BUG_ON(dcplb_nr_bounds > ARRAY_SIZE(dcplb_bounds));
366 135
367 cplb_data[SDRAM_DMAZ].start = _ramend - DMA_UNCACHED_REGION; 136 i_i = 0;
368 cplb_data[SDRAM_DMAZ].end = _ramend; 137 /* Normal RAM, including MTD FS. */
369
370 cplb_data[RES_MEM].start = _ramend;
371 cplb_data[RES_MEM].end = physical_mem_end;
372
373 if (reserved_mem_dcache_on)
374 cplb_data[RES_MEM].d_conf = SDRAM_DGENERIC;
375 else
376 cplb_data[RES_MEM].d_conf = SDRAM_DNON_CHBL;
377
378 if (reserved_mem_icache_on)
379 cplb_data[RES_MEM].i_conf = SDRAM_IGENERIC;
380 else
381 cplb_data[RES_MEM].i_conf = SDRAM_INON_CHBL;
382
383 for (i = ZERO_P; i < ARRAY_SIZE(cplb_data); ++i) {
384 if (!cplb_data[i].valid)
385 continue;
386
387 as_1m = cplb_data[i].start % SIZE_1M;
388
389 /* We need to make sure all sections are properly 1M aligned
390 * However between Kernel Memory and the Kernel mtd section, depending on the
391 * rootfs size, there can be overlapping memory areas.
392 */
393
394 if (as_1m && i != L1I_MEM && i != L1D_MEM) {
395#ifdef CONFIG_MTD_UCLINUX 138#ifdef CONFIG_MTD_UCLINUX
396 if (i == SDRAM_RAM_MTD) { 139 icplb_bounds[i_i].eaddr = memory_mtd_start + mtd_size;
397 if ((cplb_data[SDRAM_KERN].end + 1) > cplb_data[SDRAM_RAM_MTD].start) 140#else
398 cplb_data[SDRAM_RAM_MTD].start = (cplb_data[i].start & (-2*SIZE_1M)) + SIZE_1M; 141 icplb_bounds[i_i].eaddr = memory_end;
399 else
400 cplb_data[SDRAM_RAM_MTD].start = (cplb_data[i].start & (-2*SIZE_1M));
401 } else
402#endif 142#endif
403 printk(KERN_WARNING "Unaligned Start of %s at 0x%X\n", 143 icplb_bounds[i_i++].data = SDRAM_IGENERIC;
404 cplb_data[i].name, cplb_data[i].start); 144 /* DMA uncached region. */
405 } 145 if (DMA_UNCACHED_REGION) {
406 146 icplb_bounds[i_i].eaddr = _ramend;
407 as = cplb_data[i].start % SIZE_4M; 147 icplb_bounds[i_i++].data = 0;
408 ae = cplb_data[i].end % SIZE_4M;
409
410 if (as)
411 a_start = cplb_data[i].start + (SIZE_4M - (as));
412 else
413 a_start = cplb_data[i].start;
414
415 a_end = cplb_data[i].end - ae;
416
417 for (j = INITIAL_T; j <= SWITCH_T; j++) {
418
419 switch (j) {
420 case INITIAL_T:
421 if (cplb_data[i].attr & INITIAL_T) {
422 t_i = &cplb.init_i;
423 t_d = &cplb.init_d;
424 process = 1;
425 } else
426 process = 0;
427 break;
428 case SWITCH_T:
429 if (cplb_data[i].attr & SWITCH_T) {
430 t_i = &cplb.switch_i;
431 t_d = &cplb.switch_d;
432 process = 1;
433 } else
434 process = 0;
435 break;
436 default:
437 process = 0;
438 break;
439 }
440
441 if (!process)
442 continue;
443 if (cplb_data[i].attr & I_CPLB)
444 __fill_code_cplbtab(t_i, i, a_start, a_end);
445
446 if (cplb_data[i].attr & D_CPLB)
447 __fill_data_cplbtab(t_d, i, a_start, a_end);
448 }
449 } 148 }
450 149 if (_ramend != physical_mem_end) {
451/* close tables */ 150 /* Reserved memory. */
452 151 icplb_bounds[i_i].eaddr = physical_mem_end;
453 close_cplbtab(&cplb.init_i); 152 icplb_bounds[i_i++].data = (reserved_mem_icache_on ?
454 close_cplbtab(&cplb.init_d); 153 SDRAM_IGENERIC : SDRAM_INON_CHBL);
455 154 }
456 cplb.init_i.tab[cplb.init_i.pos] = -1; 155 /* Addressing hole up to BootROM. */
457 cplb.init_d.tab[cplb.init_d.pos] = -1; 156 icplb_bounds[i_i].eaddr = BOOT_ROM_START;
458 cplb.switch_i.tab[cplb.switch_i.pos] = -1; 157 icplb_bounds[i_i++].data = 0;
459 cplb.switch_d.tab[cplb.switch_d.pos] = -1; 158 /* BootROM -- largest one should be less than 1 meg. */
460 159 icplb_bounds[i_i].eaddr = BOOT_ROM_START + (1 * 1024 * 1024);
160 icplb_bounds[i_i++].data = SDRAM_IGENERIC;
161 if (L2_LENGTH) {
162 /* Addressing hole up to L2 SRAM, including the async bank. */
163 icplb_bounds[i_i].eaddr = L2_START;
164 icplb_bounds[i_i++].data = 0;
165 /* L2 SRAM. */
166 icplb_bounds[i_i].eaddr = L2_START + L2_LENGTH;
167 icplb_bounds[i_i++].data = L2_IMEMORY;
168 }
169 icplb_nr_bounds = i_i;
170 BUG_ON(icplb_nr_bounds > ARRAY_SIZE(icplb_bounds));
461} 171}
462
463#endif
464
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbmgr.S b/arch/blackfin/kernel/cplb-nompu/cplbmgr.S
deleted file mode 100644
index f5cf3accef37..000000000000
--- a/arch/blackfin/kernel/cplb-nompu/cplbmgr.S
+++ /dev/null
@@ -1,646 +0,0 @@
1/*
2 * File: arch/blackfin/mach-common/cplbmgtr.S
3 * Based on:
4 * Author: LG Soft India
5 *
6 * Created: ?
7 * Description: CPLB replacement routine for CPLB mismatch
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30/* Usage: int _cplb_mgr(is_data_miss,int enable_cache)
31 * is_data_miss==2 => Mark as Dirty, write to the clean data page
32 * is_data_miss==1 => Replace a data CPLB.
33 * is_data_miss==0 => Replace an instruction CPLB.
34 *
35 * Returns:
36 * CPLB_RELOADED => Successfully updated CPLB table.
37 * CPLB_NO_UNLOCKED => All CPLBs are locked, so cannot be evicted.
38 * This indicates that the CPLBs in the configuration
39 * tablei are badly configured, as this should never
40 * occur.
41 * CPLB_NO_ADDR_MATCH => The address being accessed, that triggered the
42 * exception, is not covered by any of the CPLBs in
43 * the configuration table. The application is
44 * presumably misbehaving.
45 * CPLB_PROT_VIOL => The address being accessed, that triggered the
46 * exception, was not a first-write to a clean Write
47 * Back Data page, and so presumably is a genuine
48 * violation of the page's protection attributes.
49 * The application is misbehaving.
50 */
51
52#include <linux/linkage.h>
53#include <asm/blackfin.h>
54#include <asm/cplb.h>
55
56#ifdef CONFIG_EXCPT_IRQ_SYSC_L1
57.section .l1.text
58#else
59.text
60#endif
61
62.align 2;
63ENTRY(_cplb_mgr)
64
65 [--SP]=( R7:4,P5:3 );
66
67 CC = R0 == 2;
68 IF CC JUMP .Ldcplb_write;
69
70 CC = R0 == 0;
71 IF !CC JUMP .Ldcplb_miss_compare;
72
73 /* ICPLB Miss Exception. We need to choose one of the
74 * currently-installed CPLBs, and replace it with one
75 * from the configuration table.
76 */
77
78 /* A multi-word instruction can cross a page boundary. This means the
79 * first part of the instruction can be in a valid page, but the
80 * second part is not, and hence generates the instruction miss.
81 * However, the fault address is for the start of the instruction,
82 * not the part that's in the bad page. Therefore, we have to check
83 * whether the fault address applies to a page that is already present
84 * in the table.
85 */
86
87 P4.L = LO(ICPLB_FAULT_ADDR);
88 P4.H = HI(ICPLB_FAULT_ADDR);
89
90 P1 = 16;
91 P5.L = _page_size_table;
92 P5.H = _page_size_table;
93
94 P0.L = LO(ICPLB_DATA0);
95 P0.H = HI(ICPLB_DATA0);
96 R4 = [P4]; /* Get faulting address*/
97 R6 = 64; /* Advance past the fault address, which*/
98 R6 = R6 + R4; /* we'll use if we find a match*/
99 R3 = ((16 << 8) | 2); /* Extract mask, two bits at posn 16 */
100
101 R5 = 0;
102.Lisearch:
103
104 R1 = [P0-0x100]; /* Address for this CPLB */
105
106 R0 = [P0++]; /* Info for this CPLB*/
107 CC = BITTST(R0,0); /* Is the CPLB valid?*/
108 IF !CC JUMP .Lnomatch; /* Skip it, if not.*/
109 CC = R4 < R1(IU); /* If fault address less than page start*/
110 IF CC JUMP .Lnomatch; /* then skip this one.*/
111 R2 = EXTRACT(R0,R3.L) (Z); /* Get page size*/
112 P1 = R2;
113 P1 = P5 + (P1<<2); /* index into page-size table*/
114 R2 = [P1]; /* Get the page size*/
115 R1 = R1 + R2; /* and add to page start, to get page end*/
116 CC = R4 < R1(IU); /* and see whether fault addr is in page.*/
117 IF !CC R4 = R6; /* If so, advance the address and finish loop.*/
118 IF !CC JUMP .Lisearch_done;
119.Lnomatch:
120 /* Go around again*/
121 R5 += 1;
122 CC = BITTST(R5, 4); /* i.e CC = R5 >= 16*/
123 IF !CC JUMP .Lisearch;
124
125.Lisearch_done:
126 I0 = R4; /* Fault address we'll search for*/
127
128 /* set up pointers */
129 P0.L = LO(ICPLB_DATA0);
130 P0.H = HI(ICPLB_DATA0);
131
132 /* The replacement procedure for ICPLBs */
133
134 P4.L = LO(IMEM_CONTROL);
135 P4.H = HI(IMEM_CONTROL);
136
137 /* Turn off CPLBs while we work, necessary according to HRM before
138 * modifying CPLB descriptors
139 */
140 R5 = [P4]; /* Control Register*/
141 BITCLR(R5,ENICPLB_P);
142 CLI R1;
143 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
144 .align 8;
145 [P4] = R5;
146 SSYNC;
147 STI R1;
148
149 R1 = -1; /* end point comparison */
150 R3 = 16; /* counter */
151
152 /* Search through CPLBs for first non-locked entry */
153 /* Overwrite it by moving everyone else up by 1 */
154.Licheck_lock:
155 R0 = [P0++];
156 R3 = R3 + R1;
157 CC = R3 == R1;
158 IF CC JUMP .Lall_locked;
159 CC = BITTST(R0, 0); /* an invalid entry is good */
160 IF !CC JUMP .Lifound_victim;
161 CC = BITTST(R0,1); /* but a locked entry isn't */
162 IF CC JUMP .Licheck_lock;
163
164.Lifound_victim:
165#ifdef CONFIG_CPLB_INFO
166 R7 = [P0 - 0x104];
167 P2.L = _ipdt_table;
168 P2.H = _ipdt_table;
169 P3.L = _ipdt_swapcount_table;
170 P3.H = _ipdt_swapcount_table;
171 P3 += -4;
172.Licount:
173 R2 = [P2]; /* address from config table */
174 P2 += 8;
175 P3 += 8;
176 CC = R2==-1;
177 IF CC JUMP .Licount_done;
178 CC = R7==R2;
179 IF !CC JUMP .Licount;
180 R7 = [P3];
181 R7 += 1;
182 [P3] = R7;
183 CSYNC;
184.Licount_done:
185#endif
186 LC0=R3;
187 LSETUP(.Lis_move,.Lie_move) LC0;
188.Lis_move:
189 R0 = [P0];
190 [P0 - 4] = R0;
191 R0 = [P0 - 0x100];
192 [P0-0x104] = R0;
193.Lie_move:
194 P0+=4;
195
196 /* Clear ICPLB_DATA15, in case we don't find a replacement
197 * otherwise, we would have a duplicate entry, and will crash
198 */
199 R0 = 0;
200 [P0 - 4] = R0;
201
202 /* We've made space in the ICPLB table, so that ICPLB15
203 * is now free to be overwritten. Next, we have to determine
204 * which CPLB we need to install, from the configuration
205 * table. This is a matter of getting the start-of-page
206 * addresses and page-lengths from the config table, and
207 * determining whether the fault address falls within that
208 * range.
209 */
210
211 P2.L = _ipdt_table;
212 P2.H = _ipdt_table;
213#ifdef CONFIG_CPLB_INFO
214 P3.L = _ipdt_swapcount_table;
215 P3.H = _ipdt_swapcount_table;
216 P3 += -8;
217#endif
218 P0.L = _page_size_table;
219 P0.H = _page_size_table;
220
221 /* Retrieve our fault address (which may have been advanced
222 * because the faulting instruction crossed a page boundary).
223 */
224
225 R0 = I0;
226
227 /* An extraction pattern, to get the page-size bits from
228 * the CPLB data entry. Bits 16-17, so two bits at posn 16.
229 */
230
231 R1 = ((16<<8)|2);
232.Linext: R4 = [P2++]; /* address from config table */
233 R2 = [P2++]; /* data from config table */
234#ifdef CONFIG_CPLB_INFO
235 P3 += 8;
236#endif
237
238 CC = R4 == -1; /* End of config table*/
239 IF CC JUMP .Lno_page_in_table;
240
241 /* See if failed address > start address */
242 CC = R4 <= R0(IU);
243 IF !CC JUMP .Linext;
244
245 /* extract page size (17:16)*/
246 R3 = EXTRACT(R2, R1.L) (Z);
247
248 /* add page size to addr to get range */
249
250 P5 = R3;
251 P5 = P0 + (P5 << 2); /* scaled, for int access*/
252 R3 = [P5];
253 R3 = R3 + R4;
254
255 /* See if failed address < (start address + page size) */
256 CC = R0 < R3(IU);
257 IF !CC JUMP .Linext;
258
259 /* We've found a CPLB in the config table that covers
260 * the faulting address, so install this CPLB into the
261 * last entry of the table.
262 */
263
264 P1.L = LO(ICPLB_DATA15); /* ICPLB_DATA15 */
265 P1.H = HI(ICPLB_DATA15);
266 [P1] = R2;
267 [P1-0x100] = R4;
268#ifdef CONFIG_CPLB_INFO
269 R3 = [P3];
270 R3 += 1;
271 [P3] = R3;
272#endif
273
274 /* P4 points to IMEM_CONTROL, and R5 contains its old
275 * value, after we disabled ICPLBS. Re-enable them.
276 */
277
278 BITSET(R5,ENICPLB_P);
279 CLI R2;
280 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
281 .align 8;
282 [P4] = R5;
283 SSYNC;
284 STI R2;
285
286 ( R7:4,P5:3 ) = [SP++];
287 R0 = CPLB_RELOADED;
288 RTS;
289
290/* FAILED CASES*/
291.Lno_page_in_table:
292 R0 = CPLB_NO_ADDR_MATCH;
293 JUMP .Lfail_ret;
294
295.Lall_locked:
296 R0 = CPLB_NO_UNLOCKED;
297 JUMP .Lfail_ret;
298
299.Lprot_violation:
300 R0 = CPLB_PROT_VIOL;
301
302.Lfail_ret:
303 /* Make sure we turn protection/cache back on, even in the failing case */
304 BITSET(R5,ENICPLB_P);
305 CLI R2;
306 SSYNC; /* SSYNC required before writing to IMEM_CONTROL. */
307 .align 8;
308 [P4] = R5;
309 SSYNC;
310 STI R2;
311
312 ( R7:4,P5:3 ) = [SP++];
313 RTS;
314
315.Ldcplb_write:
316
317 /* if a DCPLB is marked as write-back (CPLB_WT==0), and
318 * it is clean (CPLB_DIRTY==0), then a write to the
319 * CPLB's page triggers a protection violation. We have to
320 * mark the CPLB as dirty, to indicate that there are
321 * pending writes associated with the CPLB.
322 */
323
324 P4.L = LO(DCPLB_STATUS);
325 P4.H = HI(DCPLB_STATUS);
326 P3.L = LO(DCPLB_DATA0);
327 P3.H = HI(DCPLB_DATA0);
328 R5 = [P4];
329
330 /* A protection violation can be caused by more than just writes
331 * to a clean WB page, so we have to ensure that:
332 * - It's a write
333 * - to a clean WB page
334 * - and is allowed in the mode the access occurred.
335 */
336
337 CC = BITTST(R5, 16); /* ensure it was a write*/
338 IF !CC JUMP .Lprot_violation;
339
340 /* to check the rest, we have to retrieve the DCPLB.*/
341
342 /* The low half of DCPLB_STATUS is a bit mask*/
343
344 R2 = R5.L (Z); /* indicating which CPLB triggered the event.*/
345 R3 = 30; /* so we can use this to determine the offset*/
346 R2.L = SIGNBITS R2;
347 R2 = R2.L (Z); /* into the DCPLB table.*/
348 R3 = R3 - R2;
349 P4 = R3;
350 P3 = P3 + (P4<<2);
351 R3 = [P3]; /* Retrieve the CPLB*/
352
353 /* Now we can check whether it's a clean WB page*/
354
355 CC = BITTST(R3, 14); /* 0==WB, 1==WT*/
356 IF CC JUMP .Lprot_violation;
357 CC = BITTST(R3, 7); /* 0 == clean, 1 == dirty*/
358 IF CC JUMP .Lprot_violation;
359
360 /* Check whether the write is allowed in the mode that was active.*/
361
362 R2 = 1<<3; /* checking write in user mode*/
363 CC = BITTST(R5, 17); /* 0==was user, 1==was super*/
364 R5 = CC;
365 R2 <<= R5; /* if was super, check write in super mode*/
366 R2 = R3 & R2;
367 CC = R2 == 0;
368 IF CC JUMP .Lprot_violation;
369
370 /* It's a genuine write-to-clean-page.*/
371
372 BITSET(R3, 7); /* mark as dirty*/
373 [P3] = R3; /* and write back.*/
374 NOP;
375 CSYNC;
376 ( R7:4,P5:3 ) = [SP++];
377 R0 = CPLB_RELOADED;
378 RTS;
379
380.Ldcplb_miss_compare:
381
382 /* Data CPLB Miss event. We need to choose a CPLB to
383 * evict, and then locate a new CPLB to install from the
384 * config table, that covers the faulting address.
385 */
386
387 P1.L = LO(DCPLB_DATA15);
388 P1.H = HI(DCPLB_DATA15);
389
390 P4.L = LO(DCPLB_FAULT_ADDR);
391 P4.H = HI(DCPLB_FAULT_ADDR);
392 R4 = [P4];
393 I0 = R4;
394
395 /* The replacement procedure for DCPLBs*/
396
397 R6 = R1; /* Save for later*/
398
399 /* Turn off CPLBs while we work.*/
400 P4.L = LO(DMEM_CONTROL);
401 P4.H = HI(DMEM_CONTROL);
402 R5 = [P4];
403 BITCLR(R5,ENDCPLB_P);
404 CLI R0;
405 SSYNC; /* SSYNC required before writing to DMEM_CONTROL. */
406 .align 8;
407 [P4] = R5;
408 SSYNC;
409 STI R0;
410
411 /* Start looking for a CPLB to evict. Our order of preference
412 * is: invalid CPLBs, clean CPLBs, dirty CPLBs. Locked CPLBs
413 * are no good.
414 */
415
416 I1.L = LO(DCPLB_DATA0);
417 I1.H = HI(DCPLB_DATA0);
418 P1 = 2;
419 P2 = 16;
420 I2.L = _dcplb_preference;
421 I2.H = _dcplb_preference;
422 LSETUP(.Lsdsearch1, .Ledsearch1) LC0 = P1;
423.Lsdsearch1:
424 R0 = [I2++]; /* Get the bits we're interested in*/
425 P0 = I1; /* Go back to start of table*/
426 LSETUP (.Lsdsearch2, .Ledsearch2) LC1 = P2;
427.Lsdsearch2:
428 R1 = [P0++]; /* Fetch each installed CPLB in turn*/
429 R2 = R1 & R0; /* and test for interesting bits.*/
430 CC = R2 == 0; /* If none are set, it'll do.*/
431 IF !CC JUMP .Lskip_stack_check;
432
433 R2 = [P0 - 0x104]; /* R2 - PageStart */
434 P3.L = _page_size_table; /* retrieve end address */
435 P3.H = _page_size_table; /* retrieve end address */
436 R3 = 0x1002; /* 16th - position, 2 bits -length */
437#if ANOMALY_05000209
438 nop; /* Anomaly 05000209 */
439#endif
440 R7 = EXTRACT(R1,R3.l);
441 R7 = R7 << 2; /* Page size index offset */
442 P5 = R7;
443 P3 = P3 + P5;
444 R7 = [P3]; /* page size in bytes */
445
446 R7 = R2 + R7; /* R7 - PageEnd */
447 R4 = SP; /* Test SP is in range */
448
449 CC = R7 < R4; /* if PageEnd < SP */
450 IF CC JUMP .Ldfound_victim;
451 R3 = 0x284; /* stack length from start of trap till
452 * the point.
453 * 20 stack locations for future modifications
454 */
455 R4 = R4 + R3;
456 CC = R4 < R2; /* if SP + stacklen < PageStart */
457 IF CC JUMP .Ldfound_victim;
458.Lskip_stack_check:
459
460.Ledsearch2: NOP;
461.Ledsearch1: NOP;
462
463 /* If we got here, we didn't find a DCPLB we considered
464 * replacable, which means all of them were locked.
465 */
466
467 JUMP .Lall_locked;
468.Ldfound_victim:
469
470#ifdef CONFIG_CPLB_INFO
471 R7 = [P0 - 0x104];
472 P2.L = _dpdt_table;
473 P2.H = _dpdt_table;
474 P3.L = _dpdt_swapcount_table;
475 P3.H = _dpdt_swapcount_table;
476 P3 += -4;
477.Ldicount:
478 R2 = [P2];
479 P2 += 8;
480 P3 += 8;
481 CC = R2==-1;
482 IF CC JUMP .Ldicount_done;
483 CC = R7==R2;
484 IF !CC JUMP .Ldicount;
485 R7 = [P3];
486 R7 += 1;
487 [P3] = R7;
488.Ldicount_done:
489#endif
490
491 /* Clean down the hardware loops*/
492 R2 = 0;
493 LC1 = R2;
494 LC0 = R2;
495
496 /* There's a suitable victim in [P0-4] (because we've
497 * advanced already).
498 */
499
500.LDdoverwrite:
501
502 /* [P0-4] is a suitable victim CPLB, so we want to
503 * overwrite it by moving all the following CPLBs
504 * one space closer to the start.
505 */
506
507 R1.L = LO(DCPLB_DATA16); /* DCPLB_DATA15 + 4 */
508 R1.H = HI(DCPLB_DATA16);
509 R0 = P0;
510
511 /* If the victim happens to be in DCPLB15,
512 * we don't need to move anything.
513 */
514
515 CC = R1 == R0;
516 IF CC JUMP .Lde_moved;
517 R1 = R1 - R0;
518 R1 >>= 2;
519 P1 = R1;
520 LSETUP(.Lds_move, .Lde_move) LC0=P1;
521.Lds_move:
522 R0 = [P0++]; /* move data */
523 [P0 - 8] = R0;
524 R0 = [P0-0x104] /* move address */
525.Lde_move:
526 [P0-0x108] = R0;
527
528.Lde_moved:
529 NOP;
530
531 /* Clear DCPLB_DATA15, in case we don't find a replacement
532 * otherwise, we would have a duplicate entry, and will crash
533 */
534 R0 = 0;
535 [P0 - 0x4] = R0;
536
537 /* We've now made space in DCPLB15 for the new CPLB to be
538 * installed. The next stage is to locate a CPLB in the
539 * config table that covers the faulting address.
540 */
541
542 R0 = I0; /* Our faulting address */
543
544 P2.L = _dpdt_table;
545 P2.H = _dpdt_table;
546#ifdef CONFIG_CPLB_INFO
547 P3.L = _dpdt_swapcount_table;
548 P3.H = _dpdt_swapcount_table;
549 P3 += -8;
550#endif
551
552 P1.L = _page_size_table;
553 P1.H = _page_size_table;
554
555 /* An extraction pattern, to retrieve bits 17:16.*/
556
557 R1 = (16<<8)|2;
558.Ldnext: R4 = [P2++]; /* address */
559 R2 = [P2++]; /* data */
560#ifdef CONFIG_CPLB_INFO
561 P3 += 8;
562#endif
563
564 CC = R4 == -1;
565 IF CC JUMP .Lno_page_in_table;
566
567 /* See if failed address > start address */
568 CC = R4 <= R0(IU);
569 IF !CC JUMP .Ldnext;
570
571 /* extract page size (17:16)*/
572 R3 = EXTRACT(R2, R1.L) (Z);
573
574 /* add page size to addr to get range */
575
576 P5 = R3;
577 P5 = P1 + (P5 << 2);
578 R3 = [P5];
579 R3 = R3 + R4;
580
581 /* See if failed address < (start address + page size) */
582 CC = R0 < R3(IU);
583 IF !CC JUMP .Ldnext;
584
585 /* We've found the CPLB that should be installed, so
586 * write it into CPLB15, masking off any caching bits
587 * if necessary.
588 */
589
590 P1.L = LO(DCPLB_DATA15);
591 P1.H = HI(DCPLB_DATA15);
592
593 /* If the DCPLB has cache bits set, but caching hasn't
594 * been enabled, then we want to mask off the cache-in-L1
595 * bit before installing. Moreover, if caching is off, we
596 * also want to ensure that the DCPLB has WT mode set, rather
597 * than WB, since WB pages still trigger first-write exceptions
598 * even when not caching is off, and the page isn't marked as
599 * cachable. Finally, we could mark the page as clean, not dirty,
600 * but we choose to leave that decision to the user; if the user
601 * chooses to have a CPLB pre-defined as dirty, then they always
602 * pay the cost of flushing during eviction, but don't pay the
603 * cost of first-write exceptions to mark the page as dirty.
604 */
605
606#ifdef CONFIG_BFIN_WT
607 BITSET(R6, 14); /* Set WT*/
608#endif
609
610 [P1] = R2;
611 [P1-0x100] = R4;
612#ifdef CONFIG_CPLB_INFO
613 R3 = [P3];
614 R3 += 1;
615 [P3] = R3;
616#endif
617
618 /* We've installed the CPLB, so re-enable CPLBs. P4
619 * points to DMEM_CONTROL, and R5 is the value we
620 * last wrote to it, when we were disabling CPLBs.
621 */
622
623 BITSET(R5,ENDCPLB_P);
624 CLI R2;
625 .align 8;
626 [P4] = R5;
627 SSYNC;
628 STI R2;
629
630 ( R7:4,P5:3 ) = [SP++];
631 R0 = CPLB_RELOADED;
632 RTS;
633ENDPROC(_cplb_mgr)
634
635.data
636.align 4;
637_page_size_table:
638.byte4 0x00000400; /* 1K */
639.byte4 0x00001000; /* 4K */
640.byte4 0x00100000; /* 1M */
641.byte4 0x00400000; /* 4M */
642
643.align 4;
644_dcplb_preference:
645.byte4 0x00000001; /* valid bit */
646.byte4 0x00000002; /* lock bit */
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbmgr.c b/arch/blackfin/kernel/cplb-nompu/cplbmgr.c
new file mode 100644
index 000000000000..376249ab2694
--- /dev/null
+++ b/arch/blackfin/kernel/cplb-nompu/cplbmgr.c
@@ -0,0 +1,283 @@
1/*
2 * File: arch/blackfin/kernel/cplb-nompu-c/cplbmgr.c
3 * Based on: arch/blackfin/kernel/cplb-mpu/cplbmgr.c
4 * Author: Michael McTernan <mmcternan@airvana.com>
5 *
6 * Created: 01Nov2008
7 * Description: CPLB miss handler.
8 *
9 * Modified:
10 * Copyright 2008 Airvana Inc.
11 * Copyright 2004-2007 Analog Devices Inc.
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 */
25
26#include <linux/kernel.h>
27#include <asm/blackfin.h>
28#include <asm/cplbinit.h>
29#include <asm/cplb.h>
30#include <asm/mmu_context.h>
31
32/*
33 * WARNING
34 *
35 * This file is compiled with certain -ffixed-reg options. We have to
36 * make sure not to call any functions here that could clobber these
37 * registers.
38 */
39
40int nr_dcplb_miss[NR_CPUS], nr_icplb_miss[NR_CPUS];
41int nr_dcplb_supv_miss[NR_CPUS], nr_icplb_supv_miss[NR_CPUS];
42int nr_cplb_flush[NR_CPUS], nr_dcplb_prot[NR_CPUS];
43
44#ifdef CONFIG_EXCPT_IRQ_SYSC_L1
45#define MGR_ATTR __attribute__((l1_text))
46#else
47#define MGR_ATTR
48#endif
49
50/*
51 * We're in an exception handler. The normal cli nop nop workaround
52 * isn't going to do very much, as the only thing that can interrupt
53 * us is an NMI, and the cli isn't going to stop that.
54 */
55#define NOWA_SSYNC __asm__ __volatile__ ("ssync;")
56
57/* Anomaly handlers provide SSYNCs, so avoid extra if anomaly is present */
58#if ANOMALY_05000125
59
60#define bfin_write_DMEM_CONTROL_SSYNC(v) bfin_write_DMEM_CONTROL(v)
61#define bfin_write_IMEM_CONTROL_SSYNC(v) bfin_write_IMEM_CONTROL(v)
62
63#else
64
65#define bfin_write_DMEM_CONTROL_SSYNC(v) \
66 do { NOWA_SSYNC; bfin_write_DMEM_CONTROL(v); NOWA_SSYNC; } while (0)
67#define bfin_write_IMEM_CONTROL_SSYNC(v) \
68 do { NOWA_SSYNC; bfin_write_IMEM_CONTROL(v); NOWA_SSYNC; } while (0)
69
70#endif
71
72static inline void write_dcplb_data(int cpu, int idx, unsigned long data,
73 unsigned long addr)
74{
75 unsigned long ctrl = bfin_read_DMEM_CONTROL();
76 bfin_write_DMEM_CONTROL_SSYNC(ctrl & ~ENDCPLB);
77 bfin_write32(DCPLB_DATA0 + idx * 4, data);
78 bfin_write32(DCPLB_ADDR0 + idx * 4, addr);
79 bfin_write_DMEM_CONTROL_SSYNC(ctrl);
80
81#ifdef CONFIG_CPLB_INFO
82 dcplb_tbl[cpu][idx].addr = addr;
83 dcplb_tbl[cpu][idx].data = data;
84#endif
85}
86
87static inline void write_icplb_data(int cpu, int idx, unsigned long data,
88 unsigned long addr)
89{
90 unsigned long ctrl = bfin_read_IMEM_CONTROL();
91
92 bfin_write_IMEM_CONTROL_SSYNC(ctrl & ~ENICPLB);
93 bfin_write32(ICPLB_DATA0 + idx * 4, data);
94 bfin_write32(ICPLB_ADDR0 + idx * 4, addr);
95 bfin_write_IMEM_CONTROL_SSYNC(ctrl);
96
97#ifdef CONFIG_CPLB_INFO
98 icplb_tbl[cpu][idx].addr = addr;
99 icplb_tbl[cpu][idx].data = data;
100#endif
101}
102
103/*
104 * Given the contents of the status register, return the index of the
105 * CPLB that caused the fault.
106 */
107static inline int faulting_cplb_index(int status)
108{
109 int signbits = __builtin_bfin_norm_fr1x32(status & 0xFFFF);
110 return 30 - signbits;
111}
112
113/*
114 * Given the contents of the status register and the DCPLB_DATA contents,
115 * return true if a write access should be permitted.
116 */
117static inline int write_permitted(int status, unsigned long data)
118{
119 if (status & FAULT_USERSUPV)
120 return !!(data & CPLB_SUPV_WR);
121 else
122 return !!(data & CPLB_USER_WR);
123}
124
125/* Counters to implement round-robin replacement. */
126static int icplb_rr_index[NR_CPUS] PDT_ATTR;
127static int dcplb_rr_index[NR_CPUS] PDT_ATTR;
128
129/*
130 * Find an ICPLB entry to be evicted and return its index.
131 */
132static int evict_one_icplb(int cpu)
133{
134 int i = first_switched_icplb + icplb_rr_index[cpu];
135 if (i >= MAX_CPLBS) {
136 i -= MAX_CPLBS - first_switched_icplb;
137 icplb_rr_index[cpu] -= MAX_CPLBS - first_switched_icplb;
138 }
139 icplb_rr_index[cpu]++;
140 return i;
141}
142
143static int evict_one_dcplb(int cpu)
144{
145 int i = first_switched_dcplb + dcplb_rr_index[cpu];
146 if (i >= MAX_CPLBS) {
147 i -= MAX_CPLBS - first_switched_dcplb;
148 dcplb_rr_index[cpu] -= MAX_CPLBS - first_switched_dcplb;
149 }
150 dcplb_rr_index[cpu]++;
151 return i;
152}
153
154MGR_ATTR static int icplb_miss(int cpu)
155{
156 unsigned long addr = bfin_read_ICPLB_FAULT_ADDR();
157 int status = bfin_read_ICPLB_STATUS();
158 int idx;
159 unsigned long i_data, base, addr1, eaddr;
160
161 nr_icplb_miss[cpu]++;
162 if (unlikely(status & FAULT_USERSUPV))
163 nr_icplb_supv_miss[cpu]++;
164
165 base = 0;
166 for (idx = 0; idx < icplb_nr_bounds; idx++) {
167 eaddr = icplb_bounds[idx].eaddr;
168 if (addr < eaddr)
169 break;
170 base = eaddr;
171 }
172 if (unlikely(idx == icplb_nr_bounds))
173 return CPLB_NO_ADDR_MATCH;
174
175 i_data = icplb_bounds[idx].data;
176 if (unlikely(i_data == 0))
177 return CPLB_NO_ADDR_MATCH;
178
179 addr1 = addr & ~(SIZE_4M - 1);
180 addr &= ~(SIZE_1M - 1);
181 i_data |= PAGE_SIZE_1MB;
182 if (addr1 >= base && (addr1 + SIZE_4M) <= eaddr) {
183 /*
184 * This works because
185 * (PAGE_SIZE_4MB & PAGE_SIZE_1MB) == PAGE_SIZE_1MB.
186 */
187 i_data |= PAGE_SIZE_4MB;
188 addr = addr1;
189 }
190
191 /* Pick entry to evict */
192 idx = evict_one_icplb(cpu);
193
194 write_icplb_data(cpu, idx, i_data, addr);
195
196 return CPLB_RELOADED;
197}
198
199MGR_ATTR static int dcplb_miss(int cpu)
200{
201 unsigned long addr = bfin_read_DCPLB_FAULT_ADDR();
202 int status = bfin_read_DCPLB_STATUS();
203 int idx;
204 unsigned long d_data, base, addr1, eaddr;
205
206 nr_dcplb_miss[cpu]++;
207 if (unlikely(status & FAULT_USERSUPV))
208 nr_dcplb_supv_miss[cpu]++;
209
210 base = 0;
211 for (idx = 0; idx < dcplb_nr_bounds; idx++) {
212 eaddr = dcplb_bounds[idx].eaddr;
213 if (addr < eaddr)
214 break;
215 base = eaddr;
216 }
217 if (unlikely(idx == dcplb_nr_bounds))
218 return CPLB_NO_ADDR_MATCH;
219
220 d_data = dcplb_bounds[idx].data;
221 if (unlikely(d_data == 0))
222 return CPLB_NO_ADDR_MATCH;
223
224 addr1 = addr & ~(SIZE_4M - 1);
225 addr &= ~(SIZE_1M - 1);
226 d_data |= PAGE_SIZE_1MB;
227 if (addr1 >= base && (addr1 + SIZE_4M) <= eaddr) {
228 /*
229 * This works because
230 * (PAGE_SIZE_4MB & PAGE_SIZE_1MB) == PAGE_SIZE_1MB.
231 */
232 d_data |= PAGE_SIZE_4MB;
233 addr = addr1;
234 }
235
236 /* Pick entry to evict */
237 idx = evict_one_dcplb(cpu);
238
239 write_dcplb_data(cpu, idx, d_data, addr);
240
241 return CPLB_RELOADED;
242}
243
244MGR_ATTR static noinline int dcplb_protection_fault(int cpu)
245{
246 int status = bfin_read_DCPLB_STATUS();
247
248 nr_dcplb_prot[cpu]++;
249
250 if (likely(status & FAULT_RW)) {
251 int idx = faulting_cplb_index(status);
252 unsigned long regaddr = DCPLB_DATA0 + idx * 4;
253 unsigned long data = bfin_read32(regaddr);
254
255 /* Check if fault is to dirty a clean page */
256 if (!(data & CPLB_WT) && !(data & CPLB_DIRTY) &&
257 write_permitted(status, data)) {
258
259 dcplb_tbl[cpu][idx].data = data;
260 bfin_write32(regaddr, data);
261 return CPLB_RELOADED;
262 }
263 }
264
265 return CPLB_PROT_VIOL;
266}
267
268MGR_ATTR int cplb_hdr(int seqstat, struct pt_regs *regs)
269{
270 int cause = seqstat & 0x3f;
271 unsigned int cpu = smp_processor_id();
272 switch (cause) {
273 case 0x2C:
274 return icplb_miss(cpu);
275 case 0x26:
276 return dcplb_miss(cpu);
277 default:
278 if (unlikely(cause == 0x23))
279 return dcplb_protection_fault(cpu);
280
281 return CPLB_UNKNOWN_ERR;
282 }
283}
diff --git a/arch/blackfin/kernel/cplbinfo.c b/arch/blackfin/kernel/cplbinfo.c
new file mode 100644
index 000000000000..64d78300dd08
--- /dev/null
+++ b/arch/blackfin/kernel/cplbinfo.c
@@ -0,0 +1,177 @@
1/*
2 * arch/blackfin/kernel/cplbinfo.c - display CPLB status
3 *
4 * Copyright 2004-2008 Analog Devices Inc.
5 * Licensed under the GPL-2 or later.
6 */
7
8#include <linux/ctype.h>
9#include <linux/module.h>
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/proc_fs.h>
13#include <linux/seq_file.h>
14#include <linux/uaccess.h>
15
16#include <asm/cplbinit.h>
17#include <asm/blackfin.h>
18
19static char const page_strtbl[][3] = { "1K", "4K", "1M", "4M" };
20#define page(flags) (((flags) & 0x30000) >> 16)
21#define strpage(flags) page_strtbl[page(flags)]
22
23struct cplbinfo_data {
24 loff_t pos;
25 char cplb_type;
26 u32 mem_control;
27 struct cplb_entry *tbl;
28 int switched;
29};
30
31static void cplbinfo_print_header(struct seq_file *m)
32{
33 seq_printf(m, "Index\tAddress\t\tData\tSize\tU/RD\tU/WR\tS/WR\tSwitch\n");
34}
35
36static int cplbinfo_nomore(struct cplbinfo_data *cdata)
37{
38 return cdata->pos >= MAX_CPLBS;
39}
40
41static int cplbinfo_show(struct seq_file *m, void *p)
42{
43 struct cplbinfo_data *cdata;
44 unsigned long data, addr;
45 loff_t pos;
46
47 cdata = p;
48 pos = cdata->pos;
49 addr = cdata->tbl[pos].addr;
50 data = cdata->tbl[pos].data;
51
52 seq_printf(m,
53 "%d\t0x%08lx\t%05lx\t%s\t%c\t%c\t%c\t%c\n",
54 (int)pos, addr, data, strpage(data),
55 (data & CPLB_USER_RD) ? 'Y' : 'N',
56 (data & CPLB_USER_WR) ? 'Y' : 'N',
57 (data & CPLB_SUPV_WR) ? 'Y' : 'N',
58 pos < cdata->switched ? 'N' : 'Y');
59
60 return 0;
61}
62
63static void cplbinfo_seq_init(struct cplbinfo_data *cdata, unsigned int cpu)
64{
65 if (cdata->cplb_type == 'I') {
66 cdata->mem_control = bfin_read_IMEM_CONTROL();
67 cdata->tbl = icplb_tbl[cpu];
68 cdata->switched = first_switched_icplb;
69 } else {
70 cdata->mem_control = bfin_read_DMEM_CONTROL();
71 cdata->tbl = dcplb_tbl[cpu];
72 cdata->switched = first_switched_dcplb;
73 }
74}
75
76static void *cplbinfo_start(struct seq_file *m, loff_t *pos)
77{
78 struct cplbinfo_data *cdata = m->private;
79
80 if (!*pos) {
81 seq_printf(m, "%cCPLBs are %sabled: 0x%x\n", cdata->cplb_type,
82 (cdata->mem_control & ENDCPLB ? "en" : "dis"),
83 cdata->mem_control);
84 cplbinfo_print_header(m);
85 } else if (cplbinfo_nomore(cdata))
86 return NULL;
87
88 get_cpu();
89 return cdata;
90}
91
92static void *cplbinfo_next(struct seq_file *m, void *p, loff_t *pos)
93{
94 struct cplbinfo_data *cdata = p;
95 cdata->pos = ++(*pos);
96 if (cplbinfo_nomore(cdata))
97 return NULL;
98 else
99 return cdata;
100}
101
102static void cplbinfo_stop(struct seq_file *m, void *p)
103{
104 put_cpu();
105}
106
107static const struct seq_operations cplbinfo_sops = {
108 .start = cplbinfo_start,
109 .next = cplbinfo_next,
110 .stop = cplbinfo_stop,
111 .show = cplbinfo_show,
112};
113
114static int cplbinfo_open(struct inode *inode, struct file *file)
115{
116 char buf[256], *path, *p;
117 unsigned int cpu;
118 char *s_cpu, *s_cplb;
119 int ret;
120 struct seq_file *m;
121 struct cplbinfo_data *cdata;
122
123 path = d_path(&file->f_path, buf, sizeof(buf));
124 if (IS_ERR(path))
125 return PTR_ERR(path);
126 s_cpu = strstr(path, "/cpu");
127 s_cplb = strrchr(path, '/');
128 if (!s_cpu || !s_cplb)
129 return -EINVAL;
130
131 cpu = simple_strtoul(s_cpu + 4, &p, 10);
132 if (!cpu_online(cpu))
133 return -ENODEV;
134
135 ret = seq_open_private(file, &cplbinfo_sops, sizeof(*cdata));
136 if (ret)
137 return ret;
138 m = file->private_data;
139 cdata = m->private;
140
141 cdata->pos = 0;
142 cdata->cplb_type = toupper(s_cplb[1]);
143 cplbinfo_seq_init(cdata, cpu);
144
145 return 0;
146}
147
148static const struct file_operations cplbinfo_fops = {
149 .open = cplbinfo_open,
150 .read = seq_read,
151 .llseek = seq_lseek,
152 .release = seq_release_private,
153};
154
155static int __init cplbinfo_init(void)
156{
157 struct proc_dir_entry *cplb_dir, *cpu_dir;
158 char buf[10];
159 unsigned int cpu;
160
161 cplb_dir = proc_mkdir("cplbinfo", NULL);
162 if (!cplb_dir)
163 return -ENOMEM;
164
165 for_each_possible_cpu(cpu) {
166 sprintf(buf, "cpu%i", cpu);
167 cpu_dir = proc_mkdir(buf, cplb_dir);
168 if (!cpu_dir)
169 return -ENOMEM;
170
171 proc_create("icplb", S_IRUGO, cpu_dir, &cplbinfo_fops);
172 proc_create("dcplb", S_IRUGO, cpu_dir, &cplbinfo_fops);
173 }
174
175 return 0;
176}
177late_initcall(cplbinfo_init);
diff --git a/arch/blackfin/kernel/early_printk.c b/arch/blackfin/kernel/early_printk.c
index 1f4e3d2e0901..c8ad051742e2 100644
--- a/arch/blackfin/kernel/early_printk.c
+++ b/arch/blackfin/kernel/early_printk.c
@@ -105,10 +105,10 @@ static struct console * __init earlyserial_init(char *buf)
105 cflag |= CS5; 105 cflag |= CS5;
106 break; 106 break;
107 case 6: 107 case 6:
108 cflag |= CS5; 108 cflag |= CS6;
109 break; 109 break;
110 case 7: 110 case 7:
111 cflag |= CS5; 111 cflag |= CS7;
112 break; 112 break;
113 default: 113 default:
114 cflag |= CS8; 114 cflag |= CS8;
diff --git a/arch/blackfin/kernel/entry.S b/arch/blackfin/kernel/entry.S
index faea88ebb2ef..a9cfba9946b5 100644
--- a/arch/blackfin/kernel/entry.S
+++ b/arch/blackfin/kernel/entry.S
@@ -30,6 +30,7 @@
30#include <linux/linkage.h> 30#include <linux/linkage.h>
31#include <asm/thread_info.h> 31#include <asm/thread_info.h>
32#include <asm/errno.h> 32#include <asm/errno.h>
33#include <asm/blackfin.h>
33#include <asm/asm-offsets.h> 34#include <asm/asm-offsets.h>
34 35
35#include <asm/context.S> 36#include <asm/context.S>
@@ -41,6 +42,10 @@
41#endif 42#endif
42 43
43ENTRY(_ret_from_fork) 44ENTRY(_ret_from_fork)
45#ifdef CONFIG_IPIPE
46 [--sp] = reti; /* IRQs on. */
47 SP += 4;
48#endif /* CONFIG_IPIPE */
44 SP += -12; 49 SP += -12;
45 call _schedule_tail; 50 call _schedule_tail;
46 SP += 12; 51 SP += 12;
diff --git a/arch/blackfin/kernel/fixed_code.S b/arch/blackfin/kernel/fixed_code.S
index 4b03ba025488..0d2d9e0968c8 100644
--- a/arch/blackfin/kernel/fixed_code.S
+++ b/arch/blackfin/kernel/fixed_code.S
@@ -8,10 +8,12 @@
8 * BF561 SMP). 8 * BF561 SMP).
9 */ 9 */
10#include <linux/linkage.h> 10#include <linux/linkage.h>
11#include <linux/init.h>
11#include <linux/unistd.h> 12#include <linux/unistd.h>
12#include <asm/entry.h> 13#include <asm/entry.h>
13 14
14.text 15__INIT
16
15ENTRY(_fixed_code_start) 17ENTRY(_fixed_code_start)
16 18
17.align 16 19.align 16
@@ -144,3 +146,5 @@ ENTRY(_safe_user_instruction)
144ENDPROC(_safe_user_instruction) 146ENDPROC(_safe_user_instruction)
145 147
146ENTRY(_fixed_code_end) 148ENTRY(_fixed_code_end)
149
150__FINIT
diff --git a/arch/blackfin/kernel/ipipe.c b/arch/blackfin/kernel/ipipe.c
new file mode 100644
index 000000000000..339be5a3ae6a
--- /dev/null
+++ b/arch/blackfin/kernel/ipipe.c
@@ -0,0 +1,428 @@
1/* -*- linux-c -*-
2 * linux/arch/blackfin/kernel/ipipe.c
3 *
4 * Copyright (C) 2005-2007 Philippe Gerum.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
9 * USA; either version 2 of the License, or (at your option) any later
10 * version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 *
21 * Architecture-dependent I-pipe support for the Blackfin.
22 */
23
24#include <linux/kernel.h>
25#include <linux/sched.h>
26#include <linux/module.h>
27#include <linux/interrupt.h>
28#include <linux/percpu.h>
29#include <linux/bitops.h>
30#include <linux/slab.h>
31#include <linux/errno.h>
32#include <linux/kthread.h>
33#include <asm/unistd.h>
34#include <asm/system.h>
35#include <asm/atomic.h>
36#include <asm/io.h>
37
38static int create_irq_threads;
39
40DEFINE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
41
42static DEFINE_PER_CPU(unsigned long, pending_irqthread_mask);
43
44static DEFINE_PER_CPU(int [IVG13 + 1], pending_irq_count);
45
46asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs);
47
48static void __ipipe_no_irqtail(void);
49
50unsigned long __ipipe_irq_tail_hook = (unsigned long)&__ipipe_no_irqtail;
51EXPORT_SYMBOL(__ipipe_irq_tail_hook);
52
53unsigned long __ipipe_core_clock;
54EXPORT_SYMBOL(__ipipe_core_clock);
55
56unsigned long __ipipe_freq_scale;
57EXPORT_SYMBOL(__ipipe_freq_scale);
58
59atomic_t __ipipe_irq_lvdepth[IVG15 + 1];
60
61unsigned long __ipipe_irq_lvmask = __all_masked_irq_flags;
62EXPORT_SYMBOL(__ipipe_irq_lvmask);
63
64static void __ipipe_ack_irq(unsigned irq, struct irq_desc *desc)
65{
66 desc->ipipe_ack(irq, desc);
67}
68
69/*
70 * __ipipe_enable_pipeline() -- We are running on the boot CPU, hw
71 * interrupts are off, and secondary CPUs are still lost in space.
72 */
73void __ipipe_enable_pipeline(void)
74{
75 unsigned irq;
76
77 __ipipe_core_clock = get_cclk(); /* Fetch this once. */
78 __ipipe_freq_scale = 1000000000UL / __ipipe_core_clock;
79
80 for (irq = 0; irq < NR_IRQS; ++irq)
81 ipipe_virtualize_irq(ipipe_root_domain,
82 irq,
83 (ipipe_irq_handler_t)&asm_do_IRQ,
84 NULL,
85 &__ipipe_ack_irq,
86 IPIPE_HANDLE_MASK | IPIPE_PASS_MASK);
87}
88
89/*
90 * __ipipe_handle_irq() -- IPIPE's generic IRQ handler. An optimistic
91 * interrupt protection log is maintained here for each domain. Hw
92 * interrupts are masked on entry.
93 */
94void __ipipe_handle_irq(unsigned irq, struct pt_regs *regs)
95{
96 struct ipipe_domain *this_domain, *next_domain;
97 struct list_head *head, *pos;
98 int m_ack, s = -1;
99
100 /*
101 * Software-triggered IRQs do not need any ack. The contents
102 * of the register frame should only be used when processing
103 * the timer interrupt, but not for handling any other
104 * interrupt.
105 */
106 m_ack = (regs == NULL || irq == IRQ_SYSTMR || irq == IRQ_CORETMR);
107
108 this_domain = ipipe_current_domain;
109
110 if (unlikely(test_bit(IPIPE_STICKY_FLAG, &this_domain->irqs[irq].control)))
111 head = &this_domain->p_link;
112 else {
113 head = __ipipe_pipeline.next;
114 next_domain = list_entry(head, struct ipipe_domain, p_link);
115 if (likely(test_bit(IPIPE_WIRED_FLAG, &next_domain->irqs[irq].control))) {
116 if (!m_ack && next_domain->irqs[irq].acknowledge != NULL)
117 next_domain->irqs[irq].acknowledge(irq, irq_desc + irq);
118 if (test_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags))
119 s = __test_and_set_bit(IPIPE_STALL_FLAG,
120 &ipipe_root_cpudom_var(status));
121 __ipipe_dispatch_wired(next_domain, irq);
122 goto finalize;
123 return;
124 }
125 }
126
127 /* Ack the interrupt. */
128
129 pos = head;
130
131 while (pos != &__ipipe_pipeline) {
132 next_domain = list_entry(pos, struct ipipe_domain, p_link);
133 /*
134 * For each domain handling the incoming IRQ, mark it
135 * as pending in its log.
136 */
137 if (test_bit(IPIPE_HANDLE_FLAG, &next_domain->irqs[irq].control)) {
138 /*
139 * Domains that handle this IRQ are polled for
140 * acknowledging it by decreasing priority
141 * order. The interrupt must be made pending
142 * _first_ in the domain's status flags before
143 * the PIC is unlocked.
144 */
145 __ipipe_set_irq_pending(next_domain, irq);
146
147 if (!m_ack && next_domain->irqs[irq].acknowledge != NULL) {
148 next_domain->irqs[irq].acknowledge(irq, irq_desc + irq);
149 m_ack = 1;
150 }
151 }
152
153 /*
154 * If the domain does not want the IRQ to be passed
155 * down the interrupt pipe, exit the loop now.
156 */
157 if (!test_bit(IPIPE_PASS_FLAG, &next_domain->irqs[irq].control))
158 break;
159
160 pos = next_domain->p_link.next;
161 }
162
163 /*
164 * Now walk the pipeline, yielding control to the highest
165 * priority domain that has pending interrupt(s) or
166 * immediately to the current domain if the interrupt has been
167 * marked as 'sticky'. This search does not go beyond the
168 * current domain in the pipeline. We also enforce the
169 * additional root stage lock (blackfin-specific). */
170
171 if (test_bit(IPIPE_ROOTLOCK_FLAG, &ipipe_root_domain->flags))
172 s = __test_and_set_bit(IPIPE_STALL_FLAG,
173 &ipipe_root_cpudom_var(status));
174finalize:
175
176 __ipipe_walk_pipeline(head);
177
178 if (!s)
179 __clear_bit(IPIPE_STALL_FLAG,
180 &ipipe_root_cpudom_var(status));
181}
182
183int __ipipe_check_root(void)
184{
185 return ipipe_root_domain_p;
186}
187
188void __ipipe_enable_irqdesc(struct ipipe_domain *ipd, unsigned irq)
189{
190 struct irq_desc *desc = irq_desc + irq;
191 int prio = desc->ic_prio;
192
193 desc->depth = 0;
194 if (ipd != &ipipe_root &&
195 atomic_inc_return(&__ipipe_irq_lvdepth[prio]) == 1)
196 __set_bit(prio, &__ipipe_irq_lvmask);
197}
198EXPORT_SYMBOL(__ipipe_enable_irqdesc);
199
200void __ipipe_disable_irqdesc(struct ipipe_domain *ipd, unsigned irq)
201{
202 struct irq_desc *desc = irq_desc + irq;
203 int prio = desc->ic_prio;
204
205 if (ipd != &ipipe_root &&
206 atomic_dec_and_test(&__ipipe_irq_lvdepth[prio]))
207 __clear_bit(prio, &__ipipe_irq_lvmask);
208}
209EXPORT_SYMBOL(__ipipe_disable_irqdesc);
210
211void __ipipe_stall_root_raw(void)
212{
213 /*
214 * This code is called by the ins{bwl} routines (see
215 * arch/blackfin/lib/ins.S), which are heavily used by the
216 * network stack. It masks all interrupts but those handled by
217 * non-root domains, so that we keep decent network transfer
218 * rates for Linux without inducing pathological jitter for
219 * the real-time domain.
220 */
221 __asm__ __volatile__ ("sti %0;" : : "d"(__ipipe_irq_lvmask));
222
223 __set_bit(IPIPE_STALL_FLAG,
224 &ipipe_root_cpudom_var(status));
225}
226
227void __ipipe_unstall_root_raw(void)
228{
229 __clear_bit(IPIPE_STALL_FLAG,
230 &ipipe_root_cpudom_var(status));
231
232 __asm__ __volatile__ ("sti %0;" : : "d"(bfin_irq_flags));
233}
234
235int __ipipe_syscall_root(struct pt_regs *regs)
236{
237 unsigned long flags;
238
239 /* We need to run the IRQ tail hook whenever we don't
240 * propagate a syscall to higher domains, because we know that
241 * important operations might be pending there (e.g. Xenomai
242 * deferred rescheduling). */
243
244 if (!__ipipe_syscall_watched_p(current, regs->orig_p0)) {
245 void (*hook)(void) = (void (*)(void))__ipipe_irq_tail_hook;
246 hook();
247 return 0;
248 }
249
250 /*
251 * This routine either returns:
252 * 0 -- if the syscall is to be passed to Linux;
253 * 1 -- if the syscall should not be passed to Linux, and no
254 * tail work should be performed;
255 * -1 -- if the syscall should not be passed to Linux but the
256 * tail work has to be performed (for handling signals etc).
257 */
258
259 if (__ipipe_event_monitored_p(IPIPE_EVENT_SYSCALL) &&
260 __ipipe_dispatch_event(IPIPE_EVENT_SYSCALL, regs) > 0) {
261 if (ipipe_root_domain_p && !in_atomic()) {
262 /*
263 * Sync pending VIRQs before _TIF_NEED_RESCHED
264 * is tested.
265 */
266 local_irq_save_hw(flags);
267 if ((ipipe_root_cpudom_var(irqpend_himask) & IPIPE_IRQMASK_VIRT) != 0)
268 __ipipe_sync_pipeline(IPIPE_IRQMASK_VIRT);
269 local_irq_restore_hw(flags);
270 return -1;
271 }
272 return 1;
273 }
274
275 return 0;
276}
277
278unsigned long ipipe_critical_enter(void (*syncfn) (void))
279{
280 unsigned long flags;
281
282 local_irq_save_hw(flags);
283
284 return flags;
285}
286
287void ipipe_critical_exit(unsigned long flags)
288{
289 local_irq_restore_hw(flags);
290}
291
292static void __ipipe_no_irqtail(void)
293{
294}
295
296int ipipe_get_sysinfo(struct ipipe_sysinfo *info)
297{
298 info->ncpus = num_online_cpus();
299 info->cpufreq = ipipe_cpu_freq();
300 info->archdep.tmirq = IPIPE_TIMER_IRQ;
301 info->archdep.tmfreq = info->cpufreq;
302
303 return 0;
304}
305
306/*
307 * ipipe_trigger_irq() -- Push the interrupt at front of the pipeline
308 * just like if it has been actually received from a hw source. Also
309 * works for virtual interrupts.
310 */
311int ipipe_trigger_irq(unsigned irq)
312{
313 unsigned long flags;
314
315 if (irq >= IPIPE_NR_IRQS ||
316 (ipipe_virtual_irq_p(irq)
317 && !test_bit(irq - IPIPE_VIRQ_BASE, &__ipipe_virtual_irq_map)))
318 return -EINVAL;
319
320 local_irq_save_hw(flags);
321
322 __ipipe_handle_irq(irq, NULL);
323
324 local_irq_restore_hw(flags);
325
326 return 1;
327}
328
329/* Move Linux IRQ to threads. */
330
331static int do_irqd(void *__desc)
332{
333 struct irq_desc *desc = __desc;
334 unsigned irq = desc - irq_desc;
335 int thrprio = desc->thr_prio;
336 int thrmask = 1 << thrprio;
337 int cpu = smp_processor_id();
338 cpumask_t cpumask;
339
340 sigfillset(&current->blocked);
341 current->flags |= PF_NOFREEZE;
342 cpumask = cpumask_of_cpu(cpu);
343 set_cpus_allowed(current, cpumask);
344 ipipe_setscheduler_root(current, SCHED_FIFO, 50 + thrprio);
345
346 while (!kthread_should_stop()) {
347 local_irq_disable();
348 if (!(desc->status & IRQ_SCHEDULED)) {
349 set_current_state(TASK_INTERRUPTIBLE);
350resched:
351 local_irq_enable();
352 schedule();
353 local_irq_disable();
354 }
355 __set_current_state(TASK_RUNNING);
356 /*
357 * If higher priority interrupt servers are ready to
358 * run, reschedule immediately. We need this for the
359 * GPIO demux IRQ handler to unmask the interrupt line
360 * _last_, after all GPIO IRQs have run.
361 */
362 if (per_cpu(pending_irqthread_mask, cpu) & ~(thrmask|(thrmask-1)))
363 goto resched;
364 if (--per_cpu(pending_irq_count[thrprio], cpu) == 0)
365 per_cpu(pending_irqthread_mask, cpu) &= ~thrmask;
366 desc->status &= ~IRQ_SCHEDULED;
367 desc->thr_handler(irq, &__raw_get_cpu_var(__ipipe_tick_regs));
368 local_irq_enable();
369 }
370 __set_current_state(TASK_RUNNING);
371 return 0;
372}
373
374static void kick_irqd(unsigned irq, void *cookie)
375{
376 struct irq_desc *desc = irq_desc + irq;
377 int thrprio = desc->thr_prio;
378 int thrmask = 1 << thrprio;
379 int cpu = smp_processor_id();
380
381 if (!(desc->status & IRQ_SCHEDULED)) {
382 desc->status |= IRQ_SCHEDULED;
383 per_cpu(pending_irqthread_mask, cpu) |= thrmask;
384 ++per_cpu(pending_irq_count[thrprio], cpu);
385 wake_up_process(desc->thread);
386 }
387}
388
389int ipipe_start_irq_thread(unsigned irq, struct irq_desc *desc)
390{
391 if (desc->thread || !create_irq_threads)
392 return 0;
393
394 desc->thread = kthread_create(do_irqd, desc, "IRQ %d", irq);
395 if (desc->thread == NULL) {
396 printk(KERN_ERR "irqd: could not create IRQ thread %d!\n", irq);
397 return -ENOMEM;
398 }
399
400 wake_up_process(desc->thread);
401
402 desc->thr_handler = ipipe_root_domain->irqs[irq].handler;
403 ipipe_root_domain->irqs[irq].handler = &kick_irqd;
404
405 return 0;
406}
407
408void __init ipipe_init_irq_threads(void)
409{
410 unsigned irq;
411 struct irq_desc *desc;
412
413 create_irq_threads = 1;
414
415 for (irq = 0; irq < NR_IRQS; irq++) {
416 desc = irq_desc + irq;
417 if (desc->action != NULL ||
418 (desc->status & IRQ_NOREQUEST) != 0)
419 ipipe_start_irq_thread(irq, desc);
420 }
421}
422
423EXPORT_SYMBOL(show_stack);
424
425#ifdef CONFIG_IPIPE_TRACE_MCOUNT
426void notrace _mcount(void);
427EXPORT_SYMBOL(_mcount);
428#endif /* CONFIG_IPIPE_TRACE_MCOUNT */
diff --git a/arch/blackfin/kernel/irqchip.c b/arch/blackfin/kernel/irqchip.c
index 07402f57c9de..ab8209cbbad0 100644
--- a/arch/blackfin/kernel/irqchip.c
+++ b/arch/blackfin/kernel/irqchip.c
@@ -36,7 +36,7 @@
36#include <linux/irq.h> 36#include <linux/irq.h>
37#include <asm/trace.h> 37#include <asm/trace.h>
38 38
39static unsigned long irq_err_count; 39static atomic_t irq_err_count;
40static spinlock_t irq_controller_lock; 40static spinlock_t irq_controller_lock;
41 41
42/* 42/*
@@ -48,10 +48,9 @@ void dummy_mask_unmask_irq(unsigned int irq)
48 48
49void ack_bad_irq(unsigned int irq) 49void ack_bad_irq(unsigned int irq)
50{ 50{
51 irq_err_count += 1; 51 atomic_inc(&irq_err_count);
52 printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq); 52 printk(KERN_ERR "IRQ: spurious interrupt %d\n", irq);
53} 53}
54EXPORT_SYMBOL(ack_bad_irq);
55 54
56static struct irq_chip bad_chip = { 55static struct irq_chip bad_chip = {
57 .ack = dummy_mask_unmask_irq, 56 .ack = dummy_mask_unmask_irq,
@@ -72,7 +71,7 @@ static struct irq_desc bad_irq_desc = {
72 71
73int show_interrupts(struct seq_file *p, void *v) 72int show_interrupts(struct seq_file *p, void *v)
74{ 73{
75 int i = *(loff_t *) v; 74 int i = *(loff_t *) v, j;
76 struct irqaction *action; 75 struct irqaction *action;
77 unsigned long flags; 76 unsigned long flags;
78 77
@@ -80,19 +79,20 @@ int show_interrupts(struct seq_file *p, void *v)
80 spin_lock_irqsave(&irq_desc[i].lock, flags); 79 spin_lock_irqsave(&irq_desc[i].lock, flags);
81 action = irq_desc[i].action; 80 action = irq_desc[i].action;
82 if (!action) 81 if (!action)
83 goto unlock; 82 goto skip;
84 83 seq_printf(p, "%3d: ", i);
85 seq_printf(p, "%3d: %10u ", i, kstat_irqs(i)); 84 for_each_online_cpu(j)
85 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
86 seq_printf(p, " %8s", irq_desc[i].chip->name);
86 seq_printf(p, " %s", action->name); 87 seq_printf(p, " %s", action->name);
87 for (action = action->next; action; action = action->next) 88 for (action = action->next; action; action = action->next)
88 seq_printf(p, ", %s", action->name); 89 seq_printf(p, " %s", action->name);
89 90
90 seq_putc(p, '\n'); 91 seq_putc(p, '\n');
91 unlock: 92 skip:
92 spin_unlock_irqrestore(&irq_desc[i].lock, flags); 93 spin_unlock_irqrestore(&irq_desc[i].lock, flags);
93 } else if (i == NR_IRQS) { 94 } else if (i == NR_IRQS)
94 seq_printf(p, "Err: %10lu\n", irq_err_count); 95 seq_printf(p, "Err: %10u\n", atomic_read(&irq_err_count));
95 }
96 return 0; 96 return 0;
97} 97}
98 98
@@ -101,7 +101,6 @@ int show_interrupts(struct seq_file *p, void *v)
101 * come via this function. Instead, they should provide their 101 * come via this function. Instead, they should provide their
102 * own 'handler' 102 * own 'handler'
103 */ 103 */
104
105#ifdef CONFIG_DO_IRQ_L1 104#ifdef CONFIG_DO_IRQ_L1
106__attribute__((l1_text)) 105__attribute__((l1_text))
107#endif 106#endif
@@ -109,8 +108,9 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
109{ 108{
110 struct pt_regs *old_regs; 109 struct pt_regs *old_regs;
111 struct irq_desc *desc = irq_desc + irq; 110 struct irq_desc *desc = irq_desc + irq;
111#ifndef CONFIG_IPIPE
112 unsigned short pending, other_ints; 112 unsigned short pending, other_ints;
113 113#endif
114 old_regs = set_irq_regs(regs); 114 old_regs = set_irq_regs(regs);
115 115
116 /* 116 /*
@@ -121,9 +121,24 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
121 desc = &bad_irq_desc; 121 desc = &bad_irq_desc;
122 122
123 irq_enter(); 123 irq_enter();
124 124#ifdef CONFIG_DEBUG_STACKOVERFLOW
125 /* Debugging check for stack overflow: is there less than STACK_WARN free? */
126 {
127 long sp;
128
129 sp = __get_SP() & (THREAD_SIZE-1);
130
131 if (unlikely(sp < (sizeof(struct thread_info) + STACK_WARN))) {
132 dump_stack();
133 printk(KERN_EMERG "%s: possible stack overflow while handling irq %i "
134 " only %ld bytes free\n",
135 __func__, irq, sp - sizeof(struct thread_info));
136 }
137 }
138#endif
125 generic_handle_irq(irq); 139 generic_handle_irq(irq);
126 140
141#ifndef CONFIG_IPIPE /* Useless and bugous over the I-pipe: IRQs are threaded. */
127 /* If we're the only interrupt running (ignoring IRQ15 which is for 142 /* If we're the only interrupt running (ignoring IRQ15 which is for
128 syscalls), lower our priority to IRQ14 so that softirqs run at 143 syscalls), lower our priority to IRQ14 so that softirqs run at
129 that level. If there's another, lower-level interrupt, irq_exit 144 that level. If there's another, lower-level interrupt, irq_exit
@@ -133,6 +148,7 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
133 other_ints = pending & (pending - 1); 148 other_ints = pending & (pending - 1);
134 if (other_ints == 0) 149 if (other_ints == 0)
135 lower_to_irq14(); 150 lower_to_irq14();
151#endif /* !CONFIG_IPIPE */
136 irq_exit(); 152 irq_exit();
137 153
138 set_irq_regs(old_regs); 154 set_irq_regs(old_regs);
diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c
index b795a207742c..b163f6d3330d 100644
--- a/arch/blackfin/kernel/kgdb.c
+++ b/arch/blackfin/kernel/kgdb.c
@@ -34,9 +34,14 @@ int gdb_bfin_vector = -1;
34#error change the definition of slavecpulocks 34#error change the definition of slavecpulocks
35#endif 35#endif
36 36
37#ifdef CONFIG_BFIN_WDT 37#define IN_MEM(addr, size, l1_addr, l1_size) \
38# error "Please unselect blackfin watchdog driver before build KGDB." 38({ \
39#endif 39 unsigned long __addr = (unsigned long)(addr); \
40 (l1_size && __addr >= l1_addr && __addr + (size) <= l1_addr + l1_size); \
41})
42#define ASYNC_BANK_SIZE \
43 (ASYNC_BANK0_SIZE + ASYNC_BANK1_SIZE + \
44 ASYNC_BANK2_SIZE + ASYNC_BANK3_SIZE)
40 45
41void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) 46void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
42{ 47{
@@ -105,7 +110,7 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
105 * Extracts ebp, esp and eip values understandable by gdb from the values 110 * Extracts ebp, esp and eip values understandable by gdb from the values
106 * saved by switch_to. 111 * saved by switch_to.
107 * thread.esp points to ebp. flags and ebp are pushed in switch_to hence esp 112 * thread.esp points to ebp. flags and ebp are pushed in switch_to hence esp
108 * prior to entering switch_to is 8 greater then the value that is saved. 113 * prior to entering switch_to is 8 greater than the value that is saved.
109 * If switch_to changes, change following code appropriately. 114 * If switch_to changes, change following code appropriately.
110 */ 115 */
111void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) 116void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
@@ -219,6 +224,7 @@ int bfin_set_hw_break(unsigned long addr, int len, enum kgdb_bptype type)
219 if (bfin_type == breakinfo[breakno].type 224 if (bfin_type == breakinfo[breakno].type
220 && !breakinfo[breakno].occupied) { 225 && !breakinfo[breakno].occupied) {
221 breakinfo[breakno].occupied = 1; 226 breakinfo[breakno].occupied = 1;
227 breakinfo[breakno].skip = 0;
222 breakinfo[breakno].enabled = 1; 228 breakinfo[breakno].enabled = 1;
223 breakinfo[breakno].addr = addr; 229 breakinfo[breakno].addr = addr;
224 breakinfo[breakno].dataacc = dataacc; 230 breakinfo[breakno].dataacc = dataacc;
@@ -363,12 +369,12 @@ void kgdb_passive_cpu_callback(void *info)
363 369
364void kgdb_roundup_cpus(unsigned long flags) 370void kgdb_roundup_cpus(unsigned long flags)
365{ 371{
366 smp_call_function(kgdb_passive_cpu_callback, NULL, 0, 0); 372 smp_call_function(kgdb_passive_cpu_callback, NULL, 0);
367} 373}
368 374
369void kgdb_roundup_cpu(int cpu, unsigned long flags) 375void kgdb_roundup_cpu(int cpu, unsigned long flags)
370{ 376{
371 smp_call_function_single(cpu, kgdb_passive_cpu_callback, NULL, 0, 0); 377 smp_call_function_single(cpu, kgdb_passive_cpu_callback, NULL, 0);
372} 378}
373#endif 379#endif
374 380
@@ -385,10 +391,8 @@ int kgdb_arch_handle_exception(int vector, int signo,
385 struct pt_regs *regs) 391 struct pt_regs *regs)
386{ 392{
387 long addr; 393 long addr;
388 long breakno;
389 char *ptr; 394 char *ptr;
390 int newPC; 395 int newPC;
391 int wp_status;
392 int i; 396 int i;
393 397
394 switch (remcom_in_buffer[0]) { 398 switch (remcom_in_buffer[0]) {
@@ -426,17 +430,6 @@ int kgdb_arch_handle_exception(int vector, int signo,
426 kgdb_single_step = i + 1; 430 kgdb_single_step = i + 1;
427 } 431 }
428 432
429 if (vector == VEC_WATCH) {
430 wp_status = bfin_read_WPSTAT();
431 for (breakno = 0; breakno < HW_WATCHPOINT_NUM; breakno++) {
432 if (wp_status & (1 << breakno)) {
433 breakinfo->skip = 1;
434 break;
435 }
436 }
437 bfin_write_WPSTAT(0);
438 }
439
440 bfin_correct_hw_break(); 433 bfin_correct_hw_break();
441 434
442 return 0; 435 return 0;
@@ -478,57 +471,32 @@ static int validate_memory_access_address(unsigned long addr, int size)
478 return 0; 471 return 0;
479 if (addr >= SYSMMR_BASE) 472 if (addr >= SYSMMR_BASE)
480 return 0; 473 return 0;
481 if (addr >= ASYNC_BANK0_BASE 474 if (IN_MEM(addr, size, ASYNC_BANK0_BASE, ASYNC_BANK_SIZE))
482 && addr + size <= ASYNC_BANK3_BASE + ASYNC_BANK3_SIZE)
483 return 0; 475 return 0;
484 if (cpu == 0) { 476 if (cpu == 0) {
485 if (addr >= L1_SCRATCH_START 477 if (IN_MEM(addr, size, L1_SCRATCH_START, L1_SCRATCH_LENGTH))
486 && (addr + size <= L1_SCRATCH_START + L1_SCRATCH_LENGTH))
487 return 0; 478 return 0;
488#if L1_CODE_LENGTH != 0 479 if (IN_MEM(addr, size, L1_CODE_START, L1_CODE_LENGTH))
489 if (addr >= L1_CODE_START
490 && (addr + size <= L1_CODE_START + L1_CODE_LENGTH))
491 return 0; 480 return 0;
492#endif 481 if (IN_MEM(addr, size, L1_DATA_A_START, L1_DATA_A_LENGTH))
493#if L1_DATA_A_LENGTH != 0
494 if (addr >= L1_DATA_A_START
495 && (addr + size <= L1_DATA_A_START + L1_DATA_A_LENGTH))
496 return 0; 482 return 0;
497#endif 483 if (IN_MEM(addr, size, L1_DATA_B_START, L1_DATA_B_LENGTH))
498#if L1_DATA_B_LENGTH != 0
499 if (addr >= L1_DATA_B_START
500 && (addr + size <= L1_DATA_B_START + L1_DATA_B_LENGTH))
501 return 0; 484 return 0;
502#endif
503#ifdef CONFIG_SMP 485#ifdef CONFIG_SMP
504 } else if (cpu == 1) { 486 } else if (cpu == 1) {
505 if (addr >= COREB_L1_SCRATCH_START 487 if (IN_MEM(addr, size, COREB_L1_SCRATCH_START, L1_SCRATCH_LENGTH))
506 && (addr + size <= COREB_L1_SCRATCH_START
507 + L1_SCRATCH_LENGTH))
508 return 0; 488 return 0;
509# if L1_CODE_LENGTH != 0 489 if (IN_MEM(addr, size, COREB_L1_CODE_START, L1_CODE_LENGTH))
510 if (addr >= COREB_L1_CODE_START
511 && (addr + size <= COREB_L1_CODE_START + L1_CODE_LENGTH))
512 return 0; 490 return 0;
513# endif 491 if (IN_MEM(addr, size, COREB_L1_DATA_A_START, L1_DATA_A_LENGTH))
514# if L1_DATA_A_LENGTH != 0
515 if (addr >= COREB_L1_DATA_A_START
516 && (addr + size <= COREB_L1_DATA_A_START + L1_DATA_A_LENGTH))
517 return 0; 492 return 0;
518# endif 493 if (IN_MEM(addr, size, COREB_L1_DATA_B_START, L1_DATA_B_LENGTH))
519# if L1_DATA_B_LENGTH != 0
520 if (addr >= COREB_L1_DATA_B_START
521 && (addr + size <= COREB_L1_DATA_B_START + L1_DATA_B_LENGTH))
522 return 0; 494 return 0;
523# endif
524#endif 495#endif
525 } 496 }
526 497
527#if L2_LENGTH != 0 498 if (IN_MEM(addr, size, L2_START, L2_LENGTH))
528 if (addr >= L2_START
529 && addr + size <= L2_START + L2_LENGTH)
530 return 0; 499 return 0;
531#endif
532 500
533 return EFAULT; 501 return EFAULT;
534} 502}
@@ -582,12 +550,9 @@ int kgdb_mem2hex(char *mem, char *buf, int count)
582 default: 550 default:
583 err = EFAULT; 551 err = EFAULT;
584 } 552 }
585 } else if (cpu == 0 && (unsigned int)mem >= L1_CODE_START && 553 } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH))
586 (unsigned int)(mem + count) <= L1_CODE_START + L1_CODE_LENGTH
587#ifdef CONFIG_SMP 554#ifdef CONFIG_SMP
588 || cpu == 1 && (unsigned int)mem >= COREB_L1_CODE_START && 555 || (cpu == 1 && IN_MEM(mem, count, COREB_L1_CODE_START, L1_CODE_LENGTH))
589 (unsigned int)(mem + count) <=
590 COREB_L1_CODE_START + L1_CODE_LENGTH
591#endif 556#endif
592 ) { 557 ) {
593 /* access L1 instruction SRAM*/ 558 /* access L1 instruction SRAM*/
@@ -658,12 +623,9 @@ int kgdb_ebin2mem(char *buf, char *mem, int count)
658 default: 623 default:
659 return EFAULT; 624 return EFAULT;
660 } 625 }
661 } else if (cpu == 0 && (unsigned int)mem >= L1_CODE_START && 626 } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH))
662 (unsigned int)(mem + count) < L1_CODE_START + L1_CODE_LENGTH
663#ifdef CONFIG_SMP 627#ifdef CONFIG_SMP
664 || cpu == 1 && (unsigned int)mem >= COREB_L1_CODE_START && 628 || (cpu == 1 && IN_MEM(mem, count, COREB_L1_CODE_START, L1_CODE_LENGTH))
665 (unsigned int)(mem + count) <=
666 COREB_L1_CODE_START + L1_CODE_LENGTH
667#endif 629#endif
668 ) { 630 ) {
669 /* access L1 instruction SRAM */ 631 /* access L1 instruction SRAM */
@@ -723,12 +685,9 @@ int kgdb_hex2mem(char *buf, char *mem, int count)
723 default: 685 default:
724 return EFAULT; 686 return EFAULT;
725 } 687 }
726 } else if (cpu == 0 && (unsigned int)mem >= L1_CODE_START && 688 } else if ((cpu == 0 && IN_MEM(mem, count, L1_CODE_START, L1_CODE_LENGTH))
727 (unsigned int)(mem + count) <= L1_CODE_START + L1_CODE_LENGTH
728#ifdef CONFIG_SMP 689#ifdef CONFIG_SMP
729 || cpu == 1 && (unsigned int)mem >= COREB_L1_CODE_START && 690 || (cpu == 1 && IN_MEM(mem, count, COREB_L1_CODE_START, L1_CODE_LENGTH))
730 (unsigned int)(mem + count) <=
731 COREB_L1_CODE_START + L1_CODE_LENGTH
732#endif 691#endif
733 ) { 692 ) {
734 /* access L1 instruction SRAM */ 693 /* access L1 instruction SRAM */
@@ -745,24 +704,16 @@ int kgdb_validate_break_address(unsigned long addr)
745 704
746 if (addr >= 0x1000 && (addr + BREAK_INSTR_SIZE) <= physical_mem_end) 705 if (addr >= 0x1000 && (addr + BREAK_INSTR_SIZE) <= physical_mem_end)
747 return 0; 706 return 0;
748 if (addr >= ASYNC_BANK0_BASE 707 if (IN_MEM(addr, BREAK_INSTR_SIZE, ASYNC_BANK0_BASE, ASYNC_BANK_SIZE))
749 && addr + BREAK_INSTR_SIZE <= ASYNC_BANK3_BASE + ASYNC_BANK3_BASE)
750 return 0; 708 return 0;
751#if L1_CODE_LENGTH != 0 709 if (cpu == 0 && IN_MEM(addr, BREAK_INSTR_SIZE, L1_CODE_START, L1_CODE_LENGTH))
752 if (cpu == 0 && addr >= L1_CODE_START
753 && addr + BREAK_INSTR_SIZE <= L1_CODE_START + L1_CODE_LENGTH)
754 return 0; 710 return 0;
755# ifdef CONFIG_SMP 711#ifdef CONFIG_SMP
756 else if (cpu == 1 && addr >= COREB_L1_CODE_START 712 else if (cpu == 1 && IN_MEM(addr, BREAK_INSTR_SIZE, COREB_L1_CODE_START, L1_CODE_LENGTH))
757 && addr + BREAK_INSTR_SIZE <= COREB_L1_CODE_START + L1_CODE_LENGTH)
758 return 0; 713 return 0;
759# endif
760#endif 714#endif
761#if L2_LENGTH != 0 715 if (IN_MEM(addr, BREAK_INSTR_SIZE, L2_START, L2_LENGTH))
762 if (addr >= L2_START
763 && addr + BREAK_INSTR_SIZE <= L2_START + L2_LENGTH)
764 return 0; 716 return 0;
765#endif
766 717
767 return EFAULT; 718 return EFAULT;
768} 719}
@@ -772,13 +723,9 @@ int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr)
772 int err; 723 int err;
773 int cpu = raw_smp_processor_id(); 724 int cpu = raw_smp_processor_id();
774 725
775 if ((cpu == 0 && (unsigned int)addr >= L1_CODE_START 726 if ((cpu == 0 && IN_MEM(addr, BREAK_INSTR_SIZE, L1_CODE_START, L1_CODE_LENGTH))
776 && (unsigned int)(addr + BREAK_INSTR_SIZE)
777 < L1_CODE_START + L1_CODE_LENGTH)
778#ifdef CONFIG_SMP 727#ifdef CONFIG_SMP
779 || (cpu == 1 && (unsigned int)addr >= COREB_L1_CODE_START 728 || (cpu == 1 && IN_MEM(addr, BREAK_INSTR_SIZE, COREB_L1_CODE_START, L1_CODE_LENGTH))
780 && (unsigned int)(addr + BREAK_INSTR_SIZE)
781 < COREB_L1_CODE_START + L1_CODE_LENGTH)
782#endif 729#endif
783 ) { 730 ) {
784 /* access L1 instruction SRAM */ 731 /* access L1 instruction SRAM */
@@ -804,9 +751,7 @@ int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr)
804 751
805int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle) 752int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle)
806{ 753{
807 if ((unsigned int)addr >= L1_CODE_START && 754 if (IN_MEM(addr, BREAK_INSTR_SIZE, L1_CODE_START, L1_CODE_LENGTH)) {
808 (unsigned int)(addr + BREAK_INSTR_SIZE) <
809 L1_CODE_START + L1_CODE_LENGTH) {
810 /* access L1 instruction SRAM */ 755 /* access L1 instruction SRAM */
811 if (dma_memcpy((void *)addr, bundle, BREAK_INSTR_SIZE) == NULL) 756 if (dma_memcpy((void *)addr, bundle, BREAK_INSTR_SIZE) == NULL)
812 return -EFAULT; 757 return -EFAULT;
diff --git a/arch/blackfin/kernel/kgdb_test.c b/arch/blackfin/kernel/kgdb_test.c
new file mode 100644
index 000000000000..3dba9c17304a
--- /dev/null
+++ b/arch/blackfin/kernel/kgdb_test.c
@@ -0,0 +1,123 @@
1/*
2 * arch/blackfin/kernel/kgdb_test.c - Blackfin kgdb tests
3 *
4 * Copyright 2005-2008 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#include <linux/module.h>
10#include <linux/kernel.h>
11#include <linux/init.h>
12#include <linux/proc_fs.h>
13
14#include <asm/current.h>
15#include <asm/uaccess.h>
16#include <asm/system.h>
17
18#include <asm/blackfin.h>
19
20static char cmdline[256];
21static unsigned long len;
22
23static int num1 __attribute__((l1_data));
24
25void kgdb_l1_test(void) __attribute__((l1_text));
26
27void kgdb_l1_test(void)
28{
29 printk(KERN_ALERT "L1(before change) : data variable addr = 0x%p, data value is %d\n", &num1, num1);
30 printk(KERN_ALERT "L1 : code function addr = 0x%p\n", kgdb_l1_test);
31 num1 = num1 + 10 ;
32 printk(KERN_ALERT "L1(after change) : data variable addr = 0x%p, data value is %d\n", &num1, num1);
33 return ;
34}
35#if L2_LENGTH
36
37static int num2 __attribute__((l2));
38void kgdb_l2_test(void) __attribute__((l2));
39
40void kgdb_l2_test(void)
41{
42 printk(KERN_ALERT "L2(before change) : data variable addr = 0x%p, data value is %d\n", &num2, num2);
43 printk(KERN_ALERT "L2 : code function addr = 0x%p\n", kgdb_l2_test);
44 num2 = num2 + 20 ;
45 printk(KERN_ALERT "L2(after change) : data variable addr = 0x%p, data value is %d\n", &num2, num2);
46 return ;
47}
48
49#endif
50
51
52int kgdb_test(char *name, int len, int count, int z)
53{
54 printk(KERN_DEBUG "kgdb name(%d): %s, %d, %d\n", len, name, count, z);
55 count = z;
56 return count;
57}
58
59static int test_proc_output(char *buf)
60{
61 kgdb_test("hello world!", 12, 0x55, 0x10);
62 kgdb_l1_test();
63 #if L2_LENGTH
64 kgdb_l2_test();
65 #endif
66
67 return 0;
68}
69
70static int test_read_proc(char *page, char **start, off_t off,
71 int count, int *eof, void *data)
72{
73 int len;
74
75 len = test_proc_output(page);
76 if (len <= off+count)
77 *eof = 1;
78 *start = page + off;
79 len -= off;
80 if (len > count)
81 len = count;
82 if (len < 0)
83 len = 0;
84 return len;
85}
86
87static int test_write_proc(struct file *file, const char *buffer,
88 unsigned long count, void *data)
89{
90 if (count >= 256)
91 len = 255;
92 else
93 len = count;
94
95 memcpy(cmdline, buffer, count);
96 cmdline[len] = 0;
97
98 return len;
99}
100
101static int __init kgdbtest_init(void)
102{
103 struct proc_dir_entry *entry;
104
105 entry = create_proc_entry("kgdbtest", 0, NULL);
106 if (entry == NULL)
107 return -ENOMEM;
108
109 entry->read_proc = test_read_proc;
110 entry->write_proc = test_write_proc;
111 entry->data = NULL;
112
113 return 0;
114}
115
116static void __exit kgdbtest_exit(void)
117{
118 remove_proc_entry("kgdbtest", NULL);
119}
120
121module_init(kgdbtest_init);
122module_exit(kgdbtest_exit);
123MODULE_LICENSE("GPL");
diff --git a/arch/blackfin/kernel/mcount.S b/arch/blackfin/kernel/mcount.S
new file mode 100644
index 000000000000..edcfb3865f46
--- /dev/null
+++ b/arch/blackfin/kernel/mcount.S
@@ -0,0 +1,70 @@
1/*
2 * linux/arch/blackfin/mcount.S
3 *
4 * Copyright (C) 2006 Analog Devices Inc.
5 *
6 * 2007/04/12 Save index, length, modify and base registers. --rpm
7 */
8
9#include <linux/linkage.h>
10#include <asm/blackfin.h>
11
12.text
13
14.align 4 /* just in case */
15
16ENTRY(__mcount)
17 [--sp] = i0;
18 [--sp] = i1;
19 [--sp] = i2;
20 [--sp] = i3;
21 [--sp] = l0;
22 [--sp] = l1;
23 [--sp] = l2;
24 [--sp] = l3;
25 [--sp] = m0;
26 [--sp] = m1;
27 [--sp] = m2;
28 [--sp] = m3;
29 [--sp] = b0;
30 [--sp] = b1;
31 [--sp] = b2;
32 [--sp] = b3;
33 [--sp] = ( r7:0, p5:0 );
34 [--sp] = ASTAT;
35
36 p1.L = _ipipe_trace_enable;
37 p1.H = _ipipe_trace_enable;
38 r7 = [p1];
39 CC = r7 == 0;
40 if CC jump out;
41 link 0x10;
42 r0 = 0x0;
43 [sp + 0xc] = r0; /* v */
44 r0 = 0x0; /* type: IPIPE_TRACE_FN */
45 r1 = rets;
46 p0 = [fp]; /* p0: Prior FP */
47 r2 = [p0 + 4]; /* r2: Prior RETS */
48 call ___ipipe_trace;
49 unlink;
50out:
51 ASTAT = [sp++];
52 ( r7:0, p5:0 ) = [sp++];
53 b3 = [sp++];
54 b2 = [sp++];
55 b1 = [sp++];
56 b0 = [sp++];
57 m3 = [sp++];
58 m2 = [sp++];
59 m1 = [sp++];
60 m0 = [sp++];
61 l3 = [sp++];
62 l2 = [sp++];
63 l1 = [sp++];
64 l0 = [sp++];
65 i3 = [sp++];
66 i2 = [sp++];
67 i1 = [sp++];
68 i0 = [sp++];
69 rts;
70ENDPROC(__mcount)
diff --git a/arch/blackfin/kernel/module.c b/arch/blackfin/kernel/module.c
index e1bebc80a5bf..1bd7f2d018a8 100644
--- a/arch/blackfin/kernel/module.c
+++ b/arch/blackfin/kernel/module.c
@@ -37,111 +37,6 @@
37#include <asm/dma.h> 37#include <asm/dma.h>
38#include <asm/cacheflush.h> 38#include <asm/cacheflush.h>
39 39
40/*
41 * handle arithmetic relocations.
42 * See binutils/bfd/elf32-bfin.c for more details
43 */
44#define RELOC_STACK_SIZE 100
45static uint32_t reloc_stack[RELOC_STACK_SIZE];
46static unsigned int reloc_stack_tos;
47
48#define is_reloc_stack_empty() ((reloc_stack_tos > 0)?0:1)
49
50static void reloc_stack_push(uint32_t value)
51{
52 reloc_stack[reloc_stack_tos++] = value;
53}
54
55static uint32_t reloc_stack_pop(void)
56{
57 return reloc_stack[--reloc_stack_tos];
58}
59
60static uint32_t reloc_stack_operate(unsigned int oper, struct module *mod)
61{
62 uint32_t value;
63
64 switch (oper) {
65 case R_add:
66 value = reloc_stack[reloc_stack_tos - 2] +
67 reloc_stack[reloc_stack_tos - 1];
68 reloc_stack_tos -= 2;
69 break;
70 case R_sub:
71 value = reloc_stack[reloc_stack_tos - 2] -
72 reloc_stack[reloc_stack_tos - 1];
73 reloc_stack_tos -= 2;
74 break;
75 case R_mult:
76 value = reloc_stack[reloc_stack_tos - 2] *
77 reloc_stack[reloc_stack_tos - 1];
78 reloc_stack_tos -= 2;
79 break;
80 case R_div:
81 value = reloc_stack[reloc_stack_tos - 2] /
82 reloc_stack[reloc_stack_tos - 1];
83 reloc_stack_tos -= 2;
84 break;
85 case R_mod:
86 value = reloc_stack[reloc_stack_tos - 2] %
87 reloc_stack[reloc_stack_tos - 1];
88 reloc_stack_tos -= 2;
89 break;
90 case R_lshift:
91 value = reloc_stack[reloc_stack_tos - 2] <<
92 reloc_stack[reloc_stack_tos - 1];
93 reloc_stack_tos -= 2;
94 break;
95 case R_rshift:
96 value = reloc_stack[reloc_stack_tos - 2] >>
97 reloc_stack[reloc_stack_tos - 1];
98 reloc_stack_tos -= 2;
99 break;
100 case R_and:
101 value = reloc_stack[reloc_stack_tos - 2] &
102 reloc_stack[reloc_stack_tos - 1];
103 reloc_stack_tos -= 2;
104 break;
105 case R_or:
106 value = reloc_stack[reloc_stack_tos - 2] |
107 reloc_stack[reloc_stack_tos - 1];
108 reloc_stack_tos -= 2;
109 break;
110 case R_xor:
111 value = reloc_stack[reloc_stack_tos - 2] ^
112 reloc_stack[reloc_stack_tos - 1];
113 reloc_stack_tos -= 2;
114 break;
115 case R_land:
116 value = reloc_stack[reloc_stack_tos - 2] &&
117 reloc_stack[reloc_stack_tos - 1];
118 reloc_stack_tos -= 2;
119 break;
120 case R_lor:
121 value = reloc_stack[reloc_stack_tos - 2] ||
122 reloc_stack[reloc_stack_tos - 1];
123 reloc_stack_tos -= 2;
124 break;
125 case R_neg:
126 value = -reloc_stack[reloc_stack_tos - 1];
127 reloc_stack_tos--;
128 break;
129 case R_comp:
130 value = ~reloc_stack[reloc_stack_tos - 1];
131 reloc_stack_tos -= 1;
132 break;
133 default:
134 printk(KERN_WARNING "module %s: unhandled reloction\n",
135 mod->name);
136 return 0;
137 }
138
139 /* now push the new value back on stack */
140 reloc_stack_push(value);
141
142 return value;
143}
144
145void *module_alloc(unsigned long size) 40void *module_alloc(unsigned long size)
146{ 41{
147 if (size == 0) 42 if (size == 0)
@@ -334,16 +229,18 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
334 undefined symbols have been resolved. */ 229 undefined symbols have been resolved. */
335 sym = (Elf32_Sym *) sechdrs[symindex].sh_addr 230 sym = (Elf32_Sym *) sechdrs[symindex].sh_addr
336 + ELF32_R_SYM(rel[i].r_info); 231 + ELF32_R_SYM(rel[i].r_info);
337 if (is_reloc_stack_empty()) { 232 value = sym->st_value;
338 value = sym->st_value;
339 } else {
340 value = reloc_stack_pop();
341 }
342 value += rel[i].r_addend; 233 value += rel[i].r_addend;
343 pr_debug("location is %x, value is %x type is %d \n", 234 pr_debug("location is %x, value is %x type is %d \n",
344 (unsigned int) location32, value, 235 (unsigned int) location32, value,
345 ELF32_R_TYPE(rel[i].r_info)); 236 ELF32_R_TYPE(rel[i].r_info));
346 237#ifdef CONFIG_SMP
238 if ((unsigned long)location16 >= COREB_L1_DATA_A_START) {
239 printk(KERN_ERR "module %s: cannot relocate in L1: %u (SMP kernel)",
240 mod->name, ELF32_R_TYPE(rel[i].r_info));
241 return -ENOEXEC;
242 }
243#endif
347 switch (ELF32_R_TYPE(rel[i].r_info)) { 244 switch (ELF32_R_TYPE(rel[i].r_info)) {
348 245
349 case R_pcrel24: 246 case R_pcrel24:
@@ -355,6 +252,12 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
355 location32 = (uint32_t *) location16; 252 location32 = (uint32_t *) location16;
356 value -= (uint32_t) location32; 253 value -= (uint32_t) location32;
357 value >>= 1; 254 value >>= 1;
255 if ((value & 0xFF000000) != 0 &&
256 (value & 0xFF000000) != 0xFF000000) {
257 printk(KERN_ERR "module %s: relocation overflow\n",
258 mod->name);
259 return -ENOEXEC;
260 }
358 pr_debug("value is %x, before %x-%x after %x-%x\n", value, 261 pr_debug("value is %x, before %x-%x after %x-%x\n", value,
359 *location16, *(location16 + 1), 262 *location16, *(location16 + 1),
360 (*location16 & 0xff00) | (value >> 16 & 0x00ff), 263 (*location16 & 0xff00) | (value >> 16 & 0x00ff),
@@ -399,28 +302,6 @@ apply_relocate_add(Elf_Shdr * sechdrs, const char *strtab,
399 pr_debug("before %x after %x\n", *location32, value); 302 pr_debug("before %x after %x\n", *location32, value);
400 *location32 = value; 303 *location32 = value;
401 break; 304 break;
402 case R_push:
403 reloc_stack_push(value);
404 break;
405 case R_const:
406 reloc_stack_push(rel[i].r_addend);
407 break;
408 case R_add:
409 case R_sub:
410 case R_mult:
411 case R_div:
412 case R_mod:
413 case R_lshift:
414 case R_rshift:
415 case R_and:
416 case R_or:
417 case R_xor:
418 case R_land:
419 case R_lor:
420 case R_neg:
421 case R_comp:
422 reloc_stack_operate(ELF32_R_TYPE(rel[i].r_info), mod);
423 break;
424 default: 305 default:
425 printk(KERN_ERR "module %s: Unknown relocation: %u\n", 306 printk(KERN_ERR "module %s: Unknown relocation: %u\n",
426 mod->name, ELF32_R_TYPE(rel[i].r_info)); 307 mod->name, ELF32_R_TYPE(rel[i].r_info));
@@ -436,6 +317,7 @@ module_finalize(const Elf_Ehdr * hdr,
436{ 317{
437 unsigned int i, strindex = 0, symindex = 0; 318 unsigned int i, strindex = 0, symindex = 0;
438 char *secstrings; 319 char *secstrings;
320 long err = 0;
439 321
440 secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; 322 secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
441 323
@@ -460,8 +342,10 @@ module_finalize(const Elf_Ehdr * hdr,
460 (strcmp(".rela.l1.text", secstrings + sechdrs[i].sh_name) == 0) || 342 (strcmp(".rela.l1.text", secstrings + sechdrs[i].sh_name) == 0) ||
461 ((strcmp(".rela.text", secstrings + sechdrs[i].sh_name) == 0) && 343 ((strcmp(".rela.text", secstrings + sechdrs[i].sh_name) == 0) &&
462 (hdr->e_flags & (EF_BFIN_CODE_IN_L1|EF_BFIN_CODE_IN_L2))))) { 344 (hdr->e_flags & (EF_BFIN_CODE_IN_L1|EF_BFIN_CODE_IN_L2))))) {
463 apply_relocate_add((Elf_Shdr *) sechdrs, strtab, 345 err = apply_relocate_add((Elf_Shdr *) sechdrs, strtab,
464 symindex, i, mod); 346 symindex, i, mod);
347 if (err < 0)
348 return -ENOEXEC;
465 } 349 }
466 } 350 }
467 return 0; 351 return 0;
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 0c3ea118b657..33e2e8993f7f 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -39,6 +39,7 @@
39 39
40#include <asm/blackfin.h> 40#include <asm/blackfin.h>
41#include <asm/fixed_code.h> 41#include <asm/fixed_code.h>
42#include <asm/mem_map.h>
42 43
43asmlinkage void ret_from_fork(void); 44asmlinkage void ret_from_fork(void);
44 45
@@ -81,11 +82,14 @@ void cpu_idle(void)__attribute__((l1_text));
81 */ 82 */
82static void default_idle(void) 83static void default_idle(void)
83{ 84{
84 local_irq_disable(); 85#ifdef CONFIG_IPIPE
86 ipipe_suspend_domain();
87#endif
88 local_irq_disable_hw();
85 if (!need_resched()) 89 if (!need_resched())
86 idle_with_irq_disabled(); 90 idle_with_irq_disabled();
87 91
88 local_irq_enable(); 92 local_irq_enable_hw();
89} 93}
90 94
91/* 95/*
@@ -154,6 +158,7 @@ pid_t kernel_thread(int (*fn) (void *), void *arg, unsigned long flags)
154 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, 158 return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL,
155 NULL); 159 NULL);
156} 160}
161EXPORT_SYMBOL(kernel_thread);
157 162
158void flush_thread(void) 163void flush_thread(void)
159{ 164{
@@ -170,6 +175,13 @@ asmlinkage int bfin_clone(struct pt_regs *regs)
170 unsigned long clone_flags; 175 unsigned long clone_flags;
171 unsigned long newsp; 176 unsigned long newsp;
172 177
178#ifdef __ARCH_SYNC_CORE_DCACHE
179 if (current->rt.nr_cpus_allowed == num_possible_cpus()) {
180 current->cpus_allowed = cpumask_of_cpu(smp_processor_id());
181 current->rt.nr_cpus_allowed = 1;
182 }
183#endif
184
173 /* syscall2 puts clone_flags in r0 and usp in r1 */ 185 /* syscall2 puts clone_flags in r0 and usp in r1 */
174 clone_flags = regs->r0; 186 clone_flags = regs->r0;
175 newsp = regs->r1; 187 newsp = regs->r1;
@@ -337,22 +349,22 @@ int _access_ok(unsigned long addr, unsigned long size)
337 if (addr >= (unsigned long)__init_begin && 349 if (addr >= (unsigned long)__init_begin &&
338 addr + size <= (unsigned long)__init_end) 350 addr + size <= (unsigned long)__init_end)
339 return 1; 351 return 1;
340 if (addr >= L1_SCRATCH_START 352 if (addr >= get_l1_scratch_start()
341 && addr + size <= L1_SCRATCH_START + L1_SCRATCH_LENGTH) 353 && addr + size <= get_l1_scratch_start() + L1_SCRATCH_LENGTH)
342 return 1; 354 return 1;
343#if L1_CODE_LENGTH != 0 355#if L1_CODE_LENGTH != 0
344 if (addr >= L1_CODE_START + (_etext_l1 - _stext_l1) 356 if (addr >= get_l1_code_start() + (_etext_l1 - _stext_l1)
345 && addr + size <= L1_CODE_START + L1_CODE_LENGTH) 357 && addr + size <= get_l1_code_start() + L1_CODE_LENGTH)
346 return 1; 358 return 1;
347#endif 359#endif
348#if L1_DATA_A_LENGTH != 0 360#if L1_DATA_A_LENGTH != 0
349 if (addr >= L1_DATA_A_START + (_ebss_l1 - _sdata_l1) 361 if (addr >= get_l1_data_a_start() + (_ebss_l1 - _sdata_l1)
350 && addr + size <= L1_DATA_A_START + L1_DATA_A_LENGTH) 362 && addr + size <= get_l1_data_a_start() + L1_DATA_A_LENGTH)
351 return 1; 363 return 1;
352#endif 364#endif
353#if L1_DATA_B_LENGTH != 0 365#if L1_DATA_B_LENGTH != 0
354 if (addr >= L1_DATA_B_START + (_ebss_b_l1 - _sdata_b_l1) 366 if (addr >= get_l1_data_b_start() + (_ebss_b_l1 - _sdata_b_l1)
355 && addr + size <= L1_DATA_B_START + L1_DATA_B_LENGTH) 367 && addr + size <= get_l1_data_b_start() + L1_DATA_B_LENGTH)
356 return 1; 368 return 1;
357#endif 369#endif
358#if L2_LENGTH != 0 370#if L2_LENGTH != 0
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c
index 140bf00e9974..594e325b40e4 100644
--- a/arch/blackfin/kernel/ptrace.c
+++ b/arch/blackfin/kernel/ptrace.c
@@ -45,6 +45,7 @@
45#include <asm/asm-offsets.h> 45#include <asm/asm-offsets.h>
46#include <asm/dma.h> 46#include <asm/dma.h>
47#include <asm/fixed_code.h> 47#include <asm/fixed_code.h>
48#include <asm/mem_map.h>
48 49
49#define TEXT_OFFSET 0 50#define TEXT_OFFSET 0
50/* 51/*
@@ -80,10 +81,12 @@ static inline struct pt_regs *get_user_regs(struct task_struct *task)
80/* 81/*
81 * Get all user integer registers. 82 * Get all user integer registers.
82 */ 83 */
83static inline int ptrace_getregs(struct task_struct *tsk, void __user * uregs) 84static inline int ptrace_getregs(struct task_struct *tsk, void __user *uregs)
84{ 85{
85 struct pt_regs *regs = get_user_regs(tsk); 86 struct pt_regs regs;
86 return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0; 87 memcpy(&regs, get_user_regs(tsk), sizeof(regs));
88 regs.usp = tsk->thread.usp;
89 return copy_to_user(uregs, &regs, sizeof(struct pt_regs)) ? -EFAULT : 0;
87} 90}
88 91
89/* Mapping from PT_xxx to the stack offset at which the register is 92/* Mapping from PT_xxx to the stack offset at which the register is
@@ -157,15 +160,15 @@ put_reg(struct task_struct *task, int regno, unsigned long data)
157static inline int is_user_addr_valid(struct task_struct *child, 160static inline int is_user_addr_valid(struct task_struct *child,
158 unsigned long start, unsigned long len) 161 unsigned long start, unsigned long len)
159{ 162{
160 struct vm_list_struct *vml; 163 struct vm_area_struct *vma;
161 struct sram_list_struct *sraml; 164 struct sram_list_struct *sraml;
162 165
163 /* overflow */ 166 /* overflow */
164 if (start + len < start) 167 if (start + len < start)
165 return -EIO; 168 return -EIO;
166 169
167 for (vml = child->mm->context.vmlist; vml; vml = vml->next) 170 vma = find_vma(child->mm, start);
168 if (start >= vml->vma->vm_start && start + len < vml->vma->vm_end) 171 if (vma && start >= vma->vm_start && start + len <= vma->vm_end)
169 return 0; 172 return 0;
170 173
171 for (sraml = child->mm->context.sram_list; sraml; sraml = sraml->next) 174 for (sraml = child->mm->context.sram_list; sraml; sraml = sraml->next)
@@ -220,8 +223,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
220 break; 223 break;
221 pr_debug("ptrace: user address is valid\n"); 224 pr_debug("ptrace: user address is valid\n");
222 225
223 if (L1_CODE_LENGTH != 0 && addr >= L1_CODE_START 226 if (L1_CODE_LENGTH != 0 && addr >= get_l1_code_start()
224 && addr + sizeof(tmp) <= L1_CODE_START + L1_CODE_LENGTH) { 227 && addr + sizeof(tmp) <= get_l1_code_start() + L1_CODE_LENGTH) {
225 safe_dma_memcpy (&tmp, (const void *)(addr), sizeof(tmp)); 228 safe_dma_memcpy (&tmp, (const void *)(addr), sizeof(tmp));
226 copied = sizeof(tmp); 229 copied = sizeof(tmp);
227 230
@@ -300,8 +303,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
300 break; 303 break;
301 pr_debug("ptrace: user address is valid\n"); 304 pr_debug("ptrace: user address is valid\n");
302 305
303 if (L1_CODE_LENGTH != 0 && addr >= L1_CODE_START 306 if (L1_CODE_LENGTH != 0 && addr >= get_l1_code_start()
304 && addr + sizeof(data) <= L1_CODE_START + L1_CODE_LENGTH) { 307 && addr + sizeof(data) <= get_l1_code_start() + L1_CODE_LENGTH) {
305 safe_dma_memcpy ((void *)(addr), &data, sizeof(data)); 308 safe_dma_memcpy ((void *)(addr), &data, sizeof(data));
306 copied = sizeof(data); 309 copied = sizeof(data);
307 310
diff --git a/arch/blackfin/kernel/reboot.c b/arch/blackfin/kernel/reboot.c
index ae97ca407b0d..eeee8cb43360 100644
--- a/arch/blackfin/kernel/reboot.c
+++ b/arch/blackfin/kernel/reboot.c
@@ -21,7 +21,7 @@
21 * the core reset. 21 * the core reset.
22 */ 22 */
23__attribute__((l1_text)) 23__attribute__((l1_text))
24static void bfin_reset(void) 24static void _bfin_reset(void)
25{ 25{
26 /* Wait for completion of "system" events such as cache line 26 /* Wait for completion of "system" events such as cache line
27 * line fills so that we avoid infinite stalls later on as 27 * line fills so that we avoid infinite stalls later on as
@@ -66,6 +66,18 @@ static void bfin_reset(void)
66 } 66 }
67} 67}
68 68
69static void bfin_reset(void)
70{
71 if (ANOMALY_05000353 || ANOMALY_05000386)
72 _bfin_reset();
73 else
74 /* the bootrom checks to see how it was reset and will
75 * automatically perform a software reset for us when
76 * it starts executing boot
77 */
78 asm("raise 1;");
79}
80
69__attribute__((weak)) 81__attribute__((weak))
70void native_machine_restart(char *cmd) 82void native_machine_restart(char *cmd)
71{ 83{
@@ -75,14 +87,10 @@ void machine_restart(char *cmd)
75{ 87{
76 native_machine_restart(cmd); 88 native_machine_restart(cmd);
77 local_irq_disable(); 89 local_irq_disable();
78 if (ANOMALY_05000353 || ANOMALY_05000386) 90 if (smp_processor_id())
79 bfin_reset(); 91 smp_call_function((void *)bfin_reset, 0, 1);
80 else 92 else
81 /* the bootrom checks to see how it was reset and will 93 bfin_reset();
82 * automatically perform a software reset for us when
83 * it starts executing boot
84 */
85 asm("raise 1;");
86} 94}
87 95
88__attribute__((weak)) 96__attribute__((weak))
diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 71a9a8c53cea..b2a811347b65 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -13,6 +13,7 @@
13#include <linux/bootmem.h> 13#include <linux/bootmem.h>
14#include <linux/seq_file.h> 14#include <linux/seq_file.h>
15#include <linux/cpu.h> 15#include <linux/cpu.h>
16#include <linux/mm.h>
16#include <linux/module.h> 17#include <linux/module.h>
17#include <linux/tty.h> 18#include <linux/tty.h>
18#include <linux/pfn.h> 19#include <linux/pfn.h>
@@ -26,11 +27,10 @@
26#include <asm/blackfin.h> 27#include <asm/blackfin.h>
27#include <asm/cplbinit.h> 28#include <asm/cplbinit.h>
28#include <asm/div64.h> 29#include <asm/div64.h>
30#include <asm/cpu.h>
29#include <asm/fixed_code.h> 31#include <asm/fixed_code.h>
30#include <asm/early_printk.h> 32#include <asm/early_printk.h>
31 33
32static DEFINE_PER_CPU(struct cpu, cpu_devices);
33
34u16 _bfin_swrst; 34u16 _bfin_swrst;
35EXPORT_SYMBOL(_bfin_swrst); 35EXPORT_SYMBOL(_bfin_swrst);
36 36
@@ -79,27 +79,68 @@ static struct change_member *change_point[2*BFIN_MEMMAP_MAX] __initdata;
79static struct bfin_memmap_entry *overlap_list[BFIN_MEMMAP_MAX] __initdata; 79static struct bfin_memmap_entry *overlap_list[BFIN_MEMMAP_MAX] __initdata;
80static struct bfin_memmap_entry new_map[BFIN_MEMMAP_MAX] __initdata; 80static struct bfin_memmap_entry new_map[BFIN_MEMMAP_MAX] __initdata;
81 81
82void __init bfin_cache_init(void) 82DEFINE_PER_CPU(struct blackfin_cpudata, cpu_data);
83{ 83
84static int early_init_clkin_hz(char *buf);
85
84#if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE) 86#if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE)
85 generate_cplb_tables(); 87void __init generate_cplb_tables(void)
88{
89 unsigned int cpu;
90
91 generate_cplb_tables_all();
92 /* Generate per-CPU I&D CPLB tables */
93 for (cpu = 0; cpu < num_possible_cpus(); ++cpu)
94 generate_cplb_tables_cpu(cpu);
95}
86#endif 96#endif
87 97
98void __cpuinit bfin_setup_caches(unsigned int cpu)
99{
88#ifdef CONFIG_BFIN_ICACHE 100#ifdef CONFIG_BFIN_ICACHE
89 bfin_icache_init(); 101 bfin_icache_init(icplb_tbl[cpu]);
90 printk(KERN_INFO "Instruction Cache Enabled\n");
91#endif 102#endif
92 103
93#ifdef CONFIG_BFIN_DCACHE 104#ifdef CONFIG_BFIN_DCACHE
94 bfin_dcache_init(); 105 bfin_dcache_init(dcplb_tbl[cpu]);
95 printk(KERN_INFO "Data Cache Enabled" 106#endif
107
108 /*
109 * In cache coherence emulation mode, we need to have the
110 * D-cache enabled before running any atomic operation which
111 * might invove cache invalidation (i.e. spinlock, rwlock).
112 * So printk's are deferred until then.
113 */
114#ifdef CONFIG_BFIN_ICACHE
115 printk(KERN_INFO "Instruction Cache Enabled for CPU%u\n", cpu);
116#endif
117#ifdef CONFIG_BFIN_DCACHE
118 printk(KERN_INFO "Data Cache Enabled for CPU%u"
96# if defined CONFIG_BFIN_WB 119# if defined CONFIG_BFIN_WB
97 " (write-back)" 120 " (write-back)"
98# elif defined CONFIG_BFIN_WT 121# elif defined CONFIG_BFIN_WT
99 " (write-through)" 122 " (write-through)"
100# endif 123# endif
101 "\n"); 124 "\n", cpu);
125#endif
126}
127
128void __cpuinit bfin_setup_cpudata(unsigned int cpu)
129{
130 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu);
131
132 cpudata->idle = current;
133 cpudata->loops_per_jiffy = loops_per_jiffy;
134 cpudata->imemctl = bfin_read_IMEM_CONTROL();
135 cpudata->dmemctl = bfin_read_DMEM_CONTROL();
136}
137
138void __init bfin_cache_init(void)
139{
140#if defined(CONFIG_BFIN_DCACHE) || defined(CONFIG_BFIN_ICACHE)
141 generate_cplb_tables();
102#endif 142#endif
143 bfin_setup_caches(0);
103} 144}
104 145
105void __init bfin_relocate_l1_mem(void) 146void __init bfin_relocate_l1_mem(void)
@@ -109,6 +150,8 @@ void __init bfin_relocate_l1_mem(void)
109 unsigned long l1_data_b_length; 150 unsigned long l1_data_b_length;
110 unsigned long l2_length; 151 unsigned long l2_length;
111 152
153 blackfin_dma_early_init();
154
112 l1_code_length = _etext_l1 - _stext_l1; 155 l1_code_length = _etext_l1 - _stext_l1;
113 if (l1_code_length > L1_CODE_LENGTH) 156 if (l1_code_length > L1_CODE_LENGTH)
114 panic("L1 Instruction SRAM Overflow\n"); 157 panic("L1 Instruction SRAM Overflow\n");
@@ -230,7 +273,7 @@ static int __init sanitize_memmap(struct bfin_memmap_entry *map, int *pnr_map)
230 /* record all known change-points (starting and ending addresses), 273 /* record all known change-points (starting and ending addresses),
231 omitting those that are for empty memory regions */ 274 omitting those that are for empty memory regions */
232 chgidx = 0; 275 chgidx = 0;
233 for (i = 0; i < old_nr; i++) { 276 for (i = 0; i < old_nr; i++) {
234 if (map[i].size != 0) { 277 if (map[i].size != 0) {
235 change_point[chgidx]->addr = map[i].addr; 278 change_point[chgidx]->addr = map[i].addr;
236 change_point[chgidx++]->pentry = &map[i]; 279 change_point[chgidx++]->pentry = &map[i];
@@ -238,13 +281,13 @@ static int __init sanitize_memmap(struct bfin_memmap_entry *map, int *pnr_map)
238 change_point[chgidx++]->pentry = &map[i]; 281 change_point[chgidx++]->pentry = &map[i];
239 } 282 }
240 } 283 }
241 chg_nr = chgidx; /* true number of change-points */ 284 chg_nr = chgidx; /* true number of change-points */
242 285
243 /* sort change-point list by memory addresses (low -> high) */ 286 /* sort change-point list by memory addresses (low -> high) */
244 still_changing = 1; 287 still_changing = 1;
245 while (still_changing) { 288 while (still_changing) {
246 still_changing = 0; 289 still_changing = 0;
247 for (i = 1; i < chg_nr; i++) { 290 for (i = 1; i < chg_nr; i++) {
248 /* if <current_addr> > <last_addr>, swap */ 291 /* if <current_addr> > <last_addr>, swap */
249 /* or, if current=<start_addr> & last=<end_addr>, swap */ 292 /* or, if current=<start_addr> & last=<end_addr>, swap */
250 if ((change_point[i]->addr < change_point[i-1]->addr) || 293 if ((change_point[i]->addr < change_point[i-1]->addr) ||
@@ -261,10 +304,10 @@ static int __init sanitize_memmap(struct bfin_memmap_entry *map, int *pnr_map)
261 } 304 }
262 305
263 /* create a new memmap, removing overlaps */ 306 /* create a new memmap, removing overlaps */
264 overlap_entries = 0; /* number of entries in the overlap table */ 307 overlap_entries = 0; /* number of entries in the overlap table */
265 new_entry = 0; /* index for creating new memmap entries */ 308 new_entry = 0; /* index for creating new memmap entries */
266 last_type = 0; /* start with undefined memory type */ 309 last_type = 0; /* start with undefined memory type */
267 last_addr = 0; /* start with 0 as last starting address */ 310 last_addr = 0; /* start with 0 as last starting address */
268 /* loop through change-points, determining affect on the new memmap */ 311 /* loop through change-points, determining affect on the new memmap */
269 for (chgidx = 0; chgidx < chg_nr; chgidx++) { 312 for (chgidx = 0; chgidx < chg_nr; chgidx++) {
270 /* keep track of all overlapping memmap entries */ 313 /* keep track of all overlapping memmap entries */
@@ -286,14 +329,14 @@ static int __init sanitize_memmap(struct bfin_memmap_entry *map, int *pnr_map)
286 if (overlap_list[i]->type > current_type) 329 if (overlap_list[i]->type > current_type)
287 current_type = overlap_list[i]->type; 330 current_type = overlap_list[i]->type;
288 /* continue building up new memmap based on this information */ 331 /* continue building up new memmap based on this information */
289 if (current_type != last_type) { 332 if (current_type != last_type) {
290 if (last_type != 0) { 333 if (last_type != 0) {
291 new_map[new_entry].size = 334 new_map[new_entry].size =
292 change_point[chgidx]->addr - last_addr; 335 change_point[chgidx]->addr - last_addr;
293 /* move forward only if the new size was non-zero */ 336 /* move forward only if the new size was non-zero */
294 if (new_map[new_entry].size != 0) 337 if (new_map[new_entry].size != 0)
295 if (++new_entry >= BFIN_MEMMAP_MAX) 338 if (++new_entry >= BFIN_MEMMAP_MAX)
296 break; /* no more space left for new entries */ 339 break; /* no more space left for new entries */
297 } 340 }
298 if (current_type != 0) { 341 if (current_type != 0) {
299 new_map[new_entry].addr = change_point[chgidx]->addr; 342 new_map[new_entry].addr = change_point[chgidx]->addr;
@@ -303,9 +346,9 @@ static int __init sanitize_memmap(struct bfin_memmap_entry *map, int *pnr_map)
303 last_type = current_type; 346 last_type = current_type;
304 } 347 }
305 } 348 }
306 new_nr = new_entry; /* retain count for new entries */ 349 new_nr = new_entry; /* retain count for new entries */
307 350
308 /* copy new mapping into original location */ 351 /* copy new mapping into original location */
309 memcpy(map, new_map, new_nr*sizeof(struct bfin_memmap_entry)); 352 memcpy(map, new_map, new_nr*sizeof(struct bfin_memmap_entry));
310 *pnr_map = new_nr; 353 *pnr_map = new_nr;
311 354
@@ -361,7 +404,6 @@ static __init int parse_memmap(char *arg)
361 * - "memmap=XXX[KkmM][@][$]XXX[KkmM]" defines a memory region 404 * - "memmap=XXX[KkmM][@][$]XXX[KkmM]" defines a memory region
362 * @ from <start> to <start>+<mem>, type RAM 405 * @ from <start> to <start>+<mem>, type RAM
363 * $ from <start> to <start>+<mem>, type RESERVED 406 * $ from <start> to <start>+<mem>, type RESERVED
364 *
365 */ 407 */
366static __init void parse_cmdline_early(char *cmdline_p) 408static __init void parse_cmdline_early(char *cmdline_p)
367{ 409{
@@ -383,14 +425,15 @@ static __init void parse_cmdline_early(char *cmdline_p)
383 if (*to != ' ') { 425 if (*to != ' ') {
384 if (*to == '$' 426 if (*to == '$'
385 || *(to + 1) == '$') 427 || *(to + 1) == '$')
386 reserved_mem_dcache_on = 428 reserved_mem_dcache_on = 1;
387 1;
388 if (*to == '#' 429 if (*to == '#'
389 || *(to + 1) == '#') 430 || *(to + 1) == '#')
390 reserved_mem_icache_on = 431 reserved_mem_icache_on = 1;
391 1;
392 } 432 }
393 } 433 }
434 } else if (!memcmp(to, "clkin_hz=", 9)) {
435 to += 9;
436 early_init_clkin_hz(to);
394 } else if (!memcmp(to, "earlyprintk=", 12)) { 437 } else if (!memcmp(to, "earlyprintk=", 12)) {
395 to += 12; 438 to += 12;
396 setup_early_printk(to); 439 setup_early_printk(to);
@@ -417,9 +460,8 @@ static __init void parse_cmdline_early(char *cmdline_p)
417 * [_ramend - DMA_UNCACHED_REGION, 460 * [_ramend - DMA_UNCACHED_REGION,
418 * _ramend]: uncached DMA region 461 * _ramend]: uncached DMA region
419 * [_ramend, physical_mem_end]: memory not managed by kernel 462 * [_ramend, physical_mem_end]: memory not managed by kernel
420 *
421 */ 463 */
422static __init void memory_setup(void) 464static __init void memory_setup(void)
423{ 465{
424#ifdef CONFIG_MTD_UCLINUX 466#ifdef CONFIG_MTD_UCLINUX
425 unsigned long mtd_phys = 0; 467 unsigned long mtd_phys = 0;
@@ -436,7 +478,7 @@ static __init void memory_setup(void)
436 memory_end = _ramend - DMA_UNCACHED_REGION; 478 memory_end = _ramend - DMA_UNCACHED_REGION;
437 479
438#ifdef CONFIG_MPU 480#ifdef CONFIG_MPU
439 /* Round up to multiple of 4MB. */ 481 /* Round up to multiple of 4MB */
440 memory_start = (_ramstart + 0x3fffff) & ~0x3fffff; 482 memory_start = (_ramstart + 0x3fffff) & ~0x3fffff;
441#else 483#else
442 memory_start = PAGE_ALIGN(_ramstart); 484 memory_start = PAGE_ALIGN(_ramstart);
@@ -616,7 +658,7 @@ static __init void setup_bootmem_allocator(void)
616 end_pfn = memory_end >> PAGE_SHIFT; 658 end_pfn = memory_end >> PAGE_SHIFT;
617 659
618 /* 660 /*
619 * give all the memory to the bootmap allocator, tell it to put the 661 * give all the memory to the bootmap allocator, tell it to put the
620 * boot mem_map at the start of memory. 662 * boot mem_map at the start of memory.
621 */ 663 */
622 bootmap_size = init_bootmem_node(NODE_DATA(0), 664 bootmap_size = init_bootmem_node(NODE_DATA(0),
@@ -791,7 +833,11 @@ void __init setup_arch(char **cmdline_p)
791 bfin_write_SWRST(_bfin_swrst | DOUBLE_FAULT); 833 bfin_write_SWRST(_bfin_swrst | DOUBLE_FAULT);
792#endif 834#endif
793 835
836#ifdef CONFIG_SMP
837 if (_bfin_swrst & SWRST_DBL_FAULT_A) {
838#else
794 if (_bfin_swrst & RESET_DOUBLE) { 839 if (_bfin_swrst & RESET_DOUBLE) {
840#endif
795 printk(KERN_EMERG "Recovering from DOUBLE FAULT event\n"); 841 printk(KERN_EMERG "Recovering from DOUBLE FAULT event\n");
796#ifdef CONFIG_DEBUG_DOUBLEFAULT 842#ifdef CONFIG_DEBUG_DOUBLEFAULT
797 /* We assume the crashing kernel, and the current symbol table match */ 843 /* We assume the crashing kernel, and the current symbol table match */
@@ -823,9 +869,12 @@ void __init setup_arch(char **cmdline_p)
823 if (bfin_compiled_revid() == -1) 869 if (bfin_compiled_revid() == -1)
824 printk(KERN_ERR "Warning: Compiled for Rev none, but running on Rev %d\n", 870 printk(KERN_ERR "Warning: Compiled for Rev none, but running on Rev %d\n",
825 bfin_revid()); 871 bfin_revid());
826 else if (bfin_compiled_revid() != 0xffff) 872 else if (bfin_compiled_revid() != 0xffff) {
827 printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n", 873 printk(KERN_ERR "Warning: Compiled for Rev %d, but running on Rev %d\n",
828 bfin_compiled_revid(), bfin_revid()); 874 bfin_compiled_revid(), bfin_revid());
875 if (bfin_compiled_revid() > bfin_revid())
876 panic("Error: you are missing anomaly workarounds for this rev\n");
877 }
829 } 878 }
830 if (bfin_revid() < CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX) 879 if (bfin_revid() < CONFIG_BF_REV_MIN || bfin_revid() > CONFIG_BF_REV_MAX)
831 printk(KERN_ERR "Warning: Unsupported Chip Revision ADSP-%s Rev 0.%d detected\n", 880 printk(KERN_ERR "Warning: Unsupported Chip Revision ADSP-%s Rev 0.%d detected\n",
@@ -835,7 +884,7 @@ void __init setup_arch(char **cmdline_p)
835 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n"); 884 printk(KERN_INFO "Blackfin Linux support by http://blackfin.uclinux.org/\n");
836 885
837 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n", 886 printk(KERN_INFO "Processor Speed: %lu MHz core clock and %lu MHz System Clock\n",
838 cclk / 1000000, sclk / 1000000); 887 cclk / 1000000, sclk / 1000000);
839 888
840 if (ANOMALY_05000273 && (cclk >> 1) <= sclk) 889 if (ANOMALY_05000273 && (cclk >> 1) <= sclk)
841 printk("\n\n\nANOMALY_05000273: CCLK must be >= 2*SCLK !!!\n\n\n"); 890 printk("\n\n\nANOMALY_05000273: CCLK must be >= 2*SCLK !!!\n\n\n");
@@ -867,18 +916,21 @@ void __init setup_arch(char **cmdline_p)
867 BUG_ON((char *)&safe_user_instruction - (char *)&fixed_code_start 916 BUG_ON((char *)&safe_user_instruction - (char *)&fixed_code_start
868 != SAFE_USER_INSTRUCTION - FIXED_CODE_START); 917 != SAFE_USER_INSTRUCTION - FIXED_CODE_START);
869 918
919#ifdef CONFIG_SMP
920 platform_init_cpus();
921#endif
870 init_exception_vectors(); 922 init_exception_vectors();
871 bfin_cache_init(); 923 bfin_cache_init(); /* Initialize caches for the boot CPU */
872} 924}
873 925
874static int __init topology_init(void) 926static int __init topology_init(void)
875{ 927{
876 int cpu; 928 unsigned int cpu;
929 /* Record CPU-private information for the boot processor. */
930 bfin_setup_cpudata(0);
877 931
878 for_each_possible_cpu(cpu) { 932 for_each_possible_cpu(cpu) {
879 struct cpu *c = &per_cpu(cpu_devices, cpu); 933 register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu);
880
881 register_cpu(c, cpu);
882 } 934 }
883 935
884 return 0; 936 return 0;
@@ -886,36 +938,54 @@ static int __init topology_init(void)
886 938
887subsys_initcall(topology_init); 939subsys_initcall(topology_init);
888 940
941/* Get the input clock frequency */
942static u_long cached_clkin_hz = CONFIG_CLKIN_HZ;
943static u_long get_clkin_hz(void)
944{
945 return cached_clkin_hz;
946}
947static int __init early_init_clkin_hz(char *buf)
948{
949 cached_clkin_hz = simple_strtoul(buf, NULL, 0);
950#ifdef BFIN_KERNEL_CLOCK
951 if (cached_clkin_hz != CONFIG_CLKIN_HZ)
952 panic("cannot change clkin_hz when reprogramming clocks");
953#endif
954 return 1;
955}
956early_param("clkin_hz=", early_init_clkin_hz);
957
889/* Get the voltage input multiplier */ 958/* Get the voltage input multiplier */
890static u_long cached_vco_pll_ctl, cached_vco;
891static u_long get_vco(void) 959static u_long get_vco(void)
892{ 960{
893 u_long msel; 961 static u_long cached_vco;
962 u_long msel, pll_ctl;
894 963
895 u_long pll_ctl = bfin_read_PLL_CTL(); 964 /* The assumption here is that VCO never changes at runtime.
896 if (pll_ctl == cached_vco_pll_ctl) 965 * If, someday, we support that, then we'll have to change this.
966 */
967 if (cached_vco)
897 return cached_vco; 968 return cached_vco;
898 else
899 cached_vco_pll_ctl = pll_ctl;
900 969
970 pll_ctl = bfin_read_PLL_CTL();
901 msel = (pll_ctl >> 9) & 0x3F; 971 msel = (pll_ctl >> 9) & 0x3F;
902 if (0 == msel) 972 if (0 == msel)
903 msel = 64; 973 msel = 64;
904 974
905 cached_vco = CONFIG_CLKIN_HZ; 975 cached_vco = get_clkin_hz();
906 cached_vco >>= (1 & pll_ctl); /* DF bit */ 976 cached_vco >>= (1 & pll_ctl); /* DF bit */
907 cached_vco *= msel; 977 cached_vco *= msel;
908 return cached_vco; 978 return cached_vco;
909} 979}
910 980
911/* Get the Core clock */ 981/* Get the Core clock */
912static u_long cached_cclk_pll_div, cached_cclk;
913u_long get_cclk(void) 982u_long get_cclk(void)
914{ 983{
984 static u_long cached_cclk_pll_div, cached_cclk;
915 u_long csel, ssel; 985 u_long csel, ssel;
916 986
917 if (bfin_read_PLL_STAT() & 0x1) 987 if (bfin_read_PLL_STAT() & 0x1)
918 return CONFIG_CLKIN_HZ; 988 return get_clkin_hz();
919 989
920 ssel = bfin_read_PLL_DIV(); 990 ssel = bfin_read_PLL_DIV();
921 if (ssel == cached_cclk_pll_div) 991 if (ssel == cached_cclk_pll_div)
@@ -934,21 +1004,21 @@ u_long get_cclk(void)
934EXPORT_SYMBOL(get_cclk); 1004EXPORT_SYMBOL(get_cclk);
935 1005
936/* Get the System clock */ 1006/* Get the System clock */
937static u_long cached_sclk_pll_div, cached_sclk;
938u_long get_sclk(void) 1007u_long get_sclk(void)
939{ 1008{
1009 static u_long cached_sclk;
940 u_long ssel; 1010 u_long ssel;
941 1011
942 if (bfin_read_PLL_STAT() & 0x1) 1012 /* The assumption here is that SCLK never changes at runtime.
943 return CONFIG_CLKIN_HZ; 1013 * If, someday, we support that, then we'll have to change this.
944 1014 */
945 ssel = bfin_read_PLL_DIV(); 1015 if (cached_sclk)
946 if (ssel == cached_sclk_pll_div)
947 return cached_sclk; 1016 return cached_sclk;
948 else
949 cached_sclk_pll_div = ssel;
950 1017
951 ssel &= 0xf; 1018 if (bfin_read_PLL_STAT() & 0x1)
1019 return get_clkin_hz();
1020
1021 ssel = bfin_read_PLL_DIV() & 0xf;
952 if (0 == ssel) { 1022 if (0 == ssel) {
953 printk(KERN_WARNING "Invalid System Clock\n"); 1023 printk(KERN_WARNING "Invalid System Clock\n");
954 ssel = 1; 1024 ssel = 1;
@@ -982,17 +1052,18 @@ static int show_cpuinfo(struct seq_file *m, void *v)
982{ 1052{
983 char *cpu, *mmu, *fpu, *vendor, *cache; 1053 char *cpu, *mmu, *fpu, *vendor, *cache;
984 uint32_t revid; 1054 uint32_t revid;
985 1055 int cpu_num = *(unsigned int *)v;
986 u_long cclk = 0, sclk = 0; 1056 u_long sclk, cclk;
987 u_int icache_size = BFIN_ICACHESIZE / 1024, dcache_size = 0, dsup_banks = 0; 1057 u_int icache_size = BFIN_ICACHESIZE / 1024, dcache_size = 0, dsup_banks = 0;
1058 struct blackfin_cpudata *cpudata = &per_cpu(cpu_data, cpu_num);
988 1059
989 cpu = CPU; 1060 cpu = CPU;
990 mmu = "none"; 1061 mmu = "none";
991 fpu = "none"; 1062 fpu = "none";
992 revid = bfin_revid(); 1063 revid = bfin_revid();
993 1064
994 cclk = get_cclk();
995 sclk = get_sclk(); 1065 sclk = get_sclk();
1066 cclk = get_cclk();
996 1067
997 switch (bfin_read_CHIPID() & CHIPID_MANUFACTURE) { 1068 switch (bfin_read_CHIPID() & CHIPID_MANUFACTURE) {
998 case 0xca: 1069 case 0xca:
@@ -1003,10 +1074,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1003 break; 1074 break;
1004 } 1075 }
1005 1076
1006 seq_printf(m, "processor\t: %d\n" 1077 seq_printf(m, "processor\t: %d\n" "vendor_id\t: %s\n", cpu_num, vendor);
1007 "vendor_id\t: %s\n",
1008 *(unsigned int *)v,
1009 vendor);
1010 1078
1011 if (CPUID == bfin_cpuid()) 1079 if (CPUID == bfin_cpuid())
1012 seq_printf(m, "cpu family\t: 0x%04x\n", CPUID); 1080 seq_printf(m, "cpu family\t: 0x%04x\n", CPUID);
@@ -1029,12 +1097,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1029 sclk/1000000, sclk%1000000); 1097 sclk/1000000, sclk%1000000);
1030 seq_printf(m, "bogomips\t: %lu.%02lu\n" 1098 seq_printf(m, "bogomips\t: %lu.%02lu\n"
1031 "Calibration\t: %lu loops\n", 1099 "Calibration\t: %lu loops\n",
1032 (loops_per_jiffy * HZ) / 500000, 1100 (cpudata->loops_per_jiffy * HZ) / 500000,
1033 ((loops_per_jiffy * HZ) / 5000) % 100, 1101 ((cpudata->loops_per_jiffy * HZ) / 5000) % 100,
1034 (loops_per_jiffy * HZ)); 1102 (cpudata->loops_per_jiffy * HZ));
1035 1103
1036 /* Check Cache configutation */ 1104 /* Check Cache configutation */
1037 switch (bfin_read_DMEM_CONTROL() & (1 << DMC0_P | 1 << DMC1_P)) { 1105 switch (cpudata->dmemctl & (1 << DMC0_P | 1 << DMC1_P)) {
1038 case ACACHE_BSRAM: 1106 case ACACHE_BSRAM:
1039 cache = "dbank-A/B\t: cache/sram"; 1107 cache = "dbank-A/B\t: cache/sram";
1040 dcache_size = 16; 1108 dcache_size = 16;
@@ -1058,10 +1126,10 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1058 } 1126 }
1059 1127
1060 /* Is it turned on? */ 1128 /* Is it turned on? */
1061 if ((bfin_read_DMEM_CONTROL() & (ENDCPLB | DMC_ENABLE)) != (ENDCPLB | DMC_ENABLE)) 1129 if ((cpudata->dmemctl & (ENDCPLB | DMC_ENABLE)) != (ENDCPLB | DMC_ENABLE))
1062 dcache_size = 0; 1130 dcache_size = 0;
1063 1131
1064 if ((bfin_read_IMEM_CONTROL() & (IMC | ENICPLB)) != (IMC | ENICPLB)) 1132 if ((cpudata->imemctl & (IMC | ENICPLB)) != (IMC | ENICPLB))
1065 icache_size = 0; 1133 icache_size = 0;
1066 1134
1067 seq_printf(m, "cache size\t: %d KB(L1 icache) " 1135 seq_printf(m, "cache size\t: %d KB(L1 icache) "
@@ -1086,8 +1154,11 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1086 "dcache setup\t: %d Super-banks/%d Sub-banks/%d Ways, %d Lines/Way\n", 1154 "dcache setup\t: %d Super-banks/%d Sub-banks/%d Ways, %d Lines/Way\n",
1087 dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS, 1155 dsup_banks, BFIN_DSUBBANKS, BFIN_DWAYS,
1088 BFIN_DLINES); 1156 BFIN_DLINES);
1157#ifdef __ARCH_SYNC_CORE_DCACHE
1158 seq_printf(m, "SMP Dcache Flushes\t: %lu\n\n", cpudata->dcache_invld_count);
1159#endif
1089#ifdef CONFIG_BFIN_ICACHE_LOCK 1160#ifdef CONFIG_BFIN_ICACHE_LOCK
1090 switch ((bfin_read_IMEM_CONTROL() >> 3) & WAYALL_L) { 1161 switch ((cpudata->imemctl >> 3) & WAYALL_L) {
1091 case WAY0_L: 1162 case WAY0_L:
1092 seq_printf(m, "Way0 Locked-Down\n"); 1163 seq_printf(m, "Way0 Locked-Down\n");
1093 break; 1164 break;
@@ -1137,6 +1208,12 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1137 seq_printf(m, "No Ways are locked\n"); 1208 seq_printf(m, "No Ways are locked\n");
1138 } 1209 }
1139#endif 1210#endif
1211
1212 if (cpu_num != num_possible_cpus() - 1)
1213 return 0;
1214
1215 if (L2_LENGTH)
1216 seq_printf(m, "L2 SRAM\t\t: %dKB\n", L2_LENGTH/0x400);
1140 seq_printf(m, "board name\t: %s\n", bfin_board_name); 1217 seq_printf(m, "board name\t: %s\n", bfin_board_name);
1141 seq_printf(m, "board memory\t: %ld kB (0x%p -> 0x%p)\n", 1218 seq_printf(m, "board memory\t: %ld kB (0x%p -> 0x%p)\n",
1142 physical_mem_end >> 10, (void *)0, (void *)physical_mem_end); 1219 physical_mem_end >> 10, (void *)0, (void *)physical_mem_end);
@@ -1144,6 +1221,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
1144 ((int)memory_end - (int)_stext) >> 10, 1221 ((int)memory_end - (int)_stext) >> 10,
1145 _stext, 1222 _stext,
1146 (void *)memory_end); 1223 (void *)memory_end);
1224 seq_printf(m, "\n");
1147 1225
1148 return 0; 1226 return 0;
1149} 1227}
diff --git a/arch/blackfin/kernel/time-ts.c b/arch/blackfin/kernel/time-ts.c
index e887efc86c29..0ed2badfd746 100644
--- a/arch/blackfin/kernel/time-ts.c
+++ b/arch/blackfin/kernel/time-ts.c
@@ -162,7 +162,6 @@ static struct clock_event_device clockevent_bfin = {
162 .name = "bfin_core_timer", 162 .name = "bfin_core_timer",
163 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 163 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
164 .shift = 32, 164 .shift = 32,
165 .cpumask = CPU_MASK_CPU0,
166 .set_next_event = bfin_timer_set_next_event, 165 .set_next_event = bfin_timer_set_next_event,
167 .set_mode = bfin_timer_set_mode, 166 .set_mode = bfin_timer_set_mode,
168}; 167};
@@ -193,6 +192,7 @@ static int __init bfin_clockevent_init(void)
193 clockevent_bfin.mult = div_sc(timer_clk, NSEC_PER_SEC, clockevent_bfin.shift); 192 clockevent_bfin.mult = div_sc(timer_clk, NSEC_PER_SEC, clockevent_bfin.shift);
194 clockevent_bfin.max_delta_ns = clockevent_delta2ns(-1, &clockevent_bfin); 193 clockevent_bfin.max_delta_ns = clockevent_delta2ns(-1, &clockevent_bfin);
195 clockevent_bfin.min_delta_ns = clockevent_delta2ns(100, &clockevent_bfin); 194 clockevent_bfin.min_delta_ns = clockevent_delta2ns(100, &clockevent_bfin);
195 clockevent_bfin.cpumask = cpumask_of(0);
196 clockevents_register_device(&clockevent_bfin); 196 clockevents_register_device(&clockevent_bfin);
197 197
198 return 0; 198 return 0;
diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c
index eb2352320454..172b4c588467 100644
--- a/arch/blackfin/kernel/time.c
+++ b/arch/blackfin/kernel/time.c
@@ -1,32 +1,11 @@
1/* 1/*
2 * File: arch/blackfin/kernel/time.c 2 * arch/blackfin/kernel/time.c
3 * Based on: none - original work
4 * Author:
5 * 3 *
6 * Created: 4 * This file contains the Blackfin-specific time handling details.
7 * Description: This file contains the bfin-specific time handling details. 5 * Most of the stuff is located in the machine specific files.
8 * Most of the stuff is located in the machine specific files.
9 * FIXME: (This file is subject for removal)
10 * 6 *
11 * Modified: 7 * Copyright 2004-2008 Analog Devices Inc.
12 * Copyright 2004-2008 Analog Devices Inc. 8 * Licensed under the GPL-2 or later.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, see the file COPYING, or write
28 * to the Free Software Foundation, Inc.,
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 */ 9 */
31 10
32#include <linux/module.h> 11#include <linux/module.h>
@@ -34,23 +13,43 @@
34#include <linux/interrupt.h> 13#include <linux/interrupt.h>
35#include <linux/time.h> 14#include <linux/time.h>
36#include <linux/irq.h> 15#include <linux/irq.h>
16#include <linux/delay.h>
37 17
38#include <asm/blackfin.h> 18#include <asm/blackfin.h>
39#include <asm/time.h> 19#include <asm/time.h>
20#include <asm/gptimers.h>
40 21
41/* This is an NTP setting */ 22/* This is an NTP setting */
42#define TICK_SIZE (tick_nsec / 1000) 23#define TICK_SIZE (tick_nsec / 1000)
43 24
44static void time_sched_init(irq_handler_t timer_routine);
45static unsigned long gettimeoffset(void);
46
47static struct irqaction bfin_timer_irq = { 25static struct irqaction bfin_timer_irq = {
48 .name = "BFIN Timer Tick", 26 .name = "Blackfin Timer Tick",
27#ifdef CONFIG_IRQ_PER_CPU
28 .flags = IRQF_DISABLED | IRQF_PERCPU,
29#else
49 .flags = IRQF_DISABLED 30 .flags = IRQF_DISABLED
31#endif
50}; 32};
51 33
52static void 34#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE)
53time_sched_init(irq_handler_t timer_routine) 35void __init setup_system_timer0(void)
36{
37 /* Power down the core timer, just to play safe. */
38 bfin_write_TCNTL(0);
39
40 disable_gptimers(TIMER0bit);
41 set_gptimer_status(0, TIMER_STATUS_TRUN0);
42 while (get_gptimer_status(0) & TIMER_STATUS_TRUN0)
43 udelay(10);
44
45 set_gptimer_config(0, 0x59); /* IRQ enable, periodic, PWM_OUT, SCLKed, OUT PAD disabled */
46 set_gptimer_period(TIMER0_id, get_sclk() / HZ);
47 set_gptimer_pwidth(TIMER0_id, 1);
48 SSYNC();
49 enable_gptimers(TIMER0bit);
50}
51#else
52void __init setup_core_timer(void)
54{ 53{
55 u32 tcount; 54 u32 tcount;
56 55
@@ -58,10 +57,8 @@ time_sched_init(irq_handler_t timer_routine)
58 bfin_write_TCNTL(1); 57 bfin_write_TCNTL(1);
59 CSYNC(); 58 CSYNC();
60 59
61 /* 60 /* the TSCALE prescaler counter */
62 * the TSCALE prescaler counter. 61 bfin_write_TSCALE(TIME_SCALE - 1);
63 */
64 bfin_write_TSCALE((TIME_SCALE - 1));
65 62
66 tcount = ((get_cclk() / (HZ * TIME_SCALE)) - 1); 63 tcount = ((get_cclk() / (HZ * TIME_SCALE)) - 1);
67 bfin_write_TPERIOD(tcount); 64 bfin_write_TPERIOD(tcount);
@@ -71,35 +68,52 @@ time_sched_init(irq_handler_t timer_routine)
71 CSYNC(); 68 CSYNC();
72 69
73 bfin_write_TCNTL(7); 70 bfin_write_TCNTL(7);
71}
72#endif
74 73
75 bfin_timer_irq.handler = (irq_handler_t)timer_routine; 74static void __init
76 /* call setup_irq instead of request_irq because request_irq calls 75time_sched_init(irqreturn_t(*timer_routine) (int, void *))
77 * kmalloc which has not been initialized yet 76{
78 */ 77#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE)
78 setup_system_timer0();
79 bfin_timer_irq.handler = timer_routine;
80 setup_irq(IRQ_TIMER0, &bfin_timer_irq);
81#else
82 setup_core_timer();
83 bfin_timer_irq.handler = timer_routine;
79 setup_irq(IRQ_CORETMR, &bfin_timer_irq); 84 setup_irq(IRQ_CORETMR, &bfin_timer_irq);
85#endif
80} 86}
81 87
82/* 88/*
83 * Should return useconds since last timer tick 89 * Should return useconds since last timer tick
84 */ 90 */
91#ifndef CONFIG_GENERIC_TIME
85static unsigned long gettimeoffset(void) 92static unsigned long gettimeoffset(void)
86{ 93{
87 unsigned long offset; 94 unsigned long offset;
88 unsigned long clocks_per_jiffy; 95 unsigned long clocks_per_jiffy;
89 96
97#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE)
98 clocks_per_jiffy = bfin_read_TIMER0_PERIOD();
99 offset = bfin_read_TIMER0_COUNTER() / \
100 (((clocks_per_jiffy + 1) * HZ) / USEC_PER_SEC);
101
102 if ((get_gptimer_status(0) & TIMER_STATUS_TIMIL0) && offset < (100000 / HZ / 2))
103 offset += (USEC_PER_SEC / HZ);
104#else
90 clocks_per_jiffy = bfin_read_TPERIOD(); 105 clocks_per_jiffy = bfin_read_TPERIOD();
91 offset = 106 offset = (clocks_per_jiffy - bfin_read_TCOUNT()) / \
92 (clocks_per_jiffy - 107 (((clocks_per_jiffy + 1) * HZ) / USEC_PER_SEC);
93 bfin_read_TCOUNT()) / (((clocks_per_jiffy + 1) * HZ) /
94 USEC_PER_SEC);
95 108
96 /* Check if we just wrapped the counters and maybe missed a tick */ 109 /* Check if we just wrapped the counters and maybe missed a tick */
97 if ((bfin_read_ILAT() & (1 << IRQ_CORETMR)) 110 if ((bfin_read_ILAT() & (1 << IRQ_CORETMR))
98 && (offset < (100000 / HZ / 2))) 111 && (offset < (100000 / HZ / 2)))
99 offset += (USEC_PER_SEC / HZ); 112 offset += (USEC_PER_SEC / HZ);
100 113#endif
101 return offset; 114 return offset;
102} 115}
116#endif
103 117
104static inline int set_rtc_mmss(unsigned long nowtime) 118static inline int set_rtc_mmss(unsigned long nowtime)
105{ 119{
@@ -111,43 +125,49 @@ static inline int set_rtc_mmss(unsigned long nowtime)
111 * as well as call the "do_timer()" routine every clocktick 125 * as well as call the "do_timer()" routine every clocktick
112 */ 126 */
113#ifdef CONFIG_CORE_TIMER_IRQ_L1 127#ifdef CONFIG_CORE_TIMER_IRQ_L1
114irqreturn_t timer_interrupt(int irq, void *dummy)__attribute__((l1_text)); 128__attribute__((l1_text))
115#endif 129#endif
116
117irqreturn_t timer_interrupt(int irq, void *dummy) 130irqreturn_t timer_interrupt(int irq, void *dummy)
118{ 131{
119 /* last time the cmos clock got updated */ 132 /* last time the cmos clock got updated */
120 static long last_rtc_update; 133 static long last_rtc_update;
121 134
122 write_seqlock(&xtime_lock); 135 write_seqlock(&xtime_lock);
123 136#if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE)
124 do_timer(1); 137/* FIXME: Here TIMIL0 is not set when IPIPE enabled, why? */
125 138 if (get_gptimer_status(0) & TIMER_STATUS_TIMIL0) {
126 profile_tick(CPU_PROFILING); 139#endif
127 140 do_timer(1);
128 /* 141
129 * If we have an externally synchronized Linux clock, then update 142 /*
130 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be 143 * If we have an externally synchronized Linux clock, then update
131 * called as close as possible to 500 ms before the new second starts. 144 * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
132 */ 145 * called as close as possible to 500 ms before the new second starts.
133 146 */
134 if (ntp_synced() && 147 if (ntp_synced() &&
135 xtime.tv_sec > last_rtc_update + 660 && 148 xtime.tv_sec > last_rtc_update + 660 &&
136 (xtime.tv_nsec / NSEC_PER_USEC) >= 149 (xtime.tv_nsec / NSEC_PER_USEC) >=
137 500000 - ((unsigned)TICK_SIZE) / 2 150 500000 - ((unsigned)TICK_SIZE) / 2
138 && (xtime.tv_nsec / NSEC_PER_USEC) <= 151 && (xtime.tv_nsec / NSEC_PER_USEC) <=
139 500000 + ((unsigned)TICK_SIZE) / 2) { 152 500000 + ((unsigned)TICK_SIZE) / 2) {
140 if (set_rtc_mmss(xtime.tv_sec) == 0) 153 if (set_rtc_mmss(xtime.tv_sec) == 0)
141 last_rtc_update = xtime.tv_sec; 154 last_rtc_update = xtime.tv_sec;
142 else 155 else
143 /* Do it again in 60s. */ 156 /* Do it again in 60s. */
144 last_rtc_update = xtime.tv_sec - 600; 157 last_rtc_update = xtime.tv_sec - 600;
158 }
159#if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE)
160 set_gptimer_status(0, TIMER_STATUS_TIMIL0);
145 } 161 }
162#endif
146 write_sequnlock(&xtime_lock); 163 write_sequnlock(&xtime_lock);
147 164
148#ifndef CONFIG_SMP 165#ifdef CONFIG_IPIPE
166 update_root_process_times(get_irq_regs());
167#else
149 update_process_times(user_mode(get_irq_regs())); 168 update_process_times(user_mode(get_irq_regs()));
150#endif 169#endif
170 profile_tick(CPU_PROFILING);
151 171
152 return IRQ_HANDLED; 172 return IRQ_HANDLED;
153} 173}
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c
index bef025b07443..5b0667da8d05 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -32,6 +32,7 @@
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/kallsyms.h> 33#include <linux/kallsyms.h>
34#include <linux/fs.h> 34#include <linux/fs.h>
35#include <linux/rbtree.h>
35#include <asm/traps.h> 36#include <asm/traps.h>
36#include <asm/cacheflush.h> 37#include <asm/cacheflush.h>
37#include <asm/cplb.h> 38#include <asm/cplb.h>
@@ -75,16 +76,6 @@ void __init trap_init(void)
75 CSYNC(); 76 CSYNC();
76} 77}
77 78
78/*
79 * Used to save the RETX, SEQSTAT, I/D CPLB FAULT ADDR
80 * values across the transition from exception to IRQ5.
81 * We put these in L1, so they are going to be in a valid
82 * location during exception context
83 */
84__attribute__((l1_data))
85unsigned long saved_retx, saved_seqstat,
86 saved_icplb_fault_addr, saved_dcplb_fault_addr;
87
88static void decode_address(char *buf, unsigned long address) 79static void decode_address(char *buf, unsigned long address)
89{ 80{
90#ifdef CONFIG_DEBUG_VERBOSE 81#ifdef CONFIG_DEBUG_VERBOSE
@@ -93,6 +84,7 @@ static void decode_address(char *buf, unsigned long address)
93 struct mm_struct *mm; 84 struct mm_struct *mm;
94 unsigned long flags, offset; 85 unsigned long flags, offset;
95 unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic(); 86 unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic();
87 struct rb_node *n;
96 88
97#ifdef CONFIG_KALLSYMS 89#ifdef CONFIG_KALLSYMS
98 unsigned long symsize; 90 unsigned long symsize;
@@ -138,9 +130,10 @@ static void decode_address(char *buf, unsigned long address)
138 if (!mm) 130 if (!mm)
139 continue; 131 continue;
140 132
141 vml = mm->context.vmlist; 133 for (n = rb_first(&mm->mm_rb); n; n = rb_next(n)) {
142 while (vml) { 134 struct vm_area_struct *vma;
143 struct vm_area_struct *vma = vml->vma; 135
136 vma = rb_entry(n, struct vm_area_struct, vm_rb);
144 137
145 if (address >= vma->vm_start && address < vma->vm_end) { 138 if (address >= vma->vm_start && address < vma->vm_end) {
146 char _tmpbuf[256]; 139 char _tmpbuf[256];
@@ -186,8 +179,6 @@ static void decode_address(char *buf, unsigned long address)
186 179
187 goto done; 180 goto done;
188 } 181 }
189
190 vml = vml->next;
191 } 182 }
192 if (!in_atomic) 183 if (!in_atomic)
193 mmput(mm); 184 mmput(mm);
@@ -211,18 +202,18 @@ asmlinkage void double_fault_c(struct pt_regs *fp)
211 printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n"); 202 printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n");
212#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT 203#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT
213 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) { 204 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) {
205 unsigned int cpu = smp_processor_id();
214 char buf[150]; 206 char buf[150];
215 decode_address(buf, saved_retx); 207 decode_address(buf, cpu_pda[cpu].retx);
216 printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n", 208 printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n",
217 (int)saved_seqstat & SEQSTAT_EXCAUSE, buf); 209 (unsigned int)cpu_pda[cpu].seqstat & SEQSTAT_EXCAUSE, buf);
218 decode_address(buf, saved_dcplb_fault_addr); 210 decode_address(buf, cpu_pda[cpu].dcplb_fault_addr);
219 printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n", buf); 211 printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n", buf);
220 decode_address(buf, saved_icplb_fault_addr); 212 decode_address(buf, cpu_pda[cpu].icplb_fault_addr);
221 printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n", buf); 213 printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n", buf);
222 214
223 decode_address(buf, fp->retx); 215 decode_address(buf, fp->retx);
224 printk(KERN_NOTICE "The instruction at %s caused a double exception\n", 216 printk(KERN_NOTICE "The instruction at %s caused a double exception\n", buf);
225 buf);
226 } else 217 } else
227#endif 218#endif
228 { 219 {
@@ -240,6 +231,9 @@ asmlinkage void trap_c(struct pt_regs *fp)
240#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON 231#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
241 int j; 232 int j;
242#endif 233#endif
234#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
235 unsigned int cpu = smp_processor_id();
236#endif
243 int sig = 0; 237 int sig = 0;
244 siginfo_t info; 238 siginfo_t info;
245 unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE; 239 unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE;
@@ -417,7 +411,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
417 info.si_code = ILL_CPLB_MULHIT; 411 info.si_code = ILL_CPLB_MULHIT;
418 sig = SIGSEGV; 412 sig = SIGSEGV;
419#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO 413#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
420 if (saved_dcplb_fault_addr < FIXED_CODE_START) 414 if (cpu_pda[cpu].dcplb_fault_addr < FIXED_CODE_START)
421 verbose_printk(KERN_NOTICE "NULL pointer access\n"); 415 verbose_printk(KERN_NOTICE "NULL pointer access\n");
422 else 416 else
423#endif 417#endif
@@ -471,7 +465,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
471 info.si_code = ILL_CPLB_MULHIT; 465 info.si_code = ILL_CPLB_MULHIT;
472 sig = SIGSEGV; 466 sig = SIGSEGV;
473#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO 467#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
474 if (saved_icplb_fault_addr < FIXED_CODE_START) 468 if (cpu_pda[cpu].icplb_fault_addr < FIXED_CODE_START)
475 verbose_printk(KERN_NOTICE "Jump to NULL address\n"); 469 verbose_printk(KERN_NOTICE "Jump to NULL address\n");
476 else 470 else
477#endif 471#endif
@@ -584,10 +578,15 @@ asmlinkage void trap_c(struct pt_regs *fp)
584 } 578 }
585 } 579 }
586 580
587 info.si_signo = sig; 581#ifdef CONFIG_IPIPE
588 info.si_errno = 0; 582 if (!ipipe_trap_notify(fp->seqstat & 0x3f, fp))
589 info.si_addr = (void __user *)fp->pc; 583#endif
590 force_sig_info(sig, &info, current); 584 {
585 info.si_signo = sig;
586 info.si_errno = 0;
587 info.si_addr = (void __user *)fp->pc;
588 force_sig_info(sig, &info, current);
589 }
591 590
592 trace_buffer_restore(j); 591 trace_buffer_restore(j);
593 return; 592 return;
@@ -656,13 +655,13 @@ static bool get_instruction(unsigned short *val, unsigned short *address)
656 return false; 655 return false;
657} 656}
658 657
659/* 658/*
660 * decode the instruction if we are printing out the trace, as it 659 * decode the instruction if we are printing out the trace, as it
661 * makes things easier to follow, without running it through objdump 660 * makes things easier to follow, without running it through objdump
662 * These are the normal instructions which cause change of flow, which 661 * These are the normal instructions which cause change of flow, which
663 * would be at the source of the trace buffer 662 * would be at the source of the trace buffer
664 */ 663 */
665#ifdef CONFIG_DEBUG_VERBOSE 664#if defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_BFIN_HWTRACE_ON)
666static void decode_instruction(unsigned short *address) 665static void decode_instruction(unsigned short *address)
667{ 666{
668 unsigned short opcode; 667 unsigned short opcode;
@@ -846,7 +845,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)
846 } 845 }
847 if (fp) { 846 if (fp) {
848 frame = fp; 847 frame = fp;
849 printk(" FP: (0x%p)\n", fp); 848 printk(KERN_NOTICE " FP: (0x%p)\n", fp);
850 } else 849 } else
851 frame = 0; 850 frame = 0;
852 851
@@ -960,6 +959,7 @@ void dump_bfin_process(struct pt_regs *fp)
960 else 959 else
961 verbose_printk(KERN_NOTICE "COMM= invalid\n"); 960 verbose_printk(KERN_NOTICE "COMM= invalid\n");
962 961
962 printk(KERN_NOTICE "CPU = %d\n", current_thread_info()->cpu);
963 if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START) 963 if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START)
964 verbose_printk(KERN_NOTICE "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n" 964 verbose_printk(KERN_NOTICE "TEXT = 0x%p-0x%p DATA = 0x%p-0x%p\n"
965 KERN_NOTICE " BSS = 0x%p-0x%p USER-STACK = 0x%p\n" 965 KERN_NOTICE " BSS = 0x%p-0x%p USER-STACK = 0x%p\n"
@@ -1053,6 +1053,7 @@ void show_regs(struct pt_regs *fp)
1053 struct irqaction *action; 1053 struct irqaction *action;
1054 unsigned int i; 1054 unsigned int i;
1055 unsigned long flags; 1055 unsigned long flags;
1056 unsigned int cpu = smp_processor_id();
1056 1057
1057 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n", print_tainted()); 1058 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n", print_tainted());
1058 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n", 1059 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n",
@@ -1112,9 +1113,9 @@ unlock:
1112 1113
1113 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) && 1114 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) &&
1114 (((long)fp->seqstat & SEQSTAT_EXCAUSE) != VEC_HWERR)) { 1115 (((long)fp->seqstat & SEQSTAT_EXCAUSE) != VEC_HWERR)) {
1115 decode_address(buf, saved_dcplb_fault_addr); 1116 decode_address(buf, cpu_pda[cpu].dcplb_fault_addr);
1116 verbose_printk(KERN_NOTICE "DCPLB_FAULT_ADDR: %s\n", buf); 1117 verbose_printk(KERN_NOTICE "DCPLB_FAULT_ADDR: %s\n", buf);
1117 decode_address(buf, saved_icplb_fault_addr); 1118 decode_address(buf, cpu_pda[cpu].icplb_fault_addr);
1118 verbose_printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf); 1119 verbose_printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf);
1119 } 1120 }
1120 1121
@@ -1153,20 +1154,21 @@ unlock:
1153asmlinkage int sys_bfin_spinlock(int *spinlock)__attribute__((l1_text)); 1154asmlinkage int sys_bfin_spinlock(int *spinlock)__attribute__((l1_text));
1154#endif 1155#endif
1155 1156
1156asmlinkage int sys_bfin_spinlock(int *spinlock) 1157static DEFINE_SPINLOCK(bfin_spinlock_lock);
1158
1159asmlinkage int sys_bfin_spinlock(int *p)
1157{ 1160{
1158 int ret = 0; 1161 int ret, tmp = 0;
1159 int tmp = 0;
1160 1162
1161 local_irq_disable(); 1163 spin_lock(&bfin_spinlock_lock); /* This would also hold kernel preemption. */
1162 ret = get_user(tmp, spinlock); 1164 ret = get_user(tmp, p);
1163 if (ret == 0) { 1165 if (likely(ret == 0)) {
1164 if (tmp) 1166 if (unlikely(tmp))
1165 ret = 1; 1167 ret = 1;
1166 tmp = 1; 1168 else
1167 put_user(tmp, spinlock); 1169 put_user(1, p);
1168 } 1170 }
1169 local_irq_enable(); 1171 spin_unlock(&bfin_spinlock_lock);
1170 return ret; 1172 return ret;
1171} 1173}
1172 1174
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 7d12c6692a65..4b4341da0585 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -68,6 +68,8 @@ SECTIONS
68 __etext = .; 68 __etext = .;
69 } 69 }
70 70
71 NOTES
72
71 /* Just in case the first read only is a 32-bit access */ 73 /* Just in case the first read only is a 32-bit access */
72 RO_DATA(4) 74 RO_DATA(4)
73 75
@@ -109,7 +111,6 @@ SECTIONS
109#endif 111#endif
110 112
111 DATA_DATA 113 DATA_DATA
112 *(.data.*)
113 CONSTRUCTORS 114 CONSTRUCTORS
114 115
115 /* make sure the init_task is aligned to the 116 /* make sure the init_task is aligned to the
@@ -161,12 +162,14 @@ SECTIONS
161 *(.con_initcall.init) 162 *(.con_initcall.init)
162 ___con_initcall_end = .; 163 ___con_initcall_end = .;
163 } 164 }
165 PERCPU(4)
164 SECURITY_INIT 166 SECURITY_INIT
165 .init.ramfs : 167 .init.ramfs :
166 { 168 {
167 . = ALIGN(4); 169 . = ALIGN(4);
168 ___initramfs_start = .; 170 ___initramfs_start = .;
169 *(.init.ramfs) 171 *(.init.ramfs)
172 . = ALIGN(4);
170 ___initramfs_end = .; 173 ___initramfs_end = .;
171 } 174 }
172 175
@@ -212,7 +215,7 @@ SECTIONS
212 __ebss_b_l1 = .; 215 __ebss_b_l1 = .;
213 } 216 }
214 217
215 __l2_lma_start = .; 218 __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1);
216 219
217 .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1)) 220 .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1))
218 { 221 {
@@ -240,7 +243,7 @@ SECTIONS
240 /* Force trailing alignment of our init section so that when we 243 /* Force trailing alignment of our init section so that when we
241 * free our init memory, we don't leave behind a partial page. 244 * free our init memory, we don't leave behind a partial page.
242 */ 245 */
243 . = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); 246 . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2);
244 . = ALIGN(PAGE_SIZE); 247 . = ALIGN(PAGE_SIZE);
245 ___init_end = .; 248 ___init_end = .;
246 249
diff --git a/arch/blackfin/lib/checksum.c b/arch/blackfin/lib/checksum.c
index 5c87505165d3..762a7f02970a 100644
--- a/arch/blackfin/lib/checksum.c
+++ b/arch/blackfin/lib/checksum.c
@@ -29,6 +29,7 @@
29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 */ 30 */
31 31
32#include <linux/module.h>
32#include <net/checksum.h> 33#include <net/checksum.h>
33#include <asm/checksum.h> 34#include <asm/checksum.h>
34 35
@@ -76,6 +77,7 @@ __sum16 ip_fast_csum(unsigned char *iph, unsigned int ihl)
76{ 77{
77 return (__force __sum16)~do_csum(iph, ihl * 4); 78 return (__force __sum16)~do_csum(iph, ihl * 4);
78} 79}
80EXPORT_SYMBOL(ip_fast_csum);
79 81
80/* 82/*
81 * computes the checksum of a memory block at buff, length len, 83 * computes the checksum of a memory block at buff, length len,
@@ -104,6 +106,7 @@ __wsum csum_partial(const void *buff, int len, __wsum sum)
104 106
105 return sum; 107 return sum;
106} 108}
109EXPORT_SYMBOL(csum_partial);
107 110
108/* 111/*
109 * this routine is used for miscellaneous IP-like checksums, mainly 112 * this routine is used for miscellaneous IP-like checksums, mainly
@@ -137,3 +140,4 @@ __wsum csum_partial_copy(const void *src, void *dst, int len, __wsum sum)
137 memcpy(dst, src, len); 140 memcpy(dst, src, len);
138 return csum_partial(dst, len, sum); 141 return csum_partial(dst, len, sum);
139} 142}
143EXPORT_SYMBOL(csum_partial_copy);
diff --git a/arch/blackfin/lib/ins.S b/arch/blackfin/lib/ins.S
index d60554dce87b..1863a6ba507c 100644
--- a/arch/blackfin/lib/ins.S
+++ b/arch/blackfin/lib/ins.S
@@ -1,31 +1,9 @@
1/* 1/*
2 * File: arch/blackfin/lib/ins.S 2 * arch/blackfin/lib/ins.S - ins{bwl} using hardware loops
3 * Based on:
4 * Author: Bas Vermeulen <bas@buyways.nl>
5 * 3 *
6 * Created: Tue Mar 22 15:27:24 CEST 2005 4 * Copyright 2004-2008 Analog Devices Inc.
7 * Description: Implementation of ins{bwl} for BlackFin processors using zero overhead loops. 5 * Copyright (C) 2005 Bas Vermeulen, BuyWays BV <bas@buyways.nl>
8 * 6 * Licensed under the GPL-2 or later.
9 * Modified:
10 * Copyright 2004-2008 Analog Devices Inc.
11 * Copyright (C) 2005 Bas Vermeulen, BuyWays BV <bas@buyways.nl>
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */ 7 */
30 8
31#include <linux/linkage.h> 9#include <linux/linkage.h>
@@ -33,6 +11,46 @@
33 11
34.align 2 12.align 2
35 13
14#ifdef CONFIG_IPIPE
15# define DO_CLI \
16 [--sp] = rets; \
17 [--sp] = (P5:0); \
18 sp += -12; \
19 call ___ipipe_stall_root_raw; \
20 sp += 12; \
21 (P5:0) = [sp++];
22# define CLI_INNER_NOP
23#else
24# define DO_CLI cli R3;
25# define CLI_INNER_NOP nop; nop; nop;
26#endif
27
28#ifdef CONFIG_IPIPE
29# define DO_STI \
30 sp += -12; \
31 call ___ipipe_unstall_root_raw; \
32 sp += 12; \
332: rets = [sp++];
34#else
35# define DO_STI 2: sti R3;
36#endif
37
38#ifdef CONFIG_BFIN_INS_LOWOVERHEAD
39# define CLI_OUTER DO_CLI;
40# define STI_OUTER DO_STI;
41# define CLI_INNER 1:
42# if ANOMALY_05000416
43# define STI_INNER nop; 2: nop;
44# else
45# define STI_INNER 2:
46# endif
47#else
48# define CLI_OUTER
49# define STI_OUTER
50# define CLI_INNER 1: DO_CLI; CLI_INNER_NOP;
51# define STI_INNER DO_STI;
52#endif
53
36/* 54/*
37 * Reads on the Blackfin are speculative. In Blackfin terms, this means they 55 * Reads on the Blackfin are speculative. In Blackfin terms, this means they
38 * can be interrupted at any time (even after they have been issued on to the 56 * can be interrupted at any time (even after they have been issued on to the
@@ -53,170 +71,48 @@
53 * buffers in/out of FIFOs. 71 * buffers in/out of FIFOs.
54 */ 72 */
55 73
56ENTRY(_insl) 74#define COMMON_INS(func, ops) \
57#ifdef CONFIG_BFIN_INS_LOWOVERHEAD 75ENTRY(_ins##func) \
58 P0 = R0; /* P0 = port */ 76 P0 = R0; /* P0 = port */ \
59 cli R3; 77 CLI_OUTER; /* 3 instructions before first read access */ \
60 P1 = R1; /* P1 = address */ 78 P1 = R1; /* P1 = address */ \
61 P2 = R2; /* P2 = count */ 79 P2 = R2; /* P2 = count */ \
62 SSYNC; 80 SSYNC; \
63 LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2; 81 \
64.Llong_loop_s: R0 = [P0]; 82 LSETUP(1f, 2f) LC0 = P2; \
65 [P1++] = R0; 83 CLI_INNER; \
66 NOP; 84 ops; \
67.Llong_loop_e: NOP; 85 STI_INNER; \
68 sti R3; 86 \
69 RTS; 87 STI_OUTER; \
70#else 88 RTS; \
71 P0 = R0; /* P0 = port */ 89ENDPROC(_ins##func)
72 P1 = R1; /* P1 = address */
73 P2 = R2; /* P2 = count */
74 SSYNC;
75 LSETUP( .Llong_loop_s, .Llong_loop_e) LC0 = P2;
76.Llong_loop_s:
77 CLI R3;
78 NOP; NOP; NOP;
79 R0 = [P0];
80 [P1++] = R0;
81.Llong_loop_e:
82 STI R3;
83 90
84 RTS; 91COMMON_INS(l, \
85#endif 92 R0 = [P0]; \
86ENDPROC(_insl) 93 [P1++] = R0; \
87 94)
88ENTRY(_insw)
89#ifdef CONFIG_BFIN_INS_LOWOVERHEAD
90 P0 = R0; /* P0 = port */
91 cli R3;
92 P1 = R1; /* P1 = address */
93 P2 = R2; /* P2 = count */
94 SSYNC;
95 LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2;
96.Lword_loop_s: R0 = W[P0];
97 W[P1++] = R0;
98 NOP;
99.Lword_loop_e: NOP;
100 sti R3;
101 RTS;
102#else
103 P0 = R0; /* P0 = port */
104 P1 = R1; /* P1 = address */
105 P2 = R2; /* P2 = count */
106 SSYNC;
107 LSETUP( .Lword_loop_s, .Lword_loop_e) LC0 = P2;
108.Lword_loop_s:
109 CLI R3;
110 NOP; NOP; NOP;
111 R0 = W[P0];
112 W[P1++] = R0;
113.Lword_loop_e:
114 STI R3;
115 RTS;
116
117#endif
118ENDPROC(_insw)
119
120ENTRY(_insw_8)
121#ifdef CONFIG_BFIN_INS_LOWOVERHEAD
122 P0 = R0; /* P0 = port */
123 cli R3;
124 P1 = R1; /* P1 = address */
125 P2 = R2; /* P2 = count */
126 SSYNC;
127 LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2;
128.Lword8_loop_s: R0 = W[P0];
129 B[P1++] = R0;
130 R0 = R0 >> 8;
131 B[P1++] = R0;
132 NOP;
133.Lword8_loop_e: NOP;
134 sti R3;
135 RTS;
136#else
137 P0 = R0; /* P0 = port */
138 P1 = R1; /* P1 = address */
139 P2 = R2; /* P2 = count */
140 SSYNC;
141 LSETUP( .Lword8_loop_s, .Lword8_loop_e) LC0 = P2;
142.Lword8_loop_s:
143 CLI R3;
144 NOP; NOP; NOP;
145 R0 = W[P0];
146 B[P1++] = R0;
147 R0 = R0 >> 8;
148 B[P1++] = R0;
149 NOP;
150.Lword8_loop_e:
151 STI R3;
152 95
153 RTS; 96COMMON_INS(w, \
154#endif 97 R0 = W[P0]; \
155ENDPROC(_insw_8) 98 W[P1++] = R0; \
99)
156 100
157ENTRY(_insb) 101COMMON_INS(w_8, \
158#ifdef CONFIG_BFIN_INS_LOWOVERHEAD 102 R0 = W[P0]; \
159 P0 = R0; /* P0 = port */ 103 B[P1++] = R0; \
160 cli R3; 104 R0 = R0 >> 8; \
161 P1 = R1; /* P1 = address */ 105 B[P1++] = R0; \
162 P2 = R2; /* P2 = count */ 106)
163 SSYNC;
164 LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2;
165.Lbyte_loop_s: R0 = B[P0];
166 B[P1++] = R0;
167 NOP;
168.Lbyte_loop_e: NOP;
169 sti R3;
170 RTS;
171#else
172 P0 = R0; /* P0 = port */
173 P1 = R1; /* P1 = address */
174 P2 = R2; /* P2 = count */
175 SSYNC;
176 LSETUP( .Lbyte_loop_s, .Lbyte_loop_e) LC0 = P2;
177.Lbyte_loop_s:
178 CLI R3;
179 NOP; NOP; NOP;
180 R0 = B[P0];
181 B[P1++] = R0;
182.Lbyte_loop_e:
183 STI R3;
184 107
185 RTS; 108COMMON_INS(b, \
186#endif 109 R0 = B[P0]; \
187ENDPROC(_insb) 110 B[P1++] = R0; \
111)
188 112
189ENTRY(_insl_16) 113COMMON_INS(l_16, \
190#ifdef CONFIG_BFIN_INS_LOWOVERHEAD 114 R0 = [P0]; \
191 P0 = R0; /* P0 = port */ 115 W[P1++] = R0; \
192 cli R3; 116 R0 = R0 >> 16; \
193 P1 = R1; /* P1 = address */ 117 W[P1++] = R0; \
194 P2 = R2; /* P2 = count */ 118)
195 SSYNC;
196 LSETUP( .Llong16_loop_s, .Llong16_loop_e) LC0 = P2;
197.Llong16_loop_s: R0 = [P0];
198 W[P1++] = R0;
199 R0 = R0 >> 16;
200 W[P1++] = R0;
201 NOP;
202.Llong16_loop_e: NOP;
203 sti R3;
204 RTS;
205#else
206 P0 = R0; /* P0 = port */
207 P1 = R1; /* P1 = address */
208 P2 = R2; /* P2 = count */
209 SSYNC;
210 LSETUP( .Llong16_loop_s, .Llong16_loop_e) LC0 = P2;
211.Llong16_loop_s:
212 CLI R3;
213 NOP; NOP; NOP;
214 R0 = [P0];
215 W[P1++] = R0;
216 R0 = R0 >> 16;
217 W[P1++] = R0;
218.Llong16_loop_e:
219 STI R3;
220 RTS;
221#endif
222ENDPROC(_insl_16)
diff --git a/arch/blackfin/lib/muldi3.S b/arch/blackfin/lib/muldi3.S
new file mode 100644
index 000000000000..abde120ee230
--- /dev/null
+++ b/arch/blackfin/lib/muldi3.S
@@ -0,0 +1,68 @@
1.align 2
2.global ___muldi3;
3.type ___muldi3, STT_FUNC;
4
5#ifdef CONFIG_ARITHMETIC_OPS_L1
6.section .l1.text
7#else
8.text
9#endif
10
11/*
12 R1:R0 * R3:R2
13 = R1.h:R1.l:R0.h:R0.l * R3.h:R3.l:R2.h:R2.l
14[X] = (R1.h * R3.h) * 2^96
15[X] + (R1.h * R3.l + R1.l * R3.h) * 2^80
16[X] + (R1.h * R2.h + R1.l * R3.l + R3.h * R0.h) * 2^64
17[T1] + (R1.h * R2.l + R3.h * R0.l + R1.l * R2.h + R3.l * R0.h) * 2^48
18[T2] + (R1.l * R2.l + R3.l * R0.l + R0.h * R2.h) * 2^32
19[T3] + (R0.l * R2.h + R2.l * R0.h) * 2^16
20[T4] + (R0.l * R2.l)
21
22 We can discard the first three lines marked "X" since we produce
23 only a 64 bit result. So, we need ten 16-bit multiplies.
24
25 Individual mul-acc results:
26[E1] = R1.h * R2.l + R3.h * R0.l + R1.l * R2.h + R3.l * R0.h
27[E2] = R1.l * R2.l + R3.l * R0.l + R0.h * R2.h
28[E3] = R0.l * R2.h + R2.l * R0.h
29[E4] = R0.l * R2.l
30
31 We also need to add high parts from lower-level results to higher ones:
32 E[n]c = E[n] + (E[n+1]c >> 16), where E4c := E4
33
34 One interesting property is that all parts of the result that depend
35 on the sign of the multiplication are discarded. Those would be the
36 multiplications involving R1.h and R3.h, but only the top 16 bit of
37 the 32 bit result depend on the sign, and since R1.h and R3.h only
38 occur in E1, the top half of these results is cut off.
39 So, we can just use FU mode for all of the 16-bit multiplies, and
40 ignore questions of when to use mixed mode. */
41
42___muldi3:
43 /* [SP] technically is part of the caller's frame, but we can
44 use it as scratch space. */
45 A0 = R2.H * R1.L, A1 = R2.L * R1.H (FU) || R3 = [SP + 12]; /* E1 */
46 A0 += R3.H * R0.L, A1 += R3.L * R0.H (FU) || [SP] = R4; /* E1 */
47 A0 += A1; /* E1 */
48 R4 = A0.w;
49 A0 = R0.l * R3.l (FU); /* E2 */
50 A0 += R2.l * R1.l (FU); /* E2 */
51
52 A1 = R2.L * R0.L (FU); /* E4 */
53 R3 = A1.w;
54 A1 = A1 >> 16; /* E3c */
55 A0 += R2.H * R0.H, A1 += R2.L * R0.H (FU); /* E2, E3c */
56 A1 += R0.L * R2.H (FU); /* E3c */
57 R0 = A1.w;
58 A1 = A1 >> 16; /* E2c */
59 A0 += A1; /* E2c */
60 R1 = A0.w;
61
62 /* low(result) = low(E3c):low(E4) */
63 R0 = PACK (R0.l, R3.l);
64 /* high(result) = E2c + (E1 << 16) */
65 R1.h = R1.h + R4.l (NS) || R4 = [SP];
66 RTS;
67
68.size ___muldi3, .-___muldi3
diff --git a/arch/blackfin/lib/muldi3.c b/arch/blackfin/lib/muldi3.c
deleted file mode 100644
index 303d0c6a6dba..000000000000
--- a/arch/blackfin/lib/muldi3.c
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * File: arch/blackfin/lib/muldi3.c
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#ifndef SI_TYPE_SIZE
31#define SI_TYPE_SIZE 32
32#endif
33#define __ll_b (1L << (SI_TYPE_SIZE / 2))
34#define __ll_lowpart(t) ((usitype) (t) % __ll_b)
35#define __ll_highpart(t) ((usitype) (t) / __ll_b)
36#define BITS_PER_UNIT 8
37
38#if !defined(umul_ppmm)
39#define umul_ppmm(w1, w0, u, v) \
40 do { \
41 usitype __x0, __x1, __x2, __x3; \
42 usitype __ul, __vl, __uh, __vh; \
43 \
44 __ul = __ll_lowpart (u); \
45 __uh = __ll_highpart (u); \
46 __vl = __ll_lowpart (v); \
47 __vh = __ll_highpart (v); \
48 \
49 __x0 = (usitype) __ul * __vl; \
50 __x1 = (usitype) __ul * __vh; \
51 __x2 = (usitype) __uh * __vl; \
52 __x3 = (usitype) __uh * __vh; \
53 \
54 __x1 += __ll_highpart (__x0);/* this can't give carry */ \
55 __x1 += __x2; /* but this indeed can */ \
56 if (__x1 < __x2) /* did we get it? */ \
57 __x3 += __ll_b; /* yes, add it in the proper pos. */ \
58 \
59 (w1) = __x3 + __ll_highpart (__x1); \
60 (w0) = __ll_lowpart (__x1) * __ll_b + __ll_lowpart (__x0); \
61 } while (0)
62#endif
63
64#if !defined(__umulsidi3)
65#define __umulsidi3(u, v) \
66 ({diunion __w; \
67 umul_ppmm (__w.s.high, __w.s.low, u, v); \
68 __w.ll; })
69#endif
70
71typedef unsigned int usitype __attribute__ ((mode(SI)));
72typedef int sitype __attribute__ ((mode(SI)));
73typedef int ditype __attribute__ ((mode(DI)));
74typedef int word_type __attribute__ ((mode(__word__)));
75
76struct distruct {
77 sitype low, high;
78};
79typedef union {
80 struct distruct s;
81 ditype ll;
82} diunion;
83
84#ifdef CONFIG_ARITHMETIC_OPS_L1
85ditype __muldi3(ditype u, ditype v)__attribute__((l1_text));
86#endif
87
88ditype __muldi3(ditype u, ditype v)
89{
90 diunion w;
91 diunion uu, vv;
92
93 uu.ll = u, vv.ll = v;
94 w.ll = __umulsidi3(uu.s.low, vv.s.low);
95 w.s.high += ((usitype) uu.s.low * (usitype) vv.s.high
96 + (usitype) uu.s.high * (usitype) vv.s.low);
97
98 return w.ll;
99}
diff --git a/arch/blackfin/mach-bf518/Kconfig b/arch/blackfin/mach-bf518/Kconfig
new file mode 100644
index 000000000000..f397ede006bf
--- /dev/null
+++ b/arch/blackfin/mach-bf518/Kconfig
@@ -0,0 +1,233 @@
1if (BF51x)
2
3source "arch/blackfin/mach-bf518/boards/Kconfig"
4
5menu "BF518 Specific Configuration"
6
7comment "Alternative Multiplexing Scheme"
8
9choice
10 prompt "SPORT0"
11 default BF518_SPORT0_PORTG
12 help
13 Select PORT used for SPORT0. See Hardware Reference Manual
14
15config BF518_SPORT0_PORTF
16 bool "PORT F"
17 help
18 PORT F
19
20config BF518_SPORT0_PORTG
21 bool "PORT G"
22 help
23 PORT G
24endchoice
25
26choice
27 prompt "SPORT0 TSCLK Location"
28 depends on BF518_SPORT0_PORTG
29 default BF518_SPORT0_TSCLK_PG10
30 help
31 Select PIN used for SPORT0_TSCLK. See Hardware Reference Manual
32
33config BF518_SPORT0_TSCLK_PG10
34 bool "PORT PG10"
35 help
36 PORT PG10
37
38config BF518_SPORT0_TSCLK_PG14
39 bool "PORT PG14"
40 help
41 PORT PG14
42endchoice
43
44choice
45 prompt "UART1"
46 default BF518_UART1_PORTF
47 help
48 Select PORT used for UART1. See Hardware Reference Manual
49
50config BF518_UART1_PORTF
51 bool "PORT F"
52 help
53 PORT F
54
55config BF518_UART1_PORTG
56 bool "PORT G"
57 help
58 PORT G
59endchoice
60
61comment "Interrupt Priority Assignment"
62menu "Priority"
63
64config IRQ_PLL_WAKEUP
65 int "IRQ_PLL_WAKEUP"
66 default 7
67config IRQ_DMA0_ERROR
68 int "IRQ_DMA0_ERROR"
69 default 7
70config IRQ_DMAR0_BLK
71 int "IRQ_DMAR0_BLK"
72 default 7
73config IRQ_DMAR1_BLK
74 int "IRQ_DMAR1_BLK"
75 default 7
76config IRQ_DMAR0_OVR
77 int "IRQ_DMAR0_OVR"
78 default 7
79config IRQ_DMAR1_OVR
80 int "IRQ_DMAR1_OVR"
81 default 7
82config IRQ_PPI_ERROR
83 int "IRQ_PPI_ERROR"
84 default 7
85config IRQ_MAC_ERROR
86 int "IRQ_MAC_ERROR"
87 default 7
88config IRQ_SPORT0_ERROR
89 int "IRQ_SPORT0_ERROR"
90 default 7
91config IRQ_SPORT1_ERROR
92 int "IRQ_SPORT1_ERROR"
93 default 7
94config IRQ_PTP_ERROR
95 int "IRQ_PTP_ERROR"
96 default 7
97config IRQ_UART0_ERROR
98 int "IRQ_UART0_ERROR"
99 default 7
100config IRQ_UART1_ERROR
101 int "IRQ_UART1_ERROR"
102 default 7
103config IRQ_RTC
104 int "IRQ_RTC"
105 default 8
106config IRQ_PPI
107 int "IRQ_PPI"
108 default 8
109config IRQ_SPORT0_RX
110 int "IRQ_SPORT0_RX"
111 default 9
112config IRQ_SPORT0_TX
113 int "IRQ_SPORT0_TX"
114 default 9
115config IRQ_SPORT1_RX
116 int "IRQ_SPORT1_RX"
117 default 9
118config IRQ_SPORT1_TX
119 int "IRQ_SPORT1_TX"
120 default 9
121config IRQ_TWI
122 int "IRQ_TWI"
123 default 10
124config IRQ_SPI0
125 int "IRQ_SPI"
126 default 10
127config IRQ_UART0_RX
128 int "IRQ_UART0_RX"
129 default 10
130config IRQ_UART0_TX
131 int "IRQ_UART0_TX"
132 default 10
133config IRQ_UART1_RX
134 int "IRQ_UART1_RX"
135 default 10
136config IRQ_UART1_TX
137 int "IRQ_UART1_TX"
138 default 10
139config IRQ_OPTSEC
140 int "IRQ_OPTSEC"
141 default 11
142config IRQ_CNT
143 int "IRQ_CNT"
144 default 11
145config IRQ_MAC_RX
146 int "IRQ_MAC_RX"
147 default 11
148config IRQ_PORTH_INTA
149 int "IRQ_PORTH_INTA"
150 default 11
151config IRQ_MAC_TX
152 int "IRQ_MAC_TX/NFC"
153 default 11
154config IRQ_PORTH_INTB
155 int "IRQ_PORTH_INTB"
156 default 11
157config IRQ_TIMER0
158 int "IRQ_TIMER0"
159 default 8
160config IRQ_TIMER1
161 int "IRQ_TIMER1"
162 default 12
163config IRQ_TIMER2
164 int "IRQ_TIMER2"
165 default 12
166config IRQ_TIMER3
167 int "IRQ_TIMER3"
168 default 12
169config IRQ_TIMER4
170 int "IRQ_TIMER4"
171 default 12
172config IRQ_TIMER5
173 int "IRQ_TIMER5"
174 default 12
175config IRQ_TIMER6
176 int "IRQ_TIMER6"
177 default 12
178config IRQ_TIMER7
179 int "IRQ_TIMER7"
180 default 12
181config IRQ_PORTG_INTA
182 int "IRQ_PORTG_INTA"
183 default 12
184config IRQ_PORTG_INTB
185 int "IRQ_PORTG_INTB"
186 default 12
187config IRQ_MEM_DMA0
188 int "IRQ_MEM_DMA0"
189 default 13
190config IRQ_MEM_DMA1
191 int "IRQ_MEM_DMA1"
192 default 13
193config IRQ_WATCH
194 int "IRQ_WATCH"
195 default 13
196config IRQ_PORTF_INTA
197 int "IRQ_PORTF_INTA"
198 default 13
199config IRQ_PORTF_INTB
200 int "IRQ_PORTF_INTB"
201 default 13
202config IRQ_SPI0_ERROR
203 int "IRQ_SPI0_ERROR"
204 default 7
205config IRQ_SPI1_ERROR
206 int "IRQ_SPI1_ERROR"
207 default 7
208config IRQ_RSI_INT0
209 int "IRQ_RSI_INT0"
210 default 7
211config IRQ_RSI_INT1
212 int "IRQ_RSI_INT1"
213 default 7
214config IRQ_PWM_TRIP
215 int "IRQ_PWM_TRIP"
216 default 10
217config IRQ_PWM_SYNC
218 int "IRQ_PWM_SYNC"
219 default 10
220config IRQ_PTP_STAT
221 int "IRQ_PTP_STAT"
222 default 10
223
224 help
225 Enter the priority numbers between 7-13 ONLY. Others are Reserved.
226 This applies to all the above. It is not recommended to assign the
227 highest priority number 7 to UART or any other device.
228
229endmenu
230
231endmenu
232
233endif
diff --git a/arch/blackfin/mach-bf518/Makefile b/arch/blackfin/mach-bf518/Makefile
new file mode 100644
index 000000000000..168a193f9f9a
--- /dev/null
+++ b/arch/blackfin/mach-bf518/Makefile
@@ -0,0 +1,5 @@
1#
2# arch/blackfin/mach-bf518/Makefile
3#
4
5obj-y := ints-priority.o dma.o
diff --git a/arch/blackfin/mach-bf518/boards/Kconfig b/arch/blackfin/mach-bf518/boards/Kconfig
new file mode 100644
index 000000000000..96163514ed22
--- /dev/null
+++ b/arch/blackfin/mach-bf518/boards/Kconfig
@@ -0,0 +1,12 @@
1choice
2 prompt "System type"
3 default BFIN518F_EZBRD
4 help
5 Select your board!
6
7config BFIN518F_EZBRD
8 bool "BF518F-EZBRD"
9 help
10 BF518-EZBRD board support.
11
12endchoice
diff --git a/arch/blackfin/mach-bf518/boards/Makefile b/arch/blackfin/mach-bf518/boards/Makefile
new file mode 100644
index 000000000000..172e859c3a7f
--- /dev/null
+++ b/arch/blackfin/mach-bf518/boards/Makefile
@@ -0,0 +1,5 @@
1#
2# arch/blackfin/mach-bf518/boards/Makefile
3#
4
5obj-$(CONFIG_BFIN518F_EZBRD) += ezbrd.o
diff --git a/arch/blackfin/mach-bf518/boards/ezbrd.c b/arch/blackfin/mach-bf518/boards/ezbrd.c
new file mode 100644
index 000000000000..15f1351c8645
--- /dev/null
+++ b/arch/blackfin/mach-bf518/boards/ezbrd.c
@@ -0,0 +1,669 @@
1/*
2 * File: arch/blackfin/mach-bf518/boards/ezbrd.c
3 * Based on: arch/blackfin/mach-bf527/boards/ezbrd.c
4 * Author: Bryan Wu <cooloney@kernel.org>
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2008 Analog Devices Inc.
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31#include <linux/device.h>
32#include <linux/platform_device.h>
33#include <linux/mtd/mtd.h>
34#include <linux/mtd/partitions.h>
35#include <linux/mtd/physmap.h>
36#include <linux/spi/spi.h>
37#include <linux/spi/flash.h>
38
39#include <linux/i2c.h>
40#include <linux/irq.h>
41#include <linux/interrupt.h>
42#include <asm/dma.h>
43#include <asm/bfin5xx_spi.h>
44#include <asm/reboot.h>
45#include <asm/portmux.h>
46#include <asm/dpmc.h>
47#include <asm/bfin_sdh.h>
48#include <linux/spi/ad7877.h>
49
50/*
51 * Name the Board for the /proc/cpuinfo
52 */
53const char bfin_board_name[] = "ADI BF518F-EZBRD";
54
55/*
56 * Driver needs to know address, irq and flag pin.
57 */
58
59#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
60static struct mtd_partition ezbrd_partitions[] = {
61 {
62 .name = "bootloader(nor)",
63 .size = 0x40000,
64 .offset = 0,
65 }, {
66 .name = "linux kernel(nor)",
67 .size = 0x1C0000,
68 .offset = MTDPART_OFS_APPEND,
69 }, {
70 .name = "file system(nor)",
71 .size = MTDPART_SIZ_FULL,
72 .offset = MTDPART_OFS_APPEND,
73 }
74};
75
76static struct physmap_flash_data ezbrd_flash_data = {
77 .width = 2,
78 .parts = ezbrd_partitions,
79 .nr_parts = ARRAY_SIZE(ezbrd_partitions),
80};
81
82static struct resource ezbrd_flash_resource = {
83 .start = 0x20000000,
84 .end = 0x203fffff,
85 .flags = IORESOURCE_MEM,
86};
87
88static struct platform_device ezbrd_flash_device = {
89 .name = "physmap-flash",
90 .id = 0,
91 .dev = {
92 .platform_data = &ezbrd_flash_data,
93 },
94 .num_resources = 1,
95 .resource = &ezbrd_flash_resource,
96};
97#endif
98
99#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
100static struct platform_device rtc_device = {
101 .name = "rtc-bfin",
102 .id = -1,
103};
104#endif
105
106#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
107static struct platform_device bfin_mac_device = {
108 .name = "bfin_mac",
109};
110#endif
111
112#if defined(CONFIG_MTD_M25P80) \
113 || defined(CONFIG_MTD_M25P80_MODULE)
114static struct mtd_partition bfin_spi_flash_partitions[] = {
115 {
116 .name = "bootloader(spi)",
117 .size = 0x00040000,
118 .offset = 0,
119 .mask_flags = MTD_CAP_ROM
120 }, {
121 .name = "linux kernel(spi)",
122 .size = MTDPART_SIZ_FULL,
123 .offset = MTDPART_OFS_APPEND,
124 }
125};
126
127static struct flash_platform_data bfin_spi_flash_data = {
128 .name = "m25p80",
129 .parts = bfin_spi_flash_partitions,
130 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
131 .type = "m25p16",
132};
133
134/* SPI flash chip (m25p64) */
135static struct bfin5xx_spi_chip spi_flash_chip_info = {
136 .enable_dma = 0, /* use dma transfer with this chip*/
137 .bits_per_word = 8,
138};
139#endif
140
141#if defined(CONFIG_SPI_ADC_BF533) \
142 || defined(CONFIG_SPI_ADC_BF533_MODULE)
143/* SPI ADC chip */
144static struct bfin5xx_spi_chip spi_adc_chip_info = {
145 .enable_dma = 1, /* use dma transfer with this chip*/
146 .bits_per_word = 16,
147};
148#endif
149
150#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
151static struct bfin5xx_spi_chip spi_mmc_chip_info = {
152 .enable_dma = 1,
153 .bits_per_word = 8,
154};
155#endif
156
157#if defined(CONFIG_PBX)
158static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
159 .ctl_reg = 0x4, /* send zero */
160 .enable_dma = 0,
161 .bits_per_word = 8,
162 .cs_change_per_word = 1,
163};
164#endif
165
166#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
167static struct bfin5xx_spi_chip spi_ad7877_chip_info = {
168 .enable_dma = 0,
169 .bits_per_word = 16,
170};
171
172static const struct ad7877_platform_data bfin_ad7877_ts_info = {
173 .model = 7877,
174 .vref_delay_usecs = 50, /* internal, no capacitor */
175 .x_plate_ohms = 419,
176 .y_plate_ohms = 486,
177 .pressure_max = 1000,
178 .pressure_min = 0,
179 .stopacq_polarity = 1,
180 .first_conversion_delay = 3,
181 .acquisition_time = 1,
182 .averaging = 1,
183 .pen_down_acc_interval = 1,
184};
185#endif
186
187#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
188 && defined(CONFIG_SND_SOC_WM8731_SPI)
189static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
190 .enable_dma = 0,
191 .bits_per_word = 16,
192};
193#endif
194
195#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
196static struct bfin5xx_spi_chip spidev_chip_info = {
197 .enable_dma = 0,
198 .bits_per_word = 8,
199};
200#endif
201
202static struct spi_board_info bfin_spi_board_info[] __initdata = {
203#if defined(CONFIG_MTD_M25P80) \
204 || defined(CONFIG_MTD_M25P80_MODULE)
205 {
206 /* the modalias must be the same as spi device driver name */
207 .modalias = "m25p80", /* Name of spi_driver for this device */
208 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
209 .bus_num = 0, /* Framework bus number */
210 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
211 .platform_data = &bfin_spi_flash_data,
212 .controller_data = &spi_flash_chip_info,
213 .mode = SPI_MODE_3,
214 },
215#endif
216
217#if defined(CONFIG_SPI_ADC_BF533) \
218 || defined(CONFIG_SPI_ADC_BF533_MODULE)
219 {
220 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
221 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
222 .bus_num = 0, /* Framework bus number */
223 .chip_select = 1, /* Framework chip select. */
224 .platform_data = NULL, /* No spi_driver specific config */
225 .controller_data = &spi_adc_chip_info,
226 },
227#endif
228
229#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
230 {
231 .modalias = "spi_mmc_dummy",
232 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
233 .bus_num = 0,
234 .chip_select = 0,
235 .platform_data = NULL,
236 .controller_data = &spi_mmc_chip_info,
237 .mode = SPI_MODE_3,
238 },
239 {
240 .modalias = "spi_mmc",
241 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
242 .bus_num = 0,
243 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
244 .platform_data = NULL,
245 .controller_data = &spi_mmc_chip_info,
246 .mode = SPI_MODE_3,
247 },
248#endif
249#if defined(CONFIG_PBX)
250 {
251 .modalias = "fxs-spi",
252 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
253 .bus_num = 0,
254 .chip_select = 8 - CONFIG_J11_JUMPER,
255 .controller_data = &spi_si3xxx_chip_info,
256 .mode = SPI_MODE_3,
257 },
258 {
259 .modalias = "fxo-spi",
260 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
261 .bus_num = 0,
262 .chip_select = 8 - CONFIG_J19_JUMPER,
263 .controller_data = &spi_si3xxx_chip_info,
264 .mode = SPI_MODE_3,
265 },
266#endif
267#if defined(CONFIG_TOUCHSCREEN_AD7877) || defined(CONFIG_TOUCHSCREEN_AD7877_MODULE)
268 {
269 .modalias = "ad7877",
270 .platform_data = &bfin_ad7877_ts_info,
271 .irq = IRQ_PF8,
272 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
273 .bus_num = 0,
274 .chip_select = 2,
275 .controller_data = &spi_ad7877_chip_info,
276 },
277#endif
278#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
279 && defined(CONFIG_SND_SOC_WM8731_SPI)
280 {
281 .modalias = "wm8731",
282 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
283 .bus_num = 0,
284 .chip_select = 5,
285 .controller_data = &spi_wm8731_chip_info,
286 .mode = SPI_MODE_0,
287 },
288#endif
289#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
290 {
291 .modalias = "spidev",
292 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
293 .bus_num = 0,
294 .chip_select = 1,
295 .controller_data = &spidev_chip_info,
296 },
297#endif
298#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
299 {
300 .modalias = "bfin-lq035q1-spi",
301 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
302 .bus_num = 0,
303 .chip_select = 1,
304 .controller_data = &lq035q1_spi_chip_info,
305 .mode = SPI_CPHA | SPI_CPOL,
306 },
307#endif
308};
309
310/* SPI controller data */
311#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
312/* SPI (0) */
313static struct bfin5xx_spi_master bfin_spi0_info = {
314 .num_chipselect = 5,
315 .enable_dma = 1, /* master has the ability to do dma transfer */
316 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
317};
318
319static struct resource bfin_spi0_resource[] = {
320 [0] = {
321 .start = SPI0_REGBASE,
322 .end = SPI0_REGBASE + 0xFF,
323 .flags = IORESOURCE_MEM,
324 },
325 [1] = {
326 .start = CH_SPI0,
327 .end = CH_SPI0,
328 .flags = IORESOURCE_IRQ,
329 },
330};
331
332static struct platform_device bfin_spi0_device = {
333 .name = "bfin-spi",
334 .id = 0, /* Bus number */
335 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
336 .resource = bfin_spi0_resource,
337 .dev = {
338 .platform_data = &bfin_spi0_info, /* Passed to driver */
339 },
340};
341
342/* SPI (1) */
343static struct bfin5xx_spi_master bfin_spi1_info = {
344 .num_chipselect = 5,
345 .enable_dma = 1, /* master has the ability to do dma transfer */
346 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
347};
348
349static struct resource bfin_spi1_resource[] = {
350 [0] = {
351 .start = SPI1_REGBASE,
352 .end = SPI1_REGBASE + 0xFF,
353 .flags = IORESOURCE_MEM,
354 },
355 [1] = {
356 .start = CH_SPI1,
357 .end = CH_SPI1,
358 .flags = IORESOURCE_IRQ,
359 },
360};
361
362static struct platform_device bfin_spi1_device = {
363 .name = "bfin-spi",
364 .id = 1, /* Bus number */
365 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
366 .resource = bfin_spi1_resource,
367 .dev = {
368 .platform_data = &bfin_spi1_info, /* Passed to driver */
369 },
370};
371#endif /* spi master and devices */
372
373#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
374static struct resource bfin_uart_resources[] = {
375#ifdef CONFIG_SERIAL_BFIN_UART0
376 {
377 .start = 0xFFC00400,
378 .end = 0xFFC004FF,
379 .flags = IORESOURCE_MEM,
380 },
381#endif
382#ifdef CONFIG_SERIAL_BFIN_UART1
383 {
384 .start = 0xFFC02000,
385 .end = 0xFFC020FF,
386 .flags = IORESOURCE_MEM,
387 },
388#endif
389};
390
391static struct platform_device bfin_uart_device = {
392 .name = "bfin-uart",
393 .id = 1,
394 .num_resources = ARRAY_SIZE(bfin_uart_resources),
395 .resource = bfin_uart_resources,
396};
397#endif
398
399#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
400#ifdef CONFIG_BFIN_SIR0
401static struct resource bfin_sir0_resources[] = {
402 {
403 .start = 0xFFC00400,
404 .end = 0xFFC004FF,
405 .flags = IORESOURCE_MEM,
406 },
407 {
408 .start = IRQ_UART0_RX,
409 .end = IRQ_UART0_RX+1,
410 .flags = IORESOURCE_IRQ,
411 },
412 {
413 .start = CH_UART0_RX,
414 .end = CH_UART0_RX+1,
415 .flags = IORESOURCE_DMA,
416 },
417};
418
419static struct platform_device bfin_sir0_device = {
420 .name = "bfin_sir",
421 .id = 0,
422 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
423 .resource = bfin_sir0_resources,
424};
425#endif
426#ifdef CONFIG_BFIN_SIR1
427static struct resource bfin_sir1_resources[] = {
428 {
429 .start = 0xFFC02000,
430 .end = 0xFFC020FF,
431 .flags = IORESOURCE_MEM,
432 },
433 {
434 .start = IRQ_UART1_RX,
435 .end = IRQ_UART1_RX+1,
436 .flags = IORESOURCE_IRQ,
437 },
438 {
439 .start = CH_UART1_RX,
440 .end = CH_UART1_RX+1,
441 .flags = IORESOURCE_DMA,
442 },
443};
444
445static struct platform_device bfin_sir1_device = {
446 .name = "bfin_sir",
447 .id = 1,
448 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
449 .resource = bfin_sir1_resources,
450};
451#endif
452#endif
453
454#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
455static struct resource bfin_twi0_resource[] = {
456 [0] = {
457 .start = TWI0_REGBASE,
458 .end = TWI0_REGBASE,
459 .flags = IORESOURCE_MEM,
460 },
461 [1] = {
462 .start = IRQ_TWI,
463 .end = IRQ_TWI,
464 .flags = IORESOURCE_IRQ,
465 },
466};
467
468static struct platform_device i2c_bfin_twi_device = {
469 .name = "i2c-bfin-twi",
470 .id = 0,
471 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
472 .resource = bfin_twi0_resource,
473};
474#endif
475
476#ifdef CONFIG_I2C_BOARDINFO
477static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
478#if defined(CONFIG_TWI_LCD) || defined(CONFIG_TWI_LCD_MODULE)
479 {
480 I2C_BOARD_INFO("pcf8574_lcd", 0x22),
481 },
482#endif
483#if defined(CONFIG_TWI_KEYPAD) || defined(CONFIG_TWI_KEYPAD_MODULE)
484 {
485 I2C_BOARD_INFO("pcf8574_keypad", 0x27),
486 .irq = IRQ_PF8,
487 },
488#endif
489};
490#endif
491
492#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
493static struct platform_device bfin_sport0_uart_device = {
494 .name = "bfin-sport-uart",
495 .id = 0,
496};
497
498static struct platform_device bfin_sport1_uart_device = {
499 .name = "bfin-sport-uart",
500 .id = 1,
501};
502#endif
503
504#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
505#include <linux/input.h>
506#include <linux/gpio_keys.h>
507
508static struct gpio_keys_button bfin_gpio_keys_table[] = {
509 {BTN_0, GPIO_PG0, 1, "gpio-keys: BTN0"},
510 {BTN_1, GPIO_PG13, 1, "gpio-keys: BTN1"},
511};
512
513static struct gpio_keys_platform_data bfin_gpio_keys_data = {
514 .buttons = bfin_gpio_keys_table,
515 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
516};
517
518static struct platform_device bfin_device_gpiokeys = {
519 .name = "gpio-keys",
520 .dev = {
521 .platform_data = &bfin_gpio_keys_data,
522 },
523};
524#endif
525
526#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
527
528static struct bfin_sd_host bfin_sdh_data = {
529 .dma_chan = CH_RSI,
530 .irq_int0 = IRQ_RSI_INT0,
531 .pin_req = {P_RSI_DATA0, P_RSI_DATA1, P_RSI_DATA2, P_RSI_DATA3, P_RSI_CMD, P_RSI_CLK, 0},
532};
533
534static struct platform_device bf51x_sdh_device = {
535 .name = "bfin-sdh",
536 .id = 0,
537 .dev = {
538 .platform_data = &bfin_sdh_data,
539 },
540};
541#endif
542
543static struct resource bfin_gpios_resources = {
544 .start = 0,
545 .end = MAX_BLACKFIN_GPIOS - 1,
546 .flags = IORESOURCE_IRQ,
547};
548
549static struct platform_device bfin_gpios_device = {
550 .name = "simple-gpio",
551 .id = -1,
552 .num_resources = 1,
553 .resource = &bfin_gpios_resources,
554};
555
556static const unsigned int cclk_vlev_datasheet[] =
557{
558 VRPAIR(VLEV_100, 400000000),
559 VRPAIR(VLEV_105, 426000000),
560 VRPAIR(VLEV_110, 500000000),
561 VRPAIR(VLEV_115, 533000000),
562 VRPAIR(VLEV_120, 600000000),
563};
564
565static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
566 .tuple_tab = cclk_vlev_datasheet,
567 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
568 .vr_settling_time = 25 /* us */,
569};
570
571static struct platform_device bfin_dpmc = {
572 .name = "bfin dpmc",
573 .dev = {
574 .platform_data = &bfin_dmpc_vreg_data,
575 },
576};
577
578static struct platform_device *stamp_devices[] __initdata = {
579
580 &bfin_dpmc,
581
582#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
583 &rtc_device,
584#endif
585
586#if defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)
587 &bfin_mac_device,
588#endif
589
590#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
591 &bfin_spi0_device,
592 &bfin_spi1_device,
593#endif
594
595#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
596 &bfin_uart_device,
597#endif
598
599#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
600#ifdef CONFIG_BFIN_SIR0
601 &bfin_sir0_device,
602#endif
603#ifdef CONFIG_BFIN_SIR1
604 &bfin_sir1_device,
605#endif
606#endif
607
608#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
609 &i2c_bfin_twi_device,
610#endif
611
612#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
613 &bfin_sport0_uart_device,
614 &bfin_sport1_uart_device,
615#endif
616
617#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
618 &bfin_device_gpiokeys,
619#endif
620
621#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
622 &bf51x_sdh_device,
623#endif
624
625#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
626 &ezbrd_flash_device,
627#endif
628
629 &bfin_gpios_device,
630};
631
632static int __init ezbrd_init(void)
633{
634 printk(KERN_INFO "%s(): registering device resources\n", __func__);
635
636#ifdef CONFIG_I2C_BOARDINFO
637 i2c_register_board_info(0, bfin_i2c_board_info,
638 ARRAY_SIZE(bfin_i2c_board_info));
639#endif
640
641 platform_add_devices(stamp_devices, ARRAY_SIZE(stamp_devices));
642 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
643 return 0;
644}
645
646arch_initcall(ezbrd_init);
647
648void native_machine_restart(char *cmd)
649{
650 /* workaround reboot hang when booting from SPI */
651 if ((bfin_read_SYSCR() & 0x7) == 0x3)
652 bfin_gpio_reset_spi0_ssel1();
653}
654
655void bfin_get_ether_addr(char *addr)
656{
657 /* the MAC is stored in OTP memory page 0xDF */
658 u32 ret;
659 u64 otp_mac;
660 u32 (*otp_read)(u32 page, u32 flags, u64 *page_content) = (void *)0xEF00001A;
661
662 ret = otp_read(0xDF, 0x00, &otp_mac);
663 if (!(ret & 0x1)) {
664 char *otp_mac_p = (char *)&otp_mac;
665 for (ret = 0; ret < 6; ++ret)
666 addr[ret] = otp_mac_p[5 - ret];
667 }
668}
669EXPORT_SYMBOL(bfin_get_ether_addr);
diff --git a/arch/blackfin/mach-bf518/dma.c b/arch/blackfin/mach-bf518/dma.c
new file mode 100644
index 000000000000..698e88ca5104
--- /dev/null
+++ b/arch/blackfin/mach-bf518/dma.c
@@ -0,0 +1,118 @@
1/*
2 * File: arch/blackfin/mach-bf518/dma.c
3 * Based on:
4 * Author: Bryan Wu <cooloney@kernel.org>
5 *
6 * Created:
7 * Description: This file contains the simple DMA Implementation for Blackfin
8 *
9 * Modified:
10 * Copyright 2004-2008 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29#include <linux/module.h>
30
31#include <asm/blackfin.h>
32#include <asm/dma.h>
33
34struct dma_register *dma_io_base_addr[MAX_DMA_CHANNELS] = {
35 (struct dma_register *) DMA0_NEXT_DESC_PTR,
36 (struct dma_register *) DMA1_NEXT_DESC_PTR,
37 (struct dma_register *) DMA2_NEXT_DESC_PTR,
38 (struct dma_register *) DMA3_NEXT_DESC_PTR,
39 (struct dma_register *) DMA4_NEXT_DESC_PTR,
40 (struct dma_register *) DMA5_NEXT_DESC_PTR,
41 (struct dma_register *) DMA6_NEXT_DESC_PTR,
42 (struct dma_register *) DMA7_NEXT_DESC_PTR,
43 (struct dma_register *) DMA8_NEXT_DESC_PTR,
44 (struct dma_register *) DMA9_NEXT_DESC_PTR,
45 (struct dma_register *) DMA10_NEXT_DESC_PTR,
46 (struct dma_register *) DMA11_NEXT_DESC_PTR,
47 (struct dma_register *) MDMA_S0_NEXT_DESC_PTR,
48 (struct dma_register *) MDMA_D0_NEXT_DESC_PTR,
49 (struct dma_register *) MDMA_S1_NEXT_DESC_PTR,
50 (struct dma_register *) MDMA_D1_NEXT_DESC_PTR,
51};
52EXPORT_SYMBOL(dma_io_base_addr);
53
54int channel2irq(unsigned int channel)
55{
56 int ret_irq = -1;
57
58 switch (channel) {
59 case CH_PPI:
60 ret_irq = IRQ_PPI;
61 break;
62
63 case CH_EMAC_RX:
64 ret_irq = IRQ_MAC_RX;
65 break;
66
67 case CH_EMAC_TX:
68 ret_irq = IRQ_MAC_TX;
69 break;
70
71 case CH_UART1_RX:
72 ret_irq = IRQ_UART1_RX;
73 break;
74
75 case CH_UART1_TX:
76 ret_irq = IRQ_UART1_TX;
77 break;
78
79 case CH_SPORT0_RX:
80 ret_irq = IRQ_SPORT0_RX;
81 break;
82
83 case CH_SPORT0_TX:
84 ret_irq = IRQ_SPORT0_TX;
85 break;
86
87 case CH_SPORT1_RX:
88 ret_irq = IRQ_SPORT1_RX;
89 break;
90
91 case CH_SPORT1_TX:
92 ret_irq = IRQ_SPORT1_TX;
93 break;
94
95 case CH_SPI0:
96 ret_irq = IRQ_SPI0;
97 break;
98
99 case CH_UART0_RX:
100 ret_irq = IRQ_UART0_RX;
101 break;
102
103 case CH_UART0_TX:
104 ret_irq = IRQ_UART0_TX;
105 break;
106
107 case CH_MEM_STREAM0_SRC:
108 case CH_MEM_STREAM0_DEST:
109 ret_irq = IRQ_MEM_DMA0;
110 break;
111
112 case CH_MEM_STREAM1_SRC:
113 case CH_MEM_STREAM1_DEST:
114 ret_irq = IRQ_MEM_DMA1;
115 break;
116 }
117 return ret_irq;
118}
diff --git a/arch/blackfin/mach-bf518/include/mach/anomaly.h b/arch/blackfin/mach-bf518/include/mach/anomaly.h
new file mode 100644
index 000000000000..e5b4bef0edae
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/anomaly.h
@@ -0,0 +1,79 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/anomaly.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2004-2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9/* This file shoule be up to date with:
10 * - ????
11 */
12
13#ifndef _MACH_ANOMALY_H_
14#define _MACH_ANOMALY_H_
15
16/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */
17#define ANOMALY_05000074 (1)
18/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
19#define ANOMALY_05000122 (1)
20/* False Hardware Error from an Access in the Shadow of a Conditional Branch */
21#define ANOMALY_05000245 (1)
22/* Sensitivity To Noise with Slow Input Edge Rates on External SPORT TX and RX Clocks */
23#define ANOMALY_05000265 (1)
24/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
25#define ANOMALY_05000310 (1)
26/* PPI Underflow Error Goes Undetected in ITU-R 656 Mode */
27#define ANOMALY_05000366 (1)
28/* Lockbox SESR Firmware Does Not Save/Restore Full Context */
29#define ANOMALY_05000405 (1)
30/* Lockbox Firmware Memory Cleanup Routine Does not Clear Registers */
31#define ANOMALY_05000408 (1)
32/* Speculative Fetches Can Cause Undesired External FIFO Operations */
33#define ANOMALY_05000416 (1)
34/* TWI Fall Time (Tof) May Violate the Minimum I2C Specification */
35#define ANOMALY_05000421 (1)
36/* TWI Input Capacitance (Ci) May Violate the Maximum I2C Specification */
37#define ANOMALY_05000422 (1)
38/* Speculative Fetches of Indirect-Pointer Instructions Can Cause False Hardware Errors */
39#define ANOMALY_05000426 (1)
40/* Software System Reset Corrupts PLL_LOCKCNT Register */
41#define ANOMALY_05000430 (1)
42/* Incorrect Use of Stack in Lockbox Firmware During Authentication */
43#define ANOMALY_05000431 (1)
44/* Certain SIC Registers are not Reset After Soft or Core Double Fault Reset */
45#define ANOMALY_05000435 (1)
46/* PORTx_DRIVE and PORTx_HYSTERESIS Registers Read Back Incorrect Values */
47#define ANOMALY_05000438 (1)
48/* Preboot Cannot be Used to Program the PLL_DIV Register */
49#define ANOMALY_05000439 (1)
50/* bfrom_SysControl() Cannot be Used to Write the PLL_DIV Register */
51#define ANOMALY_05000440 (1)
52/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
53#define ANOMALY_05000443 (1)
54/* Incorrect L1 Instruction Bank B Memory Map Location */
55#define ANOMALY_05000444 (1)
56
57/* Anomalies that don't exist on this proc */
58#define ANOMALY_05000125 (0)
59#define ANOMALY_05000158 (0)
60#define ANOMALY_05000183 (0)
61#define ANOMALY_05000198 (0)
62#define ANOMALY_05000230 (0)
63#define ANOMALY_05000244 (0)
64#define ANOMALY_05000261 (0)
65#define ANOMALY_05000263 (0)
66#define ANOMALY_05000266 (0)
67#define ANOMALY_05000273 (0)
68#define ANOMALY_05000285 (0)
69#define ANOMALY_05000307 (0)
70#define ANOMALY_05000311 (0)
71#define ANOMALY_05000312 (0)
72#define ANOMALY_05000323 (0)
73#define ANOMALY_05000353 (0)
74#define ANOMALY_05000363 (0)
75#define ANOMALY_05000386 (0)
76#define ANOMALY_05000412 (0)
77#define ANOMALY_05000432 (0)
78
79#endif
diff --git a/arch/blackfin/mach-bf518/include/mach/bf518.h b/arch/blackfin/mach-bf518/include/mach/bf518.h
new file mode 100644
index 000000000000..78da1a07ee73
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/bf518.h
@@ -0,0 +1,132 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/bf518.h
3 * Based on: include/asm-blackfin/mach-bf527/bf527.h
4 * Author: Michael Hennerich (michael.hennerich@analog.com)
5 *
6 * Created:
7 * Description: SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF518
8 *
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#ifndef __MACH_BF518_H__
31#define __MACH_BF518_H__
32
33#define OFFSET_(x) ((x) & 0x0000FFFF)
34
35/*some misc defines*/
36#define IMASK_IVG15 0x8000
37#define IMASK_IVG14 0x4000
38#define IMASK_IVG13 0x2000
39#define IMASK_IVG12 0x1000
40
41#define IMASK_IVG11 0x0800
42#define IMASK_IVG10 0x0400
43#define IMASK_IVG9 0x0200
44#define IMASK_IVG8 0x0100
45
46#define IMASK_IVG7 0x0080
47#define IMASK_IVGTMR 0x0040
48#define IMASK_IVGHW 0x0020
49
50/***************************/
51
52#define BFIN_DSUBBANKS 4
53#define BFIN_DWAYS 2
54#define BFIN_DLINES 64
55#define BFIN_ISUBBANKS 4
56#define BFIN_IWAYS 4
57#define BFIN_ILINES 32
58
59#define WAY0_L 0x1
60#define WAY1_L 0x2
61#define WAY01_L 0x3
62#define WAY2_L 0x4
63#define WAY02_L 0x5
64#define WAY12_L 0x6
65#define WAY012_L 0x7
66
67#define WAY3_L 0x8
68#define WAY03_L 0x9
69#define WAY13_L 0xA
70#define WAY013_L 0xB
71
72#define WAY32_L 0xC
73#define WAY320_L 0xD
74#define WAY321_L 0xE
75#define WAYALL_L 0xF
76
77#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
78
79/********************************* EBIU Settings ************************************/
80#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
81#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
82
83#ifdef CONFIG_C_AMBEN_ALL
84#define V_AMBEN AMBEN_ALL
85#endif
86#ifdef CONFIG_C_AMBEN
87#define V_AMBEN 0x0
88#endif
89#ifdef CONFIG_C_AMBEN_B0
90#define V_AMBEN AMBEN_B0
91#endif
92#ifdef CONFIG_C_AMBEN_B0_B1
93#define V_AMBEN AMBEN_B0_B1
94#endif
95#ifdef CONFIG_C_AMBEN_B0_B1_B2
96#define V_AMBEN AMBEN_B0_B1_B2
97#endif
98#ifdef CONFIG_C_AMCKEN
99#define V_AMCKEN AMCKEN
100#else
101#define V_AMCKEN 0x0
102#endif
103#ifdef CONFIG_C_CDPRIO
104#define V_CDPRIO 0x100
105#else
106#define V_CDPRIO 0x0
107#endif
108
109#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO)
110
111#ifdef CONFIG_BF518
112#define CPU "BF518"
113#define CPUID 0x27e8
114#endif
115#ifdef CONFIG_BF516
116#define CPU "BF516"
117#define CPUID 0x27e8
118#endif
119#ifdef CONFIG_BF514
120#define CPU "BF514"
121#define CPUID 0x27e8
122#endif
123#ifdef CONFIG_BF512
124#define CPU "BF512"
125#define CPUID 0x27e8
126#endif
127
128#ifndef CPU
129#error "Unknown CPU type - This kernel doesn't seem to be configured properly"
130#endif
131
132#endif /* __MACH_BF518_H__ */
diff --git a/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
new file mode 100644
index 000000000000..b50a63b975a2
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/bfin_serial_5xx.h
@@ -0,0 +1,169 @@
1/*
2 * file: include/asm-blackfin/mach-bf518/bfin_serial_5xx.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * blackfin serial driver head file
9 * rev:
10 *
11 * modified:
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * this program is distributed in the hope that it will be useful,
22 * but without any warranty; without even the implied warranty of
23 * merchantability or fitness for a particular purpose. see the
24 * gnu general public license for more details.
25 *
26 * you should have received a copy of the gnu general public license
27 * along with this program; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */
31
32#include <linux/serial.h>
33#include <asm/dma.h>
34#include <asm/portmux.h>
35
36#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
37#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
38#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
39#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
40#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
41#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
42#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
43
44#define UART_PUT_CHAR(uart, v) bfin_write16(((uart)->port.membase + OFFSET_THR), v)
45#define UART_PUT_DLL(uart, v) bfin_write16(((uart)->port.membase + OFFSET_DLL), v)
46#define UART_PUT_IER(uart, v) bfin_write16(((uart)->port.membase + OFFSET_IER), v)
47#define UART_SET_IER(uart, v) UART_PUT_IER(uart, UART_GET_IER(uart) | (v))
48#define UART_CLEAR_IER(uart, v) UART_PUT_IER(uart, UART_GET_IER(uart) & ~(v))
49#define UART_PUT_DLH(uart, v) bfin_write16(((uart)->port.membase + OFFSET_DLH), v)
50#define UART_PUT_LCR(uart, v) bfin_write16(((uart)->port.membase + OFFSET_LCR), v)
51#define UART_PUT_GCTL(uart, v) bfin_write16(((uart)->port.membase + OFFSET_GCTL), v)
52
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55
56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_SET_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_CLEAR_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
60#define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0)
61
62#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
63# define CONFIG_SERIAL_BFIN_CTSRTS
64
65# ifndef CONFIG_UART0_CTS_PIN
66# define CONFIG_UART0_CTS_PIN -1
67# endif
68
69# ifndef CONFIG_UART0_RTS_PIN
70# define CONFIG_UART0_RTS_PIN -1
71# endif
72
73# ifndef CONFIG_UART1_CTS_PIN
74# define CONFIG_UART1_CTS_PIN -1
75# endif
76
77# ifndef CONFIG_UART1_RTS_PIN
78# define CONFIG_UART1_RTS_PIN -1
79# endif
80#endif
81
82#define BFIN_UART_TX_FIFO_SIZE 2
83
84/*
85 * The pin configuration is different from schematic
86 */
87struct bfin_serial_port {
88 struct uart_port port;
89 unsigned int old_status;
90 unsigned int lsr;
91#ifdef CONFIG_SERIAL_BFIN_DMA
92 int tx_done;
93 int tx_count;
94 struct circ_buf rx_dma_buf;
95 struct timer_list rx_dma_timer;
96 int rx_dma_nrows;
97 unsigned int tx_dma_channel;
98 unsigned int rx_dma_channel;
99 struct work_struct tx_dma_workqueue;
100#endif
101#ifdef CONFIG_SERIAL_BFIN_CTSRTS
102 struct timer_list cts_timer;
103 int cts_pin;
104 int rts_pin;
105#endif
106};
107
108/* The hardware clears the LSR bits upon read, so we need to cache
109 * some of the more fun bits in software so they don't get lost
110 * when checking the LSR in other code paths (TX).
111 */
112static inline unsigned int UART_GET_LSR(struct bfin_serial_port *uart)
113{
114 unsigned int lsr = bfin_read16(uart->port.membase + OFFSET_LSR);
115 uart->lsr |= (lsr & (BI|FE|PE|OE));
116 return lsr | uart->lsr;
117}
118
119static inline void UART_CLEAR_LSR(struct bfin_serial_port *uart)
120{
121 uart->lsr = 0;
122 bfin_write16(uart->port.membase + OFFSET_LSR, -1);
123}
124
125struct bfin_serial_res {
126 unsigned long uart_base_addr;
127 int uart_irq;
128#ifdef CONFIG_SERIAL_BFIN_DMA
129 unsigned int uart_tx_dma_channel;
130 unsigned int uart_rx_dma_channel;
131#endif
132#ifdef CONFIG_SERIAL_BFIN_CTSRTS
133 int uart_cts_pin;
134 int uart_rts_pin;
135#endif
136};
137
138struct bfin_serial_res bfin_serial_resource[] = {
139#ifdef CONFIG_SERIAL_BFIN_UART0
140 {
141 0xFFC00400,
142 IRQ_UART0_RX,
143#ifdef CONFIG_SERIAL_BFIN_DMA
144 CH_UART0_TX,
145 CH_UART0_RX,
146#endif
147#ifdef CONFIG_BFIN_UART0_CTSRTS
148 CONFIG_UART0_CTS_PIN,
149 CONFIG_UART0_RTS_PIN,
150#endif
151 },
152#endif
153#ifdef CONFIG_SERIAL_BFIN_UART1
154 {
155 0xFFC02000,
156 IRQ_UART1_RX,
157#ifdef CONFIG_SERIAL_BFIN_DMA
158 CH_UART1_TX,
159 CH_UART1_RX,
160#endif
161#ifdef CONFIG_BFIN_UART1_CTSRTS
162 CONFIG_UART1_CTS_PIN,
163 CONFIG_UART1_RTS_PIN,
164#endif
165 },
166#endif
167};
168
169#define DRIVER_NAME "bfin-uart"
diff --git a/arch/blackfin/mach-bf518/include/mach/blackfin.h b/arch/blackfin/mach-bf518/include/mach/blackfin.h
new file mode 100644
index 000000000000..d1a2b9ca6227
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/blackfin.h
@@ -0,0 +1,105 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/blackfin.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _MACH_BLACKFIN_H_
33#define _MACH_BLACKFIN_H_
34
35#define BF518_FAMILY
36
37#include "bf518.h"
38#include "mem_map.h"
39#include "defBF512.h"
40#include "anomaly.h"
41
42#if defined(CONFIG_BF518)
43#include "defBF518.h"
44#endif
45
46#if defined(CONFIG_BF516)
47#include "defBF516.h"
48#endif
49
50#if defined(CONFIG_BF514)
51#include "defBF514.h"
52#endif
53
54#if defined(CONFIG_BF512)
55#include "defBF512.h"
56#endif
57
58#if !defined(__ASSEMBLY__)
59#include "cdefBF512.h"
60
61#if defined(CONFIG_BF518)
62#include "cdefBF518.h"
63#endif
64
65#if defined(CONFIG_BF516)
66#include "cdefBF516.h"
67#endif
68
69#if defined(CONFIG_BF514)
70#include "cdefBF514.h"
71#endif
72#endif
73
74/* UART_IIR Register */
75#define STATUS(x) ((x << 1) & 0x06)
76#define STATUS_P1 0x02
77#define STATUS_P0 0x01
78
79#define BFIN_UART_NR_PORTS 2
80
81#define OFFSET_THR 0x00 /* Transmit Holding register */
82#define OFFSET_RBR 0x00 /* Receive Buffer register */
83#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
84#define OFFSET_IER 0x04 /* Interrupt Enable Register */
85#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
86#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
87#define OFFSET_LCR 0x0C /* Line Control Register */
88#define OFFSET_MCR 0x10 /* Modem Control Register */
89#define OFFSET_LSR 0x14 /* Line Status Register */
90#define OFFSET_MSR 0x18 /* Modem Status Register */
91#define OFFSET_SCR 0x1C /* SCR Scratch Register */
92#define OFFSET_GCTL 0x24 /* Global Control Register */
93
94/* DPMC*/
95#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
96#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
97#define STOPCK_OFF STOPCK
98
99/* PLL_DIV Masks */
100#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
101#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
102#define CCLK_DIV4 CSEL_DIV4 /* CCLK = VCO / 4 */
103#define CCLK_DIV8 CSEL_DIV8 /* CCLK = VCO / 8 */
104
105#endif
diff --git a/arch/blackfin/mach-bf518/include/mach/cdefBF512.h b/arch/blackfin/mach-bf518/include/mach/cdefBF512.h
new file mode 100644
index 000000000000..820c13c4daaa
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/cdefBF512.h
@@ -0,0 +1,46 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/cdefbf512.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: system mmr register map
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _CDEF_BF512_H
33#define _CDEF_BF512_H
34
35/* include all Core registers and bit definitions */
36#include "defBF512.h"
37
38/* include core specific register pointer definitions */
39#include <asm/cdef_LPBlackfin.h>
40
41/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF512 */
42
43/* include cdefBF51x_base.h for the set of #defines that are common to all ADSP-BF51x processors */
44#include "cdefBF51x_base.h"
45
46#endif /* _CDEF_BF512_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/cdefBF514.h b/arch/blackfin/mach-bf518/include/mach/cdefBF514.h
new file mode 100644
index 000000000000..9521e178fb28
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/cdefBF514.h
@@ -0,0 +1,48 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/cdefbf514.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: system mmr register map
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _CDEF_BF514_H
33#define _CDEF_BF514_H
34
35/* include all Core registers and bit definitions */
36#include "defBF514.h"
37
38/* include core specific register pointer definitions */
39#include <asm/cdef_LPBlackfin.h>
40
41/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF514 */
42
43/* include cdefBF51x_base.h for the set of #defines that are common to all ADSP-BF51x processors */
44#include "cdefBF51x_base.h"
45
46/* The following are the #defines needed by ADSP-BF514 that are not in the common header */
47
48#endif /* _CDEF_BF514_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/cdefBF516.h b/arch/blackfin/mach-bf518/include/mach/cdefBF516.h
new file mode 100644
index 000000000000..4e26ccfcef97
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/cdefBF516.h
@@ -0,0 +1,213 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/cdefbf516.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: system mmr register map
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _CDEF_BF516_H
33#define _CDEF_BF516_H
34
35/* include all Core registers and bit definitions */
36#include "defBF516.h"
37
38/* include core specific register pointer definitions */
39#include <asm/cdef_LPBlackfin.h>
40
41/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF516 */
42
43/* include cdefBF51x_base.h for the set of #defines that are common to all ADSP-BF51x processors */
44#include "cdefBF51x_base.h"
45
46/* The following are the #defines needed by ADSP-BF516 that are not in the common header */
47
48/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
49
50#define bfin_read_EMAC_OPMODE() bfin_read32(EMAC_OPMODE)
51#define bfin_write_EMAC_OPMODE(val) bfin_write32(EMAC_OPMODE, val)
52#define bfin_read_EMAC_ADDRLO() bfin_read32(EMAC_ADDRLO)
53#define bfin_write_EMAC_ADDRLO(val) bfin_write32(EMAC_ADDRLO, val)
54#define bfin_read_EMAC_ADDRHI() bfin_read32(EMAC_ADDRHI)
55#define bfin_write_EMAC_ADDRHI(val) bfin_write32(EMAC_ADDRHI, val)
56#define bfin_read_EMAC_HASHLO() bfin_read32(EMAC_HASHLO)
57#define bfin_write_EMAC_HASHLO(val) bfin_write32(EMAC_HASHLO, val)
58#define bfin_read_EMAC_HASHHI() bfin_read32(EMAC_HASHHI)
59#define bfin_write_EMAC_HASHHI(val) bfin_write32(EMAC_HASHHI, val)
60#define bfin_read_EMAC_STAADD() bfin_read32(EMAC_STAADD)
61#define bfin_write_EMAC_STAADD(val) bfin_write32(EMAC_STAADD, val)
62#define bfin_read_EMAC_STADAT() bfin_read32(EMAC_STADAT)
63#define bfin_write_EMAC_STADAT(val) bfin_write32(EMAC_STADAT, val)
64#define bfin_read_EMAC_FLC() bfin_read32(EMAC_FLC)
65#define bfin_write_EMAC_FLC(val) bfin_write32(EMAC_FLC, val)
66#define bfin_read_EMAC_VLAN1() bfin_read32(EMAC_VLAN1)
67#define bfin_write_EMAC_VLAN1(val) bfin_write32(EMAC_VLAN1, val)
68#define bfin_read_EMAC_VLAN2() bfin_read32(EMAC_VLAN2)
69#define bfin_write_EMAC_VLAN2(val) bfin_write32(EMAC_VLAN2, val)
70#define bfin_read_EMAC_WKUP_CTL() bfin_read32(EMAC_WKUP_CTL)
71#define bfin_write_EMAC_WKUP_CTL(val) bfin_write32(EMAC_WKUP_CTL, val)
72#define bfin_read_EMAC_WKUP_FFMSK0() bfin_read32(EMAC_WKUP_FFMSK0)
73#define bfin_write_EMAC_WKUP_FFMSK0(val) bfin_write32(EMAC_WKUP_FFMSK0, val)
74#define bfin_read_EMAC_WKUP_FFMSK1() bfin_read32(EMAC_WKUP_FFMSK1)
75#define bfin_write_EMAC_WKUP_FFMSK1(val) bfin_write32(EMAC_WKUP_FFMSK1, val)
76#define bfin_read_EMAC_WKUP_FFMSK2() bfin_read32(EMAC_WKUP_FFMSK2)
77#define bfin_write_EMAC_WKUP_FFMSK2(val) bfin_write32(EMAC_WKUP_FFMSK2, val)
78#define bfin_read_EMAC_WKUP_FFMSK3() bfin_read32(EMAC_WKUP_FFMSK3)
79#define bfin_write_EMAC_WKUP_FFMSK3(val) bfin_write32(EMAC_WKUP_FFMSK3, val)
80#define bfin_read_EMAC_WKUP_FFCMD() bfin_read32(EMAC_WKUP_FFCMD)
81#define bfin_write_EMAC_WKUP_FFCMD(val) bfin_write32(EMAC_WKUP_FFCMD, val)
82#define bfin_read_EMAC_WKUP_FFOFF() bfin_read32(EMAC_WKUP_FFOFF)
83#define bfin_write_EMAC_WKUP_FFOFF(val) bfin_write32(EMAC_WKUP_FFOFF, val)
84#define bfin_read_EMAC_WKUP_FFCRC0() bfin_read32(EMAC_WKUP_FFCRC0)
85#define bfin_write_EMAC_WKUP_FFCRC0(val) bfin_write32(EMAC_WKUP_FFCRC0, val)
86#define bfin_read_EMAC_WKUP_FFCRC1() bfin_read32(EMAC_WKUP_FFCRC1)
87#define bfin_write_EMAC_WKUP_FFCRC1(val) bfin_write32(EMAC_WKUP_FFCRC1, val)
88
89#define bfin_read_EMAC_SYSCTL() bfin_read32(EMAC_SYSCTL)
90#define bfin_write_EMAC_SYSCTL(val) bfin_write32(EMAC_SYSCTL, val)
91#define bfin_read_EMAC_SYSTAT() bfin_read32(EMAC_SYSTAT)
92#define bfin_write_EMAC_SYSTAT(val) bfin_write32(EMAC_SYSTAT, val)
93#define bfin_read_EMAC_RX_STAT() bfin_read32(EMAC_RX_STAT)
94#define bfin_write_EMAC_RX_STAT(val) bfin_write32(EMAC_RX_STAT, val)
95#define bfin_read_EMAC_RX_STKY() bfin_read32(EMAC_RX_STKY)
96#define bfin_write_EMAC_RX_STKY(val) bfin_write32(EMAC_RX_STKY, val)
97#define bfin_read_EMAC_RX_IRQE() bfin_read32(EMAC_RX_IRQE)
98#define bfin_write_EMAC_RX_IRQE(val) bfin_write32(EMAC_RX_IRQE, val)
99#define bfin_read_EMAC_TX_STAT() bfin_read32(EMAC_TX_STAT)
100#define bfin_write_EMAC_TX_STAT(val) bfin_write32(EMAC_TX_STAT, val)
101#define bfin_read_EMAC_TX_STKY() bfin_read32(EMAC_TX_STKY)
102#define bfin_write_EMAC_TX_STKY(val) bfin_write32(EMAC_TX_STKY, val)
103#define bfin_read_EMAC_TX_IRQE() bfin_read32(EMAC_TX_IRQE)
104#define bfin_write_EMAC_TX_IRQE(val) bfin_write32(EMAC_TX_IRQE, val)
105
106#define bfin_read_EMAC_MMC_CTL() bfin_read32(EMAC_MMC_CTL)
107#define bfin_write_EMAC_MMC_CTL(val) bfin_write32(EMAC_MMC_CTL, val)
108#define bfin_read_EMAC_MMC_RIRQS() bfin_read32(EMAC_MMC_RIRQS)
109#define bfin_write_EMAC_MMC_RIRQS(val) bfin_write32(EMAC_MMC_RIRQS, val)
110#define bfin_read_EMAC_MMC_RIRQE() bfin_read32(EMAC_MMC_RIRQE)
111#define bfin_write_EMAC_MMC_RIRQE(val) bfin_write32(EMAC_MMC_RIRQE, val)
112#define bfin_read_EMAC_MMC_TIRQS() bfin_read32(EMAC_MMC_TIRQS)
113#define bfin_write_EMAC_MMC_TIRQS(val) bfin_write32(EMAC_MMC_TIRQS, val)
114#define bfin_read_EMAC_MMC_TIRQE() bfin_read32(EMAC_MMC_TIRQE)
115#define bfin_write_EMAC_MMC_TIRQE(val) bfin_write32(EMAC_MMC_TIRQE, val)
116
117#define bfin_read_EMAC_RXC_OK() bfin_read32(EMAC_RXC_OK)
118#define bfin_write_EMAC_RXC_OK(val) bfin_write32(EMAC_RXC_OK, val)
119#define bfin_read_EMAC_RXC_FCS() bfin_read32(EMAC_RXC_FCS)
120#define bfin_write_EMAC_RXC_FCS(val) bfin_write32(EMAC_RXC_FCS, val)
121#define bfin_read_EMAC_RXC_ALIGN() bfin_read32(EMAC_RXC_ALIGN)
122#define bfin_write_EMAC_RXC_ALIGN(val) bfin_write32(EMAC_RXC_ALIGN, val)
123#define bfin_read_EMAC_RXC_OCTET() bfin_read32(EMAC_RXC_OCTET)
124#define bfin_write_EMAC_RXC_OCTET(val) bfin_write32(EMAC_RXC_OCTET, val)
125#define bfin_read_EMAC_RXC_DMAOVF() bfin_read32(EMAC_RXC_DMAOVF)
126#define bfin_write_EMAC_RXC_DMAOVF(val) bfin_write32(EMAC_RXC_DMAOVF, val)
127#define bfin_read_EMAC_RXC_UNICST() bfin_read32(EMAC_RXC_UNICST)
128#define bfin_write_EMAC_RXC_UNICST(val) bfin_write32(EMAC_RXC_UNICST, val)
129#define bfin_read_EMAC_RXC_MULTI() bfin_read32(EMAC_RXC_MULTI)
130#define bfin_write_EMAC_RXC_MULTI(val) bfin_write32(EMAC_RXC_MULTI, val)
131#define bfin_read_EMAC_RXC_BROAD() bfin_read32(EMAC_RXC_BROAD)
132#define bfin_write_EMAC_RXC_BROAD(val) bfin_write32(EMAC_RXC_BROAD, val)
133#define bfin_read_EMAC_RXC_LNERRI() bfin_read32(EMAC_RXC_LNERRI)
134#define bfin_write_EMAC_RXC_LNERRI(val) bfin_write32(EMAC_RXC_LNERRI, val)
135#define bfin_read_EMAC_RXC_LNERRO() bfin_read32(EMAC_RXC_LNERRO)
136#define bfin_write_EMAC_RXC_LNERRO(val) bfin_write32(EMAC_RXC_LNERRO, val)
137#define bfin_read_EMAC_RXC_LONG() bfin_read32(EMAC_RXC_LONG)
138#define bfin_write_EMAC_RXC_LONG(val) bfin_write32(EMAC_RXC_LONG, val)
139#define bfin_read_EMAC_RXC_MACCTL() bfin_read32(EMAC_RXC_MACCTL)
140#define bfin_write_EMAC_RXC_MACCTL(val) bfin_write32(EMAC_RXC_MACCTL, val)
141#define bfin_read_EMAC_RXC_OPCODE() bfin_read32(EMAC_RXC_OPCODE)
142#define bfin_write_EMAC_RXC_OPCODE(val) bfin_write32(EMAC_RXC_OPCODE, val)
143#define bfin_read_EMAC_RXC_PAUSE() bfin_read32(EMAC_RXC_PAUSE)
144#define bfin_write_EMAC_RXC_PAUSE(val) bfin_write32(EMAC_RXC_PAUSE, val)
145#define bfin_read_EMAC_RXC_ALLFRM() bfin_read32(EMAC_RXC_ALLFRM)
146#define bfin_write_EMAC_RXC_ALLFRM(val) bfin_write32(EMAC_RXC_ALLFRM, val)
147#define bfin_read_EMAC_RXC_ALLOCT() bfin_read32(EMAC_RXC_ALLOCT)
148#define bfin_write_EMAC_RXC_ALLOCT(val) bfin_write32(EMAC_RXC_ALLOCT, val)
149#define bfin_read_EMAC_RXC_TYPED() bfin_read32(EMAC_RXC_TYPED)
150#define bfin_write_EMAC_RXC_TYPED(val) bfin_write32(EMAC_RXC_TYPED, val)
151#define bfin_read_EMAC_RXC_SHORT() bfin_read32(EMAC_RXC_SHORT)
152#define bfin_write_EMAC_RXC_SHORT(val) bfin_write32(EMAC_RXC_SHORT, val)
153#define bfin_read_EMAC_RXC_EQ64() bfin_read32(EMAC_RXC_EQ64)
154#define bfin_write_EMAC_RXC_EQ64(val) bfin_write32(EMAC_RXC_EQ64, val)
155#define bfin_read_EMAC_RXC_LT128() bfin_read32(EMAC_RXC_LT128)
156#define bfin_write_EMAC_RXC_LT128(val) bfin_write32(EMAC_RXC_LT128, val)
157#define bfin_read_EMAC_RXC_LT256() bfin_read32(EMAC_RXC_LT256)
158#define bfin_write_EMAC_RXC_LT256(val) bfin_write32(EMAC_RXC_LT256, val)
159#define bfin_read_EMAC_RXC_LT512() bfin_read32(EMAC_RXC_LT512)
160#define bfin_write_EMAC_RXC_LT512(val) bfin_write32(EMAC_RXC_LT512, val)
161#define bfin_read_EMAC_RXC_LT1024() bfin_read32(EMAC_RXC_LT1024)
162#define bfin_write_EMAC_RXC_LT1024(val) bfin_write32(EMAC_RXC_LT1024, val)
163#define bfin_read_EMAC_RXC_GE1024() bfin_read32(EMAC_RXC_GE1024)
164#define bfin_write_EMAC_RXC_GE1024(val) bfin_write32(EMAC_RXC_GE1024, val)
165
166#define bfin_read_EMAC_TXC_OK() bfin_read32(EMAC_TXC_OK)
167#define bfin_write_EMAC_TXC_OK(val) bfin_write32(EMAC_TXC_OK, val)
168#define bfin_read_EMAC_TXC_1COL() bfin_read32(EMAC_TXC_1COL)
169#define bfin_write_EMAC_TXC_1COL(val) bfin_write32(EMAC_TXC_1COL, val)
170#define bfin_read_EMAC_TXC_GT1COL() bfin_read32(EMAC_TXC_GT1COL)
171#define bfin_write_EMAC_TXC_GT1COL(val) bfin_write32(EMAC_TXC_GT1COL, val)
172#define bfin_read_EMAC_TXC_OCTET() bfin_read32(EMAC_TXC_OCTET)
173#define bfin_write_EMAC_TXC_OCTET(val) bfin_write32(EMAC_TXC_OCTET, val)
174#define bfin_read_EMAC_TXC_DEFER() bfin_read32(EMAC_TXC_DEFER)
175#define bfin_write_EMAC_TXC_DEFER(val) bfin_write32(EMAC_TXC_DEFER, val)
176#define bfin_read_EMAC_TXC_LATECL() bfin_read32(EMAC_TXC_LATECL)
177#define bfin_write_EMAC_TXC_LATECL(val) bfin_write32(EMAC_TXC_LATECL, val)
178#define bfin_read_EMAC_TXC_XS_COL() bfin_read32(EMAC_TXC_XS_COL)
179#define bfin_write_EMAC_TXC_XS_COL(val) bfin_write32(EMAC_TXC_XS_COL, val)
180#define bfin_read_EMAC_TXC_DMAUND() bfin_read32(EMAC_TXC_DMAUND)
181#define bfin_write_EMAC_TXC_DMAUND(val) bfin_write32(EMAC_TXC_DMAUND, val)
182#define bfin_read_EMAC_TXC_CRSERR() bfin_read32(EMAC_TXC_CRSERR)
183#define bfin_write_EMAC_TXC_CRSERR(val) bfin_write32(EMAC_TXC_CRSERR, val)
184#define bfin_read_EMAC_TXC_UNICST() bfin_read32(EMAC_TXC_UNICST)
185#define bfin_write_EMAC_TXC_UNICST(val) bfin_write32(EMAC_TXC_UNICST, val)
186#define bfin_read_EMAC_TXC_MULTI() bfin_read32(EMAC_TXC_MULTI)
187#define bfin_write_EMAC_TXC_MULTI(val) bfin_write32(EMAC_TXC_MULTI, val)
188#define bfin_read_EMAC_TXC_BROAD() bfin_read32(EMAC_TXC_BROAD)
189#define bfin_write_EMAC_TXC_BROAD(val) bfin_write32(EMAC_TXC_BROAD, val)
190#define bfin_read_EMAC_TXC_XS_DFR() bfin_read32(EMAC_TXC_XS_DFR)
191#define bfin_write_EMAC_TXC_XS_DFR(val) bfin_write32(EMAC_TXC_XS_DFR, val)
192#define bfin_read_EMAC_TXC_MACCTL() bfin_read32(EMAC_TXC_MACCTL)
193#define bfin_write_EMAC_TXC_MACCTL(val) bfin_write32(EMAC_TXC_MACCTL, val)
194#define bfin_read_EMAC_TXC_ALLFRM() bfin_read32(EMAC_TXC_ALLFRM)
195#define bfin_write_EMAC_TXC_ALLFRM(val) bfin_write32(EMAC_TXC_ALLFRM, val)
196#define bfin_read_EMAC_TXC_ALLOCT() bfin_read32(EMAC_TXC_ALLOCT)
197#define bfin_write_EMAC_TXC_ALLOCT(val) bfin_write32(EMAC_TXC_ALLOCT, val)
198#define bfin_read_EMAC_TXC_EQ64() bfin_read32(EMAC_TXC_EQ64)
199#define bfin_write_EMAC_TXC_EQ64(val) bfin_write32(EMAC_TXC_EQ64, val)
200#define bfin_read_EMAC_TXC_LT128() bfin_read32(EMAC_TXC_LT128)
201#define bfin_write_EMAC_TXC_LT128(val) bfin_write32(EMAC_TXC_LT128, val)
202#define bfin_read_EMAC_TXC_LT256() bfin_read32(EMAC_TXC_LT256)
203#define bfin_write_EMAC_TXC_LT256(val) bfin_write32(EMAC_TXC_LT256, val)
204#define bfin_read_EMAC_TXC_LT512() bfin_read32(EMAC_TXC_LT512)
205#define bfin_write_EMAC_TXC_LT512(val) bfin_write32(EMAC_TXC_LT512, val)
206#define bfin_read_EMAC_TXC_LT1024() bfin_read32(EMAC_TXC_LT1024)
207#define bfin_write_EMAC_TXC_LT1024(val) bfin_write32(EMAC_TXC_LT1024, val)
208#define bfin_read_EMAC_TXC_GE1024() bfin_read32(EMAC_TXC_GE1024)
209#define bfin_write_EMAC_TXC_GE1024(val) bfin_write32(EMAC_TXC_GE1024, val)
210#define bfin_read_EMAC_TXC_ABORT() bfin_read32(EMAC_TXC_ABORT)
211#define bfin_write_EMAC_TXC_ABORT(val) bfin_write32(EMAC_TXC_ABORT, val)
212
213#endif /* _CDEF_BF516_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/cdefBF518.h b/arch/blackfin/mach-bf518/include/mach/cdefBF518.h
new file mode 100644
index 000000000000..bafb370cfb3c
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/cdefBF518.h
@@ -0,0 +1,282 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/cdefbf518.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: system mmr register map
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _CDEF_BF518_H
33#define _CDEF_BF518_H
34
35/* include all Core registers and bit definitions */
36#include "defBF518.h"
37
38/* include core specific register pointer definitions */
39#include <asm/cdef_LPBlackfin.h>
40
41/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF518 */
42
43/* include cdefBF51x_base.h for the set of #defines that are common to all ADSP-BF51x processors */
44#include "cdefBF51x_base.h"
45
46/* The following are the #defines needed by ADSP-BF518 that are not in the common header */
47
48
49/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
50
51#define bfin_read_EMAC_OPMODE() bfin_read32(EMAC_OPMODE)
52#define bfin_write_EMAC_OPMODE(val) bfin_write32(EMAC_OPMODE, val)
53#define bfin_read_EMAC_ADDRLO() bfin_read32(EMAC_ADDRLO)
54#define bfin_write_EMAC_ADDRLO(val) bfin_write32(EMAC_ADDRLO, val)
55#define bfin_read_EMAC_ADDRHI() bfin_read32(EMAC_ADDRHI)
56#define bfin_write_EMAC_ADDRHI(val) bfin_write32(EMAC_ADDRHI, val)
57#define bfin_read_EMAC_HASHLO() bfin_read32(EMAC_HASHLO)
58#define bfin_write_EMAC_HASHLO(val) bfin_write32(EMAC_HASHLO, val)
59#define bfin_read_EMAC_HASHHI() bfin_read32(EMAC_HASHHI)
60#define bfin_write_EMAC_HASHHI(val) bfin_write32(EMAC_HASHHI, val)
61#define bfin_read_EMAC_STAADD() bfin_read32(EMAC_STAADD)
62#define bfin_write_EMAC_STAADD(val) bfin_write32(EMAC_STAADD, val)
63#define bfin_read_EMAC_STADAT() bfin_read32(EMAC_STADAT)
64#define bfin_write_EMAC_STADAT(val) bfin_write32(EMAC_STADAT, val)
65#define bfin_read_EMAC_FLC() bfin_read32(EMAC_FLC)
66#define bfin_write_EMAC_FLC(val) bfin_write32(EMAC_FLC, val)
67#define bfin_read_EMAC_VLAN1() bfin_read32(EMAC_VLAN1)
68#define bfin_write_EMAC_VLAN1(val) bfin_write32(EMAC_VLAN1, val)
69#define bfin_read_EMAC_VLAN2() bfin_read32(EMAC_VLAN2)
70#define bfin_write_EMAC_VLAN2(val) bfin_write32(EMAC_VLAN2, val)
71#define bfin_read_EMAC_WKUP_CTL() bfin_read32(EMAC_WKUP_CTL)
72#define bfin_write_EMAC_WKUP_CTL(val) bfin_write32(EMAC_WKUP_CTL, val)
73#define bfin_read_EMAC_WKUP_FFMSK0() bfin_read32(EMAC_WKUP_FFMSK0)
74#define bfin_write_EMAC_WKUP_FFMSK0(val) bfin_write32(EMAC_WKUP_FFMSK0, val)
75#define bfin_read_EMAC_WKUP_FFMSK1() bfin_read32(EMAC_WKUP_FFMSK1)
76#define bfin_write_EMAC_WKUP_FFMSK1(val) bfin_write32(EMAC_WKUP_FFMSK1, val)
77#define bfin_read_EMAC_WKUP_FFMSK2() bfin_read32(EMAC_WKUP_FFMSK2)
78#define bfin_write_EMAC_WKUP_FFMSK2(val) bfin_write32(EMAC_WKUP_FFMSK2, val)
79#define bfin_read_EMAC_WKUP_FFMSK3() bfin_read32(EMAC_WKUP_FFMSK3)
80#define bfin_write_EMAC_WKUP_FFMSK3(val) bfin_write32(EMAC_WKUP_FFMSK3, val)
81#define bfin_read_EMAC_WKUP_FFCMD() bfin_read32(EMAC_WKUP_FFCMD)
82#define bfin_write_EMAC_WKUP_FFCMD(val) bfin_write32(EMAC_WKUP_FFCMD, val)
83#define bfin_read_EMAC_WKUP_FFOFF() bfin_read32(EMAC_WKUP_FFOFF)
84#define bfin_write_EMAC_WKUP_FFOFF(val) bfin_write32(EMAC_WKUP_FFOFF, val)
85#define bfin_read_EMAC_WKUP_FFCRC0() bfin_read32(EMAC_WKUP_FFCRC0)
86#define bfin_write_EMAC_WKUP_FFCRC0(val) bfin_write32(EMAC_WKUP_FFCRC0, val)
87#define bfin_read_EMAC_WKUP_FFCRC1() bfin_read32(EMAC_WKUP_FFCRC1)
88#define bfin_write_EMAC_WKUP_FFCRC1(val) bfin_write32(EMAC_WKUP_FFCRC1, val)
89
90#define bfin_read_EMAC_SYSCTL() bfin_read32(EMAC_SYSCTL)
91#define bfin_write_EMAC_SYSCTL(val) bfin_write32(EMAC_SYSCTL, val)
92#define bfin_read_EMAC_SYSTAT() bfin_read32(EMAC_SYSTAT)
93#define bfin_write_EMAC_SYSTAT(val) bfin_write32(EMAC_SYSTAT, val)
94#define bfin_read_EMAC_RX_STAT() bfin_read32(EMAC_RX_STAT)
95#define bfin_write_EMAC_RX_STAT(val) bfin_write32(EMAC_RX_STAT, val)
96#define bfin_read_EMAC_RX_STKY() bfin_read32(EMAC_RX_STKY)
97#define bfin_write_EMAC_RX_STKY(val) bfin_write32(EMAC_RX_STKY, val)
98#define bfin_read_EMAC_RX_IRQE() bfin_read32(EMAC_RX_IRQE)
99#define bfin_write_EMAC_RX_IRQE(val) bfin_write32(EMAC_RX_IRQE, val)
100#define bfin_read_EMAC_TX_STAT() bfin_read32(EMAC_TX_STAT)
101#define bfin_write_EMAC_TX_STAT(val) bfin_write32(EMAC_TX_STAT, val)
102#define bfin_read_EMAC_TX_STKY() bfin_read32(EMAC_TX_STKY)
103#define bfin_write_EMAC_TX_STKY(val) bfin_write32(EMAC_TX_STKY, val)
104#define bfin_read_EMAC_TX_IRQE() bfin_read32(EMAC_TX_IRQE)
105#define bfin_write_EMAC_TX_IRQE(val) bfin_write32(EMAC_TX_IRQE, val)
106
107#define bfin_read_EMAC_MMC_CTL() bfin_read32(EMAC_MMC_CTL)
108#define bfin_write_EMAC_MMC_CTL(val) bfin_write32(EMAC_MMC_CTL, val)
109#define bfin_read_EMAC_MMC_RIRQS() bfin_read32(EMAC_MMC_RIRQS)
110#define bfin_write_EMAC_MMC_RIRQS(val) bfin_write32(EMAC_MMC_RIRQS, val)
111#define bfin_read_EMAC_MMC_RIRQE() bfin_read32(EMAC_MMC_RIRQE)
112#define bfin_write_EMAC_MMC_RIRQE(val) bfin_write32(EMAC_MMC_RIRQE, val)
113#define bfin_read_EMAC_MMC_TIRQS() bfin_read32(EMAC_MMC_TIRQS)
114#define bfin_write_EMAC_MMC_TIRQS(val) bfin_write32(EMAC_MMC_TIRQS, val)
115#define bfin_read_EMAC_MMC_TIRQE() bfin_read32(EMAC_MMC_TIRQE)
116#define bfin_write_EMAC_MMC_TIRQE(val) bfin_write32(EMAC_MMC_TIRQE, val)
117
118#define bfin_read_EMAC_RXC_OK() bfin_read32(EMAC_RXC_OK)
119#define bfin_write_EMAC_RXC_OK(val) bfin_write32(EMAC_RXC_OK, val)
120#define bfin_read_EMAC_RXC_FCS() bfin_read32(EMAC_RXC_FCS)
121#define bfin_write_EMAC_RXC_FCS(val) bfin_write32(EMAC_RXC_FCS, val)
122#define bfin_read_EMAC_RXC_ALIGN() bfin_read32(EMAC_RXC_ALIGN)
123#define bfin_write_EMAC_RXC_ALIGN(val) bfin_write32(EMAC_RXC_ALIGN, val)
124#define bfin_read_EMAC_RXC_OCTET() bfin_read32(EMAC_RXC_OCTET)
125#define bfin_write_EMAC_RXC_OCTET(val) bfin_write32(EMAC_RXC_OCTET, val)
126#define bfin_read_EMAC_RXC_DMAOVF() bfin_read32(EMAC_RXC_DMAOVF)
127#define bfin_write_EMAC_RXC_DMAOVF(val) bfin_write32(EMAC_RXC_DMAOVF, val)
128#define bfin_read_EMAC_RXC_UNICST() bfin_read32(EMAC_RXC_UNICST)
129#define bfin_write_EMAC_RXC_UNICST(val) bfin_write32(EMAC_RXC_UNICST, val)
130#define bfin_read_EMAC_RXC_MULTI() bfin_read32(EMAC_RXC_MULTI)
131#define bfin_write_EMAC_RXC_MULTI(val) bfin_write32(EMAC_RXC_MULTI, val)
132#define bfin_read_EMAC_RXC_BROAD() bfin_read32(EMAC_RXC_BROAD)
133#define bfin_write_EMAC_RXC_BROAD(val) bfin_write32(EMAC_RXC_BROAD, val)
134#define bfin_read_EMAC_RXC_LNERRI() bfin_read32(EMAC_RXC_LNERRI)
135#define bfin_write_EMAC_RXC_LNERRI(val) bfin_write32(EMAC_RXC_LNERRI, val)
136#define bfin_read_EMAC_RXC_LNERRO() bfin_read32(EMAC_RXC_LNERRO)
137#define bfin_write_EMAC_RXC_LNERRO(val) bfin_write32(EMAC_RXC_LNERRO, val)
138#define bfin_read_EMAC_RXC_LONG() bfin_read32(EMAC_RXC_LONG)
139#define bfin_write_EMAC_RXC_LONG(val) bfin_write32(EMAC_RXC_LONG, val)
140#define bfin_read_EMAC_RXC_MACCTL() bfin_read32(EMAC_RXC_MACCTL)
141#define bfin_write_EMAC_RXC_MACCTL(val) bfin_write32(EMAC_RXC_MACCTL, val)
142#define bfin_read_EMAC_RXC_OPCODE() bfin_read32(EMAC_RXC_OPCODE)
143#define bfin_write_EMAC_RXC_OPCODE(val) bfin_write32(EMAC_RXC_OPCODE, val)
144#define bfin_read_EMAC_RXC_PAUSE() bfin_read32(EMAC_RXC_PAUSE)
145#define bfin_write_EMAC_RXC_PAUSE(val) bfin_write32(EMAC_RXC_PAUSE, val)
146#define bfin_read_EMAC_RXC_ALLFRM() bfin_read32(EMAC_RXC_ALLFRM)
147#define bfin_write_EMAC_RXC_ALLFRM(val) bfin_write32(EMAC_RXC_ALLFRM, val)
148#define bfin_read_EMAC_RXC_ALLOCT() bfin_read32(EMAC_RXC_ALLOCT)
149#define bfin_write_EMAC_RXC_ALLOCT(val) bfin_write32(EMAC_RXC_ALLOCT, val)
150#define bfin_read_EMAC_RXC_TYPED() bfin_read32(EMAC_RXC_TYPED)
151#define bfin_write_EMAC_RXC_TYPED(val) bfin_write32(EMAC_RXC_TYPED, val)
152#define bfin_read_EMAC_RXC_SHORT() bfin_read32(EMAC_RXC_SHORT)
153#define bfin_write_EMAC_RXC_SHORT(val) bfin_write32(EMAC_RXC_SHORT, val)
154#define bfin_read_EMAC_RXC_EQ64() bfin_read32(EMAC_RXC_EQ64)
155#define bfin_write_EMAC_RXC_EQ64(val) bfin_write32(EMAC_RXC_EQ64, val)
156#define bfin_read_EMAC_RXC_LT128() bfin_read32(EMAC_RXC_LT128)
157#define bfin_write_EMAC_RXC_LT128(val) bfin_write32(EMAC_RXC_LT128, val)
158#define bfin_read_EMAC_RXC_LT256() bfin_read32(EMAC_RXC_LT256)
159#define bfin_write_EMAC_RXC_LT256(val) bfin_write32(EMAC_RXC_LT256, val)
160#define bfin_read_EMAC_RXC_LT512() bfin_read32(EMAC_RXC_LT512)
161#define bfin_write_EMAC_RXC_LT512(val) bfin_write32(EMAC_RXC_LT512, val)
162#define bfin_read_EMAC_RXC_LT1024() bfin_read32(EMAC_RXC_LT1024)
163#define bfin_write_EMAC_RXC_LT1024(val) bfin_write32(EMAC_RXC_LT1024, val)
164#define bfin_read_EMAC_RXC_GE1024() bfin_read32(EMAC_RXC_GE1024)
165#define bfin_write_EMAC_RXC_GE1024(val) bfin_write32(EMAC_RXC_GE1024, val)
166
167#define bfin_read_EMAC_TXC_OK() bfin_read32(EMAC_TXC_OK)
168#define bfin_write_EMAC_TXC_OK(val) bfin_write32(EMAC_TXC_OK, val)
169#define bfin_read_EMAC_TXC_1COL() bfin_read32(EMAC_TXC_1COL)
170#define bfin_write_EMAC_TXC_1COL(val) bfin_write32(EMAC_TXC_1COL, val)
171#define bfin_read_EMAC_TXC_GT1COL() bfin_read32(EMAC_TXC_GT1COL)
172#define bfin_write_EMAC_TXC_GT1COL(val) bfin_write32(EMAC_TXC_GT1COL, val)
173#define bfin_read_EMAC_TXC_OCTET() bfin_read32(EMAC_TXC_OCTET)
174#define bfin_write_EMAC_TXC_OCTET(val) bfin_write32(EMAC_TXC_OCTET, val)
175#define bfin_read_EMAC_TXC_DEFER() bfin_read32(EMAC_TXC_DEFER)
176#define bfin_write_EMAC_TXC_DEFER(val) bfin_write32(EMAC_TXC_DEFER, val)
177#define bfin_read_EMAC_TXC_LATECL() bfin_read32(EMAC_TXC_LATECL)
178#define bfin_write_EMAC_TXC_LATECL(val) bfin_write32(EMAC_TXC_LATECL, val)
179#define bfin_read_EMAC_TXC_XS_COL() bfin_read32(EMAC_TXC_XS_COL)
180#define bfin_write_EMAC_TXC_XS_COL(val) bfin_write32(EMAC_TXC_XS_COL, val)
181#define bfin_read_EMAC_TXC_DMAUND() bfin_read32(EMAC_TXC_DMAUND)
182#define bfin_write_EMAC_TXC_DMAUND(val) bfin_write32(EMAC_TXC_DMAUND, val)
183#define bfin_read_EMAC_TXC_CRSERR() bfin_read32(EMAC_TXC_CRSERR)
184#define bfin_write_EMAC_TXC_CRSERR(val) bfin_write32(EMAC_TXC_CRSERR, val)
185#define bfin_read_EMAC_TXC_UNICST() bfin_read32(EMAC_TXC_UNICST)
186#define bfin_write_EMAC_TXC_UNICST(val) bfin_write32(EMAC_TXC_UNICST, val)
187#define bfin_read_EMAC_TXC_MULTI() bfin_read32(EMAC_TXC_MULTI)
188#define bfin_write_EMAC_TXC_MULTI(val) bfin_write32(EMAC_TXC_MULTI, val)
189#define bfin_read_EMAC_TXC_BROAD() bfin_read32(EMAC_TXC_BROAD)
190#define bfin_write_EMAC_TXC_BROAD(val) bfin_write32(EMAC_TXC_BROAD, val)
191#define bfin_read_EMAC_TXC_XS_DFR() bfin_read32(EMAC_TXC_XS_DFR)
192#define bfin_write_EMAC_TXC_XS_DFR(val) bfin_write32(EMAC_TXC_XS_DFR, val)
193#define bfin_read_EMAC_TXC_MACCTL() bfin_read32(EMAC_TXC_MACCTL)
194#define bfin_write_EMAC_TXC_MACCTL(val) bfin_write32(EMAC_TXC_MACCTL, val)
195#define bfin_read_EMAC_TXC_ALLFRM() bfin_read32(EMAC_TXC_ALLFRM)
196#define bfin_write_EMAC_TXC_ALLFRM(val) bfin_write32(EMAC_TXC_ALLFRM, val)
197#define bfin_read_EMAC_TXC_ALLOCT() bfin_read32(EMAC_TXC_ALLOCT)
198#define bfin_write_EMAC_TXC_ALLOCT(val) bfin_write32(EMAC_TXC_ALLOCT, val)
199#define bfin_read_EMAC_TXC_EQ64() bfin_read32(EMAC_TXC_EQ64)
200#define bfin_write_EMAC_TXC_EQ64(val) bfin_write32(EMAC_TXC_EQ64, val)
201#define bfin_read_EMAC_TXC_LT128() bfin_read32(EMAC_TXC_LT128)
202#define bfin_write_EMAC_TXC_LT128(val) bfin_write32(EMAC_TXC_LT128, val)
203#define bfin_read_EMAC_TXC_LT256() bfin_read32(EMAC_TXC_LT256)
204#define bfin_write_EMAC_TXC_LT256(val) bfin_write32(EMAC_TXC_LT256, val)
205#define bfin_read_EMAC_TXC_LT512() bfin_read32(EMAC_TXC_LT512)
206#define bfin_write_EMAC_TXC_LT512(val) bfin_write32(EMAC_TXC_LT512, val)
207#define bfin_read_EMAC_TXC_LT1024() bfin_read32(EMAC_TXC_LT1024)
208#define bfin_write_EMAC_TXC_LT1024(val) bfin_write32(EMAC_TXC_LT1024, val)
209#define bfin_read_EMAC_TXC_GE1024() bfin_read32(EMAC_TXC_GE1024)
210#define bfin_write_EMAC_TXC_GE1024(val) bfin_write32(EMAC_TXC_GE1024, val)
211#define bfin_read_EMAC_TXC_ABORT() bfin_read32(EMAC_TXC_ABORT)
212#define bfin_write_EMAC_TXC_ABORT(val) bfin_write32(EMAC_TXC_ABORT, val)
213
214/* Removable Storage Interface Registers */
215
216#define bfin_read_RSI_PWR_CTL() bfin_read16(RSI_PWR_CONTROL)
217#define bfin_write_RSI_PWR_CTL(val) bfin_write16(RSI_PWR_CONTROL, val)
218#define bfin_read_RSI_CLK_CTL() bfin_read16(RSI_CLK_CONTROL)
219#define bfin_write_RSI_CLK_CTL(val) bfin_write16(RSI_CLK_CONTROL, val)
220#define bfin_read_RSI_ARGUMENT() bfin_read32(RSI_ARGUMENT)
221#define bfin_write_RSI_ARGUMENT(val) bfin_write32(RSI_ARGUMENT, val)
222#define bfin_read_RSI_COMMAND() bfin_read16(RSI_COMMAND)
223#define bfin_write_RSI_COMMAND(val) bfin_write16(RSI_COMMAND, val)
224#define bfin_read_RSI_RESP_CMD() bfin_read16(RSI_RESP_CMD)
225#define bfin_write_RSI_RESP_CMD(val) bfin_write16(RSI_RESP_CMD, val)
226#define bfin_read_RSI_RESPONSE0() bfin_read32(RSI_RESPONSE0)
227#define bfin_write_RSI_RESPONSE0(val) bfin_write32(RSI_RESPONSE0, val)
228#define bfin_read_RSI_RESPONSE1() bfin_read32(RSI_RESPONSE1)
229#define bfin_write_RSI_RESPONSE1(val) bfin_write32(RSI_RESPONSE1, val)
230#define bfin_read_RSI_RESPONSE2() bfin_read32(RSI_RESPONSE2)
231#define bfin_write_RSI_RESPONSE2(val) bfin_write32(RSI_RESPONSE2, val)
232#define bfin_read_RSI_RESPONSE3() bfin_read32(RSI_RESPONSE3)
233#define bfin_write_RSI_RESPONSE3(val) bfin_write32(RSI_RESPONSE3, val)
234#define bfin_read_RSI_DATA_TIMER() bfin_read32(RSI_DATA_TIMER)
235#define bfin_write_RSI_DATA_TIMER(val) bfin_write32(RSI_DATA_TIMER, val)
236#define bfin_read_RSI_DATA_LGTH() bfin_read16(RSI_DATA_LGTH)
237#define bfin_write_RSI_DATA_LGTH(val) bfin_write16(RSI_DATA_LGTH, val)
238#define bfin_read_RSI_DATA_CTL() bfin_read16(RSI_DATA_CONTROL)
239#define bfin_write_RSI_DATA_CTL(val) bfin_write16(RSI_DATA_CONTROL, val)
240#define bfin_read_RSI_DATA_CNT() bfin_read16(RSI_DATA_CNT)
241#define bfin_write_RSI_DATA_CNT(val) bfin_write16(RSI_DATA_CNT, val)
242#define bfin_read_RSI_STATUS() bfin_read32(RSI_STATUS)
243#define bfin_write_RSI_STATUS(val) bfin_write32(RSI_STATUS, val)
244#define bfin_read_RSI_STATUS_CLR() bfin_read16(RSI_STATUSCL)
245#define bfin_write_RSI_STATUS_CLR(val) bfin_write16(RSI_STATUSCL, val)
246#define bfin_read_RSI_MASK0() bfin_read32(RSI_MASK0)
247#define bfin_write_RSI_MASK0(val) bfin_write32(RSI_MASK0, val)
248#define bfin_read_RSI_MASK1() bfin_read32(RSI_MASK1)
249#define bfin_write_RSI_MASK1(val) bfin_write32(RSI_MASK1, val)
250#define bfin_read_RSI_FIFO_CNT() bfin_read16(RSI_FIFO_CNT)
251#define bfin_write_RSI_FIFO_CNT(val) bfin_write16(RSI_FIFO_CNT, val)
252#define bfin_read_RSI_CEATA_CTL() bfin_read16(RSI_CEATA_CONTROL)
253#define bfin_write_RSI_CEATA_CTL(val) bfin_write16(RSI_CEATA_CONTROL, val)
254#define bfin_read_RSI_FIFO() bfin_read32(RSI_FIFO)
255#define bfin_write_RSI_FIFO(val) bfin_write32(RSI_FIFO, val)
256#define bfin_read_RSI_E_STATUS() bfin_read16(RSI_ESTAT)
257#define bfin_write_RSI_E_STATUS(val) bfin_write16(RSI_ESTAT, val)
258#define bfin_read_RSI_E_MASK() bfin_read16(RSI_EMASK)
259#define bfin_write_RSI_E_MASK(val) bfin_write16(RSI_EMASK, val)
260#define bfin_read_RSI_CFG() bfin_read16(RSI_CONFIG)
261#define bfin_write_RSI_CFG(val) bfin_write16(RSI_CONFIG, val)
262#define bfin_read_RSI_RD_WAIT_EN() bfin_read16(RSI_RD_WAIT_EN)
263#define bfin_write_RSI_RD_WAIT_EN(val) bfin_write16(RSI_RD_WAIT_EN, val)
264#define bfin_read_RSI_PID0() bfin_read16(RSI_PID0)
265#define bfin_write_RSI_PID0(val) bfin_write16(RSI_PID0, val)
266#define bfin_read_RSI_PID1() bfin_read16(RSI_PID1)
267#define bfin_write_RSI_PID1(val) bfin_write16(RSI_PID1, val)
268#define bfin_read_RSI_PID2() bfin_read16(RSI_PID2)
269#define bfin_write_RSI_PID2(val) bfin_write16(RSI_PID2, val)
270#define bfin_read_RSI_PID3() bfin_read16(RSI_PID3)
271#define bfin_write_RSI_PID3(val) bfin_write16(RSI_PID3, val)
272#define bfin_read_RSI_PID4() bfin_read16(RSI_PID4)
273#define bfin_write_RSI_PID4(val) bfin_write16(RSI_PID4, val)
274#define bfin_read_RSI_PID5() bfin_read16(RSI_PID5)
275#define bfin_write_RSI_PID5(val) bfin_write16(RSI_PID5, val)
276#define bfin_read_RSI_PID6() bfin_read16(RSI_PID6)
277#define bfin_write_RSI_PID6(val) bfin_write16(RSI_PID6, val)
278#define bfin_read_RSI_PID7() bfin_read16(RSI_PID7)
279#define bfin_write_RSI_PID7(val) bfin_write16(RSI_PID7, val)
280
281
282#endif /* _CDEF_BF518_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h b/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h
new file mode 100644
index 000000000000..ee3d4733369c
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/cdefBF51x_base.h
@@ -0,0 +1,1208 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/cdefBF51x_base.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _CDEF_BF52X_H
32#define _CDEF_BF52X_H
33
34#include <asm/blackfin.h>
35
36#include "defBF51x_base.h"
37
38/* Include core specific register pointer definitions */
39#include <asm/cdef_LPBlackfin.h>
40
41/* ==== begin from cdefBF534.h ==== */
42
43/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
44#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
45#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
46#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
47#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
48#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
49#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
50#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
51#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT, val)
52#define bfin_read_CHIPID() bfin_read32(CHIPID)
53#define bfin_write_CHIPID(val) bfin_write32(CHIPID, val)
54
55
56/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
57#define bfin_read_SWRST() bfin_read16(SWRST)
58#define bfin_write_SWRST(val) bfin_write16(SWRST, val)
59#define bfin_read_SYSCR() bfin_read16(SYSCR)
60#define bfin_write_SYSCR(val) bfin_write16(SYSCR, val)
61
62#define bfin_read_SIC_RVECT() bfin_read32(SIC_RVECT)
63#define bfin_write_SIC_RVECT(val) bfin_write32(SIC_RVECT, val)
64#define bfin_read_SIC_IMASK0() bfin_read32(SIC_IMASK0)
65#define bfin_write_SIC_IMASK0(val) bfin_write32(SIC_IMASK0, val)
66#define bfin_read_SIC_IMASK(x) bfin_read32(SIC_IMASK0 + (x << 6))
67#define bfin_write_SIC_IMASK(x, val) bfin_write32((SIC_IMASK0 + (x << 6)), val)
68
69#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
70#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0, val)
71#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
72#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1, val)
73#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
74#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2, val)
75#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
76#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3, val)
77
78#define bfin_read_SIC_ISR0() bfin_read32(SIC_ISR0)
79#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val)
80#define bfin_read_SIC_ISR(x) bfin_read32(SIC_ISR0 + (x << 6))
81#define bfin_write_SIC_ISR(x, val) bfin_write32((SIC_ISR0 + (x << 6)), val)
82
83#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0)
84#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val)
85#define bfin_read_SIC_IWR(x) bfin_read32(SIC_IWR0 + (x << 6))
86#define bfin_write_SIC_IWR(x, val) bfin_write32((SIC_IWR0 + (x << 6)), val)
87
88/* SIC Additions to ADSP-BF51x (0xFFC0014C - 0xFFC00162) */
89
90#define bfin_read_SIC_IMASK1() bfin_read32(SIC_IMASK1)
91#define bfin_write_SIC_IMASK1(val) bfin_write32(SIC_IMASK1, val)
92#define bfin_read_SIC_IAR4() bfin_read32(SIC_IAR4)
93#define bfin_write_SIC_IAR4(val) bfin_write32(SIC_IAR4, val)
94#define bfin_read_SIC_IAR5() bfin_read32(SIC_IAR5)
95#define bfin_write_SIC_IAR5(val) bfin_write32(SIC_IAR5, val)
96#define bfin_read_SIC_IAR6() bfin_read32(SIC_IAR6)
97#define bfin_write_SIC_IAR6(val) bfin_write32(SIC_IAR6, val)
98#define bfin_read_SIC_IAR7() bfin_read32(SIC_IAR7)
99#define bfin_write_SIC_IAR7(val) bfin_write32(SIC_IAR7, val)
100#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1)
101#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val)
102#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1)
103#define bfin_write_SIC_IWR1(val) bfin_write32(SIC_IWR1, val)
104
105/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
106#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
107#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL, val)
108#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
109#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT, val)
110#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
111#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT, val)
112
113
114/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
115#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
116#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT, val)
117#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
118#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL, val)
119#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
120#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT, val)
121#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
122#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT, val)
123#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
124#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM, val)
125#define bfin_read_RTC_FAST() bfin_read16(RTC_FAST)
126#define bfin_write_RTC_FAST(val) bfin_write16(RTC_FAST, val)
127#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
128#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN, val)
129
130
131/* UART0 Controller (0xFFC00400 - 0xFFC004FF) */
132#define bfin_read_UART0_THR() bfin_read16(UART0_THR)
133#define bfin_write_UART0_THR(val) bfin_write16(UART0_THR, val)
134#define bfin_read_UART0_RBR() bfin_read16(UART0_RBR)
135#define bfin_write_UART0_RBR(val) bfin_write16(UART0_RBR, val)
136#define bfin_read_UART0_DLL() bfin_read16(UART0_DLL)
137#define bfin_write_UART0_DLL(val) bfin_write16(UART0_DLL, val)
138#define bfin_read_UART0_IER() bfin_read16(UART0_IER)
139#define bfin_write_UART0_IER(val) bfin_write16(UART0_IER, val)
140#define bfin_read_UART0_DLH() bfin_read16(UART0_DLH)
141#define bfin_write_UART0_DLH(val) bfin_write16(UART0_DLH, val)
142#define bfin_read_UART0_IIR() bfin_read16(UART0_IIR)
143#define bfin_write_UART0_IIR(val) bfin_write16(UART0_IIR, val)
144#define bfin_read_UART0_LCR() bfin_read16(UART0_LCR)
145#define bfin_write_UART0_LCR(val) bfin_write16(UART0_LCR, val)
146#define bfin_read_UART0_MCR() bfin_read16(UART0_MCR)
147#define bfin_write_UART0_MCR(val) bfin_write16(UART0_MCR, val)
148#define bfin_read_UART0_LSR() bfin_read16(UART0_LSR)
149#define bfin_write_UART0_LSR(val) bfin_write16(UART0_LSR, val)
150#define bfin_read_UART0_MSR() bfin_read16(UART0_MSR)
151#define bfin_write_UART0_MSR(val) bfin_write16(UART0_MSR, val)
152#define bfin_read_UART0_SCR() bfin_read16(UART0_SCR)
153#define bfin_write_UART0_SCR(val) bfin_write16(UART0_SCR, val)
154#define bfin_read_UART0_GCTL() bfin_read16(UART0_GCTL)
155#define bfin_write_UART0_GCTL(val) bfin_write16(UART0_GCTL, val)
156
157
158/* SPI Controller (0xFFC00500 - 0xFFC005FF) */
159#define bfin_read_SPI_CTL() bfin_read16(SPI_CTL)
160#define bfin_write_SPI_CTL(val) bfin_write16(SPI_CTL, val)
161#define bfin_read_SPI_FLG() bfin_read16(SPI_FLG)
162#define bfin_write_SPI_FLG(val) bfin_write16(SPI_FLG, val)
163#define bfin_read_SPI_STAT() bfin_read16(SPI_STAT)
164#define bfin_write_SPI_STAT(val) bfin_write16(SPI_STAT, val)
165#define bfin_read_SPI_TDBR() bfin_read16(SPI_TDBR)
166#define bfin_write_SPI_TDBR(val) bfin_write16(SPI_TDBR, val)
167#define bfin_read_SPI_RDBR() bfin_read16(SPI_RDBR)
168#define bfin_write_SPI_RDBR(val) bfin_write16(SPI_RDBR, val)
169#define bfin_read_SPI_BAUD() bfin_read16(SPI_BAUD)
170#define bfin_write_SPI_BAUD(val) bfin_write16(SPI_BAUD, val)
171#define bfin_read_SPI_SHADOW() bfin_read16(SPI_SHADOW)
172#define bfin_write_SPI_SHADOW(val) bfin_write16(SPI_SHADOW, val)
173
174
175/* TIMER0-7 Registers (0xFFC00600 - 0xFFC006FF) */
176#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
177#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG, val)
178#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
179#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
180#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
181#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD, val)
182#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
183#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH, val)
184
185#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
186#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG, val)
187#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
188#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
189#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
190#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD, val)
191#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
192#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH, val)
193
194#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
195#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG, val)
196#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
197#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
198#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
199#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD, val)
200#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
201#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH, val)
202
203#define bfin_read_TIMER3_CONFIG() bfin_read16(TIMER3_CONFIG)
204#define bfin_write_TIMER3_CONFIG(val) bfin_write16(TIMER3_CONFIG, val)
205#define bfin_read_TIMER3_COUNTER() bfin_read32(TIMER3_COUNTER)
206#define bfin_write_TIMER3_COUNTER(val) bfin_write32(TIMER3_COUNTER, val)
207#define bfin_read_TIMER3_PERIOD() bfin_read32(TIMER3_PERIOD)
208#define bfin_write_TIMER3_PERIOD(val) bfin_write32(TIMER3_PERIOD, val)
209#define bfin_read_TIMER3_WIDTH() bfin_read32(TIMER3_WIDTH)
210#define bfin_write_TIMER3_WIDTH(val) bfin_write32(TIMER3_WIDTH, val)
211
212#define bfin_read_TIMER4_CONFIG() bfin_read16(TIMER4_CONFIG)
213#define bfin_write_TIMER4_CONFIG(val) bfin_write16(TIMER4_CONFIG, val)
214#define bfin_read_TIMER4_COUNTER() bfin_read32(TIMER4_COUNTER)
215#define bfin_write_TIMER4_COUNTER(val) bfin_write32(TIMER4_COUNTER, val)
216#define bfin_read_TIMER4_PERIOD() bfin_read32(TIMER4_PERIOD)
217#define bfin_write_TIMER4_PERIOD(val) bfin_write32(TIMER4_PERIOD, val)
218#define bfin_read_TIMER4_WIDTH() bfin_read32(TIMER4_WIDTH)
219#define bfin_write_TIMER4_WIDTH(val) bfin_write32(TIMER4_WIDTH, val)
220
221#define bfin_read_TIMER5_CONFIG() bfin_read16(TIMER5_CONFIG)
222#define bfin_write_TIMER5_CONFIG(val) bfin_write16(TIMER5_CONFIG, val)
223#define bfin_read_TIMER5_COUNTER() bfin_read32(TIMER5_COUNTER)
224#define bfin_write_TIMER5_COUNTER(val) bfin_write32(TIMER5_COUNTER, val)
225#define bfin_read_TIMER5_PERIOD() bfin_read32(TIMER5_PERIOD)
226#define bfin_write_TIMER5_PERIOD(val) bfin_write32(TIMER5_PERIOD, val)
227#define bfin_read_TIMER5_WIDTH() bfin_read32(TIMER5_WIDTH)
228#define bfin_write_TIMER5_WIDTH(val) bfin_write32(TIMER5_WIDTH, val)
229
230#define bfin_read_TIMER6_CONFIG() bfin_read16(TIMER6_CONFIG)
231#define bfin_write_TIMER6_CONFIG(val) bfin_write16(TIMER6_CONFIG, val)
232#define bfin_read_TIMER6_COUNTER() bfin_read32(TIMER6_COUNTER)
233#define bfin_write_TIMER6_COUNTER(val) bfin_write32(TIMER6_COUNTER, val)
234#define bfin_read_TIMER6_PERIOD() bfin_read32(TIMER6_PERIOD)
235#define bfin_write_TIMER6_PERIOD(val) bfin_write32(TIMER6_PERIOD, val)
236#define bfin_read_TIMER6_WIDTH() bfin_read32(TIMER6_WIDTH)
237#define bfin_write_TIMER6_WIDTH(val) bfin_write32(TIMER6_WIDTH, val)
238
239#define bfin_read_TIMER7_CONFIG() bfin_read16(TIMER7_CONFIG)
240#define bfin_write_TIMER7_CONFIG(val) bfin_write16(TIMER7_CONFIG, val)
241#define bfin_read_TIMER7_COUNTER() bfin_read32(TIMER7_COUNTER)
242#define bfin_write_TIMER7_COUNTER(val) bfin_write32(TIMER7_COUNTER, val)
243#define bfin_read_TIMER7_PERIOD() bfin_read32(TIMER7_PERIOD)
244#define bfin_write_TIMER7_PERIOD(val) bfin_write32(TIMER7_PERIOD, val)
245#define bfin_read_TIMER7_WIDTH() bfin_read32(TIMER7_WIDTH)
246#define bfin_write_TIMER7_WIDTH(val) bfin_write32(TIMER7_WIDTH, val)
247
248#define bfin_read_TIMER_ENABLE() bfin_read16(TIMER_ENABLE)
249#define bfin_write_TIMER_ENABLE(val) bfin_write16(TIMER_ENABLE, val)
250#define bfin_read_TIMER_DISABLE() bfin_read16(TIMER_DISABLE)
251#define bfin_write_TIMER_DISABLE(val) bfin_write16(TIMER_DISABLE, val)
252#define bfin_read_TIMER_STATUS() bfin_read32(TIMER_STATUS)
253#define bfin_write_TIMER_STATUS(val) bfin_write32(TIMER_STATUS, val)
254
255
256/* General Purpose I/O Port F (0xFFC00700 - 0xFFC007FF) */
257#define bfin_read_PORTFIO() bfin_read16(PORTFIO)
258#define bfin_write_PORTFIO(val) bfin_write16(PORTFIO, val)
259#define bfin_read_PORTFIO_CLEAR() bfin_read16(PORTFIO_CLEAR)
260#define bfin_write_PORTFIO_CLEAR(val) bfin_write16(PORTFIO_CLEAR, val)
261#define bfin_read_PORTFIO_SET() bfin_read16(PORTFIO_SET)
262#define bfin_write_PORTFIO_SET(val) bfin_write16(PORTFIO_SET, val)
263#define bfin_read_PORTFIO_TOGGLE() bfin_read16(PORTFIO_TOGGLE)
264#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE, val)
265#define bfin_read_PORTFIO_MASKA() bfin_read16(PORTFIO_MASKA)
266#define bfin_write_PORTFIO_MASKA(val) bfin_write16(PORTFIO_MASKA, val)
267#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
268#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR, val)
269#define bfin_read_PORTFIO_MASKA_SET() bfin_read16(PORTFIO_MASKA_SET)
270#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET, val)
271#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
272#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE, val)
273#define bfin_read_PORTFIO_MASKB() bfin_read16(PORTFIO_MASKB)
274#define bfin_write_PORTFIO_MASKB(val) bfin_write16(PORTFIO_MASKB, val)
275#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
276#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR, val)
277#define bfin_read_PORTFIO_MASKB_SET() bfin_read16(PORTFIO_MASKB_SET)
278#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET, val)
279#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
280#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE, val)
281#define bfin_read_PORTFIO_DIR() bfin_read16(PORTFIO_DIR)
282#define bfin_write_PORTFIO_DIR(val) bfin_write16(PORTFIO_DIR, val)
283#define bfin_read_PORTFIO_POLAR() bfin_read16(PORTFIO_POLAR)
284#define bfin_write_PORTFIO_POLAR(val) bfin_write16(PORTFIO_POLAR, val)
285#define bfin_read_PORTFIO_EDGE() bfin_read16(PORTFIO_EDGE)
286#define bfin_write_PORTFIO_EDGE(val) bfin_write16(PORTFIO_EDGE, val)
287#define bfin_read_PORTFIO_BOTH() bfin_read16(PORTFIO_BOTH)
288#define bfin_write_PORTFIO_BOTH(val) bfin_write16(PORTFIO_BOTH, val)
289#define bfin_read_PORTFIO_INEN() bfin_read16(PORTFIO_INEN)
290#define bfin_write_PORTFIO_INEN(val) bfin_write16(PORTFIO_INEN, val)
291
292
293/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
294#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
295#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1, val)
296#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
297#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2, val)
298#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
299#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
300#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
301#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV, val)
302#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
303#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX, val)
304#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
305#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX, val)
306#define bfin_read_SPORT0_TX32() bfin_read32(SPORT0_TX32)
307#define bfin_write_SPORT0_TX32(val) bfin_write32(SPORT0_TX32, val)
308#define bfin_read_SPORT0_RX32() bfin_read32(SPORT0_RX32)
309#define bfin_write_SPORT0_RX32(val) bfin_write32(SPORT0_RX32, val)
310#define bfin_read_SPORT0_TX16() bfin_read16(SPORT0_TX16)
311#define bfin_write_SPORT0_TX16(val) bfin_write16(SPORT0_TX16, val)
312#define bfin_read_SPORT0_RX16() bfin_read16(SPORT0_RX16)
313#define bfin_write_SPORT0_RX16(val) bfin_write16(SPORT0_RX16, val)
314#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
315#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1, val)
316#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
317#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2, val)
318#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
319#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
320#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
321#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV, val)
322#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
323#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT, val)
324#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
325#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL, val)
326#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
327#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1, val)
328#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
329#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2, val)
330#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
331#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0, val)
332#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
333#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1, val)
334#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
335#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2, val)
336#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
337#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3, val)
338#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
339#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0, val)
340#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
341#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1, val)
342#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
343#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2, val)
344#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
345#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3, val)
346
347
348/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
349#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
350#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1, val)
351#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
352#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2, val)
353#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
354#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
355#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
356#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV, val)
357#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
358#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX, val)
359#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
360#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX, val)
361#define bfin_read_SPORT1_TX32() bfin_read32(SPORT1_TX32)
362#define bfin_write_SPORT1_TX32(val) bfin_write32(SPORT1_TX32, val)
363#define bfin_read_SPORT1_RX32() bfin_read32(SPORT1_RX32)
364#define bfin_write_SPORT1_RX32(val) bfin_write32(SPORT1_RX32, val)
365#define bfin_read_SPORT1_TX16() bfin_read16(SPORT1_TX16)
366#define bfin_write_SPORT1_TX16(val) bfin_write16(SPORT1_TX16, val)
367#define bfin_read_SPORT1_RX16() bfin_read16(SPORT1_RX16)
368#define bfin_write_SPORT1_RX16(val) bfin_write16(SPORT1_RX16, val)
369#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
370#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1, val)
371#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
372#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2, val)
373#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
374#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
375#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
376#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV, val)
377#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
378#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT, val)
379#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
380#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL, val)
381#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
382#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1, val)
383#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
384#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2, val)
385#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
386#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0, val)
387#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
388#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1, val)
389#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
390#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2, val)
391#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
392#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3, val)
393#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
394#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0, val)
395#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
396#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1, val)
397#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
398#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2, val)
399#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
400#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3, val)
401
402
403/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
404#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
405#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL, val)
406#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
407#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0, val)
408#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
409#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1, val)
410#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
411#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL, val)
412#define bfin_read_EBIU_SDBCTL() bfin_read16(EBIU_SDBCTL)
413#define bfin_write_EBIU_SDBCTL(val) bfin_write16(EBIU_SDBCTL, val)
414#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
415#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC, val)
416#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
417#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT, val)
418
419
420/* DMA Traffic Control Registers */
421#define bfin_read_DMA_TC_PER() bfin_read16(DMA_TC_PER)
422#define bfin_write_DMA_TC_PER(val) bfin_write16(DMA_TC_PER, val)
423#define bfin_read_DMA_TC_CNT() bfin_read16(DMA_TC_CNT)
424#define bfin_write_DMA_TC_CNT(val) bfin_write16(DMA_TC_CNT, val)
425
426/* Alternate deprecated register names (below) provided for backwards code compatibility */
427#define bfin_read_DMA_TCPER() bfin_read16(DMA_TCPER)
428#define bfin_write_DMA_TCPER(val) bfin_write16(DMA_TCPER, val)
429#define bfin_read_DMA_TCCNT() bfin_read16(DMA_TCCNT)
430#define bfin_write_DMA_TCCNT(val) bfin_write16(DMA_TCCNT, val)
431
432/* DMA Controller */
433#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
434#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG, val)
435#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_read32(DMA0_NEXT_DESC_PTR)
436#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_write32(DMA0_NEXT_DESC_PTR, val)
437#define bfin_read_DMA0_START_ADDR() bfin_read32(DMA0_START_ADDR)
438#define bfin_write_DMA0_START_ADDR(val) bfin_write32(DMA0_START_ADDR, val)
439#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
440#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT, val)
441#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
442#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT, val)
443#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
444#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY, val)
445#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
446#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY, val)
447#define bfin_read_DMA0_CURR_DESC_PTR() bfin_read32(DMA0_CURR_DESC_PTR)
448#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_write32(DMA0_CURR_DESC_PTR, val)
449#define bfin_read_DMA0_CURR_ADDR() bfin_read32(DMA0_CURR_ADDR)
450#define bfin_write_DMA0_CURR_ADDR(val) bfin_write32(DMA0_CURR_ADDR, val)
451#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
452#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
453#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
454#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
455#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
456#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
457#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
458#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
459
460#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
461#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG, val)
462#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_read32(DMA1_NEXT_DESC_PTR)
463#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_write32(DMA1_NEXT_DESC_PTR, val)
464#define bfin_read_DMA1_START_ADDR() bfin_read32(DMA1_START_ADDR)
465#define bfin_write_DMA1_START_ADDR(val) bfin_write32(DMA1_START_ADDR, val)
466#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
467#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT, val)
468#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
469#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT, val)
470#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
471#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY, val)
472#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
473#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY, val)
474#define bfin_read_DMA1_CURR_DESC_PTR() bfin_read32(DMA1_CURR_DESC_PTR)
475#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_write32(DMA1_CURR_DESC_PTR, val)
476#define bfin_read_DMA1_CURR_ADDR() bfin_read32(DMA1_CURR_ADDR)
477#define bfin_write_DMA1_CURR_ADDR(val) bfin_write32(DMA1_CURR_ADDR, val)
478#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
479#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
480#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
481#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
482#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
483#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
484#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
485#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
486
487#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
488#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG, val)
489#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_read32(DMA2_NEXT_DESC_PTR)
490#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_write32(DMA2_NEXT_DESC_PTR, val)
491#define bfin_read_DMA2_START_ADDR() bfin_read32(DMA2_START_ADDR)
492#define bfin_write_DMA2_START_ADDR(val) bfin_write32(DMA2_START_ADDR, val)
493#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
494#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT, val)
495#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
496#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT, val)
497#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
498#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY, val)
499#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
500#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY, val)
501#define bfin_read_DMA2_CURR_DESC_PTR() bfin_read32(DMA2_CURR_DESC_PTR)
502#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_write32(DMA2_CURR_DESC_PTR, val)
503#define bfin_read_DMA2_CURR_ADDR() bfin_read32(DMA2_CURR_ADDR)
504#define bfin_write_DMA2_CURR_ADDR(val) bfin_write32(DMA2_CURR_ADDR, val)
505#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
506#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
507#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
508#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
509#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
510#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
511#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
512#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
513
514#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
515#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG, val)
516#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_read32(DMA3_NEXT_DESC_PTR)
517#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_write32(DMA3_NEXT_DESC_PTR, val)
518#define bfin_read_DMA3_START_ADDR() bfin_read32(DMA3_START_ADDR)
519#define bfin_write_DMA3_START_ADDR(val) bfin_write32(DMA3_START_ADDR, val)
520#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
521#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT, val)
522#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
523#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT, val)
524#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
525#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY, val)
526#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
527#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY, val)
528#define bfin_read_DMA3_CURR_DESC_PTR() bfin_read32(DMA3_CURR_DESC_PTR)
529#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_write32(DMA3_CURR_DESC_PTR, val)
530#define bfin_read_DMA3_CURR_ADDR() bfin_read32(DMA3_CURR_ADDR)
531#define bfin_write_DMA3_CURR_ADDR(val) bfin_write32(DMA3_CURR_ADDR, val)
532#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
533#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
534#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
535#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
536#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
537#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
538#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
539#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
540
541#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
542#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG, val)
543#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_read32(DMA4_NEXT_DESC_PTR)
544#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_write32(DMA4_NEXT_DESC_PTR, val)
545#define bfin_read_DMA4_START_ADDR() bfin_read32(DMA4_START_ADDR)
546#define bfin_write_DMA4_START_ADDR(val) bfin_write32(DMA4_START_ADDR, val)
547#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
548#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT, val)
549#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
550#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT, val)
551#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
552#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY, val)
553#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
554#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY, val)
555#define bfin_read_DMA4_CURR_DESC_PTR() bfin_read32(DMA4_CURR_DESC_PTR)
556#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_write32(DMA4_CURR_DESC_PTR, val)
557#define bfin_read_DMA4_CURR_ADDR() bfin_read32(DMA4_CURR_ADDR)
558#define bfin_write_DMA4_CURR_ADDR(val) bfin_write32(DMA4_CURR_ADDR, val)
559#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
560#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
561#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
562#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
563#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
564#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
565#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
566#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
567
568#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
569#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG, val)
570#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_read32(DMA5_NEXT_DESC_PTR)
571#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_write32(DMA5_NEXT_DESC_PTR, val)
572#define bfin_read_DMA5_START_ADDR() bfin_read32(DMA5_START_ADDR)
573#define bfin_write_DMA5_START_ADDR(val) bfin_write32(DMA5_START_ADDR, val)
574#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
575#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT, val)
576#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
577#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT, val)
578#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
579#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY, val)
580#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
581#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY, val)
582#define bfin_read_DMA5_CURR_DESC_PTR() bfin_read32(DMA5_CURR_DESC_PTR)
583#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_write32(DMA5_CURR_DESC_PTR, val)
584#define bfin_read_DMA5_CURR_ADDR() bfin_read32(DMA5_CURR_ADDR)
585#define bfin_write_DMA5_CURR_ADDR(val) bfin_write32(DMA5_CURR_ADDR, val)
586#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
587#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
588#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
589#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
590#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
591#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
592#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
593#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
594
595#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
596#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG, val)
597#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_read32(DMA6_NEXT_DESC_PTR)
598#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_write32(DMA6_NEXT_DESC_PTR, val)
599#define bfin_read_DMA6_START_ADDR() bfin_read32(DMA6_START_ADDR)
600#define bfin_write_DMA6_START_ADDR(val) bfin_write32(DMA6_START_ADDR, val)
601#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
602#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT, val)
603#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
604#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT, val)
605#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
606#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY, val)
607#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
608#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY, val)
609#define bfin_read_DMA6_CURR_DESC_PTR() bfin_read32(DMA6_CURR_DESC_PTR)
610#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_write32(DMA6_CURR_DESC_PTR, val)
611#define bfin_read_DMA6_CURR_ADDR() bfin_read32(DMA6_CURR_ADDR)
612#define bfin_write_DMA6_CURR_ADDR(val) bfin_write32(DMA6_CURR_ADDR, val)
613#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
614#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
615#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
616#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
617#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
618#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
619#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
620#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
621
622#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
623#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG, val)
624#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_read32(DMA7_NEXT_DESC_PTR)
625#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_write32(DMA7_NEXT_DESC_PTR, val)
626#define bfin_read_DMA7_START_ADDR() bfin_read32(DMA7_START_ADDR)
627#define bfin_write_DMA7_START_ADDR(val) bfin_write32(DMA7_START_ADDR, val)
628#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
629#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT, val)
630#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
631#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT, val)
632#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
633#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY, val)
634#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
635#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY, val)
636#define bfin_read_DMA7_CURR_DESC_PTR() bfin_read32(DMA7_CURR_DESC_PTR)
637#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_write32(DMA7_CURR_DESC_PTR, val)
638#define bfin_read_DMA7_CURR_ADDR() bfin_read32(DMA7_CURR_ADDR)
639#define bfin_write_DMA7_CURR_ADDR(val) bfin_write32(DMA7_CURR_ADDR, val)
640#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
641#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
642#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
643#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
644#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
645#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
646#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
647#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
648
649#define bfin_read_DMA8_CONFIG() bfin_read16(DMA8_CONFIG)
650#define bfin_write_DMA8_CONFIG(val) bfin_write16(DMA8_CONFIG, val)
651#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_read32(DMA8_NEXT_DESC_PTR)
652#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_write32(DMA8_NEXT_DESC_PTR, val)
653#define bfin_read_DMA8_START_ADDR() bfin_read32(DMA8_START_ADDR)
654#define bfin_write_DMA8_START_ADDR(val) bfin_write32(DMA8_START_ADDR, val)
655#define bfin_read_DMA8_X_COUNT() bfin_read16(DMA8_X_COUNT)
656#define bfin_write_DMA8_X_COUNT(val) bfin_write16(DMA8_X_COUNT, val)
657#define bfin_read_DMA8_Y_COUNT() bfin_read16(DMA8_Y_COUNT)
658#define bfin_write_DMA8_Y_COUNT(val) bfin_write16(DMA8_Y_COUNT, val)
659#define bfin_read_DMA8_X_MODIFY() bfin_read16(DMA8_X_MODIFY)
660#define bfin_write_DMA8_X_MODIFY(val) bfin_write16(DMA8_X_MODIFY, val)
661#define bfin_read_DMA8_Y_MODIFY() bfin_read16(DMA8_Y_MODIFY)
662#define bfin_write_DMA8_Y_MODIFY(val) bfin_write16(DMA8_Y_MODIFY, val)
663#define bfin_read_DMA8_CURR_DESC_PTR() bfin_read32(DMA8_CURR_DESC_PTR)
664#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_write32(DMA8_CURR_DESC_PTR, val)
665#define bfin_read_DMA8_CURR_ADDR() bfin_read32(DMA8_CURR_ADDR)
666#define bfin_write_DMA8_CURR_ADDR(val) bfin_write32(DMA8_CURR_ADDR, val)
667#define bfin_read_DMA8_CURR_X_COUNT() bfin_read16(DMA8_CURR_X_COUNT)
668#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
669#define bfin_read_DMA8_CURR_Y_COUNT() bfin_read16(DMA8_CURR_Y_COUNT)
670#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
671#define bfin_read_DMA8_IRQ_STATUS() bfin_read16(DMA8_IRQ_STATUS)
672#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
673#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
674#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
675
676#define bfin_read_DMA9_CONFIG() bfin_read16(DMA9_CONFIG)
677#define bfin_write_DMA9_CONFIG(val) bfin_write16(DMA9_CONFIG, val)
678#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_read32(DMA9_NEXT_DESC_PTR)
679#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_write32(DMA9_NEXT_DESC_PTR, val)
680#define bfin_read_DMA9_START_ADDR() bfin_read32(DMA9_START_ADDR)
681#define bfin_write_DMA9_START_ADDR(val) bfin_write32(DMA9_START_ADDR, val)
682#define bfin_read_DMA9_X_COUNT() bfin_read16(DMA9_X_COUNT)
683#define bfin_write_DMA9_X_COUNT(val) bfin_write16(DMA9_X_COUNT, val)
684#define bfin_read_DMA9_Y_COUNT() bfin_read16(DMA9_Y_COUNT)
685#define bfin_write_DMA9_Y_COUNT(val) bfin_write16(DMA9_Y_COUNT, val)
686#define bfin_read_DMA9_X_MODIFY() bfin_read16(DMA9_X_MODIFY)
687#define bfin_write_DMA9_X_MODIFY(val) bfin_write16(DMA9_X_MODIFY, val)
688#define bfin_read_DMA9_Y_MODIFY() bfin_read16(DMA9_Y_MODIFY)
689#define bfin_write_DMA9_Y_MODIFY(val) bfin_write16(DMA9_Y_MODIFY, val)
690#define bfin_read_DMA9_CURR_DESC_PTR() bfin_read32(DMA9_CURR_DESC_PTR)
691#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_write32(DMA9_CURR_DESC_PTR, val)
692#define bfin_read_DMA9_CURR_ADDR() bfin_read32(DMA9_CURR_ADDR)
693#define bfin_write_DMA9_CURR_ADDR(val) bfin_write32(DMA9_CURR_ADDR, val)
694#define bfin_read_DMA9_CURR_X_COUNT() bfin_read16(DMA9_CURR_X_COUNT)
695#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
696#define bfin_read_DMA9_CURR_Y_COUNT() bfin_read16(DMA9_CURR_Y_COUNT)
697#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
698#define bfin_read_DMA9_IRQ_STATUS() bfin_read16(DMA9_IRQ_STATUS)
699#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
700#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
701#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
702
703#define bfin_read_DMA10_CONFIG() bfin_read16(DMA10_CONFIG)
704#define bfin_write_DMA10_CONFIG(val) bfin_write16(DMA10_CONFIG, val)
705#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_read32(DMA10_NEXT_DESC_PTR)
706#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_write32(DMA10_NEXT_DESC_PTR, val)
707#define bfin_read_DMA10_START_ADDR() bfin_read32(DMA10_START_ADDR)
708#define bfin_write_DMA10_START_ADDR(val) bfin_write32(DMA10_START_ADDR, val)
709#define bfin_read_DMA10_X_COUNT() bfin_read16(DMA10_X_COUNT)
710#define bfin_write_DMA10_X_COUNT(val) bfin_write16(DMA10_X_COUNT, val)
711#define bfin_read_DMA10_Y_COUNT() bfin_read16(DMA10_Y_COUNT)
712#define bfin_write_DMA10_Y_COUNT(val) bfin_write16(DMA10_Y_COUNT, val)
713#define bfin_read_DMA10_X_MODIFY() bfin_read16(DMA10_X_MODIFY)
714#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY, val)
715#define bfin_read_DMA10_Y_MODIFY() bfin_read16(DMA10_Y_MODIFY)
716#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY, val)
717#define bfin_read_DMA10_CURR_DESC_PTR() bfin_read32(DMA10_CURR_DESC_PTR)
718#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_write32(DMA10_CURR_DESC_PTR, val)
719#define bfin_read_DMA10_CURR_ADDR() bfin_read32(DMA10_CURR_ADDR)
720#define bfin_write_DMA10_CURR_ADDR(val) bfin_write32(DMA10_CURR_ADDR, val)
721#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
722#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
723#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
724#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
725#define bfin_read_DMA10_IRQ_STATUS() bfin_read16(DMA10_IRQ_STATUS)
726#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
727#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
728#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
729
730#define bfin_read_DMA11_CONFIG() bfin_read16(DMA11_CONFIG)
731#define bfin_write_DMA11_CONFIG(val) bfin_write16(DMA11_CONFIG, val)
732#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_read32(DMA11_NEXT_DESC_PTR)
733#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_write32(DMA11_NEXT_DESC_PTR, val)
734#define bfin_read_DMA11_START_ADDR() bfin_read32(DMA11_START_ADDR)
735#define bfin_write_DMA11_START_ADDR(val) bfin_write32(DMA11_START_ADDR, val)
736#define bfin_read_DMA11_X_COUNT() bfin_read16(DMA11_X_COUNT)
737#define bfin_write_DMA11_X_COUNT(val) bfin_write16(DMA11_X_COUNT, val)
738#define bfin_read_DMA11_Y_COUNT() bfin_read16(DMA11_Y_COUNT)
739#define bfin_write_DMA11_Y_COUNT(val) bfin_write16(DMA11_Y_COUNT, val)
740#define bfin_read_DMA11_X_MODIFY() bfin_read16(DMA11_X_MODIFY)
741#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY, val)
742#define bfin_read_DMA11_Y_MODIFY() bfin_read16(DMA11_Y_MODIFY)
743#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY, val)
744#define bfin_read_DMA11_CURR_DESC_PTR() bfin_read32(DMA11_CURR_DESC_PTR)
745#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_write32(DMA11_CURR_DESC_PTR, val)
746#define bfin_read_DMA11_CURR_ADDR() bfin_read32(DMA11_CURR_ADDR)
747#define bfin_write_DMA11_CURR_ADDR(val) bfin_write32(DMA11_CURR_ADDR, val)
748#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
749#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
750#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
751#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
752#define bfin_read_DMA11_IRQ_STATUS() bfin_read16(DMA11_IRQ_STATUS)
753#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
754#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
755#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
756
757#define bfin_read_MDMA_D0_CONFIG() bfin_read16(MDMA_D0_CONFIG)
758#define bfin_write_MDMA_D0_CONFIG(val) bfin_write16(MDMA_D0_CONFIG, val)
759#define bfin_read_MDMA_D0_NEXT_DESC_PTR() bfin_read32(MDMA_D0_NEXT_DESC_PTR)
760#define bfin_write_MDMA_D0_NEXT_DESC_PTR(val) bfin_write32(MDMA_D0_NEXT_DESC_PTR, val)
761#define bfin_read_MDMA_D0_START_ADDR() bfin_read32(MDMA_D0_START_ADDR)
762#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write32(MDMA_D0_START_ADDR, val)
763#define bfin_read_MDMA_D0_X_COUNT() bfin_read16(MDMA_D0_X_COUNT)
764#define bfin_write_MDMA_D0_X_COUNT(val) bfin_write16(MDMA_D0_X_COUNT, val)
765#define bfin_read_MDMA_D0_Y_COUNT() bfin_read16(MDMA_D0_Y_COUNT)
766#define bfin_write_MDMA_D0_Y_COUNT(val) bfin_write16(MDMA_D0_Y_COUNT, val)
767#define bfin_read_MDMA_D0_X_MODIFY() bfin_read16(MDMA_D0_X_MODIFY)
768#define bfin_write_MDMA_D0_X_MODIFY(val) bfin_write16(MDMA_D0_X_MODIFY, val)
769#define bfin_read_MDMA_D0_Y_MODIFY() bfin_read16(MDMA_D0_Y_MODIFY)
770#define bfin_write_MDMA_D0_Y_MODIFY(val) bfin_write16(MDMA_D0_Y_MODIFY, val)
771#define bfin_read_MDMA_D0_CURR_DESC_PTR() bfin_read32(MDMA_D0_CURR_DESC_PTR)
772#define bfin_write_MDMA_D0_CURR_DESC_PTR(val) bfin_write32(MDMA_D0_CURR_DESC_PTR, val)
773#define bfin_read_MDMA_D0_CURR_ADDR() bfin_read32(MDMA_D0_CURR_ADDR)
774#define bfin_write_MDMA_D0_CURR_ADDR(val) bfin_write32(MDMA_D0_CURR_ADDR, val)
775#define bfin_read_MDMA_D0_CURR_X_COUNT() bfin_read16(MDMA_D0_CURR_X_COUNT)
776#define bfin_write_MDMA_D0_CURR_X_COUNT(val) bfin_write16(MDMA_D0_CURR_X_COUNT, val)
777#define bfin_read_MDMA_D0_CURR_Y_COUNT() bfin_read16(MDMA_D0_CURR_Y_COUNT)
778#define bfin_write_MDMA_D0_CURR_Y_COUNT(val) bfin_write16(MDMA_D0_CURR_Y_COUNT, val)
779#define bfin_read_MDMA_D0_IRQ_STATUS() bfin_read16(MDMA_D0_IRQ_STATUS)
780#define bfin_write_MDMA_D0_IRQ_STATUS(val) bfin_write16(MDMA_D0_IRQ_STATUS, val)
781#define bfin_read_MDMA_D0_PERIPHERAL_MAP() bfin_read16(MDMA_D0_PERIPHERAL_MAP)
782#define bfin_write_MDMA_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA_D0_PERIPHERAL_MAP, val)
783
784#define bfin_read_MDMA_S0_CONFIG() bfin_read16(MDMA_S0_CONFIG)
785#define bfin_write_MDMA_S0_CONFIG(val) bfin_write16(MDMA_S0_CONFIG, val)
786#define bfin_read_MDMA_S0_NEXT_DESC_PTR() bfin_read32(MDMA_S0_NEXT_DESC_PTR)
787#define bfin_write_MDMA_S0_NEXT_DESC_PTR(val) bfin_write32(MDMA_S0_NEXT_DESC_PTR, val)
788#define bfin_read_MDMA_S0_START_ADDR() bfin_read32(MDMA_S0_START_ADDR)
789#define bfin_write_MDMA_S0_START_ADDR(val) bfin_write32(MDMA_S0_START_ADDR, val)
790#define bfin_read_MDMA_S0_X_COUNT() bfin_read16(MDMA_S0_X_COUNT)
791#define bfin_write_MDMA_S0_X_COUNT(val) bfin_write16(MDMA_S0_X_COUNT, val)
792#define bfin_read_MDMA_S0_Y_COUNT() bfin_read16(MDMA_S0_Y_COUNT)
793#define bfin_write_MDMA_S0_Y_COUNT(val) bfin_write16(MDMA_S0_Y_COUNT, val)
794#define bfin_read_MDMA_S0_X_MODIFY() bfin_read16(MDMA_S0_X_MODIFY)
795#define bfin_write_MDMA_S0_X_MODIFY(val) bfin_write16(MDMA_S0_X_MODIFY, val)
796#define bfin_read_MDMA_S0_Y_MODIFY() bfin_read16(MDMA_S0_Y_MODIFY)
797#define bfin_write_MDMA_S0_Y_MODIFY(val) bfin_write16(MDMA_S0_Y_MODIFY, val)
798#define bfin_read_MDMA_S0_CURR_DESC_PTR() bfin_read32(MDMA_S0_CURR_DESC_PTR)
799#define bfin_write_MDMA_S0_CURR_DESC_PTR(val) bfin_write32(MDMA_S0_CURR_DESC_PTR, val)
800#define bfin_read_MDMA_S0_CURR_ADDR() bfin_read32(MDMA_S0_CURR_ADDR)
801#define bfin_write_MDMA_S0_CURR_ADDR(val) bfin_write32(MDMA_S0_CURR_ADDR, val)
802#define bfin_read_MDMA_S0_CURR_X_COUNT() bfin_read16(MDMA_S0_CURR_X_COUNT)
803#define bfin_write_MDMA_S0_CURR_X_COUNT(val) bfin_write16(MDMA_S0_CURR_X_COUNT, val)
804#define bfin_read_MDMA_S0_CURR_Y_COUNT() bfin_read16(MDMA_S0_CURR_Y_COUNT)
805#define bfin_write_MDMA_S0_CURR_Y_COUNT(val) bfin_write16(MDMA_S0_CURR_Y_COUNT, val)
806#define bfin_read_MDMA_S0_IRQ_STATUS() bfin_read16(MDMA_S0_IRQ_STATUS)
807#define bfin_write_MDMA_S0_IRQ_STATUS(val) bfin_write16(MDMA_S0_IRQ_STATUS, val)
808#define bfin_read_MDMA_S0_PERIPHERAL_MAP() bfin_read16(MDMA_S0_PERIPHERAL_MAP)
809#define bfin_write_MDMA_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA_S0_PERIPHERAL_MAP, val)
810
811#define bfin_read_MDMA_D1_CONFIG() bfin_read16(MDMA_D1_CONFIG)
812#define bfin_write_MDMA_D1_CONFIG(val) bfin_write16(MDMA_D1_CONFIG, val)
813#define bfin_read_MDMA_D1_NEXT_DESC_PTR() bfin_read32(MDMA_D1_NEXT_DESC_PTR)
814#define bfin_write_MDMA_D1_NEXT_DESC_PTR(val) bfin_write32(MDMA_D1_NEXT_DESC_PTR, val)
815#define bfin_read_MDMA_D1_START_ADDR() bfin_read32(MDMA_D1_START_ADDR)
816#define bfin_write_MDMA_D1_START_ADDR(val) bfin_write32(MDMA_D1_START_ADDR, val)
817#define bfin_read_MDMA_D1_X_COUNT() bfin_read16(MDMA_D1_X_COUNT)
818#define bfin_write_MDMA_D1_X_COUNT(val) bfin_write16(MDMA_D1_X_COUNT, val)
819#define bfin_read_MDMA_D1_Y_COUNT() bfin_read16(MDMA_D1_Y_COUNT)
820#define bfin_write_MDMA_D1_Y_COUNT(val) bfin_write16(MDMA_D1_Y_COUNT, val)
821#define bfin_read_MDMA_D1_X_MODIFY() bfin_read16(MDMA_D1_X_MODIFY)
822#define bfin_write_MDMA_D1_X_MODIFY(val) bfin_write16(MDMA_D1_X_MODIFY, val)
823#define bfin_read_MDMA_D1_Y_MODIFY() bfin_read16(MDMA_D1_Y_MODIFY)
824#define bfin_write_MDMA_D1_Y_MODIFY(val) bfin_write16(MDMA_D1_Y_MODIFY, val)
825#define bfin_read_MDMA_D1_CURR_DESC_PTR() bfin_read32(MDMA_D1_CURR_DESC_PTR)
826#define bfin_write_MDMA_D1_CURR_DESC_PTR(val) bfin_write32(MDMA_D1_CURR_DESC_PTR, val)
827#define bfin_read_MDMA_D1_CURR_ADDR() bfin_read32(MDMA_D1_CURR_ADDR)
828#define bfin_write_MDMA_D1_CURR_ADDR(val) bfin_write32(MDMA_D1_CURR_ADDR, val)
829#define bfin_read_MDMA_D1_CURR_X_COUNT() bfin_read16(MDMA_D1_CURR_X_COUNT)
830#define bfin_write_MDMA_D1_CURR_X_COUNT(val) bfin_write16(MDMA_D1_CURR_X_COUNT, val)
831#define bfin_read_MDMA_D1_CURR_Y_COUNT() bfin_read16(MDMA_D1_CURR_Y_COUNT)
832#define bfin_write_MDMA_D1_CURR_Y_COUNT(val) bfin_write16(MDMA_D1_CURR_Y_COUNT, val)
833#define bfin_read_MDMA_D1_IRQ_STATUS() bfin_read16(MDMA_D1_IRQ_STATUS)
834#define bfin_write_MDMA_D1_IRQ_STATUS(val) bfin_write16(MDMA_D1_IRQ_STATUS, val)
835#define bfin_read_MDMA_D1_PERIPHERAL_MAP() bfin_read16(MDMA_D1_PERIPHERAL_MAP)
836#define bfin_write_MDMA_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA_D1_PERIPHERAL_MAP, val)
837
838#define bfin_read_MDMA_S1_CONFIG() bfin_read16(MDMA_S1_CONFIG)
839#define bfin_write_MDMA_S1_CONFIG(val) bfin_write16(MDMA_S1_CONFIG, val)
840#define bfin_read_MDMA_S1_NEXT_DESC_PTR() bfin_read32(MDMA_S1_NEXT_DESC_PTR)
841#define bfin_write_MDMA_S1_NEXT_DESC_PTR(val) bfin_write32(MDMA_S1_NEXT_DESC_PTR, val)
842#define bfin_read_MDMA_S1_START_ADDR() bfin_read32(MDMA_S1_START_ADDR)
843#define bfin_write_MDMA_S1_START_ADDR(val) bfin_write32(MDMA_S1_START_ADDR, val)
844#define bfin_read_MDMA_S1_X_COUNT() bfin_read16(MDMA_S1_X_COUNT)
845#define bfin_write_MDMA_S1_X_COUNT(val) bfin_write16(MDMA_S1_X_COUNT, val)
846#define bfin_read_MDMA_S1_Y_COUNT() bfin_read16(MDMA_S1_Y_COUNT)
847#define bfin_write_MDMA_S1_Y_COUNT(val) bfin_write16(MDMA_S1_Y_COUNT, val)
848#define bfin_read_MDMA_S1_X_MODIFY() bfin_read16(MDMA_S1_X_MODIFY)
849#define bfin_write_MDMA_S1_X_MODIFY(val) bfin_write16(MDMA_S1_X_MODIFY, val)
850#define bfin_read_MDMA_S1_Y_MODIFY() bfin_read16(MDMA_S1_Y_MODIFY)
851#define bfin_write_MDMA_S1_Y_MODIFY(val) bfin_write16(MDMA_S1_Y_MODIFY, val)
852#define bfin_read_MDMA_S1_CURR_DESC_PTR() bfin_read32(MDMA_S1_CURR_DESC_PTR)
853#define bfin_write_MDMA_S1_CURR_DESC_PTR(val) bfin_write32(MDMA_S1_CURR_DESC_PTR, val)
854#define bfin_read_MDMA_S1_CURR_ADDR() bfin_read32(MDMA_S1_CURR_ADDR)
855#define bfin_write_MDMA_S1_CURR_ADDR(val) bfin_write32(MDMA_S1_CURR_ADDR, val)
856#define bfin_read_MDMA_S1_CURR_X_COUNT() bfin_read16(MDMA_S1_CURR_X_COUNT)
857#define bfin_write_MDMA_S1_CURR_X_COUNT(val) bfin_write16(MDMA_S1_CURR_X_COUNT, val)
858#define bfin_read_MDMA_S1_CURR_Y_COUNT() bfin_read16(MDMA_S1_CURR_Y_COUNT)
859#define bfin_write_MDMA_S1_CURR_Y_COUNT(val) bfin_write16(MDMA_S1_CURR_Y_COUNT, val)
860#define bfin_read_MDMA_S1_IRQ_STATUS() bfin_read16(MDMA_S1_IRQ_STATUS)
861#define bfin_write_MDMA_S1_IRQ_STATUS(val) bfin_write16(MDMA_S1_IRQ_STATUS, val)
862#define bfin_read_MDMA_S1_PERIPHERAL_MAP() bfin_read16(MDMA_S1_PERIPHERAL_MAP)
863#define bfin_write_MDMA_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA_S1_PERIPHERAL_MAP, val)
864
865
866/* Parallel Peripheral Interface (0xFFC01000 - 0xFFC010FF) */
867#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
868#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL, val)
869#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
870#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS, val)
871#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
872#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY, val)
873#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
874#define bfin_write_PPI_COUNT(val) bfin_write16(PPI_COUNT, val)
875#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
876#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME, val)
877
878
879/* Two-Wire Interface (0xFFC01400 - 0xFFC014FF) */
880
881/* General Purpose I/O Port G (0xFFC01500 - 0xFFC015FF) */
882#define bfin_read_PORTGIO() bfin_read16(PORTGIO)
883#define bfin_write_PORTGIO(val) bfin_write16(PORTGIO, val)
884#define bfin_read_PORTGIO_CLEAR() bfin_read16(PORTGIO_CLEAR)
885#define bfin_write_PORTGIO_CLEAR(val) bfin_write16(PORTGIO_CLEAR, val)
886#define bfin_read_PORTGIO_SET() bfin_read16(PORTGIO_SET)
887#define bfin_write_PORTGIO_SET(val) bfin_write16(PORTGIO_SET, val)
888#define bfin_read_PORTGIO_TOGGLE() bfin_read16(PORTGIO_TOGGLE)
889#define bfin_write_PORTGIO_TOGGLE(val) bfin_write16(PORTGIO_TOGGLE, val)
890#define bfin_read_PORTGIO_MASKA() bfin_read16(PORTGIO_MASKA)
891#define bfin_write_PORTGIO_MASKA(val) bfin_write16(PORTGIO_MASKA, val)
892#define bfin_read_PORTGIO_MASKA_CLEAR() bfin_read16(PORTGIO_MASKA_CLEAR)
893#define bfin_write_PORTGIO_MASKA_CLEAR(val) bfin_write16(PORTGIO_MASKA_CLEAR, val)
894#define bfin_read_PORTGIO_MASKA_SET() bfin_read16(PORTGIO_MASKA_SET)
895#define bfin_write_PORTGIO_MASKA_SET(val) bfin_write16(PORTGIO_MASKA_SET, val)
896#define bfin_read_PORTGIO_MASKA_TOGGLE() bfin_read16(PORTGIO_MASKA_TOGGLE)
897#define bfin_write_PORTGIO_MASKA_TOGGLE(val) bfin_write16(PORTGIO_MASKA_TOGGLE, val)
898#define bfin_read_PORTGIO_MASKB() bfin_read16(PORTGIO_MASKB)
899#define bfin_write_PORTGIO_MASKB(val) bfin_write16(PORTGIO_MASKB, val)
900#define bfin_read_PORTGIO_MASKB_CLEAR() bfin_read16(PORTGIO_MASKB_CLEAR)
901#define bfin_write_PORTGIO_MASKB_CLEAR(val) bfin_write16(PORTGIO_MASKB_CLEAR, val)
902#define bfin_read_PORTGIO_MASKB_SET() bfin_read16(PORTGIO_MASKB_SET)
903#define bfin_write_PORTGIO_MASKB_SET(val) bfin_write16(PORTGIO_MASKB_SET, val)
904#define bfin_read_PORTGIO_MASKB_TOGGLE() bfin_read16(PORTGIO_MASKB_TOGGLE)
905#define bfin_write_PORTGIO_MASKB_TOGGLE(val) bfin_write16(PORTGIO_MASKB_TOGGLE, val)
906#define bfin_read_PORTGIO_DIR() bfin_read16(PORTGIO_DIR)
907#define bfin_write_PORTGIO_DIR(val) bfin_write16(PORTGIO_DIR, val)
908#define bfin_read_PORTGIO_POLAR() bfin_read16(PORTGIO_POLAR)
909#define bfin_write_PORTGIO_POLAR(val) bfin_write16(PORTGIO_POLAR, val)
910#define bfin_read_PORTGIO_EDGE() bfin_read16(PORTGIO_EDGE)
911#define bfin_write_PORTGIO_EDGE(val) bfin_write16(PORTGIO_EDGE, val)
912#define bfin_read_PORTGIO_BOTH() bfin_read16(PORTGIO_BOTH)
913#define bfin_write_PORTGIO_BOTH(val) bfin_write16(PORTGIO_BOTH, val)
914#define bfin_read_PORTGIO_INEN() bfin_read16(PORTGIO_INEN)
915#define bfin_write_PORTGIO_INEN(val) bfin_write16(PORTGIO_INEN, val)
916
917
918/* General Purpose I/O Port H (0xFFC01700 - 0xFFC017FF) */
919#define bfin_read_PORTHIO() bfin_read16(PORTHIO)
920#define bfin_write_PORTHIO(val) bfin_write16(PORTHIO, val)
921#define bfin_read_PORTHIO_CLEAR() bfin_read16(PORTHIO_CLEAR)
922#define bfin_write_PORTHIO_CLEAR(val) bfin_write16(PORTHIO_CLEAR, val)
923#define bfin_read_PORTHIO_SET() bfin_read16(PORTHIO_SET)
924#define bfin_write_PORTHIO_SET(val) bfin_write16(PORTHIO_SET, val)
925#define bfin_read_PORTHIO_TOGGLE() bfin_read16(PORTHIO_TOGGLE)
926#define bfin_write_PORTHIO_TOGGLE(val) bfin_write16(PORTHIO_TOGGLE, val)
927#define bfin_read_PORTHIO_MASKA() bfin_read16(PORTHIO_MASKA)
928#define bfin_write_PORTHIO_MASKA(val) bfin_write16(PORTHIO_MASKA, val)
929#define bfin_read_PORTHIO_MASKA_CLEAR() bfin_read16(PORTHIO_MASKA_CLEAR)
930#define bfin_write_PORTHIO_MASKA_CLEAR(val) bfin_write16(PORTHIO_MASKA_CLEAR, val)
931#define bfin_read_PORTHIO_MASKA_SET() bfin_read16(PORTHIO_MASKA_SET)
932#define bfin_write_PORTHIO_MASKA_SET(val) bfin_write16(PORTHIO_MASKA_SET, val)
933#define bfin_read_PORTHIO_MASKA_TOGGLE() bfin_read16(PORTHIO_MASKA_TOGGLE)
934#define bfin_write_PORTHIO_MASKA_TOGGLE(val) bfin_write16(PORTHIO_MASKA_TOGGLE, val)
935#define bfin_read_PORTHIO_MASKB() bfin_read16(PORTHIO_MASKB)
936#define bfin_write_PORTHIO_MASKB(val) bfin_write16(PORTHIO_MASKB, val)
937#define bfin_read_PORTHIO_MASKB_CLEAR() bfin_read16(PORTHIO_MASKB_CLEAR)
938#define bfin_write_PORTHIO_MASKB_CLEAR(val) bfin_write16(PORTHIO_MASKB_CLEAR, val)
939#define bfin_read_PORTHIO_MASKB_SET() bfin_read16(PORTHIO_MASKB_SET)
940#define bfin_write_PORTHIO_MASKB_SET(val) bfin_write16(PORTHIO_MASKB_SET, val)
941#define bfin_read_PORTHIO_MASKB_TOGGLE() bfin_read16(PORTHIO_MASKB_TOGGLE)
942#define bfin_write_PORTHIO_MASKB_TOGGLE(val) bfin_write16(PORTHIO_MASKB_TOGGLE, val)
943#define bfin_read_PORTHIO_DIR() bfin_read16(PORTHIO_DIR)
944#define bfin_write_PORTHIO_DIR(val) bfin_write16(PORTHIO_DIR, val)
945#define bfin_read_PORTHIO_POLAR() bfin_read16(PORTHIO_POLAR)
946#define bfin_write_PORTHIO_POLAR(val) bfin_write16(PORTHIO_POLAR, val)
947#define bfin_read_PORTHIO_EDGE() bfin_read16(PORTHIO_EDGE)
948#define bfin_write_PORTHIO_EDGE(val) bfin_write16(PORTHIO_EDGE, val)
949#define bfin_read_PORTHIO_BOTH() bfin_read16(PORTHIO_BOTH)
950#define bfin_write_PORTHIO_BOTH(val) bfin_write16(PORTHIO_BOTH, val)
951#define bfin_read_PORTHIO_INEN() bfin_read16(PORTHIO_INEN)
952#define bfin_write_PORTHIO_INEN(val) bfin_write16(PORTHIO_INEN, val)
953
954
955/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
956#define bfin_read_UART1_THR() bfin_read16(UART1_THR)
957#define bfin_write_UART1_THR(val) bfin_write16(UART1_THR, val)
958#define bfin_read_UART1_RBR() bfin_read16(UART1_RBR)
959#define bfin_write_UART1_RBR(val) bfin_write16(UART1_RBR, val)
960#define bfin_read_UART1_DLL() bfin_read16(UART1_DLL)
961#define bfin_write_UART1_DLL(val) bfin_write16(UART1_DLL, val)
962#define bfin_read_UART1_IER() bfin_read16(UART1_IER)
963#define bfin_write_UART1_IER(val) bfin_write16(UART1_IER, val)
964#define bfin_read_UART1_DLH() bfin_read16(UART1_DLH)
965#define bfin_write_UART1_DLH(val) bfin_write16(UART1_DLH, val)
966#define bfin_read_UART1_IIR() bfin_read16(UART1_IIR)
967#define bfin_write_UART1_IIR(val) bfin_write16(UART1_IIR, val)
968#define bfin_read_UART1_LCR() bfin_read16(UART1_LCR)
969#define bfin_write_UART1_LCR(val) bfin_write16(UART1_LCR, val)
970#define bfin_read_UART1_MCR() bfin_read16(UART1_MCR)
971#define bfin_write_UART1_MCR(val) bfin_write16(UART1_MCR, val)
972#define bfin_read_UART1_LSR() bfin_read16(UART1_LSR)
973#define bfin_write_UART1_LSR(val) bfin_write16(UART1_LSR, val)
974#define bfin_read_UART1_MSR() bfin_read16(UART1_MSR)
975#define bfin_write_UART1_MSR(val) bfin_write16(UART1_MSR, val)
976#define bfin_read_UART1_SCR() bfin_read16(UART1_SCR)
977#define bfin_write_UART1_SCR(val) bfin_write16(UART1_SCR, val)
978#define bfin_read_UART1_GCTL() bfin_read16(UART1_GCTL)
979#define bfin_write_UART1_GCTL(val) bfin_write16(UART1_GCTL, val)
980
981/* Omit CAN register sets from the cdefBF534.h (CAN is not in the ADSP-BF51x processor) */
982
983/* Pin Control Registers (0xFFC03200 - 0xFFC032FF) */
984#define bfin_read_PORTF_FER() bfin_read16(PORTF_FER)
985#define bfin_write_PORTF_FER(val) bfin_write16(PORTF_FER, val)
986#define bfin_read_PORTG_FER() bfin_read16(PORTG_FER)
987#define bfin_write_PORTG_FER(val) bfin_write16(PORTG_FER, val)
988#define bfin_read_PORTH_FER() bfin_read16(PORTH_FER)
989#define bfin_write_PORTH_FER(val) bfin_write16(PORTH_FER, val)
990#define bfin_read_PORT_MUX() bfin_read16(PORT_MUX)
991#define bfin_write_PORT_MUX(val) bfin_write16(PORT_MUX, val)
992
993
994/* Handshake MDMA Registers (0xFFC03300 - 0xFFC033FF) */
995#define bfin_read_HMDMA0_CONTROL() bfin_read16(HMDMA0_CONTROL)
996#define bfin_write_HMDMA0_CONTROL(val) bfin_write16(HMDMA0_CONTROL, val)
997#define bfin_read_HMDMA0_ECINIT() bfin_read16(HMDMA0_ECINIT)
998#define bfin_write_HMDMA0_ECINIT(val) bfin_write16(HMDMA0_ECINIT, val)
999#define bfin_read_HMDMA0_BCINIT() bfin_read16(HMDMA0_BCINIT)
1000#define bfin_write_HMDMA0_BCINIT(val) bfin_write16(HMDMA0_BCINIT, val)
1001#define bfin_read_HMDMA0_ECURGENT() bfin_read16(HMDMA0_ECURGENT)
1002#define bfin_write_HMDMA0_ECURGENT(val) bfin_write16(HMDMA0_ECURGENT, val)
1003#define bfin_read_HMDMA0_ECOVERFLOW() bfin_read16(HMDMA0_ECOVERFLOW)
1004#define bfin_write_HMDMA0_ECOVERFLOW(val) bfin_write16(HMDMA0_ECOVERFLOW, val)
1005#define bfin_read_HMDMA0_ECOUNT() bfin_read16(HMDMA0_ECOUNT)
1006#define bfin_write_HMDMA0_ECOUNT(val) bfin_write16(HMDMA0_ECOUNT, val)
1007#define bfin_read_HMDMA0_BCOUNT() bfin_read16(HMDMA0_BCOUNT)
1008#define bfin_write_HMDMA0_BCOUNT(val) bfin_write16(HMDMA0_BCOUNT, val)
1009
1010#define bfin_read_HMDMA1_CONTROL() bfin_read16(HMDMA1_CONTROL)
1011#define bfin_write_HMDMA1_CONTROL(val) bfin_write16(HMDMA1_CONTROL, val)
1012#define bfin_read_HMDMA1_ECINIT() bfin_read16(HMDMA1_ECINIT)
1013#define bfin_write_HMDMA1_ECINIT(val) bfin_write16(HMDMA1_ECINIT, val)
1014#define bfin_read_HMDMA1_BCINIT() bfin_read16(HMDMA1_BCINIT)
1015#define bfin_write_HMDMA1_BCINIT(val) bfin_write16(HMDMA1_BCINIT, val)
1016#define bfin_read_HMDMA1_ECURGENT() bfin_read16(HMDMA1_ECURGENT)
1017#define bfin_write_HMDMA1_ECURGENT(val) bfin_write16(HMDMA1_ECURGENT, val)
1018#define bfin_read_HMDMA1_ECOVERFLOW() bfin_read16(HMDMA1_ECOVERFLOW)
1019#define bfin_write_HMDMA1_ECOVERFLOW(val) bfin_write16(HMDMA1_ECOVERFLOW, val)
1020#define bfin_read_HMDMA1_ECOUNT() bfin_read16(HMDMA1_ECOUNT)
1021#define bfin_write_HMDMA1_ECOUNT(val) bfin_write16(HMDMA1_ECOUNT, val)
1022#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
1023#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT, val)
1024
1025/* ==== end from cdefBF534.h ==== */
1026
1027/* GPIO PIN mux (0xFFC03210 - OxFFC03288) */
1028
1029#define bfin_read_PORTF_MUX() bfin_read16(PORTF_MUX)
1030#define bfin_write_PORTF_MUX(val) bfin_write16(PORTF_MUX, val)
1031#define bfin_read_PORTG_MUX() bfin_read16(PORTG_MUX)
1032#define bfin_write_PORTG_MUX(val) bfin_write16(PORTG_MUX, val)
1033#define bfin_read_PORTH_MUX() bfin_read16(PORTH_MUX)
1034#define bfin_write_PORTH_MUX(val) bfin_write16(PORTH_MUX, val)
1035
1036#define bfin_read_PORTF_DRIVE() bfin_read16(PORTF_DRIVE)
1037#define bfin_write_PORTF_DRIVE(val) bfin_write16(PORTF_DRIVE, val)
1038#define bfin_read_PORTG_DRIVE() bfin_read16(PORTG_DRIVE)
1039#define bfin_write_PORTG_DRIVE(val) bfin_write16(PORTG_DRIVE, val)
1040#define bfin_read_PORTH_DRIVE() bfin_read16(PORTH_DRIVE)
1041#define bfin_write_PORTH_DRIVE(val) bfin_write16(PORTH_DRIVE, val)
1042#define bfin_read_PORTF_SLEW() bfin_read16(PORTF_SLEW)
1043#define bfin_write_PORTF_SLEW(val) bfin_write16(PORTF_SLEW, val)
1044#define bfin_read_PORTG_SLEW() bfin_read16(PORTG_SLEW)
1045#define bfin_write_PORTG_SLEW(val) bfin_write16(PORTG_SLEW, val)
1046#define bfin_read_PORTH_SLEW() bfin_read16(PORTH_SLEW)
1047#define bfin_write_PORTH_SLEW(val) bfin_write16(PORTH_SLEW, val)
1048#define bfin_read_PORTF_HYSTERISIS() bfin_read16(PORTF_HYSTERISIS)
1049#define bfin_write_PORTF_HYSTERISIS(val) bfin_write16(PORTF_HYSTERISIS, val)
1050#define bfin_read_PORTG_HYSTERISIS() bfin_read16(PORTG_HYSTERISIS)
1051#define bfin_write_PORTG_HYSTERISIS(val) bfin_write16(PORTG_HYSTERISIS, val)
1052#define bfin_read_PORTH_HYSTERISIS() bfin_read16(PORTH_HYSTERISIS)
1053#define bfin_write_PORTH_HYSTERISIS(val) bfin_write16(PORTH_HYSTERISIS, val)
1054#define bfin_read_MISCPORT_DRIVE() bfin_read16(MISCPORT_DRIVE)
1055#define bfin_write_MISCPORT_DRIVE(val) bfin_write16(MISCPORT_DRIVE, val)
1056#define bfin_read_MISCPORT_SLEW() bfin_read16(MISCPORT_SLEW)
1057#define bfin_write_MISCPORT_SLEW(val) bfin_write16(MISCPORT_SLEW, val)
1058#define bfin_read_MISCPORT_HYSTERISIS() bfin_read16(MISCPORT_HYSTERISIS)
1059#define bfin_write_MISCPORT_HYSTERISIS(val) bfin_write16(MISCPORT_HYSTERISIS, val)
1060
1061/* HOST Port Registers */
1062
1063#define bfin_read_HOST_CONTROL() bfin_read16(HOST_CONTROL)
1064#define bfin_write_HOST_CONTROL(val) bfin_write16(HOST_CONTROL, val)
1065#define bfin_read_HOST_STATUS() bfin_read16(HOST_STATUS)
1066#define bfin_write_HOST_STATUS(val) bfin_write16(HOST_STATUS, val)
1067#define bfin_read_HOST_TIMEOUT() bfin_read16(HOST_TIMEOUT)
1068#define bfin_write_HOST_TIMEOUT(val) bfin_write16(HOST_TIMEOUT, val)
1069
1070/* Counter Registers */
1071
1072#define bfin_read_CNT_CONFIG() bfin_read16(CNT_CONFIG)
1073#define bfin_write_CNT_CONFIG(val) bfin_write16(CNT_CONFIG, val)
1074#define bfin_read_CNT_IMASK() bfin_read16(CNT_IMASK)
1075#define bfin_write_CNT_IMASK(val) bfin_write16(CNT_IMASK, val)
1076#define bfin_read_CNT_STATUS() bfin_read16(CNT_STATUS)
1077#define bfin_write_CNT_STATUS(val) bfin_write16(CNT_STATUS, val)
1078#define bfin_read_CNT_COMMAND() bfin_read16(CNT_COMMAND)
1079#define bfin_write_CNT_COMMAND(val) bfin_write16(CNT_COMMAND, val)
1080#define bfin_read_CNT_DEBOUNCE() bfin_read16(CNT_DEBOUNCE)
1081#define bfin_write_CNT_DEBOUNCE(val) bfin_write16(CNT_DEBOUNCE, val)
1082#define bfin_read_CNT_COUNTER() bfin_read32(CNT_COUNTER)
1083#define bfin_write_CNT_COUNTER(val) bfin_write32(CNT_COUNTER, val)
1084#define bfin_read_CNT_MAX() bfin_read32(CNT_MAX)
1085#define bfin_write_CNT_MAX(val) bfin_write32(CNT_MAX, val)
1086#define bfin_read_CNT_MIN() bfin_read32(CNT_MIN)
1087#define bfin_write_CNT_MIN(val) bfin_write32(CNT_MIN, val)
1088
1089/* OTP/FUSE Registers */
1090
1091#define bfin_read_OTP_CONTROL() bfin_read16(OTP_CONTROL)
1092#define bfin_write_OTP_CONTROL(val) bfin_write16(OTP_CONTROL, val)
1093#define bfin_read_OTP_BEN() bfin_read16(OTP_BEN)
1094#define bfin_write_OTP_BEN(val) bfin_write16(OTP_BEN, val)
1095#define bfin_read_OTP_STATUS() bfin_read16(OTP_STATUS)
1096#define bfin_write_OTP_STATUS(val) bfin_write16(OTP_STATUS, val)
1097#define bfin_read_OTP_TIMING() bfin_read32(OTP_TIMING)
1098#define bfin_write_OTP_TIMING(val) bfin_write32(OTP_TIMING, val)
1099
1100/* Security Registers */
1101
1102#define bfin_read_SECURE_SYSSWT() bfin_read32(SECURE_SYSSWT)
1103#define bfin_write_SECURE_SYSSWT(val) bfin_write32(SECURE_SYSSWT, val)
1104#define bfin_read_SECURE_CONTROL() bfin_read16(SECURE_CONTROL)
1105#define bfin_write_SECURE_CONTROL(val) bfin_write16(SECURE_CONTROL, val)
1106#define bfin_read_SECURE_STATUS() bfin_read16(SECURE_STATUS)
1107#define bfin_write_SECURE_STATUS(val) bfin_write16(SECURE_STATUS, val)
1108
1109/* OTP Read/Write Data Buffer Registers */
1110
1111#define bfin_read_OTP_DATA0() bfin_read32(OTP_DATA0)
1112#define bfin_write_OTP_DATA0(val) bfin_write32(OTP_DATA0, val)
1113#define bfin_read_OTP_DATA1() bfin_read32(OTP_DATA1)
1114#define bfin_write_OTP_DATA1(val) bfin_write32(OTP_DATA1, val)
1115#define bfin_read_OTP_DATA2() bfin_read32(OTP_DATA2)
1116#define bfin_write_OTP_DATA2(val) bfin_write32(OTP_DATA2, val)
1117#define bfin_read_OTP_DATA3() bfin_read32(OTP_DATA3)
1118#define bfin_write_OTP_DATA3(val) bfin_write32(OTP_DATA3, val)
1119
1120/* NFC Registers */
1121
1122#define bfin_read_NFC_CTL() bfin_read16(NFC_CTL)
1123#define bfin_write_NFC_CTL(val) bfin_write16(NFC_CTL, val)
1124#define bfin_read_NFC_STAT() bfin_read16(NFC_STAT)
1125#define bfin_write_NFC_STAT(val) bfin_write16(NFC_STAT, val)
1126#define bfin_read_NFC_IRQSTAT() bfin_read16(NFC_IRQSTAT)
1127#define bfin_write_NFC_IRQSTAT(val) bfin_write16(NFC_IRQSTAT, val)
1128#define bfin_read_NFC_IRQMASK() bfin_read16(NFC_IRQMASK)
1129#define bfin_write_NFC_IRQMASK(val) bfin_write16(NFC_IRQMASK, val)
1130#define bfin_read_NFC_ECC0() bfin_read16(NFC_ECC0)
1131#define bfin_write_NFC_ECC0(val) bfin_write16(NFC_ECC0, val)
1132#define bfin_read_NFC_ECC1() bfin_read16(NFC_ECC1)
1133#define bfin_write_NFC_ECC1(val) bfin_write16(NFC_ECC1, val)
1134#define bfin_read_NFC_ECC2() bfin_read16(NFC_ECC2)
1135#define bfin_write_NFC_ECC2(val) bfin_write16(NFC_ECC2, val)
1136#define bfin_read_NFC_ECC3() bfin_read16(NFC_ECC3)
1137#define bfin_write_NFC_ECC3(val) bfin_write16(NFC_ECC3, val)
1138#define bfin_read_NFC_COUNT() bfin_read16(NFC_COUNT)
1139#define bfin_write_NFC_COUNT(val) bfin_write16(NFC_COUNT, val)
1140#define bfin_read_NFC_RST() bfin_read16(NFC_RST)
1141#define bfin_write_NFC_RST(val) bfin_write16(NFC_RST, val)
1142#define bfin_read_NFC_PGCTL() bfin_read16(NFC_PGCTL)
1143#define bfin_write_NFC_PGCTL(val) bfin_write16(NFC_PGCTL, val)
1144#define bfin_read_NFC_READ() bfin_read16(NFC_READ)
1145#define bfin_write_NFC_READ(val) bfin_write16(NFC_READ, val)
1146#define bfin_read_NFC_ADDR() bfin_read16(NFC_ADDR)
1147#define bfin_write_NFC_ADDR(val) bfin_write16(NFC_ADDR, val)
1148#define bfin_read_NFC_CMD() bfin_read16(NFC_CMD)
1149#define bfin_write_NFC_CMD(val) bfin_write16(NFC_CMD, val)
1150#define bfin_read_NFC_DATA_WR() bfin_read16(NFC_DATA_WR)
1151#define bfin_write_NFC_DATA_WR(val) bfin_write16(NFC_DATA_WR, val)
1152#define bfin_read_NFC_DATA_RD() bfin_read16(NFC_DATA_RD)
1153#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val)
1154
1155/* These need to be last due to the cdef/linux inter-dependencies */
1156#include <asm/irq.h>
1157
1158/* Writing to PLL_CTL initiates a PLL relock sequence. */
1159static __inline__ void bfin_write_PLL_CTL(unsigned int val)
1160{
1161 unsigned long flags, iwr0, iwr1;
1162
1163 if (val == bfin_read_PLL_CTL())
1164 return;
1165
1166 local_irq_save_hw(flags);
1167 /* Enable the PLL Wakeup bit in SIC IWR */
1168 iwr0 = bfin_read32(SIC_IWR0);
1169 iwr1 = bfin_read32(SIC_IWR1);
1170 /* Only allow PPL Wakeup) */
1171 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
1172 bfin_write32(SIC_IWR1, 0);
1173
1174 bfin_write16(PLL_CTL, val);
1175 SSYNC();
1176 asm("IDLE;");
1177
1178 bfin_write32(SIC_IWR0, iwr0);
1179 bfin_write32(SIC_IWR1, iwr1);
1180 local_irq_restore_hw(flags);
1181}
1182
1183/* Writing to VR_CTL initiates a PLL relock sequence. */
1184static __inline__ void bfin_write_VR_CTL(unsigned int val)
1185{
1186 unsigned long flags, iwr0, iwr1;
1187
1188 if (val == bfin_read_VR_CTL())
1189 return;
1190
1191 local_irq_save_hw(flags);
1192 /* Enable the PLL Wakeup bit in SIC IWR */
1193 iwr0 = bfin_read32(SIC_IWR0);
1194 iwr1 = bfin_read32(SIC_IWR1);
1195 /* Only allow PPL Wakeup) */
1196 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
1197 bfin_write32(SIC_IWR1, 0);
1198
1199 bfin_write16(VR_CTL, val);
1200 SSYNC();
1201 asm("IDLE;");
1202
1203 bfin_write32(SIC_IWR0, iwr0);
1204 bfin_write32(SIC_IWR1, iwr1);
1205 local_irq_restore_hw(flags);
1206}
1207
1208#endif /* _CDEF_BF52X_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/defBF512.h b/arch/blackfin/mach-bf518/include/mach/defBF512.h
new file mode 100644
index 000000000000..a96ca90154dd
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/defBF512.h
@@ -0,0 +1,42 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/defBF512.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _DEF_BF512_H
32#define _DEF_BF512_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF512 */
38
39/* Include defBF51x_base.h for the set of #defines that are common to all ADSP-BF51x processors */
40#include "defBF51x_base.h"
41
42#endif /* _DEF_BF512_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/defBF514.h b/arch/blackfin/mach-bf518/include/mach/defBF514.h
new file mode 100644
index 000000000000..543f2913b3f5
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/defBF514.h
@@ -0,0 +1,113 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/defBF514.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _DEF_BF514_H
32#define _DEF_BF514_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF514 */
38
39/* Include defBF51x_base.h for the set of #defines that are common to all ADSP-BF51x processors */
40#include "defBF51x_base.h"
41
42/* The following are the #defines needed by ADSP-BF514 that are not in the common header */
43
44/* SDH Registers */
45
46#define SDH_PWR_CTL 0xFFC03900 /* SDH Power Control */
47#define SDH_CLK_CTL 0xFFC03904 /* SDH Clock Control */
48#define SDH_ARGUMENT 0xFFC03908 /* SDH Argument */
49#define SDH_COMMAND 0xFFC0390C /* SDH Command */
50#define SDH_RESP_CMD 0xFFC03910 /* SDH Response Command */
51#define SDH_RESPONSE0 0xFFC03914 /* SDH Response0 */
52#define SDH_RESPONSE1 0xFFC03918 /* SDH Response1 */
53#define SDH_RESPONSE2 0xFFC0391C /* SDH Response2 */
54#define SDH_RESPONSE3 0xFFC03920 /* SDH Response3 */
55#define SDH_DATA_TIMER 0xFFC03924 /* SDH Data Timer */
56#define SDH_DATA_LGTH 0xFFC03928 /* SDH Data Length */
57#define SDH_DATA_CTL 0xFFC0392C /* SDH Data Control */
58#define SDH_DATA_CNT 0xFFC03930 /* SDH Data Counter */
59#define SDH_STATUS 0xFFC03934 /* SDH Status */
60#define SDH_STATUS_CLR 0xFFC03938 /* SDH Status Clear */
61#define SDH_MASK0 0xFFC0393C /* SDH Interrupt0 Mask */
62#define SDH_MASK1 0xFFC03940 /* SDH Interrupt1 Mask */
63#define SDH_FIFO_CNT 0xFFC03948 /* SDH FIFO Counter */
64#define SDH_FIFO 0xFFC03980 /* SDH Data FIFO */
65#define SDH_E_STATUS 0xFFC039C0 /* SDH Exception Status */
66#define SDH_E_MASK 0xFFC039C4 /* SDH Exception Mask */
67#define SDH_CFG 0xFFC039C8 /* SDH Configuration */
68#define SDH_RD_WAIT_EN 0xFFC039CC /* SDH Read Wait Enable */
69#define SDH_PID0 0xFFC039D0 /* SDH Peripheral Identification0 */
70#define SDH_PID1 0xFFC039D4 /* SDH Peripheral Identification1 */
71#define SDH_PID2 0xFFC039D8 /* SDH Peripheral Identification2 */
72#define SDH_PID3 0xFFC039DC /* SDH Peripheral Identification3 */
73#define SDH_PID4 0xFFC039E0 /* SDH Peripheral Identification4 */
74#define SDH_PID5 0xFFC039E4 /* SDH Peripheral Identification5 */
75#define SDH_PID6 0xFFC039E8 /* SDH Peripheral Identification6 */
76#define SDH_PID7 0xFFC039EC /* SDH Peripheral Identification7 */
77
78/* Removable Storage Interface Registers */
79
80#define RSI_PWR_CONTROL 0xFFC03800 /* RSI Power Control Register */
81#define RSI_CLK_CONTROL 0xFFC03804 /* RSI Clock Control Register */
82#define RSI_ARGUMENT 0xFFC03808 /* RSI Argument Register */
83#define RSI_COMMAND 0xFFC0380C /* RSI Command Register */
84#define RSI_RESP_CMD 0xFFC03810 /* RSI Response Command Register */
85#define RSI_RESPONSE0 0xFFC03814 /* RSI Response Register */
86#define RSI_RESPONSE1 0xFFC03818 /* RSI Response Register */
87#define RSI_RESPONSE2 0xFFC0381C /* RSI Response Register */
88#define RSI_RESPONSE3 0xFFC03820 /* RSI Response Register */
89#define RSI_DATA_TIMER 0xFFC03824 /* RSI Data Timer Register */
90#define RSI_DATA_LGTH 0xFFC03828 /* RSI Data Length Register */
91#define RSI_DATA_CONTROL 0xFFC0382C /* RSI Data Control Register */
92#define RSI_DATA_CNT 0xFFC03830 /* RSI Data Counter Register */
93#define RSI_STATUS 0xFFC03834 /* RSI Status Register */
94#define RSI_STATUSCL 0xFFC03838 /* RSI Status Clear Register */
95#define RSI_MASK0 0xFFC0383C /* RSI Interrupt 0 Mask Register */
96#define RSI_MASK1 0xFFC03840 /* RSI Interrupt 1 Mask Register */
97#define RSI_FIFO_CNT 0xFFC03848 /* RSI FIFO Counter Register */
98#define RSI_CEATA_CONTROL 0xFFC0384C /* RSI CEATA Register */
99#define RSI_FIFO 0xFFC03880 /* RSI Data FIFO Register */
100#define RSI_ESTAT 0xFFC038C0 /* RSI Exception Status Register */
101#define RSI_EMASK 0xFFC038C4 /* RSI Exception Mask Register */
102#define RSI_CONFIG 0xFFC038C8 /* RSI Configuration Register */
103#define RSI_RD_WAIT_EN 0xFFC038CC /* RSI Read Wait Enable Register */
104#define RSI_PID0 0xFFC03FE0 /* RSI Peripheral ID Register 0 */
105#define RSI_PID1 0xFFC03FE4 /* RSI Peripheral ID Register 1 */
106#define RSI_PID2 0xFFC03FE8 /* RSI Peripheral ID Register 2 */
107#define RSI_PID3 0xFFC03FEC /* RSI Peripheral ID Register 3 */
108#define RSI_PID4 0xFFC03FF0 /* RSI Peripheral ID Register 4 */
109#define RSI_PID5 0xFFC03FF4 /* RSI Peripheral ID Register 5 */
110#define RSI_PID6 0xFFC03FF8 /* RSI Peripheral ID Register 6 */
111#define RSI_PID7 0xFFC03FFC /* RSI Peripheral ID Register 7 */
112
113#endif /* _DEF_BF514_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/defBF516.h b/arch/blackfin/mach-bf518/include/mach/defBF516.h
new file mode 100644
index 000000000000..149a269306c5
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/defBF516.h
@@ -0,0 +1,490 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/defBF516.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _DEF_BF516_H
32#define _DEF_BF516_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF516 */
38
39/* Include defBF51x_base.h for the set of #defines that are common to all ADSP-BF51x processors */
40#include "defBF51x_base.h"
41
42/* The following are the #defines needed by ADSP-BF516 that are not in the common header */
43/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
44
45#define EMAC_OPMODE 0xFFC03000 /* Operating Mode Register */
46#define EMAC_ADDRLO 0xFFC03004 /* Address Low (32 LSBs) Register */
47#define EMAC_ADDRHI 0xFFC03008 /* Address High (16 MSBs) Register */
48#define EMAC_HASHLO 0xFFC0300C /* Multicast Hash Table Low (Bins 31-0) Register */
49#define EMAC_HASHHI 0xFFC03010 /* Multicast Hash Table High (Bins 63-32) Register */
50#define EMAC_STAADD 0xFFC03014 /* Station Management Address Register */
51#define EMAC_STADAT 0xFFC03018 /* Station Management Data Register */
52#define EMAC_FLC 0xFFC0301C /* Flow Control Register */
53#define EMAC_VLAN1 0xFFC03020 /* VLAN1 Tag Register */
54#define EMAC_VLAN2 0xFFC03024 /* VLAN2 Tag Register */
55#define EMAC_WKUP_CTL 0xFFC0302C /* Wake-Up Control/Status Register */
56#define EMAC_WKUP_FFMSK0 0xFFC03030 /* Wake-Up Frame Filter 0 Byte Mask Register */
57#define EMAC_WKUP_FFMSK1 0xFFC03034 /* Wake-Up Frame Filter 1 Byte Mask Register */
58#define EMAC_WKUP_FFMSK2 0xFFC03038 /* Wake-Up Frame Filter 2 Byte Mask Register */
59#define EMAC_WKUP_FFMSK3 0xFFC0303C /* Wake-Up Frame Filter 3 Byte Mask Register */
60#define EMAC_WKUP_FFCMD 0xFFC03040 /* Wake-Up Frame Filter Commands Register */
61#define EMAC_WKUP_FFOFF 0xFFC03044 /* Wake-Up Frame Filter Offsets Register */
62#define EMAC_WKUP_FFCRC0 0xFFC03048 /* Wake-Up Frame Filter 0,1 CRC-16 Register */
63#define EMAC_WKUP_FFCRC1 0xFFC0304C /* Wake-Up Frame Filter 2,3 CRC-16 Register */
64
65#define EMAC_SYSCTL 0xFFC03060 /* EMAC System Control Register */
66#define EMAC_SYSTAT 0xFFC03064 /* EMAC System Status Register */
67#define EMAC_RX_STAT 0xFFC03068 /* RX Current Frame Status Register */
68#define EMAC_RX_STKY 0xFFC0306C /* RX Sticky Frame Status Register */
69#define EMAC_RX_IRQE 0xFFC03070 /* RX Frame Status Interrupt Enables Register */
70#define EMAC_TX_STAT 0xFFC03074 /* TX Current Frame Status Register */
71#define EMAC_TX_STKY 0xFFC03078 /* TX Sticky Frame Status Register */
72#define EMAC_TX_IRQE 0xFFC0307C /* TX Frame Status Interrupt Enables Register */
73
74#define EMAC_MMC_CTL 0xFFC03080 /* MMC Counter Control Register */
75#define EMAC_MMC_RIRQS 0xFFC03084 /* MMC RX Interrupt Status Register */
76#define EMAC_MMC_RIRQE 0xFFC03088 /* MMC RX Interrupt Enables Register */
77#define EMAC_MMC_TIRQS 0xFFC0308C /* MMC TX Interrupt Status Register */
78#define EMAC_MMC_TIRQE 0xFFC03090 /* MMC TX Interrupt Enables Register */
79
80#define EMAC_RXC_OK 0xFFC03100 /* RX Frame Successful Count */
81#define EMAC_RXC_FCS 0xFFC03104 /* RX Frame FCS Failure Count */
82#define EMAC_RXC_ALIGN 0xFFC03108 /* RX Alignment Error Count */
83#define EMAC_RXC_OCTET 0xFFC0310C /* RX Octets Successfully Received Count */
84#define EMAC_RXC_DMAOVF 0xFFC03110 /* Internal MAC Sublayer Error RX Frame Count */
85#define EMAC_RXC_UNICST 0xFFC03114 /* Unicast RX Frame Count */
86#define EMAC_RXC_MULTI 0xFFC03118 /* Multicast RX Frame Count */
87#define EMAC_RXC_BROAD 0xFFC0311C /* Broadcast RX Frame Count */
88#define EMAC_RXC_LNERRI 0xFFC03120 /* RX Frame In Range Error Count */
89#define EMAC_RXC_LNERRO 0xFFC03124 /* RX Frame Out Of Range Error Count */
90#define EMAC_RXC_LONG 0xFFC03128 /* RX Frame Too Long Count */
91#define EMAC_RXC_MACCTL 0xFFC0312C /* MAC Control RX Frame Count */
92#define EMAC_RXC_OPCODE 0xFFC03130 /* Unsupported Op-Code RX Frame Count */
93#define EMAC_RXC_PAUSE 0xFFC03134 /* MAC Control Pause RX Frame Count */
94#define EMAC_RXC_ALLFRM 0xFFC03138 /* Overall RX Frame Count */
95#define EMAC_RXC_ALLOCT 0xFFC0313C /* Overall RX Octet Count */
96#define EMAC_RXC_TYPED 0xFFC03140 /* Type/Length Consistent RX Frame Count */
97#define EMAC_RXC_SHORT 0xFFC03144 /* RX Frame Fragment Count - Byte Count x < 64 */
98#define EMAC_RXC_EQ64 0xFFC03148 /* Good RX Frame Count - Byte Count x = 64 */
99#define EMAC_RXC_LT128 0xFFC0314C /* Good RX Frame Count - Byte Count 64 < x < 128 */
100#define EMAC_RXC_LT256 0xFFC03150 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
101#define EMAC_RXC_LT512 0xFFC03154 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
102#define EMAC_RXC_LT1024 0xFFC03158 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
103#define EMAC_RXC_GE1024 0xFFC0315C /* Good RX Frame Count - Byte Count x >= 1024 */
104
105#define EMAC_TXC_OK 0xFFC03180 /* TX Frame Successful Count */
106#define EMAC_TXC_1COL 0xFFC03184 /* TX Frames Successful After Single Collision Count */
107#define EMAC_TXC_GT1COL 0xFFC03188 /* TX Frames Successful After Multiple Collisions Count */
108#define EMAC_TXC_OCTET 0xFFC0318C /* TX Octets Successfully Received Count */
109#define EMAC_TXC_DEFER 0xFFC03190 /* TX Frame Delayed Due To Busy Count */
110#define EMAC_TXC_LATECL 0xFFC03194 /* Late TX Collisions Count */
111#define EMAC_TXC_XS_COL 0xFFC03198 /* TX Frame Failed Due To Excessive Collisions Count */
112#define EMAC_TXC_DMAUND 0xFFC0319C /* Internal MAC Sublayer Error TX Frame Count */
113#define EMAC_TXC_CRSERR 0xFFC031A0 /* Carrier Sense Deasserted During TX Frame Count */
114#define EMAC_TXC_UNICST 0xFFC031A4 /* Unicast TX Frame Count */
115#define EMAC_TXC_MULTI 0xFFC031A8 /* Multicast TX Frame Count */
116#define EMAC_TXC_BROAD 0xFFC031AC /* Broadcast TX Frame Count */
117#define EMAC_TXC_XS_DFR 0xFFC031B0 /* TX Frames With Excessive Deferral Count */
118#define EMAC_TXC_MACCTL 0xFFC031B4 /* MAC Control TX Frame Count */
119#define EMAC_TXC_ALLFRM 0xFFC031B8 /* Overall TX Frame Count */
120#define EMAC_TXC_ALLOCT 0xFFC031BC /* Overall TX Octet Count */
121#define EMAC_TXC_EQ64 0xFFC031C0 /* Good TX Frame Count - Byte Count x = 64 */
122#define EMAC_TXC_LT128 0xFFC031C4 /* Good TX Frame Count - Byte Count 64 < x < 128 */
123#define EMAC_TXC_LT256 0xFFC031C8 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
124#define EMAC_TXC_LT512 0xFFC031CC /* Good TX Frame Count - Byte Count 256 <= x < 512 */
125#define EMAC_TXC_LT1024 0xFFC031D0 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
126#define EMAC_TXC_GE1024 0xFFC031D4 /* Good TX Frame Count - Byte Count x >= 1024 */
127#define EMAC_TXC_ABORT 0xFFC031D8 /* Total TX Frames Aborted Count */
128
129/* Listing for IEEE-Supported Count Registers */
130
131#define FramesReceivedOK EMAC_RXC_OK /* RX Frame Successful Count */
132#define FrameCheckSequenceErrors EMAC_RXC_FCS /* RX Frame FCS Failure Count */
133#define AlignmentErrors EMAC_RXC_ALIGN /* RX Alignment Error Count */
134#define OctetsReceivedOK EMAC_RXC_OCTET /* RX Octets Successfully Received Count */
135#define FramesLostDueToIntMACRcvError EMAC_RXC_DMAOVF /* Internal MAC Sublayer Error RX Frame Count */
136#define UnicastFramesReceivedOK EMAC_RXC_UNICST /* Unicast RX Frame Count */
137#define MulticastFramesReceivedOK EMAC_RXC_MULTI /* Multicast RX Frame Count */
138#define BroadcastFramesReceivedOK EMAC_RXC_BROAD /* Broadcast RX Frame Count */
139#define InRangeLengthErrors EMAC_RXC_LNERRI /* RX Frame In Range Error Count */
140#define OutOfRangeLengthField EMAC_RXC_LNERRO /* RX Frame Out Of Range Error Count */
141#define FrameTooLongErrors EMAC_RXC_LONG /* RX Frame Too Long Count */
142#define MACControlFramesReceived EMAC_RXC_MACCTL /* MAC Control RX Frame Count */
143#define UnsupportedOpcodesReceived EMAC_RXC_OPCODE /* Unsupported Op-Code RX Frame Count */
144#define PAUSEMACCtrlFramesReceived EMAC_RXC_PAUSE /* MAC Control Pause RX Frame Count */
145#define FramesReceivedAll EMAC_RXC_ALLFRM /* Overall RX Frame Count */
146#define OctetsReceivedAll EMAC_RXC_ALLOCT /* Overall RX Octet Count */
147#define TypedFramesReceived EMAC_RXC_TYPED /* Type/Length Consistent RX Frame Count */
148#define FramesLenLt64Received EMAC_RXC_SHORT /* RX Frame Fragment Count - Byte Count x < 64 */
149#define FramesLenEq64Received EMAC_RXC_EQ64 /* Good RX Frame Count - Byte Count x = 64 */
150#define FramesLen65_127Received EMAC_RXC_LT128 /* Good RX Frame Count - Byte Count 64 < x < 128 */
151#define FramesLen128_255Received EMAC_RXC_LT256 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
152#define FramesLen256_511Received EMAC_RXC_LT512 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
153#define FramesLen512_1023Received EMAC_RXC_LT1024 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
154#define FramesLen1024_MaxReceived EMAC_RXC_GE1024 /* Good RX Frame Count - Byte Count x >= 1024 */
155
156#define FramesTransmittedOK EMAC_TXC_OK /* TX Frame Successful Count */
157#define SingleCollisionFrames EMAC_TXC_1COL /* TX Frames Successful After Single Collision Count */
158#define MultipleCollisionFrames EMAC_TXC_GT1COL /* TX Frames Successful After Multiple Collisions Count */
159#define OctetsTransmittedOK EMAC_TXC_OCTET /* TX Octets Successfully Received Count */
160#define FramesWithDeferredXmissions EMAC_TXC_DEFER /* TX Frame Delayed Due To Busy Count */
161#define LateCollisions EMAC_TXC_LATECL /* Late TX Collisions Count */
162#define FramesAbortedDueToXSColls EMAC_TXC_XS_COL /* TX Frame Failed Due To Excessive Collisions Count */
163#define FramesLostDueToIntMacXmitError EMAC_TXC_DMAUND /* Internal MAC Sublayer Error TX Frame Count */
164#define CarrierSenseErrors EMAC_TXC_CRSERR /* Carrier Sense Deasserted During TX Frame Count */
165#define UnicastFramesXmittedOK EMAC_TXC_UNICST /* Unicast TX Frame Count */
166#define MulticastFramesXmittedOK EMAC_TXC_MULTI /* Multicast TX Frame Count */
167#define BroadcastFramesXmittedOK EMAC_TXC_BROAD /* Broadcast TX Frame Count */
168#define FramesWithExcessiveDeferral EMAC_TXC_XS_DFR /* TX Frames With Excessive Deferral Count */
169#define MACControlFramesTransmitted EMAC_TXC_MACCTL /* MAC Control TX Frame Count */
170#define FramesTransmittedAll EMAC_TXC_ALLFRM /* Overall TX Frame Count */
171#define OctetsTransmittedAll EMAC_TXC_ALLOCT /* Overall TX Octet Count */
172#define FramesLenEq64Transmitted EMAC_TXC_EQ64 /* Good TX Frame Count - Byte Count x = 64 */
173#define FramesLen65_127Transmitted EMAC_TXC_LT128 /* Good TX Frame Count - Byte Count 64 < x < 128 */
174#define FramesLen128_255Transmitted EMAC_TXC_LT256 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
175#define FramesLen256_511Transmitted EMAC_TXC_LT512 /* Good TX Frame Count - Byte Count 256 <= x < 512 */
176#define FramesLen512_1023Transmitted EMAC_TXC_LT1024 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
177#define FramesLen1024_MaxTransmitted EMAC_TXC_GE1024 /* Good TX Frame Count - Byte Count x >= 1024 */
178#define TxAbortedFrames EMAC_TXC_ABORT /* Total TX Frames Aborted Count */
179
180/***********************************************************************************
181** System MMR Register Bits And Macros
182**
183** Disclaimer: All macros are intended to make C and Assembly code more readable.
184** Use these macros carefully, as any that do left shifts for field
185** depositing will result in the lower order bits being destroyed. Any
186** macro that shifts left to properly position the bit-field should be
187** used as part of an OR to initialize a register and NOT as a dynamic
188** modifier UNLESS the lower order bits are saved and ORed back in when
189** the macro is used.
190*************************************************************************************/
191
192/************************ ETHERNET 10/100 CONTROLLER MASKS ************************/
193
194/* EMAC_OPMODE Masks */
195
196#define RE 0x00000001 /* Receiver Enable */
197#define ASTP 0x00000002 /* Enable Automatic Pad Stripping On RX Frames */
198#define HU 0x00000010 /* Hash Filter Unicast Address */
199#define HM 0x00000020 /* Hash Filter Multicast Address */
200#define PAM 0x00000040 /* Pass-All-Multicast Mode Enable */
201#define PR 0x00000080 /* Promiscuous Mode Enable */
202#define IFE 0x00000100 /* Inverse Filtering Enable */
203#define DBF 0x00000200 /* Disable Broadcast Frame Reception */
204#define PBF 0x00000400 /* Pass Bad Frames Enable */
205#define PSF 0x00000800 /* Pass Short Frames Enable */
206#define RAF 0x00001000 /* Receive-All Mode */
207#define TE 0x00010000 /* Transmitter Enable */
208#define DTXPAD 0x00020000 /* Disable Automatic TX Padding */
209#define DTXCRC 0x00040000 /* Disable Automatic TX CRC Generation */
210#define DC 0x00080000 /* Deferral Check */
211#define BOLMT 0x00300000 /* Back-Off Limit */
212#define BOLMT_10 0x00000000 /* 10-bit range */
213#define BOLMT_8 0x00100000 /* 8-bit range */
214#define BOLMT_4 0x00200000 /* 4-bit range */
215#define BOLMT_1 0x00300000 /* 1-bit range */
216#define DRTY 0x00400000 /* Disable TX Retry On Collision */
217#define LCTRE 0x00800000 /* Enable TX Retry On Late Collision */
218#define RMII 0x01000000 /* RMII/MII* Mode */
219#define RMII_10 0x02000000 /* Speed Select for RMII Port (10MBit/100MBit*) */
220#define FDMODE 0x04000000 /* Duplex Mode Enable (Full/Half*) */
221#define LB 0x08000000 /* Internal Loopback Enable */
222#define DRO 0x10000000 /* Disable Receive Own Frames (Half-Duplex Mode) */
223
224/* EMAC_STAADD Masks */
225
226#define STABUSY 0x00000001 /* Initiate Station Mgt Reg Access / STA Busy Stat */
227#define STAOP 0x00000002 /* Station Management Operation Code (Write/Read*) */
228#define STADISPRE 0x00000004 /* Disable Preamble Generation */
229#define STAIE 0x00000008 /* Station Mgt. Transfer Done Interrupt Enable */
230#define REGAD 0x000007C0 /* STA Register Address */
231#define PHYAD 0x0000F800 /* PHY Device Address */
232
233#define SET_REGAD(x) (((x)&0x1F)<< 6 ) /* Set STA Register Address */
234#define SET_PHYAD(x) (((x)&0x1F)<< 11 ) /* Set PHY Device Address */
235
236/* EMAC_STADAT Mask */
237
238#define STADATA 0x0000FFFF /* Station Management Data */
239
240/* EMAC_FLC Masks */
241
242#define FLCBUSY 0x00000001 /* Send Flow Ctrl Frame / Flow Ctrl Busy Status */
243#define FLCE 0x00000002 /* Flow Control Enable */
244#define PCF 0x00000004 /* Pass Control Frames */
245#define BKPRSEN 0x00000008 /* Enable Backpressure */
246#define FLCPAUSE 0xFFFF0000 /* Pause Time */
247
248#define SET_FLCPAUSE(x) (((x)&0xFFFF)<< 16) /* Set Pause Time */
249
250/* EMAC_WKUP_CTL Masks */
251
252#define CAPWKFRM 0x00000001 /* Capture Wake-Up Frames */
253#define MPKE 0x00000002 /* Magic Packet Enable */
254#define RWKE 0x00000004 /* Remote Wake-Up Frame Enable */
255#define GUWKE 0x00000008 /* Global Unicast Wake Enable */
256#define MPKS 0x00000020 /* Magic Packet Received Status */
257#define RWKS 0x00000F00 /* Wake-Up Frame Received Status, Filters 3:0 */
258
259/* EMAC_WKUP_FFCMD Masks */
260
261#define WF0_E 0x00000001 /* Enable Wake-Up Filter 0 */
262#define WF0_T 0x00000008 /* Wake-Up Filter 0 Addr Type (Multicast/Unicast*) */
263#define WF1_E 0x00000100 /* Enable Wake-Up Filter 1 */
264#define WF1_T 0x00000800 /* Wake-Up Filter 1 Addr Type (Multicast/Unicast*) */
265#define WF2_E 0x00010000 /* Enable Wake-Up Filter 2 */
266#define WF2_T 0x00080000 /* Wake-Up Filter 2 Addr Type (Multicast/Unicast*) */
267#define WF3_E 0x01000000 /* Enable Wake-Up Filter 3 */
268#define WF3_T 0x08000000 /* Wake-Up Filter 3 Addr Type (Multicast/Unicast*) */
269
270/* EMAC_WKUP_FFOFF Masks */
271
272#define WF0_OFF 0x000000FF /* Wake-Up Filter 0 Pattern Offset */
273#define WF1_OFF 0x0000FF00 /* Wake-Up Filter 1 Pattern Offset */
274#define WF2_OFF 0x00FF0000 /* Wake-Up Filter 2 Pattern Offset */
275#define WF3_OFF 0xFF000000 /* Wake-Up Filter 3 Pattern Offset */
276
277#define SET_WF0_OFF(x) (((x)&0xFF)<< 0 ) /* Set Wake-Up Filter 0 Byte Offset */
278#define SET_WF1_OFF(x) (((x)&0xFF)<< 8 ) /* Set Wake-Up Filter 1 Byte Offset */
279#define SET_WF2_OFF(x) (((x)&0xFF)<< 16 ) /* Set Wake-Up Filter 2 Byte Offset */
280#define SET_WF3_OFF(x) (((x)&0xFF)<< 24 ) /* Set Wake-Up Filter 3 Byte Offset */
281/* Set ALL Offsets */
282#define SET_WF_OFFS(x0,x1,x2,x3) (SET_WF0_OFF((x0))|SET_WF1_OFF((x1))|SET_WF2_OFF((x2))|SET_WF3_OFF((x3)))
283
284/* EMAC_WKUP_FFCRC0 Masks */
285
286#define WF0_CRC 0x0000FFFF /* Wake-Up Filter 0 Pattern CRC */
287#define WF1_CRC 0xFFFF0000 /* Wake-Up Filter 1 Pattern CRC */
288
289#define SET_WF0_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 0 Target CRC */
290#define SET_WF1_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 1 Target CRC */
291
292/* EMAC_WKUP_FFCRC1 Masks */
293
294#define WF2_CRC 0x0000FFFF /* Wake-Up Filter 2 Pattern CRC */
295#define WF3_CRC 0xFFFF0000 /* Wake-Up Filter 3 Pattern CRC */
296
297#define SET_WF2_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 2 Target CRC */
298#define SET_WF3_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 3 Target CRC */
299
300/* EMAC_SYSCTL Masks */
301
302#define PHYIE 0x00000001 /* PHY_INT Interrupt Enable */
303#define RXDWA 0x00000002 /* Receive Frame DMA Word Alignment (Odd/Even*) */
304#define RXCKS 0x00000004 /* Enable RX Frame TCP/UDP Checksum Computation */
305#define TXDWA 0x00000010 /* Transmit Frame DMA Word Alignment (Odd/Even*) */
306#define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */
307
308#define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */
309
310/* EMAC_SYSTAT Masks */
311
312#define PHYINT 0x00000001 /* PHY_INT Interrupt Status */
313#define MMCINT 0x00000002 /* MMC Counter Interrupt Status */
314#define RXFSINT 0x00000004 /* RX Frame-Status Interrupt Status */
315#define TXFSINT 0x00000008 /* TX Frame-Status Interrupt Status */
316#define WAKEDET 0x00000010 /* Wake-Up Detected Status */
317#define RXDMAERR 0x00000020 /* RX DMA Direction Error Status */
318#define TXDMAERR 0x00000040 /* TX DMA Direction Error Status */
319#define STMDONE 0x00000080 /* Station Mgt. Transfer Done Interrupt Status */
320
321/* EMAC_RX_STAT, EMAC_RX_STKY, and EMAC_RX_IRQE Masks */
322
323#define RX_FRLEN 0x000007FF /* Frame Length In Bytes */
324#define RX_COMP 0x00001000 /* RX Frame Complete */
325#define RX_OK 0x00002000 /* RX Frame Received With No Errors */
326#define RX_LONG 0x00004000 /* RX Frame Too Long Error */
327#define RX_ALIGN 0x00008000 /* RX Frame Alignment Error */
328#define RX_CRC 0x00010000 /* RX Frame CRC Error */
329#define RX_LEN 0x00020000 /* RX Frame Length Error */
330#define RX_FRAG 0x00040000 /* RX Frame Fragment Error */
331#define RX_ADDR 0x00080000 /* RX Frame Address Filter Failed Error */
332#define RX_DMAO 0x00100000 /* RX Frame DMA Overrun Error */
333#define RX_PHY 0x00200000 /* RX Frame PHY Error */
334#define RX_LATE 0x00400000 /* RX Frame Late Collision Error */
335#define RX_RANGE 0x00800000 /* RX Frame Length Field Out of Range Error */
336#define RX_MULTI 0x01000000 /* RX Multicast Frame Indicator */
337#define RX_BROAD 0x02000000 /* RX Broadcast Frame Indicator */
338#define RX_CTL 0x04000000 /* RX Control Frame Indicator */
339#define RX_UCTL 0x08000000 /* Unsupported RX Control Frame Indicator */
340#define RX_TYPE 0x10000000 /* RX Typed Frame Indicator */
341#define RX_VLAN1 0x20000000 /* RX VLAN1 Frame Indicator */
342#define RX_VLAN2 0x40000000 /* RX VLAN2 Frame Indicator */
343#define RX_ACCEPT 0x80000000 /* RX Frame Accepted Indicator */
344
345/* EMAC_TX_STAT, EMAC_TX_STKY, and EMAC_TX_IRQE Masks */
346
347#define TX_COMP 0x00000001 /* TX Frame Complete */
348#define TX_OK 0x00000002 /* TX Frame Sent With No Errors */
349#define TX_ECOLL 0x00000004 /* TX Frame Excessive Collision Error */
350#define TX_LATE 0x00000008 /* TX Frame Late Collision Error */
351#define TX_DMAU 0x00000010 /* TX Frame DMA Underrun Error (STAT) */
352#define TX_MACE 0x00000010 /* Internal MAC Error Detected (STKY and IRQE) */
353#define TX_EDEFER 0x00000020 /* TX Frame Excessive Deferral Error */
354#define TX_BROAD 0x00000040 /* TX Broadcast Frame Indicator */
355#define TX_MULTI 0x00000080 /* TX Multicast Frame Indicator */
356#define TX_CCNT 0x00000F00 /* TX Frame Collision Count */
357#define TX_DEFER 0x00001000 /* TX Frame Deferred Indicator */
358#define TX_CRS 0x00002000 /* TX Frame Carrier Sense Not Asserted Error */
359#define TX_LOSS 0x00004000 /* TX Frame Carrier Lost During TX Error */
360#define TX_RETRY 0x00008000 /* TX Frame Successful After Retry */
361#define TX_FRLEN 0x07FF0000 /* TX Frame Length (Bytes) */
362
363/* EMAC_MMC_CTL Masks */
364#define RSTC 0x00000001 /* Reset All Counters */
365#define CROLL 0x00000002 /* Counter Roll-Over Enable */
366#define CCOR 0x00000004 /* Counter Clear-On-Read Mode Enable */
367#define MMCE 0x00000008 /* Enable MMC Counter Operation */
368
369/* EMAC_MMC_RIRQS and EMAC_MMC_RIRQE Masks */
370#define RX_OK_CNT 0x00000001 /* RX Frames Received With No Errors */
371#define RX_FCS_CNT 0x00000002 /* RX Frames W/Frame Check Sequence Errors */
372#define RX_ALIGN_CNT 0x00000004 /* RX Frames With Alignment Errors */
373#define RX_OCTET_CNT 0x00000008 /* RX Octets Received OK */
374#define RX_LOST_CNT 0x00000010 /* RX Frames Lost Due To Internal MAC RX Error */
375#define RX_UNI_CNT 0x00000020 /* Unicast RX Frames Received OK */
376#define RX_MULTI_CNT 0x00000040 /* Multicast RX Frames Received OK */
377#define RX_BROAD_CNT 0x00000080 /* Broadcast RX Frames Received OK */
378#define RX_IRL_CNT 0x00000100 /* RX Frames With In-Range Length Errors */
379#define RX_ORL_CNT 0x00000200 /* RX Frames With Out-Of-Range Length Errors */
380#define RX_LONG_CNT 0x00000400 /* RX Frames With Frame Too Long Errors */
381#define RX_MACCTL_CNT 0x00000800 /* MAC Control RX Frames Received */
382#define RX_OPCODE_CTL 0x00001000 /* Unsupported Op-Code RX Frames Received */
383#define RX_PAUSE_CNT 0x00002000 /* PAUSEMAC Control RX Frames Received */
384#define RX_ALLF_CNT 0x00004000 /* All RX Frames Received */
385#define RX_ALLO_CNT 0x00008000 /* All RX Octets Received */
386#define RX_TYPED_CNT 0x00010000 /* Typed RX Frames Received */
387#define RX_SHORT_CNT 0x00020000 /* RX Frame Fragments (< 64 Bytes) Received */
388#define RX_EQ64_CNT 0x00040000 /* 64-Byte RX Frames Received */
389#define RX_LT128_CNT 0x00080000 /* 65-127-Byte RX Frames Received */
390#define RX_LT256_CNT 0x00100000 /* 128-255-Byte RX Frames Received */
391#define RX_LT512_CNT 0x00200000 /* 256-511-Byte RX Frames Received */
392#define RX_LT1024_CNT 0x00400000 /* 512-1023-Byte RX Frames Received */
393#define RX_GE1024_CNT 0x00800000 /* 1024-Max-Byte RX Frames Received */
394
395/* EMAC_MMC_TIRQS and EMAC_MMC_TIRQE Masks */
396
397#define TX_OK_CNT 0x00000001 /* TX Frames Sent OK */
398#define TX_SCOLL_CNT 0x00000002 /* TX Frames With Single Collisions */
399#define TX_MCOLL_CNT 0x00000004 /* TX Frames With Multiple Collisions */
400#define TX_OCTET_CNT 0x00000008 /* TX Octets Sent OK */
401#define TX_DEFER_CNT 0x00000010 /* TX Frames With Deferred Transmission */
402#define TX_LATE_CNT 0x00000020 /* TX Frames With Late Collisions */
403#define TX_ABORTC_CNT 0x00000040 /* TX Frames Aborted Due To Excess Collisions */
404#define TX_LOST_CNT 0x00000080 /* TX Frames Lost Due To Internal MAC TX Error */
405#define TX_CRS_CNT 0x00000100 /* TX Frames With Carrier Sense Errors */
406#define TX_UNI_CNT 0x00000200 /* Unicast TX Frames Sent */
407#define TX_MULTI_CNT 0x00000400 /* Multicast TX Frames Sent */
408#define TX_BROAD_CNT 0x00000800 /* Broadcast TX Frames Sent */
409#define TX_EXDEF_CTL 0x00001000 /* TX Frames With Excessive Deferral */
410#define TX_MACCTL_CNT 0x00002000 /* MAC Control TX Frames Sent */
411#define TX_ALLF_CNT 0x00004000 /* All TX Frames Sent */
412#define TX_ALLO_CNT 0x00008000 /* All TX Octets Sent */
413#define TX_EQ64_CNT 0x00010000 /* 64-Byte TX Frames Sent */
414#define TX_LT128_CNT 0x00020000 /* 65-127-Byte TX Frames Sent */
415#define TX_LT256_CNT 0x00040000 /* 128-255-Byte TX Frames Sent */
416#define TX_LT512_CNT 0x00080000 /* 256-511-Byte TX Frames Sent */
417#define TX_LT1024_CNT 0x00100000 /* 512-1023-Byte TX Frames Sent */
418#define TX_GE1024_CNT 0x00200000 /* 1024-Max-Byte TX Frames Sent */
419#define TX_ABORT_CNT 0x00400000 /* TX Frames Aborted */
420
421/* SDH Registers */
422
423#define SDH_PWR_CTL 0xFFC03900 /* SDH Power Control */
424#define SDH_CLK_CTL 0xFFC03904 /* SDH Clock Control */
425#define SDH_ARGUMENT 0xFFC03908 /* SDH Argument */
426#define SDH_COMMAND 0xFFC0390C /* SDH Command */
427#define SDH_RESP_CMD 0xFFC03910 /* SDH Response Command */
428#define SDH_RESPONSE0 0xFFC03914 /* SDH Response0 */
429#define SDH_RESPONSE1 0xFFC03918 /* SDH Response1 */
430#define SDH_RESPONSE2 0xFFC0391C /* SDH Response2 */
431#define SDH_RESPONSE3 0xFFC03920 /* SDH Response3 */
432#define SDH_DATA_TIMER 0xFFC03924 /* SDH Data Timer */
433#define SDH_DATA_LGTH 0xFFC03928 /* SDH Data Length */
434#define SDH_DATA_CTL 0xFFC0392C /* SDH Data Control */
435#define SDH_DATA_CNT 0xFFC03930 /* SDH Data Counter */
436#define SDH_STATUS 0xFFC03934 /* SDH Status */
437#define SDH_STATUS_CLR 0xFFC03938 /* SDH Status Clear */
438#define SDH_MASK0 0xFFC0393C /* SDH Interrupt0 Mask */
439#define SDH_MASK1 0xFFC03940 /* SDH Interrupt1 Mask */
440#define SDH_FIFO_CNT 0xFFC03948 /* SDH FIFO Counter */
441#define SDH_FIFO 0xFFC03980 /* SDH Data FIFO */
442#define SDH_E_STATUS 0xFFC039C0 /* SDH Exception Status */
443#define SDH_E_MASK 0xFFC039C4 /* SDH Exception Mask */
444#define SDH_CFG 0xFFC039C8 /* SDH Configuration */
445#define SDH_RD_WAIT_EN 0xFFC039CC /* SDH Read Wait Enable */
446#define SDH_PID0 0xFFC039D0 /* SDH Peripheral Identification0 */
447#define SDH_PID1 0xFFC039D4 /* SDH Peripheral Identification1 */
448#define SDH_PID2 0xFFC039D8 /* SDH Peripheral Identification2 */
449#define SDH_PID3 0xFFC039DC /* SDH Peripheral Identification3 */
450#define SDH_PID4 0xFFC039E0 /* SDH Peripheral Identification4 */
451#define SDH_PID5 0xFFC039E4 /* SDH Peripheral Identification5 */
452#define SDH_PID6 0xFFC039E8 /* SDH Peripheral Identification6 */
453#define SDH_PID7 0xFFC039EC /* SDH Peripheral Identification7 */
454
455/* Removable Storage Interface Registers */
456
457#define RSI_PWR_CONTROL 0xFFC03800 /* RSI Power Control Register */
458#define RSI_CLK_CONTROL 0xFFC03804 /* RSI Clock Control Register */
459#define RSI_ARGUMENT 0xFFC03808 /* RSI Argument Register */
460#define RSI_COMMAND 0xFFC0380C /* RSI Command Register */
461#define RSI_RESP_CMD 0xFFC03810 /* RSI Response Command Register */
462#define RSI_RESPONSE0 0xFFC03814 /* RSI Response Register */
463#define RSI_RESPONSE1 0xFFC03818 /* RSI Response Register */
464#define RSI_RESPONSE2 0xFFC0381C /* RSI Response Register */
465#define RSI_RESPONSE3 0xFFC03820 /* RSI Response Register */
466#define RSI_DATA_TIMER 0xFFC03824 /* RSI Data Timer Register */
467#define RSI_DATA_LGTH 0xFFC03828 /* RSI Data Length Register */
468#define RSI_DATA_CONTROL 0xFFC0382C /* RSI Data Control Register */
469#define RSI_DATA_CNT 0xFFC03830 /* RSI Data Counter Register */
470#define RSI_STATUS 0xFFC03834 /* RSI Status Register */
471#define RSI_STATUSCL 0xFFC03838 /* RSI Status Clear Register */
472#define RSI_MASK0 0xFFC0383C /* RSI Interrupt 0 Mask Register */
473#define RSI_MASK1 0xFFC03840 /* RSI Interrupt 1 Mask Register */
474#define RSI_FIFO_CNT 0xFFC03848 /* RSI FIFO Counter Register */
475#define RSI_CEATA_CONTROL 0xFFC0384C /* RSI CEATA Register */
476#define RSI_FIFO 0xFFC03880 /* RSI Data FIFO Register */
477#define RSI_ESTAT 0xFFC038C0 /* RSI Exception Status Register */
478#define RSI_EMASK 0xFFC038C4 /* RSI Exception Mask Register */
479#define RSI_CONFIG 0xFFC038C8 /* RSI Configuration Register */
480#define RSI_RD_WAIT_EN 0xFFC038CC /* RSI Read Wait Enable Register */
481#define RSI_PID0 0xFFC03FE0 /* RSI Peripheral ID Register 0 */
482#define RSI_PID1 0xFFC03FE4 /* RSI Peripheral ID Register 1 */
483#define RSI_PID2 0xFFC03FE8 /* RSI Peripheral ID Register 2 */
484#define RSI_PID3 0xFFC03FEC /* RSI Peripheral ID Register 3 */
485#define RSI_PID4 0xFFC03FF0 /* RSI Peripheral ID Register 4 */
486#define RSI_PID5 0xFFC03FF4 /* RSI Peripheral ID Register 5 */
487#define RSI_PID6 0xFFC03FF8 /* RSI Peripheral ID Register 6 */
488#define RSI_PID7 0xFFC03FFC /* RSI Peripheral ID Register 7 */
489
490#endif /* _DEF_BF516_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/defBF518.h b/arch/blackfin/mach-bf518/include/mach/defBF518.h
new file mode 100644
index 000000000000..6e982abf4ede
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/defBF518.h
@@ -0,0 +1,651 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/defBF518.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _DEF_BF518_H
32#define _DEF_BF518_H
33
34/* Include all Core registers and bit definitions */
35#include <asm/def_LPBlackfin.h>
36
37/* SYSTEM & MMR ADDRESS DEFINITIONS FOR ADSP-BF518 */
38
39/* Include defBF51x_base.h for the set of #defines that are common to all ADSP-BF51x processors */
40#include "defBF51x_base.h"
41
42/* The following are the #defines needed by ADSP-BF518 that are not in the common header */
43/* 10/100 Ethernet Controller (0xFFC03000 - 0xFFC031FF) */
44
45#define EMAC_OPMODE 0xFFC03000 /* Operating Mode Register */
46#define EMAC_ADDRLO 0xFFC03004 /* Address Low (32 LSBs) Register */
47#define EMAC_ADDRHI 0xFFC03008 /* Address High (16 MSBs) Register */
48#define EMAC_HASHLO 0xFFC0300C /* Multicast Hash Table Low (Bins 31-0) Register */
49#define EMAC_HASHHI 0xFFC03010 /* Multicast Hash Table High (Bins 63-32) Register */
50#define EMAC_STAADD 0xFFC03014 /* Station Management Address Register */
51#define EMAC_STADAT 0xFFC03018 /* Station Management Data Register */
52#define EMAC_FLC 0xFFC0301C /* Flow Control Register */
53#define EMAC_VLAN1 0xFFC03020 /* VLAN1 Tag Register */
54#define EMAC_VLAN2 0xFFC03024 /* VLAN2 Tag Register */
55#define EMAC_WKUP_CTL 0xFFC0302C /* Wake-Up Control/Status Register */
56#define EMAC_WKUP_FFMSK0 0xFFC03030 /* Wake-Up Frame Filter 0 Byte Mask Register */
57#define EMAC_WKUP_FFMSK1 0xFFC03034 /* Wake-Up Frame Filter 1 Byte Mask Register */
58#define EMAC_WKUP_FFMSK2 0xFFC03038 /* Wake-Up Frame Filter 2 Byte Mask Register */
59#define EMAC_WKUP_FFMSK3 0xFFC0303C /* Wake-Up Frame Filter 3 Byte Mask Register */
60#define EMAC_WKUP_FFCMD 0xFFC03040 /* Wake-Up Frame Filter Commands Register */
61#define EMAC_WKUP_FFOFF 0xFFC03044 /* Wake-Up Frame Filter Offsets Register */
62#define EMAC_WKUP_FFCRC0 0xFFC03048 /* Wake-Up Frame Filter 0,1 CRC-16 Register */
63#define EMAC_WKUP_FFCRC1 0xFFC0304C /* Wake-Up Frame Filter 2,3 CRC-16 Register */
64
65#define EMAC_SYSCTL 0xFFC03060 /* EMAC System Control Register */
66#define EMAC_SYSTAT 0xFFC03064 /* EMAC System Status Register */
67#define EMAC_RX_STAT 0xFFC03068 /* RX Current Frame Status Register */
68#define EMAC_RX_STKY 0xFFC0306C /* RX Sticky Frame Status Register */
69#define EMAC_RX_IRQE 0xFFC03070 /* RX Frame Status Interrupt Enables Register */
70#define EMAC_TX_STAT 0xFFC03074 /* TX Current Frame Status Register */
71#define EMAC_TX_STKY 0xFFC03078 /* TX Sticky Frame Status Register */
72#define EMAC_TX_IRQE 0xFFC0307C /* TX Frame Status Interrupt Enables Register */
73
74#define EMAC_MMC_CTL 0xFFC03080 /* MMC Counter Control Register */
75#define EMAC_MMC_RIRQS 0xFFC03084 /* MMC RX Interrupt Status Register */
76#define EMAC_MMC_RIRQE 0xFFC03088 /* MMC RX Interrupt Enables Register */
77#define EMAC_MMC_TIRQS 0xFFC0308C /* MMC TX Interrupt Status Register */
78#define EMAC_MMC_TIRQE 0xFFC03090 /* MMC TX Interrupt Enables Register */
79
80#define EMAC_RXC_OK 0xFFC03100 /* RX Frame Successful Count */
81#define EMAC_RXC_FCS 0xFFC03104 /* RX Frame FCS Failure Count */
82#define EMAC_RXC_ALIGN 0xFFC03108 /* RX Alignment Error Count */
83#define EMAC_RXC_OCTET 0xFFC0310C /* RX Octets Successfully Received Count */
84#define EMAC_RXC_DMAOVF 0xFFC03110 /* Internal MAC Sublayer Error RX Frame Count */
85#define EMAC_RXC_UNICST 0xFFC03114 /* Unicast RX Frame Count */
86#define EMAC_RXC_MULTI 0xFFC03118 /* Multicast RX Frame Count */
87#define EMAC_RXC_BROAD 0xFFC0311C /* Broadcast RX Frame Count */
88#define EMAC_RXC_LNERRI 0xFFC03120 /* RX Frame In Range Error Count */
89#define EMAC_RXC_LNERRO 0xFFC03124 /* RX Frame Out Of Range Error Count */
90#define EMAC_RXC_LONG 0xFFC03128 /* RX Frame Too Long Count */
91#define EMAC_RXC_MACCTL 0xFFC0312C /* MAC Control RX Frame Count */
92#define EMAC_RXC_OPCODE 0xFFC03130 /* Unsupported Op-Code RX Frame Count */
93#define EMAC_RXC_PAUSE 0xFFC03134 /* MAC Control Pause RX Frame Count */
94#define EMAC_RXC_ALLFRM 0xFFC03138 /* Overall RX Frame Count */
95#define EMAC_RXC_ALLOCT 0xFFC0313C /* Overall RX Octet Count */
96#define EMAC_RXC_TYPED 0xFFC03140 /* Type/Length Consistent RX Frame Count */
97#define EMAC_RXC_SHORT 0xFFC03144 /* RX Frame Fragment Count - Byte Count x < 64 */
98#define EMAC_RXC_EQ64 0xFFC03148 /* Good RX Frame Count - Byte Count x = 64 */
99#define EMAC_RXC_LT128 0xFFC0314C /* Good RX Frame Count - Byte Count 64 < x < 128 */
100#define EMAC_RXC_LT256 0xFFC03150 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
101#define EMAC_RXC_LT512 0xFFC03154 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
102#define EMAC_RXC_LT1024 0xFFC03158 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
103#define EMAC_RXC_GE1024 0xFFC0315C /* Good RX Frame Count - Byte Count x >= 1024 */
104
105#define EMAC_TXC_OK 0xFFC03180 /* TX Frame Successful Count */
106#define EMAC_TXC_1COL 0xFFC03184 /* TX Frames Successful After Single Collision Count */
107#define EMAC_TXC_GT1COL 0xFFC03188 /* TX Frames Successful After Multiple Collisions Count */
108#define EMAC_TXC_OCTET 0xFFC0318C /* TX Octets Successfully Received Count */
109#define EMAC_TXC_DEFER 0xFFC03190 /* TX Frame Delayed Due To Busy Count */
110#define EMAC_TXC_LATECL 0xFFC03194 /* Late TX Collisions Count */
111#define EMAC_TXC_XS_COL 0xFFC03198 /* TX Frame Failed Due To Excessive Collisions Count */
112#define EMAC_TXC_DMAUND 0xFFC0319C /* Internal MAC Sublayer Error TX Frame Count */
113#define EMAC_TXC_CRSERR 0xFFC031A0 /* Carrier Sense Deasserted During TX Frame Count */
114#define EMAC_TXC_UNICST 0xFFC031A4 /* Unicast TX Frame Count */
115#define EMAC_TXC_MULTI 0xFFC031A8 /* Multicast TX Frame Count */
116#define EMAC_TXC_BROAD 0xFFC031AC /* Broadcast TX Frame Count */
117#define EMAC_TXC_XS_DFR 0xFFC031B0 /* TX Frames With Excessive Deferral Count */
118#define EMAC_TXC_MACCTL 0xFFC031B4 /* MAC Control TX Frame Count */
119#define EMAC_TXC_ALLFRM 0xFFC031B8 /* Overall TX Frame Count */
120#define EMAC_TXC_ALLOCT 0xFFC031BC /* Overall TX Octet Count */
121#define EMAC_TXC_EQ64 0xFFC031C0 /* Good TX Frame Count - Byte Count x = 64 */
122#define EMAC_TXC_LT128 0xFFC031C4 /* Good TX Frame Count - Byte Count 64 < x < 128 */
123#define EMAC_TXC_LT256 0xFFC031C8 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
124#define EMAC_TXC_LT512 0xFFC031CC /* Good TX Frame Count - Byte Count 256 <= x < 512 */
125#define EMAC_TXC_LT1024 0xFFC031D0 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
126#define EMAC_TXC_GE1024 0xFFC031D4 /* Good TX Frame Count - Byte Count x >= 1024 */
127#define EMAC_TXC_ABORT 0xFFC031D8 /* Total TX Frames Aborted Count */
128
129/* Listing for IEEE-Supported Count Registers */
130
131#define FramesReceivedOK EMAC_RXC_OK /* RX Frame Successful Count */
132#define FrameCheckSequenceErrors EMAC_RXC_FCS /* RX Frame FCS Failure Count */
133#define AlignmentErrors EMAC_RXC_ALIGN /* RX Alignment Error Count */
134#define OctetsReceivedOK EMAC_RXC_OCTET /* RX Octets Successfully Received Count */
135#define FramesLostDueToIntMACRcvError EMAC_RXC_DMAOVF /* Internal MAC Sublayer Error RX Frame Count */
136#define UnicastFramesReceivedOK EMAC_RXC_UNICST /* Unicast RX Frame Count */
137#define MulticastFramesReceivedOK EMAC_RXC_MULTI /* Multicast RX Frame Count */
138#define BroadcastFramesReceivedOK EMAC_RXC_BROAD /* Broadcast RX Frame Count */
139#define InRangeLengthErrors EMAC_RXC_LNERRI /* RX Frame In Range Error Count */
140#define OutOfRangeLengthField EMAC_RXC_LNERRO /* RX Frame Out Of Range Error Count */
141#define FrameTooLongErrors EMAC_RXC_LONG /* RX Frame Too Long Count */
142#define MACControlFramesReceived EMAC_RXC_MACCTL /* MAC Control RX Frame Count */
143#define UnsupportedOpcodesReceived EMAC_RXC_OPCODE /* Unsupported Op-Code RX Frame Count */
144#define PAUSEMACCtrlFramesReceived EMAC_RXC_PAUSE /* MAC Control Pause RX Frame Count */
145#define FramesReceivedAll EMAC_RXC_ALLFRM /* Overall RX Frame Count */
146#define OctetsReceivedAll EMAC_RXC_ALLOCT /* Overall RX Octet Count */
147#define TypedFramesReceived EMAC_RXC_TYPED /* Type/Length Consistent RX Frame Count */
148#define FramesLenLt64Received EMAC_RXC_SHORT /* RX Frame Fragment Count - Byte Count x < 64 */
149#define FramesLenEq64Received EMAC_RXC_EQ64 /* Good RX Frame Count - Byte Count x = 64 */
150#define FramesLen65_127Received EMAC_RXC_LT128 /* Good RX Frame Count - Byte Count 64 < x < 128 */
151#define FramesLen128_255Received EMAC_RXC_LT256 /* Good RX Frame Count - Byte Count 128 <= x < 256 */
152#define FramesLen256_511Received EMAC_RXC_LT512 /* Good RX Frame Count - Byte Count 256 <= x < 512 */
153#define FramesLen512_1023Received EMAC_RXC_LT1024 /* Good RX Frame Count - Byte Count 512 <= x < 1024 */
154#define FramesLen1024_MaxReceived EMAC_RXC_GE1024 /* Good RX Frame Count - Byte Count x >= 1024 */
155
156#define FramesTransmittedOK EMAC_TXC_OK /* TX Frame Successful Count */
157#define SingleCollisionFrames EMAC_TXC_1COL /* TX Frames Successful After Single Collision Count */
158#define MultipleCollisionFrames EMAC_TXC_GT1COL /* TX Frames Successful After Multiple Collisions Count */
159#define OctetsTransmittedOK EMAC_TXC_OCTET /* TX Octets Successfully Received Count */
160#define FramesWithDeferredXmissions EMAC_TXC_DEFER /* TX Frame Delayed Due To Busy Count */
161#define LateCollisions EMAC_TXC_LATECL /* Late TX Collisions Count */
162#define FramesAbortedDueToXSColls EMAC_TXC_XS_COL /* TX Frame Failed Due To Excessive Collisions Count */
163#define FramesLostDueToIntMacXmitError EMAC_TXC_DMAUND /* Internal MAC Sublayer Error TX Frame Count */
164#define CarrierSenseErrors EMAC_TXC_CRSERR /* Carrier Sense Deasserted During TX Frame Count */
165#define UnicastFramesXmittedOK EMAC_TXC_UNICST /* Unicast TX Frame Count */
166#define MulticastFramesXmittedOK EMAC_TXC_MULTI /* Multicast TX Frame Count */
167#define BroadcastFramesXmittedOK EMAC_TXC_BROAD /* Broadcast TX Frame Count */
168#define FramesWithExcessiveDeferral EMAC_TXC_XS_DFR /* TX Frames With Excessive Deferral Count */
169#define MACControlFramesTransmitted EMAC_TXC_MACCTL /* MAC Control TX Frame Count */
170#define FramesTransmittedAll EMAC_TXC_ALLFRM /* Overall TX Frame Count */
171#define OctetsTransmittedAll EMAC_TXC_ALLOCT /* Overall TX Octet Count */
172#define FramesLenEq64Transmitted EMAC_TXC_EQ64 /* Good TX Frame Count - Byte Count x = 64 */
173#define FramesLen65_127Transmitted EMAC_TXC_LT128 /* Good TX Frame Count - Byte Count 64 < x < 128 */
174#define FramesLen128_255Transmitted EMAC_TXC_LT256 /* Good TX Frame Count - Byte Count 128 <= x < 256 */
175#define FramesLen256_511Transmitted EMAC_TXC_LT512 /* Good TX Frame Count - Byte Count 256 <= x < 512 */
176#define FramesLen512_1023Transmitted EMAC_TXC_LT1024 /* Good TX Frame Count - Byte Count 512 <= x < 1024 */
177#define FramesLen1024_MaxTransmitted EMAC_TXC_GE1024 /* Good TX Frame Count - Byte Count x >= 1024 */
178#define TxAbortedFrames EMAC_TXC_ABORT /* Total TX Frames Aborted Count */
179
180/***********************************************************************************
181** System MMR Register Bits And Macros
182**
183** Disclaimer: All macros are intended to make C and Assembly code more readable.
184** Use these macros carefully, as any that do left shifts for field
185** depositing will result in the lower order bits being destroyed. Any
186** macro that shifts left to properly position the bit-field should be
187** used as part of an OR to initialize a register and NOT as a dynamic
188** modifier UNLESS the lower order bits are saved and ORed back in when
189** the macro is used.
190*************************************************************************************/
191
192/************************ ETHERNET 10/100 CONTROLLER MASKS ************************/
193
194/* EMAC_OPMODE Masks */
195
196#define RE 0x00000001 /* Receiver Enable */
197#define ASTP 0x00000002 /* Enable Automatic Pad Stripping On RX Frames */
198#define HU 0x00000010 /* Hash Filter Unicast Address */
199#define HM 0x00000020 /* Hash Filter Multicast Address */
200#define PAM 0x00000040 /* Pass-All-Multicast Mode Enable */
201#define PR 0x00000080 /* Promiscuous Mode Enable */
202#define IFE 0x00000100 /* Inverse Filtering Enable */
203#define DBF 0x00000200 /* Disable Broadcast Frame Reception */
204#define PBF 0x00000400 /* Pass Bad Frames Enable */
205#define PSF 0x00000800 /* Pass Short Frames Enable */
206#define RAF 0x00001000 /* Receive-All Mode */
207#define TE 0x00010000 /* Transmitter Enable */
208#define DTXPAD 0x00020000 /* Disable Automatic TX Padding */
209#define DTXCRC 0x00040000 /* Disable Automatic TX CRC Generation */
210#define DC 0x00080000 /* Deferral Check */
211#define BOLMT 0x00300000 /* Back-Off Limit */
212#define BOLMT_10 0x00000000 /* 10-bit range */
213#define BOLMT_8 0x00100000 /* 8-bit range */
214#define BOLMT_4 0x00200000 /* 4-bit range */
215#define BOLMT_1 0x00300000 /* 1-bit range */
216#define DRTY 0x00400000 /* Disable TX Retry On Collision */
217#define LCTRE 0x00800000 /* Enable TX Retry On Late Collision */
218#define RMII 0x01000000 /* RMII/MII* Mode */
219#define RMII_10 0x02000000 /* Speed Select for RMII Port (10MBit/100MBit*) */
220#define FDMODE 0x04000000 /* Duplex Mode Enable (Full/Half*) */
221#define LB 0x08000000 /* Internal Loopback Enable */
222#define DRO 0x10000000 /* Disable Receive Own Frames (Half-Duplex Mode) */
223
224/* EMAC_STAADD Masks */
225
226#define STABUSY 0x00000001 /* Initiate Station Mgt Reg Access / STA Busy Stat */
227#define STAOP 0x00000002 /* Station Management Operation Code (Write/Read*) */
228#define STADISPRE 0x00000004 /* Disable Preamble Generation */
229#define STAIE 0x00000008 /* Station Mgt. Transfer Done Interrupt Enable */
230#define REGAD 0x000007C0 /* STA Register Address */
231#define PHYAD 0x0000F800 /* PHY Device Address */
232
233#define SET_REGAD(x) (((x)&0x1F)<< 6 ) /* Set STA Register Address */
234#define SET_PHYAD(x) (((x)&0x1F)<< 11 ) /* Set PHY Device Address */
235
236/* EMAC_STADAT Mask */
237
238#define STADATA 0x0000FFFF /* Station Management Data */
239
240/* EMAC_FLC Masks */
241
242#define FLCBUSY 0x00000001 /* Send Flow Ctrl Frame / Flow Ctrl Busy Status */
243#define FLCE 0x00000002 /* Flow Control Enable */
244#define PCF 0x00000004 /* Pass Control Frames */
245#define BKPRSEN 0x00000008 /* Enable Backpressure */
246#define FLCPAUSE 0xFFFF0000 /* Pause Time */
247
248#define SET_FLCPAUSE(x) (((x)&0xFFFF)<< 16) /* Set Pause Time */
249
250/* EMAC_WKUP_CTL Masks */
251
252#define CAPWKFRM 0x00000001 /* Capture Wake-Up Frames */
253#define MPKE 0x00000002 /* Magic Packet Enable */
254#define RWKE 0x00000004 /* Remote Wake-Up Frame Enable */
255#define GUWKE 0x00000008 /* Global Unicast Wake Enable */
256#define MPKS 0x00000020 /* Magic Packet Received Status */
257#define RWKS 0x00000F00 /* Wake-Up Frame Received Status, Filters 3:0 */
258
259/* EMAC_WKUP_FFCMD Masks */
260
261#define WF0_E 0x00000001 /* Enable Wake-Up Filter 0 */
262#define WF0_T 0x00000008 /* Wake-Up Filter 0 Addr Type (Multicast/Unicast*) */
263#define WF1_E 0x00000100 /* Enable Wake-Up Filter 1 */
264#define WF1_T 0x00000800 /* Wake-Up Filter 1 Addr Type (Multicast/Unicast*) */
265#define WF2_E 0x00010000 /* Enable Wake-Up Filter 2 */
266#define WF2_T 0x00080000 /* Wake-Up Filter 2 Addr Type (Multicast/Unicast*) */
267#define WF3_E 0x01000000 /* Enable Wake-Up Filter 3 */
268#define WF3_T 0x08000000 /* Wake-Up Filter 3 Addr Type (Multicast/Unicast*) */
269
270/* EMAC_WKUP_FFOFF Masks */
271
272#define WF0_OFF 0x000000FF /* Wake-Up Filter 0 Pattern Offset */
273#define WF1_OFF 0x0000FF00 /* Wake-Up Filter 1 Pattern Offset */
274#define WF2_OFF 0x00FF0000 /* Wake-Up Filter 2 Pattern Offset */
275#define WF3_OFF 0xFF000000 /* Wake-Up Filter 3 Pattern Offset */
276
277#define SET_WF0_OFF(x) (((x)&0xFF)<< 0 ) /* Set Wake-Up Filter 0 Byte Offset */
278#define SET_WF1_OFF(x) (((x)&0xFF)<< 8 ) /* Set Wake-Up Filter 1 Byte Offset */
279#define SET_WF2_OFF(x) (((x)&0xFF)<< 16 ) /* Set Wake-Up Filter 2 Byte Offset */
280#define SET_WF3_OFF(x) (((x)&0xFF)<< 24 ) /* Set Wake-Up Filter 3 Byte Offset */
281/* Set ALL Offsets */
282#define SET_WF_OFFS(x0,x1,x2,x3) (SET_WF0_OFF((x0))|SET_WF1_OFF((x1))|SET_WF2_OFF((x2))|SET_WF3_OFF((x3)))
283
284/* EMAC_WKUP_FFCRC0 Masks */
285
286#define WF0_CRC 0x0000FFFF /* Wake-Up Filter 0 Pattern CRC */
287#define WF1_CRC 0xFFFF0000 /* Wake-Up Filter 1 Pattern CRC */
288
289#define SET_WF0_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 0 Target CRC */
290#define SET_WF1_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 1 Target CRC */
291
292/* EMAC_WKUP_FFCRC1 Masks */
293
294#define WF2_CRC 0x0000FFFF /* Wake-Up Filter 2 Pattern CRC */
295#define WF3_CRC 0xFFFF0000 /* Wake-Up Filter 3 Pattern CRC */
296
297#define SET_WF2_CRC(x) (((x)&0xFFFF)<< 0 ) /* Set Wake-Up Filter 2 Target CRC */
298#define SET_WF3_CRC(x) (((x)&0xFFFF)<< 16 ) /* Set Wake-Up Filter 3 Target CRC */
299
300/* EMAC_SYSCTL Masks */
301
302#define PHYIE 0x00000001 /* PHY_INT Interrupt Enable */
303#define RXDWA 0x00000002 /* Receive Frame DMA Word Alignment (Odd/Even*) */
304#define RXCKS 0x00000004 /* Enable RX Frame TCP/UDP Checksum Computation */
305#define TXDWA 0x00000010 /* Transmit Frame DMA Word Alignment (Odd/Even*) */
306#define MDCDIV 0x00003F00 /* SCLK:MDC Clock Divisor [MDC=SCLK/(2*(N+1))] */
307
308#define SET_MDCDIV(x) (((x)&0x3F)<< 8) /* Set MDC Clock Divisor */
309
310/* EMAC_SYSTAT Masks */
311
312#define PHYINT 0x00000001 /* PHY_INT Interrupt Status */
313#define MMCINT 0x00000002 /* MMC Counter Interrupt Status */
314#define RXFSINT 0x00000004 /* RX Frame-Status Interrupt Status */
315#define TXFSINT 0x00000008 /* TX Frame-Status Interrupt Status */
316#define WAKEDET 0x00000010 /* Wake-Up Detected Status */
317#define RXDMAERR 0x00000020 /* RX DMA Direction Error Status */
318#define TXDMAERR 0x00000040 /* TX DMA Direction Error Status */
319#define STMDONE 0x00000080 /* Station Mgt. Transfer Done Interrupt Status */
320
321/* EMAC_RX_STAT, EMAC_RX_STKY, and EMAC_RX_IRQE Masks */
322
323#define RX_FRLEN 0x000007FF /* Frame Length In Bytes */
324#define RX_COMP 0x00001000 /* RX Frame Complete */
325#define RX_OK 0x00002000 /* RX Frame Received With No Errors */
326#define RX_LONG 0x00004000 /* RX Frame Too Long Error */
327#define RX_ALIGN 0x00008000 /* RX Frame Alignment Error */
328#define RX_CRC 0x00010000 /* RX Frame CRC Error */
329#define RX_LEN 0x00020000 /* RX Frame Length Error */
330#define RX_FRAG 0x00040000 /* RX Frame Fragment Error */
331#define RX_ADDR 0x00080000 /* RX Frame Address Filter Failed Error */
332#define RX_DMAO 0x00100000 /* RX Frame DMA Overrun Error */
333#define RX_PHY 0x00200000 /* RX Frame PHY Error */
334#define RX_LATE 0x00400000 /* RX Frame Late Collision Error */
335#define RX_RANGE 0x00800000 /* RX Frame Length Field Out of Range Error */
336#define RX_MULTI 0x01000000 /* RX Multicast Frame Indicator */
337#define RX_BROAD 0x02000000 /* RX Broadcast Frame Indicator */
338#define RX_CTL 0x04000000 /* RX Control Frame Indicator */
339#define RX_UCTL 0x08000000 /* Unsupported RX Control Frame Indicator */
340#define RX_TYPE 0x10000000 /* RX Typed Frame Indicator */
341#define RX_VLAN1 0x20000000 /* RX VLAN1 Frame Indicator */
342#define RX_VLAN2 0x40000000 /* RX VLAN2 Frame Indicator */
343#define RX_ACCEPT 0x80000000 /* RX Frame Accepted Indicator */
344
345/* EMAC_TX_STAT, EMAC_TX_STKY, and EMAC_TX_IRQE Masks */
346
347#define TX_COMP 0x00000001 /* TX Frame Complete */
348#define TX_OK 0x00000002 /* TX Frame Sent With No Errors */
349#define TX_ECOLL 0x00000004 /* TX Frame Excessive Collision Error */
350#define TX_LATE 0x00000008 /* TX Frame Late Collision Error */
351#define TX_DMAU 0x00000010 /* TX Frame DMA Underrun Error (STAT) */
352#define TX_MACE 0x00000010 /* Internal MAC Error Detected (STKY and IRQE) */
353#define TX_EDEFER 0x00000020 /* TX Frame Excessive Deferral Error */
354#define TX_BROAD 0x00000040 /* TX Broadcast Frame Indicator */
355#define TX_MULTI 0x00000080 /* TX Multicast Frame Indicator */
356#define TX_CCNT 0x00000F00 /* TX Frame Collision Count */
357#define TX_DEFER 0x00001000 /* TX Frame Deferred Indicator */
358#define TX_CRS 0x00002000 /* TX Frame Carrier Sense Not Asserted Error */
359#define TX_LOSS 0x00004000 /* TX Frame Carrier Lost During TX Error */
360#define TX_RETRY 0x00008000 /* TX Frame Successful After Retry */
361#define TX_FRLEN 0x07FF0000 /* TX Frame Length (Bytes) */
362
363/* EMAC_MMC_CTL Masks */
364#define RSTC 0x00000001 /* Reset All Counters */
365#define CROLL 0x00000002 /* Counter Roll-Over Enable */
366#define CCOR 0x00000004 /* Counter Clear-On-Read Mode Enable */
367#define MMCE 0x00000008 /* Enable MMC Counter Operation */
368
369/* EMAC_MMC_RIRQS and EMAC_MMC_RIRQE Masks */
370#define RX_OK_CNT 0x00000001 /* RX Frames Received With No Errors */
371#define RX_FCS_CNT 0x00000002 /* RX Frames W/Frame Check Sequence Errors */
372#define RX_ALIGN_CNT 0x00000004 /* RX Frames With Alignment Errors */
373#define RX_OCTET_CNT 0x00000008 /* RX Octets Received OK */
374#define RX_LOST_CNT 0x00000010 /* RX Frames Lost Due To Internal MAC RX Error */
375#define RX_UNI_CNT 0x00000020 /* Unicast RX Frames Received OK */
376#define RX_MULTI_CNT 0x00000040 /* Multicast RX Frames Received OK */
377#define RX_BROAD_CNT 0x00000080 /* Broadcast RX Frames Received OK */
378#define RX_IRL_CNT 0x00000100 /* RX Frames With In-Range Length Errors */
379#define RX_ORL_CNT 0x00000200 /* RX Frames With Out-Of-Range Length Errors */
380#define RX_LONG_CNT 0x00000400 /* RX Frames With Frame Too Long Errors */
381#define RX_MACCTL_CNT 0x00000800 /* MAC Control RX Frames Received */
382#define RX_OPCODE_CTL 0x00001000 /* Unsupported Op-Code RX Frames Received */
383#define RX_PAUSE_CNT 0x00002000 /* PAUSEMAC Control RX Frames Received */
384#define RX_ALLF_CNT 0x00004000 /* All RX Frames Received */
385#define RX_ALLO_CNT 0x00008000 /* All RX Octets Received */
386#define RX_TYPED_CNT 0x00010000 /* Typed RX Frames Received */
387#define RX_SHORT_CNT 0x00020000 /* RX Frame Fragments (< 64 Bytes) Received */
388#define RX_EQ64_CNT 0x00040000 /* 64-Byte RX Frames Received */
389#define RX_LT128_CNT 0x00080000 /* 65-127-Byte RX Frames Received */
390#define RX_LT256_CNT 0x00100000 /* 128-255-Byte RX Frames Received */
391#define RX_LT512_CNT 0x00200000 /* 256-511-Byte RX Frames Received */
392#define RX_LT1024_CNT 0x00400000 /* 512-1023-Byte RX Frames Received */
393#define RX_GE1024_CNT 0x00800000 /* 1024-Max-Byte RX Frames Received */
394
395/* EMAC_MMC_TIRQS and EMAC_MMC_TIRQE Masks */
396
397#define TX_OK_CNT 0x00000001 /* TX Frames Sent OK */
398#define TX_SCOLL_CNT 0x00000002 /* TX Frames With Single Collisions */
399#define TX_MCOLL_CNT 0x00000004 /* TX Frames With Multiple Collisions */
400#define TX_OCTET_CNT 0x00000008 /* TX Octets Sent OK */
401#define TX_DEFER_CNT 0x00000010 /* TX Frames With Deferred Transmission */
402#define TX_LATE_CNT 0x00000020 /* TX Frames With Late Collisions */
403#define TX_ABORTC_CNT 0x00000040 /* TX Frames Aborted Due To Excess Collisions */
404#define TX_LOST_CNT 0x00000080 /* TX Frames Lost Due To Internal MAC TX Error */
405#define TX_CRS_CNT 0x00000100 /* TX Frames With Carrier Sense Errors */
406#define TX_UNI_CNT 0x00000200 /* Unicast TX Frames Sent */
407#define TX_MULTI_CNT 0x00000400 /* Multicast TX Frames Sent */
408#define TX_BROAD_CNT 0x00000800 /* Broadcast TX Frames Sent */
409#define TX_EXDEF_CTL 0x00001000 /* TX Frames With Excessive Deferral */
410#define TX_MACCTL_CNT 0x00002000 /* MAC Control TX Frames Sent */
411#define TX_ALLF_CNT 0x00004000 /* All TX Frames Sent */
412#define TX_ALLO_CNT 0x00008000 /* All TX Octets Sent */
413#define TX_EQ64_CNT 0x00010000 /* 64-Byte TX Frames Sent */
414#define TX_LT128_CNT 0x00020000 /* 65-127-Byte TX Frames Sent */
415#define TX_LT256_CNT 0x00040000 /* 128-255-Byte TX Frames Sent */
416#define TX_LT512_CNT 0x00080000 /* 256-511-Byte TX Frames Sent */
417#define TX_LT1024_CNT 0x00100000 /* 512-1023-Byte TX Frames Sent */
418#define TX_GE1024_CNT 0x00200000 /* 1024-Max-Byte TX Frames Sent */
419#define TX_ABORT_CNT 0x00400000 /* TX Frames Aborted */
420
421/* SDH Registers */
422
423#define SDH_PWR_CTL 0xFFC03900 /* SDH Power Control */
424#define SDH_CLK_CTL 0xFFC03904 /* SDH Clock Control */
425#define SDH_ARGUMENT 0xFFC03908 /* SDH Argument */
426#define SDH_COMMAND 0xFFC0390C /* SDH Command */
427#define SDH_RESP_CMD 0xFFC03910 /* SDH Response Command */
428#define SDH_RESPONSE0 0xFFC03914 /* SDH Response0 */
429#define SDH_RESPONSE1 0xFFC03918 /* SDH Response1 */
430#define SDH_RESPONSE2 0xFFC0391C /* SDH Response2 */
431#define SDH_RESPONSE3 0xFFC03920 /* SDH Response3 */
432#define SDH_DATA_TIMER 0xFFC03924 /* SDH Data Timer */
433#define SDH_DATA_LGTH 0xFFC03928 /* SDH Data Length */
434#define SDH_DATA_CTL 0xFFC0392C /* SDH Data Control */
435#define SDH_DATA_CNT 0xFFC03930 /* SDH Data Counter */
436#define SDH_STATUS 0xFFC03934 /* SDH Status */
437#define SDH_STATUS_CLR 0xFFC03938 /* SDH Status Clear */
438#define SDH_MASK0 0xFFC0393C /* SDH Interrupt0 Mask */
439#define SDH_MASK1 0xFFC03940 /* SDH Interrupt1 Mask */
440#define SDH_FIFO_CNT 0xFFC03948 /* SDH FIFO Counter */
441#define SDH_FIFO 0xFFC03980 /* SDH Data FIFO */
442#define SDH_E_STATUS 0xFFC039C0 /* SDH Exception Status */
443#define SDH_E_MASK 0xFFC039C4 /* SDH Exception Mask */
444#define SDH_CFG 0xFFC039C8 /* SDH Configuration */
445#define SDH_RD_WAIT_EN 0xFFC039CC /* SDH Read Wait Enable */
446#define SDH_PID0 0xFFC039D0 /* SDH Peripheral Identification0 */
447#define SDH_PID1 0xFFC039D4 /* SDH Peripheral Identification1 */
448#define SDH_PID2 0xFFC039D8 /* SDH Peripheral Identification2 */
449#define SDH_PID3 0xFFC039DC /* SDH Peripheral Identification3 */
450#define SDH_PID4 0xFFC039E0 /* SDH Peripheral Identification4 */
451#define SDH_PID5 0xFFC039E4 /* SDH Peripheral Identification5 */
452#define SDH_PID6 0xFFC039E8 /* SDH Peripheral Identification6 */
453#define SDH_PID7 0xFFC039EC /* SDH Peripheral Identification7 */
454
455/* Removable Storage Interface Registers */
456
457#define RSI_PWR_CONTROL 0xFFC03800 /* RSI Power Control Register */
458#define RSI_CLK_CONTROL 0xFFC03804 /* RSI Clock Control Register */
459#define RSI_ARGUMENT 0xFFC03808 /* RSI Argument Register */
460#define RSI_COMMAND 0xFFC0380C /* RSI Command Register */
461#define RSI_RESP_CMD 0xFFC03810 /* RSI Response Command Register */
462#define RSI_RESPONSE0 0xFFC03814 /* RSI Response Register */
463#define RSI_RESPONSE1 0xFFC03818 /* RSI Response Register */
464#define RSI_RESPONSE2 0xFFC0381C /* RSI Response Register */
465#define RSI_RESPONSE3 0xFFC03820 /* RSI Response Register */
466#define RSI_DATA_TIMER 0xFFC03824 /* RSI Data Timer Register */
467#define RSI_DATA_LGTH 0xFFC03828 /* RSI Data Length Register */
468#define RSI_DATA_CONTROL 0xFFC0382C /* RSI Data Control Register */
469#define RSI_DATA_CNT 0xFFC03830 /* RSI Data Counter Register */
470#define RSI_STATUS 0xFFC03834 /* RSI Status Register */
471#define RSI_STATUSCL 0xFFC03838 /* RSI Status Clear Register */
472#define RSI_MASK0 0xFFC0383C /* RSI Interrupt 0 Mask Register */
473#define RSI_MASK1 0xFFC03840 /* RSI Interrupt 1 Mask Register */
474#define RSI_FIFO_CNT 0xFFC03848 /* RSI FIFO Counter Register */
475#define RSI_CEATA_CONTROL 0xFFC0384C /* RSI CEATA Register */
476#define RSI_FIFO 0xFFC03880 /* RSI Data FIFO Register */
477#define RSI_ESTAT 0xFFC038C0 /* RSI Exception Status Register */
478#define RSI_EMASK 0xFFC038C4 /* RSI Exception Mask Register */
479#define RSI_CONFIG 0xFFC038C8 /* RSI Configuration Register */
480#define RSI_RD_WAIT_EN 0xFFC038CC /* RSI Read Wait Enable Register */
481#define RSI_PID0 0xFFC03FE0 /* RSI Peripheral ID Register 0 */
482#define RSI_PID1 0xFFC03FE4 /* RSI Peripheral ID Register 1 */
483#define RSI_PID2 0xFFC03FE8 /* RSI Peripheral ID Register 2 */
484#define RSI_PID3 0xFFC03FEC /* RSI Peripheral ID Register 3 */
485#define RSI_PID4 0xFFC03FF0 /* RSI Peripheral ID Register 4 */
486#define RSI_PID5 0xFFC03FF4 /* RSI Peripheral ID Register 5 */
487#define RSI_PID6 0xFFC03FF8 /* RSI Peripheral ID Register 6 */
488#define RSI_PID7 0xFFC03FFC /* RSI Peripheral ID Register 7 */
489
490/* PTP TSYNC Registers */
491
492#define EMAC_PTP_CTL 0xFFC030A0 /* PTP Block Control */
493#define EMAC_PTP_IE 0xFFC030A4 /* PTP Block Interrupt Enable */
494#define EMAC_PTP_ISTAT 0xFFC030A8 /* PTP Block Interrupt Status */
495#define EMAC_PTP_FOFF 0xFFC030AC /* PTP Filter offset Register */
496#define EMAC_PTP_FV1 0xFFC030B0 /* PTP Filter Value Register 1 */
497#define EMAC_PTP_FV2 0xFFC030B4 /* PTP Filter Value Register 2 */
498#define EMAC_PTP_FV3 0xFFC030B8 /* PTP Filter Value Register 3 */
499#define EMAC_PTP_ADDEND 0xFFC030BC /* PTP Addend for Frequency Compensation */
500#define EMAC_PTP_ACCR 0xFFC030C0 /* PTP Accumulator for Frequency Compensation */
501#define EMAC_PTP_OFFSET 0xFFC030C4 /* PTP Time Offset Register */
502#define EMAC_PTP_TIMELO 0xFFC030C8 /* PTP Precision Clock Time Low */
503#define EMAC_PTP_TIMEHI 0xFFC030CC /* PTP Precision Clock Time High */
504#define EMAC_PTP_RXSNAPLO 0xFFC030D0 /* PTP Receive Snapshot Register Low */
505#define EMAC_PTP_RXSNAPHI 0xFFC030D4 /* PTP Receive Snapshot Register High */
506#define EMAC_PTP_TXSNAPLO 0xFFC030D8 /* PTP Transmit Snapshot Register Low */
507#define EMAC_PTP_TXSNAPHI 0xFFC030DC /* PTP Transmit Snapshot Register High */
508#define EMAC_PTP_ALARMLO 0xFFC030E0 /* PTP Alarm time Low */
509#define EMAC_PTP_ALARMHI 0xFFC030E4 /* PTP Alarm time High */
510#define EMAC_PTP_ID_OFF 0xFFC030E8 /* PTP Capture ID offset register */
511#define EMAC_PTP_ID_SNAP 0xFFC030EC /* PTP Capture ID register */
512#define EMAC_PTP_PPS_STARTLO 0xFFC030F0 /* PPS Start Time Low */
513#define EMAC_PTP_PPS_STARTHI 0xFFC030F4 /* PPS Start Time High */
514#define EMAC_PTP_PPS_PERIOD 0xFFC030F8 /* PPS Count Register */
515
516/* ********************************************************** */
517/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
518/* and MULTI BIT READ MACROS */
519/* ********************************************************** */
520
521/* Bit masks for SDH_COMMAND */
522
523#define CMD_IDX 0x3f /* Command Index */
524#define CMD_RSP 0x40 /* Response */
525#define CMD_L_RSP 0x80 /* Long Response */
526#define CMD_INT_E 0x100 /* Command Interrupt */
527#define CMD_PEND_E 0x200 /* Command Pending */
528#define CMD_E 0x400 /* Command Enable */
529
530/* Bit masks for SDH_PWR_CTL */
531
532#define PWR_ON 0x3 /* Power On */
533#if 0
534#define TBD 0x3c /* TBD */
535#endif
536#define SD_CMD_OD 0x40 /* Open Drain Output */
537#define ROD_CTL 0x80 /* Rod Control */
538
539/* Bit masks for SDH_CLK_CTL */
540
541#define CLKDIV 0xff /* MC_CLK Divisor */
542#define CLK_E 0x100 /* MC_CLK Bus Clock Enable */
543#define PWR_SV_E 0x200 /* Power Save Enable */
544#define CLKDIV_BYPASS 0x400 /* Bypass Divisor */
545#define WIDE_BUS 0x800 /* Wide Bus Mode Enable */
546
547/* Bit masks for SDH_RESP_CMD */
548
549#define RESP_CMD 0x3f /* Response Command */
550
551/* Bit masks for SDH_DATA_CTL */
552
553#define DTX_E 0x1 /* Data Transfer Enable */
554#define DTX_DIR 0x2 /* Data Transfer Direction */
555#define DTX_MODE 0x4 /* Data Transfer Mode */
556#define DTX_DMA_E 0x8 /* Data Transfer DMA Enable */
557#define DTX_BLK_LGTH 0xf0 /* Data Transfer Block Length */
558
559/* Bit masks for SDH_STATUS */
560
561#define CMD_CRC_FAIL 0x1 /* CMD CRC Fail */
562#define DAT_CRC_FAIL 0x2 /* Data CRC Fail */
563#define CMD_TIME_OUT 0x4 /* CMD Time Out */
564#define DAT_TIME_OUT 0x8 /* Data Time Out */
565#define TX_UNDERRUN 0x10 /* Transmit Underrun */
566#define RX_OVERRUN 0x20 /* Receive Overrun */
567#define CMD_RESP_END 0x40 /* CMD Response End */
568#define CMD_SENT 0x80 /* CMD Sent */
569#define DAT_END 0x100 /* Data End */
570#define START_BIT_ERR 0x200 /* Start Bit Error */
571#define DAT_BLK_END 0x400 /* Data Block End */
572#define CMD_ACT 0x800 /* CMD Active */
573#define TX_ACT 0x1000 /* Transmit Active */
574#define RX_ACT 0x2000 /* Receive Active */
575#define TX_FIFO_STAT 0x4000 /* Transmit FIFO Status */
576#define RX_FIFO_STAT 0x8000 /* Receive FIFO Status */
577#define TX_FIFO_FULL 0x10000 /* Transmit FIFO Full */
578#define RX_FIFO_FULL 0x20000 /* Receive FIFO Full */
579#define TX_FIFO_ZERO 0x40000 /* Transmit FIFO Empty */
580#define RX_DAT_ZERO 0x80000 /* Receive FIFO Empty */
581#define TX_DAT_RDY 0x100000 /* Transmit Data Available */
582#define RX_FIFO_RDY 0x200000 /* Receive Data Available */
583
584/* Bit masks for SDH_STATUS_CLR */
585
586#define CMD_CRC_FAIL_STAT 0x1 /* CMD CRC Fail Status */
587#define DAT_CRC_FAIL_STAT 0x2 /* Data CRC Fail Status */
588#define CMD_TIMEOUT_STAT 0x4 /* CMD Time Out Status */
589#define DAT_TIMEOUT_STAT 0x8 /* Data Time Out status */
590#define TX_UNDERRUN_STAT 0x10 /* Transmit Underrun Status */
591#define RX_OVERRUN_STAT 0x20 /* Receive Overrun Status */
592#define CMD_RESP_END_STAT 0x40 /* CMD Response End Status */
593#define CMD_SENT_STAT 0x80 /* CMD Sent Status */
594#define DAT_END_STAT 0x100 /* Data End Status */
595#define START_BIT_ERR_STAT 0x200 /* Start Bit Error Status */
596#define DAT_BLK_END_STAT 0x400 /* Data Block End Status */
597
598/* Bit masks for SDH_MASK0 */
599
600#define CMD_CRC_FAIL_MASK 0x1 /* CMD CRC Fail Mask */
601#define DAT_CRC_FAIL_MASK 0x2 /* Data CRC Fail Mask */
602#define CMD_TIMEOUT_MASK 0x4 /* CMD Time Out Mask */
603#define DAT_TIMEOUT_MASK 0x8 /* Data Time Out Mask */
604#define TX_UNDERRUN_MASK 0x10 /* Transmit Underrun Mask */
605#define RX_OVERRUN_MASK 0x20 /* Receive Overrun Mask */
606#define CMD_RESP_END_MASK 0x40 /* CMD Response End Mask */
607#define CMD_SENT_MASK 0x80 /* CMD Sent Mask */
608#define DAT_END_MASK 0x100 /* Data End Mask */
609#define START_BIT_ERR_MASK 0x200 /* Start Bit Error Mask */
610#define DAT_BLK_END_MASK 0x400 /* Data Block End Mask */
611#define CMD_ACT_MASK 0x800 /* CMD Active Mask */
612#define TX_ACT_MASK 0x1000 /* Transmit Active Mask */
613#define RX_ACT_MASK 0x2000 /* Receive Active Mask */
614#define TX_FIFO_STAT_MASK 0x4000 /* Transmit FIFO Status Mask */
615#define RX_FIFO_STAT_MASK 0x8000 /* Receive FIFO Status Mask */
616#define TX_FIFO_FULL_MASK 0x10000 /* Transmit FIFO Full Mask */
617#define RX_FIFO_FULL_MASK 0x20000 /* Receive FIFO Full Mask */
618#define TX_FIFO_ZERO_MASK 0x40000 /* Transmit FIFO Empty Mask */
619#define RX_DAT_ZERO_MASK 0x80000 /* Receive FIFO Empty Mask */
620#define TX_DAT_RDY_MASK 0x100000 /* Transmit Data Available Mask */
621#define RX_FIFO_RDY_MASK 0x200000 /* Receive Data Available Mask */
622
623/* Bit masks for SDH_FIFO_CNT */
624
625#define FIFO_COUNT 0x7fff /* FIFO Count */
626
627/* Bit masks for SDH_E_STATUS */
628
629#define SDIO_INT_DET 0x2 /* SDIO Int Detected */
630#define SD_CARD_DET 0x10 /* SD Card Detect */
631
632/* Bit masks for SDH_E_MASK */
633
634#define SDIO_MSK 0x2 /* Mask SDIO Int Detected */
635#define SCD_MSK 0x40 /* Mask Card Detect */
636
637/* Bit masks for SDH_CFG */
638
639#define CLKS_EN 0x1 /* Clocks Enable */
640#define SD4E 0x4 /* SDIO 4-Bit Enable */
641#define MWE 0x8 /* Moving Window Enable */
642#define SD_RST 0x10 /* SDMMC Reset */
643#define PUP_SDDAT 0x20 /* Pull-up SD_DAT */
644#define PUP_SDDAT3 0x40 /* Pull-up SD_DAT3 */
645#define PD_SDDAT3 0x80 /* Pull-down SD_DAT3 */
646
647/* Bit masks for SDH_RD_WAIT_EN */
648
649#define RWR 0x1 /* Read Wait Request */
650
651#endif /* _DEF_BF518_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/defBF51x_base.h b/arch/blackfin/mach-bf518/include/mach/defBF51x_base.h
new file mode 100644
index 000000000000..1bec8d1c2a73
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/defBF51x_base.h
@@ -0,0 +1,1940 @@
1/*
2 * File: include/asm-blackfin/mach-bf518/defBF51x_base.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _DEF_BF51X_H
32#define _DEF_BF51X_H
33
34
35/* ************************************************************** */
36/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF51x */
37/* ************************************************************** */
38
39/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
40#define PLL_CTL 0xFFC00000 /* PLL Control Register */
41#define PLL_DIV 0xFFC00004 /* PLL Divide Register */
42#define VR_CTL 0xFFC00008 /* Voltage Regulator Control Register */
43#define PLL_STAT 0xFFC0000C /* PLL Status Register */
44#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count Register */
45#define CHIPID 0xFFC00014 /* Device ID Register */
46
47/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
48#define SWRST 0xFFC00100 /* Software Reset Register */
49#define SYSCR 0xFFC00104 /* System Configuration Register */
50#define SIC_RVECT 0xFFC00108 /* Interrupt Reset Vector Address Register */
51
52#define SIC_IMASK0 0xFFC0010C /* Interrupt Mask Register */
53#define SIC_IAR0 0xFFC00110 /* Interrupt Assignment Register 0 */
54#define SIC_IAR1 0xFFC00114 /* Interrupt Assignment Register 1 */
55#define SIC_IAR2 0xFFC00118 /* Interrupt Assignment Register 2 */
56#define SIC_IAR3 0xFFC0011C /* Interrupt Assignment Register 3 */
57#define SIC_ISR0 0xFFC00120 /* Interrupt Status Register */
58#define SIC_IWR0 0xFFC00124 /* Interrupt Wakeup Register */
59
60/* SIC Additions to ADSP-BF51x (0xFFC0014C - 0xFFC00162) */
61#define SIC_IMASK1 0xFFC0014C /* Interrupt Mask register of SIC2 */
62#define SIC_IAR4 0xFFC00150 /* Interrupt Assignment register4 */
63#define SIC_IAR5 0xFFC00154 /* Interrupt Assignment register5 */
64#define SIC_IAR6 0xFFC00158 /* Interrupt Assignment register6 */
65#define SIC_IAR7 0xFFC0015C /* Interrupt Assignment register7 */
66#define SIC_ISR1 0xFFC00160 /* Interrupt Statur register */
67#define SIC_IWR1 0xFFC00164 /* Interrupt Wakeup register */
68
69
70/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
71#define WDOG_CTL 0xFFC00200 /* Watchdog Control Register */
72#define WDOG_CNT 0xFFC00204 /* Watchdog Count Register */
73#define WDOG_STAT 0xFFC00208 /* Watchdog Status Register */
74
75
76/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
77#define RTC_STAT 0xFFC00300 /* RTC Status Register */
78#define RTC_ICTL 0xFFC00304 /* RTC Interrupt Control Register */
79#define RTC_ISTAT 0xFFC00308 /* RTC Interrupt Status Register */
80#define RTC_SWCNT 0xFFC0030C /* RTC Stopwatch Count Register */
81#define RTC_ALARM 0xFFC00310 /* RTC Alarm Time Register */
82#define RTC_FAST 0xFFC00314 /* RTC Prescaler Enable Register */
83#define RTC_PREN 0xFFC00314 /* RTC Prescaler Enable Alternate Macro */
84
85
86/* UART0 Controller (0xFFC00400 - 0xFFC004FF) */
87#define UART0_THR 0xFFC00400 /* Transmit Holding register */
88#define UART0_RBR 0xFFC00400 /* Receive Buffer register */
89#define UART0_DLL 0xFFC00400 /* Divisor Latch (Low-Byte) */
90#define UART0_IER 0xFFC00404 /* Interrupt Enable Register */
91#define UART0_DLH 0xFFC00404 /* Divisor Latch (High-Byte) */
92#define UART0_IIR 0xFFC00408 /* Interrupt Identification Register */
93#define UART0_LCR 0xFFC0040C /* Line Control Register */
94#define UART0_MCR 0xFFC00410 /* Modem Control Register */
95#define UART0_LSR 0xFFC00414 /* Line Status Register */
96#define UART0_MSR 0xFFC00418 /* Modem Status Register */
97#define UART0_SCR 0xFFC0041C /* SCR Scratch Register */
98#define UART0_GCTL 0xFFC00424 /* Global Control Register */
99
100/* SPI0 Controller (0xFFC00500 - 0xFFC005FF) */
101#define SPI0_REGBASE 0xFFC00500
102#define SPI0_CTL 0xFFC00500 /* SPI Control Register */
103#define SPI0_FLG 0xFFC00504 /* SPI Flag register */
104#define SPI0_STAT 0xFFC00508 /* SPI Status register */
105#define SPI0_TDBR 0xFFC0050C /* SPI Transmit Data Buffer Register */
106#define SPI0_RDBR 0xFFC00510 /* SPI Receive Data Buffer Register */
107#define SPI0_BAUD 0xFFC00514 /* SPI Baud rate Register */
108#define SPI0_SHADOW 0xFFC00518 /* SPI_RDBR Shadow Register */
109
110/* SPI1 Controller (0xFFC03400 - 0xFFC034FF) */
111#define SPI1_REGBASE 0xFFC03400
112#define SPI1_CTL 0xFFC03400 /* SPI Control Register */
113#define SPI1_FLG 0xFFC03404 /* SPI Flag register */
114#define SPI1_STAT 0xFFC03408 /* SPI Status register */
115#define SPI1_TDBR 0xFFC0340C /* SPI Transmit Data Buffer Register */
116#define SPI1_RDBR 0xFFC03410 /* SPI Receive Data Buffer Register */
117#define SPI1_BAUD 0xFFC03414 /* SPI Baud rate Register */
118#define SPI1_SHADOW 0xFFC03418 /* SPI_RDBR Shadow Register */
119
120/* TIMER0-7 Registers (0xFFC00600 - 0xFFC006FF) */
121#define TIMER0_CONFIG 0xFFC00600 /* Timer 0 Configuration Register */
122#define TIMER0_COUNTER 0xFFC00604 /* Timer 0 Counter Register */
123#define TIMER0_PERIOD 0xFFC00608 /* Timer 0 Period Register */
124#define TIMER0_WIDTH 0xFFC0060C /* Timer 0 Width Register */
125
126#define TIMER1_CONFIG 0xFFC00610 /* Timer 1 Configuration Register */
127#define TIMER1_COUNTER 0xFFC00614 /* Timer 1 Counter Register */
128#define TIMER1_PERIOD 0xFFC00618 /* Timer 1 Period Register */
129#define TIMER1_WIDTH 0xFFC0061C /* Timer 1 Width Register */
130
131#define TIMER2_CONFIG 0xFFC00620 /* Timer 2 Configuration Register */
132#define TIMER2_COUNTER 0xFFC00624 /* Timer 2 Counter Register */
133#define TIMER2_PERIOD 0xFFC00628 /* Timer 2 Period Register */
134#define TIMER2_WIDTH 0xFFC0062C /* Timer 2 Width Register */
135
136#define TIMER3_CONFIG 0xFFC00630 /* Timer 3 Configuration Register */
137#define TIMER3_COUNTER 0xFFC00634 /* Timer 3 Counter Register */
138#define TIMER3_PERIOD 0xFFC00638 /* Timer 3 Period Register */
139#define TIMER3_WIDTH 0xFFC0063C /* Timer 3 Width Register */
140
141#define TIMER4_CONFIG 0xFFC00640 /* Timer 4 Configuration Register */
142#define TIMER4_COUNTER 0xFFC00644 /* Timer 4 Counter Register */
143#define TIMER4_PERIOD 0xFFC00648 /* Timer 4 Period Register */
144#define TIMER4_WIDTH 0xFFC0064C /* Timer 4 Width Register */
145
146#define TIMER5_CONFIG 0xFFC00650 /* Timer 5 Configuration Register */
147#define TIMER5_COUNTER 0xFFC00654 /* Timer 5 Counter Register */
148#define TIMER5_PERIOD 0xFFC00658 /* Timer 5 Period Register */
149#define TIMER5_WIDTH 0xFFC0065C /* Timer 5 Width Register */
150
151#define TIMER6_CONFIG 0xFFC00660 /* Timer 6 Configuration Register */
152#define TIMER6_COUNTER 0xFFC00664 /* Timer 6 Counter Register */
153#define TIMER6_PERIOD 0xFFC00668 /* Timer 6 Period Register */
154#define TIMER6_WIDTH 0xFFC0066C /* Timer 6 Width Register */
155
156#define TIMER7_CONFIG 0xFFC00670 /* Timer 7 Configuration Register */
157#define TIMER7_COUNTER 0xFFC00674 /* Timer 7 Counter Register */
158#define TIMER7_PERIOD 0xFFC00678 /* Timer 7 Period Register */
159#define TIMER7_WIDTH 0xFFC0067C /* Timer 7 Width Register */
160
161#define TIMER_ENABLE 0xFFC00680 /* Timer Enable Register */
162#define TIMER_DISABLE 0xFFC00684 /* Timer Disable Register */
163#define TIMER_STATUS 0xFFC00688 /* Timer Status Register */
164
165/* General Purpose I/O Port F (0xFFC00700 - 0xFFC007FF) */
166#define PORTFIO 0xFFC00700 /* Port F I/O Pin State Specify Register */
167#define PORTFIO_CLEAR 0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register */
168#define PORTFIO_SET 0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register */
169#define PORTFIO_TOGGLE 0xFFC0070C /* Port F I/O Pin State Toggle Register */
170#define PORTFIO_MASKA 0xFFC00710 /* Port F I/O Mask State Specify Interrupt A Register */
171#define PORTFIO_MASKA_CLEAR 0xFFC00714 /* Port F I/O Mask Disable Interrupt A Register */
172#define PORTFIO_MASKA_SET 0xFFC00718 /* Port F I/O Mask Enable Interrupt A Register */
173#define PORTFIO_MASKA_TOGGLE 0xFFC0071C /* Port F I/O Mask Toggle Enable Interrupt A Register */
174#define PORTFIO_MASKB 0xFFC00720 /* Port F I/O Mask State Specify Interrupt B Register */
175#define PORTFIO_MASKB_CLEAR 0xFFC00724 /* Port F I/O Mask Disable Interrupt B Register */
176#define PORTFIO_MASKB_SET 0xFFC00728 /* Port F I/O Mask Enable Interrupt B Register */
177#define PORTFIO_MASKB_TOGGLE 0xFFC0072C /* Port F I/O Mask Toggle Enable Interrupt B Register */
178#define PORTFIO_DIR 0xFFC00730 /* Port F I/O Direction Register */
179#define PORTFIO_POLAR 0xFFC00734 /* Port F I/O Source Polarity Register */
180#define PORTFIO_EDGE 0xFFC00738 /* Port F I/O Source Sensitivity Register */
181#define PORTFIO_BOTH 0xFFC0073C /* Port F I/O Set on BOTH Edges Register */
182#define PORTFIO_INEN 0xFFC00740 /* Port F I/O Input Enable Register */
183
184/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
185#define SPORT0_TCR1 0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
186#define SPORT0_TCR2 0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
187#define SPORT0_TCLKDIV 0xFFC00808 /* SPORT0 Transmit Clock Divider */
188#define SPORT0_TFSDIV 0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
189#define SPORT0_TX 0xFFC00810 /* SPORT0 TX Data Register */
190#define SPORT0_RX 0xFFC00818 /* SPORT0 RX Data Register */
191#define SPORT0_RCR1 0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
192#define SPORT0_RCR2 0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
193#define SPORT0_RCLKDIV 0xFFC00828 /* SPORT0 Receive Clock Divider */
194#define SPORT0_RFSDIV 0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
195#define SPORT0_STAT 0xFFC00830 /* SPORT0 Status Register */
196#define SPORT0_CHNL 0xFFC00834 /* SPORT0 Current Channel Register */
197#define SPORT0_MCMC1 0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
198#define SPORT0_MCMC2 0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
199#define SPORT0_MTCS0 0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
200#define SPORT0_MTCS1 0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
201#define SPORT0_MTCS2 0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
202#define SPORT0_MTCS3 0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
203#define SPORT0_MRCS0 0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
204#define SPORT0_MRCS1 0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
205#define SPORT0_MRCS2 0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
206#define SPORT0_MRCS3 0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
207
208/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
209#define SPORT1_TCR1 0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
210#define SPORT1_TCR2 0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
211#define SPORT1_TCLKDIV 0xFFC00908 /* SPORT1 Transmit Clock Divider */
212#define SPORT1_TFSDIV 0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
213#define SPORT1_TX 0xFFC00910 /* SPORT1 TX Data Register */
214#define SPORT1_RX 0xFFC00918 /* SPORT1 RX Data Register */
215#define SPORT1_RCR1 0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
216#define SPORT1_RCR2 0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
217#define SPORT1_RCLKDIV 0xFFC00928 /* SPORT1 Receive Clock Divider */
218#define SPORT1_RFSDIV 0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
219#define SPORT1_STAT 0xFFC00930 /* SPORT1 Status Register */
220#define SPORT1_CHNL 0xFFC00934 /* SPORT1 Current Channel Register */
221#define SPORT1_MCMC1 0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
222#define SPORT1_MCMC2 0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
223#define SPORT1_MTCS0 0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
224#define SPORT1_MTCS1 0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
225#define SPORT1_MTCS2 0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
226#define SPORT1_MTCS3 0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
227#define SPORT1_MRCS0 0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
228#define SPORT1_MRCS1 0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
229#define SPORT1_MRCS2 0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
230#define SPORT1_MRCS3 0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
231
232/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
233#define EBIU_AMGCTL 0xFFC00A00 /* Asynchronous Memory Global Control Register */
234#define EBIU_AMBCTL0 0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
235#define EBIU_AMBCTL1 0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
236#define EBIU_SDGCTL 0xFFC00A10 /* SDRAM Global Control Register */
237#define EBIU_SDBCTL 0xFFC00A14 /* SDRAM Bank Control Register */
238#define EBIU_SDRRC 0xFFC00A18 /* SDRAM Refresh Rate Control Register */
239#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
240
241/* DMA Traffic Control Registers */
242#define DMA_TC_PER 0xFFC00B0C /* Traffic Control Periods Register */
243#define DMA_TC_CNT 0xFFC00B10 /* Traffic Control Current Counts Register */
244
245/* Alternate deprecated register names (below) provided for backwards code compatibility */
246#define DMA_TCPER 0xFFC00B0C /* Traffic Control Periods Register */
247#define DMA_TCCNT 0xFFC00B10 /* Traffic Control Current Counts Register */
248
249/* DMA Controller (0xFFC00C00 - 0xFFC00FFF) */
250#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
251#define DMA0_START_ADDR 0xFFC00C04 /* DMA Channel 0 Start Address Register */
252#define DMA0_CONFIG 0xFFC00C08 /* DMA Channel 0 Configuration Register */
253#define DMA0_X_COUNT 0xFFC00C10 /* DMA Channel 0 X Count Register */
254#define DMA0_X_MODIFY 0xFFC00C14 /* DMA Channel 0 X Modify Register */
255#define DMA0_Y_COUNT 0xFFC00C18 /* DMA Channel 0 Y Count Register */
256#define DMA0_Y_MODIFY 0xFFC00C1C /* DMA Channel 0 Y Modify Register */
257#define DMA0_CURR_DESC_PTR 0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
258#define DMA0_CURR_ADDR 0xFFC00C24 /* DMA Channel 0 Current Address Register */
259#define DMA0_IRQ_STATUS 0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
260#define DMA0_PERIPHERAL_MAP 0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
261#define DMA0_CURR_X_COUNT 0xFFC00C30 /* DMA Channel 0 Current X Count Register */
262#define DMA0_CURR_Y_COUNT 0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
263
264#define DMA1_NEXT_DESC_PTR 0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
265#define DMA1_START_ADDR 0xFFC00C44 /* DMA Channel 1 Start Address Register */
266#define DMA1_CONFIG 0xFFC00C48 /* DMA Channel 1 Configuration Register */
267#define DMA1_X_COUNT 0xFFC00C50 /* DMA Channel 1 X Count Register */
268#define DMA1_X_MODIFY 0xFFC00C54 /* DMA Channel 1 X Modify Register */
269#define DMA1_Y_COUNT 0xFFC00C58 /* DMA Channel 1 Y Count Register */
270#define DMA1_Y_MODIFY 0xFFC00C5C /* DMA Channel 1 Y Modify Register */
271#define DMA1_CURR_DESC_PTR 0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
272#define DMA1_CURR_ADDR 0xFFC00C64 /* DMA Channel 1 Current Address Register */
273#define DMA1_IRQ_STATUS 0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
274#define DMA1_PERIPHERAL_MAP 0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
275#define DMA1_CURR_X_COUNT 0xFFC00C70 /* DMA Channel 1 Current X Count Register */
276#define DMA1_CURR_Y_COUNT 0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
277
278#define DMA2_NEXT_DESC_PTR 0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
279#define DMA2_START_ADDR 0xFFC00C84 /* DMA Channel 2 Start Address Register */
280#define DMA2_CONFIG 0xFFC00C88 /* DMA Channel 2 Configuration Register */
281#define DMA2_X_COUNT 0xFFC00C90 /* DMA Channel 2 X Count Register */
282#define DMA2_X_MODIFY 0xFFC00C94 /* DMA Channel 2 X Modify Register */
283#define DMA2_Y_COUNT 0xFFC00C98 /* DMA Channel 2 Y Count Register */
284#define DMA2_Y_MODIFY 0xFFC00C9C /* DMA Channel 2 Y Modify Register */
285#define DMA2_CURR_DESC_PTR 0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
286#define DMA2_CURR_ADDR 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
287#define DMA2_IRQ_STATUS 0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
288#define DMA2_PERIPHERAL_MAP 0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
289#define DMA2_CURR_X_COUNT 0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
290#define DMA2_CURR_Y_COUNT 0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
291
292#define DMA3_NEXT_DESC_PTR 0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
293#define DMA3_START_ADDR 0xFFC00CC4 /* DMA Channel 3 Start Address Register */
294#define DMA3_CONFIG 0xFFC00CC8 /* DMA Channel 3 Configuration Register */
295#define DMA3_X_COUNT 0xFFC00CD0 /* DMA Channel 3 X Count Register */
296#define DMA3_X_MODIFY 0xFFC00CD4 /* DMA Channel 3 X Modify Register */
297#define DMA3_Y_COUNT 0xFFC00CD8 /* DMA Channel 3 Y Count Register */
298#define DMA3_Y_MODIFY 0xFFC00CDC /* DMA Channel 3 Y Modify Register */
299#define DMA3_CURR_DESC_PTR 0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
300#define DMA3_CURR_ADDR 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
301#define DMA3_IRQ_STATUS 0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
302#define DMA3_PERIPHERAL_MAP 0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
303#define DMA3_CURR_X_COUNT 0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
304#define DMA3_CURR_Y_COUNT 0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
305
306#define DMA4_NEXT_DESC_PTR 0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
307#define DMA4_START_ADDR 0xFFC00D04 /* DMA Channel 4 Start Address Register */
308#define DMA4_CONFIG 0xFFC00D08 /* DMA Channel 4 Configuration Register */
309#define DMA4_X_COUNT 0xFFC00D10 /* DMA Channel 4 X Count Register */
310#define DMA4_X_MODIFY 0xFFC00D14 /* DMA Channel 4 X Modify Register */
311#define DMA4_Y_COUNT 0xFFC00D18 /* DMA Channel 4 Y Count Register */
312#define DMA4_Y_MODIFY 0xFFC00D1C /* DMA Channel 4 Y Modify Register */
313#define DMA4_CURR_DESC_PTR 0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
314#define DMA4_CURR_ADDR 0xFFC00D24 /* DMA Channel 4 Current Address Register */
315#define DMA4_IRQ_STATUS 0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
316#define DMA4_PERIPHERAL_MAP 0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
317#define DMA4_CURR_X_COUNT 0xFFC00D30 /* DMA Channel 4 Current X Count Register */
318#define DMA4_CURR_Y_COUNT 0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
319
320#define DMA5_NEXT_DESC_PTR 0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
321#define DMA5_START_ADDR 0xFFC00D44 /* DMA Channel 5 Start Address Register */
322#define DMA5_CONFIG 0xFFC00D48 /* DMA Channel 5 Configuration Register */
323#define DMA5_X_COUNT 0xFFC00D50 /* DMA Channel 5 X Count Register */
324#define DMA5_X_MODIFY 0xFFC00D54 /* DMA Channel 5 X Modify Register */
325#define DMA5_Y_COUNT 0xFFC00D58 /* DMA Channel 5 Y Count Register */
326#define DMA5_Y_MODIFY 0xFFC00D5C /* DMA Channel 5 Y Modify Register */
327#define DMA5_CURR_DESC_PTR 0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
328#define DMA5_CURR_ADDR 0xFFC00D64 /* DMA Channel 5 Current Address Register */
329#define DMA5_IRQ_STATUS 0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
330#define DMA5_PERIPHERAL_MAP 0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
331#define DMA5_CURR_X_COUNT 0xFFC00D70 /* DMA Channel 5 Current X Count Register */
332#define DMA5_CURR_Y_COUNT 0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
333
334#define DMA6_NEXT_DESC_PTR 0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
335#define DMA6_START_ADDR 0xFFC00D84 /* DMA Channel 6 Start Address Register */
336#define DMA6_CONFIG 0xFFC00D88 /* DMA Channel 6 Configuration Register */
337#define DMA6_X_COUNT 0xFFC00D90 /* DMA Channel 6 X Count Register */
338#define DMA6_X_MODIFY 0xFFC00D94 /* DMA Channel 6 X Modify Register */
339#define DMA6_Y_COUNT 0xFFC00D98 /* DMA Channel 6 Y Count Register */
340#define DMA6_Y_MODIFY 0xFFC00D9C /* DMA Channel 6 Y Modify Register */
341#define DMA6_CURR_DESC_PTR 0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
342#define DMA6_CURR_ADDR 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
343#define DMA6_IRQ_STATUS 0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
344#define DMA6_PERIPHERAL_MAP 0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
345#define DMA6_CURR_X_COUNT 0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
346#define DMA6_CURR_Y_COUNT 0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
347
348#define DMA7_NEXT_DESC_PTR 0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
349#define DMA7_START_ADDR 0xFFC00DC4 /* DMA Channel 7 Start Address Register */
350#define DMA7_CONFIG 0xFFC00DC8 /* DMA Channel 7 Configuration Register */
351#define DMA7_X_COUNT 0xFFC00DD0 /* DMA Channel 7 X Count Register */
352#define DMA7_X_MODIFY 0xFFC00DD4 /* DMA Channel 7 X Modify Register */
353#define DMA7_Y_COUNT 0xFFC00DD8 /* DMA Channel 7 Y Count Register */
354#define DMA7_Y_MODIFY 0xFFC00DDC /* DMA Channel 7 Y Modify Register */
355#define DMA7_CURR_DESC_PTR 0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
356#define DMA7_CURR_ADDR 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
357#define DMA7_IRQ_STATUS 0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
358#define DMA7_PERIPHERAL_MAP 0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
359#define DMA7_CURR_X_COUNT 0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
360#define DMA7_CURR_Y_COUNT 0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
361
362#define DMA8_NEXT_DESC_PTR 0xFFC00E00 /* DMA Channel 8 Next Descriptor Pointer Register */
363#define DMA8_START_ADDR 0xFFC00E04 /* DMA Channel 8 Start Address Register */
364#define DMA8_CONFIG 0xFFC00E08 /* DMA Channel 8 Configuration Register */
365#define DMA8_X_COUNT 0xFFC00E10 /* DMA Channel 8 X Count Register */
366#define DMA8_X_MODIFY 0xFFC00E14 /* DMA Channel 8 X Modify Register */
367#define DMA8_Y_COUNT 0xFFC00E18 /* DMA Channel 8 Y Count Register */
368#define DMA8_Y_MODIFY 0xFFC00E1C /* DMA Channel 8 Y Modify Register */
369#define DMA8_CURR_DESC_PTR 0xFFC00E20 /* DMA Channel 8 Current Descriptor Pointer Register */
370#define DMA8_CURR_ADDR 0xFFC00E24 /* DMA Channel 8 Current Address Register */
371#define DMA8_IRQ_STATUS 0xFFC00E28 /* DMA Channel 8 Interrupt/Status Register */
372#define DMA8_PERIPHERAL_MAP 0xFFC00E2C /* DMA Channel 8 Peripheral Map Register */
373#define DMA8_CURR_X_COUNT 0xFFC00E30 /* DMA Channel 8 Current X Count Register */
374#define DMA8_CURR_Y_COUNT 0xFFC00E38 /* DMA Channel 8 Current Y Count Register */
375
376#define DMA9_NEXT_DESC_PTR 0xFFC00E40 /* DMA Channel 9 Next Descriptor Pointer Register */
377#define DMA9_START_ADDR 0xFFC00E44 /* DMA Channel 9 Start Address Register */
378#define DMA9_CONFIG 0xFFC00E48 /* DMA Channel 9 Configuration Register */
379#define DMA9_X_COUNT 0xFFC00E50 /* DMA Channel 9 X Count Register */
380#define DMA9_X_MODIFY 0xFFC00E54 /* DMA Channel 9 X Modify Register */
381#define DMA9_Y_COUNT 0xFFC00E58 /* DMA Channel 9 Y Count Register */
382#define DMA9_Y_MODIFY 0xFFC00E5C /* DMA Channel 9 Y Modify Register */
383#define DMA9_CURR_DESC_PTR 0xFFC00E60 /* DMA Channel 9 Current Descriptor Pointer Register */
384#define DMA9_CURR_ADDR 0xFFC00E64 /* DMA Channel 9 Current Address Register */
385#define DMA9_IRQ_STATUS 0xFFC00E68 /* DMA Channel 9 Interrupt/Status Register */
386#define DMA9_PERIPHERAL_MAP 0xFFC00E6C /* DMA Channel 9 Peripheral Map Register */
387#define DMA9_CURR_X_COUNT 0xFFC00E70 /* DMA Channel 9 Current X Count Register */
388#define DMA9_CURR_Y_COUNT 0xFFC00E78 /* DMA Channel 9 Current Y Count Register */
389
390#define DMA10_NEXT_DESC_PTR 0xFFC00E80 /* DMA Channel 10 Next Descriptor Pointer Register */
391#define DMA10_START_ADDR 0xFFC00E84 /* DMA Channel 10 Start Address Register */
392#define DMA10_CONFIG 0xFFC00E88 /* DMA Channel 10 Configuration Register */
393#define DMA10_X_COUNT 0xFFC00E90 /* DMA Channel 10 X Count Register */
394#define DMA10_X_MODIFY 0xFFC00E94 /* DMA Channel 10 X Modify Register */
395#define DMA10_Y_COUNT 0xFFC00E98 /* DMA Channel 10 Y Count Register */
396#define DMA10_Y_MODIFY 0xFFC00E9C /* DMA Channel 10 Y Modify Register */
397#define DMA10_CURR_DESC_PTR 0xFFC00EA0 /* DMA Channel 10 Current Descriptor Pointer Register */
398#define DMA10_CURR_ADDR 0xFFC00EA4 /* DMA Channel 10 Current Address Register */
399#define DMA10_IRQ_STATUS 0xFFC00EA8 /* DMA Channel 10 Interrupt/Status Register */
400#define DMA10_PERIPHERAL_MAP 0xFFC00EAC /* DMA Channel 10 Peripheral Map Register */
401#define DMA10_CURR_X_COUNT 0xFFC00EB0 /* DMA Channel 10 Current X Count Register */
402#define DMA10_CURR_Y_COUNT 0xFFC00EB8 /* DMA Channel 10 Current Y Count Register */
403
404#define DMA11_NEXT_DESC_PTR 0xFFC00EC0 /* DMA Channel 11 Next Descriptor Pointer Register */
405#define DMA11_START_ADDR 0xFFC00EC4 /* DMA Channel 11 Start Address Register */
406#define DMA11_CONFIG 0xFFC00EC8 /* DMA Channel 11 Configuration Register */
407#define DMA11_X_COUNT 0xFFC00ED0 /* DMA Channel 11 X Count Register */
408#define DMA11_X_MODIFY 0xFFC00ED4 /* DMA Channel 11 X Modify Register */
409#define DMA11_Y_COUNT 0xFFC00ED8 /* DMA Channel 11 Y Count Register */
410#define DMA11_Y_MODIFY 0xFFC00EDC /* DMA Channel 11 Y Modify Register */
411#define DMA11_CURR_DESC_PTR 0xFFC00EE0 /* DMA Channel 11 Current Descriptor Pointer Register */
412#define DMA11_CURR_ADDR 0xFFC00EE4 /* DMA Channel 11 Current Address Register */
413#define DMA11_IRQ_STATUS 0xFFC00EE8 /* DMA Channel 11 Interrupt/Status Register */
414#define DMA11_PERIPHERAL_MAP 0xFFC00EEC /* DMA Channel 11 Peripheral Map Register */
415#define DMA11_CURR_X_COUNT 0xFFC00EF0 /* DMA Channel 11 Current X Count Register */
416#define DMA11_CURR_Y_COUNT 0xFFC00EF8 /* DMA Channel 11 Current Y Count Register */
417
418#define MDMA_D0_NEXT_DESC_PTR 0xFFC00F00 /* MemDMA Stream 0 Destination Next Descriptor Pointer Register */
419#define MDMA_D0_START_ADDR 0xFFC00F04 /* MemDMA Stream 0 Destination Start Address Register */
420#define MDMA_D0_CONFIG 0xFFC00F08 /* MemDMA Stream 0 Destination Configuration Register */
421#define MDMA_D0_X_COUNT 0xFFC00F10 /* MemDMA Stream 0 Destination X Count Register */
422#define MDMA_D0_X_MODIFY 0xFFC00F14 /* MemDMA Stream 0 Destination X Modify Register */
423#define MDMA_D0_Y_COUNT 0xFFC00F18 /* MemDMA Stream 0 Destination Y Count Register */
424#define MDMA_D0_Y_MODIFY 0xFFC00F1C /* MemDMA Stream 0 Destination Y Modify Register */
425#define MDMA_D0_CURR_DESC_PTR 0xFFC00F20 /* MemDMA Stream 0 Destination Current Descriptor Pointer Register */
426#define MDMA_D0_CURR_ADDR 0xFFC00F24 /* MemDMA Stream 0 Destination Current Address Register */
427#define MDMA_D0_IRQ_STATUS 0xFFC00F28 /* MemDMA Stream 0 Destination Interrupt/Status Register */
428#define MDMA_D0_PERIPHERAL_MAP 0xFFC00F2C /* MemDMA Stream 0 Destination Peripheral Map Register */
429#define MDMA_D0_CURR_X_COUNT 0xFFC00F30 /* MemDMA Stream 0 Destination Current X Count Register */
430#define MDMA_D0_CURR_Y_COUNT 0xFFC00F38 /* MemDMA Stream 0 Destination Current Y Count Register */
431
432#define MDMA_S0_NEXT_DESC_PTR 0xFFC00F40 /* MemDMA Stream 0 Source Next Descriptor Pointer Register */
433#define MDMA_S0_START_ADDR 0xFFC00F44 /* MemDMA Stream 0 Source Start Address Register */
434#define MDMA_S0_CONFIG 0xFFC00F48 /* MemDMA Stream 0 Source Configuration Register */
435#define MDMA_S0_X_COUNT 0xFFC00F50 /* MemDMA Stream 0 Source X Count Register */
436#define MDMA_S0_X_MODIFY 0xFFC00F54 /* MemDMA Stream 0 Source X Modify Register */
437#define MDMA_S0_Y_COUNT 0xFFC00F58 /* MemDMA Stream 0 Source Y Count Register */
438#define MDMA_S0_Y_MODIFY 0xFFC00F5C /* MemDMA Stream 0 Source Y Modify Register */
439#define MDMA_S0_CURR_DESC_PTR 0xFFC00F60 /* MemDMA Stream 0 Source Current Descriptor Pointer Register */
440#define MDMA_S0_CURR_ADDR 0xFFC00F64 /* MemDMA Stream 0 Source Current Address Register */
441#define MDMA_S0_IRQ_STATUS 0xFFC00F68 /* MemDMA Stream 0 Source Interrupt/Status Register */
442#define MDMA_S0_PERIPHERAL_MAP 0xFFC00F6C /* MemDMA Stream 0 Source Peripheral Map Register */
443#define MDMA_S0_CURR_X_COUNT 0xFFC00F70 /* MemDMA Stream 0 Source Current X Count Register */
444#define MDMA_S0_CURR_Y_COUNT 0xFFC00F78 /* MemDMA Stream 0 Source Current Y Count Register */
445
446#define MDMA_D1_NEXT_DESC_PTR 0xFFC00F80 /* MemDMA Stream 1 Destination Next Descriptor Pointer Register */
447#define MDMA_D1_START_ADDR 0xFFC00F84 /* MemDMA Stream 1 Destination Start Address Register */
448#define MDMA_D1_CONFIG 0xFFC00F88 /* MemDMA Stream 1 Destination Configuration Register */
449#define MDMA_D1_X_COUNT 0xFFC00F90 /* MemDMA Stream 1 Destination X Count Register */
450#define MDMA_D1_X_MODIFY 0xFFC00F94 /* MemDMA Stream 1 Destination X Modify Register */
451#define MDMA_D1_Y_COUNT 0xFFC00F98 /* MemDMA Stream 1 Destination Y Count Register */
452#define MDMA_D1_Y_MODIFY 0xFFC00F9C /* MemDMA Stream 1 Destination Y Modify Register */
453#define MDMA_D1_CURR_DESC_PTR 0xFFC00FA0 /* MemDMA Stream 1 Destination Current Descriptor Pointer Register */
454#define MDMA_D1_CURR_ADDR 0xFFC00FA4 /* MemDMA Stream 1 Destination Current Address Register */
455#define MDMA_D1_IRQ_STATUS 0xFFC00FA8 /* MemDMA Stream 1 Destination Interrupt/Status Register */
456#define MDMA_D1_PERIPHERAL_MAP 0xFFC00FAC /* MemDMA Stream 1 Destination Peripheral Map Register */
457#define MDMA_D1_CURR_X_COUNT 0xFFC00FB0 /* MemDMA Stream 1 Destination Current X Count Register */
458#define MDMA_D1_CURR_Y_COUNT 0xFFC00FB8 /* MemDMA Stream 1 Destination Current Y Count Register */
459
460#define MDMA_S1_NEXT_DESC_PTR 0xFFC00FC0 /* MemDMA Stream 1 Source Next Descriptor Pointer Register */
461#define MDMA_S1_START_ADDR 0xFFC00FC4 /* MemDMA Stream 1 Source Start Address Register */
462#define MDMA_S1_CONFIG 0xFFC00FC8 /* MemDMA Stream 1 Source Configuration Register */
463#define MDMA_S1_X_COUNT 0xFFC00FD0 /* MemDMA Stream 1 Source X Count Register */
464#define MDMA_S1_X_MODIFY 0xFFC00FD4 /* MemDMA Stream 1 Source X Modify Register */
465#define MDMA_S1_Y_COUNT 0xFFC00FD8 /* MemDMA Stream 1 Source Y Count Register */
466#define MDMA_S1_Y_MODIFY 0xFFC00FDC /* MemDMA Stream 1 Source Y Modify Register */
467#define MDMA_S1_CURR_DESC_PTR 0xFFC00FE0 /* MemDMA Stream 1 Source Current Descriptor Pointer Register */
468#define MDMA_S1_CURR_ADDR 0xFFC00FE4 /* MemDMA Stream 1 Source Current Address Register */
469#define MDMA_S1_IRQ_STATUS 0xFFC00FE8 /* MemDMA Stream 1 Source Interrupt/Status Register */
470#define MDMA_S1_PERIPHERAL_MAP 0xFFC00FEC /* MemDMA Stream 1 Source Peripheral Map Register */
471#define MDMA_S1_CURR_X_COUNT 0xFFC00FF0 /* MemDMA Stream 1 Source Current X Count Register */
472#define MDMA_S1_CURR_Y_COUNT 0xFFC00FF8 /* MemDMA Stream 1 Source Current Y Count Register */
473
474
475/* Parallel Peripheral Interface (0xFFC01000 - 0xFFC010FF) */
476#define PPI_CONTROL 0xFFC01000 /* PPI Control Register */
477#define PPI_STATUS 0xFFC01004 /* PPI Status Register */
478#define PPI_COUNT 0xFFC01008 /* PPI Transfer Count Register */
479#define PPI_DELAY 0xFFC0100C /* PPI Delay Count Register */
480#define PPI_FRAME 0xFFC01010 /* PPI Frame Length Register */
481
482
483/* Two-Wire Interface (0xFFC01400 - 0xFFC014FF) */
484#define TWI0_REGBASE 0xFFC01400
485#define TWI_CLKDIV 0xFFC01400 /* Serial Clock Divider Register */
486#define TWI_CONTROL 0xFFC01404 /* TWI Control Register */
487#define TWI_SLAVE_CTL 0xFFC01408 /* Slave Mode Control Register */
488#define TWI_SLAVE_STAT 0xFFC0140C /* Slave Mode Status Register */
489#define TWI_SLAVE_ADDR 0xFFC01410 /* Slave Mode Address Register */
490#define TWI_MASTER_CTL 0xFFC01414 /* Master Mode Control Register */
491#define TWI_MASTER_STAT 0xFFC01418 /* Master Mode Status Register */
492#define TWI_MASTER_ADDR 0xFFC0141C /* Master Mode Address Register */
493#define TWI_INT_STAT 0xFFC01420 /* TWI Interrupt Status Register */
494#define TWI_INT_MASK 0xFFC01424 /* TWI Master Interrupt Mask Register */
495#define TWI_FIFO_CTL 0xFFC01428 /* FIFO Control Register */
496#define TWI_FIFO_STAT 0xFFC0142C /* FIFO Status Register */
497#define TWI_XMT_DATA8 0xFFC01480 /* FIFO Transmit Data Single Byte Register */
498#define TWI_XMT_DATA16 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
499#define TWI_RCV_DATA8 0xFFC01488 /* FIFO Receive Data Single Byte Register */
500#define TWI_RCV_DATA16 0xFFC0148C /* FIFO Receive Data Double Byte Register */
501
502
503/* General Purpose I/O Port G (0xFFC01500 - 0xFFC015FF) */
504#define PORTGIO 0xFFC01500 /* Port G I/O Pin State Specify Register */
505#define PORTGIO_CLEAR 0xFFC01504 /* Port G I/O Peripheral Interrupt Clear Register */
506#define PORTGIO_SET 0xFFC01508 /* Port G I/O Peripheral Interrupt Set Register */
507#define PORTGIO_TOGGLE 0xFFC0150C /* Port G I/O Pin State Toggle Register */
508#define PORTGIO_MASKA 0xFFC01510 /* Port G I/O Mask State Specify Interrupt A Register */
509#define PORTGIO_MASKA_CLEAR 0xFFC01514 /* Port G I/O Mask Disable Interrupt A Register */
510#define PORTGIO_MASKA_SET 0xFFC01518 /* Port G I/O Mask Enable Interrupt A Register */
511#define PORTGIO_MASKA_TOGGLE 0xFFC0151C /* Port G I/O Mask Toggle Enable Interrupt A Register */
512#define PORTGIO_MASKB 0xFFC01520 /* Port G I/O Mask State Specify Interrupt B Register */
513#define PORTGIO_MASKB_CLEAR 0xFFC01524 /* Port G I/O Mask Disable Interrupt B Register */
514#define PORTGIO_MASKB_SET 0xFFC01528 /* Port G I/O Mask Enable Interrupt B Register */
515#define PORTGIO_MASKB_TOGGLE 0xFFC0152C /* Port G I/O Mask Toggle Enable Interrupt B Register */
516#define PORTGIO_DIR 0xFFC01530 /* Port G I/O Direction Register */
517#define PORTGIO_POLAR 0xFFC01534 /* Port G I/O Source Polarity Register */
518#define PORTGIO_EDGE 0xFFC01538 /* Port G I/O Source Sensitivity Register */
519#define PORTGIO_BOTH 0xFFC0153C /* Port G I/O Set on BOTH Edges Register */
520#define PORTGIO_INEN 0xFFC01540 /* Port G I/O Input Enable Register */
521
522
523/* General Purpose I/O Port H (0xFFC01700 - 0xFFC017FF) */
524#define PORTHIO 0xFFC01700 /* Port H I/O Pin State Specify Register */
525#define PORTHIO_CLEAR 0xFFC01704 /* Port H I/O Peripheral Interrupt Clear Register */
526#define PORTHIO_SET 0xFFC01708 /* Port H I/O Peripheral Interrupt Set Register */
527#define PORTHIO_TOGGLE 0xFFC0170C /* Port H I/O Pin State Toggle Register */
528#define PORTHIO_MASKA 0xFFC01710 /* Port H I/O Mask State Specify Interrupt A Register */
529#define PORTHIO_MASKA_CLEAR 0xFFC01714 /* Port H I/O Mask Disable Interrupt A Register */
530#define PORTHIO_MASKA_SET 0xFFC01718 /* Port H I/O Mask Enable Interrupt A Register */
531#define PORTHIO_MASKA_TOGGLE 0xFFC0171C /* Port H I/O Mask Toggle Enable Interrupt A Register */
532#define PORTHIO_MASKB 0xFFC01720 /* Port H I/O Mask State Specify Interrupt B Register */
533#define PORTHIO_MASKB_CLEAR 0xFFC01724 /* Port H I/O Mask Disable Interrupt B Register */
534#define PORTHIO_MASKB_SET 0xFFC01728 /* Port H I/O Mask Enable Interrupt B Register */
535#define PORTHIO_MASKB_TOGGLE 0xFFC0172C /* Port H I/O Mask Toggle Enable Interrupt B Register */
536#define PORTHIO_DIR 0xFFC01730 /* Port H I/O Direction Register */
537#define PORTHIO_POLAR 0xFFC01734 /* Port H I/O Source Polarity Register */
538#define PORTHIO_EDGE 0xFFC01738 /* Port H I/O Source Sensitivity Register */
539#define PORTHIO_BOTH 0xFFC0173C /* Port H I/O Set on BOTH Edges Register */
540#define PORTHIO_INEN 0xFFC01740 /* Port H I/O Input Enable Register */
541
542
543/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
544#define UART1_THR 0xFFC02000 /* Transmit Holding register */
545#define UART1_RBR 0xFFC02000 /* Receive Buffer register */
546#define UART1_DLL 0xFFC02000 /* Divisor Latch (Low-Byte) */
547#define UART1_IER 0xFFC02004 /* Interrupt Enable Register */
548#define UART1_DLH 0xFFC02004 /* Divisor Latch (High-Byte) */
549#define UART1_IIR 0xFFC02008 /* Interrupt Identification Register */
550#define UART1_LCR 0xFFC0200C /* Line Control Register */
551#define UART1_MCR 0xFFC02010 /* Modem Control Register */
552#define UART1_LSR 0xFFC02014 /* Line Status Register */
553#define UART1_MSR 0xFFC02018 /* Modem Status Register */
554#define UART1_SCR 0xFFC0201C /* SCR Scratch Register */
555#define UART1_GCTL 0xFFC02024 /* Global Control Register */
556
557
558/* Pin Control Registers (0xFFC03200 - 0xFFC032FF) */
559#define PORTF_FER 0xFFC03200 /* Port F Function Enable Register (Alternate/Flag*) */
560#define PORTG_FER 0xFFC03204 /* Port G Function Enable Register (Alternate/Flag*) */
561#define PORTH_FER 0xFFC03208 /* Port H Function Enable Register (Alternate/Flag*) */
562#define BFIN_PORT_MUX 0xFFC0320C /* Port Multiplexer Control Register */
563
564
565/* Handshake MDMA Registers (0xFFC03300 - 0xFFC033FF) */
566#define HMDMA0_CONTROL 0xFFC03300 /* Handshake MDMA0 Control Register */
567#define HMDMA0_ECINIT 0xFFC03304 /* HMDMA0 Initial Edge Count Register */
568#define HMDMA0_BCINIT 0xFFC03308 /* HMDMA0 Initial Block Count Register */
569#define HMDMA0_ECURGENT 0xFFC0330C /* HMDMA0 Urgent Edge Count Threshhold Register */
570#define HMDMA0_ECOVERFLOW 0xFFC03310 /* HMDMA0 Edge Count Overflow Interrupt Register */
571#define HMDMA0_ECOUNT 0xFFC03314 /* HMDMA0 Current Edge Count Register */
572#define HMDMA0_BCOUNT 0xFFC03318 /* HMDMA0 Current Block Count Register */
573
574#define HMDMA1_CONTROL 0xFFC03340 /* Handshake MDMA1 Control Register */
575#define HMDMA1_ECINIT 0xFFC03344 /* HMDMA1 Initial Edge Count Register */
576#define HMDMA1_BCINIT 0xFFC03348 /* HMDMA1 Initial Block Count Register */
577#define HMDMA1_ECURGENT 0xFFC0334C /* HMDMA1 Urgent Edge Count Threshhold Register */
578#define HMDMA1_ECOVERFLOW 0xFFC03350 /* HMDMA1 Edge Count Overflow Interrupt Register */
579#define HMDMA1_ECOUNT 0xFFC03354 /* HMDMA1 Current Edge Count Register */
580#define HMDMA1_BCOUNT 0xFFC03358 /* HMDMA1 Current Block Count Register */
581
582
583/* GPIO PIN mux (0xFFC03210 - OxFFC03288) */
584#define PORTF_MUX 0xFFC03210 /* Port F mux control */
585#define PORTG_MUX 0xFFC03214 /* Port G mux control */
586#define PORTH_MUX 0xFFC03218 /* Port H mux control */
587#define PORTF_DRIVE 0xFFC03220 /* Port F drive strength control */
588#define PORTG_DRIVE 0xFFC03224 /* Port G drive strength control */
589#define PORTH_DRIVE 0xFFC03228 /* Port H drive strength control */
590#define PORTF_SLEW 0xFFC03230 /* Port F slew control */
591#define PORTG_SLEW 0xFFC03234 /* Port G slew control */
592#define PORTH_SLEW 0xFFC03238 /* Port H slew control */
593#define PORTF_HYSTERISIS 0xFFC03240 /* Port F Schmitt trigger control */
594#define PORTG_HYSTERISIS 0xFFC03244 /* Port G Schmitt trigger control */
595#define PORTH_HYSTERISIS 0xFFC03248 /* Port H Schmitt trigger control */
596#define MISCPORT_DRIVE 0xFFC03280 /* Misc Port drive strength control */
597#define MISCPORT_SLEW 0xFFC03284 /* Misc Port slew control */
598#define MISCPORT_HYSTERISIS 0xFFC03288 /* Misc Port Schmitt trigger control */
599
600
601/***********************************************************************************
602** System MMR Register Bits And Macros
603**
604** Disclaimer: All macros are intended to make C and Assembly code more readable.
605** Use these macros carefully, as any that do left shifts for field
606** depositing will result in the lower order bits being destroyed. Any
607** macro that shifts left to properly position the bit-field should be
608** used as part of an OR to initialize a register and NOT as a dynamic
609** modifier UNLESS the lower order bits are saved and ORed back in when
610** the macro is used.
611*************************************************************************************/
612/*
613** ********************* PLL AND RESET MASKS ****************************************/
614/* PLL_CTL Masks */
615#define DF 0x0001 /* 0: PLL = CLKIN, 1: PLL = CLKIN/2 */
616#define PLL_OFF 0x0002 /* PLL Not Powered */
617#define STOPCK 0x0008 /* Core Clock Off */
618#define PDWN 0x0020 /* Enter Deep Sleep Mode */
619#define IN_DELAY 0x0040 /* Add 200ps Delay To EBIU Input Latches */
620#define OUT_DELAY 0x0080 /* Add 200ps Delay To EBIU Output Signals */
621#define BYPASS 0x0100 /* Bypass the PLL */
622#define MSEL 0x7E00 /* Multiplier Select For CCLK/VCO Factors */
623/* PLL_CTL Macros (Only Use With Logic OR While Setting Lower Order Bits) */
624#define SET_MSEL(x) (((x)&0x3F) << 0x9) /* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */
625
626/* PLL_DIV Masks */
627#define SSEL 0x000F /* System Select */
628#define CSEL 0x0030 /* Core Select */
629#define CSEL_DIV1 0x0000 /* CCLK = VCO / 1 */
630#define CSEL_DIV2 0x0010 /* CCLK = VCO / 2 */
631#define CSEL_DIV4 0x0020 /* CCLK = VCO / 4 */
632#define CSEL_DIV8 0x0030 /* CCLK = VCO / 8 */
633/* PLL_DIV Macros */
634#define SET_SSEL(x) ((x)&0xF) /* Set SSEL = 0-15 --> SCLK = VCO/SSEL */
635
636/* VR_CTL Masks */
637#define FREQ 0x3000 /* Switching Oscillator Frequency For Regulator */
638#define HIBERNATE 0x0000 /* Powerdown/Bypass On-Board Regulation */
639
640#define VLEV 0x00F0 /* Internal Voltage Level */
641#define VLEV_085 0x0060 /* VLEV = 0.85 V (-5% - +10% Accuracy) */
642#define VLEV_090 0x0070 /* VLEV = 0.90 V (-5% - +10% Accuracy) */
643#define VLEV_095 0x0080 /* VLEV = 0.95 V (-5% - +10% Accuracy) */
644#define VLEV_100 0x0090 /* VLEV = 1.00 V (-5% - +10% Accuracy) */
645#define VLEV_105 0x00A0 /* VLEV = 1.05 V (-5% - +10% Accuracy) */
646#define VLEV_110 0x00B0 /* VLEV = 1.10 V (-5% - +10% Accuracy) */
647#define VLEV_115 0x00C0 /* VLEV = 1.15 V (-5% - +10% Accuracy) */
648#define VLEV_120 0x00D0 /* VLEV = 1.20 V (-5% - +10% Accuracy) */
649#define VLEV_125 0x00E0 /* VLEV = 1.25 V (-5% - +10% Accuracy) */
650#define VLEV_130 0x00F0 /* VLEV = 1.30 V (-5% - +10% Accuracy) */
651
652#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */
653#define USBWE 0x0200 /* Enable USB Wakeup From Hibernate */
654#define PHYWE 0x0400 /* Enable PHY Wakeup From Hibernate */
655#define CLKBUFOE 0x4000 /* CLKIN Buffer Output Enable */
656#define PHYCLKOE CLKBUFOE /* Alternative legacy name for the above */
657#define SCKELOW 0x8000 /* Enable Drive CKE Low During Reset */
658
659/* PLL_STAT Masks */
660#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
661#define FULL_ON 0x0002 /* Processor In Full On Mode */
662#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
663#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
664
665/* CHIPID Masks */
666#define CHIPID_VERSION 0xF0000000
667#define CHIPID_FAMILY 0x0FFFF000
668#define CHIPID_MANUFACTURE 0x00000FFE
669
670/* SWRST Masks */
671#define SYSTEM_RESET 0x0007 /* Initiates A System Software Reset */
672#define DOUBLE_FAULT 0x0008 /* Core Double Fault Causes Reset */
673#define RESET_DOUBLE 0x2000 /* SW Reset Generated By Core Double-Fault */
674#define RESET_WDOG 0x4000 /* SW Reset Generated By Watchdog Timer */
675#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */
676
677/* SYSCR Masks */
678#define BMODE 0x0007 /* Boot Mode - Latched During HW Reset From Mode Pins */
679#define NOBOOT 0x0010 /* Execute From L1 or ASYNC Bank 0 When BMODE = 0 */
680
681
682/* ************* SYSTEM INTERRUPT CONTROLLER MASKS *************************************/
683/* Peripheral Masks For SIC_ISR, SIC_IWR, SIC_IMASK */
684
685#if 0
686#define IRQ_PLL_WAKEUP 0x00000001 /* PLL Wakeup Interrupt */
687
688#define IRQ_ERROR1 0x00000002 /* Error Interrupt (DMA, DMARx Block, DMARx Overflow) */
689#define IRQ_ERROR2 0x00000004 /* Error Interrupt (CAN, Ethernet, SPORTx, PPI, SPI, UARTx) */
690#define IRQ_RTC 0x00000008 /* Real Time Clock Interrupt */
691#define IRQ_DMA0 0x00000010 /* DMA Channel 0 (PPI) Interrupt */
692#define IRQ_DMA3 0x00000020 /* DMA Channel 3 (SPORT0 RX) Interrupt */
693#define IRQ_DMA4 0x00000040 /* DMA Channel 4 (SPORT0 TX) Interrupt */
694#define IRQ_DMA5 0x00000080 /* DMA Channel 5 (SPORT1 RX) Interrupt */
695
696#define IRQ_DMA6 0x00000100 /* DMA Channel 6 (SPORT1 TX) Interrupt */
697#define IRQ_TWI 0x00000200 /* TWI Interrupt */
698#define IRQ_DMA7 0x00000400 /* DMA Channel 7 (SPI) Interrupt */
699#define IRQ_DMA8 0x00000800 /* DMA Channel 8 (UART0 RX) Interrupt */
700#define IRQ_DMA9 0x00001000 /* DMA Channel 9 (UART0 TX) Interrupt */
701#define IRQ_DMA10 0x00002000 /* DMA Channel 10 (UART1 RX) Interrupt */
702#define IRQ_DMA11 0x00004000 /* DMA Channel 11 (UART1 TX) Interrupt */
703#define IRQ_CAN_RX 0x00008000 /* CAN Receive Interrupt */
704
705#define IRQ_CAN_TX 0x00010000 /* CAN Transmit Interrupt */
706#define IRQ_DMA1 0x00020000 /* DMA Channel 1 (Ethernet RX) Interrupt */
707#define IRQ_PFA_PORTH 0x00020000 /* PF Port H (PF47:32) Interrupt A */
708#define IRQ_DMA2 0x00040000 /* DMA Channel 2 (Ethernet TX) Interrupt */
709#define IRQ_PFB_PORTH 0x00040000 /* PF Port H (PF47:32) Interrupt B */
710#define IRQ_TIMER0 0x00080000 /* Timer 0 Interrupt */
711#define IRQ_TIMER1 0x00100000 /* Timer 1 Interrupt */
712#define IRQ_TIMER2 0x00200000 /* Timer 2 Interrupt */
713#define IRQ_TIMER3 0x00400000 /* Timer 3 Interrupt */
714#define IRQ_TIMER4 0x00800000 /* Timer 4 Interrupt */
715
716#define IRQ_TIMER5 0x01000000 /* Timer 5 Interrupt */
717#define IRQ_TIMER6 0x02000000 /* Timer 6 Interrupt */
718#define IRQ_TIMER7 0x04000000 /* Timer 7 Interrupt */
719#define IRQ_PFA_PORTFG 0x08000000 /* PF Ports F&G (PF31:0) Interrupt A */
720#define IRQ_PFB_PORTF 0x80000000 /* PF Port F (PF15:0) Interrupt B */
721#define IRQ_DMA12 0x20000000 /* DMA Channels 12 (MDMA1 Source) RX Interrupt */
722#define IRQ_DMA13 0x20000000 /* DMA Channels 13 (MDMA1 Destination) TX Interrupt */
723#define IRQ_DMA14 0x40000000 /* DMA Channels 14 (MDMA0 Source) RX Interrupt */
724#define IRQ_DMA15 0x40000000 /* DMA Channels 15 (MDMA0 Destination) TX Interrupt */
725#define IRQ_WDOG 0x80000000 /* Software Watchdog Timer Interrupt */
726#define IRQ_PFB_PORTG 0x10000000 /* PF Port G (PF31:16) Interrupt B */
727#endif
728
729/* SIC_IAR0 Macros */
730#define P0_IVG(x) (((x)&0xF)-7) /* Peripheral #0 assigned IVG #x */
731#define P1_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #1 assigned IVG #x */
732#define P2_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #2 assigned IVG #x */
733#define P3_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #3 assigned IVG #x */
734#define P4_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #4 assigned IVG #x */
735#define P5_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #5 assigned IVG #x */
736#define P6_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #6 assigned IVG #x */
737#define P7_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #7 assigned IVG #x */
738
739/* SIC_IAR1 Macros */
740#define P8_IVG(x) (((x)&0xF)-7) /* Peripheral #8 assigned IVG #x */
741#define P9_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #9 assigned IVG #x */
742#define P10_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #10 assigned IVG #x */
743#define P11_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #11 assigned IVG #x */
744#define P12_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #12 assigned IVG #x */
745#define P13_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #13 assigned IVG #x */
746#define P14_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #14 assigned IVG #x */
747#define P15_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #15 assigned IVG #x */
748
749/* SIC_IAR2 Macros */
750#define P16_IVG(x) (((x)&0xF)-7) /* Peripheral #16 assigned IVG #x */
751#define P17_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #17 assigned IVG #x */
752#define P18_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #18 assigned IVG #x */
753#define P19_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #19 assigned IVG #x */
754#define P20_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #20 assigned IVG #x */
755#define P21_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #21 assigned IVG #x */
756#define P22_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #22 assigned IVG #x */
757#define P23_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #23 assigned IVG #x */
758
759/* SIC_IAR3 Macros */
760#define P24_IVG(x) (((x)&0xF)-7) /* Peripheral #24 assigned IVG #x */
761#define P25_IVG(x) (((x)&0xF)-7) << 0x4 /* Peripheral #25 assigned IVG #x */
762#define P26_IVG(x) (((x)&0xF)-7) << 0x8 /* Peripheral #26 assigned IVG #x */
763#define P27_IVG(x) (((x)&0xF)-7) << 0xC /* Peripheral #27 assigned IVG #x */
764#define P28_IVG(x) (((x)&0xF)-7) << 0x10 /* Peripheral #28 assigned IVG #x */
765#define P29_IVG(x) (((x)&0xF)-7) << 0x14 /* Peripheral #29 assigned IVG #x */
766#define P30_IVG(x) (((x)&0xF)-7) << 0x18 /* Peripheral #30 assigned IVG #x */
767#define P31_IVG(x) (((x)&0xF)-7) << 0x1C /* Peripheral #31 assigned IVG #x */
768
769
770/* SIC_IMASK Masks */
771#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
772#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
773#define SIC_MASK(x) (1 << ((x)&0x1F)) /* Mask Peripheral #x interrupt */
774#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Unmask Peripheral #x interrupt */
775
776/* SIC_IWR Masks */
777#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
778#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
779#define IWR_ENABLE(x) (1 << ((x)&0x1F)) /* Wakeup Enable Peripheral #x */
780#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Wakeup Disable Peripheral #x */
781
782
783/* ********* WATCHDOG TIMER MASKS ******************** */
784
785/* Watchdog Timer WDOG_CTL Register Masks */
786
787#define WDEV(x) (((x)<<1) & 0x0006) /* event generated on roll over */
788#define WDEV_RESET 0x0000 /* generate reset event on roll over */
789#define WDEV_NMI 0x0002 /* generate NMI event on roll over */
790#define WDEV_GPI 0x0004 /* generate GP IRQ on roll over */
791#define WDEV_NONE 0x0006 /* no event on roll over */
792#define WDEN 0x0FF0 /* enable watchdog */
793#define WDDIS 0x0AD0 /* disable watchdog */
794#define WDRO 0x8000 /* watchdog rolled over latch */
795
796/* depreciated WDOG_CTL Register Masks for legacy code */
797
798
799#define ICTL WDEV
800#define ENABLE_RESET WDEV_RESET
801#define WDOG_RESET WDEV_RESET
802#define ENABLE_NMI WDEV_NMI
803#define WDOG_NMI WDEV_NMI
804#define ENABLE_GPI WDEV_GPI
805#define WDOG_GPI WDEV_GPI
806#define DISABLE_EVT WDEV_NONE
807#define WDOG_NONE WDEV_NONE
808
809#define TMR_EN WDEN
810#define TMR_DIS WDDIS
811#define TRO WDRO
812#define ICTL_P0 0x01
813 #define ICTL_P1 0x02
814#define TRO_P 0x0F
815
816
817
818/* *************** REAL TIME CLOCK MASKS **************************/
819/* RTC_STAT and RTC_ALARM Masks */
820#define RTC_SEC 0x0000003F /* Real-Time Clock Seconds */
821#define RTC_MIN 0x00000FC0 /* Real-Time Clock Minutes */
822#define RTC_HR 0x0001F000 /* Real-Time Clock Hours */
823#define RTC_DAY 0xFFFE0000 /* Real-Time Clock Days */
824
825/* RTC_ALARM Macro z=day y=hr x=min w=sec */
826#define SET_ALARM(z,y,x,w) ((((z)&0x7FFF)<<0x11)|(((y)&0x1F)<<0xC)|(((x)&0x3F)<<0x6)|((w)&0x3F))
827
828/* RTC_ICTL and RTC_ISTAT Masks */
829#define STOPWATCH 0x0001 /* Stopwatch Interrupt Enable */
830#define ALARM 0x0002 /* Alarm Interrupt Enable */
831#define SECOND 0x0004 /* Seconds (1 Hz) Interrupt Enable */
832#define MINUTE 0x0008 /* Minutes Interrupt Enable */
833#define HOUR 0x0010 /* Hours Interrupt Enable */
834#define DAY 0x0020 /* 24 Hours (Days) Interrupt Enable */
835#define DAY_ALARM 0x0040 /* Day Alarm (Day, Hour, Minute, Second) Interrupt Enable */
836#define WRITE_PENDING 0x4000 /* Write Pending Status */
837#define WRITE_COMPLETE 0x8000 /* Write Complete Interrupt Enable */
838
839/* RTC_FAST / RTC_PREN Mask */
840#define PREN 0x0001 /* Enable Prescaler, RTC Runs @1 Hz */
841
842
843/* ************** UART CONTROLLER MASKS *************************/
844/* UARTx_LCR Masks */
845#define WLS(x) (((x)-5) & 0x03) /* Word Length Select */
846#define STB 0x04 /* Stop Bits */
847#define PEN 0x08 /* Parity Enable */
848#define EPS 0x10 /* Even Parity Select */
849#define STP 0x20 /* Stick Parity */
850#define SB 0x40 /* Set Break */
851#define DLAB 0x80 /* Divisor Latch Access */
852
853/* UARTx_MCR Mask */
854#define LOOP_ENA 0x10 /* Loopback Mode Enable */
855#define LOOP_ENA_P 0x04
856
857/* UARTx_LSR Masks */
858#define DR 0x01 /* Data Ready */
859#define OE 0x02 /* Overrun Error */
860#define PE 0x04 /* Parity Error */
861#define FE 0x08 /* Framing Error */
862#define BI 0x10 /* Break Interrupt */
863#define THRE 0x20 /* THR Empty */
864#define TEMT 0x40 /* TSR and UART_THR Empty */
865
866/* UARTx_IER Masks */
867#define ERBFI 0x01 /* Enable Receive Buffer Full Interrupt */
868#define ETBEI 0x02 /* Enable Transmit Buffer Empty Interrupt */
869#define ELSI 0x04 /* Enable RX Status Interrupt */
870
871/* UARTx_IIR Masks */
872#define NINT 0x01 /* Pending Interrupt */
873#define IIR_TX_READY 0x02 /* UART_THR empty */
874#define IIR_RX_READY 0x04 /* Receive data ready */
875#define IIR_LINE_CHANGE 0x06 /* Receive line status */
876#define IIR_STATUS 0x06 /* Highest Priority Pending Interrupt */
877
878/* UARTx_GCTL Masks */
879#define UCEN 0x01 /* Enable UARTx Clocks */
880#define IREN 0x02 /* Enable IrDA Mode */
881#define TPOLC 0x04 /* IrDA TX Polarity Change */
882#define RPOLC 0x08 /* IrDA RX Polarity Change */
883#define FPE 0x10 /* Force Parity Error On Transmit */
884#define FFE 0x20 /* Force Framing Error On Transmit */
885
886
887/* *********** SERIAL PERIPHERAL INTERFACE (SPI) MASKS ****************************/
888/* SPI_CTL Masks */
889#define TIMOD 0x0003 /* Transfer Initiate Mode */
890#define RDBR_CORE 0x0000 /* RDBR Read Initiates, IRQ When RDBR Full */
891#define TDBR_CORE 0x0001 /* TDBR Write Initiates, IRQ When TDBR Empty */
892#define RDBR_DMA 0x0002 /* DMA Read, DMA Until FIFO Empty */
893#define TDBR_DMA 0x0003 /* DMA Write, DMA Until FIFO Full */
894#define SZ 0x0004 /* Send Zero (When TDBR Empty, Send Zero/Last*) */
895#define GM 0x0008 /* Get More (When RDBR Full, Overwrite/Discard*) */
896#define PSSE 0x0010 /* Slave-Select Input Enable */
897#define EMISO 0x0020 /* Enable MISO As Output */
898#define SIZE 0x0100 /* Size of Words (16/8* Bits) */
899#define LSBF 0x0200 /* LSB First */
900#define CPHA 0x0400 /* Clock Phase */
901#define CPOL 0x0800 /* Clock Polarity */
902#define MSTR 0x1000 /* Master/Slave* */
903#define WOM 0x2000 /* Write Open Drain Master */
904#define SPE 0x4000 /* SPI Enable */
905
906/* SPI_FLG Masks */
907#define FLS1 0x0002 /* Enables SPI_FLOUT1 as SPI Slave-Select Output */
908#define FLS2 0x0004 /* Enables SPI_FLOUT2 as SPI Slave-Select Output */
909#define FLS3 0x0008 /* Enables SPI_FLOUT3 as SPI Slave-Select Output */
910#define FLS4 0x0010 /* Enables SPI_FLOUT4 as SPI Slave-Select Output */
911#define FLS5 0x0020 /* Enables SPI_FLOUT5 as SPI Slave-Select Output */
912#define FLS6 0x0040 /* Enables SPI_FLOUT6 as SPI Slave-Select Output */
913#define FLS7 0x0080 /* Enables SPI_FLOUT7 as SPI Slave-Select Output */
914#define FLG1 0xFDFF /* Activates SPI_FLOUT1 */
915#define FLG2 0xFBFF /* Activates SPI_FLOUT2 */
916#define FLG3 0xF7FF /* Activates SPI_FLOUT3 */
917#define FLG4 0xEFFF /* Activates SPI_FLOUT4 */
918#define FLG5 0xDFFF /* Activates SPI_FLOUT5 */
919#define FLG6 0xBFFF /* Activates SPI_FLOUT6 */
920#define FLG7 0x7FFF /* Activates SPI_FLOUT7 */
921
922/* SPI_STAT Masks */
923#define SPIF 0x0001 /* SPI Finished (Single-Word Transfer Complete) */
924#define MODF 0x0002 /* Mode Fault Error (Another Device Tried To Become Master) */
925#define TXE 0x0004 /* Transmission Error (Data Sent With No New Data In TDBR) */
926#define TXS 0x0008 /* SPI_TDBR Data Buffer Status (Full/Empty*) */
927#define RBSY 0x0010 /* Receive Error (Data Received With RDBR Full) */
928#define RXS 0x0020 /* SPI_RDBR Data Buffer Status (Full/Empty*) */
929#define TXCOL 0x0040 /* Transmit Collision Error (Corrupt Data May Have Been Sent) */
930
931
932/* **************** GENERAL PURPOSE TIMER MASKS **********************/
933/* TIMER_ENABLE Masks */
934#define TIMEN0 0x0001 /* Enable Timer 0 */
935#define TIMEN1 0x0002 /* Enable Timer 1 */
936#define TIMEN2 0x0004 /* Enable Timer 2 */
937#define TIMEN3 0x0008 /* Enable Timer 3 */
938#define TIMEN4 0x0010 /* Enable Timer 4 */
939#define TIMEN5 0x0020 /* Enable Timer 5 */
940#define TIMEN6 0x0040 /* Enable Timer 6 */
941#define TIMEN7 0x0080 /* Enable Timer 7 */
942
943/* TIMER_DISABLE Masks */
944#define TIMDIS0 TIMEN0 /* Disable Timer 0 */
945#define TIMDIS1 TIMEN1 /* Disable Timer 1 */
946#define TIMDIS2 TIMEN2 /* Disable Timer 2 */
947#define TIMDIS3 TIMEN3 /* Disable Timer 3 */
948#define TIMDIS4 TIMEN4 /* Disable Timer 4 */
949#define TIMDIS5 TIMEN5 /* Disable Timer 5 */
950#define TIMDIS6 TIMEN6 /* Disable Timer 6 */
951#define TIMDIS7 TIMEN7 /* Disable Timer 7 */
952
953/* TIMER_STATUS Masks */
954#define TIMIL0 0x00000001 /* Timer 0 Interrupt */
955#define TIMIL1 0x00000002 /* Timer 1 Interrupt */
956#define TIMIL2 0x00000004 /* Timer 2 Interrupt */
957#define TIMIL3 0x00000008 /* Timer 3 Interrupt */
958#define TOVF_ERR0 0x00000010 /* Timer 0 Counter Overflow */
959#define TOVF_ERR1 0x00000020 /* Timer 1 Counter Overflow */
960#define TOVF_ERR2 0x00000040 /* Timer 2 Counter Overflow */
961#define TOVF_ERR3 0x00000080 /* Timer 3 Counter Overflow */
962#define TRUN0 0x00001000 /* Timer 0 Slave Enable Status */
963#define TRUN1 0x00002000 /* Timer 1 Slave Enable Status */
964#define TRUN2 0x00004000 /* Timer 2 Slave Enable Status */
965#define TRUN3 0x00008000 /* Timer 3 Slave Enable Status */
966#define TIMIL4 0x00010000 /* Timer 4 Interrupt */
967#define TIMIL5 0x00020000 /* Timer 5 Interrupt */
968#define TIMIL6 0x00040000 /* Timer 6 Interrupt */
969#define TIMIL7 0x00080000 /* Timer 7 Interrupt */
970#define TOVF_ERR4 0x00100000 /* Timer 4 Counter Overflow */
971#define TOVF_ERR5 0x00200000 /* Timer 5 Counter Overflow */
972#define TOVF_ERR6 0x00400000 /* Timer 6 Counter Overflow */
973#define TOVF_ERR7 0x00800000 /* Timer 7 Counter Overflow */
974#define TRUN4 0x10000000 /* Timer 4 Slave Enable Status */
975#define TRUN5 0x20000000 /* Timer 5 Slave Enable Status */
976#define TRUN6 0x40000000 /* Timer 6 Slave Enable Status */
977#define TRUN7 0x80000000 /* Timer 7 Slave Enable Status */
978
979/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
980#define TOVL_ERR0 TOVF_ERR0
981#define TOVL_ERR1 TOVF_ERR1
982#define TOVL_ERR2 TOVF_ERR2
983#define TOVL_ERR3 TOVF_ERR3
984#define TOVL_ERR4 TOVF_ERR4
985#define TOVL_ERR5 TOVF_ERR5
986#define TOVL_ERR6 TOVF_ERR6
987#define TOVL_ERR7 TOVF_ERR7
988
989/* TIMERx_CONFIG Masks */
990#define PWM_OUT 0x0001 /* Pulse-Width Modulation Output Mode */
991#define WDTH_CAP 0x0002 /* Width Capture Input Mode */
992#define EXT_CLK 0x0003 /* External Clock Mode */
993#define PULSE_HI 0x0004 /* Action Pulse (Positive/Negative*) */
994#define PERIOD_CNT 0x0008 /* Period Count */
995#define IRQ_ENA 0x0010 /* Interrupt Request Enable */
996#define TIN_SEL 0x0020 /* Timer Input Select */
997#define OUT_DIS 0x0040 /* Output Pad Disable */
998#define CLK_SEL 0x0080 /* Timer Clock Select */
999#define TOGGLE_HI 0x0100 /* PWM_OUT PULSE_HI Toggle Mode */
1000#define EMU_RUN 0x0200 /* Emulation Behavior Select */
1001#define ERR_TYP 0xC000 /* Error Type */
1002
1003
1004/* ****************** GPIO PORTS F, G, H MASKS ***********************/
1005/* General Purpose IO (0xFFC00700 - 0xFFC007FF) Masks */
1006/* Port F Masks */
1007#define PF0 0x0001
1008#define PF1 0x0002
1009#define PF2 0x0004
1010#define PF3 0x0008
1011#define PF4 0x0010
1012#define PF5 0x0020
1013#define PF6 0x0040
1014#define PF7 0x0080
1015#define PF8 0x0100
1016#define PF9 0x0200
1017#define PF10 0x0400
1018#define PF11 0x0800
1019#define PF12 0x1000
1020#define PF13 0x2000
1021#define PF14 0x4000
1022#define PF15 0x8000
1023
1024/* Port G Masks */
1025#define PG0 0x0001
1026#define PG1 0x0002
1027#define PG2 0x0004
1028#define PG3 0x0008
1029#define PG4 0x0010
1030#define PG5 0x0020
1031#define PG6 0x0040
1032#define PG7 0x0080
1033#define PG8 0x0100
1034#define PG9 0x0200
1035#define PG10 0x0400
1036#define PG11 0x0800
1037#define PG12 0x1000
1038#define PG13 0x2000
1039#define PG14 0x4000
1040#define PG15 0x8000
1041
1042/* Port H Masks */
1043#define PH0 0x0001
1044#define PH1 0x0002
1045#define PH2 0x0004
1046#define PH3 0x0008
1047#define PH4 0x0010
1048#define PH5 0x0020
1049#define PH6 0x0040
1050#define PH7 0x0080
1051
1052
1053/* ******************* SERIAL PORT MASKS **************************************/
1054/* SPORTx_TCR1 Masks */
1055#define TSPEN 0x0001 /* Transmit Enable */
1056#define ITCLK 0x0002 /* Internal Transmit Clock Select */
1057#define DTYPE_NORM 0x0004 /* Data Format Normal */
1058#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1059#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1060#define TLSBIT 0x0010 /* Transmit Bit Order */
1061#define ITFS 0x0200 /* Internal Transmit Frame Sync Select */
1062#define TFSR 0x0400 /* Transmit Frame Sync Required Select */
1063#define DITFS 0x0800 /* Data-Independent Transmit Frame Sync Select */
1064#define LTFS 0x1000 /* Low Transmit Frame Sync Select */
1065#define LATFS 0x2000 /* Late Transmit Frame Sync Select */
1066#define TCKFE 0x4000 /* Clock Falling Edge Select */
1067
1068/* SPORTx_TCR2 Masks and Macro */
1069#define SLEN(x) ((x)&0x1F) /* SPORT TX Word Length (2 - 31) */
1070#define TXSE 0x0100 /* TX Secondary Enable */
1071#define TSFSE 0x0200 /* Transmit Stereo Frame Sync Enable */
1072#define TRFST 0x0400 /* Left/Right Order (1 = Right Channel 1st) */
1073
1074/* SPORTx_RCR1 Masks */
1075#define RSPEN 0x0001 /* Receive Enable */
1076#define IRCLK 0x0002 /* Internal Receive Clock Select */
1077#define DTYPE_NORM 0x0004 /* Data Format Normal */
1078#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1079#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1080#define RLSBIT 0x0010 /* Receive Bit Order */
1081#define IRFS 0x0200 /* Internal Receive Frame Sync Select */
1082#define RFSR 0x0400 /* Receive Frame Sync Required Select */
1083#define LRFS 0x1000 /* Low Receive Frame Sync Select */
1084#define LARFS 0x2000 /* Late Receive Frame Sync Select */
1085#define RCKFE 0x4000 /* Clock Falling Edge Select */
1086
1087/* SPORTx_RCR2 Masks */
1088#define SLEN(x) ((x)&0x1F) /* SPORT RX Word Length (2 - 31) */
1089#define RXSE 0x0100 /* RX Secondary Enable */
1090#define RSFSE 0x0200 /* RX Stereo Frame Sync Enable */
1091#define RRFST 0x0400 /* Right-First Data Order */
1092
1093/* SPORTx_STAT Masks */
1094#define RXNE 0x0001 /* Receive FIFO Not Empty Status */
1095#define RUVF 0x0002 /* Sticky Receive Underflow Status */
1096#define ROVF 0x0004 /* Sticky Receive Overflow Status */
1097#define TXF 0x0008 /* Transmit FIFO Full Status */
1098#define TUVF 0x0010 /* Sticky Transmit Underflow Status */
1099#define TOVF 0x0020 /* Sticky Transmit Overflow Status */
1100#define TXHRE 0x0040 /* Transmit Hold Register Empty */
1101
1102/* SPORTx_MCMC1 Macros */
1103#define SP_WOFF(x) ((x) & 0x3FF) /* Multichannel Window Offset Field */
1104
1105/* Only use WSIZE Macro With Logic OR While Setting Lower Order Bits */
1106#define SP_WSIZE(x) (((((x)>>0x3)-1)&0xF) << 0xC) /* Multichannel Window Size = (x/8)-1 */
1107
1108/* SPORTx_MCMC2 Masks */
1109#define REC_BYPASS 0x0000 /* Bypass Mode (No Clock Recovery) */
1110#define REC_2FROM4 0x0002 /* Recover 2 MHz Clock from 4 MHz Clock */
1111#define REC_8FROM16 0x0003 /* Recover 8 MHz Clock from 16 MHz Clock */
1112#define MCDTXPE 0x0004 /* Multichannel DMA Transmit Packing */
1113#define MCDRXPE 0x0008 /* Multichannel DMA Receive Packing */
1114#define MCMEN 0x0010 /* Multichannel Frame Mode Enable */
1115#define FSDR 0x0080 /* Multichannel Frame Sync to Data Relationship */
1116#define MFD_0 0x0000 /* Multichannel Frame Delay = 0 */
1117#define MFD_1 0x1000 /* Multichannel Frame Delay = 1 */
1118#define MFD_2 0x2000 /* Multichannel Frame Delay = 2 */
1119#define MFD_3 0x3000 /* Multichannel Frame Delay = 3 */
1120#define MFD_4 0x4000 /* Multichannel Frame Delay = 4 */
1121#define MFD_5 0x5000 /* Multichannel Frame Delay = 5 */
1122#define MFD_6 0x6000 /* Multichannel Frame Delay = 6 */
1123#define MFD_7 0x7000 /* Multichannel Frame Delay = 7 */
1124#define MFD_8 0x8000 /* Multichannel Frame Delay = 8 */
1125#define MFD_9 0x9000 /* Multichannel Frame Delay = 9 */
1126#define MFD_10 0xA000 /* Multichannel Frame Delay = 10 */
1127#define MFD_11 0xB000 /* Multichannel Frame Delay = 11 */
1128#define MFD_12 0xC000 /* Multichannel Frame Delay = 12 */
1129#define MFD_13 0xD000 /* Multichannel Frame Delay = 13 */
1130#define MFD_14 0xE000 /* Multichannel Frame Delay = 14 */
1131#define MFD_15 0xF000 /* Multichannel Frame Delay = 15 */
1132
1133
1134/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS *************************/
1135/* EBIU_AMGCTL Masks */
1136#define AMCKEN 0x0001 /* Enable CLKOUT */
1137#define AMBEN_NONE 0x0000 /* All Banks Disabled */
1138#define AMBEN_B0 0x0002 /* Enable Async Memory Bank 0 only */
1139#define AMBEN_B0_B1 0x0004 /* Enable Async Memory Banks 0 & 1 only */
1140#define AMBEN_B0_B1_B2 0x0006 /* Enable Async Memory Banks 0, 1, and 2 */
1141#define AMBEN_ALL 0x0008 /* Enable Async Memory Banks (all) 0, 1, 2, and 3 */
1142
1143/* EBIU_AMBCTL0 Masks */
1144#define B0RDYEN 0x00000001 /* Bank 0 (B0) RDY Enable */
1145#define B0RDYPOL 0x00000002 /* B0 RDY Active High */
1146#define B0TT_1 0x00000004 /* B0 Transition Time (Read to Write) = 1 cycle */
1147#define B0TT_2 0x00000008 /* B0 Transition Time (Read to Write) = 2 cycles */
1148#define B0TT_3 0x0000000C /* B0 Transition Time (Read to Write) = 3 cycles */
1149#define B0TT_4 0x00000000 /* B0 Transition Time (Read to Write) = 4 cycles */
1150#define B0ST_1 0x00000010 /* B0 Setup Time (AOE to Read/Write) = 1 cycle */
1151#define B0ST_2 0x00000020 /* B0 Setup Time (AOE to Read/Write) = 2 cycles */
1152#define B0ST_3 0x00000030 /* B0 Setup Time (AOE to Read/Write) = 3 cycles */
1153#define B0ST_4 0x00000000 /* B0 Setup Time (AOE to Read/Write) = 4 cycles */
1154#define B0HT_1 0x00000040 /* B0 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1155#define B0HT_2 0x00000080 /* B0 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1156#define B0HT_3 0x000000C0 /* B0 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1157#define B0HT_0 0x00000000 /* B0 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1158#define B0RAT_1 0x00000100 /* B0 Read Access Time = 1 cycle */
1159#define B0RAT_2 0x00000200 /* B0 Read Access Time = 2 cycles */
1160#define B0RAT_3 0x00000300 /* B0 Read Access Time = 3 cycles */
1161#define B0RAT_4 0x00000400 /* B0 Read Access Time = 4 cycles */
1162#define B0RAT_5 0x00000500 /* B0 Read Access Time = 5 cycles */
1163#define B0RAT_6 0x00000600 /* B0 Read Access Time = 6 cycles */
1164#define B0RAT_7 0x00000700 /* B0 Read Access Time = 7 cycles */
1165#define B0RAT_8 0x00000800 /* B0 Read Access Time = 8 cycles */
1166#define B0RAT_9 0x00000900 /* B0 Read Access Time = 9 cycles */
1167#define B0RAT_10 0x00000A00 /* B0 Read Access Time = 10 cycles */
1168#define B0RAT_11 0x00000B00 /* B0 Read Access Time = 11 cycles */
1169#define B0RAT_12 0x00000C00 /* B0 Read Access Time = 12 cycles */
1170#define B0RAT_13 0x00000D00 /* B0 Read Access Time = 13 cycles */
1171#define B0RAT_14 0x00000E00 /* B0 Read Access Time = 14 cycles */
1172#define B0RAT_15 0x00000F00 /* B0 Read Access Time = 15 cycles */
1173#define B0WAT_1 0x00001000 /* B0 Write Access Time = 1 cycle */
1174#define B0WAT_2 0x00002000 /* B0 Write Access Time = 2 cycles */
1175#define B0WAT_3 0x00003000 /* B0 Write Access Time = 3 cycles */
1176#define B0WAT_4 0x00004000 /* B0 Write Access Time = 4 cycles */
1177#define B0WAT_5 0x00005000 /* B0 Write Access Time = 5 cycles */
1178#define B0WAT_6 0x00006000 /* B0 Write Access Time = 6 cycles */
1179#define B0WAT_7 0x00007000 /* B0 Write Access Time = 7 cycles */
1180#define B0WAT_8 0x00008000 /* B0 Write Access Time = 8 cycles */
1181#define B0WAT_9 0x00009000 /* B0 Write Access Time = 9 cycles */
1182#define B0WAT_10 0x0000A000 /* B0 Write Access Time = 10 cycles */
1183#define B0WAT_11 0x0000B000 /* B0 Write Access Time = 11 cycles */
1184#define B0WAT_12 0x0000C000 /* B0 Write Access Time = 12 cycles */
1185#define B0WAT_13 0x0000D000 /* B0 Write Access Time = 13 cycles */
1186#define B0WAT_14 0x0000E000 /* B0 Write Access Time = 14 cycles */
1187#define B0WAT_15 0x0000F000 /* B0 Write Access Time = 15 cycles */
1188
1189#define B1RDYEN 0x00010000 /* Bank 1 (B1) RDY Enable */
1190#define B1RDYPOL 0x00020000 /* B1 RDY Active High */
1191#define B1TT_1 0x00040000 /* B1 Transition Time (Read to Write) = 1 cycle */
1192#define B1TT_2 0x00080000 /* B1 Transition Time (Read to Write) = 2 cycles */
1193#define B1TT_3 0x000C0000 /* B1 Transition Time (Read to Write) = 3 cycles */
1194#define B1TT_4 0x00000000 /* B1 Transition Time (Read to Write) = 4 cycles */
1195#define B1ST_1 0x00100000 /* B1 Setup Time (AOE to Read/Write) = 1 cycle */
1196#define B1ST_2 0x00200000 /* B1 Setup Time (AOE to Read/Write) = 2 cycles */
1197#define B1ST_3 0x00300000 /* B1 Setup Time (AOE to Read/Write) = 3 cycles */
1198#define B1ST_4 0x00000000 /* B1 Setup Time (AOE to Read/Write) = 4 cycles */
1199#define B1HT_1 0x00400000 /* B1 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1200#define B1HT_2 0x00800000 /* B1 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1201#define B1HT_3 0x00C00000 /* B1 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1202#define B1HT_0 0x00000000 /* B1 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1203#define B1RAT_1 0x01000000 /* B1 Read Access Time = 1 cycle */
1204#define B1RAT_2 0x02000000 /* B1 Read Access Time = 2 cycles */
1205#define B1RAT_3 0x03000000 /* B1 Read Access Time = 3 cycles */
1206#define B1RAT_4 0x04000000 /* B1 Read Access Time = 4 cycles */
1207#define B1RAT_5 0x05000000 /* B1 Read Access Time = 5 cycles */
1208#define B1RAT_6 0x06000000 /* B1 Read Access Time = 6 cycles */
1209#define B1RAT_7 0x07000000 /* B1 Read Access Time = 7 cycles */
1210#define B1RAT_8 0x08000000 /* B1 Read Access Time = 8 cycles */
1211#define B1RAT_9 0x09000000 /* B1 Read Access Time = 9 cycles */
1212#define B1RAT_10 0x0A000000 /* B1 Read Access Time = 10 cycles */
1213#define B1RAT_11 0x0B000000 /* B1 Read Access Time = 11 cycles */
1214#define B1RAT_12 0x0C000000 /* B1 Read Access Time = 12 cycles */
1215#define B1RAT_13 0x0D000000 /* B1 Read Access Time = 13 cycles */
1216#define B1RAT_14 0x0E000000 /* B1 Read Access Time = 14 cycles */
1217#define B1RAT_15 0x0F000000 /* B1 Read Access Time = 15 cycles */
1218#define B1WAT_1 0x10000000 /* B1 Write Access Time = 1 cycle */
1219#define B1WAT_2 0x20000000 /* B1 Write Access Time = 2 cycles */
1220#define B1WAT_3 0x30000000 /* B1 Write Access Time = 3 cycles */
1221#define B1WAT_4 0x40000000 /* B1 Write Access Time = 4 cycles */
1222#define B1WAT_5 0x50000000 /* B1 Write Access Time = 5 cycles */
1223#define B1WAT_6 0x60000000 /* B1 Write Access Time = 6 cycles */
1224#define B1WAT_7 0x70000000 /* B1 Write Access Time = 7 cycles */
1225#define B1WAT_8 0x80000000 /* B1 Write Access Time = 8 cycles */
1226#define B1WAT_9 0x90000000 /* B1 Write Access Time = 9 cycles */
1227#define B1WAT_10 0xA0000000 /* B1 Write Access Time = 10 cycles */
1228#define B1WAT_11 0xB0000000 /* B1 Write Access Time = 11 cycles */
1229#define B1WAT_12 0xC0000000 /* B1 Write Access Time = 12 cycles */
1230#define B1WAT_13 0xD0000000 /* B1 Write Access Time = 13 cycles */
1231#define B1WAT_14 0xE0000000 /* B1 Write Access Time = 14 cycles */
1232#define B1WAT_15 0xF0000000 /* B1 Write Access Time = 15 cycles */
1233
1234/* EBIU_AMBCTL1 Masks */
1235#define B2RDYEN 0x00000001 /* Bank 2 (B2) RDY Enable */
1236#define B2RDYPOL 0x00000002 /* B2 RDY Active High */
1237#define B2TT_1 0x00000004 /* B2 Transition Time (Read to Write) = 1 cycle */
1238#define B2TT_2 0x00000008 /* B2 Transition Time (Read to Write) = 2 cycles */
1239#define B2TT_3 0x0000000C /* B2 Transition Time (Read to Write) = 3 cycles */
1240#define B2TT_4 0x00000000 /* B2 Transition Time (Read to Write) = 4 cycles */
1241#define B2ST_1 0x00000010 /* B2 Setup Time (AOE to Read/Write) = 1 cycle */
1242#define B2ST_2 0x00000020 /* B2 Setup Time (AOE to Read/Write) = 2 cycles */
1243#define B2ST_3 0x00000030 /* B2 Setup Time (AOE to Read/Write) = 3 cycles */
1244#define B2ST_4 0x00000000 /* B2 Setup Time (AOE to Read/Write) = 4 cycles */
1245#define B2HT_1 0x00000040 /* B2 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1246#define B2HT_2 0x00000080 /* B2 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1247#define B2HT_3 0x000000C0 /* B2 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1248#define B2HT_0 0x00000000 /* B2 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1249#define B2RAT_1 0x00000100 /* B2 Read Access Time = 1 cycle */
1250#define B2RAT_2 0x00000200 /* B2 Read Access Time = 2 cycles */
1251#define B2RAT_3 0x00000300 /* B2 Read Access Time = 3 cycles */
1252#define B2RAT_4 0x00000400 /* B2 Read Access Time = 4 cycles */
1253#define B2RAT_5 0x00000500 /* B2 Read Access Time = 5 cycles */
1254#define B2RAT_6 0x00000600 /* B2 Read Access Time = 6 cycles */
1255#define B2RAT_7 0x00000700 /* B2 Read Access Time = 7 cycles */
1256#define B2RAT_8 0x00000800 /* B2 Read Access Time = 8 cycles */
1257#define B2RAT_9 0x00000900 /* B2 Read Access Time = 9 cycles */
1258#define B2RAT_10 0x00000A00 /* B2 Read Access Time = 10 cycles */
1259#define B2RAT_11 0x00000B00 /* B2 Read Access Time = 11 cycles */
1260#define B2RAT_12 0x00000C00 /* B2 Read Access Time = 12 cycles */
1261#define B2RAT_13 0x00000D00 /* B2 Read Access Time = 13 cycles */
1262#define B2RAT_14 0x00000E00 /* B2 Read Access Time = 14 cycles */
1263#define B2RAT_15 0x00000F00 /* B2 Read Access Time = 15 cycles */
1264#define B2WAT_1 0x00001000 /* B2 Write Access Time = 1 cycle */
1265#define B2WAT_2 0x00002000 /* B2 Write Access Time = 2 cycles */
1266#define B2WAT_3 0x00003000 /* B2 Write Access Time = 3 cycles */
1267#define B2WAT_4 0x00004000 /* B2 Write Access Time = 4 cycles */
1268#define B2WAT_5 0x00005000 /* B2 Write Access Time = 5 cycles */
1269#define B2WAT_6 0x00006000 /* B2 Write Access Time = 6 cycles */
1270#define B2WAT_7 0x00007000 /* B2 Write Access Time = 7 cycles */
1271#define B2WAT_8 0x00008000 /* B2 Write Access Time = 8 cycles */
1272#define B2WAT_9 0x00009000 /* B2 Write Access Time = 9 cycles */
1273#define B2WAT_10 0x0000A000 /* B2 Write Access Time = 10 cycles */
1274#define B2WAT_11 0x0000B000 /* B2 Write Access Time = 11 cycles */
1275#define B2WAT_12 0x0000C000 /* B2 Write Access Time = 12 cycles */
1276#define B2WAT_13 0x0000D000 /* B2 Write Access Time = 13 cycles */
1277#define B2WAT_14 0x0000E000 /* B2 Write Access Time = 14 cycles */
1278#define B2WAT_15 0x0000F000 /* B2 Write Access Time = 15 cycles */
1279
1280#define B3RDYEN 0x00010000 /* Bank 3 (B3) RDY Enable */
1281#define B3RDYPOL 0x00020000 /* B3 RDY Active High */
1282#define B3TT_1 0x00040000 /* B3 Transition Time (Read to Write) = 1 cycle */
1283#define B3TT_2 0x00080000 /* B3 Transition Time (Read to Write) = 2 cycles */
1284#define B3TT_3 0x000C0000 /* B3 Transition Time (Read to Write) = 3 cycles */
1285#define B3TT_4 0x00000000 /* B3 Transition Time (Read to Write) = 4 cycles */
1286#define B3ST_1 0x00100000 /* B3 Setup Time (AOE to Read/Write) = 1 cycle */
1287#define B3ST_2 0x00200000 /* B3 Setup Time (AOE to Read/Write) = 2 cycles */
1288#define B3ST_3 0x00300000 /* B3 Setup Time (AOE to Read/Write) = 3 cycles */
1289#define B3ST_4 0x00000000 /* B3 Setup Time (AOE to Read/Write) = 4 cycles */
1290#define B3HT_1 0x00400000 /* B3 Hold Time (~Read/Write to ~AOE) = 1 cycle */
1291#define B3HT_2 0x00800000 /* B3 Hold Time (~Read/Write to ~AOE) = 2 cycles */
1292#define B3HT_3 0x00C00000 /* B3 Hold Time (~Read/Write to ~AOE) = 3 cycles */
1293#define B3HT_0 0x00000000 /* B3 Hold Time (~Read/Write to ~AOE) = 0 cycles */
1294#define B3RAT_1 0x01000000 /* B3 Read Access Time = 1 cycle */
1295#define B3RAT_2 0x02000000 /* B3 Read Access Time = 2 cycles */
1296#define B3RAT_3 0x03000000 /* B3 Read Access Time = 3 cycles */
1297#define B3RAT_4 0x04000000 /* B3 Read Access Time = 4 cycles */
1298#define B3RAT_5 0x05000000 /* B3 Read Access Time = 5 cycles */
1299#define B3RAT_6 0x06000000 /* B3 Read Access Time = 6 cycles */
1300#define B3RAT_7 0x07000000 /* B3 Read Access Time = 7 cycles */
1301#define B3RAT_8 0x08000000 /* B3 Read Access Time = 8 cycles */
1302#define B3RAT_9 0x09000000 /* B3 Read Access Time = 9 cycles */
1303#define B3RAT_10 0x0A000000 /* B3 Read Access Time = 10 cycles */
1304#define B3RAT_11 0x0B000000 /* B3 Read Access Time = 11 cycles */
1305#define B3RAT_12 0x0C000000 /* B3 Read Access Time = 12 cycles */
1306#define B3RAT_13 0x0D000000 /* B3 Read Access Time = 13 cycles */
1307#define B3RAT_14 0x0E000000 /* B3 Read Access Time = 14 cycles */
1308#define B3RAT_15 0x0F000000 /* B3 Read Access Time = 15 cycles */
1309#define B3WAT_1 0x10000000 /* B3 Write Access Time = 1 cycle */
1310#define B3WAT_2 0x20000000 /* B3 Write Access Time = 2 cycles */
1311#define B3WAT_3 0x30000000 /* B3 Write Access Time = 3 cycles */
1312#define B3WAT_4 0x40000000 /* B3 Write Access Time = 4 cycles */
1313#define B3WAT_5 0x50000000 /* B3 Write Access Time = 5 cycles */
1314#define B3WAT_6 0x60000000 /* B3 Write Access Time = 6 cycles */
1315#define B3WAT_7 0x70000000 /* B3 Write Access Time = 7 cycles */
1316#define B3WAT_8 0x80000000 /* B3 Write Access Time = 8 cycles */
1317#define B3WAT_9 0x90000000 /* B3 Write Access Time = 9 cycles */
1318#define B3WAT_10 0xA0000000 /* B3 Write Access Time = 10 cycles */
1319#define B3WAT_11 0xB0000000 /* B3 Write Access Time = 11 cycles */
1320#define B3WAT_12 0xC0000000 /* B3 Write Access Time = 12 cycles */
1321#define B3WAT_13 0xD0000000 /* B3 Write Access Time = 13 cycles */
1322#define B3WAT_14 0xE0000000 /* B3 Write Access Time = 14 cycles */
1323#define B3WAT_15 0xF0000000 /* B3 Write Access Time = 15 cycles */
1324
1325
1326/* ********************** SDRAM CONTROLLER MASKS **********************************************/
1327/* EBIU_SDGCTL Masks */
1328#define SCTLE 0x00000001 /* Enable SDRAM Signals */
1329#define CL_2 0x00000008 /* SDRAM CAS Latency = 2 cycles */
1330#define CL_3 0x0000000C /* SDRAM CAS Latency = 3 cycles */
1331#define PASR_ALL 0x00000000 /* All 4 SDRAM Banks Refreshed In Self-Refresh */
1332#define PASR_B0_B1 0x00000010 /* SDRAM Banks 0 and 1 Are Refreshed In Self-Refresh */
1333#define PASR_B0 0x00000020 /* Only SDRAM Bank 0 Is Refreshed In Self-Refresh */
1334#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
1335#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
1336#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
1337#define TRAS_4 0x00000100 /* SDRAM tRAS = 4 cycles */
1338#define TRAS_5 0x00000140 /* SDRAM tRAS = 5 cycles */
1339#define TRAS_6 0x00000180 /* SDRAM tRAS = 6 cycles */
1340#define TRAS_7 0x000001C0 /* SDRAM tRAS = 7 cycles */
1341#define TRAS_8 0x00000200 /* SDRAM tRAS = 8 cycles */
1342#define TRAS_9 0x00000240 /* SDRAM tRAS = 9 cycles */
1343#define TRAS_10 0x00000280 /* SDRAM tRAS = 10 cycles */
1344#define TRAS_11 0x000002C0 /* SDRAM tRAS = 11 cycles */
1345#define TRAS_12 0x00000300 /* SDRAM tRAS = 12 cycles */
1346#define TRAS_13 0x00000340 /* SDRAM tRAS = 13 cycles */
1347#define TRAS_14 0x00000380 /* SDRAM tRAS = 14 cycles */
1348#define TRAS_15 0x000003C0 /* SDRAM tRAS = 15 cycles */
1349#define TRP_1 0x00000800 /* SDRAM tRP = 1 cycle */
1350#define TRP_2 0x00001000 /* SDRAM tRP = 2 cycles */
1351#define TRP_3 0x00001800 /* SDRAM tRP = 3 cycles */
1352#define TRP_4 0x00002000 /* SDRAM tRP = 4 cycles */
1353#define TRP_5 0x00002800 /* SDRAM tRP = 5 cycles */
1354#define TRP_6 0x00003000 /* SDRAM tRP = 6 cycles */
1355#define TRP_7 0x00003800 /* SDRAM tRP = 7 cycles */
1356#define TRCD_1 0x00008000 /* SDRAM tRCD = 1 cycle */
1357#define TRCD_2 0x00010000 /* SDRAM tRCD = 2 cycles */
1358#define TRCD_3 0x00018000 /* SDRAM tRCD = 3 cycles */
1359#define TRCD_4 0x00020000 /* SDRAM tRCD = 4 cycles */
1360#define TRCD_5 0x00028000 /* SDRAM tRCD = 5 cycles */
1361#define TRCD_6 0x00030000 /* SDRAM tRCD = 6 cycles */
1362#define TRCD_7 0x00038000 /* SDRAM tRCD = 7 cycles */
1363#define TWR_1 0x00080000 /* SDRAM tWR = 1 cycle */
1364#define TWR_2 0x00100000 /* SDRAM tWR = 2 cycles */
1365#define TWR_3 0x00180000 /* SDRAM tWR = 3 cycles */
1366#define PUPSD 0x00200000 /* Power-Up Start Delay (15 SCLK Cycles Delay) */
1367#define PSM 0x00400000 /* Power-Up Sequence (Mode Register Before/After* Refresh) */
1368#define PSS 0x00800000 /* Enable Power-Up Sequence on Next SDRAM Access */
1369#define SRFS 0x01000000 /* Enable SDRAM Self-Refresh Mode */
1370#define EBUFE 0x02000000 /* Enable External Buffering Timing */
1371#define FBBRW 0x04000000 /* Enable Fast Back-To-Back Read To Write */
1372#define EMREN 0x10000000 /* Extended Mode Register Enable */
1373#define TCSR 0x20000000 /* Temp-Compensated Self-Refresh Value (85/45* Deg C) */
1374#define CDDBG 0x40000000 /* Tristate SDRAM Controls During Bus Grant */
1375
1376/* EBIU_SDBCTL Masks */
1377#define EBE 0x0001 /* Enable SDRAM External Bank */
1378#define EBSZ_16 0x0000 /* SDRAM External Bank Size = 16MB */
1379#define EBSZ_32 0x0002 /* SDRAM External Bank Size = 32MB */
1380#define EBSZ_64 0x0004 /* SDRAM External Bank Size = 64MB */
1381#define EBSZ_128 0x0006 /* SDRAM External Bank Size = 128MB */
1382#define EBSZ_256 0x0008 /* SDRAM External Bank Size = 256MB */
1383#define EBSZ_512 0x000A /* SDRAM External Bank Size = 512MB */
1384#define EBCAW_8 0x0000 /* SDRAM External Bank Column Address Width = 8 Bits */
1385#define EBCAW_9 0x0010 /* SDRAM External Bank Column Address Width = 9 Bits */
1386#define EBCAW_10 0x0020 /* SDRAM External Bank Column Address Width = 10 Bits */
1387#define EBCAW_11 0x0030 /* SDRAM External Bank Column Address Width = 11 Bits */
1388
1389/* EBIU_SDSTAT Masks */
1390#define SDCI 0x0001 /* SDRAM Controller Idle */
1391#define SDSRA 0x0002 /* SDRAM Self-Refresh Active */
1392#define SDPUA 0x0004 /* SDRAM Power-Up Active */
1393#define SDRS 0x0008 /* SDRAM Will Power-Up On Next Access */
1394#define SDEASE 0x0010 /* SDRAM EAB Sticky Error Status */
1395#define BGSTAT 0x0020 /* Bus Grant Status */
1396
1397
1398/* ************************** DMA CONTROLLER MASKS ********************************/
1399/* DMAx_CONFIG, MDMA_yy_CONFIG Masks */
1400#define DMAEN 0x0001 /* DMA Channel Enable */
1401#define WNR 0x0002 /* Channel Direction (W/R*) */
1402#define WDSIZE_8 0x0000 /* Transfer Word Size = 8 */
1403#define WDSIZE_16 0x0004 /* Transfer Word Size = 16 */
1404#define WDSIZE_32 0x0008 /* Transfer Word Size = 32 */
1405#define DMA2D 0x0010 /* DMA Mode (2D/1D*) */
1406#define RESTART 0x0020 /* DMA Buffer Clear */
1407#define DI_SEL 0x0040 /* Data Interrupt Timing Select */
1408#define DI_EN 0x0080 /* Data Interrupt Enable */
1409#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
1410#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
1411#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
1412#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
1413#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
1414#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
1415#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
1416#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
1417#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
1418#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
1419#define NDSIZE 0x0900 /* Next Descriptor Size */
1420#define DMAFLOW 0x7000 /* Flow Control */
1421#define DMAFLOW_STOP 0x0000 /* Stop Mode */
1422#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
1423#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
1424#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
1425#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
1426
1427/* DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP Masks */
1428#define CTYPE 0x0040 /* DMA Channel Type Indicator (Memory/Peripheral*) */
1429#define PMAP 0xF000 /* Peripheral Mapped To This Channel */
1430#define PMAP_PPI 0x0000 /* PPI Port DMA */
1431#define PMAP_EMACRX 0x1000 /* Ethernet Receive DMA */
1432#define PMAP_EMACTX 0x2000 /* Ethernet Transmit DMA */
1433#define PMAP_SPORT0RX 0x3000 /* SPORT0 Receive DMA */
1434#define PMAP_SPORT0TX 0x4000 /* SPORT0 Transmit DMA */
1435#define PMAP_SPORT1RX 0x5000 /* SPORT1 Receive DMA */
1436#define PMAP_SPORT1TX 0x6000 /* SPORT1 Transmit DMA */
1437#define PMAP_SPI 0x7000 /* SPI Port DMA */
1438#define PMAP_UART0RX 0x8000 /* UART0 Port Receive DMA */
1439#define PMAP_UART0TX 0x9000 /* UART0 Port Transmit DMA */
1440#define PMAP_UART1RX 0xA000 /* UART1 Port Receive DMA */
1441#define PMAP_UART1TX 0xB000 /* UART1 Port Transmit DMA */
1442
1443/* DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS Masks */
1444#define DMA_DONE 0x0001 /* DMA Completion Interrupt Status */
1445#define DMA_ERR 0x0002 /* DMA Error Interrupt Status */
1446#define DFETCH 0x0004 /* DMA Descriptor Fetch Indicator */
1447#define DMA_RUN 0x0008 /* DMA Channel Running Indicator */
1448
1449
1450/* ************ PARALLEL PERIPHERAL INTERFACE (PPI) MASKS *************/
1451/* PPI_CONTROL Masks */
1452#define PORT_EN 0x0001 /* PPI Port Enable */
1453#define PORT_DIR 0x0002 /* PPI Port Direction */
1454#define XFR_TYPE 0x000C /* PPI Transfer Type */
1455#define PORT_CFG 0x0030 /* PPI Port Configuration */
1456#define FLD_SEL 0x0040 /* PPI Active Field Select */
1457#define PACK_EN 0x0080 /* PPI Packing Mode */
1458#define DMA32 0x0100 /* PPI 32-bit DMA Enable */
1459#define SKIP_EN 0x0200 /* PPI Skip Element Enable */
1460#define SKIP_EO 0x0400 /* PPI Skip Even/Odd Elements */
1461#define DLEN_8 0x0000 /* Data Length = 8 Bits */
1462#define DLEN_10 0x0800 /* Data Length = 10 Bits */
1463#define DLEN_11 0x1000 /* Data Length = 11 Bits */
1464#define DLEN_12 0x1800 /* Data Length = 12 Bits */
1465#define DLEN_13 0x2000 /* Data Length = 13 Bits */
1466#define DLEN_14 0x2800 /* Data Length = 14 Bits */
1467#define DLEN_15 0x3000 /* Data Length = 15 Bits */
1468#define DLEN_16 0x3800 /* Data Length = 16 Bits */
1469#define DLENGTH 0x3800 /* PPI Data Length */
1470#define POLC 0x4000 /* PPI Clock Polarity */
1471#define POLS 0x8000 /* PPI Frame Sync Polarity */
1472
1473/* PPI_STATUS Masks */
1474#define FLD 0x0400 /* Field Indicator */
1475#define FT_ERR 0x0800 /* Frame Track Error */
1476#define OVR 0x1000 /* FIFO Overflow Error */
1477#define UNDR 0x2000 /* FIFO Underrun Error */
1478#define ERR_DET 0x4000 /* Error Detected Indicator */
1479#define ERR_NCOR 0x8000 /* Error Not Corrected Indicator */
1480
1481
1482/* ******************** TWO-WIRE INTERFACE (TWI) MASKS ***********************/
1483/* TWI_CLKDIV Macros (Use: *pTWI_CLKDIV = CLKLOW(x)|CLKHI(y); ) */
1484#define CLKLOW(x) ((x) & 0xFF) /* Periods Clock Is Held Low */
1485#define CLKHI(y) (((y)&0xFF)<<0x8) /* Periods Before New Clock Low */
1486
1487/* TWI_PRESCALE Masks */
1488#define PRESCALE 0x007F /* SCLKs Per Internal Time Reference (10MHz) */
1489#define TWI_ENA 0x0080 /* TWI Enable */
1490#define SCCB 0x0200 /* SCCB Compatibility Enable */
1491
1492/* TWI_SLAVE_CTRL Masks */
1493#define SEN 0x0001 /* Slave Enable */
1494#define SADD_LEN 0x0002 /* Slave Address Length */
1495#define STDVAL 0x0004 /* Slave Transmit Data Valid */
1496#define NAK 0x0008 /* NAK/ACK* Generated At Conclusion Of Transfer */
1497#define GEN 0x0010 /* General Call Adrress Matching Enabled */
1498
1499/* TWI_SLAVE_STAT Masks */
1500#define SDIR 0x0001 /* Slave Transfer Direction (Transmit/Receive*) */
1501#define GCALL 0x0002 /* General Call Indicator */
1502
1503/* TWI_MASTER_CTRL Masks */
1504#define MEN 0x0001 /* Master Mode Enable */
1505#define MADD_LEN 0x0002 /* Master Address Length */
1506#define MDIR 0x0004 /* Master Transmit Direction (RX/TX*) */
1507#define FAST 0x0008 /* Use Fast Mode Timing Specs */
1508#define STOP 0x0010 /* Issue Stop Condition */
1509#define RSTART 0x0020 /* Repeat Start or Stop* At End Of Transfer */
1510#define DCNT 0x3FC0 /* Data Bytes To Transfer */
1511#define SDAOVR 0x4000 /* Serial Data Override */
1512#define SCLOVR 0x8000 /* Serial Clock Override */
1513
1514/* TWI_MASTER_STAT Masks */
1515#define MPROG 0x0001 /* Master Transfer In Progress */
1516#define LOSTARB 0x0002 /* Lost Arbitration Indicator (Xfer Aborted) */
1517#define ANAK 0x0004 /* Address Not Acknowledged */
1518#define DNAK 0x0008 /* Data Not Acknowledged */
1519#define BUFRDERR 0x0010 /* Buffer Read Error */
1520#define BUFWRERR 0x0020 /* Buffer Write Error */
1521#define SDASEN 0x0040 /* Serial Data Sense */
1522#define SCLSEN 0x0080 /* Serial Clock Sense */
1523#define BUSBUSY 0x0100 /* Bus Busy Indicator */
1524
1525/* TWI_INT_SRC and TWI_INT_ENABLE Masks */
1526#define SINIT 0x0001 /* Slave Transfer Initiated */
1527#define SCOMP 0x0002 /* Slave Transfer Complete */
1528#define SERR 0x0004 /* Slave Transfer Error */
1529#define SOVF 0x0008 /* Slave Overflow */
1530#define MCOMP 0x0010 /* Master Transfer Complete */
1531#define MERR 0x0020 /* Master Transfer Error */
1532#define XMTSERV 0x0040 /* Transmit FIFO Service */
1533#define RCVSERV 0x0080 /* Receive FIFO Service */
1534
1535/* TWI_FIFO_CTRL Masks */
1536#define XMTFLUSH 0x0001 /* Transmit Buffer Flush */
1537#define RCVFLUSH 0x0002 /* Receive Buffer Flush */
1538#define XMTINTLEN 0x0004 /* Transmit Buffer Interrupt Length */
1539#define RCVINTLEN 0x0008 /* Receive Buffer Interrupt Length */
1540
1541/* TWI_FIFO_STAT Masks */
1542#define XMTSTAT 0x0003 /* Transmit FIFO Status */
1543#define XMT_EMPTY 0x0000 /* Transmit FIFO Empty */
1544#define XMT_HALF 0x0001 /* Transmit FIFO Has 1 Byte To Write */
1545#define XMT_FULL 0x0003 /* Transmit FIFO Full (2 Bytes To Write) */
1546
1547#define RCVSTAT 0x000C /* Receive FIFO Status */
1548#define RCV_EMPTY 0x0000 /* Receive FIFO Empty */
1549#define RCV_HALF 0x0004 /* Receive FIFO Has 1 Byte To Read */
1550#define RCV_FULL 0x000C /* Receive FIFO Full (2 Bytes To Read) */
1551
1552
1553/* ******************* PIN CONTROL REGISTER MASKS ************************/
1554/* PORT_MUX Masks */
1555#define PJSE 0x0001 /* Port J SPI/SPORT Enable */
1556#define PJSE_SPORT 0x0000 /* Enable TFS0/DT0PRI */
1557#define PJSE_SPI 0x0001 /* Enable SPI_SSEL3:2 */
1558
1559#define PJCE(x) (((x)&0x3)<<1) /* Port J CAN/SPI/SPORT Enable */
1560#define PJCE_SPORT 0x0000 /* Enable DR0SEC/DT0SEC */
1561#define PJCE_CAN 0x0002 /* Enable CAN RX/TX */
1562#define PJCE_SPI 0x0004 /* Enable SPI_SSEL7 */
1563
1564#define PFDE 0x0008 /* Port F DMA Request Enable */
1565#define PFDE_UART 0x0000 /* Enable UART0 RX/TX */
1566#define PFDE_DMA 0x0008 /* Enable DMAR1:0 */
1567
1568#define PFTE 0x0010 /* Port F Timer Enable */
1569#define PFTE_UART 0x0000 /* Enable UART1 RX/TX */
1570#define PFTE_TIMER 0x0010 /* Enable TMR7:6 */
1571
1572#define PFS6E 0x0020 /* Port F SPI SSEL 6 Enable */
1573#define PFS6E_TIMER 0x0000 /* Enable TMR5 */
1574#define PFS6E_SPI 0x0020 /* Enable SPI_SSEL6 */
1575
1576#define PFS5E 0x0040 /* Port F SPI SSEL 5 Enable */
1577#define PFS5E_TIMER 0x0000 /* Enable TMR4 */
1578#define PFS5E_SPI 0x0040 /* Enable SPI_SSEL5 */
1579
1580#define PFS4E 0x0080 /* Port F SPI SSEL 4 Enable */
1581#define PFS4E_TIMER 0x0000 /* Enable TMR3 */
1582#define PFS4E_SPI 0x0080 /* Enable SPI_SSEL4 */
1583
1584#define PFFE 0x0100 /* Port F PPI Frame Sync Enable */
1585#define PFFE_TIMER 0x0000 /* Enable TMR2 */
1586#define PFFE_PPI 0x0100 /* Enable PPI FS3 */
1587
1588#define PGSE 0x0200 /* Port G SPORT1 Secondary Enable */
1589#define PGSE_PPI 0x0000 /* Enable PPI D9:8 */
1590#define PGSE_SPORT 0x0200 /* Enable DR1SEC/DT1SEC */
1591
1592#define PGRE 0x0400 /* Port G SPORT1 Receive Enable */
1593#define PGRE_PPI 0x0000 /* Enable PPI D12:10 */
1594#define PGRE_SPORT 0x0400 /* Enable DR1PRI/RFS1/RSCLK1 */
1595
1596#define PGTE 0x0800 /* Port G SPORT1 Transmit Enable */
1597#define PGTE_PPI 0x0000 /* Enable PPI D15:13 */
1598#define PGTE_SPORT 0x0800 /* Enable DT1PRI/TFS1/TSCLK1 */
1599
1600
1601/* ****************** HANDSHAKE DMA (HDMA) MASKS *********************/
1602/* HDMAx_CTL Masks */
1603#define HMDMAEN 0x0001 /* Enable Handshake DMA 0/1 */
1604#define REP 0x0002 /* HDMA Request Polarity */
1605#define UTE 0x0004 /* Urgency Threshold Enable */
1606#define OIE 0x0010 /* Overflow Interrupt Enable */
1607#define BDIE 0x0020 /* Block Done Interrupt Enable */
1608#define MBDI 0x0040 /* Mask Block Done IRQ If Pending ECNT */
1609#define DRQ 0x0300 /* HDMA Request Type */
1610#define DRQ_NONE 0x0000 /* No Request */
1611#define DRQ_SINGLE 0x0100 /* Channels Request Single */
1612#define DRQ_MULTI 0x0200 /* Channels Request Multi (Default) */
1613#define DRQ_URGENT 0x0300 /* Channels Request Multi Urgent */
1614#define RBC 0x1000 /* Reload BCNT With IBCNT */
1615#define PS 0x2000 /* HDMA Pin Status */
1616#define OI 0x4000 /* Overflow Interrupt Generated */
1617#define BDI 0x8000 /* Block Done Interrupt Generated */
1618
1619/* entry addresses of the user-callable Boot ROM functions */
1620
1621#define _BOOTROM_RESET 0xEF000000
1622#define _BOOTROM_FINAL_INIT 0xEF000002
1623#define _BOOTROM_DO_MEMORY_DMA 0xEF000006
1624#define _BOOTROM_BOOT_DXE_FLASH 0xEF000008
1625#define _BOOTROM_BOOT_DXE_SPI 0xEF00000A
1626#define _BOOTROM_BOOT_DXE_TWI 0xEF00000C
1627#define _BOOTROM_GET_DXE_ADDRESS_FLASH 0xEF000010
1628#define _BOOTROM_GET_DXE_ADDRESS_SPI 0xEF000012
1629#define _BOOTROM_GET_DXE_ADDRESS_TWI 0xEF000014
1630
1631/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
1632#define PGDE_UART PFDE_UART
1633#define PGDE_DMA PFDE_DMA
1634#define CKELOW SCKELOW
1635
1636/* HOST Port Registers */
1637
1638#define HOST_CONTROL 0xffc03400 /* HOST Control Register */
1639#define HOST_STATUS 0xffc03404 /* HOST Status Register */
1640#define HOST_TIMEOUT 0xffc03408 /* HOST Acknowledge Mode Timeout Register */
1641
1642/* Counter Registers */
1643
1644#define CNT_CONFIG 0xffc03500 /* Configuration Register */
1645#define CNT_IMASK 0xffc03504 /* Interrupt Mask Register */
1646#define CNT_STATUS 0xffc03508 /* Status Register */
1647#define CNT_COMMAND 0xffc0350c /* Command Register */
1648#define CNT_DEBOUNCE 0xffc03510 /* Debounce Register */
1649#define CNT_COUNTER 0xffc03514 /* Counter Register */
1650#define CNT_MAX 0xffc03518 /* Maximal Count Register */
1651#define CNT_MIN 0xffc0351c /* Minimal Count Register */
1652
1653/* OTP/FUSE Registers */
1654
1655#define OTP_CONTROL 0xffc03600 /* OTP/Fuse Control Register */
1656#define OTP_BEN 0xffc03604 /* OTP/Fuse Byte Enable */
1657#define OTP_STATUS 0xffc03608 /* OTP/Fuse Status */
1658#define OTP_TIMING 0xffc0360c /* OTP/Fuse Access Timing */
1659
1660/* Security Registers */
1661
1662#define SECURE_SYSSWT 0xffc03620 /* Secure System Switches */
1663#define SECURE_CONTROL 0xffc03624 /* Secure Control */
1664#define SECURE_STATUS 0xffc03628 /* Secure Status */
1665
1666/* OTP Read/Write Data Buffer Registers */
1667
1668#define OTP_DATA0 0xffc03680 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1669#define OTP_DATA1 0xffc03684 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1670#define OTP_DATA2 0xffc03688 /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1671#define OTP_DATA3 0xffc0368c /* OTP/Fuse Data (OTP_DATA0-3) accesses the fuse read write buffer */
1672
1673/* Motor Control PWM Registers */
1674
1675#define PWM_CTRL 0xffc03700 /* PWM Control Register */
1676#define PWM_STAT 0xffc03704 /* PWM Status Register */
1677#define PWM_TM 0xffc03708 /* PWM Period Register */
1678#define PWM_DT 0xffc0370c /* PWM Dead Time Register */
1679#define PWM_GATE 0xffc03710 /* PWM Chopping Control */
1680#define PWM_CHA 0xffc03714 /* PWM Channel A Duty Control */
1681#define PWM_CHB 0xffc03718 /* PWM Channel B Duty Control */
1682#define PWM_CHC 0xffc0371c /* PWM Channel C Duty Control */
1683#define PWM_SEG 0xffc03720 /* PWM Crossover and Output Enable */
1684#define PWM_SYNCWT 0xffc03724 /* PWM Sync Pluse Width Control */
1685#define PWM_CHAL 0xffc03728 /* PWM Channel AL Duty Control (SR mode only) */
1686#define PWM_CHBL 0xffc0372c /* PWM Channel BL Duty Control (SR mode only) */
1687#define PWM_CHCL 0xffc03730 /* PWM Channel CL Duty Control (SR mode only) */
1688#define PWM_LSI 0xffc03734 /* PWM Low Side Invert (SR mode only) */
1689#define PWM_STAT2 0xffc03738 /* PWM Status Register 2 */
1690
1691
1692/* ********************************************************** */
1693/* SINGLE BIT MACRO PAIRS (bit mask and negated one) */
1694/* and MULTI BIT READ MACROS */
1695/* ********************************************************** */
1696
1697/* Bit masks for HOST_CONTROL */
1698
1699#define HOST_CNTR_HOST_EN 0x1 /* Host Enable */
1700#define HOST_CNTR_nHOST_EN 0x0
1701#define HOST_CNTR_HOST_END 0x2 /* Host Endianess */
1702#define HOST_CNTR_nHOST_END 0x0
1703#define HOST_CNTR_DATA_SIZE 0x4 /* Data Size */
1704#define HOST_CNTR_nDATA_SIZE 0x0
1705#define HOST_CNTR_HOST_RST 0x8 /* Host Reset */
1706#define HOST_CNTR_nHOST_RST 0x0
1707#define HOST_CNTR_HRDY_OVR 0x20 /* Host Ready Override */
1708#define HOST_CNTR_nHRDY_OVR 0x0
1709#define HOST_CNTR_INT_MODE 0x40 /* Interrupt Mode */
1710#define HOST_CNTR_nINT_MODE 0x0
1711#define HOST_CNTR_BT_EN 0x80 /* Bus Timeout Enable */
1712#define HOST_CNTR_ nBT_EN 0x0
1713#define HOST_CNTR_EHW 0x100 /* Enable Host Write */
1714#define HOST_CNTR_nEHW 0x0
1715#define HOST_CNTR_EHR 0x200 /* Enable Host Read */
1716#define HOST_CNTR_nEHR 0x0
1717#define HOST_CNTR_BDR 0x400 /* Burst DMA Requests */
1718#define HOST_CNTR_nBDR 0x0
1719
1720/* Bit masks for HOST_STATUS */
1721
1722#define HOST_STAT_READY 0x1 /* DMA Ready */
1723#define HOST_STAT_nREADY 0x0
1724#define HOST_STAT_FIFOFULL 0x2 /* FIFO Full */
1725#define HOST_STAT_nFIFOFULL 0x0
1726#define HOST_STAT_FIFOEMPTY 0x4 /* FIFO Empty */
1727#define HOST_STAT_nFIFOEMPTY 0x0
1728#define HOST_STAT_COMPLETE 0x8 /* DMA Complete */
1729#define HOST_STAT_nCOMPLETE 0x0
1730#define HOST_STAT_HSHK 0x10 /* Host Handshake */
1731#define HOST_STAT_nHSHK 0x0
1732#define HOST_STAT_TIMEOUT 0x20 /* Host Timeout */
1733#define HOST_STAT_nTIMEOUT 0x0
1734#define HOST_STAT_HIRQ 0x40 /* Host Interrupt Request */
1735#define HOST_STAT_nHIRQ 0x0
1736#define HOST_STAT_ALLOW_CNFG 0x80 /* Allow New Configuration */
1737#define HOST_STAT_nALLOW_CNFG 0x0
1738#define HOST_STAT_DMA_DIR 0x100 /* DMA Direction */
1739#define HOST_STAT_nDMA_DIR 0x0
1740#define HOST_STAT_BTE 0x200 /* Bus Timeout Enabled */
1741#define HOST_STAT_nBTE 0x0
1742#define HOST_STAT_HOSTRD_DONE 0x8000 /* Host Read Completion Interrupt */
1743#define HOST_STAT_nHOSTRD_DONE 0x0
1744
1745/* Bit masks for HOST_TIMEOUT */
1746
1747#define HOST_COUNT_TIMEOUT 0x7ff /* Host Timeout count */
1748
1749/* Bit masks for CNT_CONFIG */
1750
1751#define CNTE 0x1 /* Counter Enable */
1752#define nCNTE 0x0
1753#define DEBE 0x2 /* Debounce Enable */
1754#define nDEBE 0x0
1755#define CDGINV 0x10 /* CDG Pin Polarity Invert */
1756#define nCDGINV 0x0
1757#define CUDINV 0x20 /* CUD Pin Polarity Invert */
1758#define nCUDINV 0x0
1759#define CZMINV 0x40 /* CZM Pin Polarity Invert */
1760#define nCZMINV 0x0
1761#define CNTMODE 0x700 /* Counter Operating Mode */
1762#define ZMZC 0x800 /* CZM Zeroes Counter Enable */
1763#define nZMZC 0x0
1764#define BNDMODE 0x3000 /* Boundary register Mode */
1765#define INPDIS 0x8000 /* CUG and CDG Input Disable */
1766#define nINPDIS 0x0
1767
1768/* Bit masks for CNT_IMASK */
1769
1770#define ICIE 0x1 /* Illegal Gray/Binary Code Interrupt Enable */
1771#define nICIE 0x0
1772#define UCIE 0x2 /* Up count Interrupt Enable */
1773#define nUCIE 0x0
1774#define DCIE 0x4 /* Down count Interrupt Enable */
1775#define nDCIE 0x0
1776#define MINCIE 0x8 /* Min Count Interrupt Enable */
1777#define nMINCIE 0x0
1778#define MAXCIE 0x10 /* Max Count Interrupt Enable */
1779#define nMAXCIE 0x0
1780#define COV31IE 0x20 /* Bit 31 Overflow Interrupt Enable */
1781#define nCOV31IE 0x0
1782#define COV15IE 0x40 /* Bit 15 Overflow Interrupt Enable */
1783#define nCOV15IE 0x0
1784#define CZEROIE 0x80 /* Count to Zero Interrupt Enable */
1785#define nCZEROIE 0x0
1786#define CZMIE 0x100 /* CZM Pin Interrupt Enable */
1787#define nCZMIE 0x0
1788#define CZMEIE 0x200 /* CZM Error Interrupt Enable */
1789#define nCZMEIE 0x0
1790#define CZMZIE 0x400 /* CZM Zeroes Counter Interrupt Enable */
1791#define nCZMZIE 0x0
1792
1793/* Bit masks for CNT_STATUS */
1794
1795#define ICII 0x1 /* Illegal Gray/Binary Code Interrupt Identifier */
1796#define nICII 0x0
1797#define UCII 0x2 /* Up count Interrupt Identifier */
1798#define nUCII 0x0
1799#define DCII 0x4 /* Down count Interrupt Identifier */
1800#define nDCII 0x0
1801#define MINCII 0x8 /* Min Count Interrupt Identifier */
1802#define nMINCII 0x0
1803#define MAXCII 0x10 /* Max Count Interrupt Identifier */
1804#define nMAXCII 0x0
1805#define COV31II 0x20 /* Bit 31 Overflow Interrupt Identifier */
1806#define nCOV31II 0x0
1807#define COV15II 0x40 /* Bit 15 Overflow Interrupt Identifier */
1808#define nCOV15II 0x0
1809#define CZEROII 0x80 /* Count to Zero Interrupt Identifier */
1810#define nCZEROII 0x0
1811#define CZMII 0x100 /* CZM Pin Interrupt Identifier */
1812#define nCZMII 0x0
1813#define CZMEII 0x200 /* CZM Error Interrupt Identifier */
1814#define nCZMEII 0x0
1815#define CZMZII 0x400 /* CZM Zeroes Counter Interrupt Identifier */
1816#define nCZMZII 0x0
1817
1818/* Bit masks for CNT_COMMAND */
1819
1820#define W1LCNT 0xf /* Load Counter Register */
1821#define W1LMIN 0xf0 /* Load Min Register */
1822#define W1LMAX 0xf00 /* Load Max Register */
1823#define W1ZMONCE 0x1000 /* Enable CZM Clear Counter Once */
1824#define nW1ZMONCE 0x0
1825
1826/* Bit masks for CNT_DEBOUNCE */
1827
1828#define DPRESCALE 0xf /* Load Counter Register */
1829
1830/* CNT_COMMAND bit field options */
1831
1832#define W1LCNT_ZERO 0x0001 /* write 1 to load CNT_COUNTER with zero */
1833#define W1LCNT_MIN 0x0004 /* write 1 to load CNT_COUNTER from CNT_MIN */
1834#define W1LCNT_MAX 0x0008 /* write 1 to load CNT_COUNTER from CNT_MAX */
1835
1836#define W1LMIN_ZERO 0x0010 /* write 1 to load CNT_MIN with zero */
1837#define W1LMIN_CNT 0x0020 /* write 1 to load CNT_MIN from CNT_COUNTER */
1838#define W1LMIN_MAX 0x0080 /* write 1 to load CNT_MIN from CNT_MAX */
1839
1840#define W1LMAX_ZERO 0x0100 /* write 1 to load CNT_MAX with zero */
1841#define W1LMAX_CNT 0x0200 /* write 1 to load CNT_MAX from CNT_COUNTER */
1842#define W1LMAX_MIN 0x0400 /* write 1 to load CNT_MAX from CNT_MIN */
1843
1844/* CNT_CONFIG bit field options */
1845
1846#define CNTMODE_QUADENC 0x0000 /* quadrature encoder mode */
1847#define CNTMODE_BINENC 0x0100 /* binary encoder mode */
1848#define CNTMODE_UDCNT 0x0200 /* up/down counter mode */
1849#define CNTMODE_DIRCNT 0x0400 /* direction counter mode */
1850#define CNTMODE_DIRTMR 0x0500 /* direction timer mode */
1851
1852#define BNDMODE_COMP 0x0000 /* boundary compare mode */
1853#define BNDMODE_ZERO 0x1000 /* boundary compare and zero mode */
1854#define BNDMODE_CAPT 0x2000 /* boundary capture mode */
1855#define BNDMODE_AEXT 0x3000 /* boundary auto-extend mode */
1856
1857/* Bit masks for OTP_CONTROL */
1858
1859#define FUSE_FADDR 0x1ff /* OTP/Fuse Address */
1860#define FIEN 0x800 /* OTP/Fuse Interrupt Enable */
1861#define nFIEN 0x0
1862#define FTESTDEC 0x1000 /* OTP/Fuse Test Decoder */
1863#define nFTESTDEC 0x0
1864#define FWRTEST 0x2000 /* OTP/Fuse Write Test */
1865#define nFWRTEST 0x0
1866#define FRDEN 0x4000 /* OTP/Fuse Read Enable */
1867#define nFRDEN 0x0
1868#define FWREN 0x8000 /* OTP/Fuse Write Enable */
1869#define nFWREN 0x0
1870
1871/* Bit masks for OTP_BEN */
1872
1873#define FBEN 0xffff /* OTP/Fuse Byte Enable */
1874
1875/* Bit masks for OTP_STATUS */
1876
1877#define FCOMP 0x1 /* OTP/Fuse Access Complete */
1878#define nFCOMP 0x0
1879#define FERROR 0x2 /* OTP/Fuse Access Error */
1880#define nFERROR 0x0
1881#define MMRGLOAD 0x10 /* Memory Mapped Register Gasket Load */
1882#define nMMRGLOAD 0x0
1883#define MMRGLOCK 0x20 /* Memory Mapped Register Gasket Lock */
1884#define nMMRGLOCK 0x0
1885#define FPGMEN 0x40 /* OTP/Fuse Program Enable */
1886#define nFPGMEN 0x0
1887
1888/* Bit masks for OTP_TIMING */
1889
1890#define USECDIV 0xff /* Micro Second Divider */
1891#define READACC 0x7f00 /* Read Access Time */
1892#define CPUMPRL 0x38000 /* Charge Pump Release Time */
1893#define CPUMPSU 0xc0000 /* Charge Pump Setup Time */
1894#define CPUMPHD 0xf00000 /* Charge Pump Hold Time */
1895#define PGMTIME 0xff000000 /* Program Time */
1896
1897/* Bit masks for SECURE_SYSSWT */
1898
1899#define EMUDABL 0x1 /* Emulation Disable. */
1900#define nEMUDABL 0x0
1901#define RSTDABL 0x2 /* Reset Disable */
1902#define nRSTDABL 0x0
1903#define L1IDABL 0x1c /* L1 Instruction Memory Disable. */
1904#define L1DADABL 0xe0 /* L1 Data Bank A Memory Disable. */
1905#define L1DBDABL 0x700 /* L1 Data Bank B Memory Disable. */
1906#define DMA0OVR 0x800 /* DMA0 Memory Access Override */
1907#define nDMA0OVR 0x0
1908#define DMA1OVR 0x1000 /* DMA1 Memory Access Override */
1909#define nDMA1OVR 0x0
1910#define EMUOVR 0x4000 /* Emulation Override */
1911#define nEMUOVR 0x0
1912#define OTPSEN 0x8000 /* OTP Secrets Enable. */
1913#define nOTPSEN 0x0
1914#define L2DABL 0x70000 /* L2 Memory Disable. */
1915
1916/* Bit masks for SECURE_CONTROL */
1917
1918#define SECURE0 0x1 /* SECURE 0 */
1919#define nSECURE0 0x0
1920#define SECURE1 0x2 /* SECURE 1 */
1921#define nSECURE1 0x0
1922#define SECURE2 0x4 /* SECURE 2 */
1923#define nSECURE2 0x0
1924#define SECURE3 0x8 /* SECURE 3 */
1925#define nSECURE3 0x0
1926
1927/* Bit masks for SECURE_STATUS */
1928
1929#define SECMODE 0x3 /* Secured Mode Control State */
1930#define NMI 0x4 /* Non Maskable Interrupt */
1931#define nNMI 0x0
1932#define AFVALID 0x8 /* Authentication Firmware Valid */
1933#define nAFVALID 0x0
1934#define AFEXIT 0x10 /* Authentication Firmware Exit */
1935#define nAFEXIT 0x0
1936#define SECSTAT 0xe0 /* Secure Status */
1937
1938
1939
1940#endif /* _DEF_BF51X_H */
diff --git a/arch/blackfin/mach-bf518/include/mach/dma.h b/arch/blackfin/mach-bf518/include/mach/dma.h
new file mode 100644
index 000000000000..bbd33c1706e2
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/dma.h
@@ -0,0 +1,33 @@
1/* mach/dma.h - arch-specific DMA defines
2 *
3 * Copyright 2004-2008 Analog Devices Inc.
4 *
5 * Licensed under the GPL-2 or later.
6 */
7
8#ifndef _MACH_DMA_H_
9#define _MACH_DMA_H_
10
11#define MAX_DMA_CHANNELS 16
12
13#define CH_PPI 0 /* PPI receive/transmit */
14#define CH_EMAC_RX 1 /* Ethernet MAC receive */
15#define CH_EMAC_TX 2 /* Ethernet MAC transmit */
16#define CH_SPORT0_RX 3 /* SPORT0 receive */
17#define CH_SPORT0_TX 4 /* SPORT0 transmit */
18#define CH_RSI 4 /* RSI */
19#define CH_SPORT1_RX 5 /* SPORT1 receive */
20#define CH_SPI1 5 /* SPI1 transmit/receive */
21#define CH_SPORT1_TX 6 /* SPORT1 transmit */
22#define CH_SPI0 7 /* SPI0 transmit/receive */
23#define CH_UART0_RX 8 /* UART0 receive */
24#define CH_UART0_TX 9 /* UART0 transmit */
25#define CH_UART1_RX 10 /* UART1 receive */
26#define CH_UART1_TX 11 /* UART1 transmit */
27
28#define CH_MEM_STREAM0_SRC 12 /* RX */
29#define CH_MEM_STREAM0_DEST 13 /* TX */
30#define CH_MEM_STREAM1_SRC 14 /* RX */
31#define CH_MEM_STREAM1_DEST 15 /* TX */
32
33#endif
diff --git a/arch/blackfin/mach-bf518/include/mach/gpio.h b/arch/blackfin/mach-bf518/include/mach/gpio.h
new file mode 100644
index 000000000000..9757683c3948
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/gpio.h
@@ -0,0 +1,60 @@
1/*
2 * File: arch/blackfin/mach-bf518/include/mach/gpio.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9
10#ifndef _MACH_GPIO_H_
11#define _MACH_GPIO_H_
12
13#define MAX_BLACKFIN_GPIOS 40
14
15#define GPIO_PF0 0
16#define GPIO_PF1 1
17#define GPIO_PF2 2
18#define GPIO_PF3 3
19#define GPIO_PF4 4
20#define GPIO_PF5 5
21#define GPIO_PF6 6
22#define GPIO_PF7 7
23#define GPIO_PF8 8
24#define GPIO_PF9 9
25#define GPIO_PF10 10
26#define GPIO_PF11 11
27#define GPIO_PF12 12
28#define GPIO_PF13 13
29#define GPIO_PF14 14
30#define GPIO_PF15 15
31#define GPIO_PG0 16
32#define GPIO_PG1 17
33#define GPIO_PG2 18
34#define GPIO_PG3 19
35#define GPIO_PG4 20
36#define GPIO_PG5 21
37#define GPIO_PG6 22
38#define GPIO_PG7 23
39#define GPIO_PG8 24
40#define GPIO_PG9 25
41#define GPIO_PG10 26
42#define GPIO_PG11 27
43#define GPIO_PG12 28
44#define GPIO_PG13 29
45#define GPIO_PG14 30
46#define GPIO_PG15 31
47#define GPIO_PH0 32
48#define GPIO_PH1 33
49#define GPIO_PH2 34
50#define GPIO_PH3 35
51#define GPIO_PH4 36
52#define GPIO_PH5 37
53#define GPIO_PH6 38
54#define GPIO_PH7 39
55
56#define PORT_F GPIO_PF0
57#define PORT_G GPIO_PG0
58#define PORT_H GPIO_PH0
59
60#endif /* _MACH_GPIO_H_ */
diff --git a/arch/blackfin/mach-bf518/include/mach/irq.h b/arch/blackfin/mach-bf518/include/mach/irq.h
new file mode 100644
index 000000000000..3ff0f093313d
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/irq.h
@@ -0,0 +1,260 @@
1/*
2 * file: include/asm-blackfin/mach-bf518/irq.h
3 * based on: include/asm-blackfin/mach-bf527/irq.h
4 * author: Michael Hennerich (michael.hennerich@analog.com)
5 *
6 * created:
7 * description:
8 * system mmr register map
9 * rev:
10 *
11 * modified:
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * this program is distributed in the hope that it will be useful,
22 * but without any warranty; without even the implied warranty of
23 * merchantability or fitness for a particular purpose. see the
24 * gnu general public license for more details.
25 *
26 * you should have received a copy of the gnu general public license
27 * along with this program; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */
31
32#ifndef _BF518_IRQ_H_
33#define _BF518_IRQ_H_
34
35/*
36 * Interrupt source definitions
37 Event Source Core Event Name
38 Core Emulation **
39 Events (highest priority) EMU 0
40 Reset RST 1
41 NMI NMI 2
42 Exception EVX 3
43 Reserved -- 4
44 Hardware Error IVHW 5
45 Core Timer IVTMR 6 *
46
47 .....
48
49 Software Interrupt 1 IVG14 31
50 Software Interrupt 2 --
51 (lowest priority) IVG15 32 *
52*/
53
54#define NR_PERI_INTS (2 * 32)
55
56/* The ABSTRACT IRQ definitions */
57/** the first seven of the following are fixed, the rest you change if you need to **/
58#define IRQ_EMU 0 /* Emulation */
59#define IRQ_RST 1 /* reset */
60#define IRQ_NMI 2 /* Non Maskable */
61#define IRQ_EVX 3 /* Exception */
62#define IRQ_UNUSED 4 /* - unused interrupt */
63#define IRQ_HWERR 5 /* Hardware Error */
64#define IRQ_CORETMR 6 /* Core timer */
65
66#define BFIN_IRQ(x) ((x) + 7)
67
68#define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */
69#define IRQ_DMA0_ERROR BFIN_IRQ(1) /* DMA Error 0 (generic) */
70#define IRQ_DMAR0_BLK BFIN_IRQ(2) /* DMAR0 Block Interrupt */
71#define IRQ_DMAR1_BLK BFIN_IRQ(3) /* DMAR1 Block Interrupt */
72#define IRQ_DMAR0_OVR BFIN_IRQ(4) /* DMAR0 Overflow Error */
73#define IRQ_DMAR1_OVR BFIN_IRQ(5) /* DMAR1 Overflow Error */
74#define IRQ_PPI_ERROR BFIN_IRQ(6) /* PPI Error */
75#define IRQ_MAC_ERROR BFIN_IRQ(7) /* MAC Status */
76#define IRQ_SPORT0_ERROR BFIN_IRQ(8) /* SPORT0 Status */
77#define IRQ_SPORT1_ERROR BFIN_IRQ(9) /* SPORT1 Status */
78#define IRQ_PTP_ERROR BFIN_IRQ(10) /* PTP Error Interrupt */
79#define IRQ_UART0_ERROR BFIN_IRQ(12) /* UART0 Status */
80#define IRQ_UART1_ERROR BFIN_IRQ(13) /* UART1 Status */
81#define IRQ_RTC BFIN_IRQ(14) /* RTC */
82#define IRQ_PPI BFIN_IRQ(15) /* DMA Channel 0 (PPI) */
83#define IRQ_SPORT0_RX BFIN_IRQ(16) /* DMA 3 Channel (SPORT0 RX) */
84#define IRQ_SPORT0_TX BFIN_IRQ(17) /* DMA 4 Channel (SPORT0 TX) */
85#define IRQ_RSI BFIN_IRQ(17) /* DMA 4 Channel (RSI) */
86#define IRQ_SPORT1_RX BFIN_IRQ(18) /* DMA 5 Channel (SPORT1 RX/SPI) */
87#define IRQ_SPI1 BFIN_IRQ(18) /* DMA 5 Channel (SPI1) */
88#define IRQ_SPORT1_TX BFIN_IRQ(19) /* DMA 6 Channel (SPORT1 TX) */
89#define IRQ_TWI BFIN_IRQ(20) /* TWI */
90#define IRQ_SPI0 BFIN_IRQ(21) /* DMA 7 Channel (SPI0) */
91#define IRQ_UART0_RX BFIN_IRQ(22) /* DMA8 Channel (UART0 RX) */
92#define IRQ_UART0_TX BFIN_IRQ(23) /* DMA9 Channel (UART0 TX) */
93#define IRQ_UART1_RX BFIN_IRQ(24) /* DMA10 Channel (UART1 RX) */
94#define IRQ_UART1_TX BFIN_IRQ(25) /* DMA11 Channel (UART1 TX) */
95#define IRQ_OPTSEC BFIN_IRQ(26) /* OTPSEC Interrupt */
96#define IRQ_CNT BFIN_IRQ(27) /* GP Counter */
97#define IRQ_MAC_RX BFIN_IRQ(28) /* DMA1 Channel (MAC RX) */
98#define IRQ_PORTH_INTA BFIN_IRQ(29) /* Port H Interrupt A */
99#define IRQ_MAC_TX BFIN_IRQ(30) /* DMA2 Channel (MAC TX) */
100#define IRQ_PORTH_INTB BFIN_IRQ(31) /* Port H Interrupt B */
101#define IRQ_TIMER0 BFIN_IRQ(32) /* Timer 0 */
102#define IRQ_TIMER1 BFIN_IRQ(33) /* Timer 1 */
103#define IRQ_TIMER2 BFIN_IRQ(34) /* Timer 2 */
104#define IRQ_TIMER3 BFIN_IRQ(35) /* Timer 3 */
105#define IRQ_TIMER4 BFIN_IRQ(36) /* Timer 4 */
106#define IRQ_TIMER5 BFIN_IRQ(37) /* Timer 5 */
107#define IRQ_TIMER6 BFIN_IRQ(38) /* Timer 6 */
108#define IRQ_TIMER7 BFIN_IRQ(39) /* Timer 7 */
109#define IRQ_PORTG_INTA BFIN_IRQ(40) /* Port G Interrupt A */
110#define IRQ_PORTG_INTB BFIN_IRQ(41) /* Port G Interrupt B */
111#define IRQ_MEM_DMA0 BFIN_IRQ(42) /* MDMA Stream 0 */
112#define IRQ_MEM_DMA1 BFIN_IRQ(43) /* MDMA Stream 1 */
113#define IRQ_WATCH BFIN_IRQ(44) /* Software Watchdog Timer */
114#define IRQ_PORTF_INTA BFIN_IRQ(45) /* Port F Interrupt A */
115#define IRQ_PORTF_INTB BFIN_IRQ(46) /* Port F Interrupt B */
116#define IRQ_SPI0_ERROR BFIN_IRQ(47) /* SPI0 Status */
117#define IRQ_SPI1_ERROR BFIN_IRQ(48) /* SPI1 Error */
118#define IRQ_RSI_INT0 BFIN_IRQ(51) /* RSI Interrupt0 */
119#define IRQ_RSI_INT1 BFIN_IRQ(52) /* RSI Interrupt1 */
120#define IRQ_PWM_TRIP BFIN_IRQ(53) /* PWM Trip Interrupt */
121#define IRQ_PWM_SYNC BFIN_IRQ(54) /* PWM Sync Interrupt */
122#define IRQ_PTP_STAT BFIN_IRQ(55) /* PTP Stat Interrupt */
123
124#define SYS_IRQS BFIN_IRQ(63) /* 70 */
125
126#define IRQ_PF0 71
127#define IRQ_PF1 72
128#define IRQ_PF2 73
129#define IRQ_PF3 74
130#define IRQ_PF4 75
131#define IRQ_PF5 76
132#define IRQ_PF6 77
133#define IRQ_PF7 78
134#define IRQ_PF8 79
135#define IRQ_PF9 80
136#define IRQ_PF10 81
137#define IRQ_PF11 82
138#define IRQ_PF12 83
139#define IRQ_PF13 84
140#define IRQ_PF14 85
141#define IRQ_PF15 86
142
143#define IRQ_PG0 87
144#define IRQ_PG1 88
145#define IRQ_PG2 89
146#define IRQ_PG3 90
147#define IRQ_PG4 91
148#define IRQ_PG5 92
149#define IRQ_PG6 93
150#define IRQ_PG7 94
151#define IRQ_PG8 95
152#define IRQ_PG9 96
153#define IRQ_PG10 97
154#define IRQ_PG11 98
155#define IRQ_PG12 99
156#define IRQ_PG13 100
157#define IRQ_PG14 101
158#define IRQ_PG15 102
159
160#define IRQ_PH0 103
161#define IRQ_PH1 104
162#define IRQ_PH2 105
163#define IRQ_PH3 106
164#define IRQ_PH4 107
165#define IRQ_PH5 108
166#define IRQ_PH6 109
167#define IRQ_PH7 110
168#define IRQ_PH8 111
169#define IRQ_PH9 112
170#define IRQ_PH10 113
171#define IRQ_PH11 114
172#define IRQ_PH12 115
173#define IRQ_PH13 116
174#define IRQ_PH14 117
175#define IRQ_PH15 118
176
177#define GPIO_IRQ_BASE IRQ_PF0
178
179#define NR_IRQS (IRQ_PH15 + 1)
180
181#define IVG7 7
182#define IVG8 8
183#define IVG9 9
184#define IVG10 10
185#define IVG11 11
186#define IVG12 12
187#define IVG13 13
188#define IVG14 14
189#define IVG15 15
190
191/* IAR0 BIT FIELDS */
192#define IRQ_PLL_WAKEUP_POS 0
193#define IRQ_DMA0_ERROR_POS 4
194#define IRQ_DMAR0_BLK_POS 8
195#define IRQ_DMAR1_BLK_POS 12
196#define IRQ_DMAR0_OVR_POS 16
197#define IRQ_DMAR1_OVR_POS 20
198#define IRQ_PPI_ERROR_POS 24
199#define IRQ_MAC_ERROR_POS 28
200
201/* IAR1 BIT FIELDS */
202#define IRQ_SPORT0_ERROR_POS 0
203#define IRQ_SPORT1_ERROR_POS 4
204#define IRQ_PTP_ERROR_POS 8
205#define IRQ_UART0_ERROR_POS 16
206#define IRQ_UART1_ERROR_POS 20
207#define IRQ_RTC_POS 24
208#define IRQ_PPI_POS 28
209
210/* IAR2 BIT FIELDS */
211#define IRQ_SPORT0_RX_POS 0
212#define IRQ_SPORT0_TX_POS 4
213#define IRQ_RSI_POS 4
214#define IRQ_SPORT1_RX_POS 8
215#define IRQ_SPI1_POS 8
216#define IRQ_SPORT1_TX_POS 12
217#define IRQ_TWI_POS 16
218#define IRQ_SPI0_POS 20
219#define IRQ_UART0_RX_POS 24
220#define IRQ_UART0_TX_POS 28
221
222/* IAR3 BIT FIELDS */
223#define IRQ_UART1_RX_POS 0
224#define IRQ_UART1_TX_POS 4
225#define IRQ_OPTSEC_POS 8
226#define IRQ_CNT_POS 12
227#define IRQ_MAC_RX_POS 16
228#define IRQ_PORTH_INTA_POS 20
229#define IRQ_MAC_TX_POS 24
230#define IRQ_PORTH_INTB_POS 28
231
232/* IAR4 BIT FIELDS */
233#define IRQ_TIMER0_POS 0
234#define IRQ_TIMER1_POS 4
235#define IRQ_TIMER2_POS 8
236#define IRQ_TIMER3_POS 12
237#define IRQ_TIMER4_POS 16
238#define IRQ_TIMER5_POS 20
239#define IRQ_TIMER6_POS 24
240#define IRQ_TIMER7_POS 28
241
242/* IAR5 BIT FIELDS */
243#define IRQ_PORTG_INTA_POS 0
244#define IRQ_PORTG_INTB_POS 4
245#define IRQ_MEM_DMA0_POS 8
246#define IRQ_MEM_DMA1_POS 12
247#define IRQ_WATCH_POS 16
248#define IRQ_PORTF_INTA_POS 20
249#define IRQ_PORTF_INTB_POS 24
250#define IRQ_SPI0_ERROR_POS 28
251
252/* IAR6 BIT FIELDS */
253#define IRQ_SPI1_ERROR_POS 0
254#define IRQ_RSI_INT0_POS 12
255#define IRQ_RSI_INT1_POS 16
256#define IRQ_PWM_TRIP_POS 20
257#define IRQ_PWM_SYNC_POS 24
258#define IRQ_PTP_STAT_POS 28
259
260#endif /* _BF518_IRQ_H_ */
diff --git a/arch/blackfin/mach-bf518/include/mach/mem_map.h b/arch/blackfin/mach-bf518/include/mach/mem_map.h
new file mode 100644
index 000000000000..62bcc781bfaa
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/mem_map.h
@@ -0,0 +1,108 @@
1/*
2 * file: include/asm-blackfin/mach-bf518/mem_map.h
3 * based on: include/asm-blackfin/mach-bf527/mem_map.h
4 * author: Bryan Wu <cooloney@kernel.org>
5 *
6 * created:
7 * description:
8 * Memory MAP Common header file for blackfin BF518/6/4/2 of processors.
9 * rev:
10 *
11 * modified:
12 *
13 * bugs: enter bugs at http://blackfin.uclinux.org/
14 *
15 * this program is free software; you can redistribute it and/or modify
16 * it under the terms of the gnu general public license as published by
17 * the free software foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * this program is distributed in the hope that it will be useful,
21 * but without any warranty; without even the implied warranty of
22 * merchantability or fitness for a particular purpose. see the
23 * gnu general public license for more details.
24 *
25 * you should have received a copy of the gnu general public license
26 * along with this program; see the file copying.
27 * if not, write to the free software foundation,
28 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
29 */
30
31#ifndef _MEM_MAP_518_H_
32#define _MEM_MAP_518_H_
33
34#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
35#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
36
37/* Async Memory Banks */
38#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
39#define ASYNC_BANK3_SIZE 0x00100000 /* 1M */
40#define ASYNC_BANK2_BASE 0x20200000 /* Async Bank 2 */
41#define ASYNC_BANK2_SIZE 0x00100000 /* 1M */
42#define ASYNC_BANK1_BASE 0x20100000 /* Async Bank 1 */
43#define ASYNC_BANK1_SIZE 0x00100000 /* 1M */
44#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
45#define ASYNC_BANK0_SIZE 0x00100000 /* 1M */
46
47/* Boot ROM Memory */
48
49#define BOOT_ROM_START 0xEF000000
50#define BOOT_ROM_LENGTH 0x8000
51
52/* Level 1 Memory */
53
54/* Memory Map for ADSP-BF518/6/4/2 processors */
55
56#ifdef CONFIG_BFIN_ICACHE
57#define BFIN_ICACHESIZE (16 * 1024)
58#else
59#define BFIN_ICACHESIZE (0)
60#endif
61
62#define L1_CODE_START 0xFFA00000
63#define L1_DATA_A_START 0xFF800000
64#define L1_DATA_B_START 0xFF900000
65
66#define L1_CODE_LENGTH 0xC000
67
68#ifdef CONFIG_BFIN_DCACHE
69
70#ifdef CONFIG_BFIN_DCACHE_BANKA
71#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
72#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
73#define L1_DATA_B_LENGTH 0x8000
74#define BFIN_DCACHESIZE (16 * 1024)
75#define BFIN_DSUPBANKS 1
76#else
77#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
78#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
79#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
80#define BFIN_DCACHESIZE (32 * 1024)
81#define BFIN_DSUPBANKS 2
82#endif
83
84#else
85#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
86#define L1_DATA_A_LENGTH 0x8000
87#define L1_DATA_B_LENGTH 0x8000
88#define BFIN_DCACHESIZE 0
89#define BFIN_DSUPBANKS 0
90#endif /*CONFIG_BFIN_DCACHE */
91
92/* Level 2 Memory - none */
93
94#define L2_START 0
95#define L2_LENGTH 0
96
97/* Scratch Pad Memory */
98
99#define L1_SCRATCH_START 0xFFB00000
100#define L1_SCRATCH_LENGTH 0x1000
101
102#define GET_PDA_SAFE(preg) \
103 preg.l = _cpu_pda; \
104 preg.h = _cpu_pda;
105
106#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
107
108#endif /* _MEM_MAP_518_H_ */
diff --git a/arch/blackfin/mach-bf518/include/mach/portmux.h b/arch/blackfin/mach-bf518/include/mach/portmux.h
new file mode 100644
index 000000000000..ac16d54734d4
--- /dev/null
+++ b/arch/blackfin/mach-bf518/include/mach/portmux.h
@@ -0,0 +1,188 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define MAX_RESOURCES MAX_BLACKFIN_GPIOS
5
6/* EMAC MII/RMII Port Mux */
7#define P_MII0_ETxD2 (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(0))
8#define P_MII0_ERxD2 (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(0))
9#define P_MII0_ETxD3 (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(0))
10#define P_MII0_ERxD3 (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(0))
11#define P_MII0_ERxCLK (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(0))
12#define P_MII0_ERxDV (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(0))
13#define P_MII0_COL (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(0))
14
15#define P_MII0_MDC (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(0))
16#define P_MII0_MDIO (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(0))
17#define P_MII0_ETxD0 (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(0))
18#define P_MII0_ERxD0 (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(0))
19#define P_MII0_ETxD1 (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(0))
20#define P_MII0_ERxD1 (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(0))
21#define P_MII0_ETxEN (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(0))
22#define P_MII0_PHYINT (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(0))
23#define P_MII0_CRS (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(0))
24#define P_MII0_ERxER (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(0))
25#define P_MII0_TxCLK (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(0))
26
27#define P_MII0 {\
28 P_MII0_ETxD0, \
29 P_MII0_ETxD1, \
30 P_MII0_ETxD2, \
31 P_MII0_ETxD3, \
32 P_MII0_ETxEN, \
33 P_MII0_TxCLK, \
34 P_MII0_PHYINT, \
35 P_MII0_COL, \
36 P_MII0_ERxD0, \
37 P_MII0_ERxD1, \
38 P_MII0_ERxD2, \
39 P_MII0_ERxD3, \
40 P_MII0_ERxDV, \
41 P_MII0_ERxCLK, \
42 P_MII0_ERxER, \
43 P_MII0_CRS, \
44 P_MII0_MDC, \
45 P_MII0_MDIO, 0}
46
47#define P_RMII0 {\
48 P_MII0_ETxD0, \
49 P_MII0_ETxD1, \
50 P_MII0_ETxEN, \
51 P_MII0_ERxD0, \
52 P_MII0_ERxD1, \
53 P_MII0_ERxER, \
54 P_MII0_TxCLK, \
55 P_MII0_PHYINT, \
56 P_MII0_CRS, \
57 P_MII0_MDC, \
58 P_MII0_MDIO, 0}
59
60/* PPI Port Mux */
61#define P_PPI0_D0 (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(1))
62#define P_PPI0_D1 (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(1))
63#define P_PPI0_D2 (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(1))
64#define P_PPI0_D3 (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(1))
65#define P_PPI0_D4 (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(1))
66#define P_PPI0_D5 (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(1))
67#define P_PPI0_D6 (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(1))
68#define P_PPI0_D7 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(1))
69#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(1))
70#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(1))
71#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(1))
72#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(1))
73#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(1))
74#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(1))
75#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(1))
76#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(1))
77
78#define P_PPI0_CLK (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(1))
79#define P_PPI0_FS1 (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(1))
80#define P_PPI0_FS2 (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(1))
81#define P_PPI0_FS3 (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(1))
82
83/* SPI Port Mux */
84#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(0))
85#define P_SPI0_SCK (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(0))
86#define P_SPI0_MISO (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(0))
87#define P_SPI0_MOSI (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(0))
88
89#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(0))
90#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PG15) | P_FUNCT(0))
91#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(2))
92#define P_SPI0_SSEL4 (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(2))
93#define P_SPI0_SSEL5 (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(2))
94
95#define P_SPI1_SS (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(1))
96#define P_SPI1_SCK (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(1))
97#define P_SPI1_MISO (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(1))
98#define P_SPI1_MOSI (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(1))
99
100#define P_SPI1_SSEL1 (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(2))
101#define P_SPI1_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF0) | P_FUNCT(2))
102#define P_SPI1_SSEL3 (P_DEFINED | P_IDENT(GPIO_PG0) | P_FUNCT(2))
103#define P_SPI1_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF8) | P_FUNCT(2))
104#define P_SPI1_SSEL5 (P_DEFINED | P_IDENT(GPIO_PG11) | P_FUNCT(2))
105
106/* SPORT Port Mux */
107#define P_SPORT0_DRPRI (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(0))
108#define P_SPORT0_RSCLK (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(0))
109#define P_SPORT0_RFS (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(0))
110#define P_SPORT0_TFS (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(0))
111#define P_SPORT0_DTPRI (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(0))
112#define P_SPORT0_TSCLK (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(0))
113#define P_SPORT0_DTSEC (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(0))
114#define P_SPORT0_DRSEC (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(0))
115
116#define P_SPORT1_DRPRI (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(0))
117#define P_SPORT1_RFS (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(0))
118#define P_SPORT1_RSCLK (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(0))
119#define P_SPORT1_DTPRI (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(0))
120#define P_SPORT1_TFS (P_DEFINED | P_IDENT(GPIO_PH4) | P_FUNCT(0))
121#define P_SPORT1_TSCLK (P_DEFINED | P_IDENT(GPIO_PH5) | P_FUNCT(0))
122#define P_SPORT1_DTSEC (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(0))
123#define P_SPORT1_DRSEC (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(0))
124
125/* UART Port Mux */
126#define P_UART0_TX (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(1))
127#define P_UART0_RX (P_DEFINED | P_IDENT(GPIO_PG10) | P_FUNCT(1))
128
129#define P_UART1_TX (P_DEFINED | P_IDENT(GPIO_PH6) | P_FUNCT(1))
130#define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(1))
131
132/* Timer */
133#define P_TMRCLK (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(2))
134#define P_TMR0 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(2))
135#define P_TMR1 (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(2))
136#define P_TMR2 (P_DEFINED | P_IDENT(GPIO_PF9) | P_FUNCT(2))
137#define P_TMR3 (P_DEFINED | P_IDENT(GPIO_PF10) | P_FUNCT(2))
138#define P_TMR4 (P_DEFINED | P_IDENT(GPIO_PG9) | P_FUNCT(2))
139#define P_TMR5 (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(2))
140#define P_TMR6 (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(2))
141#define P_TMR7 (P_DEFINED | P_IDENT(GPIO_PH7) | P_FUNCT(2))
142
143/* DMA */
144#define P_DMAR1 (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(1))
145#define P_DMAR0 (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(1))
146
147/* TWI */
148#define P_TWI0_SCL (P_DONTCARE)
149#define P_TWI0_SDA (P_DONTCARE)
150
151/* PWM */
152#define P_PWM0_AH (P_DEFINED | P_IDENT(GPIO_PF1) | P_FUNCT(2))
153#define P_PWM0_AL (P_DEFINED | P_IDENT(GPIO_PF2) | P_FUNCT(2))
154#define P_PWM0_BH (P_DEFINED | P_IDENT(GPIO_PF3) | P_FUNCT(2))
155#define P_PWM0_BL (P_DEFINED | P_IDENT(GPIO_PF4) | P_FUNCT(2))
156#define P_PWM0_CH (P_DEFINED | P_IDENT(GPIO_PF5) | P_FUNCT(2))
157#define P_PWM0_CL (P_DEFINED | P_IDENT(GPIO_PF6) | P_FUNCT(2))
158#define P_PWM0_SYNC (P_DEFINED | P_IDENT(GPIO_PF7) | P_FUNCT(2))
159
160#define P_PWM1_AH (P_DEFINED | P_IDENT(GPIO_PF11) | P_FUNCT(2))
161#define P_PWM1_AL (P_DEFINED | P_IDENT(GPIO_PF12) | P_FUNCT(2))
162#define P_PWM1_BH (P_DEFINED | P_IDENT(GPIO_PF13) | P_FUNCT(2))
163#define P_PWM1_BL (P_DEFINED | P_IDENT(GPIO_PF14) | P_FUNCT(2))
164#define P_PWM1_CH (P_DEFINED | P_IDENT(GPIO_PG1) | P_FUNCT(2))
165#define P_PWM1_CL (P_DEFINED | P_IDENT(GPIO_PG2) | P_FUNCT(2))
166#define P_PWM1_SYNC (P_DEFINED | P_IDENT(GPIO_PF15) | P_FUNCT(2))
167
168#define P_PWM_TRIPB (P_DEFINED | P_IDENT(GPIO_PG14) | P_FUNCT(2))
169
170/* RSI */
171#define P_RSI_DATA0 (P_DEFINED | P_IDENT(GPIO_PG3) | P_FUNCT(1))
172#define P_RSI_DATA1 (P_DEFINED | P_IDENT(GPIO_PG4) | P_FUNCT(1))
173#define P_RSI_DATA2 (P_DEFINED | P_IDENT(GPIO_PG5) | P_FUNCT(1))
174#define P_RSI_DATA3 (P_DEFINED | P_IDENT(GPIO_PG6) | P_FUNCT(1))
175#define P_RSI_DATA4 (P_DEFINED | P_IDENT(GPIO_PH0) | P_FUNCT(2))
176#define P_RSI_DATA5 (P_DEFINED | P_IDENT(GPIO_PH1) | P_FUNCT(2))
177#define P_RSI_DATA6 (P_DEFINED | P_IDENT(GPIO_PH2) | P_FUNCT(2))
178#define P_RSI_DATA7 (P_DEFINED | P_IDENT(GPIO_PH3) | P_FUNCT(2))
179#define P_RSI_CMD (P_DEFINED | P_IDENT(GPIO_PG7) | P_FUNCT(1))
180#define P_RSI_CLK (P_DEFINED | P_IDENT(GPIO_PG8) | P_FUNCT(1))
181
182/* PTP */
183#define P_PTP_PPS (P_DEFINED | P_IDENT(GPIO_PG12) | P_FUNCT(2))
184#define P_PTP_CLKOUT (P_DEFINED | P_IDENT(GPIO_PG13) | P_FUNCT(2))
185
186#define P_HWAIT (P_DEFINED | P_IDENT(GPIO_PG000000000) | P_FUNCT(1))
187
188#endif /* _MACH_PORTMUX_H_ */
diff --git a/arch/blackfin/mach-bf518/ints-priority.c b/arch/blackfin/mach-bf518/ints-priority.c
new file mode 100644
index 000000000000..3151fd5501ca
--- /dev/null
+++ b/arch/blackfin/mach-bf518/ints-priority.c
@@ -0,0 +1,99 @@
1/*
2 * File: arch/blackfin/mach-bf518/ints-priority.c
3 * Based on: arch/blackfin/mach-bf527/ints-priority.c
4 * Author: Bryan Wu <cooloney@kernel.org>
5 *
6 * Created:
7 * Description: Set up the interrupt priorities
8 *
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/module.h>
31#include <linux/irq.h>
32#include <asm/blackfin.h>
33
34void __init program_IAR(void)
35{
36 /* Program the IAR0 Register with the configured priority */
37 bfin_write_SIC_IAR0(((CONFIG_IRQ_PLL_WAKEUP - 7) << IRQ_PLL_WAKEUP_POS) |
38 ((CONFIG_IRQ_DMA0_ERROR - 7) << IRQ_DMA0_ERROR_POS) |
39 ((CONFIG_IRQ_DMAR0_BLK - 7) << IRQ_DMAR0_BLK_POS) |
40 ((CONFIG_IRQ_DMAR1_BLK - 7) << IRQ_DMAR1_BLK_POS) |
41 ((CONFIG_IRQ_DMAR0_OVR - 7) << IRQ_DMAR0_OVR_POS) |
42 ((CONFIG_IRQ_DMAR1_OVR - 7) << IRQ_DMAR1_OVR_POS) |
43 ((CONFIG_IRQ_PPI_ERROR - 7) << IRQ_PPI_ERROR_POS) |
44 ((CONFIG_IRQ_MAC_ERROR - 7) << IRQ_MAC_ERROR_POS));
45
46
47 bfin_write_SIC_IAR1(((CONFIG_IRQ_SPORT0_ERROR - 7) << IRQ_SPORT0_ERROR_POS) |
48 ((CONFIG_IRQ_SPORT1_ERROR - 7) << IRQ_SPORT1_ERROR_POS) |
49 ((CONFIG_IRQ_PTP_ERROR - 7) << IRQ_PTP_ERROR_POS) |
50 ((CONFIG_IRQ_UART0_ERROR - 7) << IRQ_UART0_ERROR_POS) |
51 ((CONFIG_IRQ_UART1_ERROR - 7) << IRQ_UART1_ERROR_POS) |
52 ((CONFIG_IRQ_RTC - 7) << IRQ_RTC_POS) |
53 ((CONFIG_IRQ_PPI - 7) << IRQ_PPI_POS));
54
55 bfin_write_SIC_IAR2(((CONFIG_IRQ_SPORT0_RX - 7) << IRQ_SPORT0_RX_POS) |
56 ((CONFIG_IRQ_SPORT0_TX - 7) << IRQ_SPORT0_TX_POS) |
57 ((CONFIG_IRQ_SPORT1_RX - 7) << IRQ_SPORT1_RX_POS) |
58 ((CONFIG_IRQ_SPORT1_TX - 7) << IRQ_SPORT1_TX_POS) |
59 ((CONFIG_IRQ_TWI - 7) << IRQ_TWI_POS) |
60 ((CONFIG_IRQ_SPI0 - 7) << IRQ_SPI0_POS) |
61 ((CONFIG_IRQ_UART0_RX - 7) << IRQ_UART0_RX_POS) |
62 ((CONFIG_IRQ_UART0_TX - 7) << IRQ_UART0_TX_POS));
63
64 bfin_write_SIC_IAR3(((CONFIG_IRQ_UART1_RX - 7) << IRQ_UART1_RX_POS) |
65 ((CONFIG_IRQ_UART1_TX - 7) << IRQ_UART1_TX_POS) |
66 ((CONFIG_IRQ_OPTSEC - 7) << IRQ_OPTSEC_POS) |
67 ((CONFIG_IRQ_CNT - 7) << IRQ_CNT_POS) |
68 ((CONFIG_IRQ_MAC_RX - 7) << IRQ_MAC_RX_POS) |
69 ((CONFIG_IRQ_PORTH_INTA - 7) << IRQ_PORTH_INTA_POS) |
70 ((CONFIG_IRQ_MAC_TX - 7) << IRQ_MAC_TX_POS) |
71 ((CONFIG_IRQ_PORTH_INTB - 7) << IRQ_PORTH_INTB_POS));
72
73 bfin_write_SIC_IAR4(((CONFIG_IRQ_TIMER0 - 7) << IRQ_TIMER0_POS) |
74 ((CONFIG_IRQ_TIMER1 - 7) << IRQ_TIMER1_POS) |
75 ((CONFIG_IRQ_TIMER2 - 7) << IRQ_TIMER2_POS) |
76 ((CONFIG_IRQ_TIMER3 - 7) << IRQ_TIMER3_POS) |
77 ((CONFIG_IRQ_TIMER4 - 7) << IRQ_TIMER4_POS) |
78 ((CONFIG_IRQ_TIMER5 - 7) << IRQ_TIMER5_POS) |
79 ((CONFIG_IRQ_TIMER6 - 7) << IRQ_TIMER6_POS) |
80 ((CONFIG_IRQ_TIMER7 - 7) << IRQ_TIMER7_POS));
81
82 bfin_write_SIC_IAR5(((CONFIG_IRQ_PORTG_INTA - 7) << IRQ_PORTG_INTA_POS) |
83 ((CONFIG_IRQ_PORTG_INTB - 7) << IRQ_PORTG_INTB_POS) |
84 ((CONFIG_IRQ_MEM_DMA0 - 7) << IRQ_MEM_DMA0_POS) |
85 ((CONFIG_IRQ_MEM_DMA1 - 7) << IRQ_MEM_DMA1_POS) |
86 ((CONFIG_IRQ_WATCH - 7) << IRQ_WATCH_POS) |
87 ((CONFIG_IRQ_PORTF_INTA - 7) << IRQ_PORTF_INTA_POS) |
88 ((CONFIG_IRQ_PORTF_INTB - 7) << IRQ_PORTF_INTB_POS) |
89 ((CONFIG_IRQ_SPI0_ERROR - 7) << IRQ_SPI0_ERROR_POS));
90
91 bfin_write_SIC_IAR6(((CONFIG_IRQ_SPI1_ERROR - 7) << IRQ_SPI1_ERROR_POS) |
92 ((CONFIG_IRQ_RSI_INT0 - 7) << IRQ_RSI_INT0_POS) |
93 ((CONFIG_IRQ_RSI_INT1 - 7) << IRQ_RSI_INT1_POS) |
94 ((CONFIG_IRQ_PWM_TRIP - 7) << IRQ_PWM_TRIP_POS) |
95 ((CONFIG_IRQ_PWM_SYNC - 7) << IRQ_PWM_SYNC_POS) |
96 ((CONFIG_IRQ_PTP_STAT - 7) << IRQ_PTP_STAT_POS));
97
98 SSYNC();
99}
diff --git a/arch/blackfin/mach-bf527/Kconfig b/arch/blackfin/mach-bf527/Kconfig
index 3cde4beeb214..8438ec6d6679 100644
--- a/arch/blackfin/mach-bf527/Kconfig
+++ b/arch/blackfin/mach-bf527/Kconfig
@@ -168,29 +168,29 @@ config IRQ_MAC_TX
168config IRQ_PORTH_INTB 168config IRQ_PORTH_INTB
169 int "IRQ_PORTH_INTB" 169 int "IRQ_PORTH_INTB"
170 default 11 170 default 11
171config IRQ_TMR0 171config IRQ_TIMER0
172 int "IRQ_TMR0" 172 int "IRQ_TIMER0"
173 default 12 173 default 8
174config IRQ_TMR1 174config IRQ_TIMER1
175 int "IRQ_TMR1" 175 int "IRQ_TIMER1"
176 default 12 176 default 12
177config IRQ_TMR2 177config IRQ_TIMER2
178 int "IRQ_TMR2" 178 int "IRQ_TIMER2"
179 default 12 179 default 12
180config IRQ_TMR3 180config IRQ_TIMER3
181 int "IRQ_TMR3" 181 int "IRQ_TIMER3"
182 default 12 182 default 12
183config IRQ_TMR4 183config IRQ_TIMER4
184 int "IRQ_TMR4" 184 int "IRQ_TIMER4"
185 default 12 185 default 12
186config IRQ_TMR5 186config IRQ_TIMER5
187 int "IRQ_TMR5" 187 int "IRQ_TIMER5"
188 default 12 188 default 12
189config IRQ_TMR6 189config IRQ_TIMER6
190 int "IRQ_TMR6" 190 int "IRQ_TIMER6"
191 default 12 191 default 12
192config IRQ_TMR7 192config IRQ_TIMER7
193 int "IRQ_TMR7" 193 int "IRQ_TIMER7"
194 default 12 194 default 12
195config IRQ_PORTG_INTA 195config IRQ_PORTG_INTA
196 int "IRQ_PORTG_INTA" 196 int "IRQ_PORTG_INTA"
diff --git a/arch/blackfin/mach-bf527/Makefile b/arch/blackfin/mach-bf527/Makefile
index 4eddb580319c..4a6cdafab8ce 100644
--- a/arch/blackfin/mach-bf527/Makefile
+++ b/arch/blackfin/mach-bf527/Makefile
@@ -2,6 +2,4 @@
2# arch/blackfin/mach-bf527/Makefile 2# arch/blackfin/mach-bf527/Makefile
3# 3#
4 4
5extra-y := head.o
6
7obj-y := ints-priority.o dma.o 5obj-y := ints-priority.o dma.o
diff --git a/arch/blackfin/mach-bf527/boards/cm_bf527.c b/arch/blackfin/mach-bf527/boards/cm_bf527.c
index 9ea440bbb13d..a2c3578f4b6c 100644
--- a/arch/blackfin/mach-bf527/boards/cm_bf527.c
+++ b/arch/blackfin/mach-bf527/boards/cm_bf527.c
@@ -61,51 +61,40 @@ const char bfin_board_name[] = "Bluetechnix CM-BF527";
61 * Driver needs to know address, irq and flag pin. 61 * Driver needs to know address, irq and flag pin.
62 */ 62 */
63 63
64#define ISP1761_BASE 0x203C0000
65#define ISP1761_IRQ IRQ_PF7
66
67#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 64#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
68static struct resource bfin_isp1761_resources[] = { 65#include <linux/usb/isp1760.h>
66static struct resource bfin_isp1760_resources[] = {
69 [0] = { 67 [0] = {
70 .name = "isp1761-regs", 68 .start = 0x203C0000,
71 .start = ISP1761_BASE + 0x00000000, 69 .end = 0x203C0000 + 0x000fffff,
72 .end = ISP1761_BASE + 0x000fffff,
73 .flags = IORESOURCE_MEM, 70 .flags = IORESOURCE_MEM,
74 }, 71 },
75 [1] = { 72 [1] = {
76 .start = ISP1761_IRQ, 73 .start = IRQ_PF7,
77 .end = ISP1761_IRQ, 74 .end = IRQ_PF7,
78 .flags = IORESOURCE_IRQ, 75 .flags = IORESOURCE_IRQ,
79 }, 76 },
80}; 77};
81 78
82static struct platform_device bfin_isp1761_device = { 79static struct isp1760_platform_data isp1760_priv = {
83 .name = "isp1761", 80 .is_isp1761 = 0,
84 .id = 0, 81 .port1_disable = 0,
85 .num_resources = ARRAY_SIZE(bfin_isp1761_resources), 82 .bus_width_16 = 1,
86 .resource = bfin_isp1761_resources, 83 .port1_otg = 0,
84 .analog_oc = 0,
85 .dack_polarity_high = 0,
86 .dreq_polarity_high = 0,
87}; 87};
88 88
89static struct platform_device *bfin_isp1761_devices[] = { 89static struct platform_device bfin_isp1760_device = {
90 &bfin_isp1761_device, 90 .name = "isp1760-hcd",
91 .id = 0,
92 .dev = {
93 .platform_data = &isp1760_priv,
94 },
95 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
96 .resource = bfin_isp1760_resources,
91}; 97};
92
93int __init bfin_isp1761_init(void)
94{
95 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
96
97 printk(KERN_INFO "%s(): registering device resources\n", __func__);
98 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
99
100 return platform_add_devices(bfin_isp1761_devices, num_devices);
101}
102
103void __exit bfin_isp1761_exit(void)
104{
105 platform_device_unregister(&bfin_isp1761_device);
106}
107
108arch_initcall(bfin_isp1761_init);
109#endif 98#endif
110 99
111#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 100#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
@@ -132,8 +121,8 @@ static struct musb_hdrc_config musb_config = {
132 .dyn_fifo = 0, 121 .dyn_fifo = 0,
133 .soft_con = 1, 122 .soft_con = 1,
134 .dma = 1, 123 .dma = 1,
135 .num_eps = 7, 124 .num_eps = 8,
136 .dma_channels = 7, 125 .dma_channels = 8,
137 .gpio_vrsel = GPIO_PF11, 126 .gpio_vrsel = GPIO_PF11,
138}; 127};
139 128
@@ -728,30 +717,59 @@ static struct platform_device bfin_uart_device = {
728#endif 717#endif
729 718
730#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 719#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
731static struct resource bfin_sir_resources[] = {
732#ifdef CONFIG_BFIN_SIR0 720#ifdef CONFIG_BFIN_SIR0
721static struct resource bfin_sir0_resources[] = {
733 { 722 {
734 .start = 0xFFC00400, 723 .start = 0xFFC00400,
735 .end = 0xFFC004FF, 724 .end = 0xFFC004FF,
736 .flags = IORESOURCE_MEM, 725 .flags = IORESOURCE_MEM,
737 }, 726 },
727 {
728 .start = IRQ_UART0_RX,
729 .end = IRQ_UART0_RX+1,
730 .flags = IORESOURCE_IRQ,
731 },
732 {
733 .start = CH_UART0_RX,
734 .end = CH_UART0_RX+1,
735 .flags = IORESOURCE_DMA,
736 },
737};
738
739static struct platform_device bfin_sir0_device = {
740 .name = "bfin_sir",
741 .id = 0,
742 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
743 .resource = bfin_sir0_resources,
744};
738#endif 745#endif
739#ifdef CONFIG_BFIN_SIR1 746#ifdef CONFIG_BFIN_SIR1
747static struct resource bfin_sir1_resources[] = {
740 { 748 {
741 .start = 0xFFC02000, 749 .start = 0xFFC02000,
742 .end = 0xFFC020FF, 750 .end = 0xFFC020FF,
743 .flags = IORESOURCE_MEM, 751 .flags = IORESOURCE_MEM,
744 }, 752 },
745#endif 753 {
754 .start = IRQ_UART1_RX,
755 .end = IRQ_UART1_RX+1,
756 .flags = IORESOURCE_IRQ,
757 },
758 {
759 .start = CH_UART1_RX,
760 .end = CH_UART1_RX+1,
761 .flags = IORESOURCE_DMA,
762 },
746}; 763};
747 764
748static struct platform_device bfin_sir_device = { 765static struct platform_device bfin_sir1_device = {
749 .name = "bfin_sir", 766 .name = "bfin_sir",
750 .id = 0, 767 .id = 1,
751 .num_resources = ARRAY_SIZE(bfin_sir_resources), 768 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
752 .resource = bfin_sir_resources, 769 .resource = bfin_sir1_resources,
753}; 770};
754#endif 771#endif
772#endif
755 773
756#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 774#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
757static struct resource bfin_twi0_resource[] = { 775static struct resource bfin_twi0_resource[] = {
@@ -885,6 +903,10 @@ static struct platform_device *stamp_devices[] __initdata = {
885 &isp1362_hcd_device, 903 &isp1362_hcd_device,
886#endif 904#endif
887 905
906#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
907 &bfin_isp1760_device,
908#endif
909
888#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 910#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
889 &musb_device, 911 &musb_device,
890#endif 912#endif
@@ -918,7 +940,12 @@ static struct platform_device *stamp_devices[] __initdata = {
918#endif 940#endif
919 941
920#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 942#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
921 &bfin_sir_device, 943#ifdef CONFIG_BFIN_SIR0
944 &bfin_sir0_device,
945#endif
946#ifdef CONFIG_BFIN_SIR1
947 &bfin_sir1_device,
948#endif
922#endif 949#endif
923 950
924#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 951#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
diff --git a/arch/blackfin/mach-bf527/boards/ezbrd.c b/arch/blackfin/mach-bf527/boards/ezbrd.c
index 36c87b6fbdec..0314bd3355eb 100644
--- a/arch/blackfin/mach-bf527/boards/ezbrd.c
+++ b/arch/blackfin/mach-bf527/boards/ezbrd.c
@@ -51,7 +51,7 @@
51/* 51/*
52 * Name the Board for the /proc/cpuinfo 52 * Name the Board for the /proc/cpuinfo
53 */ 53 */
54const char bfin_board_name[] = "BF526-EZBRD"; 54const char bfin_board_name[] = "ADI BF526-EZBRD";
55 55
56/* 56/*
57 * Driver needs to know address, irq and flag pin. 57 * Driver needs to know address, irq and flag pin.
@@ -81,8 +81,8 @@ static struct musb_hdrc_config musb_config = {
81 .dyn_fifo = 0, 81 .dyn_fifo = 0,
82 .soft_con = 1, 82 .soft_con = 1,
83 .dma = 1, 83 .dma = 1,
84 .num_eps = 7, 84 .num_eps = 8,
85 .dma_channels = 7, 85 .dma_channels = 8,
86 .gpio_vrsel = GPIO_PG13, 86 .gpio_vrsel = GPIO_PG13,
87}; 87};
88 88
@@ -288,6 +288,30 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
288}; 288};
289#endif 289#endif
290 290
291#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
292#include <linux/spi/ad7879.h>
293static const struct ad7879_platform_data bfin_ad7879_ts_info = {
294 .model = 7879, /* Model = AD7879 */
295 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
296 .pressure_max = 10000,
297 .pressure_min = 0,
298 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
299 .acquisition_time = 1, /* 4us acquisition time per sample */
300 .median = 2, /* do 8 measurements */
301 .averaging = 1, /* take the average of 4 middle samples */
302 .pen_down_acc_interval = 255, /* 9.4 ms */
303 .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */
304 .gpio_default = 1, /* During initialization set GPIO = HIGH */
305};
306#endif
307
308#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
309static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
310 .enable_dma = 0,
311 .bits_per_word = 16,
312};
313#endif
314
291#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ 315#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
292 && defined(CONFIG_SND_SOC_WM8731_SPI) 316 && defined(CONFIG_SND_SOC_WM8731_SPI)
293static struct bfin5xx_spi_chip spi_wm8731_chip_info = { 317static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
@@ -386,6 +410,18 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
386 .controller_data = &spi_ad7877_chip_info, 410 .controller_data = &spi_ad7877_chip_info,
387 }, 411 },
388#endif 412#endif
413#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
414 {
415 .modalias = "ad7879",
416 .platform_data = &bfin_ad7879_ts_info,
417 .irq = IRQ_PG0,
418 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
419 .bus_num = 0,
420 .chip_select = 5,
421 .controller_data = &spi_ad7879_chip_info,
422 .mode = SPI_CPHA | SPI_CPOL,
423 },
424#endif
389#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ 425#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
390 && defined(CONFIG_SND_SOC_WM8731_SPI) 426 && defined(CONFIG_SND_SOC_WM8731_SPI)
391 { 427 {
@@ -478,30 +514,59 @@ static struct platform_device bfin_uart_device = {
478#endif 514#endif
479 515
480#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 516#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
481static struct resource bfin_sir_resources[] = {
482#ifdef CONFIG_BFIN_SIR0 517#ifdef CONFIG_BFIN_SIR0
518static struct resource bfin_sir0_resources[] = {
483 { 519 {
484 .start = 0xFFC00400, 520 .start = 0xFFC00400,
485 .end = 0xFFC004FF, 521 .end = 0xFFC004FF,
486 .flags = IORESOURCE_MEM, 522 .flags = IORESOURCE_MEM,
487 }, 523 },
524 {
525 .start = IRQ_UART0_RX,
526 .end = IRQ_UART0_RX+1,
527 .flags = IORESOURCE_IRQ,
528 },
529 {
530 .start = CH_UART0_RX,
531 .end = CH_UART0_RX+1,
532 .flags = IORESOURCE_DMA,
533 },
534};
535
536static struct platform_device bfin_sir0_device = {
537 .name = "bfin_sir",
538 .id = 0,
539 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
540 .resource = bfin_sir0_resources,
541};
488#endif 542#endif
489#ifdef CONFIG_BFIN_SIR1 543#ifdef CONFIG_BFIN_SIR1
544static struct resource bfin_sir1_resources[] = {
490 { 545 {
491 .start = 0xFFC02000, 546 .start = 0xFFC02000,
492 .end = 0xFFC020FF, 547 .end = 0xFFC020FF,
493 .flags = IORESOURCE_MEM, 548 .flags = IORESOURCE_MEM,
494 }, 549 },
495#endif 550 {
551 .start = IRQ_UART1_RX,
552 .end = IRQ_UART1_RX+1,
553 .flags = IORESOURCE_IRQ,
554 },
555 {
556 .start = CH_UART1_RX,
557 .end = CH_UART1_RX+1,
558 .flags = IORESOURCE_DMA,
559 },
496}; 560};
497 561
498static struct platform_device bfin_sir_device = { 562static struct platform_device bfin_sir1_device = {
499 .name = "bfin_sir", 563 .name = "bfin_sir",
500 .id = 0, 564 .id = 1,
501 .num_resources = ARRAY_SIZE(bfin_sir_resources), 565 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
502 .resource = bfin_sir_resources, 566 .resource = bfin_sir1_resources,
503}; 567};
504#endif 568#endif
569#endif
505 570
506#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 571#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
507static struct resource bfin_twi0_resource[] = { 572static struct resource bfin_twi0_resource[] = {
@@ -671,7 +736,12 @@ static struct platform_device *stamp_devices[] __initdata = {
671#endif 736#endif
672 737
673#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 738#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
674 &bfin_sir_device, 739#ifdef CONFIG_BFIN_SIR0
740 &bfin_sir0_device,
741#endif
742#ifdef CONFIG_BFIN_SIR1
743 &bfin_sir1_device,
744#endif
675#endif 745#endif
676 746
677#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 747#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
diff --git a/arch/blackfin/mach-bf527/boards/ezkit.c b/arch/blackfin/mach-bf527/boards/ezkit.c
index 8ee2b744e234..9454fb7b18c3 100644
--- a/arch/blackfin/mach-bf527/boards/ezkit.c
+++ b/arch/blackfin/mach-bf527/boards/ezkit.c
@@ -54,57 +54,46 @@
54/* 54/*
55 * Name the Board for the /proc/cpuinfo 55 * Name the Board for the /proc/cpuinfo
56 */ 56 */
57const char bfin_board_name[] = "ADDS-BF527-EZKIT"; 57const char bfin_board_name[] = "ADI BF527-EZKIT";
58 58
59/* 59/*
60 * Driver needs to know address, irq and flag pin. 60 * Driver needs to know address, irq and flag pin.
61 */ 61 */
62 62
63#define ISP1761_BASE 0x203C0000
64#define ISP1761_IRQ IRQ_PF7
65
66#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 63#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
67static struct resource bfin_isp1761_resources[] = { 64#include <linux/usb/isp1760.h>
65static struct resource bfin_isp1760_resources[] = {
68 [0] = { 66 [0] = {
69 .name = "isp1761-regs", 67 .start = 0x203C0000,
70 .start = ISP1761_BASE + 0x00000000, 68 .end = 0x203C0000 + 0x000fffff,
71 .end = ISP1761_BASE + 0x000fffff,
72 .flags = IORESOURCE_MEM, 69 .flags = IORESOURCE_MEM,
73 }, 70 },
74 [1] = { 71 [1] = {
75 .start = ISP1761_IRQ, 72 .start = IRQ_PF7,
76 .end = ISP1761_IRQ, 73 .end = IRQ_PF7,
77 .flags = IORESOURCE_IRQ, 74 .flags = IORESOURCE_IRQ,
78 }, 75 },
79}; 76};
80 77
81static struct platform_device bfin_isp1761_device = { 78static struct isp1760_platform_data isp1760_priv = {
82 .name = "isp1761", 79 .is_isp1761 = 0,
83 .id = 0, 80 .port1_disable = 0,
84 .num_resources = ARRAY_SIZE(bfin_isp1761_resources), 81 .bus_width_16 = 1,
85 .resource = bfin_isp1761_resources, 82 .port1_otg = 0,
83 .analog_oc = 0,
84 .dack_polarity_high = 0,
85 .dreq_polarity_high = 0,
86}; 86};
87 87
88static struct platform_device *bfin_isp1761_devices[] = { 88static struct platform_device bfin_isp1760_device = {
89 &bfin_isp1761_device, 89 .name = "isp1760-hcd",
90 .id = 0,
91 .dev = {
92 .platform_data = &isp1760_priv,
93 },
94 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
95 .resource = bfin_isp1760_resources,
90}; 96};
91
92int __init bfin_isp1761_init(void)
93{
94 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
95
96 printk(KERN_INFO "%s(): registering device resources\n", __func__);
97 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
98
99 return platform_add_devices(bfin_isp1761_devices, num_devices);
100}
101
102void __exit bfin_isp1761_exit(void)
103{
104 platform_device_unregister(&bfin_isp1761_device);
105}
106
107arch_initcall(bfin_isp1761_init);
108#endif 97#endif
109 98
110#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 99#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
@@ -131,8 +120,8 @@ static struct musb_hdrc_config musb_config = {
131 .dyn_fifo = 0, 120 .dyn_fifo = 0,
132 .soft_con = 1, 121 .soft_con = 1,
133 .dma = 1, 122 .dma = 1,
134 .num_eps = 7, 123 .num_eps = 8,
135 .dma_channels = 7, 124 .dma_channels = 8,
136 .gpio_vrsel = GPIO_PG13, 125 .gpio_vrsel = GPIO_PG13,
137}; 126};
138 127
@@ -515,13 +504,6 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
515}; 504};
516#endif 505#endif
517 506
518#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
519static struct bfin5xx_spi_chip spi_mmc_chip_info = {
520 .enable_dma = 1,
521 .bits_per_word = 8,
522};
523#endif
524
525#if defined(CONFIG_PBX) 507#if defined(CONFIG_PBX)
526static struct bfin5xx_spi_chip spi_si3xxx_chip_info = { 508static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
527 .ctl_reg = 0x4, /* send zero */ 509 .ctl_reg = 0x4, /* send zero */
@@ -552,6 +534,30 @@ static const struct ad7877_platform_data bfin_ad7877_ts_info = {
552}; 534};
553#endif 535#endif
554 536
537#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
538#include <linux/spi/ad7879.h>
539static const struct ad7879_platform_data bfin_ad7879_ts_info = {
540 .model = 7879, /* Model = AD7879 */
541 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
542 .pressure_max = 10000,
543 .pressure_min = 0,
544 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
545 .acquisition_time = 1, /* 4us acquisition time per sample */
546 .median = 2, /* do 8 measurements */
547 .averaging = 1, /* take the average of 4 middle samples */
548 .pen_down_acc_interval = 255, /* 9.4 ms */
549 .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */
550 .gpio_default = 1, /* During initialization set GPIO = HIGH */
551};
552#endif
553
554#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
555static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
556 .enable_dma = 0,
557 .bits_per_word = 16,
558};
559#endif
560
555#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ 561#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
556 && defined(CONFIG_SND_SOC_WM8731_SPI) 562 && defined(CONFIG_SND_SOC_WM8731_SPI)
557static struct bfin5xx_spi_chip spi_wm8731_chip_info = { 563static struct bfin5xx_spi_chip spi_wm8731_chip_info = {
@@ -613,26 +619,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
613 .controller_data = &ad9960_spi_chip_info, 619 .controller_data = &ad9960_spi_chip_info,
614 }, 620 },
615#endif 621#endif
616#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
617 {
618 .modalias = "spi_mmc_dummy",
619 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
620 .bus_num = 0,
621 .chip_select = 0,
622 .platform_data = NULL,
623 .controller_data = &spi_mmc_chip_info,
624 .mode = SPI_MODE_3,
625 },
626 {
627 .modalias = "spi_mmc",
628 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
629 .bus_num = 0,
630 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
631 .platform_data = NULL,
632 .controller_data = &spi_mmc_chip_info,
633 .mode = SPI_MODE_3,
634 },
635#endif
636#if defined(CONFIG_PBX) 622#if defined(CONFIG_PBX)
637 { 623 {
638 .modalias = "fxs-spi", 624 .modalias = "fxs-spi",
@@ -662,6 +648,18 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
662 .controller_data = &spi_ad7877_chip_info, 648 .controller_data = &spi_ad7877_chip_info,
663 }, 649 },
664#endif 650#endif
651#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
652 {
653 .modalias = "ad7879",
654 .platform_data = &bfin_ad7879_ts_info,
655 .irq = IRQ_PF8,
656 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
657 .bus_num = 0,
658 .chip_select = 3,
659 .controller_data = &spi_ad7879_chip_info,
660 .mode = SPI_CPHA | SPI_CPOL,
661 },
662#endif
665#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \ 663#if defined(CONFIG_SND_SOC_WM8731) || defined(CONFIG_SND_SOC_WM8731_MODULE) \
666 && defined(CONFIG_SND_SOC_WM8731_SPI) 664 && defined(CONFIG_SND_SOC_WM8731_SPI)
667 { 665 {
@@ -756,30 +754,59 @@ static struct platform_device bfin_uart_device = {
756#endif 754#endif
757 755
758#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 756#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
759static struct resource bfin_sir_resources[] = {
760#ifdef CONFIG_BFIN_SIR0 757#ifdef CONFIG_BFIN_SIR0
758static struct resource bfin_sir0_resources[] = {
761 { 759 {
762 .start = 0xFFC00400, 760 .start = 0xFFC00400,
763 .end = 0xFFC004FF, 761 .end = 0xFFC004FF,
764 .flags = IORESOURCE_MEM, 762 .flags = IORESOURCE_MEM,
765 }, 763 },
764 {
765 .start = IRQ_UART0_RX,
766 .end = IRQ_UART0_RX+1,
767 .flags = IORESOURCE_IRQ,
768 },
769 {
770 .start = CH_UART0_RX,
771 .end = CH_UART0_RX+1,
772 .flags = IORESOURCE_DMA,
773 },
774};
775
776static struct platform_device bfin_sir0_device = {
777 .name = "bfin_sir",
778 .id = 0,
779 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
780 .resource = bfin_sir0_resources,
781};
766#endif 782#endif
767#ifdef CONFIG_BFIN_SIR1 783#ifdef CONFIG_BFIN_SIR1
784static struct resource bfin_sir1_resources[] = {
768 { 785 {
769 .start = 0xFFC02000, 786 .start = 0xFFC02000,
770 .end = 0xFFC020FF, 787 .end = 0xFFC020FF,
771 .flags = IORESOURCE_MEM, 788 .flags = IORESOURCE_MEM,
772 }, 789 },
773#endif 790 {
791 .start = IRQ_UART1_RX,
792 .end = IRQ_UART1_RX+1,
793 .flags = IORESOURCE_IRQ,
794 },
795 {
796 .start = CH_UART1_RX,
797 .end = CH_UART1_RX+1,
798 .flags = IORESOURCE_DMA,
799 },
774}; 800};
775 801
776static struct platform_device bfin_sir_device = { 802static struct platform_device bfin_sir1_device = {
777 .name = "bfin_sir", 803 .name = "bfin_sir",
778 .id = 0, 804 .id = 1,
779 .num_resources = ARRAY_SIZE(bfin_sir_resources), 805 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
780 .resource = bfin_sir_resources, 806 .resource = bfin_sir1_resources,
781}; 807};
782#endif 808#endif
809#endif
783 810
784#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 811#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
785static struct resource bfin_twi0_resource[] = { 812static struct resource bfin_twi0_resource[] = {
@@ -944,6 +971,10 @@ static struct platform_device *stamp_devices[] __initdata = {
944 &isp1362_hcd_device, 971 &isp1362_hcd_device,
945#endif 972#endif
946 973
974#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
975 &bfin_isp1760_device,
976#endif
977
947#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE) 978#if defined(CONFIG_USB_MUSB_HDRC) || defined(CONFIG_USB_MUSB_HDRC_MODULE)
948 &musb_device, 979 &musb_device,
949#endif 980#endif
@@ -985,7 +1016,12 @@ static struct platform_device *stamp_devices[] __initdata = {
985#endif 1016#endif
986 1017
987#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1018#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
988 &bfin_sir_device, 1019#ifdef CONFIG_BFIN_SIR0
1020 &bfin_sir0_device,
1021#endif
1022#ifdef CONFIG_BFIN_SIR1
1023 &bfin_sir1_device,
1024#endif
989#endif 1025#endif
990 1026
991#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 1027#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
diff --git a/arch/blackfin/mach-bf527/dma.c b/arch/blackfin/mach-bf527/dma.c
index dfd080cda787..231877578243 100644
--- a/arch/blackfin/mach-bf527/dma.c
+++ b/arch/blackfin/mach-bf527/dma.c
@@ -31,7 +31,7 @@
31#include <asm/blackfin.h> 31#include <asm/blackfin.h>
32#include <asm/dma.h> 32#include <asm/dma.h>
33 33
34struct dma_register *dma_io_base_addr[MAX_BLACKFIN_DMA_CHANNEL] = { 34struct dma_register *dma_io_base_addr[MAX_DMA_CHANNELS] = {
35 (struct dma_register *) DMA0_NEXT_DESC_PTR, 35 (struct dma_register *) DMA0_NEXT_DESC_PTR,
36 (struct dma_register *) DMA1_NEXT_DESC_PTR, 36 (struct dma_register *) DMA1_NEXT_DESC_PTR,
37 (struct dma_register *) DMA2_NEXT_DESC_PTR, 37 (struct dma_register *) DMA2_NEXT_DESC_PTR,
diff --git a/arch/blackfin/mach-bf527/head.S b/arch/blackfin/mach-bf527/head.S
deleted file mode 100644
index 0eb1da85db73..000000000000
--- a/arch/blackfin/mach-bf527/head.S
+++ /dev/null
@@ -1,146 +0,0 @@
1/*
2 * File: arch/blackfin/mach-bf527/head.S
3 * Based on: arch/blackfin/mach-bf533/head.S
4 * Author: Jeff Dionne <jeff@uclinux.org> COPYRIGHT 1998 D. Jeff Dionne
5 *
6 * Created: 1998
7 * Description: Startup code for Blackfin BF537
8 *
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/linkage.h>
31#include <linux/init.h>
32#include <asm/blackfin.h>
33#ifdef CONFIG_BFIN_KERNEL_CLOCK
34#include <asm/clocks.h>
35#include <mach/mem_init.h>
36#endif
37
38.section .l1.text
39#ifdef CONFIG_BFIN_KERNEL_CLOCK
40ENTRY(_start_dma_code)
41
42 /* Enable PHY CLK buffer output */
43 p0.h = hi(VR_CTL);
44 p0.l = lo(VR_CTL);
45 r0.l = w[p0];
46 bitset(r0, 14);
47 w[p0] = r0.l;
48 ssync;
49
50 p0.h = hi(SIC_IWR0);
51 p0.l = lo(SIC_IWR0);
52 r0.l = 0x1;
53 r0.h = 0x0;
54 [p0] = r0;
55 SSYNC;
56
57 /*
58 * Set PLL_CTL
59 * - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
60 * - [8] = BYPASS : BYPASS the PLL, run CLKIN into CCLK/SCLK
61 * - [7] = output delay (add 200ps of delay to mem signals)
62 * - [6] = input delay (add 200ps of input delay to mem signals)
63 * - [5] = PDWN : 1=All Clocks off
64 * - [3] = STOPCK : 1=Core Clock off
65 * - [1] = PLL_OFF : 1=Disable Power to PLL
66 * - [0] = DF : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
67 * all other bits set to zero
68 */
69
70 p0.h = hi(PLL_LOCKCNT);
71 p0.l = lo(PLL_LOCKCNT);
72 r0 = 0x300(Z);
73 w[p0] = r0.l;
74 ssync;
75
76 P2.H = hi(EBIU_SDGCTL);
77 P2.L = lo(EBIU_SDGCTL);
78 R0 = [P2];
79 BITSET (R0, 24);
80 [P2] = R0;
81 SSYNC;
82
83 r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
84 r0 = r0 << 9; /* Shift it over, */
85 r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
86 r0 = r1 | r0;
87 r1 = PLL_BYPASS; /* Bypass the PLL? */
88 r1 = r1 << 8; /* Shift it over */
89 r0 = r1 | r0; /* add them all together */
90#ifdef ANOMALY_05000265
91 BITSET(r0, 15); /* Add 250 mV of hysteresis to SPORT input pins */
92#endif
93
94 p0.h = hi(PLL_CTL);
95 p0.l = lo(PLL_CTL); /* Load the address */
96 cli r2; /* Disable interrupts */
97 ssync;
98 w[p0] = r0.l; /* Set the value */
99 idle; /* Wait for the PLL to stablize */
100 sti r2; /* Enable interrupts */
101
102.Lcheck_again:
103 p0.h = hi(PLL_STAT);
104 p0.l = lo(PLL_STAT);
105 R0 = W[P0](Z);
106 CC = BITTST(R0,5);
107 if ! CC jump .Lcheck_again;
108
109 /* Configure SCLK & CCLK Dividers */
110 r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
111 p0.h = hi(PLL_DIV);
112 p0.l = lo(PLL_DIV);
113 w[p0] = r0.l;
114 ssync;
115
116 p0.l = lo(EBIU_SDRRC);
117 p0.h = hi(EBIU_SDRRC);
118 r0 = mem_SDRRC;
119 w[p0] = r0.l;
120 ssync;
121
122 P2.H = hi(EBIU_SDGCTL);
123 P2.L = lo(EBIU_SDGCTL);
124 R0 = [P2];
125 BITCLR (R0, 24);
126 p0.h = hi(EBIU_SDSTAT);
127 p0.l = lo(EBIU_SDSTAT);
128 r2.l = w[p0];
129 cc = bittst(r2,3);
130 if !cc jump .Lskip;
131 NOP;
132 BITSET (R0, 23);
133.Lskip:
134 [P2] = R0;
135 SSYNC;
136
137 R0.L = lo(mem_SDGCTL);
138 R0.H = hi(mem_SDGCTL);
139 R1 = [p2];
140 R1 = R1 | R0;
141 [P2] = R1;
142 SSYNC;
143
144 RTS;
145ENDPROC(_start_dma_code)
146#endif /* CONFIG_BFIN_KERNEL_CLOCK */
diff --git a/arch/blackfin/mach-bf527/include/mach/anomaly.h b/arch/blackfin/mach-bf527/include/mach/anomaly.h
index 62373e61c585..035e8d835058 100644
--- a/arch/blackfin/mach-bf527/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf527/include/mach/anomaly.h
@@ -28,7 +28,7 @@
28/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */ 28/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */
29#define ANOMALY_05000074 (1) 29#define ANOMALY_05000074 (1)
30/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */ 30/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
31#define ANOMALY_05000119 (1) 31#define ANOMALY_05000119 (1) /* note: brokenness is noted in documentation, not anomaly sheet */
32/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */ 32/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
33#define ANOMALY_05000122 (1) 33#define ANOMALY_05000122 (1)
34/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */ 34/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */
@@ -37,8 +37,6 @@
37#define ANOMALY_05000265 (1) 37#define ANOMALY_05000265 (1)
38/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */ 38/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
39#define ANOMALY_05000310 (1) 39#define ANOMALY_05000310 (1)
40/* Errors when SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
41#define ANOMALY_05000312 (ANOMALY_BF527)
42/* PPI Is Level-Sensitive on First Transfer In Single Frame Sync Modes */ 40/* PPI Is Level-Sensitive on First Transfer In Single Frame Sync Modes */
43#define ANOMALY_05000313 (__SILICON_REVISION__ < 2) 41#define ANOMALY_05000313 (__SILICON_REVISION__ < 2)
44/* Incorrect Access of OTP_STATUS During otp_write() Function */ 42/* Incorrect Access of OTP_STATUS During otp_write() Function */
@@ -153,6 +151,10 @@
153#define ANOMALY_05000430 (ANOMALY_BF527 && __SILICON_REVISION__ > 1) 151#define ANOMALY_05000430 (ANOMALY_BF527 && __SILICON_REVISION__ > 1)
154/* bfrom_SysControl() Does Not Clear SIC_IWR1 Before Executing PLL Programming Sequence */ 152/* bfrom_SysControl() Does Not Clear SIC_IWR1 Before Executing PLL Programming Sequence */
155#define ANOMALY_05000432 (ANOMALY_BF526) 153#define ANOMALY_05000432 (ANOMALY_BF526)
154/* Certain SIC Registers are not Reset After Soft or Core Double Fault Reset */
155#define ANOMALY_05000435 ((ANOMALY_BF526 && __SILICON_REVISION__ < 1) || ANOMALY_BF527)
156/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
157#define ANOMALY_05000443 (1)
156 158
157/* Anomalies that don't exist on this proc */ 159/* Anomalies that don't exist on this proc */
158#define ANOMALY_05000125 (0) 160#define ANOMALY_05000125 (0)
@@ -168,7 +170,9 @@
168#define ANOMALY_05000285 (0) 170#define ANOMALY_05000285 (0)
169#define ANOMALY_05000307 (0) 171#define ANOMALY_05000307 (0)
170#define ANOMALY_05000311 (0) 172#define ANOMALY_05000311 (0)
173#define ANOMALY_05000312 (0)
171#define ANOMALY_05000323 (0) 174#define ANOMALY_05000323 (0)
172#define ANOMALY_05000363 (0) 175#define ANOMALY_05000363 (0)
176#define ANOMALY_05000412 (0)
173 177
174#endif 178#endif
diff --git a/arch/blackfin/mach-bf527/include/mach/bf527.h b/arch/blackfin/mach-bf527/include/mach/bf527.h
index 144f08d3f8ea..3832aab11e9a 100644
--- a/arch/blackfin/mach-bf527/include/mach/bf527.h
+++ b/arch/blackfin/mach-bf527/include/mach/bf527.h
@@ -110,7 +110,7 @@
110 110
111#ifdef CONFIG_BF527 111#ifdef CONFIG_BF527
112#define CPU "BF527" 112#define CPU "BF527"
113#define CPUID 0x27e4 113#define CPUID 0x27e0
114#endif 114#endif
115#ifdef CONFIG_BF526 115#ifdef CONFIG_BF526
116#define CPU "BF526" 116#define CPU "BF526"
@@ -118,7 +118,7 @@
118#endif 118#endif
119#ifdef CONFIG_BF525 119#ifdef CONFIG_BF525
120#define CPU "BF525" 120#define CPU "BF525"
121#define CPUID 0x27e4 121#define CPUID 0x27e0
122#endif 122#endif
123#ifdef CONFIG_BF524 123#ifdef CONFIG_BF524
124#define CPU "BF524" 124#define CPU "BF524"
@@ -126,7 +126,7 @@
126#endif 126#endif
127#ifdef CONFIG_BF523 127#ifdef CONFIG_BF523
128#define CPU "BF523" 128#define CPU "BF523"
129#define CPUID 0x27e4 129#define CPUID 0x27e0
130#endif 130#endif
131#ifdef CONFIG_BF522 131#ifdef CONFIG_BF522
132#define CPU "BF522" 132#define CPU "BF522"
@@ -134,7 +134,7 @@
134#endif 134#endif
135 135
136#ifndef CPU 136#ifndef CPU
137#error Unknown CPU type - This kernel doesn't seem to be configured properly 137#error "Unknown CPU type - This kernel doesn't seem to be configured properly"
138#endif 138#endif
139 139
140#endif /* __MACH_BF527_H__ */ 140#endif /* __MACH_BF527_H__ */
diff --git a/arch/blackfin/mach-bf527/include/mach/bfin_sir.h b/arch/blackfin/mach-bf527/include/mach/bfin_sir.h
deleted file mode 100644
index cfd8ad4f1f2c..000000000000
--- a/arch/blackfin/mach-bf527/include/mach/bfin_sir.h
+++ /dev/null
@@ -1,142 +0,0 @@
1/*
2 * Blackfin Infra-red Driver
3 *
4 * Copyright 2006-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 *
10 */
11
12#include <linux/serial.h>
13#include <asm/dma.h>
14#include <asm/portmux.h>
15
16#define SIR_UART_GET_CHAR(port) bfin_read16((port)->membase + OFFSET_RBR)
17#define SIR_UART_GET_DLL(port) bfin_read16((port)->membase + OFFSET_DLL)
18#define SIR_UART_GET_IER(port) bfin_read16((port)->membase + OFFSET_IER)
19#define SIR_UART_GET_DLH(port) bfin_read16((port)->membase + OFFSET_DLH)
20#define SIR_UART_GET_IIR(port) bfin_read16((port)->membase + OFFSET_IIR)
21#define SIR_UART_GET_LCR(port) bfin_read16((port)->membase + OFFSET_LCR)
22#define SIR_UART_GET_GCTL(port) bfin_read16((port)->membase + OFFSET_GCTL)
23
24#define SIR_UART_PUT_CHAR(port, v) bfin_write16(((port)->membase + OFFSET_THR), v)
25#define SIR_UART_PUT_DLL(port, v) bfin_write16(((port)->membase + OFFSET_DLL), v)
26#define SIR_UART_PUT_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER), v)
27#define SIR_UART_PUT_DLH(port, v) bfin_write16(((port)->membase + OFFSET_DLH), v)
28#define SIR_UART_PUT_LCR(port, v) bfin_write16(((port)->membase + OFFSET_LCR), v)
29#define SIR_UART_PUT_GCTL(port, v) bfin_write16(((port)->membase + OFFSET_GCTL), v)
30
31#ifdef CONFIG_SIR_BFIN_DMA
32struct dma_rx_buf {
33 char *buf;
34 int head;
35 int tail;
36 };
37#endif /* CONFIG_SIR_BFIN_DMA */
38
39struct bfin_sir_port {
40 unsigned char __iomem *membase;
41 unsigned int irq;
42 unsigned int lsr;
43 unsigned long clk;
44 struct net_device *dev;
45#ifdef CONFIG_SIR_BFIN_DMA
46 int tx_done;
47 struct dma_rx_buf rx_dma_buf;
48 struct timer_list rx_dma_timer;
49 int rx_dma_nrows;
50#endif /* CONFIG_SIR_BFIN_DMA */
51 unsigned int tx_dma_channel;
52 unsigned int rx_dma_channel;
53};
54
55struct bfin_sir_port sir_ports[BFIN_UART_NR_PORTS];
56
57struct bfin_sir_port_res {
58 unsigned long base_addr;
59 int irq;
60 unsigned int rx_dma_channel;
61 unsigned int tx_dma_channel;
62};
63
64struct bfin_sir_port_res bfin_sir_port_resource[] = {
65#ifdef CONFIG_BFIN_SIR0
66 {
67 0xFFC00400,
68 IRQ_UART0_RX,
69 CH_UART0_RX,
70 CH_UART0_TX,
71 },
72#endif
73#ifdef CONFIG_BFIN_SIR1
74 {
75 0xFFC02000,
76 IRQ_UART1_RX,
77 CH_UART1_RX,
78 CH_UART1_TX,
79 },
80#endif
81};
82
83int nr_sirs = ARRAY_SIZE(bfin_sir_port_resource);
84
85struct bfin_sir_self {
86 struct bfin_sir_port *sir_port;
87 spinlock_t lock;
88 unsigned int open;
89 int speed;
90 int newspeed;
91
92 struct sk_buff *txskb;
93 struct sk_buff *rxskb;
94 struct net_device_stats stats;
95 struct device *dev;
96 struct irlap_cb *irlap;
97 struct qos_info qos;
98
99 iobuff_t tx_buff;
100 iobuff_t rx_buff;
101
102 struct work_struct work;
103 int mtt;
104};
105
106static inline unsigned int SIR_UART_GET_LSR(struct bfin_sir_port *port)
107{
108 unsigned int lsr = bfin_read16(port->membase + OFFSET_LSR);
109 port->lsr |= (lsr & (BI|FE|PE|OE));
110 return lsr | port->lsr;
111}
112
113static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port)
114{
115 port->lsr = 0;
116 bfin_read16(port->membase + OFFSET_LSR);
117}
118
119#define DRIVER_NAME "bfin_sir"
120
121static int bfin_sir_hw_init(void)
122{
123 int ret = -ENODEV;
124#ifdef CONFIG_BFIN_SIR0
125 ret = peripheral_request(P_UART0_TX, DRIVER_NAME);
126 if (ret)
127 return ret;
128 ret = peripheral_request(P_UART0_RX, DRIVER_NAME);
129 if (ret)
130 return ret;
131#endif
132
133#ifdef CONFIG_BFIN_SIR1
134 ret = peripheral_request(P_UART1_TX, DRIVER_NAME);
135 if (ret)
136 return ret;
137 ret = peripheral_request(P_UART1_RX, DRIVER_NAME);
138 if (ret)
139 return ret;
140#endif
141 return ret;
142}
diff --git a/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h b/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h
index 9a814b9a12b9..1fe76d8e0403 100644
--- a/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h
+++ b/arch/blackfin/mach-bf527/include/mach/cdefBF52x_base.h
@@ -31,7 +31,6 @@
31#ifndef _CDEF_BF52X_H 31#ifndef _CDEF_BF52X_H
32#define _CDEF_BF52X_H 32#define _CDEF_BF52X_H
33 33
34#include <asm/system.h>
35#include <asm/blackfin.h> 34#include <asm/blackfin.h>
36 35
37#include "defBF52x_base.h" 36#include "defBF52x_base.h"
@@ -43,57 +42,9 @@
43 42
44/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */ 43/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
45#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL) 44#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
46/* Writing to PLL_CTL initiates a PLL relock sequence. */
47static __inline__ void bfin_write_PLL_CTL(unsigned int val)
48{
49 unsigned long flags, iwr0, iwr1;
50
51 if (val == bfin_read_PLL_CTL())
52 return;
53
54 local_irq_save(flags);
55 /* Enable the PLL Wakeup bit in SIC IWR */
56 iwr0 = bfin_read32(SIC_IWR0);
57 iwr1 = bfin_read32(SIC_IWR1);
58 /* Only allow PPL Wakeup) */
59 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
60 bfin_write32(SIC_IWR1, 0);
61
62 bfin_write16(PLL_CTL, val);
63 SSYNC();
64 asm("IDLE;");
65
66 bfin_write32(SIC_IWR0, iwr0);
67 bfin_write32(SIC_IWR1, iwr1);
68 local_irq_restore(flags);
69}
70#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV) 45#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
71#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val) 46#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
72#define bfin_read_VR_CTL() bfin_read16(VR_CTL) 47#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
73/* Writing to VR_CTL initiates a PLL relock sequence. */
74static __inline__ void bfin_write_VR_CTL(unsigned int val)
75{
76 unsigned long flags, iwr0, iwr1;
77
78 if (val == bfin_read_VR_CTL())
79 return;
80
81 local_irq_save(flags);
82 /* Enable the PLL Wakeup bit in SIC IWR */
83 iwr0 = bfin_read32(SIC_IWR0);
84 iwr1 = bfin_read32(SIC_IWR1);
85 /* Only allow PPL Wakeup) */
86 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
87 bfin_write32(SIC_IWR1, 0);
88
89 bfin_write16(VR_CTL, val);
90 SSYNC();
91 asm("IDLE;");
92
93 bfin_write32(SIC_IWR0, iwr0);
94 bfin_write32(SIC_IWR1, iwr1);
95 local_irq_restore(flags);
96}
97#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 48#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
98#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val) 49#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
99#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT) 50#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
@@ -1201,4 +1152,57 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
1201#define bfin_read_NFC_DATA_RD() bfin_read16(NFC_DATA_RD) 1152#define bfin_read_NFC_DATA_RD() bfin_read16(NFC_DATA_RD)
1202#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val) 1153#define bfin_write_NFC_DATA_RD(val) bfin_write16(NFC_DATA_RD, val)
1203 1154
1155/* These need to be last due to the cdef/linux inter-dependencies */
1156#include <asm/irq.h>
1157
1158/* Writing to PLL_CTL initiates a PLL relock sequence. */
1159static __inline__ void bfin_write_PLL_CTL(unsigned int val)
1160{
1161 unsigned long flags, iwr0, iwr1;
1162
1163 if (val == bfin_read_PLL_CTL())
1164 return;
1165
1166 local_irq_save_hw(flags);
1167 /* Enable the PLL Wakeup bit in SIC IWR */
1168 iwr0 = bfin_read32(SIC_IWR0);
1169 iwr1 = bfin_read32(SIC_IWR1);
1170 /* Only allow PPL Wakeup) */
1171 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
1172 bfin_write32(SIC_IWR1, 0);
1173
1174 bfin_write16(PLL_CTL, val);
1175 SSYNC();
1176 asm("IDLE;");
1177
1178 bfin_write32(SIC_IWR0, iwr0);
1179 bfin_write32(SIC_IWR1, iwr1);
1180 local_irq_restore_hw(flags);
1181}
1182
1183/* Writing to VR_CTL initiates a PLL relock sequence. */
1184static __inline__ void bfin_write_VR_CTL(unsigned int val)
1185{
1186 unsigned long flags, iwr0, iwr1;
1187
1188 if (val == bfin_read_VR_CTL())
1189 return;
1190
1191 local_irq_save_hw(flags);
1192 /* Enable the PLL Wakeup bit in SIC IWR */
1193 iwr0 = bfin_read32(SIC_IWR0);
1194 iwr1 = bfin_read32(SIC_IWR1);
1195 /* Only allow PPL Wakeup) */
1196 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
1197 bfin_write32(SIC_IWR1, 0);
1198
1199 bfin_write16(VR_CTL, val);
1200 SSYNC();
1201 asm("IDLE;");
1202
1203 bfin_write32(SIC_IWR0, iwr0);
1204 bfin_write32(SIC_IWR1, iwr1);
1205 local_irq_restore_hw(flags);
1206}
1207
1204#endif /* _CDEF_BF52X_H */ 1208#endif /* _CDEF_BF52X_H */
diff --git a/arch/blackfin/mach-bf527/include/mach/dma.h b/arch/blackfin/mach-bf527/include/mach/dma.h
index 49dd693223e8..eb287da101a2 100644
--- a/arch/blackfin/mach-bf527/include/mach/dma.h
+++ b/arch/blackfin/mach-bf527/include/mach/dma.h
@@ -1,38 +1,14 @@
1/* 1/* mach/dma.h - arch-specific DMA defines
2 * file: include/asm-blackfin/mach-bf527/dma.h
3 * based on: include/asm-blackfin/mach-bf537/dma.h
4 * author: Michael Hennerich (michael.hennerich@analog.com)
5 * 2 *
6 * created: 3 * Copyright 2004-2008 Analog Devices Inc.
7 * description:
8 * system DMA map
9 * rev:
10 * 4 *
11 * modified: 5 * Licensed under the GPL-2 or later.
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * this program is distributed in the hope that it will be useful,
22 * but without any warranty; without even the implied warranty of
23 * merchantability or fitness for a particular purpose. see the
24 * gnu general public license for more details.
25 *
26 * you should have received a copy of the gnu general public license
27 * along with this program; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */ 6 */
31 7
32#ifndef _MACH_DMA_H_ 8#ifndef _MACH_DMA_H_
33#define _MACH_DMA_H_ 9#define _MACH_DMA_H_
34 10
35#define MAX_BLACKFIN_DMA_CHANNEL 16 11#define MAX_DMA_CHANNELS 16
36 12
37#define CH_PPI 0 /* PPI receive/transmit or NFC */ 13#define CH_PPI 0 /* PPI receive/transmit or NFC */
38#define CH_EMAC_RX 1 /* Ethernet MAC receive or HOSTDP */ 14#define CH_EMAC_RX 1 /* Ethernet MAC receive or HOSTDP */
diff --git a/arch/blackfin/mach-bf527/include/mach/gpio.h b/arch/blackfin/mach-bf527/include/mach/gpio.h
new file mode 100644
index 000000000000..06b6eebf0d49
--- /dev/null
+++ b/arch/blackfin/mach-bf527/include/mach/gpio.h
@@ -0,0 +1,68 @@
1/*
2 * File: arch/blackfin/mach-bf527/include/mach/gpio.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9
10#ifndef _MACH_GPIO_H_
11#define _MACH_GPIO_H_
12
13#define MAX_BLACKFIN_GPIOS 48
14
15#define GPIO_PF0 0
16#define GPIO_PF1 1
17#define GPIO_PF2 2
18#define GPIO_PF3 3
19#define GPIO_PF4 4
20#define GPIO_PF5 5
21#define GPIO_PF6 6
22#define GPIO_PF7 7
23#define GPIO_PF8 8
24#define GPIO_PF9 9
25#define GPIO_PF10 10
26#define GPIO_PF11 11
27#define GPIO_PF12 12
28#define GPIO_PF13 13
29#define GPIO_PF14 14
30#define GPIO_PF15 15
31#define GPIO_PG0 16
32#define GPIO_PG1 17
33#define GPIO_PG2 18
34#define GPIO_PG3 19
35#define GPIO_PG4 20
36#define GPIO_PG5 21
37#define GPIO_PG6 22
38#define GPIO_PG7 23
39#define GPIO_PG8 24
40#define GPIO_PG9 25
41#define GPIO_PG10 26
42#define GPIO_PG11 27
43#define GPIO_PG12 28
44#define GPIO_PG13 29
45#define GPIO_PG14 30
46#define GPIO_PG15 31
47#define GPIO_PH0 32
48#define GPIO_PH1 33
49#define GPIO_PH2 34
50#define GPIO_PH3 35
51#define GPIO_PH4 36
52#define GPIO_PH5 37
53#define GPIO_PH6 38
54#define GPIO_PH7 39
55#define GPIO_PH8 40
56#define GPIO_PH9 41
57#define GPIO_PH10 42
58#define GPIO_PH11 43
59#define GPIO_PH12 44
60#define GPIO_PH13 45
61#define GPIO_PH14 46
62#define GPIO_PH15 47
63
64#define PORT_F GPIO_PF0
65#define PORT_G GPIO_PG0
66#define PORT_H GPIO_PH0
67
68#endif /* _MACH_GPIO_H_ */
diff --git a/arch/blackfin/mach-bf527/include/mach/irq.h b/arch/blackfin/mach-bf527/include/mach/irq.h
index 4e2b3f2020e5..8ea660d8151f 100644
--- a/arch/blackfin/mach-bf527/include/mach/irq.h
+++ b/arch/blackfin/mach-bf527/include/mach/irq.h
@@ -96,14 +96,14 @@
96#define IRQ_MAC_TX BFIN_IRQ(30) /* DMA2 Channel (MAC TX/NAND) */ 96#define IRQ_MAC_TX BFIN_IRQ(30) /* DMA2 Channel (MAC TX/NAND) */
97#define IRQ_NFC BFIN_IRQ(30) /* DMA2 Channel (MAC TX/NAND) */ 97#define IRQ_NFC BFIN_IRQ(30) /* DMA2 Channel (MAC TX/NAND) */
98#define IRQ_PORTH_INTB BFIN_IRQ(31) /* Port H Interrupt B */ 98#define IRQ_PORTH_INTB BFIN_IRQ(31) /* Port H Interrupt B */
99#define IRQ_TMR0 BFIN_IRQ(32) /* Timer 0 */ 99#define IRQ_TIMER0 BFIN_IRQ(32) /* Timer 0 */
100#define IRQ_TMR1 BFIN_IRQ(33) /* Timer 1 */ 100#define IRQ_TIMER1 BFIN_IRQ(33) /* Timer 1 */
101#define IRQ_TMR2 BFIN_IRQ(34) /* Timer 2 */ 101#define IRQ_TIMER2 BFIN_IRQ(34) /* Timer 2 */
102#define IRQ_TMR3 BFIN_IRQ(35) /* Timer 3 */ 102#define IRQ_TIMER3 BFIN_IRQ(35) /* Timer 3 */
103#define IRQ_TMR4 BFIN_IRQ(36) /* Timer 4 */ 103#define IRQ_TIMER4 BFIN_IRQ(36) /* Timer 4 */
104#define IRQ_TMR5 BFIN_IRQ(37) /* Timer 5 */ 104#define IRQ_TIMER5 BFIN_IRQ(37) /* Timer 5 */
105#define IRQ_TMR6 BFIN_IRQ(38) /* Timer 6 */ 105#define IRQ_TIMER6 BFIN_IRQ(38) /* Timer 6 */
106#define IRQ_TMR7 BFIN_IRQ(39) /* Timer 7 */ 106#define IRQ_TIMER7 BFIN_IRQ(39) /* Timer 7 */
107#define IRQ_PORTG_INTA BFIN_IRQ(40) /* Port G Interrupt A */ 107#define IRQ_PORTG_INTA BFIN_IRQ(40) /* Port G Interrupt A */
108#define IRQ_PORTG_INTB BFIN_IRQ(41) /* Port G Interrupt B */ 108#define IRQ_PORTG_INTB BFIN_IRQ(41) /* Port G Interrupt B */
109#define IRQ_MEM_DMA0 BFIN_IRQ(42) /* MDMA Stream 0 */ 109#define IRQ_MEM_DMA0 BFIN_IRQ(42) /* MDMA Stream 0 */
@@ -227,14 +227,14 @@
227#define IRQ_PORTH_INTB_POS 28 227#define IRQ_PORTH_INTB_POS 28
228 228
229/* IAR4 BIT FIELDS */ 229/* IAR4 BIT FIELDS */
230#define IRQ_TMR0_POS 0 230#define IRQ_TIMER0_POS 0
231#define IRQ_TMR1_POS 4 231#define IRQ_TIMER1_POS 4
232#define IRQ_TMR2_POS 8 232#define IRQ_TIMER2_POS 8
233#define IRQ_TMR3_POS 12 233#define IRQ_TIMER3_POS 12
234#define IRQ_TMR4_POS 16 234#define IRQ_TIMER4_POS 16
235#define IRQ_TMR5_POS 20 235#define IRQ_TIMER5_POS 20
236#define IRQ_TMR6_POS 24 236#define IRQ_TIMER6_POS 24
237#define IRQ_TMR7_POS 28 237#define IRQ_TIMER7_POS 28
238 238
239/* IAR5 BIT FIELDS */ 239/* IAR5 BIT FIELDS */
240#define IRQ_PORTG_INTA_POS 0 240#define IRQ_PORTG_INTA_POS 0
diff --git a/arch/blackfin/mach-bf527/include/mach/mem_map.h b/arch/blackfin/mach-bf527/include/mach/mem_map.h
index ef46dc991cd4..019e0017ad81 100644
--- a/arch/blackfin/mach-bf527/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf527/include/mach/mem_map.h
@@ -99,4 +99,10 @@
99#define L1_SCRATCH_START 0xFFB00000 99#define L1_SCRATCH_START 0xFFB00000
100#define L1_SCRATCH_LENGTH 0x1000 100#define L1_SCRATCH_LENGTH 0x1000
101 101
102#define GET_PDA_SAFE(preg) \
103 preg.l = _cpu_pda; \
104 preg.h = _cpu_pda;
105
106#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
107
102#endif /* _MEM_MAP_527_H_ */ 108#endif /* _MEM_MAP_527_H_ */
diff --git a/arch/blackfin/mach-bf527/ints-priority.c b/arch/blackfin/mach-bf527/ints-priority.c
index 8a2367403d2b..f8c8acd73e30 100644
--- a/arch/blackfin/mach-bf527/ints-priority.c
+++ b/arch/blackfin/mach-bf527/ints-priority.c
@@ -69,14 +69,14 @@ void __init program_IAR(void)
69 ((CONFIG_IRQ_MAC_TX - 7) << IRQ_MAC_TX_POS) | 69 ((CONFIG_IRQ_MAC_TX - 7) << IRQ_MAC_TX_POS) |
70 ((CONFIG_IRQ_PORTH_INTB - 7) << IRQ_PORTH_INTB_POS)); 70 ((CONFIG_IRQ_PORTH_INTB - 7) << IRQ_PORTH_INTB_POS));
71 71
72 bfin_write_SIC_IAR4(((CONFIG_IRQ_TMR0 - 7) << IRQ_TMR0_POS) | 72 bfin_write_SIC_IAR4(((CONFIG_IRQ_TIMER0 - 7) << IRQ_TIMER0_POS) |
73 ((CONFIG_IRQ_TMR1 - 7) << IRQ_TMR1_POS) | 73 ((CONFIG_IRQ_TIMER1 - 7) << IRQ_TIMER1_POS) |
74 ((CONFIG_IRQ_TMR2 - 7) << IRQ_TMR2_POS) | 74 ((CONFIG_IRQ_TIMER2 - 7) << IRQ_TIMER2_POS) |
75 ((CONFIG_IRQ_TMR3 - 7) << IRQ_TMR3_POS) | 75 ((CONFIG_IRQ_TIMER3 - 7) << IRQ_TIMER3_POS) |
76 ((CONFIG_IRQ_TMR4 - 7) << IRQ_TMR4_POS) | 76 ((CONFIG_IRQ_TIMER4 - 7) << IRQ_TIMER4_POS) |
77 ((CONFIG_IRQ_TMR5 - 7) << IRQ_TMR5_POS) | 77 ((CONFIG_IRQ_TIMER5 - 7) << IRQ_TIMER5_POS) |
78 ((CONFIG_IRQ_TMR6 - 7) << IRQ_TMR6_POS) | 78 ((CONFIG_IRQ_TIMER6 - 7) << IRQ_TIMER6_POS) |
79 ((CONFIG_IRQ_TMR7 - 7) << IRQ_TMR7_POS)); 79 ((CONFIG_IRQ_TIMER7 - 7) << IRQ_TIMER7_POS));
80 80
81 bfin_write_SIC_IAR5(((CONFIG_IRQ_PORTG_INTA - 7) << IRQ_PORTG_INTA_POS) | 81 bfin_write_SIC_IAR5(((CONFIG_IRQ_PORTG_INTA - 7) << IRQ_PORTG_INTA_POS) |
82 ((CONFIG_IRQ_PORTG_INTB - 7) << IRQ_PORTG_INTB_POS) | 82 ((CONFIG_IRQ_PORTG_INTB - 7) << IRQ_PORTG_INTB_POS) |
diff --git a/arch/blackfin/mach-bf533/Kconfig b/arch/blackfin/mach-bf533/Kconfig
index 76beb75f12da..14427de7d77f 100644
--- a/arch/blackfin/mach-bf533/Kconfig
+++ b/arch/blackfin/mach-bf533/Kconfig
@@ -59,7 +59,7 @@ config DMA7_UARTTX
59 default 10 59 default 10
60config TIMER0 60config TIMER0
61 int "TIMER0" 61 int "TIMER0"
62 default 11 62 default 8
63config TIMER1 63config TIMER1
64 int "TIMER1" 64 int "TIMER1"
65 default 11 65 default 11
diff --git a/arch/blackfin/mach-bf533/Makefile b/arch/blackfin/mach-bf533/Makefile
index aa9f2647ee0c..874840f76028 100644
--- a/arch/blackfin/mach-bf533/Makefile
+++ b/arch/blackfin/mach-bf533/Makefile
@@ -2,6 +2,4 @@
2# arch/blackfin/mach-bf533/Makefile 2# arch/blackfin/mach-bf533/Makefile
3# 3#
4 4
5extra-y := head.o
6
7obj-y := ints-priority.o dma.o 5obj-y := ints-priority.o dma.o
diff --git a/arch/blackfin/mach-bf533/boards/H8606.c b/arch/blackfin/mach-bf533/boards/H8606.c
index 72ac3ac8ef76..0c66bf44cfab 100644
--- a/arch/blackfin/mach-bf533/boards/H8606.c
+++ b/arch/blackfin/mach-bf533/boards/H8606.c
@@ -313,23 +313,33 @@ static struct platform_device bfin_uart_device = {
313#endif 313#endif
314 314
315#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 315#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
316static struct resource bfin_sir_resources[] = {
317#ifdef CONFIG_BFIN_SIR0 316#ifdef CONFIG_BFIN_SIR0
317static struct resource bfin_sir0_resources[] = {
318 { 318 {
319 .start = 0xFFC00400, 319 .start = 0xFFC00400,
320 .end = 0xFFC004FF, 320 .end = 0xFFC004FF,
321 .flags = IORESOURCE_MEM, 321 .flags = IORESOURCE_MEM,
322 }, 322 },
323#endif 323 {
324 .start = IRQ_UART0_RX,
325 .end = IRQ_UART0_RX+1,
326 .flags = IORESOURCE_IRQ,
327 },
328 {
329 .start = CH_UART0_RX,
330 .end = CH_UART0_RX+1,
331 .flags = IORESOURCE_DMA,
332 },
324}; 333};
325 334
326static struct platform_device bfin_sir_device = { 335static struct platform_device bfin_sir0_device = {
327 .name = "bfin_sir", 336 .name = "bfin_sir",
328 .id = 0, 337 .id = 0,
329 .num_resources = ARRAY_SIZE(bfin_sir_resources), 338 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
330 .resource = bfin_sir_resources, 339 .resource = bfin_sir0_resources,
331}; 340};
332#endif 341#endif
342#endif
333 343
334#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) 344#if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE)
335 345
@@ -431,7 +441,9 @@ static struct platform_device *h8606_devices[] __initdata = {
431#endif 441#endif
432 442
433#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 443#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
434 &bfin_sir_device, 444#ifdef CONFIG_BFIN_SIR0
445 &bfin_sir0_device,
446#endif
435#endif 447#endif
436 448
437#if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE) 449#if defined(CONFIG_KEYBOARD_OPENCORES) || defined(CONFIG_KEYBOARD_OPENCORES_MODULE)
diff --git a/arch/blackfin/mach-bf533/boards/blackstamp.c b/arch/blackfin/mach-bf533/boards/blackstamp.c
index d064ded87719..6ee607c259ac 100644
--- a/arch/blackfin/mach-bf533/boards/blackstamp.c
+++ b/arch/blackfin/mach-bf533/boards/blackstamp.c
@@ -212,23 +212,33 @@ static struct platform_device bfin_uart_device = {
212#endif 212#endif
213 213
214#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 214#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
215static struct resource bfin_sir_resources[] = {
216#ifdef CONFIG_BFIN_SIR0 215#ifdef CONFIG_BFIN_SIR0
216static struct resource bfin_sir0_resources[] = {
217 { 217 {
218 .start = 0xFFC00400, 218 .start = 0xFFC00400,
219 .end = 0xFFC004FF, 219 .end = 0xFFC004FF,
220 .flags = IORESOURCE_MEM, 220 .flags = IORESOURCE_MEM,
221 }, 221 },
222#endif 222 {
223 .start = IRQ_UART0_RX,
224 .end = IRQ_UART0_RX+1,
225 .flags = IORESOURCE_IRQ,
226 },
227 {
228 .start = CH_UART0_RX,
229 .end = CH_UART0_RX+1,
230 .flags = IORESOURCE_DMA,
231 },
223}; 232};
224 233
225static struct platform_device bfin_sir_device = { 234static struct platform_device bfin_sir0_device = {
226 .name = "bfin_sir", 235 .name = "bfin_sir",
227 .id = 0, 236 .id = 0,
228 .num_resources = ARRAY_SIZE(bfin_sir_resources), 237 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
229 .resource = bfin_sir_resources, 238 .resource = bfin_sir0_resources,
230}; 239};
231#endif 240#endif
241#endif
232 242
233#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 243#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
234static struct platform_device bfin_sport0_uart_device = { 244static struct platform_device bfin_sport0_uart_device = {
@@ -353,7 +363,9 @@ static struct platform_device *stamp_devices[] __initdata = {
353#endif 363#endif
354 364
355#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 365#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
356 &bfin_sir_device, 366#ifdef CONFIG_BFIN_SIR0
367 &bfin_sir0_device,
368#endif
357#endif 369#endif
358 370
359#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 371#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c
index 575843f6d9ef..e7061c7e8c42 100644
--- a/arch/blackfin/mach-bf533/boards/cm_bf533.c
+++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c
@@ -219,6 +219,19 @@ static struct platform_device smc91x_device = {
219}; 219};
220#endif 220#endif
221 221
222static struct resource bfin_gpios_resources = {
223 .start = 0,
224 .end = MAX_BLACKFIN_GPIOS - 1,
225 .flags = IORESOURCE_IRQ,
226};
227
228static struct platform_device bfin_gpios_device = {
229 .name = "simple-gpio",
230 .id = -1,
231 .num_resources = 1,
232 .resource = &bfin_gpios_resources,
233};
234
222#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 235#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
223static struct resource bfin_uart_resources[] = { 236static struct resource bfin_uart_resources[] = {
224 { 237 {
@@ -237,23 +250,33 @@ static struct platform_device bfin_uart_device = {
237#endif 250#endif
238 251
239#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 252#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
240static struct resource bfin_sir_resources[] = {
241#ifdef CONFIG_BFIN_SIR0 253#ifdef CONFIG_BFIN_SIR0
254static struct resource bfin_sir0_resources[] = {
242 { 255 {
243 .start = 0xFFC00400, 256 .start = 0xFFC00400,
244 .end = 0xFFC004FF, 257 .end = 0xFFC004FF,
245 .flags = IORESOURCE_MEM, 258 .flags = IORESOURCE_MEM,
246 }, 259 },
247#endif 260 {
261 .start = IRQ_UART0_RX,
262 .end = IRQ_UART0_RX+1,
263 .flags = IORESOURCE_IRQ,
264 },
265 {
266 .start = CH_UART0_RX,
267 .end = CH_UART0_RX+1,
268 .flags = IORESOURCE_DMA,
269 },
248}; 270};
249 271
250static struct platform_device bfin_sir_device = { 272static struct platform_device bfin_sir0_device = {
251 .name = "bfin_sir", 273 .name = "bfin_sir",
252 .id = 0, 274 .id = 0,
253 .num_resources = ARRAY_SIZE(bfin_sir_resources), 275 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
254 .resource = bfin_sir_resources, 276 .resource = bfin_sir0_resources,
255}; 277};
256#endif 278#endif
279#endif
257 280
258#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 281#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
259static struct platform_device bfin_sport0_uart_device = { 282static struct platform_device bfin_sport0_uart_device = {
@@ -342,7 +365,9 @@ static struct platform_device *cm_bf533_devices[] __initdata = {
342#endif 365#endif
343 366
344#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 367#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
345 &bfin_sir_device, 368#ifdef CONFIG_BFIN_SIR0
369 &bfin_sir0_device,
370#endif
346#endif 371#endif
347 372
348#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 373#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
@@ -365,6 +390,8 @@ static struct platform_device *cm_bf533_devices[] __initdata = {
365#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 390#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
366 &bfin_spi0_device, 391 &bfin_spi0_device,
367#endif 392#endif
393
394 &bfin_gpios_device,
368}; 395};
369 396
370static int __init cm_bf533_init(void) 397static int __init cm_bf533_init(void)
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c
index cc2e7eeb1d5a..08cd0969de47 100644
--- a/arch/blackfin/mach-bf533/boards/ezkit.c
+++ b/arch/blackfin/mach-bf533/boards/ezkit.c
@@ -46,7 +46,7 @@
46/* 46/*
47 * Name the Board for the /proc/cpuinfo 47 * Name the Board for the /proc/cpuinfo
48 */ 48 */
49const char bfin_board_name[] = "ADDS-BF533-EZKIT"; 49const char bfin_board_name[] = "ADI BF533-EZKIT";
50 50
51#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 51#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
52static struct platform_device rtc_device = { 52static struct platform_device rtc_device = {
@@ -236,23 +236,33 @@ static struct platform_device bfin_uart_device = {
236#endif 236#endif
237 237
238#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 238#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
239static struct resource bfin_sir_resources[] = {
240#ifdef CONFIG_BFIN_SIR0 239#ifdef CONFIG_BFIN_SIR0
240static struct resource bfin_sir0_resources[] = {
241 { 241 {
242 .start = 0xFFC00400, 242 .start = 0xFFC00400,
243 .end = 0xFFC004FF, 243 .end = 0xFFC004FF,
244 .flags = IORESOURCE_MEM, 244 .flags = IORESOURCE_MEM,
245 }, 245 },
246#endif 246 {
247 .start = IRQ_UART0_RX,
248 .end = IRQ_UART0_RX+1,
249 .flags = IORESOURCE_IRQ,
250 },
251 {
252 .start = CH_UART0_RX,
253 .end = CH_UART0_RX+1,
254 .flags = IORESOURCE_DMA,
255 },
247}; 256};
248 257
249static struct platform_device bfin_sir_device = { 258static struct platform_device bfin_sir0_device = {
250 .name = "bfin_sir", 259 .name = "bfin_sir",
251 .id = 0, 260 .id = 0,
252 .num_resources = ARRAY_SIZE(bfin_sir_resources), 261 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
253 .resource = bfin_sir_resources, 262 .resource = bfin_sir0_resources,
254}; 263};
255#endif 264#endif
265#endif
256 266
257#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 267#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
258#include <linux/input.h> 268#include <linux/input.h>
@@ -363,7 +373,9 @@ static struct platform_device *ezkit_devices[] __initdata = {
363#endif 373#endif
364 374
365#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 375#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
366 &bfin_sir_device, 376#ifdef CONFIG_BFIN_SIR0
377 &bfin_sir0_device,
378#endif
367#endif 379#endif
368 380
369#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 381#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
diff --git a/arch/blackfin/mach-bf533/boards/generic_board.c b/arch/blackfin/mach-bf533/boards/generic_board.c
index 82b1f6a60e3f..986eeec53b1f 100644
--- a/arch/blackfin/mach-bf533/boards/generic_board.c
+++ b/arch/blackfin/mach-bf533/boards/generic_board.c
@@ -72,6 +72,35 @@ static struct platform_device smc91x_device = {
72}; 72};
73#endif 73#endif
74 74
75#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
76#ifdef CONFIG_BFIN_SIR0
77static struct resource bfin_sir0_resources[] = {
78 {
79 .start = 0xFFC00400,
80 .end = 0xFFC004FF,
81 .flags = IORESOURCE_MEM,
82 },
83 {
84 .start = IRQ_UART0_RX,
85 .end = IRQ_UART0_RX+1,
86 .flags = IORESOURCE_IRQ,
87 },
88 {
89 .start = CH_UART0_RX,
90 .end = CH_UART0_RX+1,
91 .flags = IORESOURCE_DMA,
92 },
93};
94
95static struct platform_device bfin_sir0_device = {
96 .name = "bfin_sir",
97 .id = 0,
98 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
99 .resource = bfin_sir0_resources,
100};
101#endif
102#endif
103
75static struct platform_device *generic_board_devices[] __initdata = { 104static struct platform_device *generic_board_devices[] __initdata = {
76#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 105#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
77 &rtc_device, 106 &rtc_device,
@@ -80,6 +109,12 @@ static struct platform_device *generic_board_devices[] __initdata = {
80#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 109#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
81 &smc91x_device, 110 &smc91x_device,
82#endif 111#endif
112
113#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
114#ifdef CONFIG_BFIN_SIR0
115 &bfin_sir0_device,
116#endif
117#endif
83}; 118};
84 119
85static int __init generic_board_init(void) 120static int __init generic_board_init(void)
diff --git a/arch/blackfin/mach-bf533/boards/ip0x.c b/arch/blackfin/mach-bf533/boards/ip0x.c
index 5864892de314..e30b1b7d1442 100644
--- a/arch/blackfin/mach-bf533/boards/ip0x.c
+++ b/arch/blackfin/mach-bf533/boards/ip0x.c
@@ -197,23 +197,33 @@ static struct platform_device bfin_uart_device = {
197#endif 197#endif
198 198
199#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 199#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
200static struct resource bfin_sir_resources[] = {
201#ifdef CONFIG_BFIN_SIR0 200#ifdef CONFIG_BFIN_SIR0
201static struct resource bfin_sir0_resources[] = {
202 { 202 {
203 .start = 0xFFC00400, 203 .start = 0xFFC00400,
204 .end = 0xFFC004FF, 204 .end = 0xFFC004FF,
205 .flags = IORESOURCE_MEM, 205 .flags = IORESOURCE_MEM,
206 }, 206 },
207#endif 207 {
208 .start = IRQ_UART0_RX,
209 .end = IRQ_UART0_RX+1,
210 .flags = IORESOURCE_IRQ,
211 },
212 {
213 .start = CH_UART0_RX,
214 .end = CH_UART0_RX+1,
215 .flags = IORESOURCE_DMA,
216 },
208}; 217};
209 218
210static struct platform_device bfin_sir_device = { 219static struct platform_device bfin_sir0_device = {
211 .name = "bfin_sir", 220 .name = "bfin_sir",
212 .id = 0, 221 .id = 0,
213 .num_resources = ARRAY_SIZE(bfin_sir_resources), 222 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
214 .resource = bfin_sir_resources, 223 .resource = bfin_sir0_resources,
215}; 224};
216#endif 225#endif
226#endif
217 227
218#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 228#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
219static struct resource isp1362_hcd_resources[] = { 229static struct resource isp1362_hcd_resources[] = {
@@ -272,7 +282,9 @@ static struct platform_device *ip0x_devices[] __initdata = {
272#endif 282#endif
273 283
274#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 284#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
275 &bfin_sir_device, 285#ifdef CONFIG_BFIN_SIR0
286 &bfin_sir0_device,
287#endif
276#endif 288#endif
277 289
278#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 290#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index 050ffca53530..07f9ad1e189c 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -49,7 +49,7 @@
49/* 49/*
50 * Name the Board for the /proc/cpuinfo 50 * Name the Board for the /proc/cpuinfo
51 */ 51 */
52const char bfin_board_name[] = "ADDS-BF533-STAMP"; 52const char bfin_board_name[] = "ADI BF533-STAMP";
53 53
54#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 54#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
55static struct platform_device rtc_device = { 55static struct platform_device rtc_device = {
@@ -118,7 +118,7 @@ static struct mtd_partition stamp_partitions[] = {
118 .offset = 0, 118 .offset = 0,
119 }, { 119 }, {
120 .name = "linux kernel(nor)", 120 .name = "linux kernel(nor)",
121 .size = 0xE0000, 121 .size = 0x180000,
122 .offset = MTDPART_OFS_APPEND, 122 .offset = MTDPART_OFS_APPEND,
123 }, { 123 }, {
124 .name = "file system(nor)", 124 .name = "file system(nor)",
@@ -169,7 +169,7 @@ static struct mtd_partition bfin_spi_flash_partitions[] = {
169 .mask_flags = MTD_CAP_ROM 169 .mask_flags = MTD_CAP_ROM
170 }, { 170 }, {
171 .name = "linux kernel(spi)", 171 .name = "linux kernel(spi)",
172 .size = 0xe0000, 172 .size = 0x180000,
173 .offset = MTDPART_OFS_APPEND, 173 .offset = MTDPART_OFS_APPEND,
174 }, { 174 }, {
175 .name = "file system(spi)", 175 .name = "file system(spi)",
@@ -216,13 +216,6 @@ static struct bfin5xx_spi_chip spi_si3xxx_chip_info = {
216}; 216};
217#endif 217#endif
218 218
219#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
220static struct bfin5xx_spi_chip spi_mmc_chip_info = {
221 .enable_dma = 1,
222 .bits_per_word = 8,
223};
224#endif
225
226#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 219#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
227static struct bfin5xx_spi_chip spidev_chip_info = { 220static struct bfin5xx_spi_chip spidev_chip_info = {
228 .enable_dma = 0, 221 .enable_dma = 0,
@@ -265,27 +258,6 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
265 }, 258 },
266#endif 259#endif
267 260
268#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE)
269 {
270 .modalias = "spi_mmc_dummy",
271 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
272 .bus_num = 0,
273 .chip_select = 0,
274 .platform_data = NULL,
275 .controller_data = &spi_mmc_chip_info,
276 .mode = SPI_MODE_3,
277 },
278 {
279 .modalias = "spi_mmc",
280 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
281 .bus_num = 0,
282 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
283 .platform_data = NULL,
284 .controller_data = &spi_mmc_chip_info,
285 .mode = SPI_MODE_3,
286 },
287#endif
288
289#if defined(CONFIG_PBX) 261#if defined(CONFIG_PBX)
290 { 262 {
291 .modalias = "fxs-spi", 263 .modalias = "fxs-spi",
@@ -373,23 +345,33 @@ static struct platform_device bfin_uart_device = {
373#endif 345#endif
374 346
375#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 347#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
376static struct resource bfin_sir_resources[] = {
377#ifdef CONFIG_BFIN_SIR0 348#ifdef CONFIG_BFIN_SIR0
349static struct resource bfin_sir0_resources[] = {
378 { 350 {
379 .start = 0xFFC00400, 351 .start = 0xFFC00400,
380 .end = 0xFFC004FF, 352 .end = 0xFFC004FF,
381 .flags = IORESOURCE_MEM, 353 .flags = IORESOURCE_MEM,
382 }, 354 },
383#endif 355 {
356 .start = IRQ_UART0_RX,
357 .end = IRQ_UART0_RX+1,
358 .flags = IORESOURCE_IRQ,
359 },
360 {
361 .start = CH_UART0_RX,
362 .end = CH_UART0_RX+1,
363 .flags = IORESOURCE_DMA,
364 },
384}; 365};
385 366
386static struct platform_device bfin_sir_device = { 367static struct platform_device bfin_sir0_device = {
387 .name = "bfin_sir", 368 .name = "bfin_sir",
388 .id = 0, 369 .id = 0,
389 .num_resources = ARRAY_SIZE(bfin_sir_resources), 370 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
390 .resource = bfin_sir_resources, 371 .resource = bfin_sir0_resources,
391}; 372};
392#endif 373#endif
374#endif
393 375
394#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 376#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
395static struct platform_device bfin_sport0_uart_device = { 377static struct platform_device bfin_sport0_uart_device = {
@@ -537,7 +519,9 @@ static struct platform_device *stamp_devices[] __initdata = {
537#endif 519#endif
538 520
539#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 521#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
540 &bfin_sir_device, 522#ifdef CONFIG_BFIN_SIR0
523 &bfin_sir0_device,
524#endif
541#endif 525#endif
542 526
543#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 527#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
diff --git a/arch/blackfin/mach-bf533/dma.c b/arch/blackfin/mach-bf533/dma.c
index 28655c1cb7dc..0a6eb8f24d98 100644
--- a/arch/blackfin/mach-bf533/dma.c
+++ b/arch/blackfin/mach-bf533/dma.c
@@ -31,7 +31,7 @@
31#include <asm/blackfin.h> 31#include <asm/blackfin.h>
32#include <asm/dma.h> 32#include <asm/dma.h>
33 33
34struct dma_register *dma_io_base_addr[MAX_BLACKFIN_DMA_CHANNEL] = { 34struct dma_register *dma_io_base_addr[MAX_DMA_CHANNELS] = {
35 (struct dma_register *) DMA0_NEXT_DESC_PTR, 35 (struct dma_register *) DMA0_NEXT_DESC_PTR,
36 (struct dma_register *) DMA1_NEXT_DESC_PTR, 36 (struct dma_register *) DMA1_NEXT_DESC_PTR,
37 (struct dma_register *) DMA2_NEXT_DESC_PTR, 37 (struct dma_register *) DMA2_NEXT_DESC_PTR,
diff --git a/arch/blackfin/mach-bf533/head.S b/arch/blackfin/mach-bf533/head.S
deleted file mode 100644
index 9fc95aaca439..000000000000
--- a/arch/blackfin/mach-bf533/head.S
+++ /dev/null
@@ -1,137 +0,0 @@
1/*
2 * File: arch/blackfin/mach-bf533/head.S
3 * Based on:
4 * Author: Jeff Dionne <jeff@uclinux.org> COPYRIGHT 1998 D. Jeff Dionne
5 *
6 * Created: 1998
7 * Description: bf533 startup file
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/linkage.h>
31#include <linux/init.h>
32#include <asm/blackfin.h>
33#ifdef CONFIG_BFIN_KERNEL_CLOCK
34#include <asm/clocks.h>
35#include <mach/mem_init.h>
36#endif
37
38.section .l1.text
39#ifdef CONFIG_BFIN_KERNEL_CLOCK
40ENTRY(_start_dma_code)
41 p0.h = hi(SIC_IWR);
42 p0.l = lo(SIC_IWR);
43 r0.l = 0x1;
44 r0.h = 0x0;
45 [p0] = r0;
46 SSYNC;
47
48 /*
49 * Set PLL_CTL
50 * - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
51 * - [8] = BYPASS : BYPASS the PLL, run CLKIN into CCLK/SCLK
52 * - [7] = output delay (add 200ps of delay to mem signals)
53 * - [6] = input delay (add 200ps of input delay to mem signals)
54 * - [5] = PDWN : 1=All Clocks off
55 * - [3] = STOPCK : 1=Core Clock off
56 * - [1] = PLL_OFF : 1=Disable Power to PLL
57 * - [0] = DF : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
58 * all other bits set to zero
59 */
60
61 p0.h = hi(PLL_LOCKCNT);
62 p0.l = lo(PLL_LOCKCNT);
63 r0 = 0x300(Z);
64 w[p0] = r0.l;
65 ssync;
66
67 P2.H = hi(EBIU_SDGCTL);
68 P2.L = lo(EBIU_SDGCTL);
69 R0 = [P2];
70 BITSET (R0, 24);
71 [P2] = R0;
72 SSYNC;
73
74 r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
75 r0 = r0 << 9; /* Shift it over, */
76 r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
77 r0 = r1 | r0;
78 r1 = PLL_BYPASS; /* Bypass the PLL? */
79 r1 = r1 << 8; /* Shift it over */
80 r0 = r1 | r0; /* add them all together */
81#ifdef ANOMALY_05000265
82 BITSET(r0, 15); /* Add 250 mV of hysteresis to SPORT input pins */
83#endif
84
85 p0.h = hi(PLL_CTL);
86 p0.l = lo(PLL_CTL); /* Load the address */
87 cli r2; /* Disable interrupts */
88 ssync;
89 w[p0] = r0.l; /* Set the value */
90 idle; /* Wait for the PLL to stablize */
91 sti r2; /* Enable interrupts */
92
93.Lcheck_again:
94 p0.h = hi(PLL_STAT);
95 p0.l = lo(PLL_STAT);
96 R0 = W[P0](Z);
97 CC = BITTST(R0,5);
98 if ! CC jump .Lcheck_again;
99
100 /* Configure SCLK & CCLK Dividers */
101 r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
102 p0.h = hi(PLL_DIV);
103 p0.l = lo(PLL_DIV);
104 w[p0] = r0.l;
105 ssync;
106
107 p0.l = lo(EBIU_SDRRC);
108 p0.h = hi(EBIU_SDRRC);
109 r0 = mem_SDRRC;
110 w[p0] = r0.l;
111 ssync;
112
113 P2.H = hi(EBIU_SDGCTL);
114 P2.L = lo(EBIU_SDGCTL);
115 R0 = [P2];
116 BITCLR (R0, 24);
117 p0.h = hi(EBIU_SDSTAT);
118 p0.l = lo(EBIU_SDSTAT);
119 r2.l = w[p0];
120 cc = bittst(r2,3);
121 if !cc jump .Lskip;
122 NOP;
123 BITSET (R0, 23);
124.Lskip:
125 [P2] = R0;
126 SSYNC;
127
128 R0.L = lo(mem_SDGCTL);
129 R0.H = hi(mem_SDGCTL);
130 R1 = [p2];
131 R1 = R1 | R0;
132 [P2] = R1;
133 SSYNC;
134
135 RTS;
136ENDPROC(_start_dma_code)
137#endif /* CONFIG_BFIN_KERNEL_CLOCK */
diff --git a/arch/blackfin/mach-bf533/include/mach/anomaly.h b/arch/blackfin/mach-bf533/include/mach/anomaly.h
index f544fc56959a..0d3a03429fb9 100644
--- a/arch/blackfin/mach-bf533/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf533/include/mach/anomaly.h
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9/* This file shoule be up to date with: 9/* This file shoule be up to date with:
10 * - Revision D, 06/18/2008; ADSP-BF531/BF532/BF533 Blackfin Processor Anomaly List 10 * - Revision E, 09/18/2008; ADSP-BF531/BF532/BF533 Blackfin Processor Anomaly List
11 */ 11 */
12 12
13#ifndef _MACH_ANOMALY_H_ 13#ifndef _MACH_ANOMALY_H_
@@ -194,6 +194,12 @@
194#define ANOMALY_05000403 (1) 194#define ANOMALY_05000403 (1)
195/* Speculative Fetches Can Cause Undesired External FIFO Operations */ 195/* Speculative Fetches Can Cause Undesired External FIFO Operations */
196#define ANOMALY_05000416 (1) 196#define ANOMALY_05000416 (1)
197/* Multichannel SPORT Channel Misalignment Under Specific Configuration */
198#define ANOMALY_05000425 (1)
199/* Speculative Fetches of Indirect-Pointer Instructions Can Cause False Hardware Errors */
200#define ANOMALY_05000426 (1)
201/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
202#define ANOMALY_05000443 (1)
197 203
198/* These anomalies have been "phased" out of analog.com anomaly sheets and are 204/* These anomalies have been "phased" out of analog.com anomaly sheets and are
199 * here to show running on older silicon just isn't feasible. 205 * here to show running on older silicon just isn't feasible.
@@ -273,5 +279,8 @@
273#define ANOMALY_05000323 (0) 279#define ANOMALY_05000323 (0)
274#define ANOMALY_05000353 (1) 280#define ANOMALY_05000353 (1)
275#define ANOMALY_05000386 (1) 281#define ANOMALY_05000386 (1)
282#define ANOMALY_05000412 (0)
283#define ANOMALY_05000432 (0)
284#define ANOMALY_05000435 (0)
276 285
277#endif 286#endif
diff --git a/arch/blackfin/mach-bf533/include/mach/bf533.h b/arch/blackfin/mach-bf533/include/mach/bf533.h
index dfc8c1ad2d7a..cf4427cd3f72 100644
--- a/arch/blackfin/mach-bf533/include/mach/bf533.h
+++ b/arch/blackfin/mach-bf533/include/mach/bf533.h
@@ -145,7 +145,7 @@
145#endif 145#endif
146#ifdef CONFIG_BF532 146#ifdef CONFIG_BF532
147#define CPU "BF532" 147#define CPU "BF532"
148#define CPUID 0x275A 148#define CPUID 0x27a5
149#endif 149#endif
150#ifdef CONFIG_BF531 150#ifdef CONFIG_BF531
151#define CPU "BF531" 151#define CPU "BF531"
@@ -153,7 +153,7 @@
153#endif 153#endif
154 154
155#ifndef CPU 155#ifndef CPU
156#error Unknown CPU type - This kernel doesn't seem to be configured properly 156#error "Unknown CPU type - This kernel doesn't seem to be configured properly"
157#endif 157#endif
158 158
159#endif /* __MACH_BF533_H__ */ 159#endif /* __MACH_BF533_H__ */
diff --git a/arch/blackfin/mach-bf533/include/mach/bfin_sir.h b/arch/blackfin/mach-bf533/include/mach/bfin_sir.h
deleted file mode 100644
index 9bb87e9e2e9b..000000000000
--- a/arch/blackfin/mach-bf533/include/mach/bfin_sir.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * Blackfin Infra-red Driver
3 *
4 * Copyright 2006-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 *
10 */
11
12#include <linux/serial.h>
13#include <asm/dma.h>
14#include <asm/portmux.h>
15
16#define SIR_UART_GET_CHAR(port) bfin_read16((port)->membase + OFFSET_RBR)
17#define SIR_UART_GET_DLL(port) bfin_read16((port)->membase + OFFSET_DLL)
18#define SIR_UART_GET_IER(port) bfin_read16((port)->membase + OFFSET_IER)
19#define SIR_UART_GET_DLH(port) bfin_read16((port)->membase + OFFSET_DLH)
20#define SIR_UART_GET_IIR(port) bfin_read16((port)->membase + OFFSET_IIR)
21#define SIR_UART_GET_LCR(port) bfin_read16((port)->membase + OFFSET_LCR)
22#define SIR_UART_GET_GCTL(port) bfin_read16((port)->membase + OFFSET_GCTL)
23
24#define SIR_UART_PUT_CHAR(port, v) bfin_write16(((port)->membase + OFFSET_THR), v)
25#define SIR_UART_PUT_DLL(port, v) bfin_write16(((port)->membase + OFFSET_DLL), v)
26#define SIR_UART_PUT_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER), v)
27#define SIR_UART_PUT_DLH(port, v) bfin_write16(((port)->membase + OFFSET_DLH), v)
28#define SIR_UART_PUT_LCR(port, v) bfin_write16(((port)->membase + OFFSET_LCR), v)
29#define SIR_UART_PUT_GCTL(port, v) bfin_write16(((port)->membase + OFFSET_GCTL), v)
30
31#ifdef CONFIG_SIR_BFIN_DMA
32struct dma_rx_buf {
33 char *buf;
34 int head;
35 int tail;
36 };
37#endif /* CONFIG_SIR_BFIN_DMA */
38
39struct bfin_sir_port {
40 unsigned char __iomem *membase;
41 unsigned int irq;
42 unsigned int lsr;
43 unsigned long clk;
44 struct net_device *dev;
45#ifdef CONFIG_SIR_BFIN_DMA
46 int tx_done;
47 struct dma_rx_buf rx_dma_buf;
48 struct timer_list rx_dma_timer;
49 int rx_dma_nrows;
50#endif /* CONFIG_SIR_BFIN_DMA */
51 unsigned int tx_dma_channel;
52 unsigned int rx_dma_channel;
53};
54
55struct bfin_sir_port sir_ports[BFIN_UART_NR_PORTS];
56
57struct bfin_sir_port_res {
58 unsigned long base_addr;
59 int irq;
60 unsigned int rx_dma_channel;
61 unsigned int tx_dma_channel;
62};
63
64struct bfin_sir_port_res bfin_sir_port_resource[] = {
65#ifdef CONFIG_BFIN_SIR0
66 {
67 0xFFC00400,
68 IRQ_UART_RX,
69 CH_UART_RX,
70 CH_UART_TX,
71 },
72#endif
73};
74
75int nr_sirs = ARRAY_SIZE(bfin_sir_port_resource);
76
77struct bfin_sir_self {
78 struct bfin_sir_port *sir_port;
79 spinlock_t lock;
80 unsigned int open;
81 int speed;
82 int newspeed;
83
84 struct sk_buff *txskb;
85 struct sk_buff *rxskb;
86 struct net_device_stats stats;
87 struct device *dev;
88 struct irlap_cb *irlap;
89 struct qos_info qos;
90
91 iobuff_t tx_buff;
92 iobuff_t rx_buff;
93
94 struct work_struct work;
95 int mtt;
96};
97
98static inline unsigned int SIR_UART_GET_LSR(struct bfin_sir_port *port)
99{
100 unsigned int lsr = bfin_read16(port->membase + OFFSET_LSR);
101 port->lsr |= (lsr & (BI|FE|PE|OE));
102 return lsr | port->lsr;
103}
104
105static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port)
106{
107 port->lsr = 0;
108 bfin_read16(port->membase + OFFSET_LSR);
109}
110
111#define DRIVER_NAME "bfin_sir"
112
113static int bfin_sir_hw_init(void)
114{
115 int ret = -ENODEV;
116#ifdef CONFIG_BFIN_SIR0
117 ret = peripheral_request(P_UART0_TX, DRIVER_NAME);
118 if (ret)
119 return ret;
120 ret = peripheral_request(P_UART0_RX, DRIVER_NAME);
121 if (ret)
122 return ret;
123#endif
124 return ret;
125}
diff --git a/arch/blackfin/mach-bf533/include/mach/blackfin.h b/arch/blackfin/mach-bf533/include/mach/blackfin.h
index d80971b4e3aa..045184f81a29 100644
--- a/arch/blackfin/mach-bf533/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf533/include/mach/blackfin.h
@@ -44,6 +44,13 @@
44 44
45#define BFIN_UART_NR_PORTS 1 45#define BFIN_UART_NR_PORTS 1
46 46
47#define CH_UART_RX CH_UART0_RX
48#define CH_UART_TX CH_UART0_TX
49
50#define IRQ_UART_ERROR IRQ_UART0_ERROR
51#define IRQ_UART_RX IRQ_UART0_RX
52#define IRQ_UART_TX IRQ_UART0_TX
53
47#define OFFSET_THR 0x00 /* Transmit Holding register */ 54#define OFFSET_THR 0x00 /* Transmit Holding register */
48#define OFFSET_RBR 0x00 /* Receive Buffer register */ 55#define OFFSET_RBR 0x00 /* Receive Buffer register */
49#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */ 56#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
diff --git a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h
index 3d8978a52c17..bbc3c8386d48 100644
--- a/arch/blackfin/mach-bf533/include/mach/cdefBF532.h
+++ b/arch/blackfin/mach-bf533/include/mach/cdefBF532.h
@@ -39,31 +39,8 @@
39/*include core specific register pointer definitions*/ 39/*include core specific register pointer definitions*/
40#include <asm/cdef_LPBlackfin.h> 40#include <asm/cdef_LPBlackfin.h>
41 41
42#include <asm/system.h>
43
44/* Clock and System Control (0xFFC0 0400-0xFFC0 07FF) */ 42/* Clock and System Control (0xFFC0 0400-0xFFC0 07FF) */
45#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL) 43#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
46/* Writing to PLL_CTL initiates a PLL relock sequence. */
47static __inline__ void bfin_write_PLL_CTL(unsigned int val)
48{
49 unsigned long flags, iwr;
50
51 if (val == bfin_read_PLL_CTL())
52 return;
53
54 local_irq_save(flags);
55 /* Enable the PLL Wakeup bit in SIC IWR */
56 iwr = bfin_read32(SIC_IWR);
57 /* Only allow PPL Wakeup) */
58 bfin_write32(SIC_IWR, IWR_ENABLE(0));
59
60 bfin_write16(PLL_CTL, val);
61 SSYNC();
62 asm("IDLE;");
63
64 bfin_write32(SIC_IWR, iwr);
65 local_irq_restore(flags);
66}
67#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 44#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
68#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val) 45#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
69#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT) 46#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
@@ -72,27 +49,6 @@ static __inline__ void bfin_write_PLL_CTL(unsigned int val)
72#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV) 49#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
73#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val) 50#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
74#define bfin_read_VR_CTL() bfin_read16(VR_CTL) 51#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
75/* Writing to VR_CTL initiates a PLL relock sequence. */
76static __inline__ void bfin_write_VR_CTL(unsigned int val)
77{
78 unsigned long flags, iwr;
79
80 if (val == bfin_read_VR_CTL())
81 return;
82
83 local_irq_save(flags);
84 /* Enable the PLL Wakeup bit in SIC IWR */
85 iwr = bfin_read32(SIC_IWR);
86 /* Only allow PPL Wakeup) */
87 bfin_write32(SIC_IWR, IWR_ENABLE(0));
88
89 bfin_write16(VR_CTL, val);
90 SSYNC();
91 asm("IDLE;");
92
93 bfin_write32(SIC_IWR, iwr);
94 local_irq_restore(flags);
95}
96 52
97/* System Interrupt Controller (0xFFC0 0C00-0xFFC0 0FFF) */ 53/* System Interrupt Controller (0xFFC0 0C00-0xFFC0 0FFF) */
98#define bfin_read_SWRST() bfin_read16(SWRST) 54#define bfin_read_SWRST() bfin_read16(SWRST)
@@ -178,50 +134,6 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
178#define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T) 134#define bfin_read_FIO_MASKB_T() bfin_read16(FIO_MASKB_T)
179#define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val) 135#define bfin_write_FIO_MASKB_T(val) bfin_write16(FIO_MASKB_T,val)
180 136
181
182#if ANOMALY_05000311
183#define BFIN_WRITE_FIO_FLAG(name) \
184static __inline__ void bfin_write_FIO_FLAG_ ## name (unsigned short val)\
185{\
186 unsigned long flags;\
187 local_irq_save(flags);\
188 bfin_write16(FIO_FLAG_ ## name,val);\
189 bfin_read_CHIPID();\
190 local_irq_restore(flags);\
191}
192BFIN_WRITE_FIO_FLAG(D)
193BFIN_WRITE_FIO_FLAG(C)
194BFIN_WRITE_FIO_FLAG(S)
195BFIN_WRITE_FIO_FLAG(T)
196
197#define BFIN_READ_FIO_FLAG(name) \
198static __inline__ unsigned short bfin_read_FIO_FLAG_ ## name (void)\
199{\
200 unsigned long flags;\
201 unsigned short ret;\
202 local_irq_save(flags);\
203 ret = bfin_read16(FIO_FLAG_ ## name);\
204 bfin_read_CHIPID();\
205 local_irq_restore(flags);\
206 return ret;\
207}
208BFIN_READ_FIO_FLAG(D)
209BFIN_READ_FIO_FLAG(C)
210BFIN_READ_FIO_FLAG(S)
211BFIN_READ_FIO_FLAG(T)
212
213#else
214#define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D,val)
215#define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C,val)
216#define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S,val)
217#define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T,val)
218#define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T)
219#define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C)
220#define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S)
221#define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D)
222#endif
223
224
225/* DMA Controller */ 137/* DMA Controller */
226#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG) 138#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
227#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val) 139#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG,val)
@@ -764,4 +676,93 @@ BFIN_READ_FIO_FLAG(T)
764#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME) 676#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
765#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME,val) 677#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME,val)
766 678
679/* These need to be last due to the cdef/linux inter-dependencies */
680#include <asm/irq.h>
681
682#if ANOMALY_05000311
683#define BFIN_WRITE_FIO_FLAG(name) \
684static inline void bfin_write_FIO_FLAG_##name(unsigned short val) \
685{ \
686 unsigned long flags; \
687 local_irq_save_hw(flags); \
688 bfin_write16(FIO_FLAG_##name, val); \
689 bfin_read_CHIPID(); \
690 local_irq_restore_hw(flags); \
691}
692BFIN_WRITE_FIO_FLAG(D)
693BFIN_WRITE_FIO_FLAG(C)
694BFIN_WRITE_FIO_FLAG(S)
695BFIN_WRITE_FIO_FLAG(T)
696
697#define BFIN_READ_FIO_FLAG(name) \
698static inline u16 bfin_read_FIO_FLAG_##name(void) \
699{ \
700 unsigned long flags; \
701 u16 ret; \
702 local_irq_save_hw(flags); \
703 ret = bfin_read16(FIO_FLAG_##name); \
704 bfin_read_CHIPID(); \
705 local_irq_restore_hw(flags); \
706 return ret; \
707}
708BFIN_READ_FIO_FLAG(D)
709BFIN_READ_FIO_FLAG(C)
710BFIN_READ_FIO_FLAG(S)
711BFIN_READ_FIO_FLAG(T)
712
713#else
714#define bfin_write_FIO_FLAG_D(val) bfin_write16(FIO_FLAG_D, val)
715#define bfin_write_FIO_FLAG_C(val) bfin_write16(FIO_FLAG_C, val)
716#define bfin_write_FIO_FLAG_S(val) bfin_write16(FIO_FLAG_S, val)
717#define bfin_write_FIO_FLAG_T(val) bfin_write16(FIO_FLAG_T, val)
718#define bfin_read_FIO_FLAG_T() bfin_read16(FIO_FLAG_T)
719#define bfin_read_FIO_FLAG_C() bfin_read16(FIO_FLAG_C)
720#define bfin_read_FIO_FLAG_S() bfin_read16(FIO_FLAG_S)
721#define bfin_read_FIO_FLAG_D() bfin_read16(FIO_FLAG_D)
722#endif
723
724/* Writing to PLL_CTL initiates a PLL relock sequence. */
725static __inline__ void bfin_write_PLL_CTL(unsigned int val)
726{
727 unsigned long flags, iwr;
728
729 if (val == bfin_read_PLL_CTL())
730 return;
731
732 local_irq_save_hw(flags);
733 /* Enable the PLL Wakeup bit in SIC IWR */
734 iwr = bfin_read32(SIC_IWR);
735 /* Only allow PPL Wakeup) */
736 bfin_write32(SIC_IWR, IWR_ENABLE(0));
737
738 bfin_write16(PLL_CTL, val);
739 SSYNC();
740 asm("IDLE;");
741
742 bfin_write32(SIC_IWR, iwr);
743 local_irq_restore_hw(flags);
744}
745
746/* Writing to VR_CTL initiates a PLL relock sequence. */
747static __inline__ void bfin_write_VR_CTL(unsigned int val)
748{
749 unsigned long flags, iwr;
750
751 if (val == bfin_read_VR_CTL())
752 return;
753
754 local_irq_save_hw(flags);
755 /* Enable the PLL Wakeup bit in SIC IWR */
756 iwr = bfin_read32(SIC_IWR);
757 /* Only allow PPL Wakeup) */
758 bfin_write32(SIC_IWR, IWR_ENABLE(0));
759
760 bfin_write16(VR_CTL, val);
761 SSYNC();
762 asm("IDLE;");
763
764 bfin_write32(SIC_IWR, iwr);
765 local_irq_restore_hw(flags);
766}
767
767#endif /* _CDEF_BF532_H */ 768#endif /* _CDEF_BF532_H */
diff --git a/arch/blackfin/mach-bf533/include/mach/dma.h b/arch/blackfin/mach-bf533/include/mach/dma.h
index bd9d5e94307d..fb34934c5ba8 100644
--- a/arch/blackfin/mach-bf533/include/mach/dma.h
+++ b/arch/blackfin/mach-bf533/include/mach/dma.h
@@ -1,42 +1,14 @@
1/***************************************************************************** 1/* mach/dma.h - arch-specific DMA defines
2*
3* BF-533/2/1 Specific Declarations
4*
5****************************************************************************/
6/*
7 * File: include/asm-blackfin/mach-bf533/dma.h
8 * Based on:
9 * Author:
10 * 2 *
11 * Created: 3 * Copyright 2004-2008 Analog Devices Inc.
12 * Description:
13 * 4 *
14 * Rev: 5 * Licensed under the GPL-2 or later.
15 *
16 * Modified:
17 *
18 * Bugs: Enter bugs at http://blackfin.uclinux.org/
19 *
20 * This program is free software; you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation; either version 2, or (at your option)
23 * any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
29 *
30 * You should have received a copy of the GNU General Public License
31 * along with this program; see the file COPYING.
32 * If not, write to the Free Software Foundation,
33 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 */ 6 */
35 7
36#ifndef _MACH_DMA_H_ 8#ifndef _MACH_DMA_H_
37#define _MACH_DMA_H_ 9#define _MACH_DMA_H_
38 10
39#define MAX_BLACKFIN_DMA_CHANNEL 12 11#define MAX_DMA_CHANNELS 12
40 12
41#define CH_PPI 0 13#define CH_PPI 0
42#define CH_SPORT0_RX 1 14#define CH_SPORT0_RX 1
@@ -44,8 +16,8 @@
44#define CH_SPORT1_RX 3 16#define CH_SPORT1_RX 3
45#define CH_SPORT1_TX 4 17#define CH_SPORT1_TX 4
46#define CH_SPI 5 18#define CH_SPI 5
47#define CH_UART_RX 6 19#define CH_UART0_RX 6
48#define CH_UART_TX 7 20#define CH_UART0_TX 7
49#define CH_MEM_STREAM0_DEST 8 /* TX */ 21#define CH_MEM_STREAM0_DEST 8 /* TX */
50#define CH_MEM_STREAM0_SRC 9 /* RX */ 22#define CH_MEM_STREAM0_SRC 9 /* RX */
51#define CH_MEM_STREAM1_DEST 10 /* TX */ 23#define CH_MEM_STREAM1_DEST 10 /* TX */
diff --git a/arch/blackfin/mach-bf533/include/mach/gpio.h b/arch/blackfin/mach-bf533/include/mach/gpio.h
new file mode 100644
index 000000000000..e45c17077aff
--- /dev/null
+++ b/arch/blackfin/mach-bf533/include/mach/gpio.h
@@ -0,0 +1,34 @@
1/*
2 * File: arch/blackfin/mach-bf533/include/mach/gpio.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9
10#ifndef _MACH_GPIO_H_
11#define _MACH_GPIO_H_
12
13#define MAX_BLACKFIN_GPIOS 16
14
15#define GPIO_PF0 0
16#define GPIO_PF1 1
17#define GPIO_PF2 2
18#define GPIO_PF3 3
19#define GPIO_PF4 4
20#define GPIO_PF5 5
21#define GPIO_PF6 6
22#define GPIO_PF7 7
23#define GPIO_PF8 8
24#define GPIO_PF9 9
25#define GPIO_PF10 10
26#define GPIO_PF11 11
27#define GPIO_PF12 12
28#define GPIO_PF13 13
29#define GPIO_PF14 14
30#define GPIO_PF15 15
31
32#define PORT_F GPIO_PF0
33
34#endif /* _MACH_GPIO_H_ */
diff --git a/arch/blackfin/mach-bf533/include/mach/irq.h b/arch/blackfin/mach-bf533/include/mach/irq.h
index 5aa38e5da6b7..db1e346cd1aa 100644
--- a/arch/blackfin/mach-bf533/include/mach/irq.h
+++ b/arch/blackfin/mach-bf533/include/mach/irq.h
@@ -90,19 +90,19 @@ Core Emulation **
90#define IRQ_SPORT0_ERROR 10 /*SPORT0 Error Interrupt */ 90#define IRQ_SPORT0_ERROR 10 /*SPORT0 Error Interrupt */
91#define IRQ_SPORT1_ERROR 11 /*SPORT1 Error Interrupt */ 91#define IRQ_SPORT1_ERROR 11 /*SPORT1 Error Interrupt */
92#define IRQ_SPI_ERROR 12 /*SPI Error Interrupt */ 92#define IRQ_SPI_ERROR 12 /*SPI Error Interrupt */
93#define IRQ_UART_ERROR 13 /*UART Error Interrupt */ 93#define IRQ_UART0_ERROR 13 /*UART Error Interrupt */
94#define IRQ_RTC 14 /*RTC Interrupt */ 94#define IRQ_RTC 14 /*RTC Interrupt */
95#define IRQ_PPI 15 /*DMA0 Interrupt (PPI) */ 95#define IRQ_PPI 15 /*DMA0 Interrupt (PPI) */
96#define IRQ_SPORT0_RX 16 /*DMA1 Interrupt (SPORT0 RX) */ 96#define IRQ_SPORT0_RX 16 /*DMA1 Interrupt (SPORT0 RX) */
97#define IRQ_SPORT0_TX 17 /*DMA2 Interrupt (SPORT0 TX) */ 97#define IRQ_SPORT0_TX 17 /*DMA2 Interrupt (SPORT0 TX) */
98#define IRQ_SPORT1_RX 18 /*DMA3 Interrupt (SPORT1 RX) */ 98#define IRQ_SPORT1_RX 18 /*DMA3 Interrupt (SPORT1 RX) */
99#define IRQ_SPORT1_TX 19 /*DMA4 Interrupt (SPORT1 TX) */ 99#define IRQ_SPORT1_TX 19 /*DMA4 Interrupt (SPORT1 TX) */
100#define IRQ_SPI 20 /*DMA5 Interrupt (SPI) */ 100#define IRQ_SPI 20 /*DMA5 Interrupt (SPI) */
101#define IRQ_UART_RX 21 /*DMA6 Interrupt (UART RX) */ 101#define IRQ_UART0_RX 21 /*DMA6 Interrupt (UART RX) */
102#define IRQ_UART_TX 22 /*DMA7 Interrupt (UART TX) */ 102#define IRQ_UART0_TX 22 /*DMA7 Interrupt (UART TX) */
103#define IRQ_TMR0 23 /*Timer 0 */ 103#define IRQ_TIMER0 23 /*Timer 0 */
104#define IRQ_TMR1 24 /*Timer 1 */ 104#define IRQ_TIMER1 24 /*Timer 1 */
105#define IRQ_TMR2 25 /*Timer 2 */ 105#define IRQ_TIMER2 25 /*Timer 2 */
106#define IRQ_PROG_INTA 26 /*Programmable Flags A (8) */ 106#define IRQ_PROG_INTA 26 /*Programmable Flags A (8) */
107#define IRQ_PROG_INTB 27 /*Programmable Flags B (8) */ 107#define IRQ_PROG_INTB 27 /*Programmable Flags B (8) */
108#define IRQ_MEM_DMA0 28 /*DMA8/9 Interrupt (Memory DMA Stream 0) */ 108#define IRQ_MEM_DMA0 28 /*DMA8/9 Interrupt (Memory DMA Stream 0) */
diff --git a/arch/blackfin/mach-bf533/include/mach/mem_init.h b/arch/blackfin/mach-bf533/include/mach/mem_init.h
deleted file mode 100644
index ed2034bf10ec..000000000000
--- a/arch/blackfin/mach-bf533/include/mach/mem_init.h
+++ /dev/null
@@ -1,297 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf533/mem_init.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 * Copyright 2004-2006 Analog Devices Inc.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#if (CONFIG_MEM_MT48LC16M16A2TG_75 || CONFIG_MEM_MT48LC64M4A2FB_7E || \
33 CONFIG_MEM_MT48LC32M16A2TG_75 || CONFIG_MEM_GENERIC_BOARD)
34#if (CONFIG_SCLK_HZ > 119402985)
35#define SDRAM_tRP TRP_2
36#define SDRAM_tRP_num 2
37#define SDRAM_tRAS TRAS_7
38#define SDRAM_tRAS_num 7
39#define SDRAM_tRCD TRCD_2
40#define SDRAM_tWR TWR_2
41#endif
42#if (CONFIG_SCLK_HZ > 104477612) && (CONFIG_SCLK_HZ <= 119402985)
43#define SDRAM_tRP TRP_2
44#define SDRAM_tRP_num 2
45#define SDRAM_tRAS TRAS_6
46#define SDRAM_tRAS_num 6
47#define SDRAM_tRCD TRCD_2
48#define SDRAM_tWR TWR_2
49#endif
50#if (CONFIG_SCLK_HZ > 89552239) && (CONFIG_SCLK_HZ <= 104477612)
51#define SDRAM_tRP TRP_2
52#define SDRAM_tRP_num 2
53#define SDRAM_tRAS TRAS_5
54#define SDRAM_tRAS_num 5
55#define SDRAM_tRCD TRCD_2
56#define SDRAM_tWR TWR_2
57#endif
58#if (CONFIG_SCLK_HZ > 74626866) && (CONFIG_SCLK_HZ <= 89552239)
59#define SDRAM_tRP TRP_2
60#define SDRAM_tRP_num 2
61#define SDRAM_tRAS TRAS_4
62#define SDRAM_tRAS_num 4
63#define SDRAM_tRCD TRCD_2
64#define SDRAM_tWR TWR_2
65#endif
66#if (CONFIG_SCLK_HZ > 66666667) && (CONFIG_SCLK_HZ <= 74626866)
67#define SDRAM_tRP TRP_2
68#define SDRAM_tRP_num 2
69#define SDRAM_tRAS TRAS_3
70#define SDRAM_tRAS_num 3
71#define SDRAM_tRCD TRCD_2
72#define SDRAM_tWR TWR_2
73#endif
74#if (CONFIG_SCLK_HZ > 59701493) && (CONFIG_SCLK_HZ <= 66666667)
75#define SDRAM_tRP TRP_1
76#define SDRAM_tRP_num 1
77#define SDRAM_tRAS TRAS_4
78#define SDRAM_tRAS_num 3
79#define SDRAM_tRCD TRCD_1
80#define SDRAM_tWR TWR_2
81#endif
82#if (CONFIG_SCLK_HZ > 44776119) && (CONFIG_SCLK_HZ <= 59701493)
83#define SDRAM_tRP TRP_1
84#define SDRAM_tRP_num 1
85#define SDRAM_tRAS TRAS_3
86#define SDRAM_tRAS_num 3
87#define SDRAM_tRCD TRCD_1
88#define SDRAM_tWR TWR_2
89#endif
90#if (CONFIG_SCLK_HZ > 29850746) && (CONFIG_SCLK_HZ <= 44776119)
91#define SDRAM_tRP TRP_1
92#define SDRAM_tRP_num 1
93#define SDRAM_tRAS TRAS_2
94#define SDRAM_tRAS_num 2
95#define SDRAM_tRCD TRCD_1
96#define SDRAM_tWR TWR_2
97#endif
98#if (CONFIG_SCLK_HZ <= 29850746)
99#define SDRAM_tRP TRP_1
100#define SDRAM_tRP_num 1
101#define SDRAM_tRAS TRAS_1
102#define SDRAM_tRAS_num 1
103#define SDRAM_tRCD TRCD_1
104#define SDRAM_tWR TWR_2
105#endif
106#endif
107
108#if (CONFIG_MEM_MT48LC16M16A2TG_75)
109 /*SDRAM INFORMATION: */
110#define SDRAM_Tref 64 /* Refresh period in milliseconds */
111#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
112#define SDRAM_CL CL_3
113#endif
114
115#if (CONFIG_MEM_MT48LC64M4A2FB_7E)
116 /*SDRAM INFORMATION: */
117#define SDRAM_Tref 64 /* Refresh period in milliseconds */
118#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
119#define SDRAM_CL CL_3
120#endif
121
122#if (CONFIG_MEM_MT48LC32M16A2TG_75)
123 /*SDRAM INFORMATION: */
124#define SDRAM_Tref 64 /* Refresh period in milliseconds */
125#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
126#define SDRAM_CL CL_3
127#endif
128
129#if (CONFIG_MEM_GENERIC_BOARD)
130 /*SDRAM INFORMATION: Modify this for your board */
131#define SDRAM_Tref 64 /* Refresh period in milliseconds */
132#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
133#define SDRAM_CL CL_3
134#endif
135
136/* Equation from section 17 (p17-46) of BF533 HRM */
137#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
138
139/* Enable SCLK Out */
140#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
141
142#if defined CONFIG_CLKIN_HALF
143#define CLKIN_HALF 1
144#else
145#define CLKIN_HALF 0
146#endif
147
148#if defined CONFIG_PLL_BYPASS
149#define PLL_BYPASS 1
150#else
151#define PLL_BYPASS 0
152#endif
153
154/***************************************Currently Not Being Used *********************************/
155#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
156#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
157#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
158#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
159#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
160
161#if (flash_EBIU_AMBCTL_TT > 3)
162#define flash_EBIU_AMBCTL0_TT B0TT_4
163#endif
164#if (flash_EBIU_AMBCTL_TT == 3)
165#define flash_EBIU_AMBCTL0_TT B0TT_3
166#endif
167#if (flash_EBIU_AMBCTL_TT == 2)
168#define flash_EBIU_AMBCTL0_TT B0TT_2
169#endif
170#if (flash_EBIU_AMBCTL_TT < 2)
171#define flash_EBIU_AMBCTL0_TT B0TT_1
172#endif
173
174#if (flash_EBIU_AMBCTL_ST > 3)
175#define flash_EBIU_AMBCTL0_ST B0ST_4
176#endif
177#if (flash_EBIU_AMBCTL_ST == 3)
178#define flash_EBIU_AMBCTL0_ST B0ST_3
179#endif
180#if (flash_EBIU_AMBCTL_ST == 2)
181#define flash_EBIU_AMBCTL0_ST B0ST_2
182#endif
183#if (flash_EBIU_AMBCTL_ST < 2)
184#define flash_EBIU_AMBCTL0_ST B0ST_1
185#endif
186
187#if (flash_EBIU_AMBCTL_HT > 2)
188#define flash_EBIU_AMBCTL0_HT B0HT_3
189#endif
190#if (flash_EBIU_AMBCTL_HT == 2)
191#define flash_EBIU_AMBCTL0_HT B0HT_2
192#endif
193#if (flash_EBIU_AMBCTL_HT == 1)
194#define flash_EBIU_AMBCTL0_HT B0HT_1
195#endif
196#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
197#define flash_EBIU_AMBCTL0_HT B0HT_0
198#endif
199#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
200#define flash_EBIU_AMBCTL0_HT B0HT_1
201#endif
202
203#if (flash_EBIU_AMBCTL_WAT > 14)
204#define flash_EBIU_AMBCTL0_WAT B0WAT_15
205#endif
206#if (flash_EBIU_AMBCTL_WAT == 14)
207#define flash_EBIU_AMBCTL0_WAT B0WAT_14
208#endif
209#if (flash_EBIU_AMBCTL_WAT == 13)
210#define flash_EBIU_AMBCTL0_WAT B0WAT_13
211#endif
212#if (flash_EBIU_AMBCTL_WAT == 12)
213#define flash_EBIU_AMBCTL0_WAT B0WAT_12
214#endif
215#if (flash_EBIU_AMBCTL_WAT == 11)
216#define flash_EBIU_AMBCTL0_WAT B0WAT_11
217#endif
218#if (flash_EBIU_AMBCTL_WAT == 10)
219#define flash_EBIU_AMBCTL0_WAT B0WAT_10
220#endif
221#if (flash_EBIU_AMBCTL_WAT == 9)
222#define flash_EBIU_AMBCTL0_WAT B0WAT_9
223#endif
224#if (flash_EBIU_AMBCTL_WAT == 8)
225#define flash_EBIU_AMBCTL0_WAT B0WAT_8
226#endif
227#if (flash_EBIU_AMBCTL_WAT == 7)
228#define flash_EBIU_AMBCTL0_WAT B0WAT_7
229#endif
230#if (flash_EBIU_AMBCTL_WAT == 6)
231#define flash_EBIU_AMBCTL0_WAT B0WAT_6
232#endif
233#if (flash_EBIU_AMBCTL_WAT == 5)
234#define flash_EBIU_AMBCTL0_WAT B0WAT_5
235#endif
236#if (flash_EBIU_AMBCTL_WAT == 4)
237#define flash_EBIU_AMBCTL0_WAT B0WAT_4
238#endif
239#if (flash_EBIU_AMBCTL_WAT == 3)
240#define flash_EBIU_AMBCTL0_WAT B0WAT_3
241#endif
242#if (flash_EBIU_AMBCTL_WAT == 2)
243#define flash_EBIU_AMBCTL0_WAT B0WAT_2
244#endif
245#if (flash_EBIU_AMBCTL_WAT == 1)
246#define flash_EBIU_AMBCTL0_WAT B0WAT_1
247#endif
248
249#if (flash_EBIU_AMBCTL_RAT > 14)
250#define flash_EBIU_AMBCTL0_RAT B0RAT_15
251#endif
252#if (flash_EBIU_AMBCTL_RAT == 14)
253#define flash_EBIU_AMBCTL0_RAT B0RAT_14
254#endif
255#if (flash_EBIU_AMBCTL_RAT == 13)
256#define flash_EBIU_AMBCTL0_RAT B0RAT_13
257#endif
258#if (flash_EBIU_AMBCTL_RAT == 12)
259#define flash_EBIU_AMBCTL0_RAT B0RAT_12
260#endif
261#if (flash_EBIU_AMBCTL_RAT == 11)
262#define flash_EBIU_AMBCTL0_RAT B0RAT_11
263#endif
264#if (flash_EBIU_AMBCTL_RAT == 10)
265#define flash_EBIU_AMBCTL0_RAT B0RAT_10
266#endif
267#if (flash_EBIU_AMBCTL_RAT == 9)
268#define flash_EBIU_AMBCTL0_RAT B0RAT_9
269#endif
270#if (flash_EBIU_AMBCTL_RAT == 8)
271#define flash_EBIU_AMBCTL0_RAT B0RAT_8
272#endif
273#if (flash_EBIU_AMBCTL_RAT == 7)
274#define flash_EBIU_AMBCTL0_RAT B0RAT_7
275#endif
276#if (flash_EBIU_AMBCTL_RAT == 6)
277#define flash_EBIU_AMBCTL0_RAT B0RAT_6
278#endif
279#if (flash_EBIU_AMBCTL_RAT == 5)
280#define flash_EBIU_AMBCTL0_RAT B0RAT_5
281#endif
282#if (flash_EBIU_AMBCTL_RAT == 4)
283#define flash_EBIU_AMBCTL0_RAT B0RAT_4
284#endif
285#if (flash_EBIU_AMBCTL_RAT == 3)
286#define flash_EBIU_AMBCTL0_RAT B0RAT_3
287#endif
288#if (flash_EBIU_AMBCTL_RAT == 2)
289#define flash_EBIU_AMBCTL0_RAT B0RAT_2
290#endif
291#if (flash_EBIU_AMBCTL_RAT == 1)
292#define flash_EBIU_AMBCTL0_RAT B0RAT_1
293#endif
294
295#define flash_EBIU_AMBCTL0 \
296 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
297 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
diff --git a/arch/blackfin/mach-bf533/include/mach/mem_map.h b/arch/blackfin/mach-bf533/include/mach/mem_map.h
index 581fc6eea789..fc33b7cb9937 100644
--- a/arch/blackfin/mach-bf533/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf533/include/mach/mem_map.h
@@ -168,4 +168,10 @@
168#define L1_SCRATCH_START 0xFFB00000 168#define L1_SCRATCH_START 0xFFB00000
169#define L1_SCRATCH_LENGTH 0x1000 169#define L1_SCRATCH_LENGTH 0x1000
170 170
171#define GET_PDA_SAFE(preg) \
172 preg.l = _cpu_pda; \
173 preg.h = _cpu_pda;
174
175#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
176
171#endif /* _MEM_MAP_533_H_ */ 177#endif /* _MEM_MAP_533_H_ */
diff --git a/arch/blackfin/mach-bf537/Kconfig b/arch/blackfin/mach-bf537/Kconfig
index 8255374c04aa..bbc08fd4f122 100644
--- a/arch/blackfin/mach-bf537/Kconfig
+++ b/arch/blackfin/mach-bf537/Kconfig
@@ -64,29 +64,29 @@ config IRQ_MAC_RX
64config IRQ_MAC_TX 64config IRQ_MAC_TX
65 int "IRQ_MAC_TX" 65 int "IRQ_MAC_TX"
66 default 11 66 default 11
67config IRQ_TMR0 67config IRQ_TIMER0
68 int "IRQ_TMR0" 68 int "IRQ_TIMER0"
69 default 12 69 default 8
70config IRQ_TMR1 70config IRQ_TIMER1
71 int "IRQ_TMR1" 71 int "IRQ_TIMER1"
72 default 12 72 default 12
73config IRQ_TMR2 73config IRQ_TIMER2
74 int "IRQ_TMR2" 74 int "IRQ_TIMER2"
75 default 12 75 default 12
76config IRQ_TMR3 76config IRQ_TIMER3
77 int "IRQ_TMR3" 77 int "IRQ_TIMER3"
78 default 12 78 default 12
79config IRQ_TMR4 79config IRQ_TIMER4
80 int "IRQ_TMR4" 80 int "IRQ_TIMER4"
81 default 12 81 default 12
82config IRQ_TMR5 82config IRQ_TIMER5
83 int "IRQ_TMR5" 83 int "IRQ_TIMER5"
84 default 12 84 default 12
85config IRQ_TMR6 85config IRQ_TIMER6
86 int "IRQ_TMR6" 86 int "IRQ_TIMER6"
87 default 12 87 default 12
88config IRQ_TMR7 88config IRQ_TIMER7
89 int "IRQ_TMR7" 89 int "IRQ_TIMER7"
90 default 12 90 default 12
91config IRQ_PROG_INTA 91config IRQ_PROG_INTA
92 int "IRQ_PROG_INTA" 92 int "IRQ_PROG_INTA"
diff --git a/arch/blackfin/mach-bf537/Makefile b/arch/blackfin/mach-bf537/Makefile
index 68e5478e95a9..56994b675f9c 100644
--- a/arch/blackfin/mach-bf537/Makefile
+++ b/arch/blackfin/mach-bf537/Makefile
@@ -2,6 +2,4 @@
2# arch/blackfin/mach-bf537/Makefile 2# arch/blackfin/mach-bf537/Makefile
3# 3#
4 4
5extra-y := head.o
6
7obj-y := ints-priority.o dma.o 5obj-y := ints-priority.o dma.o
diff --git a/arch/blackfin/mach-bf537/boards/cm_bf537.c b/arch/blackfin/mach-bf537/boards/cm_bf537.c
index dde14720b0ea..6ac8e4d5bd38 100644
--- a/arch/blackfin/mach-bf537/boards/cm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/cm_bf537.c
@@ -308,6 +308,19 @@ static struct platform_device net2272_bfin_device = {
308}; 308};
309#endif 309#endif
310 310
311static struct resource bfin_gpios_resources = {
312 .start = 0,
313 .end = MAX_BLACKFIN_GPIOS - 1,
314 .flags = IORESOURCE_IRQ,
315};
316
317static struct platform_device bfin_gpios_device = {
318 .name = "simple-gpio",
319 .id = -1,
320 .num_resources = 1,
321 .resource = &bfin_gpios_resources,
322};
323
311#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 324#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
312static struct mtd_partition cm_partitions[] = { 325static struct mtd_partition cm_partitions[] = {
313 { 326 {
@@ -379,30 +392,57 @@ static struct platform_device bfin_uart_device = {
379#endif 392#endif
380 393
381#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 394#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
382static struct resource bfin_sir_resources[] = {
383#ifdef CONFIG_BFIN_SIR0 395#ifdef CONFIG_BFIN_SIR0
396static struct resource bfin_sir0_resources[] = {
384 { 397 {
385 .start = 0xFFC00400, 398 .start = 0xFFC00400,
386 .end = 0xFFC004FF, 399 .end = 0xFFC004FF,
387 .flags = IORESOURCE_MEM, 400 .flags = IORESOURCE_MEM,
388 }, 401 },
402 {
403 .start = IRQ_UART0_RX,
404 .end = IRQ_UART0_RX+1,
405 .flags = IORESOURCE_IRQ,
406 },
407 {
408 .start = CH_UART0_RX,
409 .end = CH_UART0_RX+1,
410 .flags = IORESOURCE_DMA,
411 },
412};
413static struct platform_device bfin_sir0_device = {
414 .name = "bfin_sir",
415 .id = 0,
416 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
417 .resource = bfin_sir0_resources,
418};
389#endif 419#endif
390#ifdef CONFIG_BFIN_SIR1 420#ifdef CONFIG_BFIN_SIR1
421static struct resource bfin_sir1_resources[] = {
391 { 422 {
392 .start = 0xFFC02000, 423 .start = 0xFFC02000,
393 .end = 0xFFC020FF, 424 .end = 0xFFC020FF,
394 .flags = IORESOURCE_MEM, 425 .flags = IORESOURCE_MEM,
395 }, 426 },
396#endif 427 {
428 .start = IRQ_UART1_RX,
429 .end = IRQ_UART1_RX+1,
430 .flags = IORESOURCE_IRQ,
431 },
432 {
433 .start = CH_UART1_RX,
434 .end = CH_UART1_RX+1,
435 .flags = IORESOURCE_DMA,
436 },
397}; 437};
398 438static struct platform_device bfin_sir1_device = {
399static struct platform_device bfin_sir_device = {
400 .name = "bfin_sir", 439 .name = "bfin_sir",
401 .id = 0, 440 .id = 1,
402 .num_resources = ARRAY_SIZE(bfin_sir_resources), 441 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
403 .resource = bfin_sir_resources, 442 .resource = bfin_sir1_resources,
404}; 443};
405#endif 444#endif
445#endif
406 446
407#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 447#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
408static struct resource bfin_twi0_resource[] = { 448static struct resource bfin_twi0_resource[] = {
@@ -525,7 +565,12 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
525#endif 565#endif
526 566
527#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 567#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
528 &bfin_sir_device, 568#ifdef CONFIG_BFIN_SIR0
569 &bfin_sir0_device,
570#endif
571#ifdef CONFIG_BFIN_SIR1
572 &bfin_sir1_device,
573#endif
529#endif 574#endif
530 575
531#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 576#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
@@ -564,6 +609,8 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
564#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 609#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
565 &cm_flash_device, 610 &cm_flash_device,
566#endif 611#endif
612
613 &bfin_gpios_device,
567}; 614};
568 615
569static int __init cm_bf537_init(void) 616static int __init cm_bf537_init(void)
diff --git a/arch/blackfin/mach-bf537/boards/generic_board.c b/arch/blackfin/mach-bf537/boards/generic_board.c
index 78a13d5bfd55..dd6e6bfb98ea 100644
--- a/arch/blackfin/mach-bf537/boards/generic_board.c
+++ b/arch/blackfin/mach-bf537/boards/generic_board.c
@@ -50,57 +50,46 @@
50/* 50/*
51 * Name the Board for the /proc/cpuinfo 51 * Name the Board for the /proc/cpuinfo
52 */ 52 */
53const char bfin_board_name[] = "GENERIC Board"; 53const char bfin_board_name[] = "UNKNOWN BOARD";
54 54
55/* 55/*
56 * Driver needs to know address, irq and flag pin. 56 * Driver needs to know address, irq and flag pin.
57 */ 57 */
58 58
59#define ISP1761_BASE 0x203C0000
60#define ISP1761_IRQ IRQ_PF7
61
62#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 59#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
63static struct resource bfin_isp1761_resources[] = { 60#include <linux/usb/isp1760.h>
61static struct resource bfin_isp1760_resources[] = {
64 [0] = { 62 [0] = {
65 .name = "isp1761-regs", 63 .start = 0x203C0000,
66 .start = ISP1761_BASE + 0x00000000, 64 .end = 0x203C0000 + 0x000fffff,
67 .end = ISP1761_BASE + 0x000fffff,
68 .flags = IORESOURCE_MEM, 65 .flags = IORESOURCE_MEM,
69 }, 66 },
70 [1] = { 67 [1] = {
71 .start = ISP1761_IRQ, 68 .start = IRQ_PF7,
72 .end = ISP1761_IRQ, 69 .end = IRQ_PF7,
73 .flags = IORESOURCE_IRQ, 70 .flags = IORESOURCE_IRQ,
74 }, 71 },
75}; 72};
76 73
77static struct platform_device bfin_isp1761_device = { 74static struct isp1760_platform_data isp1760_priv = {
78 .name = "isp1761", 75 .is_isp1761 = 0,
79 .id = 0, 76 .port1_disable = 0,
80 .num_resources = ARRAY_SIZE(bfin_isp1761_resources), 77 .bus_width_16 = 1,
81 .resource = bfin_isp1761_resources, 78 .port1_otg = 0,
79 .analog_oc = 0,
80 .dack_polarity_high = 0,
81 .dreq_polarity_high = 0,
82}; 82};
83 83
84static struct platform_device *bfin_isp1761_devices[] = { 84static struct platform_device bfin_isp1760_device = {
85 &bfin_isp1761_device, 85 .name = "isp1760-hcd",
86 .id = 0,
87 .dev = {
88 .platform_data = &isp1760_priv,
89 },
90 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
91 .resource = bfin_isp1760_resources,
86}; 92};
87
88int __init bfin_isp1761_init(void)
89{
90 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
91
92 printk(KERN_INFO "%s(): registering device resources\n", __func__);
93 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
94
95 return platform_add_devices(bfin_isp1761_devices, num_devices);
96}
97
98void __exit bfin_isp1761_exit(void)
99{
100 platform_device_unregister(&bfin_isp1761_device);
101}
102
103arch_initcall(bfin_isp1761_init);
104#endif 93#endif
105 94
106#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 95#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
@@ -559,30 +548,59 @@ static struct platform_device bfin_uart_device = {
559#endif 548#endif
560 549
561#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 550#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
562static struct resource bfin_sir_resources[] = {
563#ifdef CONFIG_BFIN_SIR0 551#ifdef CONFIG_BFIN_SIR0
552static struct resource bfin_sir0_resources[] = {
564 { 553 {
565 .start = 0xFFC00400, 554 .start = 0xFFC00400,
566 .end = 0xFFC004FF, 555 .end = 0xFFC004FF,
567 .flags = IORESOURCE_MEM, 556 .flags = IORESOURCE_MEM,
568 }, 557 },
558 {
559 .start = IRQ_UART0_RX,
560 .end = IRQ_UART0_RX+1,
561 .flags = IORESOURCE_IRQ,
562 },
563 {
564 .start = CH_UART0_RX,
565 .end = CH_UART0_RX+1,
566 .flags = IORESOURCE_DMA,
567 },
568};
569
570static struct platform_device bfin_sir0_device = {
571 .name = "bfin_sir",
572 .id = 0,
573 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
574 .resource = bfin_sir0_resources,
575};
569#endif 576#endif
570#ifdef CONFIG_BFIN_SIR1 577#ifdef CONFIG_BFIN_SIR1
578static struct resource bfin_sir1_resources[] = {
571 { 579 {
572 .start = 0xFFC02000, 580 .start = 0xFFC02000,
573 .end = 0xFFC020FF, 581 .end = 0xFFC020FF,
574 .flags = IORESOURCE_MEM, 582 .flags = IORESOURCE_MEM,
575 }, 583 },
576#endif 584 {
585 .start = IRQ_UART1_RX,
586 .end = IRQ_UART1_RX+1,
587 .flags = IORESOURCE_IRQ,
588 },
589 {
590 .start = CH_UART1_RX,
591 .end = CH_UART1_RX+1,
592 .flags = IORESOURCE_DMA,
593 },
577}; 594};
578 595
579static struct platform_device bfin_sir_device = { 596static struct platform_device bfin_sir1_device = {
580 .name = "bfin_sir", 597 .name = "bfin_sir",
581 .id = 0, 598 .id = 1,
582 .num_resources = ARRAY_SIZE(bfin_sir_resources), 599 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
583 .resource = bfin_sir_resources, 600 .resource = bfin_sir1_resources,
584}; 601};
585#endif 602#endif
603#endif
586 604
587#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 605#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
588static struct resource bfin_twi0_resource[] = { 606static struct resource bfin_twi0_resource[] = {
@@ -651,6 +669,10 @@ static struct platform_device *stamp_devices[] __initdata = {
651 &net2272_bfin_device, 669 &net2272_bfin_device,
652#endif 670#endif
653 671
672#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
673 &bfin_isp1760_device,
674#endif
675
654#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 676#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
655 &bfin_spi0_device, 677 &bfin_spi0_device,
656#endif 678#endif
@@ -668,7 +690,12 @@ static struct platform_device *stamp_devices[] __initdata = {
668#endif 690#endif
669 691
670#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 692#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
671 &bfin_sir_device, 693#ifdef CONFIG_BFIN_SIR0
694 &bfin_sir0_device,
695#endif
696#ifdef CONFIG_BFIN_SIR1
697 &bfin_sir1_device,
698#endif
672#endif 699#endif
673 700
674#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 701#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
diff --git a/arch/blackfin/mach-bf537/boards/minotaur.c b/arch/blackfin/mach-bf537/boards/minotaur.c
index 48c4cd2d1be6..bb795341cb17 100644
--- a/arch/blackfin/mach-bf537/boards/minotaur.c
+++ b/arch/blackfin/mach-bf537/boards/minotaur.c
@@ -226,30 +226,59 @@ static struct platform_device bfin_uart_device = {
226#endif 226#endif
227 227
228#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 228#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
229static struct resource bfin_sir_resources[] = {
230#ifdef CONFIG_BFIN_SIR0 229#ifdef CONFIG_BFIN_SIR0
230static struct resource bfin_sir0_resources[] = {
231 { 231 {
232 .start = 0xFFC00400, 232 .start = 0xFFC00400,
233 .end = 0xFFC004FF, 233 .end = 0xFFC004FF,
234 .flags = IORESOURCE_MEM, 234 .flags = IORESOURCE_MEM,
235 }, 235 },
236 {
237 .start = IRQ_UART0_RX,
238 .end = IRQ_UART0_RX+1,
239 .flags = IORESOURCE_IRQ,
240 },
241 {
242 .start = CH_UART0_RX,
243 .end = CH_UART0_RX+1,
244 .flags = IORESOURCE_DMA,
245 },
246};
247
248static struct platform_device bfin_sir0_device = {
249 .name = "bfin_sir",
250 .id = 0,
251 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
252 .resource = bfin_sir0_resources,
253};
236#endif 254#endif
237#ifdef CONFIG_BFIN_SIR1 255#ifdef CONFIG_BFIN_SIR1
256static struct resource bfin_sir1_resources[] = {
238 { 257 {
239 .start = 0xFFC02000, 258 .start = 0xFFC02000,
240 .end = 0xFFC020FF, 259 .end = 0xFFC020FF,
241 .flags = IORESOURCE_MEM, 260 .flags = IORESOURCE_MEM,
242 }, 261 },
243#endif 262 {
263 .start = IRQ_UART1_RX,
264 .end = IRQ_UART1_RX+1,
265 .flags = IORESOURCE_IRQ,
266 },
267 {
268 .start = CH_UART1_RX,
269 .end = CH_UART1_RX+1,
270 .flags = IORESOURCE_DMA,
271 },
244}; 272};
245 273
246static struct platform_device bfin_sir_device = { 274static struct platform_device bfin_sir1_device = {
247 .name = "bfin_sir", 275 .name = "bfin_sir",
248 .id = 0, 276 .id = 1,
249 .num_resources = ARRAY_SIZE(bfin_sir_resources), 277 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
250 .resource = bfin_sir_resources, 278 .resource = bfin_sir1_resources,
251}; 279};
252#endif 280#endif
281#endif
253 282
254#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 283#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
255static struct resource bfin_twi0_resource[] = { 284static struct resource bfin_twi0_resource[] = {
@@ -311,7 +340,12 @@ static struct platform_device *minotaur_devices[] __initdata = {
311#endif 340#endif
312 341
313#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 342#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
314 &bfin_sir_device, 343#ifdef CONFIG_BFIN_SIR0
344 &bfin_sir0_device,
345#endif
346#ifdef CONFIG_BFIN_SIR1
347 &bfin_sir1_device,
348#endif
315#endif 349#endif
316 350
317#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 351#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
diff --git a/arch/blackfin/mach-bf537/boards/pnav10.c b/arch/blackfin/mach-bf537/boards/pnav10.c
index f9174c11cbd4..89de94f4545d 100644
--- a/arch/blackfin/mach-bf537/boards/pnav10.c
+++ b/arch/blackfin/mach-bf537/boards/pnav10.c
@@ -49,7 +49,7 @@
49/* 49/*
50 * Name the Board for the /proc/cpuinfo 50 * Name the Board for the /proc/cpuinfo
51 */ 51 */
52const char bfin_board_name[] = "PNAV-1.0"; 52const char bfin_board_name[] = "ADI PNAV-1.0";
53 53
54/* 54/*
55 * Driver needs to know address, irq and flag pin. 55 * Driver needs to know address, irq and flag pin.
@@ -453,30 +453,59 @@ static struct platform_device bfin_uart_device = {
453#endif 453#endif
454 454
455#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 455#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
456static struct resource bfin_sir_resources[] = {
457#ifdef CONFIG_BFIN_SIR0 456#ifdef CONFIG_BFIN_SIR0
457static struct resource bfin_sir0_resources[] = {
458 { 458 {
459 .start = 0xFFC00400, 459 .start = 0xFFC00400,
460 .end = 0xFFC004FF, 460 .end = 0xFFC004FF,
461 .flags = IORESOURCE_MEM, 461 .flags = IORESOURCE_MEM,
462 }, 462 },
463 {
464 .start = IRQ_UART0_RX,
465 .end = IRQ_UART0_RX+1,
466 .flags = IORESOURCE_IRQ,
467 },
468 {
469 .start = CH_UART0_RX,
470 .end = CH_UART0_RX+1,
471 .flags = IORESOURCE_DMA,
472 },
473};
474
475static struct platform_device bfin_sir0_device = {
476 .name = "bfin_sir",
477 .id = 0,
478 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
479 .resource = bfin_sir0_resources,
480};
463#endif 481#endif
464#ifdef CONFIG_BFIN_SIR1 482#ifdef CONFIG_BFIN_SIR1
483static struct resource bfin_sir1_resources[] = {
465 { 484 {
466 .start = 0xFFC02000, 485 .start = 0xFFC02000,
467 .end = 0xFFC020FF, 486 .end = 0xFFC020FF,
468 .flags = IORESOURCE_MEM, 487 .flags = IORESOURCE_MEM,
469 }, 488 },
470#endif 489 {
490 .start = IRQ_UART1_RX,
491 .end = IRQ_UART1_RX+1,
492 .flags = IORESOURCE_IRQ,
493 },
494 {
495 .start = CH_UART1_RX,
496 .end = CH_UART1_RX+1,
497 .flags = IORESOURCE_DMA,
498 },
471}; 499};
472 500
473static struct platform_device bfin_sir_device = { 501static struct platform_device bfin_sir1_device = {
474 .name = "bfin_sir", 502 .name = "bfin_sir",
475 .id = 0, 503 .id = 1,
476 .num_resources = ARRAY_SIZE(bfin_sir_resources), 504 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
477 .resource = bfin_sir_resources, 505 .resource = bfin_sir1_resources,
478}; 506};
479#endif 507#endif
508#endif
480 509
481static struct platform_device *stamp_devices[] __initdata = { 510static struct platform_device *stamp_devices[] __initdata = {
482#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE) 511#if defined(CONFIG_BFIN_CFPCMCIA) || defined(CONFIG_BFIN_CFPCMCIA_MODULE)
@@ -520,7 +549,12 @@ static struct platform_device *stamp_devices[] __initdata = {
520#endif 549#endif
521 550
522#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 551#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
523 &bfin_sir_device, 552#ifdef CONFIG_BFIN_SIR0
553 &bfin_sir0_device,
554#endif
555#ifdef CONFIG_BFIN_SIR1
556 &bfin_sir1_device,
557#endif
524#endif 558#endif
525}; 559};
526 560
diff --git a/arch/blackfin/mach-bf537/boards/stamp.c b/arch/blackfin/mach-bf537/boards/stamp.c
index 8d394393201f..d812e2514a2f 100644
--- a/arch/blackfin/mach-bf537/boards/stamp.c
+++ b/arch/blackfin/mach-bf537/boards/stamp.c
@@ -46,6 +46,7 @@
46#include <linux/interrupt.h> 46#include <linux/interrupt.h>
47#include <linux/i2c.h> 47#include <linux/i2c.h>
48#include <linux/usb/sl811.h> 48#include <linux/usb/sl811.h>
49#include <linux/spi/mmc_spi.h>
49#include <asm/dma.h> 50#include <asm/dma.h>
50#include <asm/bfin5xx_spi.h> 51#include <asm/bfin5xx_spi.h>
51#include <asm/reboot.h> 52#include <asm/reboot.h>
@@ -55,57 +56,46 @@
55/* 56/*
56 * Name the Board for the /proc/cpuinfo 57 * Name the Board for the /proc/cpuinfo
57 */ 58 */
58const char bfin_board_name[] = "ADDS-BF537-STAMP"; 59const char bfin_board_name[] = "ADI BF537-STAMP";
59 60
60/* 61/*
61 * Driver needs to know address, irq and flag pin. 62 * Driver needs to know address, irq and flag pin.
62 */ 63 */
63 64
64#define ISP1761_BASE 0x203C0000
65#define ISP1761_IRQ IRQ_PF7
66
67#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 65#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
68static struct resource bfin_isp1761_resources[] = { 66#include <linux/usb/isp1760.h>
67static struct resource bfin_isp1760_resources[] = {
69 [0] = { 68 [0] = {
70 .name = "isp1761-regs", 69 .start = 0x203C0000,
71 .start = ISP1761_BASE + 0x00000000, 70 .end = 0x203C0000 + 0x000fffff,
72 .end = ISP1761_BASE + 0x000fffff,
73 .flags = IORESOURCE_MEM, 71 .flags = IORESOURCE_MEM,
74 }, 72 },
75 [1] = { 73 [1] = {
76 .start = ISP1761_IRQ, 74 .start = IRQ_PF7,
77 .end = ISP1761_IRQ, 75 .end = IRQ_PF7,
78 .flags = IORESOURCE_IRQ, 76 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
79 }, 77 },
80}; 78};
81 79
82static struct platform_device bfin_isp1761_device = { 80static struct isp1760_platform_data isp1760_priv = {
83 .name = "isp1761", 81 .is_isp1761 = 0,
84 .id = 0, 82 .port1_disable = 0,
85 .num_resources = ARRAY_SIZE(bfin_isp1761_resources), 83 .bus_width_16 = 1,
86 .resource = bfin_isp1761_resources, 84 .port1_otg = 0,
85 .analog_oc = 0,
86 .dack_polarity_high = 0,
87 .dreq_polarity_high = 0,
87}; 88};
88 89
89static struct platform_device *bfin_isp1761_devices[] = { 90static struct platform_device bfin_isp1760_device = {
90 &bfin_isp1761_device, 91 .name = "isp1760-hcd",
92 .id = 0,
93 .dev = {
94 .platform_data = &isp1760_priv,
95 },
96 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
97 .resource = bfin_isp1760_resources,
91}; 98};
92
93int __init bfin_isp1761_init(void)
94{
95 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
96
97 printk(KERN_INFO "%s(): registering device resources\n", __func__);
98 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
99
100 return platform_add_devices(bfin_isp1761_devices, num_devices);
101}
102
103void __exit bfin_isp1761_exit(void)
104{
105 platform_device_unregister(&bfin_isp1761_device);
106}
107
108arch_initcall(bfin_isp1761_init);
109#endif 99#endif
110 100
111#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 101#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
@@ -443,11 +433,11 @@ static struct mtd_partition stamp_partitions[] = {
443 .offset = 0, 433 .offset = 0,
444 }, { 434 }, {
445 .name = "linux kernel(nor)", 435 .name = "linux kernel(nor)",
446 .size = 0xE0000, 436 .size = 0x180000,
447 .offset = MTDPART_OFS_APPEND, 437 .offset = MTDPART_OFS_APPEND,
448 }, { 438 }, {
449 .name = "file system(nor)", 439 .name = "file system(nor)",
450 .size = 0x400000 - 0x40000 - 0xE0000 - 0x10000, 440 .size = 0x400000 - 0x40000 - 0x180000 - 0x10000,
451 .offset = MTDPART_OFS_APPEND, 441 .offset = MTDPART_OFS_APPEND,
452 }, { 442 }, {
453 .name = "MAC Address(nor)", 443 .name = "MAC Address(nor)",
@@ -490,7 +480,7 @@ static struct mtd_partition bfin_spi_flash_partitions[] = {
490 .mask_flags = MTD_CAP_ROM 480 .mask_flags = MTD_CAP_ROM
491 }, { 481 }, {
492 .name = "linux kernel(spi)", 482 .name = "linux kernel(spi)",
493 .size = 0xe0000, 483 .size = 0x180000,
494 .offset = MTDPART_OFS_APPEND, 484 .offset = MTDPART_OFS_APPEND,
495 }, { 485 }, {
496 .name = "file system(spi)", 486 .name = "file system(spi)",
@@ -503,7 +493,7 @@ static struct flash_platform_data bfin_spi_flash_data = {
503 .name = "m25p80", 493 .name = "m25p80",
504 .parts = bfin_spi_flash_partitions, 494 .parts = bfin_spi_flash_partitions,
505 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions), 495 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
506 .type = "m25p64", 496 /* .type = "m25p64", */
507}; 497};
508 498
509/* SPI flash chip (m25p64) */ 499/* SPI flash chip (m25p64) */
@@ -537,9 +527,29 @@ static struct bfin5xx_spi_chip ad9960_spi_chip_info = {
537}; 527};
538#endif 528#endif
539 529
540#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) 530#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
541static struct bfin5xx_spi_chip spi_mmc_chip_info = { 531#define MMC_SPI_CARD_DETECT_INT IRQ_PF5
542 .enable_dma = 1, 532
533static int bfin_mmc_spi_init(struct device *dev,
534 irqreturn_t (*detect_int)(int, void *), void *data)
535{
536 return request_irq(MMC_SPI_CARD_DETECT_INT, detect_int,
537 IRQF_TRIGGER_FALLING, "mmc-spi-detect", data);
538}
539
540static void bfin_mmc_spi_exit(struct device *dev, void *data)
541{
542 free_irq(MMC_SPI_CARD_DETECT_INT, data);
543}
544
545static struct mmc_spi_platform_data bfin_mmc_spi_pdata = {
546 .init = bfin_mmc_spi_init,
547 .exit = bfin_mmc_spi_exit,
548 .detect_delay = 100, /* msecs */
549};
550
551static struct bfin5xx_spi_chip mmc_spi_chip_info = {
552 .enable_dma = 0,
543 .bits_per_word = 8, 553 .bits_per_word = 8,
544}; 554};
545#endif 555#endif
@@ -613,6 +623,14 @@ static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
613}; 623};
614#endif 624#endif
615 625
626#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
627static struct bfin5xx_spi_chip enc28j60_spi_chip_info = {
628 .enable_dma = 1,
629 .bits_per_word = 8,
630 .cs_gpio = GPIO_PF10,
631};
632#endif
633
616#if defined(CONFIG_MTD_DATAFLASH) \ 634#if defined(CONFIG_MTD_DATAFLASH) \
617 || defined(CONFIG_MTD_DATAFLASH_MODULE) 635 || defined(CONFIG_MTD_DATAFLASH_MODULE)
618 636
@@ -624,7 +642,7 @@ static struct mtd_partition bfin_spi_dataflash_partitions[] = {
624 .mask_flags = MTD_CAP_ROM 642 .mask_flags = MTD_CAP_ROM
625 }, { 643 }, {
626 .name = "linux kernel(spi)", 644 .name = "linux kernel(spi)",
627 .size = 0xe0000, 645 .size = 0x180000,
628 .offset = MTDPART_OFS_APPEND, 646 .offset = MTDPART_OFS_APPEND,
629 }, { 647 }, {
630 .name = "file system(spi)", 648 .name = "file system(spi)",
@@ -703,23 +721,14 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
703 .controller_data = &ad9960_spi_chip_info, 721 .controller_data = &ad9960_spi_chip_info,
704 }, 722 },
705#endif 723#endif
706#if defined(CONFIG_SPI_MMC) || defined(CONFIG_SPI_MMC_MODULE) 724#if defined(CONFIG_MMC_SPI) || defined(CONFIG_MMC_SPI_MODULE)
707 { 725 {
708 .modalias = "spi_mmc_dummy", 726 .modalias = "mmc_spi",
709 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */ 727 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
710 .bus_num = 0, 728 .bus_num = 0,
711 .chip_select = 0, 729 .chip_select = 4,
712 .platform_data = NULL, 730 .platform_data = &bfin_mmc_spi_pdata,
713 .controller_data = &spi_mmc_chip_info, 731 .controller_data = &mmc_spi_chip_info,
714 .mode = SPI_MODE_3,
715 },
716 {
717 .modalias = "spi_mmc",
718 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
719 .bus_num = 0,
720 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
721 .platform_data = NULL,
722 .controller_data = &spi_mmc_chip_info,
723 .mode = SPI_MODE_3, 732 .mode = SPI_MODE_3,
724 }, 733 },
725#endif 734#endif
@@ -783,6 +792,17 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
783 .mode = SPI_CPHA | SPI_CPOL, 792 .mode = SPI_CPHA | SPI_CPOL,
784 }, 793 },
785#endif 794#endif
795#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
796 {
797 .modalias = "enc28j60",
798 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
799 .irq = IRQ_PF6,
800 .bus_num = 0,
801 .chip_select = 0, /* GPIO controlled SSEL */
802 .controller_data = &enc28j60_spi_chip_info,
803 .mode = SPI_MODE_0,
804 },
805#endif
786}; 806};
787 807
788#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 808#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
@@ -885,30 +905,59 @@ static struct platform_device bfin_uart_device = {
885#endif 905#endif
886 906
887#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 907#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
888static struct resource bfin_sir_resources[] = {
889#ifdef CONFIG_BFIN_SIR0 908#ifdef CONFIG_BFIN_SIR0
909static struct resource bfin_sir0_resources[] = {
890 { 910 {
891 .start = 0xFFC00400, 911 .start = 0xFFC00400,
892 .end = 0xFFC004FF, 912 .end = 0xFFC004FF,
893 .flags = IORESOURCE_MEM, 913 .flags = IORESOURCE_MEM,
894 }, 914 },
915 {
916 .start = IRQ_UART0_RX,
917 .end = IRQ_UART0_RX+1,
918 .flags = IORESOURCE_IRQ,
919 },
920 {
921 .start = CH_UART0_RX,
922 .end = CH_UART0_RX+1,
923 .flags = IORESOURCE_DMA,
924 },
925};
926
927static struct platform_device bfin_sir0_device = {
928 .name = "bfin_sir",
929 .id = 0,
930 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
931 .resource = bfin_sir0_resources,
932};
895#endif 933#endif
896#ifdef CONFIG_BFIN_SIR1 934#ifdef CONFIG_BFIN_SIR1
935static struct resource bfin_sir1_resources[] = {
897 { 936 {
898 .start = 0xFFC02000, 937 .start = 0xFFC02000,
899 .end = 0xFFC020FF, 938 .end = 0xFFC020FF,
900 .flags = IORESOURCE_MEM, 939 .flags = IORESOURCE_MEM,
901 }, 940 },
902#endif 941 {
942 .start = IRQ_UART1_RX,
943 .end = IRQ_UART1_RX+1,
944 .flags = IORESOURCE_IRQ,
945 },
946 {
947 .start = CH_UART1_RX,
948 .end = CH_UART1_RX+1,
949 .flags = IORESOURCE_DMA,
950 },
903}; 951};
904 952
905static struct platform_device bfin_sir_device = { 953static struct platform_device bfin_sir1_device = {
906 .name = "bfin_sir", 954 .name = "bfin_sir",
907 .id = 0, 955 .id = 1,
908 .num_resources = ARRAY_SIZE(bfin_sir_resources), 956 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
909 .resource = bfin_sir_resources, 957 .resource = bfin_sir1_resources,
910}; 958};
911#endif 959#endif
960#endif
912 961
913#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 962#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
914static struct resource bfin_twi0_resource[] = { 963static struct resource bfin_twi0_resource[] = {
@@ -932,6 +981,93 @@ static struct platform_device i2c_bfin_twi_device = {
932}; 981};
933#endif 982#endif
934 983
984#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
985#include <linux/input.h>
986#include <linux/i2c/adp5588_keys.h>
987static const unsigned short adp5588_keymap[ADP5588_KEYMAPSIZE] = {
988 [0] = KEY_GRAVE,
989 [1] = KEY_1,
990 [2] = KEY_2,
991 [3] = KEY_3,
992 [4] = KEY_4,
993 [5] = KEY_5,
994 [6] = KEY_6,
995 [7] = KEY_7,
996 [8] = KEY_8,
997 [9] = KEY_9,
998 [10] = KEY_0,
999 [11] = KEY_MINUS,
1000 [12] = KEY_EQUAL,
1001 [13] = KEY_BACKSLASH,
1002 [15] = KEY_KP0,
1003 [16] = KEY_Q,
1004 [17] = KEY_W,
1005 [18] = KEY_E,
1006 [19] = KEY_R,
1007 [20] = KEY_T,
1008 [21] = KEY_Y,
1009 [22] = KEY_U,
1010 [23] = KEY_I,
1011 [24] = KEY_O,
1012 [25] = KEY_P,
1013 [26] = KEY_LEFTBRACE,
1014 [27] = KEY_RIGHTBRACE,
1015 [29] = KEY_KP1,
1016 [30] = KEY_KP2,
1017 [31] = KEY_KP3,
1018 [32] = KEY_A,
1019 [33] = KEY_S,
1020 [34] = KEY_D,
1021 [35] = KEY_F,
1022 [36] = KEY_G,
1023 [37] = KEY_H,
1024 [38] = KEY_J,
1025 [39] = KEY_K,
1026 [40] = KEY_L,
1027 [41] = KEY_SEMICOLON,
1028 [42] = KEY_APOSTROPHE,
1029 [43] = KEY_BACKSLASH,
1030 [45] = KEY_KP4,
1031 [46] = KEY_KP5,
1032 [47] = KEY_KP6,
1033 [48] = KEY_102ND,
1034 [49] = KEY_Z,
1035 [50] = KEY_X,
1036 [51] = KEY_C,
1037 [52] = KEY_V,
1038 [53] = KEY_B,
1039 [54] = KEY_N,
1040 [55] = KEY_M,
1041 [56] = KEY_COMMA,
1042 [57] = KEY_DOT,
1043 [58] = KEY_SLASH,
1044 [60] = KEY_KPDOT,
1045 [61] = KEY_KP7,
1046 [62] = KEY_KP8,
1047 [63] = KEY_KP9,
1048 [64] = KEY_SPACE,
1049 [65] = KEY_BACKSPACE,
1050 [66] = KEY_TAB,
1051 [67] = KEY_KPENTER,
1052 [68] = KEY_ENTER,
1053 [69] = KEY_ESC,
1054 [70] = KEY_DELETE,
1055 [74] = KEY_KPMINUS,
1056 [76] = KEY_UP,
1057 [77] = KEY_DOWN,
1058 [78] = KEY_RIGHT,
1059 [79] = KEY_LEFT,
1060};
1061
1062static struct adp5588_kpad_platform_data adp5588_kpad_data = {
1063 .rows = 8,
1064 .cols = 10,
1065 .keymap = adp5588_keymap,
1066 .keymapsize = ARRAY_SIZE(adp5588_keymap),
1067 .repeat = 0,
1068};
1069#endif
1070
935#ifdef CONFIG_I2C_BOARDINFO 1071#ifdef CONFIG_I2C_BOARDINFO
936static struct i2c_board_info __initdata bfin_i2c_board_info[] = { 1072static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
937#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE) 1073#if defined(CONFIG_JOYSTICK_AD7142) || defined(CONFIG_JOYSTICK_AD7142_MODULE)
@@ -958,6 +1094,13 @@ static struct i2c_board_info __initdata bfin_i2c_board_info[] = {
958 .platform_data = (void *)&bfin_ad7879_ts_info, 1094 .platform_data = (void *)&bfin_ad7879_ts_info,
959 }, 1095 },
960#endif 1096#endif
1097#if defined(CONFIG_KEYBOARD_ADP5588) || defined(CONFIG_KEYBOARD_ADP5588_MODULE)
1098 {
1099 I2C_BOARD_INFO("adp5588-keys", 0x34),
1100 .irq = IRQ_PG0,
1101 .platform_data = (void *)&adp5588_kpad_data,
1102 },
1103#endif
961}; 1104};
962#endif 1105#endif
963 1106
@@ -1057,6 +1200,10 @@ static struct platform_device *stamp_devices[] __initdata = {
1057 &isp1362_hcd_device, 1200 &isp1362_hcd_device,
1058#endif 1201#endif
1059 1202
1203#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
1204 &bfin_isp1760_device,
1205#endif
1206
1060#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 1207#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
1061 &smc91x_device, 1208 &smc91x_device,
1062#endif 1209#endif
@@ -1098,7 +1245,12 @@ static struct platform_device *stamp_devices[] __initdata = {
1098#endif 1245#endif
1099 1246
1100#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 1247#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
1101 &bfin_sir_device, 1248#ifdef CONFIG_BFIN_SIR0
1249 &bfin_sir0_device,
1250#endif
1251#ifdef CONFIG_BFIN_SIR1
1252 &bfin_sir1_device,
1253#endif
1102#endif 1254#endif
1103 1255
1104#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 1256#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
diff --git a/arch/blackfin/mach-bf537/boards/tcm_bf537.c b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
index d5ff705a5129..2f4b066153c5 100644
--- a/arch/blackfin/mach-bf537/boards/tcm_bf537.c
+++ b/arch/blackfin/mach-bf537/boards/tcm_bf537.c
@@ -308,6 +308,19 @@ static struct platform_device net2272_bfin_device = {
308}; 308};
309#endif 309#endif
310 310
311static struct resource bfin_gpios_resources = {
312 .start = 0,
313 .end = MAX_BLACKFIN_GPIOS - 1,
314 .flags = IORESOURCE_IRQ,
315};
316
317static struct platform_device bfin_gpios_device = {
318 .name = "simple-gpio",
319 .id = -1,
320 .num_resources = 1,
321 .resource = &bfin_gpios_resources,
322};
323
311#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 324#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
312static struct mtd_partition cm_partitions[] = { 325static struct mtd_partition cm_partitions[] = {
313 { 326 {
@@ -379,30 +392,59 @@ static struct platform_device bfin_uart_device = {
379#endif 392#endif
380 393
381#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 394#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
382static struct resource bfin_sir_resources[] = {
383#ifdef CONFIG_BFIN_SIR0 395#ifdef CONFIG_BFIN_SIR0
396static struct resource bfin_sir0_resources[] = {
384 { 397 {
385 .start = 0xFFC00400, 398 .start = 0xFFC00400,
386 .end = 0xFFC004FF, 399 .end = 0xFFC004FF,
387 .flags = IORESOURCE_MEM, 400 .flags = IORESOURCE_MEM,
388 }, 401 },
402 {
403 .start = IRQ_UART0_RX,
404 .end = IRQ_UART0_RX+1,
405 .flags = IORESOURCE_IRQ,
406 },
407 {
408 .start = CH_UART0_RX,
409 .end = CH_UART0_RX+1,
410 .flags = IORESOURCE_DMA,
411 },
412};
413
414static struct platform_device bfin_sir0_device = {
415 .name = "bfin_sir",
416 .id = 0,
417 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
418 .resource = bfin_sir0_resources,
419};
389#endif 420#endif
390#ifdef CONFIG_BFIN_SIR1 421#ifdef CONFIG_BFIN_SIR1
422static struct resource bfin_sir1_resources[] = {
391 { 423 {
392 .start = 0xFFC02000, 424 .start = 0xFFC02000,
393 .end = 0xFFC020FF, 425 .end = 0xFFC020FF,
394 .flags = IORESOURCE_MEM, 426 .flags = IORESOURCE_MEM,
395 }, 427 },
396#endif 428 {
429 .start = IRQ_UART1_RX,
430 .end = IRQ_UART1_RX+1,
431 .flags = IORESOURCE_IRQ,
432 },
433 {
434 .start = CH_UART1_RX,
435 .end = CH_UART1_RX+1,
436 .flags = IORESOURCE_DMA,
437 },
397}; 438};
398 439
399static struct platform_device bfin_sir_device = { 440static struct platform_device bfin_sir1_device = {
400 .name = "bfin_sir", 441 .name = "bfin_sir",
401 .id = 0, 442 .id = 1,
402 .num_resources = ARRAY_SIZE(bfin_sir_resources), 443 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
403 .resource = bfin_sir_resources, 444 .resource = bfin_sir1_resources,
404}; 445};
405#endif 446#endif
447#endif
406 448
407#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 449#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
408static struct resource bfin_twi0_resource[] = { 450static struct resource bfin_twi0_resource[] = {
@@ -525,7 +567,12 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
525#endif 567#endif
526 568
527#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 569#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
528 &bfin_sir_device, 570#ifdef CONFIG_BFIN_SIR0
571 &bfin_sir0_device,
572#endif
573#ifdef CONFIG_BFIN_SIR1
574 &bfin_sir1_device,
575#endif
529#endif 576#endif
530 577
531#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 578#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
@@ -564,6 +611,8 @@ static struct platform_device *cm_bf537_devices[] __initdata = {
564#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE) 611#if defined(CONFIG_MTD_GPIO_ADDR) || defined(CONFIG_MTD_GPIO_ADDR_MODULE)
565 &cm_flash_device, 612 &cm_flash_device,
566#endif 613#endif
614
615 &bfin_gpios_device,
567}; 616};
568 617
569static int __init cm_bf537_init(void) 618static int __init cm_bf537_init(void)
diff --git a/arch/blackfin/mach-bf537/dma.c b/arch/blackfin/mach-bf537/dma.c
index 4edb363ff99c..81185051de91 100644
--- a/arch/blackfin/mach-bf537/dma.c
+++ b/arch/blackfin/mach-bf537/dma.c
@@ -31,7 +31,7 @@
31#include <asm/blackfin.h> 31#include <asm/blackfin.h>
32#include <asm/dma.h> 32#include <asm/dma.h>
33 33
34struct dma_register *dma_io_base_addr[MAX_BLACKFIN_DMA_CHANNEL] = { 34struct dma_register *dma_io_base_addr[MAX_DMA_CHANNELS] = {
35 (struct dma_register *) DMA0_NEXT_DESC_PTR, 35 (struct dma_register *) DMA0_NEXT_DESC_PTR,
36 (struct dma_register *) DMA1_NEXT_DESC_PTR, 36 (struct dma_register *) DMA1_NEXT_DESC_PTR,
37 (struct dma_register *) DMA2_NEXT_DESC_PTR, 37 (struct dma_register *) DMA2_NEXT_DESC_PTR,
diff --git a/arch/blackfin/mach-bf537/head.S b/arch/blackfin/mach-bf537/head.S
deleted file mode 100644
index f5c94bf80e3b..000000000000
--- a/arch/blackfin/mach-bf537/head.S
+++ /dev/null
@@ -1,146 +0,0 @@
1/*
2 * File: arch/blackfin/mach-bf537/head.S
3 * Based on: arch/blackfin/mach-bf533/head.S
4 * Author: Jeff Dionne <jeff@uclinux.org> COPYRIGHT 1998 D. Jeff Dionne
5 *
6 * Created: 1998
7 * Description: Startup code for Blackfin BF537
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/linkage.h>
31#include <linux/init.h>
32#include <asm/blackfin.h>
33#ifdef CONFIG_BFIN_KERNEL_CLOCK
34#include <asm/clocks.h>
35#include <mach/mem_init.h>
36#endif
37
38.section .l1.text
39#ifdef CONFIG_BFIN_KERNEL_CLOCK
40ENTRY(_start_dma_code)
41
42 /* Enable PHY CLK buffer output */
43 p0.h = hi(VR_CTL);
44 p0.l = lo(VR_CTL);
45 r0.l = w[p0];
46 bitset(r0, 14);
47 w[p0] = r0.l;
48 ssync;
49
50 p0.h = hi(SIC_IWR);
51 p0.l = lo(SIC_IWR);
52 r0.l = 0x1;
53 r0.h = 0x0;
54 [p0] = r0;
55 SSYNC;
56
57 /*
58 * Set PLL_CTL
59 * - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
60 * - [8] = BYPASS : BYPASS the PLL, run CLKIN into CCLK/SCLK
61 * - [7] = output delay (add 200ps of delay to mem signals)
62 * - [6] = input delay (add 200ps of input delay to mem signals)
63 * - [5] = PDWN : 1=All Clocks off
64 * - [3] = STOPCK : 1=Core Clock off
65 * - [1] = PLL_OFF : 1=Disable Power to PLL
66 * - [0] = DF : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
67 * all other bits set to zero
68 */
69
70 p0.h = hi(PLL_LOCKCNT);
71 p0.l = lo(PLL_LOCKCNT);
72 r0 = 0x300(Z);
73 w[p0] = r0.l;
74 ssync;
75
76 P2.H = hi(EBIU_SDGCTL);
77 P2.L = lo(EBIU_SDGCTL);
78 R0 = [P2];
79 BITSET (R0, 24);
80 [P2] = R0;
81 SSYNC;
82
83 r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
84 r0 = r0 << 9; /* Shift it over, */
85 r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
86 r0 = r1 | r0;
87 r1 = PLL_BYPASS; /* Bypass the PLL? */
88 r1 = r1 << 8; /* Shift it over */
89 r0 = r1 | r0; /* add them all together */
90#ifdef ANOMALY_05000265
91 BITSET(r0, 15); /* Add 250 mV of hysteresis to SPORT input pins */
92#endif
93
94 p0.h = hi(PLL_CTL);
95 p0.l = lo(PLL_CTL); /* Load the address */
96 cli r2; /* Disable interrupts */
97 ssync;
98 w[p0] = r0.l; /* Set the value */
99 idle; /* Wait for the PLL to stablize */
100 sti r2; /* Enable interrupts */
101
102.Lcheck_again:
103 p0.h = hi(PLL_STAT);
104 p0.l = lo(PLL_STAT);
105 R0 = W[P0](Z);
106 CC = BITTST(R0,5);
107 if ! CC jump .Lcheck_again;
108
109 /* Configure SCLK & CCLK Dividers */
110 r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
111 p0.h = hi(PLL_DIV);
112 p0.l = lo(PLL_DIV);
113 w[p0] = r0.l;
114 ssync;
115
116 p0.l = lo(EBIU_SDRRC);
117 p0.h = hi(EBIU_SDRRC);
118 r0 = mem_SDRRC;
119 w[p0] = r0.l;
120 ssync;
121
122 P2.H = hi(EBIU_SDGCTL);
123 P2.L = lo(EBIU_SDGCTL);
124 R0 = [P2];
125 BITCLR (R0, 24);
126 p0.h = hi(EBIU_SDSTAT);
127 p0.l = lo(EBIU_SDSTAT);
128 r2.l = w[p0];
129 cc = bittst(r2,3);
130 if !cc jump .Lskip;
131 NOP;
132 BITSET (R0, 23);
133.Lskip:
134 [P2] = R0;
135 SSYNC;
136
137 R0.L = lo(mem_SDGCTL);
138 R0.H = hi(mem_SDGCTL);
139 R1 = [p2];
140 R1 = R1 | R0;
141 [P2] = R1;
142 SSYNC;
143
144 RTS;
145ENDPROC(_start_dma_code)
146#endif /* CONFIG_BFIN_KERNEL_CLOCK */
diff --git a/arch/blackfin/mach-bf537/include/mach/anomaly.h b/arch/blackfin/mach-bf537/include/mach/anomaly.h
index c68992494f9e..9cb39121d1cb 100644
--- a/arch/blackfin/mach-bf537/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf537/include/mach/anomaly.h
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9/* This file shoule be up to date with: 9/* This file shoule be up to date with:
10 * - Revision C, 02/08/2008; ADSP-BF534/ADSP-BF536/ADSP-BF537 Blackfin Processor Anomaly List 10 * - Revision D, 09/18/2008; ADSP-BF534/ADSP-BF536/ADSP-BF537 Blackfin Processor Anomaly List
11 */ 11 */
12 12
13#ifndef _MACH_ANOMALY_H_ 13#ifndef _MACH_ANOMALY_H_
@@ -148,6 +148,14 @@
148#define ANOMALY_05000402 (__SILICON_REVISION__ >= 5) 148#define ANOMALY_05000402 (__SILICON_REVISION__ >= 5)
149/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */ 149/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
150#define ANOMALY_05000403 (1) 150#define ANOMALY_05000403 (1)
151/* Speculative Fetches Can Cause Undesired External FIFO Operations */
152#define ANOMALY_05000416 (1)
153/* Multichannel SPORT Channel Misalignment Under Specific Configuration */
154#define ANOMALY_05000425 (1)
155/* Speculative Fetches of Indirect-Pointer Instructions Can Cause False Hardware Errors */
156#define ANOMALY_05000426 (1)
157/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
158#define ANOMALY_05000443 (1)
151 159
152/* Anomalies that don't exist on this proc */ 160/* Anomalies that don't exist on this proc */
153#define ANOMALY_05000125 (0) 161#define ANOMALY_05000125 (0)
@@ -161,5 +169,8 @@
161#define ANOMALY_05000353 (1) 169#define ANOMALY_05000353 (1)
162#define ANOMALY_05000363 (0) 170#define ANOMALY_05000363 (0)
163#define ANOMALY_05000386 (1) 171#define ANOMALY_05000386 (1)
172#define ANOMALY_05000412 (0)
173#define ANOMALY_05000432 (0)
174#define ANOMALY_05000435 (0)
164 175
165#endif 176#endif
diff --git a/arch/blackfin/mach-bf537/include/mach/bf537.h b/arch/blackfin/mach-bf537/include/mach/bf537.h
index 24d5c9d42323..f194a848ae8e 100644
--- a/arch/blackfin/mach-bf537/include/mach/bf537.h
+++ b/arch/blackfin/mach-bf537/include/mach/bf537.h
@@ -133,7 +133,7 @@
133#endif 133#endif
134 134
135#ifndef CPU 135#ifndef CPU
136#error Unknown CPU type - This kernel doesn't seem to be configured properly 136#error "Unknown CPU type - This kernel doesn't seem to be configured properly"
137#endif 137#endif
138 138
139#endif /* __MACH_BF537_H__ */ 139#endif /* __MACH_BF537_H__ */
diff --git a/arch/blackfin/mach-bf537/include/mach/bfin_sir.h b/arch/blackfin/mach-bf537/include/mach/bfin_sir.h
deleted file mode 100644
index cfd8ad4f1f2c..000000000000
--- a/arch/blackfin/mach-bf537/include/mach/bfin_sir.h
+++ /dev/null
@@ -1,142 +0,0 @@
1/*
2 * Blackfin Infra-red Driver
3 *
4 * Copyright 2006-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 *
10 */
11
12#include <linux/serial.h>
13#include <asm/dma.h>
14#include <asm/portmux.h>
15
16#define SIR_UART_GET_CHAR(port) bfin_read16((port)->membase + OFFSET_RBR)
17#define SIR_UART_GET_DLL(port) bfin_read16((port)->membase + OFFSET_DLL)
18#define SIR_UART_GET_IER(port) bfin_read16((port)->membase + OFFSET_IER)
19#define SIR_UART_GET_DLH(port) bfin_read16((port)->membase + OFFSET_DLH)
20#define SIR_UART_GET_IIR(port) bfin_read16((port)->membase + OFFSET_IIR)
21#define SIR_UART_GET_LCR(port) bfin_read16((port)->membase + OFFSET_LCR)
22#define SIR_UART_GET_GCTL(port) bfin_read16((port)->membase + OFFSET_GCTL)
23
24#define SIR_UART_PUT_CHAR(port, v) bfin_write16(((port)->membase + OFFSET_THR), v)
25#define SIR_UART_PUT_DLL(port, v) bfin_write16(((port)->membase + OFFSET_DLL), v)
26#define SIR_UART_PUT_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER), v)
27#define SIR_UART_PUT_DLH(port, v) bfin_write16(((port)->membase + OFFSET_DLH), v)
28#define SIR_UART_PUT_LCR(port, v) bfin_write16(((port)->membase + OFFSET_LCR), v)
29#define SIR_UART_PUT_GCTL(port, v) bfin_write16(((port)->membase + OFFSET_GCTL), v)
30
31#ifdef CONFIG_SIR_BFIN_DMA
32struct dma_rx_buf {
33 char *buf;
34 int head;
35 int tail;
36 };
37#endif /* CONFIG_SIR_BFIN_DMA */
38
39struct bfin_sir_port {
40 unsigned char __iomem *membase;
41 unsigned int irq;
42 unsigned int lsr;
43 unsigned long clk;
44 struct net_device *dev;
45#ifdef CONFIG_SIR_BFIN_DMA
46 int tx_done;
47 struct dma_rx_buf rx_dma_buf;
48 struct timer_list rx_dma_timer;
49 int rx_dma_nrows;
50#endif /* CONFIG_SIR_BFIN_DMA */
51 unsigned int tx_dma_channel;
52 unsigned int rx_dma_channel;
53};
54
55struct bfin_sir_port sir_ports[BFIN_UART_NR_PORTS];
56
57struct bfin_sir_port_res {
58 unsigned long base_addr;
59 int irq;
60 unsigned int rx_dma_channel;
61 unsigned int tx_dma_channel;
62};
63
64struct bfin_sir_port_res bfin_sir_port_resource[] = {
65#ifdef CONFIG_BFIN_SIR0
66 {
67 0xFFC00400,
68 IRQ_UART0_RX,
69 CH_UART0_RX,
70 CH_UART0_TX,
71 },
72#endif
73#ifdef CONFIG_BFIN_SIR1
74 {
75 0xFFC02000,
76 IRQ_UART1_RX,
77 CH_UART1_RX,
78 CH_UART1_TX,
79 },
80#endif
81};
82
83int nr_sirs = ARRAY_SIZE(bfin_sir_port_resource);
84
85struct bfin_sir_self {
86 struct bfin_sir_port *sir_port;
87 spinlock_t lock;
88 unsigned int open;
89 int speed;
90 int newspeed;
91
92 struct sk_buff *txskb;
93 struct sk_buff *rxskb;
94 struct net_device_stats stats;
95 struct device *dev;
96 struct irlap_cb *irlap;
97 struct qos_info qos;
98
99 iobuff_t tx_buff;
100 iobuff_t rx_buff;
101
102 struct work_struct work;
103 int mtt;
104};
105
106static inline unsigned int SIR_UART_GET_LSR(struct bfin_sir_port *port)
107{
108 unsigned int lsr = bfin_read16(port->membase + OFFSET_LSR);
109 port->lsr |= (lsr & (BI|FE|PE|OE));
110 return lsr | port->lsr;
111}
112
113static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port)
114{
115 port->lsr = 0;
116 bfin_read16(port->membase + OFFSET_LSR);
117}
118
119#define DRIVER_NAME "bfin_sir"
120
121static int bfin_sir_hw_init(void)
122{
123 int ret = -ENODEV;
124#ifdef CONFIG_BFIN_SIR0
125 ret = peripheral_request(P_UART0_TX, DRIVER_NAME);
126 if (ret)
127 return ret;
128 ret = peripheral_request(P_UART0_RX, DRIVER_NAME);
129 if (ret)
130 return ret;
131#endif
132
133#ifdef CONFIG_BFIN_SIR1
134 ret = peripheral_request(P_UART1_TX, DRIVER_NAME);
135 if (ret)
136 return ret;
137 ret = peripheral_request(P_UART1_RX, DRIVER_NAME);
138 if (ret)
139 return ret;
140#endif
141 return ret;
142}
diff --git a/arch/blackfin/mach-bf537/include/mach/blackfin.h b/arch/blackfin/mach-bf537/include/mach/blackfin.h
index cffc786b2a2b..7d6069c886f1 100644
--- a/arch/blackfin/mach-bf537/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf537/include/mach/blackfin.h
@@ -82,7 +82,7 @@
82#define STATUS_P1 0x02 82#define STATUS_P1 0x02
83#define STATUS_P0 0x01 83#define STATUS_P0 0x01
84 84
85/* DMA Channnel */ 85/* DMA Channel */
86#define bfin_read_CH_UART_RX() bfin_read_CH_UART0_RX() 86#define bfin_read_CH_UART_RX() bfin_read_CH_UART0_RX()
87#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART0_RX(val) 87#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART0_RX(val)
88#define CH_UART_RX CH_UART0_RX 88#define CH_UART_RX CH_UART0_RX
diff --git a/arch/blackfin/mach-bf537/include/mach/cdefBF534.h b/arch/blackfin/mach-bf537/include/mach/cdefBF534.h
index 88d491cd9f36..5f8b5f845be6 100644
--- a/arch/blackfin/mach-bf537/include/mach/cdefBF534.h
+++ b/arch/blackfin/mach-bf537/include/mach/cdefBF534.h
@@ -40,55 +40,11 @@
40/* Include core specific register pointer definitions */ 40/* Include core specific register pointer definitions */
41#include <asm/cdef_LPBlackfin.h> 41#include <asm/cdef_LPBlackfin.h>
42 42
43#include <asm/system.h>
44
45/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */ 43/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
46#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL) 44#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
47/* Writing to PLL_CTL initiates a PLL relock sequence. */
48static __inline__ void bfin_write_PLL_CTL(unsigned int val)
49{
50 unsigned long flags, iwr;
51
52 if (val == bfin_read_PLL_CTL())
53 return;
54
55 local_irq_save(flags);
56 /* Enable the PLL Wakeup bit in SIC IWR */
57 iwr = bfin_read32(SIC_IWR);
58 /* Only allow PPL Wakeup) */
59 bfin_write32(SIC_IWR, IWR_ENABLE(0));
60
61 bfin_write16(PLL_CTL, val);
62 SSYNC();
63 asm("IDLE;");
64
65 bfin_write32(SIC_IWR, iwr);
66 local_irq_restore(flags);
67}
68#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV) 45#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
69#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val) 46#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
70#define bfin_read_VR_CTL() bfin_read16(VR_CTL) 47#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
71/* Writing to VR_CTL initiates a PLL relock sequence. */
72static __inline__ void bfin_write_VR_CTL(unsigned int val)
73{
74 unsigned long flags, iwr;
75
76 if (val == bfin_read_VR_CTL())
77 return;
78
79 local_irq_save(flags);
80 /* Enable the PLL Wakeup bit in SIC IWR */
81 iwr = bfin_read32(SIC_IWR);
82 /* Only allow PPL Wakeup) */
83 bfin_write32(SIC_IWR, IWR_ENABLE(0));
84
85 bfin_write16(VR_CTL, val);
86 SSYNC();
87 asm("IDLE;");
88
89 bfin_write32(SIC_IWR, iwr);
90 local_irq_restore(flags);
91}
92#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 48#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
93#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val) 49#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
94#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT) 50#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
@@ -1816,4 +1772,51 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
1816#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT) 1772#define bfin_read_HMDMA1_BCOUNT() bfin_read16(HMDMA1_BCOUNT)
1817#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT,val) 1773#define bfin_write_HMDMA1_BCOUNT(val) bfin_write16(HMDMA1_BCOUNT,val)
1818 1774
1775/* These need to be last due to the cdef/linux inter-dependencies */
1776#include <asm/irq.h>
1777
1778/* Writing to PLL_CTL initiates a PLL relock sequence. */
1779static __inline__ void bfin_write_PLL_CTL(unsigned int val)
1780{
1781 unsigned long flags, iwr;
1782
1783 if (val == bfin_read_PLL_CTL())
1784 return;
1785
1786 local_irq_save_hw(flags);
1787 /* Enable the PLL Wakeup bit in SIC IWR */
1788 iwr = bfin_read32(SIC_IWR);
1789 /* Only allow PPL Wakeup) */
1790 bfin_write32(SIC_IWR, IWR_ENABLE(0));
1791
1792 bfin_write16(PLL_CTL, val);
1793 SSYNC();
1794 asm("IDLE;");
1795
1796 bfin_write32(SIC_IWR, iwr);
1797 local_irq_restore_hw(flags);
1798}
1799
1800/* Writing to VR_CTL initiates a PLL relock sequence. */
1801static __inline__ void bfin_write_VR_CTL(unsigned int val)
1802{
1803 unsigned long flags, iwr;
1804
1805 if (val == bfin_read_VR_CTL())
1806 return;
1807
1808 local_irq_save_hw(flags);
1809 /* Enable the PLL Wakeup bit in SIC IWR */
1810 iwr = bfin_read32(SIC_IWR);
1811 /* Only allow PPL Wakeup) */
1812 bfin_write32(SIC_IWR, IWR_ENABLE(0));
1813
1814 bfin_write16(VR_CTL, val);
1815 SSYNC();
1816 asm("IDLE;");
1817
1818 bfin_write32(SIC_IWR, iwr);
1819 local_irq_restore_hw(flags);
1820}
1821
1819#endif /* _CDEF_BF534_H */ 1822#endif /* _CDEF_BF534_H */
diff --git a/arch/blackfin/mach-bf537/include/mach/dma.h b/arch/blackfin/mach-bf537/include/mach/dma.h
index 7a964040870a..5ae83b1183a1 100644
--- a/arch/blackfin/mach-bf537/include/mach/dma.h
+++ b/arch/blackfin/mach-bf537/include/mach/dma.h
@@ -1,38 +1,14 @@
1/* 1/* mach/dma.h - arch-specific DMA defines
2 * file: include/asm-blackfin/mach-bf537/dma.h
3 * based on:
4 * author:
5 * 2 *
6 * created: 3 * Copyright 2004-2008 Analog Devices Inc.
7 * description:
8 * system mmr register map
9 * rev:
10 * 4 *
11 * modified: 5 * Licensed under the GPL-2 or later.
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * this program is distributed in the hope that it will be useful,
22 * but without any warranty; without even the implied warranty of
23 * merchantability or fitness for a particular purpose. see the
24 * gnu general public license for more details.
25 *
26 * you should have received a copy of the gnu general public license
27 * along with this program; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */ 6 */
31 7
32#ifndef _MACH_DMA_H_ 8#ifndef _MACH_DMA_H_
33#define _MACH_DMA_H_ 9#define _MACH_DMA_H_
34 10
35#define MAX_BLACKFIN_DMA_CHANNEL 16 11#define MAX_DMA_CHANNELS 16
36 12
37#define CH_PPI 0 13#define CH_PPI 0
38#define CH_EMAC_RX 1 14#define CH_EMAC_RX 1
diff --git a/arch/blackfin/mach-bf537/include/mach/gpio.h b/arch/blackfin/mach-bf537/include/mach/gpio.h
new file mode 100644
index 000000000000..d77a31e45a30
--- /dev/null
+++ b/arch/blackfin/mach-bf537/include/mach/gpio.h
@@ -0,0 +1,68 @@
1/*
2 * File: arch/blackfin/mach-bf537/include/mach/gpio.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9
10#ifndef _MACH_GPIO_H_
11#define _MACH_GPIO_H_
12
13#define MAX_BLACKFIN_GPIOS 48
14
15#define GPIO_PF0 0
16#define GPIO_PF1 1
17#define GPIO_PF2 2
18#define GPIO_PF3 3
19#define GPIO_PF4 4
20#define GPIO_PF5 5
21#define GPIO_PF6 6
22#define GPIO_PF7 7
23#define GPIO_PF8 8
24#define GPIO_PF9 9
25#define GPIO_PF10 10
26#define GPIO_PF11 11
27#define GPIO_PF12 12
28#define GPIO_PF13 13
29#define GPIO_PF14 14
30#define GPIO_PF15 15
31#define GPIO_PG0 16
32#define GPIO_PG1 17
33#define GPIO_PG2 18
34#define GPIO_PG3 19
35#define GPIO_PG4 20
36#define GPIO_PG5 21
37#define GPIO_PG6 22
38#define GPIO_PG7 23
39#define GPIO_PG8 24
40#define GPIO_PG9 25
41#define GPIO_PG10 26
42#define GPIO_PG11 27
43#define GPIO_PG12 28
44#define GPIO_PG13 29
45#define GPIO_PG14 30
46#define GPIO_PG15 31
47#define GPIO_PH0 32
48#define GPIO_PH1 33
49#define GPIO_PH2 34
50#define GPIO_PH3 35
51#define GPIO_PH4 36
52#define GPIO_PH5 37
53#define GPIO_PH6 38
54#define GPIO_PH7 39
55#define GPIO_PH8 40
56#define GPIO_PH9 41
57#define GPIO_PH10 42
58#define GPIO_PH11 43
59#define GPIO_PH12 44
60#define GPIO_PH13 45
61#define GPIO_PH14 46
62#define GPIO_PH15 47
63
64#define PORT_F GPIO_PF0
65#define PORT_G GPIO_PG0
66#define PORT_H GPIO_PH0
67
68#endif /* _MACH_GPIO_H_ */
diff --git a/arch/blackfin/mach-bf537/include/mach/irq.h b/arch/blackfin/mach-bf537/include/mach/irq.h
index 2e68a8a1e730..b2a71d5d4e5f 100644
--- a/arch/blackfin/mach-bf537/include/mach/irq.h
+++ b/arch/blackfin/mach-bf537/include/mach/irq.h
@@ -82,14 +82,14 @@
82#define IRQ_CAN_TX 23 /*CAN Transmit Interrupt */ 82#define IRQ_CAN_TX 23 /*CAN Transmit Interrupt */
83#define IRQ_MAC_RX 24 /*DMA1 (Ethernet RX) Interrupt */ 83#define IRQ_MAC_RX 24 /*DMA1 (Ethernet RX) Interrupt */
84#define IRQ_MAC_TX 25 /*DMA2 (Ethernet TX) Interrupt */ 84#define IRQ_MAC_TX 25 /*DMA2 (Ethernet TX) Interrupt */
85#define IRQ_TMR0 26 /*Timer 0 */ 85#define IRQ_TIMER0 26 /*Timer 0 */
86#define IRQ_TMR1 27 /*Timer 1 */ 86#define IRQ_TIMER1 27 /*Timer 1 */
87#define IRQ_TMR2 28 /*Timer 2 */ 87#define IRQ_TIMER2 28 /*Timer 2 */
88#define IRQ_TMR3 29 /*Timer 3 */ 88#define IRQ_TIMER3 29 /*Timer 3 */
89#define IRQ_TMR4 30 /*Timer 4 */ 89#define IRQ_TIMER4 30 /*Timer 4 */
90#define IRQ_TMR5 31 /*Timer 5 */ 90#define IRQ_TIMER5 31 /*Timer 5 */
91#define IRQ_TMR6 32 /*Timer 6 */ 91#define IRQ_TIMER6 32 /*Timer 6 */
92#define IRQ_TMR7 33 /*Timer 7 */ 92#define IRQ_TIMER7 33 /*Timer 7 */
93#define IRQ_PROG_INTA 34 /* PF Ports F&G (PF15:0) Interrupt A */ 93#define IRQ_PROG_INTA 34 /* PF Ports F&G (PF15:0) Interrupt A */
94#define IRQ_PORTG_INTB 35 /* PF Port G (PF15:0) Interrupt B */ 94#define IRQ_PORTG_INTB 35 /* PF Port G (PF15:0) Interrupt B */
95#define IRQ_MEM_DMA0 36 /*(Memory DMA Stream 0) */ 95#define IRQ_MEM_DMA0 36 /*(Memory DMA Stream 0) */
@@ -195,16 +195,16 @@
195#define IRQ_CAN_TX_POS 0 195#define IRQ_CAN_TX_POS 0
196#define IRQ_MAC_RX_POS 4 196#define IRQ_MAC_RX_POS 4
197#define IRQ_MAC_TX_POS 8 197#define IRQ_MAC_TX_POS 8
198#define IRQ_TMR0_POS 12 198#define IRQ_TIMER0_POS 12
199#define IRQ_TMR1_POS 16 199#define IRQ_TIMER1_POS 16
200#define IRQ_TMR2_POS 20 200#define IRQ_TIMER2_POS 20
201#define IRQ_TMR3_POS 24 201#define IRQ_TIMER3_POS 24
202#define IRQ_TMR4_POS 28 202#define IRQ_TIMER4_POS 28
203 203
204/* IAR3 BIT FIELDS*/ 204/* IAR3 BIT FIELDS*/
205#define IRQ_TMR5_POS 0 205#define IRQ_TIMER5_POS 0
206#define IRQ_TMR6_POS 4 206#define IRQ_TIMER6_POS 4
207#define IRQ_TMR7_POS 8 207#define IRQ_TIMER7_POS 8
208#define IRQ_PROG_INTA_POS 12 208#define IRQ_PROG_INTA_POS 12
209#define IRQ_PORTG_INTB_POS 16 209#define IRQ_PORTG_INTB_POS 16
210#define IRQ_MEM_DMA0_POS 20 210#define IRQ_MEM_DMA0_POS 20
diff --git a/arch/blackfin/mach-bf537/include/mach/mem_init.h b/arch/blackfin/mach-bf537/include/mach/mem_init.h
deleted file mode 100644
index f67698f670ca..000000000000
--- a/arch/blackfin/mach-bf537/include/mach/mem_init.h
+++ /dev/null
@@ -1,303 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf537/mem_init.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 * Copyright 2004-2006 Analog Devices Inc.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#if (CONFIG_MEM_MT48LC16M16A2TG_75 || CONFIG_MEM_MT48LC64M4A2FB_7E || CONFIG_MEM_MT48LC16M8A2TG_75 || CONFIG_MEM_GENERIC_BOARD || CONFIG_MEM_MT48LC32M8A2_75)
33#if (CONFIG_SCLK_HZ > 119402985)
34#define SDRAM_tRP TRP_2
35#define SDRAM_tRP_num 2
36#define SDRAM_tRAS TRAS_7
37#define SDRAM_tRAS_num 7
38#define SDRAM_tRCD TRCD_2
39#define SDRAM_tWR TWR_2
40#endif
41#if (CONFIG_SCLK_HZ > 104477612) && (CONFIG_SCLK_HZ <= 119402985)
42#define SDRAM_tRP TRP_2
43#define SDRAM_tRP_num 2
44#define SDRAM_tRAS TRAS_6
45#define SDRAM_tRAS_num 6
46#define SDRAM_tRCD TRCD_2
47#define SDRAM_tWR TWR_2
48#endif
49#if (CONFIG_SCLK_HZ > 89552239) && (CONFIG_SCLK_HZ <= 104477612)
50#define SDRAM_tRP TRP_2
51#define SDRAM_tRP_num 2
52#define SDRAM_tRAS TRAS_5
53#define SDRAM_tRAS_num 5
54#define SDRAM_tRCD TRCD_2
55#define SDRAM_tWR TWR_2
56#endif
57#if (CONFIG_SCLK_HZ > 74626866) && (CONFIG_SCLK_HZ <= 89552239)
58#define SDRAM_tRP TRP_2
59#define SDRAM_tRP_num 2
60#define SDRAM_tRAS TRAS_4
61#define SDRAM_tRAS_num 4
62#define SDRAM_tRCD TRCD_2
63#define SDRAM_tWR TWR_2
64#endif
65#if (CONFIG_SCLK_HZ > 66666667) && (CONFIG_SCLK_HZ <= 74626866)
66#define SDRAM_tRP TRP_2
67#define SDRAM_tRP_num 2
68#define SDRAM_tRAS TRAS_3
69#define SDRAM_tRAS_num 3
70#define SDRAM_tRCD TRCD_2
71#define SDRAM_tWR TWR_2
72#endif
73#if (CONFIG_SCLK_HZ > 59701493) && (CONFIG_SCLK_HZ <= 66666667)
74#define SDRAM_tRP TRP_1
75#define SDRAM_tRP_num 1
76#define SDRAM_tRAS TRAS_4
77#define SDRAM_tRAS_num 3
78#define SDRAM_tRCD TRCD_1
79#define SDRAM_tWR TWR_2
80#endif
81#if (CONFIG_SCLK_HZ > 44776119) && (CONFIG_SCLK_HZ <= 59701493)
82#define SDRAM_tRP TRP_1
83#define SDRAM_tRP_num 1
84#define SDRAM_tRAS TRAS_3
85#define SDRAM_tRAS_num 3
86#define SDRAM_tRCD TRCD_1
87#define SDRAM_tWR TWR_2
88#endif
89#if (CONFIG_SCLK_HZ > 29850746) && (CONFIG_SCLK_HZ <= 44776119)
90#define SDRAM_tRP TRP_1
91#define SDRAM_tRP_num 1
92#define SDRAM_tRAS TRAS_2
93#define SDRAM_tRAS_num 2
94#define SDRAM_tRCD TRCD_1
95#define SDRAM_tWR TWR_2
96#endif
97#if (CONFIG_SCLK_HZ <= 29850746)
98#define SDRAM_tRP TRP_1
99#define SDRAM_tRP_num 1
100#define SDRAM_tRAS TRAS_1
101#define SDRAM_tRAS_num 1
102#define SDRAM_tRCD TRCD_1
103#define SDRAM_tWR TWR_2
104#endif
105#endif
106
107#if (CONFIG_MEM_MT48LC16M16A2TG_75)
108 /*SDRAM INFORMATION: */
109#define SDRAM_Tref 64 /* Refresh period in milliseconds */
110#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
111#define SDRAM_CL CL_3
112#endif
113
114#if (CONFIG_MEM_MT48LC16M8A2TG_75)
115 /*SDRAM INFORMATION: */
116#define SDRAM_Tref 64 /* Refresh period in milliseconds */
117#define SDRAM_NRA 4096 /* Number of row addresses in SDRAM */
118#define SDRAM_CL CL_3
119#endif
120
121#if (CONFIG_MEM_MT48LC32M8A2_75)
122 /*SDRAM INFORMATION: */
123#define SDRAM_Tref 64 /* Refresh period in milliseconds */
124#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
125#define SDRAM_CL CL_3
126#endif
127
128#if (CONFIG_MEM_MT48LC64M4A2FB_7E)
129 /*SDRAM INFORMATION: */
130#define SDRAM_Tref 64 /* Refresh period in milliseconds */
131#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
132#define SDRAM_CL CL_3
133#endif
134
135#if (CONFIG_MEM_GENERIC_BOARD)
136 /*SDRAM INFORMATION: Modify this for your board */
137#define SDRAM_Tref 64 /* Refresh period in milliseconds */
138#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
139#define SDRAM_CL CL_3
140#endif
141
142/* Equation from section 17 (p17-46) of BF533 HRM */
143#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
144
145/* Enable SCLK Out */
146#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
147
148#if defined CONFIG_CLKIN_HALF
149#define CLKIN_HALF 1
150#else
151#define CLKIN_HALF 0
152#endif
153
154#if defined CONFIG_PLL_BYPASS
155#define PLL_BYPASS 1
156#else
157#define PLL_BYPASS 0
158#endif
159
160/***************************************Currently Not Being Used *********************************/
161#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
162#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
163#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
164#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
165#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
166
167#if (flash_EBIU_AMBCTL_TT > 3)
168#define flash_EBIU_AMBCTL0_TT B0TT_4
169#endif
170#if (flash_EBIU_AMBCTL_TT == 3)
171#define flash_EBIU_AMBCTL0_TT B0TT_3
172#endif
173#if (flash_EBIU_AMBCTL_TT == 2)
174#define flash_EBIU_AMBCTL0_TT B0TT_2
175#endif
176#if (flash_EBIU_AMBCTL_TT < 2)
177#define flash_EBIU_AMBCTL0_TT B0TT_1
178#endif
179
180#if (flash_EBIU_AMBCTL_ST > 3)
181#define flash_EBIU_AMBCTL0_ST B0ST_4
182#endif
183#if (flash_EBIU_AMBCTL_ST == 3)
184#define flash_EBIU_AMBCTL0_ST B0ST_3
185#endif
186#if (flash_EBIU_AMBCTL_ST == 2)
187#define flash_EBIU_AMBCTL0_ST B0ST_2
188#endif
189#if (flash_EBIU_AMBCTL_ST < 2)
190#define flash_EBIU_AMBCTL0_ST B0ST_1
191#endif
192
193#if (flash_EBIU_AMBCTL_HT > 2)
194#define flash_EBIU_AMBCTL0_HT B0HT_3
195#endif
196#if (flash_EBIU_AMBCTL_HT == 2)
197#define flash_EBIU_AMBCTL0_HT B0HT_2
198#endif
199#if (flash_EBIU_AMBCTL_HT == 1)
200#define flash_EBIU_AMBCTL0_HT B0HT_1
201#endif
202#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
203#define flash_EBIU_AMBCTL0_HT B0HT_0
204#endif
205#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
206#define flash_EBIU_AMBCTL0_HT B0HT_1
207#endif
208
209#if (flash_EBIU_AMBCTL_WAT > 14)
210#define flash_EBIU_AMBCTL0_WAT B0WAT_15
211#endif
212#if (flash_EBIU_AMBCTL_WAT == 14)
213#define flash_EBIU_AMBCTL0_WAT B0WAT_14
214#endif
215#if (flash_EBIU_AMBCTL_WAT == 13)
216#define flash_EBIU_AMBCTL0_WAT B0WAT_13
217#endif
218#if (flash_EBIU_AMBCTL_WAT == 12)
219#define flash_EBIU_AMBCTL0_WAT B0WAT_12
220#endif
221#if (flash_EBIU_AMBCTL_WAT == 11)
222#define flash_EBIU_AMBCTL0_WAT B0WAT_11
223#endif
224#if (flash_EBIU_AMBCTL_WAT == 10)
225#define flash_EBIU_AMBCTL0_WAT B0WAT_10
226#endif
227#if (flash_EBIU_AMBCTL_WAT == 9)
228#define flash_EBIU_AMBCTL0_WAT B0WAT_9
229#endif
230#if (flash_EBIU_AMBCTL_WAT == 8)
231#define flash_EBIU_AMBCTL0_WAT B0WAT_8
232#endif
233#if (flash_EBIU_AMBCTL_WAT == 7)
234#define flash_EBIU_AMBCTL0_WAT B0WAT_7
235#endif
236#if (flash_EBIU_AMBCTL_WAT == 6)
237#define flash_EBIU_AMBCTL0_WAT B0WAT_6
238#endif
239#if (flash_EBIU_AMBCTL_WAT == 5)
240#define flash_EBIU_AMBCTL0_WAT B0WAT_5
241#endif
242#if (flash_EBIU_AMBCTL_WAT == 4)
243#define flash_EBIU_AMBCTL0_WAT B0WAT_4
244#endif
245#if (flash_EBIU_AMBCTL_WAT == 3)
246#define flash_EBIU_AMBCTL0_WAT B0WAT_3
247#endif
248#if (flash_EBIU_AMBCTL_WAT == 2)
249#define flash_EBIU_AMBCTL0_WAT B0WAT_2
250#endif
251#if (flash_EBIU_AMBCTL_WAT == 1)
252#define flash_EBIU_AMBCTL0_WAT B0WAT_1
253#endif
254
255#if (flash_EBIU_AMBCTL_RAT > 14)
256#define flash_EBIU_AMBCTL0_RAT B0RAT_15
257#endif
258#if (flash_EBIU_AMBCTL_RAT == 14)
259#define flash_EBIU_AMBCTL0_RAT B0RAT_14
260#endif
261#if (flash_EBIU_AMBCTL_RAT == 13)
262#define flash_EBIU_AMBCTL0_RAT B0RAT_13
263#endif
264#if (flash_EBIU_AMBCTL_RAT == 12)
265#define flash_EBIU_AMBCTL0_RAT B0RAT_12
266#endif
267#if (flash_EBIU_AMBCTL_RAT == 11)
268#define flash_EBIU_AMBCTL0_RAT B0RAT_11
269#endif
270#if (flash_EBIU_AMBCTL_RAT == 10)
271#define flash_EBIU_AMBCTL0_RAT B0RAT_10
272#endif
273#if (flash_EBIU_AMBCTL_RAT == 9)
274#define flash_EBIU_AMBCTL0_RAT B0RAT_9
275#endif
276#if (flash_EBIU_AMBCTL_RAT == 8)
277#define flash_EBIU_AMBCTL0_RAT B0RAT_8
278#endif
279#if (flash_EBIU_AMBCTL_RAT == 7)
280#define flash_EBIU_AMBCTL0_RAT B0RAT_7
281#endif
282#if (flash_EBIU_AMBCTL_RAT == 6)
283#define flash_EBIU_AMBCTL0_RAT B0RAT_6
284#endif
285#if (flash_EBIU_AMBCTL_RAT == 5)
286#define flash_EBIU_AMBCTL0_RAT B0RAT_5
287#endif
288#if (flash_EBIU_AMBCTL_RAT == 4)
289#define flash_EBIU_AMBCTL0_RAT B0RAT_4
290#endif
291#if (flash_EBIU_AMBCTL_RAT == 3)
292#define flash_EBIU_AMBCTL0_RAT B0RAT_3
293#endif
294#if (flash_EBIU_AMBCTL_RAT == 2)
295#define flash_EBIU_AMBCTL0_RAT B0RAT_2
296#endif
297#if (flash_EBIU_AMBCTL_RAT == 1)
298#define flash_EBIU_AMBCTL0_RAT B0RAT_1
299#endif
300
301#define flash_EBIU_AMBCTL0 \
302 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
303 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
diff --git a/arch/blackfin/mach-bf537/include/mach/mem_map.h b/arch/blackfin/mach-bf537/include/mach/mem_map.h
index 5078b669431f..f9010c4b4bf3 100644
--- a/arch/blackfin/mach-bf537/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf537/include/mach/mem_map.h
@@ -176,4 +176,10 @@
176#define L1_SCRATCH_START 0xFFB00000 176#define L1_SCRATCH_START 0xFFB00000
177#define L1_SCRATCH_LENGTH 0x1000 177#define L1_SCRATCH_LENGTH 0x1000
178 178
179#define GET_PDA_SAFE(preg) \
180 preg.l = _cpu_pda; \
181 preg.h = _cpu_pda;
182
183#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
184
179#endif /* _MEM_MAP_537_H_ */ 185#endif /* _MEM_MAP_537_H_ */
diff --git a/arch/blackfin/mach-bf537/ints-priority.c b/arch/blackfin/mach-bf537/ints-priority.c
index b1300b3f1812..51c48087e03b 100644
--- a/arch/blackfin/mach-bf537/ints-priority.c
+++ b/arch/blackfin/mach-bf537/ints-priority.c
@@ -55,15 +55,15 @@ void __init program_IAR(void)
55 bfin_write_SIC_IAR2(((CONFIG_IRQ_CAN_TX - 7) << IRQ_CAN_TX_POS) | 55 bfin_write_SIC_IAR2(((CONFIG_IRQ_CAN_TX - 7) << IRQ_CAN_TX_POS) |
56 ((CONFIG_IRQ_MAC_RX - 7) << IRQ_MAC_RX_POS) | 56 ((CONFIG_IRQ_MAC_RX - 7) << IRQ_MAC_RX_POS) |
57 ((CONFIG_IRQ_MAC_TX - 7) << IRQ_MAC_TX_POS) | 57 ((CONFIG_IRQ_MAC_TX - 7) << IRQ_MAC_TX_POS) |
58 ((CONFIG_IRQ_TMR0 - 7) << IRQ_TMR0_POS) | 58 ((CONFIG_IRQ_TIMER0 - 7) << IRQ_TIMER0_POS) |
59 ((CONFIG_IRQ_TMR1 - 7) << IRQ_TMR1_POS) | 59 ((CONFIG_IRQ_TIMER1 - 7) << IRQ_TIMER1_POS) |
60 ((CONFIG_IRQ_TMR2 - 7) << IRQ_TMR2_POS) | 60 ((CONFIG_IRQ_TIMER2 - 7) << IRQ_TIMER2_POS) |
61 ((CONFIG_IRQ_TMR3 - 7) << IRQ_TMR3_POS) | 61 ((CONFIG_IRQ_TIMER3 - 7) << IRQ_TIMER3_POS) |
62 ((CONFIG_IRQ_TMR4 - 7) << IRQ_TMR4_POS)); 62 ((CONFIG_IRQ_TIMER4 - 7) << IRQ_TIMER4_POS));
63 63
64 bfin_write_SIC_IAR3(((CONFIG_IRQ_TMR5 - 7) << IRQ_TMR5_POS) | 64 bfin_write_SIC_IAR3(((CONFIG_IRQ_TIMER5 - 7) << IRQ_TIMER5_POS) |
65 ((CONFIG_IRQ_TMR6 - 7) << IRQ_TMR6_POS) | 65 ((CONFIG_IRQ_TIMER6 - 7) << IRQ_TIMER6_POS) |
66 ((CONFIG_IRQ_TMR7 - 7) << IRQ_TMR7_POS) | 66 ((CONFIG_IRQ_TIMER7 - 7) << IRQ_TIMER7_POS) |
67 ((CONFIG_IRQ_PROG_INTA - 7) << IRQ_PROG_INTA_POS) | 67 ((CONFIG_IRQ_PROG_INTA - 7) << IRQ_PROG_INTA_POS) |
68 ((CONFIG_IRQ_PORTG_INTB - 7) << IRQ_PORTG_INTB_POS) | 68 ((CONFIG_IRQ_PORTG_INTB - 7) << IRQ_PORTG_INTB_POS) |
69 ((CONFIG_IRQ_MEM_DMA0 - 7) << IRQ_MEM_DMA0_POS) | 69 ((CONFIG_IRQ_MEM_DMA0 - 7) << IRQ_MEM_DMA0_POS) |
diff --git a/arch/blackfin/mach-bf538/Kconfig b/arch/blackfin/mach-bf538/Kconfig
new file mode 100644
index 000000000000..f068c3523cdc
--- /dev/null
+++ b/arch/blackfin/mach-bf538/Kconfig
@@ -0,0 +1,164 @@
1if (BF538 || BF539)
2
3source "arch/blackfin/mach-bf538/boards/Kconfig"
4
5menu "BF538 Specific Configuration"
6
7comment "Interrupt Priority Assignment"
8menu "Priority"
9
10config IRQ_PLL_WAKEUP
11 int "IRQ_PLL_WAKEUP"
12 default 7
13config IRQ_DMA0_ERROR
14 int "IRQ_DMA0_ERROR"
15 default 7
16config IRQ_PPI_ERROR
17 int "IRQ_PPI_ERROR"
18 default 7
19config IRQ_SPORT0_ERROR
20 int "IRQ_SPORT0_ERROR"
21 default 7
22config IRQ_SPORT1_ERROR
23 int "IRQ_SPORT1_ERROR"
24 default 7
25config IRQ_SPI0_ERROR
26 int "IRQ_SPI0_ERROR"
27 default 7
28config IRQ_UART0_ERROR
29 int "IRQ_UART0_ERROR"
30 default 7
31config IRQ_RTC
32 int "IRQ_RTC"
33 default 8
34config IRQ_PPI
35 int "IRQ_PPI"
36 default 8
37config IRQ_SPORT0_RX
38 int "IRQ_SPORT0_RX"
39 default 9
40config IRQ_SPORT0_TX
41 int "IRQ_SPORT0_TX"
42 default 9
43config IRQ_SPORT1_RX
44 int "IRQ_SPORT1_RX"
45 default 9
46config IRQ_SPORT1_TX
47 int "IRQ_SPORT1_TX"
48 default 9
49config IRQ_SPI0
50 int "IRQ_SPI0"
51 default 10
52config IRQ_UART0_RX
53 int "IRQ_UART0_RX"
54 default 10
55config IRQ_UART0_TX
56 int "IRQ_UART0_TX"
57 default 10
58config IRQ_TIMER0
59 int "IRQ_TIMER0"
60 default 8
61config IRQ_TIMER1
62 int "IRQ_TIMER1"
63 default 11
64config IRQ_TIMER2
65 int "IRQ_TIMER2"
66 default 11
67config IRQ_PORTF_INTA
68 int "IRQ_PORTF_INTA"
69 default 12
70config IRQ_PORTF_INTB
71 int "IRQ_PORTF_INTB"
72 default 12
73config IRQ_MEM0_DMA0
74 int "IRQ_MEM0_DMA0"
75 default 13
76config IRQ_MEM0_DMA1
77 int "IRQ_MEM0_DMA1"
78 default 13
79config IRQ_WATCH
80 int "IRQ_WATCH"
81 default 13
82config IRQ_DMA1_ERROR
83 int "IRQ_DMA1_ERROR"
84 default 7
85config IRQ_SPORT2_ERROR
86 int "IRQ_SPORT2_ERROR"
87 default 7
88config IRQ_SPORT3_ERROR
89 int "IRQ_SPORT3_ERROR"
90 default 7
91config IRQ_SPI1_ERROR
92 int "IRQ_SPI1_ERROR"
93 default 7
94config IRQ_SPI2_ERROR
95 int "IRQ_SPI2_ERROR"
96 default 7
97config IRQ_UART1_ERROR
98 int "IRQ_UART1_ERROR"
99 default 7
100config IRQ_UART2_ERROR
101 int "IRQ_UART2_ERROR"
102 default 7
103config IRQ_CAN_ERROR
104 int "IRQ_CAN_ERROR"
105 default 7
106config IRQ_SPORT2_RX
107 int "IRQ_SPORT2_RX"
108 default 9
109config IRQ_SPORT2_TX
110 int "IRQ_SPORT2_TX"
111 default 9
112config IRQ_SPORT3_RX
113 int "IRQ_SPORT3_RX"
114 default 9
115config IRQ_SPORT3_TX
116 int "IRQ_SPORT3_TX"
117 default 9
118config IRQ_SPI1
119 int "IRQ_SPI1"
120 default 10
121config IRQ_SPI2
122 int "IRQ_SPI2"
123 default 10
124config IRQ_UART1_RX
125 int "IRQ_UART1_RX"
126 default 10
127config IRQ_UART1_TX
128 int "IRQ_UART1_TX"
129 default 10
130config IRQ_UART2_RX
131 int "IRQ_UART2_RX"
132 default 10
133config IRQ_UART2_TX
134 int "IRQ_UART2_TX"
135 default 10
136config IRQ_TWI0
137 int "IRQ_TWI0"
138 default 11
139config IRQ_TWI1
140 int "IRQ_TWI1"
141 default 11
142config IRQ_CAN_RX
143 int "IRQ_CAN_RX"
144 default 11
145config IRQ_CAN_TX
146 int "IRQ_CAN_TX"
147 default 11
148config IRQ_MEM1_DMA0
149 int "IRQ_MEM1_DMA0"
150 default 13
151config IRQ_MEM1_DMA1
152 int "IRQ_MEM1_DMA1"
153 default 13
154
155 help
156 Enter the priority numbers between 7-13 ONLY. Others are Reserved.
157 This applies to all the above. It is not recommended to assign the
158 highest priority number 7 to UART or any other device.
159
160endmenu
161
162endmenu
163
164endif
diff --git a/arch/blackfin/mach-bf538/Makefile b/arch/blackfin/mach-bf538/Makefile
new file mode 100644
index 000000000000..8cd2719684db
--- /dev/null
+++ b/arch/blackfin/mach-bf538/Makefile
@@ -0,0 +1,5 @@
1#
2# arch/blackfin/mach-bf538/Makefile
3#
4
5obj-y := ints-priority.o dma.o
diff --git a/arch/blackfin/mach-bf538/boards/Kconfig b/arch/blackfin/mach-bf538/boards/Kconfig
new file mode 100644
index 000000000000..215249ba58bb
--- /dev/null
+++ b/arch/blackfin/mach-bf538/boards/Kconfig
@@ -0,0 +1,12 @@
1choice
2 prompt "System type"
3 default BFIN538_EZKIT
4 help
5 Select your board!
6
7config BFIN538_EZKIT
8 bool "BF538-EZKIT"
9 help
10 BF538-EZKIT-LITE board support.
11
12endchoice
diff --git a/arch/blackfin/mach-bf538/boards/Makefile b/arch/blackfin/mach-bf538/boards/Makefile
new file mode 100644
index 000000000000..6143b320d585
--- /dev/null
+++ b/arch/blackfin/mach-bf538/boards/Makefile
@@ -0,0 +1,5 @@
1#
2# arch/blackfin/mach-bf538/boards/Makefile
3#
4
5obj-$(CONFIG_BFIN538_EZKIT) += ezkit.o
diff --git a/arch/blackfin/mach-bf538/boards/ezkit.c b/arch/blackfin/mach-bf538/boards/ezkit.c
new file mode 100644
index 000000000000..e37cb9378884
--- /dev/null
+++ b/arch/blackfin/mach-bf538/boards/ezkit.c
@@ -0,0 +1,606 @@
1/*
2 * File: arch/blackfin/mach-bf538/boards/ezkit.c
3 * Based on: arch/blackfin/mach-bf537/boards/ezkit.c
4 * Author: Aidan Williams <aidan@nicta.com.au>
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2005 National ICT Australia (NICTA)
11 * Copyright 2004-2008 Analog Devices Inc.
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31#include <linux/device.h>
32#include <linux/platform_device.h>
33#include <linux/mtd/mtd.h>
34#include <linux/mtd/partitions.h>
35#include <linux/spi/spi.h>
36#include <linux/spi/flash.h>
37#include <linux/irq.h>
38#include <linux/interrupt.h>
39#include <asm/bfin5xx_spi.h>
40#include <asm/dma.h>
41#include <asm/gpio.h>
42#include <asm/nand.h>
43#include <asm/portmux.h>
44#include <asm/dpmc.h>
45#include <linux/input.h>
46
47/*
48 * Name the Board for the /proc/cpuinfo
49 */
50const char bfin_board_name[] = "ADI BF538-EZKIT";
51
52/*
53 * Driver needs to know address, irq and flag pin.
54 */
55
56
57#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
58static struct platform_device rtc_device = {
59 .name = "rtc-bfin",
60 .id = -1,
61};
62#endif
63
64#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
65static struct resource bfin_uart_resources[] = {
66#ifdef CONFIG_SERIAL_BFIN_UART0
67 {
68 .start = 0xFFC00400,
69 .end = 0xFFC004FF,
70 .flags = IORESOURCE_MEM,
71 },
72#endif
73#ifdef CONFIG_SERIAL_BFIN_UART1
74 {
75 .start = 0xFFC02000,
76 .end = 0xFFC020FF,
77 .flags = IORESOURCE_MEM,
78 },
79#endif
80#ifdef CONFIG_SERIAL_BFIN_UART2
81 {
82 .start = 0xFFC02100,
83 .end = 0xFFC021FF,
84 .flags = IORESOURCE_MEM,
85 },
86#endif
87};
88
89static struct platform_device bfin_uart_device = {
90 .name = "bfin-uart",
91 .id = 1,
92 .num_resources = ARRAY_SIZE(bfin_uart_resources),
93 .resource = bfin_uart_resources,
94};
95#endif
96
97#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
98#ifdef CONFIG_BFIN_SIR0
99static struct resource bfin_sir0_resources[] = {
100 {
101 .start = 0xFFC00400,
102 .end = 0xFFC004FF,
103 .flags = IORESOURCE_MEM,
104 },
105 {
106 .start = IRQ_UART0_RX,
107 .end = IRQ_UART0_RX+1,
108 .flags = IORESOURCE_IRQ,
109 },
110 {
111 .start = CH_UART0_RX,
112 .end = CH_UART0_RX+1,
113 .flags = IORESOURCE_DMA,
114 },
115};
116static struct platform_device bfin_sir0_device = {
117 .name = "bfin_sir",
118 .id = 0,
119 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
120 .resource = bfin_sir0_resources,
121};
122#endif
123#ifdef CONFIG_BFIN_SIR1
124static struct resource bfin_sir1_resources[] = {
125 {
126 .start = 0xFFC02000,
127 .end = 0xFFC020FF,
128 .flags = IORESOURCE_MEM,
129 },
130 {
131 .start = IRQ_UART1_RX,
132 .end = IRQ_UART1_RX+1,
133 .flags = IORESOURCE_IRQ,
134 },
135 {
136 .start = CH_UART1_RX,
137 .end = CH_UART1_RX+1,
138 .flags = IORESOURCE_DMA,
139 },
140};
141static struct platform_device bfin_sir1_device = {
142 .name = "bfin_sir",
143 .id = 1,
144 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
145 .resource = bfin_sir1_resources,
146};
147#endif
148#ifdef CONFIG_BFIN_SIR2
149static struct resource bfin_sir2_resources[] = {
150 {
151 .start = 0xFFC02100,
152 .end = 0xFFC021FF,
153 .flags = IORESOURCE_MEM,
154 },
155 {
156 .start = IRQ_UART2_RX,
157 .end = IRQ_UART2_RX+1,
158 .flags = IORESOURCE_IRQ,
159 },
160 {
161 .start = CH_UART2_RX,
162 .end = CH_UART2_RX+1,
163 .flags = IORESOURCE_DMA,
164 },
165};
166static struct platform_device bfin_sir2_device = {
167 .name = "bfin_sir",
168 .id = 2,
169 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
170 .resource = bfin_sir2_resources,
171};
172#endif
173#endif
174
175/*
176 * USB-LAN EzExtender board
177 * Driver needs to know address, irq and flag pin.
178 */
179#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
180static struct resource smc91x_resources[] = {
181 {
182 .name = "smc91x-regs",
183 .start = 0x20310300,
184 .end = 0x20310300 + 16,
185 .flags = IORESOURCE_MEM,
186 }, {
187 .start = IRQ_PF0,
188 .end = IRQ_PF0,
189 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
190 },
191};
192static struct platform_device smc91x_device = {
193 .name = "smc91x",
194 .id = 0,
195 .num_resources = ARRAY_SIZE(smc91x_resources),
196 .resource = smc91x_resources,
197};
198#endif
199
200#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
201/* all SPI peripherals info goes here */
202#if defined(CONFIG_MTD_M25P80) \
203 || defined(CONFIG_MTD_M25P80_MODULE)
204/* SPI flash chip (m25p16) */
205static struct mtd_partition bfin_spi_flash_partitions[] = {
206 {
207 .name = "bootloader(spi)",
208 .size = 0x00040000,
209 .offset = 0,
210 .mask_flags = MTD_CAP_ROM
211 }, {
212 .name = "linux kernel(spi)",
213 .size = 0x1c0000,
214 .offset = 0x40000
215 }
216};
217
218static struct flash_platform_data bfin_spi_flash_data = {
219 .name = "m25p80",
220 .parts = bfin_spi_flash_partitions,
221 .nr_parts = ARRAY_SIZE(bfin_spi_flash_partitions),
222 .type = "m25p16",
223};
224
225static struct bfin5xx_spi_chip spi_flash_chip_info = {
226 .enable_dma = 0, /* use dma transfer with this chip*/
227 .bits_per_word = 8,
228 .cs_change_per_word = 0,
229};
230#endif
231
232#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
233#include <linux/spi/ad7879.h>
234static const struct ad7879_platform_data bfin_ad7879_ts_info = {
235 .model = 7879, /* Model = AD7879 */
236 .x_plate_ohms = 620, /* 620 Ohm from the touch datasheet */
237 .pressure_max = 10000,
238 .pressure_min = 0,
239 .first_conversion_delay = 3, /* wait 512us before do a first conversion */
240 .acquisition_time = 1, /* 4us acquisition time per sample */
241 .median = 2, /* do 8 measurements */
242 .averaging = 1, /* take the average of 4 middle samples */
243 .pen_down_acc_interval = 255, /* 9.4 ms */
244 .gpio_output = 1, /* configure AUX/VBAT/GPIO as GPIO output */
245 .gpio_default = 1, /* During initialization set GPIO = HIGH */
246};
247#endif
248
249#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
250static struct bfin5xx_spi_chip spi_ad7879_chip_info = {
251 .enable_dma = 0,
252 .bits_per_word = 16,
253};
254#endif
255
256#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
257#include <asm/bfin-lq035q1.h>
258
259static struct bfin_lq035q1fb_disp_info bfin_lq035q1_data = {
260 .mode = LQ035_NORM | LQ035_RGB | LQ035_RL | LQ035_TB,
261 .use_bl = 0, /* let something else control the LCD Blacklight */
262 .gpio_bl = GPIO_PF7,
263};
264
265static struct resource bfin_lq035q1_resources[] = {
266 {
267 .start = IRQ_PPI_ERROR,
268 .end = IRQ_PPI_ERROR,
269 .flags = IORESOURCE_IRQ,
270 },
271};
272
273static struct platform_device bfin_lq035q1_device = {
274 .name = "bfin-lq035q1",
275 .id = -1,
276 .num_resources = ARRAY_SIZE(bfin_lq035q1_resources),
277 .resource = bfin_lq035q1_resources,
278 .dev = {
279 .platform_data = &bfin_lq035q1_data,
280 },
281};
282#endif
283
284#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
285static struct bfin5xx_spi_chip spidev_chip_info = {
286 .enable_dma = 0,
287 .bits_per_word = 8,
288};
289#endif
290
291#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
292static struct bfin5xx_spi_chip lq035q1_spi_chip_info = {
293 .enable_dma = 0,
294 .bits_per_word = 8,
295};
296#endif
297
298static struct spi_board_info bf538_spi_board_info[] __initdata = {
299#if defined(CONFIG_MTD_M25P80) \
300 || defined(CONFIG_MTD_M25P80_MODULE)
301 {
302 /* the modalias must be the same as spi device driver name */
303 .modalias = "m25p80", /* Name of spi_driver for this device */
304 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
305 .bus_num = 0, /* Framework bus number */
306 .chip_select = 1, /* SPI_SSEL1*/
307 .platform_data = &bfin_spi_flash_data,
308 .controller_data = &spi_flash_chip_info,
309 .mode = SPI_MODE_3,
310 },
311#endif
312#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
313 {
314 .modalias = "ad7879",
315 .platform_data = &bfin_ad7879_ts_info,
316 .irq = IRQ_PF3,
317 .max_speed_hz = 5000000, /* max spi clock (SCK) speed in HZ */
318 .bus_num = 0,
319 .chip_select = 1,
320 .controller_data = &spi_ad7879_chip_info,
321 .mode = SPI_CPHA | SPI_CPOL,
322 },
323#endif
324#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
325 {
326 .modalias = "bfin-lq035q1-spi",
327 .max_speed_hz = 20000000, /* max spi clock (SCK) speed in HZ */
328 .bus_num = 0,
329 .chip_select = 2,
330 .controller_data = &lq035q1_spi_chip_info,
331 .mode = SPI_CPHA | SPI_CPOL,
332 },
333#endif
334#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
335 {
336 .modalias = "spidev",
337 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
338 .bus_num = 0,
339 .chip_select = 1,
340 .controller_data = &spidev_chip_info,
341 },
342#endif
343};
344
345/* SPI (0) */
346static struct resource bfin_spi0_resource[] = {
347 [0] = {
348 .start = SPI0_REGBASE,
349 .end = SPI0_REGBASE + 0xFF,
350 .flags = IORESOURCE_MEM,
351 },
352 [1] = {
353 .start = CH_SPI0,
354 .end = CH_SPI0,
355 .flags = IORESOURCE_IRQ,
356 }
357};
358
359/* SPI (1) */
360static struct resource bfin_spi1_resource[] = {
361 [0] = {
362 .start = SPI1_REGBASE,
363 .end = SPI1_REGBASE + 0xFF,
364 .flags = IORESOURCE_MEM,
365 },
366 [1] = {
367 .start = CH_SPI1,
368 .end = CH_SPI1,
369 .flags = IORESOURCE_IRQ,
370 }
371};
372
373/* SPI (2) */
374static struct resource bfin_spi2_resource[] = {
375 [0] = {
376 .start = SPI2_REGBASE,
377 .end = SPI2_REGBASE + 0xFF,
378 .flags = IORESOURCE_MEM,
379 },
380 [1] = {
381 .start = CH_SPI2,
382 .end = CH_SPI2,
383 .flags = IORESOURCE_IRQ,
384 }
385};
386
387/* SPI controller data */
388static struct bfin5xx_spi_master bf538_spi_master_info0 = {
389 .num_chipselect = 8,
390 .enable_dma = 1, /* master has the ability to do dma transfer */
391 .pin_req = {P_SPI0_SCK, P_SPI0_MISO, P_SPI0_MOSI, 0},
392};
393
394static struct platform_device bf538_spi_master0 = {
395 .name = "bfin-spi",
396 .id = 0, /* Bus number */
397 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
398 .resource = bfin_spi0_resource,
399 .dev = {
400 .platform_data = &bf538_spi_master_info0, /* Passed to driver */
401 },
402};
403
404static struct bfin5xx_spi_master bf538_spi_master_info1 = {
405 .num_chipselect = 8,
406 .enable_dma = 1, /* master has the ability to do dma transfer */
407 .pin_req = {P_SPI1_SCK, P_SPI1_MISO, P_SPI1_MOSI, 0},
408};
409
410static struct platform_device bf538_spi_master1 = {
411 .name = "bfin-spi",
412 .id = 1, /* Bus number */
413 .num_resources = ARRAY_SIZE(bfin_spi1_resource),
414 .resource = bfin_spi1_resource,
415 .dev = {
416 .platform_data = &bf538_spi_master_info1, /* Passed to driver */
417 },
418};
419
420static struct bfin5xx_spi_master bf538_spi_master_info2 = {
421 .num_chipselect = 8,
422 .enable_dma = 1, /* master has the ability to do dma transfer */
423 .pin_req = {P_SPI2_SCK, P_SPI2_MISO, P_SPI2_MOSI, 0},
424};
425
426static struct platform_device bf538_spi_master2 = {
427 .name = "bfin-spi",
428 .id = 2, /* Bus number */
429 .num_resources = ARRAY_SIZE(bfin_spi2_resource),
430 .resource = bfin_spi2_resource,
431 .dev = {
432 .platform_data = &bf538_spi_master_info2, /* Passed to driver */
433 },
434};
435
436#endif /* spi master and devices */
437
438#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
439static struct resource bfin_twi0_resource[] = {
440 [0] = {
441 .start = TWI0_REGBASE,
442 .end = TWI0_REGBASE + 0xFF,
443 .flags = IORESOURCE_MEM,
444 },
445 [1] = {
446 .start = IRQ_TWI0,
447 .end = IRQ_TWI0,
448 .flags = IORESOURCE_IRQ,
449 },
450};
451
452static struct platform_device i2c_bfin_twi0_device = {
453 .name = "i2c-bfin-twi",
454 .id = 0,
455 .num_resources = ARRAY_SIZE(bfin_twi0_resource),
456 .resource = bfin_twi0_resource,
457};
458
459#if !defined(CONFIG_BF542) /* The BF542 only has 1 TWI */
460static struct resource bfin_twi1_resource[] = {
461 [0] = {
462 .start = TWI1_REGBASE,
463 .end = TWI1_REGBASE + 0xFF,
464 .flags = IORESOURCE_MEM,
465 },
466 [1] = {
467 .start = IRQ_TWI1,
468 .end = IRQ_TWI1,
469 .flags = IORESOURCE_IRQ,
470 },
471};
472
473static struct platform_device i2c_bfin_twi1_device = {
474 .name = "i2c-bfin-twi",
475 .id = 1,
476 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
477 .resource = bfin_twi1_resource,
478};
479#endif
480#endif
481
482static struct resource bfin_gpios_resources = {
483 .start = 0,
484 .end = MAX_BLACKFIN_GPIOS - 1,
485 .flags = IORESOURCE_IRQ,
486};
487
488static struct platform_device bfin_gpios_device = {
489 .name = "simple-gpio",
490 .id = -1,
491 .num_resources = 1,
492 .resource = &bfin_gpios_resources,
493};
494
495#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
496#include <linux/gpio_keys.h>
497
498static struct gpio_keys_button bfin_gpio_keys_table[] = {
499 {BTN_0, GPIO_PC7, 1, "gpio-keys: BTN0"},
500};
501
502static struct gpio_keys_platform_data bfin_gpio_keys_data = {
503 .buttons = bfin_gpio_keys_table,
504 .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table),
505};
506
507static struct platform_device bfin_device_gpiokeys = {
508 .name = "gpio-keys",
509 .dev = {
510 .platform_data = &bfin_gpio_keys_data,
511 },
512};
513#endif
514
515static const unsigned int cclk_vlev_datasheet[] =
516{
517/*
518 * Internal VLEV BF538SBBC1533
519 ****temporarily using these values until data sheet is updated
520 */
521 VRPAIR(VLEV_100, 150000000),
522 VRPAIR(VLEV_100, 250000000),
523 VRPAIR(VLEV_110, 276000000),
524 VRPAIR(VLEV_115, 301000000),
525 VRPAIR(VLEV_120, 525000000),
526 VRPAIR(VLEV_125, 550000000),
527 VRPAIR(VLEV_130, 600000000),
528};
529
530static struct bfin_dpmc_platform_data bfin_dmpc_vreg_data = {
531 .tuple_tab = cclk_vlev_datasheet,
532 .tabsize = ARRAY_SIZE(cclk_vlev_datasheet),
533 .vr_settling_time = 25 /* us */,
534};
535
536static struct platform_device bfin_dpmc = {
537 .name = "bfin dpmc",
538 .dev = {
539 .platform_data = &bfin_dmpc_vreg_data,
540 },
541};
542
543static struct platform_device *cm_bf538_devices[] __initdata = {
544
545 &bfin_dpmc,
546
547#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
548 &rtc_device,
549#endif
550
551#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
552 &bfin_uart_device,
553#endif
554
555#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
556 &bf538_spi_master0,
557 &bf538_spi_master1,
558 &bf538_spi_master2,
559#endif
560
561#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
562 &i2c_bfin_twi0_device,
563 &i2c_bfin_twi1_device,
564#endif
565
566#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
567#ifdef CONFIG_BFIN_SIR0
568 &bfin_sir0_device,
569#endif
570#ifdef CONFIG_BFIN_SIR1
571 &bfin_sir1_device,
572#endif
573#ifdef CONFIG_BFIN_SIR2
574 &bfin_sir2_device,
575#endif
576#endif
577
578#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
579 &smc91x_device,
580#endif
581
582#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
583 &bfin_lq035q1_device,
584#endif
585
586#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
587 &bfin_device_gpiokeys,
588#endif
589
590 &bfin_gpios_device,
591};
592
593static int __init ezkit_init(void)
594{
595 printk(KERN_INFO "%s(): registering device resources\n", __func__);
596 platform_add_devices(cm_bf538_devices, ARRAY_SIZE(cm_bf538_devices));
597
598#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
599 spi_register_board_info(bf538_spi_board_info,
600 ARRAY_SIZE(bf538_spi_board_info));
601#endif
602
603 return 0;
604}
605
606arch_initcall(ezkit_init);
diff --git a/arch/blackfin/mach-bf538/dma.c b/arch/blackfin/mach-bf538/dma.c
new file mode 100644
index 000000000000..d6837fbf94ea
--- /dev/null
+++ b/arch/blackfin/mach-bf538/dma.c
@@ -0,0 +1,161 @@
1/*
2 * File: arch/blackfin/mach-bf538/dma.c
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description: This file contains the simple DMA Implementation for Blackfin
8 *
9 * Modified:
10 * Copyright 2008 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29#include <linux/module.h>
30
31#include <asm/blackfin.h>
32#include <asm/dma.h>
33
34struct dma_register *dma_io_base_addr[MAX_DMA_CHANNELS] = {
35 (struct dma_register *) DMA0_NEXT_DESC_PTR,
36 (struct dma_register *) DMA1_NEXT_DESC_PTR,
37 (struct dma_register *) DMA2_NEXT_DESC_PTR,
38 (struct dma_register *) DMA3_NEXT_DESC_PTR,
39 (struct dma_register *) DMA4_NEXT_DESC_PTR,
40 (struct dma_register *) DMA5_NEXT_DESC_PTR,
41 (struct dma_register *) DMA6_NEXT_DESC_PTR,
42 (struct dma_register *) DMA7_NEXT_DESC_PTR,
43 (struct dma_register *) DMA8_NEXT_DESC_PTR,
44 (struct dma_register *) DMA9_NEXT_DESC_PTR,
45 (struct dma_register *) DMA10_NEXT_DESC_PTR,
46 (struct dma_register *) DMA11_NEXT_DESC_PTR,
47 (struct dma_register *) DMA12_NEXT_DESC_PTR,
48 (struct dma_register *) DMA13_NEXT_DESC_PTR,
49 (struct dma_register *) DMA14_NEXT_DESC_PTR,
50 (struct dma_register *) DMA15_NEXT_DESC_PTR,
51 (struct dma_register *) DMA16_NEXT_DESC_PTR,
52 (struct dma_register *) DMA17_NEXT_DESC_PTR,
53 (struct dma_register *) DMA18_NEXT_DESC_PTR,
54 (struct dma_register *) DMA19_NEXT_DESC_PTR,
55 (struct dma_register *) MDMA0_D0_NEXT_DESC_PTR,
56 (struct dma_register *) MDMA0_S0_NEXT_DESC_PTR,
57 (struct dma_register *) MDMA0_D1_NEXT_DESC_PTR,
58 (struct dma_register *) MDMA0_S1_NEXT_DESC_PTR,
59 (struct dma_register *) MDMA1_D0_NEXT_DESC_PTR,
60 (struct dma_register *) MDMA1_S0_NEXT_DESC_PTR,
61 (struct dma_register *) MDMA1_D1_NEXT_DESC_PTR,
62 (struct dma_register *) MDMA1_S1_NEXT_DESC_PTR,
63};
64EXPORT_SYMBOL(dma_io_base_addr);
65
66int channel2irq(unsigned int channel)
67{
68 int ret_irq = -1;
69
70 switch (channel) {
71 case CH_PPI:
72 ret_irq = IRQ_PPI;
73 break;
74
75 case CH_UART0_RX:
76 ret_irq = IRQ_UART0_RX;
77 break;
78
79 case CH_UART0_TX:
80 ret_irq = IRQ_UART0_TX;
81 break;
82
83 case CH_UART1_RX:
84 ret_irq = IRQ_UART1_RX;
85 break;
86
87 case CH_UART1_TX:
88 ret_irq = IRQ_UART1_TX;
89 break;
90
91 case CH_UART2_RX:
92 ret_irq = IRQ_UART2_RX;
93 break;
94
95 case CH_UART2_TX:
96 ret_irq = IRQ_UART2_TX;
97 break;
98
99 case CH_SPORT0_RX:
100 ret_irq = IRQ_SPORT0_RX;
101 break;
102
103 case CH_SPORT0_TX:
104 ret_irq = IRQ_SPORT0_TX;
105 break;
106
107 case CH_SPORT1_RX:
108 ret_irq = IRQ_SPORT1_RX;
109 break;
110
111 case CH_SPORT1_TX:
112 ret_irq = IRQ_SPORT1_TX;
113 break;
114
115 case CH_SPORT2_RX:
116 ret_irq = IRQ_SPORT2_RX;
117 break;
118
119 case CH_SPORT2_TX:
120 ret_irq = IRQ_SPORT2_TX;
121 break;
122
123 case CH_SPORT3_RX:
124 ret_irq = IRQ_SPORT3_RX;
125 break;
126
127 case CH_SPORT3_TX:
128 ret_irq = IRQ_SPORT3_TX;
129 break;
130
131 case CH_SPI0:
132 ret_irq = IRQ_SPI0;
133 break;
134
135 case CH_SPI1:
136 ret_irq = IRQ_SPI1;
137 break;
138
139 case CH_SPI2:
140 ret_irq = IRQ_SPI2;
141 break;
142
143 case CH_MEM_STREAM0_SRC:
144 case CH_MEM_STREAM0_DEST:
145 ret_irq = IRQ_MEM0_DMA0;
146 break;
147 case CH_MEM_STREAM1_SRC:
148 case CH_MEM_STREAM1_DEST:
149 ret_irq = IRQ_MEM0_DMA1;
150 break;
151 case CH_MEM_STREAM2_SRC:
152 case CH_MEM_STREAM2_DEST:
153 ret_irq = IRQ_MEM1_DMA0;
154 break;
155 case CH_MEM_STREAM3_SRC:
156 case CH_MEM_STREAM3_DEST:
157 ret_irq = IRQ_MEM1_DMA1;
158 break;
159 }
160 return ret_irq;
161}
diff --git a/arch/blackfin/mach-bf538/include/mach/anomaly.h b/arch/blackfin/mach-bf538/include/mach/anomaly.h
new file mode 100644
index 000000000000..e130b4f8a05d
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/anomaly.h
@@ -0,0 +1,132 @@
1/*
2 * File: include/asm-blackfin/mach-bf538/anomaly.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2004-2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9/* This file shoule be up to date with:
10 * - Revision G, 09/18/2008; ADSP-BF538/BF538F Blackfin Processor Anomaly List
11 * - Revision L, 09/18/2008; ADSP-BF539/BF539F Blackfin Processor Anomaly List
12 */
13
14#ifndef _MACH_ANOMALY_H_
15#define _MACH_ANOMALY_H_
16
17#if __SILICON_REVISION__ < 4
18# error will not work on BF538 silicon version 0.0, 0.1, 0.2, or 0.3
19#endif
20
21/* Multi-Issue Instruction with dsp32shiftimm in slot1 and P-reg Store in slot2 Not Supported */
22#define ANOMALY_05000074 (1)
23/* DMA_RUN Bit Is Not Valid after a Peripheral Receive Channel DMA Stops */
24#define ANOMALY_05000119 (1)
25/* Rx.H Cannot Be Used to Access 16-bit System MMR Registers */
26#define ANOMALY_05000122 (1)
27/* PPI Data Lengths between 8 and 16 Do Not Zero Out Upper Bits */
28#define ANOMALY_05000166 (1)
29/* PPI_COUNT Cannot Be Programmed to 0 in General Purpose TX or RX Modes */
30#define ANOMALY_05000179 (1)
31/* PPI_DELAY Not Functional in PPI Modes with 0 Frame Syncs */
32#define ANOMALY_05000180 (1)
33/* False I/O Pin Interrupts on Edge-Sensitive Inputs When Polarity Setting Is Changed */
34#define ANOMALY_05000193 (1)
35/* Current DMA Address Shows Wrong Value During Carry Fix */
36#define ANOMALY_05000199 (__SILICON_REVISION__ < 4)
37/* NMI Event at Boot Time Results in Unpredictable State */
38#define ANOMALY_05000219 (1)
39/* SPI Slave Boot Mode Modifies Registers from Reset Value */
40#define ANOMALY_05000229 (1)
41/* PPI_FS3 Is Not Driven in 2 or 3 Internal Frame Sync Transmit Modes */
42#define ANOMALY_05000233 (1)
43/* If i-cache is on, CSYNC/SSYNC/IDLE around Change of Control causes failures */
44#define ANOMALY_05000244 (__SILICON_REVISION__ < 3)
45/* Spurious Hardware Error from an Access in the Shadow of a Conditional Branch */
46#define ANOMALY_05000245 (1)
47/* Maximum External Clock Speed for Timers */
48#define ANOMALY_05000253 (1)
49/* DCPLB_FAULT_ADDR MMR register may be corrupted */
50#define ANOMALY_05000261 (__SILICON_REVISION__ < 3)
51/* High I/O Activity Causes Output Voltage of Internal Voltage Regulator (Vddint) to Decrease */
52#define ANOMALY_05000270 (__SILICON_REVISION__ < 4)
53/* Certain Data Cache Writethrough Modes Fail for Vddint <= 0.9V */
54#define ANOMALY_05000272 (1)
55/* Writes to Synchronous SDRAM Memory May Be Lost */
56#define ANOMALY_05000273 (__SILICON_REVISION__ < 4)
57/* Writes to an I/O Data Register One SCLK Cycle after an Edge Is Detected May Clear Interrupt */
58#define ANOMALY_05000277 (__SILICON_REVISION__ < 4)
59/* Disabling Peripherals with DMA Running May Cause DMA System Instability */
60#define ANOMALY_05000278 (__SILICON_REVISION__ < 4)
61/* False Hardware Error Exception when ISR Context Is Not Restored */
62#define ANOMALY_05000281 (__SILICON_REVISION__ < 4)
63/* Memory DMA Corruption with 32-Bit Data and Traffic Control */
64#define ANOMALY_05000282 (__SILICON_REVISION__ < 4)
65/* System MMR Write Is Stalled Indefinitely when Killed in a Particular Stage */
66#define ANOMALY_05000283 (__SILICON_REVISION__ < 4)
67/* SPORTs May Receive Bad Data If FIFOs Fill Up */
68#define ANOMALY_05000288 (__SILICON_REVISION__ < 4)
69/* Reads from CAN Mailbox and Acceptance Mask Area Can Fail */
70#define ANOMALY_05000291 (__SILICON_REVISION__ < 4)
71/* Hibernate Leakage Current Is Higher Than Specified */
72#define ANOMALY_05000293 (__SILICON_REVISION__ < 4)
73/* Timer Pin Limitations for PPI TX Modes with External Frame Syncs */
74#define ANOMALY_05000294 (1)
75/* Memory-To-Memory DMA Source/Destination Descriptors Must Be in Same Memory Space */
76#define ANOMALY_05000301 (__SILICON_REVISION__ < 4)
77/* SSYNCs After Writes To CAN/DMA MMR Registers Are Not Always Handled Correctly */
78#define ANOMALY_05000304 (__SILICON_REVISION__ < 4)
79/* SCKELOW Bit Does Not Maintain State Through Hibernate */
80#define ANOMALY_05000307 (__SILICON_REVISION__ < 4)
81/* False Hardware Errors Caused by Fetches at the Boundary of Reserved Memory */
82#define ANOMALY_05000310 (1)
83/* Errors when SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted */
84#define ANOMALY_05000312 (__SILICON_REVISION__ < 5)
85/* PPI Is Level-Sensitive on First Transfer */
86#define ANOMALY_05000313 (__SILICON_REVISION__ < 4)
87/* Killed System MMR Write Completes Erroneously on Next System MMR Access */
88#define ANOMALY_05000315 (__SILICON_REVISION__ < 4)
89/* PFx Glitch on Write to FIO_FLAG_D or FIO_FLAG_T */
90#define ANOMALY_05000318 (__SILICON_REVISION__ < 4)
91/* Regulator Programming Blocked when Hibernate Wakeup Source Remains Active */
92#define ANOMALY_05000355 (__SILICON_REVISION__ < 5)
93/* Serial Port (SPORT) Multichannel Transmit Failure when Channel 0 Is Disabled */
94#define ANOMALY_05000357 (__SILICON_REVISION__ < 5)
95/* PPI Underflow Error Goes Undetected in ITU-R 656 Mode */
96#define ANOMALY_05000366 (1)
97/* Possible RETS Register Corruption when Subroutine Is under 5 Cycles in Duration */
98#define ANOMALY_05000371 (__SILICON_REVISION__ < 5)
99/* Entering Hibernate State with Peripheral Wakeups Enabled Draws Excess Current */
100#define ANOMALY_05000374 (__SILICON_REVISION__ == 4)
101/* New Feature: Open-Drain GPIO Outputs on PC1 and PC4 (Not Available on Older Silicon) */
102#define ANOMALY_05000375 (__SILICON_REVISION__ < 4)
103/* SSYNC Stalls Processor when Executed from Non-Cacheable Memory */
104#define ANOMALY_05000402 (__SILICON_REVISION__ < 4)
105/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
106#define ANOMALY_05000403 (1)
107/* Speculative Fetches Can Cause Undesired External FIFO Operations */
108#define ANOMALY_05000416 (1)
109/* Multichannel SPORT Channel Misalignment Under Specific Configuration */
110#define ANOMALY_05000425 (1)
111/* Speculative Fetches of Indirect-Pointer Instructions Can Cause False Hardware Errors */
112#define ANOMALY_05000426 (1)
113/* Specific GPIO Pins May Change State when Entering Hibernate */
114#define ANOMALY_05000436 (__SILICON_REVISION__ > 3)
115/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
116#define ANOMALY_05000443 (1)
117
118/* Anomalies that don't exist on this proc */
119#define ANOMALY_05000158 (0)
120#define ANOMALY_05000198 (0)
121#define ANOMALY_05000230 (0)
122#define ANOMALY_05000263 (0)
123#define ANOMALY_05000311 (0)
124#define ANOMALY_05000323 (0)
125#define ANOMALY_05000353 (1)
126#define ANOMALY_05000363 (0)
127#define ANOMALY_05000386 (1)
128#define ANOMALY_05000412 (0)
129#define ANOMALY_05000432 (0)
130#define ANOMALY_05000435 (0)
131
132#endif
diff --git a/arch/blackfin/mach-bf538/include/mach/bf538.h b/arch/blackfin/mach-bf538/include/mach/bf538.h
new file mode 100644
index 000000000000..9c8abb307908
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/bf538.h
@@ -0,0 +1,124 @@
1/*
2 * File: include/asm-blackfin/mach-bf538/bf538.h
3 * Based on: include/asm-blackfin/mach-bf537/bf537.h
4 * Author: Michael Hennerich (michael.hennerich@analog.com)
5 *
6 * Created:
7 * Description: SYSTEM MMR REGISTER AND MEMORY MAP FOR ADSP-BF527
8 *
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#ifndef __MACH_BF538_H__
31#define __MACH_BF538_H__
32
33#define OFFSET_(x) ((x) & 0x0000FFFF)
34
35/*some misc defines*/
36#define IMASK_IVG15 0x8000
37#define IMASK_IVG14 0x4000
38#define IMASK_IVG13 0x2000
39#define IMASK_IVG12 0x1000
40
41#define IMASK_IVG11 0x0800
42#define IMASK_IVG10 0x0400
43#define IMASK_IVG9 0x0200
44#define IMASK_IVG8 0x0100
45
46#define IMASK_IVG7 0x0080
47#define IMASK_IVGTMR 0x0040
48#define IMASK_IVGHW 0x0020
49
50/***************************/
51
52#define BFIN_DSUBBANKS 4
53#define BFIN_DWAYS 2
54#define BFIN_DLINES 64
55#define BFIN_ISUBBANKS 4
56#define BFIN_IWAYS 4
57#define BFIN_ILINES 32
58
59#define WAY0_L 0x1
60#define WAY1_L 0x2
61#define WAY01_L 0x3
62#define WAY2_L 0x4
63#define WAY02_L 0x5
64#define WAY12_L 0x6
65#define WAY012_L 0x7
66
67#define WAY3_L 0x8
68#define WAY03_L 0x9
69#define WAY13_L 0xA
70#define WAY013_L 0xB
71
72#define WAY32_L 0xC
73#define WAY320_L 0xD
74#define WAY321_L 0xE
75#define WAYALL_L 0xF
76
77#define DMC_ENABLE (2<<2) /*yes, 2, not 1 */
78
79/********************************* EBIU Settings ************************************/
80#define AMBCTL0VAL ((CONFIG_BANK_1 << 16) | CONFIG_BANK_0)
81#define AMBCTL1VAL ((CONFIG_BANK_3 << 16) | CONFIG_BANK_2)
82
83#ifdef CONFIG_C_AMBEN_ALL
84#define V_AMBEN AMBEN_ALL
85#endif
86#ifdef CONFIG_C_AMBEN
87#define V_AMBEN 0x0
88#endif
89#ifdef CONFIG_C_AMBEN_B0
90#define V_AMBEN AMBEN_B0
91#endif
92#ifdef CONFIG_C_AMBEN_B0_B1
93#define V_AMBEN AMBEN_B0_B1
94#endif
95#ifdef CONFIG_C_AMBEN_B0_B1_B2
96#define V_AMBEN AMBEN_B0_B1_B2
97#endif
98#ifdef CONFIG_C_AMCKEN
99#define V_AMCKEN AMCKEN
100#else
101#define V_AMCKEN 0x0
102#endif
103#ifdef CONFIG_C_CDPRIO
104#define V_CDPRIO 0x100
105#else
106#define V_CDPRIO 0x0
107#endif
108
109#define AMGCTLVAL (V_AMBEN | V_AMCKEN | V_CDPRIO)
110
111#ifdef CONFIG_BF538
112#define CPU "BF538"
113#define CPUID 0x27C4
114#endif
115#ifdef CONFIG_BF539
116#define CPU "BF539"
117#define CPUID 0x27C4 /* FXIME:? */
118#endif
119
120#ifndef CPU
121#error "Unknown CPU type - This kernel doesn't seem to be configured properly"
122#endif
123
124#endif /* __MACH_BF538_H__ */
diff --git a/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h b/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
new file mode 100644
index 000000000000..40503b6b89a3
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/bfin_serial_5xx.h
@@ -0,0 +1,183 @@
1/*
2 * file: include/asm-blackfin/mach-bf538/bfin_serial_5xx.h
3 * based on:
4 * author:
5 *
6 * created:
7 * description:
8 * blackfin serial driver header files
9 * rev:
10 *
11 * modified:
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * this program is distributed in the hope that it will be useful,
22 * but without any warranty; without even the implied warranty of
23 * merchantability or fitness for a particular purpose. see the
24 * gnu general public license for more details.
25 *
26 * you should have received a copy of the gnu general public license
27 * along with this program; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */
31
32#include <linux/serial.h>
33#include <asm/dma.h>
34#include <asm/portmux.h>
35
36#define UART_GET_CHAR(uart) bfin_read16(((uart)->port.membase + OFFSET_RBR))
37#define UART_GET_DLL(uart) bfin_read16(((uart)->port.membase + OFFSET_DLL))
38#define UART_GET_IER(uart) bfin_read16(((uart)->port.membase + OFFSET_IER))
39#define UART_GET_DLH(uart) bfin_read16(((uart)->port.membase + OFFSET_DLH))
40#define UART_GET_IIR(uart) bfin_read16(((uart)->port.membase + OFFSET_IIR))
41#define UART_GET_LCR(uart) bfin_read16(((uart)->port.membase + OFFSET_LCR))
42#define UART_GET_GCTL(uart) bfin_read16(((uart)->port.membase + OFFSET_GCTL))
43
44#define UART_PUT_CHAR(uart, v) bfin_write16(((uart)->port.membase + OFFSET_THR), v)
45#define UART_PUT_DLL(uart, v) bfin_write16(((uart)->port.membase + OFFSET_DLL), v)
46#define UART_PUT_IER(uart, v) bfin_write16(((uart)->port.membase + OFFSET_IER), v)
47#define UART_SET_IER(uart, v) UART_PUT_IER(uart, UART_GET_IER(uart) | (v))
48#define UART_CLEAR_IER(uart, v) UART_PUT_IER(uart, UART_GET_IER(uart) & ~(v))
49#define UART_PUT_DLH(uart, v) bfin_write16(((uart)->port.membase + OFFSET_DLH), v)
50#define UART_PUT_LCR(uart, v) bfin_write16(((uart)->port.membase + OFFSET_LCR), v)
51#define UART_PUT_GCTL(uart, v) bfin_write16(((uart)->port.membase + OFFSET_GCTL), v)
52
53#define UART_SET_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) | DLAB); SSYNC(); } while (0)
54#define UART_CLEAR_DLAB(uart) do { UART_PUT_LCR(uart, UART_GET_LCR(uart) & ~DLAB); SSYNC(); } while (0)
55
56#define UART_GET_CTS(x) gpio_get_value(x->cts_pin)
57#define UART_SET_RTS(x) gpio_set_value(x->rts_pin, 1)
58#define UART_CLEAR_RTS(x) gpio_set_value(x->rts_pin, 0)
59#define UART_ENABLE_INTS(x, v) UART_PUT_IER(x, v)
60#define UART_DISABLE_INTS(x) UART_PUT_IER(x, 0)
61
62#if defined(CONFIG_BFIN_UART0_CTSRTS) || defined(CONFIG_BFIN_UART1_CTSRTS)
63# define CONFIG_SERIAL_BFIN_CTSRTS
64
65# ifndef CONFIG_UART0_CTS_PIN
66# define CONFIG_UART0_CTS_PIN -1
67# endif
68
69# ifndef CONFIG_UART0_RTS_PIN
70# define CONFIG_UART0_RTS_PIN -1
71# endif
72
73# ifndef CONFIG_UART1_CTS_PIN
74# define CONFIG_UART1_CTS_PIN -1
75# endif
76
77# ifndef CONFIG_UART1_RTS_PIN
78# define CONFIG_UART1_RTS_PIN -1
79# endif
80#endif
81
82#define BFIN_UART_TX_FIFO_SIZE 2
83
84/*
85 * The pin configuration is different from schematic
86 */
87struct bfin_serial_port {
88 struct uart_port port;
89 unsigned int old_status;
90 unsigned int lsr;
91#ifdef CONFIG_SERIAL_BFIN_DMA
92 int tx_done;
93 int tx_count;
94 struct circ_buf rx_dma_buf;
95 struct timer_list rx_dma_timer;
96 int rx_dma_nrows;
97 unsigned int tx_dma_channel;
98 unsigned int rx_dma_channel;
99 struct work_struct tx_dma_workqueue;
100#endif
101#ifdef CONFIG_SERIAL_BFIN_CTSRTS
102 struct timer_list cts_timer;
103 int cts_pin;
104 int rts_pin;
105#endif
106};
107
108/* The hardware clears the LSR bits upon read, so we need to cache
109 * some of the more fun bits in software so they don't get lost
110 * when checking the LSR in other code paths (TX).
111 */
112static inline unsigned int UART_GET_LSR(struct bfin_serial_port *uart)
113{
114 unsigned int lsr = bfin_read16(uart->port.membase + OFFSET_LSR);
115 uart->lsr |= (lsr & (BI|FE|PE|OE));
116 return lsr | uart->lsr;
117}
118
119static inline void UART_CLEAR_LSR(struct bfin_serial_port *uart)
120{
121 uart->lsr = 0;
122 bfin_write16(uart->port.membase + OFFSET_LSR, -1);
123}
124
125struct bfin_serial_res {
126 unsigned long uart_base_addr;
127 int uart_irq;
128#ifdef CONFIG_SERIAL_BFIN_DMA
129 unsigned int uart_tx_dma_channel;
130 unsigned int uart_rx_dma_channel;
131#endif
132#ifdef CONFIG_SERIAL_BFIN_CTSRTS
133 int uart_cts_pin;
134 int uart_rts_pin;
135#endif
136};
137
138struct bfin_serial_res bfin_serial_resource[] = {
139#ifdef CONFIG_SERIAL_BFIN_UART0
140 {
141 0xFFC00400,
142 IRQ_UART0_RX,
143#ifdef CONFIG_SERIAL_BFIN_DMA
144 CH_UART0_TX,
145 CH_UART0_RX,
146#endif
147#ifdef CONFIG_BFIN_UART0_CTSRTS
148 CONFIG_UART0_CTS_PIN,
149 CONFIG_UART0_RTS_PIN,
150#endif
151 },
152#endif
153#ifdef CONFIG_SERIAL_BFIN_UART1
154 {
155 0xFFC02000,
156 IRQ_UART1_RX,
157#ifdef CONFIG_SERIAL_BFIN_DMA
158 CH_UART1_TX,
159 CH_UART1_RX,
160#endif
161#ifdef CONFIG_BFIN_UART1_CTSRTS
162 CONFIG_UART1_CTS_PIN,
163 CONFIG_UART1_RTS_PIN,
164#endif
165 },
166#endif
167#ifdef CONFIG_SERIAL_BFIN_UART2
168 {
169 0xFFC02100,
170 IRQ_UART2_RX,
171#ifdef CONFIG_SERIAL_BFIN_DMA
172 CH_UART2_TX,
173 CH_UART2_RX,
174#endif
175#ifdef CONFIG_BFIN_UART2_CTSRTS
176 CONFIG_UART2_CTS_PIN,
177 CONFIG_UART2_RTS_PIN,
178#endif
179 },
180#endif
181};
182
183#define DRIVER_NAME "bfin-uart"
diff --git a/arch/blackfin/mach-bf538/include/mach/blackfin.h b/arch/blackfin/mach-bf538/include/mach/blackfin.h
new file mode 100644
index 000000000000..ea25371a922b
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/blackfin.h
@@ -0,0 +1,101 @@
1/*
2 * File: include/asm-blackfin/mach-bf538/blackfin.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32#ifndef _MACH_BLACKFIN_H_
33#define _MACH_BLACKFIN_H_
34
35#define BF538_FAMILY
36
37#include "bf538.h"
38#include "mem_map.h"
39#include "defBF539.h"
40#include "anomaly.h"
41
42
43#if !defined(__ASSEMBLY__)
44#include "cdefBF538.h"
45
46#if defined(CONFIG_BF539)
47#include "cdefBF539.h"
48#endif
49#endif
50
51/* UART_IIR Register */
52#define STATUS(x) ((x << 1) & 0x06)
53#define STATUS_P1 0x02
54#define STATUS_P0 0x01
55
56#define BFIN_UART_NR_PORTS 3
57
58#define OFFSET_THR 0x00 /* Transmit Holding register */
59#define OFFSET_RBR 0x00 /* Receive Buffer register */
60#define OFFSET_DLL 0x00 /* Divisor Latch (Low-Byte) */
61#define OFFSET_IER 0x04 /* Interrupt Enable Register */
62#define OFFSET_DLH 0x04 /* Divisor Latch (High-Byte) */
63#define OFFSET_IIR 0x08 /* Interrupt Identification Register */
64#define OFFSET_LCR 0x0C /* Line Control Register */
65#define OFFSET_MCR 0x10 /* Modem Control Register */
66#define OFFSET_LSR 0x14 /* Line Status Register */
67#define OFFSET_MSR 0x18 /* Modem Status Register */
68#define OFFSET_SCR 0x1C /* SCR Scratch Register */
69#define OFFSET_GCTL 0x24 /* Global Control Register */
70
71
72#define bfin_write_MDMA_D0_IRQ_STATUS bfin_write_MDMA0_D0_IRQ_STATUS
73#define bfin_write_MDMA_D0_START_ADDR bfin_write_MDMA0_D0_START_ADDR
74#define bfin_write_MDMA_S0_START_ADDR bfin_write_MDMA0_S0_START_ADDR
75#define bfin_write_MDMA_D0_X_COUNT bfin_write_MDMA0_D0_X_COUNT
76#define bfin_write_MDMA_S0_X_COUNT bfin_write_MDMA0_S0_X_COUNT
77#define bfin_write_MDMA_D0_Y_COUNT bfin_write_MDMA0_D0_Y_COUNT
78#define bfin_write_MDMA_S0_Y_COUNT bfin_write_MDMA0_S0_Y_COUNT
79#define bfin_write_MDMA_D0_X_MODIFY bfin_write_MDMA0_D0_X_MODIFY
80#define bfin_write_MDMA_S0_X_MODIFY bfin_write_MDMA0_S0_X_MODIFY
81#define bfin_write_MDMA_D0_Y_MODIFY bfin_write_MDMA0_D0_Y_MODIFY
82#define bfin_write_MDMA_S0_Y_MODIFY bfin_write_MDMA0_S0_Y_MODIFY
83#define bfin_write_MDMA_S0_CONFIG bfin_write_MDMA0_S0_CONFIG
84#define bfin_write_MDMA_D0_CONFIG bfin_write_MDMA0_D0_CONFIG
85#define bfin_read_MDMA_S0_CONFIG bfin_read_MDMA0_S0_CONFIG
86#define bfin_read_MDMA_D0_IRQ_STATUS bfin_read_MDMA0_D0_IRQ_STATUS
87#define bfin_write_MDMA_S0_IRQ_STATUS bfin_write_MDMA0_S0_IRQ_STATUS
88
89
90/* DPMC*/
91#define bfin_read_STOPCK_OFF() bfin_read_STOPCK()
92#define bfin_write_STOPCK_OFF(val) bfin_write_STOPCK(val)
93#define STOPCK_OFF STOPCK
94
95/* PLL_DIV Masks */
96#define CCLK_DIV1 CSEL_DIV1 /* CCLK = VCO / 1 */
97#define CCLK_DIV2 CSEL_DIV2 /* CCLK = VCO / 2 */
98#define CCLK_DIV4 CSEL_DIV4 /* CCLK = VCO / 4 */
99#define CCLK_DIV8 CSEL_DIV8 /* CCLK = VCO / 8 */
100
101#endif
diff --git a/arch/blackfin/mach-bf538/include/mach/cdefBF538.h b/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
new file mode 100644
index 000000000000..241725bc6988
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/cdefBF538.h
@@ -0,0 +1,2108 @@
1/*
2 * File: include/asm-blackfin/mach-bf538/cdefBF538.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _CDEF_BF538_H
32#define _CDEF_BF538_H
33
34#include <asm/blackfin.h>
35
36/*include all Core registers and bit definitions*/
37#include "defBF539.h"
38
39/*include core specific register pointer definitions*/
40#include <asm/cdef_LPBlackfin.h>
41
42#define bfin_writePTR(addr, val) bfin_write32(addr, val)
43
44#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
45#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
46#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
47#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
48#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
49#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
50#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
51#define bfin_write_PLL_LOCKCNT(val) bfin_write16(PLL_LOCKCNT, val)
52#define bfin_read_CHIPID() bfin_read32(CHIPID)
53#define bfin_write_CHIPID(val) bfin_write32(CHIPID, val)
54#define bfin_read_SWRST() bfin_read16(SWRST)
55#define bfin_write_SWRST(val) bfin_write16(SWRST, val)
56#define bfin_read_SYSCR() bfin_read16(SYSCR)
57#define bfin_write_SYSCR(val) bfin_write16(SYSCR, val)
58#define bfin_read_SIC_RVECT() bfin_readPTR(SIC_RVECT)
59#define bfin_write_SIC_RVECT(val) bfin_writePTR(SIC_RVECT, val)
60#define bfin_read_SIC_IMASK0() bfin_read32(SIC_IMASK0)
61#define bfin_write_SIC_IMASK0(val) bfin_write32(SIC_IMASK0, val)
62#define bfin_read_SIC_IMASK1() bfin_read32(SIC_IMASK1)
63#define bfin_write_SIC_IMASK1(val) bfin_write32(SIC_IMASK1, val)
64#define bfin_read_SIC_IMASK(x) bfin_read32(SIC_IMASK0 + x * (SIC_IMASK1 - SIC_IMASK0))
65#define bfin_write_SIC_IMASK(x, val) bfin_write32(SIC_IMASK0 + x * (SIC_IMASK1 - SIC_IMASK0), val)
66#define bfin_read_SIC_ISR0() bfin_read32(SIC_ISR0)
67#define bfin_write_SIC_ISR0(val) bfin_write32(SIC_ISR0, val)
68#define bfin_read_SIC_ISR1() bfin_read32(SIC_ISR1)
69#define bfin_write_SIC_ISR1(val) bfin_write32(SIC_ISR1, val)
70#define bfin_read_SIC_ISR(x) bfin_read32(SIC_ISR0 + x * (SIC_ISR1 - SIC_ISR0))
71#define bfin_write_SIC_ISR(x, val) bfin_write32(SIC_ISR0 + x * (SIC_ISR1 - SIC_ISR0), val)
72#define bfin_read_SIC_IWR0() bfin_read32(SIC_IWR0)
73#define bfin_write_SIC_IWR0(val) bfin_write32(SIC_IWR0, val)
74#define bfin_read_SIC_IWR1() bfin_read32(SIC_IWR1)
75#define bfin_write_SIC_IWR1(val) bfin_write32(SIC_IWR1, val)
76#define bfin_read_SIC_IWR(x) bfin_read32(SIC_IWR0 + x * (SIC_IWR1 - SIC_IWR0))
77#define bfin_write_SIC_IWR(x, val) bfin_write32((SIC_IWR0 + x * (SIC_IWR1 - SIC_IWR0), val)
78#define bfin_read_SIC_IAR0() bfin_read32(SIC_IAR0)
79#define bfin_write_SIC_IAR0(val) bfin_write32(SIC_IAR0, val)
80#define bfin_read_SIC_IAR1() bfin_read32(SIC_IAR1)
81#define bfin_write_SIC_IAR1(val) bfin_write32(SIC_IAR1, val)
82#define bfin_read_SIC_IAR2() bfin_read32(SIC_IAR2)
83#define bfin_write_SIC_IAR2(val) bfin_write32(SIC_IAR2, val)
84#define bfin_read_SIC_IAR3() bfin_read32(SIC_IAR3)
85#define bfin_write_SIC_IAR3(val) bfin_write32(SIC_IAR3, val)
86#define bfin_read_SIC_IAR4() bfin_read32(SIC_IAR4)
87#define bfin_write_SIC_IAR4(val) bfin_write32(SIC_IAR4, val)
88#define bfin_read_SIC_IAR5() bfin_read32(SIC_IAR5)
89#define bfin_write_SIC_IAR5(val) bfin_write32(SIC_IAR5, val)
90#define bfin_read_SIC_IAR6() bfin_read32(SIC_IAR6)
91#define bfin_write_SIC_IAR6(val) bfin_write32(SIC_IAR6, val)
92#define bfin_read_WDOG_CTL() bfin_read16(WDOG_CTL)
93#define bfin_write_WDOG_CTL(val) bfin_write16(WDOG_CTL, val)
94#define bfin_read_WDOG_CNT() bfin_read32(WDOG_CNT)
95#define bfin_write_WDOG_CNT(val) bfin_write32(WDOG_CNT, val)
96#define bfin_read_WDOG_STAT() bfin_read32(WDOG_STAT)
97#define bfin_write_WDOG_STAT(val) bfin_write32(WDOG_STAT, val)
98#define bfin_read_RTC_STAT() bfin_read32(RTC_STAT)
99#define bfin_write_RTC_STAT(val) bfin_write32(RTC_STAT, val)
100#define bfin_read_RTC_ICTL() bfin_read16(RTC_ICTL)
101#define bfin_write_RTC_ICTL(val) bfin_write16(RTC_ICTL, val)
102#define bfin_read_RTC_ISTAT() bfin_read16(RTC_ISTAT)
103#define bfin_write_RTC_ISTAT(val) bfin_write16(RTC_ISTAT, val)
104#define bfin_read_RTC_SWCNT() bfin_read16(RTC_SWCNT)
105#define bfin_write_RTC_SWCNT(val) bfin_write16(RTC_SWCNT, val)
106#define bfin_read_RTC_ALARM() bfin_read32(RTC_ALARM)
107#define bfin_write_RTC_ALARM(val) bfin_write32(RTC_ALARM, val)
108#define bfin_read_RTC_PREN() bfin_read16(RTC_PREN)
109#define bfin_write_RTC_PREN(val) bfin_write16(RTC_PREN, val)
110#define bfin_read_UART0_THR() bfin_read16(UART0_THR)
111#define bfin_write_UART0_THR(val) bfin_write16(UART0_THR, val)
112#define bfin_read_UART0_RBR() bfin_read16(UART0_RBR)
113#define bfin_write_UART0_RBR(val) bfin_write16(UART0_RBR, val)
114#define bfin_read_UART0_DLL() bfin_read16(UART0_DLL)
115#define bfin_write_UART0_DLL(val) bfin_write16(UART0_DLL, val)
116#define bfin_read_UART0_DLH() bfin_read16(UART0_DLH)
117#define bfin_write_UART0_DLH(val) bfin_write16(UART0_DLH, val)
118#define bfin_read_UART0_IER() bfin_read16(UART0_IER)
119#define bfin_write_UART0_IER(val) bfin_write16(UART0_IER, val)
120#define bfin_read_UART0_IIR() bfin_read16(UART0_IIR)
121#define bfin_write_UART0_IIR(val) bfin_write16(UART0_IIR, val)
122#define bfin_read_UART0_LCR() bfin_read16(UART0_LCR)
123#define bfin_write_UART0_LCR(val) bfin_write16(UART0_LCR, val)
124#define bfin_read_UART0_MCR() bfin_read16(UART0_MCR)
125#define bfin_write_UART0_MCR(val) bfin_write16(UART0_MCR, val)
126#define bfin_read_UART0_LSR() bfin_read16(UART0_LSR)
127#define bfin_write_UART0_LSR(val) bfin_write16(UART0_LSR, val)
128#define bfin_read_UART0_SCR() bfin_read16(UART0_SCR)
129#define bfin_write_UART0_SCR(val) bfin_write16(UART0_SCR, val)
130#define bfin_read_UART0_GCTL() bfin_read16(UART0_GCTL)
131#define bfin_write_UART0_GCTL(val) bfin_write16(UART0_GCTL, val)
132#define bfin_read_UART1_THR() bfin_read16(UART1_THR)
133#define bfin_write_UART1_THR(val) bfin_write16(UART1_THR, val)
134#define bfin_read_UART1_RBR() bfin_read16(UART1_RBR)
135#define bfin_write_UART1_RBR(val) bfin_write16(UART1_RBR, val)
136#define bfin_read_UART1_DLL() bfin_read16(UART1_DLL)
137#define bfin_write_UART1_DLL(val) bfin_write16(UART1_DLL, val)
138#define bfin_read_UART1_DLH() bfin_read16(UART1_DLH)
139#define bfin_write_UART1_DLH(val) bfin_write16(UART1_DLH, val)
140#define bfin_read_UART1_IER() bfin_read16(UART1_IER)
141#define bfin_write_UART1_IER(val) bfin_write16(UART1_IER, val)
142#define bfin_read_UART1_IIR() bfin_read16(UART1_IIR)
143#define bfin_write_UART1_IIR(val) bfin_write16(UART1_IIR, val)
144#define bfin_read_UART1_LCR() bfin_read16(UART1_LCR)
145#define bfin_write_UART1_LCR(val) bfin_write16(UART1_LCR, val)
146#define bfin_read_UART1_MCR() bfin_read16(UART1_MCR)
147#define bfin_write_UART1_MCR(val) bfin_write16(UART1_MCR, val)
148#define bfin_read_UART1_LSR() bfin_read16(UART1_LSR)
149#define bfin_write_UART1_LSR(val) bfin_write16(UART1_LSR, val)
150#define bfin_read_UART1_SCR() bfin_read16(UART1_SCR)
151#define bfin_write_UART1_SCR(val) bfin_write16(UART1_SCR, val)
152#define bfin_read_UART1_GCTL() bfin_read16(UART1_GCTL)
153#define bfin_write_UART1_GCTL(val) bfin_write16(UART1_GCTL, val)
154#define bfin_read_UART2_THR() bfin_read16(UART2_THR)
155#define bfin_write_UART2_THR(val) bfin_write16(UART2_THR, val)
156#define bfin_read_UART2_RBR() bfin_read16(UART2_RBR)
157#define bfin_write_UART2_RBR(val) bfin_write16(UART2_RBR, val)
158#define bfin_read_UART2_DLL() bfin_read16(UART2_DLL)
159#define bfin_write_UART2_DLL(val) bfin_write16(UART2_DLL, val)
160#define bfin_read_UART2_DLH() bfin_read16(UART2_DLH)
161#define bfin_write_UART2_DLH(val) bfin_write16(UART2_DLH, val)
162#define bfin_read_UART2_IER() bfin_read16(UART2_IER)
163#define bfin_write_UART2_IER(val) bfin_write16(UART2_IER, val)
164#define bfin_read_UART2_IIR() bfin_read16(UART2_IIR)
165#define bfin_write_UART2_IIR(val) bfin_write16(UART2_IIR, val)
166#define bfin_read_UART2_LCR() bfin_read16(UART2_LCR)
167#define bfin_write_UART2_LCR(val) bfin_write16(UART2_LCR, val)
168#define bfin_read_UART2_MCR() bfin_read16(UART2_MCR)
169#define bfin_write_UART2_MCR(val) bfin_write16(UART2_MCR, val)
170#define bfin_read_UART2_LSR() bfin_read16(UART2_LSR)
171#define bfin_write_UART2_LSR(val) bfin_write16(UART2_LSR, val)
172#define bfin_read_UART2_SCR() bfin_read16(UART2_SCR)
173#define bfin_write_UART2_SCR(val) bfin_write16(UART2_SCR, val)
174#define bfin_read_UART2_GCTL() bfin_read16(UART2_GCTL)
175#define bfin_write_UART2_GCTL(val) bfin_write16(UART2_GCTL, val)
176#define bfin_read_SPI0_CTL() bfin_read16(SPI0_CTL)
177#define bfin_write_SPI0_CTL(val) bfin_write16(SPI0_CTL, val)
178#define bfin_read_SPI0_FLG() bfin_read16(SPI0_FLG)
179#define bfin_write_SPI0_FLG(val) bfin_write16(SPI0_FLG, val)
180#define bfin_read_SPI0_STAT() bfin_read16(SPI0_STAT)
181#define bfin_write_SPI0_STAT(val) bfin_write16(SPI0_STAT, val)
182#define bfin_read_SPI0_TDBR() bfin_read16(SPI0_TDBR)
183#define bfin_write_SPI0_TDBR(val) bfin_write16(SPI0_TDBR, val)
184#define bfin_read_SPI0_RDBR() bfin_read16(SPI0_RDBR)
185#define bfin_write_SPI0_RDBR(val) bfin_write16(SPI0_RDBR, val)
186#define bfin_read_SPI0_BAUD() bfin_read16(SPI0_BAUD)
187#define bfin_write_SPI0_BAUD(val) bfin_write16(SPI0_BAUD, val)
188#define bfin_read_SPI0_SHADOW() bfin_read16(SPI0_SHADOW)
189#define bfin_write_SPI0_SHADOW(val) bfin_write16(SPI0_SHADOW, val)
190#define bfin_read_SPI1_CTL() bfin_read16(SPI1_CTL)
191#define bfin_write_SPI1_CTL(val) bfin_write16(SPI1_CTL, val)
192#define bfin_read_SPI1_FLG() bfin_read16(SPI1_FLG)
193#define bfin_write_SPI1_FLG(val) bfin_write16(SPI1_FLG, val)
194#define bfin_read_SPI1_STAT() bfin_read16(SPI1_STAT)
195#define bfin_write_SPI1_STAT(val) bfin_write16(SPI1_STAT, val)
196#define bfin_read_SPI1_TDBR() bfin_read16(SPI1_TDBR)
197#define bfin_write_SPI1_TDBR(val) bfin_write16(SPI1_TDBR, val)
198#define bfin_read_SPI1_RDBR() bfin_read16(SPI1_RDBR)
199#define bfin_write_SPI1_RDBR(val) bfin_write16(SPI1_RDBR, val)
200#define bfin_read_SPI1_BAUD() bfin_read16(SPI1_BAUD)
201#define bfin_write_SPI1_BAUD(val) bfin_write16(SPI1_BAUD, val)
202#define bfin_read_SPI1_SHADOW() bfin_read16(SPI1_SHADOW)
203#define bfin_write_SPI1_SHADOW(val) bfin_write16(SPI1_SHADOW, val)
204#define bfin_read_SPI2_CTL() bfin_read16(SPI2_CTL)
205#define bfin_write_SPI2_CTL(val) bfin_write16(SPI2_CTL, val)
206#define bfin_read_SPI2_FLG() bfin_read16(SPI2_FLG)
207#define bfin_write_SPI2_FLG(val) bfin_write16(SPI2_FLG, val)
208#define bfin_read_SPI2_STAT() bfin_read16(SPI2_STAT)
209#define bfin_write_SPI2_STAT(val) bfin_write16(SPI2_STAT, val)
210#define bfin_read_SPI2_TDBR() bfin_read16(SPI2_TDBR)
211#define bfin_write_SPI2_TDBR(val) bfin_write16(SPI2_TDBR, val)
212#define bfin_read_SPI2_RDBR() bfin_read16(SPI2_RDBR)
213#define bfin_write_SPI2_RDBR(val) bfin_write16(SPI2_RDBR, val)
214#define bfin_read_SPI2_BAUD() bfin_read16(SPI2_BAUD)
215#define bfin_write_SPI2_BAUD(val) bfin_write16(SPI2_BAUD, val)
216#define bfin_read_SPI2_SHADOW() bfin_read16(SPI2_SHADOW)
217#define bfin_write_SPI2_SHADOW(val) bfin_write16(SPI2_SHADOW, val)
218#define bfin_read_TIMER0_CONFIG() bfin_read16(TIMER0_CONFIG)
219#define bfin_write_TIMER0_CONFIG(val) bfin_write16(TIMER0_CONFIG, val)
220#define bfin_read_TIMER0_COUNTER() bfin_read32(TIMER0_COUNTER)
221#define bfin_write_TIMER0_COUNTER(val) bfin_write32(TIMER0_COUNTER, val)
222#define bfin_read_TIMER0_PERIOD() bfin_read32(TIMER0_PERIOD)
223#define bfin_write_TIMER0_PERIOD(val) bfin_write32(TIMER0_PERIOD, val)
224#define bfin_read_TIMER0_WIDTH() bfin_read32(TIMER0_WIDTH)
225#define bfin_write_TIMER0_WIDTH(val) bfin_write32(TIMER0_WIDTH, val)
226#define bfin_read_TIMER1_CONFIG() bfin_read16(TIMER1_CONFIG)
227#define bfin_write_TIMER1_CONFIG(val) bfin_write16(TIMER1_CONFIG, val)
228#define bfin_read_TIMER1_COUNTER() bfin_read32(TIMER1_COUNTER)
229#define bfin_write_TIMER1_COUNTER(val) bfin_write32(TIMER1_COUNTER, val)
230#define bfin_read_TIMER1_PERIOD() bfin_read32(TIMER1_PERIOD)
231#define bfin_write_TIMER1_PERIOD(val) bfin_write32(TIMER1_PERIOD, val)
232#define bfin_read_TIMER1_WIDTH() bfin_read32(TIMER1_WIDTH)
233#define bfin_write_TIMER1_WIDTH(val) bfin_write32(TIMER1_WIDTH, val)
234#define bfin_read_TIMER2_CONFIG() bfin_read16(TIMER2_CONFIG)
235#define bfin_write_TIMER2_CONFIG(val) bfin_write16(TIMER2_CONFIG, val)
236#define bfin_read_TIMER2_COUNTER() bfin_read32(TIMER2_COUNTER)
237#define bfin_write_TIMER2_COUNTER(val) bfin_write32(TIMER2_COUNTER, val)
238#define bfin_read_TIMER2_PERIOD() bfin_read32(TIMER2_PERIOD)
239#define bfin_write_TIMER2_PERIOD(val) bfin_write32(TIMER2_PERIOD, val)
240#define bfin_read_TIMER2_WIDTH() bfin_read32(TIMER2_WIDTH)
241#define bfin_write_TIMER2_WIDTH(val) bfin_write32(TIMER2_WIDTH, val)
242#define bfin_read_TIMER_ENABLE() bfin_read16(TIMER_ENABLE)
243#define bfin_write_TIMER_ENABLE(val) bfin_write16(TIMER_ENABLE, val)
244#define bfin_read_TIMER_DISABLE() bfin_read16(TIMER_DISABLE)
245#define bfin_write_TIMER_DISABLE(val) bfin_write16(TIMER_DISABLE, val)
246#define bfin_read_TIMER_STATUS() bfin_read16(TIMER_STATUS)
247#define bfin_write_TIMER_STATUS(val) bfin_write16(TIMER_STATUS, val)
248#define bfin_read_SPORT0_TCR1() bfin_read16(SPORT0_TCR1)
249#define bfin_write_SPORT0_TCR1(val) bfin_write16(SPORT0_TCR1, val)
250#define bfin_read_SPORT0_TCR2() bfin_read16(SPORT0_TCR2)
251#define bfin_write_SPORT0_TCR2(val) bfin_write16(SPORT0_TCR2, val)
252#define bfin_read_SPORT0_TCLKDIV() bfin_read16(SPORT0_TCLKDIV)
253#define bfin_write_SPORT0_TCLKDIV(val) bfin_write16(SPORT0_TCLKDIV, val)
254#define bfin_read_SPORT0_TFSDIV() bfin_read16(SPORT0_TFSDIV)
255#define bfin_write_SPORT0_TFSDIV(val) bfin_write16(SPORT0_TFSDIV, val)
256#define bfin_read_SPORT0_TX() bfin_read32(SPORT0_TX)
257#define bfin_write_SPORT0_TX(val) bfin_write32(SPORT0_TX, val)
258#define bfin_read_SPORT0_RX() bfin_read32(SPORT0_RX)
259#define bfin_write_SPORT0_RX(val) bfin_write32(SPORT0_RX, val)
260#define bfin_read_SPORT0_RCR1() bfin_read16(SPORT0_RCR1)
261#define bfin_write_SPORT0_RCR1(val) bfin_write16(SPORT0_RCR1, val)
262#define bfin_read_SPORT0_RCR2() bfin_read16(SPORT0_RCR2)
263#define bfin_write_SPORT0_RCR2(val) bfin_write16(SPORT0_RCR2, val)
264#define bfin_read_SPORT0_RCLKDIV() bfin_read16(SPORT0_RCLKDIV)
265#define bfin_write_SPORT0_RCLKDIV(val) bfin_write16(SPORT0_RCLKDIV, val)
266#define bfin_read_SPORT0_RFSDIV() bfin_read16(SPORT0_RFSDIV)
267#define bfin_write_SPORT0_RFSDIV(val) bfin_write16(SPORT0_RFSDIV, val)
268#define bfin_read_SPORT0_STAT() bfin_read16(SPORT0_STAT)
269#define bfin_write_SPORT0_STAT(val) bfin_write16(SPORT0_STAT, val)
270#define bfin_read_SPORT0_CHNL() bfin_read16(SPORT0_CHNL)
271#define bfin_write_SPORT0_CHNL(val) bfin_write16(SPORT0_CHNL, val)
272#define bfin_read_SPORT0_MCMC1() bfin_read16(SPORT0_MCMC1)
273#define bfin_write_SPORT0_MCMC1(val) bfin_write16(SPORT0_MCMC1, val)
274#define bfin_read_SPORT0_MCMC2() bfin_read16(SPORT0_MCMC2)
275#define bfin_write_SPORT0_MCMC2(val) bfin_write16(SPORT0_MCMC2, val)
276#define bfin_read_SPORT0_MTCS0() bfin_read32(SPORT0_MTCS0)
277#define bfin_write_SPORT0_MTCS0(val) bfin_write32(SPORT0_MTCS0, val)
278#define bfin_read_SPORT0_MTCS1() bfin_read32(SPORT0_MTCS1)
279#define bfin_write_SPORT0_MTCS1(val) bfin_write32(SPORT0_MTCS1, val)
280#define bfin_read_SPORT0_MTCS2() bfin_read32(SPORT0_MTCS2)
281#define bfin_write_SPORT0_MTCS2(val) bfin_write32(SPORT0_MTCS2, val)
282#define bfin_read_SPORT0_MTCS3() bfin_read32(SPORT0_MTCS3)
283#define bfin_write_SPORT0_MTCS3(val) bfin_write32(SPORT0_MTCS3, val)
284#define bfin_read_SPORT0_MRCS0() bfin_read32(SPORT0_MRCS0)
285#define bfin_write_SPORT0_MRCS0(val) bfin_write32(SPORT0_MRCS0, val)
286#define bfin_read_SPORT0_MRCS1() bfin_read32(SPORT0_MRCS1)
287#define bfin_write_SPORT0_MRCS1(val) bfin_write32(SPORT0_MRCS1, val)
288#define bfin_read_SPORT0_MRCS2() bfin_read32(SPORT0_MRCS2)
289#define bfin_write_SPORT0_MRCS2(val) bfin_write32(SPORT0_MRCS2, val)
290#define bfin_read_SPORT0_MRCS3() bfin_read32(SPORT0_MRCS3)
291#define bfin_write_SPORT0_MRCS3(val) bfin_write32(SPORT0_MRCS3, val)
292#define bfin_read_SPORT1_TCR1() bfin_read16(SPORT1_TCR1)
293#define bfin_write_SPORT1_TCR1(val) bfin_write16(SPORT1_TCR1, val)
294#define bfin_read_SPORT1_TCR2() bfin_read16(SPORT1_TCR2)
295#define bfin_write_SPORT1_TCR2(val) bfin_write16(SPORT1_TCR2, val)
296#define bfin_read_SPORT1_TCLKDIV() bfin_read16(SPORT1_TCLKDIV)
297#define bfin_write_SPORT1_TCLKDIV(val) bfin_write16(SPORT1_TCLKDIV, val)
298#define bfin_read_SPORT1_TFSDIV() bfin_read16(SPORT1_TFSDIV)
299#define bfin_write_SPORT1_TFSDIV(val) bfin_write16(SPORT1_TFSDIV, val)
300#define bfin_read_SPORT1_TX() bfin_read32(SPORT1_TX)
301#define bfin_write_SPORT1_TX(val) bfin_write32(SPORT1_TX, val)
302#define bfin_read_SPORT1_RX() bfin_read32(SPORT1_RX)
303#define bfin_write_SPORT1_RX(val) bfin_write32(SPORT1_RX, val)
304#define bfin_read_SPORT1_RCR1() bfin_read16(SPORT1_RCR1)
305#define bfin_write_SPORT1_RCR1(val) bfin_write16(SPORT1_RCR1, val)
306#define bfin_read_SPORT1_RCR2() bfin_read16(SPORT1_RCR2)
307#define bfin_write_SPORT1_RCR2(val) bfin_write16(SPORT1_RCR2, val)
308#define bfin_read_SPORT1_RCLKDIV() bfin_read16(SPORT1_RCLKDIV)
309#define bfin_write_SPORT1_RCLKDIV(val) bfin_write16(SPORT1_RCLKDIV, val)
310#define bfin_read_SPORT1_RFSDIV() bfin_read16(SPORT1_RFSDIV)
311#define bfin_write_SPORT1_RFSDIV(val) bfin_write16(SPORT1_RFSDIV, val)
312#define bfin_read_SPORT1_STAT() bfin_read16(SPORT1_STAT)
313#define bfin_write_SPORT1_STAT(val) bfin_write16(SPORT1_STAT, val)
314#define bfin_read_SPORT1_CHNL() bfin_read16(SPORT1_CHNL)
315#define bfin_write_SPORT1_CHNL(val) bfin_write16(SPORT1_CHNL, val)
316#define bfin_read_SPORT1_MCMC1() bfin_read16(SPORT1_MCMC1)
317#define bfin_write_SPORT1_MCMC1(val) bfin_write16(SPORT1_MCMC1, val)
318#define bfin_read_SPORT1_MCMC2() bfin_read16(SPORT1_MCMC2)
319#define bfin_write_SPORT1_MCMC2(val) bfin_write16(SPORT1_MCMC2, val)
320#define bfin_read_SPORT1_MTCS0() bfin_read32(SPORT1_MTCS0)
321#define bfin_write_SPORT1_MTCS0(val) bfin_write32(SPORT1_MTCS0, val)
322#define bfin_read_SPORT1_MTCS1() bfin_read32(SPORT1_MTCS1)
323#define bfin_write_SPORT1_MTCS1(val) bfin_write32(SPORT1_MTCS1, val)
324#define bfin_read_SPORT1_MTCS2() bfin_read32(SPORT1_MTCS2)
325#define bfin_write_SPORT1_MTCS2(val) bfin_write32(SPORT1_MTCS2, val)
326#define bfin_read_SPORT1_MTCS3() bfin_read32(SPORT1_MTCS3)
327#define bfin_write_SPORT1_MTCS3(val) bfin_write32(SPORT1_MTCS3, val)
328#define bfin_read_SPORT1_MRCS0() bfin_read32(SPORT1_MRCS0)
329#define bfin_write_SPORT1_MRCS0(val) bfin_write32(SPORT1_MRCS0, val)
330#define bfin_read_SPORT1_MRCS1() bfin_read32(SPORT1_MRCS1)
331#define bfin_write_SPORT1_MRCS1(val) bfin_write32(SPORT1_MRCS1, val)
332#define bfin_read_SPORT1_MRCS2() bfin_read32(SPORT1_MRCS2)
333#define bfin_write_SPORT1_MRCS2(val) bfin_write32(SPORT1_MRCS2, val)
334#define bfin_read_SPORT1_MRCS3() bfin_read32(SPORT1_MRCS3)
335#define bfin_write_SPORT1_MRCS3(val) bfin_write32(SPORT1_MRCS3, val)
336#define bfin_read_SPORT2_TCR1() bfin_read16(SPORT2_TCR1)
337#define bfin_write_SPORT2_TCR1(val) bfin_write16(SPORT2_TCR1, val)
338#define bfin_read_SPORT2_TCR2() bfin_read16(SPORT2_TCR2)
339#define bfin_write_SPORT2_TCR2(val) bfin_write16(SPORT2_TCR2, val)
340#define bfin_read_SPORT2_TCLKDIV() bfin_read16(SPORT2_TCLKDIV)
341#define bfin_write_SPORT2_TCLKDIV(val) bfin_write16(SPORT2_TCLKDIV, val)
342#define bfin_read_SPORT2_TFSDIV() bfin_read16(SPORT2_TFSDIV)
343#define bfin_write_SPORT2_TFSDIV(val) bfin_write16(SPORT2_TFSDIV, val)
344#define bfin_read_SPORT2_TX() bfin_read32(SPORT2_TX)
345#define bfin_write_SPORT2_TX(val) bfin_write32(SPORT2_TX, val)
346#define bfin_read_SPORT2_RX() bfin_read32(SPORT2_RX)
347#define bfin_write_SPORT2_RX(val) bfin_write32(SPORT2_RX, val)
348#define bfin_read_SPORT2_RCR1() bfin_read16(SPORT2_RCR1)
349#define bfin_write_SPORT2_RCR1(val) bfin_write16(SPORT2_RCR1, val)
350#define bfin_read_SPORT2_RCR2() bfin_read16(SPORT2_RCR2)
351#define bfin_write_SPORT2_RCR2(val) bfin_write16(SPORT2_RCR2, val)
352#define bfin_read_SPORT2_RCLKDIV() bfin_read16(SPORT2_RCLKDIV)
353#define bfin_write_SPORT2_RCLKDIV(val) bfin_write16(SPORT2_RCLKDIV, val)
354#define bfin_read_SPORT2_RFSDIV() bfin_read16(SPORT2_RFSDIV)
355#define bfin_write_SPORT2_RFSDIV(val) bfin_write16(SPORT2_RFSDIV, val)
356#define bfin_read_SPORT2_STAT() bfin_read16(SPORT2_STAT)
357#define bfin_write_SPORT2_STAT(val) bfin_write16(SPORT2_STAT, val)
358#define bfin_read_SPORT2_CHNL() bfin_read16(SPORT2_CHNL)
359#define bfin_write_SPORT2_CHNL(val) bfin_write16(SPORT2_CHNL, val)
360#define bfin_read_SPORT2_MCMC1() bfin_read16(SPORT2_MCMC1)
361#define bfin_write_SPORT2_MCMC1(val) bfin_write16(SPORT2_MCMC1, val)
362#define bfin_read_SPORT2_MCMC2() bfin_read16(SPORT2_MCMC2)
363#define bfin_write_SPORT2_MCMC2(val) bfin_write16(SPORT2_MCMC2, val)
364#define bfin_read_SPORT2_MTCS0() bfin_read32(SPORT2_MTCS0)
365#define bfin_write_SPORT2_MTCS0(val) bfin_write32(SPORT2_MTCS0, val)
366#define bfin_read_SPORT2_MTCS1() bfin_read32(SPORT2_MTCS1)
367#define bfin_write_SPORT2_MTCS1(val) bfin_write32(SPORT2_MTCS1, val)
368#define bfin_read_SPORT2_MTCS2() bfin_read32(SPORT2_MTCS2)
369#define bfin_write_SPORT2_MTCS2(val) bfin_write32(SPORT2_MTCS2, val)
370#define bfin_read_SPORT2_MTCS3() bfin_read32(SPORT2_MTCS3)
371#define bfin_write_SPORT2_MTCS3(val) bfin_write32(SPORT2_MTCS3, val)
372#define bfin_read_SPORT2_MRCS0() bfin_read32(SPORT2_MRCS0)
373#define bfin_write_SPORT2_MRCS0(val) bfin_write32(SPORT2_MRCS0, val)
374#define bfin_read_SPORT2_MRCS1() bfin_read32(SPORT2_MRCS1)
375#define bfin_write_SPORT2_MRCS1(val) bfin_write32(SPORT2_MRCS1, val)
376#define bfin_read_SPORT2_MRCS2() bfin_read32(SPORT2_MRCS2)
377#define bfin_write_SPORT2_MRCS2(val) bfin_write32(SPORT2_MRCS2, val)
378#define bfin_read_SPORT2_MRCS3() bfin_read32(SPORT2_MRCS3)
379#define bfin_write_SPORT2_MRCS3(val) bfin_write32(SPORT2_MRCS3, val)
380#define bfin_read_SPORT3_TCR1() bfin_read16(SPORT3_TCR1)
381#define bfin_write_SPORT3_TCR1(val) bfin_write16(SPORT3_TCR1, val)
382#define bfin_read_SPORT3_TCR2() bfin_read16(SPORT3_TCR2)
383#define bfin_write_SPORT3_TCR2(val) bfin_write16(SPORT3_TCR2, val)
384#define bfin_read_SPORT3_TCLKDIV() bfin_read16(SPORT3_TCLKDIV)
385#define bfin_write_SPORT3_TCLKDIV(val) bfin_write16(SPORT3_TCLKDIV, val)
386#define bfin_read_SPORT3_TFSDIV() bfin_read16(SPORT3_TFSDIV)
387#define bfin_write_SPORT3_TFSDIV(val) bfin_write16(SPORT3_TFSDIV, val)
388#define bfin_read_SPORT3_TX() bfin_read32(SPORT3_TX)
389#define bfin_write_SPORT3_TX(val) bfin_write32(SPORT3_TX, val)
390#define bfin_read_SPORT3_RX() bfin_read32(SPORT3_RX)
391#define bfin_write_SPORT3_RX(val) bfin_write32(SPORT3_RX, val)
392#define bfin_read_SPORT3_RCR1() bfin_read16(SPORT3_RCR1)
393#define bfin_write_SPORT3_RCR1(val) bfin_write16(SPORT3_RCR1, val)
394#define bfin_read_SPORT3_RCR2() bfin_read16(SPORT3_RCR2)
395#define bfin_write_SPORT3_RCR2(val) bfin_write16(SPORT3_RCR2, val)
396#define bfin_read_SPORT3_RCLKDIV() bfin_read16(SPORT3_RCLKDIV)
397#define bfin_write_SPORT3_RCLKDIV(val) bfin_write16(SPORT3_RCLKDIV, val)
398#define bfin_read_SPORT3_RFSDIV() bfin_read16(SPORT3_RFSDIV)
399#define bfin_write_SPORT3_RFSDIV(val) bfin_write16(SPORT3_RFSDIV, val)
400#define bfin_read_SPORT3_STAT() bfin_read16(SPORT3_STAT)
401#define bfin_write_SPORT3_STAT(val) bfin_write16(SPORT3_STAT, val)
402#define bfin_read_SPORT3_CHNL() bfin_read16(SPORT3_CHNL)
403#define bfin_write_SPORT3_CHNL(val) bfin_write16(SPORT3_CHNL, val)
404#define bfin_read_SPORT3_MCMC1() bfin_read16(SPORT3_MCMC1)
405#define bfin_write_SPORT3_MCMC1(val) bfin_write16(SPORT3_MCMC1, val)
406#define bfin_read_SPORT3_MCMC2() bfin_read16(SPORT3_MCMC2)
407#define bfin_write_SPORT3_MCMC2(val) bfin_write16(SPORT3_MCMC2, val)
408#define bfin_read_SPORT3_MTCS0() bfin_read32(SPORT3_MTCS0)
409#define bfin_write_SPORT3_MTCS0(val) bfin_write32(SPORT3_MTCS0, val)
410#define bfin_read_SPORT3_MTCS1() bfin_read32(SPORT3_MTCS1)
411#define bfin_write_SPORT3_MTCS1(val) bfin_write32(SPORT3_MTCS1, val)
412#define bfin_read_SPORT3_MTCS2() bfin_read32(SPORT3_MTCS2)
413#define bfin_write_SPORT3_MTCS2(val) bfin_write32(SPORT3_MTCS2, val)
414#define bfin_read_SPORT3_MTCS3() bfin_read32(SPORT3_MTCS3)
415#define bfin_write_SPORT3_MTCS3(val) bfin_write32(SPORT3_MTCS3, val)
416#define bfin_read_SPORT3_MRCS0() bfin_read32(SPORT3_MRCS0)
417#define bfin_write_SPORT3_MRCS0(val) bfin_write32(SPORT3_MRCS0, val)
418#define bfin_read_SPORT3_MRCS1() bfin_read32(SPORT3_MRCS1)
419#define bfin_write_SPORT3_MRCS1(val) bfin_write32(SPORT3_MRCS1, val)
420#define bfin_read_SPORT3_MRCS2() bfin_read32(SPORT3_MRCS2)
421#define bfin_write_SPORT3_MRCS2(val) bfin_write32(SPORT3_MRCS2, val)
422#define bfin_read_SPORT3_MRCS3() bfin_read32(SPORT3_MRCS3)
423#define bfin_write_SPORT3_MRCS3(val) bfin_write32(SPORT3_MRCS3, val)
424#define bfin_read_PORTFIO() bfin_read16(PORTFIO)
425#define bfin_write_PORTFIO(val) bfin_write16(PORTFIO, val)
426#define bfin_read_PORTFIO_CLEAR() bfin_read16(PORTFIO_CLEAR)
427#define bfin_write_PORTFIO_CLEAR(val) bfin_write16(PORTFIO_CLEAR, val)
428#define bfin_read_PORTFIO_SET() bfin_read16(PORTFIO_SET)
429#define bfin_write_PORTFIO_SET(val) bfin_write16(PORTFIO_SET, val)
430#define bfin_read_PORTFIO_TOGGLE() bfin_read16(PORTFIO_TOGGLE)
431#define bfin_write_PORTFIO_TOGGLE(val) bfin_write16(PORTFIO_TOGGLE, val)
432#define bfin_read_PORTFIO_MASKA() bfin_read16(PORTFIO_MASKA)
433#define bfin_write_PORTFIO_MASKA(val) bfin_write16(PORTFIO_MASKA, val)
434#define bfin_read_PORTFIO_MASKA_CLEAR() bfin_read16(PORTFIO_MASKA_CLEAR)
435#define bfin_write_PORTFIO_MASKA_CLEAR(val) bfin_write16(PORTFIO_MASKA_CLEAR, val)
436#define bfin_read_PORTFIO_MASKA_SET() bfin_read16(PORTFIO_MASKA_SET)
437#define bfin_write_PORTFIO_MASKA_SET(val) bfin_write16(PORTFIO_MASKA_SET, val)
438#define bfin_read_PORTFIO_MASKA_TOGGLE() bfin_read16(PORTFIO_MASKA_TOGGLE)
439#define bfin_write_PORTFIO_MASKA_TOGGLE(val) bfin_write16(PORTFIO_MASKA_TOGGLE, val)
440#define bfin_read_PORTFIO_MASKB() bfin_read16(PORTFIO_MASKB)
441#define bfin_write_PORTFIO_MASKB(val) bfin_write16(PORTFIO_MASKB, val)
442#define bfin_read_PORTFIO_MASKB_CLEAR() bfin_read16(PORTFIO_MASKB_CLEAR)
443#define bfin_write_PORTFIO_MASKB_CLEAR(val) bfin_write16(PORTFIO_MASKB_CLEAR, val)
444#define bfin_read_PORTFIO_MASKB_SET() bfin_read16(PORTFIO_MASKB_SET)
445#define bfin_write_PORTFIO_MASKB_SET(val) bfin_write16(PORTFIO_MASKB_SET, val)
446#define bfin_read_PORTFIO_MASKB_TOGGLE() bfin_read16(PORTFIO_MASKB_TOGGLE)
447#define bfin_write_PORTFIO_MASKB_TOGGLE(val) bfin_write16(PORTFIO_MASKB_TOGGLE, val)
448#define bfin_read_PORTFIO_DIR() bfin_read16(PORTFIO_DIR)
449#define bfin_write_PORTFIO_DIR(val) bfin_write16(PORTFIO_DIR, val)
450#define bfin_read_PORTFIO_POLAR() bfin_read16(PORTFIO_POLAR)
451#define bfin_write_PORTFIO_POLAR(val) bfin_write16(PORTFIO_POLAR, val)
452#define bfin_read_PORTFIO_EDGE() bfin_read16(PORTFIO_EDGE)
453#define bfin_write_PORTFIO_EDGE(val) bfin_write16(PORTFIO_EDGE, val)
454#define bfin_read_PORTFIO_BOTH() bfin_read16(PORTFIO_BOTH)
455#define bfin_write_PORTFIO_BOTH(val) bfin_write16(PORTFIO_BOTH, val)
456#define bfin_read_PORTFIO_INEN() bfin_read16(PORTFIO_INEN)
457#define bfin_write_PORTFIO_INEN(val) bfin_write16(PORTFIO_INEN, val)
458#define bfin_read_PORTCIO_FER() bfin_read16(PORTCIO_FER)
459#define bfin_write_PORTCIO_FER(val) bfin_write16(PORTCIO_FER, val)
460#define bfin_read_PORTCIO() bfin_read16(PORTCIO)
461#define bfin_write_PORTCIO(val) bfin_write16(PORTCIO, val)
462#define bfin_read_PORTCIO_CLEAR() bfin_read16(PORTCIO_CLEAR)
463#define bfin_write_PORTCIO_CLEAR(val) bfin_write16(PORTCIO_CLEAR, val)
464#define bfin_read_PORTCIO_SET() bfin_read16(PORTCIO_SET)
465#define bfin_write_PORTCIO_SET(val) bfin_write16(PORTCIO_SET, val)
466#define bfin_read_PORTCIO_TOGGLE() bfin_read16(PORTCIO_TOGGLE)
467#define bfin_write_PORTCIO_TOGGLE(val) bfin_write16(PORTCIO_TOGGLE, val)
468#define bfin_read_PORTCIO_DIR() bfin_read16(PORTCIO_DIR)
469#define bfin_write_PORTCIO_DIR(val) bfin_write16(PORTCIO_DIR, val)
470#define bfin_read_PORTCIO_INEN() bfin_read16(PORTCIO_INEN)
471#define bfin_write_PORTCIO_INEN(val) bfin_write16(PORTCIO_INEN, val)
472#define bfin_read_PORTDIO_FER() bfin_read16(PORTDIO_FER)
473#define bfin_write_PORTDIO_FER(val) bfin_write16(PORTDIO_FER, val)
474#define bfin_read_PORTDIO() bfin_read16(PORTDIO)
475#define bfin_write_PORTDIO(val) bfin_write16(PORTDIO, val)
476#define bfin_read_PORTDIO_CLEAR() bfin_read16(PORTDIO_CLEAR)
477#define bfin_write_PORTDIO_CLEAR(val) bfin_write16(PORTDIO_CLEAR, val)
478#define bfin_read_PORTDIO_SET() bfin_read16(PORTDIO_SET)
479#define bfin_write_PORTDIO_SET(val) bfin_write16(PORTDIO_SET, val)
480#define bfin_read_PORTDIO_TOGGLE() bfin_read16(PORTDIO_TOGGLE)
481#define bfin_write_PORTDIO_TOGGLE(val) bfin_write16(PORTDIO_TOGGLE, val)
482#define bfin_read_PORTDIO_DIR() bfin_read16(PORTDIO_DIR)
483#define bfin_write_PORTDIO_DIR(val) bfin_write16(PORTDIO_DIR, val)
484#define bfin_read_PORTDIO_INEN() bfin_read16(PORTDIO_INEN)
485#define bfin_write_PORTDIO_INEN(val) bfin_write16(PORTDIO_INEN, val)
486#define bfin_read_PORTEIO_FER() bfin_read16(PORTEIO_FER)
487#define bfin_write_PORTEIO_FER(val) bfin_write16(PORTEIO_FER, val)
488#define bfin_read_PORTEIO() bfin_read16(PORTEIO)
489#define bfin_write_PORTEIO(val) bfin_write16(PORTEIO, val)
490#define bfin_read_PORTEIO_CLEAR() bfin_read16(PORTEIO_CLEAR)
491#define bfin_write_PORTEIO_CLEAR(val) bfin_write16(PORTEIO_CLEAR, val)
492#define bfin_read_PORTEIO_SET() bfin_read16(PORTEIO_SET)
493#define bfin_write_PORTEIO_SET(val) bfin_write16(PORTEIO_SET, val)
494#define bfin_read_PORTEIO_TOGGLE() bfin_read16(PORTEIO_TOGGLE)
495#define bfin_write_PORTEIO_TOGGLE(val) bfin_write16(PORTEIO_TOGGLE, val)
496#define bfin_read_PORTEIO_DIR() bfin_read16(PORTEIO_DIR)
497#define bfin_write_PORTEIO_DIR(val) bfin_write16(PORTEIO_DIR, val)
498#define bfin_read_PORTEIO_INEN() bfin_read16(PORTEIO_INEN)
499#define bfin_write_PORTEIO_INEN(val) bfin_write16(PORTEIO_INEN, val)
500#define bfin_read_EBIU_AMGCTL() bfin_read16(EBIU_AMGCTL)
501#define bfin_write_EBIU_AMGCTL(val) bfin_write16(EBIU_AMGCTL, val)
502#define bfin_read_EBIU_AMBCTL0() bfin_read32(EBIU_AMBCTL0)
503#define bfin_write_EBIU_AMBCTL0(val) bfin_write32(EBIU_AMBCTL0, val)
504#define bfin_read_EBIU_AMBCTL1() bfin_read32(EBIU_AMBCTL1)
505#define bfin_write_EBIU_AMBCTL1(val) bfin_write32(EBIU_AMBCTL1, val)
506#define bfin_read_EBIU_SDGCTL() bfin_read32(EBIU_SDGCTL)
507#define bfin_write_EBIU_SDGCTL(val) bfin_write32(EBIU_SDGCTL, val)
508#define bfin_read_EBIU_SDBCTL() bfin_read16(EBIU_SDBCTL)
509#define bfin_write_EBIU_SDBCTL(val) bfin_write16(EBIU_SDBCTL, val)
510#define bfin_read_EBIU_SDRRC() bfin_read16(EBIU_SDRRC)
511#define bfin_write_EBIU_SDRRC(val) bfin_write16(EBIU_SDRRC, val)
512#define bfin_read_EBIU_SDSTAT() bfin_read16(EBIU_SDSTAT)
513#define bfin_write_EBIU_SDSTAT(val) bfin_write16(EBIU_SDSTAT, val)
514#define bfin_read_DMA0_TC_PER() bfin_read16(DMA0_TC_PER)
515#define bfin_write_DMA0_TC_PER(val) bfin_write16(DMA0_TC_PER, val)
516#define bfin_read_DMA0_TC_CNT() bfin_read16(DMA0_TC_CNT)
517#define bfin_write_DMA0_TC_CNT(val) bfin_write16(DMA0_TC_CNT, val)
518#define bfin_read_DMA0_NEXT_DESC_PTR() bfin_readPTR(DMA0_NEXT_DESC_PTR)
519#define bfin_write_DMA0_NEXT_DESC_PTR(val) bfin_writePTR(DMA0_NEXT_DESC_PTR, val)
520#define bfin_read_DMA0_START_ADDR() bfin_readPTR(DMA0_START_ADDR)
521#define bfin_write_DMA0_START_ADDR(val) bfin_writePTR(DMA0_START_ADDR, val)
522#define bfin_read_DMA0_CONFIG() bfin_read16(DMA0_CONFIG)
523#define bfin_write_DMA0_CONFIG(val) bfin_write16(DMA0_CONFIG, val)
524#define bfin_read_DMA0_X_COUNT() bfin_read16(DMA0_X_COUNT)
525#define bfin_write_DMA0_X_COUNT(val) bfin_write16(DMA0_X_COUNT, val)
526#define bfin_read_DMA0_X_MODIFY() bfin_read16(DMA0_X_MODIFY)
527#define bfin_write_DMA0_X_MODIFY(val) bfin_write16(DMA0_X_MODIFY, val)
528#define bfin_read_DMA0_Y_COUNT() bfin_read16(DMA0_Y_COUNT)
529#define bfin_write_DMA0_Y_COUNT(val) bfin_write16(DMA0_Y_COUNT, val)
530#define bfin_read_DMA0_Y_MODIFY() bfin_read16(DMA0_Y_MODIFY)
531#define bfin_write_DMA0_Y_MODIFY(val) bfin_write16(DMA0_Y_MODIFY, val)
532#define bfin_read_DMA0_CURR_DESC_PTR() bfin_readPTR(DMA0_CURR_DESC_PTR)
533#define bfin_write_DMA0_CURR_DESC_PTR(val) bfin_writePTR(DMA0_CURR_DESC_PTR, val)
534#define bfin_read_DMA0_CURR_ADDR() bfin_readPTR(DMA0_CURR_ADDR)
535#define bfin_write_DMA0_CURR_ADDR(val) bfin_writePTR(DMA0_CURR_ADDR, val)
536#define bfin_read_DMA0_IRQ_STATUS() bfin_read16(DMA0_IRQ_STATUS)
537#define bfin_write_DMA0_IRQ_STATUS(val) bfin_write16(DMA0_IRQ_STATUS, val)
538#define bfin_read_DMA0_PERIPHERAL_MAP() bfin_read16(DMA0_PERIPHERAL_MAP)
539#define bfin_write_DMA0_PERIPHERAL_MAP(val) bfin_write16(DMA0_PERIPHERAL_MAP, val)
540#define bfin_read_DMA0_CURR_X_COUNT() bfin_read16(DMA0_CURR_X_COUNT)
541#define bfin_write_DMA0_CURR_X_COUNT(val) bfin_write16(DMA0_CURR_X_COUNT, val)
542#define bfin_read_DMA0_CURR_Y_COUNT() bfin_read16(DMA0_CURR_Y_COUNT)
543#define bfin_write_DMA0_CURR_Y_COUNT(val) bfin_write16(DMA0_CURR_Y_COUNT, val)
544#define bfin_read_DMA1_NEXT_DESC_PTR() bfin_readPTR(DMA1_NEXT_DESC_PTR)
545#define bfin_write_DMA1_NEXT_DESC_PTR(val) bfin_writePTR(DMA1_NEXT_DESC_PTR, val)
546#define bfin_read_DMA1_START_ADDR() bfin_readPTR(DMA1_START_ADDR)
547#define bfin_write_DMA1_START_ADDR(val) bfin_writePTR(DMA1_START_ADDR, val)
548#define bfin_read_DMA1_CONFIG() bfin_read16(DMA1_CONFIG)
549#define bfin_write_DMA1_CONFIG(val) bfin_write16(DMA1_CONFIG, val)
550#define bfin_read_DMA1_X_COUNT() bfin_read16(DMA1_X_COUNT)
551#define bfin_write_DMA1_X_COUNT(val) bfin_write16(DMA1_X_COUNT, val)
552#define bfin_read_DMA1_X_MODIFY() bfin_read16(DMA1_X_MODIFY)
553#define bfin_write_DMA1_X_MODIFY(val) bfin_write16(DMA1_X_MODIFY, val)
554#define bfin_read_DMA1_Y_COUNT() bfin_read16(DMA1_Y_COUNT)
555#define bfin_write_DMA1_Y_COUNT(val) bfin_write16(DMA1_Y_COUNT, val)
556#define bfin_read_DMA1_Y_MODIFY() bfin_read16(DMA1_Y_MODIFY)
557#define bfin_write_DMA1_Y_MODIFY(val) bfin_write16(DMA1_Y_MODIFY, val)
558#define bfin_read_DMA1_CURR_DESC_PTR() bfin_readPTR(DMA1_CURR_DESC_PTR)
559#define bfin_write_DMA1_CURR_DESC_PTR(val) bfin_writePTR(DMA1_CURR_DESC_PTR, val)
560#define bfin_read_DMA1_CURR_ADDR() bfin_readPTR(DMA1_CURR_ADDR)
561#define bfin_write_DMA1_CURR_ADDR(val) bfin_writePTR(DMA1_CURR_ADDR, val)
562#define bfin_read_DMA1_IRQ_STATUS() bfin_read16(DMA1_IRQ_STATUS)
563#define bfin_write_DMA1_IRQ_STATUS(val) bfin_write16(DMA1_IRQ_STATUS, val)
564#define bfin_read_DMA1_PERIPHERAL_MAP() bfin_read16(DMA1_PERIPHERAL_MAP)
565#define bfin_write_DMA1_PERIPHERAL_MAP(val) bfin_write16(DMA1_PERIPHERAL_MAP, val)
566#define bfin_read_DMA1_CURR_X_COUNT() bfin_read16(DMA1_CURR_X_COUNT)
567#define bfin_write_DMA1_CURR_X_COUNT(val) bfin_write16(DMA1_CURR_X_COUNT, val)
568#define bfin_read_DMA1_CURR_Y_COUNT() bfin_read16(DMA1_CURR_Y_COUNT)
569#define bfin_write_DMA1_CURR_Y_COUNT(val) bfin_write16(DMA1_CURR_Y_COUNT, val)
570#define bfin_read_DMA2_NEXT_DESC_PTR() bfin_readPTR(DMA2_NEXT_DESC_PTR)
571#define bfin_write_DMA2_NEXT_DESC_PTR(val) bfin_writePTR(DMA2_NEXT_DESC_PTR, val)
572#define bfin_read_DMA2_START_ADDR() bfin_readPTR(DMA2_START_ADDR)
573#define bfin_write_DMA2_START_ADDR(val) bfin_writePTR(DMA2_START_ADDR, val)
574#define bfin_read_DMA2_CONFIG() bfin_read16(DMA2_CONFIG)
575#define bfin_write_DMA2_CONFIG(val) bfin_write16(DMA2_CONFIG, val)
576#define bfin_read_DMA2_X_COUNT() bfin_read16(DMA2_X_COUNT)
577#define bfin_write_DMA2_X_COUNT(val) bfin_write16(DMA2_X_COUNT, val)
578#define bfin_read_DMA2_X_MODIFY() bfin_read16(DMA2_X_MODIFY)
579#define bfin_write_DMA2_X_MODIFY(val) bfin_write16(DMA2_X_MODIFY, val)
580#define bfin_read_DMA2_Y_COUNT() bfin_read16(DMA2_Y_COUNT)
581#define bfin_write_DMA2_Y_COUNT(val) bfin_write16(DMA2_Y_COUNT, val)
582#define bfin_read_DMA2_Y_MODIFY() bfin_read16(DMA2_Y_MODIFY)
583#define bfin_write_DMA2_Y_MODIFY(val) bfin_write16(DMA2_Y_MODIFY, val)
584#define bfin_read_DMA2_CURR_DESC_PTR() bfin_readPTR(DMA2_CURR_DESC_PTR)
585#define bfin_write_DMA2_CURR_DESC_PTR(val) bfin_writePTR(DMA2_CURR_DESC_PTR, val)
586#define bfin_read_DMA2_CURR_ADDR() bfin_readPTR(DMA2_CURR_ADDR)
587#define bfin_write_DMA2_CURR_ADDR(val) bfin_writePTR(DMA2_CURR_ADDR, val)
588#define bfin_read_DMA2_IRQ_STATUS() bfin_read16(DMA2_IRQ_STATUS)
589#define bfin_write_DMA2_IRQ_STATUS(val) bfin_write16(DMA2_IRQ_STATUS, val)
590#define bfin_read_DMA2_PERIPHERAL_MAP() bfin_read16(DMA2_PERIPHERAL_MAP)
591#define bfin_write_DMA2_PERIPHERAL_MAP(val) bfin_write16(DMA2_PERIPHERAL_MAP, val)
592#define bfin_read_DMA2_CURR_X_COUNT() bfin_read16(DMA2_CURR_X_COUNT)
593#define bfin_write_DMA2_CURR_X_COUNT(val) bfin_write16(DMA2_CURR_X_COUNT, val)
594#define bfin_read_DMA2_CURR_Y_COUNT() bfin_read16(DMA2_CURR_Y_COUNT)
595#define bfin_write_DMA2_CURR_Y_COUNT(val) bfin_write16(DMA2_CURR_Y_COUNT, val)
596#define bfin_read_DMA3_NEXT_DESC_PTR() bfin_readPTR(DMA3_NEXT_DESC_PTR)
597#define bfin_write_DMA3_NEXT_DESC_PTR(val) bfin_writePTR(DMA3_NEXT_DESC_PTR, val)
598#define bfin_read_DMA3_START_ADDR() bfin_readPTR(DMA3_START_ADDR)
599#define bfin_write_DMA3_START_ADDR(val) bfin_writePTR(DMA3_START_ADDR, val)
600#define bfin_read_DMA3_CONFIG() bfin_read16(DMA3_CONFIG)
601#define bfin_write_DMA3_CONFIG(val) bfin_write16(DMA3_CONFIG, val)
602#define bfin_read_DMA3_X_COUNT() bfin_read16(DMA3_X_COUNT)
603#define bfin_write_DMA3_X_COUNT(val) bfin_write16(DMA3_X_COUNT, val)
604#define bfin_read_DMA3_X_MODIFY() bfin_read16(DMA3_X_MODIFY)
605#define bfin_write_DMA3_X_MODIFY(val) bfin_write16(DMA3_X_MODIFY, val)
606#define bfin_read_DMA3_Y_COUNT() bfin_read16(DMA3_Y_COUNT)
607#define bfin_write_DMA3_Y_COUNT(val) bfin_write16(DMA3_Y_COUNT, val)
608#define bfin_read_DMA3_Y_MODIFY() bfin_read16(DMA3_Y_MODIFY)
609#define bfin_write_DMA3_Y_MODIFY(val) bfin_write16(DMA3_Y_MODIFY, val)
610#define bfin_read_DMA3_CURR_DESC_PTR() bfin_readPTR(DMA3_CURR_DESC_PTR)
611#define bfin_write_DMA3_CURR_DESC_PTR(val) bfin_writePTR(DMA3_CURR_DESC_PTR, val)
612#define bfin_read_DMA3_CURR_ADDR() bfin_readPTR(DMA3_CURR_ADDR)
613#define bfin_write_DMA3_CURR_ADDR(val) bfin_writePTR(DMA3_CURR_ADDR, val)
614#define bfin_read_DMA3_IRQ_STATUS() bfin_read16(DMA3_IRQ_STATUS)
615#define bfin_write_DMA3_IRQ_STATUS(val) bfin_write16(DMA3_IRQ_STATUS, val)
616#define bfin_read_DMA3_PERIPHERAL_MAP() bfin_read16(DMA3_PERIPHERAL_MAP)
617#define bfin_write_DMA3_PERIPHERAL_MAP(val) bfin_write16(DMA3_PERIPHERAL_MAP, val)
618#define bfin_read_DMA3_CURR_X_COUNT() bfin_read16(DMA3_CURR_X_COUNT)
619#define bfin_write_DMA3_CURR_X_COUNT(val) bfin_write16(DMA3_CURR_X_COUNT, val)
620#define bfin_read_DMA3_CURR_Y_COUNT() bfin_read16(DMA3_CURR_Y_COUNT)
621#define bfin_write_DMA3_CURR_Y_COUNT(val) bfin_write16(DMA3_CURR_Y_COUNT, val)
622#define bfin_read_DMA4_NEXT_DESC_PTR() bfin_readPTR(DMA4_NEXT_DESC_PTR)
623#define bfin_write_DMA4_NEXT_DESC_PTR(val) bfin_writePTR(DMA4_NEXT_DESC_PTR, val)
624#define bfin_read_DMA4_START_ADDR() bfin_readPTR(DMA4_START_ADDR)
625#define bfin_write_DMA4_START_ADDR(val) bfin_writePTR(DMA4_START_ADDR, val)
626#define bfin_read_DMA4_CONFIG() bfin_read16(DMA4_CONFIG)
627#define bfin_write_DMA4_CONFIG(val) bfin_write16(DMA4_CONFIG, val)
628#define bfin_read_DMA4_X_COUNT() bfin_read16(DMA4_X_COUNT)
629#define bfin_write_DMA4_X_COUNT(val) bfin_write16(DMA4_X_COUNT, val)
630#define bfin_read_DMA4_X_MODIFY() bfin_read16(DMA4_X_MODIFY)
631#define bfin_write_DMA4_X_MODIFY(val) bfin_write16(DMA4_X_MODIFY, val)
632#define bfin_read_DMA4_Y_COUNT() bfin_read16(DMA4_Y_COUNT)
633#define bfin_write_DMA4_Y_COUNT(val) bfin_write16(DMA4_Y_COUNT, val)
634#define bfin_read_DMA4_Y_MODIFY() bfin_read16(DMA4_Y_MODIFY)
635#define bfin_write_DMA4_Y_MODIFY(val) bfin_write16(DMA4_Y_MODIFY, val)
636#define bfin_read_DMA4_CURR_DESC_PTR() bfin_readPTR(DMA4_CURR_DESC_PTR)
637#define bfin_write_DMA4_CURR_DESC_PTR(val) bfin_writePTR(DMA4_CURR_DESC_PTR, val)
638#define bfin_read_DMA4_CURR_ADDR() bfin_readPTR(DMA4_CURR_ADDR)
639#define bfin_write_DMA4_CURR_ADDR(val) bfin_writePTR(DMA4_CURR_ADDR, val)
640#define bfin_read_DMA4_IRQ_STATUS() bfin_read16(DMA4_IRQ_STATUS)
641#define bfin_write_DMA4_IRQ_STATUS(val) bfin_write16(DMA4_IRQ_STATUS, val)
642#define bfin_read_DMA4_PERIPHERAL_MAP() bfin_read16(DMA4_PERIPHERAL_MAP)
643#define bfin_write_DMA4_PERIPHERAL_MAP(val) bfin_write16(DMA4_PERIPHERAL_MAP, val)
644#define bfin_read_DMA4_CURR_X_COUNT() bfin_read16(DMA4_CURR_X_COUNT)
645#define bfin_write_DMA4_CURR_X_COUNT(val) bfin_write16(DMA4_CURR_X_COUNT, val)
646#define bfin_read_DMA4_CURR_Y_COUNT() bfin_read16(DMA4_CURR_Y_COUNT)
647#define bfin_write_DMA4_CURR_Y_COUNT(val) bfin_write16(DMA4_CURR_Y_COUNT, val)
648#define bfin_read_DMA5_NEXT_DESC_PTR() bfin_readPTR(DMA5_NEXT_DESC_PTR)
649#define bfin_write_DMA5_NEXT_DESC_PTR(val) bfin_writePTR(DMA5_NEXT_DESC_PTR, val)
650#define bfin_read_DMA5_START_ADDR() bfin_readPTR(DMA5_START_ADDR)
651#define bfin_write_DMA5_START_ADDR(val) bfin_writePTR(DMA5_START_ADDR, val)
652#define bfin_read_DMA5_CONFIG() bfin_read16(DMA5_CONFIG)
653#define bfin_write_DMA5_CONFIG(val) bfin_write16(DMA5_CONFIG, val)
654#define bfin_read_DMA5_X_COUNT() bfin_read16(DMA5_X_COUNT)
655#define bfin_write_DMA5_X_COUNT(val) bfin_write16(DMA5_X_COUNT, val)
656#define bfin_read_DMA5_X_MODIFY() bfin_read16(DMA5_X_MODIFY)
657#define bfin_write_DMA5_X_MODIFY(val) bfin_write16(DMA5_X_MODIFY, val)
658#define bfin_read_DMA5_Y_COUNT() bfin_read16(DMA5_Y_COUNT)
659#define bfin_write_DMA5_Y_COUNT(val) bfin_write16(DMA5_Y_COUNT, val)
660#define bfin_read_DMA5_Y_MODIFY() bfin_read16(DMA5_Y_MODIFY)
661#define bfin_write_DMA5_Y_MODIFY(val) bfin_write16(DMA5_Y_MODIFY, val)
662#define bfin_read_DMA5_CURR_DESC_PTR() bfin_readPTR(DMA5_CURR_DESC_PTR)
663#define bfin_write_DMA5_CURR_DESC_PTR(val) bfin_writePTR(DMA5_CURR_DESC_PTR, val)
664#define bfin_read_DMA5_CURR_ADDR() bfin_readPTR(DMA5_CURR_ADDR)
665#define bfin_write_DMA5_CURR_ADDR(val) bfin_writePTR(DMA5_CURR_ADDR, val)
666#define bfin_read_DMA5_IRQ_STATUS() bfin_read16(DMA5_IRQ_STATUS)
667#define bfin_write_DMA5_IRQ_STATUS(val) bfin_write16(DMA5_IRQ_STATUS, val)
668#define bfin_read_DMA5_PERIPHERAL_MAP() bfin_read16(DMA5_PERIPHERAL_MAP)
669#define bfin_write_DMA5_PERIPHERAL_MAP(val) bfin_write16(DMA5_PERIPHERAL_MAP, val)
670#define bfin_read_DMA5_CURR_X_COUNT() bfin_read16(DMA5_CURR_X_COUNT)
671#define bfin_write_DMA5_CURR_X_COUNT(val) bfin_write16(DMA5_CURR_X_COUNT, val)
672#define bfin_read_DMA5_CURR_Y_COUNT() bfin_read16(DMA5_CURR_Y_COUNT)
673#define bfin_write_DMA5_CURR_Y_COUNT(val) bfin_write16(DMA5_CURR_Y_COUNT, val)
674#define bfin_read_DMA6_NEXT_DESC_PTR() bfin_readPTR(DMA6_NEXT_DESC_PTR)
675#define bfin_write_DMA6_NEXT_DESC_PTR(val) bfin_writePTR(DMA6_NEXT_DESC_PTR, val)
676#define bfin_read_DMA6_START_ADDR() bfin_readPTR(DMA6_START_ADDR)
677#define bfin_write_DMA6_START_ADDR(val) bfin_writePTR(DMA6_START_ADDR, val)
678#define bfin_read_DMA6_CONFIG() bfin_read16(DMA6_CONFIG)
679#define bfin_write_DMA6_CONFIG(val) bfin_write16(DMA6_CONFIG, val)
680#define bfin_read_DMA6_X_COUNT() bfin_read16(DMA6_X_COUNT)
681#define bfin_write_DMA6_X_COUNT(val) bfin_write16(DMA6_X_COUNT, val)
682#define bfin_read_DMA6_X_MODIFY() bfin_read16(DMA6_X_MODIFY)
683#define bfin_write_DMA6_X_MODIFY(val) bfin_write16(DMA6_X_MODIFY, val)
684#define bfin_read_DMA6_Y_COUNT() bfin_read16(DMA6_Y_COUNT)
685#define bfin_write_DMA6_Y_COUNT(val) bfin_write16(DMA6_Y_COUNT, val)
686#define bfin_read_DMA6_Y_MODIFY() bfin_read16(DMA6_Y_MODIFY)
687#define bfin_write_DMA6_Y_MODIFY(val) bfin_write16(DMA6_Y_MODIFY, val)
688#define bfin_read_DMA6_CURR_DESC_PTR() bfin_readPTR(DMA6_CURR_DESC_PTR)
689#define bfin_write_DMA6_CURR_DESC_PTR(val) bfin_writePTR(DMA6_CURR_DESC_PTR, val)
690#define bfin_read_DMA6_CURR_ADDR() bfin_readPTR(DMA6_CURR_ADDR)
691#define bfin_write_DMA6_CURR_ADDR(val) bfin_writePTR(DMA6_CURR_ADDR, val)
692#define bfin_read_DMA6_IRQ_STATUS() bfin_read16(DMA6_IRQ_STATUS)
693#define bfin_write_DMA6_IRQ_STATUS(val) bfin_write16(DMA6_IRQ_STATUS, val)
694#define bfin_read_DMA6_PERIPHERAL_MAP() bfin_read16(DMA6_PERIPHERAL_MAP)
695#define bfin_write_DMA6_PERIPHERAL_MAP(val) bfin_write16(DMA6_PERIPHERAL_MAP, val)
696#define bfin_read_DMA6_CURR_X_COUNT() bfin_read16(DMA6_CURR_X_COUNT)
697#define bfin_write_DMA6_CURR_X_COUNT(val) bfin_write16(DMA6_CURR_X_COUNT, val)
698#define bfin_read_DMA6_CURR_Y_COUNT() bfin_read16(DMA6_CURR_Y_COUNT)
699#define bfin_write_DMA6_CURR_Y_COUNT(val) bfin_write16(DMA6_CURR_Y_COUNT, val)
700#define bfin_read_DMA7_NEXT_DESC_PTR() bfin_readPTR(DMA7_NEXT_DESC_PTR)
701#define bfin_write_DMA7_NEXT_DESC_PTR(val) bfin_writePTR(DMA7_NEXT_DESC_PTR, val)
702#define bfin_read_DMA7_START_ADDR() bfin_readPTR(DMA7_START_ADDR)
703#define bfin_write_DMA7_START_ADDR(val) bfin_writePTR(DMA7_START_ADDR, val)
704#define bfin_read_DMA7_CONFIG() bfin_read16(DMA7_CONFIG)
705#define bfin_write_DMA7_CONFIG(val) bfin_write16(DMA7_CONFIG, val)
706#define bfin_read_DMA7_X_COUNT() bfin_read16(DMA7_X_COUNT)
707#define bfin_write_DMA7_X_COUNT(val) bfin_write16(DMA7_X_COUNT, val)
708#define bfin_read_DMA7_X_MODIFY() bfin_read16(DMA7_X_MODIFY)
709#define bfin_write_DMA7_X_MODIFY(val) bfin_write16(DMA7_X_MODIFY, val)
710#define bfin_read_DMA7_Y_COUNT() bfin_read16(DMA7_Y_COUNT)
711#define bfin_write_DMA7_Y_COUNT(val) bfin_write16(DMA7_Y_COUNT, val)
712#define bfin_read_DMA7_Y_MODIFY() bfin_read16(DMA7_Y_MODIFY)
713#define bfin_write_DMA7_Y_MODIFY(val) bfin_write16(DMA7_Y_MODIFY, val)
714#define bfin_read_DMA7_CURR_DESC_PTR() bfin_readPTR(DMA7_CURR_DESC_PTR)
715#define bfin_write_DMA7_CURR_DESC_PTR(val) bfin_writePTR(DMA7_CURR_DESC_PTR, val)
716#define bfin_read_DMA7_CURR_ADDR() bfin_readPTR(DMA7_CURR_ADDR)
717#define bfin_write_DMA7_CURR_ADDR(val) bfin_writePTR(DMA7_CURR_ADDR, val)
718#define bfin_read_DMA7_IRQ_STATUS() bfin_read16(DMA7_IRQ_STATUS)
719#define bfin_write_DMA7_IRQ_STATUS(val) bfin_write16(DMA7_IRQ_STATUS, val)
720#define bfin_read_DMA7_PERIPHERAL_MAP() bfin_read16(DMA7_PERIPHERAL_MAP)
721#define bfin_write_DMA7_PERIPHERAL_MAP(val) bfin_write16(DMA7_PERIPHERAL_MAP, val)
722#define bfin_read_DMA7_CURR_X_COUNT() bfin_read16(DMA7_CURR_X_COUNT)
723#define bfin_write_DMA7_CURR_X_COUNT(val) bfin_write16(DMA7_CURR_X_COUNT, val)
724#define bfin_read_DMA7_CURR_Y_COUNT() bfin_read16(DMA7_CURR_Y_COUNT)
725#define bfin_write_DMA7_CURR_Y_COUNT(val) bfin_write16(DMA7_CURR_Y_COUNT, val)
726#define bfin_read_DMA1_TC_PER() bfin_read16(DMA1_TC_PER)
727#define bfin_write_DMA1_TC_PER(val) bfin_write16(DMA1_TC_PER, val)
728#define bfin_read_DMA1_TC_CNT() bfin_read16(DMA1_TC_CNT)
729#define bfin_write_DMA1_TC_CNT(val) bfin_write16(DMA1_TC_CNT, val)
730#define bfin_read_DMA8_NEXT_DESC_PTR() bfin_readPTR(DMA8_NEXT_DESC_PTR)
731#define bfin_write_DMA8_NEXT_DESC_PTR(val) bfin_writePTR(DMA8_NEXT_DESC_PTR, val)
732#define bfin_read_DMA8_START_ADDR() bfin_readPTR(DMA8_START_ADDR)
733#define bfin_write_DMA8_START_ADDR(val) bfin_writePTR(DMA8_START_ADDR, val)
734#define bfin_read_DMA8_CONFIG() bfin_read16(DMA8_CONFIG)
735#define bfin_write_DMA8_CONFIG(val) bfin_write16(DMA8_CONFIG, val)
736#define bfin_read_DMA8_X_COUNT() bfin_read16(DMA8_X_COUNT)
737#define bfin_write_DMA8_X_COUNT(val) bfin_write16(DMA8_X_COUNT, val)
738#define bfin_read_DMA8_X_MODIFY() bfin_read16(DMA8_X_MODIFY)
739#define bfin_write_DMA8_X_MODIFY(val) bfin_write16(DMA8_X_MODIFY, val)
740#define bfin_read_DMA8_Y_COUNT() bfin_read16(DMA8_Y_COUNT)
741#define bfin_write_DMA8_Y_COUNT(val) bfin_write16(DMA8_Y_COUNT, val)
742#define bfin_read_DMA8_Y_MODIFY() bfin_read16(DMA8_Y_MODIFY)
743#define bfin_write_DMA8_Y_MODIFY(val) bfin_write16(DMA8_Y_MODIFY, val)
744#define bfin_read_DMA8_CURR_DESC_PTR() bfin_readPTR(DMA8_CURR_DESC_PTR)
745#define bfin_write_DMA8_CURR_DESC_PTR(val) bfin_writePTR(DMA8_CURR_DESC_PTR, val)
746#define bfin_read_DMA8_CURR_ADDR() bfin_readPTR(DMA8_CURR_ADDR)
747#define bfin_write_DMA8_CURR_ADDR(val) bfin_writePTR(DMA8_CURR_ADDR, val)
748#define bfin_read_DMA8_IRQ_STATUS() bfin_read16(DMA8_IRQ_STATUS)
749#define bfin_write_DMA8_IRQ_STATUS(val) bfin_write16(DMA8_IRQ_STATUS, val)
750#define bfin_read_DMA8_PERIPHERAL_MAP() bfin_read16(DMA8_PERIPHERAL_MAP)
751#define bfin_write_DMA8_PERIPHERAL_MAP(val) bfin_write16(DMA8_PERIPHERAL_MAP, val)
752#define bfin_read_DMA8_CURR_X_COUNT() bfin_read16(DMA8_CURR_X_COUNT)
753#define bfin_write_DMA8_CURR_X_COUNT(val) bfin_write16(DMA8_CURR_X_COUNT, val)
754#define bfin_read_DMA8_CURR_Y_COUNT() bfin_read16(DMA8_CURR_Y_COUNT)
755#define bfin_write_DMA8_CURR_Y_COUNT(val) bfin_write16(DMA8_CURR_Y_COUNT, val)
756#define bfin_read_DMA9_NEXT_DESC_PTR() bfin_readPTR(DMA9_NEXT_DESC_PTR)
757#define bfin_write_DMA9_NEXT_DESC_PTR(val) bfin_writePTR(DMA9_NEXT_DESC_PTR, val)
758#define bfin_read_DMA9_START_ADDR() bfin_readPTR(DMA9_START_ADDR)
759#define bfin_write_DMA9_START_ADDR(val) bfin_writePTR(DMA9_START_ADDR, val)
760#define bfin_read_DMA9_CONFIG() bfin_read16(DMA9_CONFIG)
761#define bfin_write_DMA9_CONFIG(val) bfin_write16(DMA9_CONFIG, val)
762#define bfin_read_DMA9_X_COUNT() bfin_read16(DMA9_X_COUNT)
763#define bfin_write_DMA9_X_COUNT(val) bfin_write16(DMA9_X_COUNT, val)
764#define bfin_read_DMA9_X_MODIFY() bfin_read16(DMA9_X_MODIFY)
765#define bfin_write_DMA9_X_MODIFY(val) bfin_write16(DMA9_X_MODIFY, val)
766#define bfin_read_DMA9_Y_COUNT() bfin_read16(DMA9_Y_COUNT)
767#define bfin_write_DMA9_Y_COUNT(val) bfin_write16(DMA9_Y_COUNT, val)
768#define bfin_read_DMA9_Y_MODIFY() bfin_read16(DMA9_Y_MODIFY)
769#define bfin_write_DMA9_Y_MODIFY(val) bfin_write16(DMA9_Y_MODIFY, val)
770#define bfin_read_DMA9_CURR_DESC_PTR() bfin_readPTR(DMA9_CURR_DESC_PTR)
771#define bfin_write_DMA9_CURR_DESC_PTR(val) bfin_writePTR(DMA9_CURR_DESC_PTR, val)
772#define bfin_read_DMA9_CURR_ADDR() bfin_readPTR(DMA9_CURR_ADDR)
773#define bfin_write_DMA9_CURR_ADDR(val) bfin_writePTR(DMA9_CURR_ADDR, val)
774#define bfin_read_DMA9_IRQ_STATUS() bfin_read16(DMA9_IRQ_STATUS)
775#define bfin_write_DMA9_IRQ_STATUS(val) bfin_write16(DMA9_IRQ_STATUS, val)
776#define bfin_read_DMA9_PERIPHERAL_MAP() bfin_read16(DMA9_PERIPHERAL_MAP)
777#define bfin_write_DMA9_PERIPHERAL_MAP(val) bfin_write16(DMA9_PERIPHERAL_MAP, val)
778#define bfin_read_DMA9_CURR_X_COUNT() bfin_read16(DMA9_CURR_X_COUNT)
779#define bfin_write_DMA9_CURR_X_COUNT(val) bfin_write16(DMA9_CURR_X_COUNT, val)
780#define bfin_read_DMA9_CURR_Y_COUNT() bfin_read16(DMA9_CURR_Y_COUNT)
781#define bfin_write_DMA9_CURR_Y_COUNT(val) bfin_write16(DMA9_CURR_Y_COUNT, val)
782#define bfin_read_DMA10_NEXT_DESC_PTR() bfin_readPTR(DMA10_NEXT_DESC_PTR)
783#define bfin_write_DMA10_NEXT_DESC_PTR(val) bfin_writePTR(DMA10_NEXT_DESC_PTR, val)
784#define bfin_read_DMA10_START_ADDR() bfin_readPTR(DMA10_START_ADDR)
785#define bfin_write_DMA10_START_ADDR(val) bfin_writePTR(DMA10_START_ADDR, val)
786#define bfin_read_DMA10_CONFIG() bfin_read16(DMA10_CONFIG)
787#define bfin_write_DMA10_CONFIG(val) bfin_write16(DMA10_CONFIG, val)
788#define bfin_read_DMA10_X_COUNT() bfin_read16(DMA10_X_COUNT)
789#define bfin_write_DMA10_X_COUNT(val) bfin_write16(DMA10_X_COUNT, val)
790#define bfin_read_DMA10_X_MODIFY() bfin_read16(DMA10_X_MODIFY)
791#define bfin_write_DMA10_X_MODIFY(val) bfin_write16(DMA10_X_MODIFY, val)
792#define bfin_read_DMA10_Y_COUNT() bfin_read16(DMA10_Y_COUNT)
793#define bfin_write_DMA10_Y_COUNT(val) bfin_write16(DMA10_Y_COUNT, val)
794#define bfin_read_DMA10_Y_MODIFY() bfin_read16(DMA10_Y_MODIFY)
795#define bfin_write_DMA10_Y_MODIFY(val) bfin_write16(DMA10_Y_MODIFY, val)
796#define bfin_read_DMA10_CURR_DESC_PTR() bfin_readPTR(DMA10_CURR_DESC_PTR)
797#define bfin_write_DMA10_CURR_DESC_PTR(val) bfin_writePTR(DMA10_CURR_DESC_PTR, val)
798#define bfin_read_DMA10_CURR_ADDR() bfin_readPTR(DMA10_CURR_ADDR)
799#define bfin_write_DMA10_CURR_ADDR(val) bfin_writePTR(DMA10_CURR_ADDR, val)
800#define bfin_read_DMA10_IRQ_STATUS() bfin_read16(DMA10_IRQ_STATUS)
801#define bfin_write_DMA10_IRQ_STATUS(val) bfin_write16(DMA10_IRQ_STATUS, val)
802#define bfin_read_DMA10_PERIPHERAL_MAP() bfin_read16(DMA10_PERIPHERAL_MAP)
803#define bfin_write_DMA10_PERIPHERAL_MAP(val) bfin_write16(DMA10_PERIPHERAL_MAP, val)
804#define bfin_read_DMA10_CURR_X_COUNT() bfin_read16(DMA10_CURR_X_COUNT)
805#define bfin_write_DMA10_CURR_X_COUNT(val) bfin_write16(DMA10_CURR_X_COUNT, val)
806#define bfin_read_DMA10_CURR_Y_COUNT() bfin_read16(DMA10_CURR_Y_COUNT)
807#define bfin_write_DMA10_CURR_Y_COUNT(val) bfin_write16(DMA10_CURR_Y_COUNT, val)
808#define bfin_read_DMA11_NEXT_DESC_PTR() bfin_readPTR(DMA11_NEXT_DESC_PTR)
809#define bfin_write_DMA11_NEXT_DESC_PTR(val) bfin_writePTR(DMA11_NEXT_DESC_PTR, val)
810#define bfin_read_DMA11_START_ADDR() bfin_readPTR(DMA11_START_ADDR)
811#define bfin_write_DMA11_START_ADDR(val) bfin_writePTR(DMA11_START_ADDR, val)
812#define bfin_read_DMA11_CONFIG() bfin_read16(DMA11_CONFIG)
813#define bfin_write_DMA11_CONFIG(val) bfin_write16(DMA11_CONFIG, val)
814#define bfin_read_DMA11_X_COUNT() bfin_read16(DMA11_X_COUNT)
815#define bfin_write_DMA11_X_COUNT(val) bfin_write16(DMA11_X_COUNT, val)
816#define bfin_read_DMA11_X_MODIFY() bfin_read16(DMA11_X_MODIFY)
817#define bfin_write_DMA11_X_MODIFY(val) bfin_write16(DMA11_X_MODIFY, val)
818#define bfin_read_DMA11_Y_COUNT() bfin_read16(DMA11_Y_COUNT)
819#define bfin_write_DMA11_Y_COUNT(val) bfin_write16(DMA11_Y_COUNT, val)
820#define bfin_read_DMA11_Y_MODIFY() bfin_read16(DMA11_Y_MODIFY)
821#define bfin_write_DMA11_Y_MODIFY(val) bfin_write16(DMA11_Y_MODIFY, val)
822#define bfin_read_DMA11_CURR_DESC_PTR() bfin_readPTR(DMA11_CURR_DESC_PTR)
823#define bfin_write_DMA11_CURR_DESC_PTR(val) bfin_writePTR(DMA11_CURR_DESC_PTR, val)
824#define bfin_read_DMA11_CURR_ADDR() bfin_readPTR(DMA11_CURR_ADDR)
825#define bfin_write_DMA11_CURR_ADDR(val) bfin_writePTR(DMA11_CURR_ADDR, val)
826#define bfin_read_DMA11_IRQ_STATUS() bfin_read16(DMA11_IRQ_STATUS)
827#define bfin_write_DMA11_IRQ_STATUS(val) bfin_write16(DMA11_IRQ_STATUS, val)
828#define bfin_read_DMA11_PERIPHERAL_MAP() bfin_read16(DMA11_PERIPHERAL_MAP)
829#define bfin_write_DMA11_PERIPHERAL_MAP(val) bfin_write16(DMA11_PERIPHERAL_MAP, val)
830#define bfin_read_DMA11_CURR_X_COUNT() bfin_read16(DMA11_CURR_X_COUNT)
831#define bfin_write_DMA11_CURR_X_COUNT(val) bfin_write16(DMA11_CURR_X_COUNT, val)
832#define bfin_read_DMA11_CURR_Y_COUNT() bfin_read16(DMA11_CURR_Y_COUNT)
833#define bfin_write_DMA11_CURR_Y_COUNT(val) bfin_write16(DMA11_CURR_Y_COUNT, val)
834#define bfin_read_DMA12_NEXT_DESC_PTR() bfin_readPTR(DMA12_NEXT_DESC_PTR)
835#define bfin_write_DMA12_NEXT_DESC_PTR(val) bfin_writePTR(DMA12_NEXT_DESC_PTR, val)
836#define bfin_read_DMA12_START_ADDR() bfin_readPTR(DMA12_START_ADDR)
837#define bfin_write_DMA12_START_ADDR(val) bfin_writePTR(DMA12_START_ADDR, val)
838#define bfin_read_DMA12_CONFIG() bfin_read16(DMA12_CONFIG)
839#define bfin_write_DMA12_CONFIG(val) bfin_write16(DMA12_CONFIG, val)
840#define bfin_read_DMA12_X_COUNT() bfin_read16(DMA12_X_COUNT)
841#define bfin_write_DMA12_X_COUNT(val) bfin_write16(DMA12_X_COUNT, val)
842#define bfin_read_DMA12_X_MODIFY() bfin_read16(DMA12_X_MODIFY)
843#define bfin_write_DMA12_X_MODIFY(val) bfin_write16(DMA12_X_MODIFY, val)
844#define bfin_read_DMA12_Y_COUNT() bfin_read16(DMA12_Y_COUNT)
845#define bfin_write_DMA12_Y_COUNT(val) bfin_write16(DMA12_Y_COUNT, val)
846#define bfin_read_DMA12_Y_MODIFY() bfin_read16(DMA12_Y_MODIFY)
847#define bfin_write_DMA12_Y_MODIFY(val) bfin_write16(DMA12_Y_MODIFY, val)
848#define bfin_read_DMA12_CURR_DESC_PTR() bfin_readPTR(DMA12_CURR_DESC_PTR)
849#define bfin_write_DMA12_CURR_DESC_PTR(val) bfin_writePTR(DMA12_CURR_DESC_PTR, val)
850#define bfin_read_DMA12_CURR_ADDR() bfin_readPTR(DMA12_CURR_ADDR)
851#define bfin_write_DMA12_CURR_ADDR(val) bfin_writePTR(DMA12_CURR_ADDR, val)
852#define bfin_read_DMA12_IRQ_STATUS() bfin_read16(DMA12_IRQ_STATUS)
853#define bfin_write_DMA12_IRQ_STATUS(val) bfin_write16(DMA12_IRQ_STATUS, val)
854#define bfin_read_DMA12_PERIPHERAL_MAP() bfin_read16(DMA12_PERIPHERAL_MAP)
855#define bfin_write_DMA12_PERIPHERAL_MAP(val) bfin_write16(DMA12_PERIPHERAL_MAP, val)
856#define bfin_read_DMA12_CURR_X_COUNT() bfin_read16(DMA12_CURR_X_COUNT)
857#define bfin_write_DMA12_CURR_X_COUNT(val) bfin_write16(DMA12_CURR_X_COUNT, val)
858#define bfin_read_DMA12_CURR_Y_COUNT() bfin_read16(DMA12_CURR_Y_COUNT)
859#define bfin_write_DMA12_CURR_Y_COUNT(val) bfin_write16(DMA12_CURR_Y_COUNT, val)
860#define bfin_read_DMA13_NEXT_DESC_PTR() bfin_readPTR(DMA13_NEXT_DESC_PTR)
861#define bfin_write_DMA13_NEXT_DESC_PTR(val) bfin_writePTR(DMA13_NEXT_DESC_PTR, val)
862#define bfin_read_DMA13_START_ADDR() bfin_readPTR(DMA13_START_ADDR)
863#define bfin_write_DMA13_START_ADDR(val) bfin_writePTR(DMA13_START_ADDR, val)
864#define bfin_read_DMA13_CONFIG() bfin_read16(DMA13_CONFIG)
865#define bfin_write_DMA13_CONFIG(val) bfin_write16(DMA13_CONFIG, val)
866#define bfin_read_DMA13_X_COUNT() bfin_read16(DMA13_X_COUNT)
867#define bfin_write_DMA13_X_COUNT(val) bfin_write16(DMA13_X_COUNT, val)
868#define bfin_read_DMA13_X_MODIFY() bfin_read16(DMA13_X_MODIFY)
869#define bfin_write_DMA13_X_MODIFY(val) bfin_write16(DMA13_X_MODIFY, val)
870#define bfin_read_DMA13_Y_COUNT() bfin_read16(DMA13_Y_COUNT)
871#define bfin_write_DMA13_Y_COUNT(val) bfin_write16(DMA13_Y_COUNT, val)
872#define bfin_read_DMA13_Y_MODIFY() bfin_read16(DMA13_Y_MODIFY)
873#define bfin_write_DMA13_Y_MODIFY(val) bfin_write16(DMA13_Y_MODIFY, val)
874#define bfin_read_DMA13_CURR_DESC_PTR() bfin_readPTR(DMA13_CURR_DESC_PTR)
875#define bfin_write_DMA13_CURR_DESC_PTR(val) bfin_writePTR(DMA13_CURR_DESC_PTR, val)
876#define bfin_read_DMA13_CURR_ADDR() bfin_readPTR(DMA13_CURR_ADDR)
877#define bfin_write_DMA13_CURR_ADDR(val) bfin_writePTR(DMA13_CURR_ADDR, val)
878#define bfin_read_DMA13_IRQ_STATUS() bfin_read16(DMA13_IRQ_STATUS)
879#define bfin_write_DMA13_IRQ_STATUS(val) bfin_write16(DMA13_IRQ_STATUS, val)
880#define bfin_read_DMA13_PERIPHERAL_MAP() bfin_read16(DMA13_PERIPHERAL_MAP)
881#define bfin_write_DMA13_PERIPHERAL_MAP(val) bfin_write16(DMA13_PERIPHERAL_MAP, val)
882#define bfin_read_DMA13_CURR_X_COUNT() bfin_read16(DMA13_CURR_X_COUNT)
883#define bfin_write_DMA13_CURR_X_COUNT(val) bfin_write16(DMA13_CURR_X_COUNT, val)
884#define bfin_read_DMA13_CURR_Y_COUNT() bfin_read16(DMA13_CURR_Y_COUNT)
885#define bfin_write_DMA13_CURR_Y_COUNT(val) bfin_write16(DMA13_CURR_Y_COUNT, val)
886#define bfin_read_DMA14_NEXT_DESC_PTR() bfin_readPTR(DMA14_NEXT_DESC_PTR)
887#define bfin_write_DMA14_NEXT_DESC_PTR(val) bfin_writePTR(DMA14_NEXT_DESC_PTR, val)
888#define bfin_read_DMA14_START_ADDR() bfin_readPTR(DMA14_START_ADDR)
889#define bfin_write_DMA14_START_ADDR(val) bfin_writePTR(DMA14_START_ADDR, val)
890#define bfin_read_DMA14_CONFIG() bfin_read16(DMA14_CONFIG)
891#define bfin_write_DMA14_CONFIG(val) bfin_write16(DMA14_CONFIG, val)
892#define bfin_read_DMA14_X_COUNT() bfin_read16(DMA14_X_COUNT)
893#define bfin_write_DMA14_X_COUNT(val) bfin_write16(DMA14_X_COUNT, val)
894#define bfin_read_DMA14_X_MODIFY() bfin_read16(DMA14_X_MODIFY)
895#define bfin_write_DMA14_X_MODIFY(val) bfin_write16(DMA14_X_MODIFY, val)
896#define bfin_read_DMA14_Y_COUNT() bfin_read16(DMA14_Y_COUNT)
897#define bfin_write_DMA14_Y_COUNT(val) bfin_write16(DMA14_Y_COUNT, val)
898#define bfin_read_DMA14_Y_MODIFY() bfin_read16(DMA14_Y_MODIFY)
899#define bfin_write_DMA14_Y_MODIFY(val) bfin_write16(DMA14_Y_MODIFY, val)
900#define bfin_read_DMA14_CURR_DESC_PTR() bfin_readPTR(DMA14_CURR_DESC_PTR)
901#define bfin_write_DMA14_CURR_DESC_PTR(val) bfin_writePTR(DMA14_CURR_DESC_PTR, val)
902#define bfin_read_DMA14_CURR_ADDR() bfin_readPTR(DMA14_CURR_ADDR)
903#define bfin_write_DMA14_CURR_ADDR(val) bfin_writePTR(DMA14_CURR_ADDR, val)
904#define bfin_read_DMA14_IRQ_STATUS() bfin_read16(DMA14_IRQ_STATUS)
905#define bfin_write_DMA14_IRQ_STATUS(val) bfin_write16(DMA14_IRQ_STATUS, val)
906#define bfin_read_DMA14_PERIPHERAL_MAP() bfin_read16(DMA14_PERIPHERAL_MAP)
907#define bfin_write_DMA14_PERIPHERAL_MAP(val) bfin_write16(DMA14_PERIPHERAL_MAP, val)
908#define bfin_read_DMA14_CURR_X_COUNT() bfin_read16(DMA14_CURR_X_COUNT)
909#define bfin_write_DMA14_CURR_X_COUNT(val) bfin_write16(DMA14_CURR_X_COUNT, val)
910#define bfin_read_DMA14_CURR_Y_COUNT() bfin_read16(DMA14_CURR_Y_COUNT)
911#define bfin_write_DMA14_CURR_Y_COUNT(val) bfin_write16(DMA14_CURR_Y_COUNT, val)
912#define bfin_read_DMA15_NEXT_DESC_PTR() bfin_readPTR(DMA15_NEXT_DESC_PTR)
913#define bfin_write_DMA15_NEXT_DESC_PTR(val) bfin_writePTR(DMA15_NEXT_DESC_PTR, val)
914#define bfin_read_DMA15_START_ADDR() bfin_readPTR(DMA15_START_ADDR)
915#define bfin_write_DMA15_START_ADDR(val) bfin_writePTR(DMA15_START_ADDR, val)
916#define bfin_read_DMA15_CONFIG() bfin_read16(DMA15_CONFIG)
917#define bfin_write_DMA15_CONFIG(val) bfin_write16(DMA15_CONFIG, val)
918#define bfin_read_DMA15_X_COUNT() bfin_read16(DMA15_X_COUNT)
919#define bfin_write_DMA15_X_COUNT(val) bfin_write16(DMA15_X_COUNT, val)
920#define bfin_read_DMA15_X_MODIFY() bfin_read16(DMA15_X_MODIFY)
921#define bfin_write_DMA15_X_MODIFY(val) bfin_write16(DMA15_X_MODIFY, val)
922#define bfin_read_DMA15_Y_COUNT() bfin_read16(DMA15_Y_COUNT)
923#define bfin_write_DMA15_Y_COUNT(val) bfin_write16(DMA15_Y_COUNT, val)
924#define bfin_read_DMA15_Y_MODIFY() bfin_read16(DMA15_Y_MODIFY)
925#define bfin_write_DMA15_Y_MODIFY(val) bfin_write16(DMA15_Y_MODIFY, val)
926#define bfin_read_DMA15_CURR_DESC_PTR() bfin_readPTR(DMA15_CURR_DESC_PTR)
927#define bfin_write_DMA15_CURR_DESC_PTR(val) bfin_writePTR(DMA15_CURR_DESC_PTR, val)
928#define bfin_read_DMA15_CURR_ADDR() bfin_readPTR(DMA15_CURR_ADDR)
929#define bfin_write_DMA15_CURR_ADDR(val) bfin_writePTR(DMA15_CURR_ADDR, val)
930#define bfin_read_DMA15_IRQ_STATUS() bfin_read16(DMA15_IRQ_STATUS)
931#define bfin_write_DMA15_IRQ_STATUS(val) bfin_write16(DMA15_IRQ_STATUS, val)
932#define bfin_read_DMA15_PERIPHERAL_MAP() bfin_read16(DMA15_PERIPHERAL_MAP)
933#define bfin_write_DMA15_PERIPHERAL_MAP(val) bfin_write16(DMA15_PERIPHERAL_MAP, val)
934#define bfin_read_DMA15_CURR_X_COUNT() bfin_read16(DMA15_CURR_X_COUNT)
935#define bfin_write_DMA15_CURR_X_COUNT(val) bfin_write16(DMA15_CURR_X_COUNT, val)
936#define bfin_read_DMA15_CURR_Y_COUNT() bfin_read16(DMA15_CURR_Y_COUNT)
937#define bfin_write_DMA15_CURR_Y_COUNT(val) bfin_write16(DMA15_CURR_Y_COUNT, val)
938#define bfin_read_DMA16_NEXT_DESC_PTR() bfin_readPTR(DMA16_NEXT_DESC_PTR)
939#define bfin_write_DMA16_NEXT_DESC_PTR(val) bfin_writePTR(DMA16_NEXT_DESC_PTR, val)
940#define bfin_read_DMA16_START_ADDR() bfin_readPTR(DMA16_START_ADDR)
941#define bfin_write_DMA16_START_ADDR(val) bfin_writePTR(DMA16_START_ADDR, val)
942#define bfin_read_DMA16_CONFIG() bfin_read16(DMA16_CONFIG)
943#define bfin_write_DMA16_CONFIG(val) bfin_write16(DMA16_CONFIG, val)
944#define bfin_read_DMA16_X_COUNT() bfin_read16(DMA16_X_COUNT)
945#define bfin_write_DMA16_X_COUNT(val) bfin_write16(DMA16_X_COUNT, val)
946#define bfin_read_DMA16_X_MODIFY() bfin_read16(DMA16_X_MODIFY)
947#define bfin_write_DMA16_X_MODIFY(val) bfin_write16(DMA16_X_MODIFY, val)
948#define bfin_read_DMA16_Y_COUNT() bfin_read16(DMA16_Y_COUNT)
949#define bfin_write_DMA16_Y_COUNT(val) bfin_write16(DMA16_Y_COUNT, val)
950#define bfin_read_DMA16_Y_MODIFY() bfin_read16(DMA16_Y_MODIFY)
951#define bfin_write_DMA16_Y_MODIFY(val) bfin_write16(DMA16_Y_MODIFY, val)
952#define bfin_read_DMA16_CURR_DESC_PTR() bfin_readPTR(DMA16_CURR_DESC_PTR)
953#define bfin_write_DMA16_CURR_DESC_PTR(val) bfin_writePTR(DMA16_CURR_DESC_PTR, val)
954#define bfin_read_DMA16_CURR_ADDR() bfin_readPTR(DMA16_CURR_ADDR)
955#define bfin_write_DMA16_CURR_ADDR(val) bfin_writePTR(DMA16_CURR_ADDR, val)
956#define bfin_read_DMA16_IRQ_STATUS() bfin_read16(DMA16_IRQ_STATUS)
957#define bfin_write_DMA16_IRQ_STATUS(val) bfin_write16(DMA16_IRQ_STATUS, val)
958#define bfin_read_DMA16_PERIPHERAL_MAP() bfin_read16(DMA16_PERIPHERAL_MAP)
959#define bfin_write_DMA16_PERIPHERAL_MAP(val) bfin_write16(DMA16_PERIPHERAL_MAP, val)
960#define bfin_read_DMA16_CURR_X_COUNT() bfin_read16(DMA16_CURR_X_COUNT)
961#define bfin_write_DMA16_CURR_X_COUNT(val) bfin_write16(DMA16_CURR_X_COUNT, val)
962#define bfin_read_DMA16_CURR_Y_COUNT() bfin_read16(DMA16_CURR_Y_COUNT)
963#define bfin_write_DMA16_CURR_Y_COUNT(val) bfin_write16(DMA16_CURR_Y_COUNT, val)
964#define bfin_read_DMA17_NEXT_DESC_PTR() bfin_readPTR(DMA17_NEXT_DESC_PTR)
965#define bfin_write_DMA17_NEXT_DESC_PTR(val) bfin_writePTR(DMA17_NEXT_DESC_PTR, val)
966#define bfin_read_DMA17_START_ADDR() bfin_readPTR(DMA17_START_ADDR)
967#define bfin_write_DMA17_START_ADDR(val) bfin_writePTR(DMA17_START_ADDR, val)
968#define bfin_read_DMA17_CONFIG() bfin_read16(DMA17_CONFIG)
969#define bfin_write_DMA17_CONFIG(val) bfin_write16(DMA17_CONFIG, val)
970#define bfin_read_DMA17_X_COUNT() bfin_read16(DMA17_X_COUNT)
971#define bfin_write_DMA17_X_COUNT(val) bfin_write16(DMA17_X_COUNT, val)
972#define bfin_read_DMA17_X_MODIFY() bfin_read16(DMA17_X_MODIFY)
973#define bfin_write_DMA17_X_MODIFY(val) bfin_write16(DMA17_X_MODIFY, val)
974#define bfin_read_DMA17_Y_COUNT() bfin_read16(DMA17_Y_COUNT)
975#define bfin_write_DMA17_Y_COUNT(val) bfin_write16(DMA17_Y_COUNT, val)
976#define bfin_read_DMA17_Y_MODIFY() bfin_read16(DMA17_Y_MODIFY)
977#define bfin_write_DMA17_Y_MODIFY(val) bfin_write16(DMA17_Y_MODIFY, val)
978#define bfin_read_DMA17_CURR_DESC_PTR() bfin_readPTR(DMA17_CURR_DESC_PTR)
979#define bfin_write_DMA17_CURR_DESC_PTR(val) bfin_writePTR(DMA17_CURR_DESC_PTR, val)
980#define bfin_read_DMA17_CURR_ADDR() bfin_readPTR(DMA17_CURR_ADDR)
981#define bfin_write_DMA17_CURR_ADDR(val) bfin_writePTR(DMA17_CURR_ADDR, val)
982#define bfin_read_DMA17_IRQ_STATUS() bfin_read16(DMA17_IRQ_STATUS)
983#define bfin_write_DMA17_IRQ_STATUS(val) bfin_write16(DMA17_IRQ_STATUS, val)
984#define bfin_read_DMA17_PERIPHERAL_MAP() bfin_read16(DMA17_PERIPHERAL_MAP)
985#define bfin_write_DMA17_PERIPHERAL_MAP(val) bfin_write16(DMA17_PERIPHERAL_MAP, val)
986#define bfin_read_DMA17_CURR_X_COUNT() bfin_read16(DMA17_CURR_X_COUNT)
987#define bfin_write_DMA17_CURR_X_COUNT(val) bfin_write16(DMA17_CURR_X_COUNT, val)
988#define bfin_read_DMA17_CURR_Y_COUNT() bfin_read16(DMA17_CURR_Y_COUNT)
989#define bfin_write_DMA17_CURR_Y_COUNT(val) bfin_write16(DMA17_CURR_Y_COUNT, val)
990#define bfin_read_DMA18_NEXT_DESC_PTR() bfin_readPTR(DMA18_NEXT_DESC_PTR)
991#define bfin_write_DMA18_NEXT_DESC_PTR(val) bfin_writePTR(DMA18_NEXT_DESC_PTR, val)
992#define bfin_read_DMA18_START_ADDR() bfin_readPTR(DMA18_START_ADDR)
993#define bfin_write_DMA18_START_ADDR(val) bfin_writePTR(DMA18_START_ADDR, val)
994#define bfin_read_DMA18_CONFIG() bfin_read16(DMA18_CONFIG)
995#define bfin_write_DMA18_CONFIG(val) bfin_write16(DMA18_CONFIG, val)
996#define bfin_read_DMA18_X_COUNT() bfin_read16(DMA18_X_COUNT)
997#define bfin_write_DMA18_X_COUNT(val) bfin_write16(DMA18_X_COUNT, val)
998#define bfin_read_DMA18_X_MODIFY() bfin_read16(DMA18_X_MODIFY)
999#define bfin_write_DMA18_X_MODIFY(val) bfin_write16(DMA18_X_MODIFY, val)
1000#define bfin_read_DMA18_Y_COUNT() bfin_read16(DMA18_Y_COUNT)
1001#define bfin_write_DMA18_Y_COUNT(val) bfin_write16(DMA18_Y_COUNT, val)
1002#define bfin_read_DMA18_Y_MODIFY() bfin_read16(DMA18_Y_MODIFY)
1003#define bfin_write_DMA18_Y_MODIFY(val) bfin_write16(DMA18_Y_MODIFY, val)
1004#define bfin_read_DMA18_CURR_DESC_PTR() bfin_readPTR(DMA18_CURR_DESC_PTR)
1005#define bfin_write_DMA18_CURR_DESC_PTR(val) bfin_writePTR(DMA18_CURR_DESC_PTR, val)
1006#define bfin_read_DMA18_CURR_ADDR() bfin_readPTR(DMA18_CURR_ADDR)
1007#define bfin_write_DMA18_CURR_ADDR(val) bfin_writePTR(DMA18_CURR_ADDR, val)
1008#define bfin_read_DMA18_IRQ_STATUS() bfin_read16(DMA18_IRQ_STATUS)
1009#define bfin_write_DMA18_IRQ_STATUS(val) bfin_write16(DMA18_IRQ_STATUS, val)
1010#define bfin_read_DMA18_PERIPHERAL_MAP() bfin_read16(DMA18_PERIPHERAL_MAP)
1011#define bfin_write_DMA18_PERIPHERAL_MAP(val) bfin_write16(DMA18_PERIPHERAL_MAP, val)
1012#define bfin_read_DMA18_CURR_X_COUNT() bfin_read16(DMA18_CURR_X_COUNT)
1013#define bfin_write_DMA18_CURR_X_COUNT(val) bfin_write16(DMA18_CURR_X_COUNT, val)
1014#define bfin_read_DMA18_CURR_Y_COUNT() bfin_read16(DMA18_CURR_Y_COUNT)
1015#define bfin_write_DMA18_CURR_Y_COUNT(val) bfin_write16(DMA18_CURR_Y_COUNT, val)
1016#define bfin_read_DMA19_NEXT_DESC_PTR() bfin_readPTR(DMA19_NEXT_DESC_PTR)
1017#define bfin_write_DMA19_NEXT_DESC_PTR(val) bfin_writePTR(DMA19_NEXT_DESC_PTR, val)
1018#define bfin_read_DMA19_START_ADDR() bfin_readPTR(DMA19_START_ADDR)
1019#define bfin_write_DMA19_START_ADDR(val) bfin_writePTR(DMA19_START_ADDR, val)
1020#define bfin_read_DMA19_CONFIG() bfin_read16(DMA19_CONFIG)
1021#define bfin_write_DMA19_CONFIG(val) bfin_write16(DMA19_CONFIG, val)
1022#define bfin_read_DMA19_X_COUNT() bfin_read16(DMA19_X_COUNT)
1023#define bfin_write_DMA19_X_COUNT(val) bfin_write16(DMA19_X_COUNT, val)
1024#define bfin_read_DMA19_X_MODIFY() bfin_read16(DMA19_X_MODIFY)
1025#define bfin_write_DMA19_X_MODIFY(val) bfin_write16(DMA19_X_MODIFY, val)
1026#define bfin_read_DMA19_Y_COUNT() bfin_read16(DMA19_Y_COUNT)
1027#define bfin_write_DMA19_Y_COUNT(val) bfin_write16(DMA19_Y_COUNT, val)
1028#define bfin_read_DMA19_Y_MODIFY() bfin_read16(DMA19_Y_MODIFY)
1029#define bfin_write_DMA19_Y_MODIFY(val) bfin_write16(DMA19_Y_MODIFY, val)
1030#define bfin_read_DMA19_CURR_DESC_PTR() bfin_readPTR(DMA19_CURR_DESC_PTR)
1031#define bfin_write_DMA19_CURR_DESC_PTR(val) bfin_writePTR(DMA19_CURR_DESC_PTR, val)
1032#define bfin_read_DMA19_CURR_ADDR() bfin_readPTR(DMA19_CURR_ADDR)
1033#define bfin_write_DMA19_CURR_ADDR(val) bfin_writePTR(DMA19_CURR_ADDR, val)
1034#define bfin_read_DMA19_IRQ_STATUS() bfin_read16(DMA19_IRQ_STATUS)
1035#define bfin_write_DMA19_IRQ_STATUS(val) bfin_write16(DMA19_IRQ_STATUS, val)
1036#define bfin_read_DMA19_PERIPHERAL_MAP() bfin_read16(DMA19_PERIPHERAL_MAP)
1037#define bfin_write_DMA19_PERIPHERAL_MAP(val) bfin_write16(DMA19_PERIPHERAL_MAP, val)
1038#define bfin_read_DMA19_CURR_X_COUNT() bfin_read16(DMA19_CURR_X_COUNT)
1039#define bfin_write_DMA19_CURR_X_COUNT(val) bfin_write16(DMA19_CURR_X_COUNT, val)
1040#define bfin_read_DMA19_CURR_Y_COUNT() bfin_read16(DMA19_CURR_Y_COUNT)
1041#define bfin_write_DMA19_CURR_Y_COUNT(val) bfin_write16(DMA19_CURR_Y_COUNT, val)
1042#define bfin_read_MDMA0_D0_NEXT_DESC_PTR() bfin_readPTR(MDMA0_D0_NEXT_DESC_PTR)
1043#define bfin_write_MDMA0_D0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA0_D0_NEXT_DESC_PTR, val)
1044#define bfin_read_MDMA0_D0_START_ADDR() bfin_readPTR(MDMA0_D0_START_ADDR)
1045#define bfin_write_MDMA0_D0_START_ADDR(val) bfin_writePTR(MDMA0_D0_START_ADDR, val)
1046#define bfin_read_MDMA0_D0_CONFIG() bfin_read16(MDMA0_D0_CONFIG)
1047#define bfin_write_MDMA0_D0_CONFIG(val) bfin_write16(MDMA0_D0_CONFIG, val)
1048#define bfin_read_MDMA0_D0_X_COUNT() bfin_read16(MDMA0_D0_X_COUNT)
1049#define bfin_write_MDMA0_D0_X_COUNT(val) bfin_write16(MDMA0_D0_X_COUNT, val)
1050#define bfin_read_MDMA0_D0_X_MODIFY() bfin_read16(MDMA0_D0_X_MODIFY)
1051#define bfin_write_MDMA0_D0_X_MODIFY(val) bfin_write16(MDMA0_D0_X_MODIFY, val)
1052#define bfin_read_MDMA0_D0_Y_COUNT() bfin_read16(MDMA0_D0_Y_COUNT)
1053#define bfin_write_MDMA0_D0_Y_COUNT(val) bfin_write16(MDMA0_D0_Y_COUNT, val)
1054#define bfin_read_MDMA0_D0_Y_MODIFY() bfin_read16(MDMA0_D0_Y_MODIFY)
1055#define bfin_write_MDMA0_D0_Y_MODIFY(val) bfin_write16(MDMA0_D0_Y_MODIFY, val)
1056#define bfin_read_MDMA0_D0_CURR_DESC_PTR() bfin_readPTR(MDMA0_D0_CURR_DESC_PTR)
1057#define bfin_write_MDMA0_D0_CURR_DESC_PTR(val) bfin_writePTR(MDMA0_D0_CURR_DESC_PTR, val)
1058#define bfin_read_MDMA0_D0_CURR_ADDR() bfin_readPTR(MDMA0_D0_CURR_ADDR)
1059#define bfin_write_MDMA0_D0_CURR_ADDR(val) bfin_writePTR(MDMA0_D0_CURR_ADDR, val)
1060#define bfin_read_MDMA0_D0_IRQ_STATUS() bfin_read16(MDMA0_D0_IRQ_STATUS)
1061#define bfin_write_MDMA0_D0_IRQ_STATUS(val) bfin_write16(MDMA0_D0_IRQ_STATUS, val)
1062#define bfin_read_MDMA0_D0_PERIPHERAL_MAP() bfin_read16(MDMA0_D0_PERIPHERAL_MAP)
1063#define bfin_write_MDMA0_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA0_D0_PERIPHERAL_MAP, val)
1064#define bfin_read_MDMA0_D0_CURR_X_COUNT() bfin_read16(MDMA0_D0_CURR_X_COUNT)
1065#define bfin_write_MDMA0_D0_CURR_X_COUNT(val) bfin_write16(MDMA0_D0_CURR_X_COUNT, val)
1066#define bfin_read_MDMA0_D0_CURR_Y_COUNT() bfin_read16(MDMA0_D0_CURR_Y_COUNT)
1067#define bfin_write_MDMA0_D0_CURR_Y_COUNT(val) bfin_write16(MDMA0_D0_CURR_Y_COUNT, val)
1068#define bfin_read_MDMA0_S0_NEXT_DESC_PTR() bfin_readPTR(MDMA0_S0_NEXT_DESC_PTR)
1069#define bfin_write_MDMA0_S0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA0_S0_NEXT_DESC_PTR, val)
1070#define bfin_read_MDMA0_S0_START_ADDR() bfin_readPTR(MDMA0_S0_START_ADDR)
1071#define bfin_write_MDMA0_S0_START_ADDR(val) bfin_writePTR(MDMA0_S0_START_ADDR, val)
1072#define bfin_read_MDMA0_S0_CONFIG() bfin_read16(MDMA0_S0_CONFIG)
1073#define bfin_write_MDMA0_S0_CONFIG(val) bfin_write16(MDMA0_S0_CONFIG, val)
1074#define bfin_read_MDMA0_S0_X_COUNT() bfin_read16(MDMA0_S0_X_COUNT)
1075#define bfin_write_MDMA0_S0_X_COUNT(val) bfin_write16(MDMA0_S0_X_COUNT, val)
1076#define bfin_read_MDMA0_S0_X_MODIFY() bfin_read16(MDMA0_S0_X_MODIFY)
1077#define bfin_write_MDMA0_S0_X_MODIFY(val) bfin_write16(MDMA0_S0_X_MODIFY, val)
1078#define bfin_read_MDMA0_S0_Y_COUNT() bfin_read16(MDMA0_S0_Y_COUNT)
1079#define bfin_write_MDMA0_S0_Y_COUNT(val) bfin_write16(MDMA0_S0_Y_COUNT, val)
1080#define bfin_read_MDMA0_S0_Y_MODIFY() bfin_read16(MDMA0_S0_Y_MODIFY)
1081#define bfin_write_MDMA0_S0_Y_MODIFY(val) bfin_write16(MDMA0_S0_Y_MODIFY, val)
1082#define bfin_read_MDMA0_S0_CURR_DESC_PTR() bfin_readPTR(MDMA0_S0_CURR_DESC_PTR)
1083#define bfin_write_MDMA0_S0_CURR_DESC_PTR(val) bfin_writePTR(MDMA0_S0_CURR_DESC_PTR, val)
1084#define bfin_read_MDMA0_S0_CURR_ADDR() bfin_readPTR(MDMA0_S0_CURR_ADDR)
1085#define bfin_write_MDMA0_S0_CURR_ADDR(val) bfin_writePTR(MDMA0_S0_CURR_ADDR, val)
1086#define bfin_read_MDMA0_S0_IRQ_STATUS() bfin_read16(MDMA0_S0_IRQ_STATUS)
1087#define bfin_write_MDMA0_S0_IRQ_STATUS(val) bfin_write16(MDMA0_S0_IRQ_STATUS, val)
1088#define bfin_read_MDMA0_S0_PERIPHERAL_MAP() bfin_read16(MDMA0_S0_PERIPHERAL_MAP)
1089#define bfin_write_MDMA0_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA0_S0_PERIPHERAL_MAP, val)
1090#define bfin_read_MDMA0_S0_CURR_X_COUNT() bfin_read16(MDMA0_S0_CURR_X_COUNT)
1091#define bfin_write_MDMA0_S0_CURR_X_COUNT(val) bfin_write16(MDMA0_S0_CURR_X_COUNT, val)
1092#define bfin_read_MDMA0_S0_CURR_Y_COUNT() bfin_read16(MDMA0_S0_CURR_Y_COUNT)
1093#define bfin_write_MDMA0_S0_CURR_Y_COUNT(val) bfin_write16(MDMA0_S0_CURR_Y_COUNT, val)
1094#define bfin_read_MDMA0_D1_NEXT_DESC_PTR() bfin_readPTR(MDMA0_D1_NEXT_DESC_PTR)
1095#define bfin_write_MDMA0_D1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA0_D1_NEXT_DESC_PTR, val)
1096#define bfin_read_MDMA0_D1_START_ADDR() bfin_readPTR(MDMA0_D1_START_ADDR)
1097#define bfin_write_MDMA0_D1_START_ADDR(val) bfin_writePTR(MDMA0_D1_START_ADDR, val)
1098#define bfin_read_MDMA0_D1_CONFIG() bfin_read16(MDMA0_D1_CONFIG)
1099#define bfin_write_MDMA0_D1_CONFIG(val) bfin_write16(MDMA0_D1_CONFIG, val)
1100#define bfin_read_MDMA0_D1_X_COUNT() bfin_read16(MDMA0_D1_X_COUNT)
1101#define bfin_write_MDMA0_D1_X_COUNT(val) bfin_write16(MDMA0_D1_X_COUNT, val)
1102#define bfin_read_MDMA0_D1_X_MODIFY() bfin_read16(MDMA0_D1_X_MODIFY)
1103#define bfin_write_MDMA0_D1_X_MODIFY(val) bfin_write16(MDMA0_D1_X_MODIFY, val)
1104#define bfin_read_MDMA0_D1_Y_COUNT() bfin_read16(MDMA0_D1_Y_COUNT)
1105#define bfin_write_MDMA0_D1_Y_COUNT(val) bfin_write16(MDMA0_D1_Y_COUNT, val)
1106#define bfin_read_MDMA0_D1_Y_MODIFY() bfin_read16(MDMA0_D1_Y_MODIFY)
1107#define bfin_write_MDMA0_D1_Y_MODIFY(val) bfin_write16(MDMA0_D1_Y_MODIFY, val)
1108#define bfin_read_MDMA0_D1_CURR_DESC_PTR() bfin_readPTR(MDMA0_D1_CURR_DESC_PTR)
1109#define bfin_write_MDMA0_D1_CURR_DESC_PTR(val) bfin_writePTR(MDMA0_D1_CURR_DESC_PTR, val)
1110#define bfin_read_MDMA0_D1_CURR_ADDR() bfin_readPTR(MDMA0_D1_CURR_ADDR)
1111#define bfin_write_MDMA0_D1_CURR_ADDR(val) bfin_writePTR(MDMA0_D1_CURR_ADDR, val)
1112#define bfin_read_MDMA0_D1_IRQ_STATUS() bfin_read16(MDMA0_D1_IRQ_STATUS)
1113#define bfin_write_MDMA0_D1_IRQ_STATUS(val) bfin_write16(MDMA0_D1_IRQ_STATUS, val)
1114#define bfin_read_MDMA0_D1_PERIPHERAL_MAP() bfin_read16(MDMA0_D1_PERIPHERAL_MAP)
1115#define bfin_write_MDMA0_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA0_D1_PERIPHERAL_MAP, val)
1116#define bfin_read_MDMA0_D1_CURR_X_COUNT() bfin_read16(MDMA0_D1_CURR_X_COUNT)
1117#define bfin_write_MDMA0_D1_CURR_X_COUNT(val) bfin_write16(MDMA0_D1_CURR_X_COUNT, val)
1118#define bfin_read_MDMA0_D1_CURR_Y_COUNT() bfin_read16(MDMA0_D1_CURR_Y_COUNT)
1119#define bfin_write_MDMA0_D1_CURR_Y_COUNT(val) bfin_write16(MDMA0_D1_CURR_Y_COUNT, val)
1120#define bfin_read_MDMA0_S1_NEXT_DESC_PTR() bfin_readPTR(MDMA0_S1_NEXT_DESC_PTR)
1121#define bfin_write_MDMA0_S1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA0_S1_NEXT_DESC_PTR, val)
1122#define bfin_read_MDMA0_S1_START_ADDR() bfin_readPTR(MDMA0_S1_START_ADDR)
1123#define bfin_write_MDMA0_S1_START_ADDR(val) bfin_writePTR(MDMA0_S1_START_ADDR, val)
1124#define bfin_read_MDMA0_S1_CONFIG() bfin_read16(MDMA0_S1_CONFIG)
1125#define bfin_write_MDMA0_S1_CONFIG(val) bfin_write16(MDMA0_S1_CONFIG, val)
1126#define bfin_read_MDMA0_S1_X_COUNT() bfin_read16(MDMA0_S1_X_COUNT)
1127#define bfin_write_MDMA0_S1_X_COUNT(val) bfin_write16(MDMA0_S1_X_COUNT, val)
1128#define bfin_read_MDMA0_S1_X_MODIFY() bfin_read16(MDMA0_S1_X_MODIFY)
1129#define bfin_write_MDMA0_S1_X_MODIFY(val) bfin_write16(MDMA0_S1_X_MODIFY, val)
1130#define bfin_read_MDMA0_S1_Y_COUNT() bfin_read16(MDMA0_S1_Y_COUNT)
1131#define bfin_write_MDMA0_S1_Y_COUNT(val) bfin_write16(MDMA0_S1_Y_COUNT, val)
1132#define bfin_read_MDMA0_S1_Y_MODIFY() bfin_read16(MDMA0_S1_Y_MODIFY)
1133#define bfin_write_MDMA0_S1_Y_MODIFY(val) bfin_write16(MDMA0_S1_Y_MODIFY, val)
1134#define bfin_read_MDMA0_S1_CURR_DESC_PTR() bfin_readPTR(MDMA0_S1_CURR_DESC_PTR)
1135#define bfin_write_MDMA0_S1_CURR_DESC_PTR(val) bfin_writePTR(MDMA0_S1_CURR_DESC_PTR, val)
1136#define bfin_read_MDMA0_S1_CURR_ADDR() bfin_readPTR(MDMA0_S1_CURR_ADDR)
1137#define bfin_write_MDMA0_S1_CURR_ADDR(val) bfin_writePTR(MDMA0_S1_CURR_ADDR, val)
1138#define bfin_read_MDMA0_S1_IRQ_STATUS() bfin_read16(MDMA0_S1_IRQ_STATUS)
1139#define bfin_write_MDMA0_S1_IRQ_STATUS(val) bfin_write16(MDMA0_S1_IRQ_STATUS, val)
1140#define bfin_read_MDMA0_S1_PERIPHERAL_MAP() bfin_read16(MDMA0_S1_PERIPHERAL_MAP)
1141#define bfin_write_MDMA0_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA0_S1_PERIPHERAL_MAP, val)
1142#define bfin_read_MDMA0_S1_CURR_X_COUNT() bfin_read16(MDMA0_S1_CURR_X_COUNT)
1143#define bfin_write_MDMA0_S1_CURR_X_COUNT(val) bfin_write16(MDMA0_S1_CURR_X_COUNT, val)
1144#define bfin_read_MDMA0_S1_CURR_Y_COUNT() bfin_read16(MDMA0_S1_CURR_Y_COUNT)
1145#define bfin_write_MDMA0_S1_CURR_Y_COUNT(val) bfin_write16(MDMA0_S1_CURR_Y_COUNT, val)
1146#define bfin_read_MDMA1_D0_NEXT_DESC_PTR() bfin_readPTR(MDMA1_D0_NEXT_DESC_PTR)
1147#define bfin_write_MDMA1_D0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA1_D0_NEXT_DESC_PTR, val)
1148#define bfin_read_MDMA1_D0_START_ADDR() bfin_readPTR(MDMA1_D0_START_ADDR)
1149#define bfin_write_MDMA1_D0_START_ADDR(val) bfin_writePTR(MDMA1_D0_START_ADDR, val)
1150#define bfin_read_MDMA1_D0_CONFIG() bfin_read16(MDMA1_D0_CONFIG)
1151#define bfin_write_MDMA1_D0_CONFIG(val) bfin_write16(MDMA1_D0_CONFIG, val)
1152#define bfin_read_MDMA1_D0_X_COUNT() bfin_read16(MDMA1_D0_X_COUNT)
1153#define bfin_write_MDMA1_D0_X_COUNT(val) bfin_write16(MDMA1_D0_X_COUNT, val)
1154#define bfin_read_MDMA1_D0_X_MODIFY() bfin_read16(MDMA1_D0_X_MODIFY)
1155#define bfin_write_MDMA1_D0_X_MODIFY(val) bfin_write16(MDMA1_D0_X_MODIFY, val)
1156#define bfin_read_MDMA1_D0_Y_COUNT() bfin_read16(MDMA1_D0_Y_COUNT)
1157#define bfin_write_MDMA1_D0_Y_COUNT(val) bfin_write16(MDMA1_D0_Y_COUNT, val)
1158#define bfin_read_MDMA1_D0_Y_MODIFY() bfin_read16(MDMA1_D0_Y_MODIFY)
1159#define bfin_write_MDMA1_D0_Y_MODIFY(val) bfin_write16(MDMA1_D0_Y_MODIFY, val)
1160#define bfin_read_MDMA1_D0_CURR_DESC_PTR() bfin_readPTR(MDMA1_D0_CURR_DESC_PTR)
1161#define bfin_write_MDMA1_D0_CURR_DESC_PTR(val) bfin_writePTR(MDMA1_D0_CURR_DESC_PTR, val)
1162#define bfin_read_MDMA1_D0_CURR_ADDR() bfin_readPTR(MDMA1_D0_CURR_ADDR)
1163#define bfin_write_MDMA1_D0_CURR_ADDR(val) bfin_writePTR(MDMA1_D0_CURR_ADDR, val)
1164#define bfin_read_MDMA1_D0_IRQ_STATUS() bfin_read16(MDMA1_D0_IRQ_STATUS)
1165#define bfin_write_MDMA1_D0_IRQ_STATUS(val) bfin_write16(MDMA1_D0_IRQ_STATUS, val)
1166#define bfin_read_MDMA1_D0_PERIPHERAL_MAP() bfin_read16(MDMA1_D0_PERIPHERAL_MAP)
1167#define bfin_write_MDMA1_D0_PERIPHERAL_MAP(val) bfin_write16(MDMA1_D0_PERIPHERAL_MAP, val)
1168#define bfin_read_MDMA1_D0_CURR_X_COUNT() bfin_read16(MDMA1_D0_CURR_X_COUNT)
1169#define bfin_write_MDMA1_D0_CURR_X_COUNT(val) bfin_write16(MDMA1_D0_CURR_X_COUNT, val)
1170#define bfin_read_MDMA1_D0_CURR_Y_COUNT() bfin_read16(MDMA1_D0_CURR_Y_COUNT)
1171#define bfin_write_MDMA1_D0_CURR_Y_COUNT(val) bfin_write16(MDMA1_D0_CURR_Y_COUNT, val)
1172#define bfin_read_MDMA1_S0_NEXT_DESC_PTR() bfin_readPTR(MDMA1_S0_NEXT_DESC_PTR)
1173#define bfin_write_MDMA1_S0_NEXT_DESC_PTR(val) bfin_writePTR(MDMA1_S0_NEXT_DESC_PTR, val)
1174#define bfin_read_MDMA1_S0_START_ADDR() bfin_readPTR(MDMA1_S0_START_ADDR)
1175#define bfin_write_MDMA1_S0_START_ADDR(val) bfin_writePTR(MDMA1_S0_START_ADDR, val)
1176#define bfin_read_MDMA1_S0_CONFIG() bfin_read16(MDMA1_S0_CONFIG)
1177#define bfin_write_MDMA1_S0_CONFIG(val) bfin_write16(MDMA1_S0_CONFIG, val)
1178#define bfin_read_MDMA1_S0_X_COUNT() bfin_read16(MDMA1_S0_X_COUNT)
1179#define bfin_write_MDMA1_S0_X_COUNT(val) bfin_write16(MDMA1_S0_X_COUNT, val)
1180#define bfin_read_MDMA1_S0_X_MODIFY() bfin_read16(MDMA1_S0_X_MODIFY)
1181#define bfin_write_MDMA1_S0_X_MODIFY(val) bfin_write16(MDMA1_S0_X_MODIFY, val)
1182#define bfin_read_MDMA1_S0_Y_COUNT() bfin_read16(MDMA1_S0_Y_COUNT)
1183#define bfin_write_MDMA1_S0_Y_COUNT(val) bfin_write16(MDMA1_S0_Y_COUNT, val)
1184#define bfin_read_MDMA1_S0_Y_MODIFY() bfin_read16(MDMA1_S0_Y_MODIFY)
1185#define bfin_write_MDMA1_S0_Y_MODIFY(val) bfin_write16(MDMA1_S0_Y_MODIFY, val)
1186#define bfin_read_MDMA1_S0_CURR_DESC_PTR() bfin_readPTR(MDMA1_S0_CURR_DESC_PTR)
1187#define bfin_write_MDMA1_S0_CURR_DESC_PTR(val) bfin_writePTR(MDMA1_S0_CURR_DESC_PTR, val)
1188#define bfin_read_MDMA1_S0_CURR_ADDR() bfin_readPTR(MDMA1_S0_CURR_ADDR)
1189#define bfin_write_MDMA1_S0_CURR_ADDR(val) bfin_writePTR(MDMA1_S0_CURR_ADDR, val)
1190#define bfin_read_MDMA1_S0_IRQ_STATUS() bfin_read16(MDMA1_S0_IRQ_STATUS)
1191#define bfin_write_MDMA1_S0_IRQ_STATUS(val) bfin_write16(MDMA1_S0_IRQ_STATUS, val)
1192#define bfin_read_MDMA1_S0_PERIPHERAL_MAP() bfin_read16(MDMA1_S0_PERIPHERAL_MAP)
1193#define bfin_write_MDMA1_S0_PERIPHERAL_MAP(val) bfin_write16(MDMA1_S0_PERIPHERAL_MAP, val)
1194#define bfin_read_MDMA1_S0_CURR_X_COUNT() bfin_read16(MDMA1_S0_CURR_X_COUNT)
1195#define bfin_write_MDMA1_S0_CURR_X_COUNT(val) bfin_write16(MDMA1_S0_CURR_X_COUNT, val)
1196#define bfin_read_MDMA1_S0_CURR_Y_COUNT() bfin_read16(MDMA1_S0_CURR_Y_COUNT)
1197#define bfin_write_MDMA1_S0_CURR_Y_COUNT(val) bfin_write16(MDMA1_S0_CURR_Y_COUNT, val)
1198#define bfin_read_MDMA1_D1_NEXT_DESC_PTR() bfin_readPTR(MDMA1_D1_NEXT_DESC_PTR)
1199#define bfin_write_MDMA1_D1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA1_D1_NEXT_DESC_PTR, val)
1200#define bfin_read_MDMA1_D1_START_ADDR() bfin_readPTR(MDMA1_D1_START_ADDR)
1201#define bfin_write_MDMA1_D1_START_ADDR(val) bfin_writePTR(MDMA1_D1_START_ADDR, val)
1202#define bfin_read_MDMA1_D1_CONFIG() bfin_read16(MDMA1_D1_CONFIG)
1203#define bfin_write_MDMA1_D1_CONFIG(val) bfin_write16(MDMA1_D1_CONFIG, val)
1204#define bfin_read_MDMA1_D1_X_COUNT() bfin_read16(MDMA1_D1_X_COUNT)
1205#define bfin_write_MDMA1_D1_X_COUNT(val) bfin_write16(MDMA1_D1_X_COUNT, val)
1206#define bfin_read_MDMA1_D1_X_MODIFY() bfin_read16(MDMA1_D1_X_MODIFY)
1207#define bfin_write_MDMA1_D1_X_MODIFY(val) bfin_write16(MDMA1_D1_X_MODIFY, val)
1208#define bfin_read_MDMA1_D1_Y_COUNT() bfin_read16(MDMA1_D1_Y_COUNT)
1209#define bfin_write_MDMA1_D1_Y_COUNT(val) bfin_write16(MDMA1_D1_Y_COUNT, val)
1210#define bfin_read_MDMA1_D1_Y_MODIFY() bfin_read16(MDMA1_D1_Y_MODIFY)
1211#define bfin_write_MDMA1_D1_Y_MODIFY(val) bfin_write16(MDMA1_D1_Y_MODIFY, val)
1212#define bfin_read_MDMA1_D1_CURR_DESC_PTR() bfin_readPTR(MDMA1_D1_CURR_DESC_PTR)
1213#define bfin_write_MDMA1_D1_CURR_DESC_PTR(val) bfin_writePTR(MDMA1_D1_CURR_DESC_PTR, val)
1214#define bfin_read_MDMA1_D1_CURR_ADDR() bfin_readPTR(MDMA1_D1_CURR_ADDR)
1215#define bfin_write_MDMA1_D1_CURR_ADDR(val) bfin_writePTR(MDMA1_D1_CURR_ADDR, val)
1216#define bfin_read_MDMA1_D1_IRQ_STATUS() bfin_read16(MDMA1_D1_IRQ_STATUS)
1217#define bfin_write_MDMA1_D1_IRQ_STATUS(val) bfin_write16(MDMA1_D1_IRQ_STATUS, val)
1218#define bfin_read_MDMA1_D1_PERIPHERAL_MAP() bfin_read16(MDMA1_D1_PERIPHERAL_MAP)
1219#define bfin_write_MDMA1_D1_PERIPHERAL_MAP(val) bfin_write16(MDMA1_D1_PERIPHERAL_MAP, val)
1220#define bfin_read_MDMA1_D1_CURR_X_COUNT() bfin_read16(MDMA1_D1_CURR_X_COUNT)
1221#define bfin_write_MDMA1_D1_CURR_X_COUNT(val) bfin_write16(MDMA1_D1_CURR_X_COUNT, val)
1222#define bfin_read_MDMA1_D1_CURR_Y_COUNT() bfin_read16(MDMA1_D1_CURR_Y_COUNT)
1223#define bfin_write_MDMA1_D1_CURR_Y_COUNT(val) bfin_write16(MDMA1_D1_CURR_Y_COUNT, val)
1224#define bfin_read_MDMA1_S1_NEXT_DESC_PTR() bfin_readPTR(MDMA1_S1_NEXT_DESC_PTR)
1225#define bfin_write_MDMA1_S1_NEXT_DESC_PTR(val) bfin_writePTR(MDMA1_S1_NEXT_DESC_PTR, val)
1226#define bfin_read_MDMA1_S1_START_ADDR() bfin_readPTR(MDMA1_S1_START_ADDR)
1227#define bfin_write_MDMA1_S1_START_ADDR(val) bfin_writePTR(MDMA1_S1_START_ADDR, val)
1228#define bfin_read_MDMA1_S1_CONFIG() bfin_read16(MDMA1_S1_CONFIG)
1229#define bfin_write_MDMA1_S1_CONFIG(val) bfin_write16(MDMA1_S1_CONFIG, val)
1230#define bfin_read_MDMA1_S1_X_COUNT() bfin_read16(MDMA1_S1_X_COUNT)
1231#define bfin_write_MDMA1_S1_X_COUNT(val) bfin_write16(MDMA1_S1_X_COUNT, val)
1232#define bfin_read_MDMA1_S1_X_MODIFY() bfin_read16(MDMA1_S1_X_MODIFY)
1233#define bfin_write_MDMA1_S1_X_MODIFY(val) bfin_write16(MDMA1_S1_X_MODIFY, val)
1234#define bfin_read_MDMA1_S1_Y_COUNT() bfin_read16(MDMA1_S1_Y_COUNT)
1235#define bfin_write_MDMA1_S1_Y_COUNT(val) bfin_write16(MDMA1_S1_Y_COUNT, val)
1236#define bfin_read_MDMA1_S1_Y_MODIFY() bfin_read16(MDMA1_S1_Y_MODIFY)
1237#define bfin_write_MDMA1_S1_Y_MODIFY(val) bfin_write16(MDMA1_S1_Y_MODIFY, val)
1238#define bfin_read_MDMA1_S1_CURR_DESC_PTR() bfin_readPTR(MDMA1_S1_CURR_DESC_PTR)
1239#define bfin_write_MDMA1_S1_CURR_DESC_PTR(val) bfin_writePTR(MDMA1_S1_CURR_DESC_PTR, val)
1240#define bfin_read_MDMA1_S1_CURR_ADDR() bfin_readPTR(MDMA1_S1_CURR_ADDR)
1241#define bfin_write_MDMA1_S1_CURR_ADDR(val) bfin_writePTR(MDMA1_S1_CURR_ADDR, val)
1242#define bfin_read_MDMA1_S1_IRQ_STATUS() bfin_read16(MDMA1_S1_IRQ_STATUS)
1243#define bfin_write_MDMA1_S1_IRQ_STATUS(val) bfin_write16(MDMA1_S1_IRQ_STATUS, val)
1244#define bfin_read_MDMA1_S1_PERIPHERAL_MAP() bfin_read16(MDMA1_S1_PERIPHERAL_MAP)
1245#define bfin_write_MDMA1_S1_PERIPHERAL_MAP(val) bfin_write16(MDMA1_S1_PERIPHERAL_MAP, val)
1246#define bfin_read_MDMA1_S1_CURR_X_COUNT() bfin_read16(MDMA1_S1_CURR_X_COUNT)
1247#define bfin_write_MDMA1_S1_CURR_X_COUNT(val) bfin_write16(MDMA1_S1_CURR_X_COUNT, val)
1248#define bfin_read_MDMA1_S1_CURR_Y_COUNT() bfin_read16(MDMA1_S1_CURR_Y_COUNT)
1249#define bfin_write_MDMA1_S1_CURR_Y_COUNT(val) bfin_write16(MDMA1_S1_CURR_Y_COUNT, val)
1250#define bfin_read_PPI_CONTROL() bfin_read16(PPI_CONTROL)
1251#define bfin_write_PPI_CONTROL(val) bfin_write16(PPI_CONTROL, val)
1252#define bfin_read_PPI_STATUS() bfin_read16(PPI_STATUS)
1253#define bfin_write_PPI_STATUS(val) bfin_write16(PPI_STATUS, val)
1254#define bfin_read_PPI_DELAY() bfin_read16(PPI_DELAY)
1255#define bfin_write_PPI_DELAY(val) bfin_write16(PPI_DELAY, val)
1256#define bfin_read_PPI_COUNT() bfin_read16(PPI_COUNT)
1257#define bfin_write_PPI_COUNT(val) bfin_write16(PPI_COUNT, val)
1258#define bfin_read_PPI_FRAME() bfin_read16(PPI_FRAME)
1259#define bfin_write_PPI_FRAME(val) bfin_write16(PPI_FRAME, val)
1260#define bfin_read_TWI0_CLKDIV() bfin_read16(TWI0_CLKDIV)
1261#define bfin_write_TWI0_CLKDIV(val) bfin_write16(TWI0_CLKDIV, val)
1262#define bfin_read_TWI0_CONTROL() bfin_read16(TWI0_CONTROL)
1263#define bfin_write_TWI0_CONTROL(val) bfin_write16(TWI0_CONTROL, val)
1264#define bfin_read_TWI0_SLAVE_CTRL() bfin_read16(TWI0_SLAVE_CTRL)
1265#define bfin_write_TWI0_SLAVE_CTRL(val) bfin_write16(TWI0_SLAVE_CTRL, val)
1266#define bfin_read_TWI0_SLAVE_STAT() bfin_read16(TWI0_SLAVE_STAT)
1267#define bfin_write_TWI0_SLAVE_STAT(val) bfin_write16(TWI0_SLAVE_STAT, val)
1268#define bfin_read_TWI0_SLAVE_ADDR() bfin_read16(TWI0_SLAVE_ADDR)
1269#define bfin_write_TWI0_SLAVE_ADDR(val) bfin_write16(TWI0_SLAVE_ADDR, val)
1270#define bfin_read_TWI0_MASTER_CTL() bfin_read16(TWI0_MASTER_CTL)
1271#define bfin_write_TWI0_MASTER_CTL(val) bfin_write16(TWI0_MASTER_CTL, val)
1272#define bfin_read_TWI0_MASTER_STAT() bfin_read16(TWI0_MASTER_STAT)
1273#define bfin_write_TWI0_MASTER_STAT(val) bfin_write16(TWI0_MASTER_STAT, val)
1274#define bfin_read_TWI0_MASTER_ADDR() bfin_read16(TWI0_MASTER_ADDR)
1275#define bfin_write_TWI0_MASTER_ADDR(val) bfin_write16(TWI0_MASTER_ADDR, val)
1276#define bfin_read_TWI0_INT_STAT() bfin_read16(TWI0_INT_STAT)
1277#define bfin_write_TWI0_INT_STAT(val) bfin_write16(TWI0_INT_STAT, val)
1278#define bfin_read_TWI0_INT_MASK() bfin_read16(TWI0_INT_MASK)
1279#define bfin_write_TWI0_INT_MASK(val) bfin_write16(TWI0_INT_MASK, val)
1280#define bfin_read_TWI0_FIFO_CTL() bfin_read16(TWI0_FIFO_CTL)
1281#define bfin_write_TWI0_FIFO_CTL(val) bfin_write16(TWI0_FIFO_CTL, val)
1282#define bfin_read_TWI0_FIFO_STAT() bfin_read16(TWI0_FIFO_STAT)
1283#define bfin_write_TWI0_FIFO_STAT(val) bfin_write16(TWI0_FIFO_STAT, val)
1284#define bfin_read_TWI0_XMT_DATA8() bfin_read16(TWI0_XMT_DATA8)
1285#define bfin_write_TWI0_XMT_DATA8(val) bfin_write16(TWI0_XMT_DATA8, val)
1286#define bfin_read_TWI0_XMT_DATA16() bfin_read16(TWI0_XMT_DATA16)
1287#define bfin_write_TWI0_XMT_DATA16(val) bfin_write16(TWI0_XMT_DATA16, val)
1288#define bfin_read_TWI0_RCV_DATA8() bfin_read16(TWI0_RCV_DATA8)
1289#define bfin_write_TWI0_RCV_DATA8(val) bfin_write16(TWI0_RCV_DATA8, val)
1290#define bfin_read_TWI0_RCV_DATA16() bfin_read16(TWI0_RCV_DATA16)
1291#define bfin_write_TWI0_RCV_DATA16(val) bfin_write16(TWI0_RCV_DATA16, val)
1292#define bfin_read_TWI1_CLKDIV() bfin_read16(TWI1_CLKDIV)
1293#define bfin_write_TWI1_CLKDIV(val) bfin_write16(TWI1_CLKDIV, val)
1294#define bfin_read_TWI1_CONTROL() bfin_read16(TWI1_CONTROL)
1295#define bfin_write_TWI1_CONTROL(val) bfin_write16(TWI1_CONTROL, val)
1296#define bfin_read_TWI1_SLAVE_CTRL() bfin_read16(TWI1_SLAVE_CTRL)
1297#define bfin_write_TWI1_SLAVE_CTRL(val) bfin_write16(TWI1_SLAVE_CTRL, val)
1298#define bfin_read_TWI1_SLAVE_STAT() bfin_read16(TWI1_SLAVE_STAT)
1299#define bfin_write_TWI1_SLAVE_STAT(val) bfin_write16(TWI1_SLAVE_STAT, val)
1300#define bfin_read_TWI1_SLAVE_ADDR() bfin_read16(TWI1_SLAVE_ADDR)
1301#define bfin_write_TWI1_SLAVE_ADDR(val) bfin_write16(TWI1_SLAVE_ADDR, val)
1302#define bfin_read_TWI1_MASTER_CTL() bfin_read16(TWI1_MASTER_CTL)
1303#define bfin_write_TWI1_MASTER_CTL(val) bfin_write16(TWI1_MASTER_CTL, val)
1304#define bfin_read_TWI1_MASTER_STAT() bfin_read16(TWI1_MASTER_STAT)
1305#define bfin_write_TWI1_MASTER_STAT(val) bfin_write16(TWI1_MASTER_STAT, val)
1306#define bfin_read_TWI1_MASTER_ADDR() bfin_read16(TWI1_MASTER_ADDR)
1307#define bfin_write_TWI1_MASTER_ADDR(val) bfin_write16(TWI1_MASTER_ADDR, val)
1308#define bfin_read_TWI1_INT_STAT() bfin_read16(TWI1_INT_STAT)
1309#define bfin_write_TWI1_INT_STAT(val) bfin_write16(TWI1_INT_STAT, val)
1310#define bfin_read_TWI1_INT_MASK() bfin_read16(TWI1_INT_MASK)
1311#define bfin_write_TWI1_INT_MASK(val) bfin_write16(TWI1_INT_MASK, val)
1312#define bfin_read_TWI1_FIFO_CTL() bfin_read16(TWI1_FIFO_CTL)
1313#define bfin_write_TWI1_FIFO_CTL(val) bfin_write16(TWI1_FIFO_CTL, val)
1314#define bfin_read_TWI1_FIFO_STAT() bfin_read16(TWI1_FIFO_STAT)
1315#define bfin_write_TWI1_FIFO_STAT(val) bfin_write16(TWI1_FIFO_STAT, val)
1316#define bfin_read_TWI1_XMT_DATA8() bfin_read16(TWI1_XMT_DATA8)
1317#define bfin_write_TWI1_XMT_DATA8(val) bfin_write16(TWI1_XMT_DATA8, val)
1318#define bfin_read_TWI1_XMT_DATA16() bfin_read16(TWI1_XMT_DATA16)
1319#define bfin_write_TWI1_XMT_DATA16(val) bfin_write16(TWI1_XMT_DATA16, val)
1320#define bfin_read_TWI1_RCV_DATA8() bfin_read16(TWI1_RCV_DATA8)
1321#define bfin_write_TWI1_RCV_DATA8(val) bfin_write16(TWI1_RCV_DATA8, val)
1322#define bfin_read_TWI1_RCV_DATA16() bfin_read16(TWI1_RCV_DATA16)
1323#define bfin_write_TWI1_RCV_DATA16(val) bfin_write16(TWI1_RCV_DATA16, val)
1324#define bfin_read_CAN_MC1() bfin_read16(CAN_MC1)
1325#define bfin_write_CAN_MC1(val) bfin_write16(CAN_MC1, val)
1326#define bfin_read_CAN_MD1() bfin_read16(CAN_MD1)
1327#define bfin_write_CAN_MD1(val) bfin_write16(CAN_MD1, val)
1328#define bfin_read_CAN_TRS1() bfin_read16(CAN_TRS1)
1329#define bfin_write_CAN_TRS1(val) bfin_write16(CAN_TRS1, val)
1330#define bfin_read_CAN_TRR1() bfin_read16(CAN_TRR1)
1331#define bfin_write_CAN_TRR1(val) bfin_write16(CAN_TRR1, val)
1332#define bfin_read_CAN_TA1() bfin_read16(CAN_TA1)
1333#define bfin_write_CAN_TA1(val) bfin_write16(CAN_TA1, val)
1334#define bfin_read_CAN_AA1() bfin_read16(CAN_AA1)
1335#define bfin_write_CAN_AA1(val) bfin_write16(CAN_AA1, val)
1336#define bfin_read_CAN_RMP1() bfin_read16(CAN_RMP1)
1337#define bfin_write_CAN_RMP1(val) bfin_write16(CAN_RMP1, val)
1338#define bfin_read_CAN_RML1() bfin_read16(CAN_RML1)
1339#define bfin_write_CAN_RML1(val) bfin_write16(CAN_RML1, val)
1340#define bfin_read_CAN_MBTIF1() bfin_read16(CAN_MBTIF1)
1341#define bfin_write_CAN_MBTIF1(val) bfin_write16(CAN_MBTIF1, val)
1342#define bfin_read_CAN_MBRIF1() bfin_read16(CAN_MBRIF1)
1343#define bfin_write_CAN_MBRIF1(val) bfin_write16(CAN_MBRIF1, val)
1344#define bfin_read_CAN_MBIM1() bfin_read16(CAN_MBIM1)
1345#define bfin_write_CAN_MBIM1(val) bfin_write16(CAN_MBIM1, val)
1346#define bfin_read_CAN_RFH1() bfin_read16(CAN_RFH1)
1347#define bfin_write_CAN_RFH1(val) bfin_write16(CAN_RFH1, val)
1348#define bfin_read_CAN_OPSS1() bfin_read16(CAN_OPSS1)
1349#define bfin_write_CAN_OPSS1(val) bfin_write16(CAN_OPSS1, val)
1350#define bfin_read_CAN_MC2() bfin_read16(CAN_MC2)
1351#define bfin_write_CAN_MC2(val) bfin_write16(CAN_MC2, val)
1352#define bfin_read_CAN_MD2() bfin_read16(CAN_MD2)
1353#define bfin_write_CAN_MD2(val) bfin_write16(CAN_MD2, val)
1354#define bfin_read_CAN_TRS2() bfin_read16(CAN_TRS2)
1355#define bfin_write_CAN_TRS2(val) bfin_write16(CAN_TRS2, val)
1356#define bfin_read_CAN_TRR2() bfin_read16(CAN_TRR2)
1357#define bfin_write_CAN_TRR2(val) bfin_write16(CAN_TRR2, val)
1358#define bfin_read_CAN_TA2() bfin_read16(CAN_TA2)
1359#define bfin_write_CAN_TA2(val) bfin_write16(CAN_TA2, val)
1360#define bfin_read_CAN_AA2() bfin_read16(CAN_AA2)
1361#define bfin_write_CAN_AA2(val) bfin_write16(CAN_AA2, val)
1362#define bfin_read_CAN_RMP2() bfin_read16(CAN_RMP2)
1363#define bfin_write_CAN_RMP2(val) bfin_write16(CAN_RMP2, val)
1364#define bfin_read_CAN_RML2() bfin_read16(CAN_RML2)
1365#define bfin_write_CAN_RML2(val) bfin_write16(CAN_RML2, val)
1366#define bfin_read_CAN_MBTIF2() bfin_read16(CAN_MBTIF2)
1367#define bfin_write_CAN_MBTIF2(val) bfin_write16(CAN_MBTIF2, val)
1368#define bfin_read_CAN_MBRIF2() bfin_read16(CAN_MBRIF2)
1369#define bfin_write_CAN_MBRIF2(val) bfin_write16(CAN_MBRIF2, val)
1370#define bfin_read_CAN_MBIM2() bfin_read16(CAN_MBIM2)
1371#define bfin_write_CAN_MBIM2(val) bfin_write16(CAN_MBIM2, val)
1372#define bfin_read_CAN_RFH2() bfin_read16(CAN_RFH2)
1373#define bfin_write_CAN_RFH2(val) bfin_write16(CAN_RFH2, val)
1374#define bfin_read_CAN_OPSS2() bfin_read16(CAN_OPSS2)
1375#define bfin_write_CAN_OPSS2(val) bfin_write16(CAN_OPSS2, val)
1376#define bfin_read_CAN_CLOCK() bfin_read16(CAN_CLOCK)
1377#define bfin_write_CAN_CLOCK(val) bfin_write16(CAN_CLOCK, val)
1378#define bfin_read_CAN_TIMING() bfin_read16(CAN_TIMING)
1379#define bfin_write_CAN_TIMING(val) bfin_write16(CAN_TIMING, val)
1380#define bfin_read_CAN_DEBUG() bfin_read16(CAN_DEBUG)
1381#define bfin_write_CAN_DEBUG(val) bfin_write16(CAN_DEBUG, val)
1382#define bfin_read_CAN_STATUS() bfin_read16(CAN_STATUS)
1383#define bfin_write_CAN_STATUS(val) bfin_write16(CAN_STATUS, val)
1384#define bfin_read_CAN_CEC() bfin_read16(CAN_CEC)
1385#define bfin_write_CAN_CEC(val) bfin_write16(CAN_CEC, val)
1386#define bfin_read_CAN_GIS() bfin_read16(CAN_GIS)
1387#define bfin_write_CAN_GIS(val) bfin_write16(CAN_GIS, val)
1388#define bfin_read_CAN_GIM() bfin_read16(CAN_GIM)
1389#define bfin_write_CAN_GIM(val) bfin_write16(CAN_GIM, val)
1390#define bfin_read_CAN_GIF() bfin_read16(CAN_GIF)
1391#define bfin_write_CAN_GIF(val) bfin_write16(CAN_GIF, val)
1392#define bfin_read_CAN_CONTROL() bfin_read16(CAN_CONTROL)
1393#define bfin_write_CAN_CONTROL(val) bfin_write16(CAN_CONTROL, val)
1394#define bfin_read_CAN_INTR() bfin_read16(CAN_INTR)
1395#define bfin_write_CAN_INTR(val) bfin_write16(CAN_INTR, val)
1396#define bfin_read_CAN_VERSION() bfin_read16(CAN_VERSION)
1397#define bfin_write_CAN_VERSION(val) bfin_write16(CAN_VERSION, val)
1398#define bfin_read_CAN_MBTD() bfin_read16(CAN_MBTD)
1399#define bfin_write_CAN_MBTD(val) bfin_write16(CAN_MBTD, val)
1400#define bfin_read_CAN_EWR() bfin_read16(CAN_EWR)
1401#define bfin_write_CAN_EWR(val) bfin_write16(CAN_EWR, val)
1402#define bfin_read_CAN_ESR() bfin_read16(CAN_ESR)
1403#define bfin_write_CAN_ESR(val) bfin_write16(CAN_ESR, val)
1404#define bfin_read_CAN_UCREG() bfin_read16(CAN_UCREG)
1405#define bfin_write_CAN_UCREG(val) bfin_write16(CAN_UCREG, val)
1406#define bfin_read_CAN_UCCNT() bfin_read16(CAN_UCCNT)
1407#define bfin_write_CAN_UCCNT(val) bfin_write16(CAN_UCCNT, val)
1408#define bfin_read_CAN_UCRC() bfin_read16(CAN_UCRC)
1409#define bfin_write_CAN_UCRC(val) bfin_write16(CAN_UCRC, val)
1410#define bfin_read_CAN_UCCNF() bfin_read16(CAN_UCCNF)
1411#define bfin_write_CAN_UCCNF(val) bfin_write16(CAN_UCCNF, val)
1412#define bfin_read_CAN_VERSION2() bfin_read16(CAN_VERSION2)
1413#define bfin_write_CAN_VERSION2(val) bfin_write16(CAN_VERSION2, val)
1414#define bfin_read_CAN_AM00L() bfin_read16(CAN_AM00L)
1415#define bfin_write_CAN_AM00L(val) bfin_write16(CAN_AM00L, val)
1416#define bfin_read_CAN_AM00H() bfin_read16(CAN_AM00H)
1417#define bfin_write_CAN_AM00H(val) bfin_write16(CAN_AM00H, val)
1418#define bfin_read_CAN_AM01L() bfin_read16(CAN_AM01L)
1419#define bfin_write_CAN_AM01L(val) bfin_write16(CAN_AM01L, val)
1420#define bfin_read_CAN_AM01H() bfin_read16(CAN_AM01H)
1421#define bfin_write_CAN_AM01H(val) bfin_write16(CAN_AM01H, val)
1422#define bfin_read_CAN_AM02L() bfin_read16(CAN_AM02L)
1423#define bfin_write_CAN_AM02L(val) bfin_write16(CAN_AM02L, val)
1424#define bfin_read_CAN_AM02H() bfin_read16(CAN_AM02H)
1425#define bfin_write_CAN_AM02H(val) bfin_write16(CAN_AM02H, val)
1426#define bfin_read_CAN_AM03L() bfin_read16(CAN_AM03L)
1427#define bfin_write_CAN_AM03L(val) bfin_write16(CAN_AM03L, val)
1428#define bfin_read_CAN_AM03H() bfin_read16(CAN_AM03H)
1429#define bfin_write_CAN_AM03H(val) bfin_write16(CAN_AM03H, val)
1430#define bfin_read_CAN_AM04L() bfin_read16(CAN_AM04L)
1431#define bfin_write_CAN_AM04L(val) bfin_write16(CAN_AM04L, val)
1432#define bfin_read_CAN_AM04H() bfin_read16(CAN_AM04H)
1433#define bfin_write_CAN_AM04H(val) bfin_write16(CAN_AM04H, val)
1434#define bfin_read_CAN_AM05L() bfin_read16(CAN_AM05L)
1435#define bfin_write_CAN_AM05L(val) bfin_write16(CAN_AM05L, val)
1436#define bfin_read_CAN_AM05H() bfin_read16(CAN_AM05H)
1437#define bfin_write_CAN_AM05H(val) bfin_write16(CAN_AM05H, val)
1438#define bfin_read_CAN_AM06L() bfin_read16(CAN_AM06L)
1439#define bfin_write_CAN_AM06L(val) bfin_write16(CAN_AM06L, val)
1440#define bfin_read_CAN_AM06H() bfin_read16(CAN_AM06H)
1441#define bfin_write_CAN_AM06H(val) bfin_write16(CAN_AM06H, val)
1442#define bfin_read_CAN_AM07L() bfin_read16(CAN_AM07L)
1443#define bfin_write_CAN_AM07L(val) bfin_write16(CAN_AM07L, val)
1444#define bfin_read_CAN_AM07H() bfin_read16(CAN_AM07H)
1445#define bfin_write_CAN_AM07H(val) bfin_write16(CAN_AM07H, val)
1446#define bfin_read_CAN_AM08L() bfin_read16(CAN_AM08L)
1447#define bfin_write_CAN_AM08L(val) bfin_write16(CAN_AM08L, val)
1448#define bfin_read_CAN_AM08H() bfin_read16(CAN_AM08H)
1449#define bfin_write_CAN_AM08H(val) bfin_write16(CAN_AM08H, val)
1450#define bfin_read_CAN_AM09L() bfin_read16(CAN_AM09L)
1451#define bfin_write_CAN_AM09L(val) bfin_write16(CAN_AM09L, val)
1452#define bfin_read_CAN_AM09H() bfin_read16(CAN_AM09H)
1453#define bfin_write_CAN_AM09H(val) bfin_write16(CAN_AM09H, val)
1454#define bfin_read_CAN_AM10L() bfin_read16(CAN_AM10L)
1455#define bfin_write_CAN_AM10L(val) bfin_write16(CAN_AM10L, val)
1456#define bfin_read_CAN_AM10H() bfin_read16(CAN_AM10H)
1457#define bfin_write_CAN_AM10H(val) bfin_write16(CAN_AM10H, val)
1458#define bfin_read_CAN_AM11L() bfin_read16(CAN_AM11L)
1459#define bfin_write_CAN_AM11L(val) bfin_write16(CAN_AM11L, val)
1460#define bfin_read_CAN_AM11H() bfin_read16(CAN_AM11H)
1461#define bfin_write_CAN_AM11H(val) bfin_write16(CAN_AM11H, val)
1462#define bfin_read_CAN_AM12L() bfin_read16(CAN_AM12L)
1463#define bfin_write_CAN_AM12L(val) bfin_write16(CAN_AM12L, val)
1464#define bfin_read_CAN_AM12H() bfin_read16(CAN_AM12H)
1465#define bfin_write_CAN_AM12H(val) bfin_write16(CAN_AM12H, val)
1466#define bfin_read_CAN_AM13L() bfin_read16(CAN_AM13L)
1467#define bfin_write_CAN_AM13L(val) bfin_write16(CAN_AM13L, val)
1468#define bfin_read_CAN_AM13H() bfin_read16(CAN_AM13H)
1469#define bfin_write_CAN_AM13H(val) bfin_write16(CAN_AM13H, val)
1470#define bfin_read_CAN_AM14L() bfin_read16(CAN_AM14L)
1471#define bfin_write_CAN_AM14L(val) bfin_write16(CAN_AM14L, val)
1472#define bfin_read_CAN_AM14H() bfin_read16(CAN_AM14H)
1473#define bfin_write_CAN_AM14H(val) bfin_write16(CAN_AM14H, val)
1474#define bfin_read_CAN_AM15L() bfin_read16(CAN_AM15L)
1475#define bfin_write_CAN_AM15L(val) bfin_write16(CAN_AM15L, val)
1476#define bfin_read_CAN_AM15H() bfin_read16(CAN_AM15H)
1477#define bfin_write_CAN_AM15H(val) bfin_write16(CAN_AM15H, val)
1478#define bfin_read_CAN_AM16L() bfin_read16(CAN_AM16L)
1479#define bfin_write_CAN_AM16L(val) bfin_write16(CAN_AM16L, val)
1480#define bfin_read_CAN_AM16H() bfin_read16(CAN_AM16H)
1481#define bfin_write_CAN_AM16H(val) bfin_write16(CAN_AM16H, val)
1482#define bfin_read_CAN_AM17L() bfin_read16(CAN_AM17L)
1483#define bfin_write_CAN_AM17L(val) bfin_write16(CAN_AM17L, val)
1484#define bfin_read_CAN_AM17H() bfin_read16(CAN_AM17H)
1485#define bfin_write_CAN_AM17H(val) bfin_write16(CAN_AM17H, val)
1486#define bfin_read_CAN_AM18L() bfin_read16(CAN_AM18L)
1487#define bfin_write_CAN_AM18L(val) bfin_write16(CAN_AM18L, val)
1488#define bfin_read_CAN_AM18H() bfin_read16(CAN_AM18H)
1489#define bfin_write_CAN_AM18H(val) bfin_write16(CAN_AM18H, val)
1490#define bfin_read_CAN_AM19L() bfin_read16(CAN_AM19L)
1491#define bfin_write_CAN_AM19L(val) bfin_write16(CAN_AM19L, val)
1492#define bfin_read_CAN_AM19H() bfin_read16(CAN_AM19H)
1493#define bfin_write_CAN_AM19H(val) bfin_write16(CAN_AM19H, val)
1494#define bfin_read_CAN_AM20L() bfin_read16(CAN_AM20L)
1495#define bfin_write_CAN_AM20L(val) bfin_write16(CAN_AM20L, val)
1496#define bfin_read_CAN_AM20H() bfin_read16(CAN_AM20H)
1497#define bfin_write_CAN_AM20H(val) bfin_write16(CAN_AM20H, val)
1498#define bfin_read_CAN_AM21L() bfin_read16(CAN_AM21L)
1499#define bfin_write_CAN_AM21L(val) bfin_write16(CAN_AM21L, val)
1500#define bfin_read_CAN_AM21H() bfin_read16(CAN_AM21H)
1501#define bfin_write_CAN_AM21H(val) bfin_write16(CAN_AM21H, val)
1502#define bfin_read_CAN_AM22L() bfin_read16(CAN_AM22L)
1503#define bfin_write_CAN_AM22L(val) bfin_write16(CAN_AM22L, val)
1504#define bfin_read_CAN_AM22H() bfin_read16(CAN_AM22H)
1505#define bfin_write_CAN_AM22H(val) bfin_write16(CAN_AM22H, val)
1506#define bfin_read_CAN_AM23L() bfin_read16(CAN_AM23L)
1507#define bfin_write_CAN_AM23L(val) bfin_write16(CAN_AM23L, val)
1508#define bfin_read_CAN_AM23H() bfin_read16(CAN_AM23H)
1509#define bfin_write_CAN_AM23H(val) bfin_write16(CAN_AM23H, val)
1510#define bfin_read_CAN_AM24L() bfin_read16(CAN_AM24L)
1511#define bfin_write_CAN_AM24L(val) bfin_write16(CAN_AM24L, val)
1512#define bfin_read_CAN_AM24H() bfin_read16(CAN_AM24H)
1513#define bfin_write_CAN_AM24H(val) bfin_write16(CAN_AM24H, val)
1514#define bfin_read_CAN_AM25L() bfin_read16(CAN_AM25L)
1515#define bfin_write_CAN_AM25L(val) bfin_write16(CAN_AM25L, val)
1516#define bfin_read_CAN_AM25H() bfin_read16(CAN_AM25H)
1517#define bfin_write_CAN_AM25H(val) bfin_write16(CAN_AM25H, val)
1518#define bfin_read_CAN_AM26L() bfin_read16(CAN_AM26L)
1519#define bfin_write_CAN_AM26L(val) bfin_write16(CAN_AM26L, val)
1520#define bfin_read_CAN_AM26H() bfin_read16(CAN_AM26H)
1521#define bfin_write_CAN_AM26H(val) bfin_write16(CAN_AM26H, val)
1522#define bfin_read_CAN_AM27L() bfin_read16(CAN_AM27L)
1523#define bfin_write_CAN_AM27L(val) bfin_write16(CAN_AM27L, val)
1524#define bfin_read_CAN_AM27H() bfin_read16(CAN_AM27H)
1525#define bfin_write_CAN_AM27H(val) bfin_write16(CAN_AM27H, val)
1526#define bfin_read_CAN_AM28L() bfin_read16(CAN_AM28L)
1527#define bfin_write_CAN_AM28L(val) bfin_write16(CAN_AM28L, val)
1528#define bfin_read_CAN_AM28H() bfin_read16(CAN_AM28H)
1529#define bfin_write_CAN_AM28H(val) bfin_write16(CAN_AM28H, val)
1530#define bfin_read_CAN_AM29L() bfin_read16(CAN_AM29L)
1531#define bfin_write_CAN_AM29L(val) bfin_write16(CAN_AM29L, val)
1532#define bfin_read_CAN_AM29H() bfin_read16(CAN_AM29H)
1533#define bfin_write_CAN_AM29H(val) bfin_write16(CAN_AM29H, val)
1534#define bfin_read_CAN_AM30L() bfin_read16(CAN_AM30L)
1535#define bfin_write_CAN_AM30L(val) bfin_write16(CAN_AM30L, val)
1536#define bfin_read_CAN_AM30H() bfin_read16(CAN_AM30H)
1537#define bfin_write_CAN_AM30H(val) bfin_write16(CAN_AM30H, val)
1538#define bfin_read_CAN_AM31L() bfin_read16(CAN_AM31L)
1539#define bfin_write_CAN_AM31L(val) bfin_write16(CAN_AM31L, val)
1540#define bfin_read_CAN_AM31H() bfin_read16(CAN_AM31H)
1541#define bfin_write_CAN_AM31H(val) bfin_write16(CAN_AM31H, val)
1542#define bfin_read_CAN_MB00_DATA0() bfin_read16(CAN_MB00_DATA0)
1543#define bfin_write_CAN_MB00_DATA0(val) bfin_write16(CAN_MB00_DATA0, val)
1544#define bfin_read_CAN_MB00_DATA1() bfin_read16(CAN_MB00_DATA1)
1545#define bfin_write_CAN_MB00_DATA1(val) bfin_write16(CAN_MB00_DATA1, val)
1546#define bfin_read_CAN_MB00_DATA2() bfin_read16(CAN_MB00_DATA2)
1547#define bfin_write_CAN_MB00_DATA2(val) bfin_write16(CAN_MB00_DATA2, val)
1548#define bfin_read_CAN_MB00_DATA3() bfin_read16(CAN_MB00_DATA3)
1549#define bfin_write_CAN_MB00_DATA3(val) bfin_write16(CAN_MB00_DATA3, val)
1550#define bfin_read_CAN_MB00_LENGTH() bfin_read16(CAN_MB00_LENGTH)
1551#define bfin_write_CAN_MB00_LENGTH(val) bfin_write16(CAN_MB00_LENGTH, val)
1552#define bfin_read_CAN_MB00_TIMESTAMP() bfin_read16(CAN_MB00_TIMESTAMP)
1553#define bfin_write_CAN_MB00_TIMESTAMP(val) bfin_write16(CAN_MB00_TIMESTAMP, val)
1554#define bfin_read_CAN_MB00_ID0() bfin_read16(CAN_MB00_ID0)
1555#define bfin_write_CAN_MB00_ID0(val) bfin_write16(CAN_MB00_ID0, val)
1556#define bfin_read_CAN_MB00_ID1() bfin_read16(CAN_MB00_ID1)
1557#define bfin_write_CAN_MB00_ID1(val) bfin_write16(CAN_MB00_ID1, val)
1558#define bfin_read_CAN_MB01_DATA0() bfin_read16(CAN_MB01_DATA0)
1559#define bfin_write_CAN_MB01_DATA0(val) bfin_write16(CAN_MB01_DATA0, val)
1560#define bfin_read_CAN_MB01_DATA1() bfin_read16(CAN_MB01_DATA1)
1561#define bfin_write_CAN_MB01_DATA1(val) bfin_write16(CAN_MB01_DATA1, val)
1562#define bfin_read_CAN_MB01_DATA2() bfin_read16(CAN_MB01_DATA2)
1563#define bfin_write_CAN_MB01_DATA2(val) bfin_write16(CAN_MB01_DATA2, val)
1564#define bfin_read_CAN_MB01_DATA3() bfin_read16(CAN_MB01_DATA3)
1565#define bfin_write_CAN_MB01_DATA3(val) bfin_write16(CAN_MB01_DATA3, val)
1566#define bfin_read_CAN_MB01_LENGTH() bfin_read16(CAN_MB01_LENGTH)
1567#define bfin_write_CAN_MB01_LENGTH(val) bfin_write16(CAN_MB01_LENGTH, val)
1568#define bfin_read_CAN_MB01_TIMESTAMP() bfin_read16(CAN_MB01_TIMESTAMP)
1569#define bfin_write_CAN_MB01_TIMESTAMP(val) bfin_write16(CAN_MB01_TIMESTAMP, val)
1570#define bfin_read_CAN_MB01_ID0() bfin_read16(CAN_MB01_ID0)
1571#define bfin_write_CAN_MB01_ID0(val) bfin_write16(CAN_MB01_ID0, val)
1572#define bfin_read_CAN_MB01_ID1() bfin_read16(CAN_MB01_ID1)
1573#define bfin_write_CAN_MB01_ID1(val) bfin_write16(CAN_MB01_ID1, val)
1574#define bfin_read_CAN_MB02_DATA0() bfin_read16(CAN_MB02_DATA0)
1575#define bfin_write_CAN_MB02_DATA0(val) bfin_write16(CAN_MB02_DATA0, val)
1576#define bfin_read_CAN_MB02_DATA1() bfin_read16(CAN_MB02_DATA1)
1577#define bfin_write_CAN_MB02_DATA1(val) bfin_write16(CAN_MB02_DATA1, val)
1578#define bfin_read_CAN_MB02_DATA2() bfin_read16(CAN_MB02_DATA2)
1579#define bfin_write_CAN_MB02_DATA2(val) bfin_write16(CAN_MB02_DATA2, val)
1580#define bfin_read_CAN_MB02_DATA3() bfin_read16(CAN_MB02_DATA3)
1581#define bfin_write_CAN_MB02_DATA3(val) bfin_write16(CAN_MB02_DATA3, val)
1582#define bfin_read_CAN_MB02_LENGTH() bfin_read16(CAN_MB02_LENGTH)
1583#define bfin_write_CAN_MB02_LENGTH(val) bfin_write16(CAN_MB02_LENGTH, val)
1584#define bfin_read_CAN_MB02_TIMESTAMP() bfin_read16(CAN_MB02_TIMESTAMP)
1585#define bfin_write_CAN_MB02_TIMESTAMP(val) bfin_write16(CAN_MB02_TIMESTAMP, val)
1586#define bfin_read_CAN_MB02_ID0() bfin_read16(CAN_MB02_ID0)
1587#define bfin_write_CAN_MB02_ID0(val) bfin_write16(CAN_MB02_ID0, val)
1588#define bfin_read_CAN_MB02_ID1() bfin_read16(CAN_MB02_ID1)
1589#define bfin_write_CAN_MB02_ID1(val) bfin_write16(CAN_MB02_ID1, val)
1590#define bfin_read_CAN_MB03_DATA0() bfin_read16(CAN_MB03_DATA0)
1591#define bfin_write_CAN_MB03_DATA0(val) bfin_write16(CAN_MB03_DATA0, val)
1592#define bfin_read_CAN_MB03_DATA1() bfin_read16(CAN_MB03_DATA1)
1593#define bfin_write_CAN_MB03_DATA1(val) bfin_write16(CAN_MB03_DATA1, val)
1594#define bfin_read_CAN_MB03_DATA2() bfin_read16(CAN_MB03_DATA2)
1595#define bfin_write_CAN_MB03_DATA2(val) bfin_write16(CAN_MB03_DATA2, val)
1596#define bfin_read_CAN_MB03_DATA3() bfin_read16(CAN_MB03_DATA3)
1597#define bfin_write_CAN_MB03_DATA3(val) bfin_write16(CAN_MB03_DATA3, val)
1598#define bfin_read_CAN_MB03_LENGTH() bfin_read16(CAN_MB03_LENGTH)
1599#define bfin_write_CAN_MB03_LENGTH(val) bfin_write16(CAN_MB03_LENGTH, val)
1600#define bfin_read_CAN_MB03_TIMESTAMP() bfin_read16(CAN_MB03_TIMESTAMP)
1601#define bfin_write_CAN_MB03_TIMESTAMP(val) bfin_write16(CAN_MB03_TIMESTAMP, val)
1602#define bfin_read_CAN_MB03_ID0() bfin_read16(CAN_MB03_ID0)
1603#define bfin_write_CAN_MB03_ID0(val) bfin_write16(CAN_MB03_ID0, val)
1604#define bfin_read_CAN_MB03_ID1() bfin_read16(CAN_MB03_ID1)
1605#define bfin_write_CAN_MB03_ID1(val) bfin_write16(CAN_MB03_ID1, val)
1606#define bfin_read_CAN_MB04_DATA0() bfin_read16(CAN_MB04_DATA0)
1607#define bfin_write_CAN_MB04_DATA0(val) bfin_write16(CAN_MB04_DATA0, val)
1608#define bfin_read_CAN_MB04_DATA1() bfin_read16(CAN_MB04_DATA1)
1609#define bfin_write_CAN_MB04_DATA1(val) bfin_write16(CAN_MB04_DATA1, val)
1610#define bfin_read_CAN_MB04_DATA2() bfin_read16(CAN_MB04_DATA2)
1611#define bfin_write_CAN_MB04_DATA2(val) bfin_write16(CAN_MB04_DATA2, val)
1612#define bfin_read_CAN_MB04_DATA3() bfin_read16(CAN_MB04_DATA3)
1613#define bfin_write_CAN_MB04_DATA3(val) bfin_write16(CAN_MB04_DATA3, val)
1614#define bfin_read_CAN_MB04_LENGTH() bfin_read16(CAN_MB04_LENGTH)
1615#define bfin_write_CAN_MB04_LENGTH(val) bfin_write16(CAN_MB04_LENGTH, val)
1616#define bfin_read_CAN_MB04_TIMESTAMP() bfin_read16(CAN_MB04_TIMESTAMP)
1617#define bfin_write_CAN_MB04_TIMESTAMP(val) bfin_write16(CAN_MB04_TIMESTAMP, val)
1618#define bfin_read_CAN_MB04_ID0() bfin_read16(CAN_MB04_ID0)
1619#define bfin_write_CAN_MB04_ID0(val) bfin_write16(CAN_MB04_ID0, val)
1620#define bfin_read_CAN_MB04_ID1() bfin_read16(CAN_MB04_ID1)
1621#define bfin_write_CAN_MB04_ID1(val) bfin_write16(CAN_MB04_ID1, val)
1622#define bfin_read_CAN_MB05_DATA0() bfin_read16(CAN_MB05_DATA0)
1623#define bfin_write_CAN_MB05_DATA0(val) bfin_write16(CAN_MB05_DATA0, val)
1624#define bfin_read_CAN_MB05_DATA1() bfin_read16(CAN_MB05_DATA1)
1625#define bfin_write_CAN_MB05_DATA1(val) bfin_write16(CAN_MB05_DATA1, val)
1626#define bfin_read_CAN_MB05_DATA2() bfin_read16(CAN_MB05_DATA2)
1627#define bfin_write_CAN_MB05_DATA2(val) bfin_write16(CAN_MB05_DATA2, val)
1628#define bfin_read_CAN_MB05_DATA3() bfin_read16(CAN_MB05_DATA3)
1629#define bfin_write_CAN_MB05_DATA3(val) bfin_write16(CAN_MB05_DATA3, val)
1630#define bfin_read_CAN_MB05_LENGTH() bfin_read16(CAN_MB05_LENGTH)
1631#define bfin_write_CAN_MB05_LENGTH(val) bfin_write16(CAN_MB05_LENGTH, val)
1632#define bfin_read_CAN_MB05_TIMESTAMP() bfin_read16(CAN_MB05_TIMESTAMP)
1633#define bfin_write_CAN_MB05_TIMESTAMP(val) bfin_write16(CAN_MB05_TIMESTAMP, val)
1634#define bfin_read_CAN_MB05_ID0() bfin_read16(CAN_MB05_ID0)
1635#define bfin_write_CAN_MB05_ID0(val) bfin_write16(CAN_MB05_ID0, val)
1636#define bfin_read_CAN_MB05_ID1() bfin_read16(CAN_MB05_ID1)
1637#define bfin_write_CAN_MB05_ID1(val) bfin_write16(CAN_MB05_ID1, val)
1638#define bfin_read_CAN_MB06_DATA0() bfin_read16(CAN_MB06_DATA0)
1639#define bfin_write_CAN_MB06_DATA0(val) bfin_write16(CAN_MB06_DATA0, val)
1640#define bfin_read_CAN_MB06_DATA1() bfin_read16(CAN_MB06_DATA1)
1641#define bfin_write_CAN_MB06_DATA1(val) bfin_write16(CAN_MB06_DATA1, val)
1642#define bfin_read_CAN_MB06_DATA2() bfin_read16(CAN_MB06_DATA2)
1643#define bfin_write_CAN_MB06_DATA2(val) bfin_write16(CAN_MB06_DATA2, val)
1644#define bfin_read_CAN_MB06_DATA3() bfin_read16(CAN_MB06_DATA3)
1645#define bfin_write_CAN_MB06_DATA3(val) bfin_write16(CAN_MB06_DATA3, val)
1646#define bfin_read_CAN_MB06_LENGTH() bfin_read16(CAN_MB06_LENGTH)
1647#define bfin_write_CAN_MB06_LENGTH(val) bfin_write16(CAN_MB06_LENGTH, val)
1648#define bfin_read_CAN_MB06_TIMESTAMP() bfin_read16(CAN_MB06_TIMESTAMP)
1649#define bfin_write_CAN_MB06_TIMESTAMP(val) bfin_write16(CAN_MB06_TIMESTAMP, val)
1650#define bfin_read_CAN_MB06_ID0() bfin_read16(CAN_MB06_ID0)
1651#define bfin_write_CAN_MB06_ID0(val) bfin_write16(CAN_MB06_ID0, val)
1652#define bfin_read_CAN_MB06_ID1() bfin_read16(CAN_MB06_ID1)
1653#define bfin_write_CAN_MB06_ID1(val) bfin_write16(CAN_MB06_ID1, val)
1654#define bfin_read_CAN_MB07_DATA0() bfin_read16(CAN_MB07_DATA0)
1655#define bfin_write_CAN_MB07_DATA0(val) bfin_write16(CAN_MB07_DATA0, val)
1656#define bfin_read_CAN_MB07_DATA1() bfin_read16(CAN_MB07_DATA1)
1657#define bfin_write_CAN_MB07_DATA1(val) bfin_write16(CAN_MB07_DATA1, val)
1658#define bfin_read_CAN_MB07_DATA2() bfin_read16(CAN_MB07_DATA2)
1659#define bfin_write_CAN_MB07_DATA2(val) bfin_write16(CAN_MB07_DATA2, val)
1660#define bfin_read_CAN_MB07_DATA3() bfin_read16(CAN_MB07_DATA3)
1661#define bfin_write_CAN_MB07_DATA3(val) bfin_write16(CAN_MB07_DATA3, val)
1662#define bfin_read_CAN_MB07_LENGTH() bfin_read16(CAN_MB07_LENGTH)
1663#define bfin_write_CAN_MB07_LENGTH(val) bfin_write16(CAN_MB07_LENGTH, val)
1664#define bfin_read_CAN_MB07_TIMESTAMP() bfin_read16(CAN_MB07_TIMESTAMP)
1665#define bfin_write_CAN_MB07_TIMESTAMP(val) bfin_write16(CAN_MB07_TIMESTAMP, val)
1666#define bfin_read_CAN_MB07_ID0() bfin_read16(CAN_MB07_ID0)
1667#define bfin_write_CAN_MB07_ID0(val) bfin_write16(CAN_MB07_ID0, val)
1668#define bfin_read_CAN_MB07_ID1() bfin_read16(CAN_MB07_ID1)
1669#define bfin_write_CAN_MB07_ID1(val) bfin_write16(CAN_MB07_ID1, val)
1670#define bfin_read_CAN_MB08_DATA0() bfin_read16(CAN_MB08_DATA0)
1671#define bfin_write_CAN_MB08_DATA0(val) bfin_write16(CAN_MB08_DATA0, val)
1672#define bfin_read_CAN_MB08_DATA1() bfin_read16(CAN_MB08_DATA1)
1673#define bfin_write_CAN_MB08_DATA1(val) bfin_write16(CAN_MB08_DATA1, val)
1674#define bfin_read_CAN_MB08_DATA2() bfin_read16(CAN_MB08_DATA2)
1675#define bfin_write_CAN_MB08_DATA2(val) bfin_write16(CAN_MB08_DATA2, val)
1676#define bfin_read_CAN_MB08_DATA3() bfin_read16(CAN_MB08_DATA3)
1677#define bfin_write_CAN_MB08_DATA3(val) bfin_write16(CAN_MB08_DATA3, val)
1678#define bfin_read_CAN_MB08_LENGTH() bfin_read16(CAN_MB08_LENGTH)
1679#define bfin_write_CAN_MB08_LENGTH(val) bfin_write16(CAN_MB08_LENGTH, val)
1680#define bfin_read_CAN_MB08_TIMESTAMP() bfin_read16(CAN_MB08_TIMESTAMP)
1681#define bfin_write_CAN_MB08_TIMESTAMP(val) bfin_write16(CAN_MB08_TIMESTAMP, val)
1682#define bfin_read_CAN_MB08_ID0() bfin_read16(CAN_MB08_ID0)
1683#define bfin_write_CAN_MB08_ID0(val) bfin_write16(CAN_MB08_ID0, val)
1684#define bfin_read_CAN_MB08_ID1() bfin_read16(CAN_MB08_ID1)
1685#define bfin_write_CAN_MB08_ID1(val) bfin_write16(CAN_MB08_ID1, val)
1686#define bfin_read_CAN_MB09_DATA0() bfin_read16(CAN_MB09_DATA0)
1687#define bfin_write_CAN_MB09_DATA0(val) bfin_write16(CAN_MB09_DATA0, val)
1688#define bfin_read_CAN_MB09_DATA1() bfin_read16(CAN_MB09_DATA1)
1689#define bfin_write_CAN_MB09_DATA1(val) bfin_write16(CAN_MB09_DATA1, val)
1690#define bfin_read_CAN_MB09_DATA2() bfin_read16(CAN_MB09_DATA2)
1691#define bfin_write_CAN_MB09_DATA2(val) bfin_write16(CAN_MB09_DATA2, val)
1692#define bfin_read_CAN_MB09_DATA3() bfin_read16(CAN_MB09_DATA3)
1693#define bfin_write_CAN_MB09_DATA3(val) bfin_write16(CAN_MB09_DATA3, val)
1694#define bfin_read_CAN_MB09_LENGTH() bfin_read16(CAN_MB09_LENGTH)
1695#define bfin_write_CAN_MB09_LENGTH(val) bfin_write16(CAN_MB09_LENGTH, val)
1696#define bfin_read_CAN_MB09_TIMESTAMP() bfin_read16(CAN_MB09_TIMESTAMP)
1697#define bfin_write_CAN_MB09_TIMESTAMP(val) bfin_write16(CAN_MB09_TIMESTAMP, val)
1698#define bfin_read_CAN_MB09_ID0() bfin_read16(CAN_MB09_ID0)
1699#define bfin_write_CAN_MB09_ID0(val) bfin_write16(CAN_MB09_ID0, val)
1700#define bfin_read_CAN_MB09_ID1() bfin_read16(CAN_MB09_ID1)
1701#define bfin_write_CAN_MB09_ID1(val) bfin_write16(CAN_MB09_ID1, val)
1702#define bfin_read_CAN_MB10_DATA0() bfin_read16(CAN_MB10_DATA0)
1703#define bfin_write_CAN_MB10_DATA0(val) bfin_write16(CAN_MB10_DATA0, val)
1704#define bfin_read_CAN_MB10_DATA1() bfin_read16(CAN_MB10_DATA1)
1705#define bfin_write_CAN_MB10_DATA1(val) bfin_write16(CAN_MB10_DATA1, val)
1706#define bfin_read_CAN_MB10_DATA2() bfin_read16(CAN_MB10_DATA2)
1707#define bfin_write_CAN_MB10_DATA2(val) bfin_write16(CAN_MB10_DATA2, val)
1708#define bfin_read_CAN_MB10_DATA3() bfin_read16(CAN_MB10_DATA3)
1709#define bfin_write_CAN_MB10_DATA3(val) bfin_write16(CAN_MB10_DATA3, val)
1710#define bfin_read_CAN_MB10_LENGTH() bfin_read16(CAN_MB10_LENGTH)
1711#define bfin_write_CAN_MB10_LENGTH(val) bfin_write16(CAN_MB10_LENGTH, val)
1712#define bfin_read_CAN_MB10_TIMESTAMP() bfin_read16(CAN_MB10_TIMESTAMP)
1713#define bfin_write_CAN_MB10_TIMESTAMP(val) bfin_write16(CAN_MB10_TIMESTAMP, val)
1714#define bfin_read_CAN_MB10_ID0() bfin_read16(CAN_MB10_ID0)
1715#define bfin_write_CAN_MB10_ID0(val) bfin_write16(CAN_MB10_ID0, val)
1716#define bfin_read_CAN_MB10_ID1() bfin_read16(CAN_MB10_ID1)
1717#define bfin_write_CAN_MB10_ID1(val) bfin_write16(CAN_MB10_ID1, val)
1718#define bfin_read_CAN_MB11_DATA0() bfin_read16(CAN_MB11_DATA0)
1719#define bfin_write_CAN_MB11_DATA0(val) bfin_write16(CAN_MB11_DATA0, val)
1720#define bfin_read_CAN_MB11_DATA1() bfin_read16(CAN_MB11_DATA1)
1721#define bfin_write_CAN_MB11_DATA1(val) bfin_write16(CAN_MB11_DATA1, val)
1722#define bfin_read_CAN_MB11_DATA2() bfin_read16(CAN_MB11_DATA2)
1723#define bfin_write_CAN_MB11_DATA2(val) bfin_write16(CAN_MB11_DATA2, val)
1724#define bfin_read_CAN_MB11_DATA3() bfin_read16(CAN_MB11_DATA3)
1725#define bfin_write_CAN_MB11_DATA3(val) bfin_write16(CAN_MB11_DATA3, val)
1726#define bfin_read_CAN_MB11_LENGTH() bfin_read16(CAN_MB11_LENGTH)
1727#define bfin_write_CAN_MB11_LENGTH(val) bfin_write16(CAN_MB11_LENGTH, val)
1728#define bfin_read_CAN_MB11_TIMESTAMP() bfin_read16(CAN_MB11_TIMESTAMP)
1729#define bfin_write_CAN_MB11_TIMESTAMP(val) bfin_write16(CAN_MB11_TIMESTAMP, val)
1730#define bfin_read_CAN_MB11_ID0() bfin_read16(CAN_MB11_ID0)
1731#define bfin_write_CAN_MB11_ID0(val) bfin_write16(CAN_MB11_ID0, val)
1732#define bfin_read_CAN_MB11_ID1() bfin_read16(CAN_MB11_ID1)
1733#define bfin_write_CAN_MB11_ID1(val) bfin_write16(CAN_MB11_ID1, val)
1734#define bfin_read_CAN_MB12_DATA0() bfin_read16(CAN_MB12_DATA0)
1735#define bfin_write_CAN_MB12_DATA0(val) bfin_write16(CAN_MB12_DATA0, val)
1736#define bfin_read_CAN_MB12_DATA1() bfin_read16(CAN_MB12_DATA1)
1737#define bfin_write_CAN_MB12_DATA1(val) bfin_write16(CAN_MB12_DATA1, val)
1738#define bfin_read_CAN_MB12_DATA2() bfin_read16(CAN_MB12_DATA2)
1739#define bfin_write_CAN_MB12_DATA2(val) bfin_write16(CAN_MB12_DATA2, val)
1740#define bfin_read_CAN_MB12_DATA3() bfin_read16(CAN_MB12_DATA3)
1741#define bfin_write_CAN_MB12_DATA3(val) bfin_write16(CAN_MB12_DATA3, val)
1742#define bfin_read_CAN_MB12_LENGTH() bfin_read16(CAN_MB12_LENGTH)
1743#define bfin_write_CAN_MB12_LENGTH(val) bfin_write16(CAN_MB12_LENGTH, val)
1744#define bfin_read_CAN_MB12_TIMESTAMP() bfin_read16(CAN_MB12_TIMESTAMP)
1745#define bfin_write_CAN_MB12_TIMESTAMP(val) bfin_write16(CAN_MB12_TIMESTAMP, val)
1746#define bfin_read_CAN_MB12_ID0() bfin_read16(CAN_MB12_ID0)
1747#define bfin_write_CAN_MB12_ID0(val) bfin_write16(CAN_MB12_ID0, val)
1748#define bfin_read_CAN_MB12_ID1() bfin_read16(CAN_MB12_ID1)
1749#define bfin_write_CAN_MB12_ID1(val) bfin_write16(CAN_MB12_ID1, val)
1750#define bfin_read_CAN_MB13_DATA0() bfin_read16(CAN_MB13_DATA0)
1751#define bfin_write_CAN_MB13_DATA0(val) bfin_write16(CAN_MB13_DATA0, val)
1752#define bfin_read_CAN_MB13_DATA1() bfin_read16(CAN_MB13_DATA1)
1753#define bfin_write_CAN_MB13_DATA1(val) bfin_write16(CAN_MB13_DATA1, val)
1754#define bfin_read_CAN_MB13_DATA2() bfin_read16(CAN_MB13_DATA2)
1755#define bfin_write_CAN_MB13_DATA2(val) bfin_write16(CAN_MB13_DATA2, val)
1756#define bfin_read_CAN_MB13_DATA3() bfin_read16(CAN_MB13_DATA3)
1757#define bfin_write_CAN_MB13_DATA3(val) bfin_write16(CAN_MB13_DATA3, val)
1758#define bfin_read_CAN_MB13_LENGTH() bfin_read16(CAN_MB13_LENGTH)
1759#define bfin_write_CAN_MB13_LENGTH(val) bfin_write16(CAN_MB13_LENGTH, val)
1760#define bfin_read_CAN_MB13_TIMESTAMP() bfin_read16(CAN_MB13_TIMESTAMP)
1761#define bfin_write_CAN_MB13_TIMESTAMP(val) bfin_write16(CAN_MB13_TIMESTAMP, val)
1762#define bfin_read_CAN_MB13_ID0() bfin_read16(CAN_MB13_ID0)
1763#define bfin_write_CAN_MB13_ID0(val) bfin_write16(CAN_MB13_ID0, val)
1764#define bfin_read_CAN_MB13_ID1() bfin_read16(CAN_MB13_ID1)
1765#define bfin_write_CAN_MB13_ID1(val) bfin_write16(CAN_MB13_ID1, val)
1766#define bfin_read_CAN_MB14_DATA0() bfin_read16(CAN_MB14_DATA0)
1767#define bfin_write_CAN_MB14_DATA0(val) bfin_write16(CAN_MB14_DATA0, val)
1768#define bfin_read_CAN_MB14_DATA1() bfin_read16(CAN_MB14_DATA1)
1769#define bfin_write_CAN_MB14_DATA1(val) bfin_write16(CAN_MB14_DATA1, val)
1770#define bfin_read_CAN_MB14_DATA2() bfin_read16(CAN_MB14_DATA2)
1771#define bfin_write_CAN_MB14_DATA2(val) bfin_write16(CAN_MB14_DATA2, val)
1772#define bfin_read_CAN_MB14_DATA3() bfin_read16(CAN_MB14_DATA3)
1773#define bfin_write_CAN_MB14_DATA3(val) bfin_write16(CAN_MB14_DATA3, val)
1774#define bfin_read_CAN_MB14_LENGTH() bfin_read16(CAN_MB14_LENGTH)
1775#define bfin_write_CAN_MB14_LENGTH(val) bfin_write16(CAN_MB14_LENGTH, val)
1776#define bfin_read_CAN_MB14_TIMESTAMP() bfin_read16(CAN_MB14_TIMESTAMP)
1777#define bfin_write_CAN_MB14_TIMESTAMP(val) bfin_write16(CAN_MB14_TIMESTAMP, val)
1778#define bfin_read_CAN_MB14_ID0() bfin_read16(CAN_MB14_ID0)
1779#define bfin_write_CAN_MB14_ID0(val) bfin_write16(CAN_MB14_ID0, val)
1780#define bfin_read_CAN_MB14_ID1() bfin_read16(CAN_MB14_ID1)
1781#define bfin_write_CAN_MB14_ID1(val) bfin_write16(CAN_MB14_ID1, val)
1782#define bfin_read_CAN_MB15_DATA0() bfin_read16(CAN_MB15_DATA0)
1783#define bfin_write_CAN_MB15_DATA0(val) bfin_write16(CAN_MB15_DATA0, val)
1784#define bfin_read_CAN_MB15_DATA1() bfin_read16(CAN_MB15_DATA1)
1785#define bfin_write_CAN_MB15_DATA1(val) bfin_write16(CAN_MB15_DATA1, val)
1786#define bfin_read_CAN_MB15_DATA2() bfin_read16(CAN_MB15_DATA2)
1787#define bfin_write_CAN_MB15_DATA2(val) bfin_write16(CAN_MB15_DATA2, val)
1788#define bfin_read_CAN_MB15_DATA3() bfin_read16(CAN_MB15_DATA3)
1789#define bfin_write_CAN_MB15_DATA3(val) bfin_write16(CAN_MB15_DATA3, val)
1790#define bfin_read_CAN_MB15_LENGTH() bfin_read16(CAN_MB15_LENGTH)
1791#define bfin_write_CAN_MB15_LENGTH(val) bfin_write16(CAN_MB15_LENGTH, val)
1792#define bfin_read_CAN_MB15_TIMESTAMP() bfin_read16(CAN_MB15_TIMESTAMP)
1793#define bfin_write_CAN_MB15_TIMESTAMP(val) bfin_write16(CAN_MB15_TIMESTAMP, val)
1794#define bfin_read_CAN_MB15_ID0() bfin_read16(CAN_MB15_ID0)
1795#define bfin_write_CAN_MB15_ID0(val) bfin_write16(CAN_MB15_ID0, val)
1796#define bfin_read_CAN_MB15_ID1() bfin_read16(CAN_MB15_ID1)
1797#define bfin_write_CAN_MB15_ID1(val) bfin_write16(CAN_MB15_ID1, val)
1798#define bfin_read_CAN_MB16_DATA0() bfin_read16(CAN_MB16_DATA0)
1799#define bfin_write_CAN_MB16_DATA0(val) bfin_write16(CAN_MB16_DATA0, val)
1800#define bfin_read_CAN_MB16_DATA1() bfin_read16(CAN_MB16_DATA1)
1801#define bfin_write_CAN_MB16_DATA1(val) bfin_write16(CAN_MB16_DATA1, val)
1802#define bfin_read_CAN_MB16_DATA2() bfin_read16(CAN_MB16_DATA2)
1803#define bfin_write_CAN_MB16_DATA2(val) bfin_write16(CAN_MB16_DATA2, val)
1804#define bfin_read_CAN_MB16_DATA3() bfin_read16(CAN_MB16_DATA3)
1805#define bfin_write_CAN_MB16_DATA3(val) bfin_write16(CAN_MB16_DATA3, val)
1806#define bfin_read_CAN_MB16_LENGTH() bfin_read16(CAN_MB16_LENGTH)
1807#define bfin_write_CAN_MB16_LENGTH(val) bfin_write16(CAN_MB16_LENGTH, val)
1808#define bfin_read_CAN_MB16_TIMESTAMP() bfin_read16(CAN_MB16_TIMESTAMP)
1809#define bfin_write_CAN_MB16_TIMESTAMP(val) bfin_write16(CAN_MB16_TIMESTAMP, val)
1810#define bfin_read_CAN_MB16_ID0() bfin_read16(CAN_MB16_ID0)
1811#define bfin_write_CAN_MB16_ID0(val) bfin_write16(CAN_MB16_ID0, val)
1812#define bfin_read_CAN_MB16_ID1() bfin_read16(CAN_MB16_ID1)
1813#define bfin_write_CAN_MB16_ID1(val) bfin_write16(CAN_MB16_ID1, val)
1814#define bfin_read_CAN_MB17_DATA0() bfin_read16(CAN_MB17_DATA0)
1815#define bfin_write_CAN_MB17_DATA0(val) bfin_write16(CAN_MB17_DATA0, val)
1816#define bfin_read_CAN_MB17_DATA1() bfin_read16(CAN_MB17_DATA1)
1817#define bfin_write_CAN_MB17_DATA1(val) bfin_write16(CAN_MB17_DATA1, val)
1818#define bfin_read_CAN_MB17_DATA2() bfin_read16(CAN_MB17_DATA2)
1819#define bfin_write_CAN_MB17_DATA2(val) bfin_write16(CAN_MB17_DATA2, val)
1820#define bfin_read_CAN_MB17_DATA3() bfin_read16(CAN_MB17_DATA3)
1821#define bfin_write_CAN_MB17_DATA3(val) bfin_write16(CAN_MB17_DATA3, val)
1822#define bfin_read_CAN_MB17_LENGTH() bfin_read16(CAN_MB17_LENGTH)
1823#define bfin_write_CAN_MB17_LENGTH(val) bfin_write16(CAN_MB17_LENGTH, val)
1824#define bfin_read_CAN_MB17_TIMESTAMP() bfin_read16(CAN_MB17_TIMESTAMP)
1825#define bfin_write_CAN_MB17_TIMESTAMP(val) bfin_write16(CAN_MB17_TIMESTAMP, val)
1826#define bfin_read_CAN_MB17_ID0() bfin_read16(CAN_MB17_ID0)
1827#define bfin_write_CAN_MB17_ID0(val) bfin_write16(CAN_MB17_ID0, val)
1828#define bfin_read_CAN_MB17_ID1() bfin_read16(CAN_MB17_ID1)
1829#define bfin_write_CAN_MB17_ID1(val) bfin_write16(CAN_MB17_ID1, val)
1830#define bfin_read_CAN_MB18_DATA0() bfin_read16(CAN_MB18_DATA0)
1831#define bfin_write_CAN_MB18_DATA0(val) bfin_write16(CAN_MB18_DATA0, val)
1832#define bfin_read_CAN_MB18_DATA1() bfin_read16(CAN_MB18_DATA1)
1833#define bfin_write_CAN_MB18_DATA1(val) bfin_write16(CAN_MB18_DATA1, val)
1834#define bfin_read_CAN_MB18_DATA2() bfin_read16(CAN_MB18_DATA2)
1835#define bfin_write_CAN_MB18_DATA2(val) bfin_write16(CAN_MB18_DATA2, val)
1836#define bfin_read_CAN_MB18_DATA3() bfin_read16(CAN_MB18_DATA3)
1837#define bfin_write_CAN_MB18_DATA3(val) bfin_write16(CAN_MB18_DATA3, val)
1838#define bfin_read_CAN_MB18_LENGTH() bfin_read16(CAN_MB18_LENGTH)
1839#define bfin_write_CAN_MB18_LENGTH(val) bfin_write16(CAN_MB18_LENGTH, val)
1840#define bfin_read_CAN_MB18_TIMESTAMP() bfin_read16(CAN_MB18_TIMESTAMP)
1841#define bfin_write_CAN_MB18_TIMESTAMP(val) bfin_write16(CAN_MB18_TIMESTAMP, val)
1842#define bfin_read_CAN_MB18_ID0() bfin_read16(CAN_MB18_ID0)
1843#define bfin_write_CAN_MB18_ID0(val) bfin_write16(CAN_MB18_ID0, val)
1844#define bfin_read_CAN_MB18_ID1() bfin_read16(CAN_MB18_ID1)
1845#define bfin_write_CAN_MB18_ID1(val) bfin_write16(CAN_MB18_ID1, val)
1846#define bfin_read_CAN_MB19_DATA0() bfin_read16(CAN_MB19_DATA0)
1847#define bfin_write_CAN_MB19_DATA0(val) bfin_write16(CAN_MB19_DATA0, val)
1848#define bfin_read_CAN_MB19_DATA1() bfin_read16(CAN_MB19_DATA1)
1849#define bfin_write_CAN_MB19_DATA1(val) bfin_write16(CAN_MB19_DATA1, val)
1850#define bfin_read_CAN_MB19_DATA2() bfin_read16(CAN_MB19_DATA2)
1851#define bfin_write_CAN_MB19_DATA2(val) bfin_write16(CAN_MB19_DATA2, val)
1852#define bfin_read_CAN_MB19_DATA3() bfin_read16(CAN_MB19_DATA3)
1853#define bfin_write_CAN_MB19_DATA3(val) bfin_write16(CAN_MB19_DATA3, val)
1854#define bfin_read_CAN_MB19_LENGTH() bfin_read16(CAN_MB19_LENGTH)
1855#define bfin_write_CAN_MB19_LENGTH(val) bfin_write16(CAN_MB19_LENGTH, val)
1856#define bfin_read_CAN_MB19_TIMESTAMP() bfin_read16(CAN_MB19_TIMESTAMP)
1857#define bfin_write_CAN_MB19_TIMESTAMP(val) bfin_write16(CAN_MB19_TIMESTAMP, val)
1858#define bfin_read_CAN_MB19_ID0() bfin_read16(CAN_MB19_ID0)
1859#define bfin_write_CAN_MB19_ID0(val) bfin_write16(CAN_MB19_ID0, val)
1860#define bfin_read_CAN_MB19_ID1() bfin_read16(CAN_MB19_ID1)
1861#define bfin_write_CAN_MB19_ID1(val) bfin_write16(CAN_MB19_ID1, val)
1862#define bfin_read_CAN_MB20_DATA0() bfin_read16(CAN_MB20_DATA0)
1863#define bfin_write_CAN_MB20_DATA0(val) bfin_write16(CAN_MB20_DATA0, val)
1864#define bfin_read_CAN_MB20_DATA1() bfin_read16(CAN_MB20_DATA1)
1865#define bfin_write_CAN_MB20_DATA1(val) bfin_write16(CAN_MB20_DATA1, val)
1866#define bfin_read_CAN_MB20_DATA2() bfin_read16(CAN_MB20_DATA2)
1867#define bfin_write_CAN_MB20_DATA2(val) bfin_write16(CAN_MB20_DATA2, val)
1868#define bfin_read_CAN_MB20_DATA3() bfin_read16(CAN_MB20_DATA3)
1869#define bfin_write_CAN_MB20_DATA3(val) bfin_write16(CAN_MB20_DATA3, val)
1870#define bfin_read_CAN_MB20_LENGTH() bfin_read16(CAN_MB20_LENGTH)
1871#define bfin_write_CAN_MB20_LENGTH(val) bfin_write16(CAN_MB20_LENGTH, val)
1872#define bfin_read_CAN_MB20_TIMESTAMP() bfin_read16(CAN_MB20_TIMESTAMP)
1873#define bfin_write_CAN_MB20_TIMESTAMP(val) bfin_write16(CAN_MB20_TIMESTAMP, val)
1874#define bfin_read_CAN_MB20_ID0() bfin_read16(CAN_MB20_ID0)
1875#define bfin_write_CAN_MB20_ID0(val) bfin_write16(CAN_MB20_ID0, val)
1876#define bfin_read_CAN_MB20_ID1() bfin_read16(CAN_MB20_ID1)
1877#define bfin_write_CAN_MB20_ID1(val) bfin_write16(CAN_MB20_ID1, val)
1878#define bfin_read_CAN_MB21_DATA0() bfin_read16(CAN_MB21_DATA0)
1879#define bfin_write_CAN_MB21_DATA0(val) bfin_write16(CAN_MB21_DATA0, val)
1880#define bfin_read_CAN_MB21_DATA1() bfin_read16(CAN_MB21_DATA1)
1881#define bfin_write_CAN_MB21_DATA1(val) bfin_write16(CAN_MB21_DATA1, val)
1882#define bfin_read_CAN_MB21_DATA2() bfin_read16(CAN_MB21_DATA2)
1883#define bfin_write_CAN_MB21_DATA2(val) bfin_write16(CAN_MB21_DATA2, val)
1884#define bfin_read_CAN_MB21_DATA3() bfin_read16(CAN_MB21_DATA3)
1885#define bfin_write_CAN_MB21_DATA3(val) bfin_write16(CAN_MB21_DATA3, val)
1886#define bfin_read_CAN_MB21_LENGTH() bfin_read16(CAN_MB21_LENGTH)
1887#define bfin_write_CAN_MB21_LENGTH(val) bfin_write16(CAN_MB21_LENGTH, val)
1888#define bfin_read_CAN_MB21_TIMESTAMP() bfin_read16(CAN_MB21_TIMESTAMP)
1889#define bfin_write_CAN_MB21_TIMESTAMP(val) bfin_write16(CAN_MB21_TIMESTAMP, val)
1890#define bfin_read_CAN_MB21_ID0() bfin_read16(CAN_MB21_ID0)
1891#define bfin_write_CAN_MB21_ID0(val) bfin_write16(CAN_MB21_ID0, val)
1892#define bfin_read_CAN_MB21_ID1() bfin_read16(CAN_MB21_ID1)
1893#define bfin_write_CAN_MB21_ID1(val) bfin_write16(CAN_MB21_ID1, val)
1894#define bfin_read_CAN_MB22_DATA0() bfin_read16(CAN_MB22_DATA0)
1895#define bfin_write_CAN_MB22_DATA0(val) bfin_write16(CAN_MB22_DATA0, val)
1896#define bfin_read_CAN_MB22_DATA1() bfin_read16(CAN_MB22_DATA1)
1897#define bfin_write_CAN_MB22_DATA1(val) bfin_write16(CAN_MB22_DATA1, val)
1898#define bfin_read_CAN_MB22_DATA2() bfin_read16(CAN_MB22_DATA2)
1899#define bfin_write_CAN_MB22_DATA2(val) bfin_write16(CAN_MB22_DATA2, val)
1900#define bfin_read_CAN_MB22_DATA3() bfin_read16(CAN_MB22_DATA3)
1901#define bfin_write_CAN_MB22_DATA3(val) bfin_write16(CAN_MB22_DATA3, val)
1902#define bfin_read_CAN_MB22_LENGTH() bfin_read16(CAN_MB22_LENGTH)
1903#define bfin_write_CAN_MB22_LENGTH(val) bfin_write16(CAN_MB22_LENGTH, val)
1904#define bfin_read_CAN_MB22_TIMESTAMP() bfin_read16(CAN_MB22_TIMESTAMP)
1905#define bfin_write_CAN_MB22_TIMESTAMP(val) bfin_write16(CAN_MB22_TIMESTAMP, val)
1906#define bfin_read_CAN_MB22_ID0() bfin_read16(CAN_MB22_ID0)
1907#define bfin_write_CAN_MB22_ID0(val) bfin_write16(CAN_MB22_ID0, val)
1908#define bfin_read_CAN_MB22_ID1() bfin_read16(CAN_MB22_ID1)
1909#define bfin_write_CAN_MB22_ID1(val) bfin_write16(CAN_MB22_ID1, val)
1910#define bfin_read_CAN_MB23_DATA0() bfin_read16(CAN_MB23_DATA0)
1911#define bfin_write_CAN_MB23_DATA0(val) bfin_write16(CAN_MB23_DATA0, val)
1912#define bfin_read_CAN_MB23_DATA1() bfin_read16(CAN_MB23_DATA1)
1913#define bfin_write_CAN_MB23_DATA1(val) bfin_write16(CAN_MB23_DATA1, val)
1914#define bfin_read_CAN_MB23_DATA2() bfin_read16(CAN_MB23_DATA2)
1915#define bfin_write_CAN_MB23_DATA2(val) bfin_write16(CAN_MB23_DATA2, val)
1916#define bfin_read_CAN_MB23_DATA3() bfin_read16(CAN_MB23_DATA3)
1917#define bfin_write_CAN_MB23_DATA3(val) bfin_write16(CAN_MB23_DATA3, val)
1918#define bfin_read_CAN_MB23_LENGTH() bfin_read16(CAN_MB23_LENGTH)
1919#define bfin_write_CAN_MB23_LENGTH(val) bfin_write16(CAN_MB23_LENGTH, val)
1920#define bfin_read_CAN_MB23_TIMESTAMP() bfin_read16(CAN_MB23_TIMESTAMP)
1921#define bfin_write_CAN_MB23_TIMESTAMP(val) bfin_write16(CAN_MB23_TIMESTAMP, val)
1922#define bfin_read_CAN_MB23_ID0() bfin_read16(CAN_MB23_ID0)
1923#define bfin_write_CAN_MB23_ID0(val) bfin_write16(CAN_MB23_ID0, val)
1924#define bfin_read_CAN_MB23_ID1() bfin_read16(CAN_MB23_ID1)
1925#define bfin_write_CAN_MB23_ID1(val) bfin_write16(CAN_MB23_ID1, val)
1926#define bfin_read_CAN_MB24_DATA0() bfin_read16(CAN_MB24_DATA0)
1927#define bfin_write_CAN_MB24_DATA0(val) bfin_write16(CAN_MB24_DATA0, val)
1928#define bfin_read_CAN_MB24_DATA1() bfin_read16(CAN_MB24_DATA1)
1929#define bfin_write_CAN_MB24_DATA1(val) bfin_write16(CAN_MB24_DATA1, val)
1930#define bfin_read_CAN_MB24_DATA2() bfin_read16(CAN_MB24_DATA2)
1931#define bfin_write_CAN_MB24_DATA2(val) bfin_write16(CAN_MB24_DATA2, val)
1932#define bfin_read_CAN_MB24_DATA3() bfin_read16(CAN_MB24_DATA3)
1933#define bfin_write_CAN_MB24_DATA3(val) bfin_write16(CAN_MB24_DATA3, val)
1934#define bfin_read_CAN_MB24_LENGTH() bfin_read16(CAN_MB24_LENGTH)
1935#define bfin_write_CAN_MB24_LENGTH(val) bfin_write16(CAN_MB24_LENGTH, val)
1936#define bfin_read_CAN_MB24_TIMESTAMP() bfin_read16(CAN_MB24_TIMESTAMP)
1937#define bfin_write_CAN_MB24_TIMESTAMP(val) bfin_write16(CAN_MB24_TIMESTAMP, val)
1938#define bfin_read_CAN_MB24_ID0() bfin_read16(CAN_MB24_ID0)
1939#define bfin_write_CAN_MB24_ID0(val) bfin_write16(CAN_MB24_ID0, val)
1940#define bfin_read_CAN_MB24_ID1() bfin_read16(CAN_MB24_ID1)
1941#define bfin_write_CAN_MB24_ID1(val) bfin_write16(CAN_MB24_ID1, val)
1942#define bfin_read_CAN_MB25_DATA0() bfin_read16(CAN_MB25_DATA0)
1943#define bfin_write_CAN_MB25_DATA0(val) bfin_write16(CAN_MB25_DATA0, val)
1944#define bfin_read_CAN_MB25_DATA1() bfin_read16(CAN_MB25_DATA1)
1945#define bfin_write_CAN_MB25_DATA1(val) bfin_write16(CAN_MB25_DATA1, val)
1946#define bfin_read_CAN_MB25_DATA2() bfin_read16(CAN_MB25_DATA2)
1947#define bfin_write_CAN_MB25_DATA2(val) bfin_write16(CAN_MB25_DATA2, val)
1948#define bfin_read_CAN_MB25_DATA3() bfin_read16(CAN_MB25_DATA3)
1949#define bfin_write_CAN_MB25_DATA3(val) bfin_write16(CAN_MB25_DATA3, val)
1950#define bfin_read_CAN_MB25_LENGTH() bfin_read16(CAN_MB25_LENGTH)
1951#define bfin_write_CAN_MB25_LENGTH(val) bfin_write16(CAN_MB25_LENGTH, val)
1952#define bfin_read_CAN_MB25_TIMESTAMP() bfin_read16(CAN_MB25_TIMESTAMP)
1953#define bfin_write_CAN_MB25_TIMESTAMP(val) bfin_write16(CAN_MB25_TIMESTAMP, val)
1954#define bfin_read_CAN_MB25_ID0() bfin_read16(CAN_MB25_ID0)
1955#define bfin_write_CAN_MB25_ID0(val) bfin_write16(CAN_MB25_ID0, val)
1956#define bfin_read_CAN_MB25_ID1() bfin_read16(CAN_MB25_ID1)
1957#define bfin_write_CAN_MB25_ID1(val) bfin_write16(CAN_MB25_ID1, val)
1958#define bfin_read_CAN_MB26_DATA0() bfin_read16(CAN_MB26_DATA0)
1959#define bfin_write_CAN_MB26_DATA0(val) bfin_write16(CAN_MB26_DATA0, val)
1960#define bfin_read_CAN_MB26_DATA1() bfin_read16(CAN_MB26_DATA1)
1961#define bfin_write_CAN_MB26_DATA1(val) bfin_write16(CAN_MB26_DATA1, val)
1962#define bfin_read_CAN_MB26_DATA2() bfin_read16(CAN_MB26_DATA2)
1963#define bfin_write_CAN_MB26_DATA2(val) bfin_write16(CAN_MB26_DATA2, val)
1964#define bfin_read_CAN_MB26_DATA3() bfin_read16(CAN_MB26_DATA3)
1965#define bfin_write_CAN_MB26_DATA3(val) bfin_write16(CAN_MB26_DATA3, val)
1966#define bfin_read_CAN_MB26_LENGTH() bfin_read16(CAN_MB26_LENGTH)
1967#define bfin_write_CAN_MB26_LENGTH(val) bfin_write16(CAN_MB26_LENGTH, val)
1968#define bfin_read_CAN_MB26_TIMESTAMP() bfin_read16(CAN_MB26_TIMESTAMP)
1969#define bfin_write_CAN_MB26_TIMESTAMP(val) bfin_write16(CAN_MB26_TIMESTAMP, val)
1970#define bfin_read_CAN_MB26_ID0() bfin_read16(CAN_MB26_ID0)
1971#define bfin_write_CAN_MB26_ID0(val) bfin_write16(CAN_MB26_ID0, val)
1972#define bfin_read_CAN_MB26_ID1() bfin_read16(CAN_MB26_ID1)
1973#define bfin_write_CAN_MB26_ID1(val) bfin_write16(CAN_MB26_ID1, val)
1974#define bfin_read_CAN_MB27_DATA0() bfin_read16(CAN_MB27_DATA0)
1975#define bfin_write_CAN_MB27_DATA0(val) bfin_write16(CAN_MB27_DATA0, val)
1976#define bfin_read_CAN_MB27_DATA1() bfin_read16(CAN_MB27_DATA1)
1977#define bfin_write_CAN_MB27_DATA1(val) bfin_write16(CAN_MB27_DATA1, val)
1978#define bfin_read_CAN_MB27_DATA2() bfin_read16(CAN_MB27_DATA2)
1979#define bfin_write_CAN_MB27_DATA2(val) bfin_write16(CAN_MB27_DATA2, val)
1980#define bfin_read_CAN_MB27_DATA3() bfin_read16(CAN_MB27_DATA3)
1981#define bfin_write_CAN_MB27_DATA3(val) bfin_write16(CAN_MB27_DATA3, val)
1982#define bfin_read_CAN_MB27_LENGTH() bfin_read16(CAN_MB27_LENGTH)
1983#define bfin_write_CAN_MB27_LENGTH(val) bfin_write16(CAN_MB27_LENGTH, val)
1984#define bfin_read_CAN_MB27_TIMESTAMP() bfin_read16(CAN_MB27_TIMESTAMP)
1985#define bfin_write_CAN_MB27_TIMESTAMP(val) bfin_write16(CAN_MB27_TIMESTAMP, val)
1986#define bfin_read_CAN_MB27_ID0() bfin_read16(CAN_MB27_ID0)
1987#define bfin_write_CAN_MB27_ID0(val) bfin_write16(CAN_MB27_ID0, val)
1988#define bfin_read_CAN_MB27_ID1() bfin_read16(CAN_MB27_ID1)
1989#define bfin_write_CAN_MB27_ID1(val) bfin_write16(CAN_MB27_ID1, val)
1990#define bfin_read_CAN_MB28_DATA0() bfin_read16(CAN_MB28_DATA0)
1991#define bfin_write_CAN_MB28_DATA0(val) bfin_write16(CAN_MB28_DATA0, val)
1992#define bfin_read_CAN_MB28_DATA1() bfin_read16(CAN_MB28_DATA1)
1993#define bfin_write_CAN_MB28_DATA1(val) bfin_write16(CAN_MB28_DATA1, val)
1994#define bfin_read_CAN_MB28_DATA2() bfin_read16(CAN_MB28_DATA2)
1995#define bfin_write_CAN_MB28_DATA2(val) bfin_write16(CAN_MB28_DATA2, val)
1996#define bfin_read_CAN_MB28_DATA3() bfin_read16(CAN_MB28_DATA3)
1997#define bfin_write_CAN_MB28_DATA3(val) bfin_write16(CAN_MB28_DATA3, val)
1998#define bfin_read_CAN_MB28_LENGTH() bfin_read16(CAN_MB28_LENGTH)
1999#define bfin_write_CAN_MB28_LENGTH(val) bfin_write16(CAN_MB28_LENGTH, val)
2000#define bfin_read_CAN_MB28_TIMESTAMP() bfin_read16(CAN_MB28_TIMESTAMP)
2001#define bfin_write_CAN_MB28_TIMESTAMP(val) bfin_write16(CAN_MB28_TIMESTAMP, val)
2002#define bfin_read_CAN_MB28_ID0() bfin_read16(CAN_MB28_ID0)
2003#define bfin_write_CAN_MB28_ID0(val) bfin_write16(CAN_MB28_ID0, val)
2004#define bfin_read_CAN_MB28_ID1() bfin_read16(CAN_MB28_ID1)
2005#define bfin_write_CAN_MB28_ID1(val) bfin_write16(CAN_MB28_ID1, val)
2006#define bfin_read_CAN_MB29_DATA0() bfin_read16(CAN_MB29_DATA0)
2007#define bfin_write_CAN_MB29_DATA0(val) bfin_write16(CAN_MB29_DATA0, val)
2008#define bfin_read_CAN_MB29_DATA1() bfin_read16(CAN_MB29_DATA1)
2009#define bfin_write_CAN_MB29_DATA1(val) bfin_write16(CAN_MB29_DATA1, val)
2010#define bfin_read_CAN_MB29_DATA2() bfin_read16(CAN_MB29_DATA2)
2011#define bfin_write_CAN_MB29_DATA2(val) bfin_write16(CAN_MB29_DATA2, val)
2012#define bfin_read_CAN_MB29_DATA3() bfin_read16(CAN_MB29_DATA3)
2013#define bfin_write_CAN_MB29_DATA3(val) bfin_write16(CAN_MB29_DATA3, val)
2014#define bfin_read_CAN_MB29_LENGTH() bfin_read16(CAN_MB29_LENGTH)
2015#define bfin_write_CAN_MB29_LENGTH(val) bfin_write16(CAN_MB29_LENGTH, val)
2016#define bfin_read_CAN_MB29_TIMESTAMP() bfin_read16(CAN_MB29_TIMESTAMP)
2017#define bfin_write_CAN_MB29_TIMESTAMP(val) bfin_write16(CAN_MB29_TIMESTAMP, val)
2018#define bfin_read_CAN_MB29_ID0() bfin_read16(CAN_MB29_ID0)
2019#define bfin_write_CAN_MB29_ID0(val) bfin_write16(CAN_MB29_ID0, val)
2020#define bfin_read_CAN_MB29_ID1() bfin_read16(CAN_MB29_ID1)
2021#define bfin_write_CAN_MB29_ID1(val) bfin_write16(CAN_MB29_ID1, val)
2022#define bfin_read_CAN_MB30_DATA0() bfin_read16(CAN_MB30_DATA0)
2023#define bfin_write_CAN_MB30_DATA0(val) bfin_write16(CAN_MB30_DATA0, val)
2024#define bfin_read_CAN_MB30_DATA1() bfin_read16(CAN_MB30_DATA1)
2025#define bfin_write_CAN_MB30_DATA1(val) bfin_write16(CAN_MB30_DATA1, val)
2026#define bfin_read_CAN_MB30_DATA2() bfin_read16(CAN_MB30_DATA2)
2027#define bfin_write_CAN_MB30_DATA2(val) bfin_write16(CAN_MB30_DATA2, val)
2028#define bfin_read_CAN_MB30_DATA3() bfin_read16(CAN_MB30_DATA3)
2029#define bfin_write_CAN_MB30_DATA3(val) bfin_write16(CAN_MB30_DATA3, val)
2030#define bfin_read_CAN_MB30_LENGTH() bfin_read16(CAN_MB30_LENGTH)
2031#define bfin_write_CAN_MB30_LENGTH(val) bfin_write16(CAN_MB30_LENGTH, val)
2032#define bfin_read_CAN_MB30_TIMESTAMP() bfin_read16(CAN_MB30_TIMESTAMP)
2033#define bfin_write_CAN_MB30_TIMESTAMP(val) bfin_write16(CAN_MB30_TIMESTAMP, val)
2034#define bfin_read_CAN_MB30_ID0() bfin_read16(CAN_MB30_ID0)
2035#define bfin_write_CAN_MB30_ID0(val) bfin_write16(CAN_MB30_ID0, val)
2036#define bfin_read_CAN_MB30_ID1() bfin_read16(CAN_MB30_ID1)
2037#define bfin_write_CAN_MB30_ID1(val) bfin_write16(CAN_MB30_ID1, val)
2038#define bfin_read_CAN_MB31_DATA0() bfin_read16(CAN_MB31_DATA0)
2039#define bfin_write_CAN_MB31_DATA0(val) bfin_write16(CAN_MB31_DATA0, val)
2040#define bfin_read_CAN_MB31_DATA1() bfin_read16(CAN_MB31_DATA1)
2041#define bfin_write_CAN_MB31_DATA1(val) bfin_write16(CAN_MB31_DATA1, val)
2042#define bfin_read_CAN_MB31_DATA2() bfin_read16(CAN_MB31_DATA2)
2043#define bfin_write_CAN_MB31_DATA2(val) bfin_write16(CAN_MB31_DATA2, val)
2044#define bfin_read_CAN_MB31_DATA3() bfin_read16(CAN_MB31_DATA3)
2045#define bfin_write_CAN_MB31_DATA3(val) bfin_write16(CAN_MB31_DATA3, val)
2046#define bfin_read_CAN_MB31_LENGTH() bfin_read16(CAN_MB31_LENGTH)
2047#define bfin_write_CAN_MB31_LENGTH(val) bfin_write16(CAN_MB31_LENGTH, val)
2048#define bfin_read_CAN_MB31_TIMESTAMP() bfin_read16(CAN_MB31_TIMESTAMP)
2049#define bfin_write_CAN_MB31_TIMESTAMP(val) bfin_write16(CAN_MB31_TIMESTAMP, val)
2050#define bfin_read_CAN_MB31_ID0() bfin_read16(CAN_MB31_ID0)
2051#define bfin_write_CAN_MB31_ID0(val) bfin_write16(CAN_MB31_ID0, val)
2052#define bfin_read_CAN_MB31_ID1() bfin_read16(CAN_MB31_ID1)
2053#define bfin_write_CAN_MB31_ID1(val) bfin_write16(CAN_MB31_ID1, val)
2054
2055/* These need to be last due to the cdef/linux inter-dependencies */
2056#include <asm/irq.h>
2057
2058/* Writing to PLL_CTL initiates a PLL relock sequence. */
2059static __inline__ void bfin_write_PLL_CTL(unsigned int val)
2060{
2061 unsigned long flags, iwr0, iwr1;
2062
2063 if (val == bfin_read_PLL_CTL())
2064 return;
2065
2066 local_irq_save_hw(flags);
2067 /* Enable the PLL Wakeup bit in SIC IWR */
2068 iwr0 = bfin_read32(SIC_IWR0);
2069 iwr1 = bfin_read32(SIC_IWR1);
2070 /* Only allow PPL Wakeup) */
2071 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
2072 bfin_write32(SIC_IWR1, 0);
2073
2074 bfin_write16(PLL_CTL, val);
2075 SSYNC();
2076 asm("IDLE;");
2077
2078 bfin_write32(SIC_IWR0, iwr0);
2079 bfin_write32(SIC_IWR1, iwr1);
2080 local_irq_restore_hw(flags);
2081}
2082
2083/* Writing to VR_CTL initiates a PLL relock sequence. */
2084static __inline__ void bfin_write_VR_CTL(unsigned int val)
2085{
2086 unsigned long flags, iwr0, iwr1;
2087
2088 if (val == bfin_read_VR_CTL())
2089 return;
2090
2091 local_irq_save_hw(flags);
2092 /* Enable the PLL Wakeup bit in SIC IWR */
2093 iwr0 = bfin_read32(SIC_IWR0);
2094 iwr1 = bfin_read32(SIC_IWR1);
2095 /* Only allow PPL Wakeup) */
2096 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
2097 bfin_write32(SIC_IWR1, 0);
2098
2099 bfin_write16(VR_CTL, val);
2100 SSYNC();
2101 asm("IDLE;");
2102
2103 bfin_write32(SIC_IWR0, iwr0);
2104 bfin_write32(SIC_IWR1, iwr1);
2105 local_irq_restore_hw(flags);
2106}
2107
2108#endif
diff --git a/arch/blackfin/mach-bf538/include/mach/cdefBF539.h b/arch/blackfin/mach-bf538/include/mach/cdefBF539.h
new file mode 100644
index 000000000000..198c4bbc8e5d
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/cdefBF539.h
@@ -0,0 +1,240 @@
1/* DO NOT EDIT THIS FILE
2 * Automatically generated by generate-cdef-headers.xsl
3 * DO NOT EDIT THIS FILE
4 */
5
6#ifndef _CDEF_BF539_H
7#define _CDEF_BF539_H
8
9/* Include MMRs Common to BF538 */
10#include "cdefBF538.h"
11
12
13#define bfin_read_MXVR_CONFIG() bfin_read16(MXVR_CONFIG)
14#define bfin_write_MXVR_CONFIG(val) bfin_write16(MXVR_CONFIG, val)
15#define bfin_read_MXVR_PLL_CTL_0() bfin_read32(MXVR_PLL_CTL_0)
16#define bfin_write_MXVR_PLL_CTL_0(val) bfin_write32(MXVR_PLL_CTL_0, val)
17#define bfin_read_MXVR_STATE_0() bfin_read32(MXVR_STATE_0)
18#define bfin_write_MXVR_STATE_0(val) bfin_write32(MXVR_STATE_0, val)
19#define bfin_read_MXVR_STATE_1() bfin_read32(MXVR_STATE_1)
20#define bfin_write_MXVR_STATE_1(val) bfin_write32(MXVR_STATE_1, val)
21#define bfin_read_MXVR_INT_STAT_0() bfin_read32(MXVR_INT_STAT_0)
22#define bfin_write_MXVR_INT_STAT_0(val) bfin_write32(MXVR_INT_STAT_0, val)
23#define bfin_read_MXVR_INT_STAT_1() bfin_read32(MXVR_INT_STAT_1)
24#define bfin_write_MXVR_INT_STAT_1(val) bfin_write32(MXVR_INT_STAT_1, val)
25#define bfin_read_MXVR_INT_EN_0() bfin_read32(MXVR_INT_EN_0)
26#define bfin_write_MXVR_INT_EN_0(val) bfin_write32(MXVR_INT_EN_0, val)
27#define bfin_read_MXVR_INT_EN_1() bfin_read32(MXVR_INT_EN_1)
28#define bfin_write_MXVR_INT_EN_1(val) bfin_write32(MXVR_INT_EN_1, val)
29#define bfin_read_MXVR_POSITION() bfin_read16(MXVR_POSITION)
30#define bfin_write_MXVR_POSITION(val) bfin_write16(MXVR_POSITION, val)
31#define bfin_read_MXVR_MAX_POSITION() bfin_read16(MXVR_MAX_POSITION)
32#define bfin_write_MXVR_MAX_POSITION(val) bfin_write16(MXVR_MAX_POSITION, val)
33#define bfin_read_MXVR_DELAY() bfin_read16(MXVR_DELAY)
34#define bfin_write_MXVR_DELAY(val) bfin_write16(MXVR_DELAY, val)
35#define bfin_read_MXVR_MAX_DELAY() bfin_read16(MXVR_MAX_DELAY)
36#define bfin_write_MXVR_MAX_DELAY(val) bfin_write16(MXVR_MAX_DELAY, val)
37#define bfin_read_MXVR_LADDR() bfin_read32(MXVR_LADDR)
38#define bfin_write_MXVR_LADDR(val) bfin_write32(MXVR_LADDR, val)
39#define bfin_read_MXVR_GADDR() bfin_read16(MXVR_GADDR)
40#define bfin_write_MXVR_GADDR(val) bfin_write16(MXVR_GADDR, val)
41#define bfin_read_MXVR_AADDR() bfin_read32(MXVR_AADDR)
42#define bfin_write_MXVR_AADDR(val) bfin_write32(MXVR_AADDR, val)
43#define bfin_read_MXVR_ALLOC_0() bfin_read32(MXVR_ALLOC_0)
44#define bfin_write_MXVR_ALLOC_0(val) bfin_write32(MXVR_ALLOC_0, val)
45#define bfin_read_MXVR_ALLOC_1() bfin_read32(MXVR_ALLOC_1)
46#define bfin_write_MXVR_ALLOC_1(val) bfin_write32(MXVR_ALLOC_1, val)
47#define bfin_read_MXVR_ALLOC_2() bfin_read32(MXVR_ALLOC_2)
48#define bfin_write_MXVR_ALLOC_2(val) bfin_write32(MXVR_ALLOC_2, val)
49#define bfin_read_MXVR_ALLOC_3() bfin_read32(MXVR_ALLOC_3)
50#define bfin_write_MXVR_ALLOC_3(val) bfin_write32(MXVR_ALLOC_3, val)
51#define bfin_read_MXVR_ALLOC_4() bfin_read32(MXVR_ALLOC_4)
52#define bfin_write_MXVR_ALLOC_4(val) bfin_write32(MXVR_ALLOC_4, val)
53#define bfin_read_MXVR_ALLOC_5() bfin_read32(MXVR_ALLOC_5)
54#define bfin_write_MXVR_ALLOC_5(val) bfin_write32(MXVR_ALLOC_5, val)
55#define bfin_read_MXVR_ALLOC_6() bfin_read32(MXVR_ALLOC_6)
56#define bfin_write_MXVR_ALLOC_6(val) bfin_write32(MXVR_ALLOC_6, val)
57#define bfin_read_MXVR_ALLOC_7() bfin_read32(MXVR_ALLOC_7)
58#define bfin_write_MXVR_ALLOC_7(val) bfin_write32(MXVR_ALLOC_7, val)
59#define bfin_read_MXVR_ALLOC_8() bfin_read32(MXVR_ALLOC_8)
60#define bfin_write_MXVR_ALLOC_8(val) bfin_write32(MXVR_ALLOC_8, val)
61#define bfin_read_MXVR_ALLOC_9() bfin_read32(MXVR_ALLOC_9)
62#define bfin_write_MXVR_ALLOC_9(val) bfin_write32(MXVR_ALLOC_9, val)
63#define bfin_read_MXVR_ALLOC_10() bfin_read32(MXVR_ALLOC_10)
64#define bfin_write_MXVR_ALLOC_10(val) bfin_write32(MXVR_ALLOC_10, val)
65#define bfin_read_MXVR_ALLOC_11() bfin_read32(MXVR_ALLOC_11)
66#define bfin_write_MXVR_ALLOC_11(val) bfin_write32(MXVR_ALLOC_11, val)
67#define bfin_read_MXVR_ALLOC_12() bfin_read32(MXVR_ALLOC_12)
68#define bfin_write_MXVR_ALLOC_12(val) bfin_write32(MXVR_ALLOC_12, val)
69#define bfin_read_MXVR_ALLOC_13() bfin_read32(MXVR_ALLOC_13)
70#define bfin_write_MXVR_ALLOC_13(val) bfin_write32(MXVR_ALLOC_13, val)
71#define bfin_read_MXVR_ALLOC_14() bfin_read32(MXVR_ALLOC_14)
72#define bfin_write_MXVR_ALLOC_14(val) bfin_write32(MXVR_ALLOC_14, val)
73#define bfin_read_MXVR_SYNC_LCHAN_0() bfin_read32(MXVR_SYNC_LCHAN_0)
74#define bfin_write_MXVR_SYNC_LCHAN_0(val) bfin_write32(MXVR_SYNC_LCHAN_0, val)
75#define bfin_read_MXVR_SYNC_LCHAN_1() bfin_read32(MXVR_SYNC_LCHAN_1)
76#define bfin_write_MXVR_SYNC_LCHAN_1(val) bfin_write32(MXVR_SYNC_LCHAN_1, val)
77#define bfin_read_MXVR_SYNC_LCHAN_2() bfin_read32(MXVR_SYNC_LCHAN_2)
78#define bfin_write_MXVR_SYNC_LCHAN_2(val) bfin_write32(MXVR_SYNC_LCHAN_2, val)
79#define bfin_read_MXVR_SYNC_LCHAN_3() bfin_read32(MXVR_SYNC_LCHAN_3)
80#define bfin_write_MXVR_SYNC_LCHAN_3(val) bfin_write32(MXVR_SYNC_LCHAN_3, val)
81#define bfin_read_MXVR_SYNC_LCHAN_4() bfin_read32(MXVR_SYNC_LCHAN_4)
82#define bfin_write_MXVR_SYNC_LCHAN_4(val) bfin_write32(MXVR_SYNC_LCHAN_4, val)
83#define bfin_read_MXVR_SYNC_LCHAN_5() bfin_read32(MXVR_SYNC_LCHAN_5)
84#define bfin_write_MXVR_SYNC_LCHAN_5(val) bfin_write32(MXVR_SYNC_LCHAN_5, val)
85#define bfin_read_MXVR_SYNC_LCHAN_6() bfin_read32(MXVR_SYNC_LCHAN_6)
86#define bfin_write_MXVR_SYNC_LCHAN_6(val) bfin_write32(MXVR_SYNC_LCHAN_6, val)
87#define bfin_read_MXVR_SYNC_LCHAN_7() bfin_read32(MXVR_SYNC_LCHAN_7)
88#define bfin_write_MXVR_SYNC_LCHAN_7(val) bfin_write32(MXVR_SYNC_LCHAN_7, val)
89#define bfin_read_MXVR_DMA0_CONFIG() bfin_read32(MXVR_DMA0_CONFIG)
90#define bfin_write_MXVR_DMA0_CONFIG(val) bfin_write32(MXVR_DMA0_CONFIG, val)
91#define bfin_read_MXVR_DMA0_START_ADDR() bfin_readPTR(MXVR_DMA0_START_ADDR)
92#define bfin_write_MXVR_DMA0_START_ADDR(val) bfin_writePTR(MXVR_DMA0_START_ADDR, val)
93#define bfin_read_MXVR_DMA0_COUNT() bfin_read16(MXVR_DMA0_COUNT)
94#define bfin_write_MXVR_DMA0_COUNT(val) bfin_write16(MXVR_DMA0_COUNT, val)
95#define bfin_read_MXVR_DMA0_CURR_ADDR() bfin_readPTR(MXVR_DMA0_CURR_ADDR)
96#define bfin_write_MXVR_DMA0_CURR_ADDR(val) bfin_writePTR(MXVR_DMA0_CURR_ADDR, val)
97#define bfin_read_MXVR_DMA0_CURR_COUNT() bfin_read16(MXVR_DMA0_CURR_COUNT)
98#define bfin_write_MXVR_DMA0_CURR_COUNT(val) bfin_write16(MXVR_DMA0_CURR_COUNT, val)
99#define bfin_read_MXVR_DMA1_CONFIG() bfin_read32(MXVR_DMA1_CONFIG)
100#define bfin_write_MXVR_DMA1_CONFIG(val) bfin_write32(MXVR_DMA1_CONFIG, val)
101#define bfin_read_MXVR_DMA1_START_ADDR() bfin_readPTR(MXVR_DMA1_START_ADDR)
102#define bfin_write_MXVR_DMA1_START_ADDR(val) bfin_writePTR(MXVR_DMA1_START_ADDR, val)
103#define bfin_read_MXVR_DMA1_COUNT() bfin_read16(MXVR_DMA1_COUNT)
104#define bfin_write_MXVR_DMA1_COUNT(val) bfin_write16(MXVR_DMA1_COUNT, val)
105#define bfin_read_MXVR_DMA1_CURR_ADDR() bfin_readPTR(MXVR_DMA1_CURR_ADDR)
106#define bfin_write_MXVR_DMA1_CURR_ADDR(val) bfin_writePTR(MXVR_DMA1_CURR_ADDR, val)
107#define bfin_read_MXVR_DMA1_CURR_COUNT() bfin_read16(MXVR_DMA1_CURR_COUNT)
108#define bfin_write_MXVR_DMA1_CURR_COUNT(val) bfin_write16(MXVR_DMA1_CURR_COUNT, val)
109#define bfin_read_MXVR_DMA2_CONFIG() bfin_read32(MXVR_DMA2_CONFIG)
110#define bfin_write_MXVR_DMA2_CONFIG(val) bfin_write32(MXVR_DMA2_CONFIG, val)
111#define bfin_read_MXVR_DMA2_START_ADDR() bfin_readPTR(MXVR_DMA2_START_ADDR)
112#define bfin_write_MXVR_DMA2_START_ADDR(val) bfin_writePTR(MXVR_DMA2_START_ADDR, val)
113#define bfin_read_MXVR_DMA2_COUNT() bfin_read16(MXVR_DMA2_COUNT)
114#define bfin_write_MXVR_DMA2_COUNT(val) bfin_write16(MXVR_DMA2_COUNT, val)
115#define bfin_read_MXVR_DMA2_CURR_ADDR() bfin_readPTR(MXVR_DMA2_CURR_ADDR)
116#define bfin_write_MXVR_DMA2_CURR_ADDR(val) bfin_writePTR(MXVR_DMA2_CURR_ADDR, val)
117#define bfin_read_MXVR_DMA2_CURR_COUNT() bfin_read16(MXVR_DMA2_CURR_COUNT)
118#define bfin_write_MXVR_DMA2_CURR_COUNT(val) bfin_write16(MXVR_DMA2_CURR_COUNT, val)
119#define bfin_read_MXVR_DMA3_CONFIG() bfin_read32(MXVR_DMA3_CONFIG)
120#define bfin_write_MXVR_DMA3_CONFIG(val) bfin_write32(MXVR_DMA3_CONFIG, val)
121#define bfin_read_MXVR_DMA3_START_ADDR() bfin_readPTR(MXVR_DMA3_START_ADDR)
122#define bfin_write_MXVR_DMA3_START_ADDR(val) bfin_writePTR(MXVR_DMA3_START_ADDR, val)
123#define bfin_read_MXVR_DMA3_COUNT() bfin_read16(MXVR_DMA3_COUNT)
124#define bfin_write_MXVR_DMA3_COUNT(val) bfin_write16(MXVR_DMA3_COUNT, val)
125#define bfin_read_MXVR_DMA3_CURR_ADDR() bfin_readPTR(MXVR_DMA3_CURR_ADDR)
126#define bfin_write_MXVR_DMA3_CURR_ADDR(val) bfin_writePTR(MXVR_DMA3_CURR_ADDR, val)
127#define bfin_read_MXVR_DMA3_CURR_COUNT() bfin_read16(MXVR_DMA3_CURR_COUNT)
128#define bfin_write_MXVR_DMA3_CURR_COUNT(val) bfin_write16(MXVR_DMA3_CURR_COUNT, val)
129#define bfin_read_MXVR_DMA4_CONFIG() bfin_read32(MXVR_DMA4_CONFIG)
130#define bfin_write_MXVR_DMA4_CONFIG(val) bfin_write32(MXVR_DMA4_CONFIG, val)
131#define bfin_read_MXVR_DMA4_START_ADDR() bfin_readPTR(MXVR_DMA4_START_ADDR)
132#define bfin_write_MXVR_DMA4_START_ADDR(val) bfin_writePTR(MXVR_DMA4_START_ADDR, val)
133#define bfin_read_MXVR_DMA4_COUNT() bfin_read16(MXVR_DMA4_COUNT)
134#define bfin_write_MXVR_DMA4_COUNT(val) bfin_write16(MXVR_DMA4_COUNT, val)
135#define bfin_read_MXVR_DMA4_CURR_ADDR() bfin_readPTR(MXVR_DMA4_CURR_ADDR)
136#define bfin_write_MXVR_DMA4_CURR_ADDR(val) bfin_writePTR(MXVR_DMA4_CURR_ADDR, val)
137#define bfin_read_MXVR_DMA4_CURR_COUNT() bfin_read16(MXVR_DMA4_CURR_COUNT)
138#define bfin_write_MXVR_DMA4_CURR_COUNT(val) bfin_write16(MXVR_DMA4_CURR_COUNT, val)
139#define bfin_read_MXVR_DMA5_CONFIG() bfin_read32(MXVR_DMA5_CONFIG)
140#define bfin_write_MXVR_DMA5_CONFIG(val) bfin_write32(MXVR_DMA5_CONFIG, val)
141#define bfin_read_MXVR_DMA5_START_ADDR() bfin_readPTR(MXVR_DMA5_START_ADDR)
142#define bfin_write_MXVR_DMA5_START_ADDR(val) bfin_writePTR(MXVR_DMA5_START_ADDR, val)
143#define bfin_read_MXVR_DMA5_COUNT() bfin_read16(MXVR_DMA5_COUNT)
144#define bfin_write_MXVR_DMA5_COUNT(val) bfin_write16(MXVR_DMA5_COUNT, val)
145#define bfin_read_MXVR_DMA5_CURR_ADDR() bfin_readPTR(MXVR_DMA5_CURR_ADDR)
146#define bfin_write_MXVR_DMA5_CURR_ADDR(val) bfin_writePTR(MXVR_DMA5_CURR_ADDR, val)
147#define bfin_read_MXVR_DMA5_CURR_COUNT() bfin_read16(MXVR_DMA5_CURR_COUNT)
148#define bfin_write_MXVR_DMA5_CURR_COUNT(val) bfin_write16(MXVR_DMA5_CURR_COUNT, val)
149#define bfin_read_MXVR_DMA6_CONFIG() bfin_read32(MXVR_DMA6_CONFIG)
150#define bfin_write_MXVR_DMA6_CONFIG(val) bfin_write32(MXVR_DMA6_CONFIG, val)
151#define bfin_read_MXVR_DMA6_START_ADDR() bfin_readPTR(MXVR_DMA6_START_ADDR)
152#define bfin_write_MXVR_DMA6_START_ADDR(val) bfin_writePTR(MXVR_DMA6_START_ADDR, val)
153#define bfin_read_MXVR_DMA6_COUNT() bfin_read16(MXVR_DMA6_COUNT)
154#define bfin_write_MXVR_DMA6_COUNT(val) bfin_write16(MXVR_DMA6_COUNT, val)
155#define bfin_read_MXVR_DMA6_CURR_ADDR() bfin_readPTR(MXVR_DMA6_CURR_ADDR)
156#define bfin_write_MXVR_DMA6_CURR_ADDR(val) bfin_writePTR(MXVR_DMA6_CURR_ADDR, val)
157#define bfin_read_MXVR_DMA6_CURR_COUNT() bfin_read16(MXVR_DMA6_CURR_COUNT)
158#define bfin_write_MXVR_DMA6_CURR_COUNT(val) bfin_write16(MXVR_DMA6_CURR_COUNT, val)
159#define bfin_read_MXVR_DMA7_CONFIG() bfin_read32(MXVR_DMA7_CONFIG)
160#define bfin_write_MXVR_DMA7_CONFIG(val) bfin_write32(MXVR_DMA7_CONFIG, val)
161#define bfin_read_MXVR_DMA7_START_ADDR() bfin_readPTR(MXVR_DMA7_START_ADDR)
162#define bfin_write_MXVR_DMA7_START_ADDR(val) bfin_writePTR(MXVR_DMA7_START_ADDR, val)
163#define bfin_read_MXVR_DMA7_COUNT() bfin_read16(MXVR_DMA7_COUNT)
164#define bfin_write_MXVR_DMA7_COUNT(val) bfin_write16(MXVR_DMA7_COUNT, val)
165#define bfin_read_MXVR_DMA7_CURR_ADDR() bfin_readPTR(MXVR_DMA7_CURR_ADDR)
166#define bfin_write_MXVR_DMA7_CURR_ADDR(val) bfin_writePTR(MXVR_DMA7_CURR_ADDR, val)
167#define bfin_read_MXVR_DMA7_CURR_COUNT() bfin_read16(MXVR_DMA7_CURR_COUNT)
168#define bfin_write_MXVR_DMA7_CURR_COUNT(val) bfin_write16(MXVR_DMA7_CURR_COUNT, val)
169#define bfin_read_MXVR_AP_CTL() bfin_read16(MXVR_AP_CTL)
170#define bfin_write_MXVR_AP_CTL(val) bfin_write16(MXVR_AP_CTL, val)
171#define bfin_read_MXVR_APRB_START_ADDR() bfin_readPTR(MXVR_APRB_START_ADDR)
172#define bfin_write_MXVR_APRB_START_ADDR(val) bfin_writePTR(MXVR_APRB_START_ADDR, val)
173#define bfin_read_MXVR_APRB_CURR_ADDR() bfin_readPTR(MXVR_APRB_CURR_ADDR)
174#define bfin_write_MXVR_APRB_CURR_ADDR(val) bfin_writePTR(MXVR_APRB_CURR_ADDR, val)
175#define bfin_read_MXVR_APTB_START_ADDR() bfin_readPTR(MXVR_APTB_START_ADDR)
176#define bfin_write_MXVR_APTB_START_ADDR(val) bfin_writePTR(MXVR_APTB_START_ADDR, val)
177#define bfin_read_MXVR_APTB_CURR_ADDR() bfin_readPTR(MXVR_APTB_CURR_ADDR)
178#define bfin_write_MXVR_APTB_CURR_ADDR(val) bfin_writePTR(MXVR_APTB_CURR_ADDR, val)
179#define bfin_read_MXVR_CM_CTL() bfin_read32(MXVR_CM_CTL)
180#define bfin_write_MXVR_CM_CTL(val) bfin_write32(MXVR_CM_CTL, val)
181#define bfin_read_MXVR_CMRB_START_ADDR() bfin_readPTR(MXVR_CMRB_START_ADDR)
182#define bfin_write_MXVR_CMRB_START_ADDR(val) bfin_writePTR(MXVR_CMRB_START_ADDR, val)
183#define bfin_read_MXVR_CMRB_CURR_ADDR() bfin_readPTR(MXVR_CMRB_CURR_ADDR)
184#define bfin_write_MXVR_CMRB_CURR_ADDR(val) bfin_writePTR(MXVR_CMRB_CURR_ADDR, val)
185#define bfin_read_MXVR_CMTB_START_ADDR() bfin_readPTR(MXVR_CMTB_START_ADDR)
186#define bfin_write_MXVR_CMTB_START_ADDR(val) bfin_writePTR(MXVR_CMTB_START_ADDR, val)
187#define bfin_read_MXVR_CMTB_CURR_ADDR() bfin_readPTR(MXVR_CMTB_CURR_ADDR)
188#define bfin_write_MXVR_CMTB_CURR_ADDR(val) bfin_writePTR(MXVR_CMTB_CURR_ADDR, val)
189#define bfin_read_MXVR_RRDB_START_ADDR() bfin_readPTR(MXVR_RRDB_START_ADDR)
190#define bfin_write_MXVR_RRDB_START_ADDR(val) bfin_writePTR(MXVR_RRDB_START_ADDR, val)
191#define bfin_read_MXVR_RRDB_CURR_ADDR() bfin_readPTR(MXVR_RRDB_CURR_ADDR)
192#define bfin_write_MXVR_RRDB_CURR_ADDR(val) bfin_writePTR(MXVR_RRDB_CURR_ADDR, val)
193#define bfin_read_MXVR_PAT_DATA_0() bfin_read32(MXVR_PAT_DATA_0)
194#define bfin_write_MXVR_PAT_DATA_0(val) bfin_write32(MXVR_PAT_DATA_0, val)
195#define bfin_read_MXVR_PAT_EN_0() bfin_read32(MXVR_PAT_EN_0)
196#define bfin_write_MXVR_PAT_EN_0(val) bfin_write32(MXVR_PAT_EN_0, val)
197#define bfin_read_MXVR_PAT_DATA_1() bfin_read32(MXVR_PAT_DATA_1)
198#define bfin_write_MXVR_PAT_DATA_1(val) bfin_write32(MXVR_PAT_DATA_1, val)
199#define bfin_read_MXVR_PAT_EN_1() bfin_read32(MXVR_PAT_EN_1)
200#define bfin_write_MXVR_PAT_EN_1(val) bfin_write32(MXVR_PAT_EN_1, val)
201#define bfin_read_MXVR_FRAME_CNT_0() bfin_read16(MXVR_FRAME_CNT_0)
202#define bfin_write_MXVR_FRAME_CNT_0(val) bfin_write16(MXVR_FRAME_CNT_0, val)
203#define bfin_read_MXVR_FRAME_CNT_1() bfin_read16(MXVR_FRAME_CNT_1)
204#define bfin_write_MXVR_FRAME_CNT_1(val) bfin_write16(MXVR_FRAME_CNT_1, val)
205#define bfin_read_MXVR_ROUTING_0() bfin_read32(MXVR_ROUTING_0)
206#define bfin_write_MXVR_ROUTING_0(val) bfin_write32(MXVR_ROUTING_0, val)
207#define bfin_read_MXVR_ROUTING_1() bfin_read32(MXVR_ROUTING_1)
208#define bfin_write_MXVR_ROUTING_1(val) bfin_write32(MXVR_ROUTING_1, val)
209#define bfin_read_MXVR_ROUTING_2() bfin_read32(MXVR_ROUTING_2)
210#define bfin_write_MXVR_ROUTING_2(val) bfin_write32(MXVR_ROUTING_2, val)
211#define bfin_read_MXVR_ROUTING_3() bfin_read32(MXVR_ROUTING_3)
212#define bfin_write_MXVR_ROUTING_3(val) bfin_write32(MXVR_ROUTING_3, val)
213#define bfin_read_MXVR_ROUTING_4() bfin_read32(MXVR_ROUTING_4)
214#define bfin_write_MXVR_ROUTING_4(val) bfin_write32(MXVR_ROUTING_4, val)
215#define bfin_read_MXVR_ROUTING_5() bfin_read32(MXVR_ROUTING_5)
216#define bfin_write_MXVR_ROUTING_5(val) bfin_write32(MXVR_ROUTING_5, val)
217#define bfin_read_MXVR_ROUTING_6() bfin_read32(MXVR_ROUTING_6)
218#define bfin_write_MXVR_ROUTING_6(val) bfin_write32(MXVR_ROUTING_6, val)
219#define bfin_read_MXVR_ROUTING_7() bfin_read32(MXVR_ROUTING_7)
220#define bfin_write_MXVR_ROUTING_7(val) bfin_write32(MXVR_ROUTING_7, val)
221#define bfin_read_MXVR_ROUTING_8() bfin_read32(MXVR_ROUTING_8)
222#define bfin_write_MXVR_ROUTING_8(val) bfin_write32(MXVR_ROUTING_8, val)
223#define bfin_read_MXVR_ROUTING_9() bfin_read32(MXVR_ROUTING_9)
224#define bfin_write_MXVR_ROUTING_9(val) bfin_write32(MXVR_ROUTING_9, val)
225#define bfin_read_MXVR_ROUTING_10() bfin_read32(MXVR_ROUTING_10)
226#define bfin_write_MXVR_ROUTING_10(val) bfin_write32(MXVR_ROUTING_10, val)
227#define bfin_read_MXVR_ROUTING_11() bfin_read32(MXVR_ROUTING_11)
228#define bfin_write_MXVR_ROUTING_11(val) bfin_write32(MXVR_ROUTING_11, val)
229#define bfin_read_MXVR_ROUTING_12() bfin_read32(MXVR_ROUTING_12)
230#define bfin_write_MXVR_ROUTING_12(val) bfin_write32(MXVR_ROUTING_12, val)
231#define bfin_read_MXVR_ROUTING_13() bfin_read32(MXVR_ROUTING_13)
232#define bfin_write_MXVR_ROUTING_13(val) bfin_write32(MXVR_ROUTING_13, val)
233#define bfin_read_MXVR_ROUTING_14() bfin_read32(MXVR_ROUTING_14)
234#define bfin_write_MXVR_ROUTING_14(val) bfin_write32(MXVR_ROUTING_14, val)
235#define bfin_read_MXVR_PLL_CTL_1() bfin_read32(MXVR_PLL_CTL_1)
236#define bfin_write_MXVR_PLL_CTL_1(val) bfin_write32(MXVR_PLL_CTL_1, val)
237#define bfin_read_MXVR_BLOCK_CNT() bfin_read16(MXVR_BLOCK_CNT)
238#define bfin_write_MXVR_BLOCK_CNT(val) bfin_write16(MXVR_BLOCK_CNT, val)
239
240#endif /* _CDEF_BF539_H */
diff --git a/arch/blackfin/mach-bf538/include/mach/defBF539.h b/arch/blackfin/mach-bf538/include/mach/defBF539.h
new file mode 100644
index 000000000000..6adbfcc65a35
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/defBF539.h
@@ -0,0 +1,4243 @@
1/************************************************************************
2 *
3 * This file is subject to the terms and conditions of the GNU Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Non-GPL License also available as part of VisualDSP++
8 * http://www.analog.com/processors/resources/crosscore/visualDspDevSoftware.html
9 *
10 * (c) Copyright 2001-2005 Analog Devices, Inc. All rights reserved
11 *
12 * This file under source code control, please send bugs or changes to:
13 * dsptools.support@analog.com
14 *
15 ************************************************************************/
16/*
17 * File: include/asm-blackfin/mach-bf538/defBF539.h
18 * Based on:
19 * Author:
20 *
21 * Created:
22 * Description:
23 *
24 * Rev:
25 *
26 * Modified:
27 *
28 * Bugs: Enter bugs at http://blackfin.uclinux.org/
29 *
30 * This program is free software; you can redistribute it and/or modify
31 * it under the terms of the GNU General Public License as published by
32 * the Free Software Foundation; either version 2, or (at your option)
33 * any later version.
34 *
35 * This program is distributed in the hope that it will be useful,
36 * but WITHOUT ANY WARRANTY; without even the implied warranty of
37 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
38 * GNU General Public License for more details.
39 *
40 * You should have received a copy of the GNU General Public License
41 * along with this program; see the file COPYING.
42 * If not, write to the Free Software Foundation,
43 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
44 */
45/* SYSTEM & MM REGISTER BIT & ADDRESS DEFINITIONS FOR ADSP-BF538/9 */
46
47#ifndef _DEF_BF539_H
48#define _DEF_BF539_H
49
50/* include all Core registers and bit definitions */
51#include <asm/def_LPBlackfin.h>
52
53
54/*********************************************************************************** */
55/* System MMR Register Map */
56/*********************************************************************************** */
57/* Clock/Regulator Control (0xFFC00000 - 0xFFC000FF) */
58#define PLL_CTL 0xFFC00000 /* PLL Control register (16-bit) */
59#define PLL_DIV 0xFFC00004 /* PLL Divide Register (16-bit) */
60#define VR_CTL 0xFFC00008 /* Voltage Regulator Control Register (16-bit) */
61#define PLL_STAT 0xFFC0000C /* PLL Status register (16-bit) */
62#define PLL_LOCKCNT 0xFFC00010 /* PLL Lock Count register (16-bit) */
63#define CHIPID 0xFFC00014 /* Chip ID Register */
64
65/* CHIPID Masks */
66#define CHIPID_VERSION 0xF0000000
67#define CHIPID_FAMILY 0x0FFFF000
68#define CHIPID_MANUFACTURE 0x00000FFE
69
70/* System Interrupt Controller (0xFFC00100 - 0xFFC001FF) */
71#define SWRST 0xFFC00100 /* Software Reset Register (16-bit) */
72#define SYSCR 0xFFC00104 /* System Configuration registe */
73#define SIC_IMASK0 0xFFC0010C /* Interrupt Mask Register */
74#define SIC_IAR0 0xFFC00110 /* Interrupt Assignment Register 0 */
75#define SIC_IAR1 0xFFC00114 /* Interrupt Assignment Register 1 */
76#define SIC_IAR2 0xFFC00118 /* Interrupt Assignment Register 2 */
77#define SIC_IAR3 0xFFC0011C /* Interrupt Assignment Register 3 */
78#define SIC_ISR0 0xFFC00120 /* Interrupt Status Register */
79#define SIC_IWR0 0xFFC00124 /* Interrupt Wakeup Register */
80#define SIC_IMASK1 0xFFC00128 /* Interrupt Mask Register 1 */
81#define SIC_ISR1 0xFFC0012C /* Interrupt Status Register 1 */
82#define SIC_IWR1 0xFFC00130 /* Interrupt Wakeup Register 1 */
83#define SIC_IAR4 0xFFC00134 /* Interrupt Assignment Register 4 */
84#define SIC_IAR5 0xFFC00138 /* Interrupt Assignment Register 5 */
85#define SIC_IAR6 0xFFC0013C /* Interrupt Assignment Register 6 */
86
87
88/* Watchdog Timer (0xFFC00200 - 0xFFC002FF) */
89#define WDOG_CTL 0xFFC00200 /* Watchdog Control Register */
90#define WDOG_CNT 0xFFC00204 /* Watchdog Count Register */
91#define WDOG_STAT 0xFFC00208 /* Watchdog Status Register */
92
93
94/* Real Time Clock (0xFFC00300 - 0xFFC003FF) */
95#define RTC_STAT 0xFFC00300 /* RTC Status Register */
96#define RTC_ICTL 0xFFC00304 /* RTC Interrupt Control Register */
97#define RTC_ISTAT 0xFFC00308 /* RTC Interrupt Status Register */
98#define RTC_SWCNT 0xFFC0030C /* RTC Stopwatch Count Register */
99#define RTC_ALARM 0xFFC00310 /* RTC Alarm Time Register */
100#define RTC_FAST 0xFFC00314 /* RTC Prescaler Enable Register */
101#define RTC_PREN 0xFFC00314 /* RTC Prescaler Enable Register (alternate macro) */
102
103
104/* UART0 Controller (0xFFC00400 - 0xFFC004FF) */
105#define UART0_THR 0xFFC00400 /* Transmit Holding register */
106#define UART0_RBR 0xFFC00400 /* Receive Buffer register */
107#define UART0_DLL 0xFFC00400 /* Divisor Latch (Low-Byte) */
108#define UART0_IER 0xFFC00404 /* Interrupt Enable Register */
109#define UART0_DLH 0xFFC00404 /* Divisor Latch (High-Byte) */
110#define UART0_IIR 0xFFC00408 /* Interrupt Identification Register */
111#define UART0_LCR 0xFFC0040C /* Line Control Register */
112#define UART0_MCR 0xFFC00410 /* Modem Control Register */
113#define UART0_LSR 0xFFC00414 /* Line Status Register */
114#define UART0_SCR 0xFFC0041C /* SCR Scratch Register */
115#define UART0_GCTL 0xFFC00424 /* Global Control Register */
116
117
118/* SPI0 Controller (0xFFC00500 - 0xFFC005FF) */
119
120#define SPI0_CTL 0xFFC00500 /* SPI0 Control Register */
121#define SPI0_FLG 0xFFC00504 /* SPI0 Flag register */
122#define SPI0_STAT 0xFFC00508 /* SPI0 Status register */
123#define SPI0_TDBR 0xFFC0050C /* SPI0 Transmit Data Buffer Register */
124#define SPI0_RDBR 0xFFC00510 /* SPI0 Receive Data Buffer Register */
125#define SPI0_BAUD 0xFFC00514 /* SPI0 Baud rate Register */
126#define SPI0_SHADOW 0xFFC00518 /* SPI0_RDBR Shadow Register */
127#define SPI0_REGBASE SPI0_CTL
128
129
130/* TIMER 0, 1, 2 Registers (0xFFC00600 - 0xFFC006FF) */
131#define TIMER0_CONFIG 0xFFC00600 /* Timer 0 Configuration Register */
132#define TIMER0_COUNTER 0xFFC00604 /* Timer 0 Counter Register */
133#define TIMER0_PERIOD 0xFFC00608 /* Timer 0 Period Register */
134#define TIMER0_WIDTH 0xFFC0060C /* Timer 0 Width Register */
135
136#define TIMER1_CONFIG 0xFFC00610 /* Timer 1 Configuration Register */
137#define TIMER1_COUNTER 0xFFC00614 /* Timer 1 Counter Register */
138#define TIMER1_PERIOD 0xFFC00618 /* Timer 1 Period Register */
139#define TIMER1_WIDTH 0xFFC0061C /* Timer 1 Width Register */
140
141#define TIMER2_CONFIG 0xFFC00620 /* Timer 2 Configuration Register */
142#define TIMER2_COUNTER 0xFFC00624 /* Timer 2 Counter Register */
143#define TIMER2_PERIOD 0xFFC00628 /* Timer 2 Period Register */
144#define TIMER2_WIDTH 0xFFC0062C /* Timer 2 Width Register */
145
146#define TIMER_ENABLE 0xFFC00640 /* Timer Enable Register */
147#define TIMER_DISABLE 0xFFC00644 /* Timer Disable Register */
148#define TIMER_STATUS 0xFFC00648 /* Timer Status Register */
149
150
151/* Programmable Flags (0xFFC00700 - 0xFFC007FF) */
152#define FIO_FLAG_D 0xFFC00700 /* Flag Mask to directly specify state of pins */
153#define FIO_FLAG_C 0xFFC00704 /* Peripheral Interrupt Flag Register (clear) */
154#define FIO_FLAG_S 0xFFC00708 /* Peripheral Interrupt Flag Register (set) */
155#define FIO_FLAG_T 0xFFC0070C /* Flag Mask to directly toggle state of pins */
156#define FIO_MASKA_D 0xFFC00710 /* Flag Mask Interrupt A Register (set directly) */
157#define FIO_MASKA_C 0xFFC00714 /* Flag Mask Interrupt A Register (clear) */
158#define FIO_MASKA_S 0xFFC00718 /* Flag Mask Interrupt A Register (set) */
159#define FIO_MASKA_T 0xFFC0071C /* Flag Mask Interrupt A Register (toggle) */
160#define FIO_MASKB_D 0xFFC00720 /* Flag Mask Interrupt B Register (set directly) */
161#define FIO_MASKB_C 0xFFC00724 /* Flag Mask Interrupt B Register (clear) */
162#define FIO_MASKB_S 0xFFC00728 /* Flag Mask Interrupt B Register (set) */
163#define FIO_MASKB_T 0xFFC0072C /* Flag Mask Interrupt B Register (toggle) */
164#define FIO_DIR 0xFFC00730 /* Peripheral Flag Direction Register */
165#define FIO_POLAR 0xFFC00734 /* Flag Source Polarity Register */
166#define FIO_EDGE 0xFFC00738 /* Flag Source Sensitivity Register */
167#define FIO_BOTH 0xFFC0073C /* Flag Set on BOTH Edges Register */
168#define FIO_INEN 0xFFC00740 /* Flag Input Enable Register */
169
170
171/* SPORT0 Controller (0xFFC00800 - 0xFFC008FF) */
172#define SPORT0_TCR1 0xFFC00800 /* SPORT0 Transmit Configuration 1 Register */
173#define SPORT0_TCR2 0xFFC00804 /* SPORT0 Transmit Configuration 2 Register */
174#define SPORT0_TCLKDIV 0xFFC00808 /* SPORT0 Transmit Clock Divider */
175#define SPORT0_TFSDIV 0xFFC0080C /* SPORT0 Transmit Frame Sync Divider */
176#define SPORT0_TX 0xFFC00810 /* SPORT0 TX Data Register */
177#define SPORT0_RX 0xFFC00818 /* SPORT0 RX Data Register */
178#define SPORT0_RCR1 0xFFC00820 /* SPORT0 Transmit Configuration 1 Register */
179#define SPORT0_RCR2 0xFFC00824 /* SPORT0 Transmit Configuration 2 Register */
180#define SPORT0_RCLKDIV 0xFFC00828 /* SPORT0 Receive Clock Divider */
181#define SPORT0_RFSDIV 0xFFC0082C /* SPORT0 Receive Frame Sync Divider */
182#define SPORT0_STAT 0xFFC00830 /* SPORT0 Status Register */
183#define SPORT0_CHNL 0xFFC00834 /* SPORT0 Current Channel Register */
184#define SPORT0_MCMC1 0xFFC00838 /* SPORT0 Multi-Channel Configuration Register 1 */
185#define SPORT0_MCMC2 0xFFC0083C /* SPORT0 Multi-Channel Configuration Register 2 */
186#define SPORT0_MTCS0 0xFFC00840 /* SPORT0 Multi-Channel Transmit Select Register 0 */
187#define SPORT0_MTCS1 0xFFC00844 /* SPORT0 Multi-Channel Transmit Select Register 1 */
188#define SPORT0_MTCS2 0xFFC00848 /* SPORT0 Multi-Channel Transmit Select Register 2 */
189#define SPORT0_MTCS3 0xFFC0084C /* SPORT0 Multi-Channel Transmit Select Register 3 */
190#define SPORT0_MRCS0 0xFFC00850 /* SPORT0 Multi-Channel Receive Select Register 0 */
191#define SPORT0_MRCS1 0xFFC00854 /* SPORT0 Multi-Channel Receive Select Register 1 */
192#define SPORT0_MRCS2 0xFFC00858 /* SPORT0 Multi-Channel Receive Select Register 2 */
193#define SPORT0_MRCS3 0xFFC0085C /* SPORT0 Multi-Channel Receive Select Register 3 */
194
195
196/* SPORT1 Controller (0xFFC00900 - 0xFFC009FF) */
197#define SPORT1_TCR1 0xFFC00900 /* SPORT1 Transmit Configuration 1 Register */
198#define SPORT1_TCR2 0xFFC00904 /* SPORT1 Transmit Configuration 2 Register */
199#define SPORT1_TCLKDIV 0xFFC00908 /* SPORT1 Transmit Clock Divider */
200#define SPORT1_TFSDIV 0xFFC0090C /* SPORT1 Transmit Frame Sync Divider */
201#define SPORT1_TX 0xFFC00910 /* SPORT1 TX Data Register */
202#define SPORT1_RX 0xFFC00918 /* SPORT1 RX Data Register */
203#define SPORT1_RCR1 0xFFC00920 /* SPORT1 Transmit Configuration 1 Register */
204#define SPORT1_RCR2 0xFFC00924 /* SPORT1 Transmit Configuration 2 Register */
205#define SPORT1_RCLKDIV 0xFFC00928 /* SPORT1 Receive Clock Divider */
206#define SPORT1_RFSDIV 0xFFC0092C /* SPORT1 Receive Frame Sync Divider */
207#define SPORT1_STAT 0xFFC00930 /* SPORT1 Status Register */
208#define SPORT1_CHNL 0xFFC00934 /* SPORT1 Current Channel Register */
209#define SPORT1_MCMC1 0xFFC00938 /* SPORT1 Multi-Channel Configuration Register 1 */
210#define SPORT1_MCMC2 0xFFC0093C /* SPORT1 Multi-Channel Configuration Register 2 */
211#define SPORT1_MTCS0 0xFFC00940 /* SPORT1 Multi-Channel Transmit Select Register 0 */
212#define SPORT1_MTCS1 0xFFC00944 /* SPORT1 Multi-Channel Transmit Select Register 1 */
213#define SPORT1_MTCS2 0xFFC00948 /* SPORT1 Multi-Channel Transmit Select Register 2 */
214#define SPORT1_MTCS3 0xFFC0094C /* SPORT1 Multi-Channel Transmit Select Register 3 */
215#define SPORT1_MRCS0 0xFFC00950 /* SPORT1 Multi-Channel Receive Select Register 0 */
216#define SPORT1_MRCS1 0xFFC00954 /* SPORT1 Multi-Channel Receive Select Register 1 */
217#define SPORT1_MRCS2 0xFFC00958 /* SPORT1 Multi-Channel Receive Select Register 2 */
218#define SPORT1_MRCS3 0xFFC0095C /* SPORT1 Multi-Channel Receive Select Register 3 */
219
220
221/* External Bus Interface Unit (0xFFC00A00 - 0xFFC00AFF) */
222/* Asynchronous Memory Controller */
223#define EBIU_AMGCTL 0xFFC00A00 /* Asynchronous Memory Global Control Register */
224#define EBIU_AMBCTL0 0xFFC00A04 /* Asynchronous Memory Bank Control Register 0 */
225#define EBIU_AMBCTL1 0xFFC00A08 /* Asynchronous Memory Bank Control Register 1 */
226
227/* SDRAM Controller */
228#define EBIU_SDGCTL 0xFFC00A10 /* SDRAM Global Control Register */
229#define EBIU_SDBCTL 0xFFC00A14 /* SDRAM Bank Control Register */
230#define EBIU_SDRRC 0xFFC00A18 /* SDRAM Refresh Rate Control Register */
231#define EBIU_SDSTAT 0xFFC00A1C /* SDRAM Status Register */
232
233
234
235/* DMA Controller 0 Traffic Control Registers (0xFFC00B00 - 0xFFC00BFF) */
236
237#define DMAC0_TC_PER 0xFFC00B0C /* DMA Controller 0 Traffic Control Periods Register */
238#define DMAC0_TC_CNT 0xFFC00B10 /* DMA Controller 0 Traffic Control Current Counts Register */
239
240/* Alternate deprecated register names (below) provided for backwards code compatibility */
241#define DMA0_TCPER DMAC0_TC_PER
242#define DMA0_TCCNT DMAC0_TC_CNT
243
244
245/* DMA Controller 0 (0xFFC00C00 - 0xFFC00FFF) */
246
247#define DMA0_NEXT_DESC_PTR 0xFFC00C00 /* DMA Channel 0 Next Descriptor Pointer Register */
248#define DMA0_START_ADDR 0xFFC00C04 /* DMA Channel 0 Start Address Register */
249#define DMA0_CONFIG 0xFFC00C08 /* DMA Channel 0 Configuration Register */
250#define DMA0_X_COUNT 0xFFC00C10 /* DMA Channel 0 X Count Register */
251#define DMA0_X_MODIFY 0xFFC00C14 /* DMA Channel 0 X Modify Register */
252#define DMA0_Y_COUNT 0xFFC00C18 /* DMA Channel 0 Y Count Register */
253#define DMA0_Y_MODIFY 0xFFC00C1C /* DMA Channel 0 Y Modify Register */
254#define DMA0_CURR_DESC_PTR 0xFFC00C20 /* DMA Channel 0 Current Descriptor Pointer Register */
255#define DMA0_CURR_ADDR 0xFFC00C24 /* DMA Channel 0 Current Address Register */
256#define DMA0_IRQ_STATUS 0xFFC00C28 /* DMA Channel 0 Interrupt/Status Register */
257#define DMA0_PERIPHERAL_MAP 0xFFC00C2C /* DMA Channel 0 Peripheral Map Register */
258#define DMA0_CURR_X_COUNT 0xFFC00C30 /* DMA Channel 0 Current X Count Register */
259#define DMA0_CURR_Y_COUNT 0xFFC00C38 /* DMA Channel 0 Current Y Count Register */
260
261#define DMA1_NEXT_DESC_PTR 0xFFC00C40 /* DMA Channel 1 Next Descriptor Pointer Register */
262#define DMA1_START_ADDR 0xFFC00C44 /* DMA Channel 1 Start Address Register */
263#define DMA1_CONFIG 0xFFC00C48 /* DMA Channel 1 Configuration Register */
264#define DMA1_X_COUNT 0xFFC00C50 /* DMA Channel 1 X Count Register */
265#define DMA1_X_MODIFY 0xFFC00C54 /* DMA Channel 1 X Modify Register */
266#define DMA1_Y_COUNT 0xFFC00C58 /* DMA Channel 1 Y Count Register */
267#define DMA1_Y_MODIFY 0xFFC00C5C /* DMA Channel 1 Y Modify Register */
268#define DMA1_CURR_DESC_PTR 0xFFC00C60 /* DMA Channel 1 Current Descriptor Pointer Register */
269#define DMA1_CURR_ADDR 0xFFC00C64 /* DMA Channel 1 Current Address Register */
270#define DMA1_IRQ_STATUS 0xFFC00C68 /* DMA Channel 1 Interrupt/Status Register */
271#define DMA1_PERIPHERAL_MAP 0xFFC00C6C /* DMA Channel 1 Peripheral Map Register */
272#define DMA1_CURR_X_COUNT 0xFFC00C70 /* DMA Channel 1 Current X Count Register */
273#define DMA1_CURR_Y_COUNT 0xFFC00C78 /* DMA Channel 1 Current Y Count Register */
274
275#define DMA2_NEXT_DESC_PTR 0xFFC00C80 /* DMA Channel 2 Next Descriptor Pointer Register */
276#define DMA2_START_ADDR 0xFFC00C84 /* DMA Channel 2 Start Address Register */
277#define DMA2_CONFIG 0xFFC00C88 /* DMA Channel 2 Configuration Register */
278#define DMA2_X_COUNT 0xFFC00C90 /* DMA Channel 2 X Count Register */
279#define DMA2_X_MODIFY 0xFFC00C94 /* DMA Channel 2 X Modify Register */
280#define DMA2_Y_COUNT 0xFFC00C98 /* DMA Channel 2 Y Count Register */
281#define DMA2_Y_MODIFY 0xFFC00C9C /* DMA Channel 2 Y Modify Register */
282#define DMA2_CURR_DESC_PTR 0xFFC00CA0 /* DMA Channel 2 Current Descriptor Pointer Register */
283#define DMA2_CURR_ADDR 0xFFC00CA4 /* DMA Channel 2 Current Address Register */
284#define DMA2_IRQ_STATUS 0xFFC00CA8 /* DMA Channel 2 Interrupt/Status Register */
285#define DMA2_PERIPHERAL_MAP 0xFFC00CAC /* DMA Channel 2 Peripheral Map Register */
286#define DMA2_CURR_X_COUNT 0xFFC00CB0 /* DMA Channel 2 Current X Count Register */
287#define DMA2_CURR_Y_COUNT 0xFFC00CB8 /* DMA Channel 2 Current Y Count Register */
288
289#define DMA3_NEXT_DESC_PTR 0xFFC00CC0 /* DMA Channel 3 Next Descriptor Pointer Register */
290#define DMA3_START_ADDR 0xFFC00CC4 /* DMA Channel 3 Start Address Register */
291#define DMA3_CONFIG 0xFFC00CC8 /* DMA Channel 3 Configuration Register */
292#define DMA3_X_COUNT 0xFFC00CD0 /* DMA Channel 3 X Count Register */
293#define DMA3_X_MODIFY 0xFFC00CD4 /* DMA Channel 3 X Modify Register */
294#define DMA3_Y_COUNT 0xFFC00CD8 /* DMA Channel 3 Y Count Register */
295#define DMA3_Y_MODIFY 0xFFC00CDC /* DMA Channel 3 Y Modify Register */
296#define DMA3_CURR_DESC_PTR 0xFFC00CE0 /* DMA Channel 3 Current Descriptor Pointer Register */
297#define DMA3_CURR_ADDR 0xFFC00CE4 /* DMA Channel 3 Current Address Register */
298#define DMA3_IRQ_STATUS 0xFFC00CE8 /* DMA Channel 3 Interrupt/Status Register */
299#define DMA3_PERIPHERAL_MAP 0xFFC00CEC /* DMA Channel 3 Peripheral Map Register */
300#define DMA3_CURR_X_COUNT 0xFFC00CF0 /* DMA Channel 3 Current X Count Register */
301#define DMA3_CURR_Y_COUNT 0xFFC00CF8 /* DMA Channel 3 Current Y Count Register */
302
303#define DMA4_NEXT_DESC_PTR 0xFFC00D00 /* DMA Channel 4 Next Descriptor Pointer Register */
304#define DMA4_START_ADDR 0xFFC00D04 /* DMA Channel 4 Start Address Register */
305#define DMA4_CONFIG 0xFFC00D08 /* DMA Channel 4 Configuration Register */
306#define DMA4_X_COUNT 0xFFC00D10 /* DMA Channel 4 X Count Register */
307#define DMA4_X_MODIFY 0xFFC00D14 /* DMA Channel 4 X Modify Register */
308#define DMA4_Y_COUNT 0xFFC00D18 /* DMA Channel 4 Y Count Register */
309#define DMA4_Y_MODIFY 0xFFC00D1C /* DMA Channel 4 Y Modify Register */
310#define DMA4_CURR_DESC_PTR 0xFFC00D20 /* DMA Channel 4 Current Descriptor Pointer Register */
311#define DMA4_CURR_ADDR 0xFFC00D24 /* DMA Channel 4 Current Address Register */
312#define DMA4_IRQ_STATUS 0xFFC00D28 /* DMA Channel 4 Interrupt/Status Register */
313#define DMA4_PERIPHERAL_MAP 0xFFC00D2C /* DMA Channel 4 Peripheral Map Register */
314#define DMA4_CURR_X_COUNT 0xFFC00D30 /* DMA Channel 4 Current X Count Register */
315#define DMA4_CURR_Y_COUNT 0xFFC00D38 /* DMA Channel 4 Current Y Count Register */
316
317#define DMA5_NEXT_DESC_PTR 0xFFC00D40 /* DMA Channel 5 Next Descriptor Pointer Register */
318#define DMA5_START_ADDR 0xFFC00D44 /* DMA Channel 5 Start Address Register */
319#define DMA5_CONFIG 0xFFC00D48 /* DMA Channel 5 Configuration Register */
320#define DMA5_X_COUNT 0xFFC00D50 /* DMA Channel 5 X Count Register */
321#define DMA5_X_MODIFY 0xFFC00D54 /* DMA Channel 5 X Modify Register */
322#define DMA5_Y_COUNT 0xFFC00D58 /* DMA Channel 5 Y Count Register */
323#define DMA5_Y_MODIFY 0xFFC00D5C /* DMA Channel 5 Y Modify Register */
324#define DMA5_CURR_DESC_PTR 0xFFC00D60 /* DMA Channel 5 Current Descriptor Pointer Register */
325#define DMA5_CURR_ADDR 0xFFC00D64 /* DMA Channel 5 Current Address Register */
326#define DMA5_IRQ_STATUS 0xFFC00D68 /* DMA Channel 5 Interrupt/Status Register */
327#define DMA5_PERIPHERAL_MAP 0xFFC00D6C /* DMA Channel 5 Peripheral Map Register */
328#define DMA5_CURR_X_COUNT 0xFFC00D70 /* DMA Channel 5 Current X Count Register */
329#define DMA5_CURR_Y_COUNT 0xFFC00D78 /* DMA Channel 5 Current Y Count Register */
330
331#define DMA6_NEXT_DESC_PTR 0xFFC00D80 /* DMA Channel 6 Next Descriptor Pointer Register */
332#define DMA6_START_ADDR 0xFFC00D84 /* DMA Channel 6 Start Address Register */
333#define DMA6_CONFIG 0xFFC00D88 /* DMA Channel 6 Configuration Register */
334#define DMA6_X_COUNT 0xFFC00D90 /* DMA Channel 6 X Count Register */
335#define DMA6_X_MODIFY 0xFFC00D94 /* DMA Channel 6 X Modify Register */
336#define DMA6_Y_COUNT 0xFFC00D98 /* DMA Channel 6 Y Count Register */
337#define DMA6_Y_MODIFY 0xFFC00D9C /* DMA Channel 6 Y Modify Register */
338#define DMA6_CURR_DESC_PTR 0xFFC00DA0 /* DMA Channel 6 Current Descriptor Pointer Register */
339#define DMA6_CURR_ADDR 0xFFC00DA4 /* DMA Channel 6 Current Address Register */
340#define DMA6_IRQ_STATUS 0xFFC00DA8 /* DMA Channel 6 Interrupt/Status Register */
341#define DMA6_PERIPHERAL_MAP 0xFFC00DAC /* DMA Channel 6 Peripheral Map Register */
342#define DMA6_CURR_X_COUNT 0xFFC00DB0 /* DMA Channel 6 Current X Count Register */
343#define DMA6_CURR_Y_COUNT 0xFFC00DB8 /* DMA Channel 6 Current Y Count Register */
344
345#define DMA7_NEXT_DESC_PTR 0xFFC00DC0 /* DMA Channel 7 Next Descriptor Pointer Register */
346#define DMA7_START_ADDR 0xFFC00DC4 /* DMA Channel 7 Start Address Register */
347#define DMA7_CONFIG 0xFFC00DC8 /* DMA Channel 7 Configuration Register */
348#define DMA7_X_COUNT 0xFFC00DD0 /* DMA Channel 7 X Count Register */
349#define DMA7_X_MODIFY 0xFFC00DD4 /* DMA Channel 7 X Modify Register */
350#define DMA7_Y_COUNT 0xFFC00DD8 /* DMA Channel 7 Y Count Register */
351#define DMA7_Y_MODIFY 0xFFC00DDC /* DMA Channel 7 Y Modify Register */
352#define DMA7_CURR_DESC_PTR 0xFFC00DE0 /* DMA Channel 7 Current Descriptor Pointer Register */
353#define DMA7_CURR_ADDR 0xFFC00DE4 /* DMA Channel 7 Current Address Register */
354#define DMA7_IRQ_STATUS 0xFFC00DE8 /* DMA Channel 7 Interrupt/Status Register */
355#define DMA7_PERIPHERAL_MAP 0xFFC00DEC /* DMA Channel 7 Peripheral Map Register */
356#define DMA7_CURR_X_COUNT 0xFFC00DF0 /* DMA Channel 7 Current X Count Register */
357#define DMA7_CURR_Y_COUNT 0xFFC00DF8 /* DMA Channel 7 Current Y Count Register */
358
359#define MDMA0_D0_NEXT_DESC_PTR 0xFFC00E00 /* MemDMA0 Stream 0 Destination Next Descriptor Pointer Register */
360#define MDMA0_D0_START_ADDR 0xFFC00E04 /* MemDMA0 Stream 0 Destination Start Address Register */
361#define MDMA0_D0_CONFIG 0xFFC00E08 /* MemDMA0 Stream 0 Destination Configuration Register */
362#define MDMA0_D0_X_COUNT 0xFFC00E10 /* MemDMA0 Stream 0 Destination X Count Register */
363#define MDMA0_D0_X_MODIFY 0xFFC00E14 /* MemDMA0 Stream 0 Destination X Modify Register */
364#define MDMA0_D0_Y_COUNT 0xFFC00E18 /* MemDMA0 Stream 0 Destination Y Count Register */
365#define MDMA0_D0_Y_MODIFY 0xFFC00E1C /* MemDMA0 Stream 0 Destination Y Modify Register */
366#define MDMA0_D0_CURR_DESC_PTR 0xFFC00E20 /* MemDMA0 Stream 0 Destination Current Descriptor Pointer Register */
367#define MDMA0_D0_CURR_ADDR 0xFFC00E24 /* MemDMA0 Stream 0 Destination Current Address Register */
368#define MDMA0_D0_IRQ_STATUS 0xFFC00E28 /* MemDMA0 Stream 0 Destination Interrupt/Status Register */
369#define MDMA0_D0_PERIPHERAL_MAP 0xFFC00E2C /* MemDMA0 Stream 0 Destination Peripheral Map Register */
370#define MDMA0_D0_CURR_X_COUNT 0xFFC00E30 /* MemDMA0 Stream 0 Destination Current X Count Register */
371#define MDMA0_D0_CURR_Y_COUNT 0xFFC00E38 /* MemDMA0 Stream 0 Destination Current Y Count Register */
372
373#define MDMA0_S0_NEXT_DESC_PTR 0xFFC00E40 /* MemDMA0 Stream 0 Source Next Descriptor Pointer Register */
374#define MDMA0_S0_START_ADDR 0xFFC00E44 /* MemDMA0 Stream 0 Source Start Address Register */
375#define MDMA0_S0_CONFIG 0xFFC00E48 /* MemDMA0 Stream 0 Source Configuration Register */
376#define MDMA0_S0_X_COUNT 0xFFC00E50 /* MemDMA0 Stream 0 Source X Count Register */
377#define MDMA0_S0_X_MODIFY 0xFFC00E54 /* MemDMA0 Stream 0 Source X Modify Register */
378#define MDMA0_S0_Y_COUNT 0xFFC00E58 /* MemDMA0 Stream 0 Source Y Count Register */
379#define MDMA0_S0_Y_MODIFY 0xFFC00E5C /* MemDMA0 Stream 0 Source Y Modify Register */
380#define MDMA0_S0_CURR_DESC_PTR 0xFFC00E60 /* MemDMA0 Stream 0 Source Current Descriptor Pointer Register */
381#define MDMA0_S0_CURR_ADDR 0xFFC00E64 /* MemDMA0 Stream 0 Source Current Address Register */
382#define MDMA0_S0_IRQ_STATUS 0xFFC00E68 /* MemDMA0 Stream 0 Source Interrupt/Status Register */
383#define MDMA0_S0_PERIPHERAL_MAP 0xFFC00E6C /* MemDMA0 Stream 0 Source Peripheral Map Register */
384#define MDMA0_S0_CURR_X_COUNT 0xFFC00E70 /* MemDMA0 Stream 0 Source Current X Count Register */
385#define MDMA0_S0_CURR_Y_COUNT 0xFFC00E78 /* MemDMA0 Stream 0 Source Current Y Count Register */
386
387#define MDMA0_D1_NEXT_DESC_PTR 0xFFC00E80 /* MemDMA0 Stream 1 Destination Next Descriptor Pointer Register */
388#define MDMA0_D1_START_ADDR 0xFFC00E84 /* MemDMA0 Stream 1 Destination Start Address Register */
389#define MDMA0_D1_CONFIG 0xFFC00E88 /* MemDMA0 Stream 1 Destination Configuration Register */
390#define MDMA0_D1_X_COUNT 0xFFC00E90 /* MemDMA0 Stream 1 Destination X Count Register */
391#define MDMA0_D1_X_MODIFY 0xFFC00E94 /* MemDMA0 Stream 1 Destination X Modify Register */
392#define MDMA0_D1_Y_COUNT 0xFFC00E98 /* MemDMA0 Stream 1 Destination Y Count Register */
393#define MDMA0_D1_Y_MODIFY 0xFFC00E9C /* MemDMA0 Stream 1 Destination Y Modify Register */
394#define MDMA0_D1_CURR_DESC_PTR 0xFFC00EA0 /* MemDMA0 Stream 1 Destination Current Descriptor Pointer Register */
395#define MDMA0_D1_CURR_ADDR 0xFFC00EA4 /* MemDMA0 Stream 1 Destination Current Address Register */
396#define MDMA0_D1_IRQ_STATUS 0xFFC00EA8 /* MemDMA0 Stream 1 Destination Interrupt/Status Register */
397#define MDMA0_D1_PERIPHERAL_MAP 0xFFC00EAC /* MemDMA0 Stream 1 Destination Peripheral Map Register */
398#define MDMA0_D1_CURR_X_COUNT 0xFFC00EB0 /* MemDMA0 Stream 1 Destination Current X Count Register */
399#define MDMA0_D1_CURR_Y_COUNT 0xFFC00EB8 /* MemDMA0 Stream 1 Destination Current Y Count Register */
400
401#define MDMA0_S1_NEXT_DESC_PTR 0xFFC00EC0 /* MemDMA0 Stream 1 Source Next Descriptor Pointer Register */
402#define MDMA0_S1_START_ADDR 0xFFC00EC4 /* MemDMA0 Stream 1 Source Start Address Register */
403#define MDMA0_S1_CONFIG 0xFFC00EC8 /* MemDMA0 Stream 1 Source Configuration Register */
404#define MDMA0_S1_X_COUNT 0xFFC00ED0 /* MemDMA0 Stream 1 Source X Count Register */
405#define MDMA0_S1_X_MODIFY 0xFFC00ED4 /* MemDMA0 Stream 1 Source X Modify Register */
406#define MDMA0_S1_Y_COUNT 0xFFC00ED8 /* MemDMA0 Stream 1 Source Y Count Register */
407#define MDMA0_S1_Y_MODIFY 0xFFC00EDC /* MemDMA0 Stream 1 Source Y Modify Register */
408#define MDMA0_S1_CURR_DESC_PTR 0xFFC00EE0 /* MemDMA0 Stream 1 Source Current Descriptor Pointer Register */
409#define MDMA0_S1_CURR_ADDR 0xFFC00EE4 /* MemDMA0 Stream 1 Source Current Address Register */
410#define MDMA0_S1_IRQ_STATUS 0xFFC00EE8 /* MemDMA0 Stream 1 Source Interrupt/Status Register */
411#define MDMA0_S1_PERIPHERAL_MAP 0xFFC00EEC /* MemDMA0 Stream 1 Source Peripheral Map Register */
412#define MDMA0_S1_CURR_X_COUNT 0xFFC00EF0 /* MemDMA0 Stream 1 Source Current X Count Register */
413#define MDMA0_S1_CURR_Y_COUNT 0xFFC00EF8 /* MemDMA0 Stream 1 Source Current Y Count Register */
414
415
416/* Parallel Peripheral Interface (PPI) (0xFFC01000 - 0xFFC010FF) */
417#define PPI_CONTROL 0xFFC01000 /* PPI Control Register */
418#define PPI_STATUS 0xFFC01004 /* PPI Status Register */
419#define PPI_COUNT 0xFFC01008 /* PPI Transfer Count Register */
420#define PPI_DELAY 0xFFC0100C /* PPI Delay Count Register */
421#define PPI_FRAME 0xFFC01010 /* PPI Frame Length Register */
422
423
424/* Two-Wire Interface 0 (0xFFC01400 - 0xFFC014FF) */
425#define TWI0_CLKDIV 0xFFC01400 /* Serial Clock Divider Register */
426#define TWI0_CONTROL 0xFFC01404 /* TWI0 Master Internal Time Reference Register */
427#define TWI0_SLAVE_CTRL 0xFFC01408 /* Slave Mode Control Register */
428#define TWI0_SLAVE_STAT 0xFFC0140C /* Slave Mode Status Register */
429#define TWI0_SLAVE_ADDR 0xFFC01410 /* Slave Mode Address Register */
430#define TWI0_MASTER_CTRL 0xFFC01414 /* Master Mode Control Register */
431#define TWI0_MASTER_STAT 0xFFC01418 /* Master Mode Status Register */
432#define TWI0_MASTER_ADDR 0xFFC0141C /* Master Mode Address Register */
433#define TWI0_INT_STAT 0xFFC01420 /* TWI0 Master Interrupt Register */
434#define TWI0_INT_MASK 0xFFC01424 /* TWI0 Master Interrupt Mask Register */
435#define TWI0_FIFO_CTRL 0xFFC01428 /* FIFO Control Register */
436#define TWI0_FIFO_STAT 0xFFC0142C /* FIFO Status Register */
437#define TWI0_XMT_DATA8 0xFFC01480 /* FIFO Transmit Data Single Byte Register */
438#define TWI0_XMT_DATA16 0xFFC01484 /* FIFO Transmit Data Double Byte Register */
439#define TWI0_RCV_DATA8 0xFFC01488 /* FIFO Receive Data Single Byte Register */
440#define TWI0_RCV_DATA16 0xFFC0148C /* FIFO Receive Data Double Byte Register */
441
442#define TWI0_REGBASE TWI0_CLKDIV
443
444/* the following are for backwards compatibility */
445#define TWI0_PRESCALE TWI0_CONTROL
446#define TWI0_INT_SRC TWI0_INT_STAT
447#define TWI0_INT_ENABLE TWI0_INT_MASK
448
449
450/* General-Purpose Ports (0xFFC01500 - 0xFFC015FF) */
451
452/* GPIO Port C Register Names */
453#define GPIO_C_CNFG 0xFFC01500 /* GPIO Pin Port C Configuration Register */
454#define GPIO_C_D 0xFFC01510 /* GPIO Pin Port C Data Register */
455#define GPIO_C_C 0xFFC01520 /* Clear GPIO Pin Port C Register */
456#define GPIO_C_S 0xFFC01530 /* Set GPIO Pin Port C Register */
457#define GPIO_C_T 0xFFC01540 /* Toggle GPIO Pin Port C Register */
458#define GPIO_C_DIR 0xFFC01550 /* GPIO Pin Port C Direction Register */
459#define GPIO_C_INEN 0xFFC01560 /* GPIO Pin Port C Input Enable Register */
460
461/* GPIO Port D Register Names */
462#define GPIO_D_CNFG 0xFFC01504 /* GPIO Pin Port D Configuration Register */
463#define GPIO_D_D 0xFFC01514 /* GPIO Pin Port D Data Register */
464#define GPIO_D_C 0xFFC01524 /* Clear GPIO Pin Port D Register */
465#define GPIO_D_S 0xFFC01534 /* Set GPIO Pin Port D Register */
466#define GPIO_D_T 0xFFC01544 /* Toggle GPIO Pin Port D Register */
467#define GPIO_D_DIR 0xFFC01554 /* GPIO Pin Port D Direction Register */
468#define GPIO_D_INEN 0xFFC01564 /* GPIO Pin Port D Input Enable Register */
469
470/* GPIO Port E Register Names */
471#define GPIO_E_CNFG 0xFFC01508 /* GPIO Pin Port E Configuration Register */
472#define GPIO_E_D 0xFFC01518 /* GPIO Pin Port E Data Register */
473#define GPIO_E_C 0xFFC01528 /* Clear GPIO Pin Port E Register */
474#define GPIO_E_S 0xFFC01538 /* Set GPIO Pin Port E Register */
475#define GPIO_E_T 0xFFC01548 /* Toggle GPIO Pin Port E Register */
476#define GPIO_E_DIR 0xFFC01558 /* GPIO Pin Port E Direction Register */
477#define GPIO_E_INEN 0xFFC01568 /* GPIO Pin Port E Input Enable Register */
478
479/* DMA Controller 1 Traffic Control Registers (0xFFC01B00 - 0xFFC01BFF) */
480
481#define DMAC1_TC_PER 0xFFC01B0C /* DMA Controller 1 Traffic Control Periods Register */
482#define DMAC1_TC_CNT 0xFFC01B10 /* DMA Controller 1 Traffic Control Current Counts Register */
483
484/* Alternate deprecated register names (below) provided for backwards code compatibility */
485#define DMA1_TCPER DMAC1_TC_PER
486#define DMA1_TCCNT DMAC1_TC_CNT
487
488
489/* DMA Controller 1 (0xFFC01C00 - 0xFFC01FFF) */
490#define DMA8_NEXT_DESC_PTR 0xFFC01C00 /* DMA Channel 8 Next Descriptor Pointer Register */
491#define DMA8_START_ADDR 0xFFC01C04 /* DMA Channel 8 Start Address Register */
492#define DMA8_CONFIG 0xFFC01C08 /* DMA Channel 8 Configuration Register */
493#define DMA8_X_COUNT 0xFFC01C10 /* DMA Channel 8 X Count Register */
494#define DMA8_X_MODIFY 0xFFC01C14 /* DMA Channel 8 X Modify Register */
495#define DMA8_Y_COUNT 0xFFC01C18 /* DMA Channel 8 Y Count Register */
496#define DMA8_Y_MODIFY 0xFFC01C1C /* DMA Channel 8 Y Modify Register */
497#define DMA8_CURR_DESC_PTR 0xFFC01C20 /* DMA Channel 8 Current Descriptor Pointer Register */
498#define DMA8_CURR_ADDR 0xFFC01C24 /* DMA Channel 8 Current Address Register */
499#define DMA8_IRQ_STATUS 0xFFC01C28 /* DMA Channel 8 Interrupt/Status Register */
500#define DMA8_PERIPHERAL_MAP 0xFFC01C2C /* DMA Channel 8 Peripheral Map Register */
501#define DMA8_CURR_X_COUNT 0xFFC01C30 /* DMA Channel 8 Current X Count Register */
502#define DMA8_CURR_Y_COUNT 0xFFC01C38 /* DMA Channel 8 Current Y Count Register */
503
504#define DMA9_NEXT_DESC_PTR 0xFFC01C40 /* DMA Channel 9 Next Descriptor Pointer Register */
505#define DMA9_START_ADDR 0xFFC01C44 /* DMA Channel 9 Start Address Register */
506#define DMA9_CONFIG 0xFFC01C48 /* DMA Channel 9 Configuration Register */
507#define DMA9_X_COUNT 0xFFC01C50 /* DMA Channel 9 X Count Register */
508#define DMA9_X_MODIFY 0xFFC01C54 /* DMA Channel 9 X Modify Register */
509#define DMA9_Y_COUNT 0xFFC01C58 /* DMA Channel 9 Y Count Register */
510#define DMA9_Y_MODIFY 0xFFC01C5C /* DMA Channel 9 Y Modify Register */
511#define DMA9_CURR_DESC_PTR 0xFFC01C60 /* DMA Channel 9 Current Descriptor Pointer Register */
512#define DMA9_CURR_ADDR 0xFFC01C64 /* DMA Channel 9 Current Address Register */
513#define DMA9_IRQ_STATUS 0xFFC01C68 /* DMA Channel 9 Interrupt/Status Register */
514#define DMA9_PERIPHERAL_MAP 0xFFC01C6C /* DMA Channel 9 Peripheral Map Register */
515#define DMA9_CURR_X_COUNT 0xFFC01C70 /* DMA Channel 9 Current X Count Register */
516#define DMA9_CURR_Y_COUNT 0xFFC01C78 /* DMA Channel 9 Current Y Count Register */
517
518#define DMA10_NEXT_DESC_PTR 0xFFC01C80 /* DMA Channel 10 Next Descriptor Pointer Register */
519#define DMA10_START_ADDR 0xFFC01C84 /* DMA Channel 10 Start Address Register */
520#define DMA10_CONFIG 0xFFC01C88 /* DMA Channel 10 Configuration Register */
521#define DMA10_X_COUNT 0xFFC01C90 /* DMA Channel 10 X Count Register */
522#define DMA10_X_MODIFY 0xFFC01C94 /* DMA Channel 10 X Modify Register */
523#define DMA10_Y_COUNT 0xFFC01C98 /* DMA Channel 10 Y Count Register */
524#define DMA10_Y_MODIFY 0xFFC01C9C /* DMA Channel 10 Y Modify Register */
525#define DMA10_CURR_DESC_PTR 0xFFC01CA0 /* DMA Channel 10 Current Descriptor Pointer Register */
526#define DMA10_CURR_ADDR 0xFFC01CA4 /* DMA Channel 10 Current Address Register */
527#define DMA10_IRQ_STATUS 0xFFC01CA8 /* DMA Channel 10 Interrupt/Status Register */
528#define DMA10_PERIPHERAL_MAP 0xFFC01CAC /* DMA Channel 10 Peripheral Map Register */
529#define DMA10_CURR_X_COUNT 0xFFC01CB0 /* DMA Channel 10 Current X Count Register */
530#define DMA10_CURR_Y_COUNT 0xFFC01CB8 /* DMA Channel 10 Current Y Count Register */
531
532#define DMA11_NEXT_DESC_PTR 0xFFC01CC0 /* DMA Channel 11 Next Descriptor Pointer Register */
533#define DMA11_START_ADDR 0xFFC01CC4 /* DMA Channel 11 Start Address Register */
534#define DMA11_CONFIG 0xFFC01CC8 /* DMA Channel 11 Configuration Register */
535#define DMA11_X_COUNT 0xFFC01CD0 /* DMA Channel 11 X Count Register */
536#define DMA11_X_MODIFY 0xFFC01CD4 /* DMA Channel 11 X Modify Register */
537#define DMA11_Y_COUNT 0xFFC01CD8 /* DMA Channel 11 Y Count Register */
538#define DMA11_Y_MODIFY 0xFFC01CDC /* DMA Channel 11 Y Modify Register */
539#define DMA11_CURR_DESC_PTR 0xFFC01CE0 /* DMA Channel 11 Current Descriptor Pointer Register */
540#define DMA11_CURR_ADDR 0xFFC01CE4 /* DMA Channel 11 Current Address Register */
541#define DMA11_IRQ_STATUS 0xFFC01CE8 /* DMA Channel 11 Interrupt/Status Register */
542#define DMA11_PERIPHERAL_MAP 0xFFC01CEC /* DMA Channel 11 Peripheral Map Register */
543#define DMA11_CURR_X_COUNT 0xFFC01CF0 /* DMA Channel 11 Current X Count Register */
544#define DMA11_CURR_Y_COUNT 0xFFC01CF8 /* DMA Channel 11 Current Y Count Register */
545
546#define DMA12_NEXT_DESC_PTR 0xFFC01D00 /* DMA Channel 12 Next Descriptor Pointer Register */
547#define DMA12_START_ADDR 0xFFC01D04 /* DMA Channel 12 Start Address Register */
548#define DMA12_CONFIG 0xFFC01D08 /* DMA Channel 12 Configuration Register */
549#define DMA12_X_COUNT 0xFFC01D10 /* DMA Channel 12 X Count Register */
550#define DMA12_X_MODIFY 0xFFC01D14 /* DMA Channel 12 X Modify Register */
551#define DMA12_Y_COUNT 0xFFC01D18 /* DMA Channel 12 Y Count Register */
552#define DMA12_Y_MODIFY 0xFFC01D1C /* DMA Channel 12 Y Modify Register */
553#define DMA12_CURR_DESC_PTR 0xFFC01D20 /* DMA Channel 12 Current Descriptor Pointer Register */
554#define DMA12_CURR_ADDR 0xFFC01D24 /* DMA Channel 12 Current Address Register */
555#define DMA12_IRQ_STATUS 0xFFC01D28 /* DMA Channel 12 Interrupt/Status Register */
556#define DMA12_PERIPHERAL_MAP 0xFFC01D2C /* DMA Channel 12 Peripheral Map Register */
557#define DMA12_CURR_X_COUNT 0xFFC01D30 /* DMA Channel 12 Current X Count Register */
558#define DMA12_CURR_Y_COUNT 0xFFC01D38 /* DMA Channel 12 Current Y Count Register */
559
560#define DMA13_NEXT_DESC_PTR 0xFFC01D40 /* DMA Channel 13 Next Descriptor Pointer Register */
561#define DMA13_START_ADDR 0xFFC01D44 /* DMA Channel 13 Start Address Register */
562#define DMA13_CONFIG 0xFFC01D48 /* DMA Channel 13 Configuration Register */
563#define DMA13_X_COUNT 0xFFC01D50 /* DMA Channel 13 X Count Register */
564#define DMA13_X_MODIFY 0xFFC01D54 /* DMA Channel 13 X Modify Register */
565#define DMA13_Y_COUNT 0xFFC01D58 /* DMA Channel 13 Y Count Register */
566#define DMA13_Y_MODIFY 0xFFC01D5C /* DMA Channel 13 Y Modify Register */
567#define DMA13_CURR_DESC_PTR 0xFFC01D60 /* DMA Channel 13 Current Descriptor Pointer Register */
568#define DMA13_CURR_ADDR 0xFFC01D64 /* DMA Channel 13 Current Address Register */
569#define DMA13_IRQ_STATUS 0xFFC01D68 /* DMA Channel 13 Interrupt/Status Register */
570#define DMA13_PERIPHERAL_MAP 0xFFC01D6C /* DMA Channel 13 Peripheral Map Register */
571#define DMA13_CURR_X_COUNT 0xFFC01D70 /* DMA Channel 13 Current X Count Register */
572#define DMA13_CURR_Y_COUNT 0xFFC01D78 /* DMA Channel 13 Current Y Count Register */
573
574#define DMA14_NEXT_DESC_PTR 0xFFC01D80 /* DMA Channel 14 Next Descriptor Pointer Register */
575#define DMA14_START_ADDR 0xFFC01D84 /* DMA Channel 14 Start Address Register */
576#define DMA14_CONFIG 0xFFC01D88 /* DMA Channel 14 Configuration Register */
577#define DMA14_X_COUNT 0xFFC01D90 /* DMA Channel 14 X Count Register */
578#define DMA14_X_MODIFY 0xFFC01D94 /* DMA Channel 14 X Modify Register */
579#define DMA14_Y_COUNT 0xFFC01D98 /* DMA Channel 14 Y Count Register */
580#define DMA14_Y_MODIFY 0xFFC01D9C /* DMA Channel 14 Y Modify Register */
581#define DMA14_CURR_DESC_PTR 0xFFC01DA0 /* DMA Channel 14 Current Descriptor Pointer Register */
582#define DMA14_CURR_ADDR 0xFFC01DA4 /* DMA Channel 14 Current Address Register */
583#define DMA14_IRQ_STATUS 0xFFC01DA8 /* DMA Channel 14 Interrupt/Status Register */
584#define DMA14_PERIPHERAL_MAP 0xFFC01DAC /* DMA Channel 14 Peripheral Map Register */
585#define DMA14_CURR_X_COUNT 0xFFC01DB0 /* DMA Channel 14 Current X Count Register */
586#define DMA14_CURR_Y_COUNT 0xFFC01DB8 /* DMA Channel 14 Current Y Count Register */
587
588#define DMA15_NEXT_DESC_PTR 0xFFC01DC0 /* DMA Channel 15 Next Descriptor Pointer Register */
589#define DMA15_START_ADDR 0xFFC01DC4 /* DMA Channel 15 Start Address Register */
590#define DMA15_CONFIG 0xFFC01DC8 /* DMA Channel 15 Configuration Register */
591#define DMA15_X_COUNT 0xFFC01DD0 /* DMA Channel 15 X Count Register */
592#define DMA15_X_MODIFY 0xFFC01DD4 /* DMA Channel 15 X Modify Register */
593#define DMA15_Y_COUNT 0xFFC01DD8 /* DMA Channel 15 Y Count Register */
594#define DMA15_Y_MODIFY 0xFFC01DDC /* DMA Channel 15 Y Modify Register */
595#define DMA15_CURR_DESC_PTR 0xFFC01DE0 /* DMA Channel 15 Current Descriptor Pointer Register */
596#define DMA15_CURR_ADDR 0xFFC01DE4 /* DMA Channel 15 Current Address Register */
597#define DMA15_IRQ_STATUS 0xFFC01DE8 /* DMA Channel 15 Interrupt/Status Register */
598#define DMA15_PERIPHERAL_MAP 0xFFC01DEC /* DMA Channel 15 Peripheral Map Register */
599#define DMA15_CURR_X_COUNT 0xFFC01DF0 /* DMA Channel 15 Current X Count Register */
600#define DMA15_CURR_Y_COUNT 0xFFC01DF8 /* DMA Channel 15 Current Y Count Register */
601
602#define DMA16_NEXT_DESC_PTR 0xFFC01E00 /* DMA Channel 16 Next Descriptor Pointer Register */
603#define DMA16_START_ADDR 0xFFC01E04 /* DMA Channel 16 Start Address Register */
604#define DMA16_CONFIG 0xFFC01E08 /* DMA Channel 16 Configuration Register */
605#define DMA16_X_COUNT 0xFFC01E10 /* DMA Channel 16 X Count Register */
606#define DMA16_X_MODIFY 0xFFC01E14 /* DMA Channel 16 X Modify Register */
607#define DMA16_Y_COUNT 0xFFC01E18 /* DMA Channel 16 Y Count Register */
608#define DMA16_Y_MODIFY 0xFFC01E1C /* DMA Channel 16 Y Modify Register */
609#define DMA16_CURR_DESC_PTR 0xFFC01E20 /* DMA Channel 16 Current Descriptor Pointer Register */
610#define DMA16_CURR_ADDR 0xFFC01E24 /* DMA Channel 16 Current Address Register */
611#define DMA16_IRQ_STATUS 0xFFC01E28 /* DMA Channel 16 Interrupt/Status Register */
612#define DMA16_PERIPHERAL_MAP 0xFFC01E2C /* DMA Channel 16 Peripheral Map Register */
613#define DMA16_CURR_X_COUNT 0xFFC01E30 /* DMA Channel 16 Current X Count Register */
614#define DMA16_CURR_Y_COUNT 0xFFC01E38 /* DMA Channel 16 Current Y Count Register */
615
616#define DMA17_NEXT_DESC_PTR 0xFFC01E40 /* DMA Channel 17 Next Descriptor Pointer Register */
617#define DMA17_START_ADDR 0xFFC01E44 /* DMA Channel 17 Start Address Register */
618#define DMA17_CONFIG 0xFFC01E48 /* DMA Channel 17 Configuration Register */
619#define DMA17_X_COUNT 0xFFC01E50 /* DMA Channel 17 X Count Register */
620#define DMA17_X_MODIFY 0xFFC01E54 /* DMA Channel 17 X Modify Register */
621#define DMA17_Y_COUNT 0xFFC01E58 /* DMA Channel 17 Y Count Register */
622#define DMA17_Y_MODIFY 0xFFC01E5C /* DMA Channel 17 Y Modify Register */
623#define DMA17_CURR_DESC_PTR 0xFFC01E60 /* DMA Channel 17 Current Descriptor Pointer Register */
624#define DMA17_CURR_ADDR 0xFFC01E64 /* DMA Channel 17 Current Address Register */
625#define DMA17_IRQ_STATUS 0xFFC01E68 /* DMA Channel 17 Interrupt/Status Register */
626#define DMA17_PERIPHERAL_MAP 0xFFC01E6C /* DMA Channel 17 Peripheral Map Register */
627#define DMA17_CURR_X_COUNT 0xFFC01E70 /* DMA Channel 17 Current X Count Register */
628#define DMA17_CURR_Y_COUNT 0xFFC01E78 /* DMA Channel 17 Current Y Count Register */
629
630#define DMA18_NEXT_DESC_PTR 0xFFC01E80 /* DMA Channel 18 Next Descriptor Pointer Register */
631#define DMA18_START_ADDR 0xFFC01E84 /* DMA Channel 18 Start Address Register */
632#define DMA18_CONFIG 0xFFC01E88 /* DMA Channel 18 Configuration Register */
633#define DMA18_X_COUNT 0xFFC01E90 /* DMA Channel 18 X Count Register */
634#define DMA18_X_MODIFY 0xFFC01E94 /* DMA Channel 18 X Modify Register */
635#define DMA18_Y_COUNT 0xFFC01E98 /* DMA Channel 18 Y Count Register */
636#define DMA18_Y_MODIFY 0xFFC01E9C /* DMA Channel 18 Y Modify Register */
637#define DMA18_CURR_DESC_PTR 0xFFC01EA0 /* DMA Channel 18 Current Descriptor Pointer Register */
638#define DMA18_CURR_ADDR 0xFFC01EA4 /* DMA Channel 18 Current Address Register */
639#define DMA18_IRQ_STATUS 0xFFC01EA8 /* DMA Channel 18 Interrupt/Status Register */
640#define DMA18_PERIPHERAL_MAP 0xFFC01EAC /* DMA Channel 18 Peripheral Map Register */
641#define DMA18_CURR_X_COUNT 0xFFC01EB0 /* DMA Channel 18 Current X Count Register */
642#define DMA18_CURR_Y_COUNT 0xFFC01EB8 /* DMA Channel 18 Current Y Count Register */
643
644#define DMA19_NEXT_DESC_PTR 0xFFC01EC0 /* DMA Channel 19 Next Descriptor Pointer Register */
645#define DMA19_START_ADDR 0xFFC01EC4 /* DMA Channel 19 Start Address Register */
646#define DMA19_CONFIG 0xFFC01EC8 /* DMA Channel 19 Configuration Register */
647#define DMA19_X_COUNT 0xFFC01ED0 /* DMA Channel 19 X Count Register */
648#define DMA19_X_MODIFY 0xFFC01ED4 /* DMA Channel 19 X Modify Register */
649#define DMA19_Y_COUNT 0xFFC01ED8 /* DMA Channel 19 Y Count Register */
650#define DMA19_Y_MODIFY 0xFFC01EDC /* DMA Channel 19 Y Modify Register */
651#define DMA19_CURR_DESC_PTR 0xFFC01EE0 /* DMA Channel 19 Current Descriptor Pointer Register */
652#define DMA19_CURR_ADDR 0xFFC01EE4 /* DMA Channel 19 Current Address Register */
653#define DMA19_IRQ_STATUS 0xFFC01EE8 /* DMA Channel 19 Interrupt/Status Register */
654#define DMA19_PERIPHERAL_MAP 0xFFC01EEC /* DMA Channel 19 Peripheral Map Register */
655#define DMA19_CURR_X_COUNT 0xFFC01EF0 /* DMA Channel 19 Current X Count Register */
656#define DMA19_CURR_Y_COUNT 0xFFC01EF8 /* DMA Channel 19 Current Y Count Register */
657
658#define MDMA1_D0_NEXT_DESC_PTR 0xFFC01F00 /* MemDMA1 Stream 0 Destination Next Descriptor Pointer Register */
659#define MDMA1_D0_START_ADDR 0xFFC01F04 /* MemDMA1 Stream 0 Destination Start Address Register */
660#define MDMA1_D0_CONFIG 0xFFC01F08 /* MemDMA1 Stream 0 Destination Configuration Register */
661#define MDMA1_D0_X_COUNT 0xFFC01F10 /* MemDMA1 Stream 0 Destination X Count Register */
662#define MDMA1_D0_X_MODIFY 0xFFC01F14 /* MemDMA1 Stream 0 Destination X Modify Register */
663#define MDMA1_D0_Y_COUNT 0xFFC01F18 /* MemDMA1 Stream 0 Destination Y Count Register */
664#define MDMA1_D0_Y_MODIFY 0xFFC01F1C /* MemDMA1 Stream 0 Destination Y Modify Register */
665#define MDMA1_D0_CURR_DESC_PTR 0xFFC01F20 /* MemDMA1 Stream 0 Destination Current Descriptor Pointer Register */
666#define MDMA1_D0_CURR_ADDR 0xFFC01F24 /* MemDMA1 Stream 0 Destination Current Address Register */
667#define MDMA1_D0_IRQ_STATUS 0xFFC01F28 /* MemDMA1 Stream 0 Destination Interrupt/Status Register */
668#define MDMA1_D0_PERIPHERAL_MAP 0xFFC01F2C /* MemDMA1 Stream 0 Destination Peripheral Map Register */
669#define MDMA1_D0_CURR_X_COUNT 0xFFC01F30 /* MemDMA1 Stream 0 Destination Current X Count Register */
670#define MDMA1_D0_CURR_Y_COUNT 0xFFC01F38 /* MemDMA1 Stream 0 Destination Current Y Count Register */
671
672#define MDMA1_S0_NEXT_DESC_PTR 0xFFC01F40 /* MemDMA1 Stream 0 Source Next Descriptor Pointer Register */
673#define MDMA1_S0_START_ADDR 0xFFC01F44 /* MemDMA1 Stream 0 Source Start Address Register */
674#define MDMA1_S0_CONFIG 0xFFC01F48 /* MemDMA1 Stream 0 Source Configuration Register */
675#define MDMA1_S0_X_COUNT 0xFFC01F50 /* MemDMA1 Stream 0 Source X Count Register */
676#define MDMA1_S0_X_MODIFY 0xFFC01F54 /* MemDMA1 Stream 0 Source X Modify Register */
677#define MDMA1_S0_Y_COUNT 0xFFC01F58 /* MemDMA1 Stream 0 Source Y Count Register */
678#define MDMA1_S0_Y_MODIFY 0xFFC01F5C /* MemDMA1 Stream 0 Source Y Modify Register */
679#define MDMA1_S0_CURR_DESC_PTR 0xFFC01F60 /* MemDMA1 Stream 0 Source Current Descriptor Pointer Register */
680#define MDMA1_S0_CURR_ADDR 0xFFC01F64 /* MemDMA1 Stream 0 Source Current Address Register */
681#define MDMA1_S0_IRQ_STATUS 0xFFC01F68 /* MemDMA1 Stream 0 Source Interrupt/Status Register */
682#define MDMA1_S0_PERIPHERAL_MAP 0xFFC01F6C /* MemDMA1 Stream 0 Source Peripheral Map Register */
683#define MDMA1_S0_CURR_X_COUNT 0xFFC01F70 /* MemDMA1 Stream 0 Source Current X Count Register */
684#define MDMA1_S0_CURR_Y_COUNT 0xFFC01F78 /* MemDMA1 Stream 0 Source Current Y Count Register */
685
686#define MDMA1_D1_NEXT_DESC_PTR 0xFFC01F80 /* MemDMA1 Stream 1 Destination Next Descriptor Pointer Register */
687#define MDMA1_D1_START_ADDR 0xFFC01F84 /* MemDMA1 Stream 1 Destination Start Address Register */
688#define MDMA1_D1_CONFIG 0xFFC01F88 /* MemDMA1 Stream 1 Destination Configuration Register */
689#define MDMA1_D1_X_COUNT 0xFFC01F90 /* MemDMA1 Stream 1 Destination X Count Register */
690#define MDMA1_D1_X_MODIFY 0xFFC01F94 /* MemDMA1 Stream 1 Destination X Modify Register */
691#define MDMA1_D1_Y_COUNT 0xFFC01F98 /* MemDMA1 Stream 1 Destination Y Count Register */
692#define MDMA1_D1_Y_MODIFY 0xFFC01F9C /* MemDMA1 Stream 1 Destination Y Modify Register */
693#define MDMA1_D1_CURR_DESC_PTR 0xFFC01FA0 /* MemDMA1 Stream 1 Destination Current Descriptor Pointer Register */
694#define MDMA1_D1_CURR_ADDR 0xFFC01FA4 /* MemDMA1 Stream 1 Destination Current Address Register */
695#define MDMA1_D1_IRQ_STATUS 0xFFC01FA8 /* MemDMA1 Stream 1 Destination Interrupt/Status Register */
696#define MDMA1_D1_PERIPHERAL_MAP 0xFFC01FAC /* MemDMA1 Stream 1 Destination Peripheral Map Register */
697#define MDMA1_D1_CURR_X_COUNT 0xFFC01FB0 /* MemDMA1 Stream 1 Destination Current X Count Register */
698#define MDMA1_D1_CURR_Y_COUNT 0xFFC01FB8 /* MemDMA1 Stream 1 Destination Current Y Count Register */
699
700#define MDMA1_S1_NEXT_DESC_PTR 0xFFC01FC0 /* MemDMA1 Stream 1 Source Next Descriptor Pointer Register */
701#define MDMA1_S1_START_ADDR 0xFFC01FC4 /* MemDMA1 Stream 1 Source Start Address Register */
702#define MDMA1_S1_CONFIG 0xFFC01FC8 /* MemDMA1 Stream 1 Source Configuration Register */
703#define MDMA1_S1_X_COUNT 0xFFC01FD0 /* MemDMA1 Stream 1 Source X Count Register */
704#define MDMA1_S1_X_MODIFY 0xFFC01FD4 /* MemDMA1 Stream 1 Source X Modify Register */
705#define MDMA1_S1_Y_COUNT 0xFFC01FD8 /* MemDMA1 Stream 1 Source Y Count Register */
706#define MDMA1_S1_Y_MODIFY 0xFFC01FDC /* MemDMA1 Stream 1 Source Y Modify Register */
707#define MDMA1_S1_CURR_DESC_PTR 0xFFC01FE0 /* MemDMA1 Stream 1 Source Current Descriptor Pointer Register */
708#define MDMA1_S1_CURR_ADDR 0xFFC01FE4 /* MemDMA1 Stream 1 Source Current Address Register */
709#define MDMA1_S1_IRQ_STATUS 0xFFC01FE8 /* MemDMA1 Stream 1 Source Interrupt/Status Register */
710#define MDMA1_S1_PERIPHERAL_MAP 0xFFC01FEC /* MemDMA1 Stream 1 Source Peripheral Map Register */
711#define MDMA1_S1_CURR_X_COUNT 0xFFC01FF0 /* MemDMA1 Stream 1 Source Current X Count Register */
712#define MDMA1_S1_CURR_Y_COUNT 0xFFC01FF8 /* MemDMA1 Stream 1 Source Current Y Count Register */
713
714
715/* UART1 Controller (0xFFC02000 - 0xFFC020FF) */
716#define UART1_THR 0xFFC02000 /* Transmit Holding register */
717#define UART1_RBR 0xFFC02000 /* Receive Buffer register */
718#define UART1_DLL 0xFFC02000 /* Divisor Latch (Low-Byte) */
719#define UART1_IER 0xFFC02004 /* Interrupt Enable Register */
720#define UART1_DLH 0xFFC02004 /* Divisor Latch (High-Byte) */
721#define UART1_IIR 0xFFC02008 /* Interrupt Identification Register */
722#define UART1_LCR 0xFFC0200C /* Line Control Register */
723#define UART1_MCR 0xFFC02010 /* Modem Control Register */
724#define UART1_LSR 0xFFC02014 /* Line Status Register */
725#define UART1_SCR 0xFFC0201C /* SCR Scratch Register */
726#define UART1_GCTL 0xFFC02024 /* Global Control Register */
727
728
729/* UART2 Controller (0xFFC02100 - 0xFFC021FF) */
730#define UART2_THR 0xFFC02100 /* Transmit Holding register */
731#define UART2_RBR 0xFFC02100 /* Receive Buffer register */
732#define UART2_DLL 0xFFC02100 /* Divisor Latch (Low-Byte) */
733#define UART2_IER 0xFFC02104 /* Interrupt Enable Register */
734#define UART2_DLH 0xFFC02104 /* Divisor Latch (High-Byte) */
735#define UART2_IIR 0xFFC02108 /* Interrupt Identification Register */
736#define UART2_LCR 0xFFC0210C /* Line Control Register */
737#define UART2_MCR 0xFFC02110 /* Modem Control Register */
738#define UART2_LSR 0xFFC02114 /* Line Status Register */
739#define UART2_SCR 0xFFC0211C /* SCR Scratch Register */
740#define UART2_GCTL 0xFFC02124 /* Global Control Register */
741
742
743/* Two-Wire Interface 1 (0xFFC02200 - 0xFFC022FF) */
744#define TWI1_CLKDIV 0xFFC02200 /* Serial Clock Divider Register */
745#define TWI1_CONTROL 0xFFC02204 /* TWI1 Master Internal Time Reference Register */
746#define TWI1_SLAVE_CTRL 0xFFC02208 /* Slave Mode Control Register */
747#define TWI1_SLAVE_STAT 0xFFC0220C /* Slave Mode Status Register */
748#define TWI1_SLAVE_ADDR 0xFFC02210 /* Slave Mode Address Register */
749#define TWI1_MASTER_CTRL 0xFFC02214 /* Master Mode Control Register */
750#define TWI1_MASTER_STAT 0xFFC02218 /* Master Mode Status Register */
751#define TWI1_MASTER_ADDR 0xFFC0221C /* Master Mode Address Register */
752#define TWI1_INT_STAT 0xFFC02220 /* TWI1 Master Interrupt Register */
753#define TWI1_INT_MASK 0xFFC02224 /* TWI1 Master Interrupt Mask Register */
754#define TWI1_FIFO_CTRL 0xFFC02228 /* FIFO Control Register */
755#define TWI1_FIFO_STAT 0xFFC0222C /* FIFO Status Register */
756#define TWI1_XMT_DATA8 0xFFC02280 /* FIFO Transmit Data Single Byte Register */
757#define TWI1_XMT_DATA16 0xFFC02284 /* FIFO Transmit Data Double Byte Register */
758#define TWI1_RCV_DATA8 0xFFC02288 /* FIFO Receive Data Single Byte Register */
759#define TWI1_RCV_DATA16 0xFFC0228C /* FIFO Receive Data Double Byte Register */
760#define TWI1_REGBASE TWI1_CLKDIV
761
762
763/* the following are for backwards compatibility */
764#define TWI1_PRESCALE TWI1_CONTROL
765#define TWI1_INT_SRC TWI1_INT_STAT
766#define TWI1_INT_ENABLE TWI1_INT_MASK
767
768
769/* SPI1 Controller (0xFFC02300 - 0xFFC023FF) */
770#define SPI1_CTL 0xFFC02300 /* SPI1 Control Register */
771#define SPI1_FLG 0xFFC02304 /* SPI1 Flag register */
772#define SPI1_STAT 0xFFC02308 /* SPI1 Status register */
773#define SPI1_TDBR 0xFFC0230C /* SPI1 Transmit Data Buffer Register */
774#define SPI1_RDBR 0xFFC02310 /* SPI1 Receive Data Buffer Register */
775#define SPI1_BAUD 0xFFC02314 /* SPI1 Baud rate Register */
776#define SPI1_SHADOW 0xFFC02318 /* SPI1_RDBR Shadow Register */
777#define SPI1_REGBASE SPI1_CTL
778
779/* SPI2 Controller (0xFFC02400 - 0xFFC024FF) */
780#define SPI2_CTL 0xFFC02400 /* SPI2 Control Register */
781#define SPI2_FLG 0xFFC02404 /* SPI2 Flag register */
782#define SPI2_STAT 0xFFC02408 /* SPI2 Status register */
783#define SPI2_TDBR 0xFFC0240C /* SPI2 Transmit Data Buffer Register */
784#define SPI2_RDBR 0xFFC02410 /* SPI2 Receive Data Buffer Register */
785#define SPI2_BAUD 0xFFC02414 /* SPI2 Baud rate Register */
786#define SPI2_SHADOW 0xFFC02418 /* SPI2_RDBR Shadow Register */
787#define SPI2_REGBASE SPI2_CTL
788
789/* SPORT2 Controller (0xFFC02500 - 0xFFC025FF) */
790#define SPORT2_TCR1 0xFFC02500 /* SPORT2 Transmit Configuration 1 Register */
791#define SPORT2_TCR2 0xFFC02504 /* SPORT2 Transmit Configuration 2 Register */
792#define SPORT2_TCLKDIV 0xFFC02508 /* SPORT2 Transmit Clock Divider */
793#define SPORT2_TFSDIV 0xFFC0250C /* SPORT2 Transmit Frame Sync Divider */
794#define SPORT2_TX 0xFFC02510 /* SPORT2 TX Data Register */
795#define SPORT2_RX 0xFFC02518 /* SPORT2 RX Data Register */
796#define SPORT2_RCR1 0xFFC02520 /* SPORT2 Transmit Configuration 1 Register */
797#define SPORT2_RCR2 0xFFC02524 /* SPORT2 Transmit Configuration 2 Register */
798#define SPORT2_RCLKDIV 0xFFC02528 /* SPORT2 Receive Clock Divider */
799#define SPORT2_RFSDIV 0xFFC0252C /* SPORT2 Receive Frame Sync Divider */
800#define SPORT2_STAT 0xFFC02530 /* SPORT2 Status Register */
801#define SPORT2_CHNL 0xFFC02534 /* SPORT2 Current Channel Register */
802#define SPORT2_MCMC1 0xFFC02538 /* SPORT2 Multi-Channel Configuration Register 1 */
803#define SPORT2_MCMC2 0xFFC0253C /* SPORT2 Multi-Channel Configuration Register 2 */
804#define SPORT2_MTCS0 0xFFC02540 /* SPORT2 Multi-Channel Transmit Select Register 0 */
805#define SPORT2_MTCS1 0xFFC02544 /* SPORT2 Multi-Channel Transmit Select Register 1 */
806#define SPORT2_MTCS2 0xFFC02548 /* SPORT2 Multi-Channel Transmit Select Register 2 */
807#define SPORT2_MTCS3 0xFFC0254C /* SPORT2 Multi-Channel Transmit Select Register 3 */
808#define SPORT2_MRCS0 0xFFC02550 /* SPORT2 Multi-Channel Receive Select Register 0 */
809#define SPORT2_MRCS1 0xFFC02554 /* SPORT2 Multi-Channel Receive Select Register 1 */
810#define SPORT2_MRCS2 0xFFC02558 /* SPORT2 Multi-Channel Receive Select Register 2 */
811#define SPORT2_MRCS3 0xFFC0255C /* SPORT2 Multi-Channel Receive Select Register 3 */
812
813
814/* SPORT3 Controller (0xFFC02600 - 0xFFC026FF) */
815#define SPORT3_TCR1 0xFFC02600 /* SPORT3 Transmit Configuration 1 Register */
816#define SPORT3_TCR2 0xFFC02604 /* SPORT3 Transmit Configuration 2 Register */
817#define SPORT3_TCLKDIV 0xFFC02608 /* SPORT3 Transmit Clock Divider */
818#define SPORT3_TFSDIV 0xFFC0260C /* SPORT3 Transmit Frame Sync Divider */
819#define SPORT3_TX 0xFFC02610 /* SPORT3 TX Data Register */
820#define SPORT3_RX 0xFFC02618 /* SPORT3 RX Data Register */
821#define SPORT3_RCR1 0xFFC02620 /* SPORT3 Transmit Configuration 1 Register */
822#define SPORT3_RCR2 0xFFC02624 /* SPORT3 Transmit Configuration 2 Register */
823#define SPORT3_RCLKDIV 0xFFC02628 /* SPORT3 Receive Clock Divider */
824#define SPORT3_RFSDIV 0xFFC0262C /* SPORT3 Receive Frame Sync Divider */
825#define SPORT3_STAT 0xFFC02630 /* SPORT3 Status Register */
826#define SPORT3_CHNL 0xFFC02634 /* SPORT3 Current Channel Register */
827#define SPORT3_MCMC1 0xFFC02638 /* SPORT3 Multi-Channel Configuration Register 1 */
828#define SPORT3_MCMC2 0xFFC0263C /* SPORT3 Multi-Channel Configuration Register 2 */
829#define SPORT3_MTCS0 0xFFC02640 /* SPORT3 Multi-Channel Transmit Select Register 0 */
830#define SPORT3_MTCS1 0xFFC02644 /* SPORT3 Multi-Channel Transmit Select Register 1 */
831#define SPORT3_MTCS2 0xFFC02648 /* SPORT3 Multi-Channel Transmit Select Register 2 */
832#define SPORT3_MTCS3 0xFFC0264C /* SPORT3 Multi-Channel Transmit Select Register 3 */
833#define SPORT3_MRCS0 0xFFC02650 /* SPORT3 Multi-Channel Receive Select Register 0 */
834#define SPORT3_MRCS1 0xFFC02654 /* SPORT3 Multi-Channel Receive Select Register 1 */
835#define SPORT3_MRCS2 0xFFC02658 /* SPORT3 Multi-Channel Receive Select Register 2 */
836#define SPORT3_MRCS3 0xFFC0265C /* SPORT3 Multi-Channel Receive Select Register 3 */
837
838
839/* Media Transceiver (MXVR) (0xFFC02700 - 0xFFC028FF) */
840
841#define MXVR_CONFIG 0xFFC02700 /* MXVR Configuration Register */
842#define MXVR_PLL_CTL_0 0xFFC02704 /* MXVR Phase Lock Loop Control Register 0 */
843
844#define MXVR_STATE_0 0xFFC02708 /* MXVR State Register 0 */
845#define MXVR_STATE_1 0xFFC0270C /* MXVR State Register 1 */
846
847#define MXVR_INT_STAT_0 0xFFC02710 /* MXVR Interrupt Status Register 0 */
848#define MXVR_INT_STAT_1 0xFFC02714 /* MXVR Interrupt Status Register 1 */
849
850#define MXVR_INT_EN_0 0xFFC02718 /* MXVR Interrupt Enable Register 0 */
851#define MXVR_INT_EN_1 0xFFC0271C /* MXVR Interrupt Enable Register 1 */
852
853#define MXVR_POSITION 0xFFC02720 /* MXVR Node Position Register */
854#define MXVR_MAX_POSITION 0xFFC02724 /* MXVR Maximum Node Position Register */
855
856#define MXVR_DELAY 0xFFC02728 /* MXVR Node Frame Delay Register */
857#define MXVR_MAX_DELAY 0xFFC0272C /* MXVR Maximum Node Frame Delay Register */
858
859#define MXVR_LADDR 0xFFC02730 /* MXVR Logical Address Register */
860#define MXVR_GADDR 0xFFC02734 /* MXVR Group Address Register */
861#define MXVR_AADDR 0xFFC02738 /* MXVR Alternate Address Register */
862
863#define MXVR_ALLOC_0 0xFFC0273C /* MXVR Allocation Table Register 0 */
864#define MXVR_ALLOC_1 0xFFC02740 /* MXVR Allocation Table Register 1 */
865#define MXVR_ALLOC_2 0xFFC02744 /* MXVR Allocation Table Register 2 */
866#define MXVR_ALLOC_3 0xFFC02748 /* MXVR Allocation Table Register 3 */
867#define MXVR_ALLOC_4 0xFFC0274C /* MXVR Allocation Table Register 4 */
868#define MXVR_ALLOC_5 0xFFC02750 /* MXVR Allocation Table Register 5 */
869#define MXVR_ALLOC_6 0xFFC02754 /* MXVR Allocation Table Register 6 */
870#define MXVR_ALLOC_7 0xFFC02758 /* MXVR Allocation Table Register 7 */
871#define MXVR_ALLOC_8 0xFFC0275C /* MXVR Allocation Table Register 8 */
872#define MXVR_ALLOC_9 0xFFC02760 /* MXVR Allocation Table Register 9 */
873#define MXVR_ALLOC_10 0xFFC02764 /* MXVR Allocation Table Register 10 */
874#define MXVR_ALLOC_11 0xFFC02768 /* MXVR Allocation Table Register 11 */
875#define MXVR_ALLOC_12 0xFFC0276C /* MXVR Allocation Table Register 12 */
876#define MXVR_ALLOC_13 0xFFC02770 /* MXVR Allocation Table Register 13 */
877#define MXVR_ALLOC_14 0xFFC02774 /* MXVR Allocation Table Register 14 */
878
879#define MXVR_SYNC_LCHAN_0 0xFFC02778 /* MXVR Sync Data Logical Channel Assign Register 0 */
880#define MXVR_SYNC_LCHAN_1 0xFFC0277C /* MXVR Sync Data Logical Channel Assign Register 1 */
881#define MXVR_SYNC_LCHAN_2 0xFFC02780 /* MXVR Sync Data Logical Channel Assign Register 2 */
882#define MXVR_SYNC_LCHAN_3 0xFFC02784 /* MXVR Sync Data Logical Channel Assign Register 3 */
883#define MXVR_SYNC_LCHAN_4 0xFFC02788 /* MXVR Sync Data Logical Channel Assign Register 4 */
884#define MXVR_SYNC_LCHAN_5 0xFFC0278C /* MXVR Sync Data Logical Channel Assign Register 5 */
885#define MXVR_SYNC_LCHAN_6 0xFFC02790 /* MXVR Sync Data Logical Channel Assign Register 6 */
886#define MXVR_SYNC_LCHAN_7 0xFFC02794 /* MXVR Sync Data Logical Channel Assign Register 7 */
887
888#define MXVR_DMA0_CONFIG 0xFFC02798 /* MXVR Sync Data DMA0 Config Register */
889#define MXVR_DMA0_START_ADDR 0xFFC0279C /* MXVR Sync Data DMA0 Start Address Register */
890#define MXVR_DMA0_COUNT 0xFFC027A0 /* MXVR Sync Data DMA0 Loop Count Register */
891#define MXVR_DMA0_CURR_ADDR 0xFFC027A4 /* MXVR Sync Data DMA0 Current Address Register */
892#define MXVR_DMA0_CURR_COUNT 0xFFC027A8 /* MXVR Sync Data DMA0 Current Loop Count Register */
893
894#define MXVR_DMA1_CONFIG 0xFFC027AC /* MXVR Sync Data DMA1 Config Register */
895#define MXVR_DMA1_START_ADDR 0xFFC027B0 /* MXVR Sync Data DMA1 Start Address Register */
896#define MXVR_DMA1_COUNT 0xFFC027B4 /* MXVR Sync Data DMA1 Loop Count Register */
897#define MXVR_DMA1_CURR_ADDR 0xFFC027B8 /* MXVR Sync Data DMA1 Current Address Register */
898#define MXVR_DMA1_CURR_COUNT 0xFFC027BC /* MXVR Sync Data DMA1 Current Loop Count Register */
899
900#define MXVR_DMA2_CONFIG 0xFFC027C0 /* MXVR Sync Data DMA2 Config Register */
901#define MXVR_DMA2_START_ADDR 0xFFC027C4 /* MXVR Sync Data DMA2 Start Address Register */
902#define MXVR_DMA2_COUNT 0xFFC027C8 /* MXVR Sync Data DMA2 Loop Count Register */
903#define MXVR_DMA2_CURR_ADDR 0xFFC027CC /* MXVR Sync Data DMA2 Current Address Register */
904#define MXVR_DMA2_CURR_COUNT 0xFFC027D0 /* MXVR Sync Data DMA2 Current Loop Count Register */
905
906#define MXVR_DMA3_CONFIG 0xFFC027D4 /* MXVR Sync Data DMA3 Config Register */
907#define MXVR_DMA3_START_ADDR 0xFFC027D8 /* MXVR Sync Data DMA3 Start Address Register */
908#define MXVR_DMA3_COUNT 0xFFC027DC /* MXVR Sync Data DMA3 Loop Count Register */
909#define MXVR_DMA3_CURR_ADDR 0xFFC027E0 /* MXVR Sync Data DMA3 Current Address Register */
910#define MXVR_DMA3_CURR_COUNT 0xFFC027E4 /* MXVR Sync Data DMA3 Current Loop Count Register */
911
912#define MXVR_DMA4_CONFIG 0xFFC027E8 /* MXVR Sync Data DMA4 Config Register */
913#define MXVR_DMA4_START_ADDR 0xFFC027EC /* MXVR Sync Data DMA4 Start Address Register */
914#define MXVR_DMA4_COUNT 0xFFC027F0 /* MXVR Sync Data DMA4 Loop Count Register */
915#define MXVR_DMA4_CURR_ADDR 0xFFC027F4 /* MXVR Sync Data DMA4 Current Address Register */
916#define MXVR_DMA4_CURR_COUNT 0xFFC027F8 /* MXVR Sync Data DMA4 Current Loop Count Register */
917
918#define MXVR_DMA5_CONFIG 0xFFC027FC /* MXVR Sync Data DMA5 Config Register */
919#define MXVR_DMA5_START_ADDR 0xFFC02800 /* MXVR Sync Data DMA5 Start Address Register */
920#define MXVR_DMA5_COUNT 0xFFC02804 /* MXVR Sync Data DMA5 Loop Count Register */
921#define MXVR_DMA5_CURR_ADDR 0xFFC02808 /* MXVR Sync Data DMA5 Current Address Register */
922#define MXVR_DMA5_CURR_COUNT 0xFFC0280C /* MXVR Sync Data DMA5 Current Loop Count Register */
923
924#define MXVR_DMA6_CONFIG 0xFFC02810 /* MXVR Sync Data DMA6 Config Register */
925#define MXVR_DMA6_START_ADDR 0xFFC02814 /* MXVR Sync Data DMA6 Start Address Register */
926#define MXVR_DMA6_COUNT 0xFFC02818 /* MXVR Sync Data DMA6 Loop Count Register */
927#define MXVR_DMA6_CURR_ADDR 0xFFC0281C /* MXVR Sync Data DMA6 Current Address Register */
928#define MXVR_DMA6_CURR_COUNT 0xFFC02820 /* MXVR Sync Data DMA6 Current Loop Count Register */
929
930#define MXVR_DMA7_CONFIG 0xFFC02824 /* MXVR Sync Data DMA7 Config Register */
931#define MXVR_DMA7_START_ADDR 0xFFC02828 /* MXVR Sync Data DMA7 Start Address Register */
932#define MXVR_DMA7_COUNT 0xFFC0282C /* MXVR Sync Data DMA7 Loop Count Register */
933#define MXVR_DMA7_CURR_ADDR 0xFFC02830 /* MXVR Sync Data DMA7 Current Address Register */
934#define MXVR_DMA7_CURR_COUNT 0xFFC02834 /* MXVR Sync Data DMA7 Current Loop Count Register */
935
936#define MXVR_AP_CTL 0xFFC02838 /* MXVR Async Packet Control Register */
937#define MXVR_APRB_START_ADDR 0xFFC0283C /* MXVR Async Packet RX Buffer Start Addr Register */
938#define MXVR_APRB_CURR_ADDR 0xFFC02840 /* MXVR Async Packet RX Buffer Current Addr Register */
939#define MXVR_APTB_START_ADDR 0xFFC02844 /* MXVR Async Packet TX Buffer Start Addr Register */
940#define MXVR_APTB_CURR_ADDR 0xFFC02848 /* MXVR Async Packet TX Buffer Current Addr Register */
941
942#define MXVR_CM_CTL 0xFFC0284C /* MXVR Control Message Control Register */
943#define MXVR_CMRB_START_ADDR 0xFFC02850 /* MXVR Control Message RX Buffer Start Addr Register */
944#define MXVR_CMRB_CURR_ADDR 0xFFC02854 /* MXVR Control Message RX Buffer Current Address */
945#define MXVR_CMTB_START_ADDR 0xFFC02858 /* MXVR Control Message TX Buffer Start Addr Register */
946#define MXVR_CMTB_CURR_ADDR 0xFFC0285C /* MXVR Control Message TX Buffer Current Address */
947
948#define MXVR_RRDB_START_ADDR 0xFFC02860 /* MXVR Remote Read Buffer Start Addr Register */
949#define MXVR_RRDB_CURR_ADDR 0xFFC02864 /* MXVR Remote Read Buffer Current Addr Register */
950
951#define MXVR_PAT_DATA_0 0xFFC02868 /* MXVR Pattern Data Register 0 */
952#define MXVR_PAT_EN_0 0xFFC0286C /* MXVR Pattern Enable Register 0 */
953#define MXVR_PAT_DATA_1 0xFFC02870 /* MXVR Pattern Data Register 1 */
954#define MXVR_PAT_EN_1 0xFFC02874 /* MXVR Pattern Enable Register 1 */
955
956#define MXVR_FRAME_CNT_0 0xFFC02878 /* MXVR Frame Counter 0 */
957#define MXVR_FRAME_CNT_1 0xFFC0287C /* MXVR Frame Counter 1 */
958
959#define MXVR_ROUTING_0 0xFFC02880 /* MXVR Routing Table Register 0 */
960#define MXVR_ROUTING_1 0xFFC02884 /* MXVR Routing Table Register 1 */
961#define MXVR_ROUTING_2 0xFFC02888 /* MXVR Routing Table Register 2 */
962#define MXVR_ROUTING_3 0xFFC0288C /* MXVR Routing Table Register 3 */
963#define MXVR_ROUTING_4 0xFFC02890 /* MXVR Routing Table Register 4 */
964#define MXVR_ROUTING_5 0xFFC02894 /* MXVR Routing Table Register 5 */
965#define MXVR_ROUTING_6 0xFFC02898 /* MXVR Routing Table Register 6 */
966#define MXVR_ROUTING_7 0xFFC0289C /* MXVR Routing Table Register 7 */
967#define MXVR_ROUTING_8 0xFFC028A0 /* MXVR Routing Table Register 8 */
968#define MXVR_ROUTING_9 0xFFC028A4 /* MXVR Routing Table Register 9 */
969#define MXVR_ROUTING_10 0xFFC028A8 /* MXVR Routing Table Register 10 */
970#define MXVR_ROUTING_11 0xFFC028AC /* MXVR Routing Table Register 11 */
971#define MXVR_ROUTING_12 0xFFC028B0 /* MXVR Routing Table Register 12 */
972#define MXVR_ROUTING_13 0xFFC028B4 /* MXVR Routing Table Register 13 */
973#define MXVR_ROUTING_14 0xFFC028B8 /* MXVR Routing Table Register 14 */
974
975#define MXVR_PLL_CTL_1 0xFFC028BC /* MXVR Phase Lock Loop Control Register 1 */
976#define MXVR_BLOCK_CNT 0xFFC028C0 /* MXVR Block Counter */
977#define MXVR_PLL_CTL_2 0xFFC028C4 /* MXVR Phase Lock Loop Control Register 2 */
978
979
980/* CAN Controller (0xFFC02A00 - 0xFFC02FFF) */
981/* For Mailboxes 0-15 */
982#define CAN_MC1 0xFFC02A00 /* Mailbox config reg 1 */
983#define CAN_MD1 0xFFC02A04 /* Mailbox direction reg 1 */
984#define CAN_TRS1 0xFFC02A08 /* Transmit Request Set reg 1 */
985#define CAN_TRR1 0xFFC02A0C /* Transmit Request Reset reg 1 */
986#define CAN_TA1 0xFFC02A10 /* Transmit Acknowledge reg 1 */
987#define CAN_AA1 0xFFC02A14 /* Transmit Abort Acknowledge reg 1 */
988#define CAN_RMP1 0xFFC02A18 /* Receive Message Pending reg 1 */
989#define CAN_RML1 0xFFC02A1C /* Receive Message Lost reg 1 */
990#define CAN_MBTIF1 0xFFC02A20 /* Mailbox Transmit Interrupt Flag reg 1 */
991#define CAN_MBRIF1 0xFFC02A24 /* Mailbox Receive Interrupt Flag reg 1 */
992#define CAN_MBIM1 0xFFC02A28 /* Mailbox Interrupt Mask reg 1 */
993#define CAN_RFH1 0xFFC02A2C /* Remote Frame Handling reg 1 */
994#define CAN_OPSS1 0xFFC02A30 /* Overwrite Protection Single Shot Xmission reg 1 */
995
996/* For Mailboxes 16-31 */
997#define CAN_MC2 0xFFC02A40 /* Mailbox config reg 2 */
998#define CAN_MD2 0xFFC02A44 /* Mailbox direction reg 2 */
999#define CAN_TRS2 0xFFC02A48 /* Transmit Request Set reg 2 */
1000#define CAN_TRR2 0xFFC02A4C /* Transmit Request Reset reg 2 */
1001#define CAN_TA2 0xFFC02A50 /* Transmit Acknowledge reg 2 */
1002#define CAN_AA2 0xFFC02A54 /* Transmit Abort Acknowledge reg 2 */
1003#define CAN_RMP2 0xFFC02A58 /* Receive Message Pending reg 2 */
1004#define CAN_RML2 0xFFC02A5C /* Receive Message Lost reg 2 */
1005#define CAN_MBTIF2 0xFFC02A60 /* Mailbox Transmit Interrupt Flag reg 2 */
1006#define CAN_MBRIF2 0xFFC02A64 /* Mailbox Receive Interrupt Flag reg 2 */
1007#define CAN_MBIM2 0xFFC02A68 /* Mailbox Interrupt Mask reg 2 */
1008#define CAN_RFH2 0xFFC02A6C /* Remote Frame Handling reg 2 */
1009#define CAN_OPSS2 0xFFC02A70 /* Overwrite Protection Single Shot Xmission reg 2 */
1010
1011#define CAN_CLOCK 0xFFC02A80 /* Bit Timing Configuration register 0 */
1012#define CAN_TIMING 0xFFC02A84 /* Bit Timing Configuration register 1 */
1013
1014#define CAN_DEBUG 0xFFC02A88 /* Debug Register */
1015/* the following is for backwards compatibility */
1016#define CAN_CNF CAN_DEBUG
1017
1018#define CAN_STATUS 0xFFC02A8C /* Global Status Register */
1019#define CAN_CEC 0xFFC02A90 /* Error Counter Register */
1020#define CAN_GIS 0xFFC02A94 /* Global Interrupt Status Register */
1021#define CAN_GIM 0xFFC02A98 /* Global Interrupt Mask Register */
1022#define CAN_GIF 0xFFC02A9C /* Global Interrupt Flag Register */
1023#define CAN_CONTROL 0xFFC02AA0 /* Master Control Register */
1024#define CAN_INTR 0xFFC02AA4 /* Interrupt Pending Register */
1025#define CAN_MBTD 0xFFC02AAC /* Mailbox Temporary Disable Feature */
1026#define CAN_EWR 0xFFC02AB0 /* Programmable Warning Level */
1027#define CAN_ESR 0xFFC02AB4 /* Error Status Register */
1028#define CAN_UCCNT 0xFFC02AC4 /* Universal Counter */
1029#define CAN_UCRC 0xFFC02AC8 /* Universal Counter Reload/Capture Register */
1030#define CAN_UCCNF 0xFFC02ACC /* Universal Counter Configuration Register */
1031
1032/* Mailbox Acceptance Masks */
1033#define CAN_AM00L 0xFFC02B00 /* Mailbox 0 Low Acceptance Mask */
1034#define CAN_AM00H 0xFFC02B04 /* Mailbox 0 High Acceptance Mask */
1035#define CAN_AM01L 0xFFC02B08 /* Mailbox 1 Low Acceptance Mask */
1036#define CAN_AM01H 0xFFC02B0C /* Mailbox 1 High Acceptance Mask */
1037#define CAN_AM02L 0xFFC02B10 /* Mailbox 2 Low Acceptance Mask */
1038#define CAN_AM02H 0xFFC02B14 /* Mailbox 2 High Acceptance Mask */
1039#define CAN_AM03L 0xFFC02B18 /* Mailbox 3 Low Acceptance Mask */
1040#define CAN_AM03H 0xFFC02B1C /* Mailbox 3 High Acceptance Mask */
1041#define CAN_AM04L 0xFFC02B20 /* Mailbox 4 Low Acceptance Mask */
1042#define CAN_AM04H 0xFFC02B24 /* Mailbox 4 High Acceptance Mask */
1043#define CAN_AM05L 0xFFC02B28 /* Mailbox 5 Low Acceptance Mask */
1044#define CAN_AM05H 0xFFC02B2C /* Mailbox 5 High Acceptance Mask */
1045#define CAN_AM06L 0xFFC02B30 /* Mailbox 6 Low Acceptance Mask */
1046#define CAN_AM06H 0xFFC02B34 /* Mailbox 6 High Acceptance Mask */
1047#define CAN_AM07L 0xFFC02B38 /* Mailbox 7 Low Acceptance Mask */
1048#define CAN_AM07H 0xFFC02B3C /* Mailbox 7 High Acceptance Mask */
1049#define CAN_AM08L 0xFFC02B40 /* Mailbox 8 Low Acceptance Mask */
1050#define CAN_AM08H 0xFFC02B44 /* Mailbox 8 High Acceptance Mask */
1051#define CAN_AM09L 0xFFC02B48 /* Mailbox 9 Low Acceptance Mask */
1052#define CAN_AM09H 0xFFC02B4C /* Mailbox 9 High Acceptance Mask */
1053#define CAN_AM10L 0xFFC02B50 /* Mailbox 10 Low Acceptance Mask */
1054#define CAN_AM10H 0xFFC02B54 /* Mailbox 10 High Acceptance Mask */
1055#define CAN_AM11L 0xFFC02B58 /* Mailbox 11 Low Acceptance Mask */
1056#define CAN_AM11H 0xFFC02B5C /* Mailbox 11 High Acceptance Mask */
1057#define CAN_AM12L 0xFFC02B60 /* Mailbox 12 Low Acceptance Mask */
1058#define CAN_AM12H 0xFFC02B64 /* Mailbox 12 High Acceptance Mask */
1059#define CAN_AM13L 0xFFC02B68 /* Mailbox 13 Low Acceptance Mask */
1060#define CAN_AM13H 0xFFC02B6C /* Mailbox 13 High Acceptance Mask */
1061#define CAN_AM14L 0xFFC02B70 /* Mailbox 14 Low Acceptance Mask */
1062#define CAN_AM14H 0xFFC02B74 /* Mailbox 14 High Acceptance Mask */
1063#define CAN_AM15L 0xFFC02B78 /* Mailbox 15 Low Acceptance Mask */
1064#define CAN_AM15H 0xFFC02B7C /* Mailbox 15 High Acceptance Mask */
1065
1066#define CAN_AM16L 0xFFC02B80 /* Mailbox 16 Low Acceptance Mask */
1067#define CAN_AM16H 0xFFC02B84 /* Mailbox 16 High Acceptance Mask */
1068#define CAN_AM17L 0xFFC02B88 /* Mailbox 17 Low Acceptance Mask */
1069#define CAN_AM17H 0xFFC02B8C /* Mailbox 17 High Acceptance Mask */
1070#define CAN_AM18L 0xFFC02B90 /* Mailbox 18 Low Acceptance Mask */
1071#define CAN_AM18H 0xFFC02B94 /* Mailbox 18 High Acceptance Mask */
1072#define CAN_AM19L 0xFFC02B98 /* Mailbox 19 Low Acceptance Mask */
1073#define CAN_AM19H 0xFFC02B9C /* Mailbox 19 High Acceptance Mask */
1074#define CAN_AM20L 0xFFC02BA0 /* Mailbox 20 Low Acceptance Mask */
1075#define CAN_AM20H 0xFFC02BA4 /* Mailbox 20 High Acceptance Mask */
1076#define CAN_AM21L 0xFFC02BA8 /* Mailbox 21 Low Acceptance Mask */
1077#define CAN_AM21H 0xFFC02BAC /* Mailbox 21 High Acceptance Mask */
1078#define CAN_AM22L 0xFFC02BB0 /* Mailbox 22 Low Acceptance Mask */
1079#define CAN_AM22H 0xFFC02BB4 /* Mailbox 22 High Acceptance Mask */
1080#define CAN_AM23L 0xFFC02BB8 /* Mailbox 23 Low Acceptance Mask */
1081#define CAN_AM23H 0xFFC02BBC /* Mailbox 23 High Acceptance Mask */
1082#define CAN_AM24L 0xFFC02BC0 /* Mailbox 24 Low Acceptance Mask */
1083#define CAN_AM24H 0xFFC02BC4 /* Mailbox 24 High Acceptance Mask */
1084#define CAN_AM25L 0xFFC02BC8 /* Mailbox 25 Low Acceptance Mask */
1085#define CAN_AM25H 0xFFC02BCC /* Mailbox 25 High Acceptance Mask */
1086#define CAN_AM26L 0xFFC02BD0 /* Mailbox 26 Low Acceptance Mask */
1087#define CAN_AM26H 0xFFC02BD4 /* Mailbox 26 High Acceptance Mask */
1088#define CAN_AM27L 0xFFC02BD8 /* Mailbox 27 Low Acceptance Mask */
1089#define CAN_AM27H 0xFFC02BDC /* Mailbox 27 High Acceptance Mask */
1090#define CAN_AM28L 0xFFC02BE0 /* Mailbox 28 Low Acceptance Mask */
1091#define CAN_AM28H 0xFFC02BE4 /* Mailbox 28 High Acceptance Mask */
1092#define CAN_AM29L 0xFFC02BE8 /* Mailbox 29 Low Acceptance Mask */
1093#define CAN_AM29H 0xFFC02BEC /* Mailbox 29 High Acceptance Mask */
1094#define CAN_AM30L 0xFFC02BF0 /* Mailbox 30 Low Acceptance Mask */
1095#define CAN_AM30H 0xFFC02BF4 /* Mailbox 30 High Acceptance Mask */
1096#define CAN_AM31L 0xFFC02BF8 /* Mailbox 31 Low Acceptance Mask */
1097#define CAN_AM31H 0xFFC02BFC /* Mailbox 31 High Acceptance Mask */
1098
1099/* CAN Acceptance Mask Macros */
1100#define CAN_AM_L(x) (CAN_AM00L+((x)*0x8))
1101#define CAN_AM_H(x) (CAN_AM00H+((x)*0x8))
1102
1103/* Mailbox Registers */
1104#define CAN_MB00_DATA0 0xFFC02C00 /* Mailbox 0 Data Word 0 [15:0] Register */
1105#define CAN_MB00_DATA1 0xFFC02C04 /* Mailbox 0 Data Word 1 [31:16] Register */
1106#define CAN_MB00_DATA2 0xFFC02C08 /* Mailbox 0 Data Word 2 [47:32] Register */
1107#define CAN_MB00_DATA3 0xFFC02C0C /* Mailbox 0 Data Word 3 [63:48] Register */
1108#define CAN_MB00_LENGTH 0xFFC02C10 /* Mailbox 0 Data Length Code Register */
1109#define CAN_MB00_TIMESTAMP 0xFFC02C14 /* Mailbox 0 Time Stamp Value Register */
1110#define CAN_MB00_ID0 0xFFC02C18 /* Mailbox 0 Identifier Low Register */
1111#define CAN_MB00_ID1 0xFFC02C1C /* Mailbox 0 Identifier High Register */
1112
1113#define CAN_MB01_DATA0 0xFFC02C20 /* Mailbox 1 Data Word 0 [15:0] Register */
1114#define CAN_MB01_DATA1 0xFFC02C24 /* Mailbox 1 Data Word 1 [31:16] Register */
1115#define CAN_MB01_DATA2 0xFFC02C28 /* Mailbox 1 Data Word 2 [47:32] Register */
1116#define CAN_MB01_DATA3 0xFFC02C2C /* Mailbox 1 Data Word 3 [63:48] Register */
1117#define CAN_MB01_LENGTH 0xFFC02C30 /* Mailbox 1 Data Length Code Register */
1118#define CAN_MB01_TIMESTAMP 0xFFC02C34 /* Mailbox 1 Time Stamp Value Register */
1119#define CAN_MB01_ID0 0xFFC02C38 /* Mailbox 1 Identifier Low Register */
1120#define CAN_MB01_ID1 0xFFC02C3C /* Mailbox 1 Identifier High Register */
1121
1122#define CAN_MB02_DATA0 0xFFC02C40 /* Mailbox 2 Data Word 0 [15:0] Register */
1123#define CAN_MB02_DATA1 0xFFC02C44 /* Mailbox 2 Data Word 1 [31:16] Register */
1124#define CAN_MB02_DATA2 0xFFC02C48 /* Mailbox 2 Data Word 2 [47:32] Register */
1125#define CAN_MB02_DATA3 0xFFC02C4C /* Mailbox 2 Data Word 3 [63:48] Register */
1126#define CAN_MB02_LENGTH 0xFFC02C50 /* Mailbox 2 Data Length Code Register */
1127#define CAN_MB02_TIMESTAMP 0xFFC02C54 /* Mailbox 2 Time Stamp Value Register */
1128#define CAN_MB02_ID0 0xFFC02C58 /* Mailbox 2 Identifier Low Register */
1129#define CAN_MB02_ID1 0xFFC02C5C /* Mailbox 2 Identifier High Register */
1130
1131#define CAN_MB03_DATA0 0xFFC02C60 /* Mailbox 3 Data Word 0 [15:0] Register */
1132#define CAN_MB03_DATA1 0xFFC02C64 /* Mailbox 3 Data Word 1 [31:16] Register */
1133#define CAN_MB03_DATA2 0xFFC02C68 /* Mailbox 3 Data Word 2 [47:32] Register */
1134#define CAN_MB03_DATA3 0xFFC02C6C /* Mailbox 3 Data Word 3 [63:48] Register */
1135#define CAN_MB03_LENGTH 0xFFC02C70 /* Mailbox 3 Data Length Code Register */
1136#define CAN_MB03_TIMESTAMP 0xFFC02C74 /* Mailbox 3 Time Stamp Value Register */
1137#define CAN_MB03_ID0 0xFFC02C78 /* Mailbox 3 Identifier Low Register */
1138#define CAN_MB03_ID1 0xFFC02C7C /* Mailbox 3 Identifier High Register */
1139
1140#define CAN_MB04_DATA0 0xFFC02C80 /* Mailbox 4 Data Word 0 [15:0] Register */
1141#define CAN_MB04_DATA1 0xFFC02C84 /* Mailbox 4 Data Word 1 [31:16] Register */
1142#define CAN_MB04_DATA2 0xFFC02C88 /* Mailbox 4 Data Word 2 [47:32] Register */
1143#define CAN_MB04_DATA3 0xFFC02C8C /* Mailbox 4 Data Word 3 [63:48] Register */
1144#define CAN_MB04_LENGTH 0xFFC02C90 /* Mailbox 4 Data Length Code Register */
1145#define CAN_MB04_TIMESTAMP 0xFFC02C94 /* Mailbox 4 Time Stamp Value Register */
1146#define CAN_MB04_ID0 0xFFC02C98 /* Mailbox 4 Identifier Low Register */
1147#define CAN_MB04_ID1 0xFFC02C9C /* Mailbox 4 Identifier High Register */
1148
1149#define CAN_MB05_DATA0 0xFFC02CA0 /* Mailbox 5 Data Word 0 [15:0] Register */
1150#define CAN_MB05_DATA1 0xFFC02CA4 /* Mailbox 5 Data Word 1 [31:16] Register */
1151#define CAN_MB05_DATA2 0xFFC02CA8 /* Mailbox 5 Data Word 2 [47:32] Register */
1152#define CAN_MB05_DATA3 0xFFC02CAC /* Mailbox 5 Data Word 3 [63:48] Register */
1153#define CAN_MB05_LENGTH 0xFFC02CB0 /* Mailbox 5 Data Length Code Register */
1154#define CAN_MB05_TIMESTAMP 0xFFC02CB4 /* Mailbox 5 Time Stamp Value Register */
1155#define CAN_MB05_ID0 0xFFC02CB8 /* Mailbox 5 Identifier Low Register */
1156#define CAN_MB05_ID1 0xFFC02CBC /* Mailbox 5 Identifier High Register */
1157
1158#define CAN_MB06_DATA0 0xFFC02CC0 /* Mailbox 6 Data Word 0 [15:0] Register */
1159#define CAN_MB06_DATA1 0xFFC02CC4 /* Mailbox 6 Data Word 1 [31:16] Register */
1160#define CAN_MB06_DATA2 0xFFC02CC8 /* Mailbox 6 Data Word 2 [47:32] Register */
1161#define CAN_MB06_DATA3 0xFFC02CCC /* Mailbox 6 Data Word 3 [63:48] Register */
1162#define CAN_MB06_LENGTH 0xFFC02CD0 /* Mailbox 6 Data Length Code Register */
1163#define CAN_MB06_TIMESTAMP 0xFFC02CD4 /* Mailbox 6 Time Stamp Value Register */
1164#define CAN_MB06_ID0 0xFFC02CD8 /* Mailbox 6 Identifier Low Register */
1165#define CAN_MB06_ID1 0xFFC02CDC /* Mailbox 6 Identifier High Register */
1166
1167#define CAN_MB07_DATA0 0xFFC02CE0 /* Mailbox 7 Data Word 0 [15:0] Register */
1168#define CAN_MB07_DATA1 0xFFC02CE4 /* Mailbox 7 Data Word 1 [31:16] Register */
1169#define CAN_MB07_DATA2 0xFFC02CE8 /* Mailbox 7 Data Word 2 [47:32] Register */
1170#define CAN_MB07_DATA3 0xFFC02CEC /* Mailbox 7 Data Word 3 [63:48] Register */
1171#define CAN_MB07_LENGTH 0xFFC02CF0 /* Mailbox 7 Data Length Code Register */
1172#define CAN_MB07_TIMESTAMP 0xFFC02CF4 /* Mailbox 7 Time Stamp Value Register */
1173#define CAN_MB07_ID0 0xFFC02CF8 /* Mailbox 7 Identifier Low Register */
1174#define CAN_MB07_ID1 0xFFC02CFC /* Mailbox 7 Identifier High Register */
1175
1176#define CAN_MB08_DATA0 0xFFC02D00 /* Mailbox 8 Data Word 0 [15:0] Register */
1177#define CAN_MB08_DATA1 0xFFC02D04 /* Mailbox 8 Data Word 1 [31:16] Register */
1178#define CAN_MB08_DATA2 0xFFC02D08 /* Mailbox 8 Data Word 2 [47:32] Register */
1179#define CAN_MB08_DATA3 0xFFC02D0C /* Mailbox 8 Data Word 3 [63:48] Register */
1180#define CAN_MB08_LENGTH 0xFFC02D10 /* Mailbox 8 Data Length Code Register */
1181#define CAN_MB08_TIMESTAMP 0xFFC02D14 /* Mailbox 8 Time Stamp Value Register */
1182#define CAN_MB08_ID0 0xFFC02D18 /* Mailbox 8 Identifier Low Register */
1183#define CAN_MB08_ID1 0xFFC02D1C /* Mailbox 8 Identifier High Register */
1184
1185#define CAN_MB09_DATA0 0xFFC02D20 /* Mailbox 9 Data Word 0 [15:0] Register */
1186#define CAN_MB09_DATA1 0xFFC02D24 /* Mailbox 9 Data Word 1 [31:16] Register */
1187#define CAN_MB09_DATA2 0xFFC02D28 /* Mailbox 9 Data Word 2 [47:32] Register */
1188#define CAN_MB09_DATA3 0xFFC02D2C /* Mailbox 9 Data Word 3 [63:48] Register */
1189#define CAN_MB09_LENGTH 0xFFC02D30 /* Mailbox 9 Data Length Code Register */
1190#define CAN_MB09_TIMESTAMP 0xFFC02D34 /* Mailbox 9 Time Stamp Value Register */
1191#define CAN_MB09_ID0 0xFFC02D38 /* Mailbox 9 Identifier Low Register */
1192#define CAN_MB09_ID1 0xFFC02D3C /* Mailbox 9 Identifier High Register */
1193
1194#define CAN_MB10_DATA0 0xFFC02D40 /* Mailbox 10 Data Word 0 [15:0] Register */
1195#define CAN_MB10_DATA1 0xFFC02D44 /* Mailbox 10 Data Word 1 [31:16] Register */
1196#define CAN_MB10_DATA2 0xFFC02D48 /* Mailbox 10 Data Word 2 [47:32] Register */
1197#define CAN_MB10_DATA3 0xFFC02D4C /* Mailbox 10 Data Word 3 [63:48] Register */
1198#define CAN_MB10_LENGTH 0xFFC02D50 /* Mailbox 10 Data Length Code Register */
1199#define CAN_MB10_TIMESTAMP 0xFFC02D54 /* Mailbox 10 Time Stamp Value Register */
1200#define CAN_MB10_ID0 0xFFC02D58 /* Mailbox 10 Identifier Low Register */
1201#define CAN_MB10_ID1 0xFFC02D5C /* Mailbox 10 Identifier High Register */
1202
1203#define CAN_MB11_DATA0 0xFFC02D60 /* Mailbox 11 Data Word 0 [15:0] Register */
1204#define CAN_MB11_DATA1 0xFFC02D64 /* Mailbox 11 Data Word 1 [31:16] Register */
1205#define CAN_MB11_DATA2 0xFFC02D68 /* Mailbox 11 Data Word 2 [47:32] Register */
1206#define CAN_MB11_DATA3 0xFFC02D6C /* Mailbox 11 Data Word 3 [63:48] Register */
1207#define CAN_MB11_LENGTH 0xFFC02D70 /* Mailbox 11 Data Length Code Register */
1208#define CAN_MB11_TIMESTAMP 0xFFC02D74 /* Mailbox 11 Time Stamp Value Register */
1209#define CAN_MB11_ID0 0xFFC02D78 /* Mailbox 11 Identifier Low Register */
1210#define CAN_MB11_ID1 0xFFC02D7C /* Mailbox 11 Identifier High Register */
1211
1212#define CAN_MB12_DATA0 0xFFC02D80 /* Mailbox 12 Data Word 0 [15:0] Register */
1213#define CAN_MB12_DATA1 0xFFC02D84 /* Mailbox 12 Data Word 1 [31:16] Register */
1214#define CAN_MB12_DATA2 0xFFC02D88 /* Mailbox 12 Data Word 2 [47:32] Register */
1215#define CAN_MB12_DATA3 0xFFC02D8C /* Mailbox 12 Data Word 3 [63:48] Register */
1216#define CAN_MB12_LENGTH 0xFFC02D90 /* Mailbox 12 Data Length Code Register */
1217#define CAN_MB12_TIMESTAMP 0xFFC02D94 /* Mailbox 12 Time Stamp Value Register */
1218#define CAN_MB12_ID0 0xFFC02D98 /* Mailbox 12 Identifier Low Register */
1219#define CAN_MB12_ID1 0xFFC02D9C /* Mailbox 12 Identifier High Register */
1220
1221#define CAN_MB13_DATA0 0xFFC02DA0 /* Mailbox 13 Data Word 0 [15:0] Register */
1222#define CAN_MB13_DATA1 0xFFC02DA4 /* Mailbox 13 Data Word 1 [31:16] Register */
1223#define CAN_MB13_DATA2 0xFFC02DA8 /* Mailbox 13 Data Word 2 [47:32] Register */
1224#define CAN_MB13_DATA3 0xFFC02DAC /* Mailbox 13 Data Word 3 [63:48] Register */
1225#define CAN_MB13_LENGTH 0xFFC02DB0 /* Mailbox 13 Data Length Code Register */
1226#define CAN_MB13_TIMESTAMP 0xFFC02DB4 /* Mailbox 13 Time Stamp Value Register */
1227#define CAN_MB13_ID0 0xFFC02DB8 /* Mailbox 13 Identifier Low Register */
1228#define CAN_MB13_ID1 0xFFC02DBC /* Mailbox 13 Identifier High Register */
1229
1230#define CAN_MB14_DATA0 0xFFC02DC0 /* Mailbox 14 Data Word 0 [15:0] Register */
1231#define CAN_MB14_DATA1 0xFFC02DC4 /* Mailbox 14 Data Word 1 [31:16] Register */
1232#define CAN_MB14_DATA2 0xFFC02DC8 /* Mailbox 14 Data Word 2 [47:32] Register */
1233#define CAN_MB14_DATA3 0xFFC02DCC /* Mailbox 14 Data Word 3 [63:48] Register */
1234#define CAN_MB14_LENGTH 0xFFC02DD0 /* Mailbox 14 Data Length Code Register */
1235#define CAN_MB14_TIMESTAMP 0xFFC02DD4 /* Mailbox 14 Time Stamp Value Register */
1236#define CAN_MB14_ID0 0xFFC02DD8 /* Mailbox 14 Identifier Low Register */
1237#define CAN_MB14_ID1 0xFFC02DDC /* Mailbox 14 Identifier High Register */
1238
1239#define CAN_MB15_DATA0 0xFFC02DE0 /* Mailbox 15 Data Word 0 [15:0] Register */
1240#define CAN_MB15_DATA1 0xFFC02DE4 /* Mailbox 15 Data Word 1 [31:16] Register */
1241#define CAN_MB15_DATA2 0xFFC02DE8 /* Mailbox 15 Data Word 2 [47:32] Register */
1242#define CAN_MB15_DATA3 0xFFC02DEC /* Mailbox 15 Data Word 3 [63:48] Register */
1243#define CAN_MB15_LENGTH 0xFFC02DF0 /* Mailbox 15 Data Length Code Register */
1244#define CAN_MB15_TIMESTAMP 0xFFC02DF4 /* Mailbox 15 Time Stamp Value Register */
1245#define CAN_MB15_ID0 0xFFC02DF8 /* Mailbox 15 Identifier Low Register */
1246#define CAN_MB15_ID1 0xFFC02DFC /* Mailbox 15 Identifier High Register */
1247
1248#define CAN_MB16_DATA0 0xFFC02E00 /* Mailbox 16 Data Word 0 [15:0] Register */
1249#define CAN_MB16_DATA1 0xFFC02E04 /* Mailbox 16 Data Word 1 [31:16] Register */
1250#define CAN_MB16_DATA2 0xFFC02E08 /* Mailbox 16 Data Word 2 [47:32] Register */
1251#define CAN_MB16_DATA3 0xFFC02E0C /* Mailbox 16 Data Word 3 [63:48] Register */
1252#define CAN_MB16_LENGTH 0xFFC02E10 /* Mailbox 16 Data Length Code Register */
1253#define CAN_MB16_TIMESTAMP 0xFFC02E14 /* Mailbox 16 Time Stamp Value Register */
1254#define CAN_MB16_ID0 0xFFC02E18 /* Mailbox 16 Identifier Low Register */
1255#define CAN_MB16_ID1 0xFFC02E1C /* Mailbox 16 Identifier High Register */
1256
1257#define CAN_MB17_DATA0 0xFFC02E20 /* Mailbox 17 Data Word 0 [15:0] Register */
1258#define CAN_MB17_DATA1 0xFFC02E24 /* Mailbox 17 Data Word 1 [31:16] Register */
1259#define CAN_MB17_DATA2 0xFFC02E28 /* Mailbox 17 Data Word 2 [47:32] Register */
1260#define CAN_MB17_DATA3 0xFFC02E2C /* Mailbox 17 Data Word 3 [63:48] Register */
1261#define CAN_MB17_LENGTH 0xFFC02E30 /* Mailbox 17 Data Length Code Register */
1262#define CAN_MB17_TIMESTAMP 0xFFC02E34 /* Mailbox 17 Time Stamp Value Register */
1263#define CAN_MB17_ID0 0xFFC02E38 /* Mailbox 17 Identifier Low Register */
1264#define CAN_MB17_ID1 0xFFC02E3C /* Mailbox 17 Identifier High Register */
1265
1266#define CAN_MB18_DATA0 0xFFC02E40 /* Mailbox 18 Data Word 0 [15:0] Register */
1267#define CAN_MB18_DATA1 0xFFC02E44 /* Mailbox 18 Data Word 1 [31:16] Register */
1268#define CAN_MB18_DATA2 0xFFC02E48 /* Mailbox 18 Data Word 2 [47:32] Register */
1269#define CAN_MB18_DATA3 0xFFC02E4C /* Mailbox 18 Data Word 3 [63:48] Register */
1270#define CAN_MB18_LENGTH 0xFFC02E50 /* Mailbox 18 Data Length Code Register */
1271#define CAN_MB18_TIMESTAMP 0xFFC02E54 /* Mailbox 18 Time Stamp Value Register */
1272#define CAN_MB18_ID0 0xFFC02E58 /* Mailbox 18 Identifier Low Register */
1273#define CAN_MB18_ID1 0xFFC02E5C /* Mailbox 18 Identifier High Register */
1274
1275#define CAN_MB19_DATA0 0xFFC02E60 /* Mailbox 19 Data Word 0 [15:0] Register */
1276#define CAN_MB19_DATA1 0xFFC02E64 /* Mailbox 19 Data Word 1 [31:16] Register */
1277#define CAN_MB19_DATA2 0xFFC02E68 /* Mailbox 19 Data Word 2 [47:32] Register */
1278#define CAN_MB19_DATA3 0xFFC02E6C /* Mailbox 19 Data Word 3 [63:48] Register */
1279#define CAN_MB19_LENGTH 0xFFC02E70 /* Mailbox 19 Data Length Code Register */
1280#define CAN_MB19_TIMESTAMP 0xFFC02E74 /* Mailbox 19 Time Stamp Value Register */
1281#define CAN_MB19_ID0 0xFFC02E78 /* Mailbox 19 Identifier Low Register */
1282#define CAN_MB19_ID1 0xFFC02E7C /* Mailbox 19 Identifier High Register */
1283
1284#define CAN_MB20_DATA0 0xFFC02E80 /* Mailbox 20 Data Word 0 [15:0] Register */
1285#define CAN_MB20_DATA1 0xFFC02E84 /* Mailbox 20 Data Word 1 [31:16] Register */
1286#define CAN_MB20_DATA2 0xFFC02E88 /* Mailbox 20 Data Word 2 [47:32] Register */
1287#define CAN_MB20_DATA3 0xFFC02E8C /* Mailbox 20 Data Word 3 [63:48] Register */
1288#define CAN_MB20_LENGTH 0xFFC02E90 /* Mailbox 20 Data Length Code Register */
1289#define CAN_MB20_TIMESTAMP 0xFFC02E94 /* Mailbox 20 Time Stamp Value Register */
1290#define CAN_MB20_ID0 0xFFC02E98 /* Mailbox 20 Identifier Low Register */
1291#define CAN_MB20_ID1 0xFFC02E9C /* Mailbox 20 Identifier High Register */
1292
1293#define CAN_MB21_DATA0 0xFFC02EA0 /* Mailbox 21 Data Word 0 [15:0] Register */
1294#define CAN_MB21_DATA1 0xFFC02EA4 /* Mailbox 21 Data Word 1 [31:16] Register */
1295#define CAN_MB21_DATA2 0xFFC02EA8 /* Mailbox 21 Data Word 2 [47:32] Register */
1296#define CAN_MB21_DATA3 0xFFC02EAC /* Mailbox 21 Data Word 3 [63:48] Register */
1297#define CAN_MB21_LENGTH 0xFFC02EB0 /* Mailbox 21 Data Length Code Register */
1298#define CAN_MB21_TIMESTAMP 0xFFC02EB4 /* Mailbox 21 Time Stamp Value Register */
1299#define CAN_MB21_ID0 0xFFC02EB8 /* Mailbox 21 Identifier Low Register */
1300#define CAN_MB21_ID1 0xFFC02EBC /* Mailbox 21 Identifier High Register */
1301
1302#define CAN_MB22_DATA0 0xFFC02EC0 /* Mailbox 22 Data Word 0 [15:0] Register */
1303#define CAN_MB22_DATA1 0xFFC02EC4 /* Mailbox 22 Data Word 1 [31:16] Register */
1304#define CAN_MB22_DATA2 0xFFC02EC8 /* Mailbox 22 Data Word 2 [47:32] Register */
1305#define CAN_MB22_DATA3 0xFFC02ECC /* Mailbox 22 Data Word 3 [63:48] Register */
1306#define CAN_MB22_LENGTH 0xFFC02ED0 /* Mailbox 22 Data Length Code Register */
1307#define CAN_MB22_TIMESTAMP 0xFFC02ED4 /* Mailbox 22 Time Stamp Value Register */
1308#define CAN_MB22_ID0 0xFFC02ED8 /* Mailbox 22 Identifier Low Register */
1309#define CAN_MB22_ID1 0xFFC02EDC /* Mailbox 22 Identifier High Register */
1310
1311#define CAN_MB23_DATA0 0xFFC02EE0 /* Mailbox 23 Data Word 0 [15:0] Register */
1312#define CAN_MB23_DATA1 0xFFC02EE4 /* Mailbox 23 Data Word 1 [31:16] Register */
1313#define CAN_MB23_DATA2 0xFFC02EE8 /* Mailbox 23 Data Word 2 [47:32] Register */
1314#define CAN_MB23_DATA3 0xFFC02EEC /* Mailbox 23 Data Word 3 [63:48] Register */
1315#define CAN_MB23_LENGTH 0xFFC02EF0 /* Mailbox 23 Data Length Code Register */
1316#define CAN_MB23_TIMESTAMP 0xFFC02EF4 /* Mailbox 23 Time Stamp Value Register */
1317#define CAN_MB23_ID0 0xFFC02EF8 /* Mailbox 23 Identifier Low Register */
1318#define CAN_MB23_ID1 0xFFC02EFC /* Mailbox 23 Identifier High Register */
1319
1320#define CAN_MB24_DATA0 0xFFC02F00 /* Mailbox 24 Data Word 0 [15:0] Register */
1321#define CAN_MB24_DATA1 0xFFC02F04 /* Mailbox 24 Data Word 1 [31:16] Register */
1322#define CAN_MB24_DATA2 0xFFC02F08 /* Mailbox 24 Data Word 2 [47:32] Register */
1323#define CAN_MB24_DATA3 0xFFC02F0C /* Mailbox 24 Data Word 3 [63:48] Register */
1324#define CAN_MB24_LENGTH 0xFFC02F10 /* Mailbox 24 Data Length Code Register */
1325#define CAN_MB24_TIMESTAMP 0xFFC02F14 /* Mailbox 24 Time Stamp Value Register */
1326#define CAN_MB24_ID0 0xFFC02F18 /* Mailbox 24 Identifier Low Register */
1327#define CAN_MB24_ID1 0xFFC02F1C /* Mailbox 24 Identifier High Register */
1328
1329#define CAN_MB25_DATA0 0xFFC02F20 /* Mailbox 25 Data Word 0 [15:0] Register */
1330#define CAN_MB25_DATA1 0xFFC02F24 /* Mailbox 25 Data Word 1 [31:16] Register */
1331#define CAN_MB25_DATA2 0xFFC02F28 /* Mailbox 25 Data Word 2 [47:32] Register */
1332#define CAN_MB25_DATA3 0xFFC02F2C /* Mailbox 25 Data Word 3 [63:48] Register */
1333#define CAN_MB25_LENGTH 0xFFC02F30 /* Mailbox 25 Data Length Code Register */
1334#define CAN_MB25_TIMESTAMP 0xFFC02F34 /* Mailbox 25 Time Stamp Value Register */
1335#define CAN_MB25_ID0 0xFFC02F38 /* Mailbox 25 Identifier Low Register */
1336#define CAN_MB25_ID1 0xFFC02F3C /* Mailbox 25 Identifier High Register */
1337
1338#define CAN_MB26_DATA0 0xFFC02F40 /* Mailbox 26 Data Word 0 [15:0] Register */
1339#define CAN_MB26_DATA1 0xFFC02F44 /* Mailbox 26 Data Word 1 [31:16] Register */
1340#define CAN_MB26_DATA2 0xFFC02F48 /* Mailbox 26 Data Word 2 [47:32] Register */
1341#define CAN_MB26_DATA3 0xFFC02F4C /* Mailbox 26 Data Word 3 [63:48] Register */
1342#define CAN_MB26_LENGTH 0xFFC02F50 /* Mailbox 26 Data Length Code Register */
1343#define CAN_MB26_TIMESTAMP 0xFFC02F54 /* Mailbox 26 Time Stamp Value Register */
1344#define CAN_MB26_ID0 0xFFC02F58 /* Mailbox 26 Identifier Low Register */
1345#define CAN_MB26_ID1 0xFFC02F5C /* Mailbox 26 Identifier High Register */
1346
1347#define CAN_MB27_DATA0 0xFFC02F60 /* Mailbox 27 Data Word 0 [15:0] Register */
1348#define CAN_MB27_DATA1 0xFFC02F64 /* Mailbox 27 Data Word 1 [31:16] Register */
1349#define CAN_MB27_DATA2 0xFFC02F68 /* Mailbox 27 Data Word 2 [47:32] Register */
1350#define CAN_MB27_DATA3 0xFFC02F6C /* Mailbox 27 Data Word 3 [63:48] Register */
1351#define CAN_MB27_LENGTH 0xFFC02F70 /* Mailbox 27 Data Length Code Register */
1352#define CAN_MB27_TIMESTAMP 0xFFC02F74 /* Mailbox 27 Time Stamp Value Register */
1353#define CAN_MB27_ID0 0xFFC02F78 /* Mailbox 27 Identifier Low Register */
1354#define CAN_MB27_ID1 0xFFC02F7C /* Mailbox 27 Identifier High Register */
1355
1356#define CAN_MB28_DATA0 0xFFC02F80 /* Mailbox 28 Data Word 0 [15:0] Register */
1357#define CAN_MB28_DATA1 0xFFC02F84 /* Mailbox 28 Data Word 1 [31:16] Register */
1358#define CAN_MB28_DATA2 0xFFC02F88 /* Mailbox 28 Data Word 2 [47:32] Register */
1359#define CAN_MB28_DATA3 0xFFC02F8C /* Mailbox 28 Data Word 3 [63:48] Register */
1360#define CAN_MB28_LENGTH 0xFFC02F90 /* Mailbox 28 Data Length Code Register */
1361#define CAN_MB28_TIMESTAMP 0xFFC02F94 /* Mailbox 28 Time Stamp Value Register */
1362#define CAN_MB28_ID0 0xFFC02F98 /* Mailbox 28 Identifier Low Register */
1363#define CAN_MB28_ID1 0xFFC02F9C /* Mailbox 28 Identifier High Register */
1364
1365#define CAN_MB29_DATA0 0xFFC02FA0 /* Mailbox 29 Data Word 0 [15:0] Register */
1366#define CAN_MB29_DATA1 0xFFC02FA4 /* Mailbox 29 Data Word 1 [31:16] Register */
1367#define CAN_MB29_DATA2 0xFFC02FA8 /* Mailbox 29 Data Word 2 [47:32] Register */
1368#define CAN_MB29_DATA3 0xFFC02FAC /* Mailbox 29 Data Word 3 [63:48] Register */
1369#define CAN_MB29_LENGTH 0xFFC02FB0 /* Mailbox 29 Data Length Code Register */
1370#define CAN_MB29_TIMESTAMP 0xFFC02FB4 /* Mailbox 29 Time Stamp Value Register */
1371#define CAN_MB29_ID0 0xFFC02FB8 /* Mailbox 29 Identifier Low Register */
1372#define CAN_MB29_ID1 0xFFC02FBC /* Mailbox 29 Identifier High Register */
1373
1374#define CAN_MB30_DATA0 0xFFC02FC0 /* Mailbox 30 Data Word 0 [15:0] Register */
1375#define CAN_MB30_DATA1 0xFFC02FC4 /* Mailbox 30 Data Word 1 [31:16] Register */
1376#define CAN_MB30_DATA2 0xFFC02FC8 /* Mailbox 30 Data Word 2 [47:32] Register */
1377#define CAN_MB30_DATA3 0xFFC02FCC /* Mailbox 30 Data Word 3 [63:48] Register */
1378#define CAN_MB30_LENGTH 0xFFC02FD0 /* Mailbox 30 Data Length Code Register */
1379#define CAN_MB30_TIMESTAMP 0xFFC02FD4 /* Mailbox 30 Time Stamp Value Register */
1380#define CAN_MB30_ID0 0xFFC02FD8 /* Mailbox 30 Identifier Low Register */
1381#define CAN_MB30_ID1 0xFFC02FDC /* Mailbox 30 Identifier High Register */
1382
1383#define CAN_MB31_DATA0 0xFFC02FE0 /* Mailbox 31 Data Word 0 [15:0] Register */
1384#define CAN_MB31_DATA1 0xFFC02FE4 /* Mailbox 31 Data Word 1 [31:16] Register */
1385#define CAN_MB31_DATA2 0xFFC02FE8 /* Mailbox 31 Data Word 2 [47:32] Register */
1386#define CAN_MB31_DATA3 0xFFC02FEC /* Mailbox 31 Data Word 3 [63:48] Register */
1387#define CAN_MB31_LENGTH 0xFFC02FF0 /* Mailbox 31 Data Length Code Register */
1388#define CAN_MB31_TIMESTAMP 0xFFC02FF4 /* Mailbox 31 Time Stamp Value Register */
1389#define CAN_MB31_ID0 0xFFC02FF8 /* Mailbox 31 Identifier Low Register */
1390#define CAN_MB31_ID1 0xFFC02FFC /* Mailbox 31 Identifier High Register */
1391
1392/* CAN Mailbox Area Macros */
1393#define CAN_MB_ID1(x) (CAN_MB00_ID1+((x)*0x20))
1394#define CAN_MB_ID0(x) (CAN_MB00_ID0+((x)*0x20))
1395#define CAN_MB_TIMESTAMP(x) (CAN_MB00_TIMESTAMP+((x)*0x20))
1396#define CAN_MB_LENGTH(x) (CAN_MB00_LENGTH+((x)*0x20))
1397#define CAN_MB_DATA3(x) (CAN_MB00_DATA3+((x)*0x20))
1398#define CAN_MB_DATA2(x) (CAN_MB00_DATA2+((x)*0x20))
1399#define CAN_MB_DATA1(x) (CAN_MB00_DATA1+((x)*0x20))
1400#define CAN_MB_DATA0(x) (CAN_MB00_DATA0+((x)*0x20))
1401
1402
1403/*********************************************************************************** */
1404/* System MMR Register Bits and Macros */
1405/******************************************************************************* */
1406
1407/* ********************* PLL AND RESET MASKS ************************ */
1408/* PLL_CTL Masks */
1409#define PLL_CLKIN 0x0000 /* Pass CLKIN to PLL */
1410#define PLL_CLKIN_DIV2 0x0001 /* Pass CLKIN/2 to PLL */
1411#define DF 0x0001 /* 0: PLL = CLKIN, 1: PLL = CLKIN/2 */
1412#define PLL_OFF 0x0002 /* Shut off PLL clocks */
1413
1414#define STOPCK 0x0008 /* Core Clock Off */
1415#define PDWN 0x0020 /* Put the PLL in a Deep Sleep state */
1416#define IN_DELAY 0x0014 /* EBIU Input Delay Select */
1417#define OUT_DELAY 0x00C0 /* EBIU Output Delay Select */
1418#define BYPASS 0x0100 /* Bypass the PLL */
1419#define MSEL 0x7E00 /* Multiplier Select For CCLK/VCO Factors */
1420
1421/* PLL_CTL Macros */
1422#ifdef _MISRA_RULES
1423#define SET_MSEL(x) (((x)&0x3Fu) << 0x9) /* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */
1424#define SET_OUT_DELAY(x) (((x)&0x03u) << 0x6)
1425#define SET_IN_DELAY(x) ((((x)&0x02u) << 0x3) | (((x)&0x01u) << 0x2))
1426#else
1427#define SET_MSEL(x) (((x)&0x3F) << 0x9) /* Set MSEL = 0-63 --> VCO = CLKIN*MSEL */
1428#define SET_OUT_DELAY(x) (((x)&0x03) << 0x6)
1429#define SET_IN_DELAY(x) ((((x)&0x02) << 0x3) | (((x)&0x01) << 0x2))
1430#endif /* _MISRA_RULES */
1431
1432/* PLL_DIV Masks */
1433#define SSEL 0x000F /* System Select */
1434#define CSEL 0x0030 /* Core Select */
1435#define CSEL_DIV1 0x0000 /* CCLK = VCO / 1 */
1436#define CSEL_DIV2 0x0010 /* CCLK = VCO / 2 */
1437#define CSEL_DIV4 0x0020 /* CCLK = VCO / 4 */
1438#define CSEL_DIV8 0x0030 /* CCLK = VCO / 8 */
1439
1440#define SCLK_DIV(x) (x) /* SCLK = VCO / x */
1441
1442/* PLL_DIV Macros */
1443#ifdef _MISRA_RULES
1444#define SET_SSEL(x) ((x)&0xFu) /* Set SSEL = 0-15 --> SCLK = VCO/SSEL */
1445#else
1446#define SET_SSEL(x) ((x)&0xF) /* Set SSEL = 0-15 --> SCLK = VCO/SSEL */
1447#endif /* _MISRA_RULES */
1448
1449/* PLL_STAT Masks */
1450#define ACTIVE_PLLENABLED 0x0001 /* Processor In Active Mode With PLL Enabled */
1451#define FULL_ON 0x0002 /* Processor In Full On Mode */
1452#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
1453#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
1454
1455/* VR_CTL Masks */
1456#define FREQ 0x0003 /* Switching Oscillator Frequency For Regulator */
1457#define HIBERNATE 0x0000 /* Powerdown/Bypass On-Board Regulation */
1458#define FREQ_333 0x0001 /* Switching Frequency Is 333 kHz */
1459#define FREQ_667 0x0002 /* Switching Frequency Is 667 kHz */
1460#define FREQ_1000 0x0003 /* Switching Frequency Is 1 MHz */
1461
1462#define GAIN 0x000C /* Voltage Level Gain */
1463#define GAIN_5 0x0000 /* GAIN = 5 */
1464#define GAIN_10 0x0004 /* GAIN = 10 */
1465#define GAIN_20 0x0008 /* GAIN = 20 */
1466#define GAIN_50 0x000C /* GAIN = 50 */
1467
1468#define VLEV 0x00F0 /* Internal Voltage Level - Only Program Values Within Specifications */
1469#define VLEV_100 0x0090 /* VLEV = 1.00 V (See Datasheet for Regulator Tolerance) */
1470#define VLEV_105 0x00A0 /* VLEV = 1.05 V (See Datasheet for Regulator Tolerance) */
1471#define VLEV_110 0x00B0 /* VLEV = 1.10 V (See Datasheet for Regulator Tolerance) */
1472#define VLEV_115 0x00C0 /* VLEV = 1.15 V (See Datasheet for Regulator Tolerance) */
1473#define VLEV_120 0x00D0 /* VLEV = 1.20 V (See Datasheet for Regulator Tolerance) */
1474#define VLEV_125 0x00E0 /* VLEV = 1.25 V (See Datasheet for Regulator Tolerance) */
1475#define VLEV_130 0x00F0 /* VLEV = 1.30 V (See Datasheet for Regulator Tolerance) */
1476
1477#define WAKE 0x0100 /* Enable RTC/Reset Wakeup From Hibernate */
1478#define CANWE 0x0200 /* Enable CAN Wakeup From Hibernate */
1479#define MXVRWE 0x0400 /* Enable MXVR Wakeup From Hibernate */
1480#define SCKELOW 0x8000 /* Do Not Drive SCKE High During Reset After Hibernate */
1481
1482/* SWRST Mask */
1483#define SYSTEM_RESET 0x0007 /* Initiates A System Software Reset */
1484#define DOUBLE_FAULT 0x0008 /* Core Double Fault Causes Reset */
1485#define RESET_DOUBLE 0x2000 /* SW Reset Generated By Core Double-Fault */
1486#define RESET_WDOG 0x4000 /* SW Reset Generated By Watchdog Timer */
1487#define RESET_SOFTWARE 0x8000 /* SW Reset Occurred Since Last Read Of SWRST */
1488
1489/* SYSCR Masks */
1490#define BMODE 0x0006 /* Boot Mode - Latched During HW Reset From Mode Pins */
1491#define NOBOOT 0x0010 /* Execute From L1 or ASYNC Bank 0 When BMODE = 0 */
1492
1493
1494/* ************* SYSTEM INTERRUPT CONTROLLER MASKS ***************** */
1495
1496/* Peripheral Masks For SIC0_ISR, SIC0_IWR, SIC0_IMASK */
1497#define PLL_WAKEUP_IRQ 0x00000001 /* PLL Wakeup Interrupt Request */
1498#define DMAC0_ERR_IRQ 0x00000002 /* DMA Controller 0 Error Interrupt Request */
1499#define PPI_ERR_IRQ 0x00000004 /* PPI Error Interrupt Request */
1500#define SPORT0_ERR_IRQ 0x00000008 /* SPORT0 Error Interrupt Request */
1501#define SPORT1_ERR_IRQ 0x00000010 /* SPORT1 Error Interrupt Request */
1502#define SPI0_ERR_IRQ 0x00000020 /* SPI0 Error Interrupt Request */
1503#define UART0_ERR_IRQ 0x00000040 /* UART0 Error Interrupt Request */
1504#define RTC_IRQ 0x00000080 /* Real-Time Clock Interrupt Request */
1505#define DMA0_IRQ 0x00000100 /* DMA Channel 0 (PPI) Interrupt Request */
1506#define DMA1_IRQ 0x00000200 /* DMA Channel 1 (SPORT0 RX) Interrupt Request */
1507#define DMA2_IRQ 0x00000400 /* DMA Channel 2 (SPORT0 TX) Interrupt Request */
1508#define DMA3_IRQ 0x00000800 /* DMA Channel 3 (SPORT1 RX) Interrupt Request */
1509#define DMA4_IRQ 0x00001000 /* DMA Channel 4 (SPORT1 TX) Interrupt Request */
1510#define DMA5_IRQ 0x00002000 /* DMA Channel 5 (SPI) Interrupt Request */
1511#define DMA6_IRQ 0x00004000 /* DMA Channel 6 (UART RX) Interrupt Request */
1512#define DMA7_IRQ 0x00008000 /* DMA Channel 7 (UART TX) Interrupt Request */
1513#define TIMER0_IRQ 0x00010000 /* Timer 0 Interrupt Request */
1514#define TIMER1_IRQ 0x00020000 /* Timer 1 Interrupt Request */
1515#define TIMER2_IRQ 0x00040000 /* Timer 2 Interrupt Request */
1516#define PFA_IRQ 0x00080000 /* Programmable Flag Interrupt Request A */
1517#define PFB_IRQ 0x00100000 /* Programmable Flag Interrupt Request B */
1518#define MDMA0_0_IRQ 0x00200000 /* MemDMA0 Stream 0 Interrupt Request */
1519#define MDMA0_1_IRQ 0x00400000 /* MemDMA0 Stream 1 Interrupt Request */
1520#define WDOG_IRQ 0x00800000 /* Software Watchdog Timer Interrupt Request */
1521#define DMAC1_ERR_IRQ 0x01000000 /* DMA Controller 1 Error Interrupt Request */
1522#define SPORT2_ERR_IRQ 0x02000000 /* SPORT2 Error Interrupt Request */
1523#define SPORT3_ERR_IRQ 0x04000000 /* SPORT3 Error Interrupt Request */
1524#define MXVR_SD_IRQ 0x08000000 /* MXVR Synchronous Data Interrupt Request */
1525#define SPI1_ERR_IRQ 0x10000000 /* SPI1 Error Interrupt Request */
1526#define SPI2_ERR_IRQ 0x20000000 /* SPI2 Error Interrupt Request */
1527#define UART1_ERR_IRQ 0x40000000 /* UART1 Error Interrupt Request */
1528#define UART2_ERR_IRQ 0x80000000 /* UART2 Error Interrupt Request */
1529
1530/* the following are for backwards compatibility */
1531#define DMA0_ERR_IRQ DMAC0_ERR_IRQ
1532#define DMA1_ERR_IRQ DMAC1_ERR_IRQ
1533
1534
1535/* Peripheral Masks For SIC_ISR1, SIC_IWR1, SIC_IMASK1 */
1536#define CAN_ERR_IRQ 0x00000001 /* CAN Error Interrupt Request */
1537#define DMA8_IRQ 0x00000002 /* DMA Channel 8 (SPORT2 RX) Interrupt Request */
1538#define DMA9_IRQ 0x00000004 /* DMA Channel 9 (SPORT2 TX) Interrupt Request */
1539#define DMA10_IRQ 0x00000008 /* DMA Channel 10 (SPORT3 RX) Interrupt Request */
1540#define DMA11_IRQ 0x00000010 /* DMA Channel 11 (SPORT3 TX) Interrupt Request */
1541#define DMA12_IRQ 0x00000020 /* DMA Channel 12 Interrupt Request */
1542#define DMA13_IRQ 0x00000040 /* DMA Channel 13 Interrupt Request */
1543#define DMA14_IRQ 0x00000080 /* DMA Channel 14 (SPI1) Interrupt Request */
1544#define DMA15_IRQ 0x00000100 /* DMA Channel 15 (SPI2) Interrupt Request */
1545#define DMA16_IRQ 0x00000200 /* DMA Channel 16 (UART1 RX) Interrupt Request */
1546#define DMA17_IRQ 0x00000400 /* DMA Channel 17 (UART1 TX) Interrupt Request */
1547#define DMA18_IRQ 0x00000800 /* DMA Channel 18 (UART2 RX) Interrupt Request */
1548#define DMA19_IRQ 0x00001000 /* DMA Channel 19 (UART2 TX) Interrupt Request */
1549#define TWI0_IRQ 0x00002000 /* TWI0 Interrupt Request */
1550#define TWI1_IRQ 0x00004000 /* TWI1 Interrupt Request */
1551#define CAN_RX_IRQ 0x00008000 /* CAN Receive Interrupt Request */
1552#define CAN_TX_IRQ 0x00010000 /* CAN Transmit Interrupt Request */
1553#define MDMA1_0_IRQ 0x00020000 /* MemDMA1 Stream 0 Interrupt Request */
1554#define MDMA1_1_IRQ 0x00040000 /* MemDMA1 Stream 1 Interrupt Request */
1555#define MXVR_STAT_IRQ 0x00080000 /* MXVR Status Interrupt Request */
1556#define MXVR_CM_IRQ 0x00100000 /* MXVR Control Message Interrupt Request */
1557#define MXVR_AP_IRQ 0x00200000 /* MXVR Asynchronous Packet Interrupt */
1558
1559/* the following are for backwards compatibility */
1560#define MDMA0_IRQ MDMA1_0_IRQ
1561#define MDMA1_IRQ MDMA1_1_IRQ
1562
1563#ifdef _MISRA_RULES
1564#define _MF15 0xFu
1565#define _MF7 7u
1566#else
1567#define _MF15 0xF
1568#define _MF7 7
1569#endif /* _MISRA_RULES */
1570
1571/* SIC_IMASKx Masks */
1572#define SIC_UNMASK_ALL 0x00000000 /* Unmask all peripheral interrupts */
1573#define SIC_MASK_ALL 0xFFFFFFFF /* Mask all peripheral interrupts */
1574#ifdef _MISRA_RULES
1575#define SIC_MASK(x) (1 << ((x)&0x1Fu)) /* Mask Peripheral #x interrupt */
1576#define SIC_UNMASK(x) (0xFFFFFFFFu ^ (1 << ((x)&0x1Fu))) /* Unmask Peripheral #x interrupt */
1577#else
1578#define SIC_MASK(x) (1 << ((x)&0x1F)) /* Mask Peripheral #x interrupt */
1579#define SIC_UNMASK(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Unmask Peripheral #x interrupt */
1580#endif /* _MISRA_RULES */
1581
1582/* SIC_IWRx Masks */
1583#define IWR_DISABLE_ALL 0x00000000 /* Wakeup Disable all peripherals */
1584#define IWR_ENABLE_ALL 0xFFFFFFFF /* Wakeup Enable all peripherals */
1585#ifdef _MISRA_RULES
1586#define IWR_ENABLE(x) (1 << ((x)&0x1Fu)) /* Wakeup Enable Peripheral #x */
1587#define IWR_DISABLE(x) (0xFFFFFFFFu ^ (1 << ((x)&0x1Fu))) /* Wakeup Disable Peripheral #x */
1588#else
1589#define IWR_ENABLE(x) (1 << ((x)&0x1F)) /* Wakeup Enable Peripheral #x */
1590#define IWR_DISABLE(x) (0xFFFFFFFF ^ (1 << ((x)&0x1F))) /* Wakeup Disable Peripheral #x */
1591#endif /* _MISRA_RULES */
1592
1593
1594/* ********* WATCHDOG TIMER MASKS ******************** */
1595/* Watchdog Timer WDOG_CTL Register Masks */
1596#ifdef _MISRA_RULES
1597#define WDEV(x) (((x)<<1) & 0x0006u) /* event generated on roll over */
1598#else
1599#define WDEV(x) (((x)<<1) & 0x0006) /* event generated on roll over */
1600#endif /* _MISRA_RULES */
1601#define WDEV_RESET 0x0000 /* generate reset event on roll over */
1602#define WDEV_NMI 0x0002 /* generate NMI event on roll over */
1603#define WDEV_GPI 0x0004 /* generate GP IRQ on roll over */
1604#define WDEV_NONE 0x0006 /* no event on roll over */
1605#define WDEN 0x0FF0 /* enable watchdog */
1606#define WDDIS 0x0AD0 /* disable watchdog */
1607#define WDRO 0x8000 /* watchdog rolled over latch */
1608
1609/* deprecated WDOG_CTL Register Masks for legacy code */
1610#define ICTL WDEV
1611#define ENABLE_RESET WDEV_RESET
1612#define WDOG_RESET WDEV_RESET
1613#define ENABLE_NMI WDEV_NMI
1614#define WDOG_NMI WDEV_NMI
1615#define ENABLE_GPI WDEV_GPI
1616#define WDOG_GPI WDEV_GPI
1617#define DISABLE_EVT WDEV_NONE
1618#define WDOG_NONE WDEV_NONE
1619
1620#define TMR_EN WDEN
1621#define WDOG_DISABLE WDDIS
1622#define TRO WDRO
1623
1624#define ICTL_P0 0x01
1625#define ICTL_P1 0x02
1626#define TRO_P 0x0F
1627
1628
1629/* *************** REAL TIME CLOCK MASKS **************************/
1630/* RTC_STAT and RTC_ALARM register */
1631#define RTSEC 0x0000003F /* Real-Time Clock Seconds */
1632#define RTMIN 0x00000FC0 /* Real-Time Clock Minutes */
1633#define RTHR 0x0001F000 /* Real-Time Clock Hours */
1634#define RTDAY 0xFFFE0000 /* Real-Time Clock Days */
1635
1636/* RTC_ICTL register */
1637#define SWIE 0x0001 /* Stopwatch Interrupt Enable */
1638#define AIE 0x0002 /* Alarm Interrupt Enable */
1639#define SIE 0x0004 /* Seconds (1 Hz) Interrupt Enable */
1640#define MIE 0x0008 /* Minutes Interrupt Enable */
1641#define HIE 0x0010 /* Hours Interrupt Enable */
1642#define DIE 0x0020 /* 24 Hours (Days) Interrupt Enable */
1643#define DAIE 0x0040 /* Day Alarm (Day, Hour, Minute, Second) Interrupt Enable */
1644#define WCIE 0x8000 /* Write Complete Interrupt Enable */
1645
1646/* RTC_ISTAT register */
1647#define SWEF 0x0001 /* Stopwatch Event Flag */
1648#define AEF 0x0002 /* Alarm Event Flag */
1649#define SEF 0x0004 /* Seconds (1 Hz) Event Flag */
1650#define MEF 0x0008 /* Minutes Event Flag */
1651#define HEF 0x0010 /* Hours Event Flag */
1652#define DEF 0x0020 /* 24 Hours (Days) Event Flag */
1653#define DAEF 0x0040 /* Day Alarm (Day, Hour, Minute, Second) Event Flag */
1654#define WPS 0x4000 /* Write Pending Status (RO) */
1655#define WCOM 0x8000 /* Write Complete */
1656
1657/* RTC_FAST Mask (RTC_PREN Mask) */
1658#define ENABLE_PRESCALE 0x00000001 /* Enable prescaler so RTC runs at 1 Hz */
1659#define PREN 0x00000001
1660 /* ** Must be set after power-up for proper operation of RTC */
1661
1662/* Deprecated RTC_STAT and RTC_ALARM Masks */
1663#define RTC_SEC RTSEC /* Real-Time Clock Seconds */
1664#define RTC_MIN RTMIN /* Real-Time Clock Minutes */
1665#define RTC_HR RTHR /* Real-Time Clock Hours */
1666#define RTC_DAY RTDAY /* Real-Time Clock Days */
1667
1668/* Deprecated RTC_ICTL/RTC_ISTAT Masks */
1669#define STOPWATCH SWIE /* Stopwatch Interrupt Enable */
1670#define ALARM AIE /* Alarm Interrupt Enable */
1671#define SECOND SIE /* Seconds (1 Hz) Interrupt Enable */
1672#define MINUTE MIE /* Minutes Interrupt Enable */
1673#define HOUR HIE /* Hours Interrupt Enable */
1674#define DAY DIE /* 24 Hours (Days) Interrupt Enable */
1675#define DAY_ALARM DAIE /* Day Alarm (Day, Hour, Minute, Second) Interrupt Enable */
1676#define WRITE_COMPLETE WCIE /* Write Complete Interrupt Enable */
1677
1678
1679/* ***************************** UART CONTROLLER MASKS ********************** */
1680/* UARTx_LCR Register */
1681#ifdef _MISRA_RULES
1682#define WLS(x) (((x)-5u) & 0x03u) /* Word Length Select */
1683#else
1684#define WLS(x) (((x)-5) & 0x03) /* Word Length Select */
1685#endif /* _MISRA_RULES */
1686#define STB 0x04 /* Stop Bits */
1687#define PEN 0x08 /* Parity Enable */
1688#define EPS 0x10 /* Even Parity Select */
1689#define STP 0x20 /* Stick Parity */
1690#define SB 0x40 /* Set Break */
1691#define DLAB 0x80 /* Divisor Latch Access */
1692
1693#define DLAB_P 0x07
1694#define SB_P 0x06
1695#define STP_P 0x05
1696#define EPS_P 0x04
1697#define PEN_P 0x03
1698#define STB_P 0x02
1699#define WLS_P1 0x01
1700#define WLS_P0 0x00
1701
1702/* UARTx_MCR Register */
1703#define LOOP_ENA 0x10 /* Loopback Mode Enable */
1704#define LOOP_ENA_P 0x04
1705/* Deprecated UARTx_MCR Mask */
1706
1707/* UARTx_LSR Register */
1708#define DR 0x01 /* Data Ready */
1709#define OE 0x02 /* Overrun Error */
1710#define PE 0x04 /* Parity Error */
1711#define FE 0x08 /* Framing Error */
1712#define BI 0x10 /* Break Interrupt */
1713#define THRE 0x20 /* THR Empty */
1714#define TEMT 0x40 /* TSR and UART_THR Empty */
1715
1716#define TEMP_P 0x06
1717#define THRE_P 0x05
1718#define BI_P 0x04
1719#define FE_P 0x03
1720#define PE_P 0x02
1721#define OE_P 0x01
1722#define DR_P 0x00
1723
1724/* UARTx_IER Register */
1725#define ERBFI 0x01 /* Enable Receive Buffer Full Interrupt */
1726#define ETBEI 0x02 /* Enable Transmit Buffer Empty Interrupt */
1727#define ELSI 0x04 /* Enable RX Status Interrupt */
1728
1729#define ELSI_P 0x02
1730#define ETBEI_P 0x01
1731#define ERBFI_P 0x00
1732
1733/* UARTx_IIR Register */
1734#define NINT 0x01
1735#define STATUS_P1 0x02
1736#define STATUS_P0 0x01
1737#define NINT_P 0x00
1738
1739/* UARTx_GCTL Register */
1740#define UCEN 0x01 /* Enable UARTx Clocks */
1741#define IREN 0x02 /* Enable IrDA Mode */
1742#define TPOLC 0x04 /* IrDA TX Polarity Change */
1743#define RPOLC 0x08 /* IrDA RX Polarity Change */
1744#define FPE 0x10 /* Force Parity Error On Transmit */
1745#define FFE 0x20 /* Force Framing Error On Transmit */
1746
1747#define FFE_P 0x05
1748#define FPE_P 0x04
1749#define RPOLC_P 0x03
1750#define TPOLC_P 0x02
1751#define IREN_P 0x01
1752#define UCEN_P 0x00
1753
1754
1755/* ********** SERIAL PORT MASKS ********************** */
1756/* SPORTx_TCR1 Masks */
1757#define TSPEN 0x0001 /* TX enable */
1758#define ITCLK 0x0002 /* Internal TX Clock Select */
1759#define TDTYPE 0x000C /* TX Data Formatting Select */
1760#define DTYPE_NORM 0x0000 /* Data Format Normal */
1761#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1762#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1763#define TLSBIT 0x0010 /* TX Bit Order */
1764#define ITFS 0x0200 /* Internal TX Frame Sync Select */
1765#define TFSR 0x0400 /* TX Frame Sync Required Select */
1766#define DITFS 0x0800 /* Data Independent TX Frame Sync Select */
1767#define LTFS 0x1000 /* Low TX Frame Sync Select */
1768#define LATFS 0x2000 /* Late TX Frame Sync Select */
1769#define TCKFE 0x4000 /* TX Clock Falling Edge Select */
1770/* SPORTx_RCR1 Deprecated Masks */
1771#define TULAW DTYPE_ULAW /* Compand Using u-Law */
1772#define TALAW DTYPE_ALAW /* Compand Using A-Law */
1773
1774/* SPORTx_TCR2 Masks */
1775#ifdef _MISRA_RULES
1776#define SLEN(x) ((x)&0x1Fu) /* SPORT TX Word Length (2 - 31) */
1777#else
1778#define SLEN(x) ((x)&0x1F) /* SPORT TX Word Length (2 - 31) */
1779#endif /* _MISRA_RULES */
1780#define TXSE 0x0100 /*TX Secondary Enable */
1781#define TSFSE 0x0200 /*TX Stereo Frame Sync Enable */
1782#define TRFST 0x0400 /*TX Right-First Data Order */
1783
1784/* SPORTx_RCR1 Masks */
1785#define RSPEN 0x0001 /* RX enable */
1786#define IRCLK 0x0002 /* Internal RX Clock Select */
1787#define RDTYPE 0x000C /* RX Data Formatting Select */
1788#define DTYPE_NORM 0x0000 /* no companding */
1789#define DTYPE_ULAW 0x0008 /* Compand Using u-Law */
1790#define DTYPE_ALAW 0x000C /* Compand Using A-Law */
1791#define RLSBIT 0x0010 /* RX Bit Order */
1792#define IRFS 0x0200 /* Internal RX Frame Sync Select */
1793#define RFSR 0x0400 /* RX Frame Sync Required Select */
1794#define LRFS 0x1000 /* Low RX Frame Sync Select */
1795#define LARFS 0x2000 /* Late RX Frame Sync Select */
1796#define RCKFE 0x4000 /* RX Clock Falling Edge Select */
1797/* SPORTx_RCR1 Deprecated Masks */
1798#define RULAW DTYPE_ULAW /* Compand Using u-Law */
1799#define RALAW DTYPE_ALAW /* Compand Using A-Law */
1800
1801/* SPORTx_RCR2 Masks */
1802#ifdef _MISRA_RULES
1803#define SLEN(x) ((x)&0x1Fu) /* SPORT RX Word Length (2 - 31) */
1804#else
1805#define SLEN(x) ((x)&0x1F) /* SPORT RX Word Length (2 - 31) */
1806#endif /* _MISRA_RULES */
1807#define RXSE 0x0100 /*RX Secondary Enable */
1808#define RSFSE 0x0200 /*RX Stereo Frame Sync Enable */
1809#define RRFST 0x0400 /*Right-First Data Order */
1810
1811/*SPORTx_STAT Masks */
1812#define RXNE 0x0001 /*RX FIFO Not Empty Status */
1813#define RUVF 0x0002 /*RX Underflow Status */
1814#define ROVF 0x0004 /*RX Overflow Status */
1815#define TXF 0x0008 /*TX FIFO Full Status */
1816#define TUVF 0x0010 /*TX Underflow Status */
1817#define TOVF 0x0020 /*TX Overflow Status */
1818#define TXHRE 0x0040 /*TX Hold Register Empty */
1819
1820/*SPORTx_MCMC1 Masks */
1821#define WOFF 0x000003FF /*Multichannel Window Offset Field */
1822/* SPORTx_MCMC1 Macros */
1823#ifdef _MISRA_RULES
1824#define SET_WOFF(x) ((x) & 0x3FFu) /* Multichannel Window Offset Field */
1825/* Only use SET_WSIZE Macro With Logic OR While Setting Lower Order Bits */
1826#define SET_WSIZE(x) (((((x)>>0x3)-1u)&0xFu) << 0xC) /* Multichannel Window Size = (x/8)-1 */
1827#else
1828#define SET_WOFF(x) ((x) & 0x3FF) /* Multichannel Window Offset Field */
1829/* Only use SET_WSIZE Macro With Logic OR While Setting Lower Order Bits */
1830#define SET_WSIZE(x) (((((x)>>0x3)-1)&0xF) << 0xC) /* Multichannel Window Size = (x/8)-1 */
1831#endif /* _MISRA_RULES */
1832
1833
1834/*SPORTx_MCMC2 Masks */
1835#define MCCRM 0x0003 /*Multichannel Clock Recovery Mode */
1836#define REC_BYPASS 0x0000 /* Bypass Mode (No Clock Recovery) */
1837#define REC_2FROM4 0x0002 /* Recover 2 MHz Clock from 4 MHz Clock */
1838#define REC_8FROM16 0x0003 /* Recover 8 MHz Clock from 16 MHz Clock */
1839#define MCDTXPE 0x0004 /*Multichannel DMA Transmit Packing */
1840#define MCDRXPE 0x0008 /*Multichannel DMA Receive Packing */
1841#define MCMEN 0x0010 /*Multichannel Frame Mode Enable */
1842#define FSDR 0x0080 /*Multichannel Frame Sync to Data Relationship */
1843#define MFD 0xF000 /*Multichannel Frame Delay */
1844#define MFD_0 0x0000 /* Multichannel Frame Delay = 0 */
1845#define MFD_1 0x1000 /* Multichannel Frame Delay = 1 */
1846#define MFD_2 0x2000 /* Multichannel Frame Delay = 2 */
1847#define MFD_3 0x3000 /* Multichannel Frame Delay = 3 */
1848#define MFD_4 0x4000 /* Multichannel Frame Delay = 4 */
1849#define MFD_5 0x5000 /* Multichannel Frame Delay = 5 */
1850#define MFD_6 0x6000 /* Multichannel Frame Delay = 6 */
1851#define MFD_7 0x7000 /* Multichannel Frame Delay = 7 */
1852#define MFD_8 0x8000 /* Multichannel Frame Delay = 8 */
1853#define MFD_9 0x9000 /* Multichannel Frame Delay = 9 */
1854#define MFD_10 0xA000 /* Multichannel Frame Delay = 10 */
1855#define MFD_11 0xB000 /* Multichannel Frame Delay = 11 */
1856#define MFD_12 0xC000 /* Multichannel Frame Delay = 12 */
1857#define MFD_13 0xD000 /* Multichannel Frame Delay = 13 */
1858#define MFD_14 0xE000 /* Multichannel Frame Delay = 14 */
1859#define MFD_15 0xF000 /* Multichannel Frame Delay = 15 */
1860
1861
1862/* ********* PARALLEL PERIPHERAL INTERFACE (PPI) MASKS **************** */
1863/* PPI_CONTROL Masks */
1864#define PORT_EN 0x0001 /* PPI Port Enable */
1865#define PORT_DIR 0x0002 /* PPI Port Direction */
1866#define XFR_TYPE 0x000C /* PPI Transfer Type */
1867#define PORT_CFG 0x0030 /* PPI Port Configuration */
1868#define FLD_SEL 0x0040 /* PPI Active Field Select */
1869#define PACK_EN 0x0080 /* PPI Packing Mode */
1870/* previous versions of defBF539.h erroneously included DMA32 (PPI 32-bit DMA Enable) */
1871#define SKIP_EN 0x0200 /* PPI Skip Element Enable */
1872#define SKIP_EO 0x0400 /* PPI Skip Even/Odd Elements */
1873#define DLENGTH 0x3800 /* PPI Data Length */
1874#define DLEN_8 0x0 /* PPI Data Length mask for DLEN=8 */
1875#define DLEN_10 0x0800 /* Data Length = 10 Bits */
1876#define DLEN_11 0x1000 /* Data Length = 11 Bits */
1877#define DLEN_12 0x1800 /* Data Length = 12 Bits */
1878#define DLEN_13 0x2000 /* Data Length = 13 Bits */
1879#define DLEN_14 0x2800 /* Data Length = 14 Bits */
1880#define DLEN_15 0x3000 /* Data Length = 15 Bits */
1881#define DLEN_16 0x3800 /* Data Length = 16 Bits */
1882#ifdef _MISRA_RULES
1883#define DLEN(x) ((((x)-9u) & 0x07u) << 11) /* PPI Data Length (only works for x=10-->x=16) */
1884#else
1885#define DLEN(x) ((((x)-9) & 0x07) << 11) /* PPI Data Length (only works for x=10-->x=16) */
1886#endif /* _MISRA_RULES */
1887#define POL 0xC000 /* PPI Signal Polarities */
1888#define POLC 0x4000 /* PPI Clock Polarity */
1889#define POLS 0x8000 /* PPI Frame Sync Polarity */
1890
1891
1892/* PPI_STATUS Masks */
1893#define FLD 0x0400 /* Field Indicator */
1894#define FT_ERR 0x0800 /* Frame Track Error */
1895#define OVR 0x1000 /* FIFO Overflow Error */
1896#define UNDR 0x2000 /* FIFO Underrun Error */
1897#define ERR_DET 0x4000 /* Error Detected Indicator */
1898#define ERR_NCOR 0x8000 /* Error Not Corrected Indicator */
1899
1900
1901/* ********** DMA CONTROLLER MASKS ***********************/
1902/* DMAx_CONFIG, MDMA_yy_CONFIG Masks */
1903#define DMAEN 0x0001 /* Channel Enable */
1904#define WNR 0x0002 /* Channel Direction (W/R*) */
1905#define WDSIZE_8 0x0000 /* Word Size 8 bits */
1906#define WDSIZE_16 0x0004 /* Word Size 16 bits */
1907#define WDSIZE_32 0x0008 /* Word Size 32 bits */
1908#define DMA2D 0x0010 /* 2D/1D* Mode */
1909#define RESTART 0x0020 /* Restart */
1910#define DI_SEL 0x0040 /* Data Interrupt Select */
1911#define DI_EN 0x0080 /* Data Interrupt Enable */
1912#define NDSIZE 0x0900 /* Next Descriptor Size */
1913#define NDSIZE_0 0x0000 /* Next Descriptor Size = 0 (Stop/Autobuffer) */
1914#define NDSIZE_1 0x0100 /* Next Descriptor Size = 1 */
1915#define NDSIZE_2 0x0200 /* Next Descriptor Size = 2 */
1916#define NDSIZE_3 0x0300 /* Next Descriptor Size = 3 */
1917#define NDSIZE_4 0x0400 /* Next Descriptor Size = 4 */
1918#define NDSIZE_5 0x0500 /* Next Descriptor Size = 5 */
1919#define NDSIZE_6 0x0600 /* Next Descriptor Size = 6 */
1920#define NDSIZE_7 0x0700 /* Next Descriptor Size = 7 */
1921#define NDSIZE_8 0x0800 /* Next Descriptor Size = 8 */
1922#define NDSIZE_9 0x0900 /* Next Descriptor Size = 9 */
1923
1924#define DMAFLOW 0x7000 /* Flow Control */
1925#define DMAFLOW_STOP 0x0000 /* Stop Mode */
1926#define DMAFLOW_AUTO 0x1000 /* Autobuffer Mode */
1927#define DMAFLOW_ARRAY 0x4000 /* Descriptor Array Mode */
1928#define DMAFLOW_SMALL 0x6000 /* Small Model Descriptor List Mode */
1929#define DMAFLOW_LARGE 0x7000 /* Large Model Descriptor List Mode */
1930
1931#define DMAEN_P 0x0 /* Channel Enable */
1932#define WNR_P 0x1 /* Channel Direction (W/R*) */
1933#define DMA2D_P 0x4 /* 2D/1D* Mode */
1934#define RESTART_P 0x5 /* Restart */
1935#define DI_SEL_P 0x6 /* Data Interrupt Select */
1936#define DI_EN_P 0x7 /* Data Interrupt Enable */
1937
1938/* DMAx_IRQ_STATUS, MDMA_yy_IRQ_STATUS Masks */
1939#define DMA_DONE 0x0001 /* DMA Done Indicator */
1940#define DMA_ERR 0x0002 /* DMA Error Indicator */
1941#define DFETCH 0x0004 /* Descriptor Fetch Indicator */
1942#define DMA_RUN 0x0008 /* DMA Running Indicator */
1943
1944#define DMA_DONE_P 0x0 /* DMA Done Indicator */
1945#define DMA_ERR_P 0x1 /* DMA Error Indicator */
1946#define DFETCH_P 0x2 /* Descriptor Fetch Indicator */
1947#define DMA_RUN_P 0x3 /* DMA Running Indicator */
1948
1949/* DMAx_PERIPHERAL_MAP, MDMA_yy_PERIPHERAL_MAP Masks */
1950
1951#define CTYPE 0x0040 /* DMA Channel Type Indicator */
1952#define CTYPE_P 0x6 /* DMA Channel Type Indicator BIT POSITION */
1953#define PCAP8 0x0080 /* DMA 8-bit Operation Indicator */
1954#define PCAP16 0x0100 /* DMA 16-bit Operation Indicator */
1955#define PCAP32 0x0200 /* DMA 32-bit Operation Indicator */
1956#define PCAPWR 0x0400 /* DMA Write Operation Indicator */
1957#define PCAPRD 0x0800 /* DMA Read Operation Indicator */
1958#define PMAP 0xF000 /* DMA Peripheral Map Field */
1959
1960/* PMAP Encodings For DMA Controller 0 */
1961#define PMAP_PPI 0x0000 /* PMAP PPI Port DMA */
1962#define PMAP_SPORT0RX 0x1000 /* PMAP SPORT0 Receive DMA */
1963#define PMAP_SPORT0TX 0x2000 /* PMAP SPORT0 Transmit DMA */
1964#define PMAP_SPORT1RX 0x3000 /* PMAP SPORT1 Receive DMA */
1965#define PMAP_SPORT1TX 0x4000 /* PMAP SPORT1 Transmit DMA */
1966#define PMAP_SPI0 0x5000 /* PMAP SPI DMA */
1967#define PMAP_UART0RX 0x6000 /* PMAP UART Receive DMA */
1968#define PMAP_UART0TX 0x7000 /* PMAP UART Transmit DMA */
1969
1970/* PMAP Encodings For DMA Controller 1 */
1971#define PMAP_SPORT2RX 0x0000 /* PMAP SPORT2 Receive DMA */
1972#define PMAP_SPORT2TX 0x1000 /* PMAP SPORT2 Transmit DMA */
1973#define PMAP_SPORT3RX 0x2000 /* PMAP SPORT3 Receive DMA */
1974#define PMAP_SPORT3TX 0x3000 /* PMAP SPORT3 Transmit DMA */
1975#define PMAP_SPI1 0x6000 /* PMAP SPI1 DMA */
1976#define PMAP_SPI2 0x7000 /* PMAP SPI2 DMA */
1977#define PMAP_UART1RX 0x8000 /* PMAP UART1 Receive DMA */
1978#define PMAP_UART1TX 0x9000 /* PMAP UART1 Transmit DMA */
1979#define PMAP_UART2RX 0xA000 /* PMAP UART2 Receive DMA */
1980#define PMAP_UART2TX 0xB000 /* PMAP UART2 Transmit DMA */
1981
1982
1983/* ************* GENERAL PURPOSE TIMER MASKS ******************** */
1984/* PWM Timer bit definitions */
1985/* TIMER_ENABLE Register */
1986#define TIMEN0 0x0001 /* Enable Timer 0 */
1987#define TIMEN1 0x0002 /* Enable Timer 1 */
1988#define TIMEN2 0x0004 /* Enable Timer 2 */
1989
1990#define TIMEN0_P 0x00
1991#define TIMEN1_P 0x01
1992#define TIMEN2_P 0x02
1993
1994/* TIMER_DISABLE Register */
1995#define TIMDIS0 0x0001 /* Disable Timer 0 */
1996#define TIMDIS1 0x0002 /* Disable Timer 1 */
1997#define TIMDIS2 0x0004 /* Disable Timer 2 */
1998
1999#define TIMDIS0_P 0x00
2000#define TIMDIS1_P 0x01
2001#define TIMDIS2_P 0x02
2002
2003/* TIMER_STATUS Register */
2004#define TIMIL0 0x0001 /* Timer 0 Interrupt */
2005#define TIMIL1 0x0002 /* Timer 1 Interrupt */
2006#define TIMIL2 0x0004 /* Timer 2 Interrupt */
2007#define TOVF_ERR0 0x0010 /* Timer 0 Counter Overflow */
2008#define TOVF_ERR1 0x0020 /* Timer 1 Counter Overflow */
2009#define TOVF_ERR2 0x0040 /* Timer 2 Counter Overflow */
2010#define TRUN0 0x1000 /* Timer 0 Slave Enable Status */
2011#define TRUN1 0x2000 /* Timer 1 Slave Enable Status */
2012#define TRUN2 0x4000 /* Timer 2 Slave Enable Status */
2013
2014#define TIMIL0_P 0x00
2015#define TIMIL1_P 0x01
2016#define TIMIL2_P 0x02
2017#define TOVF_ERR0_P 0x04
2018#define TOVF_ERR1_P 0x05
2019#define TOVF_ERR2_P 0x06
2020#define TRUN0_P 0x0C
2021#define TRUN1_P 0x0D
2022#define TRUN2_P 0x0E
2023
2024/* Alternate Deprecated Macros Provided For Backwards Code Compatibility */
2025#define TOVL_ERR0 TOVF_ERR0
2026#define TOVL_ERR1 TOVF_ERR1
2027#define TOVL_ERR2 TOVF_ERR2
2028#define TOVL_ERR0_P TOVF_ERR0_P
2029#define TOVL_ERR1_P TOVF_ERR1_P
2030#define TOVL_ERR2_P TOVF_ERR2_P
2031
2032/* TIMERx_CONFIG Registers */
2033#define PWM_OUT 0x0001
2034#define WDTH_CAP 0x0002
2035#define EXT_CLK 0x0003
2036#define PULSE_HI 0x0004
2037#define PERIOD_CNT 0x0008
2038#define IRQ_ENA 0x0010
2039#define TIN_SEL 0x0020
2040#define OUT_DIS 0x0040
2041#define CLK_SEL 0x0080
2042#define TOGGLE_HI 0x0100
2043#define EMU_RUN 0x0200
2044#ifdef _MISRA_RULES
2045#define ERR_TYP(x) (((x) & 0x03u) << 14)
2046#else
2047#define ERR_TYP(x) (((x) & 0x03) << 14)
2048#endif /* _MISRA_RULES */
2049
2050#define TMODE_P0 0x00
2051#define TMODE_P1 0x01
2052#define PULSE_HI_P 0x02
2053#define PERIOD_CNT_P 0x03
2054#define IRQ_ENA_P 0x04
2055#define TIN_SEL_P 0x05
2056#define OUT_DIS_P 0x06
2057#define CLK_SEL_P 0x07
2058#define TOGGLE_HI_P 0x08
2059#define EMU_RUN_P 0x09
2060#define ERR_TYP_P0 0x0E
2061#define ERR_TYP_P1 0x0F
2062
2063
2064/*/ ****************** GENERAL-PURPOSE I/O ********************* */
2065/* Flag I/O (FIO_) Masks */
2066#define PF0 0x0001
2067#define PF1 0x0002
2068#define PF2 0x0004
2069#define PF3 0x0008
2070#define PF4 0x0010
2071#define PF5 0x0020
2072#define PF6 0x0040
2073#define PF7 0x0080
2074#define PF8 0x0100
2075#define PF9 0x0200
2076#define PF10 0x0400
2077#define PF11 0x0800
2078#define PF12 0x1000
2079#define PF13 0x2000
2080#define PF14 0x4000
2081#define PF15 0x8000
2082
2083/* PORT F BIT POSITIONS */
2084#define PF0_P 0x0
2085#define PF1_P 0x1
2086#define PF2_P 0x2
2087#define PF3_P 0x3
2088#define PF4_P 0x4
2089#define PF5_P 0x5
2090#define PF6_P 0x6
2091#define PF7_P 0x7
2092#define PF8_P 0x8
2093#define PF9_P 0x9
2094#define PF10_P 0xA
2095#define PF11_P 0xB
2096#define PF12_P 0xC
2097#define PF13_P 0xD
2098#define PF14_P 0xE
2099#define PF15_P 0xF
2100
2101
2102/******************* GPIO MASKS *********************/
2103/* Port C Masks */
2104#define PC0 0x0001
2105#define PC1 0x0002
2106#define PC4 0x0010
2107#define PC5 0x0020
2108#define PC6 0x0040
2109#define PC7 0x0080
2110#define PC8 0x0100
2111#define PC9 0x0200
2112/* Port C Bit Positions */
2113#define PC0_P 0x0
2114#define PC1_P 0x1
2115#define PC4_P 0x4
2116#define PC5_P 0x5
2117#define PC6_P 0x6
2118#define PC7_P 0x7
2119#define PC8_P 0x8
2120#define PC9_P 0x9
2121
2122/* Port D */
2123#define PD0 0x0001
2124#define PD1 0x0002
2125#define PD2 0x0004
2126#define PD3 0x0008
2127#define PD4 0x0010
2128#define PD5 0x0020
2129#define PD6 0x0040
2130#define PD7 0x0080
2131#define PD8 0x0100
2132#define PD9 0x0200
2133#define PD10 0x0400
2134#define PD11 0x0800
2135#define PD12 0x1000
2136#define PD13 0x2000
2137#define PD14 0x4000
2138#define PD15 0x8000
2139/* Port D Bit Positions */
2140#define PD0_P 0x0
2141#define PD1_P 0x1
2142#define PD2_P 0x2
2143#define PD3_P 0x3
2144#define PD4_P 0x4
2145#define PD5_P 0x5
2146#define PD6_P 0x6
2147#define PD7_P 0x7
2148#define PD8_P 0x8
2149#define PD9_P 0x9
2150#define PD10_P 0xA
2151#define PD11_P 0xB
2152#define PD12_P 0xC
2153#define PD13_P 0xD
2154#define PD14_P 0xE
2155#define PD15_P 0xF
2156
2157/* Port E */
2158#define PE0 0x0001
2159#define PE1 0x0002
2160#define PE2 0x0004
2161#define PE3 0x0008
2162#define PE4 0x0010
2163#define PE5 0x0020
2164#define PE6 0x0040
2165#define PE7 0x0080
2166#define PE8 0x0100
2167#define PE9 0x0200
2168#define PE10 0x0400
2169#define PE11 0x0800
2170#define PE12 0x1000
2171#define PE13 0x2000
2172#define PE14 0x4000
2173#define PE15 0x8000
2174/* Port E Bit Positions */
2175#define PE0_P 0x0
2176#define PE1_P 0x1
2177#define PE2_P 0x2
2178#define PE3_P 0x3
2179#define PE4_P 0x4
2180#define PE5_P 0x5
2181#define PE6_P 0x6
2182#define PE7_P 0x7
2183#define PE8_P 0x8
2184#define PE9_P 0x9
2185#define PE10_P 0xA
2186#define PE11_P 0xB
2187#define PE12_P 0xC
2188#define PE13_P 0xD
2189#define PE14_P 0xE
2190#define PE15_P 0xF
2191
2192
2193/* *********** SERIAL PERIPHERAL INTERFACE (SPI) MASKS **************** */
2194/* SPIx_CTL Masks */
2195#define TIMOD 0x0003 /* Transfer Initiate Mode */
2196#define RDBR_CORE 0x0000 /* RDBR Read Initiates, IRQ When RDBR Full */
2197#define TDBR_CORE 0x0001 /* TDBR Write Initiates, IRQ When TDBR Empty */
2198#define RDBR_DMA 0x0002 /* DMA Read, DMA Until FIFO Empty */
2199#define TDBR_DMA 0x0003 /* DMA Write, DMA Until FIFO Full */
2200#define SZ 0x0004 /* Send Zero (When TDBR Empty, Send Zero/Last*) */
2201#define GM 0x0008 /* Get More (When RDBR Full, Overwrite/Discard*) */
2202#define PSSE 0x0010 /* Slave-Select Input Enable */
2203#define EMISO 0x0020 /* Enable MISO As Output */
2204#define SIZE 0x0100 /* Size of Words (16/8* Bits) */
2205#define LSBF 0x0200 /* LSB First */
2206#define CPHA 0x0400 /* Clock Phase */
2207#define CPOL 0x0800 /* Clock Polarity */
2208#define MSTR 0x1000 /* Master/Slave* */
2209#define WOM 0x2000 /* Write Open Drain Master */
2210#define SPE 0x4000 /* SPI Enable */
2211
2212/* SPIx_FLG Masks */
2213#define FLS1 0x0002 /* Enables (=1) SPI_FLOUT1 as flag output for SPI Slave-select */
2214#define FLS2 0x0004 /* Enables (=1) SPI_FLOUT2 as flag output for SPI Slave-select */
2215#define FLS3 0x0008 /* Enables (=1) SPI_FLOUT3 as flag output for SPI Slave-select */
2216#define FLS4 0x0010 /* Enables (=1) SPI_FLOUT4 as flag output for SPI Slave-select */
2217#define FLS5 0x0020 /* Enables (=1) SPI_FLOUT5 as flag output for SPI Slave-select */
2218#define FLS6 0x0040 /* Enables (=1) SPI_FLOUT6 as flag output for SPI Slave-select */
2219#define FLS7 0x0080 /* Enables (=1) SPI_FLOUT7 as flag output for SPI Slave-select */
2220
2221#define FLG1 0x0200 /* Activates (=0) SPI_FLOUT1 as flag output for SPI Slave-select */
2222#define FLG2 0x0400 /* Activates (=0) SPI_FLOUT2 as flag output for SPI Slave-select */
2223#define FLG3 0x0800 /* Activates (=0) SPI_FLOUT3 as flag output for SPI Slave-select */
2224#define FLG4 0x1000 /* Activates (=0) SPI_FLOUT4 as flag output for SPI Slave-select */
2225#define FLG5 0x2000 /* Activates (=0) SPI_FLOUT5 as flag output for SPI Slave-select */
2226#define FLG6 0x4000 /* Activates (=0) SPI_FLOUT6 as flag output for SPI Slave-select */
2227#define FLG7 0x8000 /* Activates (=0) SPI_FLOUT7 as flag output for SPI Slave-select */
2228
2229/* SPIx_FLG Bit Positions */
2230#define FLS1_P 0x0001 /* Enables (=1) SPI_FLOUT1 as flag output for SPI Slave-select */
2231#define FLS2_P 0x0002 /* Enables (=1) SPI_FLOUT2 as flag output for SPI Slave-select */
2232#define FLS3_P 0x0003 /* Enables (=1) SPI_FLOUT3 as flag output for SPI Slave-select */
2233#define FLS4_P 0x0004 /* Enables (=1) SPI_FLOUT4 as flag output for SPI Slave-select */
2234#define FLS5_P 0x0005 /* Enables (=1) SPI_FLOUT5 as flag output for SPI Slave-select */
2235#define FLS6_P 0x0006 /* Enables (=1) SPI_FLOUT6 as flag output for SPI Slave-select */
2236#define FLS7_P 0x0007 /* Enables (=1) SPI_FLOUT7 as flag output for SPI Slave-select */
2237#define FLG1_P 0x0009 /* Activates (=0) SPI_FLOUT1 as flag output for SPI Slave-select */
2238#define FLG2_P 0x000A /* Activates (=0) SPI_FLOUT2 as flag output for SPI Slave-select */
2239#define FLG3_P 0x000B /* Activates (=0) SPI_FLOUT3 as flag output for SPI Slave-select */
2240#define FLG4_P 0x000C /* Activates (=0) SPI_FLOUT4 as flag output for SPI Slave-select */
2241#define FLG5_P 0x000D /* Activates (=0) SPI_FLOUT5 as flag output for SPI Slave-select */
2242#define FLG6_P 0x000E /* Activates (=0) SPI_FLOUT6 as flag output for SPI Slave-select */
2243#define FLG7_P 0x000F /* Activates (=0) SPI_FLOUT7 as flag output for SPI Slave-select */
2244
2245/* SPIx_STAT Masks */
2246#define SPIF 0x0001 /* Set (=1) when SPI single-word transfer complete */
2247#define MODF 0x0002 /* Set (=1) in a master device when some other device tries to become master */
2248#define TXE 0x0004 /* Set (=1) when transmission occurs with no new data in SPI_TDBR */
2249#define TXS 0x0008 /* SPI_TDBR Data Buffer Status (0=Empty, 1=Full) */
2250#define RBSY 0x0010 /* Set (=1) when data is received with RDBR full */
2251#define RXS 0x0020 /* SPI_RDBR Data Buffer Status (0=Empty, 1=Full) */
2252#define TXCOL 0x0040 /* When set (=1), corrupt data may have been transmitted */
2253
2254/* SPIx_FLG Masks */
2255#define FLG1E 0xFDFF /* Activates SPI_FLOUT1 */
2256#define FLG2E 0xFBFF /* Activates SPI_FLOUT2 */
2257#define FLG3E 0xF7FF /* Activates SPI_FLOUT3 */
2258#define FLG4E 0xEFFF /* Activates SPI_FLOUT4 */
2259#define FLG5E 0xDFFF /* Activates SPI_FLOUT5 */
2260#define FLG6E 0xBFFF /* Activates SPI_FLOUT6 */
2261#define FLG7E 0x7FFF /* Activates SPI_FLOUT7 */
2262
2263
2264/* ********************* ASYNCHRONOUS MEMORY CONTROLLER MASKS ************* */
2265/* EBIU_AMGCTL Masks */
2266#define AMCKEN 0x0001 /* Enable CLKOUT */
2267#define AMBEN_NONE 0x0000 /* All Banks Disabled */
2268#define AMBEN_B0 0x0002 /* Enable Asynchronous Memory Bank 0 only */
2269#define AMBEN_B0_B1 0x0004 /* Enable Asynchronous Memory Banks 0 & 1 only */
2270#define AMBEN_B0_B1_B2 0x0006 /* Enable Asynchronous Memory Banks 0, 1, and 2 */
2271#define AMBEN_ALL 0x0008 /* Enable Asynchronous Memory Banks (all) 0, 1, 2, and 3 */
2272#define CDPRIO 0x0100 /* DMA has priority over core for for external accesses */
2273
2274/* EBIU_AMGCTL Bit Positions */
2275#define AMCKEN_P 0x0000 /* Enable CLKOUT */
2276#define AMBEN_P0 0x0001 /* Asynchronous Memory Enable, 000 - banks 0-3 disabled, 001 - Bank 0 enabled */
2277#define AMBEN_P1 0x0002 /* Asynchronous Memory Enable, 010 - banks 0&1 enabled, 011 - banks 0-3 enabled */
2278#define AMBEN_P2 0x0003 /* Asynchronous Memory Enable, 1xx - All banks (bank 0, 1, 2, and 3) enabled */
2279
2280/* EBIU_AMBCTL0 Masks */
2281#define B0RDYEN 0x00000001 /* Bank 0 RDY Enable, 0=disable, 1=enable */
2282#define B0RDYPOL 0x00000002 /* Bank 0 RDY Active high, 0=active low, 1=active high */
2283#define B0TT_1 0x00000004 /* Bank 0 Transition Time from Read to Write = 1 cycle */
2284#define B0TT_2 0x00000008 /* Bank 0 Transition Time from Read to Write = 2 cycles */
2285#define B0TT_3 0x0000000C /* Bank 0 Transition Time from Read to Write = 3 cycles */
2286#define B0TT_4 0x00000000 /* Bank 0 Transition Time from Read to Write = 4 cycles */
2287#define B0ST_1 0x00000010 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=1 cycle */
2288#define B0ST_2 0x00000020 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=2 cycles */
2289#define B0ST_3 0x00000030 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=3 cycles */
2290#define B0ST_4 0x00000000 /* Bank 0 Setup Time from AOE asserted to Read/Write asserted=4 cycles */
2291#define B0HT_1 0x00000040 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 1 cycle */
2292#define B0HT_2 0x00000080 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 2 cycles */
2293#define B0HT_3 0x000000C0 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 3 cycles */
2294#define B0HT_0 0x00000000 /* Bank 0 Hold Time from Read/Write deasserted to AOE deasserted = 0 cycles */
2295#define B0RAT_1 0x00000100 /* Bank 0 Read Access Time = 1 cycle */
2296#define B0RAT_2 0x00000200 /* Bank 0 Read Access Time = 2 cycles */
2297#define B0RAT_3 0x00000300 /* Bank 0 Read Access Time = 3 cycles */
2298#define B0RAT_4 0x00000400 /* Bank 0 Read Access Time = 4 cycles */
2299#define B0RAT_5 0x00000500 /* Bank 0 Read Access Time = 5 cycles */
2300#define B0RAT_6 0x00000600 /* Bank 0 Read Access Time = 6 cycles */
2301#define B0RAT_7 0x00000700 /* Bank 0 Read Access Time = 7 cycles */
2302#define B0RAT_8 0x00000800 /* Bank 0 Read Access Time = 8 cycles */
2303#define B0RAT_9 0x00000900 /* Bank 0 Read Access Time = 9 cycles */
2304#define B0RAT_10 0x00000A00 /* Bank 0 Read Access Time = 10 cycles */
2305#define B0RAT_11 0x00000B00 /* Bank 0 Read Access Time = 11 cycles */
2306#define B0RAT_12 0x00000C00 /* Bank 0 Read Access Time = 12 cycles */
2307#define B0RAT_13 0x00000D00 /* Bank 0 Read Access Time = 13 cycles */
2308#define B0RAT_14 0x00000E00 /* Bank 0 Read Access Time = 14 cycles */
2309#define B0RAT_15 0x00000F00 /* Bank 0 Read Access Time = 15 cycles */
2310#define B0WAT_1 0x00001000 /* Bank 0 Write Access Time = 1 cycle */
2311#define B0WAT_2 0x00002000 /* Bank 0 Write Access Time = 2 cycles */
2312#define B0WAT_3 0x00003000 /* Bank 0 Write Access Time = 3 cycles */
2313#define B0WAT_4 0x00004000 /* Bank 0 Write Access Time = 4 cycles */
2314#define B0WAT_5 0x00005000 /* Bank 0 Write Access Time = 5 cycles */
2315#define B0WAT_6 0x00006000 /* Bank 0 Write Access Time = 6 cycles */
2316#define B0WAT_7 0x00007000 /* Bank 0 Write Access Time = 7 cycles */
2317#define B0WAT_8 0x00008000 /* Bank 0 Write Access Time = 8 cycles */
2318#define B0WAT_9 0x00009000 /* Bank 0 Write Access Time = 9 cycles */
2319#define B0WAT_10 0x0000A000 /* Bank 0 Write Access Time = 10 cycles */
2320#define B0WAT_11 0x0000B000 /* Bank 0 Write Access Time = 11 cycles */
2321#define B0WAT_12 0x0000C000 /* Bank 0 Write Access Time = 12 cycles */
2322#define B0WAT_13 0x0000D000 /* Bank 0 Write Access Time = 13 cycles */
2323#define B0WAT_14 0x0000E000 /* Bank 0 Write Access Time = 14 cycles */
2324#define B0WAT_15 0x0000F000 /* Bank 0 Write Access Time = 15 cycles */
2325#define B1RDYEN 0x00010000 /* Bank 1 RDY enable, 0=disable, 1=enable */
2326#define B1RDYPOL 0x00020000 /* Bank 1 RDY Active high, 0=active low, 1=active high */
2327#define B1TT_1 0x00040000 /* Bank 1 Transition Time from Read to Write = 1 cycle */
2328#define B1TT_2 0x00080000 /* Bank 1 Transition Time from Read to Write = 2 cycles */
2329#define B1TT_3 0x000C0000 /* Bank 1 Transition Time from Read to Write = 3 cycles */
2330#define B1TT_4 0x00000000 /* Bank 1 Transition Time from Read to Write = 4 cycles */
2331#define B1ST_1 0x00100000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
2332#define B1ST_2 0x00200000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
2333#define B1ST_3 0x00300000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
2334#define B1ST_4 0x00000000 /* Bank 1 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
2335#define B1HT_1 0x00400000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
2336#define B1HT_2 0x00800000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
2337#define B1HT_3 0x00C00000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
2338#define B1HT_0 0x00000000 /* Bank 1 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
2339#define B1RAT_1 0x01000000 /* Bank 1 Read Access Time = 1 cycle */
2340#define B1RAT_2 0x02000000 /* Bank 1 Read Access Time = 2 cycles */
2341#define B1RAT_3 0x03000000 /* Bank 1 Read Access Time = 3 cycles */
2342#define B1RAT_4 0x04000000 /* Bank 1 Read Access Time = 4 cycles */
2343#define B1RAT_5 0x05000000 /* Bank 1 Read Access Time = 5 cycles */
2344#define B1RAT_6 0x06000000 /* Bank 1 Read Access Time = 6 cycles */
2345#define B1RAT_7 0x07000000 /* Bank 1 Read Access Time = 7 cycles */
2346#define B1RAT_8 0x08000000 /* Bank 1 Read Access Time = 8 cycles */
2347#define B1RAT_9 0x09000000 /* Bank 1 Read Access Time = 9 cycles */
2348#define B1RAT_10 0x0A000000 /* Bank 1 Read Access Time = 10 cycles */
2349#define B1RAT_11 0x0B000000 /* Bank 1 Read Access Time = 11 cycles */
2350#define B1RAT_12 0x0C000000 /* Bank 1 Read Access Time = 12 cycles */
2351#define B1RAT_13 0x0D000000 /* Bank 1 Read Access Time = 13 cycles */
2352#define B1RAT_14 0x0E000000 /* Bank 1 Read Access Time = 14 cycles */
2353#define B1RAT_15 0x0F000000 /* Bank 1 Read Access Time = 15 cycles */
2354#define B1WAT_1 0x10000000 /* Bank 1 Write Access Time = 1 cycle */
2355#define B1WAT_2 0x20000000 /* Bank 1 Write Access Time = 2 cycles */
2356#define B1WAT_3 0x30000000 /* Bank 1 Write Access Time = 3 cycles */
2357#define B1WAT_4 0x40000000 /* Bank 1 Write Access Time = 4 cycles */
2358#define B1WAT_5 0x50000000 /* Bank 1 Write Access Time = 5 cycles */
2359#define B1WAT_6 0x60000000 /* Bank 1 Write Access Time = 6 cycles */
2360#define B1WAT_7 0x70000000 /* Bank 1 Write Access Time = 7 cycles */
2361#define B1WAT_8 0x80000000 /* Bank 1 Write Access Time = 8 cycles */
2362#define B1WAT_9 0x90000000 /* Bank 1 Write Access Time = 9 cycles */
2363#define B1WAT_10 0xA0000000 /* Bank 1 Write Access Time = 10 cycles */
2364#define B1WAT_11 0xB0000000 /* Bank 1 Write Access Time = 11 cycles */
2365#define B1WAT_12 0xC0000000 /* Bank 1 Write Access Time = 12 cycles */
2366#define B1WAT_13 0xD0000000 /* Bank 1 Write Access Time = 13 cycles */
2367#define B1WAT_14 0xE0000000 /* Bank 1 Write Access Time = 14 cycles */
2368#define B1WAT_15 0xF0000000 /* Bank 1 Write Access Time = 15 cycles */
2369
2370/* EBIU_AMBCTL1 Masks */
2371#define B2RDYEN 0x00000001 /* Bank 2 RDY Enable, 0=disable, 1=enable */
2372#define B2RDYPOL 0x00000002 /* Bank 2 RDY Active high, 0=active low, 1=active high */
2373#define B2TT_1 0x00000004 /* Bank 2 Transition Time from Read to Write = 1 cycle */
2374#define B2TT_2 0x00000008 /* Bank 2 Transition Time from Read to Write = 2 cycles */
2375#define B2TT_3 0x0000000C /* Bank 2 Transition Time from Read to Write = 3 cycles */
2376#define B2TT_4 0x00000000 /* Bank 2 Transition Time from Read to Write = 4 cycles */
2377#define B2ST_1 0x00000010 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
2378#define B2ST_2 0x00000020 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
2379#define B2ST_3 0x00000030 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
2380#define B2ST_4 0x00000000 /* Bank 2 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
2381#define B2HT_1 0x00000040 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
2382#define B2HT_2 0x00000080 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
2383#define B2HT_3 0x000000C0 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
2384#define B2HT_0 0x00000000 /* Bank 2 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
2385#define B2RAT_1 0x00000100 /* Bank 2 Read Access Time = 1 cycle */
2386#define B2RAT_2 0x00000200 /* Bank 2 Read Access Time = 2 cycles */
2387#define B2RAT_3 0x00000300 /* Bank 2 Read Access Time = 3 cycles */
2388#define B2RAT_4 0x00000400 /* Bank 2 Read Access Time = 4 cycles */
2389#define B2RAT_5 0x00000500 /* Bank 2 Read Access Time = 5 cycles */
2390#define B2RAT_6 0x00000600 /* Bank 2 Read Access Time = 6 cycles */
2391#define B2RAT_7 0x00000700 /* Bank 2 Read Access Time = 7 cycles */
2392#define B2RAT_8 0x00000800 /* Bank 2 Read Access Time = 8 cycles */
2393#define B2RAT_9 0x00000900 /* Bank 2 Read Access Time = 9 cycles */
2394#define B2RAT_10 0x00000A00 /* Bank 2 Read Access Time = 10 cycles */
2395#define B2RAT_11 0x00000B00 /* Bank 2 Read Access Time = 11 cycles */
2396#define B2RAT_12 0x00000C00 /* Bank 2 Read Access Time = 12 cycles */
2397#define B2RAT_13 0x00000D00 /* Bank 2 Read Access Time = 13 cycles */
2398#define B2RAT_14 0x00000E00 /* Bank 2 Read Access Time = 14 cycles */
2399#define B2RAT_15 0x00000F00 /* Bank 2 Read Access Time = 15 cycles */
2400#define B2WAT_1 0x00001000 /* Bank 2 Write Access Time = 1 cycle */
2401#define B2WAT_2 0x00002000 /* Bank 2 Write Access Time = 2 cycles */
2402#define B2WAT_3 0x00003000 /* Bank 2 Write Access Time = 3 cycles */
2403#define B2WAT_4 0x00004000 /* Bank 2 Write Access Time = 4 cycles */
2404#define B2WAT_5 0x00005000 /* Bank 2 Write Access Time = 5 cycles */
2405#define B2WAT_6 0x00006000 /* Bank 2 Write Access Time = 6 cycles */
2406#define B2WAT_7 0x00007000 /* Bank 2 Write Access Time = 7 cycles */
2407#define B2WAT_8 0x00008000 /* Bank 2 Write Access Time = 8 cycles */
2408#define B2WAT_9 0x00009000 /* Bank 2 Write Access Time = 9 cycles */
2409#define B2WAT_10 0x0000A000 /* Bank 2 Write Access Time = 10 cycles */
2410#define B2WAT_11 0x0000B000 /* Bank 2 Write Access Time = 11 cycles */
2411#define B2WAT_12 0x0000C000 /* Bank 2 Write Access Time = 12 cycles */
2412#define B2WAT_13 0x0000D000 /* Bank 2 Write Access Time = 13 cycles */
2413#define B2WAT_14 0x0000E000 /* Bank 2 Write Access Time = 14 cycles */
2414#define B2WAT_15 0x0000F000 /* Bank 2 Write Access Time = 15 cycles */
2415#define B3RDYEN 0x00010000 /* Bank 3 RDY enable, 0=disable, 1=enable */
2416#define B3RDYPOL 0x00020000 /* Bank 3 RDY Active high, 0=active low, 1=active high */
2417#define B3TT_1 0x00040000 /* Bank 3 Transition Time from Read to Write = 1 cycle */
2418#define B3TT_2 0x00080000 /* Bank 3 Transition Time from Read to Write = 2 cycles */
2419#define B3TT_3 0x000C0000 /* Bank 3 Transition Time from Read to Write = 3 cycles */
2420#define B3TT_4 0x00000000 /* Bank 3 Transition Time from Read to Write = 4 cycles */
2421#define B3ST_1 0x00100000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 1 cycle */
2422#define B3ST_2 0x00200000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 2 cycles */
2423#define B3ST_3 0x00300000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 3 cycles */
2424#define B3ST_4 0x00000000 /* Bank 3 Setup Time from AOE asserted to Read or Write asserted = 4 cycles */
2425#define B3HT_1 0x00400000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 1 cycle */
2426#define B3HT_2 0x00800000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 2 cycles */
2427#define B3HT_3 0x00C00000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 3 cycles */
2428#define B3HT_0 0x00000000 /* Bank 3 Hold Time from Read or Write deasserted to AOE deasserted = 0 cycles */
2429#define B3RAT_1 0x01000000 /* Bank 3 Read Access Time = 1 cycle */
2430#define B3RAT_2 0x02000000 /* Bank 3 Read Access Time = 2 cycles */
2431#define B3RAT_3 0x03000000 /* Bank 3 Read Access Time = 3 cycles */
2432#define B3RAT_4 0x04000000 /* Bank 3 Read Access Time = 4 cycles */
2433#define B3RAT_5 0x05000000 /* Bank 3 Read Access Time = 5 cycles */
2434#define B3RAT_6 0x06000000 /* Bank 3 Read Access Time = 6 cycles */
2435#define B3RAT_7 0x07000000 /* Bank 3 Read Access Time = 7 cycles */
2436#define B3RAT_8 0x08000000 /* Bank 3 Read Access Time = 8 cycles */
2437#define B3RAT_9 0x09000000 /* Bank 3 Read Access Time = 9 cycles */
2438#define B3RAT_10 0x0A000000 /* Bank 3 Read Access Time = 10 cycles */
2439#define B3RAT_11 0x0B000000 /* Bank 3 Read Access Time = 11 cycles */
2440#define B3RAT_12 0x0C000000 /* Bank 3 Read Access Time = 12 cycles */
2441#define B3RAT_13 0x0D000000 /* Bank 3 Read Access Time = 13 cycles */
2442#define B3RAT_14 0x0E000000 /* Bank 3 Read Access Time = 14 cycles */
2443#define B3RAT_15 0x0F000000 /* Bank 3 Read Access Time = 15 cycles */
2444#define B3WAT_1 0x10000000 /* Bank 3 Write Access Time = 1 cycle */
2445#define B3WAT_2 0x20000000 /* Bank 3 Write Access Time = 2 cycles */
2446#define B3WAT_3 0x30000000 /* Bank 3 Write Access Time = 3 cycles */
2447#define B3WAT_4 0x40000000 /* Bank 3 Write Access Time = 4 cycles */
2448#define B3WAT_5 0x50000000 /* Bank 3 Write Access Time = 5 cycles */
2449#define B3WAT_6 0x60000000 /* Bank 3 Write Access Time = 6 cycles */
2450#define B3WAT_7 0x70000000 /* Bank 3 Write Access Time = 7 cycles */
2451#define B3WAT_8 0x80000000 /* Bank 3 Write Access Time = 8 cycles */
2452#define B3WAT_9 0x90000000 /* Bank 3 Write Access Time = 9 cycles */
2453#define B3WAT_10 0xA0000000 /* Bank 3 Write Access Time = 10 cycles */
2454#define B3WAT_11 0xB0000000 /* Bank 3 Write Access Time = 11 cycles */
2455#define B3WAT_12 0xC0000000 /* Bank 3 Write Access Time = 12 cycles */
2456#define B3WAT_13 0xD0000000 /* Bank 3 Write Access Time = 13 cycles */
2457#define B3WAT_14 0xE0000000 /* Bank 3 Write Access Time = 14 cycles */
2458#define B3WAT_15 0xF0000000 /* Bank 3 Write Access Time = 15 cycles */
2459
2460/* ********************** SDRAM CONTROLLER MASKS *************************** */
2461/* EBIU_SDGCTL Masks */
2462#define SCTLE 0x00000001 /* Enable SCLK[0], /SRAS, /SCAS, /SWE, SDQM[3:0] */
2463#define CL_2 0x00000008 /* SDRAM CAS latency = 2 cycles */
2464#define CL_3 0x0000000C /* SDRAM CAS latency = 3 cycles */
2465#define PFE 0x00000010 /* Enable SDRAM prefetch */
2466#define PFP 0x00000020 /* Prefetch has priority over AMC requests */
2467#define PASR_ALL 0x00000000 /* All 4 SDRAM Banks Refreshed In Self-Refresh */
2468#define PASR_B0_B1 0x00000010 /* SDRAM Banks 0 and 1 Are Refreshed In Self-Refresh */
2469#define PASR_B0 0x00000020 /* Only SDRAM Bank 0 Is Refreshed In Self-Refresh */
2470#define TRAS_1 0x00000040 /* SDRAM tRAS = 1 cycle */
2471#define TRAS_2 0x00000080 /* SDRAM tRAS = 2 cycles */
2472#define TRAS_3 0x000000C0 /* SDRAM tRAS = 3 cycles */
2473#define TRAS_4 0x00000100 /* SDRAM tRAS = 4 cycles */
2474#define TRAS_5 0x00000140 /* SDRAM tRAS = 5 cycles */
2475#define TRAS_6 0x00000180 /* SDRAM tRAS = 6 cycles */
2476#define TRAS_7 0x000001C0 /* SDRAM tRAS = 7 cycles */
2477#define TRAS_8 0x00000200 /* SDRAM tRAS = 8 cycles */
2478#define TRAS_9 0x00000240 /* SDRAM tRAS = 9 cycles */
2479#define TRAS_10 0x00000280 /* SDRAM tRAS = 10 cycles */
2480#define TRAS_11 0x000002C0 /* SDRAM tRAS = 11 cycles */
2481#define TRAS_12 0x00000300 /* SDRAM tRAS = 12 cycles */
2482#define TRAS_13 0x00000340 /* SDRAM tRAS = 13 cycles */
2483#define TRAS_14 0x00000380 /* SDRAM tRAS = 14 cycles */
2484#define TRAS_15 0x000003C0 /* SDRAM tRAS = 15 cycles */
2485#define TRP_1 0x00000800 /* SDRAM tRP = 1 cycle */
2486#define TRP_2 0x00001000 /* SDRAM tRP = 2 cycles */
2487#define TRP_3 0x00001800 /* SDRAM tRP = 3 cycles */
2488#define TRP_4 0x00002000 /* SDRAM tRP = 4 cycles */
2489#define TRP_5 0x00002800 /* SDRAM tRP = 5 cycles */
2490#define TRP_6 0x00003000 /* SDRAM tRP = 6 cycles */
2491#define TRP_7 0x00003800 /* SDRAM tRP = 7 cycles */
2492#define TRCD_1 0x00008000 /* SDRAM tRCD = 1 cycle */
2493#define TRCD_2 0x00010000 /* SDRAM tRCD = 2 cycles */
2494#define TRCD_3 0x00018000 /* SDRAM tRCD = 3 cycles */
2495#define TRCD_4 0x00020000 /* SDRAM tRCD = 4 cycles */
2496#define TRCD_5 0x00028000 /* SDRAM tRCD = 5 cycles */
2497#define TRCD_6 0x00030000 /* SDRAM tRCD = 6 cycles */
2498#define TRCD_7 0x00038000 /* SDRAM tRCD = 7 cycles */
2499#define TWR_1 0x00080000 /* SDRAM tWR = 1 cycle */
2500#define TWR_2 0x00100000 /* SDRAM tWR = 2 cycles */
2501#define TWR_3 0x00180000 /* SDRAM tWR = 3 cycles */
2502#define PUPSD 0x00200000 /*Power-up start delay */
2503#define PSM 0x00400000 /* SDRAM power-up sequence = Precharge, mode register set, 8 CBR refresh cycles */
2504#define PSS 0x00800000 /* enable SDRAM power-up sequence on next SDRAM access */
2505#define SRFS 0x01000000 /* Start SDRAM self-refresh mode */
2506#define EBUFE 0x02000000 /* Enable external buffering timing */
2507#define FBBRW 0x04000000 /* Fast back-to-back read write enable */
2508#define EMREN 0x10000000 /* Extended mode register enable */
2509#define TCSR 0x20000000 /* Temp compensated self refresh value 85 deg C */
2510#define CDDBG 0x40000000 /* Tristate SDRAM controls during bus grant */
2511
2512/* EBIU_SDBCTL Masks */
2513#define EBE 0x00000001 /* Enable SDRAM external bank */
2514#define EBSZ_16 0x00000000 /* SDRAM external bank size = 16MB */
2515#define EBSZ_32 0x00000002 /* SDRAM external bank size = 32MB */
2516#define EBSZ_64 0x00000004 /* SDRAM external bank size = 64MB */
2517#define EBSZ_128 0x00000006 /* SDRAM external bank size = 128MB */
2518#define EBSZ_256 0x00000008 /* SDRAM External Bank Size = 256MB */
2519#define EBSZ_512 0x0000000A /* SDRAM External Bank Size = 512MB */
2520#define EBCAW_8 0x00000000 /* SDRAM external bank column address width = 8 bits */
2521#define EBCAW_9 0x00000010 /* SDRAM external bank column address width = 9 bits */
2522#define EBCAW_10 0x00000020 /* SDRAM external bank column address width = 9 bits */
2523#define EBCAW_11 0x00000030 /* SDRAM external bank column address width = 9 bits */
2524
2525/* EBIU_SDSTAT Masks */
2526#define SDCI 0x00000001 /* SDRAM controller is idle */
2527#define SDSRA 0x00000002 /* SDRAM SDRAM self refresh is active */
2528#define SDPUA 0x00000004 /* SDRAM power up active */
2529#define SDRS 0x00000008 /* SDRAM is in reset state */
2530#define SDEASE 0x00000010 /* SDRAM EAB sticky error status - W1C */
2531#define BGSTAT 0x00000020 /* Bus granted */
2532
2533
2534/* ******************** TWO-WIRE INTERFACE (TWIx) MASKS ***********************/
2535/* TWIx_CLKDIV Macros (Use: *pTWIx_CLKDIV = CLKLOW(x)|CLKHI(y); ) */
2536#ifdef _MISRA_RULES
2537#define CLKLOW(x) ((x) & 0xFFu) /* Periods Clock Is Held Low */
2538#define CLKHI(y) (((y)&0xFFu)<<0x8) /* Periods Before New Clock Low */
2539#else
2540#define CLKLOW(x) ((x) & 0xFF) /* Periods Clock Is Held Low */
2541#define CLKHI(y) (((y)&0xFF)<<0x8) /* Periods Before New Clock Low */
2542#endif /* _MISRA_RULES */
2543
2544/* TWIx_PRESCALE Masks */
2545#define PRESCALE 0x007F /* SCLKs Per Internal Time Reference (10MHz) */
2546#define TWI_ENA 0x0080 /* TWI Enable */
2547#define SCCB 0x0200 /* SCCB Compatibility Enable */
2548
2549/* TWIx_SLAVE_CTRL Masks */
2550#define SEN 0x0001 /* Slave Enable */
2551#define SADD_LEN 0x0002 /* Slave Address Length */
2552#define STDVAL 0x0004 /* Slave Transmit Data Valid */
2553#define NAK 0x0008 /* NAK/ACK* Generated At Conclusion Of Transfer */
2554#define GEN 0x0010 /* General Call Adrress Matching Enabled */
2555
2556/* TWIx_SLAVE_STAT Masks */
2557#define SDIR 0x0001 /* Slave Transfer Direction (Transmit/Receive*) */
2558#define GCALL 0x0002 /* General Call Indicator */
2559
2560/* TWIx_MASTER_CTRL Masks */
2561#define MEN 0x0001 /* Master Mode Enable */
2562#define MADD_LEN 0x0002 /* Master Address Length */
2563#define MDIR 0x0004 /* Master Transmit Direction (RX/TX*) */
2564#define FAST 0x0008 /* Use Fast Mode Timing Specs */
2565#define STOP 0x0010 /* Issue Stop Condition */
2566#define RSTART 0x0020 /* Repeat Start or Stop* At End Of Transfer */
2567#define DCNT 0x3FC0 /* Data Bytes To Transfer */
2568#define SDAOVR 0x4000 /* Serial Data Override */
2569#define SCLOVR 0x8000 /* Serial Clock Override */
2570
2571/* TWIx_MASTER_STAT Masks */
2572#define MPROG 0x0001 /* Master Transfer In Progress */
2573#define LOSTARB 0x0002 /* Lost Arbitration Indicator (Xfer Aborted) */
2574#define ANAK 0x0004 /* Address Not Acknowledged */
2575#define DNAK 0x0008 /* Data Not Acknowledged */
2576#define BUFRDERR 0x0010 /* Buffer Read Error */
2577#define BUFWRERR 0x0020 /* Buffer Write Error */
2578#define SDASEN 0x0040 /* Serial Data Sense */
2579#define SCLSEN 0x0080 /* Serial Clock Sense */
2580#define BUSBUSY 0x0100 /* Bus Busy Indicator */
2581
2582/* TWIx_INT_SRC and TWIx_INT_ENABLE Masks */
2583#define SINIT 0x0001 /* Slave Transfer Initiated */
2584#define SCOMP 0x0002 /* Slave Transfer Complete */
2585#define SERR 0x0004 /* Slave Transfer Error */
2586#define SOVF 0x0008 /* Slave Overflow */
2587#define MCOMP 0x0010 /* Master Transfer Complete */
2588#define MERR 0x0020 /* Master Transfer Error */
2589#define XMTSERV 0x0040 /* Transmit FIFO Service */
2590#define RCVSERV 0x0080 /* Receive FIFO Service */
2591
2592/* TWIx_FIFO_CTRL Masks */
2593#define XMTFLUSH 0x0001 /* Transmit Buffer Flush */
2594#define RCVFLUSH 0x0002 /* Receive Buffer Flush */
2595#define XMTINTLEN 0x0004 /* Transmit Buffer Interrupt Length */
2596#define RCVINTLEN 0x0008 /* Receive Buffer Interrupt Length */
2597
2598/* TWIx_FIFO_STAT Masks */
2599#define XMTSTAT 0x0003 /* Transmit FIFO Status */
2600#define XMT_EMPTY 0x0000 /* Transmit FIFO Empty */
2601#define XMT_HALF 0x0001 /* Transmit FIFO Has 1 Byte To Write */
2602#define XMT_FULL 0x0003 /* Transmit FIFO Full (2 Bytes To Write) */
2603
2604#define RCVSTAT 0x000C /* Receive FIFO Status */
2605#define RCV_EMPTY 0x0000 /* Receive FIFO Empty */
2606#define RCV_HALF 0x0004 /* Receive FIFO Has 1 Byte To Read */
2607#define RCV_FULL 0x000C /* Receive FIFO Full (2 Bytes To Read) */
2608
2609
2610/********************************* MXVR MASKS ****************************************/
2611
2612/* MXVR_CONFIG Masks */
2613
2614#define MXVREN 0x00000001lu
2615#define MMSM 0x00000002lu
2616#define ACTIVE 0x00000004lu
2617#define SDELAY 0x00000008lu
2618#define NCMRXEN 0x00000010lu
2619#define RWRRXEN 0x00000020lu
2620#define MTXEN 0x00000040lu
2621#define MTXON 0x00000080lu /*legacy*/
2622#define MTXONB 0x00000080lu
2623#define EPARITY 0x00000100lu
2624#define MSB 0x00001E00lu
2625#define APRXEN 0x00002000lu
2626#define WAKEUP 0x00004000lu
2627#define LMECH 0x00008000lu
2628
2629#ifdef _MISRA_RULES
2630#define SET_MSB(x) (((x)&0xFu) << 0x9)
2631#else
2632#define SET_MSB(x) (((x)&0xF) << 0x9)
2633#endif /* _MISRA_RULES */
2634
2635
2636/* MXVR_PLL_CTL_0 Masks */
2637
2638#define MXTALCEN 0x00000001lu
2639#define MXTALFEN 0x00000002lu
2640#define MPLLMS 0x00000008lu
2641#define MXTALMUL 0x00000030lu
2642#define MPLLEN 0x00000040lu
2643#define MPLLEN0 0x00000040lu /* legacy */
2644#define MPLLEN1 0x00000080lu /* legacy */
2645#define MMCLKEN 0x00000100lu
2646#define MMCLKMUL 0x00001E00lu
2647#define MPLLRSTB 0x00002000lu
2648#define MPLLRSTB0 0x00002000lu /* legacy */
2649#define MPLLRSTB1 0x00004000lu /* legacy */
2650#define MBCLKEN 0x00010000lu
2651#define MBCLKDIV 0x001E0000lu
2652#define MPLLCDR 0x00200000lu
2653#define MPLLCDR0 0x00200000lu /* legacy */
2654#define MPLLCDR1 0x00400000lu /* legacy */
2655#define INVRX 0x00800000lu
2656#define MFSEN 0x01000000lu
2657#define MFSDIV 0x1E000000lu
2658#define MFSSEL 0x60000000lu
2659#define MFSSYNC 0x80000000lu
2660
2661#define MXTALMUL_256FS 0x00000000lu /* legacy */
2662#define MXTALMUL_384FS 0x00000010lu /* legacy */
2663#define MXTALMUL_512FS 0x00000020lu /* legacy */
2664#define MXTALMUL_1024FS 0x00000030lu
2665
2666#define MMCLKMUL_1024FS 0x00000000lu
2667#define MMCLKMUL_512FS 0x00000200lu
2668#define MMCLKMUL_256FS 0x00000400lu
2669#define MMCLKMUL_128FS 0x00000600lu
2670#define MMCLKMUL_64FS 0x00000800lu
2671#define MMCLKMUL_32FS 0x00000A00lu
2672#define MMCLKMUL_16FS 0x00000C00lu
2673#define MMCLKMUL_8FS 0x00000E00lu
2674#define MMCLKMUL_4FS 0x00001000lu
2675#define MMCLKMUL_2FS 0x00001200lu
2676#define MMCLKMUL_1FS 0x00001400lu
2677#define MMCLKMUL_1536FS 0x00001A00lu
2678#define MMCLKMUL_768FS 0x00001C00lu
2679#define MMCLKMUL_384FS 0x00001E00lu
2680
2681#define MBCLKDIV_DIV2 0x00020000lu
2682#define MBCLKDIV_DIV4 0x00040000lu
2683#define MBCLKDIV_DIV8 0x00060000lu
2684#define MBCLKDIV_DIV16 0x00080000lu
2685#define MBCLKDIV_DIV32 0x000A0000lu
2686#define MBCLKDIV_DIV64 0x000C0000lu
2687#define MBCLKDIV_DIV128 0x000E0000lu
2688#define MBCLKDIV_DIV256 0x00100000lu
2689#define MBCLKDIV_DIV512 0x00120000lu
2690#define MBCLKDIV_DIV1024 0x00140000lu
2691
2692#define MFSDIV_DIV2 0x02000000lu
2693#define MFSDIV_DIV4 0x04000000lu
2694#define MFSDIV_DIV8 0x06000000lu
2695#define MFSDIV_DIV16 0x08000000lu
2696#define MFSDIV_DIV32 0x0A000000lu
2697#define MFSDIV_DIV64 0x0C000000lu
2698#define MFSDIV_DIV128 0x0E000000lu
2699#define MFSDIV_DIV256 0x10000000lu
2700#define MFSDIV_DIV512 0x12000000lu
2701#define MFSDIV_DIV1024 0x14000000lu
2702
2703#define MFSSEL_CLOCK 0x00000000lu
2704#define MFSSEL_PULSE_HI 0x20000000lu
2705#define MFSSEL_PULSE_LO 0x40000000lu
2706
2707
2708/* MXVR_PLL_CTL_1 Masks */
2709
2710#define MSTO 0x00000001lu
2711#define MSTO0 0x00000001lu /* legacy */
2712#define MHOGGD 0x00000004lu
2713#define MHOGGD0 0x00000004lu /* legacy */
2714#define MHOGGD1 0x00000008lu /* legacy */
2715#define MSHAPEREN 0x00000010lu
2716#define MSHAPEREN0 0x00000010lu /* legacy */
2717#define MSHAPEREN1 0x00000020lu /* legacy */
2718#define MPLLCNTEN 0x00008000lu
2719#define MPLLCNT 0xFFFF0000lu
2720
2721#ifdef _MISRA_RULES
2722#define SET_MPLLCNT(x) (((x)&0xFFFFu) << 0x10)
2723#else
2724#define SET_MPLLCNT(x) (((x)&0xFFFF) << 0x10)
2725#endif /* _MISRA_RULES */
2726
2727
2728/* MXVR_PLL_CTL_2 Masks */
2729
2730#define MSHAPERSEL 0x00000007lu
2731#define MCPSEL 0x000000E0lu
2732
2733/* MXVR_INT_STAT_0 Masks */
2734
2735#define NI2A 0x00000001lu
2736#define NA2I 0x00000002lu
2737#define SBU2L 0x00000004lu
2738#define SBL2U 0x00000008lu
2739#define PRU 0x00000010lu
2740#define MPRU 0x00000020lu
2741#define DRU 0x00000040lu
2742#define MDRU 0x00000080lu
2743#define SBU 0x00000100lu
2744#define ATU 0x00000200lu
2745#define FCZ0 0x00000400lu
2746#define FCZ1 0x00000800lu
2747#define PERR 0x00001000lu
2748#define MH2L 0x00002000lu
2749#define ML2H 0x00004000lu
2750#define WUP 0x00008000lu
2751#define FU2L 0x00010000lu
2752#define FL2U 0x00020000lu
2753#define BU2L 0x00040000lu
2754#define BL2U 0x00080000lu
2755#define PCZ 0x00400000lu
2756#define FERR 0x00800000lu
2757#define CMR 0x01000000lu
2758#define CMROF 0x02000000lu
2759#define CMTS 0x04000000lu
2760#define CMTC 0x08000000lu
2761#define RWRC 0x10000000lu
2762#define BCZ 0x20000000lu
2763#define BMERR 0x40000000lu
2764#define DERR 0x80000000lu
2765
2766
2767/* MXVR_INT_EN_0 Masks */
2768
2769#define NI2AEN NI2A
2770#define NA2IEN NA2I
2771#define SBU2LEN SBU2L
2772#define SBL2UEN SBL2U
2773#define PRUEN PRU
2774#define MPRUEN MPRU
2775#define DRUEN DRU
2776#define MDRUEN MDRU
2777#define SBUEN SBU
2778#define ATUEN ATU
2779#define FCZ0EN FCZ0
2780#define FCZ1EN FCZ1
2781#define PERREN PERR
2782#define MH2LEN MH2L
2783#define ML2HEN ML2H
2784#define WUPEN WUP
2785#define FU2LEN FU2L
2786#define FL2UEN FL2U
2787#define BU2LEN BU2L
2788#define BL2UEN BL2U
2789#define PCZEN PCZ
2790#define FERREN FERR
2791#define CMREN CMR
2792#define CMROFEN CMROF
2793#define CMTSEN CMTS
2794#define CMTCEN CMTC
2795#define RWRCEN RWRC
2796#define BCZEN BCZ
2797#define BMERREN BMERR
2798#define DERREN DERR
2799
2800
2801/* MXVR_INT_STAT_1 Masks */
2802
2803#define APR 0x00000004lu
2804#define APROF 0x00000008lu
2805#define APTS 0x00000040lu
2806#define APTC 0x00000080lu
2807#define APRCE 0x00000400lu
2808#define APRPE 0x00000800lu
2809
2810#define HDONE0 0x00000001lu
2811#define DONE0 0x00000002lu
2812#define HDONE1 0x00000010lu
2813#define DONE1 0x00000020lu
2814#define HDONE2 0x00000100lu
2815#define DONE2 0x00000200lu
2816#define HDONE3 0x00001000lu
2817#define DONE3 0x00002000lu
2818#define HDONE4 0x00010000lu
2819#define DONE4 0x00020000lu
2820#define HDONE5 0x00100000lu
2821#define DONE5 0x00200000lu
2822#define HDONE6 0x01000000lu
2823#define DONE6 0x02000000lu
2824#define HDONE7 0x10000000lu
2825#define DONE7 0x20000000lu
2826
2827#define DONEX(x) (0x00000002 << (4 * (x)))
2828#define HDONEX(x) (0x00000001 << (4 * (x)))
2829
2830
2831/* MXVR_INT_EN_1 Masks */
2832
2833#define APREN APR
2834#define APROFEN APROF
2835#define APTSEN APTS
2836#define APTCEN APTC
2837#define APRCEEN APRCE
2838#define APRPEEN APRPE
2839
2840#define HDONEEN0 HDONE0
2841#define DONEEN0 DONE0
2842#define HDONEEN1 HDONE1
2843#define DONEEN1 DONE1
2844#define HDONEEN2 HDONE2
2845#define DONEEN2 DONE2
2846#define HDONEEN3 HDONE3
2847#define DONEEN3 DONE3
2848#define HDONEEN4 HDONE4
2849#define DONEEN4 DONE4
2850#define HDONEEN5 HDONE5
2851#define DONEEN5 DONE5
2852#define HDONEEN6 HDONE6
2853#define DONEEN6 DONE6
2854#define HDONEEN7 HDONE7
2855#define DONEEN7 DONE7
2856
2857#define DONEENX(x) (0x00000002 << (4 * (x)))
2858#define HDONEENX(x) (0x00000001 << (4 * (x)))
2859
2860
2861/* MXVR_STATE_0 Masks */
2862
2863#define NACT 0x00000001lu
2864#define SBLOCK 0x00000002lu
2865#define PFDLOCK 0x00000004lu
2866#define PFDLOCK0 0x00000004lu /* legacy */
2867#define PDD 0x00000008lu
2868#define PDD0 0x00000008lu /* legacy */
2869#define PVCO 0x00000010lu
2870#define PVCO0 0x00000010lu /* legacy */
2871#define PFDLOCK1 0x00000020lu /* legacy */
2872#define PDD1 0x00000040lu /* legacy */
2873#define PVCO1 0x00000080lu /* legacy */
2874#define APBSY 0x00000100lu
2875#define APARB 0x00000200lu
2876#define APTX 0x00000400lu
2877#define APRX 0x00000800lu
2878#define CMBSY 0x00001000lu
2879#define CMARB 0x00002000lu
2880#define CMTX 0x00004000lu
2881#define CMRX 0x00008000lu
2882#define MRXONB 0x00010000lu
2883#define RGSIP 0x00020000lu
2884#define DALIP 0x00040000lu
2885#define ALIP 0x00080000lu
2886#define RRDIP 0x00100000lu
2887#define RWRIP 0x00200000lu
2888#define FLOCK 0x00400000lu
2889#define BLOCK 0x00800000lu
2890#define RSB 0x0F000000lu
2891#define DERRNUM 0xF0000000lu
2892
2893
2894/* MXVR_STATE_1 Masks */
2895
2896#define STXNUMB 0x0000000Flu
2897#define SRXNUMB 0x000000F0lu
2898#define APCONT 0x00000100lu
2899#define DMAACTIVEX 0x00FF0000lu
2900#define DMAACTIVE0 0x00010000lu
2901#define DMAACTIVE1 0x00020000lu
2902#define DMAACTIVE2 0x00040000lu
2903#define DMAACTIVE3 0x00080000lu
2904#define DMAACTIVE4 0x00100000lu
2905#define DMAACTIVE5 0x00200000lu
2906#define DMAACTIVE6 0x00400000lu
2907#define DMAACTIVE7 0x00800000lu
2908#define DMAPMENX 0xFF000000lu
2909#define DMAPMEN0 0x01000000lu
2910#define DMAPMEN1 0x02000000lu
2911#define DMAPMEN2 0x04000000lu
2912#define DMAPMEN3 0x08000000lu
2913#define DMAPMEN4 0x10000000lu
2914#define DMAPMEN5 0x20000000lu
2915#define DMAPMEN6 0x40000000lu
2916#define DMAPMEN7 0x80000000lu
2917
2918
2919/* MXVR_POSITION Masks */
2920
2921#define PVALID 0x8000
2922#define POSITION 0x003F
2923
2924
2925/* MXVR_MAX_POSITION Masks */
2926
2927#define MPVALID 0x8000
2928#define MPOSITION 0x003F
2929
2930
2931/* MXVR_DELAY Masks */
2932
2933#define DVALID 0x8000
2934#define DELAY 0x003F
2935
2936
2937/* MXVR_MAX_DELAY Masks */
2938
2939#define MDVALID 0x8000
2940#define MDELAY 0x003F
2941
2942
2943/* MXVR_LADDR Masks */
2944
2945#define LVALID 0x80000000lu
2946#define LADDR 0x0000FFFFlu
2947
2948
2949/* MXVR_GADDR Masks */
2950
2951#define GVALID 0x8000
2952#define GADDRL 0x00FF
2953
2954
2955/* MXVR_AADDR Masks */
2956
2957#define AVALID 0x80000000lu
2958#define AADDR 0x0000FFFFlu
2959
2960
2961/* MXVR_ALLOC_0 Masks */
2962
2963#define CIU0 0x00000080lu
2964#define CIU1 0x00008000lu
2965#define CIU2 0x00800000lu
2966#define CIU3 0x80000000lu
2967
2968#define CL0 0x0000007Flu
2969#define CL1 0x00007F00lu
2970#define CL2 0x007F0000lu
2971#define CL3 0x7F000000lu
2972
2973
2974/* MXVR_ALLOC_1 Masks */
2975
2976#define CIU4 0x00000080lu
2977#define CIU5 0x00008000lu
2978#define CIU6 0x00800000lu
2979#define CIU7 0x80000000lu
2980
2981#define CL4 0x0000007Flu
2982#define CL5 0x00007F00lu
2983#define CL6 0x007F0000lu
2984#define CL7 0x7F000000lu
2985
2986
2987/* MXVR_ALLOC_2 Masks */
2988
2989#define CIU8 0x00000080lu
2990#define CIU9 0x00008000lu
2991#define CIU10 0x00800000lu
2992#define CIU11 0x80000000lu
2993
2994#define CL8 0x0000007Flu
2995#define CL9 0x00007F00lu
2996#define CL10 0x007F0000lu
2997#define CL11 0x7F000000lu
2998
2999
3000/* MXVR_ALLOC_3 Masks */
3001
3002#define CIU12 0x00000080lu
3003#define CIU13 0x00008000lu
3004#define CIU14 0x00800000lu
3005#define CIU15 0x80000000lu
3006
3007#define CL12 0x0000007Flu
3008#define CL13 0x00007F00lu
3009#define CL14 0x007F0000lu
3010#define CL15 0x7F000000lu
3011
3012
3013/* MXVR_ALLOC_4 Masks */
3014
3015#define CIU16 0x00000080lu
3016#define CIU17 0x00008000lu
3017#define CIU18 0x00800000lu
3018#define CIU19 0x80000000lu
3019
3020#define CL16 0x0000007Flu
3021#define CL17 0x00007F00lu
3022#define CL18 0x007F0000lu
3023#define CL19 0x7F000000lu
3024
3025
3026/* MXVR_ALLOC_5 Masks */
3027
3028#define CIU20 0x00000080lu
3029#define CIU21 0x00008000lu
3030#define CIU22 0x00800000lu
3031#define CIU23 0x80000000lu
3032
3033#define CL20 0x0000007Flu
3034#define CL21 0x00007F00lu
3035#define CL22 0x007F0000lu
3036#define CL23 0x7F000000lu
3037
3038
3039/* MXVR_ALLOC_6 Masks */
3040
3041#define CIU24 0x00000080lu
3042#define CIU25 0x00008000lu
3043#define CIU26 0x00800000lu
3044#define CIU27 0x80000000lu
3045
3046#define CL24 0x0000007Flu
3047#define CL25 0x00007F00lu
3048#define CL26 0x007F0000lu
3049#define CL27 0x7F000000lu
3050
3051
3052/* MXVR_ALLOC_7 Masks */
3053
3054#define CIU28 0x00000080lu
3055#define CIU29 0x00008000lu
3056#define CIU30 0x00800000lu
3057#define CIU31 0x80000000lu
3058
3059#define CL28 0x0000007Flu
3060#define CL29 0x00007F00lu
3061#define CL30 0x007F0000lu
3062#define CL31 0x7F000000lu
3063
3064
3065/* MXVR_ALLOC_8 Masks */
3066
3067#define CIU32 0x00000080lu
3068#define CIU33 0x00008000lu
3069#define CIU34 0x00800000lu
3070#define CIU35 0x80000000lu
3071
3072#define CL32 0x0000007Flu
3073#define CL33 0x00007F00lu
3074#define CL34 0x007F0000lu
3075#define CL35 0x7F000000lu
3076
3077
3078/* MXVR_ALLOC_9 Masks */
3079
3080#define CIU36 0x00000080lu
3081#define CIU37 0x00008000lu
3082#define CIU38 0x00800000lu
3083#define CIU39 0x80000000lu
3084
3085#define CL36 0x0000007Flu
3086#define CL37 0x00007F00lu
3087#define CL38 0x007F0000lu
3088#define CL39 0x7F000000lu
3089
3090
3091/* MXVR_ALLOC_10 Masks */
3092
3093#define CIU40 0x00000080lu
3094#define CIU41 0x00008000lu
3095#define CIU42 0x00800000lu
3096#define CIU43 0x80000000lu
3097
3098#define CL40 0x0000007Flu
3099#define CL41 0x00007F00lu
3100#define CL42 0x007F0000lu
3101#define CL43 0x7F000000lu
3102
3103
3104/* MXVR_ALLOC_11 Masks */
3105
3106#define CIU44 0x00000080lu
3107#define CIU45 0x00008000lu
3108#define CIU46 0x00800000lu
3109#define CIU47 0x80000000lu
3110
3111#define CL44 0x0000007Flu
3112#define CL45 0x00007F00lu
3113#define CL46 0x007F0000lu
3114#define CL47 0x7F000000lu
3115
3116
3117/* MXVR_ALLOC_12 Masks */
3118
3119#define CIU48 0x00000080lu
3120#define CIU49 0x00008000lu
3121#define CIU50 0x00800000lu
3122#define CIU51 0x80000000lu
3123
3124#define CL48 0x0000007Flu
3125#define CL49 0x00007F00lu
3126#define CL50 0x007F0000lu
3127#define CL51 0x7F000000lu
3128
3129
3130/* MXVR_ALLOC_13 Masks */
3131
3132#define CIU52 0x00000080lu
3133#define CIU53 0x00008000lu
3134#define CIU54 0x00800000lu
3135#define CIU55 0x80000000lu
3136
3137#define CL52 0x0000007Flu
3138#define CL53 0x00007F00lu
3139#define CL54 0x007F0000lu
3140#define CL55 0x7F000000lu
3141
3142
3143/* MXVR_ALLOC_14 Masks */
3144
3145#define CIU56 0x00000080lu
3146#define CIU57 0x00008000lu
3147#define CIU58 0x00800000lu
3148#define CIU59 0x80000000lu
3149
3150#define CL56 0x0000007Flu
3151#define CL57 0x00007F00lu
3152#define CL58 0x007F0000lu
3153#define CL59 0x7F000000lu
3154
3155
3156/* MXVR_SYNC_LCHAN_0 Masks */
3157
3158#define LCHANPC0 0x0000000Flu
3159#define LCHANPC1 0x000000F0lu
3160#define LCHANPC2 0x00000F00lu
3161#define LCHANPC3 0x0000F000lu
3162#define LCHANPC4 0x000F0000lu
3163#define LCHANPC5 0x00F00000lu
3164#define LCHANPC6 0x0F000000lu
3165#define LCHANPC7 0xF0000000lu
3166
3167
3168/* MXVR_SYNC_LCHAN_1 Masks */
3169
3170#define LCHANPC8 0x0000000Flu
3171#define LCHANPC9 0x000000F0lu
3172#define LCHANPC10 0x00000F00lu
3173#define LCHANPC11 0x0000F000lu
3174#define LCHANPC12 0x000F0000lu
3175#define LCHANPC13 0x00F00000lu
3176#define LCHANPC14 0x0F000000lu
3177#define LCHANPC15 0xF0000000lu
3178
3179
3180/* MXVR_SYNC_LCHAN_2 Masks */
3181
3182#define LCHANPC16 0x0000000Flu
3183#define LCHANPC17 0x000000F0lu
3184#define LCHANPC18 0x00000F00lu
3185#define LCHANPC19 0x0000F000lu
3186#define LCHANPC20 0x000F0000lu
3187#define LCHANPC21 0x00F00000lu
3188#define LCHANPC22 0x0F000000lu
3189#define LCHANPC23 0xF0000000lu
3190
3191
3192/* MXVR_SYNC_LCHAN_3 Masks */
3193
3194#define LCHANPC24 0x0000000Flu
3195#define LCHANPC25 0x000000F0lu
3196#define LCHANPC26 0x00000F00lu
3197#define LCHANPC27 0x0000F000lu
3198#define LCHANPC28 0x000F0000lu
3199#define LCHANPC29 0x00F00000lu
3200#define LCHANPC30 0x0F000000lu
3201#define LCHANPC31 0xF0000000lu
3202
3203
3204/* MXVR_SYNC_LCHAN_4 Masks */
3205
3206#define LCHANPC32 0x0000000Flu
3207#define LCHANPC33 0x000000F0lu
3208#define LCHANPC34 0x00000F00lu
3209#define LCHANPC35 0x0000F000lu
3210#define LCHANPC36 0x000F0000lu
3211#define LCHANPC37 0x00F00000lu
3212#define LCHANPC38 0x0F000000lu
3213#define LCHANPC39 0xF0000000lu
3214
3215
3216/* MXVR_SYNC_LCHAN_5 Masks */
3217
3218#define LCHANPC40 0x0000000Flu
3219#define LCHANPC41 0x000000F0lu
3220#define LCHANPC42 0x00000F00lu
3221#define LCHANPC43 0x0000F000lu
3222#define LCHANPC44 0x000F0000lu
3223#define LCHANPC45 0x00F00000lu
3224#define LCHANPC46 0x0F000000lu
3225#define LCHANPC47 0xF0000000lu
3226
3227
3228/* MXVR_SYNC_LCHAN_6 Masks */
3229
3230#define LCHANPC48 0x0000000Flu
3231#define LCHANPC49 0x000000F0lu
3232#define LCHANPC50 0x00000F00lu
3233#define LCHANPC51 0x0000F000lu
3234#define LCHANPC52 0x000F0000lu
3235#define LCHANPC53 0x00F00000lu
3236#define LCHANPC54 0x0F000000lu
3237#define LCHANPC55 0xF0000000lu
3238
3239
3240/* MXVR_SYNC_LCHAN_7 Masks */
3241
3242#define LCHANPC56 0x0000000Flu
3243#define LCHANPC57 0x000000F0lu
3244#define LCHANPC58 0x00000F00lu
3245#define LCHANPC59 0x0000F000lu
3246
3247
3248/* MXVR_DMAx_CONFIG Masks */
3249
3250#define MDMAEN 0x00000001lu
3251#define DD 0x00000002lu
3252#define LCHAN 0x000003C0lu
3253#define BITSWAPEN 0x00000400lu
3254#define BYSWAPEN 0x00000800lu
3255#define MFLOW 0x00007000lu
3256#define FIXEDPM 0x00080000lu
3257#define STARTPAT 0x00300000lu
3258#define STOPPAT 0x00C00000lu
3259#define COUNTPOS 0x1C000000lu
3260
3261#define DD_TX 0x00000000lu
3262#define DD_RX 0x00000002lu
3263
3264#define LCHAN_0 0x00000000lu
3265#define LCHAN_1 0x00000040lu
3266#define LCHAN_2 0x00000080lu
3267#define LCHAN_3 0x000000C0lu
3268#define LCHAN_4 0x00000100lu
3269#define LCHAN_5 0x00000140lu
3270#define LCHAN_6 0x00000180lu
3271#define LCHAN_7 0x000001C0lu
3272
3273#define MFLOW_STOP 0x00000000lu
3274#define MFLOW_AUTO 0x00001000lu
3275#define MFLOW_PVC 0x00002000lu
3276#define MFLOW_PSS 0x00003000lu
3277#define MFLOW_PFC 0x00004000lu
3278
3279#define STARTPAT_0 0x00000000lu
3280#define STARTPAT_1 0x00100000lu
3281
3282#define STOPPAT_0 0x00000000lu
3283#define STOPPAT_1 0x00400000lu
3284
3285#define COUNTPOS_0 0x00000000lu
3286#define COUNTPOS_1 0x04000000lu
3287#define COUNTPOS_2 0x08000000lu
3288#define COUNTPOS_3 0x0C000000lu
3289#define COUNTPOS_4 0x10000000lu
3290#define COUNTPOS_5 0x14000000lu
3291#define COUNTPOS_6 0x18000000lu
3292#define COUNTPOS_7 0x1C000000lu
3293
3294
3295/* MXVR_AP_CTL Masks */
3296
3297#define STARTAP 0x00000001lu
3298#define CANCELAP 0x00000002lu
3299#define RESETAP 0x00000004lu
3300#define APRBE0 0x00004000lu
3301#define APRBE1 0x00008000lu
3302#define APRBEX 0x0000C000lu
3303
3304
3305/* MXVR_CM_CTL Masks */
3306
3307#define STARTCM 0x00000001lu
3308#define CANCELCM 0x00000002lu
3309#define CMRBEX 0xFFFF0000lu
3310#define CMRBE0 0x00010000lu
3311#define CMRBE1 0x00020000lu
3312#define CMRBE2 0x00040000lu
3313#define CMRBE3 0x00080000lu
3314#define CMRBE4 0x00100000lu
3315#define CMRBE5 0x00200000lu
3316#define CMRBE6 0x00400000lu
3317#define CMRBE7 0x00800000lu
3318#define CMRBE8 0x01000000lu
3319#define CMRBE9 0x02000000lu
3320#define CMRBE10 0x04000000lu
3321#define CMRBE11 0x08000000lu
3322#define CMRBE12 0x10000000lu
3323#define CMRBE13 0x20000000lu
3324#define CMRBE14 0x40000000lu
3325#define CMRBE15 0x80000000lu
3326
3327
3328/* MXVR_PAT_DATA_x Masks */
3329
3330#define MATCH_DATA_0 0x000000FFlu
3331#define MATCH_DATA_1 0x0000FF00lu
3332#define MATCH_DATA_2 0x00FF0000lu
3333#define MATCH_DATA_3 0xFF000000lu
3334
3335
3336
3337/* MXVR_PAT_EN_x Masks */
3338
3339#define MATCH_EN_0_0 0x00000001lu
3340#define MATCH_EN_0_1 0x00000002lu
3341#define MATCH_EN_0_2 0x00000004lu
3342#define MATCH_EN_0_3 0x00000008lu
3343#define MATCH_EN_0_4 0x00000010lu
3344#define MATCH_EN_0_5 0x00000020lu
3345#define MATCH_EN_0_6 0x00000040lu
3346#define MATCH_EN_0_7 0x00000080lu
3347
3348#define MATCH_EN_1_0 0x00000100lu
3349#define MATCH_EN_1_1 0x00000200lu
3350#define MATCH_EN_1_2 0x00000400lu
3351#define MATCH_EN_1_3 0x00000800lu
3352#define MATCH_EN_1_4 0x00001000lu
3353#define MATCH_EN_1_5 0x00002000lu
3354#define MATCH_EN_1_6 0x00004000lu
3355#define MATCH_EN_1_7 0x00008000lu
3356
3357#define MATCH_EN_2_0 0x00010000lu
3358#define MATCH_EN_2_1 0x00020000lu
3359#define MATCH_EN_2_2 0x00040000lu
3360#define MATCH_EN_2_3 0x00080000lu
3361#define MATCH_EN_2_4 0x00100000lu
3362#define MATCH_EN_2_5 0x00200000lu
3363#define MATCH_EN_2_6 0x00400000lu
3364#define MATCH_EN_2_7 0x00800000lu
3365
3366#define MATCH_EN_3_0 0x01000000lu
3367#define MATCH_EN_3_1 0x02000000lu
3368#define MATCH_EN_3_2 0x04000000lu
3369#define MATCH_EN_3_3 0x08000000lu
3370#define MATCH_EN_3_4 0x10000000lu
3371#define MATCH_EN_3_5 0x20000000lu
3372#define MATCH_EN_3_6 0x40000000lu
3373#define MATCH_EN_3_7 0x80000000lu
3374
3375
3376/* MXVR_ROUTING_0 Masks */
3377
3378#define MUTE_CH0 0x00000080lu
3379#define MUTE_CH1 0x00008000lu
3380#define MUTE_CH2 0x00800000lu
3381#define MUTE_CH3 0x80000000lu
3382
3383#define TX_CH0 0x0000007Flu
3384#define TX_CH1 0x00007F00lu
3385#define TX_CH2 0x007F0000lu
3386#define TX_CH3 0x7F000000lu
3387
3388
3389/* MXVR_ROUTING_1 Masks */
3390
3391#define MUTE_CH4 0x00000080lu
3392#define MUTE_CH5 0x00008000lu
3393#define MUTE_CH6 0x00800000lu
3394#define MUTE_CH7 0x80000000lu
3395
3396#define TX_CH4 0x0000007Flu
3397#define TX_CH5 0x00007F00lu
3398#define TX_CH6 0x007F0000lu
3399#define TX_CH7 0x7F000000lu
3400
3401
3402/* MXVR_ROUTING_2 Masks */
3403
3404#define MUTE_CH8 0x00000080lu
3405#define MUTE_CH9 0x00008000lu
3406#define MUTE_CH10 0x00800000lu
3407#define MUTE_CH11 0x80000000lu
3408
3409#define TX_CH8 0x0000007Flu
3410#define TX_CH9 0x00007F00lu
3411#define TX_CH10 0x007F0000lu
3412#define TX_CH11 0x7F000000lu
3413
3414/* MXVR_ROUTING_3 Masks */
3415
3416#define MUTE_CH12 0x00000080lu
3417#define MUTE_CH13 0x00008000lu
3418#define MUTE_CH14 0x00800000lu
3419#define MUTE_CH15 0x80000000lu
3420
3421#define TX_CH12 0x0000007Flu
3422#define TX_CH13 0x00007F00lu
3423#define TX_CH14 0x007F0000lu
3424#define TX_CH15 0x7F000000lu
3425
3426
3427/* MXVR_ROUTING_4 Masks */
3428
3429#define MUTE_CH16 0x00000080lu
3430#define MUTE_CH17 0x00008000lu
3431#define MUTE_CH18 0x00800000lu
3432#define MUTE_CH19 0x80000000lu
3433
3434#define TX_CH16 0x0000007Flu
3435#define TX_CH17 0x00007F00lu
3436#define TX_CH18 0x007F0000lu
3437#define TX_CH19 0x7F000000lu
3438
3439
3440/* MXVR_ROUTING_5 Masks */
3441
3442#define MUTE_CH20 0x00000080lu
3443#define MUTE_CH21 0x00008000lu
3444#define MUTE_CH22 0x00800000lu
3445#define MUTE_CH23 0x80000000lu
3446
3447#define TX_CH20 0x0000007Flu
3448#define TX_CH21 0x00007F00lu
3449#define TX_CH22 0x007F0000lu
3450#define TX_CH23 0x7F000000lu
3451
3452
3453/* MXVR_ROUTING_6 Masks */
3454
3455#define MUTE_CH24 0x00000080lu
3456#define MUTE_CH25 0x00008000lu
3457#define MUTE_CH26 0x00800000lu
3458#define MUTE_CH27 0x80000000lu
3459
3460#define TX_CH24 0x0000007Flu
3461#define TX_CH25 0x00007F00lu
3462#define TX_CH26 0x007F0000lu
3463#define TX_CH27 0x7F000000lu
3464
3465
3466/* MXVR_ROUTING_7 Masks */
3467
3468#define MUTE_CH28 0x00000080lu
3469#define MUTE_CH29 0x00008000lu
3470#define MUTE_CH30 0x00800000lu
3471#define MUTE_CH31 0x80000000lu
3472
3473#define TX_CH28 0x0000007Flu
3474#define TX_CH29 0x00007F00lu
3475#define TX_CH30 0x007F0000lu
3476#define TX_CH31 0x7F000000lu
3477
3478
3479/* MXVR_ROUTING_8 Masks */
3480
3481#define MUTE_CH32 0x00000080lu
3482#define MUTE_CH33 0x00008000lu
3483#define MUTE_CH34 0x00800000lu
3484#define MUTE_CH35 0x80000000lu
3485
3486#define TX_CH32 0x0000007Flu
3487#define TX_CH33 0x00007F00lu
3488#define TX_CH34 0x007F0000lu
3489#define TX_CH35 0x7F000000lu
3490
3491
3492/* MXVR_ROUTING_9 Masks */
3493
3494#define MUTE_CH36 0x00000080lu
3495#define MUTE_CH37 0x00008000lu
3496#define MUTE_CH38 0x00800000lu
3497#define MUTE_CH39 0x80000000lu
3498
3499#define TX_CH36 0x0000007Flu
3500#define TX_CH37 0x00007F00lu
3501#define TX_CH38 0x007F0000lu
3502#define TX_CH39 0x7F000000lu
3503
3504
3505/* MXVR_ROUTING_10 Masks */
3506
3507#define MUTE_CH40 0x00000080lu
3508#define MUTE_CH41 0x00008000lu
3509#define MUTE_CH42 0x00800000lu
3510#define MUTE_CH43 0x80000000lu
3511
3512#define TX_CH40 0x0000007Flu
3513#define TX_CH41 0x00007F00lu
3514#define TX_CH42 0x007F0000lu
3515#define TX_CH43 0x7F000000lu
3516
3517
3518/* MXVR_ROUTING_11 Masks */
3519
3520#define MUTE_CH44 0x00000080lu
3521#define MUTE_CH45 0x00008000lu
3522#define MUTE_CH46 0x00800000lu
3523#define MUTE_CH47 0x80000000lu
3524
3525#define TX_CH44 0x0000007Flu
3526#define TX_CH45 0x00007F00lu
3527#define TX_CH46 0x007F0000lu
3528#define TX_CH47 0x7F000000lu
3529
3530
3531/* MXVR_ROUTING_12 Masks */
3532
3533#define MUTE_CH48 0x00000080lu
3534#define MUTE_CH49 0x00008000lu
3535#define MUTE_CH50 0x00800000lu
3536#define MUTE_CH51 0x80000000lu
3537
3538#define TX_CH48 0x0000007Flu
3539#define TX_CH49 0x00007F00lu
3540#define TX_CH50 0x007F0000lu
3541#define TX_CH51 0x7F000000lu
3542
3543
3544/* MXVR_ROUTING_13 Masks */
3545
3546#define MUTE_CH52 0x00000080lu
3547#define MUTE_CH53 0x00008000lu
3548#define MUTE_CH54 0x00800000lu
3549#define MUTE_CH55 0x80000000lu
3550
3551#define TX_CH52 0x0000007Flu
3552#define TX_CH53 0x00007F00lu
3553#define TX_CH54 0x007F0000lu
3554#define TX_CH55 0x7F000000lu
3555
3556
3557/* MXVR_ROUTING_14 Masks */
3558
3559#define MUTE_CH56 0x00000080lu
3560#define MUTE_CH57 0x00008000lu
3561#define MUTE_CH58 0x00800000lu
3562#define MUTE_CH59 0x80000000lu
3563
3564#define TX_CH56 0x0000007Flu
3565#define TX_CH57 0x00007F00lu
3566#define TX_CH58 0x007F0000lu
3567#define TX_CH59 0x7F000000lu
3568
3569
3570/* Control Message Receive Buffer (CMRB) Address Offsets */
3571
3572#define CMRB_STRIDE 0x00000016lu
3573
3574#define CMRB_DST_OFFSET 0x00000000lu
3575#define CMRB_SRC_OFFSET 0x00000002lu
3576#define CMRB_DATA_OFFSET 0x00000005lu
3577
3578
3579/* Control Message Transmit Buffer (CMTB) Address Offsets */
3580
3581#define CMTB_PRIO_OFFSET 0x00000000lu
3582#define CMTB_DST_OFFSET 0x00000002lu
3583#define CMTB_SRC_OFFSET 0x00000004lu
3584#define CMTB_TYPE_OFFSET 0x00000006lu
3585#define CMTB_DATA_OFFSET 0x00000007lu
3586
3587#define CMTB_ANSWER_OFFSET 0x0000000Alu
3588
3589#define CMTB_STAT_N_OFFSET 0x00000018lu
3590#define CMTB_STAT_A_OFFSET 0x00000016lu
3591#define CMTB_STAT_D_OFFSET 0x0000000Elu
3592#define CMTB_STAT_R_OFFSET 0x00000014lu
3593#define CMTB_STAT_W_OFFSET 0x00000014lu
3594#define CMTB_STAT_G_OFFSET 0x00000014lu
3595
3596
3597/* Asynchronous Packet Receive Buffer (APRB) Address Offsets */
3598
3599#define APRB_STRIDE 0x00000400lu
3600
3601#define APRB_DST_OFFSET 0x00000000lu
3602#define APRB_LEN_OFFSET 0x00000002lu
3603#define APRB_SRC_OFFSET 0x00000004lu
3604#define APRB_DATA_OFFSET 0x00000006lu
3605
3606
3607/* Asynchronous Packet Transmit Buffer (APTB) Address Offsets */
3608
3609#define APTB_PRIO_OFFSET 0x00000000lu
3610#define APTB_DST_OFFSET 0x00000002lu
3611#define APTB_LEN_OFFSET 0x00000004lu
3612#define APTB_SRC_OFFSET 0x00000006lu
3613#define APTB_DATA_OFFSET 0x00000008lu
3614
3615
3616/* Remote Read Buffer (RRDB) Address Offsets */
3617
3618#define RRDB_WADDR_OFFSET 0x00000100lu
3619#define RRDB_WLEN_OFFSET 0x00000101lu
3620
3621
3622
3623/* ************ CONTROLLER AREA NETWORK (CAN) MASKS ***************/
3624/* CAN_CONTROL Masks */
3625#define SRS 0x0001 /* Software Reset */
3626#define DNM 0x0002 /* Device Net Mode */
3627#define ABO 0x0004 /* Auto-Bus On Enable */
3628#define WBA 0x0010 /* Wake-Up On CAN Bus Activity Enable */
3629#define SMR 0x0020 /* Sleep Mode Request */
3630#define CSR 0x0040 /* CAN Suspend Mode Request */
3631#define CCR 0x0080 /* CAN Configuration Mode Request */
3632
3633/* CAN_STATUS Masks */
3634#define WT 0x0001 /* TX Warning Flag */
3635#define WR 0x0002 /* RX Warning Flag */
3636#define EP 0x0004 /* Error Passive Mode */
3637#define EBO 0x0008 /* Error Bus Off Mode */
3638#define CSA 0x0040 /* Suspend Mode Acknowledge */
3639#define CCA 0x0080 /* Configuration Mode Acknowledge */
3640#define MBPTR 0x1F00 /* Mailbox Pointer */
3641#define TRM 0x4000 /* Transmit Mode */
3642#define REC 0x8000 /* Receive Mode */
3643
3644/* CAN_CLOCK Masks */
3645#define BRP 0x03FF /* Bit-Rate Pre-Scaler */
3646
3647/* CAN_TIMING Masks */
3648#define TSEG1 0x000F /* Time Segment 1 */
3649#define TSEG2 0x0070 /* Time Segment 2 */
3650#define SAM 0x0080 /* Sampling */
3651#define SJW 0x0300 /* Synchronization Jump Width */
3652
3653/* CAN_DEBUG Masks */
3654#define DEC 0x0001 /* Disable CAN Error Counters */
3655#define DRI 0x0002 /* Disable CAN RX Input */
3656#define DTO 0x0004 /* Disable CAN TX Output */
3657#define DIL 0x0008 /* Disable CAN Internal Loop */
3658#define MAA 0x0010 /* Mode Auto-Acknowledge Enable */
3659#define MRB 0x0020 /* Mode Read Back Enable */
3660#define CDE 0x8000 /* CAN Debug Enable */
3661
3662/* CAN_CEC Masks */
3663#define RXECNT 0x00FF /* Receive Error Counter */
3664#define TXECNT 0xFF00 /* Transmit Error Counter */
3665
3666/* CAN_INTR Masks */
3667#define MBRIRQ 0x0001 /* Mailbox Receive Interrupt */
3668#define MBRIF MBRIRQ /* legacy */
3669#define MBTIRQ 0x0002 /* Mailbox Transmit Interrupt */
3670#define MBTIF MBTIRQ /* legacy */
3671#define GIRQ 0x0004 /* Global Interrupt */
3672#define SMACK 0x0008 /* Sleep Mode Acknowledge */
3673#define CANTX 0x0040 /* CAN TX Bus Value */
3674#define CANRX 0x0080 /* CAN RX Bus Value */
3675
3676/* CAN_MBxx_ID1 and CAN_MBxx_ID0 Masks */
3677#define DFC 0xFFFF /* Data Filtering Code (If Enabled) (ID0) */
3678#define EXTID_LO 0xFFFF /* Lower 16 Bits of Extended Identifier (ID0) */
3679#define EXTID_HI 0x0003 /* Upper 2 Bits of Extended Identifier (ID1) */
3680#define BASEID 0x1FFC /* Base Identifier */
3681#define IDE 0x2000 /* Identifier Extension */
3682#define RTR 0x4000 /* Remote Frame Transmission Request */
3683#define AME 0x8000 /* Acceptance Mask Enable */
3684
3685/* CAN_MBxx_TIMESTAMP Masks */
3686#define TSV 0xFFFF /* Timestamp */
3687
3688/* CAN_MBxx_LENGTH Masks */
3689#define DLC 0x000F /* Data Length Code */
3690
3691/* CAN_AMxxH and CAN_AMxxL Masks */
3692#define DFM 0xFFFF /* Data Field Mask (If Enabled) (CAN_AMxxL) */
3693#define EXTID_LO 0xFFFF /* Lower 16 Bits of Extended Identifier (CAN_AMxxL) */
3694#define EXTID_HI 0x0003 /* Upper 2 Bits of Extended Identifier (CAN_AMxxH) */
3695#define BASEID 0x1FFC /* Base Identifier */
3696#define AMIDE 0x2000 /* Acceptance Mask ID Extension Enable */
3697#define FMD 0x4000 /* Full Mask Data Field Enable */
3698#define FDF 0x8000 /* Filter On Data Field Enable */
3699
3700/* CAN_MC1 Masks */
3701#define MC0 0x0001 /* Enable Mailbox 0 */
3702#define MC1 0x0002 /* Enable Mailbox 1 */
3703#define MC2 0x0004 /* Enable Mailbox 2 */
3704#define MC3 0x0008 /* Enable Mailbox 3 */
3705#define MC4 0x0010 /* Enable Mailbox 4 */
3706#define MC5 0x0020 /* Enable Mailbox 5 */
3707#define MC6 0x0040 /* Enable Mailbox 6 */
3708#define MC7 0x0080 /* Enable Mailbox 7 */
3709#define MC8 0x0100 /* Enable Mailbox 8 */
3710#define MC9 0x0200 /* Enable Mailbox 9 */
3711#define MC10 0x0400 /* Enable Mailbox 10 */
3712#define MC11 0x0800 /* Enable Mailbox 11 */
3713#define MC12 0x1000 /* Enable Mailbox 12 */
3714#define MC13 0x2000 /* Enable Mailbox 13 */
3715#define MC14 0x4000 /* Enable Mailbox 14 */
3716#define MC15 0x8000 /* Enable Mailbox 15 */
3717
3718/* CAN_MC2 Masks */
3719#define MC16 0x0001 /* Enable Mailbox 16 */
3720#define MC17 0x0002 /* Enable Mailbox 17 */
3721#define MC18 0x0004 /* Enable Mailbox 18 */
3722#define MC19 0x0008 /* Enable Mailbox 19 */
3723#define MC20 0x0010 /* Enable Mailbox 20 */
3724#define MC21 0x0020 /* Enable Mailbox 21 */
3725#define MC22 0x0040 /* Enable Mailbox 22 */
3726#define MC23 0x0080 /* Enable Mailbox 23 */
3727#define MC24 0x0100 /* Enable Mailbox 24 */
3728#define MC25 0x0200 /* Enable Mailbox 25 */
3729#define MC26 0x0400 /* Enable Mailbox 26 */
3730#define MC27 0x0800 /* Enable Mailbox 27 */
3731#define MC28 0x1000 /* Enable Mailbox 28 */
3732#define MC29 0x2000 /* Enable Mailbox 29 */
3733#define MC30 0x4000 /* Enable Mailbox 30 */
3734#define MC31 0x8000 /* Enable Mailbox 31 */
3735
3736/* CAN_MD1 Masks */
3737#define MD0 0x0001 /* Enable Mailbox 0 For Receive */
3738#define MD1 0x0002 /* Enable Mailbox 1 For Receive */
3739#define MD2 0x0004 /* Enable Mailbox 2 For Receive */
3740#define MD3 0x0008 /* Enable Mailbox 3 For Receive */
3741#define MD4 0x0010 /* Enable Mailbox 4 For Receive */
3742#define MD5 0x0020 /* Enable Mailbox 5 For Receive */
3743#define MD6 0x0040 /* Enable Mailbox 6 For Receive */
3744#define MD7 0x0080 /* Enable Mailbox 7 For Receive */
3745#define MD8 0x0100 /* Enable Mailbox 8 For Receive */
3746#define MD9 0x0200 /* Enable Mailbox 9 For Receive */
3747#define MD10 0x0400 /* Enable Mailbox 10 For Receive */
3748#define MD11 0x0800 /* Enable Mailbox 11 For Receive */
3749#define MD12 0x1000 /* Enable Mailbox 12 For Receive */
3750#define MD13 0x2000 /* Enable Mailbox 13 For Receive */
3751#define MD14 0x4000 /* Enable Mailbox 14 For Receive */
3752#define MD15 0x8000 /* Enable Mailbox 15 For Receive */
3753
3754/* CAN_MD2 Masks */
3755#define MD16 0x0001 /* Enable Mailbox 16 For Receive */
3756#define MD17 0x0002 /* Enable Mailbox 17 For Receive */
3757#define MD18 0x0004 /* Enable Mailbox 18 For Receive */
3758#define MD19 0x0008 /* Enable Mailbox 19 For Receive */
3759#define MD20 0x0010 /* Enable Mailbox 20 For Receive */
3760#define MD21 0x0020 /* Enable Mailbox 21 For Receive */
3761#define MD22 0x0040 /* Enable Mailbox 22 For Receive */
3762#define MD23 0x0080 /* Enable Mailbox 23 For Receive */
3763#define MD24 0x0100 /* Enable Mailbox 24 For Receive */
3764#define MD25 0x0200 /* Enable Mailbox 25 For Receive */
3765#define MD26 0x0400 /* Enable Mailbox 26 For Receive */
3766#define MD27 0x0800 /* Enable Mailbox 27 For Receive */
3767#define MD28 0x1000 /* Enable Mailbox 28 For Receive */
3768#define MD29 0x2000 /* Enable Mailbox 29 For Receive */
3769#define MD30 0x4000 /* Enable Mailbox 30 For Receive */
3770#define MD31 0x8000 /* Enable Mailbox 31 For Receive */
3771
3772/* CAN_RMP1 Masks */
3773#define RMP0 0x0001 /* RX Message Pending In Mailbox 0 */
3774#define RMP1 0x0002 /* RX Message Pending In Mailbox 1 */
3775#define RMP2 0x0004 /* RX Message Pending In Mailbox 2 */
3776#define RMP3 0x0008 /* RX Message Pending In Mailbox 3 */
3777#define RMP4 0x0010 /* RX Message Pending In Mailbox 4 */
3778#define RMP5 0x0020 /* RX Message Pending In Mailbox 5 */
3779#define RMP6 0x0040 /* RX Message Pending In Mailbox 6 */
3780#define RMP7 0x0080 /* RX Message Pending In Mailbox 7 */
3781#define RMP8 0x0100 /* RX Message Pending In Mailbox 8 */
3782#define RMP9 0x0200 /* RX Message Pending In Mailbox 9 */
3783#define RMP10 0x0400 /* RX Message Pending In Mailbox 10 */
3784#define RMP11 0x0800 /* RX Message Pending In Mailbox 11 */
3785#define RMP12 0x1000 /* RX Message Pending In Mailbox 12 */
3786#define RMP13 0x2000 /* RX Message Pending In Mailbox 13 */
3787#define RMP14 0x4000 /* RX Message Pending In Mailbox 14 */
3788#define RMP15 0x8000 /* RX Message Pending In Mailbox 15 */
3789
3790/* CAN_RMP2 Masks */
3791#define RMP16 0x0001 /* RX Message Pending In Mailbox 16 */
3792#define RMP17 0x0002 /* RX Message Pending In Mailbox 17 */
3793#define RMP18 0x0004 /* RX Message Pending In Mailbox 18 */
3794#define RMP19 0x0008 /* RX Message Pending In Mailbox 19 */
3795#define RMP20 0x0010 /* RX Message Pending In Mailbox 20 */
3796#define RMP21 0x0020 /* RX Message Pending In Mailbox 21 */
3797#define RMP22 0x0040 /* RX Message Pending In Mailbox 22 */
3798#define RMP23 0x0080 /* RX Message Pending In Mailbox 23 */
3799#define RMP24 0x0100 /* RX Message Pending In Mailbox 24 */
3800#define RMP25 0x0200 /* RX Message Pending In Mailbox 25 */
3801#define RMP26 0x0400 /* RX Message Pending In Mailbox 26 */
3802#define RMP27 0x0800 /* RX Message Pending In Mailbox 27 */
3803#define RMP28 0x1000 /* RX Message Pending In Mailbox 28 */
3804#define RMP29 0x2000 /* RX Message Pending In Mailbox 29 */
3805#define RMP30 0x4000 /* RX Message Pending In Mailbox 30 */
3806#define RMP31 0x8000 /* RX Message Pending In Mailbox 31 */
3807
3808/* CAN_RML1 Masks */
3809#define RML0 0x0001 /* RX Message Lost In Mailbox 0 */
3810#define RML1 0x0002 /* RX Message Lost In Mailbox 1 */
3811#define RML2 0x0004 /* RX Message Lost In Mailbox 2 */
3812#define RML3 0x0008 /* RX Message Lost In Mailbox 3 */
3813#define RML4 0x0010 /* RX Message Lost In Mailbox 4 */
3814#define RML5 0x0020 /* RX Message Lost In Mailbox 5 */
3815#define RML6 0x0040 /* RX Message Lost In Mailbox 6 */
3816#define RML7 0x0080 /* RX Message Lost In Mailbox 7 */
3817#define RML8 0x0100 /* RX Message Lost In Mailbox 8 */
3818#define RML9 0x0200 /* RX Message Lost In Mailbox 9 */
3819#define RML10 0x0400 /* RX Message Lost In Mailbox 10 */
3820#define RML11 0x0800 /* RX Message Lost In Mailbox 11 */
3821#define RML12 0x1000 /* RX Message Lost In Mailbox 12 */
3822#define RML13 0x2000 /* RX Message Lost In Mailbox 13 */
3823#define RML14 0x4000 /* RX Message Lost In Mailbox 14 */
3824#define RML15 0x8000 /* RX Message Lost In Mailbox 15 */
3825
3826/* CAN_RML2 Masks */
3827#define RML16 0x0001 /* RX Message Lost In Mailbox 16 */
3828#define RML17 0x0002 /* RX Message Lost In Mailbox 17 */
3829#define RML18 0x0004 /* RX Message Lost In Mailbox 18 */
3830#define RML19 0x0008 /* RX Message Lost In Mailbox 19 */
3831#define RML20 0x0010 /* RX Message Lost In Mailbox 20 */
3832#define RML21 0x0020 /* RX Message Lost In Mailbox 21 */
3833#define RML22 0x0040 /* RX Message Lost In Mailbox 22 */
3834#define RML23 0x0080 /* RX Message Lost In Mailbox 23 */
3835#define RML24 0x0100 /* RX Message Lost In Mailbox 24 */
3836#define RML25 0x0200 /* RX Message Lost In Mailbox 25 */
3837#define RML26 0x0400 /* RX Message Lost In Mailbox 26 */
3838#define RML27 0x0800 /* RX Message Lost In Mailbox 27 */
3839#define RML28 0x1000 /* RX Message Lost In Mailbox 28 */
3840#define RML29 0x2000 /* RX Message Lost In Mailbox 29 */
3841#define RML30 0x4000 /* RX Message Lost In Mailbox 30 */
3842#define RML31 0x8000 /* RX Message Lost In Mailbox 31 */
3843
3844/* CAN_OPSS1 Masks */
3845#define OPSS0 0x0001 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 0 */
3846#define OPSS1 0x0002 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 1 */
3847#define OPSS2 0x0004 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 2 */
3848#define OPSS3 0x0008 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 3 */
3849#define OPSS4 0x0010 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 4 */
3850#define OPSS5 0x0020 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 5 */
3851#define OPSS6 0x0040 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 6 */
3852#define OPSS7 0x0080 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 7 */
3853#define OPSS8 0x0100 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 8 */
3854#define OPSS9 0x0200 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 9 */
3855#define OPSS10 0x0400 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 10 */
3856#define OPSS11 0x0800 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 11 */
3857#define OPSS12 0x1000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 12 */
3858#define OPSS13 0x2000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 13 */
3859#define OPSS14 0x4000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 14 */
3860#define OPSS15 0x8000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 15 */
3861
3862/* CAN_OPSS2 Masks */
3863#define OPSS16 0x0001 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 16 */
3864#define OPSS17 0x0002 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 17 */
3865#define OPSS18 0x0004 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 18 */
3866#define OPSS19 0x0008 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 19 */
3867#define OPSS20 0x0010 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 20 */
3868#define OPSS21 0x0020 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 21 */
3869#define OPSS22 0x0040 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 22 */
3870#define OPSS23 0x0080 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 23 */
3871#define OPSS24 0x0100 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 24 */
3872#define OPSS25 0x0200 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 25 */
3873#define OPSS26 0x0400 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 26 */
3874#define OPSS27 0x0800 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 27 */
3875#define OPSS28 0x1000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 28 */
3876#define OPSS29 0x2000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 29 */
3877#define OPSS30 0x4000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 30 */
3878#define OPSS31 0x8000 /* Enable RX Overwrite Protection or TX Single-Shot For Mailbox 31 */
3879
3880/* CAN_TRR1 Masks */
3881#define TRR0 0x0001 /* Deny But Don't Lock Access To Mailbox 0 */
3882#define TRR1 0x0002 /* Deny But Don't Lock Access To Mailbox 1 */
3883#define TRR2 0x0004 /* Deny But Don't Lock Access To Mailbox 2 */
3884#define TRR3 0x0008 /* Deny But Don't Lock Access To Mailbox 3 */
3885#define TRR4 0x0010 /* Deny But Don't Lock Access To Mailbox 4 */
3886#define TRR5 0x0020 /* Deny But Don't Lock Access To Mailbox 5 */
3887#define TRR6 0x0040 /* Deny But Don't Lock Access To Mailbox 6 */
3888#define TRR7 0x0080 /* Deny But Don't Lock Access To Mailbox 7 */
3889#define TRR8 0x0100 /* Deny But Don't Lock Access To Mailbox 8 */
3890#define TRR9 0x0200 /* Deny But Don't Lock Access To Mailbox 9 */
3891#define TRR10 0x0400 /* Deny But Don't Lock Access To Mailbox 10 */
3892#define TRR11 0x0800 /* Deny But Don't Lock Access To Mailbox 11 */
3893#define TRR12 0x1000 /* Deny But Don't Lock Access To Mailbox 12 */
3894#define TRR13 0x2000 /* Deny But Don't Lock Access To Mailbox 13 */
3895#define TRR14 0x4000 /* Deny But Don't Lock Access To Mailbox 14 */
3896#define TRR15 0x8000 /* Deny But Don't Lock Access To Mailbox 15 */
3897
3898/* CAN_TRR2 Masks */
3899#define TRR16 0x0001 /* Deny But Don't Lock Access To Mailbox 16 */
3900#define TRR17 0x0002 /* Deny But Don't Lock Access To Mailbox 17 */
3901#define TRR18 0x0004 /* Deny But Don't Lock Access To Mailbox 18 */
3902#define TRR19 0x0008 /* Deny But Don't Lock Access To Mailbox 19 */
3903#define TRR20 0x0010 /* Deny But Don't Lock Access To Mailbox 20 */
3904#define TRR21 0x0020 /* Deny But Don't Lock Access To Mailbox 21 */
3905#define TRR22 0x0040 /* Deny But Don't Lock Access To Mailbox 22 */
3906#define TRR23 0x0080 /* Deny But Don't Lock Access To Mailbox 23 */
3907#define TRR24 0x0100 /* Deny But Don't Lock Access To Mailbox 24 */
3908#define TRR25 0x0200 /* Deny But Don't Lock Access To Mailbox 25 */
3909#define TRR26 0x0400 /* Deny But Don't Lock Access To Mailbox 26 */
3910#define TRR27 0x0800 /* Deny But Don't Lock Access To Mailbox 27 */
3911#define TRR28 0x1000 /* Deny But Don't Lock Access To Mailbox 28 */
3912#define TRR29 0x2000 /* Deny But Don't Lock Access To Mailbox 29 */
3913#define TRR30 0x4000 /* Deny But Don't Lock Access To Mailbox 30 */
3914#define TRR31 0x8000 /* Deny But Don't Lock Access To Mailbox 31 */
3915
3916/* CAN_TRS1 Masks */
3917#define TRS0 0x0001 /* Remote Frame Request For Mailbox 0 */
3918#define TRS1 0x0002 /* Remote Frame Request For Mailbox 1 */
3919#define TRS2 0x0004 /* Remote Frame Request For Mailbox 2 */
3920#define TRS3 0x0008 /* Remote Frame Request For Mailbox 3 */
3921#define TRS4 0x0010 /* Remote Frame Request For Mailbox 4 */
3922#define TRS5 0x0020 /* Remote Frame Request For Mailbox 5 */
3923#define TRS6 0x0040 /* Remote Frame Request For Mailbox 6 */
3924#define TRS7 0x0080 /* Remote Frame Request For Mailbox 7 */
3925#define TRS8 0x0100 /* Remote Frame Request For Mailbox 8 */
3926#define TRS9 0x0200 /* Remote Frame Request For Mailbox 9 */
3927#define TRS10 0x0400 /* Remote Frame Request For Mailbox 10 */
3928#define TRS11 0x0800 /* Remote Frame Request For Mailbox 11 */
3929#define TRS12 0x1000 /* Remote Frame Request For Mailbox 12 */
3930#define TRS13 0x2000 /* Remote Frame Request For Mailbox 13 */
3931#define TRS14 0x4000 /* Remote Frame Request For Mailbox 14 */
3932#define TRS15 0x8000 /* Remote Frame Request For Mailbox 15 */
3933
3934/* CAN_TRS2 Masks */
3935#define TRS16 0x0001 /* Remote Frame Request For Mailbox 16 */
3936#define TRS17 0x0002 /* Remote Frame Request For Mailbox 17 */
3937#define TRS18 0x0004 /* Remote Frame Request For Mailbox 18 */
3938#define TRS19 0x0008 /* Remote Frame Request For Mailbox 19 */
3939#define TRS20 0x0010 /* Remote Frame Request For Mailbox 20 */
3940#define TRS21 0x0020 /* Remote Frame Request For Mailbox 21 */
3941#define TRS22 0x0040 /* Remote Frame Request For Mailbox 22 */
3942#define TRS23 0x0080 /* Remote Frame Request For Mailbox 23 */
3943#define TRS24 0x0100 /* Remote Frame Request For Mailbox 24 */
3944#define TRS25 0x0200 /* Remote Frame Request For Mailbox 25 */
3945#define TRS26 0x0400 /* Remote Frame Request For Mailbox 26 */
3946#define TRS27 0x0800 /* Remote Frame Request For Mailbox 27 */
3947#define TRS28 0x1000 /* Remote Frame Request For Mailbox 28 */
3948#define TRS29 0x2000 /* Remote Frame Request For Mailbox 29 */
3949#define TRS30 0x4000 /* Remote Frame Request For Mailbox 30 */
3950#define TRS31 0x8000 /* Remote Frame Request For Mailbox 31 */
3951
3952/* CAN_AA1 Masks */
3953#define AA0 0x0001 /* Aborted Message In Mailbox 0 */
3954#define AA1 0x0002 /* Aborted Message In Mailbox 1 */
3955#define AA2 0x0004 /* Aborted Message In Mailbox 2 */
3956#define AA3 0x0008 /* Aborted Message In Mailbox 3 */
3957#define AA4 0x0010 /* Aborted Message In Mailbox 4 */
3958#define AA5 0x0020 /* Aborted Message In Mailbox 5 */
3959#define AA6 0x0040 /* Aborted Message In Mailbox 6 */
3960#define AA7 0x0080 /* Aborted Message In Mailbox 7 */
3961#define AA8 0x0100 /* Aborted Message In Mailbox 8 */
3962#define AA9 0x0200 /* Aborted Message In Mailbox 9 */
3963#define AA10 0x0400 /* Aborted Message In Mailbox 10 */
3964#define AA11 0x0800 /* Aborted Message In Mailbox 11 */
3965#define AA12 0x1000 /* Aborted Message In Mailbox 12 */
3966#define AA13 0x2000 /* Aborted Message In Mailbox 13 */
3967#define AA14 0x4000 /* Aborted Message In Mailbox 14 */
3968#define AA15 0x8000 /* Aborted Message In Mailbox 15 */
3969
3970/* CAN_AA2 Masks */
3971#define AA16 0x0001 /* Aborted Message In Mailbox 16 */
3972#define AA17 0x0002 /* Aborted Message In Mailbox 17 */
3973#define AA18 0x0004 /* Aborted Message In Mailbox 18 */
3974#define AA19 0x0008 /* Aborted Message In Mailbox 19 */
3975#define AA20 0x0010 /* Aborted Message In Mailbox 20 */
3976#define AA21 0x0020 /* Aborted Message In Mailbox 21 */
3977#define AA22 0x0040 /* Aborted Message In Mailbox 22 */
3978#define AA23 0x0080 /* Aborted Message In Mailbox 23 */
3979#define AA24 0x0100 /* Aborted Message In Mailbox 24 */
3980#define AA25 0x0200 /* Aborted Message In Mailbox 25 */
3981#define AA26 0x0400 /* Aborted Message In Mailbox 26 */
3982#define AA27 0x0800 /* Aborted Message In Mailbox 27 */
3983#define AA28 0x1000 /* Aborted Message In Mailbox 28 */
3984#define AA29 0x2000 /* Aborted Message In Mailbox 29 */
3985#define AA30 0x4000 /* Aborted Message In Mailbox 30 */
3986#define AA31 0x8000 /* Aborted Message In Mailbox 31 */
3987
3988/* CAN_TA1 Masks */
3989#define TA0 0x0001 /* Transmit Successful From Mailbox 0 */
3990#define TA1 0x0002 /* Transmit Successful From Mailbox 1 */
3991#define TA2 0x0004 /* Transmit Successful From Mailbox 2 */
3992#define TA3 0x0008 /* Transmit Successful From Mailbox 3 */
3993#define TA4 0x0010 /* Transmit Successful From Mailbox 4 */
3994#define TA5 0x0020 /* Transmit Successful From Mailbox 5 */
3995#define TA6 0x0040 /* Transmit Successful From Mailbox 6 */
3996#define TA7 0x0080 /* Transmit Successful From Mailbox 7 */
3997#define TA8 0x0100 /* Transmit Successful From Mailbox 8 */
3998#define TA9 0x0200 /* Transmit Successful From Mailbox 9 */
3999#define TA10 0x0400 /* Transmit Successful From Mailbox 10 */
4000#define TA11 0x0800 /* Transmit Successful From Mailbox 11 */
4001#define TA12 0x1000 /* Transmit Successful From Mailbox 12 */
4002#define TA13 0x2000 /* Transmit Successful From Mailbox 13 */
4003#define TA14 0x4000 /* Transmit Successful From Mailbox 14 */
4004#define TA15 0x8000 /* Transmit Successful From Mailbox 15 */
4005
4006/* CAN_TA2 Masks */
4007#define TA16 0x0001 /* Transmit Successful From Mailbox 16 */
4008#define TA17 0x0002 /* Transmit Successful From Mailbox 17 */
4009#define TA18 0x0004 /* Transmit Successful From Mailbox 18 */
4010#define TA19 0x0008 /* Transmit Successful From Mailbox 19 */
4011#define TA20 0x0010 /* Transmit Successful From Mailbox 20 */
4012#define TA21 0x0020 /* Transmit Successful From Mailbox 21 */
4013#define TA22 0x0040 /* Transmit Successful From Mailbox 22 */
4014#define TA23 0x0080 /* Transmit Successful From Mailbox 23 */
4015#define TA24 0x0100 /* Transmit Successful From Mailbox 24 */
4016#define TA25 0x0200 /* Transmit Successful From Mailbox 25 */
4017#define TA26 0x0400 /* Transmit Successful From Mailbox 26 */
4018#define TA27 0x0800 /* Transmit Successful From Mailbox 27 */
4019#define TA28 0x1000 /* Transmit Successful From Mailbox 28 */
4020#define TA29 0x2000 /* Transmit Successful From Mailbox 29 */
4021#define TA30 0x4000 /* Transmit Successful From Mailbox 30 */
4022#define TA31 0x8000 /* Transmit Successful From Mailbox 31 */
4023
4024/* CAN_MBTD Masks */
4025#define TDPTR 0x001F /* Mailbox To Temporarily Disable */
4026#define TDA 0x0040 /* Temporary Disable Acknowledge */
4027#define TDR 0x0080 /* Temporary Disable Request */
4028
4029/* CAN_RFH1 Masks */
4030#define RFH0 0x0001 /* Enable Automatic Remote Frame Handling For Mailbox 0 */
4031#define RFH1 0x0002 /* Enable Automatic Remote Frame Handling For Mailbox 1 */
4032#define RFH2 0x0004 /* Enable Automatic Remote Frame Handling For Mailbox 2 */
4033#define RFH3 0x0008 /* Enable Automatic Remote Frame Handling For Mailbox 3 */
4034#define RFH4 0x0010 /* Enable Automatic Remote Frame Handling For Mailbox 4 */
4035#define RFH5 0x0020 /* Enable Automatic Remote Frame Handling For Mailbox 5 */
4036#define RFH6 0x0040 /* Enable Automatic Remote Frame Handling For Mailbox 6 */
4037#define RFH7 0x0080 /* Enable Automatic Remote Frame Handling For Mailbox 7 */
4038#define RFH8 0x0100 /* Enable Automatic Remote Frame Handling For Mailbox 8 */
4039#define RFH9 0x0200 /* Enable Automatic Remote Frame Handling For Mailbox 9 */
4040#define RFH10 0x0400 /* Enable Automatic Remote Frame Handling For Mailbox 10 */
4041#define RFH11 0x0800 /* Enable Automatic Remote Frame Handling For Mailbox 11 */
4042#define RFH12 0x1000 /* Enable Automatic Remote Frame Handling For Mailbox 12 */
4043#define RFH13 0x2000 /* Enable Automatic Remote Frame Handling For Mailbox 13 */
4044#define RFH14 0x4000 /* Enable Automatic Remote Frame Handling For Mailbox 14 */
4045#define RFH15 0x8000 /* Enable Automatic Remote Frame Handling For Mailbox 15 */
4046
4047/* CAN_RFH2 Masks */
4048#define RFH16 0x0001 /* Enable Automatic Remote Frame Handling For Mailbox 16 */
4049#define RFH17 0x0002 /* Enable Automatic Remote Frame Handling For Mailbox 17 */
4050#define RFH18 0x0004 /* Enable Automatic Remote Frame Handling For Mailbox 18 */
4051#define RFH19 0x0008 /* Enable Automatic Remote Frame Handling For Mailbox 19 */
4052#define RFH20 0x0010 /* Enable Automatic Remote Frame Handling For Mailbox 20 */
4053#define RFH21 0x0020 /* Enable Automatic Remote Frame Handling For Mailbox 21 */
4054#define RFH22 0x0040 /* Enable Automatic Remote Frame Handling For Mailbox 22 */
4055#define RFH23 0x0080 /* Enable Automatic Remote Frame Handling For Mailbox 23 */
4056#define RFH24 0x0100 /* Enable Automatic Remote Frame Handling For Mailbox 24 */
4057#define RFH25 0x0200 /* Enable Automatic Remote Frame Handling For Mailbox 25 */
4058#define RFH26 0x0400 /* Enable Automatic Remote Frame Handling For Mailbox 26 */
4059#define RFH27 0x0800 /* Enable Automatic Remote Frame Handling For Mailbox 27 */
4060#define RFH28 0x1000 /* Enable Automatic Remote Frame Handling For Mailbox 28 */
4061#define RFH29 0x2000 /* Enable Automatic Remote Frame Handling For Mailbox 29 */
4062#define RFH30 0x4000 /* Enable Automatic Remote Frame Handling For Mailbox 30 */
4063#define RFH31 0x8000 /* Enable Automatic Remote Frame Handling For Mailbox 31 */
4064
4065/* CAN_MBTIF1 Masks */
4066#define MBTIF0 0x0001 /* TX Interrupt Active In Mailbox 0 */
4067#define MBTIF1 0x0002 /* TX Interrupt Active In Mailbox 1 */
4068#define MBTIF2 0x0004 /* TX Interrupt Active In Mailbox 2 */
4069#define MBTIF3 0x0008 /* TX Interrupt Active In Mailbox 3 */
4070#define MBTIF4 0x0010 /* TX Interrupt Active In Mailbox 4 */
4071#define MBTIF5 0x0020 /* TX Interrupt Active In Mailbox 5 */
4072#define MBTIF6 0x0040 /* TX Interrupt Active In Mailbox 6 */
4073#define MBTIF7 0x0080 /* TX Interrupt Active In Mailbox 7 */
4074#define MBTIF8 0x0100 /* TX Interrupt Active In Mailbox 8 */
4075#define MBTIF9 0x0200 /* TX Interrupt Active In Mailbox 9 */
4076#define MBTIF10 0x0400 /* TX Interrupt Active In Mailbox 10 */
4077#define MBTIF11 0x0800 /* TX Interrupt Active In Mailbox 11 */
4078#define MBTIF12 0x1000 /* TX Interrupt Active In Mailbox 12 */
4079#define MBTIF13 0x2000 /* TX Interrupt Active In Mailbox 13 */
4080#define MBTIF14 0x4000 /* TX Interrupt Active In Mailbox 14 */
4081#define MBTIF15 0x8000 /* TX Interrupt Active In Mailbox 15 */
4082
4083/* CAN_MBTIF2 Masks */
4084#define MBTIF16 0x0001 /* TX Interrupt Active In Mailbox 16 */
4085#define MBTIF17 0x0002 /* TX Interrupt Active In Mailbox 17 */
4086#define MBTIF18 0x0004 /* TX Interrupt Active In Mailbox 18 */
4087#define MBTIF19 0x0008 /* TX Interrupt Active In Mailbox 19 */
4088#define MBTIF20 0x0010 /* TX Interrupt Active In Mailbox 20 */
4089#define MBTIF21 0x0020 /* TX Interrupt Active In Mailbox 21 */
4090#define MBTIF22 0x0040 /* TX Interrupt Active In Mailbox 22 */
4091#define MBTIF23 0x0080 /* TX Interrupt Active In Mailbox 23 */
4092#define MBTIF24 0x0100 /* TX Interrupt Active In Mailbox 24 */
4093#define MBTIF25 0x0200 /* TX Interrupt Active In Mailbox 25 */
4094#define MBTIF26 0x0400 /* TX Interrupt Active In Mailbox 26 */
4095#define MBTIF27 0x0800 /* TX Interrupt Active In Mailbox 27 */
4096#define MBTIF28 0x1000 /* TX Interrupt Active In Mailbox 28 */
4097#define MBTIF29 0x2000 /* TX Interrupt Active In Mailbox 29 */
4098#define MBTIF30 0x4000 /* TX Interrupt Active In Mailbox 30 */
4099#define MBTIF31 0x8000 /* TX Interrupt Active In Mailbox 31 */
4100
4101/* CAN_MBRIF1 Masks */
4102#define MBRIF0 0x0001 /* RX Interrupt Active In Mailbox 0 */
4103#define MBRIF1 0x0002 /* RX Interrupt Active In Mailbox 1 */
4104#define MBRIF2 0x0004 /* RX Interrupt Active In Mailbox 2 */
4105#define MBRIF3 0x0008 /* RX Interrupt Active In Mailbox 3 */
4106#define MBRIF4 0x0010 /* RX Interrupt Active In Mailbox 4 */
4107#define MBRIF5 0x0020 /* RX Interrupt Active In Mailbox 5 */
4108#define MBRIF6 0x0040 /* RX Interrupt Active In Mailbox 6 */
4109#define MBRIF7 0x0080 /* RX Interrupt Active In Mailbox 7 */
4110#define MBRIF8 0x0100 /* RX Interrupt Active In Mailbox 8 */
4111#define MBRIF9 0x0200 /* RX Interrupt Active In Mailbox 9 */
4112#define MBRIF10 0x0400 /* RX Interrupt Active In Mailbox 10 */
4113#define MBRIF11 0x0800 /* RX Interrupt Active In Mailbox 11 */
4114#define MBRIF12 0x1000 /* RX Interrupt Active In Mailbox 12 */
4115#define MBRIF13 0x2000 /* RX Interrupt Active In Mailbox 13 */
4116#define MBRIF14 0x4000 /* RX Interrupt Active In Mailbox 14 */
4117#define MBRIF15 0x8000 /* RX Interrupt Active In Mailbox 15 */
4118
4119/* CAN_MBRIF2 Masks */
4120#define MBRIF16 0x0001 /* RX Interrupt Active In Mailbox 16 */
4121#define MBRIF17 0x0002 /* RX Interrupt Active In Mailbox 17 */
4122#define MBRIF18 0x0004 /* RX Interrupt Active In Mailbox 18 */
4123#define MBRIF19 0x0008 /* RX Interrupt Active In Mailbox 19 */
4124#define MBRIF20 0x0010 /* RX Interrupt Active In Mailbox 20 */
4125#define MBRIF21 0x0020 /* RX Interrupt Active In Mailbox 21 */
4126#define MBRIF22 0x0040 /* RX Interrupt Active In Mailbox 22 */
4127#define MBRIF23 0x0080 /* RX Interrupt Active In Mailbox 23 */
4128#define MBRIF24 0x0100 /* RX Interrupt Active In Mailbox 24 */
4129#define MBRIF25 0x0200 /* RX Interrupt Active In Mailbox 25 */
4130#define MBRIF26 0x0400 /* RX Interrupt Active In Mailbox 26 */
4131#define MBRIF27 0x0800 /* RX Interrupt Active In Mailbox 27 */
4132#define MBRIF28 0x1000 /* RX Interrupt Active In Mailbox 28 */
4133#define MBRIF29 0x2000 /* RX Interrupt Active In Mailbox 29 */
4134#define MBRIF30 0x4000 /* RX Interrupt Active In Mailbox 30 */
4135#define MBRIF31 0x8000 /* RX Interrupt Active In Mailbox 31 */
4136
4137/* CAN_MBIM1 Masks */
4138#define MBIM0 0x0001 /* Enable Interrupt For Mailbox 0 */
4139#define MBIM1 0x0002 /* Enable Interrupt For Mailbox 1 */
4140#define MBIM2 0x0004 /* Enable Interrupt For Mailbox 2 */
4141#define MBIM3 0x0008 /* Enable Interrupt For Mailbox 3 */
4142#define MBIM4 0x0010 /* Enable Interrupt For Mailbox 4 */
4143#define MBIM5 0x0020 /* Enable Interrupt For Mailbox 5 */
4144#define MBIM6 0x0040 /* Enable Interrupt For Mailbox 6 */
4145#define MBIM7 0x0080 /* Enable Interrupt For Mailbox 7 */
4146#define MBIM8 0x0100 /* Enable Interrupt For Mailbox 8 */
4147#define MBIM9 0x0200 /* Enable Interrupt For Mailbox 9 */
4148#define MBIM10 0x0400 /* Enable Interrupt For Mailbox 10 */
4149#define MBIM11 0x0800 /* Enable Interrupt For Mailbox 11 */
4150#define MBIM12 0x1000 /* Enable Interrupt For Mailbox 12 */
4151#define MBIM13 0x2000 /* Enable Interrupt For Mailbox 13 */
4152#define MBIM14 0x4000 /* Enable Interrupt For Mailbox 14 */
4153#define MBIM15 0x8000 /* Enable Interrupt For Mailbox 15 */
4154
4155/* CAN_MBIM2 Masks */
4156#define MBIM16 0x0001 /* Enable Interrupt For Mailbox 16 */
4157#define MBIM17 0x0002 /* Enable Interrupt For Mailbox 17 */
4158#define MBIM18 0x0004 /* Enable Interrupt For Mailbox 18 */
4159#define MBIM19 0x0008 /* Enable Interrupt For Mailbox 19 */
4160#define MBIM20 0x0010 /* Enable Interrupt For Mailbox 20 */
4161#define MBIM21 0x0020 /* Enable Interrupt For Mailbox 21 */
4162#define MBIM22 0x0040 /* Enable Interrupt For Mailbox 22 */
4163#define MBIM23 0x0080 /* Enable Interrupt For Mailbox 23 */
4164#define MBIM24 0x0100 /* Enable Interrupt For Mailbox 24 */
4165#define MBIM25 0x0200 /* Enable Interrupt For Mailbox 25 */
4166#define MBIM26 0x0400 /* Enable Interrupt For Mailbox 26 */
4167#define MBIM27 0x0800 /* Enable Interrupt For Mailbox 27 */
4168#define MBIM28 0x1000 /* Enable Interrupt For Mailbox 28 */
4169#define MBIM29 0x2000 /* Enable Interrupt For Mailbox 29 */
4170#define MBIM30 0x4000 /* Enable Interrupt For Mailbox 30 */
4171#define MBIM31 0x8000 /* Enable Interrupt For Mailbox 31 */
4172
4173/* CAN_GIM Masks */
4174#define EWTIM 0x0001 /* Enable TX Error Count Interrupt */
4175#define EWRIM 0x0002 /* Enable RX Error Count Interrupt */
4176#define EPIM 0x0004 /* Enable Error-Passive Mode Interrupt */
4177#define BOIM 0x0008 /* Enable Bus Off Interrupt */
4178#define WUIM 0x0010 /* Enable Wake-Up Interrupt */
4179#define UIAIM 0x0020 /* Enable Access To Unimplemented Address Interrupt */
4180#define AAIM 0x0040 /* Enable Abort Acknowledge Interrupt */
4181#define RMLIM 0x0080 /* Enable RX Message Lost Interrupt */
4182#define UCEIM 0x0100 /* Enable Universal Counter Overflow Interrupt */
4183#define EXTIM 0x0200 /* Enable External Trigger Output Interrupt */
4184#define ADIM 0x0400 /* Enable Access Denied Interrupt */
4185
4186/* CAN_GIS Masks */
4187#define EWTIS 0x0001 /* TX Error Count IRQ Status */
4188#define EWRIS 0x0002 /* RX Error Count IRQ Status */
4189#define EPIS 0x0004 /* Error-Passive Mode IRQ Status */
4190#define BOIS 0x0008 /* Bus Off IRQ Status */
4191#define WUIS 0x0010 /* Wake-Up IRQ Status */
4192#define UIAIS 0x0020 /* Access To Unimplemented Address IRQ Status */
4193#define AAIS 0x0040 /* Abort Acknowledge IRQ Status */
4194#define RMLIS 0x0080 /* RX Message Lost IRQ Status */
4195#define UCEIS 0x0100 /* Universal Counter Overflow IRQ Status */
4196#define EXTIS 0x0200 /* External Trigger Output IRQ Status */
4197#define ADIS 0x0400 /* Access Denied IRQ Status */
4198
4199/* CAN_GIF Masks */
4200#define EWTIF 0x0001 /* TX Error Count IRQ Flag */
4201#define EWRIF 0x0002 /* RX Error Count IRQ Flag */
4202#define EPIF 0x0004 /* Error-Passive Mode IRQ Flag */
4203#define BOIF 0x0008 /* Bus Off IRQ Flag */
4204#define WUIF 0x0010 /* Wake-Up IRQ Flag */
4205#define UIAIF 0x0020 /* Access To Unimplemented Address IRQ Flag */
4206#define AAIF 0x0040 /* Abort Acknowledge IRQ Flag */
4207#define RMLIF 0x0080 /* RX Message Lost IRQ Flag */
4208#define UCEIF 0x0100 /* Universal Counter Overflow IRQ Flag */
4209#define EXTIF 0x0200 /* External Trigger Output IRQ Flag */
4210#define ADIF 0x0400 /* Access Denied IRQ Flag */
4211
4212/* CAN_UCCNF Masks */
4213#define UCCNF 0x000F /* Universal Counter Mode */
4214#define UC_STAMP 0x0001 /* Timestamp Mode */
4215#define UC_WDOG 0x0002 /* Watchdog Mode */
4216#define UC_AUTOTX 0x0003 /* Auto-Transmit Mode */
4217#define UC_ERROR 0x0006 /* CAN Error Frame Count */
4218#define UC_OVER 0x0007 /* CAN Overload Frame Count */
4219#define UC_LOST 0x0008 /* Arbitration Lost During TX Count */
4220#define UC_AA 0x0009 /* TX Abort Count */
4221#define UC_TA 0x000A /* TX Successful Count */
4222#define UC_REJECT 0x000B /* RX Message Rejected Count */
4223#define UC_RML 0x000C /* RX Message Lost Count */
4224#define UC_RX 0x000D /* Total Successful RX Messages Count */
4225#define UC_RMP 0x000E /* Successful RX W/Matching ID Count */
4226#define UC_ALL 0x000F /* Correct Message On CAN Bus Line Count */
4227#define UCRC 0x0020 /* Universal Counter Reload/Clear */
4228#define UCCT 0x0040 /* Universal Counter CAN Trigger */
4229#define UCE 0x0080 /* Universal Counter Enable */
4230
4231/* CAN_ESR Masks */
4232#define ACKE 0x0004 /* Acknowledge Error */
4233#define SER 0x0008 /* Stuff Error */
4234#define CRCE 0x0010 /* CRC Error */
4235#define SA0 0x0020 /* Stuck At Dominant Error */
4236#define BEF 0x0040 /* Bit Error Flag */
4237#define FER 0x0080 /* Form Error Flag */
4238
4239/* CAN_EWR Masks */
4240#define EWLREC 0x00FF /* RX Error Count Limit (For EWRIS) */
4241#define EWLTEC 0xFF00 /* TX Error Count Limit (For EWTIS) */
4242
4243#endif /* _DEF_BF539_H */
diff --git a/arch/blackfin/mach-bf538/include/mach/dma.h b/arch/blackfin/mach-bf538/include/mach/dma.h
new file mode 100644
index 000000000000..eb05cacbf4d3
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/dma.h
@@ -0,0 +1,41 @@
1/* mach/dma.h - arch-specific DMA defines
2 *
3 * Copyright 2004-2008 Analog Devices Inc.
4 *
5 * Licensed under the GPL-2 or later.
6 */
7
8#ifndef _MACH_DMA_H_
9#define _MACH_DMA_H_
10
11#define CH_PPI 0
12#define CH_SPORT0_RX 1
13#define CH_SPORT0_TX 2
14#define CH_SPORT1_RX 3
15#define CH_SPORT1_TX 4
16#define CH_SPI0 5
17#define CH_UART0_RX 6
18#define CH_UART0_TX 7
19#define CH_SPORT2_RX 8
20#define CH_SPORT2_TX 9
21#define CH_SPORT3_RX 10
22#define CH_SPORT3_TX 11
23#define CH_SPI1 14
24#define CH_SPI2 15
25#define CH_UART1_RX 16
26#define CH_UART1_TX 17
27#define CH_UART2_RX 18
28#define CH_UART2_TX 19
29
30#define CH_MEM_STREAM0_DEST 20
31#define CH_MEM_STREAM0_SRC 21
32#define CH_MEM_STREAM1_DEST 22
33#define CH_MEM_STREAM1_SRC 23
34#define CH_MEM_STREAM2_DEST 24
35#define CH_MEM_STREAM2_SRC 25
36#define CH_MEM_STREAM3_DEST 26
37#define CH_MEM_STREAM3_SRC 27
38
39#define MAX_DMA_CHANNELS 28
40
41#endif
diff --git a/arch/blackfin/mach-bf538/include/mach/gpio.h b/arch/blackfin/mach-bf538/include/mach/gpio.h
new file mode 100644
index 000000000000..30f4f723f7cc
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/gpio.h
@@ -0,0 +1,79 @@
1/*
2 * File: arch/blackfin/mach-bf538/include/mach/gpio.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9
10#ifndef _MACH_GPIO_H_
11#define _MACH_GPIO_H_
12
13 /* FIXME:
14 * For now only support PORTF GPIOs.
15 * PORT C,D and E are for peripheral usage only
16 */
17#define MAX_BLACKFIN_GPIOS 16
18
19#define GPIO_PF0 0 /* PF */
20#define GPIO_PF1 1
21#define GPIO_PF2 2
22#define GPIO_PF3 3
23#define GPIO_PF4 4
24#define GPIO_PF5 5
25#define GPIO_PF6 6
26#define GPIO_PF7 7
27#define GPIO_PF8 8
28#define GPIO_PF9 9
29#define GPIO_PF10 10
30#define GPIO_PF11 11
31#define GPIO_PF12 12
32#define GPIO_PF13 13
33#define GPIO_PF14 14
34#define GPIO_PF15 15
35#define GPIO_PC0 16 /* PC */
36#define GPIO_PC1 17
37#define GPIO_PC4 20
38#define GPIO_PC5 21
39#define GPIO_PC6 22
40#define GPIO_PC7 23
41#define GPIO_PC8 24
42#define GPIO_PC9 25
43#define GPIO_PD0 32 /* PD */
44#define GPIO_PD1 33
45#define GPIO_PD2 34
46#define GPIO_PD3 35
47#define GPIO_PD4 36
48#define GPIO_PD5 37
49#define GPIO_PD6 38
50#define GPIO_PD7 39
51#define GPIO_PD8 40
52#define GPIO_PD9 41
53#define GPIO_PD10 42
54#define GPIO_PD11 43
55#define GPIO_PD12 44
56#define GPIO_PD13 45
57#define GPIO_PE0 48 /* PE */
58#define GPIO_PE1 49
59#define GPIO_PE2 50
60#define GPIO_PE3 51
61#define GPIO_PE4 52
62#define GPIO_PE5 53
63#define GPIO_PE6 54
64#define GPIO_PE7 55
65#define GPIO_PE8 56
66#define GPIO_PE9 57
67#define GPIO_PE10 58
68#define GPIO_PE11 59
69#define GPIO_PE12 60
70#define GPIO_PE13 61
71#define GPIO_PE14 62
72#define GPIO_PE15 63
73
74#define PORT_F GPIO_PF0
75#define PORT_C GPIO_PC0
76#define PORT_D GPIO_PD0
77#define PORT_E GPIO_PE0
78
79#endif /* _MACH_GPIO_H_ */
diff --git a/arch/blackfin/mach-bf538/include/mach/irq.h b/arch/blackfin/mach-bf538/include/mach/irq.h
new file mode 100644
index 000000000000..fdc87fe2c174
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/irq.h
@@ -0,0 +1,211 @@
1/*
2 * file: include/asm-blackfin/mach-bf538/irq.h
3 * based on: include/asm-blackfin/mach-bf537/irq.h
4 * author: Michael Hennerich (michael.hennerich@analog.com)
5 *
6 * created:
7 * description:
8 * system mmr register map
9 * rev:
10 *
11 * modified:
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * this program is distributed in the hope that it will be useful,
22 * but without any warranty; without even the implied warranty of
23 * merchantability or fitness for a particular purpose. see the
24 * gnu general public license for more details.
25 *
26 * you should have received a copy of the gnu general public license
27 * along with this program; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */
31
32#ifndef _BF538_IRQ_H_
33#define _BF538_IRQ_H_
34
35/*
36 * Interrupt source definitions
37 Event Source Core Event Name
38 Core Emulation **
39 Events (highest priority) EMU 0
40 Reset RST 1
41 NMI NMI 2
42 Exception EVX 3
43 Reserved -- 4
44 Hardware Error IVHW 5
45 Core Timer IVTMR 6 *
46
47 .....
48
49 Software Interrupt 1 IVG14 31
50 Software Interrupt 2 --
51 (lowest priority) IVG15 32 *
52*/
53
54#define NR_PERI_INTS (2 * 32)
55
56/* The ABSTRACT IRQ definitions */
57/** the first seven of the following are fixed, the rest you change if you need to **/
58#define IRQ_EMU 0 /* Emulation */
59#define IRQ_RST 1 /* reset */
60#define IRQ_NMI 2 /* Non Maskable */
61#define IRQ_EVX 3 /* Exception */
62#define IRQ_UNUSED 4 /* - unused interrupt */
63#define IRQ_HWERR 5 /* Hardware Error */
64#define IRQ_CORETMR 6 /* Core timer */
65
66#define BFIN_IRQ(x) ((x) + 7)
67
68#define IRQ_PLL_WAKEUP BFIN_IRQ(0) /* PLL Wakeup Interrupt */
69#define IRQ_DMA0_ERROR BFIN_IRQ(1) /* DMA Error 0 (generic) */
70#define IRQ_PPI_ERROR BFIN_IRQ(2) /* PPI Error */
71#define IRQ_SPORT0_ERROR BFIN_IRQ(3) /* SPORT0 Status */
72#define IRQ_SPORT1_ERROR BFIN_IRQ(4) /* SPORT1 Status */
73#define IRQ_SPI0_ERROR BFIN_IRQ(5) /* SPI0 Status */
74#define IRQ_UART0_ERROR BFIN_IRQ(6) /* UART0 Status */
75#define IRQ_RTC BFIN_IRQ(7) /* RTC */
76#define IRQ_PPI BFIN_IRQ(8) /* DMA Channel 0 (PPI) */
77#define IRQ_SPORT0_RX BFIN_IRQ(9) /* DMA 1 Channel (SPORT0 RX) */
78#define IRQ_SPORT0_TX BFIN_IRQ(10) /* DMA 2 Channel (SPORT0 TX) */
79#define IRQ_SPORT1_RX BFIN_IRQ(11) /* DMA 3 Channel (SPORT1 RX) */
80#define IRQ_SPORT1_TX BFIN_IRQ(12) /* DMA 4 Channel (SPORT1 TX) */
81#define IRQ_SPI0 BFIN_IRQ(13) /* DMA 5 Channel (SPI0) */
82#define IRQ_UART0_RX BFIN_IRQ(14) /* DMA 6 Channel (UART0 RX) */
83#define IRQ_UART0_TX BFIN_IRQ(15) /* DMA 7 Channel (UART0 TX) */
84#define IRQ_TIMER0 BFIN_IRQ(16) /* Timer 0 */
85#define IRQ_TIMER1 BFIN_IRQ(17) /* Timer 1 */
86#define IRQ_TIMER2 BFIN_IRQ(18) /* Timer 2 */
87#define IRQ_PORTF_INTA BFIN_IRQ(19) /* Port F Interrupt A */
88#define IRQ_PORTF_INTB BFIN_IRQ(20) /* Port F Interrupt B */
89#define IRQ_MEM0_DMA0 BFIN_IRQ(21) /* MDMA0 Stream 0 */
90#define IRQ_MEM0_DMA1 BFIN_IRQ(22) /* MDMA0 Stream 1 */
91#define IRQ_WATCH BFIN_IRQ(23) /* Software Watchdog Timer */
92#define IRQ_DMA1_ERROR BFIN_IRQ(24) /* DMA Error 1 (generic) */
93#define IRQ_SPORT2_ERROR BFIN_IRQ(25) /* SPORT2 Status */
94#define IRQ_SPORT3_ERROR BFIN_IRQ(26) /* SPORT3 Status */
95#define IRQ_SPI1_ERROR BFIN_IRQ(28) /* SPI1 Status */
96#define IRQ_SPI2_ERROR BFIN_IRQ(29) /* SPI2 Status */
97#define IRQ_UART1_ERROR BFIN_IRQ(30) /* UART1 Status */
98#define IRQ_UART2_ERROR BFIN_IRQ(31) /* UART2 Status */
99#define IRQ_CAN_ERROR BFIN_IRQ(32) /* CAN Status (Error) Interrupt */
100#define IRQ_SPORT2_RX BFIN_IRQ(33) /* DMA 8 Channel (SPORT2 RX) */
101#define IRQ_SPORT2_TX BFIN_IRQ(34) /* DMA 9 Channel (SPORT2 TX) */
102#define IRQ_SPORT3_RX BFIN_IRQ(35) /* DMA 10 Channel (SPORT3 RX) */
103#define IRQ_SPORT3_TX BFIN_IRQ(36) /* DMA 11 Channel (SPORT3 TX) */
104#define IRQ_SPI1 BFIN_IRQ(39) /* DMA 14 Channel (SPI1) */
105#define IRQ_SPI2 BFIN_IRQ(40) /* DMA 15 Channel (SPI2) */
106#define IRQ_UART1_RX BFIN_IRQ(41) /* DMA 16 Channel (UART1 RX) */
107#define IRQ_UART1_TX BFIN_IRQ(42) /* DMA 17 Channel (UART1 TX) */
108#define IRQ_UART2_RX BFIN_IRQ(43) /* DMA 18 Channel (UART2 RX) */
109#define IRQ_UART2_TX BFIN_IRQ(44) /* DMA 19 Channel (UART2 TX) */
110#define IRQ_TWI0 BFIN_IRQ(45) /* TWI0 */
111#define IRQ_TWI1 BFIN_IRQ(46) /* TWI1 */
112#define IRQ_CAN_RX BFIN_IRQ(47) /* CAN Receive Interrupt */
113#define IRQ_CAN_TX BFIN_IRQ(48) /* CAN Transmit Interrupt */
114#define IRQ_MEM1_DMA0 BFIN_IRQ(49) /* MDMA1 Stream 0 */
115#define IRQ_MEM1_DMA1 BFIN_IRQ(50) /* MDMA1 Stream 1 */
116
117#define SYS_IRQS BFIN_IRQ(63) /* 70 */
118
119#define IRQ_PF0 71
120#define IRQ_PF1 72
121#define IRQ_PF2 73
122#define IRQ_PF3 74
123#define IRQ_PF4 75
124#define IRQ_PF5 76
125#define IRQ_PF6 77
126#define IRQ_PF7 78
127#define IRQ_PF8 79
128#define IRQ_PF9 80
129#define IRQ_PF10 81
130#define IRQ_PF11 82
131#define IRQ_PF12 83
132#define IRQ_PF13 84
133#define IRQ_PF14 85
134#define IRQ_PF15 86
135
136#define GPIO_IRQ_BASE IRQ_PF0
137
138#define NR_IRQS (IRQ_PF15+1)
139
140#define IVG7 7
141#define IVG8 8
142#define IVG9 9
143#define IVG10 10
144#define IVG11 11
145#define IVG12 12
146#define IVG13 13
147#define IVG14 14
148#define IVG15 15
149
150/* IAR0 BIT FIELDS */
151#define IRQ_PLL_WAKEUP_POS 0
152#define IRQ_DMA0_ERROR_POS 4
153#define IRQ_PPI_ERROR_POS 8
154#define IRQ_SPORT0_ERROR_POS 12
155#define IRQ_SPORT1_ERROR_POS 16
156#define IRQ_SPI0_ERROR_POS 20
157#define IRQ_UART0_ERROR_POS 24
158#define IRQ_RTC_POS 28
159
160/* IAR1 BIT FIELDS */
161#define IRQ_PPI_POS 0
162#define IRQ_SPORT0_RX_POS 4
163#define IRQ_SPORT0_TX_POS 8
164#define IRQ_SPORT1_RX_POS 12
165#define IRQ_SPORT1_TX_POS 16
166#define IRQ_SPI0_POS 20
167#define IRQ_UART0_RX_POS 24
168#define IRQ_UART0_TX_POS 28
169
170/* IAR2 BIT FIELDS */
171#define IRQ_TIMER0_POS 0
172#define IRQ_TIMER1_POS 4
173#define IRQ_TIMER2_POS 8
174#define IRQ_PORTF_INTA_POS 12
175#define IRQ_PORTF_INTB_POS 16
176#define IRQ_MEM0_DMA0_POS 20
177#define IRQ_MEM0_DMA1_POS 24
178#define IRQ_WATCH_POS 28
179
180/* IAR3 BIT FIELDS */
181#define IRQ_DMA1_ERROR_POS 0
182#define IRQ_SPORT2_ERROR_POS 4
183#define IRQ_SPORT3_ERROR_POS 8
184#define IRQ_SPI1_ERROR_POS 16
185#define IRQ_SPI2_ERROR_POS 20
186#define IRQ_UART1_ERROR_POS 24
187#define IRQ_UART2_ERROR_POS 28
188
189/* IAR4 BIT FIELDS */
190#define IRQ_CAN_ERROR_POS 0
191#define IRQ_SPORT2_RX_POS 4
192#define IRQ_SPORT2_TX_POS 8
193#define IRQ_SPORT3_RX_POS 12
194#define IRQ_SPORT3_TX_POS 16
195#define IRQ_SPI1_POS 28
196
197/* IAR5 BIT FIELDS */
198#define IRQ_SPI2_POS 0
199#define IRQ_UART1_RX_POS 4
200#define IRQ_UART1_TX_POS 8
201#define IRQ_UART2_RX_POS 12
202#define IRQ_UART2_TX_POS 16
203#define IRQ_TWI0_POS 20
204#define IRQ_TWI1_POS 24
205#define IRQ_CAN_RX_POS 28
206
207/* IAR6 BIT FIELDS */
208#define IRQ_CAN_TX_POS 0
209#define IRQ_MEM1_DMA0_POS 4
210#define IRQ_MEM1_DMA1_POS 8
211#endif /* _BF538_IRQ_H_ */
diff --git a/arch/blackfin/mach-bf538/include/mach/mem_map.h b/arch/blackfin/mach-bf538/include/mach/mem_map.h
new file mode 100644
index 000000000000..76811966690e
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/mem_map.h
@@ -0,0 +1,113 @@
1/*
2 * File: include/asm-blackfin/mach-bf538/mem_map.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#ifndef _MEM_MAP_538_H_
32#define _MEM_MAP_538_H_
33
34#define COREMMR_BASE 0xFFE00000 /* Core MMRs */
35#define SYSMMR_BASE 0xFFC00000 /* System MMRs */
36
37/* Async Memory Banks */
38#define ASYNC_BANK3_BASE 0x20300000 /* Async Bank 3 */
39#define ASYNC_BANK3_SIZE 0x00100000 /* 1M */
40#define ASYNC_BANK2_BASE 0x20200000 /* Async Bank 2 */
41#define ASYNC_BANK2_SIZE 0x00100000 /* 1M */
42#define ASYNC_BANK1_BASE 0x20100000 /* Async Bank 1 */
43#define ASYNC_BANK1_SIZE 0x00100000 /* 1M */
44#define ASYNC_BANK0_BASE 0x20000000 /* Async Bank 0 */
45#define ASYNC_BANK0_SIZE 0x00100000 /* 1M */
46
47/* Boot ROM Memory */
48
49#define BOOT_ROM_START 0xEF000000
50#define BOOT_ROM_LENGTH 0x400
51
52/* Level 1 Memory */
53
54#ifdef CONFIG_BFIN_ICACHE
55#define BFIN_ICACHESIZE (16*1024)
56#else
57#define BFIN_ICACHESIZE (0*1024)
58#endif
59
60/* Memory Map for ADSP-BF538/9 processors */
61
62#define L1_CODE_START 0xFFA00000
63#define L1_DATA_A_START 0xFF800000
64#define L1_DATA_B_START 0xFF900000
65
66#ifdef CONFIG_BFIN_ICACHE
67#define L1_CODE_LENGTH (0x14000 - 0x4000)
68#else
69#define L1_CODE_LENGTH 0x14000
70#endif
71
72#ifdef CONFIG_BFIN_DCACHE
73
74#ifdef CONFIG_BFIN_DCACHE_BANKA
75#define DMEM_CNTR (ACACHE_BSRAM | ENDCPLB | PORT_PREF0)
76#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
77#define L1_DATA_B_LENGTH 0x8000
78#define BFIN_DCACHESIZE (16*1024)
79#define BFIN_DSUPBANKS 1
80#else
81#define DMEM_CNTR (ACACHE_BCACHE | ENDCPLB | PORT_PREF0)
82#define L1_DATA_A_LENGTH (0x8000 - 0x4000)
83#define L1_DATA_B_LENGTH (0x8000 - 0x4000)
84#define BFIN_DCACHESIZE (32*1024)
85#define BFIN_DSUPBANKS 2
86#endif
87
88#else
89#define DMEM_CNTR (ASRAM_BSRAM | ENDCPLB | PORT_PREF0)
90#define L1_DATA_A_LENGTH 0x8000
91#define L1_DATA_B_LENGTH 0x8000
92#define BFIN_DCACHESIZE (0*1024)
93#define BFIN_DSUPBANKS 0
94#endif /*CONFIG_BFIN_DCACHE*/
95
96
97/* Level 2 Memory - none */
98
99#define L2_START 0
100#define L2_LENGTH 0
101
102/* Scratch Pad Memory */
103
104#define L1_SCRATCH_START 0xFFB00000
105#define L1_SCRATCH_LENGTH 0x1000
106
107#define GET_PDA_SAFE(preg) \
108 preg.l = _cpu_pda; \
109 preg.h = _cpu_pda;
110
111#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
112
113#endif /* _MEM_MAP_538_H_ */
diff --git a/arch/blackfin/mach-bf538/include/mach/portmux.h b/arch/blackfin/mach-bf538/include/mach/portmux.h
new file mode 100644
index 000000000000..1e031b588b47
--- /dev/null
+++ b/arch/blackfin/mach-bf538/include/mach/portmux.h
@@ -0,0 +1,106 @@
1#ifndef _MACH_PORTMUX_H_
2#define _MACH_PORTMUX_H_
3
4#define MAX_RESOURCES MAX_BLACKFIN_GPIOS
5
6#define P_TMR2 (P_DONTCARE)
7#define P_TMR1 (P_DONTCARE)
8#define P_TMR0 (P_DONTCARE)
9#define P_TMRCLK (P_DONTCARE)
10#define P_PPI0_CLK (P_DONTCARE)
11#define P_PPI0_FS1 (P_DONTCARE)
12#define P_PPI0_FS2 (P_DONTCARE)
13
14#define P_TWI0_SCL (P_DONTCARE)
15#define P_TWI0_SDA (P_DONTCARE)
16#define P_TWI1_SCL (P_DONTCARE)
17#define P_TWI1_SDA (P_DONTCARE)
18
19#define P_SPORT1_TSCLK (P_DONTCARE)
20#define P_SPORT1_RSCLK (P_DONTCARE)
21#define P_SPORT0_TSCLK (P_DONTCARE)
22#define P_SPORT0_RSCLK (P_DONTCARE)
23#define P_SPORT1_DRSEC (P_DONTCARE)
24#define P_SPORT1_RFS (P_DONTCARE)
25#define P_SPORT1_DTPRI (P_DONTCARE)
26#define P_SPORT1_DTSEC (P_DONTCARE)
27#define P_SPORT1_TFS (P_DONTCARE)
28#define P_SPORT1_DRPRI (P_DONTCARE)
29#define P_SPORT0_DRSEC (P_DONTCARE)
30#define P_SPORT0_RFS (P_DONTCARE)
31#define P_SPORT0_DTPRI (P_DONTCARE)
32#define P_SPORT0_DTSEC (P_DONTCARE)
33#define P_SPORT0_TFS (P_DONTCARE)
34#define P_SPORT0_DRPRI (P_DONTCARE)
35
36#define P_UART0_RX (P_DONTCARE)
37#define P_UART0_TX (P_DONTCARE)
38
39#define P_SPI0_MOSI (P_DONTCARE)
40#define P_SPI0_MISO (P_DONTCARE)
41#define P_SPI0_SCK (P_DONTCARE)
42
43#define P_PPI0_D0 (P_DONTCARE)
44#define P_PPI0_D1 (P_DONTCARE)
45#define P_PPI0_D2 (P_DONTCARE)
46#define P_PPI0_D3 (P_DONTCARE)
47
48#define P_CAN0_TX (P_DEFINED | P_IDENT(GPIO_PC0))
49#define P_CAN0_RX (P_DEFINED | P_IDENT(GPIO_PC1))
50
51#define P_SPI1_MOSI (P_DEFINED | P_IDENT(GPIO_PD0))
52#define P_SPI1_MISO (P_DEFINED | P_IDENT(GPIO_PD1))
53#define P_SPI1_SCK (P_DEFINED | P_IDENT(GPIO_PD2))
54#define P_SPI1_SS (P_DEFINED | P_IDENT(GPIO_PD3))
55#define P_SPI1_SSEL1 (P_DEFINED | P_IDENT(GPIO_PD4))
56#define P_SPI2_MOSI (P_DEFINED | P_IDENT(GPIO_PD5))
57#define P_SPI2_MISO (P_DEFINED | P_IDENT(GPIO_PD6))
58#define P_SPI2_SCK (P_DEFINED | P_IDENT(GPIO_PD7))
59#define P_SPI2_SS (P_DEFINED | P_IDENT(GPIO_PD8))
60#define P_SPI2_SSEL1 (P_DEFINED | P_IDENT(GPIO_PD9))
61#define P_UART1_RX (P_DEFINED | P_IDENT(GPIO_PD10))
62#define P_UART1_TX (P_DEFINED | P_IDENT(GPIO_PD11))
63#define P_UART2_RX (P_DEFINED | P_IDENT(GPIO_PD12))
64#define P_UART2_TX (P_DEFINED | P_IDENT(GPIO_PD13))
65
66#define P_SPORT2_RSCLK (P_DEFINED | P_IDENT(GPIO_PE0))
67#define P_SPORT2_RFS (P_DEFINED | P_IDENT(GPIO_PE1))
68#define P_SPORT2_DRPRI (P_DEFINED | P_IDENT(GPIO_PE2))
69#define P_SPORT2_DRSEC (P_DEFINED | P_IDENT(GPIO_PE3))
70#define P_SPORT2_TSCLK (P_DEFINED | P_IDENT(GPIO_PE4))
71#define P_SPORT2_TFS (P_DEFINED | P_IDENT(GPIO_PE5))
72#define P_SPORT2_DTPRI (P_DEFINED | P_IDENT(GPIO_PE6))
73#define P_SPORT2_DTSEC (P_DEFINED | P_IDENT(GPIO_PE7))
74#define P_SPORT3_RSCLK (P_DEFINED | P_IDENT(GPIO_PE8))
75#define P_SPORT3_RFS (P_DEFINED | P_IDENT(GPIO_PE9))
76#define P_SPORT3_DRPRI (P_DEFINED | P_IDENT(GPIO_PE10))
77#define P_SPORT3_DRSEC (P_DEFINED | P_IDENT(GPIO_PE11))
78#define P_SPORT3_TSCLK (P_DEFINED | P_IDENT(GPIO_PE12))
79#define P_SPORT3_TFS (P_DEFINED | P_IDENT(GPIO_PE13))
80#define P_SPORT3_DTPRI (P_DEFINED | P_IDENT(GPIO_PE14))
81#define P_SPORT3_DTSEC (P_DEFINED | P_IDENT(GPIO_PE15))
82
83#define P_PPI0_FS3 (P_DEFINED | P_IDENT(GPIO_PF3))
84#define P_PPI0_D15 (P_DEFINED | P_IDENT(GPIO_PF4))
85#define P_PPI0_D14 (P_DEFINED | P_IDENT(GPIO_PF5))
86#define P_PPI0_D13 (P_DEFINED | P_IDENT(GPIO_PF6))
87#define P_PPI0_D12 (P_DEFINED | P_IDENT(GPIO_PF7))
88#define P_PPI0_D11 (P_DEFINED | P_IDENT(GPIO_PF8))
89#define P_PPI0_D10 (P_DEFINED | P_IDENT(GPIO_PF9))
90#define P_PPI0_D9 (P_DEFINED | P_IDENT(GPIO_PF10))
91#define P_PPI0_D8 (P_DEFINED | P_IDENT(GPIO_PF11))
92
93#define P_PPI0_D4 (P_DEFINED | P_IDENT(GPIO_PF15))
94#define P_PPI0_D5 (P_DEFINED | P_IDENT(GPIO_PF14))
95#define P_PPI0_D6 (P_DEFINED | P_IDENT(GPIO_PF13))
96#define P_PPI0_D7 (P_DEFINED | P_IDENT(GPIO_PF12))
97#define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(GPIO_PF7))
98#define P_SPI0_SSEL6 (P_DEFINED | P_IDENT(GPIO_PF6))
99#define P_SPI0_SSEL5 (P_DEFINED | P_IDENT(GPIO_PF5))
100#define P_SPI0_SSEL4 (P_DEFINED | P_IDENT(GPIO_PF4))
101#define P_SPI0_SSEL3 (P_DEFINED | P_IDENT(GPIO_PF3))
102#define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(GPIO_PF2))
103#define P_SPI0_SSEL1 (P_DEFINED | P_IDENT(GPIO_PF1))
104#define P_SPI0_SS (P_DEFINED | P_IDENT(GPIO_PF0))
105
106#endif /* _MACH_PORTMUX_H_ */
diff --git a/arch/blackfin/mach-bf538/ints-priority.c b/arch/blackfin/mach-bf538/ints-priority.c
new file mode 100644
index 000000000000..70d17e550e05
--- /dev/null
+++ b/arch/blackfin/mach-bf538/ints-priority.c
@@ -0,0 +1,94 @@
1/*
2 * File: arch/blackfin/mach-bf538/ints-priority.c
3 * Based on: arch/blackfin/mach-bf533/ints-priority.c
4 * Author: Michael Hennerich
5 *
6 * Created:
7 * Description: Set up the interrupt priorities
8 *
9 * Modified:
10 * Copyright 2008 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/module.h>
31#include <linux/irq.h>
32#include <asm/blackfin.h>
33
34void __init program_IAR(void)
35{
36
37 /* Program the IAR0 Register with the configured priority */
38 bfin_write_SIC_IAR0(((CONFIG_IRQ_PLL_WAKEUP - 7) << IRQ_PLL_WAKEUP_POS) |
39 ((CONFIG_IRQ_DMA0_ERROR - 7) << IRQ_DMA0_ERROR_POS) |
40 ((CONFIG_IRQ_PPI_ERROR - 7) << IRQ_PPI_ERROR_POS) |
41 ((CONFIG_IRQ_SPORT0_ERROR - 7) << IRQ_SPORT0_ERROR_POS) |
42 ((CONFIG_IRQ_SPORT1_ERROR - 7) << IRQ_SPORT1_ERROR_POS) |
43 ((CONFIG_IRQ_SPI0_ERROR - 7) << IRQ_SPI0_ERROR_POS) |
44 ((CONFIG_IRQ_UART0_ERROR - 7) << IRQ_UART0_ERROR_POS) |
45 ((CONFIG_IRQ_RTC - 7) << IRQ_RTC_POS));
46
47 bfin_write_SIC_IAR1(((CONFIG_IRQ_PPI - 7) << IRQ_PPI_POS) |
48 ((CONFIG_IRQ_SPORT0_RX - 7) << IRQ_SPORT0_RX_POS) |
49 ((CONFIG_IRQ_SPORT0_TX - 7) << IRQ_SPORT0_TX_POS) |
50 ((CONFIG_IRQ_SPORT1_RX - 7) << IRQ_SPORT1_RX_POS) |
51 ((CONFIG_IRQ_SPORT1_TX - 7) << IRQ_SPORT1_TX_POS) |
52 ((CONFIG_IRQ_SPI0 - 7) << IRQ_SPI0_POS) |
53 ((CONFIG_IRQ_UART0_RX - 7) << IRQ_UART0_RX_POS) |
54 ((CONFIG_IRQ_UART0_TX - 7) << IRQ_UART0_TX_POS));
55
56 bfin_write_SIC_IAR2(((CONFIG_IRQ_TIMER0 - 7) << IRQ_TIMER0_POS) |
57 ((CONFIG_IRQ_TIMER1 - 7) << IRQ_TIMER1_POS) |
58 ((CONFIG_IRQ_TIMER2 - 7) << IRQ_TIMER2_POS) |
59 ((CONFIG_IRQ_PORTF_INTA - 7) << IRQ_PORTF_INTA_POS) |
60 ((CONFIG_IRQ_PORTF_INTB - 7) << IRQ_PORTF_INTB_POS) |
61 ((CONFIG_IRQ_MEM0_DMA0 - 7) << IRQ_MEM0_DMA0_POS) |
62 ((CONFIG_IRQ_MEM0_DMA1 - 7) << IRQ_MEM0_DMA1_POS) |
63 ((CONFIG_IRQ_WATCH - 7) << IRQ_WATCH_POS));
64
65 bfin_write_SIC_IAR3(((CONFIG_IRQ_DMA1_ERROR - 7) << IRQ_DMA1_ERROR_POS) |
66 ((CONFIG_IRQ_SPORT2_ERROR - 7) << IRQ_SPORT2_ERROR_POS) |
67 ((CONFIG_IRQ_SPORT3_ERROR - 7) << IRQ_SPORT3_ERROR_POS) |
68 ((CONFIG_IRQ_SPI1_ERROR - 7) << IRQ_SPI1_ERROR_POS) |
69 ((CONFIG_IRQ_SPI2_ERROR - 7) << IRQ_SPI2_ERROR_POS) |
70 ((CONFIG_IRQ_UART1_ERROR - 7) << IRQ_UART1_ERROR_POS) |
71 ((CONFIG_IRQ_UART2_ERROR - 7) << IRQ_UART2_ERROR_POS));
72
73 bfin_write_SIC_IAR4(((CONFIG_IRQ_CAN_ERROR - 7) << IRQ_CAN_ERROR_POS) |
74 ((CONFIG_IRQ_SPORT2_RX - 7) << IRQ_SPORT2_RX_POS) |
75 ((CONFIG_IRQ_SPORT2_TX - 7) << IRQ_SPORT2_TX_POS) |
76 ((CONFIG_IRQ_SPORT3_RX - 7) << IRQ_SPORT3_RX_POS) |
77 ((CONFIG_IRQ_SPORT3_TX - 7) << IRQ_SPORT3_TX_POS) |
78 ((CONFIG_IRQ_SPI1 - 7) << IRQ_SPI1_POS));
79
80 bfin_write_SIC_IAR5(((CONFIG_IRQ_SPI2 - 7) << IRQ_SPI2_POS) |
81 ((CONFIG_IRQ_UART1_RX - 7) << IRQ_UART1_RX_POS) |
82 ((CONFIG_IRQ_UART1_TX - 7) << IRQ_UART1_TX_POS) |
83 ((CONFIG_IRQ_UART2_RX - 7) << IRQ_UART2_RX_POS) |
84 ((CONFIG_IRQ_UART2_TX - 7) << IRQ_UART2_TX_POS) |
85 ((CONFIG_IRQ_TWI0 - 7) << IRQ_TWI0_POS) |
86 ((CONFIG_IRQ_TWI1 - 7) << IRQ_TWI1_POS) |
87 ((CONFIG_IRQ_CAN_RX - 7) << IRQ_CAN_RX_POS));
88
89 bfin_write_SIC_IAR6(((CONFIG_IRQ_CAN_TX - 7) << IRQ_CAN_TX_POS) |
90 ((CONFIG_IRQ_MEM1_DMA0 - 7) << IRQ_MEM1_DMA0_POS) |
91 ((CONFIG_IRQ_MEM1_DMA1 - 7) << IRQ_MEM1_DMA1_POS));
92
93 SSYNC();
94}
diff --git a/arch/blackfin/mach-bf548/Kconfig b/arch/blackfin/mach-bf548/Kconfig
index 1bfcd8f646ab..dcf657159051 100644
--- a/arch/blackfin/mach-bf548/Kconfig
+++ b/arch/blackfin/mach-bf548/Kconfig
@@ -250,7 +250,7 @@ config IRQ_OTPSEC
250 default 11 250 default 11
251config IRQ_TIMER0 251config IRQ_TIMER0
252 int "IRQ_TIMER0" 252 int "IRQ_TIMER0"
253 default 11 253 default 8
254config IRQ_TIMER1 254config IRQ_TIMER1
255 int "IRQ_TIMER1" 255 int "IRQ_TIMER1"
256 default 11 256 default 11
diff --git a/arch/blackfin/mach-bf548/Makefile b/arch/blackfin/mach-bf548/Makefile
index 68e5478e95a9..56994b675f9c 100644
--- a/arch/blackfin/mach-bf548/Makefile
+++ b/arch/blackfin/mach-bf548/Makefile
@@ -2,6 +2,4 @@
2# arch/blackfin/mach-bf537/Makefile 2# arch/blackfin/mach-bf537/Makefile
3# 3#
4 4
5extra-y := head.o
6
7obj-y := ints-priority.o dma.o 5obj-y := ints-priority.o dma.o
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index 24192aaa9275..f53ad682530b 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -32,6 +32,7 @@
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/mtd/mtd.h> 33#include <linux/mtd/mtd.h>
34#include <linux/mtd/partitions.h> 34#include <linux/mtd/partitions.h>
35#include <linux/mtd/physmap.h>
35#include <linux/spi/spi.h> 36#include <linux/spi/spi.h>
36#include <linux/spi/flash.h> 37#include <linux/spi/flash.h>
37#include <linux/irq.h> 38#include <linux/irq.h>
@@ -42,6 +43,7 @@
42#include <asm/gpio.h> 43#include <asm/gpio.h>
43#include <asm/nand.h> 44#include <asm/nand.h>
44#include <asm/portmux.h> 45#include <asm/portmux.h>
46#include <asm/bfin_sdh.h>
45#include <mach/bf54x_keys.h> 47#include <mach/bf54x_keys.h>
46#include <asm/dpmc.h> 48#include <asm/dpmc.h>
47#include <linux/input.h> 49#include <linux/input.h>
@@ -186,44 +188,107 @@ static struct platform_device bfin_uart_device = {
186#endif 188#endif
187 189
188#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 190#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
189static struct resource bfin_sir_resources[] = {
190#ifdef CONFIG_BFIN_SIR0 191#ifdef CONFIG_BFIN_SIR0
192static struct resource bfin_sir0_resources[] = {
191 { 193 {
192 .start = 0xFFC00400, 194 .start = 0xFFC00400,
193 .end = 0xFFC004FF, 195 .end = 0xFFC004FF,
194 .flags = IORESOURCE_MEM, 196 .flags = IORESOURCE_MEM,
195 }, 197 },
198 {
199 .start = IRQ_UART0_RX,
200 .end = IRQ_UART0_RX+1,
201 .flags = IORESOURCE_IRQ,
202 },
203 {
204 .start = CH_UART0_RX,
205 .end = CH_UART0_RX+1,
206 .flags = IORESOURCE_DMA,
207 },
208};
209static struct platform_device bfin_sir0_device = {
210 .name = "bfin_sir",
211 .id = 0,
212 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
213 .resource = bfin_sir0_resources,
214};
196#endif 215#endif
197#ifdef CONFIG_BFIN_SIR1 216#ifdef CONFIG_BFIN_SIR1
217static struct resource bfin_sir1_resources[] = {
198 { 218 {
199 .start = 0xFFC02000, 219 .start = 0xFFC02000,
200 .end = 0xFFC020FF, 220 .end = 0xFFC020FF,
201 .flags = IORESOURCE_MEM, 221 .flags = IORESOURCE_MEM,
202 }, 222 },
223 {
224 .start = IRQ_UART1_RX,
225 .end = IRQ_UART1_RX+1,
226 .flags = IORESOURCE_IRQ,
227 },
228 {
229 .start = CH_UART1_RX,
230 .end = CH_UART1_RX+1,
231 .flags = IORESOURCE_DMA,
232 },
233};
234static struct platform_device bfin_sir1_device = {
235 .name = "bfin_sir",
236 .id = 1,
237 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
238 .resource = bfin_sir1_resources,
239};
203#endif 240#endif
204#ifdef CONFIG_BFIN_SIR2 241#ifdef CONFIG_BFIN_SIR2
242static struct resource bfin_sir2_resources[] = {
205 { 243 {
206 .start = 0xFFC02100, 244 .start = 0xFFC02100,
207 .end = 0xFFC021FF, 245 .end = 0xFFC021FF,
208 .flags = IORESOURCE_MEM, 246 .flags = IORESOURCE_MEM,
209 }, 247 },
248 {
249 .start = IRQ_UART2_RX,
250 .end = IRQ_UART2_RX+1,
251 .flags = IORESOURCE_IRQ,
252 },
253 {
254 .start = CH_UART2_RX,
255 .end = CH_UART2_RX+1,
256 .flags = IORESOURCE_DMA,
257 },
258};
259static struct platform_device bfin_sir2_device = {
260 .name = "bfin_sir",
261 .id = 2,
262 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
263 .resource = bfin_sir2_resources,
264};
210#endif 265#endif
211#ifdef CONFIG_BFIN_SIR3 266#ifdef CONFIG_BFIN_SIR3
267static struct resource bfin_sir3_resources[] = {
212 { 268 {
213 .start = 0xFFC03100, 269 .start = 0xFFC03100,
214 .end = 0xFFC031FF, 270 .end = 0xFFC031FF,
215 .flags = IORESOURCE_MEM, 271 .flags = IORESOURCE_MEM,
216 }, 272 },
217#endif 273 {
274 .start = IRQ_UART3_RX,
275 .end = IRQ_UART3_RX+1,
276 .flags = IORESOURCE_IRQ,
277 },
278 {
279 .start = CH_UART3_RX,
280 .end = CH_UART3_RX+1,
281 .flags = IORESOURCE_DMA,
282 },
218}; 283};
219 284static struct platform_device bfin_sir3_device = {
220static struct platform_device bfin_sir_device = {
221 .name = "bfin_sir", 285 .name = "bfin_sir",
222 .id = 0, 286 .id = 3,
223 .num_resources = ARRAY_SIZE(bfin_sir_resources), 287 .num_resources = ARRAY_SIZE(bfin_sir3_resources),
224 .resource = bfin_sir_resources, 288 .resource = bfin_sir3_resources,
225}; 289};
226#endif 290#endif
291#endif
227 292
228#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 293#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
229static struct resource smsc911x_resources[] = { 294static struct resource smsc911x_resources[] = {
@@ -271,8 +336,8 @@ static struct musb_hdrc_config musb_config = {
271 .dyn_fifo = 0, 336 .dyn_fifo = 0,
272 .soft_con = 1, 337 .soft_con = 1,
273 .dma = 1, 338 .dma = 1,
274 .num_eps = 7, 339 .num_eps = 8,
275 .dma_channels = 7, 340 .dma_channels = 8,
276 .gpio_vrsel = GPIO_PH6, 341 .gpio_vrsel = GPIO_PH6,
277}; 342};
278 343
@@ -302,6 +367,19 @@ static struct platform_device musb_device = {
302}; 367};
303#endif 368#endif
304 369
370static struct resource bfin_gpios_resources = {
371 .start = 0,
372 .end = MAX_BLACKFIN_GPIOS - 1,
373 .flags = IORESOURCE_IRQ,
374};
375
376static struct platform_device bfin_gpios_device = {
377 .name = "simple-gpio",
378 .id = -1,
379 .num_resources = 1,
380 .resource = &bfin_gpios_resources,
381};
382
305#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) 383#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
306static struct resource bfin_atapi_resources[] = { 384static struct resource bfin_atapi_resources[] = {
307 { 385 {
@@ -372,9 +450,58 @@ static struct platform_device bf5xx_nand_device = {
372#endif 450#endif
373 451
374#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 452#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
453static struct bfin_sd_host bfin_sdh_data = {
454 .dma_chan = CH_SDH,
455 .irq_int0 = IRQ_SDH_MASK0,
456 .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
457};
458
375static struct platform_device bf54x_sdh_device = { 459static struct platform_device bf54x_sdh_device = {
376 .name = "bfin-sdh", 460 .name = "bfin-sdh",
377 .id = 0, 461 .id = 0,
462 .dev = {
463 .platform_data = &bfin_sdh_data,
464 },
465};
466#endif
467
468#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
469static struct mtd_partition para_partitions[] = {
470 {
471 .name = "bootloader(nor)",
472 .size = 0x40000,
473 .offset = 0,
474 }, {
475 .name = "linux kernel(nor)",
476 .size = 0x400000,
477 .offset = MTDPART_OFS_APPEND,
478 }, {
479 .name = "file system(nor)",
480 .size = MTDPART_SIZ_FULL,
481 .offset = MTDPART_OFS_APPEND,
482 }
483};
484
485static struct physmap_flash_data para_flash_data = {
486 .width = 2,
487 .parts = para_partitions,
488 .nr_parts = ARRAY_SIZE(para_partitions),
489};
490
491static struct resource para_flash_resource = {
492 .start = 0x20000000,
493 .end = 0x207fffff,
494 .flags = IORESOURCE_MEM,
495};
496
497static struct platform_device para_flash_device = {
498 .name = "physmap-flash",
499 .id = 0,
500 .dev = {
501 .platform_data = &para_flash_data,
502 },
503 .num_resources = 1,
504 .resource = &para_flash_resource,
378}; 505};
379#endif 506#endif
380 507
@@ -642,7 +769,18 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
642#endif 769#endif
643 770
644#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 771#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
645 &bfin_sir_device, 772#ifdef CONFIG_BFIN_SIR0
773 &bfin_sir0_device,
774#endif
775#ifdef CONFIG_BFIN_SIR1
776 &bfin_sir1_device,
777#endif
778#ifdef CONFIG_BFIN_SIR2
779 &bfin_sir2_device,
780#endif
781#ifdef CONFIG_BFIN_SIR3
782 &bfin_sir3_device,
783#endif
646#endif 784#endif
647 785
648#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) 786#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
@@ -679,7 +817,7 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
679#endif 817#endif
680 818
681#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 819#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
682/* &i2c_bfin_twi0_device, */ 820 &i2c_bfin_twi0_device,
683#if !defined(CONFIG_BF542) 821#if !defined(CONFIG_BF542)
684 &i2c_bfin_twi1_device, 822 &i2c_bfin_twi1_device,
685#endif 823#endif
@@ -688,6 +826,12 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
688#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 826#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
689 &bfin_device_gpiokeys, 827 &bfin_device_gpiokeys,
690#endif 828#endif
829
830#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
831 &para_flash_device,
832#endif
833
834 &bfin_gpios_device,
691}; 835};
692 836
693static int __init cm_bf548_init(void) 837static int __init cm_bf548_init(void)
diff --git a/arch/blackfin/mach-bf548/boards/ezkit.c b/arch/blackfin/mach-bf548/boards/ezkit.c
index 5288187a3ace..309c16014cae 100644
--- a/arch/blackfin/mach-bf548/boards/ezkit.c
+++ b/arch/blackfin/mach-bf548/boards/ezkit.c
@@ -45,6 +45,7 @@
45#include <asm/nand.h> 45#include <asm/nand.h>
46#include <asm/dpmc.h> 46#include <asm/dpmc.h>
47#include <asm/portmux.h> 47#include <asm/portmux.h>
48#include <asm/bfin_sdh.h>
48#include <mach/bf54x_keys.h> 49#include <mach/bf54x_keys.h>
49#include <linux/input.h> 50#include <linux/input.h>
50#include <linux/spi/ad7877.h> 51#include <linux/spi/ad7877.h>
@@ -52,16 +53,16 @@
52/* 53/*
53 * Name the Board for the /proc/cpuinfo 54 * Name the Board for the /proc/cpuinfo
54 */ 55 */
55const char bfin_board_name[] = "ADSP-BF548-EZKIT"; 56const char bfin_board_name[] = "ADI BF548-EZKIT";
56 57
57/* 58/*
58 * Driver needs to know address, irq and flag pin. 59 * Driver needs to know address, irq and flag pin.
59 */ 60 */
60 61
61#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 62#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
62static struct resource bfin_isp1761_resources[] = { 63#include <linux/usb/isp1760.h>
64static struct resource bfin_isp1760_resources[] = {
63 [0] = { 65 [0] = {
64 .name = "isp1761-regs",
65 .start = 0x2C0C0000, 66 .start = 0x2C0C0000,
66 .end = 0x2C0C0000 + 0xfffff, 67 .end = 0x2C0C0000 + 0xfffff,
67 .flags = IORESOURCE_MEM, 68 .flags = IORESOURCE_MEM,
@@ -73,32 +74,25 @@ static struct resource bfin_isp1761_resources[] = {
73 }, 74 },
74}; 75};
75 76
76static struct platform_device bfin_isp1761_device = { 77static struct isp1760_platform_data isp1760_priv = {
77 .name = "isp1761", 78 .is_isp1761 = 0,
78 .id = 0, 79 .port1_disable = 0,
79 .num_resources = ARRAY_SIZE(bfin_isp1761_resources), 80 .bus_width_16 = 1,
80 .resource = bfin_isp1761_resources, 81 .port1_otg = 0,
82 .analog_oc = 0,
83 .dack_polarity_high = 0,
84 .dreq_polarity_high = 0,
81}; 85};
82 86
83static struct platform_device *bfin_isp1761_devices[] = { 87static struct platform_device bfin_isp1760_device = {
84 &bfin_isp1761_device, 88 .name = "isp1760-hcd",
89 .id = 0,
90 .dev = {
91 .platform_data = &isp1760_priv,
92 },
93 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
94 .resource = bfin_isp1760_resources,
85}; 95};
86
87int __init bfin_isp1761_init(void)
88{
89 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
90
91 printk(KERN_INFO "%s(): registering device resources\n", __func__);
92 set_irq_type(bfin_isp1761_resources[1].start, IRQF_TRIGGER_FALLING);
93
94 return platform_add_devices(bfin_isp1761_devices, num_devices);
95}
96
97void __exit bfin_isp1761_exit(void)
98{
99 platform_device_unregister(&bfin_isp1761_device);
100}
101arch_initcall(bfin_isp1761_init);
102#endif 96#endif
103 97
104#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) 98#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
@@ -262,44 +256,107 @@ static struct platform_device bfin_uart_device = {
262#endif 256#endif
263 257
264#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 258#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
265static struct resource bfin_sir_resources[] = {
266#ifdef CONFIG_BFIN_SIR0 259#ifdef CONFIG_BFIN_SIR0
260static struct resource bfin_sir0_resources[] = {
267 { 261 {
268 .start = 0xFFC00400, 262 .start = 0xFFC00400,
269 .end = 0xFFC004FF, 263 .end = 0xFFC004FF,
270 .flags = IORESOURCE_MEM, 264 .flags = IORESOURCE_MEM,
271 }, 265 },
266 {
267 .start = IRQ_UART0_RX,
268 .end = IRQ_UART0_RX+1,
269 .flags = IORESOURCE_IRQ,
270 },
271 {
272 .start = CH_UART0_RX,
273 .end = CH_UART0_RX+1,
274 .flags = IORESOURCE_DMA,
275 },
276};
277static struct platform_device bfin_sir0_device = {
278 .name = "bfin_sir",
279 .id = 0,
280 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
281 .resource = bfin_sir0_resources,
282};
272#endif 283#endif
273#ifdef CONFIG_BFIN_SIR1 284#ifdef CONFIG_BFIN_SIR1
285static struct resource bfin_sir1_resources[] = {
274 { 286 {
275 .start = 0xFFC02000, 287 .start = 0xFFC02000,
276 .end = 0xFFC020FF, 288 .end = 0xFFC020FF,
277 .flags = IORESOURCE_MEM, 289 .flags = IORESOURCE_MEM,
278 }, 290 },
291 {
292 .start = IRQ_UART1_RX,
293 .end = IRQ_UART1_RX+1,
294 .flags = IORESOURCE_IRQ,
295 },
296 {
297 .start = CH_UART1_RX,
298 .end = CH_UART1_RX+1,
299 .flags = IORESOURCE_DMA,
300 },
301};
302static struct platform_device bfin_sir1_device = {
303 .name = "bfin_sir",
304 .id = 1,
305 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
306 .resource = bfin_sir1_resources,
307};
279#endif 308#endif
280#ifdef CONFIG_BFIN_SIR2 309#ifdef CONFIG_BFIN_SIR2
310static struct resource bfin_sir2_resources[] = {
281 { 311 {
282 .start = 0xFFC02100, 312 .start = 0xFFC02100,
283 .end = 0xFFC021FF, 313 .end = 0xFFC021FF,
284 .flags = IORESOURCE_MEM, 314 .flags = IORESOURCE_MEM,
285 }, 315 },
316 {
317 .start = IRQ_UART2_RX,
318 .end = IRQ_UART2_RX+1,
319 .flags = IORESOURCE_IRQ,
320 },
321 {
322 .start = CH_UART2_RX,
323 .end = CH_UART2_RX+1,
324 .flags = IORESOURCE_DMA,
325 },
326};
327static struct platform_device bfin_sir2_device = {
328 .name = "bfin_sir",
329 .id = 2,
330 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
331 .resource = bfin_sir2_resources,
332};
286#endif 333#endif
287#ifdef CONFIG_BFIN_SIR3 334#ifdef CONFIG_BFIN_SIR3
335static struct resource bfin_sir3_resources[] = {
288 { 336 {
289 .start = 0xFFC03100, 337 .start = 0xFFC03100,
290 .end = 0xFFC031FF, 338 .end = 0xFFC031FF,
291 .flags = IORESOURCE_MEM, 339 .flags = IORESOURCE_MEM,
292 }, 340 },
293#endif 341 {
342 .start = IRQ_UART3_RX,
343 .end = IRQ_UART3_RX+1,
344 .flags = IORESOURCE_IRQ,
345 },
346 {
347 .start = CH_UART3_RX,
348 .end = CH_UART3_RX+1,
349 .flags = IORESOURCE_DMA,
350 },
294}; 351};
295 352static struct platform_device bfin_sir3_device = {
296static struct platform_device bfin_sir_device = {
297 .name = "bfin_sir", 353 .name = "bfin_sir",
298 .id = 0, 354 .id = 3,
299 .num_resources = ARRAY_SIZE(bfin_sir_resources), 355 .num_resources = ARRAY_SIZE(bfin_sir3_resources),
300 .resource = bfin_sir_resources, 356 .resource = bfin_sir3_resources,
301}; 357};
302#endif 358#endif
359#endif
303 360
304#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 361#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
305static struct resource smsc911x_resources[] = { 362static struct resource smsc911x_resources[] = {
@@ -347,8 +404,8 @@ static struct musb_hdrc_config musb_config = {
347 .dyn_fifo = 0, 404 .dyn_fifo = 0,
348 .soft_con = 1, 405 .soft_con = 1,
349 .dma = 1, 406 .dma = 1,
350 .num_eps = 7, 407 .num_eps = 8,
351 .dma_channels = 7, 408 .dma_channels = 8,
352 .gpio_vrsel = GPIO_PE7, 409 .gpio_vrsel = GPIO_PE7,
353}; 410};
354 411
@@ -448,9 +505,19 @@ static struct platform_device bf5xx_nand_device = {
448#endif 505#endif
449 506
450#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 507#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
508
509static struct bfin_sd_host bfin_sdh_data = {
510 .dma_chan = CH_SDH,
511 .irq_int0 = IRQ_SDH_MASK0,
512 .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
513};
514
451static struct platform_device bf54x_sdh_device = { 515static struct platform_device bf54x_sdh_device = {
452 .name = "bfin-sdh", 516 .name = "bfin-sdh",
453 .id = 0, 517 .id = 0,
518 .dev = {
519 .platform_data = &bfin_sdh_data,
520 },
454}; 521};
455#endif 522#endif
456 523
@@ -589,7 +656,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
589{ 656{
590 .modalias = "ad7877", 657 .modalias = "ad7877",
591 .platform_data = &bfin_ad7877_ts_info, 658 .platform_data = &bfin_ad7877_ts_info,
592 .irq = IRQ_PJ11, /* newer boards (Rev 1.4+) use IRQ_PB4 */ 659 .irq = IRQ_PB4, /* old boards (<=Rev 1.3) use IRQ_PJ11 */
593 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 660 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
594 .bus_num = 0, 661 .bus_num = 0,
595 .chip_select = 2, 662 .chip_select = 2,
@@ -812,7 +879,18 @@ static struct platform_device *ezkit_devices[] __initdata = {
812#endif 879#endif
813 880
814#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 881#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
815 &bfin_sir_device, 882#ifdef CONFIG_BFIN_SIR0
883 &bfin_sir0_device,
884#endif
885#ifdef CONFIG_BFIN_SIR1
886 &bfin_sir1_device,
887#endif
888#ifdef CONFIG_BFIN_SIR2
889 &bfin_sir2_device,
890#endif
891#ifdef CONFIG_BFIN_SIR3
892 &bfin_sir3_device,
893#endif
816#endif 894#endif
817 895
818#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) 896#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
@@ -827,6 +905,10 @@ static struct platform_device *ezkit_devices[] __initdata = {
827 &musb_device, 905 &musb_device,
828#endif 906#endif
829 907
908#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
909 &bfin_isp1760_device,
910#endif
911
830#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) 912#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
831 &bfin_atapi_device, 913 &bfin_atapi_device,
832#endif 914#endif
diff --git a/arch/blackfin/mach-bf548/dma.c b/arch/blackfin/mach-bf548/dma.c
index 74730eb8ae1b..535980652bf6 100644
--- a/arch/blackfin/mach-bf548/dma.c
+++ b/arch/blackfin/mach-bf548/dma.c
@@ -32,7 +32,7 @@
32#include <asm/blackfin.h> 32#include <asm/blackfin.h>
33#include <asm/dma.h> 33#include <asm/dma.h>
34 34
35struct dma_register *dma_io_base_addr[MAX_BLACKFIN_DMA_CHANNEL] = { 35struct dma_register *dma_io_base_addr[MAX_DMA_CHANNELS] = {
36 (struct dma_register *) DMA0_NEXT_DESC_PTR, 36 (struct dma_register *) DMA0_NEXT_DESC_PTR,
37 (struct dma_register *) DMA1_NEXT_DESC_PTR, 37 (struct dma_register *) DMA1_NEXT_DESC_PTR,
38 (struct dma_register *) DMA2_NEXT_DESC_PTR, 38 (struct dma_register *) DMA2_NEXT_DESC_PTR,
diff --git a/arch/blackfin/mach-bf548/head.S b/arch/blackfin/mach-bf548/head.S
deleted file mode 100644
index 93b361dff27b..000000000000
--- a/arch/blackfin/mach-bf548/head.S
+++ /dev/null
@@ -1,158 +0,0 @@
1/*
2 * File: arch/blackfin/mach-bf548/head.S
3 * Based on: arch/blackfin/mach-bf537/head.S
4 * Author: Jeff Dionne <jeff@uclinux.org> COPYRIGHT 1998 D. Jeff Dionne
5 *
6 * Created: 1998
7 * Description: Startup code for Blackfin BF548
8 *
9 * Modified:
10 * Copyright 2004-2007 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/linkage.h>
31#include <linux/init.h>
32#include <asm/blackfin.h>
33#ifdef CONFIG_BFIN_KERNEL_CLOCK
34#include <asm/clocks.h>
35#include <mach/mem_init.h>
36#endif
37
38.section .l1.text
39#ifdef CONFIG_BFIN_KERNEL_CLOCK
40ENTRY(_start_dma_code)
41
42 /* Enable PHY CLK buffer output */
43 p0.h = hi(VR_CTL);
44 p0.l = lo(VR_CTL);
45 r0.l = w[p0];
46 bitset(r0, 14);
47 w[p0] = r0.l;
48 ssync;
49
50 p0.h = hi(SIC_IWR0);
51 p0.l = lo(SIC_IWR0);
52 r0.l = 0x1;
53 r0.h = 0x0;
54 [p0] = r0;
55 SSYNC;
56
57 /*
58 * Set PLL_CTL
59 * - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
60 * - [8] = BYPASS : BYPASS the PLL, run CLKIN into CCLK/SCLK
61 * - [7] = output delay (add 200ps of delay to mem signals)
62 * - [6] = input delay (add 200ps of input delay to mem signals)
63 * - [5] = PDWN : 1=All Clocks off
64 * - [3] = STOPCK : 1=Core Clock off
65 * - [1] = PLL_OFF : 1=Disable Power to PLL
66 * - [0] = DF : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
67 * all other bits set to zero
68 */
69
70 p0.h = hi(PLL_LOCKCNT);
71 p0.l = lo(PLL_LOCKCNT);
72 r0 = 0x300(Z);
73 w[p0] = r0.l;
74 ssync;
75
76 /* enable self refresh via SRREQ */
77 P2.H = hi(EBIU_RSTCTL);
78 P2.L = lo(EBIU_RSTCTL);
79 R0 = [P2];
80 BITSET (R0, 3);
81 [P2] = R0;
82 SSYNC;
83
84 /* wait for SRACK bit to be set */
85.LSRR_MODE:
86 R0 = [P2];
87 CC = BITTST(R0, 4);
88 if !CC JUMP .LSRR_MODE;
89
90 r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
91 r0 = r0 << 9; /* Shift it over, */
92 r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
93 r0 = r1 | r0;
94 r1 = PLL_BYPASS; /* Bypass the PLL? */
95 r1 = r1 << 8; /* Shift it over */
96 r0 = r1 | r0; /* add them all together */
97#ifdef ANOMALY_05000265
98 BITSET(r0, 15); /* Add 250 mV of hysteresis to SPORT input pins */
99#endif
100
101 p0.h = hi(PLL_CTL);
102 p0.l = lo(PLL_CTL); /* Load the address */
103 cli r2; /* Disable interrupts */
104 ssync;
105 w[p0] = r0.l; /* Set the value */
106 idle; /* Wait for the PLL to stablize */
107 sti r2; /* Enable interrupts */
108
109.Lcheck_again:
110 p0.h = hi(PLL_STAT);
111 p0.l = lo(PLL_STAT);
112 R0 = W[P0](Z);
113 CC = BITTST(R0,5);
114 if ! CC jump .Lcheck_again;
115
116 /* Configure SCLK & CCLK Dividers */
117 r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
118 p0.h = hi(PLL_DIV);
119 p0.l = lo(PLL_DIV);
120 w[p0] = r0.l;
121 ssync;
122
123 /* disable self refresh by clearing SRREQ */
124 P2.H = hi(EBIU_RSTCTL);
125 P2.L = lo(EBIU_RSTCTL);
126 R0 = [P2];
127 CC = BITTST(R0, 0);
128 if CC jump .Lskipddrrst;
129 BITSET (R0, 0);
130.Lskipddrrst:
131 BITCLR (R0, 3);
132 [P2] = R0;
133 SSYNC;
134
135 p0.l = lo(EBIU_DDRCTL0);
136 p0.h = hi(EBIU_DDRCTL0);
137 r0.l = lo(mem_DDRCTL0);
138 r0.h = hi(mem_DDRCTL0);
139 [p0] = r0;
140 ssync;
141
142 p0.l = lo(EBIU_DDRCTL1);
143 p0.h = hi(EBIU_DDRCTL1);
144 r0.l = lo(mem_DDRCTL1);
145 r0.h = hi(mem_DDRCTL1);
146 [p0] = r0;
147 ssync;
148
149 p0.l = lo(EBIU_DDRCTL2);
150 p0.h = hi(EBIU_DDRCTL2);
151 r0.l = lo(mem_DDRCTL2);
152 r0.h = hi(mem_DDRCTL2);
153 [p0] = r0;
154 ssync;
155
156 RTS;
157ENDPROC(_start_dma_code)
158#endif /* CONFIG_BFIN_KERNEL_CLOCK */
diff --git a/arch/blackfin/mach-bf548/include/mach/anomaly.h b/arch/blackfin/mach-bf548/include/mach/anomaly.h
index 816b09278f62..3b5430999f4f 100644
--- a/arch/blackfin/mach-bf548/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf548/include/mach/anomaly.h
@@ -157,6 +157,8 @@
157#define ANOMALY_05000429 (__SILICON_REVISION__ < 2) 157#define ANOMALY_05000429 (__SILICON_REVISION__ < 2)
158/* Software System Reset Corrupts PLL_LOCKCNT Register */ 158/* Software System Reset Corrupts PLL_LOCKCNT Register */
159#define ANOMALY_05000430 (__SILICON_REVISION__ >= 2) 159#define ANOMALY_05000430 (__SILICON_REVISION__ >= 2)
160/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
161#define ANOMALY_05000443 (1)
160 162
161/* Anomalies that don't exist on this proc */ 163/* Anomalies that don't exist on this proc */
162#define ANOMALY_05000125 (0) 164#define ANOMALY_05000125 (0)
@@ -173,5 +175,8 @@
173#define ANOMALY_05000311 (0) 175#define ANOMALY_05000311 (0)
174#define ANOMALY_05000323 (0) 176#define ANOMALY_05000323 (0)
175#define ANOMALY_05000363 (0) 177#define ANOMALY_05000363 (0)
178#define ANOMALY_05000412 (0)
179#define ANOMALY_05000432 (0)
180#define ANOMALY_05000435 (0)
176 181
177#endif 182#endif
diff --git a/arch/blackfin/mach-bf548/include/mach/bf548.h b/arch/blackfin/mach-bf548/include/mach/bf548.h
index 49f9b403d458..f0e569984810 100644
--- a/arch/blackfin/mach-bf548/include/mach/bf548.h
+++ b/arch/blackfin/mach-bf548/include/mach/bf548.h
@@ -122,7 +122,7 @@
122#endif 122#endif
123 123
124#ifndef CPU 124#ifndef CPU
125#error Unknown CPU type - This kernel doesn't seem to be configured properly 125#error "Unknown CPU type - This kernel doesn't seem to be configured properly"
126#endif 126#endif
127 127
128#endif /* __MACH_BF48_H__ */ 128#endif /* __MACH_BF48_H__ */
diff --git a/arch/blackfin/mach-bf548/include/mach/bfin_sir.h b/arch/blackfin/mach-bf548/include/mach/bfin_sir.h
deleted file mode 100644
index c41f9cf00268..000000000000
--- a/arch/blackfin/mach-bf548/include/mach/bfin_sir.h
+++ /dev/null
@@ -1,166 +0,0 @@
1/*
2 * Blackfin Infra-red Driver
3 *
4 * Copyright 2006-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 *
10 */
11
12#include <linux/serial.h>
13#include <asm/dma.h>
14#include <asm/portmux.h>
15
16#define SIR_UART_GET_CHAR(port) bfin_read16((port)->membase + OFFSET_RBR)
17#define SIR_UART_GET_DLL(port) bfin_read16((port)->membase + OFFSET_DLL)
18#define SIR_UART_GET_IER(port) bfin_read16((port)->membase + OFFSET_IER_SET)
19#define SIR_UART_GET_DLH(port) bfin_read16((port)->membase + OFFSET_DLH)
20#define SIR_UART_GET_LCR(port) bfin_read16((port)->membase + OFFSET_LCR)
21#define SIR_UART_GET_LSR(port) bfin_read16((port)->membase + OFFSET_LSR)
22#define SIR_UART_GET_GCTL(port) bfin_read16((port)->membase + OFFSET_GCTL)
23
24#define SIR_UART_PUT_CHAR(port, v) bfin_write16(((port)->membase + OFFSET_THR), v)
25#define SIR_UART_PUT_DLL(port, v) bfin_write16(((port)->membase + OFFSET_DLL), v)
26#define SIR_UART_SET_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER_SET), v)
27#define SIR_UART_CLEAR_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER_CLEAR), v)
28#define SIR_UART_PUT_DLH(port, v) bfin_write16(((port)->membase + OFFSET_DLH), v)
29#define SIR_UART_PUT_LSR(port, v) bfin_write16(((port)->membase + OFFSET_LSR), v)
30#define SIR_UART_PUT_LCR(port, v) bfin_write16(((port)->membase + OFFSET_LCR), v)
31#define SIR_UART_CLEAR_LSR(port) bfin_write16(((port)->membase + OFFSET_LSR), -1)
32#define SIR_UART_PUT_GCTL(port, v) bfin_write16(((port)->membase + OFFSET_GCTL), v)
33
34#ifdef CONFIG_SIR_BFIN_DMA
35struct dma_rx_buf {
36 char *buf;
37 int head;
38 int tail;
39 };
40#endif /* CONFIG_SIR_BFIN_DMA */
41
42struct bfin_sir_port {
43 unsigned char __iomem *membase;
44 unsigned int irq;
45 unsigned int lsr;
46 unsigned long clk;
47 struct net_device *dev;
48#ifdef CONFIG_SIR_BFIN_DMA
49 int tx_done;
50 struct dma_rx_buf rx_dma_buf;
51 struct timer_list rx_dma_timer;
52 int rx_dma_nrows;
53#endif /* CONFIG_SIR_BFIN_DMA */
54 unsigned int tx_dma_channel;
55 unsigned int rx_dma_channel;
56};
57
58struct bfin_sir_port sir_ports[BFIN_UART_NR_PORTS];
59
60struct bfin_sir_port_res {
61 unsigned long base_addr;
62 int irq;
63 unsigned int rx_dma_channel;
64 unsigned int tx_dma_channel;
65};
66
67struct bfin_sir_port_res bfin_sir_port_resource[] = {
68#ifdef CONFIG_BFIN_SIR0
69 {
70 0xFFC00400,
71 IRQ_UART0_RX,
72 CH_UART0_RX,
73 CH_UART0_TX,
74 },
75#endif
76#ifdef CONFIG_BFIN_SIR1
77 {
78 0xFFC02000,
79 IRQ_UART1_RX,
80 CH_UART1_RX,
81 CH_UART1_TX,
82 },
83#endif
84#ifdef CONFIG_BFIN_SIR2
85 {
86 0xFFC02100,
87 IRQ_UART2_RX,
88 CH_UART2_RX,
89 CH_UART2_TX,
90 },
91#endif
92#ifdef CONFIG_BFIN_SIR3
93 {
94 0xFFC03100,
95 IRQ_UART3_RX,
96 CH_UART3_RX,
97 CH_UART3_TX,
98 },
99#endif
100};
101
102int nr_sirs = ARRAY_SIZE(bfin_sir_port_resource);
103
104struct bfin_sir_self {
105 struct bfin_sir_port *sir_port;
106 spinlock_t lock;
107 unsigned int open;
108 int speed;
109 int newspeed;
110
111 struct sk_buff *txskb;
112 struct sk_buff *rxskb;
113 struct net_device_stats stats;
114 struct device *dev;
115 struct irlap_cb *irlap;
116 struct qos_info qos;
117
118 iobuff_t tx_buff;
119 iobuff_t rx_buff;
120
121 struct work_struct work;
122 int mtt;
123};
124
125#define DRIVER_NAME "bfin_sir"
126
127static int bfin_sir_hw_init(void)
128{
129 int ret = -ENODEV;
130#ifdef CONFIG_BFIN_SIR0
131 ret = peripheral_request(P_UART0_TX, DRIVER_NAME);
132 if (ret)
133 return ret;
134 ret = peripheral_request(P_UART0_RX, DRIVER_NAME);
135 if (ret)
136 return ret;
137#endif
138
139#ifdef CONFIG_BFIN_SIR1
140 ret = peripheral_request(P_UART1_TX, DRIVER_NAME);
141 if (ret)
142 return ret;
143 ret = peripheral_request(P_UART1_RX, DRIVER_NAME);
144 if (ret)
145 return ret;
146#endif
147
148#ifdef CONFIG_BFIN_SIR2
149 ret = peripheral_request(P_UART2_TX, DRIVER_NAME);
150 if (ret)
151 return ret;
152 ret = peripheral_request(P_UART2_RX, DRIVER_NAME);
153 if (ret)
154 return ret;
155#endif
156
157#ifdef CONFIG_BFIN_SIR3
158 ret = peripheral_request(P_UART3_TX, DRIVER_NAME);
159 if (ret)
160 return ret;
161 ret = peripheral_request(P_UART3_RX, DRIVER_NAME);
162 if (ret)
163 return ret;
164#endif
165 return ret;
166}
diff --git a/arch/blackfin/mach-bf548/include/mach/blackfin.h b/arch/blackfin/mach-bf548/include/mach/blackfin.h
index d6ee74ac0460..0c0e3e2c3c21 100644
--- a/arch/blackfin/mach-bf548/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf548/include/mach/blackfin.h
@@ -111,7 +111,7 @@
111 111
112/* UART 0*/ 112/* UART 0*/
113 113
114/* DMA Channnel */ 114/* DMA Channel */
115#define bfin_read_CH_UART_RX() bfin_read_CH_UART1_RX() 115#define bfin_read_CH_UART_RX() bfin_read_CH_UART1_RX()
116#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART1_RX(val) 116#define bfin_write_CH_UART_RX(val) bfin_write_CH_UART1_RX(val)
117#define bfin_read_CH_UART_TX() bfin_read_CH_UART1_TX() 117#define bfin_read_CH_UART_TX() bfin_read_CH_UART1_TX()
diff --git a/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h b/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h
index 57ac8cb9b1f6..6e636c418cb0 100644
--- a/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h
+++ b/arch/blackfin/mach-bf548/include/mach/cdefBF54x_base.h
@@ -34,7 +34,6 @@
34#include <asm/blackfin.h> 34#include <asm/blackfin.h>
35 35
36#include "defBF54x_base.h" 36#include "defBF54x_base.h"
37#include <asm/system.h>
38 37
39/* ************************************************************** */ 38/* ************************************************************** */
40/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x */ 39/* SYSTEM & MMR ADDRESS DEFINITIONS COMMON TO ALL ADSP-BF54x */
@@ -43,63 +42,9 @@
43/* PLL Registers */ 42/* PLL Registers */
44 43
45#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL) 44#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
46/* Writing to PLL_CTL initiates a PLL relock sequence. */
47static __inline__ void bfin_write_PLL_CTL(unsigned int val)
48{
49 unsigned long flags, iwr0, iwr1, iwr2;
50
51 if (val == bfin_read_PLL_CTL())
52 return;
53
54 local_irq_save(flags);
55 /* Enable the PLL Wakeup bit in SIC IWR */
56 iwr0 = bfin_read32(SIC_IWR0);
57 iwr1 = bfin_read32(SIC_IWR1);
58 iwr2 = bfin_read32(SIC_IWR2);
59 /* Only allow PPL Wakeup) */
60 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
61 bfin_write32(SIC_IWR1, 0);
62 bfin_write32(SIC_IWR2, 0);
63
64 bfin_write16(PLL_CTL, val);
65 SSYNC();
66 asm("IDLE;");
67
68 bfin_write32(SIC_IWR0, iwr0);
69 bfin_write32(SIC_IWR1, iwr1);
70 bfin_write32(SIC_IWR2, iwr2);
71 local_irq_restore(flags);
72}
73#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV) 45#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
74#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val) 46#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV, val)
75#define bfin_read_VR_CTL() bfin_read16(VR_CTL) 47#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
76/* Writing to VR_CTL initiates a PLL relock sequence. */
77static __inline__ void bfin_write_VR_CTL(unsigned int val)
78{
79 unsigned long flags, iwr0, iwr1, iwr2;
80
81 if (val == bfin_read_VR_CTL())
82 return;
83
84 local_irq_save(flags);
85 /* Enable the PLL Wakeup bit in SIC IWR */
86 iwr0 = bfin_read32(SIC_IWR0);
87 iwr1 = bfin_read32(SIC_IWR1);
88 iwr2 = bfin_read32(SIC_IWR2);
89 /* Only allow PPL Wakeup) */
90 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
91 bfin_write32(SIC_IWR1, 0);
92 bfin_write32(SIC_IWR2, 0);
93
94 bfin_write16(VR_CTL, val);
95 SSYNC();
96 asm("IDLE;");
97
98 bfin_write32(SIC_IWR0, iwr0);
99 bfin_write32(SIC_IWR1, iwr1);
100 bfin_write32(SIC_IWR2, iwr2);
101 local_irq_restore(flags);
102}
103#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 48#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
104#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val) 49#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT, val)
105#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT) 50#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
@@ -2746,5 +2691,64 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
2746#define bfin_read_PINT3_IRQ bfin_read_PINT3_REQUEST 2691#define bfin_read_PINT3_IRQ bfin_read_PINT3_REQUEST
2747#define bfin_write_PINT3_IRQ bfin_write_PINT3_REQUEST 2692#define bfin_write_PINT3_IRQ bfin_write_PINT3_REQUEST
2748 2693
2694/* These need to be last due to the cdef/linux inter-dependencies */
2695#include <asm/irq.h>
2696
2697/* Writing to PLL_CTL initiates a PLL relock sequence. */
2698static __inline__ void bfin_write_PLL_CTL(unsigned int val)
2699{
2700 unsigned long flags, iwr0, iwr1, iwr2;
2701
2702 if (val == bfin_read_PLL_CTL())
2703 return;
2704
2705 local_irq_save_hw(flags);
2706 /* Enable the PLL Wakeup bit in SIC IWR */
2707 iwr0 = bfin_read32(SIC_IWR0);
2708 iwr1 = bfin_read32(SIC_IWR1);
2709 iwr2 = bfin_read32(SIC_IWR2);
2710 /* Only allow PPL Wakeup) */
2711 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
2712 bfin_write32(SIC_IWR1, 0);
2713 bfin_write32(SIC_IWR2, 0);
2714
2715 bfin_write16(PLL_CTL, val);
2716 SSYNC();
2717 asm("IDLE;");
2718
2719 bfin_write32(SIC_IWR0, iwr0);
2720 bfin_write32(SIC_IWR1, iwr1);
2721 bfin_write32(SIC_IWR2, iwr2);
2722 local_irq_restore_hw(flags);
2723}
2724
2725/* Writing to VR_CTL initiates a PLL relock sequence. */
2726static __inline__ void bfin_write_VR_CTL(unsigned int val)
2727{
2728 unsigned long flags, iwr0, iwr1, iwr2;
2729
2730 if (val == bfin_read_VR_CTL())
2731 return;
2732
2733 local_irq_save_hw(flags);
2734 /* Enable the PLL Wakeup bit in SIC IWR */
2735 iwr0 = bfin_read32(SIC_IWR0);
2736 iwr1 = bfin_read32(SIC_IWR1);
2737 iwr2 = bfin_read32(SIC_IWR2);
2738 /* Only allow PPL Wakeup) */
2739 bfin_write32(SIC_IWR0, IWR_ENABLE(0));
2740 bfin_write32(SIC_IWR1, 0);
2741 bfin_write32(SIC_IWR2, 0);
2742
2743 bfin_write16(VR_CTL, val);
2744 SSYNC();
2745 asm("IDLE;");
2746
2747 bfin_write32(SIC_IWR0, iwr0);
2748 bfin_write32(SIC_IWR1, iwr1);
2749 bfin_write32(SIC_IWR2, iwr2);
2750 local_irq_restore_hw(flags);
2751}
2752
2749#endif /* _CDEF_BF54X_H */ 2753#endif /* _CDEF_BF54X_H */
2750 2754
diff --git a/arch/blackfin/mach-bf548/include/mach/dma.h b/arch/blackfin/mach-bf548/include/mach/dma.h
index 36a2ef7e7849..a30d242c7398 100644
--- a/arch/blackfin/mach-bf548/include/mach/dma.h
+++ b/arch/blackfin/mach-bf548/include/mach/dma.h
@@ -1,32 +1,8 @@
1/* 1/* mach/dma.h - arch-specific DMA defines
2 * file: include/asm-blackfin/mach-bf548/dma.h
3 * based on:
4 * author:
5 * 2 *
6 * created: 3 * Copyright 2004-2008 Analog Devices Inc.
7 * description:
8 * system mmr register map
9 * rev:
10 * 4 *
11 * modified: 5 * Licensed under the GPL-2 or later.
12 *
13 *
14 * bugs: enter bugs at http://blackfin.uclinux.org/
15 *
16 * this program is free software; you can redistribute it and/or modify
17 * it under the terms of the gnu general public license as published by
18 * the free software foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * this program is distributed in the hope that it will be useful,
22 * but without any warranty; without even the implied warranty of
23 * merchantability or fitness for a particular purpose. see the
24 * gnu general public license for more details.
25 *
26 * you should have received a copy of the gnu general public license
27 * along with this program; see the file copying.
28 * if not, write to the free software foundation,
29 * 59 temple place - suite 330, boston, ma 02111-1307, usa.
30 */ 6 */
31 7
32#ifndef _MACH_DMA_H_ 8#ifndef _MACH_DMA_H_
@@ -71,6 +47,6 @@
71#define CH_MEM_STREAM3_DEST 30 47#define CH_MEM_STREAM3_DEST 30
72#define CH_MEM_STREAM3_SRC 31 48#define CH_MEM_STREAM3_SRC 31
73 49
74#define MAX_BLACKFIN_DMA_CHANNEL 32 50#define MAX_DMA_CHANNELS 32
75 51
76#endif 52#endif
diff --git a/arch/blackfin/mach-bf548/include/mach/irq.h b/arch/blackfin/mach-bf548/include/mach/irq.h
index ad380d1f5872..60299a71e090 100644
--- a/arch/blackfin/mach-bf548/include/mach/irq.h
+++ b/arch/blackfin/mach-bf548/include/mach/irq.h
@@ -158,7 +158,7 @@ Events (highest priority) EMU 0
158#define IRQ_PINT2 BFIN_IRQ(94) /* PINT2 Interrupt */ 158#define IRQ_PINT2 BFIN_IRQ(94) /* PINT2 Interrupt */
159#define IRQ_PINT3 BFIN_IRQ(95) /* PINT3 Interrupt */ 159#define IRQ_PINT3 BFIN_IRQ(95) /* PINT3 Interrupt */
160 160
161#define SYS_IRQS IRQ_PINT3 161#define SYS_IRQS IRQ_PINT3
162 162
163#define BFIN_PA_IRQ(x) ((x) + SYS_IRQS + 1) 163#define BFIN_PA_IRQ(x) ((x) + SYS_IRQS + 1)
164#define IRQ_PA0 BFIN_PA_IRQ(0) 164#define IRQ_PA0 BFIN_PA_IRQ(0)
diff --git a/arch/blackfin/mach-bf548/include/mach/mem_init.h b/arch/blackfin/mach-bf548/include/mach/mem_init.h
deleted file mode 100644
index ab0b863eee66..000000000000
--- a/arch/blackfin/mach-bf548/include/mach/mem_init.h
+++ /dev/null
@@ -1,255 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf548/mem_init.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 * Copyright 2004-2006 Analog Devices Inc.
13 *
14 * Bugs: Enter bugs at http://blackfin.uclinux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2, or (at your option)
19 * any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program; see the file COPYING.
28 * If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31#define MIN_DDR_SCLK(x) (x*(CONFIG_SCLK_HZ/1000/1000)/1000 + 1)
32#define MAX_DDR_SCLK(x) (x*(CONFIG_SCLK_HZ/1000/1000)/1000)
33#define DDR_CLK_HZ(x) (1000*1000*1000/x)
34
35#if (CONFIG_MEM_MT46V32M16_6T)
36#define DDR_SIZE DEVSZ_512
37#define DDR_WIDTH DEVWD_16
38#define DDR_MAX_tCK 13
39
40#define DDR_tRC DDR_TRC(MIN_DDR_SCLK(60))
41#define DDR_tRAS DDR_TRAS(MIN_DDR_SCLK(42))
42#define DDR_tRP DDR_TRP(MIN_DDR_SCLK(15))
43#define DDR_tRFC DDR_TRFC(MIN_DDR_SCLK(72))
44#define DDR_tREFI DDR_TREFI(MAX_DDR_SCLK(7800))
45
46#define DDR_tRCD DDR_TRCD(MIN_DDR_SCLK(15))
47#define DDR_tWTR DDR_TWTR(1)
48#define DDR_tMRD DDR_TMRD(MIN_DDR_SCLK(12))
49#define DDR_tWR DDR_TWR(MIN_DDR_SCLK(15))
50#endif
51
52#if (CONFIG_MEM_MT46V32M16_5B)
53#define DDR_SIZE DEVSZ_512
54#define DDR_WIDTH DEVWD_16
55#define DDR_MAX_tCK 13
56
57#define DDR_tRC DDR_TRC(MIN_DDR_SCLK(55))
58#define DDR_tRAS DDR_TRAS(MIN_DDR_SCLK(40))
59#define DDR_tRP DDR_TRP(MIN_DDR_SCLK(15))
60#define DDR_tRFC DDR_TRFC(MIN_DDR_SCLK(70))
61#define DDR_tREFI DDR_TREFI(MAX_DDR_SCLK(7800))
62
63#define DDR_tRCD DDR_TRCD(MIN_DDR_SCLK(15))
64#define DDR_tWTR DDR_TWTR(2)
65#define DDR_tMRD DDR_TMRD(MIN_DDR_SCLK(10))
66#define DDR_tWR DDR_TWR(MIN_DDR_SCLK(15))
67#endif
68
69#if (CONFIG_MEM_GENERIC_BOARD)
70#define DDR_SIZE DEVSZ_512
71#define DDR_WIDTH DEVWD_16
72#define DDR_MAX_tCK 13
73
74#define DDR_tRCD DDR_TRCD(3)
75#define DDR_tWTR DDR_TWTR(2)
76#define DDR_tWR DDR_TWR(2)
77#define DDR_tMRD DDR_TMRD(2)
78#define DDR_tRP DDR_TRP(3)
79#define DDR_tRAS DDR_TRAS(7)
80#define DDR_tRC DDR_TRC(10)
81#define DDR_tRFC DDR_TRFC(12)
82#define DDR_tREFI DDR_TREFI(1288)
83#endif
84
85#if (CONFIG_SCLK_HZ < DDR_CLK_HZ(DDR_MAX_tCK))
86# error "CONFIG_SCLK_HZ is too small (<DDR_CLK_HZ(DDR_MAX_tCK) Hz)."
87#elif(CONFIG_SCLK_HZ <= 133333333)
88# define DDR_CL CL_2
89#else
90# error "CONFIG_SCLK_HZ is too large (>133333333 Hz)."
91#endif
92
93
94#define mem_DDRCTL0 (DDR_tRP | DDR_tRAS | DDR_tRC | DDR_tRFC | DDR_tREFI)
95#define mem_DDRCTL1 (DDR_DATWIDTH | EXTBANK_1 | DDR_SIZE | DDR_WIDTH | DDR_tWTR \
96 | DDR_tMRD | DDR_tWR | DDR_tRCD)
97#define mem_DDRCTL2 DDR_CL
98
99
100#if defined CONFIG_CLKIN_HALF
101#define CLKIN_HALF 1
102#else
103#define CLKIN_HALF 0
104#endif
105
106#if defined CONFIG_PLL_BYPASS
107#define PLL_BYPASS 1
108#else
109#define PLL_BYPASS 0
110#endif
111
112/***************************************Currently Not Being Used *********************************/
113#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
114#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
115#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
116#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
117#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
118
119#if (flash_EBIU_AMBCTL_TT > 3)
120#define flash_EBIU_AMBCTL0_TT B0TT_4
121#endif
122#if (flash_EBIU_AMBCTL_TT == 3)
123#define flash_EBIU_AMBCTL0_TT B0TT_3
124#endif
125#if (flash_EBIU_AMBCTL_TT == 2)
126#define flash_EBIU_AMBCTL0_TT B0TT_2
127#endif
128#if (flash_EBIU_AMBCTL_TT < 2)
129#define flash_EBIU_AMBCTL0_TT B0TT_1
130#endif
131
132#if (flash_EBIU_AMBCTL_ST > 3)
133#define flash_EBIU_AMBCTL0_ST B0ST_4
134#endif
135#if (flash_EBIU_AMBCTL_ST == 3)
136#define flash_EBIU_AMBCTL0_ST B0ST_3
137#endif
138#if (flash_EBIU_AMBCTL_ST == 2)
139#define flash_EBIU_AMBCTL0_ST B0ST_2
140#endif
141#if (flash_EBIU_AMBCTL_ST < 2)
142#define flash_EBIU_AMBCTL0_ST B0ST_1
143#endif
144
145#if (flash_EBIU_AMBCTL_HT > 2)
146#define flash_EBIU_AMBCTL0_HT B0HT_3
147#endif
148#if (flash_EBIU_AMBCTL_HT == 2)
149#define flash_EBIU_AMBCTL0_HT B0HT_2
150#endif
151#if (flash_EBIU_AMBCTL_HT == 1)
152#define flash_EBIU_AMBCTL0_HT B0HT_1
153#endif
154#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
155#define flash_EBIU_AMBCTL0_HT B0HT_0
156#endif
157#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
158#define flash_EBIU_AMBCTL0_HT B0HT_1
159#endif
160
161#if (flash_EBIU_AMBCTL_WAT > 14)
162#define flash_EBIU_AMBCTL0_WAT B0WAT_15
163#endif
164#if (flash_EBIU_AMBCTL_WAT == 14)
165#define flash_EBIU_AMBCTL0_WAT B0WAT_14
166#endif
167#if (flash_EBIU_AMBCTL_WAT == 13)
168#define flash_EBIU_AMBCTL0_WAT B0WAT_13
169#endif
170#if (flash_EBIU_AMBCTL_WAT == 12)
171#define flash_EBIU_AMBCTL0_WAT B0WAT_12
172#endif
173#if (flash_EBIU_AMBCTL_WAT == 11)
174#define flash_EBIU_AMBCTL0_WAT B0WAT_11
175#endif
176#if (flash_EBIU_AMBCTL_WAT == 10)
177#define flash_EBIU_AMBCTL0_WAT B0WAT_10
178#endif
179#if (flash_EBIU_AMBCTL_WAT == 9)
180#define flash_EBIU_AMBCTL0_WAT B0WAT_9
181#endif
182#if (flash_EBIU_AMBCTL_WAT == 8)
183#define flash_EBIU_AMBCTL0_WAT B0WAT_8
184#endif
185#if (flash_EBIU_AMBCTL_WAT == 7)
186#define flash_EBIU_AMBCTL0_WAT B0WAT_7
187#endif
188#if (flash_EBIU_AMBCTL_WAT == 6)
189#define flash_EBIU_AMBCTL0_WAT B0WAT_6
190#endif
191#if (flash_EBIU_AMBCTL_WAT == 5)
192#define flash_EBIU_AMBCTL0_WAT B0WAT_5
193#endif
194#if (flash_EBIU_AMBCTL_WAT == 4)
195#define flash_EBIU_AMBCTL0_WAT B0WAT_4
196#endif
197#if (flash_EBIU_AMBCTL_WAT == 3)
198#define flash_EBIU_AMBCTL0_WAT B0WAT_3
199#endif
200#if (flash_EBIU_AMBCTL_WAT == 2)
201#define flash_EBIU_AMBCTL0_WAT B0WAT_2
202#endif
203#if (flash_EBIU_AMBCTL_WAT == 1)
204#define flash_EBIU_AMBCTL0_WAT B0WAT_1
205#endif
206
207#if (flash_EBIU_AMBCTL_RAT > 14)
208#define flash_EBIU_AMBCTL0_RAT B0RAT_15
209#endif
210#if (flash_EBIU_AMBCTL_RAT == 14)
211#define flash_EBIU_AMBCTL0_RAT B0RAT_14
212#endif
213#if (flash_EBIU_AMBCTL_RAT == 13)
214#define flash_EBIU_AMBCTL0_RAT B0RAT_13
215#endif
216#if (flash_EBIU_AMBCTL_RAT == 12)
217#define flash_EBIU_AMBCTL0_RAT B0RAT_12
218#endif
219#if (flash_EBIU_AMBCTL_RAT == 11)
220#define flash_EBIU_AMBCTL0_RAT B0RAT_11
221#endif
222#if (flash_EBIU_AMBCTL_RAT == 10)
223#define flash_EBIU_AMBCTL0_RAT B0RAT_10
224#endif
225#if (flash_EBIU_AMBCTL_RAT == 9)
226#define flash_EBIU_AMBCTL0_RAT B0RAT_9
227#endif
228#if (flash_EBIU_AMBCTL_RAT == 8)
229#define flash_EBIU_AMBCTL0_RAT B0RAT_8
230#endif
231#if (flash_EBIU_AMBCTL_RAT == 7)
232#define flash_EBIU_AMBCTL0_RAT B0RAT_7
233#endif
234#if (flash_EBIU_AMBCTL_RAT == 6)
235#define flash_EBIU_AMBCTL0_RAT B0RAT_6
236#endif
237#if (flash_EBIU_AMBCTL_RAT == 5)
238#define flash_EBIU_AMBCTL0_RAT B0RAT_5
239#endif
240#if (flash_EBIU_AMBCTL_RAT == 4)
241#define flash_EBIU_AMBCTL0_RAT B0RAT_4
242#endif
243#if (flash_EBIU_AMBCTL_RAT == 3)
244#define flash_EBIU_AMBCTL0_RAT B0RAT_3
245#endif
246#if (flash_EBIU_AMBCTL_RAT == 2)
247#define flash_EBIU_AMBCTL0_RAT B0RAT_2
248#endif
249#if (flash_EBIU_AMBCTL_RAT == 1)
250#define flash_EBIU_AMBCTL0_RAT B0RAT_1
251#endif
252
253#define flash_EBIU_AMBCTL0 \
254 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
255 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
diff --git a/arch/blackfin/mach-bf548/include/mach/mem_map.h b/arch/blackfin/mach-bf548/include/mach/mem_map.h
index a2228428dc06..70b9c1194024 100644
--- a/arch/blackfin/mach-bf548/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf548/include/mach/mem_map.h
@@ -108,4 +108,10 @@
108#define L1_SCRATCH_START 0xFFB00000 108#define L1_SCRATCH_START 0xFFB00000
109#define L1_SCRATCH_LENGTH 0x1000 109#define L1_SCRATCH_LENGTH 0x1000
110 110
111#define GET_PDA_SAFE(preg) \
112 preg.l = _cpu_pda; \
113 preg.h = _cpu_pda;
114
115#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
116
111#endif/* _MEM_MAP_548_H_ */ 117#endif/* _MEM_MAP_548_H_ */
diff --git a/arch/blackfin/mach-bf561/Kconfig b/arch/blackfin/mach-bf561/Kconfig
index 3f4895450bea..638ec38ca470 100644
--- a/arch/blackfin/mach-bf561/Kconfig
+++ b/arch/blackfin/mach-bf561/Kconfig
@@ -4,9 +4,9 @@ source "arch/blackfin/mach-bf561/boards/Kconfig"
4 4
5menu "BF561 Specific Configuration" 5menu "BF561 Specific Configuration"
6 6
7comment "Core B Support" 7if (!SMP)
8 8
9menu "Core B Support" 9comment "Core B Support"
10 10
11config BF561_COREB 11config BF561_COREB
12 bool "Enable Core B support" 12 bool "Enable Core B support"
@@ -25,7 +25,7 @@ config BF561_COREB_RESET
25 0 is set, and will reset PC to 0xff600000 when 25 0 is set, and will reset PC to 0xff600000 when
26 COREB_SRAM_INIT is cleared. 26 COREB_SRAM_INIT is cleared.
27 27
28endmenu 28endif
29 29
30comment "Interrupt Priority Assignment" 30comment "Interrupt Priority Assignment"
31 31
@@ -138,7 +138,7 @@ config IRQ_DMA2_11
138 default 9 138 default 9
139config IRQ_TIMER0 139config IRQ_TIMER0
140 int "TIMER 0 Interrupt" 140 int "TIMER 0 Interrupt"
141 default 10 141 default 8
142config IRQ_TIMER1 142config IRQ_TIMER1
143 int "TIMER 1 Interrupt" 143 int "TIMER 1 Interrupt"
144 default 10 144 default 10
diff --git a/arch/blackfin/mach-bf561/Makefile b/arch/blackfin/mach-bf561/Makefile
index f39235a55783..59e18afe28c6 100644
--- a/arch/blackfin/mach-bf561/Makefile
+++ b/arch/blackfin/mach-bf561/Makefile
@@ -2,8 +2,7 @@
2# arch/blackfin/mach-bf561/Makefile 2# arch/blackfin/mach-bf561/Makefile
3# 3#
4 4
5extra-y := head.o
6
7obj-y := ints-priority.o dma.o 5obj-y := ints-priority.o dma.o
8 6
9obj-$(CONFIG_BF561_COREB) += coreb.o 7obj-$(CONFIG_BF561_COREB) += coreb.o
8obj-$(CONFIG_SMP) += smp.o secondary.o atomic.o
diff --git a/arch/blackfin/mach-bf561/atomic.S b/arch/blackfin/mach-bf561/atomic.S
new file mode 100644
index 000000000000..9439bc6bd01f
--- /dev/null
+++ b/arch/blackfin/mach-bf561/atomic.S
@@ -0,0 +1,919 @@
1/*
2 * File: arch/blackfin/mach-bf561/atomic.S
3 * Author: Philippe Gerum <rpm@xenomai.org>
4 *
5 * Copyright 2007 Analog Devices Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see the file COPYING, or write
19 * to the Free Software Foundation, Inc.,
20 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#include <linux/linkage.h>
24#include <asm/blackfin.h>
25#include <asm/cache.h>
26#include <asm/asm-offsets.h>
27#include <asm/rwlock.h>
28#include <asm/cplb.h>
29
30.text
31
32.macro coreslot_loadaddr reg:req
33 \reg\().l = _corelock;
34 \reg\().h = _corelock;
35.endm
36
37/*
38 * r0 = address of atomic data to flush and invalidate (32bit).
39 *
40 * Clear interrupts and return the old mask.
41 * We assume that no atomic data can span cachelines.
42 *
43 * Clobbers: r2:0, p0
44 */
45ENTRY(_get_core_lock)
46 r1 = -L1_CACHE_BYTES;
47 r1 = r0 & r1;
48 cli r0;
49 coreslot_loadaddr p0;
50.Lretry_corelock:
51 testset (p0);
52 if cc jump .Ldone_corelock;
53 SSYNC(r2);
54 jump .Lretry_corelock
55.Ldone_corelock:
56 p0 = r1;
57 CSYNC(r2);
58 flushinv[p0];
59 SSYNC(r2);
60 rts;
61ENDPROC(_get_core_lock)
62
63/*
64 * r0 = address of atomic data in uncacheable memory region (32bit).
65 *
66 * Clear interrupts and return the old mask.
67 *
68 * Clobbers: r0, p0
69 */
70ENTRY(_get_core_lock_noflush)
71 cli r0;
72 coreslot_loadaddr p0;
73.Lretry_corelock_noflush:
74 testset (p0);
75 if cc jump .Ldone_corelock_noflush;
76 SSYNC(r2);
77 jump .Lretry_corelock_noflush
78.Ldone_corelock_noflush:
79 rts;
80ENDPROC(_get_core_lock_noflush)
81
82/*
83 * r0 = interrupt mask to restore.
84 * r1 = address of atomic data to flush and invalidate (32bit).
85 *
86 * Interrupts are masked on entry (see _get_core_lock).
87 * Clobbers: r2:0, p0
88 */
89ENTRY(_put_core_lock)
90 /* Write-through cache assumed, so no flush needed here. */
91 coreslot_loadaddr p0;
92 r1 = 0;
93 [p0] = r1;
94 SSYNC(r2);
95 sti r0;
96 rts;
97ENDPROC(_put_core_lock)
98
99#ifdef __ARCH_SYNC_CORE_DCACHE
100
101ENTRY(___raw_smp_mark_barrier_asm)
102 [--sp] = rets;
103 [--sp] = ( r7:5 );
104 [--sp] = r0;
105 [--sp] = p1;
106 [--sp] = p0;
107 call _get_core_lock_noflush;
108
109 /*
110 * Calculate current core mask
111 */
112 GET_CPUID(p1, r7);
113 r6 = 1;
114 r6 <<= r7;
115
116 /*
117 * Set bit of other cores in barrier mask. Don't change current core bit.
118 */
119 p1.l = _barrier_mask;
120 p1.h = _barrier_mask;
121 r7 = [p1];
122 r5 = r7 & r6;
123 r7 = ~r6;
124 cc = r5 == 0;
125 if cc jump 1f;
126 r7 = r7 | r6;
1271:
128 [p1] = r7;
129 SSYNC(r2);
130
131 call _put_core_lock;
132 p0 = [sp++];
133 p1 = [sp++];
134 r0 = [sp++];
135 ( r7:5 ) = [sp++];
136 rets = [sp++];
137 rts;
138ENDPROC(___raw_smp_mark_barrier_asm)
139
140ENTRY(___raw_smp_check_barrier_asm)
141 [--sp] = rets;
142 [--sp] = ( r7:5 );
143 [--sp] = r0;
144 [--sp] = p1;
145 [--sp] = p0;
146 call _get_core_lock_noflush;
147
148 /*
149 * Calculate current core mask
150 */
151 GET_CPUID(p1, r7);
152 r6 = 1;
153 r6 <<= r7;
154
155 /*
156 * Clear current core bit in barrier mask if it is set.
157 */
158 p1.l = _barrier_mask;
159 p1.h = _barrier_mask;
160 r7 = [p1];
161 r5 = r7 & r6;
162 cc = r5 == 0;
163 if cc jump 1f;
164 r6 = ~r6;
165 r7 = r7 & r6;
166 [p1] = r7;
167 SSYNC(r2);
168
169 call _put_core_lock;
170
171 /*
172 * Invalidate the entire D-cache of current core.
173 */
174 sp += -12;
175 call _resync_core_dcache
176 sp += 12;
177 jump 2f;
1781:
179 call _put_core_lock;
1802:
181 p0 = [sp++];
182 p1 = [sp++];
183 r0 = [sp++];
184 ( r7:5 ) = [sp++];
185 rets = [sp++];
186 rts;
187ENDPROC(___raw_smp_check_barrier_asm)
188
189/*
190 * r0 = irqflags
191 * r1 = address of atomic data
192 *
193 * Clobbers: r2:0, p1:0
194 */
195_start_lock_coherent:
196
197 [--sp] = rets;
198 [--sp] = ( r7:6 );
199 r7 = r0;
200 p1 = r1;
201
202 /*
203 * Determine whether the atomic data was previously
204 * owned by another CPU (=r6).
205 */
206 GET_CPUID(p0, r2);
207 r1 = 1;
208 r1 <<= r2;
209 r2 = ~r1;
210
211 r1 = [p1];
212 r1 >>= 28; /* CPU fingerprints are stored in the high nibble. */
213 r6 = r1 & r2;
214 r1 = [p1];
215 r1 <<= 4;
216 r1 >>= 4;
217 [p1] = r1;
218
219 /*
220 * Release the core lock now, but keep IRQs disabled while we are
221 * performing the remaining housekeeping chores for the current CPU.
222 */
223 coreslot_loadaddr p0;
224 r1 = 0;
225 [p0] = r1;
226
227 /*
228 * If another CPU has owned the same atomic section before us,
229 * then our D-cached copy of the shared data protected by the
230 * current spin/write_lock may be obsolete.
231 */
232 cc = r6 == 0;
233 if cc jump .Lcache_synced
234
235 /*
236 * Invalidate the entire D-cache of the current core.
237 */
238 sp += -12;
239 call _resync_core_dcache
240 sp += 12;
241
242.Lcache_synced:
243 SSYNC(r2);
244 sti r7;
245 ( r7:6 ) = [sp++];
246 rets = [sp++];
247 rts
248
249/*
250 * r0 = irqflags
251 * r1 = address of atomic data
252 *
253 * Clobbers: r2:0, p1:0
254 */
255_end_lock_coherent:
256
257 p1 = r1;
258 GET_CPUID(p0, r2);
259 r2 += 28;
260 r1 = 1;
261 r1 <<= r2;
262 r2 = [p1];
263 r2 = r1 | r2;
264 [p1] = r2;
265 r1 = p1;
266 jump _put_core_lock;
267
268#endif /* __ARCH_SYNC_CORE_DCACHE */
269
270/*
271 * r0 = &spinlock->lock
272 *
273 * Clobbers: r3:0, p1:0
274 */
275ENTRY(___raw_spin_is_locked_asm)
276 p1 = r0;
277 [--sp] = rets;
278 call _get_core_lock;
279 r3 = [p1];
280 cc = bittst( r3, 0 );
281 r3 = cc;
282 r1 = p1;
283 call _put_core_lock;
284 rets = [sp++];
285 r0 = r3;
286 rts;
287ENDPROC(___raw_spin_is_locked_asm)
288
289/*
290 * r0 = &spinlock->lock
291 *
292 * Clobbers: r3:0, p1:0
293 */
294ENTRY(___raw_spin_lock_asm)
295 p1 = r0;
296 [--sp] = rets;
297.Lretry_spinlock:
298 call _get_core_lock;
299 r1 = p1;
300 r2 = [p1];
301 cc = bittst( r2, 0 );
302 if cc jump .Lbusy_spinlock
303#ifdef __ARCH_SYNC_CORE_DCACHE
304 r3 = p1;
305 bitset ( r2, 0 ); /* Raise the lock bit. */
306 [p1] = r2;
307 call _start_lock_coherent
308#else
309 r2 = 1;
310 [p1] = r2;
311 call _put_core_lock;
312#endif
313 rets = [sp++];
314 rts;
315
316.Lbusy_spinlock:
317 /* We don't touch the atomic area if busy, so that flush
318 will behave like nop in _put_core_lock. */
319 call _put_core_lock;
320 SSYNC(r2);
321 r0 = p1;
322 jump .Lretry_spinlock
323ENDPROC(___raw_spin_lock_asm)
324
325/*
326 * r0 = &spinlock->lock
327 *
328 * Clobbers: r3:0, p1:0
329 */
330ENTRY(___raw_spin_trylock_asm)
331 p1 = r0;
332 [--sp] = rets;
333 call _get_core_lock;
334 r1 = p1;
335 r3 = [p1];
336 cc = bittst( r3, 0 );
337 if cc jump .Lfailed_trylock
338#ifdef __ARCH_SYNC_CORE_DCACHE
339 bitset ( r3, 0 ); /* Raise the lock bit. */
340 [p1] = r3;
341 call _start_lock_coherent
342#else
343 r2 = 1;
344 [p1] = r2;
345 call _put_core_lock;
346#endif
347 r0 = 1;
348 rets = [sp++];
349 rts;
350.Lfailed_trylock:
351 call _put_core_lock;
352 r0 = 0;
353 rets = [sp++];
354 rts;
355ENDPROC(___raw_spin_trylock_asm)
356
357/*
358 * r0 = &spinlock->lock
359 *
360 * Clobbers: r2:0, p1:0
361 */
362ENTRY(___raw_spin_unlock_asm)
363 p1 = r0;
364 [--sp] = rets;
365 call _get_core_lock;
366 r2 = [p1];
367 bitclr ( r2, 0 );
368 [p1] = r2;
369 r1 = p1;
370#ifdef __ARCH_SYNC_CORE_DCACHE
371 call _end_lock_coherent
372#else
373 call _put_core_lock;
374#endif
375 rets = [sp++];
376 rts;
377ENDPROC(___raw_spin_unlock_asm)
378
379/*
380 * r0 = &rwlock->lock
381 *
382 * Clobbers: r2:0, p1:0
383 */
384ENTRY(___raw_read_lock_asm)
385 p1 = r0;
386 [--sp] = rets;
387 call _get_core_lock;
388.Lrdlock_try:
389 r1 = [p1];
390 r1 += -1;
391 [p1] = r1;
392 cc = r1 < 0;
393 if cc jump .Lrdlock_failed
394 r1 = p1;
395#ifdef __ARCH_SYNC_CORE_DCACHE
396 call _start_lock_coherent
397#else
398 call _put_core_lock;
399#endif
400 rets = [sp++];
401 rts;
402
403.Lrdlock_failed:
404 r1 += 1;
405 [p1] = r1;
406.Lrdlock_wait:
407 r1 = p1;
408 call _put_core_lock;
409 SSYNC(r2);
410 r0 = p1;
411 call _get_core_lock;
412 r1 = [p1];
413 cc = r1 < 2;
414 if cc jump .Lrdlock_wait;
415 jump .Lrdlock_try
416ENDPROC(___raw_read_lock_asm)
417
418/*
419 * r0 = &rwlock->lock
420 *
421 * Clobbers: r3:0, p1:0
422 */
423ENTRY(___raw_read_trylock_asm)
424 p1 = r0;
425 [--sp] = rets;
426 call _get_core_lock;
427 r1 = [p1];
428 cc = r1 <= 0;
429 if cc jump .Lfailed_tryrdlock;
430 r1 += -1;
431 [p1] = r1;
432 r1 = p1;
433#ifdef __ARCH_SYNC_CORE_DCACHE
434 call _start_lock_coherent
435#else
436 call _put_core_lock;
437#endif
438 rets = [sp++];
439 r0 = 1;
440 rts;
441.Lfailed_tryrdlock:
442 r1 = p1;
443 call _put_core_lock;
444 rets = [sp++];
445 r0 = 0;
446 rts;
447ENDPROC(___raw_read_trylock_asm)
448
449/*
450 * r0 = &rwlock->lock
451 *
452 * Note: Processing controlled by a reader lock should not have
453 * any side-effect on cache issues with the other core, so we
454 * just release the core lock and exit (no _end_lock_coherent).
455 *
456 * Clobbers: r3:0, p1:0
457 */
458ENTRY(___raw_read_unlock_asm)
459 p1 = r0;
460 [--sp] = rets;
461 call _get_core_lock;
462 r1 = [p1];
463 r1 += 1;
464 [p1] = r1;
465 r1 = p1;
466 call _put_core_lock;
467 rets = [sp++];
468 rts;
469ENDPROC(___raw_read_unlock_asm)
470
471/*
472 * r0 = &rwlock->lock
473 *
474 * Clobbers: r3:0, p1:0
475 */
476ENTRY(___raw_write_lock_asm)
477 p1 = r0;
478 r3.l = lo(RW_LOCK_BIAS);
479 r3.h = hi(RW_LOCK_BIAS);
480 [--sp] = rets;
481 call _get_core_lock;
482.Lwrlock_try:
483 r1 = [p1];
484 r1 = r1 - r3;
485#ifdef __ARCH_SYNC_CORE_DCACHE
486 r2 = r1;
487 r2 <<= 4;
488 r2 >>= 4;
489 cc = r2 == 0;
490#else
491 cc = r1 == 0;
492#endif
493 if !cc jump .Lwrlock_wait
494 [p1] = r1;
495 r1 = p1;
496#ifdef __ARCH_SYNC_CORE_DCACHE
497 call _start_lock_coherent
498#else
499 call _put_core_lock;
500#endif
501 rets = [sp++];
502 rts;
503
504.Lwrlock_wait:
505 r1 = p1;
506 call _put_core_lock;
507 SSYNC(r2);
508 r0 = p1;
509 call _get_core_lock;
510 r1 = [p1];
511#ifdef __ARCH_SYNC_CORE_DCACHE
512 r1 <<= 4;
513 r1 >>= 4;
514#endif
515 cc = r1 == r3;
516 if !cc jump .Lwrlock_wait;
517 jump .Lwrlock_try
518ENDPROC(___raw_write_lock_asm)
519
520/*
521 * r0 = &rwlock->lock
522 *
523 * Clobbers: r3:0, p1:0
524 */
525ENTRY(___raw_write_trylock_asm)
526 p1 = r0;
527 [--sp] = rets;
528 call _get_core_lock;
529 r1 = [p1];
530 r2.l = lo(RW_LOCK_BIAS);
531 r2.h = hi(RW_LOCK_BIAS);
532 cc = r1 == r2;
533 if !cc jump .Lfailed_trywrlock;
534#ifdef __ARCH_SYNC_CORE_DCACHE
535 r1 >>= 28;
536 r1 <<= 28;
537#else
538 r1 = 0;
539#endif
540 [p1] = r1;
541 r1 = p1;
542#ifdef __ARCH_SYNC_CORE_DCACHE
543 call _start_lock_coherent
544#else
545 call _put_core_lock;
546#endif
547 rets = [sp++];
548 r0 = 1;
549 rts;
550
551.Lfailed_trywrlock:
552 r1 = p1;
553 call _put_core_lock;
554 rets = [sp++];
555 r0 = 0;
556 rts;
557ENDPROC(___raw_write_trylock_asm)
558
559/*
560 * r0 = &rwlock->lock
561 *
562 * Clobbers: r3:0, p1:0
563 */
564ENTRY(___raw_write_unlock_asm)
565 p1 = r0;
566 r3.l = lo(RW_LOCK_BIAS);
567 r3.h = hi(RW_LOCK_BIAS);
568 [--sp] = rets;
569 call _get_core_lock;
570 r1 = [p1];
571 r1 = r1 + r3;
572 [p1] = r1;
573 r1 = p1;
574#ifdef __ARCH_SYNC_CORE_DCACHE
575 call _end_lock_coherent
576#else
577 call _put_core_lock;
578#endif
579 rets = [sp++];
580 rts;
581ENDPROC(___raw_write_unlock_asm)
582
583/*
584 * r0 = ptr
585 * r1 = value
586 *
587 * Add a signed value to a 32bit word and return the new value atomically.
588 * Clobbers: r3:0, p1:0
589 */
590ENTRY(___raw_atomic_update_asm)
591 p1 = r0;
592 r3 = r1;
593 [--sp] = rets;
594 call _get_core_lock;
595 r2 = [p1];
596 r3 = r3 + r2;
597 [p1] = r3;
598 r1 = p1;
599 call _put_core_lock;
600 r0 = r3;
601 rets = [sp++];
602 rts;
603ENDPROC(___raw_atomic_update_asm)
604
605/*
606 * r0 = ptr
607 * r1 = mask
608 *
609 * Clear the mask bits from a 32bit word and return the old 32bit value
610 * atomically.
611 * Clobbers: r3:0, p1:0
612 */
613ENTRY(___raw_atomic_clear_asm)
614 p1 = r0;
615 r3 = ~r1;
616 [--sp] = rets;
617 call _get_core_lock;
618 r2 = [p1];
619 r3 = r2 & r3;
620 [p1] = r3;
621 r3 = r2;
622 r1 = p1;
623 call _put_core_lock;
624 r0 = r3;
625 rets = [sp++];
626 rts;
627ENDPROC(___raw_atomic_clear_asm)
628
629/*
630 * r0 = ptr
631 * r1 = mask
632 *
633 * Set the mask bits into a 32bit word and return the old 32bit value
634 * atomically.
635 * Clobbers: r3:0, p1:0
636 */
637ENTRY(___raw_atomic_set_asm)
638 p1 = r0;
639 r3 = r1;
640 [--sp] = rets;
641 call _get_core_lock;
642 r2 = [p1];
643 r3 = r2 | r3;
644 [p1] = r3;
645 r3 = r2;
646 r1 = p1;
647 call _put_core_lock;
648 r0 = r3;
649 rets = [sp++];
650 rts;
651ENDPROC(___raw_atomic_set_asm)
652
653/*
654 * r0 = ptr
655 * r1 = mask
656 *
657 * XOR the mask bits with a 32bit word and return the old 32bit value
658 * atomically.
659 * Clobbers: r3:0, p1:0
660 */
661ENTRY(___raw_atomic_xor_asm)
662 p1 = r0;
663 r3 = r1;
664 [--sp] = rets;
665 call _get_core_lock;
666 r2 = [p1];
667 r3 = r2 ^ r3;
668 [p1] = r3;
669 r3 = r2;
670 r1 = p1;
671 call _put_core_lock;
672 r0 = r3;
673 rets = [sp++];
674 rts;
675ENDPROC(___raw_atomic_xor_asm)
676
677/*
678 * r0 = ptr
679 * r1 = mask
680 *
681 * Perform a logical AND between the mask bits and a 32bit word, and
682 * return the masked value. We need this on this architecture in
683 * order to invalidate the local cache before testing.
684 *
685 * Clobbers: r3:0, p1:0
686 */
687ENTRY(___raw_atomic_test_asm)
688 p1 = r0;
689 r3 = r1;
690 r1 = -L1_CACHE_BYTES;
691 r1 = r0 & r1;
692 p0 = r1;
693 flushinv[p0];
694 SSYNC(r2);
695 r0 = [p1];
696 r0 = r0 & r3;
697 rts;
698ENDPROC(___raw_atomic_test_asm)
699
700/*
701 * r0 = ptr
702 * r1 = value
703 *
704 * Swap *ptr with value and return the old 32bit value atomically.
705 * Clobbers: r3:0, p1:0
706 */
707#define __do_xchg(src, dst) \
708 p1 = r0; \
709 r3 = r1; \
710 [--sp] = rets; \
711 call _get_core_lock; \
712 r2 = src; \
713 dst = r3; \
714 r3 = r2; \
715 r1 = p1; \
716 call _put_core_lock; \
717 r0 = r3; \
718 rets = [sp++]; \
719 rts;
720
721ENTRY(___raw_xchg_1_asm)
722 __do_xchg(b[p1] (z), b[p1])
723ENDPROC(___raw_xchg_1_asm)
724
725ENTRY(___raw_xchg_2_asm)
726 __do_xchg(w[p1] (z), w[p1])
727ENDPROC(___raw_xchg_2_asm)
728
729ENTRY(___raw_xchg_4_asm)
730 __do_xchg([p1], [p1])
731ENDPROC(___raw_xchg_4_asm)
732
733/*
734 * r0 = ptr
735 * r1 = new
736 * r2 = old
737 *
738 * Swap *ptr with new if *ptr == old and return the previous *ptr
739 * value atomically.
740 *
741 * Clobbers: r3:0, p1:0
742 */
743#define __do_cmpxchg(src, dst) \
744 [--sp] = rets; \
745 [--sp] = r4; \
746 p1 = r0; \
747 r3 = r1; \
748 r4 = r2; \
749 call _get_core_lock; \
750 r2 = src; \
751 cc = r2 == r4; \
752 if !cc jump 1f; \
753 dst = r3; \
754 1: r3 = r2; \
755 r1 = p1; \
756 call _put_core_lock; \
757 r0 = r3; \
758 r4 = [sp++]; \
759 rets = [sp++]; \
760 rts;
761
762ENTRY(___raw_cmpxchg_1_asm)
763 __do_cmpxchg(b[p1] (z), b[p1])
764ENDPROC(___raw_cmpxchg_1_asm)
765
766ENTRY(___raw_cmpxchg_2_asm)
767 __do_cmpxchg(w[p1] (z), w[p1])
768ENDPROC(___raw_cmpxchg_2_asm)
769
770ENTRY(___raw_cmpxchg_4_asm)
771 __do_cmpxchg([p1], [p1])
772ENDPROC(___raw_cmpxchg_4_asm)
773
774/*
775 * r0 = ptr
776 * r1 = bitnr
777 *
778 * Set a bit in a 32bit word and return the old 32bit value atomically.
779 * Clobbers: r3:0, p1:0
780 */
781ENTRY(___raw_bit_set_asm)
782 r2 = r1;
783 r1 = 1;
784 r1 <<= r2;
785 jump ___raw_atomic_set_asm
786ENDPROC(___raw_bit_set_asm)
787
788/*
789 * r0 = ptr
790 * r1 = bitnr
791 *
792 * Clear a bit in a 32bit word and return the old 32bit value atomically.
793 * Clobbers: r3:0, p1:0
794 */
795ENTRY(___raw_bit_clear_asm)
796 r2 = r1;
797 r1 = 1;
798 r1 <<= r2;
799 jump ___raw_atomic_clear_asm
800ENDPROC(___raw_bit_clear_asm)
801
802/*
803 * r0 = ptr
804 * r1 = bitnr
805 *
806 * Toggle a bit in a 32bit word and return the old 32bit value atomically.
807 * Clobbers: r3:0, p1:0
808 */
809ENTRY(___raw_bit_toggle_asm)
810 r2 = r1;
811 r1 = 1;
812 r1 <<= r2;
813 jump ___raw_atomic_xor_asm
814ENDPROC(___raw_bit_toggle_asm)
815
816/*
817 * r0 = ptr
818 * r1 = bitnr
819 *
820 * Test-and-set a bit in a 32bit word and return the old bit value atomically.
821 * Clobbers: r3:0, p1:0
822 */
823ENTRY(___raw_bit_test_set_asm)
824 [--sp] = rets;
825 [--sp] = r1;
826 call ___raw_bit_set_asm
827 r1 = [sp++];
828 r2 = 1;
829 r2 <<= r1;
830 r0 = r0 & r2;
831 cc = r0 == 0;
832 if cc jump 1f
833 r0 = 1;
8341:
835 rets = [sp++];
836 rts;
837ENDPROC(___raw_bit_test_set_asm)
838
839/*
840 * r0 = ptr
841 * r1 = bitnr
842 *
843 * Test-and-clear a bit in a 32bit word and return the old bit value atomically.
844 * Clobbers: r3:0, p1:0
845 */
846ENTRY(___raw_bit_test_clear_asm)
847 [--sp] = rets;
848 [--sp] = r1;
849 call ___raw_bit_clear_asm
850 r1 = [sp++];
851 r2 = 1;
852 r2 <<= r1;
853 r0 = r0 & r2;
854 cc = r0 == 0;
855 if cc jump 1f
856 r0 = 1;
8571:
858 rets = [sp++];
859 rts;
860ENDPROC(___raw_bit_test_clear_asm)
861
862/*
863 * r0 = ptr
864 * r1 = bitnr
865 *
866 * Test-and-toggle a bit in a 32bit word,
867 * and return the old bit value atomically.
868 * Clobbers: r3:0, p1:0
869 */
870ENTRY(___raw_bit_test_toggle_asm)
871 [--sp] = rets;
872 [--sp] = r1;
873 call ___raw_bit_toggle_asm
874 r1 = [sp++];
875 r2 = 1;
876 r2 <<= r1;
877 r0 = r0 & r2;
878 cc = r0 == 0;
879 if cc jump 1f
880 r0 = 1;
8811:
882 rets = [sp++];
883 rts;
884ENDPROC(___raw_bit_test_toggle_asm)
885
886/*
887 * r0 = ptr
888 * r1 = bitnr
889 *
890 * Test a bit in a 32bit word and return its value.
891 * We need this on this architecture in order to invalidate
892 * the local cache before testing.
893 *
894 * Clobbers: r3:0, p1:0
895 */
896ENTRY(___raw_bit_test_asm)
897 r2 = r1;
898 r1 = 1;
899 r1 <<= r2;
900 jump ___raw_atomic_test_asm
901ENDPROC(___raw_bit_test_asm)
902
903/*
904 * r0 = ptr
905 *
906 * Fetch and return an uncached 32bit value.
907 *
908 * Clobbers: r2:0, p1:0
909 */
910ENTRY(___raw_uncached_fetch_asm)
911 p1 = r0;
912 r1 = -L1_CACHE_BYTES;
913 r1 = r0 & r1;
914 p0 = r1;
915 flushinv[p0];
916 SSYNC(r2);
917 r0 = [p1];
918 rts;
919ENDPROC(___raw_uncached_fetch_asm)
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c
index 8f40990eea2f..6880d1ebfe60 100644
--- a/arch/blackfin/mach-bf561/boards/cm_bf561.c
+++ b/arch/blackfin/mach-bf561/boards/cm_bf561.c
@@ -230,6 +230,19 @@ static struct platform_device smc91x_device = {
230}; 230};
231#endif 231#endif
232 232
233static struct resource bfin_gpios_resources = {
234 .start = 0,
235 .end = MAX_BLACKFIN_GPIOS - 1,
236 .flags = IORESOURCE_IRQ,
237};
238
239static struct platform_device bfin_gpios_device = {
240 .name = "simple-gpio",
241 .id = -1,
242 .num_resources = 1,
243 .resource = &bfin_gpios_resources,
244};
245
233#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 246#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
234static struct resource isp1362_hcd_resources[] = { 247static struct resource isp1362_hcd_resources[] = {
235 { 248 {
@@ -287,23 +300,33 @@ static struct platform_device bfin_uart_device = {
287#endif 300#endif
288 301
289#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 302#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
290static struct resource bfin_sir_resources[] = {
291#ifdef CONFIG_BFIN_SIR0 303#ifdef CONFIG_BFIN_SIR0
304static struct resource bfin_sir0_resources[] = {
292 { 305 {
293 .start = 0xFFC00400, 306 .start = 0xFFC00400,
294 .end = 0xFFC004FF, 307 .end = 0xFFC004FF,
295 .flags = IORESOURCE_MEM, 308 .flags = IORESOURCE_MEM,
296 }, 309 },
297#endif 310 {
311 .start = IRQ_UART0_RX,
312 .end = IRQ_UART0_RX+1,
313 .flags = IORESOURCE_IRQ,
314 },
315 {
316 .start = CH_UART0_RX,
317 .end = CH_UART0_RX+1,
318 .flags = IORESOURCE_DMA,
319 },
298}; 320};
299 321
300static struct platform_device bfin_sir_device = { 322static struct platform_device bfin_sir0_device = {
301 .name = "bfin_sir", 323 .name = "bfin_sir",
302 .id = 0, 324 .id = 0,
303 .num_resources = ARRAY_SIZE(bfin_sir_resources), 325 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
304 .resource = bfin_sir_resources, 326 .resource = bfin_sir0_resources,
305}; 327};
306#endif 328#endif
329#endif
307 330
308#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 331#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
309#define PATA_INT IRQ_PF46 332#define PATA_INT IRQ_PF46
@@ -382,7 +405,9 @@ static struct platform_device *cm_bf561_devices[] __initdata = {
382#endif 405#endif
383 406
384#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 407#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
385 &bfin_sir_device, 408#ifdef CONFIG_BFIN_SIR0
409 &bfin_sir0_device,
410#endif
386#endif 411#endif
387 412
388#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 413#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
@@ -400,6 +425,8 @@ static struct platform_device *cm_bf561_devices[] __initdata = {
400#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) 425#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
401 &bfin_pata_device, 426 &bfin_pata_device,
402#endif 427#endif
428
429 &bfin_gpios_device,
403}; 430};
404 431
405static int __init cm_bf561_init(void) 432static int __init cm_bf561_init(void)
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 50b4cdceccfe..0e2178a1aec5 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -43,53 +43,42 @@
43/* 43/*
44 * Name the Board for the /proc/cpuinfo 44 * Name the Board for the /proc/cpuinfo
45 */ 45 */
46const char bfin_board_name[] = "ADDS-BF561-EZKIT"; 46const char bfin_board_name[] = "ADI BF561-EZKIT";
47
48#define ISP1761_BASE 0x2C0F0000
49#define ISP1761_IRQ IRQ_PF10
50 47
51#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE) 48#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
52static struct resource bfin_isp1761_resources[] = { 49#include <linux/usb/isp1760.h>
53 { 50static struct resource bfin_isp1760_resources[] = {
54 .name = "isp1761-regs", 51 [0] = {
55 .start = ISP1761_BASE + 0x00000000, 52 .start = 0x2C0F0000,
56 .end = ISP1761_BASE + 0x000fffff, 53 .end = 0x203C0000 + 0xfffff,
57 .flags = IORESOURCE_MEM, 54 .flags = IORESOURCE_MEM,
58 }, 55 },
59 { 56 [1] = {
60 .start = ISP1761_IRQ, 57 .start = IRQ_PF10,
61 .end = ISP1761_IRQ, 58 .end = IRQ_PF10,
62 .flags = IORESOURCE_IRQ, 59 .flags = IORESOURCE_IRQ,
63 }, 60 },
64}; 61};
65 62
66static struct platform_device bfin_isp1761_device = { 63static struct isp1760_platform_data isp1760_priv = {
67 .name = "isp1761", 64 .is_isp1761 = 0,
68 .id = 0, 65 .port1_disable = 0,
69 .num_resources = ARRAY_SIZE(bfin_isp1761_resources), 66 .bus_width_16 = 1,
70 .resource = bfin_isp1761_resources, 67 .port1_otg = 0,
68 .analog_oc = 0,
69 .dack_polarity_high = 0,
70 .dreq_polarity_high = 0,
71}; 71};
72 72
73static struct platform_device *bfin_isp1761_devices[] = { 73static struct platform_device bfin_isp1760_device = {
74 &bfin_isp1761_device, 74 .name = "isp1760-hcd",
75 .id = 0,
76 .dev = {
77 .platform_data = &isp1760_priv,
78 },
79 .num_resources = ARRAY_SIZE(bfin_isp1760_resources),
80 .resource = bfin_isp1760_resources,
75}; 81};
76
77int __init bfin_isp1761_init(void)
78{
79 unsigned int num_devices = ARRAY_SIZE(bfin_isp1761_devices);
80
81 printk(KERN_INFO "%s(): registering device resources\n", __func__);
82 set_irq_type(ISP1761_IRQ, IRQF_TRIGGER_FALLING);
83
84 return platform_add_devices(bfin_isp1761_devices, num_devices);
85}
86
87void __exit bfin_isp1761_exit(void)
88{
89 platform_device_unregister(&bfin_isp1761_device);
90}
91
92arch_initcall(bfin_isp1761_init);
93#endif 82#endif
94 83
95#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 84#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
@@ -221,23 +210,33 @@ static struct platform_device bfin_uart_device = {
221#endif 210#endif
222 211
223#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 212#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
224static struct resource bfin_sir_resources[] = {
225#ifdef CONFIG_BFIN_SIR0 213#ifdef CONFIG_BFIN_SIR0
214static struct resource bfin_sir0_resources[] = {
226 { 215 {
227 .start = 0xFFC00400, 216 .start = 0xFFC00400,
228 .end = 0xFFC004FF, 217 .end = 0xFFC004FF,
229 .flags = IORESOURCE_MEM, 218 .flags = IORESOURCE_MEM,
230 }, 219 },
231#endif 220 {
221 .start = IRQ_UART0_RX,
222 .end = IRQ_UART0_RX+1,
223 .flags = IORESOURCE_IRQ,
224 },
225 {
226 .start = CH_UART0_RX,
227 .end = CH_UART0_RX+1,
228 .flags = IORESOURCE_DMA,
229 },
232}; 230};
233 231
234static struct platform_device bfin_sir_device = { 232static struct platform_device bfin_sir0_device = {
235 .name = "bfin_sir", 233 .name = "bfin_sir",
236 .id = 0, 234 .id = 0,
237 .num_resources = ARRAY_SIZE(bfin_sir_resources), 235 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
238 .resource = bfin_sir_resources, 236 .resource = bfin_sir0_resources,
239}; 237};
240#endif 238#endif
239#endif
241 240
242#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) 241#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
243static struct mtd_partition ezkit_partitions[] = { 242static struct mtd_partition ezkit_partitions[] = {
@@ -449,6 +448,10 @@ static struct platform_device *ezkit_devices[] __initdata = {
449 &net2272_bfin_device, 448 &net2272_bfin_device,
450#endif 449#endif
451 450
451#if defined(CONFIG_USB_ISP1760_HCD) || defined(CONFIG_USB_ISP1760_HCD_MODULE)
452 &bfin_isp1760_device,
453#endif
454
452#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 455#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
453 &bfin_spi0_device, 456 &bfin_spi0_device,
454#endif 457#endif
@@ -458,7 +461,9 @@ static struct platform_device *ezkit_devices[] __initdata = {
458#endif 461#endif
459 462
460#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 463#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
461 &bfin_sir_device, 464#ifdef CONFIG_BFIN_SIR0
465 &bfin_sir0_device,
466#endif
462#endif 467#endif
463 468
464#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 469#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
diff --git a/arch/blackfin/mach-bf561/boards/generic_board.c b/arch/blackfin/mach-bf561/boards/generic_board.c
index 2faa0072d614..0ba366a0e696 100644
--- a/arch/blackfin/mach-bf561/boards/generic_board.c
+++ b/arch/blackfin/mach-bf561/boards/generic_board.c
@@ -62,10 +62,45 @@ static struct platform_device smc91x_device = {
62}; 62};
63#endif 63#endif
64 64
65#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
66#ifdef CONFIG_BFIN_SIR0
67static struct resource bfin_sir0_resources[] = {
68 {
69 .start = 0xFFC00400,
70 .end = 0xFFC004FF,
71 .flags = IORESOURCE_MEM,
72 },
73 {
74 .start = IRQ_UART0_RX,
75 .end = IRQ_UART0_RX+1,
76 .flags = IORESOURCE_IRQ,
77 },
78 {
79 .start = CH_UART0_RX,
80 .end = CH_UART0_RX+1,
81 .flags = IORESOURCE_DMA,
82 },
83};
84
85static struct platform_device bfin_sir0_device = {
86 .name = "bfin_sir",
87 .id = 0,
88 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
89 .resource = bfin_sir0_resources,
90};
91#endif
92#endif
93
65static struct platform_device *generic_board_devices[] __initdata = { 94static struct platform_device *generic_board_devices[] __initdata = {
66#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 95#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
67 &smc91x_device, 96 &smc91x_device,
68#endif 97#endif
98
99#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
100#ifdef CONFIG_BFIN_SIR0
101 &bfin_sir0_device,
102#endif
103#endif
69}; 104};
70 105
71static int __init generic_board_init(void) 106static int __init generic_board_init(void)
diff --git a/arch/blackfin/mach-bf561/boards/tepla.c b/arch/blackfin/mach-bf561/boards/tepla.c
index c9174b39f98d..6f77dbe952f5 100644
--- a/arch/blackfin/mach-bf561/boards/tepla.c
+++ b/arch/blackfin/mach-bf561/boards/tepla.c
@@ -44,8 +44,42 @@ static struct platform_device smc91x_device = {
44 .resource = smc91x_resources, 44 .resource = smc91x_resources,
45}; 45};
46 46
47#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
48#ifdef CONFIG_BFIN_SIR0
49static struct resource bfin_sir0_resources[] = {
50 {
51 .start = 0xFFC00400,
52 .end = 0xFFC004FF,
53 .flags = IORESOURCE_MEM,
54 },
55 {
56 .start = IRQ_UART0_RX,
57 .end = IRQ_UART0_RX+1,
58 .flags = IORESOURCE_IRQ,
59 },
60 {
61 .start = CH_UART0_RX,
62 .end = CH_UART0_RX+1,
63 .flags = IORESOURCE_DMA,
64 },
65};
66
67static struct platform_device bfin_sir0_device = {
68 .name = "bfin_sir",
69 .id = 0,
70 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
71 .resource = bfin_sir0_resources,
72};
73#endif
74#endif
75
47static struct platform_device *tepla_devices[] __initdata = { 76static struct platform_device *tepla_devices[] __initdata = {
48 &smc91x_device, 77 &smc91x_device,
78#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
79#ifdef CONFIG_BFIN_SIR0
80 &bfin_sir0_device,
81#endif
82#endif
49}; 83};
50 84
51static int __init tepla_init(void) 85static int __init tepla_init(void)
diff --git a/arch/blackfin/mach-bf561/dma.c b/arch/blackfin/mach-bf561/dma.c
index 24415eb82698..42b0037afe61 100644
--- a/arch/blackfin/mach-bf561/dma.c
+++ b/arch/blackfin/mach-bf561/dma.c
@@ -31,7 +31,7 @@
31#include <asm/blackfin.h> 31#include <asm/blackfin.h>
32#include <asm/dma.h> 32#include <asm/dma.h>
33 33
34struct dma_register *dma_io_base_addr[MAX_BLACKFIN_DMA_CHANNEL] = { 34struct dma_register *dma_io_base_addr[MAX_DMA_CHANNELS] = {
35 (struct dma_register *) DMA1_0_NEXT_DESC_PTR, 35 (struct dma_register *) DMA1_0_NEXT_DESC_PTR,
36 (struct dma_register *) DMA1_1_NEXT_DESC_PTR, 36 (struct dma_register *) DMA1_1_NEXT_DESC_PTR,
37 (struct dma_register *) DMA1_2_NEXT_DESC_PTR, 37 (struct dma_register *) DMA1_2_NEXT_DESC_PTR,
diff --git a/arch/blackfin/mach-bf561/head.S b/arch/blackfin/mach-bf561/head.S
deleted file mode 100644
index 31a777a9e699..000000000000
--- a/arch/blackfin/mach-bf561/head.S
+++ /dev/null
@@ -1,136 +0,0 @@
1/*
2 * File: arch/blackfin/mach-bf561/head.S
3 * Based on: arch/blackfin/mach-bf533/head.S
4 * Author:
5 *
6 * Created:
7 * Description: BF561 startup file
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/linkage.h>
31#include <linux/init.h>
32#include <asm/blackfin.h>
33#ifdef CONFIG_BFIN_KERNEL_CLOCK
34#include <asm/clocks.h>
35#include <mach/mem_init.h>
36#endif
37
38.section .l1.text
39#ifdef CONFIG_BFIN_KERNEL_CLOCK
40ENTRY(_start_dma_code)
41 p0.h = hi(SICA_IWR0);
42 p0.l = lo(SICA_IWR0);
43 r0.l = 0x1;
44 [p0] = r0;
45 SSYNC;
46
47 /*
48 * Set PLL_CTL
49 * - [14:09] = MSEL[5:0] : CLKIN / VCO multiplication factors
50 * - [8] = BYPASS : BYPASS the PLL, run CLKIN into CCLK/SCLK
51 * - [7] = output delay (add 200ps of delay to mem signals)
52 * - [6] = input delay (add 200ps of input delay to mem signals)
53 * - [5] = PDWN : 1=All Clocks off
54 * - [3] = STOPCK : 1=Core Clock off
55 * - [1] = PLL_OFF : 1=Disable Power to PLL
56 * - [0] = DF : 1=Pass CLKIN/2 to PLL / 0=Pass CLKIN to PLL
57 * all other bits set to zero
58 */
59
60 p0.h = hi(PLL_LOCKCNT);
61 p0.l = lo(PLL_LOCKCNT);
62 r0 = 0x300(Z);
63 w[p0] = r0.l;
64 ssync;
65
66 P2.H = hi(EBIU_SDGCTL);
67 P2.L = lo(EBIU_SDGCTL);
68 R0 = [P2];
69 BITSET (R0, 24);
70 [P2] = R0;
71 SSYNC;
72
73 r0 = CONFIG_VCO_MULT & 63; /* Load the VCO multiplier */
74 r0 = r0 << 9; /* Shift it over, */
75 r1 = CLKIN_HALF; /* Do we need to divide CLKIN by 2?*/
76 r0 = r1 | r0;
77 r1 = PLL_BYPASS; /* Bypass the PLL? */
78 r1 = r1 << 8; /* Shift it over */
79 r0 = r1 | r0; /* add them all together */
80#ifdef ANOMALY_05000265
81 BITSET(r0, 15); /* Add 250 mV of hysteresis to SPORT input pins */
82#endif
83
84 p0.h = hi(PLL_CTL);
85 p0.l = lo(PLL_CTL); /* Load the address */
86 cli r2; /* Disable interrupts */
87 ssync;
88 w[p0] = r0.l; /* Set the value */
89 idle; /* Wait for the PLL to stablize */
90 sti r2; /* Enable interrupts */
91
92.Lcheck_again:
93 p0.h = hi(PLL_STAT);
94 p0.l = lo(PLL_STAT);
95 R0 = W[P0](Z);
96 CC = BITTST(R0,5);
97 if ! CC jump .Lcheck_again;
98
99 /* Configure SCLK & CCLK Dividers */
100 r0 = (CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
101 p0.h = hi(PLL_DIV);
102 p0.l = lo(PLL_DIV);
103 w[p0] = r0.l;
104 ssync;
105
106 p0.l = lo(EBIU_SDRRC);
107 p0.h = hi(EBIU_SDRRC);
108 r0 = mem_SDRRC;
109 w[p0] = r0.l;
110 ssync;
111
112 P2.H = hi(EBIU_SDGCTL);
113 P2.L = lo(EBIU_SDGCTL);
114 R0 = [P2];
115 BITCLR (R0, 24);
116 p0.h = hi(EBIU_SDSTAT);
117 p0.l = lo(EBIU_SDSTAT);
118 r2.l = w[p0];
119 cc = bittst(r2,3);
120 if !cc jump .Lskip;
121 NOP;
122 BITSET (R0, 23);
123.Lskip:
124 [P2] = R0;
125 SSYNC;
126
127 R0.L = lo(mem_SDGCTL);
128 R0.H = hi(mem_SDGCTL);
129 R1 = [p2];
130 R1 = R1 | R0;
131 [P2] = R1;
132 SSYNC;
133
134 RTS;
135ENDPROC(_start_dma_code)
136#endif /* CONFIG_BFIN_KERNEL_CLOCK */
diff --git a/arch/blackfin/mach-bf561/include/mach/anomaly.h b/arch/blackfin/mach-bf561/include/mach/anomaly.h
index 22990df04ae1..1a9e17562821 100644
--- a/arch/blackfin/mach-bf561/include/mach/anomaly.h
+++ b/arch/blackfin/mach-bf561/include/mach/anomaly.h
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9/* This file shoule be up to date with: 9/* This file shoule be up to date with:
10 * - Revision P, 02/08/2008; ADSP-BF561 Blackfin Processor Anomaly List 10 * - Revision Q, 11/07/2008; ADSP-BF561 Blackfin Processor Anomaly List
11 */ 11 */
12 12
13#ifndef _MACH_ANOMALY_H_ 13#ifndef _MACH_ANOMALY_H_
@@ -264,6 +264,18 @@
264#define ANOMALY_05000371 (1) 264#define ANOMALY_05000371 (1)
265/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */ 265/* Level-Sensitive External GPIO Wakeups May Cause Indefinite Stall */
266#define ANOMALY_05000403 (1) 266#define ANOMALY_05000403 (1)
267/* TESTSET Instruction Causes Data Corruption with Writeback Data Cache Enabled */
268#define ANOMALY_05000412 (1)
269/* Speculative Fetches Can Cause Undesired External FIFO Operations */
270#define ANOMALY_05000416 (1)
271/* Multichannel SPORT Channel Misalignment Under Specific Configuration */
272#define ANOMALY_05000425 (1)
273/* Speculative Fetches of Indirect-Pointer Instructions Can Cause False Hardware Errors */
274#define ANOMALY_05000426 (1)
275/* Lost/Corrupted L2/L3 Memory Write after Speculative L2 Memory Read by Core B */
276#define ANOMALY_05000428 (__SILICON_REVISION__ > 3)
277/* IFLUSH Instruction at End of Hardware Loop Causes Infinite Stall */
278#define ANOMALY_05000443 (1)
267 279
268/* Anomalies that don't exist on this proc */ 280/* Anomalies that don't exist on this proc */
269#define ANOMALY_05000158 (0) 281#define ANOMALY_05000158 (0)
@@ -272,5 +284,7 @@
272#define ANOMALY_05000311 (0) 284#define ANOMALY_05000311 (0)
273#define ANOMALY_05000353 (1) 285#define ANOMALY_05000353 (1)
274#define ANOMALY_05000386 (1) 286#define ANOMALY_05000386 (1)
287#define ANOMALY_05000432 (0)
288#define ANOMALY_05000435 (0)
275 289
276#endif 290#endif
diff --git a/arch/blackfin/mach-bf561/include/mach/bf561.h b/arch/blackfin/mach-bf561/include/mach/bf561.h
index 18b1b3a223ab..9968362a2ee4 100644
--- a/arch/blackfin/mach-bf561/include/mach/bf561.h
+++ b/arch/blackfin/mach-bf561/include/mach/bf561.h
@@ -215,7 +215,7 @@
215#endif 215#endif
216 216
217#ifndef CPU 217#ifndef CPU
218#error Unknown CPU type - This kernel doesn't seem to be configured properly 218#error "Unknown CPU type - This kernel doesn't seem to be configured properly"
219#endif 219#endif
220 220
221#endif /* __MACH_BF561_H__ */ 221#endif /* __MACH_BF561_H__ */
diff --git a/arch/blackfin/mach-bf561/include/mach/bfin_sir.h b/arch/blackfin/mach-bf561/include/mach/bfin_sir.h
deleted file mode 100644
index 9bb87e9e2e9b..000000000000
--- a/arch/blackfin/mach-bf561/include/mach/bfin_sir.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * Blackfin Infra-red Driver
3 *
4 * Copyright 2006-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 *
10 */
11
12#include <linux/serial.h>
13#include <asm/dma.h>
14#include <asm/portmux.h>
15
16#define SIR_UART_GET_CHAR(port) bfin_read16((port)->membase + OFFSET_RBR)
17#define SIR_UART_GET_DLL(port) bfin_read16((port)->membase + OFFSET_DLL)
18#define SIR_UART_GET_IER(port) bfin_read16((port)->membase + OFFSET_IER)
19#define SIR_UART_GET_DLH(port) bfin_read16((port)->membase + OFFSET_DLH)
20#define SIR_UART_GET_IIR(port) bfin_read16((port)->membase + OFFSET_IIR)
21#define SIR_UART_GET_LCR(port) bfin_read16((port)->membase + OFFSET_LCR)
22#define SIR_UART_GET_GCTL(port) bfin_read16((port)->membase + OFFSET_GCTL)
23
24#define SIR_UART_PUT_CHAR(port, v) bfin_write16(((port)->membase + OFFSET_THR), v)
25#define SIR_UART_PUT_DLL(port, v) bfin_write16(((port)->membase + OFFSET_DLL), v)
26#define SIR_UART_PUT_IER(port, v) bfin_write16(((port)->membase + OFFSET_IER), v)
27#define SIR_UART_PUT_DLH(port, v) bfin_write16(((port)->membase + OFFSET_DLH), v)
28#define SIR_UART_PUT_LCR(port, v) bfin_write16(((port)->membase + OFFSET_LCR), v)
29#define SIR_UART_PUT_GCTL(port, v) bfin_write16(((port)->membase + OFFSET_GCTL), v)
30
31#ifdef CONFIG_SIR_BFIN_DMA
32struct dma_rx_buf {
33 char *buf;
34 int head;
35 int tail;
36 };
37#endif /* CONFIG_SIR_BFIN_DMA */
38
39struct bfin_sir_port {
40 unsigned char __iomem *membase;
41 unsigned int irq;
42 unsigned int lsr;
43 unsigned long clk;
44 struct net_device *dev;
45#ifdef CONFIG_SIR_BFIN_DMA
46 int tx_done;
47 struct dma_rx_buf rx_dma_buf;
48 struct timer_list rx_dma_timer;
49 int rx_dma_nrows;
50#endif /* CONFIG_SIR_BFIN_DMA */
51 unsigned int tx_dma_channel;
52 unsigned int rx_dma_channel;
53};
54
55struct bfin_sir_port sir_ports[BFIN_UART_NR_PORTS];
56
57struct bfin_sir_port_res {
58 unsigned long base_addr;
59 int irq;
60 unsigned int rx_dma_channel;
61 unsigned int tx_dma_channel;
62};
63
64struct bfin_sir_port_res bfin_sir_port_resource[] = {
65#ifdef CONFIG_BFIN_SIR0
66 {
67 0xFFC00400,
68 IRQ_UART_RX,
69 CH_UART_RX,
70 CH_UART_TX,
71 },
72#endif
73};
74
75int nr_sirs = ARRAY_SIZE(bfin_sir_port_resource);
76
77struct bfin_sir_self {
78 struct bfin_sir_port *sir_port;
79 spinlock_t lock;
80 unsigned int open;
81 int speed;
82 int newspeed;
83
84 struct sk_buff *txskb;
85 struct sk_buff *rxskb;
86 struct net_device_stats stats;
87 struct device *dev;
88 struct irlap_cb *irlap;
89 struct qos_info qos;
90
91 iobuff_t tx_buff;
92 iobuff_t rx_buff;
93
94 struct work_struct work;
95 int mtt;
96};
97
98static inline unsigned int SIR_UART_GET_LSR(struct bfin_sir_port *port)
99{
100 unsigned int lsr = bfin_read16(port->membase + OFFSET_LSR);
101 port->lsr |= (lsr & (BI|FE|PE|OE));
102 return lsr | port->lsr;
103}
104
105static inline void SIR_UART_CLEAR_LSR(struct bfin_sir_port *port)
106{
107 port->lsr = 0;
108 bfin_read16(port->membase + OFFSET_LSR);
109}
110
111#define DRIVER_NAME "bfin_sir"
112
113static int bfin_sir_hw_init(void)
114{
115 int ret = -ENODEV;
116#ifdef CONFIG_BFIN_SIR0
117 ret = peripheral_request(P_UART0_TX, DRIVER_NAME);
118 if (ret)
119 return ret;
120 ret = peripheral_request(P_UART0_RX, DRIVER_NAME);
121 if (ret)
122 return ret;
123#endif
124 return ret;
125}
diff --git a/arch/blackfin/mach-bf561/include/mach/blackfin.h b/arch/blackfin/mach-bf561/include/mach/blackfin.h
index 0ea8666e6764..f79f6626b7ec 100644
--- a/arch/blackfin/mach-bf561/include/mach/blackfin.h
+++ b/arch/blackfin/mach-bf561/include/mach/blackfin.h
@@ -66,8 +66,12 @@
66 66
67#define bfin_read_SIC_IMASK(x) bfin_read32(SICA_IMASK0 + (x << 2)) 67#define bfin_read_SIC_IMASK(x) bfin_read32(SICA_IMASK0 + (x << 2))
68#define bfin_write_SIC_IMASK(x, val) bfin_write32((SICA_IMASK0 + (x << 2)), val) 68#define bfin_write_SIC_IMASK(x, val) bfin_write32((SICA_IMASK0 + (x << 2)), val)
69#define bfin_read_SICB_IMASK(x) bfin_read32(SICB_IMASK0 + (x << 2))
70#define bfin_write_SICB_IMASK(x, val) bfin_write32((SICB_IMASK0 + (x << 2)), val)
69#define bfin_read_SIC_ISR(x) bfin_read32(SICA_ISR0 + (x << 2)) 71#define bfin_read_SIC_ISR(x) bfin_read32(SICA_ISR0 + (x << 2))
70#define bfin_write_SIC_ISR(x, val) bfin_write32((SICA_ISR0 + (x << 2)), val) 72#define bfin_write_SIC_ISR(x, val) bfin_write32((SICA_ISR0 + (x << 2)), val)
73#define bfin_read_SICB_ISR(x) bfin_read32(SICB_ISR0 + (x << 2))
74#define bfin_write_SICB_ISR(x, val) bfin_write32((SICB_ISR0 + (x << 2)), val)
71 75
72#define BFIN_UART_NR_PORTS 1 76#define BFIN_UART_NR_PORTS 1
73 77
diff --git a/arch/blackfin/mach-bf561/include/mach/cdefBF561.h b/arch/blackfin/mach-bf561/include/mach/cdefBF561.h
index c14d63402e70..95d609f11c97 100644
--- a/arch/blackfin/mach-bf561/include/mach/cdefBF561.h
+++ b/arch/blackfin/mach-bf561/include/mach/cdefBF561.h
@@ -39,65 +39,15 @@
39/*include core specific register pointer definitions*/ 39/*include core specific register pointer definitions*/
40#include <asm/cdef_LPBlackfin.h> 40#include <asm/cdef_LPBlackfin.h>
41 41
42#include <asm/system.h>
43
44/*********************************************************************************** */ 42/*********************************************************************************** */
45/* System MMR Register Map */ 43/* System MMR Register Map */
46/*********************************************************************************** */ 44/*********************************************************************************** */
47 45
48/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */ 46/* Clock and System Control (0xFFC00000 - 0xFFC000FF) */
49#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL) 47#define bfin_read_PLL_CTL() bfin_read16(PLL_CTL)
50/* Writing to PLL_CTL initiates a PLL relock sequence. */
51static __inline__ void bfin_write_PLL_CTL(unsigned int val)
52{
53 unsigned long flags, iwr0, iwr1;
54
55 if (val == bfin_read_PLL_CTL())
56 return;
57
58 local_irq_save(flags);
59 /* Enable the PLL Wakeup bit in SIC IWR */
60 iwr0 = bfin_read32(SICA_IWR0);
61 iwr1 = bfin_read32(SICA_IWR1);
62 /* Only allow PPL Wakeup) */
63 bfin_write32(SICA_IWR0, IWR_ENABLE(0));
64 bfin_write32(SICA_IWR1, 0);
65
66 bfin_write16(PLL_CTL, val);
67 SSYNC();
68 asm("IDLE;");
69
70 bfin_write32(SICA_IWR0, iwr0);
71 bfin_write32(SICA_IWR1, iwr1);
72 local_irq_restore(flags);
73}
74#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV) 48#define bfin_read_PLL_DIV() bfin_read16(PLL_DIV)
75#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val) 49#define bfin_write_PLL_DIV(val) bfin_write16(PLL_DIV,val)
76#define bfin_read_VR_CTL() bfin_read16(VR_CTL) 50#define bfin_read_VR_CTL() bfin_read16(VR_CTL)
77/* Writing to VR_CTL initiates a PLL relock sequence. */
78static __inline__ void bfin_write_VR_CTL(unsigned int val)
79{
80 unsigned long flags, iwr0, iwr1;
81
82 if (val == bfin_read_VR_CTL())
83 return;
84
85 local_irq_save(flags);
86 /* Enable the PLL Wakeup bit in SIC IWR */
87 iwr0 = bfin_read32(SICA_IWR0);
88 iwr1 = bfin_read32(SICA_IWR1);
89 /* Only allow PPL Wakeup) */
90 bfin_write32(SICA_IWR0, IWR_ENABLE(0));
91 bfin_write32(SICA_IWR1, 0);
92
93 bfin_write16(VR_CTL, val);
94 SSYNC();
95 asm("IDLE;");
96
97 bfin_write32(SICA_IWR0, iwr0);
98 bfin_write32(SICA_IWR1, iwr1);
99 local_irq_restore(flags);
100}
101#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT) 51#define bfin_read_PLL_STAT() bfin_read16(PLL_STAT)
102#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val) 52#define bfin_write_PLL_STAT(val) bfin_write16(PLL_STAT,val)
103#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT) 53#define bfin_read_PLL_LOCKCNT() bfin_read16(PLL_LOCKCNT)
@@ -1576,4 +1526,57 @@ static __inline__ void bfin_write_VR_CTL(unsigned int val)
1576#define bfin_read_MDMA_D0_START_ADDR() bfin_read_MDMA1_D0_START_ADDR() 1526#define bfin_read_MDMA_D0_START_ADDR() bfin_read_MDMA1_D0_START_ADDR()
1577#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write_MDMA1_D0_START_ADDR(val) 1527#define bfin_write_MDMA_D0_START_ADDR(val) bfin_write_MDMA1_D0_START_ADDR(val)
1578 1528
1529/* These need to be last due to the cdef/linux inter-dependencies */
1530#include <asm/irq.h>
1531
1532/* Writing to PLL_CTL initiates a PLL relock sequence. */
1533static __inline__ void bfin_write_PLL_CTL(unsigned int val)
1534{
1535 unsigned long flags, iwr0, iwr1;
1536
1537 if (val == bfin_read_PLL_CTL())
1538 return;
1539
1540 local_irq_save_hw(flags);
1541 /* Enable the PLL Wakeup bit in SIC IWR */
1542 iwr0 = bfin_read32(SICA_IWR0);
1543 iwr1 = bfin_read32(SICA_IWR1);
1544 /* Only allow PPL Wakeup) */
1545 bfin_write32(SICA_IWR0, IWR_ENABLE(0));
1546 bfin_write32(SICA_IWR1, 0);
1547
1548 bfin_write16(PLL_CTL, val);
1549 SSYNC();
1550 asm("IDLE;");
1551
1552 bfin_write32(SICA_IWR0, iwr0);
1553 bfin_write32(SICA_IWR1, iwr1);
1554 local_irq_restore_hw(flags);
1555}
1556
1557/* Writing to VR_CTL initiates a PLL relock sequence. */
1558static __inline__ void bfin_write_VR_CTL(unsigned int val)
1559{
1560 unsigned long flags, iwr0, iwr1;
1561
1562 if (val == bfin_read_VR_CTL())
1563 return;
1564
1565 local_irq_save_hw(flags);
1566 /* Enable the PLL Wakeup bit in SIC IWR */
1567 iwr0 = bfin_read32(SICA_IWR0);
1568 iwr1 = bfin_read32(SICA_IWR1);
1569 /* Only allow PPL Wakeup) */
1570 bfin_write32(SICA_IWR0, IWR_ENABLE(0));
1571 bfin_write32(SICA_IWR1, 0);
1572
1573 bfin_write16(VR_CTL, val);
1574 SSYNC();
1575 asm("IDLE;");
1576
1577 bfin_write32(SICA_IWR0, iwr0);
1578 bfin_write32(SICA_IWR1, iwr1);
1579 local_irq_restore_hw(flags);
1580}
1581
1579#endif /* _CDEF_BF561_H */ 1582#endif /* _CDEF_BF561_H */
diff --git a/arch/blackfin/mach-bf561/include/mach/defBF561.h b/arch/blackfin/mach-bf561/include/mach/defBF561.h
index 4eca2026bb92..d7c509759659 100644
--- a/arch/blackfin/mach-bf561/include/mach/defBF561.h
+++ b/arch/blackfin/mach-bf561/include/mach/defBF561.h
@@ -912,6 +912,9 @@
912#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */ 912#define ACTIVE_PLLDISABLED 0x0004 /* Processor In Active Mode With PLL Disabled */
913#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */ 913#define PLL_LOCKED 0x0020 /* PLL_LOCKCNT Has Been Reached */
914 914
915/* SICA_SYSCR Masks */
916#define COREB_SRAM_INIT 0x0020
917
915/* SWRST Mask */ 918/* SWRST Mask */
916#define SYSTEM_RESET 0x0007 /* Initiates a system software reset */ 919#define SYSTEM_RESET 0x0007 /* Initiates a system software reset */
917#define DOUBLE_FAULT_A 0x0008 /* Core A Double Fault Causes Reset */ 920#define DOUBLE_FAULT_A 0x0008 /* Core A Double Fault Causes Reset */
diff --git a/arch/blackfin/mach-bf561/include/mach/dma.h b/arch/blackfin/mach-bf561/include/mach/dma.h
index 8bc46cd89a02..13647c71f1c7 100644
--- a/arch/blackfin/mach-bf561/include/mach/dma.h
+++ b/arch/blackfin/mach-bf561/include/mach/dma.h
@@ -1,13 +1,17 @@
1/***************************************************************************** 1/* mach/dma.h - arch-specific DMA defines
2* 2 *
3* BF-533/2/1 Specific Declarations 3 * Copyright 2004-2008 Analog Devices Inc.
4* 4 *
5****************************************************************************/ 5 * Licensed under the GPL-2 or later.
6 */
6 7
7#ifndef _MACH_DMA_H_ 8#ifndef _MACH_DMA_H_
8#define _MACH_DMA_H_ 9#define _MACH_DMA_H_
9 10
10#define MAX_BLACKFIN_DMA_CHANNEL 36 11#define MAX_DMA_CHANNELS 36
12
13/* [#4267] IMDMA channels have no PERIPHERAL_MAP MMR */
14#define MAX_DMA_SUSPEND_CHANNELS 32
11 15
12#define CH_PPI0 0 16#define CH_PPI0 0
13#define CH_PPI (CH_PPI0) 17#define CH_PPI (CH_PPI0)
diff --git a/arch/blackfin/mach-bf561/include/mach/gpio.h b/arch/blackfin/mach-bf561/include/mach/gpio.h
new file mode 100644
index 000000000000..7882f79e1ade
--- /dev/null
+++ b/arch/blackfin/mach-bf561/include/mach/gpio.h
@@ -0,0 +1,68 @@
1/*
2 * File: arch/blackfin/mach-bf561/include/mach/gpio.h
3 * Bugs: Enter bugs at http://blackfin.uclinux.org/
4 *
5 * Copyright (C) 2008 Analog Devices Inc.
6 * Licensed under the GPL-2 or later.
7 */
8
9
10#ifndef _MACH_GPIO_H_
11#define _MACH_GPIO_H_
12
13#define MAX_BLACKFIN_GPIOS 48
14
15#define GPIO_PF0 0
16#define GPIO_PF1 1
17#define GPIO_PF2 2
18#define GPIO_PF3 3
19#define GPIO_PF4 4
20#define GPIO_PF5 5
21#define GPIO_PF6 6
22#define GPIO_PF7 7
23#define GPIO_PF8 8
24#define GPIO_PF9 9
25#define GPIO_PF10 10
26#define GPIO_PF11 11
27#define GPIO_PF12 12
28#define GPIO_PF13 13
29#define GPIO_PF14 14
30#define GPIO_PF15 15
31#define GPIO_PF16 16
32#define GPIO_PF17 17
33#define GPIO_PF18 18
34#define GPIO_PF19 19
35#define GPIO_PF20 20
36#define GPIO_PF21 21
37#define GPIO_PF22 22
38#define GPIO_PF23 23
39#define GPIO_PF24 24
40#define GPIO_PF25 25
41#define GPIO_PF26 26
42#define GPIO_PF27 27
43#define GPIO_PF28 28
44#define GPIO_PF29 29
45#define GPIO_PF30 30
46#define GPIO_PF31 31
47#define GPIO_PF32 32
48#define GPIO_PF33 33
49#define GPIO_PF34 34
50#define GPIO_PF35 35
51#define GPIO_PF36 36
52#define GPIO_PF37 37
53#define GPIO_PF38 38
54#define GPIO_PF39 39
55#define GPIO_PF40 40
56#define GPIO_PF41 41
57#define GPIO_PF42 42
58#define GPIO_PF43 43
59#define GPIO_PF44 44
60#define GPIO_PF45 45
61#define GPIO_PF46 46
62#define GPIO_PF47 47
63
64#define PORT_FIO0 GPIO_0
65#define PORT_FIO1 GPIO_16
66#define PORT_FIO2 GPIO_32
67
68#endif /* _MACH_GPIO_H_ */
diff --git a/arch/blackfin/mach-bf561/include/mach/mem_init.h b/arch/blackfin/mach-bf561/include/mach/mem_init.h
deleted file mode 100644
index e163260bca18..000000000000
--- a/arch/blackfin/mach-bf561/include/mach/mem_init.h
+++ /dev/null
@@ -1,295 +0,0 @@
1/*
2 * File: include/asm-blackfin/mach-bf561/mem_init.h
3 * Based on:
4 * Author:
5 *
6 * Created:
7 * Description:
8 *
9 * Rev:
10 *
11 * Modified:
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; see the file COPYING.
27 * If not, write to the Free Software Foundation,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 */
30
31#if (CONFIG_MEM_MT48LC16M16A2TG_75 || CONFIG_MEM_MT48LC64M4A2FB_7E || CONFIG_MEM_GENERIC_BOARD || CONFIG_MEM_MT48LC8M32B2B5_7)
32#if (CONFIG_SCLK_HZ > 119402985)
33#define SDRAM_tRP TRP_2
34#define SDRAM_tRP_num 2
35#define SDRAM_tRAS TRAS_7
36#define SDRAM_tRAS_num 7
37#define SDRAM_tRCD TRCD_2
38#define SDRAM_tWR TWR_2
39#endif
40#if (CONFIG_SCLK_HZ > 104477612) && (CONFIG_SCLK_HZ <= 119402985)
41#define SDRAM_tRP TRP_2
42#define SDRAM_tRP_num 2
43#define SDRAM_tRAS TRAS_6
44#define SDRAM_tRAS_num 6
45#define SDRAM_tRCD TRCD_2
46#define SDRAM_tWR TWR_2
47#endif
48#if (CONFIG_SCLK_HZ > 89552239) && (CONFIG_SCLK_HZ <= 104477612)
49#define SDRAM_tRP TRP_2
50#define SDRAM_tRP_num 2
51#define SDRAM_tRAS TRAS_5
52#define SDRAM_tRAS_num 5
53#define SDRAM_tRCD TRCD_2
54#define SDRAM_tWR TWR_2
55#endif
56#if (CONFIG_SCLK_HZ > 74626866) && (CONFIG_SCLK_HZ <= 89552239)
57#define SDRAM_tRP TRP_2
58#define SDRAM_tRP_num 2
59#define SDRAM_tRAS TRAS_4
60#define SDRAM_tRAS_num 4
61#define SDRAM_tRCD TRCD_2
62#define SDRAM_tWR TWR_2
63#endif
64#if (CONFIG_SCLK_HZ > 66666667) && (CONFIG_SCLK_HZ <= 74626866)
65#define SDRAM_tRP TRP_2
66#define SDRAM_tRP_num 2
67#define SDRAM_tRAS TRAS_3
68#define SDRAM_tRAS_num 3
69#define SDRAM_tRCD TRCD_2
70#define SDRAM_tWR TWR_2
71#endif
72#if (CONFIG_SCLK_HZ > 59701493) && (CONFIG_SCLK_HZ <= 66666667)
73#define SDRAM_tRP TRP_1
74#define SDRAM_tRP_num 1
75#define SDRAM_tRAS TRAS_4
76#define SDRAM_tRAS_num 3
77#define SDRAM_tRCD TRCD_1
78#define SDRAM_tWR TWR_2
79#endif
80#if (CONFIG_SCLK_HZ > 44776119) && (CONFIG_SCLK_HZ <= 59701493)
81#define SDRAM_tRP TRP_1
82#define SDRAM_tRP_num 1
83#define SDRAM_tRAS TRAS_3
84#define SDRAM_tRAS_num 3
85#define SDRAM_tRCD TRCD_1
86#define SDRAM_tWR TWR_2
87#endif
88#if (CONFIG_SCLK_HZ > 29850746) && (CONFIG_SCLK_HZ <= 44776119)
89#define SDRAM_tRP TRP_1
90#define SDRAM_tRP_num 1
91#define SDRAM_tRAS TRAS_2
92#define SDRAM_tRAS_num 2
93#define SDRAM_tRCD TRCD_1
94#define SDRAM_tWR TWR_2
95#endif
96#if (CONFIG_SCLK_HZ <= 29850746)
97#define SDRAM_tRP TRP_1
98#define SDRAM_tRP_num 1
99#define SDRAM_tRAS TRAS_1
100#define SDRAM_tRAS_num 1
101#define SDRAM_tRCD TRCD_1
102#define SDRAM_tWR TWR_2
103#endif
104#endif
105
106#if (CONFIG_MEM_MT48LC16M16A2TG_75)
107 /*SDRAM INFORMATION: */
108#define SDRAM_Tref 64 /* Refresh period in milliseconds */
109#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
110#define SDRAM_CL CL_3
111#endif
112
113#if (CONFIG_MEM_MT48LC64M4A2FB_7E)
114 /*SDRAM INFORMATION: */
115#define SDRAM_Tref 64 /* Refresh period in milliseconds */
116#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
117#define SDRAM_CL CL_3
118#endif
119
120#if (CONFIG_MEM_MT48LC8M32B2B5_7)
121 /*SDRAM INFORMATION: */
122#define SDRAM_Tref 64 /* Refresh period in milliseconds */
123#define SDRAM_NRA 4096 /* Number of row addresses in SDRAM */
124#define SDRAM_CL CL_3
125#endif
126
127#if (CONFIG_MEM_GENERIC_BOARD)
128 /*SDRAM INFORMATION: Modify this for your board */
129#define SDRAM_Tref 64 /* Refresh period in milliseconds */
130#define SDRAM_NRA 8192 /* Number of row addresses in SDRAM */
131#define SDRAM_CL CL_3
132#endif
133
134/* Equation from section 17 (p17-46) of BF533 HRM */
135#define mem_SDRRC (((CONFIG_SCLK_HZ / 1000) * SDRAM_Tref) / SDRAM_NRA) - (SDRAM_tRAS_num + SDRAM_tRP_num)
136
137/* Enable SCLK Out */
138#define mem_SDGCTL (SCTLE | SDRAM_CL | SDRAM_tRAS | SDRAM_tRP | SDRAM_tRCD | SDRAM_tWR | PSS)
139
140#if defined CONFIG_CLKIN_HALF
141#define CLKIN_HALF 1
142#else
143#define CLKIN_HALF 0
144#endif
145
146#if defined CONFIG_PLL_BYPASS
147#define PLL_BYPASS 1
148#else
149#define PLL_BYPASS 0
150#endif
151
152/***************************************Currently Not Being Used *********************************/
153#define flash_EBIU_AMBCTL_WAT ((CONFIG_FLASH_SPEED_BWAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
154#define flash_EBIU_AMBCTL_RAT ((CONFIG_FLASH_SPEED_BRAT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
155#define flash_EBIU_AMBCTL_HT ((CONFIG_FLASH_SPEED_BHT * 4) / (4000000000 / CONFIG_SCLK_HZ))
156#define flash_EBIU_AMBCTL_ST ((CONFIG_FLASH_SPEED_BST * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
157#define flash_EBIU_AMBCTL_TT ((CONFIG_FLASH_SPEED_BTT * 4) / (4000000000 / CONFIG_SCLK_HZ)) + 1
158
159#if (flash_EBIU_AMBCTL_TT > 3)
160#define flash_EBIU_AMBCTL0_TT B0TT_4
161#endif
162#if (flash_EBIU_AMBCTL_TT == 3)
163#define flash_EBIU_AMBCTL0_TT B0TT_3
164#endif
165#if (flash_EBIU_AMBCTL_TT == 2)
166#define flash_EBIU_AMBCTL0_TT B0TT_2
167#endif
168#if (flash_EBIU_AMBCTL_TT < 2)
169#define flash_EBIU_AMBCTL0_TT B0TT_1
170#endif
171
172#if (flash_EBIU_AMBCTL_ST > 3)
173#define flash_EBIU_AMBCTL0_ST B0ST_4
174#endif
175#if (flash_EBIU_AMBCTL_ST == 3)
176#define flash_EBIU_AMBCTL0_ST B0ST_3
177#endif
178#if (flash_EBIU_AMBCTL_ST == 2)
179#define flash_EBIU_AMBCTL0_ST B0ST_2
180#endif
181#if (flash_EBIU_AMBCTL_ST < 2)
182#define flash_EBIU_AMBCTL0_ST B0ST_1
183#endif
184
185#if (flash_EBIU_AMBCTL_HT > 2)
186#define flash_EBIU_AMBCTL0_HT B0HT_3
187#endif
188#if (flash_EBIU_AMBCTL_HT == 2)
189#define flash_EBIU_AMBCTL0_HT B0HT_2
190#endif
191#if (flash_EBIU_AMBCTL_HT == 1)
192#define flash_EBIU_AMBCTL0_HT B0HT_1
193#endif
194#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT == 0)
195#define flash_EBIU_AMBCTL0_HT B0HT_0
196#endif
197#if (flash_EBIU_AMBCTL_HT == 0 && CONFIG_FLASH_SPEED_BHT != 0)
198#define flash_EBIU_AMBCTL0_HT B0HT_1
199#endif
200
201#if (flash_EBIU_AMBCTL_WAT > 14)
202#define flash_EBIU_AMBCTL0_WAT B0WAT_15
203#endif
204#if (flash_EBIU_AMBCTL_WAT == 14)
205#define flash_EBIU_AMBCTL0_WAT B0WAT_14
206#endif
207#if (flash_EBIU_AMBCTL_WAT == 13)
208#define flash_EBIU_AMBCTL0_WAT B0WAT_13
209#endif
210#if (flash_EBIU_AMBCTL_WAT == 12)
211#define flash_EBIU_AMBCTL0_WAT B0WAT_12
212#endif
213#if (flash_EBIU_AMBCTL_WAT == 11)
214#define flash_EBIU_AMBCTL0_WAT B0WAT_11
215#endif
216#if (flash_EBIU_AMBCTL_WAT == 10)
217#define flash_EBIU_AMBCTL0_WAT B0WAT_10
218#endif
219#if (flash_EBIU_AMBCTL_WAT == 9)
220#define flash_EBIU_AMBCTL0_WAT B0WAT_9
221#endif
222#if (flash_EBIU_AMBCTL_WAT == 8)
223#define flash_EBIU_AMBCTL0_WAT B0WAT_8
224#endif
225#if (flash_EBIU_AMBCTL_WAT == 7)
226#define flash_EBIU_AMBCTL0_WAT B0WAT_7
227#endif
228#if (flash_EBIU_AMBCTL_WAT == 6)
229#define flash_EBIU_AMBCTL0_WAT B0WAT_6
230#endif
231#if (flash_EBIU_AMBCTL_WAT == 5)
232#define flash_EBIU_AMBCTL0_WAT B0WAT_5
233#endif
234#if (flash_EBIU_AMBCTL_WAT == 4)
235#define flash_EBIU_AMBCTL0_WAT B0WAT_4
236#endif
237#if (flash_EBIU_AMBCTL_WAT == 3)
238#define flash_EBIU_AMBCTL0_WAT B0WAT_3
239#endif
240#if (flash_EBIU_AMBCTL_WAT == 2)
241#define flash_EBIU_AMBCTL0_WAT B0WAT_2
242#endif
243#if (flash_EBIU_AMBCTL_WAT == 1)
244#define flash_EBIU_AMBCTL0_WAT B0WAT_1
245#endif
246
247#if (flash_EBIU_AMBCTL_RAT > 14)
248#define flash_EBIU_AMBCTL0_RAT B0RAT_15
249#endif
250#if (flash_EBIU_AMBCTL_RAT == 14)
251#define flash_EBIU_AMBCTL0_RAT B0RAT_14
252#endif
253#if (flash_EBIU_AMBCTL_RAT == 13)
254#define flash_EBIU_AMBCTL0_RAT B0RAT_13
255#endif
256#if (flash_EBIU_AMBCTL_RAT == 12)
257#define flash_EBIU_AMBCTL0_RAT B0RAT_12
258#endif
259#if (flash_EBIU_AMBCTL_RAT == 11)
260#define flash_EBIU_AMBCTL0_RAT B0RAT_11
261#endif
262#if (flash_EBIU_AMBCTL_RAT == 10)
263#define flash_EBIU_AMBCTL0_RAT B0RAT_10
264#endif
265#if (flash_EBIU_AMBCTL_RAT == 9)
266#define flash_EBIU_AMBCTL0_RAT B0RAT_9
267#endif
268#if (flash_EBIU_AMBCTL_RAT == 8)
269#define flash_EBIU_AMBCTL0_RAT B0RAT_8
270#endif
271#if (flash_EBIU_AMBCTL_RAT == 7)
272#define flash_EBIU_AMBCTL0_RAT B0RAT_7
273#endif
274#if (flash_EBIU_AMBCTL_RAT == 6)
275#define flash_EBIU_AMBCTL0_RAT B0RAT_6
276#endif
277#if (flash_EBIU_AMBCTL_RAT == 5)
278#define flash_EBIU_AMBCTL0_RAT B0RAT_5
279#endif
280#if (flash_EBIU_AMBCTL_RAT == 4)
281#define flash_EBIU_AMBCTL0_RAT B0RAT_4
282#endif
283#if (flash_EBIU_AMBCTL_RAT == 3)
284#define flash_EBIU_AMBCTL0_RAT B0RAT_3
285#endif
286#if (flash_EBIU_AMBCTL_RAT == 2)
287#define flash_EBIU_AMBCTL0_RAT B0RAT_2
288#endif
289#if (flash_EBIU_AMBCTL_RAT == 1)
290#define flash_EBIU_AMBCTL0_RAT B0RAT_1
291#endif
292
293#define flash_EBIU_AMBCTL0 \
294 (flash_EBIU_AMBCTL0_WAT | flash_EBIU_AMBCTL0_RAT | flash_EBIU_AMBCTL0_HT | \
295 flash_EBIU_AMBCTL0_ST | flash_EBIU_AMBCTL0_TT | CONFIG_FLASH_SPEED_RDYEN)
diff --git a/arch/blackfin/mach-bf561/include/mach/mem_map.h b/arch/blackfin/mach-bf561/include/mach/mem_map.h
index f1d4c0637bd2..419dffdc96eb 100644
--- a/arch/blackfin/mach-bf561/include/mach/mem_map.h
+++ b/arch/blackfin/mach-bf561/include/mach/mem_map.h
@@ -85,4 +85,84 @@
85#define L1_SCRATCH_START COREA_L1_SCRATCH_START 85#define L1_SCRATCH_START COREA_L1_SCRATCH_START
86#define L1_SCRATCH_LENGTH 0x1000 86#define L1_SCRATCH_LENGTH 0x1000
87 87
88#ifdef __ASSEMBLY__
89
90/*
91 * The following macros both return the address of the PDA for the
92 * current core.
93 *
94 * In its first safe (and hairy) form, the macro neither clobbers any
95 * register aside of the output Preg, nor uses the stack, since it
96 * could be called with an invalid stack pointer, or the current stack
97 * space being uncovered by any CPLB (e.g. early exception handling).
98 *
99 * The constraints on the second form are a bit relaxed, and the code
100 * is allowed to use the specified Dreg for determining the PDA
101 * address to be returned into Preg.
102 */
103#ifdef CONFIG_SMP
104#define GET_PDA_SAFE(preg) \
105 preg.l = lo(DSPID); \
106 preg.h = hi(DSPID); \
107 preg = [preg]; \
108 preg = preg << 2; \
109 preg = preg << 2; \
110 preg = preg << 2; \
111 preg = preg << 2; \
112 preg = preg << 2; \
113 preg = preg << 2; \
114 preg = preg << 2; \
115 preg = preg << 2; \
116 preg = preg << 2; \
117 preg = preg << 2; \
118 preg = preg << 2; \
119 preg = preg << 2; \
120 if cc jump 2f; \
121 cc = preg == 0x0; \
122 preg.l = _cpu_pda; \
123 preg.h = _cpu_pda; \
124 if !cc jump 3f; \
1251: \
126 /* preg = 0x0; */ \
127 cc = !cc; /* restore cc to 0 */ \
128 jump 4f; \
1292: \
130 cc = preg == 0x0; \
131 preg.l = _cpu_pda; \
132 preg.h = _cpu_pda; \
133 if cc jump 4f; \
134 /* preg = 0x1000000; */ \
135 cc = !cc; /* restore cc to 1 */ \
1363: \
137 preg = [preg]; \
1384:
139
140#define GET_PDA(preg, dreg) \
141 preg.l = lo(DSPID); \
142 preg.h = hi(DSPID); \
143 dreg = [preg]; \
144 preg.l = _cpu_pda; \
145 preg.h = _cpu_pda; \
146 cc = bittst(dreg, 0); \
147 if !cc jump 1f; \
148 preg = [preg]; \
1491: \
150
151#define GET_CPUID(preg, dreg) \
152 preg.l = lo(DSPID); \
153 preg.h = hi(DSPID); \
154 dreg = [preg]; \
155 dreg = ROT dreg BY -1; \
156 dreg = CC;
157
158#else
159#define GET_PDA_SAFE(preg) \
160 preg.l = _cpu_pda; \
161 preg.h = _cpu_pda;
162
163#define GET_PDA(preg, dreg) GET_PDA_SAFE(preg)
164#endif /* CONFIG_SMP */
165
166#endif /* __ASSEMBLY__ */
167
88#endif /* _MEM_MAP_533_H_ */ 168#endif /* _MEM_MAP_533_H_ */
diff --git a/arch/blackfin/mach-bf561/include/mach/smp.h b/arch/blackfin/mach-bf561/include/mach/smp.h
new file mode 100644
index 000000000000..f9e65ebe81b2
--- /dev/null
+++ b/arch/blackfin/mach-bf561/include/mach/smp.h
@@ -0,0 +1,22 @@
1#ifndef _MACH_BF561_SMP
2#define _MACH_BF561_SMP
3
4struct task_struct;
5
6void platform_init_cpus(void);
7
8void platform_prepare_cpus(unsigned int max_cpus);
9
10int platform_boot_secondary(unsigned int cpu, struct task_struct *idle);
11
12void platform_secondary_init(unsigned int cpu);
13
14void platform_request_ipi(int (*handler)(int, void *));
15
16void platform_send_ipi(cpumask_t callmap);
17
18void platform_send_ipi_cpu(unsigned int cpu);
19
20void platform_clear_ipi(unsigned int cpu);
21
22#endif /* !_MACH_BF561_SMP */
diff --git a/arch/blackfin/mach-bf561/secondary.S b/arch/blackfin/mach-bf561/secondary.S
new file mode 100644
index 000000000000..35280f06b7b6
--- /dev/null
+++ b/arch/blackfin/mach-bf561/secondary.S
@@ -0,0 +1,215 @@
1/*
2 * File: arch/blackfin/mach-bf561/secondary.S
3 * Based on: arch/blackfin/mach-bf561/head.S
4 * Author: Philippe Gerum <rpm@xenomai.org>
5 *
6 * Copyright 2007 Analog Devices Inc.
7 *
8 * Description: BF561 coreB bootstrap file
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, see the file COPYING, or write
22 * to the Free Software Foundation, Inc.,
23 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 */
25
26#include <linux/linkage.h>
27#include <linux/init.h>
28#include <asm/blackfin.h>
29#include <asm/asm-offsets.h>
30
31__INIT
32
33/* Lay the initial stack into the L1 scratch area of Core B */
34#define INITIAL_STACK (COREB_L1_SCRATCH_START + L1_SCRATCH_LENGTH - 12)
35
36ENTRY(_coreb_trampoline_start)
37 /* Set the SYSCFG register */
38 R0 = 0x36;
39 SYSCFG = R0; /*Enable Cycle Counter and Nesting Of Interrupts(3rd Bit)*/
40 R0 = 0;
41
42 /*Clear Out All the data and pointer Registers*/
43 R1 = R0;
44 R2 = R0;
45 R3 = R0;
46 R4 = R0;
47 R5 = R0;
48 R6 = R0;
49 R7 = R0;
50
51 P0 = R0;
52 P1 = R0;
53 P2 = R0;
54 P3 = R0;
55 P4 = R0;
56 P5 = R0;
57
58 LC0 = r0;
59 LC1 = r0;
60 L0 = r0;
61 L1 = r0;
62 L2 = r0;
63 L3 = r0;
64
65 /* Clear Out All the DAG Registers*/
66 B0 = r0;
67 B1 = r0;
68 B2 = r0;
69 B3 = r0;
70
71 I0 = r0;
72 I1 = r0;
73 I2 = r0;
74 I3 = r0;
75
76 M0 = r0;
77 M1 = r0;
78 M2 = r0;
79 M3 = r0;
80
81 /* Turn off the icache */
82 p0.l = LO(IMEM_CONTROL);
83 p0.h = HI(IMEM_CONTROL);
84 R1 = [p0];
85 R0 = ~ENICPLB;
86 R0 = R0 & R1;
87
88 /* Anomaly 05000125 */
89#ifdef ANOMALY_05000125
90 CLI R2;
91 SSYNC;
92#endif
93 [p0] = R0;
94 SSYNC;
95#ifdef ANOMALY_05000125
96 STI R2;
97#endif
98
99 /* Turn off the dcache */
100 p0.l = LO(DMEM_CONTROL);
101 p0.h = HI(DMEM_CONTROL);
102 R1 = [p0];
103 R0 = ~ENDCPLB;
104 R0 = R0 & R1;
105
106 /* Anomaly 05000125 */
107#ifdef ANOMALY_05000125
108 CLI R2;
109 SSYNC;
110#endif
111 [p0] = R0;
112 SSYNC;
113#ifdef ANOMALY_05000125
114 STI R2;
115#endif
116
117 /* in case of double faults, save a few things */
118 p0.l = _init_retx_coreb;
119 p0.h = _init_retx_coreb;
120 R0 = RETX;
121 [P0] = R0;
122
123#ifdef CONFIG_DEBUG_DOUBLEFAULT
124 /* Only save these if we are storing them,
125 * This happens here, since L1 gets clobbered
126 * below
127 */
128 GET_PDA(p0, r0);
129 r7 = [p0 + PDA_RETX];
130 p1.l = _init_saved_retx_coreb;
131 p1.h = _init_saved_retx_coreb;
132 [p1] = r7;
133
134 r7 = [p0 + PDA_DCPLB];
135 p1.l = _init_saved_dcplb_fault_addr_coreb;
136 p1.h = _init_saved_dcplb_fault_addr_coreb;
137 [p1] = r7;
138
139 r7 = [p0 + PDA_ICPLB];
140 p1.l = _init_saved_icplb_fault_addr_coreb;
141 p1.h = _init_saved_icplb_fault_addr_coreb;
142 [p1] = r7;
143
144 r7 = [p0 + PDA_SEQSTAT];
145 p1.l = _init_saved_seqstat_coreb;
146 p1.h = _init_saved_seqstat_coreb;
147 [p1] = r7;
148#endif
149
150 /* Initialize stack pointer */
151 sp.l = lo(INITIAL_STACK);
152 sp.h = hi(INITIAL_STACK);
153 fp = sp;
154 usp = sp;
155
156 /* This section keeps the processor in supervisor mode
157 * during core B startup. Branches to the idle task.
158 */
159
160 /* EVT15 = _real_start */
161
162 p0.l = lo(EVT15);
163 p0.h = hi(EVT15);
164 p1.l = _coreb_start;
165 p1.h = _coreb_start;
166 [p0] = p1;
167 csync;
168
169 p0.l = lo(IMASK);
170 p0.h = hi(IMASK);
171 p1.l = IMASK_IVG15;
172 p1.h = 0x0;
173 [p0] = p1;
174 csync;
175
176 raise 15;
177 p0.l = .LWAIT_HERE;
178 p0.h = .LWAIT_HERE;
179 reti = p0;
180#if defined(ANOMALY_05000281)
181 nop; nop; nop;
182#endif
183 rti;
184
185.LWAIT_HERE:
186 jump .LWAIT_HERE;
187ENDPROC(_coreb_trampoline_start)
188ENTRY(_coreb_trampoline_end)
189
190ENTRY(_coreb_start)
191 [--sp] = reti;
192
193 p0.l = lo(WDOGB_CTL);
194 p0.h = hi(WDOGB_CTL);
195 r0 = 0xAD6(z);
196 w[p0] = r0; /* Clear the watchdog. */
197 ssync;
198
199 /*
200 * switch to IDLE stack.
201 */
202 p0.l = _secondary_stack;
203 p0.h = _secondary_stack;
204 sp = [p0];
205 usp = sp;
206 fp = sp;
207 sp += -12;
208 call _init_pda
209 sp += 12;
210 call _secondary_start_kernel;
211.L_exit:
212 jump.s .L_exit;
213ENDPROC(_coreb_start)
214
215__FINIT
diff --git a/arch/blackfin/mach-bf561/smp.c b/arch/blackfin/mach-bf561/smp.c
new file mode 100644
index 000000000000..9b27e698c0b2
--- /dev/null
+++ b/arch/blackfin/mach-bf561/smp.c
@@ -0,0 +1,167 @@
1/*
2 * File: arch/blackfin/mach-bf561/smp.c
3 * Author: Philippe Gerum <rpm@xenomai.org>
4 *
5 * Copyright 2007 Analog Devices Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, see the file COPYING, or write
19 * to the Free Software Foundation, Inc.,
20 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#include <linux/init.h>
24#include <linux/kernel.h>
25#include <linux/sched.h>
26#include <linux/delay.h>
27#include <asm/smp.h>
28#include <asm/dma.h>
29
30static DEFINE_SPINLOCK(boot_lock);
31
32static cpumask_t cpu_callin_map;
33
34/*
35 * platform_init_cpus() - Tell the world about how many cores we
36 * have. This is called while setting up the architecture support
37 * (setup_arch()), so don't be too demanding here with respect to
38 * available kernel services.
39 */
40
41void __init platform_init_cpus(void)
42{
43 cpu_set(0, cpu_possible_map); /* CoreA */
44 cpu_set(1, cpu_possible_map); /* CoreB */
45}
46
47void __init platform_prepare_cpus(unsigned int max_cpus)
48{
49 int len;
50
51 len = &coreb_trampoline_end - &coreb_trampoline_start + 1;
52 BUG_ON(len > L1_CODE_LENGTH);
53
54 dma_memcpy((void *)COREB_L1_CODE_START, &coreb_trampoline_start, len);
55
56 /* Both cores ought to be present on a bf561! */
57 cpu_set(0, cpu_present_map); /* CoreA */
58 cpu_set(1, cpu_present_map); /* CoreB */
59
60 printk(KERN_INFO "CoreB bootstrap code to SRAM %p via DMA.\n", (void *)COREB_L1_CODE_START);
61}
62
63int __init setup_profiling_timer(unsigned int multiplier) /* not supported */
64{
65 return -EINVAL;
66}
67
68void __cpuinit platform_secondary_init(unsigned int cpu)
69{
70 local_irq_disable();
71
72 /* Clone setup for peripheral interrupt sources from CoreA. */
73 bfin_write_SICB_IMASK0(bfin_read_SICA_IMASK0());
74 bfin_write_SICB_IMASK1(bfin_read_SICA_IMASK1());
75 SSYNC();
76
77 /* Clone setup for IARs from CoreA. */
78 bfin_write_SICB_IAR0(bfin_read_SICA_IAR0());
79 bfin_write_SICB_IAR1(bfin_read_SICA_IAR1());
80 bfin_write_SICB_IAR2(bfin_read_SICA_IAR2());
81 bfin_write_SICB_IAR3(bfin_read_SICA_IAR3());
82 bfin_write_SICB_IAR4(bfin_read_SICA_IAR4());
83 bfin_write_SICB_IAR5(bfin_read_SICA_IAR5());
84 bfin_write_SICB_IAR6(bfin_read_SICA_IAR6());
85 bfin_write_SICB_IAR7(bfin_read_SICA_IAR7());
86 SSYNC();
87
88 local_irq_enable();
89
90 /* Calibrate loops per jiffy value. */
91 calibrate_delay();
92
93 /* Store CPU-private information to the cpu_data array. */
94 bfin_setup_cpudata(cpu);
95
96 /* We are done with local CPU inits, unblock the boot CPU. */
97 cpu_set(cpu, cpu_callin_map);
98 spin_lock(&boot_lock);
99 spin_unlock(&boot_lock);
100}
101
102int __cpuinit platform_boot_secondary(unsigned int cpu, struct task_struct *idle)
103{
104 unsigned long timeout;
105
106 /* CoreB already running?! */
107 BUG_ON((bfin_read_SICA_SYSCR() & COREB_SRAM_INIT) == 0);
108
109 printk(KERN_INFO "Booting Core B.\n");
110
111 spin_lock(&boot_lock);
112
113 /* Kick CoreB, which should start execution from CORE_SRAM_BASE. */
114 SSYNC();
115 bfin_write_SICA_SYSCR(bfin_read_SICA_SYSCR() & ~COREB_SRAM_INIT);
116 SSYNC();
117
118 timeout = jiffies + 1 * HZ;
119 while (time_before(jiffies, timeout)) {
120 if (cpu_isset(cpu, cpu_callin_map))
121 break;
122 udelay(100);
123 barrier();
124 }
125
126 spin_unlock(&boot_lock);
127
128 return cpu_isset(cpu, cpu_callin_map) ? 0 : -ENOSYS;
129}
130
131void __init platform_request_ipi(irq_handler_t handler)
132{
133 int ret;
134
135 ret = request_irq(IRQ_SUPPLE_0, handler, IRQF_DISABLED,
136 "SMP interrupt", handler);
137 if (ret)
138 panic("Cannot request supplemental interrupt 0 for IPI service\n");
139}
140
141void platform_send_ipi(cpumask_t callmap)
142{
143 unsigned int cpu;
144
145 for_each_cpu_mask(cpu, callmap) {
146 BUG_ON(cpu >= 2);
147 SSYNC();
148 bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (6 + cpu)));
149 SSYNC();
150 }
151}
152
153void platform_send_ipi_cpu(unsigned int cpu)
154{
155 BUG_ON(cpu >= 2);
156 SSYNC();
157 bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (6 + cpu)));
158 SSYNC();
159}
160
161void platform_clear_ipi(unsigned int cpu)
162{
163 BUG_ON(cpu >= 2);
164 SSYNC();
165 bfin_write_SICB_SYSCR(bfin_read_SICB_SYSCR() | (1 << (10 + cpu)));
166 SSYNC();
167}
diff --git a/arch/blackfin/mach-common/Makefile b/arch/blackfin/mach-common/Makefile
index e6ed57c56d4b..1f3228ed713f 100644
--- a/arch/blackfin/mach-common/Makefile
+++ b/arch/blackfin/mach-common/Makefile
@@ -3,10 +3,12 @@
3# 3#
4 4
5obj-y := \ 5obj-y := \
6 cache.o entry.o head.o \ 6 cache.o cache-c.o entry.o head.o \
7 interrupt.o irqpanic.o arch_checks.o ints-priority.o 7 interrupt.o irqpanic.o arch_checks.o ints-priority.o
8 8
9obj-$(CONFIG_BFIN_ICACHE_LOCK) += lock.o 9obj-$(CONFIG_BFIN_ICACHE_LOCK) += lock.o
10obj-$(CONFIG_PM) += pm.o dpmc_modes.o 10obj-$(CONFIG_PM) += pm.o dpmc_modes.o
11obj-$(CONFIG_CPU_FREQ) += cpufreq.o 11obj-$(CONFIG_CPU_FREQ) += cpufreq.o
12obj-$(CONFIG_CPU_VOLTAGE) += dpmc.o 12obj-$(CONFIG_CPU_VOLTAGE) += dpmc.o
13obj-$(CONFIG_SMP) += smp.o
14obj-$(CONFIG_BFIN_KERNEL_CLOCK) += clocks-init.o
diff --git a/arch/blackfin/mach-common/cache-c.c b/arch/blackfin/mach-common/cache-c.c
new file mode 100644
index 000000000000..e6ab1f815123
--- /dev/null
+++ b/arch/blackfin/mach-common/cache-c.c
@@ -0,0 +1,24 @@
1/*
2 * Blackfin cache control code (simpler control-style functions)
3 *
4 * Copyright 2004-2008 Analog Devices Inc.
5 *
6 * Enter bugs at http://blackfin.uclinux.org/
7 *
8 * Licensed under the GPL-2 or later.
9 */
10
11#include <asm/blackfin.h>
12
13/* Invalidate the Entire Data cache by
14 * clearing DMC[1:0] bits
15 */
16void blackfin_invalidate_entire_dcache(void)
17{
18 u32 dmem = bfin_read_DMEM_CONTROL();
19 SSYNC();
20 bfin_write_DMEM_CONTROL(dmem & ~0xc);
21 SSYNC();
22 bfin_write_DMEM_CONTROL(dmem);
23 SSYNC();
24}
diff --git a/arch/blackfin/mach-common/cache.S b/arch/blackfin/mach-common/cache.S
index a028e9450419..3c98dacbf289 100644
--- a/arch/blackfin/mach-common/cache.S
+++ b/arch/blackfin/mach-common/cache.S
@@ -49,13 +49,17 @@
49.ifnb \optflushins 49.ifnb \optflushins
50 \optflushins [P0]; 50 \optflushins [P0];
51.endif 51.endif
52#if ANOMALY_05000443
52.ifb \optnopins 53.ifb \optnopins
532: 542:
54.endif 55.endif
55 \flushins [P0++]; 56 \flushins [P0++];
56.ifnb \optnopins 57.ifnb \optnopins
572: \optnopins; 582: \optnopins;
58.endif 59.endif
60#else
612: \flushins [P0++];
62#endif
59 63
60 RTS; 64 RTS;
61.endm 65.endm
diff --git a/arch/blackfin/mach-common/clocks-init.c b/arch/blackfin/mach-common/clocks-init.c
new file mode 100644
index 000000000000..5d182abefc7b
--- /dev/null
+++ b/arch/blackfin/mach-common/clocks-init.c
@@ -0,0 +1,93 @@
1/*
2 * arch/blackfin/mach-common/clocks-init.c - reprogram clocks / memory
3 *
4 * Copyright 2004-2008 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8
9#include <linux/linkage.h>
10#include <linux/init.h>
11#include <asm/blackfin.h>
12
13#include <asm/dma.h>
14#include <asm/clocks.h>
15#include <asm/mem_init.h>
16
17#define PLL_CTL_VAL \
18 (((CONFIG_VCO_MULT & 63) << 9) | CLKIN_HALF | \
19 (PLL_BYPASS << 8) | (ANOMALY_05000265 ? 0x8000 : 0))
20
21__attribute__((l1_text))
22static void do_sync(void)
23{
24 __builtin_bfin_ssync();
25}
26
27__attribute__((l1_text))
28void init_clocks(void)
29{
30 /* Kill any active DMAs as they may trigger external memory accesses
31 * in the middle of reprogramming things, and that'll screw us up.
32 * For example, any automatic DMAs left by U-Boot for splash screens.
33 */
34 size_t i;
35 for (i = 0; i < MAX_DMA_CHANNELS; ++i) {
36 struct dma_register *dma = dma_io_base_addr[i];
37 dma->cfg = 0;
38 }
39
40 do_sync();
41
42#ifdef SIC_IWR0
43 bfin_write_SIC_IWR0(IWR_ENABLE(0));
44# ifdef SIC_IWR1
45 /* BF52x system reset does not properly reset SIC_IWR1 which
46 * will screw up the bootrom as it relies on MDMA0/1 waking it
47 * up from IDLE instructions. See this report for more info:
48 * http://blackfin.uclinux.org/gf/tracker/4323
49 */
50 if (ANOMALY_05000435)
51 bfin_write_SIC_IWR1(IWR_ENABLE(10) | IWR_ENABLE(11));
52 else
53 bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
54# endif
55# ifdef SIC_IWR2
56 bfin_write_SIC_IWR2(IWR_DISABLE_ALL);
57# endif
58#else
59 bfin_write_SIC_IWR(IWR_ENABLE(0));
60#endif
61 do_sync();
62#ifdef EBIU_SDGCTL
63 bfin_write_EBIU_SDGCTL(bfin_read_EBIU_SDGCTL() | SRFS);
64 do_sync();
65#endif
66
67#ifdef CLKBUFOE
68 bfin_write16(VR_CTL, bfin_read_VR_CTL() | CLKBUFOE);
69 do_sync();
70 __asm__ __volatile__("IDLE;");
71#endif
72 bfin_write_PLL_LOCKCNT(0x300);
73 do_sync();
74 bfin_write16(PLL_CTL, PLL_CTL_VAL);
75 __asm__ __volatile__("IDLE;");
76 bfin_write_PLL_DIV(CONFIG_CCLK_ACT_DIV | CONFIG_SCLK_DIV);
77#ifdef EBIU_SDGCTL
78 bfin_write_EBIU_SDRRC(mem_SDRRC);
79 bfin_write_EBIU_SDGCTL(mem_SDGCTL);
80#else
81 bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() & ~(SRREQ));
82 do_sync();
83 bfin_write_EBIU_RSTCTL(bfin_read_EBIU_RSTCTL() | 0x1);
84 bfin_write_EBIU_DDRCTL0(mem_DDRCTL0);
85 bfin_write_EBIU_DDRCTL1(mem_DDRCTL1);
86 bfin_write_EBIU_DDRCTL2(mem_DDRCTL2);
87#ifdef CONFIG_MEM_EBIU_DDRQUE
88 bfin_write_EBIU_DDRQUE(CONFIG_MEM_EBIU_DDRQUE);
89#endif
90#endif
91 do_sync();
92 bfin_read16(0);
93}
diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c
index dda5443b37ed..72e16605ca09 100644
--- a/arch/blackfin/mach-common/cpufreq.c
+++ b/arch/blackfin/mach-common/cpufreq.c
@@ -104,7 +104,7 @@ static int bfin_target(struct cpufreq_policy *policy,
104 cclk_hz, target_freq, freqs.old); 104 cclk_hz, target_freq, freqs.old);
105 105
106 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 106 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
107 local_irq_save(flags); 107 local_irq_save_hw(flags);
108 plldiv = (bfin_read_PLL_DIV() & SSEL) | dpm_state_table[index].csel; 108 plldiv = (bfin_read_PLL_DIV() & SSEL) | dpm_state_table[index].csel;
109 tscale = dpm_state_table[index].tscale; 109 tscale = dpm_state_table[index].tscale;
110 bfin_write_PLL_DIV(plldiv); 110 bfin_write_PLL_DIV(plldiv);
@@ -112,10 +112,10 @@ static int bfin_target(struct cpufreq_policy *policy,
112 bfin_write_TSCALE(tscale); 112 bfin_write_TSCALE(tscale);
113 cycles = get_cycles(); 113 cycles = get_cycles();
114 SSYNC(); 114 SSYNC();
115 cycles += 10; /* ~10 cycles we loose after get_cycles() */ 115 cycles += 10; /* ~10 cycles we lose after get_cycles() */
116 __bfin_cycles_off += (cycles << __bfin_cycles_mod) - (cycles << index); 116 __bfin_cycles_off += (cycles << __bfin_cycles_mod) - (cycles << index);
117 __bfin_cycles_mod = index; 117 __bfin_cycles_mod = index;
118 local_irq_restore(flags); 118 local_irq_restore_hw(flags);
119 /* TODO: just test case for cycles clock source, remove later */ 119 /* TODO: just test case for cycles clock source, remove later */
120 pr_debug("cpufreq: done\n"); 120 pr_debug("cpufreq: done\n");
121 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 121 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
diff --git a/arch/blackfin/mach-common/dpmc_modes.S b/arch/blackfin/mach-common/dpmc_modes.S
index ad5431e2cd05..4da50bcd9300 100644
--- a/arch/blackfin/mach-common/dpmc_modes.S
+++ b/arch/blackfin/mach-common/dpmc_modes.S
@@ -247,7 +247,8 @@ ENTRY(_unset_dram_srfs)
247ENDPROC(_unset_dram_srfs) 247ENDPROC(_unset_dram_srfs)
248 248
249ENTRY(_set_sic_iwr) 249ENTRY(_set_sic_iwr)
250#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) 250#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) || \
251 defined(CONFIG_BF538) || defined(CONFIG_BF539) || defined(CONFIG_BF51x)
251 P0.H = hi(SIC_IWR0); 252 P0.H = hi(SIC_IWR0);
252 P0.L = lo(SIC_IWR0); 253 P0.L = lo(SIC_IWR0);
253 P1.H = hi(SIC_IWR1); 254 P1.H = hi(SIC_IWR1);
diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S
index bde6dc4e2614..fae774651374 100644
--- a/arch/blackfin/mach-common/entry.S
+++ b/arch/blackfin/mach-common/entry.S
@@ -36,6 +36,7 @@
36#include <linux/init.h> 36#include <linux/init.h>
37#include <linux/linkage.h> 37#include <linux/linkage.h>
38#include <linux/unistd.h> 38#include <linux/unistd.h>
39#include <linux/threads.h>
39#include <asm/blackfin.h> 40#include <asm/blackfin.h>
40#include <asm/errno.h> 41#include <asm/errno.h>
41#include <asm/fixed_code.h> 42#include <asm/fixed_code.h>
@@ -75,11 +76,11 @@ ENTRY(_ex_workaround_261)
75 * handle it. 76 * handle it.
76 */ 77 */
77 P4 = R7; /* Store EXCAUSE */ 78 P4 = R7; /* Store EXCAUSE */
78 p5.l = _last_cplb_fault_retx; 79
79 p5.h = _last_cplb_fault_retx; 80 GET_PDA(p5, r7);
80 r7 = [p5]; 81 r7 = [p5 + PDA_LFRETX];
81 r6 = retx; 82 r6 = retx;
82 [p5] = r6; 83 [p5 + PDA_LFRETX] = r6;
83 cc = r6 == r7; 84 cc = r6 == r7;
84 if !cc jump _bfin_return_from_exception; 85 if !cc jump _bfin_return_from_exception;
85 /* fall through */ 86 /* fall through */
@@ -111,24 +112,21 @@ ENTRY(_ex_dcplb_viol)
111ENTRY(_ex_dcplb_miss) 112ENTRY(_ex_dcplb_miss)
112ENTRY(_ex_icplb_miss) 113ENTRY(_ex_icplb_miss)
113 (R7:6,P5:4) = [sp++]; 114 (R7:6,P5:4) = [sp++];
114 ASTAT = [sp++]; 115 /* We leave the previously pushed ASTAT on the stack. */
115 SAVE_ALL_SYS 116 SAVE_CONTEXT_CPLB
116#ifdef CONFIG_MPU 117
117 /* We must load R1 here, _before_ DEBUG_HWTRACE_SAVE, since that 118 /* We must load R1 here, _before_ DEBUG_HWTRACE_SAVE, since that
118 * will change the stack pointer. */ 119 * will change the stack pointer. */
119 R0 = SEQSTAT; 120 R0 = SEQSTAT;
120 R1 = SP; 121 R1 = SP;
121#endif 122
122 DEBUG_HWTRACE_SAVE(p5, r7) 123 DEBUG_HWTRACE_SAVE(p5, r7)
123#ifdef CONFIG_MPU 124
124 sp += -12; 125 sp += -12;
125 call _cplb_hdr; 126 call _cplb_hdr;
126 sp += 12; 127 sp += 12;
127 CC = R0 == 0; 128 CC = R0 == 0;
128 IF !CC JUMP _handle_bad_cplb; 129 IF !CC JUMP _handle_bad_cplb;
129#else
130 call __cplb_hdr;
131#endif
132 130
133#ifdef CONFIG_DEBUG_DOUBLEFAULT 131#ifdef CONFIG_DEBUG_DOUBLEFAULT
134 /* While we were processing this, did we double fault? */ 132 /* While we were processing this, did we double fault? */
@@ -142,7 +140,8 @@ ENTRY(_ex_icplb_miss)
142#endif 140#endif
143 141
144 DEBUG_HWTRACE_RESTORE(p5, r7) 142 DEBUG_HWTRACE_RESTORE(p5, r7)
145 RESTORE_ALL_SYS 143 RESTORE_CONTEXT_CPLB
144 ASTAT = [SP++];
146 SP = EX_SCRATCH_REG; 145 SP = EX_SCRATCH_REG;
147 rtx; 146 rtx;
148ENDPROC(_ex_icplb_miss) 147ENDPROC(_ex_icplb_miss)
@@ -297,9 +296,8 @@ ENTRY(_handle_bad_cplb)
297 * the stack to get ready so, we can fall through - we 296 * the stack to get ready so, we can fall through - we
298 * need to make a CPLB exception look like a normal exception 297 * need to make a CPLB exception look like a normal exception
299 */ 298 */
300 299 RESTORE_CONTEXT_CPLB
301 RESTORE_ALL_SYS 300 /* ASTAT is still on the stack, where it is needed. */
302 [--sp] = ASTAT;
303 [--sp] = (R7:6,P5:4); 301 [--sp] = (R7:6,P5:4);
304 302
305ENTRY(_ex_replaceable) 303ENTRY(_ex_replaceable)
@@ -324,7 +322,9 @@ ENTRY(_ex_trap_c)
324 [p4] = p5; 322 [p4] = p5;
325 csync; 323 csync;
326 324
325 GET_PDA(p5, r6);
327#ifndef CONFIG_DEBUG_DOUBLEFAULT 326#ifndef CONFIG_DEBUG_DOUBLEFAULT
327
328 /* 328 /*
329 * Save these registers, as they are only valid in exception context 329 * Save these registers, as they are only valid in exception context
330 * (where we are now - as soon as we defer to IRQ5, they can change) 330 * (where we are now - as soon as we defer to IRQ5, they can change)
@@ -335,29 +335,25 @@ ENTRY(_ex_trap_c)
335 p4.l = lo(DCPLB_FAULT_ADDR); 335 p4.l = lo(DCPLB_FAULT_ADDR);
336 p4.h = hi(DCPLB_FAULT_ADDR); 336 p4.h = hi(DCPLB_FAULT_ADDR);
337 r7 = [p4]; 337 r7 = [p4];
338 p5.h = _saved_dcplb_fault_addr; 338 [p5 + PDA_DCPLB] = r7;
339 p5.l = _saved_dcplb_fault_addr;
340 [p5] = r7;
341 339
342 r7 = [p4 + (ICPLB_FAULT_ADDR - DCPLB_FAULT_ADDR)]; 340 p4.l = lo(ICPLB_FAULT_ADDR);
343 p5.h = _saved_icplb_fault_addr; 341 p4.h = hi(ICPLB_FAULT_ADDR);
344 p5.l = _saved_icplb_fault_addr; 342 r6 = [p4];
345 [p5] = r7; 343 [p5 + PDA_ICPLB] = r6;
346 344
347 r6 = retx; 345 r6 = retx;
348 p4.l = _saved_retx; 346 [p5 + PDA_RETX] = r6;
349 p4.h = _saved_retx;
350 [p4] = r6;
351#endif 347#endif
352 r6 = SYSCFG; 348 r6 = SYSCFG;
353 [p4 + 4] = r6; 349 [p5 + PDA_SYSCFG] = r6;
354 BITCLR(r6, 0); 350 BITCLR(r6, 0);
355 SYSCFG = r6; 351 SYSCFG = r6;
356 352
357 /* Disable all interrupts, but make sure level 5 is enabled so 353 /* Disable all interrupts, but make sure level 5 is enabled so
358 * we can switch to that level. Save the old mask. */ 354 * we can switch to that level. Save the old mask. */
359 cli r6; 355 cli r6;
360 [p4 + 8] = r6; 356 [p5 + PDA_EXIMASK] = r6;
361 357
362 p4.l = lo(SAFE_USER_INSTRUCTION); 358 p4.l = lo(SAFE_USER_INSTRUCTION);
363 p4.h = hi(SAFE_USER_INSTRUCTION); 359 p4.h = hi(SAFE_USER_INSTRUCTION);
@@ -371,9 +367,10 @@ ENTRY(_ex_trap_c)
371ENDPROC(_ex_trap_c) 367ENDPROC(_ex_trap_c)
372 368
373/* We just realized we got an exception, while we were processing a different 369/* We just realized we got an exception, while we were processing a different
374 * exception. This is a unrecoverable event, so crash 370 * exception. This is a unrecoverable event, so crash.
371 * Note: this cannot be ENTRY() as we jump here with "if cc jump" ...
375 */ 372 */
376ENTRY(_double_fault) 373_double_fault:
377 /* Turn caches & protection off, to ensure we don't get any more 374 /* Turn caches & protection off, to ensure we don't get any more
378 * double exceptions 375 * double exceptions
379 */ 376 */
@@ -424,17 +421,16 @@ ENDPROC(_double_fault)
424ENTRY(_exception_to_level5) 421ENTRY(_exception_to_level5)
425 SAVE_ALL_SYS 422 SAVE_ALL_SYS
426 423
427 p4.l = _saved_retx; 424 GET_PDA(p4, r7); /* Fetch current PDA */
428 p4.h = _saved_retx; 425 r6 = [p4 + PDA_RETX];
429 r6 = [p4];
430 [sp + PT_PC] = r6; 426 [sp + PT_PC] = r6;
431 427
432 r6 = [p4 + 4]; 428 r6 = [p4 + PDA_SYSCFG];
433 [sp + PT_SYSCFG] = r6; 429 [sp + PT_SYSCFG] = r6;
434 430
435 /* Restore interrupt mask. We haven't pushed RETI, so this 431 /* Restore interrupt mask. We haven't pushed RETI, so this
436 * doesn't enable interrupts until we return from this handler. */ 432 * doesn't enable interrupts until we return from this handler. */
437 r6 = [p4 + 8]; 433 r6 = [p4 + PDA_EXIMASK];
438 sti r6; 434 sti r6;
439 435
440 /* Restore the hardware error vector. */ 436 /* Restore the hardware error vector. */
@@ -478,8 +474,8 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
478 * scratch register (for want of a better option). 474 * scratch register (for want of a better option).
479 */ 475 */
480 EX_SCRATCH_REG = sp; 476 EX_SCRATCH_REG = sp;
481 sp.l = _exception_stack_top; 477 GET_PDA_SAFE(sp);
482 sp.h = _exception_stack_top; 478 sp = [sp + PDA_EXSTACK]
483 /* Try to deal with syscalls quickly. */ 479 /* Try to deal with syscalls quickly. */
484 [--sp] = ASTAT; 480 [--sp] = ASTAT;
485 [--sp] = (R7:6,P5:4); 481 [--sp] = (R7:6,P5:4);
@@ -501,27 +497,22 @@ ENTRY(_trap) /* Exception: 4th entry into system event table(supervisor mode)*/
501 * but they are not very interesting, so don't save them 497 * but they are not very interesting, so don't save them
502 */ 498 */
503 499
500 GET_PDA(p5, r7);
504 p4.l = lo(DCPLB_FAULT_ADDR); 501 p4.l = lo(DCPLB_FAULT_ADDR);
505 p4.h = hi(DCPLB_FAULT_ADDR); 502 p4.h = hi(DCPLB_FAULT_ADDR);
506 r7 = [p4]; 503 r7 = [p4];
507 p5.h = _saved_dcplb_fault_addr; 504 [p5 + PDA_DCPLB] = r7;
508 p5.l = _saved_dcplb_fault_addr;
509 [p5] = r7;
510 505
511 r7 = [p4 + (ICPLB_FAULT_ADDR - DCPLB_FAULT_ADDR)]; 506 p4.l = lo(ICPLB_FAULT_ADDR);
512 p5.h = _saved_icplb_fault_addr; 507 p4.h = hi(ICPLB_FAULT_ADDR);
513 p5.l = _saved_icplb_fault_addr; 508 r7 = [p4];
514 [p5] = r7; 509 [p5 + PDA_ICPLB] = r7;
515 510
516 p4.l = _saved_retx;
517 p4.h = _saved_retx;
518 r6 = retx; 511 r6 = retx;
519 [p4] = r6; 512 [p5 + PDA_RETX] = r6;
520 513
521 r7 = SEQSTAT; /* reason code is in bit 5:0 */ 514 r7 = SEQSTAT; /* reason code is in bit 5:0 */
522 p4.l = _saved_seqstat; 515 [p5 + PDA_SEQSTAT] = r7;
523 p4.h = _saved_seqstat;
524 [p4] = r7;
525#else 516#else
526 r7 = SEQSTAT; /* reason code is in bit 5:0 */ 517 r7 = SEQSTAT; /* reason code is in bit 5:0 */
527#endif 518#endif
@@ -546,11 +537,11 @@ ENTRY(_kernel_execve)
546 p0 = sp; 537 p0 = sp;
547 r3 = SIZEOF_PTREGS / 4; 538 r3 = SIZEOF_PTREGS / 4;
548 r4 = 0(x); 539 r4 = 0(x);
5490: 540.Lclear_regs:
550 [p0++] = r4; 541 [p0++] = r4;
551 r3 += -1; 542 r3 += -1;
552 cc = r3 == 0; 543 cc = r3 == 0;
553 if !cc jump 0b (bp); 544 if !cc jump .Lclear_regs (bp);
554 545
555 p0 = sp; 546 p0 = sp;
556 sp += -16; 547 sp += -16;
@@ -558,7 +549,7 @@ ENTRY(_kernel_execve)
558 call _do_execve; 549 call _do_execve;
559 SP += 16; 550 SP += 16;
560 cc = r0 == 0; 551 cc = r0 == 0;
561 if ! cc jump 1f; 552 if ! cc jump .Lexecve_failed;
562 /* Success. Copy our temporary pt_regs to the top of the kernel 553 /* Success. Copy our temporary pt_regs to the top of the kernel
563 * stack and do a normal exception return. 554 * stack and do a normal exception return.
564 */ 555 */
@@ -574,12 +565,12 @@ ENTRY(_kernel_execve)
574 p0 = fp; 565 p0 = fp;
575 r4 = [p0--]; 566 r4 = [p0--];
576 r3 = SIZEOF_PTREGS / 4; 567 r3 = SIZEOF_PTREGS / 4;
5770: 568.Lcopy_regs:
578 r4 = [p0--]; 569 r4 = [p0--];
579 [p1--] = r4; 570 [p1--] = r4;
580 r3 += -1; 571 r3 += -1;
581 cc = r3 == 0; 572 cc = r3 == 0;
582 if ! cc jump 0b (bp); 573 if ! cc jump .Lcopy_regs (bp);
583 574
584 r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z); 575 r0 = (KERNEL_STACK_SIZE - SIZEOF_PTREGS) (z);
585 p1 = r0; 576 p1 = r0;
@@ -591,7 +582,7 @@ ENTRY(_kernel_execve)
591 582
592 RESTORE_CONTEXT; 583 RESTORE_CONTEXT;
593 rti; 584 rti;
5941: 585.Lexecve_failed:
595 unlink; 586 unlink;
596 rts; 587 rts;
597ENDPROC(_kernel_execve) 588ENDPROC(_kernel_execve)
@@ -925,9 +916,14 @@ _schedule_and_signal_from_int:
925 p1 = rets; 916 p1 = rets;
926 [sp + PT_RESERVED] = p1; 917 [sp + PT_RESERVED] = p1;
927 918
928 p0.l = _irq_flags; 919#ifdef CONFIG_SMP
929 p0.h = _irq_flags; 920 GET_PDA(p0, r0); /* Fetch current PDA (can't migrate to other CPU here) */
921 r0 = [p0 + PDA_IRQFLAGS];
922#else
923 p0.l = _bfin_irq_flags;
924 p0.h = _bfin_irq_flags;
930 r0 = [p0]; 925 r0 = [p0];
926#endif
931 sti r0; 927 sti r0;
932 928
933 r0 = sp; 929 r0 = sp;
@@ -1539,14 +1535,18 @@ ENTRY(_sys_call_table)
1539 .endr 1535 .endr
1540END(_sys_call_table) 1536END(_sys_call_table)
1541 1537
1542_exception_stack: 1538#ifdef CONFIG_EXCEPTION_L1_SCRATCH
1543 .rept 1024 1539/* .section .l1.bss.scratch */
1544 .long 0; 1540.set _exception_stack_top, L1_SCRATCH_START + L1_SCRATCH_LENGTH
1541#else
1542#ifdef CONFIG_SYSCALL_TAB_L1
1543.section .l1.bss
1544#else
1545.bss
1546#endif
1547ENTRY(_exception_stack)
1548 .rept 1024 * NR_CPUS
1549 .long 0
1545 .endr 1550 .endr
1546_exception_stack_top: 1551_exception_stack_top:
1547
1548#if ANOMALY_05000261
1549/* Used by the assembly entry point to work around an anomaly. */
1550_last_cplb_fault_retx:
1551 .long 0;
1552#endif 1552#endif
diff --git a/arch/blackfin/mach-common/head.S b/arch/blackfin/mach-common/head.S
index f123a62e2451..e1e42c029e15 100644
--- a/arch/blackfin/mach-common/head.S
+++ b/arch/blackfin/mach-common/head.S
@@ -13,6 +13,7 @@
13#include <asm/blackfin.h> 13#include <asm/blackfin.h>
14#include <asm/thread_info.h> 14#include <asm/thread_info.h>
15#include <asm/trace.h> 15#include <asm/trace.h>
16#include <asm/asm-offsets.h>
16 17
17__INIT 18__INIT
18 19
@@ -111,33 +112,26 @@ ENTRY(__start)
111 * This happens here, since L1 gets clobbered 112 * This happens here, since L1 gets clobbered
112 * below 113 * below
113 */ 114 */
114 p0.l = _saved_retx; 115 GET_PDA(p0, r0);
115 p0.h = _saved_retx; 116 r7 = [p0 + PDA_RETX];
116 p1.l = _init_saved_retx; 117 p1.l = _init_saved_retx;
117 p1.h = _init_saved_retx; 118 p1.h = _init_saved_retx;
118 r0 = [p0]; 119 [p1] = r7;
119 [p1] = r0;
120 120
121 p0.l = _saved_dcplb_fault_addr; 121 r7 = [p0 + PDA_DCPLB];
122 p0.h = _saved_dcplb_fault_addr;
123 p1.l = _init_saved_dcplb_fault_addr; 122 p1.l = _init_saved_dcplb_fault_addr;
124 p1.h = _init_saved_dcplb_fault_addr; 123 p1.h = _init_saved_dcplb_fault_addr;
125 r0 = [p0]; 124 [p1] = r7;
126 [p1] = r0;
127 125
128 p0.l = _saved_icplb_fault_addr; 126 r7 = [p0 + PDA_ICPLB];
129 p0.h = _saved_icplb_fault_addr;
130 p1.l = _init_saved_icplb_fault_addr; 127 p1.l = _init_saved_icplb_fault_addr;
131 p1.h = _init_saved_icplb_fault_addr; 128 p1.h = _init_saved_icplb_fault_addr;
132 r0 = [p0]; 129 [p1] = r7;
133 [p1] = r0;
134 130
135 p0.l = _saved_seqstat; 131 r7 = [p0 + PDA_SEQSTAT];
136 p0.h = _saved_seqstat;
137 p1.l = _init_saved_seqstat; 132 p1.l = _init_saved_seqstat;
138 p1.h = _init_saved_seqstat; 133 p1.h = _init_saved_seqstat;
139 r0 = [p0]; 134 [p1] = r7;
140 [p1] = r0;
141#endif 135#endif
142 136
143 /* Initialize stack pointer */ 137 /* Initialize stack pointer */
@@ -153,7 +147,7 @@ ENTRY(__start)
153 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */ 147 /* Put The Code for PLL Programming and SDRAM Programming in L1 ISRAM */
154 call _bfin_relocate_l1_mem; 148 call _bfin_relocate_l1_mem;
155#ifdef CONFIG_BFIN_KERNEL_CLOCK 149#ifdef CONFIG_BFIN_KERNEL_CLOCK
156 call _start_dma_code; 150 call _init_clocks;
157#endif 151#endif
158 152
159 /* This section keeps the processor in supervisor mode 153 /* This section keeps the processor in supervisor mode
@@ -170,12 +164,8 @@ ENTRY(__start)
170 [p0] = p1; 164 [p0] = p1;
171 csync; 165 csync;
172 166
173 p0.l = lo(IMASK); 167 r0 = EVT_IVG15 (z);
174 p0.h = hi(IMASK); 168 sti r0;
175 p1.l = IMASK_IVG15;
176 p1.h = 0x0;
177 [p0] = p1;
178 csync;
179 169
180 raise 15; 170 raise 15;
181 p0.l = .LWAIT_HERE; 171 p0.l = .LWAIT_HERE;
@@ -195,6 +185,19 @@ ENDPROC(__start)
195# define WDOG_CTL WDOGA_CTL 185# define WDOG_CTL WDOGA_CTL
196#endif 186#endif
197 187
188ENTRY(__init_clear_bss)
189 r2 = r2 - r1;
190 cc = r2 == 0;
191 if cc jump .L_bss_done;
192 r2 >>= 2;
193 p1 = r1;
194 p2 = r2;
195 lsetup (1f, 1f) lc0 = p2;
1961: [p1++] = r0;
197.L_bss_done:
198 rts;
199ENDPROC(__init_clear_bss)
200
198ENTRY(_real_start) 201ENTRY(_real_start)
199 /* Enable nested interrupts */ 202 /* Enable nested interrupts */
200 [--sp] = reti; 203 [--sp] = reti;
@@ -206,87 +209,34 @@ ENTRY(_real_start)
206 w[p0] = r0; 209 w[p0] = r0;
207 ssync; 210 ssync;
208 211
212 r0 = 0 (x);
213 /* Zero out all of the fun bss regions */
209#if L1_DATA_A_LENGTH > 0 214#if L1_DATA_A_LENGTH > 0
210 r1.l = __sbss_l1; 215 r1.l = __sbss_l1;
211 r1.h = __sbss_l1; 216 r1.h = __sbss_l1;
212 r2.l = __ebss_l1; 217 r2.l = __ebss_l1;
213 r2.h = __ebss_l1; 218 r2.h = __ebss_l1;
214 r0 = 0 (z); 219 call __init_clear_bss
215 r2 = r2 - r1;
216 cc = r2 == 0;
217 if cc jump .L_a_l1_done;
218 r2 >>= 2;
219 p1 = r1;
220 p2 = r2;
221 lsetup (.L_clear_a_l1, .L_clear_a_l1 ) lc0 = p2;
222.L_clear_a_l1:
223 [p1++] = r0;
224.L_a_l1_done:
225#endif 220#endif
226
227#if L1_DATA_B_LENGTH > 0 221#if L1_DATA_B_LENGTH > 0
228 r1.l = __sbss_b_l1; 222 r1.l = __sbss_b_l1;
229 r1.h = __sbss_b_l1; 223 r1.h = __sbss_b_l1;
230 r2.l = __ebss_b_l1; 224 r2.l = __ebss_b_l1;
231 r2.h = __ebss_b_l1; 225 r2.h = __ebss_b_l1;
232 r0 = 0 (z); 226 call __init_clear_bss
233 r2 = r2 - r1;
234 cc = r2 == 0;
235 if cc jump .L_b_l1_done;
236 r2 >>= 2;
237 p1 = r1;
238 p2 = r2;
239 lsetup (.L_clear_b_l1, .L_clear_b_l1 ) lc0 = p2;
240.L_clear_b_l1:
241 [p1++] = r0;
242.L_b_l1_done:
243#endif 227#endif
244
245#if L2_LENGTH > 0 228#if L2_LENGTH > 0
246 r1.l = __sbss_l2; 229 r1.l = __sbss_l2;
247 r1.h = __sbss_l2; 230 r1.h = __sbss_l2;
248 r2.l = __ebss_l2; 231 r2.l = __ebss_l2;
249 r2.h = __ebss_l2; 232 r2.h = __ebss_l2;
250 r0 = 0 (z); 233 call __init_clear_bss
251 r2 = r2 - r1;
252 cc = r2 == 0;
253 if cc jump .L_l2_done;
254 r2 >>= 2;
255 p1 = r1;
256 p2 = r2;
257 lsetup (.L_clear_l2, .L_clear_l2 ) lc0 = p2;
258.L_clear_l2:
259 [p1++] = r0;
260.L_l2_done:
261#endif 234#endif
262
263 /* Zero out the bss region
264 * Note: this will fail if bss is 0 bytes ...
265 */
266 r0 = 0 (z);
267 r1.l = ___bss_start; 235 r1.l = ___bss_start;
268 r1.h = ___bss_start; 236 r1.h = ___bss_start;
269 r2.l = ___bss_stop; 237 r2.l = ___bss_stop;
270 r2.h = ___bss_stop; 238 r2.h = ___bss_stop;
271 r2 = r2 - r1; 239 call __init_clear_bss
272 r2 >>= 2;
273 p1 = r1;
274 p2 = r2;
275 lsetup (.L_clear_bss, .L_clear_bss) lc0 = p2;
276.L_clear_bss:
277 [p1++] = r0;
278
279 /* In case there is a NULL pointer reference,
280 * zero out region before stext
281 */
282 p1 = r0;
283 r2.l = __stext;
284 r2.h = __stext;
285 r2 >>= 2;
286 p2 = r2;
287 lsetup (.L_clear_zero, .L_clear_zero) lc0 = p2;
288.L_clear_zero:
289 [p1++] = r0;
290 240
291 /* Pass the u-boot arguments to the global value command line */ 241 /* Pass the u-boot arguments to the global value command line */
292 R0 = R7; 242 R0 = R7;
@@ -299,6 +249,9 @@ ENTRY(_real_start)
299 sp = sp + p1; 249 sp = sp + p1;
300 usp = sp; 250 usp = sp;
301 fp = sp; 251 fp = sp;
252 sp += -12;
253 call _init_pda
254 sp += 12;
302 jump.l _start_kernel; 255 jump.l _start_kernel;
303ENDPROC(_real_start) 256ENDPROC(_real_start)
304 257
diff --git a/arch/blackfin/mach-common/interrupt.S b/arch/blackfin/mach-common/interrupt.S
index 4a2ec7a9675a..473df0f7fa78 100644
--- a/arch/blackfin/mach-common/interrupt.S
+++ b/arch/blackfin/mach-common/interrupt.S
@@ -129,8 +129,15 @@ __common_int_entry:
129#endif 129#endif
130 r1 = sp; 130 r1 = sp;
131 SP += -12; 131 SP += -12;
132#ifdef CONFIG_IPIPE
133 call ___ipipe_grab_irq
134 SP += 12;
135 cc = r0 == 0;
136 if cc jump .Lcommon_restore_context;
137#else /* CONFIG_IPIPE */
132 call _do_irq; 138 call _do_irq;
133 SP += 12; 139 SP += 12;
140#endif /* CONFIG_IPIPE */
134 call _return_from_int; 141 call _return_from_int;
135.Lcommon_restore_context: 142.Lcommon_restore_context:
136 RESTORE_CONTEXT 143 RESTORE_CONTEXT
@@ -152,15 +159,6 @@ ENTRY(_evt_ivhw)
1521: 1591:
153#endif 160#endif
154 161
155#ifdef CONFIG_HARDWARE_PM
156 r7 = [sp + PT_SEQSTAT];
157 r7 = r7 >>> 0xe;
158 r6 = 0x1F;
159 r7 = r7 & r6;
160 r5 = 0x12;
161 cc = r7 == r5;
162 if cc jump .Lcall_do_ovf; /* deal with performance counter overflow */
163#endif
164 # We are going to dump something out, so make sure we print IPEND properly 162 # We are going to dump something out, so make sure we print IPEND properly
165 p2.l = lo(IPEND); 163 p2.l = lo(IPEND);
166 p2.h = hi(IPEND); 164 p2.h = hi(IPEND);
@@ -192,17 +190,6 @@ ENTRY(_evt_ivhw)
192.Lcommon_restore_all_sys: 190.Lcommon_restore_all_sys:
193 RESTORE_ALL_SYS 191 RESTORE_ALL_SYS
194 rti; 192 rti;
195
196#ifdef CONFIG_HARDWARE_PM
197.Lcall_do_ovf:
198
199 SP += -12;
200 call _pm_overflow;
201 SP += 12;
202
203 jump .Lcommon_restore_all_sys;
204#endif
205
206ENDPROC(_evt_ivhw) 193ENDPROC(_evt_ivhw)
207 194
208/* Interrupt routine for evt2 (NMI). 195/* Interrupt routine for evt2 (NMI).
@@ -245,3 +232,56 @@ ENTRY(_evt_system_call)
245 call _system_call; 232 call _system_call;
246 jump .Lcommon_restore_context; 233 jump .Lcommon_restore_context;
247ENDPROC(_evt_system_call) 234ENDPROC(_evt_system_call)
235
236#ifdef CONFIG_IPIPE
237ENTRY(___ipipe_call_irqtail)
238 r0.l = 1f;
239 r0.h = 1f;
240 reti = r0;
241 rti;
2421:
243 [--sp] = rets;
244 [--sp] = ( r7:4, p5:3 );
245 p0.l = ___ipipe_irq_tail_hook;
246 p0.h = ___ipipe_irq_tail_hook;
247 p0 = [p0];
248 sp += -12;
249 call (p0);
250 sp += 12;
251 ( r7:4, p5:3 ) = [sp++];
252 rets = [sp++];
253
254 [--sp] = reti;
255 reti = [sp++]; /* IRQs are off. */
256 r0.h = 3f;
257 r0.l = 3f;
258 p0.l = lo(EVT14);
259 p0.h = hi(EVT14);
260 [p0] = r0;
261 csync;
262 r0 = 0x401f;
263 sti r0;
264 raise 14;
265 [--sp] = reti; /* IRQs on. */
2662:
267 jump 2b; /* Likely paranoid. */
2683:
269 sp += 4; /* Discard saved RETI */
270 r0.h = _evt14_softirq;
271 r0.l = _evt14_softirq;
272 p0.l = lo(EVT14);
273 p0.h = hi(EVT14);
274 [p0] = r0;
275 csync;
276 p0.l = _bfin_irq_flags;
277 p0.h = _bfin_irq_flags;
278 r0 = [p0];
279 sti r0;
280#if 0 /* FIXME: this actually raises scheduling latencies */
281 /* Reenable interrupts */
282 [--sp] = reti;
283 r0 = [sp++];
284#endif
285 rts;
286ENDPROC(___ipipe_call_irqtail)
287#endif /* CONFIG_IPIPE */
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index 34e8a726ffda..1bba6030dce9 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -1,9 +1,6 @@
1/* 1/*
2 * File: arch/blackfin/mach-common/ints-priority.c 2 * File: arch/blackfin/mach-common/ints-priority.c
3 * Based on:
4 * Author:
5 * 3 *
6 * Created: ?
7 * Description: Set up the interrupt priorities 4 * Description: Set up the interrupt priorities
8 * 5 *
9 * Modified: 6 * Modified:
@@ -37,6 +34,9 @@
37#include <linux/kernel_stat.h> 34#include <linux/kernel_stat.h>
38#include <linux/seq_file.h> 35#include <linux/seq_file.h>
39#include <linux/irq.h> 36#include <linux/irq.h>
37#ifdef CONFIG_IPIPE
38#include <linux/ipipe.h>
39#endif
40#ifdef CONFIG_KGDB 40#ifdef CONFIG_KGDB
41#include <linux/kgdb.h> 41#include <linux/kgdb.h>
42#endif 42#endif
@@ -45,6 +45,8 @@
45#include <asm/gpio.h> 45#include <asm/gpio.h>
46#include <asm/irq_handler.h> 46#include <asm/irq_handler.h>
47 47
48#define SIC_SYSIRQ(irq) (irq - (IRQ_CORETMR + 1))
49
48#ifdef BF537_FAMILY 50#ifdef BF537_FAMILY
49# define BF537_GENERIC_ERROR_INT_DEMUX 51# define BF537_GENERIC_ERROR_INT_DEMUX
50#else 52#else
@@ -58,13 +60,16 @@
58 * - 60 * -
59 */ 61 */
60 62
63#ifndef CONFIG_SMP
61/* Initialize this to an actual value to force it into the .data 64/* Initialize this to an actual value to force it into the .data
62 * section so that we know it is properly initialized at entry into 65 * section so that we know it is properly initialized at entry into
63 * the kernel but before bss is initialized to zero (which is where 66 * the kernel but before bss is initialized to zero (which is where
64 * it would live otherwise). The 0x1f magic represents the IRQs we 67 * it would live otherwise). The 0x1f magic represents the IRQs we
65 * cannot actually mask out in hardware. 68 * cannot actually mask out in hardware.
66 */ 69 */
67unsigned long irq_flags = 0x1f; 70unsigned long bfin_irq_flags = 0x1f;
71EXPORT_SYMBOL(bfin_irq_flags);
72#endif
68 73
69/* The number of spurious interrupts */ 74/* The number of spurious interrupts */
70atomic_t num_spurious; 75atomic_t num_spurious;
@@ -103,12 +108,14 @@ static void __init search_IAR(void)
103 for (irqn = 0; irqn < NR_PERI_INTS; irqn++) { 108 for (irqn = 0; irqn < NR_PERI_INTS; irqn++) {
104 int iar_shift = (irqn & 7) * 4; 109 int iar_shift = (irqn & 7) * 4;
105 if (ivg == (0xf & 110 if (ivg == (0xf &
106#ifndef CONFIG_BF52x 111#if defined(CONFIG_BF52x) || defined(CONFIG_BF538) \
112 || defined(CONFIG_BF539) || defined(CONFIG_BF51x)
107 bfin_read32((unsigned long *)SIC_IAR0 + 113 bfin_read32((unsigned long *)SIC_IAR0 +
108 (irqn >> 3)) >> iar_shift)) { 114 ((irqn % 32) >> 3) + ((irqn / 32) *
115 ((SIC_IAR4 - SIC_IAR0) / 4))) >> iar_shift)) {
109#else 116#else
110 bfin_read32((unsigned long *)SIC_IAR0 + 117 bfin_read32((unsigned long *)SIC_IAR0 +
111 ((irqn%32) >> 3) + ((irqn / 32) * 16)) >> iar_shift)) { 118 (irqn >> 3)) >> iar_shift)) {
112#endif 119#endif
113 ivg_table[irq_pos].irqno = IVG7 + irqn; 120 ivg_table[irq_pos].irqno = IVG7 + irqn;
114 ivg_table[irq_pos].isrflag = 1 << (irqn % 32); 121 ivg_table[irq_pos].isrflag = 1 << (irqn % 32);
@@ -130,25 +137,25 @@ static void bfin_ack_noop(unsigned int irq)
130 137
131static void bfin_core_mask_irq(unsigned int irq) 138static void bfin_core_mask_irq(unsigned int irq)
132{ 139{
133 irq_flags &= ~(1 << irq); 140 bfin_irq_flags &= ~(1 << irq);
134 if (!irqs_disabled()) 141 if (!irqs_disabled_hw())
135 local_irq_enable(); 142 local_irq_enable_hw();
136} 143}
137 144
138static void bfin_core_unmask_irq(unsigned int irq) 145static void bfin_core_unmask_irq(unsigned int irq)
139{ 146{
140 irq_flags |= 1 << irq; 147 bfin_irq_flags |= 1 << irq;
141 /* 148 /*
142 * If interrupts are enabled, IMASK must contain the same value 149 * If interrupts are enabled, IMASK must contain the same value
143 * as irq_flags. Make sure that invariant holds. If interrupts 150 * as bfin_irq_flags. Make sure that invariant holds. If interrupts
144 * are currently disabled we need not do anything; one of the 151 * are currently disabled we need not do anything; one of the
145 * callers will take care of setting IMASK to the proper value 152 * callers will take care of setting IMASK to the proper value
146 * when reenabling interrupts. 153 * when reenabling interrupts.
147 * local_irq_enable just does "STI irq_flags", so it's exactly 154 * local_irq_enable just does "STI bfin_irq_flags", so it's exactly
148 * what we need. 155 * what we need.
149 */ 156 */
150 if (!irqs_disabled()) 157 if (!irqs_disabled_hw())
151 local_irq_enable(); 158 local_irq_enable_hw();
152 return; 159 return;
153} 160}
154 161
@@ -163,8 +170,11 @@ static void bfin_internal_mask_irq(unsigned int irq)
163 mask_bit = SIC_SYSIRQ(irq) % 32; 170 mask_bit = SIC_SYSIRQ(irq) % 32;
164 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) & 171 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) &
165 ~(1 << mask_bit)); 172 ~(1 << mask_bit));
173#ifdef CONFIG_SMP
174 bfin_write_SICB_IMASK(mask_bank, bfin_read_SICB_IMASK(mask_bank) &
175 ~(1 << mask_bit));
176#endif
166#endif 177#endif
167 SSYNC();
168} 178}
169 179
170static void bfin_internal_unmask_irq(unsigned int irq) 180static void bfin_internal_unmask_irq(unsigned int irq)
@@ -178,14 +188,17 @@ static void bfin_internal_unmask_irq(unsigned int irq)
178 mask_bit = SIC_SYSIRQ(irq) % 32; 188 mask_bit = SIC_SYSIRQ(irq) % 32;
179 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) | 189 bfin_write_SIC_IMASK(mask_bank, bfin_read_SIC_IMASK(mask_bank) |
180 (1 << mask_bit)); 190 (1 << mask_bit));
191#ifdef CONFIG_SMP
192 bfin_write_SICB_IMASK(mask_bank, bfin_read_SICB_IMASK(mask_bank) |
193 (1 << mask_bit));
194#endif
181#endif 195#endif
182 SSYNC();
183} 196}
184 197
185#ifdef CONFIG_PM 198#ifdef CONFIG_PM
186int bfin_internal_set_wake(unsigned int irq, unsigned int state) 199int bfin_internal_set_wake(unsigned int irq, unsigned int state)
187{ 200{
188 unsigned bank, bit, wakeup = 0; 201 u32 bank, bit, wakeup = 0;
189 unsigned long flags; 202 unsigned long flags;
190 bank = SIC_SYSIRQ(irq) / 32; 203 bank = SIC_SYSIRQ(irq) / 32;
191 bit = SIC_SYSIRQ(irq) % 32; 204 bit = SIC_SYSIRQ(irq) % 32;
@@ -225,7 +238,7 @@ int bfin_internal_set_wake(unsigned int irq, unsigned int state)
225 break; 238 break;
226 } 239 }
227 240
228 local_irq_save(flags); 241 local_irq_save_hw(flags);
229 242
230 if (state) { 243 if (state) {
231 bfin_sic_iwr[bank] |= (1 << bit); 244 bfin_sic_iwr[bank] |= (1 << bit);
@@ -236,7 +249,7 @@ int bfin_internal_set_wake(unsigned int irq, unsigned int state)
236 vr_wakeup &= ~wakeup; 249 vr_wakeup &= ~wakeup;
237 } 250 }
238 251
239 local_irq_restore(flags); 252 local_irq_restore_hw(flags);
240 253
241 return 0; 254 return 0;
242} 255}
@@ -262,6 +275,19 @@ static struct irq_chip bfin_internal_irqchip = {
262#endif 275#endif
263}; 276};
264 277
278static void bfin_handle_irq(unsigned irq)
279{
280#ifdef CONFIG_IPIPE
281 struct pt_regs regs; /* Contents not used. */
282 ipipe_trace_irq_entry(irq);
283 __ipipe_handle_irq(irq, &regs);
284 ipipe_trace_irq_exit(irq);
285#else /* !CONFIG_IPIPE */
286 struct irq_desc *desc = irq_desc + irq;
287 desc->handle_irq(irq, desc);
288#endif /* !CONFIG_IPIPE */
289}
290
265#ifdef BF537_GENERIC_ERROR_INT_DEMUX 291#ifdef BF537_GENERIC_ERROR_INT_DEMUX
266static int error_int_mask; 292static int error_int_mask;
267 293
@@ -292,8 +318,6 @@ static void bfin_demux_error_irq(unsigned int int_err_irq,
292{ 318{
293 int irq = 0; 319 int irq = 0;
294 320
295 SSYNC();
296
297#if (defined(CONFIG_BF537) || defined(CONFIG_BF536)) 321#if (defined(CONFIG_BF537) || defined(CONFIG_BF536))
298 if (bfin_read_EMAC_SYSTAT() & EMAC_ERR_MASK) 322 if (bfin_read_EMAC_SYSTAT() & EMAC_ERR_MASK)
299 irq = IRQ_MAC_ERROR; 323 irq = IRQ_MAC_ERROR;
@@ -317,10 +341,9 @@ static void bfin_demux_error_irq(unsigned int int_err_irq,
317 irq = IRQ_UART1_ERROR; 341 irq = IRQ_UART1_ERROR;
318 342
319 if (irq) { 343 if (irq) {
320 if (error_int_mask & (1L << (irq - IRQ_PPI_ERROR))) { 344 if (error_int_mask & (1L << (irq - IRQ_PPI_ERROR)))
321 struct irq_desc *desc = irq_desc + irq; 345 bfin_handle_irq(irq);
322 desc->handle_irq(irq, desc); 346 else {
323 } else {
324 347
325 switch (irq) { 348 switch (irq) {
326 case IRQ_PPI_ERROR: 349 case IRQ_PPI_ERROR:
@@ -366,62 +389,57 @@ static void bfin_demux_error_irq(unsigned int int_err_irq,
366 389
367static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle) 390static inline void bfin_set_irq_handler(unsigned irq, irq_flow_handler_t handle)
368{ 391{
392#ifdef CONFIG_IPIPE
393 _set_irq_handler(irq, handle_edge_irq);
394#else
369 struct irq_desc *desc = irq_desc + irq; 395 struct irq_desc *desc = irq_desc + irq;
370 /* May not call generic set_irq_handler() due to spinlock 396 /* May not call generic set_irq_handler() due to spinlock
371 recursion. */ 397 recursion. */
372 desc->handle_irq = handle; 398 desc->handle_irq = handle;
399#endif
373} 400}
374 401
375#if !defined(CONFIG_BF54x) 402static DECLARE_BITMAP(gpio_enabled, MAX_BLACKFIN_GPIOS);
376
377static unsigned short gpio_enabled[gpio_bank(MAX_BLACKFIN_GPIOS)];
378static unsigned short gpio_edge_triggered[gpio_bank(MAX_BLACKFIN_GPIOS)];
379
380extern void bfin_gpio_irq_prepare(unsigned gpio); 403extern void bfin_gpio_irq_prepare(unsigned gpio);
381 404
405#if !defined(CONFIG_BF54x)
406
382static void bfin_gpio_ack_irq(unsigned int irq) 407static void bfin_gpio_ack_irq(unsigned int irq)
383{ 408{
384 u16 gpionr = irq - IRQ_PF0; 409 /* AFAIK ack_irq in case mask_ack is provided
385 410 * get's only called for edge sense irqs
386 if (gpio_edge_triggered[gpio_bank(gpionr)] & gpio_bit(gpionr)) { 411 */
387 set_gpio_data(gpionr, 0); 412 set_gpio_data(irq_to_gpio(irq), 0);
388 SSYNC();
389 }
390} 413}
391 414
392static void bfin_gpio_mask_ack_irq(unsigned int irq) 415static void bfin_gpio_mask_ack_irq(unsigned int irq)
393{ 416{
394 u16 gpionr = irq - IRQ_PF0; 417 struct irq_desc *desc = irq_desc + irq;
418 u32 gpionr = irq_to_gpio(irq);
395 419
396 if (gpio_edge_triggered[gpio_bank(gpionr)] & gpio_bit(gpionr)) { 420 if (desc->handle_irq == handle_edge_irq)
397 set_gpio_data(gpionr, 0); 421 set_gpio_data(gpionr, 0);
398 SSYNC();
399 }
400 422
401 set_gpio_maska(gpionr, 0); 423 set_gpio_maska(gpionr, 0);
402 SSYNC();
403} 424}
404 425
405static void bfin_gpio_mask_irq(unsigned int irq) 426static void bfin_gpio_mask_irq(unsigned int irq)
406{ 427{
407 set_gpio_maska(irq - IRQ_PF0, 0); 428 set_gpio_maska(irq_to_gpio(irq), 0);
408 SSYNC();
409} 429}
410 430
411static void bfin_gpio_unmask_irq(unsigned int irq) 431static void bfin_gpio_unmask_irq(unsigned int irq)
412{ 432{
413 set_gpio_maska(irq - IRQ_PF0, 1); 433 set_gpio_maska(irq_to_gpio(irq), 1);
414 SSYNC();
415} 434}
416 435
417static unsigned int bfin_gpio_irq_startup(unsigned int irq) 436static unsigned int bfin_gpio_irq_startup(unsigned int irq)
418{ 437{
419 u16 gpionr = irq - IRQ_PF0; 438 u32 gpionr = irq_to_gpio(irq);
420 439
421 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) 440 if (__test_and_set_bit(gpionr, gpio_enabled))
422 bfin_gpio_irq_prepare(gpionr); 441 bfin_gpio_irq_prepare(gpionr);
423 442
424 gpio_enabled[gpio_bank(gpionr)] |= gpio_bit(gpionr);
425 bfin_gpio_unmask_irq(irq); 443 bfin_gpio_unmask_irq(irq);
426 444
427 return 0; 445 return 0;
@@ -429,29 +447,39 @@ static unsigned int bfin_gpio_irq_startup(unsigned int irq)
429 447
430static void bfin_gpio_irq_shutdown(unsigned int irq) 448static void bfin_gpio_irq_shutdown(unsigned int irq)
431{ 449{
450 u32 gpionr = irq_to_gpio(irq);
451
432 bfin_gpio_mask_irq(irq); 452 bfin_gpio_mask_irq(irq);
433 gpio_enabled[gpio_bank(irq - IRQ_PF0)] &= ~gpio_bit(irq - IRQ_PF0); 453 __clear_bit(gpionr, gpio_enabled);
454 bfin_gpio_irq_free(gpionr);
434} 455}
435 456
436static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) 457static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
437{ 458{
438 u16 gpionr = irq - IRQ_PF0; 459 int ret;
460 char buf[16];
461 u32 gpionr = irq_to_gpio(irq);
439 462
440 if (type == IRQ_TYPE_PROBE) { 463 if (type == IRQ_TYPE_PROBE) {
441 /* only probe unenabled GPIO interrupt lines */ 464 /* only probe unenabled GPIO interrupt lines */
442 if (gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr)) 465 if (__test_bit(gpionr, gpio_enabled))
443 return 0; 466 return 0;
444 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; 467 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
445 } 468 }
446 469
447 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING | 470 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
448 IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { 471 IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
449 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) 472
473 snprintf(buf, 16, "gpio-irq%d", irq);
474 ret = bfin_gpio_irq_request(gpionr, buf);
475 if (ret)
476 return ret;
477
478 if (__test_and_set_bit(gpionr, gpio_enabled))
450 bfin_gpio_irq_prepare(gpionr); 479 bfin_gpio_irq_prepare(gpionr);
451 480
452 gpio_enabled[gpio_bank(gpionr)] |= gpio_bit(gpionr);
453 } else { 481 } else {
454 gpio_enabled[gpio_bank(gpionr)] &= ~gpio_bit(gpionr); 482 __clear_bit(gpionr, gpio_enabled);
455 return 0; 483 return 0;
456 } 484 }
457 485
@@ -472,17 +500,13 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
472 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { 500 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
473 set_gpio_edge(gpionr, 1); 501 set_gpio_edge(gpionr, 1);
474 set_gpio_inen(gpionr, 1); 502 set_gpio_inen(gpionr, 1);
475 gpio_edge_triggered[gpio_bank(gpionr)] |= gpio_bit(gpionr);
476 set_gpio_data(gpionr, 0); 503 set_gpio_data(gpionr, 0);
477 504
478 } else { 505 } else {
479 set_gpio_edge(gpionr, 0); 506 set_gpio_edge(gpionr, 0);
480 gpio_edge_triggered[gpio_bank(gpionr)] &= ~gpio_bit(gpionr);
481 set_gpio_inen(gpionr, 1); 507 set_gpio_inen(gpionr, 1);
482 } 508 }
483 509
484 SSYNC();
485
486 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) 510 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
487 bfin_set_irq_handler(irq, handle_edge_irq); 511 bfin_set_irq_handler(irq, handle_edge_irq);
488 else 512 else
@@ -505,22 +529,6 @@ int bfin_gpio_set_wake(unsigned int irq, unsigned int state)
505} 529}
506#endif 530#endif
507 531
508static struct irq_chip bfin_gpio_irqchip = {
509 .name = "GPIO",
510 .ack = bfin_gpio_ack_irq,
511 .mask = bfin_gpio_mask_irq,
512 .mask_ack = bfin_gpio_mask_ack_irq,
513 .unmask = bfin_gpio_unmask_irq,
514 .disable = bfin_gpio_mask_irq,
515 .enable = bfin_gpio_unmask_irq,
516 .set_type = bfin_gpio_irq_type,
517 .startup = bfin_gpio_irq_startup,
518 .shutdown = bfin_gpio_irq_shutdown,
519#ifdef CONFIG_PM
520 .set_wake = bfin_gpio_set_wake,
521#endif
522};
523
524static void bfin_demux_gpio_irq(unsigned int inta_irq, 532static void bfin_demux_gpio_irq(unsigned int inta_irq,
525 struct irq_desc *desc) 533 struct irq_desc *desc)
526{ 534{
@@ -537,7 +545,11 @@ static void bfin_demux_gpio_irq(unsigned int inta_irq,
537 irq = IRQ_PH0; 545 irq = IRQ_PH0;
538 break; 546 break;
539# endif 547# endif
540#elif defined(CONFIG_BF52x) 548#elif defined(CONFIG_BF538) || defined(CONFIG_BF539)
549 case IRQ_PORTF_INTA:
550 irq = IRQ_PF0;
551 break;
552#elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
541 case IRQ_PORTF_INTA: 553 case IRQ_PORTF_INTA:
542 irq = IRQ_PF0; 554 irq = IRQ_PF0;
543 break; 555 break;
@@ -567,30 +579,22 @@ static void bfin_demux_gpio_irq(unsigned int inta_irq,
567 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) { 579 for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) {
568 irq += i; 580 irq += i;
569 581
570 mask = get_gpiop_data(i) & 582 mask = get_gpiop_data(i) & get_gpiop_maska(i);
571 (gpio_enabled[gpio_bank(i)] &
572 get_gpiop_maska(i));
573 583
574 while (mask) { 584 while (mask) {
575 if (mask & 1) { 585 if (mask & 1)
576 desc = irq_desc + irq; 586 bfin_handle_irq(irq);
577 desc->handle_irq(irq, desc);
578 }
579 irq++; 587 irq++;
580 mask >>= 1; 588 mask >>= 1;
581 } 589 }
582 } 590 }
583 } else { 591 } else {
584 gpio = irq_to_gpio(irq); 592 gpio = irq_to_gpio(irq);
585 mask = get_gpiop_data(gpio) & 593 mask = get_gpiop_data(gpio) & get_gpiop_maska(gpio);
586 (gpio_enabled[gpio_bank(gpio)] &
587 get_gpiop_maska(gpio));
588 594
589 do { 595 do {
590 if (mask & 1) { 596 if (mask & 1)
591 desc = irq_desc + irq; 597 bfin_handle_irq(irq);
592 desc->handle_irq(irq, desc);
593 }
594 irq++; 598 irq++;
595 mask >>= 1; 599 mask >>= 1;
596 } while (mask); 600 } while (mask);
@@ -612,10 +616,6 @@ static void bfin_demux_gpio_irq(unsigned int inta_irq,
612static unsigned char irq2pint_lut[NR_PINTS]; 616static unsigned char irq2pint_lut[NR_PINTS];
613static unsigned char pint2irq_lut[NR_PINT_SYS_IRQS * NR_PINT_BITS]; 617static unsigned char pint2irq_lut[NR_PINT_SYS_IRQS * NR_PINT_BITS];
614 618
615static unsigned int gpio_both_edge_triggered[NR_PINT_SYS_IRQS];
616static unsigned short gpio_enabled[gpio_bank(MAX_BLACKFIN_GPIOS)];
617
618
619struct pin_int_t { 619struct pin_int_t {
620 unsigned int mask_set; 620 unsigned int mask_set;
621 unsigned int mask_clear; 621 unsigned int mask_clear;
@@ -636,12 +636,9 @@ static struct pin_int_t *pint[NR_PINT_SYS_IRQS] = {
636 (struct pin_int_t *)PINT3_MASK_SET, 636 (struct pin_int_t *)PINT3_MASK_SET,
637}; 637};
638 638
639extern void bfin_gpio_irq_prepare(unsigned gpio); 639inline unsigned int get_irq_base(u32 bank, u8 bmap)
640
641inline unsigned short get_irq_base(u8 bank, u8 bmap)
642{ 640{
643 641 unsigned int irq_base;
644 u16 irq_base;
645 642
646 if (bank < 2) { /*PA-PB */ 643 if (bank < 2) { /*PA-PB */
647 irq_base = IRQ_PA0 + bmap * 16; 644 irq_base = IRQ_PA0 + bmap * 16;
@@ -650,7 +647,6 @@ inline unsigned short get_irq_base(u8 bank, u8 bmap)
650 } 647 }
651 648
652 return irq_base; 649 return irq_base;
653
654} 650}
655 651
656 /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */ 652 /* Whenever PINTx_ASSIGN is altered init_pint_lut() must be executed! */
@@ -677,20 +673,18 @@ void init_pint_lut(void)
677 673
678 pint2irq_lut[bit_pos] = irq_base - SYS_IRQS; 674 pint2irq_lut[bit_pos] = irq_base - SYS_IRQS;
679 irq2pint_lut[irq_base - SYS_IRQS] = bit_pos; 675 irq2pint_lut[irq_base - SYS_IRQS] = bit_pos;
680
681 } 676 }
682
683 } 677 }
684
685} 678}
686 679
687static void bfin_gpio_ack_irq(unsigned int irq) 680static void bfin_gpio_ack_irq(unsigned int irq)
688{ 681{
689 u8 pint_val = irq2pint_lut[irq - SYS_IRQS]; 682 struct irq_desc *desc = irq_desc + irq;
683 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
690 u32 pintbit = PINT_BIT(pint_val); 684 u32 pintbit = PINT_BIT(pint_val);
691 u8 bank = PINT_2_BANK(pint_val); 685 u32 bank = PINT_2_BANK(pint_val);
692 686
693 if (unlikely(gpio_both_edge_triggered[bank] & pintbit)) { 687 if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
694 if (pint[bank]->invert_set & pintbit) 688 if (pint[bank]->invert_set & pintbit)
695 pint[bank]->invert_clear = pintbit; 689 pint[bank]->invert_clear = pintbit;
696 else 690 else
@@ -698,16 +692,16 @@ static void bfin_gpio_ack_irq(unsigned int irq)
698 } 692 }
699 pint[bank]->request = pintbit; 693 pint[bank]->request = pintbit;
700 694
701 SSYNC();
702} 695}
703 696
704static void bfin_gpio_mask_ack_irq(unsigned int irq) 697static void bfin_gpio_mask_ack_irq(unsigned int irq)
705{ 698{
706 u8 pint_val = irq2pint_lut[irq - SYS_IRQS]; 699 struct irq_desc *desc = irq_desc + irq;
700 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
707 u32 pintbit = PINT_BIT(pint_val); 701 u32 pintbit = PINT_BIT(pint_val);
708 u8 bank = PINT_2_BANK(pint_val); 702 u32 bank = PINT_2_BANK(pint_val);
709 703
710 if (unlikely(gpio_both_edge_triggered[bank] & pintbit)) { 704 if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQ_TYPE_EDGE_BOTH) {
711 if (pint[bank]->invert_set & pintbit) 705 if (pint[bank]->invert_set & pintbit)
712 pint[bank]->invert_clear = pintbit; 706 pint[bank]->invert_clear = pintbit;
713 else 707 else
@@ -716,32 +710,29 @@ static void bfin_gpio_mask_ack_irq(unsigned int irq)
716 710
717 pint[bank]->request = pintbit; 711 pint[bank]->request = pintbit;
718 pint[bank]->mask_clear = pintbit; 712 pint[bank]->mask_clear = pintbit;
719 SSYNC();
720} 713}
721 714
722static void bfin_gpio_mask_irq(unsigned int irq) 715static void bfin_gpio_mask_irq(unsigned int irq)
723{ 716{
724 u8 pint_val = irq2pint_lut[irq - SYS_IRQS]; 717 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
725 718
726 pint[PINT_2_BANK(pint_val)]->mask_clear = PINT_BIT(pint_val); 719 pint[PINT_2_BANK(pint_val)]->mask_clear = PINT_BIT(pint_val);
727 SSYNC();
728} 720}
729 721
730static void bfin_gpio_unmask_irq(unsigned int irq) 722static void bfin_gpio_unmask_irq(unsigned int irq)
731{ 723{
732 u8 pint_val = irq2pint_lut[irq - SYS_IRQS]; 724 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
733 u32 pintbit = PINT_BIT(pint_val); 725 u32 pintbit = PINT_BIT(pint_val);
734 u8 bank = PINT_2_BANK(pint_val); 726 u32 bank = PINT_2_BANK(pint_val);
735 727
736 pint[bank]->request = pintbit; 728 pint[bank]->request = pintbit;
737 pint[bank]->mask_set = pintbit; 729 pint[bank]->mask_set = pintbit;
738 SSYNC();
739} 730}
740 731
741static unsigned int bfin_gpio_irq_startup(unsigned int irq) 732static unsigned int bfin_gpio_irq_startup(unsigned int irq)
742{ 733{
743 u16 gpionr = irq_to_gpio(irq); 734 u32 gpionr = irq_to_gpio(irq);
744 u8 pint_val = irq2pint_lut[irq - SYS_IRQS]; 735 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
745 736
746 if (pint_val == IRQ_NOT_AVAIL) { 737 if (pint_val == IRQ_NOT_AVAIL) {
747 printk(KERN_ERR 738 printk(KERN_ERR
@@ -750,10 +741,9 @@ static unsigned int bfin_gpio_irq_startup(unsigned int irq)
750 return -ENODEV; 741 return -ENODEV;
751 } 742 }
752 743
753 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) 744 if (__test_and_set_bit(gpionr, gpio_enabled))
754 bfin_gpio_irq_prepare(gpionr); 745 bfin_gpio_irq_prepare(gpionr);
755 746
756 gpio_enabled[gpio_bank(gpionr)] |= gpio_bit(gpionr);
757 bfin_gpio_unmask_irq(irq); 747 bfin_gpio_unmask_irq(irq);
758 748
759 return 0; 749 return 0;
@@ -761,38 +751,45 @@ static unsigned int bfin_gpio_irq_startup(unsigned int irq)
761 751
762static void bfin_gpio_irq_shutdown(unsigned int irq) 752static void bfin_gpio_irq_shutdown(unsigned int irq)
763{ 753{
764 u16 gpionr = irq_to_gpio(irq); 754 u32 gpionr = irq_to_gpio(irq);
765 755
766 bfin_gpio_mask_irq(irq); 756 bfin_gpio_mask_irq(irq);
767 gpio_enabled[gpio_bank(gpionr)] &= ~gpio_bit(gpionr); 757 __clear_bit(gpionr, gpio_enabled);
758 bfin_gpio_irq_free(gpionr);
768} 759}
769 760
770static int bfin_gpio_irq_type(unsigned int irq, unsigned int type) 761static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
771{ 762{
772 763 int ret;
773 u16 gpionr = irq_to_gpio(irq); 764 char buf[16];
774 u8 pint_val = irq2pint_lut[irq - SYS_IRQS]; 765 u32 gpionr = irq_to_gpio(irq);
766 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
775 u32 pintbit = PINT_BIT(pint_val); 767 u32 pintbit = PINT_BIT(pint_val);
776 u8 bank = PINT_2_BANK(pint_val); 768 u32 bank = PINT_2_BANK(pint_val);
777 769
778 if (pint_val == IRQ_NOT_AVAIL) 770 if (pint_val == IRQ_NOT_AVAIL)
779 return -ENODEV; 771 return -ENODEV;
780 772
781 if (type == IRQ_TYPE_PROBE) { 773 if (type == IRQ_TYPE_PROBE) {
782 /* only probe unenabled GPIO interrupt lines */ 774 /* only probe unenabled GPIO interrupt lines */
783 if (gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr)) 775 if (__test_bit(gpionr, gpio_enabled))
784 return 0; 776 return 0;
785 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING; 777 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
786 } 778 }
787 779
788 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING | 780 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING |
789 IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) { 781 IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW)) {
790 if (!(gpio_enabled[gpio_bank(gpionr)] & gpio_bit(gpionr))) 782
783 snprintf(buf, 16, "gpio-irq%d", irq);
784 ret = bfin_gpio_irq_request(gpionr, buf);
785 if (ret)
786 return ret;
787
788 if (__test_and_set_bit(gpionr, gpio_enabled))
791 bfin_gpio_irq_prepare(gpionr); 789 bfin_gpio_irq_prepare(gpionr);
792 790
793 gpio_enabled[gpio_bank(gpionr)] |= gpio_bit(gpionr);
794 } else { 791 } else {
795 gpio_enabled[gpio_bank(gpionr)] &= ~gpio_bit(gpionr); 792 __clear_bit(gpionr, gpio_enabled);
796 return 0; 793 return 0;
797 } 794 }
798 795
@@ -803,15 +800,10 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
803 800
804 if ((type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) 801 if ((type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING))
805 == (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { 802 == (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
806
807 gpio_both_edge_triggered[bank] |= pintbit;
808
809 if (gpio_get_value(gpionr)) 803 if (gpio_get_value(gpionr))
810 pint[bank]->invert_set = pintbit; 804 pint[bank]->invert_set = pintbit;
811 else 805 else
812 pint[bank]->invert_clear = pintbit; 806 pint[bank]->invert_clear = pintbit;
813 } else {
814 gpio_both_edge_triggered[bank] &= ~pintbit;
815 } 807 }
816 808
817 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) { 809 if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
@@ -822,8 +814,6 @@ static int bfin_gpio_irq_type(unsigned int irq, unsigned int type)
822 bfin_set_irq_handler(irq, handle_level_irq); 814 bfin_set_irq_handler(irq, handle_level_irq);
823 } 815 }
824 816
825 SSYNC();
826
827 return 0; 817 return 0;
828} 818}
829 819
@@ -834,7 +824,7 @@ u32 pint_wakeup_masks[NR_PINT_SYS_IRQS];
834int bfin_gpio_set_wake(unsigned int irq, unsigned int state) 824int bfin_gpio_set_wake(unsigned int irq, unsigned int state)
835{ 825{
836 u32 pint_irq; 826 u32 pint_irq;
837 u8 pint_val = irq2pint_lut[irq - SYS_IRQS]; 827 u32 pint_val = irq2pint_lut[irq - SYS_IRQS];
838 u32 bank = PINT_2_BANK(pint_val); 828 u32 bank = PINT_2_BANK(pint_val);
839 u32 pintbit = PINT_BIT(pint_val); 829 u32 pintbit = PINT_BIT(pint_val);
840 830
@@ -895,26 +885,10 @@ void bfin_pm_restore(void)
895} 885}
896#endif 886#endif
897 887
898static struct irq_chip bfin_gpio_irqchip = {
899 .name = "GPIO",
900 .ack = bfin_gpio_ack_irq,
901 .mask = bfin_gpio_mask_irq,
902 .mask_ack = bfin_gpio_mask_ack_irq,
903 .unmask = bfin_gpio_unmask_irq,
904 .disable = bfin_gpio_mask_irq,
905 .enable = bfin_gpio_unmask_irq,
906 .set_type = bfin_gpio_irq_type,
907 .startup = bfin_gpio_irq_startup,
908 .shutdown = bfin_gpio_irq_shutdown,
909#ifdef CONFIG_PM
910 .set_wake = bfin_gpio_set_wake,
911#endif
912};
913
914static void bfin_demux_gpio_irq(unsigned int inta_irq, 888static void bfin_demux_gpio_irq(unsigned int inta_irq,
915 struct irq_desc *desc) 889 struct irq_desc *desc)
916{ 890{
917 u8 bank, pint_val; 891 u32 bank, pint_val;
918 u32 request, irq; 892 u32 request, irq;
919 893
920 switch (inta_irq) { 894 switch (inta_irq) {
@@ -941,8 +915,7 @@ static void bfin_demux_gpio_irq(unsigned int inta_irq,
941 while (request) { 915 while (request) {
942 if (request & 1) { 916 if (request & 1) {
943 irq = pint2irq_lut[pint_val] + SYS_IRQS; 917 irq = pint2irq_lut[pint_val] + SYS_IRQS;
944 desc = irq_desc + irq; 918 bfin_handle_irq(irq);
945 desc->handle_irq(irq, desc);
946 } 919 }
947 pint_val++; 920 pint_val++;
948 request >>= 1; 921 request >>= 1;
@@ -951,10 +924,24 @@ static void bfin_demux_gpio_irq(unsigned int inta_irq,
951} 924}
952#endif 925#endif
953 926
954void __init init_exception_vectors(void) 927static struct irq_chip bfin_gpio_irqchip = {
955{ 928 .name = "GPIO",
956 SSYNC(); 929 .ack = bfin_gpio_ack_irq,
930 .mask = bfin_gpio_mask_irq,
931 .mask_ack = bfin_gpio_mask_ack_irq,
932 .unmask = bfin_gpio_unmask_irq,
933 .disable = bfin_gpio_mask_irq,
934 .enable = bfin_gpio_unmask_irq,
935 .set_type = bfin_gpio_irq_type,
936 .startup = bfin_gpio_irq_startup,
937 .shutdown = bfin_gpio_irq_shutdown,
938#ifdef CONFIG_PM
939 .set_wake = bfin_gpio_set_wake,
940#endif
941};
957 942
943void __cpuinit init_exception_vectors(void)
944{
958 /* cannot program in software: 945 /* cannot program in software:
959 * evt0 - emulation (jtag) 946 * evt0 - emulation (jtag)
960 * evt1 - reset 947 * evt1 - reset
@@ -979,17 +966,23 @@ void __init init_exception_vectors(void)
979 * This function should be called during kernel startup to initialize 966 * This function should be called during kernel startup to initialize
980 * the BFin IRQ handling routines. 967 * the BFin IRQ handling routines.
981 */ 968 */
969
982int __init init_arch_irq(void) 970int __init init_arch_irq(void)
983{ 971{
984 int irq; 972 int irq;
985 unsigned long ilat = 0; 973 unsigned long ilat = 0;
986 /* Disable all the peripheral intrs - page 4-29 HW Ref manual */ 974 /* Disable all the peripheral intrs - page 4-29 HW Ref manual */
987#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) 975#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) \
976 || defined(BF538_FAMILY) || defined(CONFIG_BF51x)
988 bfin_write_SIC_IMASK0(SIC_UNMASK_ALL); 977 bfin_write_SIC_IMASK0(SIC_UNMASK_ALL);
989 bfin_write_SIC_IMASK1(SIC_UNMASK_ALL); 978 bfin_write_SIC_IMASK1(SIC_UNMASK_ALL);
990# ifdef CONFIG_BF54x 979# ifdef CONFIG_BF54x
991 bfin_write_SIC_IMASK2(SIC_UNMASK_ALL); 980 bfin_write_SIC_IMASK2(SIC_UNMASK_ALL);
992# endif 981# endif
982# ifdef CONFIG_SMP
983 bfin_write_SICB_IMASK0(SIC_UNMASK_ALL);
984 bfin_write_SICB_IMASK1(SIC_UNMASK_ALL);
985# endif
993#else 986#else
994 bfin_write_SIC_IMASK(SIC_UNMASK_ALL); 987 bfin_write_SIC_IMASK(SIC_UNMASK_ALL);
995#endif 988#endif
@@ -1029,7 +1022,7 @@ int __init init_arch_irq(void)
1029 case IRQ_PINT1: 1022 case IRQ_PINT1:
1030 case IRQ_PINT2: 1023 case IRQ_PINT2:
1031 case IRQ_PINT3: 1024 case IRQ_PINT3:
1032#elif defined(CONFIG_BF52x) 1025#elif defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
1033 case IRQ_PORTF_INTA: 1026 case IRQ_PORTF_INTA:
1034 case IRQ_PORTG_INTA: 1027 case IRQ_PORTG_INTA:
1035 case IRQ_PORTH_INTA: 1028 case IRQ_PORTH_INTA:
@@ -1037,18 +1030,41 @@ int __init init_arch_irq(void)
1037 case IRQ_PROG0_INTA: 1030 case IRQ_PROG0_INTA:
1038 case IRQ_PROG1_INTA: 1031 case IRQ_PROG1_INTA:
1039 case IRQ_PROG2_INTA: 1032 case IRQ_PROG2_INTA:
1033#elif defined(CONFIG_BF538) || defined(CONFIG_BF539)
1034 case IRQ_PORTF_INTA:
1040#endif 1035#endif
1036
1041 set_irq_chained_handler(irq, 1037 set_irq_chained_handler(irq,
1042 bfin_demux_gpio_irq); 1038 bfin_demux_gpio_irq);
1043 break; 1039 break;
1044#ifdef BF537_GENERIC_ERROR_INT_DEMUX 1040#ifdef BF537_GENERIC_ERROR_INT_DEMUX
1045 case IRQ_GENERIC_ERROR: 1041 case IRQ_GENERIC_ERROR:
1046 set_irq_handler(irq, bfin_demux_error_irq); 1042 set_irq_chained_handler(irq, bfin_demux_error_irq);
1047 1043 break;
1044#endif
1045#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE)
1046 case IRQ_TIMER0:
1047 set_irq_handler(irq, handle_percpu_irq);
1048 break;
1049#endif
1050#ifdef CONFIG_SMP
1051 case IRQ_SUPPLE_0:
1052 case IRQ_SUPPLE_1:
1053 set_irq_handler(irq, handle_percpu_irq);
1048 break; 1054 break;
1049#endif 1055#endif
1050 default: 1056 default:
1057#ifdef CONFIG_IPIPE
1058 /*
1059 * We want internal interrupt sources to be masked, because
1060 * ISRs may trigger interrupts recursively (e.g. DMA), but
1061 * interrupts are _not_ masked at CPU level. So let's handle
1062 * them as level interrupts.
1063 */
1064 set_irq_handler(irq, handle_level_irq);
1065#else /* !CONFIG_IPIPE */
1051 set_irq_handler(irq, handle_simple_irq); 1066 set_irq_handler(irq, handle_simple_irq);
1067#endif /* !CONFIG_IPIPE */
1052 break; 1068 break;
1053 } 1069 }
1054 } 1070 }
@@ -1073,7 +1089,7 @@ int __init init_arch_irq(void)
1073 CSYNC(); 1089 CSYNC();
1074 1090
1075 printk(KERN_INFO "Configuring Blackfin Priority Driven Interrupts\n"); 1091 printk(KERN_INFO "Configuring Blackfin Priority Driven Interrupts\n");
1076 /* IMASK=xxx is equivalent to STI xx or irq_flags=xx, 1092 /* IMASK=xxx is equivalent to STI xx or bfin_irq_flags=xx,
1077 * local_irq_enable() 1093 * local_irq_enable()
1078 */ 1094 */
1079 program_IAR(); 1095 program_IAR();
@@ -1081,19 +1097,23 @@ int __init init_arch_irq(void)
1081 search_IAR(); 1097 search_IAR();
1082 1098
1083 /* Enable interrupts IVG7-15 */ 1099 /* Enable interrupts IVG7-15 */
1084 irq_flags = irq_flags | IMASK_IVG15 | 1100 bfin_irq_flags |= IMASK_IVG15 |
1085 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 | 1101 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 |
1086 IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW; 1102 IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW;
1087 1103
1088#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) 1104#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) \
1105 || defined(BF538_FAMILY) || defined(CONFIG_BF51x)
1089 bfin_write_SIC_IWR0(IWR_DISABLE_ALL); 1106 bfin_write_SIC_IWR0(IWR_DISABLE_ALL);
1090#if defined(CONFIG_BF52x) 1107#if defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
1091 /* BF52x system reset does not properly reset SIC_IWR1 which 1108 /* BF52x/BF51x system reset does not properly reset SIC_IWR1 which
1092 * will screw up the bootrom as it relies on MDMA0/1 waking it 1109 * will screw up the bootrom as it relies on MDMA0/1 waking it
1093 * up from IDLE instructions. See this report for more info: 1110 * up from IDLE instructions. See this report for more info:
1094 * http://blackfin.uclinux.org/gf/tracker/4323 1111 * http://blackfin.uclinux.org/gf/tracker/4323
1095 */ 1112 */
1096 bfin_write_SIC_IWR1(IWR_ENABLE(10) | IWR_ENABLE(11)); 1113 if (ANOMALY_05000435)
1114 bfin_write_SIC_IWR1(IWR_ENABLE(10) | IWR_ENABLE(11));
1115 else
1116 bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
1097#else 1117#else
1098 bfin_write_SIC_IWR1(IWR_DISABLE_ALL); 1118 bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
1099#endif 1119#endif
@@ -1104,6 +1124,14 @@ int __init init_arch_irq(void)
1104 bfin_write_SIC_IWR(IWR_DISABLE_ALL); 1124 bfin_write_SIC_IWR(IWR_DISABLE_ALL);
1105#endif 1125#endif
1106 1126
1127#ifdef CONFIG_IPIPE
1128 for (irq = 0; irq < NR_IRQS; irq++) {
1129 struct irq_desc *desc = irq_desc + irq;
1130 desc->ic_prio = __ipipe_get_irq_priority(irq);
1131 desc->thr_prio = __ipipe_get_irqthread_priority(irq);
1132 }
1133#endif /* CONFIG_IPIPE */
1134
1107 return 0; 1135 return 0;
1108} 1136}
1109 1137
@@ -1117,11 +1145,20 @@ void do_irq(int vec, struct pt_regs *fp)
1117 } else { 1145 } else {
1118 struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst; 1146 struct ivgx *ivg = ivg7_13[vec - IVG7].ifirst;
1119 struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop; 1147 struct ivgx *ivg_stop = ivg7_13[vec - IVG7].istop;
1120#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) 1148#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) \
1149 || defined(BF538_FAMILY) || defined(CONFIG_BF51x)
1121 unsigned long sic_status[3]; 1150 unsigned long sic_status[3];
1122 1151
1123 sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0(); 1152 if (smp_processor_id()) {
1124 sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1(); 1153#ifdef CONFIG_SMP
1154 /* This will be optimized out in UP mode. */
1155 sic_status[0] = bfin_read_SICB_ISR0() & bfin_read_SICB_IMASK0();
1156 sic_status[1] = bfin_read_SICB_ISR1() & bfin_read_SICB_IMASK1();
1157#endif
1158 } else {
1159 sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0();
1160 sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1();
1161 }
1125#ifdef CONFIG_BF54x 1162#ifdef CONFIG_BF54x
1126 sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2(); 1163 sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2();
1127#endif 1164#endif
@@ -1150,3 +1187,161 @@ void do_irq(int vec, struct pt_regs *fp)
1150 } 1187 }
1151 asm_do_IRQ(vec, fp); 1188 asm_do_IRQ(vec, fp);
1152} 1189}
1190
1191#ifdef CONFIG_IPIPE
1192
1193int __ipipe_get_irq_priority(unsigned irq)
1194{
1195 int ient, prio;
1196
1197 if (irq <= IRQ_CORETMR)
1198 return irq;
1199
1200 for (ient = 0; ient < NR_PERI_INTS; ient++) {
1201 struct ivgx *ivg = ivg_table + ient;
1202 if (ivg->irqno == irq) {
1203 for (prio = 0; prio <= IVG13-IVG7; prio++) {
1204 if (ivg7_13[prio].ifirst <= ivg &&
1205 ivg7_13[prio].istop > ivg)
1206 return IVG7 + prio;
1207 }
1208 }
1209 }
1210
1211 return IVG15;
1212}
1213
1214int __ipipe_get_irqthread_priority(unsigned irq)
1215{
1216 int ient, prio;
1217 int demux_irq;
1218
1219 /* The returned priority value is rescaled to [0..IVG13+1]
1220 * with 0 being the lowest effective priority level. */
1221
1222 if (irq <= IRQ_CORETMR)
1223 return IVG13 - irq + 1;
1224
1225 /* GPIO IRQs are given the priority of the demux
1226 * interrupt. */
1227 if (IS_GPIOIRQ(irq)) {
1228#if defined(CONFIG_BF54x)
1229 u32 bank = PINT_2_BANK(irq2pint_lut[irq - SYS_IRQS]);
1230 demux_irq = (bank == 0 ? IRQ_PINT0 :
1231 bank == 1 ? IRQ_PINT1 :
1232 bank == 2 ? IRQ_PINT2 :
1233 IRQ_PINT3);
1234#elif defined(CONFIG_BF561)
1235 demux_irq = (irq >= IRQ_PF32 ? IRQ_PROG2_INTA :
1236 irq >= IRQ_PF16 ? IRQ_PROG1_INTA :
1237 IRQ_PROG0_INTA);
1238#elif defined(CONFIG_BF52x)
1239 demux_irq = (irq >= IRQ_PH0 ? IRQ_PORTH_INTA :
1240 irq >= IRQ_PG0 ? IRQ_PORTG_INTA :
1241 IRQ_PORTF_INTA);
1242#else
1243 demux_irq = irq;
1244#endif
1245 return IVG13 - PRIO_GPIODEMUX(demux_irq) + 1;
1246 }
1247
1248 /* The GPIO demux interrupt is given a lower priority
1249 * than the GPIO IRQs, so that its threaded handler
1250 * unmasks the interrupt line after the decoded IRQs
1251 * have been processed. */
1252 prio = PRIO_GPIODEMUX(irq);
1253 /* demux irq? */
1254 if (prio != -1)
1255 return IVG13 - prio;
1256
1257 for (ient = 0; ient < NR_PERI_INTS; ient++) {
1258 struct ivgx *ivg = ivg_table + ient;
1259 if (ivg->irqno == irq) {
1260 for (prio = 0; prio <= IVG13-IVG7; prio++) {
1261 if (ivg7_13[prio].ifirst <= ivg &&
1262 ivg7_13[prio].istop > ivg)
1263 return IVG7 - prio;
1264 }
1265 }
1266 }
1267
1268 return 0;
1269}
1270
1271/* Hw interrupts are disabled on entry (check SAVE_CONTEXT). */
1272#ifdef CONFIG_DO_IRQ_L1
1273__attribute__((l1_text))
1274#endif
1275asmlinkage int __ipipe_grab_irq(int vec, struct pt_regs *regs)
1276{
1277 struct ivgx *ivg_stop = ivg7_13[vec-IVG7].istop;
1278 struct ivgx *ivg = ivg7_13[vec-IVG7].ifirst;
1279 int irq;
1280
1281 if (likely(vec == EVT_IVTMR_P)) {
1282 irq = IRQ_CORETMR;
1283 goto handle_irq;
1284 }
1285
1286 SSYNC();
1287
1288#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561)
1289 {
1290 unsigned long sic_status[3];
1291
1292 sic_status[0] = bfin_read_SIC_ISR0() & bfin_read_SIC_IMASK0();
1293 sic_status[1] = bfin_read_SIC_ISR1() & bfin_read_SIC_IMASK1();
1294#ifdef CONFIG_BF54x
1295 sic_status[2] = bfin_read_SIC_ISR2() & bfin_read_SIC_IMASK2();
1296#endif
1297 for (;; ivg++) {
1298 if (ivg >= ivg_stop) {
1299 atomic_inc(&num_spurious);
1300 return 0;
1301 }
1302 if (sic_status[(ivg->irqno - IVG7) / 32] & ivg->isrflag)
1303 break;
1304 }
1305 }
1306#else
1307 {
1308 unsigned long sic_status;
1309
1310 sic_status = bfin_read_SIC_IMASK() & bfin_read_SIC_ISR();
1311
1312 for (;; ivg++) {
1313 if (ivg >= ivg_stop) {
1314 atomic_inc(&num_spurious);
1315 return 0;
1316 } else if (sic_status & ivg->isrflag)
1317 break;
1318 }
1319 }
1320#endif
1321
1322 irq = ivg->irqno;
1323
1324 if (irq == IRQ_SYSTMR) {
1325 bfin_write_TIMER_STATUS(1); /* Latch TIMIL0 */
1326 /* This is basically what we need from the register frame. */
1327 __raw_get_cpu_var(__ipipe_tick_regs).ipend = regs->ipend;
1328 __raw_get_cpu_var(__ipipe_tick_regs).pc = regs->pc;
1329 if (!ipipe_root_domain_p)
1330 __raw_get_cpu_var(__ipipe_tick_regs).ipend |= 0x10;
1331 else
1332 __raw_get_cpu_var(__ipipe_tick_regs).ipend &= ~0x10;
1333 }
1334
1335handle_irq:
1336
1337 ipipe_trace_irq_entry(irq);
1338 __ipipe_handle_irq(irq, regs);
1339 ipipe_trace_irq_exit(irq);
1340
1341 if (ipipe_root_domain_p)
1342 return !test_bit(IPIPE_STALL_FLAG, &ipipe_root_cpudom_var(status));
1343
1344 return 0;
1345}
1346
1347#endif /* CONFIG_IPIPE */
diff --git a/arch/blackfin/mach-common/irqpanic.c b/arch/blackfin/mach-common/irqpanic.c
index 606ded9ff4e1..05004df0f78b 100644
--- a/arch/blackfin/mach-common/irqpanic.c
+++ b/arch/blackfin/mach-common/irqpanic.c
@@ -33,8 +33,6 @@
33#include <asm/traps.h> 33#include <asm/traps.h>
34#include <asm/blackfin.h> 34#include <asm/blackfin.h>
35 35
36#include "../oprofile/op_blackfin.h"
37
38#ifdef CONFIG_DEBUG_ICACHE_CHECK 36#ifdef CONFIG_DEBUG_ICACHE_CHECK
39#define L1_ICACHE_START 0xffa10000 37#define L1_ICACHE_START 0xffa10000
40#define L1_ICACHE_END 0xffa13fff 38#define L1_ICACHE_END 0xffa13fff
@@ -134,13 +132,3 @@ asmlinkage void irq_panic(int reason, struct pt_regs *regs)
134#endif 132#endif
135 133
136} 134}
137
138#ifdef CONFIG_HARDWARE_PM
139/*
140 * call the handler of Performance overflow
141 */
142asmlinkage void pm_overflow(int irq, struct pt_regs *regs)
143{
144 pm_overflow_handler(irq, regs);
145}
146#endif
diff --git a/arch/blackfin/mach-common/lock.S b/arch/blackfin/mach-common/lock.S
index 9daf01201e9f..6c5f5f0ea7fe 100644
--- a/arch/blackfin/mach-common/lock.S
+++ b/arch/blackfin/mach-common/lock.S
@@ -160,7 +160,7 @@ ENDPROC(_cache_grab_lock)
160 * R0 - Which way to be locked 160 * R0 - Which way to be locked
161 */ 161 */
162 162
163ENTRY(_cache_lock) 163ENTRY(_bfin_cache_lock)
164 164
165 [--SP]=( R7:0,P5:0 ); 165 [--SP]=( R7:0,P5:0 );
166 166
@@ -184,7 +184,7 @@ ENTRY(_cache_lock)
184 184
185 ( R7:0,P5:0 ) = [SP++]; 185 ( R7:0,P5:0 ) = [SP++];
186 RTS; 186 RTS;
187ENDPROC(_cache_lock) 187ENDPROC(_bfin_cache_lock)
188 188
189/* Invalidate the Entire Instruction cache by 189/* Invalidate the Entire Instruction cache by
190 * disabling IMC bit 190 * disabling IMC bit
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c
index e28c6af1f415..d3d70fd67c16 100644
--- a/arch/blackfin/mach-common/pm.c
+++ b/arch/blackfin/mach-common/pm.c
@@ -71,7 +71,7 @@ void bfin_pm_suspend_standby_enter(void)
71 gpio_pm_wakeup_request(CONFIG_PM_WAKEUP_GPIO_NUMBER, WAKEUP_TYPE); 71 gpio_pm_wakeup_request(CONFIG_PM_WAKEUP_GPIO_NUMBER, WAKEUP_TYPE);
72#endif 72#endif
73 73
74 local_irq_save(flags); 74 local_irq_save_hw(flags);
75 bfin_pm_standby_setup(); 75 bfin_pm_standby_setup();
76 76
77#ifdef CONFIG_PM_BFIN_SLEEP_DEEPER 77#ifdef CONFIG_PM_BFIN_SLEEP_DEEPER
@@ -82,15 +82,19 @@ void bfin_pm_suspend_standby_enter(void)
82 82
83 bfin_pm_standby_restore(); 83 bfin_pm_standby_restore();
84 84
85#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) 85#if defined(CONFIG_BF54x) || defined(CONFIG_BF52x) || defined(CONFIG_BF561) || \
86 defined(CONFIG_BF538) || defined(CONFIG_BF539) || defined(CONFIG_BF51x)
86 bfin_write_SIC_IWR0(IWR_DISABLE_ALL); 87 bfin_write_SIC_IWR0(IWR_DISABLE_ALL);
87#if defined(CONFIG_BF52x) 88#if defined(CONFIG_BF52x) || defined(CONFIG_BF51x)
88 /* BF52x system reset does not properly reset SIC_IWR1 which 89 /* BF52x system reset does not properly reset SIC_IWR1 which
89 * will screw up the bootrom as it relies on MDMA0/1 waking it 90 * will screw up the bootrom as it relies on MDMA0/1 waking it
90 * up from IDLE instructions. See this report for more info: 91 * up from IDLE instructions. See this report for more info:
91 * http://blackfin.uclinux.org/gf/tracker/4323 92 * http://blackfin.uclinux.org/gf/tracker/4323
92 */ 93 */
93 bfin_write_SIC_IWR1(IWR_ENABLE(10) | IWR_ENABLE(11)); 94 if (ANOMALY_05000435)
95 bfin_write_SIC_IWR1(IWR_ENABLE(10) | IWR_ENABLE(11));
96 else
97 bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
94#else 98#else
95 bfin_write_SIC_IWR1(IWR_DISABLE_ALL); 99 bfin_write_SIC_IWR1(IWR_DISABLE_ALL);
96#endif 100#endif
@@ -101,7 +105,7 @@ void bfin_pm_suspend_standby_enter(void)
101 bfin_write_SIC_IWR(IWR_DISABLE_ALL); 105 bfin_write_SIC_IWR(IWR_DISABLE_ALL);
102#endif 106#endif
103 107
104 local_irq_restore(flags); 108 local_irq_restore_hw(flags);
105} 109}
106 110
107int bf53x_suspend_l1_mem(unsigned char *memptr) 111int bf53x_suspend_l1_mem(unsigned char *memptr)
@@ -245,12 +249,12 @@ int bfin_pm_suspend_mem_enter(void)
245 wakeup |= GPWE; 249 wakeup |= GPWE;
246#endif 250#endif
247 251
248 local_irq_save(flags); 252 local_irq_save_hw(flags);
249 253
250 ret = blackfin_dma_suspend(); 254 ret = blackfin_dma_suspend();
251 255
252 if (ret) { 256 if (ret) {
253 local_irq_restore(flags); 257 local_irq_restore_hw(flags);
254 kfree(memptr); 258 kfree(memptr);
255 return ret; 259 return ret;
256 } 260 }
@@ -271,7 +275,7 @@ int bfin_pm_suspend_mem_enter(void)
271 bfin_gpio_pm_hibernate_restore(); 275 bfin_gpio_pm_hibernate_restore();
272 blackfin_dma_resume(); 276 blackfin_dma_resume();
273 277
274 local_irq_restore(flags); 278 local_irq_restore_hw(flags);
275 kfree(memptr); 279 kfree(memptr);
276 280
277 return 0; 281 return 0;
diff --git a/arch/blackfin/mach-common/smp.c b/arch/blackfin/mach-common/smp.c
new file mode 100644
index 000000000000..77c992847094
--- /dev/null
+++ b/arch/blackfin/mach-common/smp.c
@@ -0,0 +1,476 @@
1/*
2 * File: arch/blackfin/kernel/smp.c
3 * Author: Philippe Gerum <rpm@xenomai.org>
4 * IPI management based on arch/arm/kernel/smp.c.
5 *
6 * Copyright 2007 Analog Devices Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, see the file COPYING, or write
20 * to the Free Software Foundation, Inc.,
21 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#include <linux/module.h>
25#include <linux/delay.h>
26#include <linux/init.h>
27#include <linux/spinlock.h>
28#include <linux/sched.h>
29#include <linux/interrupt.h>
30#include <linux/cache.h>
31#include <linux/profile.h>
32#include <linux/errno.h>
33#include <linux/mm.h>
34#include <linux/cpu.h>
35#include <linux/smp.h>
36#include <linux/seq_file.h>
37#include <linux/irq.h>
38#include <asm/atomic.h>
39#include <asm/cacheflush.h>
40#include <asm/mmu_context.h>
41#include <asm/pgtable.h>
42#include <asm/pgalloc.h>
43#include <asm/processor.h>
44#include <asm/ptrace.h>
45#include <asm/cpu.h>
46#include <linux/err.h>
47
48struct corelock_slot corelock __attribute__ ((__section__(".l2.bss")));
49
50void __cpuinitdata *init_retx_coreb, *init_saved_retx_coreb,
51 *init_saved_seqstat_coreb, *init_saved_icplb_fault_addr_coreb,
52 *init_saved_dcplb_fault_addr_coreb;
53
54cpumask_t cpu_possible_map;
55EXPORT_SYMBOL(cpu_possible_map);
56
57cpumask_t cpu_online_map;
58EXPORT_SYMBOL(cpu_online_map);
59
60#define BFIN_IPI_RESCHEDULE 0
61#define BFIN_IPI_CALL_FUNC 1
62#define BFIN_IPI_CPU_STOP 2
63
64struct blackfin_flush_data {
65 unsigned long start;
66 unsigned long end;
67};
68
69void *secondary_stack;
70
71
72struct smp_call_struct {
73 void (*func)(void *info);
74 void *info;
75 int wait;
76 cpumask_t pending;
77 cpumask_t waitmask;
78};
79
80static struct blackfin_flush_data smp_flush_data;
81
82static DEFINE_SPINLOCK(stop_lock);
83
84struct ipi_message {
85 struct list_head list;
86 unsigned long type;
87 struct smp_call_struct call_struct;
88};
89
90struct ipi_message_queue {
91 struct list_head head;
92 spinlock_t lock;
93 unsigned long count;
94};
95
96static DEFINE_PER_CPU(struct ipi_message_queue, ipi_msg_queue);
97
98static void ipi_cpu_stop(unsigned int cpu)
99{
100 spin_lock(&stop_lock);
101 printk(KERN_CRIT "CPU%u: stopping\n", cpu);
102 dump_stack();
103 spin_unlock(&stop_lock);
104
105 cpu_clear(cpu, cpu_online_map);
106
107 local_irq_disable();
108
109 while (1)
110 SSYNC();
111}
112
113static void ipi_flush_icache(void *info)
114{
115 struct blackfin_flush_data *fdata = info;
116
117 /* Invalidate the memory holding the bounds of the flushed region. */
118 blackfin_dcache_invalidate_range((unsigned long)fdata,
119 (unsigned long)fdata + sizeof(*fdata));
120
121 blackfin_icache_flush_range(fdata->start, fdata->end);
122}
123
124static void ipi_call_function(unsigned int cpu, struct ipi_message *msg)
125{
126 int wait;
127 void (*func)(void *info);
128 void *info;
129 func = msg->call_struct.func;
130 info = msg->call_struct.info;
131 wait = msg->call_struct.wait;
132 cpu_clear(cpu, msg->call_struct.pending);
133 func(info);
134 if (wait)
135 cpu_clear(cpu, msg->call_struct.waitmask);
136 else
137 kfree(msg);
138}
139
140static irqreturn_t ipi_handler(int irq, void *dev_instance)
141{
142 struct ipi_message *msg, *mg;
143 struct ipi_message_queue *msg_queue;
144 unsigned int cpu = smp_processor_id();
145
146 platform_clear_ipi(cpu);
147
148 msg_queue = &__get_cpu_var(ipi_msg_queue);
149 msg_queue->count++;
150
151 spin_lock(&msg_queue->lock);
152 list_for_each_entry_safe(msg, mg, &msg_queue->head, list) {
153 list_del(&msg->list);
154 switch (msg->type) {
155 case BFIN_IPI_RESCHEDULE:
156 /* That's the easiest one; leave it to
157 * return_from_int. */
158 kfree(msg);
159 break;
160 case BFIN_IPI_CALL_FUNC:
161 ipi_call_function(cpu, msg);
162 break;
163 case BFIN_IPI_CPU_STOP:
164 ipi_cpu_stop(cpu);
165 kfree(msg);
166 break;
167 default:
168 printk(KERN_CRIT "CPU%u: Unknown IPI message \
169 0x%lx\n", cpu, msg->type);
170 kfree(msg);
171 break;
172 }
173 }
174 spin_unlock(&msg_queue->lock);
175 return IRQ_HANDLED;
176}
177
178static void ipi_queue_init(void)
179{
180 unsigned int cpu;
181 struct ipi_message_queue *msg_queue;
182 for_each_possible_cpu(cpu) {
183 msg_queue = &per_cpu(ipi_msg_queue, cpu);
184 INIT_LIST_HEAD(&msg_queue->head);
185 spin_lock_init(&msg_queue->lock);
186 msg_queue->count = 0;
187 }
188}
189
190int smp_call_function(void (*func)(void *info), void *info, int wait)
191{
192 unsigned int cpu;
193 cpumask_t callmap;
194 unsigned long flags;
195 struct ipi_message_queue *msg_queue;
196 struct ipi_message *msg;
197
198 callmap = cpu_online_map;
199 cpu_clear(smp_processor_id(), callmap);
200 if (cpus_empty(callmap))
201 return 0;
202
203 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
204 INIT_LIST_HEAD(&msg->list);
205 msg->call_struct.func = func;
206 msg->call_struct.info = info;
207 msg->call_struct.wait = wait;
208 msg->call_struct.pending = callmap;
209 msg->call_struct.waitmask = callmap;
210 msg->type = BFIN_IPI_CALL_FUNC;
211
212 for_each_cpu_mask(cpu, callmap) {
213 msg_queue = &per_cpu(ipi_msg_queue, cpu);
214 spin_lock_irqsave(&msg_queue->lock, flags);
215 list_add(&msg->list, &msg_queue->head);
216 spin_unlock_irqrestore(&msg_queue->lock, flags);
217 platform_send_ipi_cpu(cpu);
218 }
219 if (wait) {
220 while (!cpus_empty(msg->call_struct.waitmask))
221 blackfin_dcache_invalidate_range(
222 (unsigned long)(&msg->call_struct.waitmask),
223 (unsigned long)(&msg->call_struct.waitmask));
224 kfree(msg);
225 }
226 return 0;
227}
228EXPORT_SYMBOL_GPL(smp_call_function);
229
230int smp_call_function_single(int cpuid, void (*func) (void *info), void *info,
231 int wait)
232{
233 unsigned int cpu = cpuid;
234 cpumask_t callmap;
235 unsigned long flags;
236 struct ipi_message_queue *msg_queue;
237 struct ipi_message *msg;
238
239 if (cpu_is_offline(cpu))
240 return 0;
241 cpus_clear(callmap);
242 cpu_set(cpu, callmap);
243
244 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
245 INIT_LIST_HEAD(&msg->list);
246 msg->call_struct.func = func;
247 msg->call_struct.info = info;
248 msg->call_struct.wait = wait;
249 msg->call_struct.pending = callmap;
250 msg->call_struct.waitmask = callmap;
251 msg->type = BFIN_IPI_CALL_FUNC;
252
253 msg_queue = &per_cpu(ipi_msg_queue, cpu);
254 spin_lock_irqsave(&msg_queue->lock, flags);
255 list_add(&msg->list, &msg_queue->head);
256 spin_unlock_irqrestore(&msg_queue->lock, flags);
257 platform_send_ipi_cpu(cpu);
258
259 if (wait) {
260 while (!cpus_empty(msg->call_struct.waitmask))
261 blackfin_dcache_invalidate_range(
262 (unsigned long)(&msg->call_struct.waitmask),
263 (unsigned long)(&msg->call_struct.waitmask));
264 kfree(msg);
265 }
266 return 0;
267}
268EXPORT_SYMBOL_GPL(smp_call_function_single);
269
270void smp_send_reschedule(int cpu)
271{
272 unsigned long flags;
273 struct ipi_message_queue *msg_queue;
274 struct ipi_message *msg;
275
276 if (cpu_is_offline(cpu))
277 return;
278
279 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
280 memset(msg, 0, sizeof(msg));
281 INIT_LIST_HEAD(&msg->list);
282 msg->type = BFIN_IPI_RESCHEDULE;
283
284 msg_queue = &per_cpu(ipi_msg_queue, cpu);
285 spin_lock_irqsave(&msg_queue->lock, flags);
286 list_add(&msg->list, &msg_queue->head);
287 spin_unlock_irqrestore(&msg_queue->lock, flags);
288 platform_send_ipi_cpu(cpu);
289
290 return;
291}
292
293void smp_send_stop(void)
294{
295 unsigned int cpu;
296 cpumask_t callmap;
297 unsigned long flags;
298 struct ipi_message_queue *msg_queue;
299 struct ipi_message *msg;
300
301 callmap = cpu_online_map;
302 cpu_clear(smp_processor_id(), callmap);
303 if (cpus_empty(callmap))
304 return;
305
306 msg = kmalloc(sizeof(*msg), GFP_ATOMIC);
307 memset(msg, 0, sizeof(msg));
308 INIT_LIST_HEAD(&msg->list);
309 msg->type = BFIN_IPI_CPU_STOP;
310
311 for_each_cpu_mask(cpu, callmap) {
312 msg_queue = &per_cpu(ipi_msg_queue, cpu);
313 spin_lock_irqsave(&msg_queue->lock, flags);
314 list_add(&msg->list, &msg_queue->head);
315 spin_unlock_irqrestore(&msg_queue->lock, flags);
316 platform_send_ipi_cpu(cpu);
317 }
318 return;
319}
320
321int __cpuinit __cpu_up(unsigned int cpu)
322{
323 struct task_struct *idle;
324 int ret;
325
326 idle = fork_idle(cpu);
327 if (IS_ERR(idle)) {
328 printk(KERN_ERR "CPU%u: fork() failed\n", cpu);
329 return PTR_ERR(idle);
330 }
331
332 secondary_stack = task_stack_page(idle) + THREAD_SIZE;
333 smp_wmb();
334
335 ret = platform_boot_secondary(cpu, idle);
336
337 if (ret) {
338 cpu_clear(cpu, cpu_present_map);
339 printk(KERN_CRIT "CPU%u: processor failed to boot (%d)\n", cpu, ret);
340 free_task(idle);
341 } else
342 cpu_set(cpu, cpu_online_map);
343
344 secondary_stack = NULL;
345
346 return ret;
347}
348
349static void __cpuinit setup_secondary(unsigned int cpu)
350{
351#if !(defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE))
352 struct irq_desc *timer_desc;
353#endif
354 unsigned long ilat;
355
356 bfin_write_IMASK(0);
357 CSYNC();
358 ilat = bfin_read_ILAT();
359 CSYNC();
360 bfin_write_ILAT(ilat);
361 CSYNC();
362
363 /* Reserve the PDA space for the secondary CPU. */
364 reserve_pda();
365
366 /* Enable interrupt levels IVG7-15. IARs have been already
367 * programmed by the boot CPU. */
368 bfin_irq_flags |= IMASK_IVG15 |
369 IMASK_IVG14 | IMASK_IVG13 | IMASK_IVG12 | IMASK_IVG11 |
370 IMASK_IVG10 | IMASK_IVG9 | IMASK_IVG8 | IMASK_IVG7 | IMASK_IVGHW;
371
372#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE)
373 /* Power down the core timer, just to play safe. */
374 bfin_write_TCNTL(0);
375
376 /* system timer0 has been setup by CoreA. */
377#else
378 timer_desc = irq_desc + IRQ_CORETMR;
379 setup_core_timer();
380 timer_desc->chip->enable(IRQ_CORETMR);
381#endif
382}
383
384void __cpuinit secondary_start_kernel(void)
385{
386 unsigned int cpu = smp_processor_id();
387 struct mm_struct *mm = &init_mm;
388
389 if (_bfin_swrst & SWRST_DBL_FAULT_B) {
390 printk(KERN_EMERG "CoreB Recovering from DOUBLE FAULT event\n");
391#ifdef CONFIG_DEBUG_DOUBLEFAULT
392 printk(KERN_EMERG " While handling exception (EXCAUSE = 0x%x) at %pF\n",
393 (int)init_saved_seqstat_coreb & SEQSTAT_EXCAUSE, init_saved_retx_coreb);
394 printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %pF\n", init_saved_dcplb_fault_addr_coreb);
395 printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %pF\n", init_saved_icplb_fault_addr_coreb);
396#endif
397 printk(KERN_NOTICE " The instruction at %pF caused a double exception\n",
398 init_retx_coreb);
399 }
400
401 /*
402 * We want the D-cache to be enabled early, in case the atomic
403 * support code emulates cache coherence (see
404 * __ARCH_SYNC_CORE_DCACHE).
405 */
406 init_exception_vectors();
407
408 bfin_setup_caches(cpu);
409
410 local_irq_disable();
411
412 /* Attach the new idle task to the global mm. */
413 atomic_inc(&mm->mm_users);
414 atomic_inc(&mm->mm_count);
415 current->active_mm = mm;
416 BUG_ON(current->mm); /* Can't be, but better be safe than sorry. */
417
418 preempt_disable();
419
420 setup_secondary(cpu);
421
422 local_irq_enable();
423
424 platform_secondary_init(cpu);
425
426 cpu_idle();
427}
428
429void __init smp_prepare_boot_cpu(void)
430{
431}
432
433void __init smp_prepare_cpus(unsigned int max_cpus)
434{
435 platform_prepare_cpus(max_cpus);
436 ipi_queue_init();
437 platform_request_ipi(&ipi_handler);
438}
439
440void __init smp_cpus_done(unsigned int max_cpus)
441{
442 unsigned long bogosum = 0;
443 unsigned int cpu;
444
445 for_each_online_cpu(cpu)
446 bogosum += per_cpu(cpu_data, cpu).loops_per_jiffy;
447
448 printk(KERN_INFO "SMP: Total of %d processors activated "
449 "(%lu.%02lu BogoMIPS).\n",
450 num_online_cpus(),
451 bogosum / (500000/HZ),
452 (bogosum / (5000/HZ)) % 100);
453}
454
455void smp_icache_flush_range_others(unsigned long start, unsigned long end)
456{
457 smp_flush_data.start = start;
458 smp_flush_data.end = end;
459
460 if (smp_call_function(&ipi_flush_icache, &smp_flush_data, 1))
461 printk(KERN_WARNING "SMP: failed to run I-cache flush request on other CPUs\n");
462}
463EXPORT_SYMBOL_GPL(smp_icache_flush_range_others);
464
465#ifdef __ARCH_SYNC_CORE_DCACHE
466unsigned long barrier_mask __attribute__ ((__section__(".l2.bss")));
467
468void resync_core_dcache(void)
469{
470 unsigned int cpu = get_cpu();
471 blackfin_invalidate_entire_dcache();
472 ++per_cpu(cpu_data, cpu).dcache_invld_count;
473 put_cpu();
474}
475EXPORT_SYMBOL(resync_core_dcache);
476#endif
diff --git a/arch/blackfin/mm/init.c b/arch/blackfin/mm/init.c
index bc240abb8745..d0532b72bba5 100644
--- a/arch/blackfin/mm/init.c
+++ b/arch/blackfin/mm/init.c
@@ -31,7 +31,8 @@
31#include <linux/bootmem.h> 31#include <linux/bootmem.h>
32#include <linux/uaccess.h> 32#include <linux/uaccess.h>
33#include <asm/bfin-global.h> 33#include <asm/bfin-global.h>
34#include <asm/l1layout.h> 34#include <asm/pda.h>
35#include <asm/cplbinit.h>
35#include "blackfin_sram.h" 36#include "blackfin_sram.h"
36 37
37/* 38/*
@@ -53,6 +54,11 @@ static unsigned long empty_bad_page;
53 54
54unsigned long empty_zero_page; 55unsigned long empty_zero_page;
55 56
57extern unsigned long exception_stack[NR_CPUS][1024];
58
59struct blackfin_pda cpu_pda[NR_CPUS];
60EXPORT_SYMBOL(cpu_pda);
61
56/* 62/*
57 * paging_init() continues the virtual memory environment setup which 63 * paging_init() continues the virtual memory environment setup which
58 * was begun by the code in arch/head.S. 64 * was begun by the code in arch/head.S.
@@ -98,6 +104,32 @@ void __init paging_init(void)
98 } 104 }
99} 105}
100 106
107asmlinkage void init_pda(void)
108{
109 unsigned int cpu = raw_smp_processor_id();
110
111 /* Initialize the PDA fields holding references to other parts
112 of the memory. The content of such memory is still
113 undefined at the time of the call, we are only setting up
114 valid pointers to it. */
115 memset(&cpu_pda[cpu], 0, sizeof(cpu_pda[cpu]));
116
117 cpu_pda[0].next = &cpu_pda[1];
118 cpu_pda[1].next = &cpu_pda[0];
119
120 cpu_pda[cpu].ex_stack = exception_stack[cpu + 1];
121
122#ifdef CONFIG_SMP
123 cpu_pda[cpu].imask = 0x1f;
124#endif
125}
126
127void __cpuinit reserve_pda(void)
128{
129 printk(KERN_INFO "PDA for CPU%u reserved at %p\n", smp_processor_id(),
130 &cpu_pda[smp_processor_id()]);
131}
132
101void __init mem_init(void) 133void __init mem_init(void)
102{ 134{
103 unsigned int codek = 0, datak = 0, initk = 0; 135 unsigned int codek = 0, datak = 0, initk = 0;
@@ -141,21 +173,13 @@ void __init mem_init(void)
141 173
142static int __init sram_init(void) 174static int __init sram_init(void)
143{ 175{
144 unsigned long tmp;
145
146 /* Initialize the blackfin L1 Memory. */ 176 /* Initialize the blackfin L1 Memory. */
147 bfin_sram_init(); 177 bfin_sram_init();
148 178
149 /* Allocate this once; never free it. We assume this gives us a 179 /* Reserve the PDA space for the boot CPU right after we
150 pointer to the start of L1 scratchpad memory; panic if it 180 * initialized the scratch memory allocator.
151 doesn't. */ 181 */
152 tmp = (unsigned long)l1sram_alloc(sizeof(struct l1_scratch_task_info)); 182 reserve_pda();
153 if (tmp != (unsigned long)L1_SCRATCH_TASK_INFO) {
154 printk(KERN_EMERG "mem_init(): Did not get the right address from l1sram_alloc: %08lx != %08lx\n",
155 tmp, (unsigned long)L1_SCRATCH_TASK_INFO);
156 panic("No L1, time to give up\n");
157 }
158
159 return 0; 183 return 0;
160} 184}
161pure_initcall(sram_init); 185pure_initcall(sram_init);
diff --git a/arch/blackfin/mm/sram-alloc.c b/arch/blackfin/mm/sram-alloc.c
index cc6f336e7313..834cab7438a8 100644
--- a/arch/blackfin/mm/sram-alloc.c
+++ b/arch/blackfin/mm/sram-alloc.c
@@ -39,10 +39,13 @@
39#include <linux/spinlock.h> 39#include <linux/spinlock.h>
40#include <linux/rtc.h> 40#include <linux/rtc.h>
41#include <asm/blackfin.h> 41#include <asm/blackfin.h>
42#include <asm/mem_map.h>
42#include "blackfin_sram.h" 43#include "blackfin_sram.h"
43 44
44static spinlock_t l1sram_lock, l1_data_sram_lock, l1_inst_sram_lock; 45static DEFINE_PER_CPU(spinlock_t, l1sram_lock) ____cacheline_aligned_in_smp;
45static spinlock_t l2_sram_lock; 46static DEFINE_PER_CPU(spinlock_t, l1_data_sram_lock) ____cacheline_aligned_in_smp;
47static DEFINE_PER_CPU(spinlock_t, l1_inst_sram_lock) ____cacheline_aligned_in_smp;
48static spinlock_t l2_sram_lock ____cacheline_aligned_in_smp;
46 49
47/* the data structure for L1 scratchpad and DATA SRAM */ 50/* the data structure for L1 scratchpad and DATA SRAM */
48struct sram_piece { 51struct sram_piece {
@@ -52,18 +55,22 @@ struct sram_piece {
52 struct sram_piece *next; 55 struct sram_piece *next;
53}; 56};
54 57
55static struct sram_piece free_l1_ssram_head, used_l1_ssram_head; 58static DEFINE_PER_CPU(struct sram_piece, free_l1_ssram_head);
59static DEFINE_PER_CPU(struct sram_piece, used_l1_ssram_head);
56 60
57#if L1_DATA_A_LENGTH != 0 61#if L1_DATA_A_LENGTH != 0
58static struct sram_piece free_l1_data_A_sram_head, used_l1_data_A_sram_head; 62static DEFINE_PER_CPU(struct sram_piece, free_l1_data_A_sram_head);
63static DEFINE_PER_CPU(struct sram_piece, used_l1_data_A_sram_head);
59#endif 64#endif
60 65
61#if L1_DATA_B_LENGTH != 0 66#if L1_DATA_B_LENGTH != 0
62static struct sram_piece free_l1_data_B_sram_head, used_l1_data_B_sram_head; 67static DEFINE_PER_CPU(struct sram_piece, free_l1_data_B_sram_head);
68static DEFINE_PER_CPU(struct sram_piece, used_l1_data_B_sram_head);
63#endif 69#endif
64 70
65#if L1_CODE_LENGTH != 0 71#if L1_CODE_LENGTH != 0
66static struct sram_piece free_l1_inst_sram_head, used_l1_inst_sram_head; 72static DEFINE_PER_CPU(struct sram_piece, free_l1_inst_sram_head);
73static DEFINE_PER_CPU(struct sram_piece, used_l1_inst_sram_head);
67#endif 74#endif
68 75
69#if L2_LENGTH != 0 76#if L2_LENGTH != 0
@@ -75,102 +82,117 @@ static struct kmem_cache *sram_piece_cache;
75/* L1 Scratchpad SRAM initialization function */ 82/* L1 Scratchpad SRAM initialization function */
76static void __init l1sram_init(void) 83static void __init l1sram_init(void)
77{ 84{
78 free_l1_ssram_head.next = 85 unsigned int cpu;
79 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); 86 for (cpu = 0; cpu < num_possible_cpus(); ++cpu) {
80 if (!free_l1_ssram_head.next) { 87 per_cpu(free_l1_ssram_head, cpu).next =
81 printk(KERN_INFO "Failed to initialize Scratchpad data SRAM\n"); 88 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
82 return; 89 if (!per_cpu(free_l1_ssram_head, cpu).next) {
90 printk(KERN_INFO "Fail to initialize Scratchpad data SRAM.\n");
91 return;
92 }
93
94 per_cpu(free_l1_ssram_head, cpu).next->paddr = (void *)get_l1_scratch_start_cpu(cpu);
95 per_cpu(free_l1_ssram_head, cpu).next->size = L1_SCRATCH_LENGTH;
96 per_cpu(free_l1_ssram_head, cpu).next->pid = 0;
97 per_cpu(free_l1_ssram_head, cpu).next->next = NULL;
98
99 per_cpu(used_l1_ssram_head, cpu).next = NULL;
100
101 /* mutex initialize */
102 spin_lock_init(&per_cpu(l1sram_lock, cpu));
103 printk(KERN_INFO "Blackfin Scratchpad data SRAM: %d KB\n",
104 L1_SCRATCH_LENGTH >> 10);
83 } 105 }
84
85 free_l1_ssram_head.next->paddr = (void *)L1_SCRATCH_START;
86 free_l1_ssram_head.next->size = L1_SCRATCH_LENGTH;
87 free_l1_ssram_head.next->pid = 0;
88 free_l1_ssram_head.next->next = NULL;
89
90 used_l1_ssram_head.next = NULL;
91
92 /* mutex initialize */
93 spin_lock_init(&l1sram_lock);
94
95 printk(KERN_INFO "Blackfin Scratchpad data SRAM: %d KB\n",
96 L1_SCRATCH_LENGTH >> 10);
97} 106}
98 107
99static void __init l1_data_sram_init(void) 108static void __init l1_data_sram_init(void)
100{ 109{
110#if L1_DATA_A_LENGTH != 0 || L1_DATA_B_LENGTH != 0
111 unsigned int cpu;
112#endif
101#if L1_DATA_A_LENGTH != 0 113#if L1_DATA_A_LENGTH != 0
102 free_l1_data_A_sram_head.next = 114 for (cpu = 0; cpu < num_possible_cpus(); ++cpu) {
103 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); 115 per_cpu(free_l1_data_A_sram_head, cpu).next =
104 if (!free_l1_data_A_sram_head.next) { 116 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
105 printk(KERN_INFO "Failed to initialize L1 Data A SRAM\n"); 117 if (!per_cpu(free_l1_data_A_sram_head, cpu).next) {
106 return; 118 printk(KERN_INFO "Fail to initialize L1 Data A SRAM.\n");
119 return;
120 }
121
122 per_cpu(free_l1_data_A_sram_head, cpu).next->paddr =
123 (void *)get_l1_data_a_start_cpu(cpu) + (_ebss_l1 - _sdata_l1);
124 per_cpu(free_l1_data_A_sram_head, cpu).next->size =
125 L1_DATA_A_LENGTH - (_ebss_l1 - _sdata_l1);
126 per_cpu(free_l1_data_A_sram_head, cpu).next->pid = 0;
127 per_cpu(free_l1_data_A_sram_head, cpu).next->next = NULL;
128
129 per_cpu(used_l1_data_A_sram_head, cpu).next = NULL;
130
131 printk(KERN_INFO "Blackfin L1 Data A SRAM: %d KB (%d KB free)\n",
132 L1_DATA_A_LENGTH >> 10,
133 per_cpu(free_l1_data_A_sram_head, cpu).next->size >> 10);
107 } 134 }
108
109 free_l1_data_A_sram_head.next->paddr =
110 (void *)L1_DATA_A_START + (_ebss_l1 - _sdata_l1);
111 free_l1_data_A_sram_head.next->size =
112 L1_DATA_A_LENGTH - (_ebss_l1 - _sdata_l1);
113 free_l1_data_A_sram_head.next->pid = 0;
114 free_l1_data_A_sram_head.next->next = NULL;
115
116 used_l1_data_A_sram_head.next = NULL;
117
118 printk(KERN_INFO "Blackfin L1 Data A SRAM: %d KB (%d KB free)\n",
119 L1_DATA_A_LENGTH >> 10,
120 free_l1_data_A_sram_head.next->size >> 10);
121#endif 135#endif
122#if L1_DATA_B_LENGTH != 0 136#if L1_DATA_B_LENGTH != 0
123 free_l1_data_B_sram_head.next = 137 for (cpu = 0; cpu < num_possible_cpus(); ++cpu) {
124 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); 138 per_cpu(free_l1_data_B_sram_head, cpu).next =
125 if (!free_l1_data_B_sram_head.next) { 139 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
126 printk(KERN_INFO "Failed to initialize L1 Data B SRAM\n"); 140 if (!per_cpu(free_l1_data_B_sram_head, cpu).next) {
127 return; 141 printk(KERN_INFO "Fail to initialize L1 Data B SRAM.\n");
142 return;
143 }
144
145 per_cpu(free_l1_data_B_sram_head, cpu).next->paddr =
146 (void *)get_l1_data_b_start_cpu(cpu) + (_ebss_b_l1 - _sdata_b_l1);
147 per_cpu(free_l1_data_B_sram_head, cpu).next->size =
148 L1_DATA_B_LENGTH - (_ebss_b_l1 - _sdata_b_l1);
149 per_cpu(free_l1_data_B_sram_head, cpu).next->pid = 0;
150 per_cpu(free_l1_data_B_sram_head, cpu).next->next = NULL;
151
152 per_cpu(used_l1_data_B_sram_head, cpu).next = NULL;
153
154 printk(KERN_INFO "Blackfin L1 Data B SRAM: %d KB (%d KB free)\n",
155 L1_DATA_B_LENGTH >> 10,
156 per_cpu(free_l1_data_B_sram_head, cpu).next->size >> 10);
157 /* mutex initialize */
128 } 158 }
129
130 free_l1_data_B_sram_head.next->paddr =
131 (void *)L1_DATA_B_START + (_ebss_b_l1 - _sdata_b_l1);
132 free_l1_data_B_sram_head.next->size =
133 L1_DATA_B_LENGTH - (_ebss_b_l1 - _sdata_b_l1);
134 free_l1_data_B_sram_head.next->pid = 0;
135 free_l1_data_B_sram_head.next->next = NULL;
136
137 used_l1_data_B_sram_head.next = NULL;
138
139 printk(KERN_INFO "Blackfin L1 Data B SRAM: %d KB (%d KB free)\n",
140 L1_DATA_B_LENGTH >> 10,
141 free_l1_data_B_sram_head.next->size >> 10);
142#endif 159#endif
143 160
144 /* mutex initialize */ 161#if L1_DATA_A_LENGTH != 0 || L1_DATA_B_LENGTH != 0
145 spin_lock_init(&l1_data_sram_lock); 162 for (cpu = 0; cpu < num_possible_cpus(); ++cpu)
163 spin_lock_init(&per_cpu(l1_data_sram_lock, cpu));
164#endif
146} 165}
147 166
148static void __init l1_inst_sram_init(void) 167static void __init l1_inst_sram_init(void)
149{ 168{
150#if L1_CODE_LENGTH != 0 169#if L1_CODE_LENGTH != 0
151 free_l1_inst_sram_head.next = 170 unsigned int cpu;
152 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); 171 for (cpu = 0; cpu < num_possible_cpus(); ++cpu) {
153 if (!free_l1_inst_sram_head.next) { 172 per_cpu(free_l1_inst_sram_head, cpu).next =
154 printk(KERN_INFO "Failed to initialize L1 Instruction SRAM\n"); 173 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
155 return; 174 if (!per_cpu(free_l1_inst_sram_head, cpu).next) {
175 printk(KERN_INFO "Failed to initialize L1 Instruction SRAM\n");
176 return;
177 }
178
179 per_cpu(free_l1_inst_sram_head, cpu).next->paddr =
180 (void *)get_l1_code_start_cpu(cpu) + (_etext_l1 - _stext_l1);
181 per_cpu(free_l1_inst_sram_head, cpu).next->size =
182 L1_CODE_LENGTH - (_etext_l1 - _stext_l1);
183 per_cpu(free_l1_inst_sram_head, cpu).next->pid = 0;
184 per_cpu(free_l1_inst_sram_head, cpu).next->next = NULL;
185
186 per_cpu(used_l1_inst_sram_head, cpu).next = NULL;
187
188 printk(KERN_INFO "Blackfin L1 Instruction SRAM: %d KB (%d KB free)\n",
189 L1_CODE_LENGTH >> 10,
190 per_cpu(free_l1_inst_sram_head, cpu).next->size >> 10);
191
192 /* mutex initialize */
193 spin_lock_init(&per_cpu(l1_inst_sram_lock, cpu));
156 } 194 }
157
158 free_l1_inst_sram_head.next->paddr =
159 (void *)L1_CODE_START + (_etext_l1 - _stext_l1);
160 free_l1_inst_sram_head.next->size =
161 L1_CODE_LENGTH - (_etext_l1 - _stext_l1);
162 free_l1_inst_sram_head.next->pid = 0;
163 free_l1_inst_sram_head.next->next = NULL;
164
165 used_l1_inst_sram_head.next = NULL;
166
167 printk(KERN_INFO "Blackfin L1 Instruction SRAM: %d KB (%d KB free)\n",
168 L1_CODE_LENGTH >> 10,
169 free_l1_inst_sram_head.next->size >> 10);
170#endif 195#endif
171
172 /* mutex initialize */
173 spin_lock_init(&l1_inst_sram_lock);
174} 196}
175 197
176static void __init l2_sram_init(void) 198static void __init l2_sram_init(void)
@@ -179,7 +201,7 @@ static void __init l2_sram_init(void)
179 free_l2_sram_head.next = 201 free_l2_sram_head.next =
180 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL); 202 kmem_cache_alloc(sram_piece_cache, GFP_KERNEL);
181 if (!free_l2_sram_head.next) { 203 if (!free_l2_sram_head.next) {
182 printk(KERN_INFO "Failed to initialize L2 SRAM\n"); 204 printk(KERN_INFO "Fail to initialize L2 SRAM.\n");
183 return; 205 return;
184 } 206 }
185 207
@@ -200,6 +222,7 @@ static void __init l2_sram_init(void)
200 /* mutex initialize */ 222 /* mutex initialize */
201 spin_lock_init(&l2_sram_lock); 223 spin_lock_init(&l2_sram_lock);
202} 224}
225
203void __init bfin_sram_init(void) 226void __init bfin_sram_init(void)
204{ 227{
205 sram_piece_cache = kmem_cache_create("sram_piece_cache", 228 sram_piece_cache = kmem_cache_create("sram_piece_cache",
@@ -353,20 +376,20 @@ int sram_free(const void *addr)
353{ 376{
354 377
355#if L1_CODE_LENGTH != 0 378#if L1_CODE_LENGTH != 0
356 if (addr >= (void *)L1_CODE_START 379 if (addr >= (void *)get_l1_code_start()
357 && addr < (void *)(L1_CODE_START + L1_CODE_LENGTH)) 380 && addr < (void *)(get_l1_code_start() + L1_CODE_LENGTH))
358 return l1_inst_sram_free(addr); 381 return l1_inst_sram_free(addr);
359 else 382 else
360#endif 383#endif
361#if L1_DATA_A_LENGTH != 0 384#if L1_DATA_A_LENGTH != 0
362 if (addr >= (void *)L1_DATA_A_START 385 if (addr >= (void *)get_l1_data_a_start()
363 && addr < (void *)(L1_DATA_A_START + L1_DATA_A_LENGTH)) 386 && addr < (void *)(get_l1_data_a_start() + L1_DATA_A_LENGTH))
364 return l1_data_A_sram_free(addr); 387 return l1_data_A_sram_free(addr);
365 else 388 else
366#endif 389#endif
367#if L1_DATA_B_LENGTH != 0 390#if L1_DATA_B_LENGTH != 0
368 if (addr >= (void *)L1_DATA_B_START 391 if (addr >= (void *)get_l1_data_b_start()
369 && addr < (void *)(L1_DATA_B_START + L1_DATA_B_LENGTH)) 392 && addr < (void *)(get_l1_data_b_start() + L1_DATA_B_LENGTH))
370 return l1_data_B_sram_free(addr); 393 return l1_data_B_sram_free(addr);
371 else 394 else
372#endif 395#endif
@@ -384,17 +407,20 @@ void *l1_data_A_sram_alloc(size_t size)
384{ 407{
385 unsigned long flags; 408 unsigned long flags;
386 void *addr = NULL; 409 void *addr = NULL;
410 unsigned int cpu;
387 411
412 cpu = get_cpu();
388 /* add mutex operation */ 413 /* add mutex operation */
389 spin_lock_irqsave(&l1_data_sram_lock, flags); 414 spin_lock_irqsave(&per_cpu(l1_data_sram_lock, cpu), flags);
390 415
391#if L1_DATA_A_LENGTH != 0 416#if L1_DATA_A_LENGTH != 0
392 addr = _sram_alloc(size, &free_l1_data_A_sram_head, 417 addr = _sram_alloc(size, &per_cpu(free_l1_data_A_sram_head, cpu),
393 &used_l1_data_A_sram_head); 418 &per_cpu(used_l1_data_A_sram_head, cpu));
394#endif 419#endif
395 420
396 /* add mutex operation */ 421 /* add mutex operation */
397 spin_unlock_irqrestore(&l1_data_sram_lock, flags); 422 spin_unlock_irqrestore(&per_cpu(l1_data_sram_lock, cpu), flags);
423 put_cpu();
398 424
399 pr_debug("Allocated address in l1_data_A_sram_alloc is 0x%lx+0x%lx\n", 425 pr_debug("Allocated address in l1_data_A_sram_alloc is 0x%lx+0x%lx\n",
400 (long unsigned int)addr, size); 426 (long unsigned int)addr, size);
@@ -407,19 +433,22 @@ int l1_data_A_sram_free(const void *addr)
407{ 433{
408 unsigned long flags; 434 unsigned long flags;
409 int ret; 435 int ret;
436 unsigned int cpu;
410 437
438 cpu = get_cpu();
411 /* add mutex operation */ 439 /* add mutex operation */
412 spin_lock_irqsave(&l1_data_sram_lock, flags); 440 spin_lock_irqsave(&per_cpu(l1_data_sram_lock, cpu), flags);
413 441
414#if L1_DATA_A_LENGTH != 0 442#if L1_DATA_A_LENGTH != 0
415 ret = _sram_free(addr, &free_l1_data_A_sram_head, 443 ret = _sram_free(addr, &per_cpu(free_l1_data_A_sram_head, cpu),
416 &used_l1_data_A_sram_head); 444 &per_cpu(used_l1_data_A_sram_head, cpu));
417#else 445#else
418 ret = -1; 446 ret = -1;
419#endif 447#endif
420 448
421 /* add mutex operation */ 449 /* add mutex operation */
422 spin_unlock_irqrestore(&l1_data_sram_lock, flags); 450 spin_unlock_irqrestore(&per_cpu(l1_data_sram_lock, cpu), flags);
451 put_cpu();
423 452
424 return ret; 453 return ret;
425} 454}
@@ -430,15 +459,18 @@ void *l1_data_B_sram_alloc(size_t size)
430#if L1_DATA_B_LENGTH != 0 459#if L1_DATA_B_LENGTH != 0
431 unsigned long flags; 460 unsigned long flags;
432 void *addr; 461 void *addr;
462 unsigned int cpu;
433 463
464 cpu = get_cpu();
434 /* add mutex operation */ 465 /* add mutex operation */
435 spin_lock_irqsave(&l1_data_sram_lock, flags); 466 spin_lock_irqsave(&per_cpu(l1_data_sram_lock, cpu), flags);
436 467
437 addr = _sram_alloc(size, &free_l1_data_B_sram_head, 468 addr = _sram_alloc(size, &per_cpu(free_l1_data_B_sram_head, cpu),
438 &used_l1_data_B_sram_head); 469 &per_cpu(used_l1_data_B_sram_head, cpu));
439 470
440 /* add mutex operation */ 471 /* add mutex operation */
441 spin_unlock_irqrestore(&l1_data_sram_lock, flags); 472 spin_unlock_irqrestore(&per_cpu(l1_data_sram_lock, cpu), flags);
473 put_cpu();
442 474
443 pr_debug("Allocated address in l1_data_B_sram_alloc is 0x%lx+0x%lx\n", 475 pr_debug("Allocated address in l1_data_B_sram_alloc is 0x%lx+0x%lx\n",
444 (long unsigned int)addr, size); 476 (long unsigned int)addr, size);
@@ -455,15 +487,18 @@ int l1_data_B_sram_free(const void *addr)
455#if L1_DATA_B_LENGTH != 0 487#if L1_DATA_B_LENGTH != 0
456 unsigned long flags; 488 unsigned long flags;
457 int ret; 489 int ret;
490 unsigned int cpu;
458 491
492 cpu = get_cpu();
459 /* add mutex operation */ 493 /* add mutex operation */
460 spin_lock_irqsave(&l1_data_sram_lock, flags); 494 spin_lock_irqsave(&per_cpu(l1_data_sram_lock, cpu), flags);
461 495
462 ret = _sram_free(addr, &free_l1_data_B_sram_head, 496 ret = _sram_free(addr, &per_cpu(free_l1_data_B_sram_head, cpu),
463 &used_l1_data_B_sram_head); 497 &per_cpu(used_l1_data_B_sram_head, cpu));
464 498
465 /* add mutex operation */ 499 /* add mutex operation */
466 spin_unlock_irqrestore(&l1_data_sram_lock, flags); 500 spin_unlock_irqrestore(&per_cpu(l1_data_sram_lock, cpu), flags);
501 put_cpu();
467 502
468 return ret; 503 return ret;
469#else 504#else
@@ -509,15 +544,18 @@ void *l1_inst_sram_alloc(size_t size)
509#if L1_CODE_LENGTH != 0 544#if L1_CODE_LENGTH != 0
510 unsigned long flags; 545 unsigned long flags;
511 void *addr; 546 void *addr;
547 unsigned int cpu;
512 548
549 cpu = get_cpu();
513 /* add mutex operation */ 550 /* add mutex operation */
514 spin_lock_irqsave(&l1_inst_sram_lock, flags); 551 spin_lock_irqsave(&per_cpu(l1_inst_sram_lock, cpu), flags);
515 552
516 addr = _sram_alloc(size, &free_l1_inst_sram_head, 553 addr = _sram_alloc(size, &per_cpu(free_l1_inst_sram_head, cpu),
517 &used_l1_inst_sram_head); 554 &per_cpu(used_l1_inst_sram_head, cpu));
518 555
519 /* add mutex operation */ 556 /* add mutex operation */
520 spin_unlock_irqrestore(&l1_inst_sram_lock, flags); 557 spin_unlock_irqrestore(&per_cpu(l1_inst_sram_lock, cpu), flags);
558 put_cpu();
521 559
522 pr_debug("Allocated address in l1_inst_sram_alloc is 0x%lx+0x%lx\n", 560 pr_debug("Allocated address in l1_inst_sram_alloc is 0x%lx+0x%lx\n",
523 (long unsigned int)addr, size); 561 (long unsigned int)addr, size);
@@ -534,15 +572,18 @@ int l1_inst_sram_free(const void *addr)
534#if L1_CODE_LENGTH != 0 572#if L1_CODE_LENGTH != 0
535 unsigned long flags; 573 unsigned long flags;
536 int ret; 574 int ret;
575 unsigned int cpu;
537 576
577 cpu = get_cpu();
538 /* add mutex operation */ 578 /* add mutex operation */
539 spin_lock_irqsave(&l1_inst_sram_lock, flags); 579 spin_lock_irqsave(&per_cpu(l1_inst_sram_lock, cpu), flags);
540 580
541 ret = _sram_free(addr, &free_l1_inst_sram_head, 581 ret = _sram_free(addr, &per_cpu(free_l1_inst_sram_head, cpu),
542 &used_l1_inst_sram_head); 582 &per_cpu(used_l1_inst_sram_head, cpu));
543 583
544 /* add mutex operation */ 584 /* add mutex operation */
545 spin_unlock_irqrestore(&l1_inst_sram_lock, flags); 585 spin_unlock_irqrestore(&per_cpu(l1_inst_sram_lock, cpu), flags);
586 put_cpu();
546 587
547 return ret; 588 return ret;
548#else 589#else
@@ -556,15 +597,18 @@ void *l1sram_alloc(size_t size)
556{ 597{
557 unsigned long flags; 598 unsigned long flags;
558 void *addr; 599 void *addr;
600 unsigned int cpu;
559 601
602 cpu = get_cpu();
560 /* add mutex operation */ 603 /* add mutex operation */
561 spin_lock_irqsave(&l1sram_lock, flags); 604 spin_lock_irqsave(&per_cpu(l1sram_lock, cpu), flags);
562 605
563 addr = _sram_alloc(size, &free_l1_ssram_head, 606 addr = _sram_alloc(size, &per_cpu(free_l1_ssram_head, cpu),
564 &used_l1_ssram_head); 607 &per_cpu(used_l1_ssram_head, cpu));
565 608
566 /* add mutex operation */ 609 /* add mutex operation */
567 spin_unlock_irqrestore(&l1sram_lock, flags); 610 spin_unlock_irqrestore(&per_cpu(l1sram_lock, cpu), flags);
611 put_cpu();
568 612
569 return addr; 613 return addr;
570} 614}
@@ -574,15 +618,18 @@ void *l1sram_alloc_max(size_t *psize)
574{ 618{
575 unsigned long flags; 619 unsigned long flags;
576 void *addr; 620 void *addr;
621 unsigned int cpu;
577 622
623 cpu = get_cpu();
578 /* add mutex operation */ 624 /* add mutex operation */
579 spin_lock_irqsave(&l1sram_lock, flags); 625 spin_lock_irqsave(&per_cpu(l1sram_lock, cpu), flags);
580 626
581 addr = _sram_alloc_max(&free_l1_ssram_head, 627 addr = _sram_alloc_max(&per_cpu(free_l1_ssram_head, cpu),
582 &used_l1_ssram_head, psize); 628 &per_cpu(used_l1_ssram_head, cpu), psize);
583 629
584 /* add mutex operation */ 630 /* add mutex operation */
585 spin_unlock_irqrestore(&l1sram_lock, flags); 631 spin_unlock_irqrestore(&per_cpu(l1sram_lock, cpu), flags);
632 put_cpu();
586 633
587 return addr; 634 return addr;
588} 635}
@@ -592,15 +639,18 @@ int l1sram_free(const void *addr)
592{ 639{
593 unsigned long flags; 640 unsigned long flags;
594 int ret; 641 int ret;
642 unsigned int cpu;
595 643
644 cpu = get_cpu();
596 /* add mutex operation */ 645 /* add mutex operation */
597 spin_lock_irqsave(&l1sram_lock, flags); 646 spin_lock_irqsave(&per_cpu(l1sram_lock, cpu), flags);
598 647
599 ret = _sram_free(addr, &free_l1_ssram_head, 648 ret = _sram_free(addr, &per_cpu(free_l1_ssram_head, cpu),
600 &used_l1_ssram_head); 649 &per_cpu(used_l1_ssram_head, cpu));
601 650
602 /* add mutex operation */ 651 /* add mutex operation */
603 spin_unlock_irqrestore(&l1sram_lock, flags); 652 spin_unlock_irqrestore(&per_cpu(l1sram_lock, cpu), flags);
653 put_cpu();
604 654
605 return ret; 655 return ret;
606} 656}
@@ -761,33 +811,36 @@ static int sram_proc_read(char *buf, char **start, off_t offset, int count,
761 int *eof, void *data) 811 int *eof, void *data)
762{ 812{
763 int len = 0; 813 int len = 0;
814 unsigned int cpu;
764 815
765 if (_sram_proc_read(buf, &len, count, "Scratchpad", 816 for (cpu = 0; cpu < num_possible_cpus(); ++cpu) {
766 &free_l1_ssram_head, &used_l1_ssram_head)) 817 if (_sram_proc_read(buf, &len, count, "Scratchpad",
767 goto not_done; 818 &per_cpu(free_l1_ssram_head, cpu), &per_cpu(used_l1_ssram_head, cpu)))
819 goto not_done;
768#if L1_DATA_A_LENGTH != 0 820#if L1_DATA_A_LENGTH != 0
769 if (_sram_proc_read(buf, &len, count, "L1 Data A", 821 if (_sram_proc_read(buf, &len, count, "L1 Data A",
770 &free_l1_data_A_sram_head, 822 &per_cpu(free_l1_data_A_sram_head, cpu),
771 &used_l1_data_A_sram_head)) 823 &per_cpu(used_l1_data_A_sram_head, cpu)))
772 goto not_done; 824 goto not_done;
773#endif 825#endif
774#if L1_DATA_B_LENGTH != 0 826#if L1_DATA_B_LENGTH != 0
775 if (_sram_proc_read(buf, &len, count, "L1 Data B", 827 if (_sram_proc_read(buf, &len, count, "L1 Data B",
776 &free_l1_data_B_sram_head, 828 &per_cpu(free_l1_data_B_sram_head, cpu),
777 &used_l1_data_B_sram_head)) 829 &per_cpu(used_l1_data_B_sram_head, cpu)))
778 goto not_done; 830 goto not_done;
779#endif 831#endif
780#if L1_CODE_LENGTH != 0 832#if L1_CODE_LENGTH != 0
781 if (_sram_proc_read(buf, &len, count, "L1 Instruction", 833 if (_sram_proc_read(buf, &len, count, "L1 Instruction",
782 &free_l1_inst_sram_head, &used_l1_inst_sram_head)) 834 &per_cpu(free_l1_inst_sram_head, cpu),
783 goto not_done; 835 &per_cpu(used_l1_inst_sram_head, cpu)))
836 goto not_done;
784#endif 837#endif
838 }
785#if L2_LENGTH != 0 839#if L2_LENGTH != 0
786 if (_sram_proc_read(buf, &len, count, "L2", 840 if (_sram_proc_read(buf, &len, count, "L2", &free_l2_sram_head,
787 &free_l2_sram_head, &used_l2_sram_head)) 841 &used_l2_sram_head))
788 goto not_done; 842 goto not_done;
789#endif 843#endif
790
791 *eof = 1; 844 *eof = 1;
792 not_done: 845 not_done:
793 return len; 846 return len;
diff --git a/arch/blackfin/oprofile/Makefile b/arch/blackfin/oprofile/Makefile
index 634e300d67e2..c70af3a01297 100644
--- a/arch/blackfin/oprofile/Makefile
+++ b/arch/blackfin/oprofile/Makefile
@@ -10,5 +10,4 @@ DRIVER_OBJS := $(addprefix ../../../drivers/oprofile/, \
10 oprofilefs.o oprofile_stats.o \ 10 oprofilefs.o oprofile_stats.o \
11 timer_int.o ) 11 timer_int.o )
12 12
13oprofile-y := $(DRIVER_OBJS) common.o 13oprofile-y := $(DRIVER_OBJS) bfin_oprofile.o
14oprofile-$(CONFIG_HARDWARE_PM) += op_model_bf533.o
diff --git a/arch/blackfin/oprofile/bfin_oprofile.c b/arch/blackfin/oprofile/bfin_oprofile.c
new file mode 100644
index 000000000000..c3b9713b23f8
--- /dev/null
+++ b/arch/blackfin/oprofile/bfin_oprofile.c
@@ -0,0 +1,18 @@
1/*
2 * bfin_oprofile.c - Blackfin oprofile code
3 *
4 * Copyright 2004-2008 Analog Devices Inc.
5 * Licensed under the GPL-2 or later.
6 */
7
8#include <linux/oprofile.h>
9#include <linux/init.h>
10
11int __init oprofile_arch_init(struct oprofile_operations *ops)
12{
13 return -1;
14}
15
16void oprofile_arch_exit(void)
17{
18}
diff --git a/arch/blackfin/oprofile/common.c b/arch/blackfin/oprofile/common.c
deleted file mode 100644
index 0f6d303a8891..000000000000
--- a/arch/blackfin/oprofile/common.c
+++ /dev/null
@@ -1,168 +0,0 @@
1/*
2 * File: arch/blackfin/oprofile/common.c
3 * Based on: arch/alpha/oprofile/common.c
4 * Author: Anton Blanchard <anton@au.ibm.com>
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
11 * Copyright 2004-2006 Analog Devices Inc.
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31#include <linux/oprofile.h>
32#include <linux/init.h>
33#include <linux/smp.h>
34#include <linux/errno.h>
35#include <linux/mutex.h>
36#include <linux/ptrace.h>
37#include <linux/irq.h>
38#include <linux/io.h>
39
40#include <asm/system.h>
41#include <asm/blackfin.h>
42
43#include "op_blackfin.h"
44
45#define BFIN_533_ID 0xE5040003
46#define BFIN_537_ID 0xE5040002
47
48static int pfmon_enabled;
49static struct mutex pfmon_lock;
50
51struct op_bfin533_model *model;
52
53struct op_counter_config ctr[OP_MAX_COUNTER];
54
55static int op_bfin_setup(void)
56{
57 int ret;
58
59 /* Pre-compute the values to stuff in the hardware registers. */
60 spin_lock(&oprofilefs_lock);
61 ret = model->reg_setup(ctr);
62 spin_unlock(&oprofilefs_lock);
63
64 return ret;
65}
66
67static void op_bfin_shutdown(void)
68{
69#if 0
70 /* what is the difference between shutdown and stop? */
71#endif
72}
73
74static int op_bfin_start(void)
75{
76 int ret = -EBUSY;
77
78 printk(KERN_INFO "KSDBG:in %s\n", __func__);
79 mutex_lock(&pfmon_lock);
80 if (!pfmon_enabled) {
81 ret = model->start(ctr);
82 pfmon_enabled = !ret;
83 }
84 mutex_unlock(&pfmon_lock);
85
86 return ret;
87}
88
89static void op_bfin_stop(void)
90{
91 mutex_lock(&pfmon_lock);
92 if (pfmon_enabled) {
93 model->stop();
94 pfmon_enabled = 0;
95 }
96 mutex_unlock(&pfmon_lock);
97}
98
99static int op_bfin_create_files(struct super_block *sb, struct dentry *root)
100{
101 int i;
102
103 for (i = 0; i < model->num_counters; ++i) {
104 struct dentry *dir;
105 char buf[3];
106 printk(KERN_INFO "Oprofile: creating files... \n");
107
108 snprintf(buf, sizeof buf, "%d", i);
109 dir = oprofilefs_mkdir(sb, root, buf);
110
111 oprofilefs_create_ulong(sb, dir, "enabled", &ctr[i].enabled);
112 oprofilefs_create_ulong(sb, dir, "event", &ctr[i].event);
113 oprofilefs_create_ulong(sb, dir, "count", &ctr[i].count);
114 /*
115 * We dont support per counter user/kernel selection, but
116 * we leave the entries because userspace expects them
117 */
118 oprofilefs_create_ulong(sb, dir, "kernel", &ctr[i].kernel);
119 oprofilefs_create_ulong(sb, dir, "user", &ctr[i].user);
120 oprofilefs_create_ulong(sb, dir, "unit_mask",
121 &ctr[i].unit_mask);
122 }
123
124 return 0;
125}
126int __init oprofile_arch_init(struct oprofile_operations *ops)
127{
128#ifdef CONFIG_HARDWARE_PM
129 unsigned int dspid;
130
131 mutex_init(&pfmon_lock);
132
133 dspid = bfin_read_DSPID();
134
135 printk(KERN_INFO "Oprofile got the cpu id is 0x%x. \n", dspid);
136
137 switch (dspid) {
138 case BFIN_533_ID:
139 model = &op_model_bfin533;
140 model->num_counters = 2;
141 break;
142 case BFIN_537_ID:
143 model = &op_model_bfin533;
144 model->num_counters = 2;
145 break;
146 default:
147 return -ENODEV;
148 }
149
150 ops->cpu_type = model->name;
151 ops->create_files = op_bfin_create_files;
152 ops->setup = op_bfin_setup;
153 ops->shutdown = op_bfin_shutdown;
154 ops->start = op_bfin_start;
155 ops->stop = op_bfin_stop;
156
157 printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
158 ops->cpu_type);
159
160 return 0;
161#else
162 return -1;
163#endif
164}
165
166void oprofile_arch_exit(void)
167{
168}
diff --git a/arch/blackfin/oprofile/op_blackfin.h b/arch/blackfin/oprofile/op_blackfin.h
deleted file mode 100644
index 05dd08c9d154..000000000000
--- a/arch/blackfin/oprofile/op_blackfin.h
+++ /dev/null
@@ -1,98 +0,0 @@
1/*
2 * File: arch/blackfin/oprofile/op_blackfin.h
3 * Based on:
4 * Author: Anton Blanchard <anton@au.ibm.com>
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
11 * Copyright 2004-2006 Analog Devices Inc.
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31#ifndef OP_BLACKFIN_H
32#define OP_BLACKFIN_H 1
33
34#define OP_MAX_COUNTER 2
35
36#include <asm/blackfin.h>
37
38/* Per-counter configuration as set via oprofilefs. */
39struct op_counter_config {
40 unsigned long valid;
41 unsigned long enabled;
42 unsigned long event;
43 unsigned long count;
44 unsigned long kernel;
45 unsigned long user;
46 unsigned long unit_mask;
47};
48
49/* System-wide configuration as set via oprofilefs. */
50struct op_system_config {
51 unsigned long enable_kernel;
52 unsigned long enable_user;
53};
54
55/* Per-arch configuration */
56struct op_bfin533_model {
57 int (*reg_setup) (struct op_counter_config *);
58 int (*start) (struct op_counter_config *);
59 void (*stop) (void);
60 int num_counters;
61 char *name;
62};
63
64extern struct op_bfin533_model op_model_bfin533;
65
66static inline unsigned int ctr_read(void)
67{
68 unsigned int tmp;
69
70 tmp = bfin_read_PFCTL();
71 CSYNC();
72
73 return tmp;
74}
75
76static inline void ctr_write(unsigned int val)
77{
78 bfin_write_PFCTL(val);
79 CSYNC();
80}
81
82static inline void count_read(unsigned int *count)
83{
84 count[0] = bfin_read_PFCNTR0();
85 count[1] = bfin_read_PFCNTR1();
86 CSYNC();
87}
88
89static inline void count_write(unsigned int *count)
90{
91 bfin_write_PFCNTR0(count[0]);
92 bfin_write_PFCNTR1(count[1]);
93 CSYNC();
94}
95
96extern int pm_overflow_handler(int irq, struct pt_regs *regs);
97
98#endif
diff --git a/arch/blackfin/oprofile/op_model_bf533.c b/arch/blackfin/oprofile/op_model_bf533.c
deleted file mode 100644
index d1c698bb9ee5..000000000000
--- a/arch/blackfin/oprofile/op_model_bf533.c
+++ /dev/null
@@ -1,161 +0,0 @@
1/*
2 * File: arch/blackfin/oprofile/op_model_bf533.c
3 * Based on:
4 * Author: Anton Blanchard <anton@au.ibm.com>
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright (C) 2004 Anton Blanchard <anton@au.ibm.com>, IBM
11 * Copyright 2004-2006 Analog Devices Inc.
12 *
13 * Bugs: Enter bugs at http://blackfin.uclinux.org/
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, see the file COPYING, or write
27 * to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 */
30
31#include <linux/oprofile.h>
32#include <linux/init.h>
33#include <linux/smp.h>
34#include <linux/interrupt.h>
35#include <linux/ptrace.h>
36#include <linux/irq.h>
37#include <linux/io.h>
38#include <asm/system.h>
39#include <asm/processor.h>
40#include <asm/blackfin.h>
41
42#include "op_blackfin.h"
43
44#define PM_ENABLE 0x01;
45#define PM_CTL1_ENABLE 0x18
46#define PM_CTL0_ENABLE 0xC000
47#define COUNT_EDGE_ONLY 0x3000000
48
49static int oprofile_running;
50
51static unsigned curr_pfctl, curr_count[2];
52
53static int bfin533_reg_setup(struct op_counter_config *ctr)
54{
55 unsigned int pfctl = ctr_read();
56 unsigned int count[2];
57
58 /* set Blackfin perf monitor regs with ctr */
59 if (ctr[0].enabled) {
60 pfctl |= (PM_CTL0_ENABLE | ((char)ctr[0].event << 5));
61 count[0] = 0xFFFFFFFF - ctr[0].count;
62 curr_count[0] = count[0];
63 }
64 if (ctr[1].enabled) {
65 pfctl |= (PM_CTL1_ENABLE | ((char)ctr[1].event << 16));
66 count[1] = 0xFFFFFFFF - ctr[1].count;
67 curr_count[1] = count[1];
68 }
69
70 pr_debug("ctr[0].enabled=%d,ctr[1].enabled=%d,ctr[0].event<<5=0x%x,ctr[1].event<<16=0x%x\n", ctr[0].enabled, ctr[1].enabled, ctr[0].event << 5, ctr[1].event << 16);
71 pfctl |= COUNT_EDGE_ONLY;
72 curr_pfctl = pfctl;
73
74 pr_debug("write 0x%x to pfctl\n", pfctl);
75 ctr_write(pfctl);
76 count_write(count);
77
78 return 0;
79}
80
81static int bfin533_start(struct op_counter_config *ctr)
82{
83 unsigned int pfctl = ctr_read();
84
85 pfctl |= PM_ENABLE;
86 curr_pfctl = pfctl;
87
88 ctr_write(pfctl);
89
90 oprofile_running = 1;
91 pr_debug("start oprofile counter \n");
92
93 return 0;
94}
95
96static void bfin533_stop(void)
97{
98 int pfctl;
99
100 pfctl = ctr_read();
101 pfctl &= ~PM_ENABLE;
102 /* freeze counters */
103 ctr_write(pfctl);
104
105 oprofile_running = 0;
106 pr_debug("stop oprofile counter \n");
107}
108
109static int get_kernel(void)
110{
111 int ipend, is_kernel;
112
113 ipend = bfin_read_IPEND();
114
115 /* test bit 15 */
116 is_kernel = ((ipend & 0x8000) != 0);
117
118 return is_kernel;
119}
120
121int pm_overflow_handler(int irq, struct pt_regs *regs)
122{
123 int is_kernel;
124 int i, cpu;
125 unsigned int pc, pfctl;
126 unsigned int count[2];
127
128 pr_debug("get interrupt in %s\n", __func__);
129 if (oprofile_running == 0) {
130 pr_debug("error: entering interrupt when oprofile is stopped.\n\r");
131 return -1;
132 }
133
134 is_kernel = get_kernel();
135 cpu = smp_processor_id();
136 pc = regs->pc;
137 pfctl = ctr_read();
138
139 /* read the two event counter regs */
140 count_read(count);
141
142 /* if the counter overflows, add sample to oprofile buffer */
143 for (i = 0; i < 2; ++i) {
144 if (oprofile_running) {
145 oprofile_add_sample(regs, i);
146 }
147 }
148
149 /* reset the perfmon counter */
150 ctr_write(curr_pfctl);
151 count_write(curr_count);
152 return 0;
153}
154
155struct op_bfin533_model op_model_bfin533 = {
156 .reg_setup = bfin533_reg_setup,
157 .start = bfin533_start,
158 .stop = bfin533_stop,
159 .num_counters = 2,
160 .name = "blackfin/bf533"
161};
diff --git a/arch/blackfin/oprofile/timer_int.c b/arch/blackfin/oprofile/timer_int.c
deleted file mode 100644
index 6c6f8606af4c..000000000000
--- a/arch/blackfin/oprofile/timer_int.c
+++ /dev/null
@@ -1,73 +0,0 @@
1/*
2 * File: arch/blackfin/oprofile/timer_int.c
3 * Based on:
4 * Author: Michael Kang
5 *
6 * Created:
7 * Description:
8 *
9 * Modified:
10 * Copyright 2004-2006 Analog Devices Inc.
11 *
12 * Bugs: Enter bugs at http://blackfin.uclinux.org/
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, see the file COPYING, or write
26 * to the Free Software Foundation, Inc.,
27 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 */
29
30#include <linux/init.h>
31#include <linux/smp.h>
32#include <linux/irq.h>
33#include <linux/oprofile.h>
34#include <linux/ptrace.h>
35
36static void enable_sys_timer0()
37{
38}
39static void disable_sys_timer0()
40{
41}
42
43static irqreturn_t sys_timer0_int_handler(int irq, void *dev_id,
44 struct pt_regs *regs)
45{
46 oprofile_add_sample(regs, 0);
47 return IRQ_HANDLED;
48}
49
50static int sys_timer0_start(void)
51{
52 enable_sys_timer0();
53 return request_irq(IVG11, sys_timer0_int_handler, 0, "sys_timer0", NULL);
54}
55
56static void sys_timer0_stop(void)
57{
58 disable_sys_timer();
59}
60
61int __init sys_timer0_init(struct oprofile_operations *ops)
62{
63 extern int nmi_active;
64
65 if (nmi_active <= 0)
66 return -ENODEV;
67
68 ops->start = timer_start;
69 ops->stop = timer_stop;
70 ops->cpu_type = "timer";
71 printk(KERN_INFO "oprofile: using NMI timer interrupt.\n");
72 return 0;
73}
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig
index b17aeea8d620..3462245fe9fb 100644
--- a/arch/cris/Kconfig
+++ b/arch/cris/Kconfig
@@ -681,6 +681,8 @@ source "drivers/usb/Kconfig"
681 681
682source "drivers/uwb/Kconfig" 682source "drivers/uwb/Kconfig"
683 683
684source "drivers/staging/Kconfig"
685
684source "arch/cris/Kconfig.debug" 686source "arch/cris/Kconfig.debug"
685 687
686source "security/Kconfig" 688source "security/Kconfig"
diff --git a/arch/cris/arch-v32/drivers/iop_fw_load.c b/arch/cris/arch-v32/drivers/iop_fw_load.c
index 3b3857ec1f15..2f8ea0f7a63c 100644
--- a/arch/cris/arch-v32/drivers/iop_fw_load.c
+++ b/arch/cris/arch-v32/drivers/iop_fw_load.c
@@ -24,12 +24,12 @@
24#error "Please contact <greg@kroah.com> for details on how to fix it properly." 24#error "Please contact <greg@kroah.com> for details on how to fix it properly."
25 25
26static struct device iop_spu_device[2] = { 26static struct device iop_spu_device[2] = {
27 { .bus_id = "iop-spu0", }, 27 { .init_name = "iop-spu0", },
28 { .bus_id = "iop-spu1", }, 28 { .init_name = "iop-spu1", },
29}; 29};
30 30
31static struct device iop_mpu_device = { 31static struct device iop_mpu_device = {
32 .bus_id = "iop-mpu", 32 .init_name = "iop-mpu",
33}; 33};
34 34
35static int wait_mpu_idle(void) 35static int wait_mpu_idle(void)
diff --git a/arch/cris/arch-v32/kernel/irq.c b/arch/cris/arch-v32/kernel/irq.c
index 173c141ac9ba..295131fee710 100644
--- a/arch/cris/arch-v32/kernel/irq.c
+++ b/arch/cris/arch-v32/kernel/irq.c
@@ -325,11 +325,11 @@ static void end_crisv32_irq(unsigned int irq)
325{ 325{
326} 326}
327 327
328void set_affinity_crisv32_irq(unsigned int irq, cpumask_t dest) 328void set_affinity_crisv32_irq(unsigned int irq, const struct cpumask *dest)
329{ 329{
330 unsigned long flags; 330 unsigned long flags;
331 spin_lock_irqsave(&irq_lock, flags); 331 spin_lock_irqsave(&irq_lock, flags);
332 irq_allocations[irq - FIRST_IRQ].mask = dest; 332 irq_allocations[irq - FIRST_IRQ].mask = *dest;
333 spin_unlock_irqrestore(&irq_lock, flags); 333 spin_unlock_irqrestore(&irq_lock, flags);
334} 334}
335 335
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c
index da7d2be000ba..372d0ca6efbc 100644
--- a/arch/cris/arch-v32/kernel/signal.c
+++ b/arch/cris/arch-v32/kernel/signal.c
@@ -456,7 +456,7 @@ give_sigsegv:
456 return -EFAULT; 456 return -EFAULT;
457} 457}
458 458
459/* Invoke a singal handler to, well, handle the signal. */ 459/* Invoke a signal handler to, well, handle the signal. */
460static inline int 460static inline int
461handle_signal(int canrestart, unsigned long sig, 461handle_signal(int canrestart, unsigned long sig,
462 siginfo_t *info, struct k_sigaction *ka, 462 siginfo_t *info, struct k_sigaction *ka,
diff --git a/arch/cris/arch-v32/kernel/smp.c b/arch/cris/arch-v32/kernel/smp.c
index 52e16c6436f9..9dac17334640 100644
--- a/arch/cris/arch-v32/kernel/smp.c
+++ b/arch/cris/arch-v32/kernel/smp.c
@@ -29,11 +29,7 @@
29spinlock_t cris_atomic_locks[] = { [0 ... LOCK_COUNT - 1] = SPIN_LOCK_UNLOCKED}; 29spinlock_t cris_atomic_locks[] = { [0 ... LOCK_COUNT - 1] = SPIN_LOCK_UNLOCKED};
30 30
31/* CPU masks */ 31/* CPU masks */
32cpumask_t cpu_online_map = CPU_MASK_NONE;
33EXPORT_SYMBOL(cpu_online_map);
34cpumask_t phys_cpu_present_map = CPU_MASK_NONE; 32cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
35cpumask_t cpu_possible_map;
36EXPORT_SYMBOL(cpu_possible_map);
37EXPORT_SYMBOL(phys_cpu_present_map); 33EXPORT_SYMBOL(phys_cpu_present_map);
38 34
39/* Variables used during SMP boot */ 35/* Variables used during SMP boot */
diff --git a/arch/cris/include/asm/atomic.h b/arch/cris/include/asm/atomic.h
index f71ea686a2ea..5718dd8902a1 100644
--- a/arch/cris/include/asm/atomic.h
+++ b/arch/cris/include/asm/atomic.h
@@ -4,7 +4,7 @@
4#define __ASM_CRIS_ATOMIC__ 4#define __ASM_CRIS_ATOMIC__
5 5
6#include <linux/compiler.h> 6#include <linux/compiler.h>
7 7#include <linux/types.h>
8#include <asm/system.h> 8#include <asm/system.h>
9#include <arch/atomic.h> 9#include <arch/atomic.h>
10 10
@@ -13,8 +13,6 @@
13 * resource counting etc.. 13 * resource counting etc..
14 */ 14 */
15 15
16typedef struct { volatile int counter; } atomic_t;
17
18#define ATOMIC_INIT(i) { (i) } 16#define ATOMIC_INIT(i) { (i) }
19 17
20#define atomic_read(v) ((v)->counter) 18#define atomic_read(v) ((v)->counter)
diff --git a/arch/cris/include/asm/bitops.h b/arch/cris/include/asm/bitops.h
index c0e62f811e09..9e69cfb7f134 100644
--- a/arch/cris/include/asm/bitops.h
+++ b/arch/cris/include/asm/bitops.h
@@ -148,6 +148,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
148#define ffs kernel_ffs 148#define ffs kernel_ffs
149 149
150#include <asm-generic/bitops/fls.h> 150#include <asm-generic/bitops/fls.h>
151#include <asm-generic/bitops/__fls.h>
151#include <asm-generic/bitops/fls64.h> 152#include <asm-generic/bitops/fls64.h>
152#include <asm-generic/bitops/hweight.h> 153#include <asm-generic/bitops/hweight.h>
153#include <asm-generic/bitops/find.h> 154#include <asm-generic/bitops/find.h>
diff --git a/arch/cris/include/asm/smp.h b/arch/cris/include/asm/smp.h
index dba33aba3e95..c615a06dd757 100644
--- a/arch/cris/include/asm/smp.h
+++ b/arch/cris/include/asm/smp.h
@@ -4,7 +4,6 @@
4#include <linux/cpumask.h> 4#include <linux/cpumask.h>
5 5
6extern cpumask_t phys_cpu_present_map; 6extern cpumask_t phys_cpu_present_map;
7extern cpumask_t cpu_possible_map;
8 7
9#define raw_smp_processor_id() (current_thread_info()->cpu) 8#define raw_smp_processor_id() (current_thread_info()->cpu)
10 9
diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c
index 709e9bdc6126..5e7d401d21e7 100644
--- a/arch/frv/kernel/ptrace.c
+++ b/arch/frv/kernel/ptrace.c
@@ -69,7 +69,8 @@ static inline int put_reg(struct task_struct *task, int regno,
69} 69}
70 70
71/* 71/*
72 * check that an address falls within the bounds of the target process's memory mappings 72 * check that an address falls within the bounds of the target process's memory
73 * mappings
73 */ 74 */
74static inline int is_user_addr_valid(struct task_struct *child, 75static inline int is_user_addr_valid(struct task_struct *child,
75 unsigned long start, unsigned long len) 76 unsigned long start, unsigned long len)
@@ -79,11 +80,11 @@ static inline int is_user_addr_valid(struct task_struct *child,
79 return -EIO; 80 return -EIO;
80 return 0; 81 return 0;
81#else 82#else
82 struct vm_list_struct *vml; 83 struct vm_area_struct *vma;
83 84
84 for (vml = child->mm->context.vmlist; vml; vml = vml->next) 85 vma = find_vma(child->mm, start);
85 if (start >= vml->vma->vm_start && start + len <= vml->vma->vm_end) 86 if (vma && start >= vma->vm_start && start + len <= vma->vm_end)
86 return 0; 87 return 0;
87 88
88 return -EIO; 89 return -EIO;
89#endif 90#endif
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 28f06fd9b7b7..9420648352b8 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -220,6 +220,8 @@ source "drivers/uwb/Kconfig"
220 220
221endmenu 221endmenu
222 222
223source "drivers/staging/Kconfig"
224
223source "fs/Kconfig" 225source "fs/Kconfig"
224 226
225source "arch/h8300/Kconfig.debug" 227source "arch/h8300/Kconfig.debug"
diff --git a/arch/h8300/include/asm/Kbuild b/arch/h8300/include/asm/Kbuild
index c68e1680da01..27b108a86b39 100644
--- a/arch/h8300/include/asm/Kbuild
+++ b/arch/h8300/include/asm/Kbuild
@@ -1 +1,2 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2unifdef-y += swab.h
diff --git a/arch/h8300/include/asm/atomic.h b/arch/h8300/include/asm/atomic.h
index b4cf0ea97ede..833186c8dc3b 100644
--- a/arch/h8300/include/asm/atomic.h
+++ b/arch/h8300/include/asm/atomic.h
@@ -1,12 +1,13 @@
1#ifndef __ARCH_H8300_ATOMIC__ 1#ifndef __ARCH_H8300_ATOMIC__
2#define __ARCH_H8300_ATOMIC__ 2#define __ARCH_H8300_ATOMIC__
3 3
4#include <linux/types.h>
5
4/* 6/*
5 * Atomic operations that C can't guarantee us. Useful for 7 * Atomic operations that C can't guarantee us. Useful for
6 * resource counting etc.. 8 * resource counting etc..
7 */ 9 */
8 10
9typedef struct { int counter; } atomic_t;
10#define ATOMIC_INIT(i) { (i) } 11#define ATOMIC_INIT(i) { (i) }
11 12
12#define atomic_read(v) ((v)->counter) 13#define atomic_read(v) ((v)->counter)
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index cb18e3b0aa94..cb9ddf5fc54f 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -207,6 +207,7 @@ static __inline__ unsigned long __ffs(unsigned long word)
207#endif /* __KERNEL__ */ 207#endif /* __KERNEL__ */
208 208
209#include <asm-generic/bitops/fls.h> 209#include <asm-generic/bitops/fls.h>
210#include <asm-generic/bitops/__fls.h>
210#include <asm-generic/bitops/fls64.h> 211#include <asm-generic/bitops/fls64.h>
211 212
212#endif /* _H8300_BITOPS_H */ 213#endif /* _H8300_BITOPS_H */
diff --git a/arch/h8300/include/asm/byteorder.h b/arch/h8300/include/asm/byteorder.h
index 36e597d61619..c36b80a3dd84 100644
--- a/arch/h8300/include/asm/byteorder.h
+++ b/arch/h8300/include/asm/byteorder.h
@@ -1,13 +1,7 @@
1#ifndef _H8300_BYTEORDER_H 1#ifndef _H8300_BYTEORDER_H
2#define _H8300_BYTEORDER_H 2#define _H8300_BYTEORDER_H
3 3
4#include <asm/types.h> 4#include <asm/swab.h>
5
6#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
7# define __BYTEORDER_HAS_U64__
8# define __SWAB_64_THRU_32__
9#endif
10
11#include <linux/byteorder/big_endian.h> 5#include <linux/byteorder/big_endian.h>
12 6
13#endif /* _H8300_BYTEORDER_H */ 7#endif /* _H8300_BYTEORDER_H */
diff --git a/arch/h8300/include/asm/mmu.h b/arch/h8300/include/asm/mmu.h
index 2ce06ea46104..31309969df70 100644
--- a/arch/h8300/include/asm/mmu.h
+++ b/arch/h8300/include/asm/mmu.h
@@ -4,7 +4,6 @@
4/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ 4/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
5 5
6typedef struct { 6typedef struct {
7 struct vm_list_struct *vmlist;
8 unsigned long end_brk; 7 unsigned long end_brk;
9} mm_context_t; 8} mm_context_t;
10 9
diff --git a/arch/h8300/include/asm/swab.h b/arch/h8300/include/asm/swab.h
new file mode 100644
index 000000000000..c108f39b8bc4
--- /dev/null
+++ b/arch/h8300/include/asm/swab.h
@@ -0,0 +1,10 @@
1#ifndef _H8300_SWAB_H
2#define _H8300_SWAB_H
3
4#include <asm/types.h>
5
6#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
7# define __SWAB_64_THRU_32__
8#endif
9
10#endif /* _H8300_SWAB_H */
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 7fa8f615ba6e..3d31636cbafb 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -687,3 +687,6 @@ config IRQ_PER_CPU
687 687
688config IOMMU_HELPER 688config IOMMU_HELPER
689 def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB) 689 def_bool (IA64_HP_ZX1 || IA64_HP_ZX1_SWIOTLB || IA64_GENERIC || SWIOTLB)
690
691config IOMMU_API
692 def_bool (DMAR)
diff --git a/arch/ia64/hp/sim/hpsim_irq.c b/arch/ia64/hp/sim/hpsim_irq.c
index c2f58ff364e7..cc0a3182db3c 100644
--- a/arch/ia64/hp/sim/hpsim_irq.c
+++ b/arch/ia64/hp/sim/hpsim_irq.c
@@ -22,7 +22,7 @@ hpsim_irq_noop (unsigned int irq)
22} 22}
23 23
24static void 24static void
25hpsim_set_affinity_noop (unsigned int a, cpumask_t b) 25hpsim_set_affinity_noop(unsigned int a, const struct cpumask *b)
26{ 26{
27} 27}
28 28
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild
index ccbe8ae47a61..3b25bd9dca91 100644
--- a/arch/ia64/include/asm/Kbuild
+++ b/arch/ia64/include/asm/Kbuild
@@ -14,3 +14,4 @@ unifdef-y += gcc_intrin.h
14unifdef-y += intrinsics.h 14unifdef-y += intrinsics.h
15unifdef-y += perfmon.h 15unifdef-y += perfmon.h
16unifdef-y += ustack.h 16unifdef-y += ustack.h
17unifdef-y += swab.h
diff --git a/arch/ia64/include/asm/acpi-ext.h b/arch/ia64/include/asm/acpi-ext.h
index 734d137dda6e..7f8362b379eb 100644
--- a/arch/ia64/include/asm/acpi-ext.h
+++ b/arch/ia64/include/asm/acpi-ext.h
@@ -14,7 +14,6 @@
14#define _ASM_IA64_ACPI_EXT_H 14#define _ASM_IA64_ACPI_EXT_H
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <acpi/actypes.h>
18 17
19extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length); 18extern acpi_status hp_acpi_csr_space (acpi_handle, u64 *base, u64 *length);
20 19
diff --git a/arch/ia64/include/asm/atomic.h b/arch/ia64/include/asm/atomic.h
index 50c2b83fd5a0..d37292bd9875 100644
--- a/arch/ia64/include/asm/atomic.h
+++ b/arch/ia64/include/asm/atomic.h
@@ -17,12 +17,6 @@
17#include <asm/intrinsics.h> 17#include <asm/intrinsics.h>
18#include <asm/system.h> 18#include <asm/system.h>
19 19
20/*
21 * On IA-64, counter must always be volatile to ensure that that the
22 * memory accesses are ordered.
23 */
24typedef struct { volatile __s32 counter; } atomic_t;
25typedef struct { volatile __s64 counter; } atomic64_t;
26 20
27#define ATOMIC_INIT(i) ((atomic_t) { (i) }) 21#define ATOMIC_INIT(i) ((atomic_t) { (i) })
28#define ATOMIC64_INIT(i) ((atomic64_t) { (i) }) 22#define ATOMIC64_INIT(i) ((atomic64_t) { (i) })
diff --git a/arch/ia64/include/asm/byteorder.h b/arch/ia64/include/asm/byteorder.h
index 69bd41d7c26e..0f84c5cb703d 100644
--- a/arch/ia64/include/asm/byteorder.h
+++ b/arch/ia64/include/asm/byteorder.h
@@ -1,42 +1,7 @@
1#ifndef _ASM_IA64_BYTEORDER_H 1#ifndef _ASM_IA64_BYTEORDER_H
2#define _ASM_IA64_BYTEORDER_H 2#define _ASM_IA64_BYTEORDER_H
3 3
4/* 4#include <asm/swab.h>
5 * Modified 1998, 1999
6 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
7 */
8
9#include <asm/types.h>
10#include <asm/intrinsics.h>
11#include <linux/compiler.h>
12
13static __inline__ __attribute_const__ __u64
14__ia64_swab64 (__u64 x)
15{
16 __u64 result;
17
18 result = ia64_mux1(x, ia64_mux1_rev);
19 return result;
20}
21
22static __inline__ __attribute_const__ __u32
23__ia64_swab32 (__u32 x)
24{
25 return __ia64_swab64(x) >> 32;
26}
27
28static __inline__ __attribute_const__ __u16
29__ia64_swab16(__u16 x)
30{
31 return __ia64_swab64(x) >> 48;
32}
33
34#define __arch__swab64(x) __ia64_swab64(x)
35#define __arch__swab32(x) __ia64_swab32(x)
36#define __arch__swab16(x) __ia64_swab16(x)
37
38#define __BYTEORDER_HAS_U64__
39
40#include <linux/byteorder/little_endian.h> 5#include <linux/byteorder/little_endian.h>
41 6
42#endif /* _ASM_IA64_BYTEORDER_H */ 7#endif /* _ASM_IA64_BYTEORDER_H */
diff --git a/arch/ia64/include/asm/irq.h b/arch/ia64/include/asm/irq.h
index 3627116fb0e2..5282546cdf82 100644
--- a/arch/ia64/include/asm/irq.h
+++ b/arch/ia64/include/asm/irq.h
@@ -27,7 +27,7 @@ irq_canonicalize (int irq)
27} 27}
28 28
29extern void set_irq_affinity_info (unsigned int irq, int dest, int redir); 29extern void set_irq_affinity_info (unsigned int irq, int dest, int redir);
30bool is_affinity_mask_valid(cpumask_t cpumask); 30bool is_affinity_mask_valid(const struct cpumask *cpumask);
31 31
32#define is_affinity_mask_valid is_affinity_mask_valid 32#define is_affinity_mask_valid is_affinity_mask_valid
33 33
diff --git a/arch/ia64/include/asm/kvm.h b/arch/ia64/include/asm/kvm.h
index f38472ac2267..68aa6da807c1 100644
--- a/arch/ia64/include/asm/kvm.h
+++ b/arch/ia64/include/asm/kvm.h
@@ -166,8 +166,6 @@ struct saved_vpd {
166}; 166};
167 167
168struct kvm_regs { 168struct kvm_regs {
169 char *saved_guest;
170 char *saved_stack;
171 struct saved_vpd vpd; 169 struct saved_vpd vpd;
172 /*Arch-regs*/ 170 /*Arch-regs*/
173 int mp_state; 171 int mp_state;
@@ -200,6 +198,10 @@ struct kvm_regs {
200 unsigned long fp_psr; /*used for lazy float register */ 198 unsigned long fp_psr; /*used for lazy float register */
201 unsigned long saved_gp; 199 unsigned long saved_gp;
202 /*for phycial emulation */ 200 /*for phycial emulation */
201
202 union context saved_guest;
203
204 unsigned long reserved[64]; /* for future use */
203}; 205};
204 206
205struct kvm_sregs { 207struct kvm_sregs {
diff --git a/arch/ia64/include/asm/kvm_host.h b/arch/ia64/include/asm/kvm_host.h
index c60d324da540..348663661659 100644
--- a/arch/ia64/include/asm/kvm_host.h
+++ b/arch/ia64/include/asm/kvm_host.h
@@ -23,17 +23,6 @@
23#ifndef __ASM_KVM_HOST_H 23#ifndef __ASM_KVM_HOST_H
24#define __ASM_KVM_HOST_H 24#define __ASM_KVM_HOST_H
25 25
26
27#include <linux/types.h>
28#include <linux/mm.h>
29#include <linux/kvm.h>
30#include <linux/kvm_para.h>
31#include <linux/kvm_types.h>
32
33#include <asm/pal.h>
34#include <asm/sal.h>
35
36#define KVM_MAX_VCPUS 4
37#define KVM_MEMORY_SLOTS 32 26#define KVM_MEMORY_SLOTS 32
38/* memory slots that does not exposed to userspace */ 27/* memory slots that does not exposed to userspace */
39#define KVM_PRIVATE_MEM_SLOTS 4 28#define KVM_PRIVATE_MEM_SLOTS 4
@@ -50,70 +39,132 @@
50#define EXIT_REASON_EXTERNAL_INTERRUPT 6 39#define EXIT_REASON_EXTERNAL_INTERRUPT 6
51#define EXIT_REASON_IPI 7 40#define EXIT_REASON_IPI 7
52#define EXIT_REASON_PTC_G 8 41#define EXIT_REASON_PTC_G 8
42#define EXIT_REASON_DEBUG 20
53 43
54/*Define vmm address space and vm data space.*/ 44/*Define vmm address space and vm data space.*/
55#define KVM_VMM_SIZE (16UL<<20) 45#define KVM_VMM_SIZE (__IA64_UL_CONST(16)<<20)
56#define KVM_VMM_SHIFT 24 46#define KVM_VMM_SHIFT 24
57#define KVM_VMM_BASE 0xD000000000000000UL 47#define KVM_VMM_BASE 0xD000000000000000
58#define VMM_SIZE (8UL<<20) 48#define VMM_SIZE (__IA64_UL_CONST(8)<<20)
59 49
60/* 50/*
61 * Define vm_buffer, used by PAL Services, base address. 51 * Define vm_buffer, used by PAL Services, base address.
62 * Note: vmbuffer is in the VMM-BLOCK, the size must be < 8M 52 * Note: vm_buffer is in the VMM-BLOCK, the size must be < 8M
63 */ 53 */
64#define KVM_VM_BUFFER_BASE (KVM_VMM_BASE + VMM_SIZE) 54#define KVM_VM_BUFFER_BASE (KVM_VMM_BASE + VMM_SIZE)
65#define KVM_VM_BUFFER_SIZE (8UL<<20) 55#define KVM_VM_BUFFER_SIZE (__IA64_UL_CONST(8)<<20)
66 56
67/*Define Virtual machine data layout.*/ 57/*
68#define KVM_VM_DATA_SHIFT 24 58 * kvm guest's data area looks as follow:
69#define KVM_VM_DATA_SIZE (1UL << KVM_VM_DATA_SHIFT) 59 *
70#define KVM_VM_DATA_BASE (KVM_VMM_BASE + KVM_VMM_SIZE) 60 * +----------------------+ ------- KVM_VM_DATA_SIZE
71 61 * | vcpu[n]'s data | | ___________________KVM_STK_OFFSET
72 62 * | | | / |
73#define KVM_P2M_BASE KVM_VM_DATA_BASE 63 * | .......... | | /vcpu's struct&stack |
74#define KVM_P2M_OFS 0 64 * | .......... | | /---------------------|---- 0
75#define KVM_P2M_SIZE (8UL << 20) 65 * | vcpu[5]'s data | | / vpd |
76 66 * | vcpu[4]'s data | |/-----------------------|
77#define KVM_VHPT_BASE (KVM_P2M_BASE + KVM_P2M_SIZE) 67 * | vcpu[3]'s data | / vtlb |
78#define KVM_VHPT_OFS KVM_P2M_SIZE 68 * | vcpu[2]'s data | /|------------------------|
79#define KVM_VHPT_BLOCK_SIZE (2UL << 20) 69 * | vcpu[1]'s data |/ | vhpt |
80#define VHPT_SHIFT 18 70 * | vcpu[0]'s data |____________________________|
81#define VHPT_SIZE (1UL << VHPT_SHIFT) 71 * +----------------------+ |
82#define VHPT_NUM_ENTRIES (1<<(VHPT_SHIFT-5)) 72 * | memory dirty log | |
83 73 * +----------------------+ |
84#define KVM_VTLB_BASE (KVM_VHPT_BASE+KVM_VHPT_BLOCK_SIZE) 74 * | vm's data struct | |
85#define KVM_VTLB_OFS (KVM_VHPT_OFS+KVM_VHPT_BLOCK_SIZE) 75 * +----------------------+ |
86#define KVM_VTLB_BLOCK_SIZE (1UL<<20) 76 * | | |
87#define VTLB_SHIFT 17 77 * | | |
88#define VTLB_SIZE (1UL<<VTLB_SHIFT) 78 * | | |
89#define VTLB_NUM_ENTRIES (1<<(VTLB_SHIFT-5)) 79 * | | |
90 80 * | | |
91#define KVM_VPD_BASE (KVM_VTLB_BASE+KVM_VTLB_BLOCK_SIZE) 81 * | | |
92#define KVM_VPD_OFS (KVM_VTLB_OFS+KVM_VTLB_BLOCK_SIZE) 82 * | | |
93#define KVM_VPD_BLOCK_SIZE (2UL<<20) 83 * | vm's p2m table | |
94#define VPD_SHIFT 16 84 * | | |
95#define VPD_SIZE (1UL<<VPD_SHIFT) 85 * | | |
96 86 * | | | |
97#define KVM_VCPU_BASE (KVM_VPD_BASE+KVM_VPD_BLOCK_SIZE) 87 * vm's data->| | | |
98#define KVM_VCPU_OFS (KVM_VPD_OFS+KVM_VPD_BLOCK_SIZE) 88 * +----------------------+ ------- 0
99#define KVM_VCPU_BLOCK_SIZE (2UL<<20) 89 * To support large memory, needs to increase the size of p2m.
100#define VCPU_SHIFT 18 90 * To support more vcpus, needs to ensure it has enough space to
101#define VCPU_SIZE (1UL<<VCPU_SHIFT) 91 * hold vcpus' data.
102#define MAX_VCPU_NUM KVM_VCPU_BLOCK_SIZE/VCPU_SIZE 92 */
103 93
104#define KVM_VM_BASE (KVM_VCPU_BASE+KVM_VCPU_BLOCK_SIZE) 94#define KVM_VM_DATA_SHIFT 26
105#define KVM_VM_OFS (KVM_VCPU_OFS+KVM_VCPU_BLOCK_SIZE) 95#define KVM_VM_DATA_SIZE (__IA64_UL_CONST(1) << KVM_VM_DATA_SHIFT)
106#define KVM_VM_BLOCK_SIZE (1UL<<19) 96#define KVM_VM_DATA_BASE (KVM_VMM_BASE + KVM_VM_DATA_SIZE)
107 97
108#define KVM_MEM_DIRTY_LOG_BASE (KVM_VM_BASE+KVM_VM_BLOCK_SIZE) 98#define KVM_P2M_BASE KVM_VM_DATA_BASE
109#define KVM_MEM_DIRTY_LOG_OFS (KVM_VM_OFS+KVM_VM_BLOCK_SIZE) 99#define KVM_P2M_SIZE (__IA64_UL_CONST(24) << 20)
110#define KVM_MEM_DIRTY_LOG_SIZE (1UL<<19) 100
111 101#define VHPT_SHIFT 16
112/* Get vpd, vhpt, tlb, vcpu, base*/ 102#define VHPT_SIZE (__IA64_UL_CONST(1) << VHPT_SHIFT)
113#define VPD_ADDR(n) (KVM_VPD_BASE+n*VPD_SIZE) 103#define VHPT_NUM_ENTRIES (__IA64_UL_CONST(1) << (VHPT_SHIFT-5))
114#define VHPT_ADDR(n) (KVM_VHPT_BASE+n*VHPT_SIZE) 104
115#define VTLB_ADDR(n) (KVM_VTLB_BASE+n*VTLB_SIZE) 105#define VTLB_SHIFT 16
116#define VCPU_ADDR(n) (KVM_VCPU_BASE+n*VCPU_SIZE) 106#define VTLB_SIZE (__IA64_UL_CONST(1) << VTLB_SHIFT)
107#define VTLB_NUM_ENTRIES (1UL << (VHPT_SHIFT-5))
108
109#define VPD_SHIFT 16
110#define VPD_SIZE (__IA64_UL_CONST(1) << VPD_SHIFT)
111
112#define VCPU_STRUCT_SHIFT 16
113#define VCPU_STRUCT_SIZE (__IA64_UL_CONST(1) << VCPU_STRUCT_SHIFT)
114
115#define KVM_STK_OFFSET VCPU_STRUCT_SIZE
116
117#define KVM_VM_STRUCT_SHIFT 19
118#define KVM_VM_STRUCT_SIZE (__IA64_UL_CONST(1) << KVM_VM_STRUCT_SHIFT)
119
120#define KVM_MEM_DIRY_LOG_SHIFT 19
121#define KVM_MEM_DIRTY_LOG_SIZE (__IA64_UL_CONST(1) << KVM_MEM_DIRY_LOG_SHIFT)
122
123#ifndef __ASSEMBLY__
124
125/*Define the max vcpus and memory for Guests.*/
126#define KVM_MAX_VCPUS (KVM_VM_DATA_SIZE - KVM_P2M_SIZE - KVM_VM_STRUCT_SIZE -\
127 KVM_MEM_DIRTY_LOG_SIZE) / sizeof(struct kvm_vcpu_data)
128#define KVM_MAX_MEM_SIZE (KVM_P2M_SIZE >> 3 << PAGE_SHIFT)
129
130#define VMM_LOG_LEN 256
131
132#include <linux/types.h>
133#include <linux/mm.h>
134#include <linux/kvm.h>
135#include <linux/kvm_para.h>
136#include <linux/kvm_types.h>
137
138#include <asm/pal.h>
139#include <asm/sal.h>
140#include <asm/page.h>
141
142struct kvm_vcpu_data {
143 char vcpu_vhpt[VHPT_SIZE];
144 char vcpu_vtlb[VTLB_SIZE];
145 char vcpu_vpd[VPD_SIZE];
146 char vcpu_struct[VCPU_STRUCT_SIZE];
147};
148
149struct kvm_vm_data {
150 char kvm_p2m[KVM_P2M_SIZE];
151 char kvm_vm_struct[KVM_VM_STRUCT_SIZE];
152 char kvm_mem_dirty_log[KVM_MEM_DIRTY_LOG_SIZE];
153 struct kvm_vcpu_data vcpu_data[KVM_MAX_VCPUS];
154};
155
156#define VCPU_BASE(n) KVM_VM_DATA_BASE + \
157 offsetof(struct kvm_vm_data, vcpu_data[n])
158#define VM_BASE KVM_VM_DATA_BASE + \
159 offsetof(struct kvm_vm_data, kvm_vm_struct)
160#define KVM_MEM_DIRTY_LOG_BASE KVM_VM_DATA_BASE + \
161 offsetof(struct kvm_vm_data, kvm_mem_dirty_log)
162
163#define VHPT_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vhpt))
164#define VTLB_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vtlb))
165#define VPD_BASE(n) (VCPU_BASE(n) + offsetof(struct kvm_vcpu_data, vcpu_vpd))
166#define VCPU_STRUCT_BASE(n) (VCPU_BASE(n) + \
167 offsetof(struct kvm_vcpu_data, vcpu_struct))
117 168
118/*IO section definitions*/ 169/*IO section definitions*/
119#define IOREQ_READ 1 170#define IOREQ_READ 1
@@ -389,6 +440,7 @@ struct kvm_vcpu_arch {
389 440
390 unsigned long opcode; 441 unsigned long opcode;
391 unsigned long cause; 442 unsigned long cause;
443 char log_buf[VMM_LOG_LEN];
392 union context host; 444 union context host;
393 union context guest; 445 union context guest;
394}; 446};
@@ -403,20 +455,19 @@ struct kvm_sal_data {
403}; 455};
404 456
405struct kvm_arch { 457struct kvm_arch {
458 spinlock_t dirty_log_lock;
459
406 unsigned long vm_base; 460 unsigned long vm_base;
407 unsigned long metaphysical_rr0; 461 unsigned long metaphysical_rr0;
408 unsigned long metaphysical_rr4; 462 unsigned long metaphysical_rr4;
409 unsigned long vmm_init_rr; 463 unsigned long vmm_init_rr;
410 unsigned long vhpt_base; 464
411 unsigned long vtlb_base;
412 unsigned long vpd_base;
413 spinlock_t dirty_log_lock;
414 struct kvm_ioapic *vioapic; 465 struct kvm_ioapic *vioapic;
415 struct kvm_vm_stat stat; 466 struct kvm_vm_stat stat;
416 struct kvm_sal_data rdv_sal_data; 467 struct kvm_sal_data rdv_sal_data;
417 468
418 struct list_head assigned_dev_head; 469 struct list_head assigned_dev_head;
419 struct dmar_domain *intel_iommu_domain; 470 struct iommu_domain *iommu_domain;
420 struct hlist_head irq_ack_notifier_list; 471 struct hlist_head irq_ack_notifier_list;
421 472
422 unsigned long irq_sources_bitmap; 473 unsigned long irq_sources_bitmap;
@@ -512,7 +563,7 @@ struct kvm_pt_regs {
512 563
513static inline struct kvm_pt_regs *vcpu_regs(struct kvm_vcpu *v) 564static inline struct kvm_pt_regs *vcpu_regs(struct kvm_vcpu *v)
514{ 565{
515 return (struct kvm_pt_regs *) ((unsigned long) v + IA64_STK_OFFSET) - 1; 566 return (struct kvm_pt_regs *) ((unsigned long) v + KVM_STK_OFFSET) - 1;
516} 567}
517 568
518typedef int kvm_vmm_entry(void); 569typedef int kvm_vmm_entry(void);
@@ -531,5 +582,6 @@ int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run);
531void kvm_sal_emul(struct kvm_vcpu *vcpu); 582void kvm_sal_emul(struct kvm_vcpu *vcpu);
532 583
533static inline void kvm_inject_nmi(struct kvm_vcpu *vcpu) {} 584static inline void kvm_inject_nmi(struct kvm_vcpu *vcpu) {}
585#endif /* __ASSEMBLY__*/
534 586
535#endif 587#endif
diff --git a/arch/ia64/include/asm/smp.h b/arch/ia64/include/asm/smp.h
index 12d96e0cd513..21c402365d0e 100644
--- a/arch/ia64/include/asm/smp.h
+++ b/arch/ia64/include/asm/smp.h
@@ -57,7 +57,6 @@ extern struct smp_boot_data {
57 57
58extern char no_int_routing __devinitdata; 58extern char no_int_routing __devinitdata;
59 59
60extern cpumask_t cpu_online_map;
61extern cpumask_t cpu_core_map[NR_CPUS]; 60extern cpumask_t cpu_core_map[NR_CPUS];
62DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); 61DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
63extern int smp_num_siblings; 62extern int smp_num_siblings;
diff --git a/arch/ia64/include/asm/sn/acpi.h b/arch/ia64/include/asm/sn/acpi.h
index 9ce2801cbd57..fd480db25565 100644
--- a/arch/ia64/include/asm/sn/acpi.h
+++ b/arch/ia64/include/asm/sn/acpi.h
@@ -9,8 +9,6 @@
9#ifndef _ASM_IA64_SN_ACPI_H 9#ifndef _ASM_IA64_SN_ACPI_H
10#define _ASM_IA64_SN_ACPI_H 10#define _ASM_IA64_SN_ACPI_H
11 11
12#include "acpi/acglobal.h"
13
14extern int sn_acpi_rev; 12extern int sn_acpi_rev;
15#define SN_ACPI_BASE_SUPPORT() (sn_acpi_rev >= 0x20101) 13#define SN_ACPI_BASE_SUPPORT() (sn_acpi_rev >= 0x20101)
16 14
diff --git a/arch/ia64/include/asm/swab.h b/arch/ia64/include/asm/swab.h
new file mode 100644
index 000000000000..6aa58b699eea
--- /dev/null
+++ b/arch/ia64/include/asm/swab.h
@@ -0,0 +1,34 @@
1#ifndef _ASM_IA64_SWAB_H
2#define _ASM_IA64_SWAB_H
3
4/*
5 * Modified 1998, 1999
6 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
7 */
8
9#include <asm/types.h>
10#include <asm/intrinsics.h>
11#include <linux/compiler.h>
12
13static __inline__ __attribute_const__ __u64 __arch_swab64(__u64 x)
14{
15 __u64 result;
16
17 result = ia64_mux1(x, ia64_mux1_rev);
18 return result;
19}
20#define __arch_swab64 __arch_swab64
21
22static __inline__ __attribute_const__ __u32 __arch_swab32(__u32 x)
23{
24 return __arch_swab64(x) >> 32;
25}
26#define __arch_swab32 __arch_swab32
27
28static __inline__ __attribute_const__ __u16 __arch_swab16(__u16 x)
29{
30 return __arch_swab64(x) >> 48;
31}
32#define __arch_swab16 __arch_swab16
33
34#endif /* _ASM_IA64_SWAB_H */
diff --git a/arch/ia64/include/asm/swiotlb.h b/arch/ia64/include/asm/swiotlb.h
index fb79423834d0..dcbaea7ce128 100644
--- a/arch/ia64/include/asm/swiotlb.h
+++ b/arch/ia64/include/asm/swiotlb.h
@@ -2,44 +2,7 @@
2#define ASM_IA64__SWIOTLB_H 2#define ASM_IA64__SWIOTLB_H
3 3
4#include <linux/dma-mapping.h> 4#include <linux/dma-mapping.h>
5 5#include <linux/swiotlb.h>
6/* SWIOTLB interface */
7
8extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr,
9 size_t size, int dir);
10extern void *swiotlb_alloc_coherent(struct device *hwdev, size_t size,
11 dma_addr_t *dma_handle, gfp_t flags);
12extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr,
13 size_t size, int dir);
14extern void swiotlb_sync_single_for_cpu(struct device *hwdev,
15 dma_addr_t dev_addr,
16 size_t size, int dir);
17extern void swiotlb_sync_single_for_device(struct device *hwdev,
18 dma_addr_t dev_addr,
19 size_t size, int dir);
20extern void swiotlb_sync_single_range_for_cpu(struct device *hwdev,
21 dma_addr_t dev_addr,
22 unsigned long offset,
23 size_t size, int dir);
24extern void swiotlb_sync_single_range_for_device(struct device *hwdev,
25 dma_addr_t dev_addr,
26 unsigned long offset,
27 size_t size, int dir);
28extern void swiotlb_sync_sg_for_cpu(struct device *hwdev,
29 struct scatterlist *sg, int nelems,
30 int dir);
31extern void swiotlb_sync_sg_for_device(struct device *hwdev,
32 struct scatterlist *sg, int nelems,
33 int dir);
34extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg,
35 int nents, int direction);
36extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg,
37 int nents, int direction);
38extern int swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
39extern void swiotlb_free_coherent(struct device *hwdev, size_t size,
40 void *vaddr, dma_addr_t dma_handle);
41extern int swiotlb_dma_supported(struct device *hwdev, u64 mask);
42extern void swiotlb_init(void);
43 6
44extern int swiotlb_force; 7extern int swiotlb_force;
45 8
diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h
index 35bcb641c9e5..32f3af1641c5 100644
--- a/arch/ia64/include/asm/topology.h
+++ b/arch/ia64/include/asm/topology.h
@@ -34,6 +34,7 @@
34 * Returns a bitmask of CPUs on Node 'node'. 34 * Returns a bitmask of CPUs on Node 'node'.
35 */ 35 */
36#define node_to_cpumask(node) (node_to_cpu_mask[node]) 36#define node_to_cpumask(node) (node_to_cpu_mask[node])
37#define cpumask_of_node(node) (&node_to_cpu_mask[node])
37 38
38/* 39/*
39 * Returns the number of the node containing Node 'nid'. 40 * Returns the number of the node containing Node 'nid'.
@@ -45,7 +46,7 @@
45/* 46/*
46 * Returns the number of the first CPU on Node 'node'. 47 * Returns the number of the first CPU on Node 'node'.
47 */ 48 */
48#define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node))) 49#define node_to_first_cpu(node) (cpumask_first(cpumask_of_node(node)))
49 50
50/* 51/*
51 * Determines the node for a given pci bus 52 * Determines the node for a given pci bus
@@ -55,7 +56,6 @@
55void build_cpu_to_node_map(void); 56void build_cpu_to_node_map(void);
56 57
57#define SD_CPU_INIT (struct sched_domain) { \ 58#define SD_CPU_INIT (struct sched_domain) { \
58 .span = CPU_MASK_NONE, \
59 .parent = NULL, \ 59 .parent = NULL, \
60 .child = NULL, \ 60 .child = NULL, \
61 .groups = NULL, \ 61 .groups = NULL, \
@@ -80,7 +80,6 @@ void build_cpu_to_node_map(void);
80 80
81/* sched_domains SD_NODE_INIT for IA64 NUMA machines */ 81/* sched_domains SD_NODE_INIT for IA64 NUMA machines */
82#define SD_NODE_INIT (struct sched_domain) { \ 82#define SD_NODE_INIT (struct sched_domain) { \
83 .span = CPU_MASK_NONE, \
84 .parent = NULL, \ 83 .parent = NULL, \
85 .child = NULL, \ 84 .child = NULL, \
86 .groups = NULL, \ 85 .groups = NULL, \
@@ -111,6 +110,8 @@ void build_cpu_to_node_map(void);
111#define topology_core_id(cpu) (cpu_data(cpu)->core_id) 110#define topology_core_id(cpu) (cpu_data(cpu)->core_id)
112#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 111#define topology_core_siblings(cpu) (cpu_core_map[cpu])
113#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) 112#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
113#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
114#define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
114#define smt_capable() (smp_num_siblings > 1) 115#define smt_capable() (smp_num_siblings > 1)
115#endif 116#endif
116 117
@@ -121,6 +122,10 @@ extern void arch_fix_phys_package_id(int num, u32 slot);
121 node_to_cpumask(pcibus_to_node(bus)) \ 122 node_to_cpumask(pcibus_to_node(bus)) \
122 ) 123 )
123 124
125#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
126 cpu_all_mask : \
127 cpumask_of_node(pcibus_to_node(bus)))
128
124#include <asm-generic/topology.h> 129#include <asm-generic/topology.h>
125 130
126#endif /* _ASM_IA64_TOPOLOGY_H */ 131#endif /* _ASM_IA64_TOPOLOGY_H */
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index bd7acc71e8a9..d541671caf4a 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -65,6 +65,7 @@ EXPORT_SYMBOL(pm_idle);
65void (*pm_power_off) (void); 65void (*pm_power_off) (void);
66EXPORT_SYMBOL(pm_power_off); 66EXPORT_SYMBOL(pm_power_off);
67 67
68u32 acpi_rsdt_forced;
68unsigned int acpi_cpei_override; 69unsigned int acpi_cpei_override;
69unsigned int acpi_cpei_phys_cpuid; 70unsigned int acpi_cpei_phys_cpuid;
70 71
@@ -202,7 +203,6 @@ char *__init __acpi_map_table(unsigned long phys_addr, unsigned long size)
202 Boot-time Table Parsing 203 Boot-time Table Parsing
203 -------------------------------------------------------------------------- */ 204 -------------------------------------------------------------------------- */
204 205
205static int total_cpus __initdata;
206static int available_cpus __initdata; 206static int available_cpus __initdata;
207struct acpi_table_madt *acpi_madt __initdata; 207struct acpi_table_madt *acpi_madt __initdata;
208static u8 has_8259; 208static u8 has_8259;
@@ -1001,7 +1001,7 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
1001 node = pxm_to_node(pxm); 1001 node = pxm_to_node(pxm);
1002 1002
1003 if (node >= MAX_NUMNODES || !node_online(node) || 1003 if (node >= MAX_NUMNODES || !node_online(node) ||
1004 cpus_empty(node_to_cpumask(node))) 1004 cpumask_empty(cpumask_of_node(node)))
1005 return AE_OK; 1005 return AE_OK;
1006 1006
1007 /* We know a gsi to node mapping! */ 1007 /* We know a gsi to node mapping! */
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index 5c4674ae8aea..5cfd3d91001a 100644
--- a/arch/ia64/kernel/iosapic.c
+++ b/arch/ia64/kernel/iosapic.c
@@ -330,25 +330,25 @@ unmask_irq (unsigned int irq)
330 330
331 331
332static void 332static void
333iosapic_set_affinity (unsigned int irq, cpumask_t mask) 333iosapic_set_affinity(unsigned int irq, const struct cpumask *mask)
334{ 334{
335#ifdef CONFIG_SMP 335#ifdef CONFIG_SMP
336 u32 high32, low32; 336 u32 high32, low32;
337 int dest, rte_index; 337 int cpu, dest, rte_index;
338 int redir = (irq & IA64_IRQ_REDIRECTED) ? 1 : 0; 338 int redir = (irq & IA64_IRQ_REDIRECTED) ? 1 : 0;
339 struct iosapic_rte_info *rte; 339 struct iosapic_rte_info *rte;
340 struct iosapic *iosapic; 340 struct iosapic *iosapic;
341 341
342 irq &= (~IA64_IRQ_REDIRECTED); 342 irq &= (~IA64_IRQ_REDIRECTED);
343 343
344 cpus_and(mask, mask, cpu_online_map); 344 cpu = cpumask_first_and(cpu_online_mask, mask);
345 if (cpus_empty(mask)) 345 if (cpu >= nr_cpu_ids)
346 return; 346 return;
347 347
348 if (irq_prepare_move(irq, first_cpu(mask))) 348 if (irq_prepare_move(irq, cpu))
349 return; 349 return;
350 350
351 dest = cpu_physical_id(first_cpu(mask)); 351 dest = cpu_physical_id(cpu);
352 352
353 if (!iosapic_intr_info[irq].count) 353 if (!iosapic_intr_info[irq].count)
354 return; /* not an IOSAPIC interrupt */ 354 return; /* not an IOSAPIC interrupt */
@@ -695,32 +695,31 @@ get_target_cpu (unsigned int gsi, int irq)
695#ifdef CONFIG_NUMA 695#ifdef CONFIG_NUMA
696 { 696 {
697 int num_cpus, cpu_index, iosapic_index, numa_cpu, i = 0; 697 int num_cpus, cpu_index, iosapic_index, numa_cpu, i = 0;
698 cpumask_t cpu_mask; 698 const struct cpumask *cpu_mask;
699 699
700 iosapic_index = find_iosapic(gsi); 700 iosapic_index = find_iosapic(gsi);
701 if (iosapic_index < 0 || 701 if (iosapic_index < 0 ||
702 iosapic_lists[iosapic_index].node == MAX_NUMNODES) 702 iosapic_lists[iosapic_index].node == MAX_NUMNODES)
703 goto skip_numa_setup; 703 goto skip_numa_setup;
704 704
705 cpu_mask = node_to_cpumask(iosapic_lists[iosapic_index].node); 705 cpu_mask = cpumask_of_node(iosapic_lists[iosapic_index].node);
706 cpus_and(cpu_mask, cpu_mask, domain); 706 num_cpus = 0;
707 for_each_cpu_mask(numa_cpu, cpu_mask) { 707 for_each_cpu_and(numa_cpu, cpu_mask, &domain) {
708 if (!cpu_online(numa_cpu)) 708 if (cpu_online(numa_cpu))
709 cpu_clear(numa_cpu, cpu_mask); 709 num_cpus++;
710 } 710 }
711 711
712 num_cpus = cpus_weight(cpu_mask);
713
714 if (!num_cpus) 712 if (!num_cpus)
715 goto skip_numa_setup; 713 goto skip_numa_setup;
716 714
717 /* Use irq assignment to distribute across cpus in node */ 715 /* Use irq assignment to distribute across cpus in node */
718 cpu_index = irq % num_cpus; 716 cpu_index = irq % num_cpus;
719 717
720 for (numa_cpu = first_cpu(cpu_mask) ; i < cpu_index ; i++) 718 for_each_cpu_and(numa_cpu, cpu_mask, &domain)
721 numa_cpu = next_cpu(numa_cpu, cpu_mask); 719 if (cpu_online(numa_cpu) && i++ >= cpu_index)
720 break;
722 721
723 if (numa_cpu != NR_CPUS) 722 if (numa_cpu < nr_cpu_ids)
724 return cpu_physical_id(numa_cpu); 723 return cpu_physical_id(numa_cpu);
725 } 724 }
726skip_numa_setup: 725skip_numa_setup:
@@ -731,7 +730,7 @@ skip_numa_setup:
731 * case of NUMA.) 730 * case of NUMA.)
732 */ 731 */
733 do { 732 do {
734 if (++cpu >= NR_CPUS) 733 if (++cpu >= nr_cpu_ids)
735 cpu = 0; 734 cpu = 0;
736 } while (!cpu_online(cpu) || !cpu_isset(cpu, domain)); 735 } while (!cpu_online(cpu) || !cpu_isset(cpu, domain));
737 736
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c
index 7fd18f54c056..a58f64ca9f0e 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -102,21 +102,18 @@ static char irq_redir [NR_IRQS]; // = { [0 ... NR_IRQS-1] = 1 };
102 102
103void set_irq_affinity_info (unsigned int irq, int hwid, int redir) 103void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
104{ 104{
105 cpumask_t mask = CPU_MASK_NONE;
106
107 cpu_set(cpu_logical_id(hwid), mask);
108
109 if (irq < NR_IRQS) { 105 if (irq < NR_IRQS) {
110 irq_desc[irq].affinity = mask; 106 cpumask_copy(&irq_desc[irq].affinity,
107 cpumask_of(cpu_logical_id(hwid)));
111 irq_redir[irq] = (char) (redir & 0xff); 108 irq_redir[irq] = (char) (redir & 0xff);
112 } 109 }
113} 110}
114 111
115bool is_affinity_mask_valid(cpumask_t cpumask) 112bool is_affinity_mask_valid(const struct cpumask *cpumask)
116{ 113{
117 if (ia64_platform_is("sn2")) { 114 if (ia64_platform_is("sn2")) {
118 /* Only allow one CPU to be specified in the smp_affinity mask */ 115 /* Only allow one CPU to be specified in the smp_affinity mask */
119 if (cpus_weight(cpumask) != 1) 116 if (cpumask_weight(cpumask) != 1)
120 return false; 117 return false;
121 } 118 }
122 return true; 119 return true;
@@ -128,12 +125,11 @@ bool is_affinity_mask_valid(cpumask_t cpumask)
128unsigned int vectors_in_migration[NR_IRQS]; 125unsigned int vectors_in_migration[NR_IRQS];
129 126
130/* 127/*
131 * Since cpu_online_map is already updated, we just need to check for 128 * Since cpu_online_mask is already updated, we just need to check for
132 * affinity that has zeros 129 * affinity that has zeros
133 */ 130 */
134static void migrate_irqs(void) 131static void migrate_irqs(void)
135{ 132{
136 cpumask_t mask;
137 irq_desc_t *desc; 133 irq_desc_t *desc;
138 int irq, new_cpu; 134 int irq, new_cpu;
139 135
@@ -152,15 +148,14 @@ static void migrate_irqs(void)
152 if (desc->status == IRQ_PER_CPU) 148 if (desc->status == IRQ_PER_CPU)
153 continue; 149 continue;
154 150
155 cpus_and(mask, irq_desc[irq].affinity, cpu_online_map); 151 if (cpumask_any_and(&irq_desc[irq].affinity, cpu_online_mask)
156 if (any_online_cpu(mask) == NR_CPUS) { 152 >= nr_cpu_ids) {
157 /* 153 /*
158 * Save it for phase 2 processing 154 * Save it for phase 2 processing
159 */ 155 */
160 vectors_in_migration[irq] = irq; 156 vectors_in_migration[irq] = irq;
161 157
162 new_cpu = any_online_cpu(cpu_online_map); 158 new_cpu = cpumask_any(cpu_online_mask);
163 mask = cpumask_of_cpu(new_cpu);
164 159
165 /* 160 /*
166 * Al three are essential, currently WARN_ON.. maybe panic? 161 * Al three are essential, currently WARN_ON.. maybe panic?
@@ -168,7 +163,8 @@ static void migrate_irqs(void)
168 if (desc->chip && desc->chip->disable && 163 if (desc->chip && desc->chip->disable &&
169 desc->chip->enable && desc->chip->set_affinity) { 164 desc->chip->enable && desc->chip->set_affinity) {
170 desc->chip->disable(irq); 165 desc->chip->disable(irq);
171 desc->chip->set_affinity(irq, mask); 166 desc->chip->set_affinity(irq,
167 cpumask_of(new_cpu));
172 desc->chip->enable(irq); 168 desc->chip->enable(irq);
173 } else { 169 } else {
174 WARN_ON((!(desc->chip) || !(desc->chip->disable) || 170 WARN_ON((!(desc->chip) || !(desc->chip->disable) ||
@@ -192,7 +188,7 @@ void fixup_irqs(void)
192 * Find a new timesync master 188 * Find a new timesync master
193 */ 189 */
194 if (smp_processor_id() == time_keeper_id) { 190 if (smp_processor_id() == time_keeper_id) {
195 time_keeper_id = first_cpu(cpu_online_map); 191 time_keeper_id = cpumask_first(cpu_online_mask);
196 printk ("CPU %d is now promoted to time-keeper master\n", time_keeper_id); 192 printk ("CPU %d is now promoted to time-keeper master\n", time_keeper_id);
197 } 193 }
198 194
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index f07688da947c..f90be51b1123 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -434,7 +434,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
434 /* 434 /*
435 * It is possible to have multiple instances associated with a given 435 * It is possible to have multiple instances associated with a given
436 * task either because an multiple functions in the call path 436 * task either because an multiple functions in the call path
437 * have a return probe installed on them, and/or more then one return 437 * have a return probe installed on them, and/or more than one return
438 * return probe was registered for a target function. 438 * return probe was registered for a target function.
439 * 439 *
440 * We can handle this because: 440 * We can handle this because:
@@ -670,9 +670,11 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
670 670
671void __kprobes arch_remove_kprobe(struct kprobe *p) 671void __kprobes arch_remove_kprobe(struct kprobe *p)
672{ 672{
673 mutex_lock(&kprobe_mutex); 673 if (p->ainsn.insn) {
674 free_insn_slot(p->ainsn.insn, p->ainsn.inst_flag & INST_FLAG_BOOSTABLE); 674 free_insn_slot(p->ainsn.insn,
675 mutex_unlock(&kprobe_mutex); 675 p->ainsn.inst_flag & INST_FLAG_BOOSTABLE);
676 p->ainsn.insn = NULL;
677 }
676} 678}
677/* 679/*
678 * We are resuming execution after a single step fault, so the pt_regs 680 * We are resuming execution after a single step fault, so the pt_regs
diff --git a/arch/ia64/kernel/msi_ia64.c b/arch/ia64/kernel/msi_ia64.c
index 702a09c13238..890339339035 100644
--- a/arch/ia64/kernel/msi_ia64.c
+++ b/arch/ia64/kernel/msi_ia64.c
@@ -49,11 +49,12 @@
49static struct irq_chip ia64_msi_chip; 49static struct irq_chip ia64_msi_chip;
50 50
51#ifdef CONFIG_SMP 51#ifdef CONFIG_SMP
52static void ia64_set_msi_irq_affinity(unsigned int irq, cpumask_t cpu_mask) 52static void ia64_set_msi_irq_affinity(unsigned int irq,
53 const cpumask_t *cpu_mask)
53{ 54{
54 struct msi_msg msg; 55 struct msi_msg msg;
55 u32 addr, data; 56 u32 addr, data;
56 int cpu = first_cpu(cpu_mask); 57 int cpu = first_cpu(*cpu_mask);
57 58
58 if (!cpu_online(cpu)) 59 if (!cpu_online(cpu))
59 return; 60 return;
@@ -166,12 +167,11 @@ void arch_teardown_msi_irq(unsigned int irq)
166 167
167#ifdef CONFIG_DMAR 168#ifdef CONFIG_DMAR
168#ifdef CONFIG_SMP 169#ifdef CONFIG_SMP
169static void dmar_msi_set_affinity(unsigned int irq, cpumask_t mask) 170static void dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask)
170{ 171{
171 struct irq_cfg *cfg = irq_cfg + irq; 172 struct irq_cfg *cfg = irq_cfg + irq;
172 struct msi_msg msg; 173 struct msi_msg msg;
173 int cpu = first_cpu(mask); 174 int cpu = cpumask_first(mask);
174
175 175
176 if (!cpu_online(cpu)) 176 if (!cpu_online(cpu))
177 return; 177 return;
@@ -187,7 +187,7 @@ static void dmar_msi_set_affinity(unsigned int irq, cpumask_t mask)
187 msg.address_lo |= MSI_ADDR_DESTID_CPU(cpu_physical_id(cpu)); 187 msg.address_lo |= MSI_ADDR_DESTID_CPU(cpu_physical_id(cpu));
188 188
189 dmar_msi_write(irq, &msg); 189 dmar_msi_write(irq, &msg);
190 irq_desc[irq].affinity = mask; 190 irq_desc[irq].affinity = *mask;
191} 191}
192#endif /* CONFIG_SMP */ 192#endif /* CONFIG_SMP */
193 193
diff --git a/arch/ia64/kernel/pci-dma.c b/arch/ia64/kernel/pci-dma.c
index 2a92f637431d..d0ada067a4af 100644
--- a/arch/ia64/kernel/pci-dma.c
+++ b/arch/ia64/kernel/pci-dma.c
@@ -39,7 +39,7 @@ int iommu_detected __read_mostly;
39 be probably a smaller DMA mask, but this is bug-to-bug compatible 39 be probably a smaller DMA mask, but this is bug-to-bug compatible
40 to i386. */ 40 to i386. */
41struct device fallback_dev = { 41struct device fallback_dev = {
42 .bus_id = "fallback device", 42 .init_name = "fallback device",
43 .coherent_dma_mask = DMA_32BIT_MASK, 43 .coherent_dma_mask = DMA_32BIT_MASK,
44 .dma_mask = &fallback_dev.coherent_dma_mask, 44 .dma_mask = &fallback_dev.coherent_dma_mask,
45}; 45};
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index 1dcbb85fc4ee..11463994a7d5 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -131,12 +131,6 @@ struct task_struct *task_for_booting_cpu;
131 */ 131 */
132DEFINE_PER_CPU(int, cpu_state); 132DEFINE_PER_CPU(int, cpu_state);
133 133
134/* Bitmasks of currently online, and possible CPUs */
135cpumask_t cpu_online_map;
136EXPORT_SYMBOL(cpu_online_map);
137cpumask_t cpu_possible_map = CPU_MASK_NONE;
138EXPORT_SYMBOL(cpu_possible_map);
139
140cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned; 134cpumask_t cpu_core_map[NR_CPUS] __cacheline_aligned;
141EXPORT_SYMBOL(cpu_core_map); 135EXPORT_SYMBOL(cpu_core_map);
142DEFINE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map); 136DEFINE_PER_CPU_SHARED_ALIGNED(cpumask_t, cpu_sibling_map);
@@ -688,7 +682,7 @@ int migrate_platform_irqs(unsigned int cpu)
688{ 682{
689 int new_cpei_cpu; 683 int new_cpei_cpu;
690 irq_desc_t *desc = NULL; 684 irq_desc_t *desc = NULL;
691 cpumask_t mask; 685 const struct cpumask *mask;
692 int retval = 0; 686 int retval = 0;
693 687
694 /* 688 /*
@@ -701,7 +695,7 @@ int migrate_platform_irqs(unsigned int cpu)
701 * Now re-target the CPEI to a different processor 695 * Now re-target the CPEI to a different processor
702 */ 696 */
703 new_cpei_cpu = any_online_cpu(cpu_online_map); 697 new_cpei_cpu = any_online_cpu(cpu_online_map);
704 mask = cpumask_of_cpu(new_cpei_cpu); 698 mask = cpumask_of(new_cpei_cpu);
705 set_cpei_target_cpu(new_cpei_cpu); 699 set_cpei_target_cpu(new_cpei_cpu);
706 desc = irq_desc + ia64_cpe_irq; 700 desc = irq_desc + ia64_cpe_irq;
707 /* 701 /*
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 65c10a42c88f..f0ebb342409d 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -93,13 +93,14 @@ void ia64_account_on_switch(struct task_struct *prev, struct task_struct *next)
93 now = ia64_get_itc(); 93 now = ia64_get_itc();
94 94
95 delta_stime = cycle_to_cputime(pi->ac_stime + (now - pi->ac_stamp)); 95 delta_stime = cycle_to_cputime(pi->ac_stime + (now - pi->ac_stamp));
96 account_system_time(prev, 0, delta_stime); 96 if (idle_task(smp_processor_id()) != prev)
97 account_system_time_scaled(prev, delta_stime); 97 account_system_time(prev, 0, delta_stime, delta_stime);
98 else
99 account_idle_time(delta_stime);
98 100
99 if (pi->ac_utime) { 101 if (pi->ac_utime) {
100 delta_utime = cycle_to_cputime(pi->ac_utime); 102 delta_utime = cycle_to_cputime(pi->ac_utime);
101 account_user_time(prev, delta_utime); 103 account_user_time(prev, delta_utime, delta_utime);
102 account_user_time_scaled(prev, delta_utime);
103 } 104 }
104 105
105 pi->ac_stamp = ni->ac_stamp = now; 106 pi->ac_stamp = ni->ac_stamp = now;
@@ -122,8 +123,10 @@ void account_system_vtime(struct task_struct *tsk)
122 now = ia64_get_itc(); 123 now = ia64_get_itc();
123 124
124 delta_stime = cycle_to_cputime(ti->ac_stime + (now - ti->ac_stamp)); 125 delta_stime = cycle_to_cputime(ti->ac_stime + (now - ti->ac_stamp));
125 account_system_time(tsk, 0, delta_stime); 126 if (irq_count() || idle_task(smp_processor_id()) != tsk)
126 account_system_time_scaled(tsk, delta_stime); 127 account_system_time(tsk, 0, delta_stime, delta_stime);
128 else
129 account_idle_time(delta_stime);
127 ti->ac_stime = 0; 130 ti->ac_stime = 0;
128 131
129 ti->ac_stamp = now; 132 ti->ac_stamp = now;
@@ -143,8 +146,7 @@ void account_process_tick(struct task_struct *p, int user_tick)
143 146
144 if (ti->ac_utime) { 147 if (ti->ac_utime) {
145 delta_utime = cycle_to_cputime(ti->ac_utime); 148 delta_utime = cycle_to_cputime(ti->ac_utime);
146 account_user_time(p, delta_utime); 149 account_user_time(p, delta_utime, delta_utime);
147 account_user_time_scaled(p, delta_utime);
148 ti->ac_utime = 0; 150 ti->ac_utime = 0;
149 } 151 }
150} 152}
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index c75b914f2d6b..a8d61a3e9a94 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -219,7 +219,7 @@ static ssize_t show_shared_cpu_map(struct cache_info *this_leaf, char *buf)
219 cpumask_t shared_cpu_map; 219 cpumask_t shared_cpu_map;
220 220
221 cpus_and(shared_cpu_map, this_leaf->shared_cpu_map, cpu_online_map); 221 cpus_and(shared_cpu_map, this_leaf->shared_cpu_map, cpu_online_map);
222 len = cpumask_scnprintf(buf, NR_CPUS+1, shared_cpu_map); 222 len = cpumask_scnprintf(buf, NR_CPUS+1, &shared_cpu_map);
223 len += sprintf(buf+len, "\n"); 223 len += sprintf(buf+len, "\n");
224 return len; 224 return len;
225} 225}
diff --git a/arch/ia64/kvm/Makefile b/arch/ia64/kvm/Makefile
index 92cef66ca268..0bb99b732908 100644
--- a/arch/ia64/kvm/Makefile
+++ b/arch/ia64/kvm/Makefile
@@ -51,8 +51,8 @@ EXTRA_AFLAGS += -Ivirt/kvm -Iarch/ia64/kvm/
51common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ 51common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \
52 coalesced_mmio.o irq_comm.o) 52 coalesced_mmio.o irq_comm.o)
53 53
54ifeq ($(CONFIG_DMAR),y) 54ifeq ($(CONFIG_IOMMU_API),y)
55common-objs += $(addprefix ../../../virt/kvm/, vtd.o) 55common-objs += $(addprefix ../../../virt/kvm/, iommu.o)
56endif 56endif
57 57
58kvm-objs := $(common-objs) kvm-ia64.o kvm_fw.o 58kvm-objs := $(common-objs) kvm-ia64.o kvm_fw.o
@@ -60,7 +60,7 @@ obj-$(CONFIG_KVM) += kvm.o
60 60
61CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127 61CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127
62kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \ 62kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \
63 vtlb.o process.o 63 vtlb.o process.o kvm_lib.o
64#Add link memcpy and memset to avoid possible structure assignment error 64#Add link memcpy and memset to avoid possible structure assignment error
65kvm-intel-objs += memcpy.o memset.o 65kvm-intel-objs += memcpy.o memset.o
66obj-$(CONFIG_KVM_INTEL) += kvm-intel.o 66obj-$(CONFIG_KVM_INTEL) += kvm-intel.o
diff --git a/arch/ia64/kvm/asm-offsets.c b/arch/ia64/kvm/asm-offsets.c
index 4e3dc13a619c..0c3564a7a033 100644
--- a/arch/ia64/kvm/asm-offsets.c
+++ b/arch/ia64/kvm/asm-offsets.c
@@ -24,19 +24,10 @@
24 24
25#include <linux/autoconf.h> 25#include <linux/autoconf.h>
26#include <linux/kvm_host.h> 26#include <linux/kvm_host.h>
27#include <linux/kbuild.h>
27 28
28#include "vcpu.h" 29#include "vcpu.h"
29 30
30#define task_struct kvm_vcpu
31
32#define DEFINE(sym, val) \
33 asm volatile("\n->" #sym " (%0) " #val : : "i" (val))
34
35#define BLANK() asm volatile("\n->" : :)
36
37#define OFFSET(_sym, _str, _mem) \
38 DEFINE(_sym, offsetof(_str, _mem));
39
40void foo(void) 31void foo(void)
41{ 32{
42 DEFINE(VMM_TASK_SIZE, sizeof(struct kvm_vcpu)); 33 DEFINE(VMM_TASK_SIZE, sizeof(struct kvm_vcpu));
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index af1464f7a6ad..4e586f6110aa 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -31,6 +31,7 @@
31#include <linux/bitops.h> 31#include <linux/bitops.h>
32#include <linux/hrtimer.h> 32#include <linux/hrtimer.h>
33#include <linux/uaccess.h> 33#include <linux/uaccess.h>
34#include <linux/iommu.h>
34#include <linux/intel-iommu.h> 35#include <linux/intel-iommu.h>
35 36
36#include <asm/pgtable.h> 37#include <asm/pgtable.h>
@@ -180,7 +181,6 @@ int kvm_dev_ioctl_check_extension(long ext)
180 181
181 switch (ext) { 182 switch (ext) {
182 case KVM_CAP_IRQCHIP: 183 case KVM_CAP_IRQCHIP:
183 case KVM_CAP_USER_MEMORY:
184 case KVM_CAP_MP_STATE: 184 case KVM_CAP_MP_STATE:
185 185
186 r = 1; 186 r = 1;
@@ -189,7 +189,7 @@ int kvm_dev_ioctl_check_extension(long ext)
189 r = KVM_COALESCED_MMIO_PAGE_OFFSET; 189 r = KVM_COALESCED_MMIO_PAGE_OFFSET;
190 break; 190 break;
191 case KVM_CAP_IOMMU: 191 case KVM_CAP_IOMMU:
192 r = intel_iommu_found(); 192 r = iommu_found();
193 break; 193 break;
194 default: 194 default:
195 r = 0; 195 r = 0;
@@ -439,7 +439,6 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu)
439 expires = div64_u64(itc_diff, cyc_per_usec); 439 expires = div64_u64(itc_diff, cyc_per_usec);
440 kt = ktime_set(0, 1000 * expires); 440 kt = ktime_set(0, 1000 * expires);
441 441
442 down_read(&vcpu->kvm->slots_lock);
443 vcpu->arch.ht_active = 1; 442 vcpu->arch.ht_active = 1;
444 hrtimer_start(p_ht, kt, HRTIMER_MODE_ABS); 443 hrtimer_start(p_ht, kt, HRTIMER_MODE_ABS);
445 444
@@ -452,7 +451,6 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu)
452 if (vcpu->arch.mp_state == KVM_MP_STATE_HALTED) 451 if (vcpu->arch.mp_state == KVM_MP_STATE_HALTED)
453 vcpu->arch.mp_state = 452 vcpu->arch.mp_state =
454 KVM_MP_STATE_RUNNABLE; 453 KVM_MP_STATE_RUNNABLE;
455 up_read(&vcpu->kvm->slots_lock);
456 454
457 if (vcpu->arch.mp_state != KVM_MP_STATE_RUNNABLE) 455 if (vcpu->arch.mp_state != KVM_MP_STATE_RUNNABLE)
458 return -EINTR; 456 return -EINTR;
@@ -476,6 +474,13 @@ static int handle_external_interrupt(struct kvm_vcpu *vcpu,
476 return 1; 474 return 1;
477} 475}
478 476
477static int handle_vcpu_debug(struct kvm_vcpu *vcpu,
478 struct kvm_run *kvm_run)
479{
480 printk("VMM: %s", vcpu->arch.log_buf);
481 return 1;
482}
483
479static int (*kvm_vti_exit_handlers[])(struct kvm_vcpu *vcpu, 484static int (*kvm_vti_exit_handlers[])(struct kvm_vcpu *vcpu,
480 struct kvm_run *kvm_run) = { 485 struct kvm_run *kvm_run) = {
481 [EXIT_REASON_VM_PANIC] = handle_vm_error, 486 [EXIT_REASON_VM_PANIC] = handle_vm_error,
@@ -487,6 +492,7 @@ static int (*kvm_vti_exit_handlers[])(struct kvm_vcpu *vcpu,
487 [EXIT_REASON_EXTERNAL_INTERRUPT] = handle_external_interrupt, 492 [EXIT_REASON_EXTERNAL_INTERRUPT] = handle_external_interrupt,
488 [EXIT_REASON_IPI] = handle_ipi, 493 [EXIT_REASON_IPI] = handle_ipi,
489 [EXIT_REASON_PTC_G] = handle_global_purge, 494 [EXIT_REASON_PTC_G] = handle_global_purge,
495 [EXIT_REASON_DEBUG] = handle_vcpu_debug,
490 496
491}; 497};
492 498
@@ -698,27 +704,24 @@ out:
698 return r; 704 return r;
699} 705}
700 706
701/*
702 * Allocate 16M memory for every vm to hold its specific data.
703 * Its memory map is defined in kvm_host.h.
704 */
705static struct kvm *kvm_alloc_kvm(void) 707static struct kvm *kvm_alloc_kvm(void)
706{ 708{
707 709
708 struct kvm *kvm; 710 struct kvm *kvm;
709 uint64_t vm_base; 711 uint64_t vm_base;
710 712
713 BUG_ON(sizeof(struct kvm) > KVM_VM_STRUCT_SIZE);
714
711 vm_base = __get_free_pages(GFP_KERNEL, get_order(KVM_VM_DATA_SIZE)); 715 vm_base = __get_free_pages(GFP_KERNEL, get_order(KVM_VM_DATA_SIZE));
712 716
713 if (!vm_base) 717 if (!vm_base)
714 return ERR_PTR(-ENOMEM); 718 return ERR_PTR(-ENOMEM);
715 printk(KERN_DEBUG"kvm: VM data's base Address:0x%lx\n", vm_base);
716 719
717 /* Zero all pages before use! */
718 memset((void *)vm_base, 0, KVM_VM_DATA_SIZE); 720 memset((void *)vm_base, 0, KVM_VM_DATA_SIZE);
719 721 kvm = (struct kvm *)(vm_base +
720 kvm = (struct kvm *)(vm_base + KVM_VM_OFS); 722 offsetof(struct kvm_vm_data, kvm_vm_struct));
721 kvm->arch.vm_base = vm_base; 723 kvm->arch.vm_base = vm_base;
724 printk(KERN_DEBUG"kvm: vm's data area:0x%lx\n", vm_base);
722 725
723 return kvm; 726 return kvm;
724} 727}
@@ -760,21 +763,12 @@ static void kvm_build_io_pmt(struct kvm *kvm)
760 763
761static void kvm_init_vm(struct kvm *kvm) 764static void kvm_init_vm(struct kvm *kvm)
762{ 765{
763 long vm_base;
764
765 BUG_ON(!kvm); 766 BUG_ON(!kvm);
766 767
767 kvm->arch.metaphysical_rr0 = GUEST_PHYSICAL_RR0; 768 kvm->arch.metaphysical_rr0 = GUEST_PHYSICAL_RR0;
768 kvm->arch.metaphysical_rr4 = GUEST_PHYSICAL_RR4; 769 kvm->arch.metaphysical_rr4 = GUEST_PHYSICAL_RR4;
769 kvm->arch.vmm_init_rr = VMM_INIT_RR; 770 kvm->arch.vmm_init_rr = VMM_INIT_RR;
770 771
771 vm_base = kvm->arch.vm_base;
772 if (vm_base) {
773 kvm->arch.vhpt_base = vm_base + KVM_VHPT_OFS;
774 kvm->arch.vtlb_base = vm_base + KVM_VTLB_OFS;
775 kvm->arch.vpd_base = vm_base + KVM_VPD_OFS;
776 }
777
778 /* 772 /*
779 *Fill P2M entries for MMIO/IO ranges 773 *Fill P2M entries for MMIO/IO ranges
780 */ 774 */
@@ -838,9 +832,8 @@ static int kvm_vm_ioctl_set_irqchip(struct kvm *kvm, struct kvm_irqchip *chip)
838 832
839int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) 833int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
840{ 834{
841 int i;
842 struct vpd *vpd = to_host(vcpu->kvm, vcpu->arch.vpd); 835 struct vpd *vpd = to_host(vcpu->kvm, vcpu->arch.vpd);
843 int r; 836 int i;
844 837
845 vcpu_load(vcpu); 838 vcpu_load(vcpu);
846 839
@@ -857,18 +850,7 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
857 850
858 vpd->vpr = regs->vpd.vpr; 851 vpd->vpr = regs->vpd.vpr;
859 852
860 r = -EFAULT; 853 memcpy(&vcpu->arch.guest, &regs->saved_guest, sizeof(union context));
861 r = copy_from_user(&vcpu->arch.guest, regs->saved_guest,
862 sizeof(union context));
863 if (r)
864 goto out;
865 r = copy_from_user(vcpu + 1, regs->saved_stack +
866 sizeof(struct kvm_vcpu),
867 IA64_STK_OFFSET - sizeof(struct kvm_vcpu));
868 if (r)
869 goto out;
870 vcpu->arch.exit_data =
871 ((struct kvm_vcpu *)(regs->saved_stack))->arch.exit_data;
872 854
873 RESTORE_REGS(mp_state); 855 RESTORE_REGS(mp_state);
874 RESTORE_REGS(vmm_rr); 856 RESTORE_REGS(vmm_rr);
@@ -902,9 +884,8 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
902 set_bit(KVM_REQ_RESUME, &vcpu->requests); 884 set_bit(KVM_REQ_RESUME, &vcpu->requests);
903 885
904 vcpu_put(vcpu); 886 vcpu_put(vcpu);
905 r = 0; 887
906out: 888 return 0;
907 return r;
908} 889}
909 890
910long kvm_arch_vm_ioctl(struct file *filp, 891long kvm_arch_vm_ioctl(struct file *filp,
@@ -1166,10 +1147,11 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
1166 /*Set entry address for first run.*/ 1147 /*Set entry address for first run.*/
1167 regs->cr_iip = PALE_RESET_ENTRY; 1148 regs->cr_iip = PALE_RESET_ENTRY;
1168 1149
1169 /*Initilize itc offset for vcpus*/ 1150 /*Initialize itc offset for vcpus*/
1170 itc_offset = 0UL - ia64_getreg(_IA64_REG_AR_ITC); 1151 itc_offset = 0UL - ia64_getreg(_IA64_REG_AR_ITC);
1171 for (i = 0; i < MAX_VCPU_NUM; i++) { 1152 for (i = 0; i < KVM_MAX_VCPUS; i++) {
1172 v = (struct kvm_vcpu *)((char *)vcpu + VCPU_SIZE * i); 1153 v = (struct kvm_vcpu *)((char *)vcpu +
1154 sizeof(struct kvm_vcpu_data) * i);
1173 v->arch.itc_offset = itc_offset; 1155 v->arch.itc_offset = itc_offset;
1174 v->arch.last_itc = 0; 1156 v->arch.last_itc = 0;
1175 } 1157 }
@@ -1183,7 +1165,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
1183 vcpu->arch.apic->vcpu = vcpu; 1165 vcpu->arch.apic->vcpu = vcpu;
1184 1166
1185 p_ctx->gr[1] = 0; 1167 p_ctx->gr[1] = 0;
1186 p_ctx->gr[12] = (unsigned long)((char *)vmm_vcpu + IA64_STK_OFFSET); 1168 p_ctx->gr[12] = (unsigned long)((char *)vmm_vcpu + KVM_STK_OFFSET);
1187 p_ctx->gr[13] = (unsigned long)vmm_vcpu; 1169 p_ctx->gr[13] = (unsigned long)vmm_vcpu;
1188 p_ctx->psr = 0x1008522000UL; 1170 p_ctx->psr = 0x1008522000UL;
1189 p_ctx->ar[40] = FPSR_DEFAULT; /*fpsr*/ 1171 p_ctx->ar[40] = FPSR_DEFAULT; /*fpsr*/
@@ -1218,12 +1200,12 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
1218 vcpu->arch.hlt_timer.function = hlt_timer_fn; 1200 vcpu->arch.hlt_timer.function = hlt_timer_fn;
1219 1201
1220 vcpu->arch.last_run_cpu = -1; 1202 vcpu->arch.last_run_cpu = -1;
1221 vcpu->arch.vpd = (struct vpd *)VPD_ADDR(vcpu->vcpu_id); 1203 vcpu->arch.vpd = (struct vpd *)VPD_BASE(vcpu->vcpu_id);
1222 vcpu->arch.vsa_base = kvm_vsa_base; 1204 vcpu->arch.vsa_base = kvm_vsa_base;
1223 vcpu->arch.__gp = kvm_vmm_gp; 1205 vcpu->arch.__gp = kvm_vmm_gp;
1224 vcpu->arch.dirty_log_lock_pa = __pa(&kvm->arch.dirty_log_lock); 1206 vcpu->arch.dirty_log_lock_pa = __pa(&kvm->arch.dirty_log_lock);
1225 vcpu->arch.vhpt.hash = (struct thash_data *)VHPT_ADDR(vcpu->vcpu_id); 1207 vcpu->arch.vhpt.hash = (struct thash_data *)VHPT_BASE(vcpu->vcpu_id);
1226 vcpu->arch.vtlb.hash = (struct thash_data *)VTLB_ADDR(vcpu->vcpu_id); 1208 vcpu->arch.vtlb.hash = (struct thash_data *)VTLB_BASE(vcpu->vcpu_id);
1227 init_ptce_info(vcpu); 1209 init_ptce_info(vcpu);
1228 1210
1229 r = 0; 1211 r = 0;
@@ -1273,12 +1255,22 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
1273 int r; 1255 int r;
1274 int cpu; 1256 int cpu;
1275 1257
1258 BUG_ON(sizeof(struct kvm_vcpu) > VCPU_STRUCT_SIZE/2);
1259
1260 r = -EINVAL;
1261 if (id >= KVM_MAX_VCPUS) {
1262 printk(KERN_ERR"kvm: Can't configure vcpus > %ld",
1263 KVM_MAX_VCPUS);
1264 goto fail;
1265 }
1266
1276 r = -ENOMEM; 1267 r = -ENOMEM;
1277 if (!vm_base) { 1268 if (!vm_base) {
1278 printk(KERN_ERR"kvm: Create vcpu[%d] error!\n", id); 1269 printk(KERN_ERR"kvm: Create vcpu[%d] error!\n", id);
1279 goto fail; 1270 goto fail;
1280 } 1271 }
1281 vcpu = (struct kvm_vcpu *)(vm_base + KVM_VCPU_OFS + VCPU_SIZE * id); 1272 vcpu = (struct kvm_vcpu *)(vm_base + offsetof(struct kvm_vm_data,
1273 vcpu_data[id].vcpu_struct));
1282 vcpu->kvm = kvm; 1274 vcpu->kvm = kvm;
1283 1275
1284 cpu = get_cpu(); 1276 cpu = get_cpu();
@@ -1374,9 +1366,9 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
1374 1366
1375int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) 1367int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
1376{ 1368{
1377 int i;
1378 int r;
1379 struct vpd *vpd = to_host(vcpu->kvm, vcpu->arch.vpd); 1369 struct vpd *vpd = to_host(vcpu->kvm, vcpu->arch.vpd);
1370 int i;
1371
1380 vcpu_load(vcpu); 1372 vcpu_load(vcpu);
1381 1373
1382 for (i = 0; i < 16; i++) { 1374 for (i = 0; i < 16; i++) {
@@ -1391,14 +1383,8 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
1391 regs->vpd.vpsr = vpd->vpsr; 1383 regs->vpd.vpsr = vpd->vpsr;
1392 regs->vpd.vpr = vpd->vpr; 1384 regs->vpd.vpr = vpd->vpr;
1393 1385
1394 r = -EFAULT; 1386 memcpy(&regs->saved_guest, &vcpu->arch.guest, sizeof(union context));
1395 r = copy_to_user(regs->saved_guest, &vcpu->arch.guest, 1387
1396 sizeof(union context));
1397 if (r)
1398 goto out;
1399 r = copy_to_user(regs->saved_stack, (void *)vcpu, IA64_STK_OFFSET);
1400 if (r)
1401 goto out;
1402 SAVE_REGS(mp_state); 1388 SAVE_REGS(mp_state);
1403 SAVE_REGS(vmm_rr); 1389 SAVE_REGS(vmm_rr);
1404 memcpy(regs->itrs, vcpu->arch.itrs, sizeof(struct thash_data) * NITRS); 1390 memcpy(regs->itrs, vcpu->arch.itrs, sizeof(struct thash_data) * NITRS);
@@ -1426,10 +1412,9 @@ int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
1426 SAVE_REGS(metaphysical_saved_rr4); 1412 SAVE_REGS(metaphysical_saved_rr4);
1427 SAVE_REGS(fp_psr); 1413 SAVE_REGS(fp_psr);
1428 SAVE_REGS(saved_gp); 1414 SAVE_REGS(saved_gp);
1415
1429 vcpu_put(vcpu); 1416 vcpu_put(vcpu);
1430 r = 0; 1417 return 0;
1431out:
1432 return r;
1433} 1418}
1434 1419
1435void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) 1420void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
@@ -1457,6 +1442,9 @@ int kvm_arch_set_memory_region(struct kvm *kvm,
1457 struct kvm_memory_slot *memslot = &kvm->memslots[mem->slot]; 1442 struct kvm_memory_slot *memslot = &kvm->memslots[mem->slot];
1458 unsigned long base_gfn = memslot->base_gfn; 1443 unsigned long base_gfn = memslot->base_gfn;
1459 1444
1445 if (base_gfn + npages > (KVM_MAX_MEM_SIZE >> PAGE_SHIFT))
1446 return -ENOMEM;
1447
1460 for (i = 0; i < npages; i++) { 1448 for (i = 0; i < npages; i++) {
1461 pfn = gfn_to_pfn(kvm, base_gfn + i); 1449 pfn = gfn_to_pfn(kvm, base_gfn + i);
1462 if (!kvm_is_mmio_pfn(pfn)) { 1450 if (!kvm_is_mmio_pfn(pfn)) {
@@ -1631,8 +1619,8 @@ static int kvm_ia64_sync_dirty_log(struct kvm *kvm,
1631 struct kvm_memory_slot *memslot; 1619 struct kvm_memory_slot *memslot;
1632 int r, i; 1620 int r, i;
1633 long n, base; 1621 long n, base;
1634 unsigned long *dirty_bitmap = (unsigned long *)((void *)kvm - KVM_VM_OFS 1622 unsigned long *dirty_bitmap = (unsigned long *)(kvm->arch.vm_base +
1635 + KVM_MEM_DIRTY_LOG_OFS); 1623 offsetof(struct kvm_vm_data, kvm_mem_dirty_log));
1636 1624
1637 r = -EINVAL; 1625 r = -EINVAL;
1638 if (log->slot >= KVM_MEMORY_SLOTS) 1626 if (log->slot >= KVM_MEMORY_SLOTS)
diff --git a/arch/ia64/kvm/kvm_lib.c b/arch/ia64/kvm/kvm_lib.c
new file mode 100644
index 000000000000..a85cb611ecd7
--- /dev/null
+++ b/arch/ia64/kvm/kvm_lib.c
@@ -0,0 +1,15 @@
1/*
2 * kvm_lib.c: Compile some libraries for kvm-intel module.
3 *
4 * Just include kernel's library, and disable symbols export.
5 * Copyright (C) 2008, Intel Corporation.
6 * Xiantao Zhang (xiantao.zhang@intel.com)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13#undef CONFIG_MODULES
14#include "../../../lib/vsprintf.c"
15#include "../../../lib/ctype.c"
diff --git a/arch/ia64/kvm/kvm_minstate.h b/arch/ia64/kvm/kvm_minstate.h
index 2cc41d17cf99..b2bcaa2787aa 100644
--- a/arch/ia64/kvm/kvm_minstate.h
+++ b/arch/ia64/kvm/kvm_minstate.h
@@ -24,6 +24,8 @@
24#include <asm/asmmacro.h> 24#include <asm/asmmacro.h>
25#include <asm/types.h> 25#include <asm/types.h>
26#include <asm/kregs.h> 26#include <asm/kregs.h>
27#include <asm/kvm_host.h>
28
27#include "asm-offsets.h" 29#include "asm-offsets.h"
28 30
29#define KVM_MINSTATE_START_SAVE_MIN \ 31#define KVM_MINSTATE_START_SAVE_MIN \
@@ -33,7 +35,7 @@
33 addl r22 = VMM_RBS_OFFSET,r1; /* compute base of RBS */ \ 35 addl r22 = VMM_RBS_OFFSET,r1; /* compute base of RBS */ \
34 ;; \ 36 ;; \
35 lfetch.fault.excl.nt1 [r22]; \ 37 lfetch.fault.excl.nt1 [r22]; \
36 addl r1 = IA64_STK_OFFSET-VMM_PT_REGS_SIZE,r1; /* compute base of memory stack */ \ 38 addl r1 = KVM_STK_OFFSET-VMM_PT_REGS_SIZE, r1; \
37 mov r23 = ar.bspstore; /* save ar.bspstore */ \ 39 mov r23 = ar.bspstore; /* save ar.bspstore */ \
38 ;; \ 40 ;; \
39 mov ar.bspstore = r22; /* switch to kernel RBS */\ 41 mov ar.bspstore = r22; /* switch to kernel RBS */\
diff --git a/arch/ia64/kvm/misc.h b/arch/ia64/kvm/misc.h
index e585c4607344..dd979e00b574 100644
--- a/arch/ia64/kvm/misc.h
+++ b/arch/ia64/kvm/misc.h
@@ -27,7 +27,8 @@
27 */ 27 */
28static inline uint64_t *kvm_host_get_pmt(struct kvm *kvm) 28static inline uint64_t *kvm_host_get_pmt(struct kvm *kvm)
29{ 29{
30 return (uint64_t *)(kvm->arch.vm_base + KVM_P2M_OFS); 30 return (uint64_t *)(kvm->arch.vm_base +
31 offsetof(struct kvm_vm_data, kvm_p2m));
31} 32}
32 33
33static inline void kvm_set_pmt_entry(struct kvm *kvm, gfn_t gfn, 34static inline void kvm_set_pmt_entry(struct kvm *kvm, gfn_t gfn,
diff --git a/arch/ia64/kvm/mmio.c b/arch/ia64/kvm/mmio.c
index 7f1a858bc69f..21f63fffc379 100644
--- a/arch/ia64/kvm/mmio.c
+++ b/arch/ia64/kvm/mmio.c
@@ -66,31 +66,25 @@ void lsapic_write(struct kvm_vcpu *v, unsigned long addr,
66 66
67 switch (addr) { 67 switch (addr) {
68 case PIB_OFST_INTA: 68 case PIB_OFST_INTA:
69 /*panic_domain(NULL, "Undefined write on PIB INTA\n");*/ 69 panic_vm(v, "Undefined write on PIB INTA\n");
70 panic_vm(v);
71 break; 70 break;
72 case PIB_OFST_XTP: 71 case PIB_OFST_XTP:
73 if (length == 1) { 72 if (length == 1) {
74 vlsapic_write_xtp(v, val); 73 vlsapic_write_xtp(v, val);
75 } else { 74 } else {
76 /*panic_domain(NULL, 75 panic_vm(v, "Undefined write on PIB XTP\n");
77 "Undefined write on PIB XTP\n");*/
78 panic_vm(v);
79 } 76 }
80 break; 77 break;
81 default: 78 default:
82 if (PIB_LOW_HALF(addr)) { 79 if (PIB_LOW_HALF(addr)) {
83 /*lower half */ 80 /*Lower half */
84 if (length != 8) 81 if (length != 8)
85 /*panic_domain(NULL, 82 panic_vm(v, "Can't LHF write with size %ld!\n",
86 "Can't LHF write with size %ld!\n", 83 length);
87 length);*/
88 panic_vm(v);
89 else 84 else
90 vlsapic_write_ipi(v, addr, val); 85 vlsapic_write_ipi(v, addr, val);
91 } else { /* upper half 86 } else { /*Upper half */
92 printk("IPI-UHF write %lx\n",addr);*/ 87 panic_vm(v, "IPI-UHF write %lx\n", addr);
93 panic_vm(v);
94 } 88 }
95 break; 89 break;
96 } 90 }
@@ -108,22 +102,18 @@ unsigned long lsapic_read(struct kvm_vcpu *v, unsigned long addr,
108 if (length == 1) /* 1 byte load */ 102 if (length == 1) /* 1 byte load */
109 ; /* There is no i8259, there is no INTA access*/ 103 ; /* There is no i8259, there is no INTA access*/
110 else 104 else
111 /*panic_domain(NULL,"Undefined read on PIB INTA\n"); */ 105 panic_vm(v, "Undefined read on PIB INTA\n");
112 panic_vm(v);
113 106
114 break; 107 break;
115 case PIB_OFST_XTP: 108 case PIB_OFST_XTP:
116 if (length == 1) { 109 if (length == 1) {
117 result = VLSAPIC_XTP(v); 110 result = VLSAPIC_XTP(v);
118 /* printk("read xtp %lx\n", result); */
119 } else { 111 } else {
120 /*panic_domain(NULL, 112 panic_vm(v, "Undefined read on PIB XTP\n");
121 "Undefined read on PIB XTP\n");*/
122 panic_vm(v);
123 } 113 }
124 break; 114 break;
125 default: 115 default:
126 panic_vm(v); 116 panic_vm(v, "Undefined addr access for lsapic!\n");
127 break; 117 break;
128 } 118 }
129 return result; 119 return result;
@@ -162,7 +152,7 @@ static void mmio_access(struct kvm_vcpu *vcpu, u64 src_pa, u64 *dest,
162 /* it's necessary to ensure zero extending */ 152 /* it's necessary to ensure zero extending */
163 *dest = p->u.ioreq.data & (~0UL >> (64-(s*8))); 153 *dest = p->u.ioreq.data & (~0UL >> (64-(s*8)));
164 } else 154 } else
165 panic_vm(vcpu); 155 panic_vm(vcpu, "Unhandled mmio access returned!\n");
166out: 156out:
167 local_irq_restore(psr); 157 local_irq_restore(psr);
168 return ; 158 return ;
@@ -324,7 +314,9 @@ void emulate_io_inst(struct kvm_vcpu *vcpu, u64 padr, u64 ma)
324 return; 314 return;
325 } else { 315 } else {
326 inst_type = -1; 316 inst_type = -1;
327 panic_vm(vcpu); 317 panic_vm(vcpu, "Unsupported MMIO access instruction! \
318 Bunld[0]=0x%lx, Bundle[1]=0x%lx\n",
319 bundle.i64[0], bundle.i64[1]);
328 } 320 }
329 321
330 size = 1 << size; 322 size = 1 << size;
@@ -335,7 +327,7 @@ void emulate_io_inst(struct kvm_vcpu *vcpu, u64 padr, u64 ma)
335 if (inst_type == SL_INTEGER) 327 if (inst_type == SL_INTEGER)
336 vcpu_set_gr(vcpu, inst.M1.r1, data, 0); 328 vcpu_set_gr(vcpu, inst.M1.r1, data, 0);
337 else 329 else
338 panic_vm(vcpu); 330 panic_vm(vcpu, "Unsupported instruction type!\n");
339 331
340 } 332 }
341 vcpu_increment_iip(vcpu); 333 vcpu_increment_iip(vcpu);
diff --git a/arch/ia64/kvm/process.c b/arch/ia64/kvm/process.c
index 800817307b7b..552d07724207 100644
--- a/arch/ia64/kvm/process.c
+++ b/arch/ia64/kvm/process.c
@@ -527,7 +527,8 @@ void reflect_interruption(u64 ifa, u64 isr, u64 iim,
527 vector = vec2off[vec]; 527 vector = vec2off[vec];
528 528
529 if (!(vpsr & IA64_PSR_IC) && (vector != IA64_DATA_NESTED_TLB_VECTOR)) { 529 if (!(vpsr & IA64_PSR_IC) && (vector != IA64_DATA_NESTED_TLB_VECTOR)) {
530 panic_vm(vcpu); 530 panic_vm(vcpu, "Interruption with vector :0x%lx occurs "
531 "with psr.ic = 0\n", vector);
531 return; 532 return;
532 } 533 }
533 534
@@ -586,7 +587,7 @@ static void set_pal_call_result(struct kvm_vcpu *vcpu)
586 vcpu_set_gr(vcpu, 10, p->u.pal_data.ret.v1, 0); 587 vcpu_set_gr(vcpu, 10, p->u.pal_data.ret.v1, 0);
587 vcpu_set_gr(vcpu, 11, p->u.pal_data.ret.v2, 0); 588 vcpu_set_gr(vcpu, 11, p->u.pal_data.ret.v2, 0);
588 } else 589 } else
589 panic_vm(vcpu); 590 panic_vm(vcpu, "Mis-set for exit reason!\n");
590} 591}
591 592
592static void set_sal_call_data(struct kvm_vcpu *vcpu) 593static void set_sal_call_data(struct kvm_vcpu *vcpu)
@@ -614,7 +615,7 @@ static void set_sal_call_result(struct kvm_vcpu *vcpu)
614 vcpu_set_gr(vcpu, 10, p->u.sal_data.ret.r10, 0); 615 vcpu_set_gr(vcpu, 10, p->u.sal_data.ret.r10, 0);
615 vcpu_set_gr(vcpu, 11, p->u.sal_data.ret.r11, 0); 616 vcpu_set_gr(vcpu, 11, p->u.sal_data.ret.r11, 0);
616 } else 617 } else
617 panic_vm(vcpu); 618 panic_vm(vcpu, "Mis-set for exit reason!\n");
618} 619}
619 620
620void kvm_ia64_handle_break(unsigned long ifa, struct kvm_pt_regs *regs, 621void kvm_ia64_handle_break(unsigned long ifa, struct kvm_pt_regs *regs,
@@ -680,7 +681,7 @@ static void generate_exirq(struct kvm_vcpu *vcpu)
680 vpsr = VCPU(vcpu, vpsr); 681 vpsr = VCPU(vcpu, vpsr);
681 isr = vpsr & IA64_PSR_RI; 682 isr = vpsr & IA64_PSR_RI;
682 if (!(vpsr & IA64_PSR_IC)) 683 if (!(vpsr & IA64_PSR_IC))
683 panic_vm(vcpu); 684 panic_vm(vcpu, "Trying to inject one IRQ with psr.ic=0\n");
684 reflect_interruption(0, isr, 0, 12, regs); /* EXT IRQ */ 685 reflect_interruption(0, isr, 0, 12, regs); /* EXT IRQ */
685} 686}
686 687
@@ -941,8 +942,20 @@ static void vcpu_do_resume(struct kvm_vcpu *vcpu)
941 ia64_set_pta(vcpu->arch.vhpt.pta.val); 942 ia64_set_pta(vcpu->arch.vhpt.pta.val);
942} 943}
943 944
945static void vmm_sanity_check(struct kvm_vcpu *vcpu)
946{
947 struct exit_ctl_data *p = &vcpu->arch.exit_data;
948
949 if (!vmm_sanity && p->exit_reason != EXIT_REASON_DEBUG) {
950 panic_vm(vcpu, "Failed to do vmm sanity check,"
951 "it maybe caused by crashed vmm!!\n\n");
952 }
953}
954
944static void kvm_do_resume_op(struct kvm_vcpu *vcpu) 955static void kvm_do_resume_op(struct kvm_vcpu *vcpu)
945{ 956{
957 vmm_sanity_check(vcpu); /*Guarantee vcpu runing on healthy vmm!*/
958
946 if (test_and_clear_bit(KVM_REQ_RESUME, &vcpu->requests)) { 959 if (test_and_clear_bit(KVM_REQ_RESUME, &vcpu->requests)) {
947 vcpu_do_resume(vcpu); 960 vcpu_do_resume(vcpu);
948 return; 961 return;
@@ -968,3 +981,11 @@ void vmm_transition(struct kvm_vcpu *vcpu)
968 1, 0, 0, 0, 0, 0); 981 1, 0, 0, 0, 0, 0);
969 kvm_do_resume_op(vcpu); 982 kvm_do_resume_op(vcpu);
970} 983}
984
985void vmm_panic_handler(u64 vec)
986{
987 struct kvm_vcpu *vcpu = current_vcpu;
988 vmm_sanity = 0;
989 panic_vm(vcpu, "Unexpected interruption occurs in VMM, vector:0x%lx\n",
990 vec2off[vec]);
991}
diff --git a/arch/ia64/kvm/vcpu.c b/arch/ia64/kvm/vcpu.c
index e44027ce5667..ecd526b55323 100644
--- a/arch/ia64/kvm/vcpu.c
+++ b/arch/ia64/kvm/vcpu.c
@@ -816,8 +816,9 @@ static void vcpu_set_itc(struct kvm_vcpu *vcpu, u64 val)
816 unsigned long vitv = VCPU(vcpu, itv); 816 unsigned long vitv = VCPU(vcpu, itv);
817 817
818 if (vcpu->vcpu_id == 0) { 818 if (vcpu->vcpu_id == 0) {
819 for (i = 0; i < MAX_VCPU_NUM; i++) { 819 for (i = 0; i < KVM_MAX_VCPUS; i++) {
820 v = (struct kvm_vcpu *)((char *)vcpu + VCPU_SIZE * i); 820 v = (struct kvm_vcpu *)((char *)vcpu +
821 sizeof(struct kvm_vcpu_data) * i);
821 VMX(v, itc_offset) = itc_offset; 822 VMX(v, itc_offset) = itc_offset;
822 VMX(v, last_itc) = 0; 823 VMX(v, last_itc) = 0;
823 } 824 }
@@ -1650,7 +1651,8 @@ void vcpu_set_psr(struct kvm_vcpu *vcpu, unsigned long val)
1650 * Otherwise panic 1651 * Otherwise panic
1651 */ 1652 */
1652 if (val & (IA64_PSR_PK | IA64_PSR_IS | IA64_PSR_VM)) 1653 if (val & (IA64_PSR_PK | IA64_PSR_IS | IA64_PSR_VM))
1653 panic_vm(vcpu); 1654 panic_vm(vcpu, "Only support guests with vpsr.pk =0 \
1655 & vpsr.is=0\n");
1654 1656
1655 /* 1657 /*
1656 * For those IA64_PSR bits: id/da/dd/ss/ed/ia 1658 * For those IA64_PSR bits: id/da/dd/ss/ed/ia
@@ -2103,7 +2105,7 @@ void kvm_init_all_rr(struct kvm_vcpu *vcpu)
2103 2105
2104 if (is_physical_mode(vcpu)) { 2106 if (is_physical_mode(vcpu)) {
2105 if (vcpu->arch.mode_flags & GUEST_PHY_EMUL) 2107 if (vcpu->arch.mode_flags & GUEST_PHY_EMUL)
2106 panic_vm(vcpu); 2108 panic_vm(vcpu, "Machine Status conflicts!\n");
2107 2109
2108 ia64_set_rr((VRN0 << VRN_SHIFT), vcpu->arch.metaphysical_rr0); 2110 ia64_set_rr((VRN0 << VRN_SHIFT), vcpu->arch.metaphysical_rr0);
2109 ia64_dv_serialize_data(); 2111 ia64_dv_serialize_data();
@@ -2152,10 +2154,70 @@ int vmm_entry(void)
2152 return 0; 2154 return 0;
2153} 2155}
2154 2156
2155void panic_vm(struct kvm_vcpu *v) 2157static void kvm_show_registers(struct kvm_pt_regs *regs)
2156{ 2158{
2159 unsigned long ip = regs->cr_iip + ia64_psr(regs)->ri;
2160
2161 struct kvm_vcpu *vcpu = current_vcpu;
2162 if (vcpu != NULL)
2163 printk("vcpu 0x%p vcpu %d\n",
2164 vcpu, vcpu->vcpu_id);
2165
2166 printk("psr : %016lx ifs : %016lx ip : [<%016lx>]\n",
2167 regs->cr_ipsr, regs->cr_ifs, ip);
2168
2169 printk("unat: %016lx pfs : %016lx rsc : %016lx\n",
2170 regs->ar_unat, regs->ar_pfs, regs->ar_rsc);
2171 printk("rnat: %016lx bspstore: %016lx pr : %016lx\n",
2172 regs->ar_rnat, regs->ar_bspstore, regs->pr);
2173 printk("ldrs: %016lx ccv : %016lx fpsr: %016lx\n",
2174 regs->loadrs, regs->ar_ccv, regs->ar_fpsr);
2175 printk("csd : %016lx ssd : %016lx\n", regs->ar_csd, regs->ar_ssd);
2176 printk("b0 : %016lx b6 : %016lx b7 : %016lx\n", regs->b0,
2177 regs->b6, regs->b7);
2178 printk("f6 : %05lx%016lx f7 : %05lx%016lx\n",
2179 regs->f6.u.bits[1], regs->f6.u.bits[0],
2180 regs->f7.u.bits[1], regs->f7.u.bits[0]);
2181 printk("f8 : %05lx%016lx f9 : %05lx%016lx\n",
2182 regs->f8.u.bits[1], regs->f8.u.bits[0],
2183 regs->f9.u.bits[1], regs->f9.u.bits[0]);
2184 printk("f10 : %05lx%016lx f11 : %05lx%016lx\n",
2185 regs->f10.u.bits[1], regs->f10.u.bits[0],
2186 regs->f11.u.bits[1], regs->f11.u.bits[0]);
2187
2188 printk("r1 : %016lx r2 : %016lx r3 : %016lx\n", regs->r1,
2189 regs->r2, regs->r3);
2190 printk("r8 : %016lx r9 : %016lx r10 : %016lx\n", regs->r8,
2191 regs->r9, regs->r10);
2192 printk("r11 : %016lx r12 : %016lx r13 : %016lx\n", regs->r11,
2193 regs->r12, regs->r13);
2194 printk("r14 : %016lx r15 : %016lx r16 : %016lx\n", regs->r14,
2195 regs->r15, regs->r16);
2196 printk("r17 : %016lx r18 : %016lx r19 : %016lx\n", regs->r17,
2197 regs->r18, regs->r19);
2198 printk("r20 : %016lx r21 : %016lx r22 : %016lx\n", regs->r20,
2199 regs->r21, regs->r22);
2200 printk("r23 : %016lx r24 : %016lx r25 : %016lx\n", regs->r23,
2201 regs->r24, regs->r25);
2202 printk("r26 : %016lx r27 : %016lx r28 : %016lx\n", regs->r26,
2203 regs->r27, regs->r28);
2204 printk("r29 : %016lx r30 : %016lx r31 : %016lx\n", regs->r29,
2205 regs->r30, regs->r31);
2206
2207}
2208
2209void panic_vm(struct kvm_vcpu *v, const char *fmt, ...)
2210{
2211 va_list args;
2212 char buf[256];
2213
2214 struct kvm_pt_regs *regs = vcpu_regs(v);
2157 struct exit_ctl_data *p = &v->arch.exit_data; 2215 struct exit_ctl_data *p = &v->arch.exit_data;
2158 2216 va_start(args, fmt);
2217 vsnprintf(buf, sizeof(buf), fmt, args);
2218 va_end(args);
2219 printk(buf);
2220 kvm_show_registers(regs);
2159 p->exit_reason = EXIT_REASON_VM_PANIC; 2221 p->exit_reason = EXIT_REASON_VM_PANIC;
2160 vmm_transition(v); 2222 vmm_transition(v);
2161 /*Never to return*/ 2223 /*Never to return*/
diff --git a/arch/ia64/kvm/vcpu.h b/arch/ia64/kvm/vcpu.h
index e9b2a4e121c0..b2f12a562bdf 100644
--- a/arch/ia64/kvm/vcpu.h
+++ b/arch/ia64/kvm/vcpu.h
@@ -737,9 +737,12 @@ void kvm_init_vtlb(struct kvm_vcpu *v);
737void kvm_init_vhpt(struct kvm_vcpu *v); 737void kvm_init_vhpt(struct kvm_vcpu *v);
738void thash_init(struct thash_cb *hcb, u64 sz); 738void thash_init(struct thash_cb *hcb, u64 sz);
739 739
740void panic_vm(struct kvm_vcpu *v); 740void panic_vm(struct kvm_vcpu *v, const char *fmt, ...);
741 741
742extern u64 ia64_call_vsa(u64 proc, u64 arg1, u64 arg2, u64 arg3, 742extern u64 ia64_call_vsa(u64 proc, u64 arg1, u64 arg2, u64 arg3,
743 u64 arg4, u64 arg5, u64 arg6, u64 arg7); 743 u64 arg4, u64 arg5, u64 arg6, u64 arg7);
744
745extern long vmm_sanity;
746
744#endif 747#endif
745#endif /* __VCPU_H__ */ 748#endif /* __VCPU_H__ */
diff --git a/arch/ia64/kvm/vmm.c b/arch/ia64/kvm/vmm.c
index 2275bf4e681a..9eee5c04bacc 100644
--- a/arch/ia64/kvm/vmm.c
+++ b/arch/ia64/kvm/vmm.c
@@ -20,6 +20,7 @@
20 */ 20 */
21 21
22 22
23#include<linux/kernel.h>
23#include<linux/module.h> 24#include<linux/module.h>
24#include<asm/fpswa.h> 25#include<asm/fpswa.h>
25 26
@@ -31,6 +32,8 @@ MODULE_LICENSE("GPL");
31extern char kvm_ia64_ivt; 32extern char kvm_ia64_ivt;
32extern fpswa_interface_t *vmm_fpswa_interface; 33extern fpswa_interface_t *vmm_fpswa_interface;
33 34
35long vmm_sanity = 1;
36
34struct kvm_vmm_info vmm_info = { 37struct kvm_vmm_info vmm_info = {
35 .module = THIS_MODULE, 38 .module = THIS_MODULE,
36 .vmm_entry = vmm_entry, 39 .vmm_entry = vmm_entry,
@@ -62,5 +65,31 @@ void vmm_spin_unlock(spinlock_t *lock)
62{ 65{
63 _vmm_raw_spin_unlock(lock); 66 _vmm_raw_spin_unlock(lock);
64} 67}
68
69static void vcpu_debug_exit(struct kvm_vcpu *vcpu)
70{
71 struct exit_ctl_data *p = &vcpu->arch.exit_data;
72 long psr;
73
74 local_irq_save(psr);
75 p->exit_reason = EXIT_REASON_DEBUG;
76 vmm_transition(vcpu);
77 local_irq_restore(psr);
78}
79
80asmlinkage int printk(const char *fmt, ...)
81{
82 struct kvm_vcpu *vcpu = current_vcpu;
83 va_list args;
84 int r;
85
86 memset(vcpu->arch.log_buf, 0, VMM_LOG_LEN);
87 va_start(args, fmt);
88 r = vsnprintf(vcpu->arch.log_buf, VMM_LOG_LEN, fmt, args);
89 va_end(args);
90 vcpu_debug_exit(vcpu);
91 return r;
92}
93
65module_init(kvm_vmm_init) 94module_init(kvm_vmm_init)
66module_exit(kvm_vmm_exit) 95module_exit(kvm_vmm_exit)
diff --git a/arch/ia64/kvm/vmm_ivt.S b/arch/ia64/kvm/vmm_ivt.S
index c1d7251a1480..3ef1a017a318 100644
--- a/arch/ia64/kvm/vmm_ivt.S
+++ b/arch/ia64/kvm/vmm_ivt.S
@@ -1,5 +1,5 @@
1/* 1/*
2 * /ia64/kvm_ivt.S 2 * arch/ia64/kvm/vmm_ivt.S
3 * 3 *
4 * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co 4 * Copyright (C) 1998-2001, 2003 Hewlett-Packard Co
5 * Stephane Eranian <eranian@hpl.hp.com> 5 * Stephane Eranian <eranian@hpl.hp.com>
@@ -70,32 +70,39 @@
70# define PSR_DEFAULT_BITS 0 70# define PSR_DEFAULT_BITS 0
71#endif 71#endif
72 72
73
74#define KVM_FAULT(n) \ 73#define KVM_FAULT(n) \
75 kvm_fault_##n:; \ 74 kvm_fault_##n:; \
76 mov r19=n;; \ 75 mov r19=n;; \
77 br.sptk.many kvm_fault_##n; \ 76 br.sptk.many kvm_vmm_panic; \
78 ;; \ 77 ;; \
79
80 78
81#define KVM_REFLECT(n) \ 79#define KVM_REFLECT(n) \
82 mov r31=pr; \ 80 mov r31=pr; \
83 mov r19=n; /* prepare to save predicates */ \ 81 mov r19=n; /* prepare to save predicates */ \
84 mov r29=cr.ipsr; \ 82 mov r29=cr.ipsr; \
85 ;; \ 83 ;; \
86 tbit.z p6,p7=r29,IA64_PSR_VM_BIT; \ 84 tbit.z p6,p7=r29,IA64_PSR_VM_BIT; \
87(p7)br.sptk.many kvm_dispatch_reflection; \ 85(p7) br.sptk.many kvm_dispatch_reflection; \
88 br.sptk.many kvm_panic; \ 86 br.sptk.many kvm_vmm_panic; \
89 87
90 88GLOBAL_ENTRY(kvm_vmm_panic)
91GLOBAL_ENTRY(kvm_panic) 89 KVM_SAVE_MIN_WITH_COVER_R19
92 br.sptk.many kvm_panic 90 alloc r14=ar.pfs,0,0,1,0
93 ;; 91 mov out0=r15
94END(kvm_panic) 92 adds r3=8,r2 // set up second base pointer
95 93 ;;
96 94 ssm psr.ic
97 95 ;;
98 96 srlz.i // guarantee that interruption collection is on
97 ;;
98 //(p15) ssm psr.i // restore psr.i
99 addl r14=@gprel(ia64_leave_hypervisor),gp
100 ;;
101 KVM_SAVE_REST
102 mov rp=r14
103 ;;
104 br.call.sptk.many b6=vmm_panic_handler;
105END(kvm_vmm_panic)
99 106
100 .section .text.ivt,"ax" 107 .section .text.ivt,"ax"
101 108
@@ -105,308 +112,307 @@ kvm_ia64_ivt:
105/////////////////////////////////////////////////////////////// 112///////////////////////////////////////////////////////////////
106// 0x0000 Entry 0 (size 64 bundles) VHPT Translation (8,20,47) 113// 0x0000 Entry 0 (size 64 bundles) VHPT Translation (8,20,47)
107ENTRY(kvm_vhpt_miss) 114ENTRY(kvm_vhpt_miss)
108 KVM_FAULT(0) 115 KVM_FAULT(0)
109END(kvm_vhpt_miss) 116END(kvm_vhpt_miss)
110 117
111
112 .org kvm_ia64_ivt+0x400 118 .org kvm_ia64_ivt+0x400
113//////////////////////////////////////////////////////////////// 119////////////////////////////////////////////////////////////////
114// 0x0400 Entry 1 (size 64 bundles) ITLB (21) 120// 0x0400 Entry 1 (size 64 bundles) ITLB (21)
115ENTRY(kvm_itlb_miss) 121ENTRY(kvm_itlb_miss)
116 mov r31 = pr 122 mov r31 = pr
117 mov r29=cr.ipsr; 123 mov r29=cr.ipsr;
118 ;; 124 ;;
119 tbit.z p6,p7=r29,IA64_PSR_VM_BIT; 125 tbit.z p6,p7=r29,IA64_PSR_VM_BIT;
120 (p6) br.sptk kvm_alt_itlb_miss 126(p6) br.sptk kvm_alt_itlb_miss
121 mov r19 = 1 127 mov r19 = 1
122 br.sptk kvm_itlb_miss_dispatch 128 br.sptk kvm_itlb_miss_dispatch
123 KVM_FAULT(1); 129 KVM_FAULT(1);
124END(kvm_itlb_miss) 130END(kvm_itlb_miss)
125 131
126 .org kvm_ia64_ivt+0x0800 132 .org kvm_ia64_ivt+0x0800
127////////////////////////////////////////////////////////////////// 133//////////////////////////////////////////////////////////////////
128// 0x0800 Entry 2 (size 64 bundles) DTLB (9,48) 134// 0x0800 Entry 2 (size 64 bundles) DTLB (9,48)
129ENTRY(kvm_dtlb_miss) 135ENTRY(kvm_dtlb_miss)
130 mov r31 = pr 136 mov r31 = pr
131 mov r29=cr.ipsr; 137 mov r29=cr.ipsr;
132 ;; 138 ;;
133 tbit.z p6,p7=r29,IA64_PSR_VM_BIT; 139 tbit.z p6,p7=r29,IA64_PSR_VM_BIT;
134(p6)br.sptk kvm_alt_dtlb_miss 140(p6) br.sptk kvm_alt_dtlb_miss
135 br.sptk kvm_dtlb_miss_dispatch 141 br.sptk kvm_dtlb_miss_dispatch
136END(kvm_dtlb_miss) 142END(kvm_dtlb_miss)
137 143
138 .org kvm_ia64_ivt+0x0c00 144 .org kvm_ia64_ivt+0x0c00
139//////////////////////////////////////////////////////////////////// 145////////////////////////////////////////////////////////////////////
140// 0x0c00 Entry 3 (size 64 bundles) Alt ITLB (19) 146// 0x0c00 Entry 3 (size 64 bundles) Alt ITLB (19)
141ENTRY(kvm_alt_itlb_miss) 147ENTRY(kvm_alt_itlb_miss)
142 mov r16=cr.ifa // get address that caused the TLB miss 148 mov r16=cr.ifa // get address that caused the TLB miss
143 ;; 149 ;;
144 movl r17=PAGE_KERNEL 150 movl r17=PAGE_KERNEL
145 mov r24=cr.ipsr 151 mov r24=cr.ipsr
146 movl r19=(((1 << IA64_MAX_PHYS_BITS) - 1) & ~0xfff) 152 movl r19=(((1 << IA64_MAX_PHYS_BITS) - 1) & ~0xfff)
147 ;; 153 ;;
148 and r19=r19,r16 // clear ed, reserved bits, and PTE control bits 154 and r19=r19,r16 // clear ed, reserved bits, and PTE control bits
149 ;; 155 ;;
150 or r19=r17,r19 // insert PTE control bits into r19 156 or r19=r17,r19 // insert PTE control bits into r19
151 ;; 157 ;;
152 movl r20=IA64_GRANULE_SHIFT<<2 158 movl r20=IA64_GRANULE_SHIFT<<2
153 ;; 159 ;;
154 mov cr.itir=r20 160 mov cr.itir=r20
155 ;; 161 ;;
156 itc.i r19 // insert the TLB entry 162 itc.i r19 // insert the TLB entry
157 mov pr=r31,-1 163 mov pr=r31,-1
158 rfi 164 rfi
159END(kvm_alt_itlb_miss) 165END(kvm_alt_itlb_miss)
160 166
161 .org kvm_ia64_ivt+0x1000 167 .org kvm_ia64_ivt+0x1000
162///////////////////////////////////////////////////////////////////// 168/////////////////////////////////////////////////////////////////////
163// 0x1000 Entry 4 (size 64 bundles) Alt DTLB (7,46) 169// 0x1000 Entry 4 (size 64 bundles) Alt DTLB (7,46)
164ENTRY(kvm_alt_dtlb_miss) 170ENTRY(kvm_alt_dtlb_miss)
165 mov r16=cr.ifa // get address that caused the TLB miss 171 mov r16=cr.ifa // get address that caused the TLB miss
166 ;; 172 ;;
167 movl r17=PAGE_KERNEL 173 movl r17=PAGE_KERNEL
168 movl r19=(((1 << IA64_MAX_PHYS_BITS) - 1) & ~0xfff) 174 movl r19=(((1 << IA64_MAX_PHYS_BITS) - 1) & ~0xfff)
169 mov r24=cr.ipsr 175 mov r24=cr.ipsr
170 ;; 176 ;;
171 and r19=r19,r16 // clear ed, reserved bits, and PTE control bits 177 and r19=r19,r16 // clear ed, reserved bits, and PTE control bits
172 ;; 178 ;;
173 or r19=r19,r17 // insert PTE control bits into r19 179 or r19=r19,r17 // insert PTE control bits into r19
174 ;; 180 ;;
175 movl r20=IA64_GRANULE_SHIFT<<2 181 movl r20=IA64_GRANULE_SHIFT<<2
176 ;; 182 ;;
177 mov cr.itir=r20 183 mov cr.itir=r20
178 ;; 184 ;;
179 itc.d r19 // insert the TLB entry 185 itc.d r19 // insert the TLB entry
180 mov pr=r31,-1 186 mov pr=r31,-1
181 rfi 187 rfi
182END(kvm_alt_dtlb_miss) 188END(kvm_alt_dtlb_miss)
183 189
184 .org kvm_ia64_ivt+0x1400 190 .org kvm_ia64_ivt+0x1400
185////////////////////////////////////////////////////////////////////// 191//////////////////////////////////////////////////////////////////////
186// 0x1400 Entry 5 (size 64 bundles) Data nested TLB (6,45) 192// 0x1400 Entry 5 (size 64 bundles) Data nested TLB (6,45)
187ENTRY(kvm_nested_dtlb_miss) 193ENTRY(kvm_nested_dtlb_miss)
188 KVM_FAULT(5) 194 KVM_FAULT(5)
189END(kvm_nested_dtlb_miss) 195END(kvm_nested_dtlb_miss)
190 196
191 .org kvm_ia64_ivt+0x1800 197 .org kvm_ia64_ivt+0x1800
192///////////////////////////////////////////////////////////////////// 198/////////////////////////////////////////////////////////////////////
193// 0x1800 Entry 6 (size 64 bundles) Instruction Key Miss (24) 199// 0x1800 Entry 6 (size 64 bundles) Instruction Key Miss (24)
194ENTRY(kvm_ikey_miss) 200ENTRY(kvm_ikey_miss)
195 KVM_REFLECT(6) 201 KVM_REFLECT(6)
196END(kvm_ikey_miss) 202END(kvm_ikey_miss)
197 203
198 .org kvm_ia64_ivt+0x1c00 204 .org kvm_ia64_ivt+0x1c00
199///////////////////////////////////////////////////////////////////// 205/////////////////////////////////////////////////////////////////////
200// 0x1c00 Entry 7 (size 64 bundles) Data Key Miss (12,51) 206// 0x1c00 Entry 7 (size 64 bundles) Data Key Miss (12,51)
201ENTRY(kvm_dkey_miss) 207ENTRY(kvm_dkey_miss)
202 KVM_REFLECT(7) 208 KVM_REFLECT(7)
203END(kvm_dkey_miss) 209END(kvm_dkey_miss)
204 210
205 .org kvm_ia64_ivt+0x2000 211 .org kvm_ia64_ivt+0x2000
206//////////////////////////////////////////////////////////////////// 212////////////////////////////////////////////////////////////////////
207// 0x2000 Entry 8 (size 64 bundles) Dirty-bit (54) 213// 0x2000 Entry 8 (size 64 bundles) Dirty-bit (54)
208ENTRY(kvm_dirty_bit) 214ENTRY(kvm_dirty_bit)
209 KVM_REFLECT(8) 215 KVM_REFLECT(8)
210END(kvm_dirty_bit) 216END(kvm_dirty_bit)
211 217
212 .org kvm_ia64_ivt+0x2400 218 .org kvm_ia64_ivt+0x2400
213//////////////////////////////////////////////////////////////////// 219////////////////////////////////////////////////////////////////////
214// 0x2400 Entry 9 (size 64 bundles) Instruction Access-bit (27) 220// 0x2400 Entry 9 (size 64 bundles) Instruction Access-bit (27)
215ENTRY(kvm_iaccess_bit) 221ENTRY(kvm_iaccess_bit)
216 KVM_REFLECT(9) 222 KVM_REFLECT(9)
217END(kvm_iaccess_bit) 223END(kvm_iaccess_bit)
218 224
219 .org kvm_ia64_ivt+0x2800 225 .org kvm_ia64_ivt+0x2800
220/////////////////////////////////////////////////////////////////// 226///////////////////////////////////////////////////////////////////
221// 0x2800 Entry 10 (size 64 bundles) Data Access-bit (15,55) 227// 0x2800 Entry 10 (size 64 bundles) Data Access-bit (15,55)
222ENTRY(kvm_daccess_bit) 228ENTRY(kvm_daccess_bit)
223 KVM_REFLECT(10) 229 KVM_REFLECT(10)
224END(kvm_daccess_bit) 230END(kvm_daccess_bit)
225 231
226 .org kvm_ia64_ivt+0x2c00 232 .org kvm_ia64_ivt+0x2c00
227///////////////////////////////////////////////////////////////// 233/////////////////////////////////////////////////////////////////
228// 0x2c00 Entry 11 (size 64 bundles) Break instruction (33) 234// 0x2c00 Entry 11 (size 64 bundles) Break instruction (33)
229ENTRY(kvm_break_fault) 235ENTRY(kvm_break_fault)
230 mov r31=pr 236 mov r31=pr
231 mov r19=11 237 mov r19=11
232 mov r29=cr.ipsr 238 mov r29=cr.ipsr
233 ;; 239 ;;
234 KVM_SAVE_MIN_WITH_COVER_R19 240 KVM_SAVE_MIN_WITH_COVER_R19
235 ;; 241 ;;
236 alloc r14=ar.pfs,0,0,4,0 // now it's safe (must be first in insn group!) 242 alloc r14=ar.pfs,0,0,4,0 //(must be first in insn group!)
237 mov out0=cr.ifa 243 mov out0=cr.ifa
238 mov out2=cr.isr // FIXME: pity to make this slow access twice 244 mov out2=cr.isr // FIXME: pity to make this slow access twice
239 mov out3=cr.iim // FIXME: pity to make this slow access twice 245 mov out3=cr.iim // FIXME: pity to make this slow access twice
240 adds r3=8,r2 // set up second base pointer 246 adds r3=8,r2 // set up second base pointer
241 ;; 247 ;;
242 ssm psr.ic 248 ssm psr.ic
243 ;; 249 ;;
244 srlz.i // guarantee that interruption collection is on 250 srlz.i // guarantee that interruption collection is on
245 ;; 251 ;;
246 //(p15)ssm psr.i // restore psr.i 252 //(p15)ssm psr.i // restore psr.i
247 addl r14=@gprel(ia64_leave_hypervisor),gp 253 addl r14=@gprel(ia64_leave_hypervisor),gp
248 ;; 254 ;;
249 KVM_SAVE_REST 255 KVM_SAVE_REST
250 mov rp=r14 256 mov rp=r14
251 ;; 257 ;;
252 adds out1=16,sp 258 adds out1=16,sp
253 br.call.sptk.many b6=kvm_ia64_handle_break 259 br.call.sptk.many b6=kvm_ia64_handle_break
254 ;; 260 ;;
255END(kvm_break_fault) 261END(kvm_break_fault)
256 262
257 .org kvm_ia64_ivt+0x3000 263 .org kvm_ia64_ivt+0x3000
258///////////////////////////////////////////////////////////////// 264/////////////////////////////////////////////////////////////////
259// 0x3000 Entry 12 (size 64 bundles) External Interrupt (4) 265// 0x3000 Entry 12 (size 64 bundles) External Interrupt (4)
260ENTRY(kvm_interrupt) 266ENTRY(kvm_interrupt)
261 mov r31=pr // prepare to save predicates 267 mov r31=pr // prepare to save predicates
262 mov r19=12 268 mov r19=12
263 mov r29=cr.ipsr 269 mov r29=cr.ipsr
264 ;; 270 ;;
265 tbit.z p6,p7=r29,IA64_PSR_VM_BIT 271 tbit.z p6,p7=r29,IA64_PSR_VM_BIT
266 tbit.z p0,p15=r29,IA64_PSR_I_BIT 272 tbit.z p0,p15=r29,IA64_PSR_I_BIT
267 ;; 273 ;;
268(p7) br.sptk kvm_dispatch_interrupt 274(p7) br.sptk kvm_dispatch_interrupt
269 ;; 275 ;;
270 mov r27=ar.rsc /* M */ 276 mov r27=ar.rsc /* M */
271 mov r20=r1 /* A */ 277 mov r20=r1 /* A */
272 mov r25=ar.unat /* M */ 278 mov r25=ar.unat /* M */
273 mov r26=ar.pfs /* I */ 279 mov r26=ar.pfs /* I */
274 mov r28=cr.iip /* M */ 280 mov r28=cr.iip /* M */
275 cover /* B (or nothing) */ 281 cover /* B (or nothing) */
276 ;; 282 ;;
277 mov r1=sp 283 mov r1=sp
278 ;; 284 ;;
279 invala /* M */ 285 invala /* M */
280 mov r30=cr.ifs 286 mov r30=cr.ifs
281 ;; 287 ;;
282 addl r1=-VMM_PT_REGS_SIZE,r1 288 addl r1=-VMM_PT_REGS_SIZE,r1
283 ;; 289 ;;
284 adds r17=2*L1_CACHE_BYTES,r1 /* really: biggest cache-line size */ 290 adds r17=2*L1_CACHE_BYTES,r1 /* really: biggest cache-line size */
285 adds r16=PT(CR_IPSR),r1 291 adds r16=PT(CR_IPSR),r1
286 ;; 292 ;;
287 lfetch.fault.excl.nt1 [r17],L1_CACHE_BYTES 293 lfetch.fault.excl.nt1 [r17],L1_CACHE_BYTES
288 st8 [r16]=r29 /* save cr.ipsr */ 294 st8 [r16]=r29 /* save cr.ipsr */
289 ;; 295 ;;
290 lfetch.fault.excl.nt1 [r17] 296 lfetch.fault.excl.nt1 [r17]
291 mov r29=b0 297 mov r29=b0
292 ;; 298 ;;
293 adds r16=PT(R8),r1 /* initialize first base pointer */ 299 adds r16=PT(R8),r1 /* initialize first base pointer */
294 adds r17=PT(R9),r1 /* initialize second base pointer */ 300 adds r17=PT(R9),r1 /* initialize second base pointer */
295 mov r18=r0 /* make sure r18 isn't NaT */ 301 mov r18=r0 /* make sure r18 isn't NaT */
296 ;; 302 ;;
297.mem.offset 0,0; st8.spill [r16]=r8,16 303.mem.offset 0,0; st8.spill [r16]=r8,16
298.mem.offset 8,0; st8.spill [r17]=r9,16 304.mem.offset 8,0; st8.spill [r17]=r9,16
299 ;; 305 ;;
300.mem.offset 0,0; st8.spill [r16]=r10,24 306.mem.offset 0,0; st8.spill [r16]=r10,24
301.mem.offset 8,0; st8.spill [r17]=r11,24 307.mem.offset 8,0; st8.spill [r17]=r11,24
302 ;; 308 ;;
303 st8 [r16]=r28,16 /* save cr.iip */ 309 st8 [r16]=r28,16 /* save cr.iip */
304 st8 [r17]=r30,16 /* save cr.ifs */ 310 st8 [r17]=r30,16 /* save cr.ifs */
305 mov r8=ar.fpsr /* M */ 311 mov r8=ar.fpsr /* M */
306 mov r9=ar.csd 312 mov r9=ar.csd
307 mov r10=ar.ssd 313 mov r10=ar.ssd
308 movl r11=FPSR_DEFAULT /* L-unit */ 314 movl r11=FPSR_DEFAULT /* L-unit */
309 ;; 315 ;;
310 st8 [r16]=r25,16 /* save ar.unat */ 316 st8 [r16]=r25,16 /* save ar.unat */
311 st8 [r17]=r26,16 /* save ar.pfs */ 317 st8 [r17]=r26,16 /* save ar.pfs */
312 shl r18=r18,16 /* compute ar.rsc to be used for "loadrs" */ 318 shl r18=r18,16 /* compute ar.rsc to be used for "loadrs" */
313 ;; 319 ;;
314 st8 [r16]=r27,16 /* save ar.rsc */ 320 st8 [r16]=r27,16 /* save ar.rsc */
315 adds r17=16,r17 /* skip over ar_rnat field */ 321 adds r17=16,r17 /* skip over ar_rnat field */
316 ;; 322 ;;
317 st8 [r17]=r31,16 /* save predicates */ 323 st8 [r17]=r31,16 /* save predicates */
318 adds r16=16,r16 /* skip over ar_bspstore field */ 324 adds r16=16,r16 /* skip over ar_bspstore field */
319 ;; 325 ;;
320 st8 [r16]=r29,16 /* save b0 */ 326 st8 [r16]=r29,16 /* save b0 */
321 st8 [r17]=r18,16 /* save ar.rsc value for "loadrs" */ 327 st8 [r17]=r18,16 /* save ar.rsc value for "loadrs" */
322 ;; 328 ;;
323.mem.offset 0,0; st8.spill [r16]=r20,16 /* save original r1 */ 329.mem.offset 0,0; st8.spill [r16]=r20,16 /* save original r1 */
324.mem.offset 8,0; st8.spill [r17]=r12,16 330.mem.offset 8,0; st8.spill [r17]=r12,16
325 adds r12=-16,r1 331 adds r12=-16,r1
326 /* switch to kernel memory stack (with 16 bytes of scratch) */ 332 /* switch to kernel memory stack (with 16 bytes of scratch) */
327 ;; 333 ;;
328.mem.offset 0,0; st8.spill [r16]=r13,16 334.mem.offset 0,0; st8.spill [r16]=r13,16
329.mem.offset 8,0; st8.spill [r17]=r8,16 /* save ar.fpsr */ 335.mem.offset 8,0; st8.spill [r17]=r8,16 /* save ar.fpsr */
330 ;; 336 ;;
331.mem.offset 0,0; st8.spill [r16]=r15,16 337.mem.offset 0,0; st8.spill [r16]=r15,16
332.mem.offset 8,0; st8.spill [r17]=r14,16 338.mem.offset 8,0; st8.spill [r17]=r14,16
333 dep r14=-1,r0,60,4 339 dep r14=-1,r0,60,4
334 ;; 340 ;;
335.mem.offset 0,0; st8.spill [r16]=r2,16 341.mem.offset 0,0; st8.spill [r16]=r2,16
336.mem.offset 8,0; st8.spill [r17]=r3,16 342.mem.offset 8,0; st8.spill [r17]=r3,16
337 adds r2=VMM_PT_REGS_R16_OFFSET,r1 343 adds r2=VMM_PT_REGS_R16_OFFSET,r1
338 adds r14 = VMM_VCPU_GP_OFFSET,r13 344 adds r14 = VMM_VCPU_GP_OFFSET,r13
339 ;; 345 ;;
340 mov r8=ar.ccv 346 mov r8=ar.ccv
341 ld8 r14 = [r14] 347 ld8 r14 = [r14]
342 ;; 348 ;;
343 mov r1=r14 /* establish kernel global pointer */ 349 mov r1=r14 /* establish kernel global pointer */
344 ;; \ 350 ;; \
345 bsw.1 351 bsw.1
346 ;; 352 ;;
347 alloc r14=ar.pfs,0,0,1,0 // must be first in an insn group 353 alloc r14=ar.pfs,0,0,1,0 // must be first in an insn group
348 mov out0=r13 354 mov out0=r13
349 ;; 355 ;;
350 ssm psr.ic 356 ssm psr.ic
351 ;; 357 ;;
352 srlz.i 358 srlz.i
353 ;; 359 ;;
354 //(p15) ssm psr.i 360 //(p15) ssm psr.i
355 adds r3=8,r2 // set up second base pointer for SAVE_REST 361 adds r3=8,r2 // set up second base pointer for SAVE_REST
356 srlz.i // ensure everybody knows psr.ic is back on 362 srlz.i // ensure everybody knows psr.ic is back on
357 ;; 363 ;;
358.mem.offset 0,0; st8.spill [r2]=r16,16 364.mem.offset 0,0; st8.spill [r2]=r16,16
359.mem.offset 8,0; st8.spill [r3]=r17,16 365.mem.offset 8,0; st8.spill [r3]=r17,16
360 ;; 366 ;;
361.mem.offset 0,0; st8.spill [r2]=r18,16 367.mem.offset 0,0; st8.spill [r2]=r18,16
362.mem.offset 8,0; st8.spill [r3]=r19,16 368.mem.offset 8,0; st8.spill [r3]=r19,16
363 ;; 369 ;;
364.mem.offset 0,0; st8.spill [r2]=r20,16 370.mem.offset 0,0; st8.spill [r2]=r20,16
365.mem.offset 8,0; st8.spill [r3]=r21,16 371.mem.offset 8,0; st8.spill [r3]=r21,16
366 mov r18=b6 372 mov r18=b6
367 ;; 373 ;;
368.mem.offset 0,0; st8.spill [r2]=r22,16 374.mem.offset 0,0; st8.spill [r2]=r22,16
369.mem.offset 8,0; st8.spill [r3]=r23,16 375.mem.offset 8,0; st8.spill [r3]=r23,16
370 mov r19=b7 376 mov r19=b7
371 ;; 377 ;;
372.mem.offset 0,0; st8.spill [r2]=r24,16 378.mem.offset 0,0; st8.spill [r2]=r24,16
373.mem.offset 8,0; st8.spill [r3]=r25,16 379.mem.offset 8,0; st8.spill [r3]=r25,16
374 ;; 380 ;;
375.mem.offset 0,0; st8.spill [r2]=r26,16 381.mem.offset 0,0; st8.spill [r2]=r26,16
376.mem.offset 8,0; st8.spill [r3]=r27,16 382.mem.offset 8,0; st8.spill [r3]=r27,16
377 ;; 383 ;;
378.mem.offset 0,0; st8.spill [r2]=r28,16 384.mem.offset 0,0; st8.spill [r2]=r28,16
379.mem.offset 8,0; st8.spill [r3]=r29,16 385.mem.offset 8,0; st8.spill [r3]=r29,16
380 ;; 386 ;;
381.mem.offset 0,0; st8.spill [r2]=r30,16 387.mem.offset 0,0; st8.spill [r2]=r30,16
382.mem.offset 8,0; st8.spill [r3]=r31,32 388.mem.offset 8,0; st8.spill [r3]=r31,32
383 ;; 389 ;;
384 mov ar.fpsr=r11 /* M-unit */ 390 mov ar.fpsr=r11 /* M-unit */
385 st8 [r2]=r8,8 /* ar.ccv */ 391 st8 [r2]=r8,8 /* ar.ccv */
386 adds r24=PT(B6)-PT(F7),r3 392 adds r24=PT(B6)-PT(F7),r3
387 ;; 393 ;;
388 stf.spill [r2]=f6,32 394 stf.spill [r2]=f6,32
389 stf.spill [r3]=f7,32 395 stf.spill [r3]=f7,32
390 ;; 396 ;;
391 stf.spill [r2]=f8,32 397 stf.spill [r2]=f8,32
392 stf.spill [r3]=f9,32 398 stf.spill [r3]=f9,32
393 ;; 399 ;;
394 stf.spill [r2]=f10 400 stf.spill [r2]=f10
395 stf.spill [r3]=f11 401 stf.spill [r3]=f11
396 adds r25=PT(B7)-PT(F11),r3 402 adds r25=PT(B7)-PT(F11),r3
397 ;; 403 ;;
398 st8 [r24]=r18,16 /* b6 */ 404 st8 [r24]=r18,16 /* b6 */
399 st8 [r25]=r19,16 /* b7 */ 405 st8 [r25]=r19,16 /* b7 */
400 ;; 406 ;;
401 st8 [r24]=r9 /* ar.csd */ 407 st8 [r24]=r9 /* ar.csd */
402 st8 [r25]=r10 /* ar.ssd */ 408 st8 [r25]=r10 /* ar.ssd */
403 ;; 409 ;;
404 srlz.d // make sure we see the effect of cr.ivr 410 srlz.d // make sure we see the effect of cr.ivr
405 addl r14=@gprel(ia64_leave_nested),gp 411 addl r14=@gprel(ia64_leave_nested),gp
406 ;; 412 ;;
407 mov rp=r14 413 mov rp=r14
408 br.call.sptk.many b6=kvm_ia64_handle_irq 414 br.call.sptk.many b6=kvm_ia64_handle_irq
409 ;; 415 ;;
410END(kvm_interrupt) 416END(kvm_interrupt)
411 417
412 .global kvm_dispatch_vexirq 418 .global kvm_dispatch_vexirq
@@ -414,387 +420,385 @@ END(kvm_interrupt)
414////////////////////////////////////////////////////////////////////// 420//////////////////////////////////////////////////////////////////////
415// 0x3400 Entry 13 (size 64 bundles) Reserved 421// 0x3400 Entry 13 (size 64 bundles) Reserved
416ENTRY(kvm_virtual_exirq) 422ENTRY(kvm_virtual_exirq)
417 mov r31=pr 423 mov r31=pr
418 mov r19=13 424 mov r19=13
419 mov r30 =r0 425 mov r30 =r0
420 ;; 426 ;;
421kvm_dispatch_vexirq: 427kvm_dispatch_vexirq:
422 cmp.eq p6,p0 = 1,r30 428 cmp.eq p6,p0 = 1,r30
423 ;; 429 ;;
424(p6)add r29 = VMM_VCPU_SAVED_GP_OFFSET,r21 430(p6) add r29 = VMM_VCPU_SAVED_GP_OFFSET,r21
425 ;; 431 ;;
426(p6)ld8 r1 = [r29] 432(p6) ld8 r1 = [r29]
427 ;; 433 ;;
428 KVM_SAVE_MIN_WITH_COVER_R19 434 KVM_SAVE_MIN_WITH_COVER_R19
429 alloc r14=ar.pfs,0,0,1,0 435 alloc r14=ar.pfs,0,0,1,0
430 mov out0=r13 436 mov out0=r13
431 437
432 ssm psr.ic 438 ssm psr.ic
433 ;; 439 ;;
434 srlz.i // guarantee that interruption collection is on 440 srlz.i // guarantee that interruption collection is on
435 ;; 441 ;;
436 //(p15) ssm psr.i // restore psr.i 442 //(p15) ssm psr.i // restore psr.i
437 adds r3=8,r2 // set up second base pointer 443 adds r3=8,r2 // set up second base pointer
438 ;; 444 ;;
439 KVM_SAVE_REST 445 KVM_SAVE_REST
440 addl r14=@gprel(ia64_leave_hypervisor),gp 446 addl r14=@gprel(ia64_leave_hypervisor),gp
441 ;; 447 ;;
442 mov rp=r14 448 mov rp=r14
443 br.call.sptk.many b6=kvm_vexirq 449 br.call.sptk.many b6=kvm_vexirq
444END(kvm_virtual_exirq) 450END(kvm_virtual_exirq)
445 451
446 .org kvm_ia64_ivt+0x3800 452 .org kvm_ia64_ivt+0x3800
447///////////////////////////////////////////////////////////////////// 453/////////////////////////////////////////////////////////////////////
448// 0x3800 Entry 14 (size 64 bundles) Reserved 454// 0x3800 Entry 14 (size 64 bundles) Reserved
449 KVM_FAULT(14) 455 KVM_FAULT(14)
450 // this code segment is from 2.6.16.13 456 // this code segment is from 2.6.16.13
451
452 457
453 .org kvm_ia64_ivt+0x3c00 458 .org kvm_ia64_ivt+0x3c00
454/////////////////////////////////////////////////////////////////////// 459///////////////////////////////////////////////////////////////////////
455// 0x3c00 Entry 15 (size 64 bundles) Reserved 460// 0x3c00 Entry 15 (size 64 bundles) Reserved
456 KVM_FAULT(15) 461 KVM_FAULT(15)
457
458 462
459 .org kvm_ia64_ivt+0x4000 463 .org kvm_ia64_ivt+0x4000
460/////////////////////////////////////////////////////////////////////// 464///////////////////////////////////////////////////////////////////////
461// 0x4000 Entry 16 (size 64 bundles) Reserved 465// 0x4000 Entry 16 (size 64 bundles) Reserved
462 KVM_FAULT(16) 466 KVM_FAULT(16)
463 467
464 .org kvm_ia64_ivt+0x4400 468 .org kvm_ia64_ivt+0x4400
465////////////////////////////////////////////////////////////////////// 469//////////////////////////////////////////////////////////////////////
466// 0x4400 Entry 17 (size 64 bundles) Reserved 470// 0x4400 Entry 17 (size 64 bundles) Reserved
467 KVM_FAULT(17) 471 KVM_FAULT(17)
468 472
469 .org kvm_ia64_ivt+0x4800 473 .org kvm_ia64_ivt+0x4800
470////////////////////////////////////////////////////////////////////// 474//////////////////////////////////////////////////////////////////////
471// 0x4800 Entry 18 (size 64 bundles) Reserved 475// 0x4800 Entry 18 (size 64 bundles) Reserved
472 KVM_FAULT(18) 476 KVM_FAULT(18)
473 477
474 .org kvm_ia64_ivt+0x4c00 478 .org kvm_ia64_ivt+0x4c00
475////////////////////////////////////////////////////////////////////// 479//////////////////////////////////////////////////////////////////////
476// 0x4c00 Entry 19 (size 64 bundles) Reserved 480// 0x4c00 Entry 19 (size 64 bundles) Reserved
477 KVM_FAULT(19) 481 KVM_FAULT(19)
478 482
479 .org kvm_ia64_ivt+0x5000 483 .org kvm_ia64_ivt+0x5000
480////////////////////////////////////////////////////////////////////// 484//////////////////////////////////////////////////////////////////////
481// 0x5000 Entry 20 (size 16 bundles) Page Not Present 485// 0x5000 Entry 20 (size 16 bundles) Page Not Present
482ENTRY(kvm_page_not_present) 486ENTRY(kvm_page_not_present)
483 KVM_REFLECT(20) 487 KVM_REFLECT(20)
484END(kvm_page_not_present) 488END(kvm_page_not_present)
485 489
486 .org kvm_ia64_ivt+0x5100 490 .org kvm_ia64_ivt+0x5100
487/////////////////////////////////////////////////////////////////////// 491///////////////////////////////////////////////////////////////////////
488// 0x5100 Entry 21 (size 16 bundles) Key Permission vector 492// 0x5100 Entry 21 (size 16 bundles) Key Permission vector
489ENTRY(kvm_key_permission) 493ENTRY(kvm_key_permission)
490 KVM_REFLECT(21) 494 KVM_REFLECT(21)
491END(kvm_key_permission) 495END(kvm_key_permission)
492 496
493 .org kvm_ia64_ivt+0x5200 497 .org kvm_ia64_ivt+0x5200
494////////////////////////////////////////////////////////////////////// 498//////////////////////////////////////////////////////////////////////
495// 0x5200 Entry 22 (size 16 bundles) Instruction Access Rights (26) 499// 0x5200 Entry 22 (size 16 bundles) Instruction Access Rights (26)
496ENTRY(kvm_iaccess_rights) 500ENTRY(kvm_iaccess_rights)
497 KVM_REFLECT(22) 501 KVM_REFLECT(22)
498END(kvm_iaccess_rights) 502END(kvm_iaccess_rights)
499 503
500 .org kvm_ia64_ivt+0x5300 504 .org kvm_ia64_ivt+0x5300
501////////////////////////////////////////////////////////////////////// 505//////////////////////////////////////////////////////////////////////
502// 0x5300 Entry 23 (size 16 bundles) Data Access Rights (14,53) 506// 0x5300 Entry 23 (size 16 bundles) Data Access Rights (14,53)
503ENTRY(kvm_daccess_rights) 507ENTRY(kvm_daccess_rights)
504 KVM_REFLECT(23) 508 KVM_REFLECT(23)
505END(kvm_daccess_rights) 509END(kvm_daccess_rights)
506 510
507 .org kvm_ia64_ivt+0x5400 511 .org kvm_ia64_ivt+0x5400
508///////////////////////////////////////////////////////////////////// 512/////////////////////////////////////////////////////////////////////
509// 0x5400 Entry 24 (size 16 bundles) General Exception (5,32,34,36,38,39) 513// 0x5400 Entry 24 (size 16 bundles) General Exception (5,32,34,36,38,39)
510ENTRY(kvm_general_exception) 514ENTRY(kvm_general_exception)
511 KVM_REFLECT(24) 515 KVM_REFLECT(24)
512 KVM_FAULT(24) 516 KVM_FAULT(24)
513END(kvm_general_exception) 517END(kvm_general_exception)
514 518
515 .org kvm_ia64_ivt+0x5500 519 .org kvm_ia64_ivt+0x5500
516////////////////////////////////////////////////////////////////////// 520//////////////////////////////////////////////////////////////////////
517// 0x5500 Entry 25 (size 16 bundles) Disabled FP-Register (35) 521// 0x5500 Entry 25 (size 16 bundles) Disabled FP-Register (35)
518ENTRY(kvm_disabled_fp_reg) 522ENTRY(kvm_disabled_fp_reg)
519 KVM_REFLECT(25) 523 KVM_REFLECT(25)
520END(kvm_disabled_fp_reg) 524END(kvm_disabled_fp_reg)
521 525
522 .org kvm_ia64_ivt+0x5600 526 .org kvm_ia64_ivt+0x5600
523//////////////////////////////////////////////////////////////////// 527////////////////////////////////////////////////////////////////////
524// 0x5600 Entry 26 (size 16 bundles) Nat Consumption (11,23,37,50) 528// 0x5600 Entry 26 (size 16 bundles) Nat Consumption (11,23,37,50)
525ENTRY(kvm_nat_consumption) 529ENTRY(kvm_nat_consumption)
526 KVM_REFLECT(26) 530 KVM_REFLECT(26)
527END(kvm_nat_consumption) 531END(kvm_nat_consumption)
528 532
529 .org kvm_ia64_ivt+0x5700 533 .org kvm_ia64_ivt+0x5700
530///////////////////////////////////////////////////////////////////// 534/////////////////////////////////////////////////////////////////////
531// 0x5700 Entry 27 (size 16 bundles) Speculation (40) 535// 0x5700 Entry 27 (size 16 bundles) Speculation (40)
532ENTRY(kvm_speculation_vector) 536ENTRY(kvm_speculation_vector)
533 KVM_REFLECT(27) 537 KVM_REFLECT(27)
534END(kvm_speculation_vector) 538END(kvm_speculation_vector)
535 539
536 .org kvm_ia64_ivt+0x5800 540 .org kvm_ia64_ivt+0x5800
537///////////////////////////////////////////////////////////////////// 541/////////////////////////////////////////////////////////////////////
538// 0x5800 Entry 28 (size 16 bundles) Reserved 542// 0x5800 Entry 28 (size 16 bundles) Reserved
539 KVM_FAULT(28) 543 KVM_FAULT(28)
540 544
541 .org kvm_ia64_ivt+0x5900 545 .org kvm_ia64_ivt+0x5900
542/////////////////////////////////////////////////////////////////// 546///////////////////////////////////////////////////////////////////
543// 0x5900 Entry 29 (size 16 bundles) Debug (16,28,56) 547// 0x5900 Entry 29 (size 16 bundles) Debug (16,28,56)
544ENTRY(kvm_debug_vector) 548ENTRY(kvm_debug_vector)
545 KVM_FAULT(29) 549 KVM_FAULT(29)
546END(kvm_debug_vector) 550END(kvm_debug_vector)
547 551
548 .org kvm_ia64_ivt+0x5a00 552 .org kvm_ia64_ivt+0x5a00
549/////////////////////////////////////////////////////////////// 553///////////////////////////////////////////////////////////////
550// 0x5a00 Entry 30 (size 16 bundles) Unaligned Reference (57) 554// 0x5a00 Entry 30 (size 16 bundles) Unaligned Reference (57)
551ENTRY(kvm_unaligned_access) 555ENTRY(kvm_unaligned_access)
552 KVM_REFLECT(30) 556 KVM_REFLECT(30)
553END(kvm_unaligned_access) 557END(kvm_unaligned_access)
554 558
555 .org kvm_ia64_ivt+0x5b00 559 .org kvm_ia64_ivt+0x5b00
556////////////////////////////////////////////////////////////////////// 560//////////////////////////////////////////////////////////////////////
557// 0x5b00 Entry 31 (size 16 bundles) Unsupported Data Reference (57) 561// 0x5b00 Entry 31 (size 16 bundles) Unsupported Data Reference (57)
558ENTRY(kvm_unsupported_data_reference) 562ENTRY(kvm_unsupported_data_reference)
559 KVM_REFLECT(31) 563 KVM_REFLECT(31)
560END(kvm_unsupported_data_reference) 564END(kvm_unsupported_data_reference)
561 565
562 .org kvm_ia64_ivt+0x5c00 566 .org kvm_ia64_ivt+0x5c00
563//////////////////////////////////////////////////////////////////// 567////////////////////////////////////////////////////////////////////
564// 0x5c00 Entry 32 (size 16 bundles) Floating Point FAULT (65) 568// 0x5c00 Entry 32 (size 16 bundles) Floating Point FAULT (65)
565ENTRY(kvm_floating_point_fault) 569ENTRY(kvm_floating_point_fault)
566 KVM_REFLECT(32) 570 KVM_REFLECT(32)
567END(kvm_floating_point_fault) 571END(kvm_floating_point_fault)
568 572
569 .org kvm_ia64_ivt+0x5d00 573 .org kvm_ia64_ivt+0x5d00
570///////////////////////////////////////////////////////////////////// 574/////////////////////////////////////////////////////////////////////
571// 0x5d00 Entry 33 (size 16 bundles) Floating Point Trap (66) 575// 0x5d00 Entry 33 (size 16 bundles) Floating Point Trap (66)
572ENTRY(kvm_floating_point_trap) 576ENTRY(kvm_floating_point_trap)
573 KVM_REFLECT(33) 577 KVM_REFLECT(33)
574END(kvm_floating_point_trap) 578END(kvm_floating_point_trap)
575 579
576 .org kvm_ia64_ivt+0x5e00 580 .org kvm_ia64_ivt+0x5e00
577////////////////////////////////////////////////////////////////////// 581//////////////////////////////////////////////////////////////////////
578// 0x5e00 Entry 34 (size 16 bundles) Lower Privilege Transfer Trap (66) 582// 0x5e00 Entry 34 (size 16 bundles) Lower Privilege Transfer Trap (66)
579ENTRY(kvm_lower_privilege_trap) 583ENTRY(kvm_lower_privilege_trap)
580 KVM_REFLECT(34) 584 KVM_REFLECT(34)
581END(kvm_lower_privilege_trap) 585END(kvm_lower_privilege_trap)
582 586
583 .org kvm_ia64_ivt+0x5f00 587 .org kvm_ia64_ivt+0x5f00
584////////////////////////////////////////////////////////////////////// 588//////////////////////////////////////////////////////////////////////
585// 0x5f00 Entry 35 (size 16 bundles) Taken Branch Trap (68) 589// 0x5f00 Entry 35 (size 16 bundles) Taken Branch Trap (68)
586ENTRY(kvm_taken_branch_trap) 590ENTRY(kvm_taken_branch_trap)
587 KVM_REFLECT(35) 591 KVM_REFLECT(35)
588END(kvm_taken_branch_trap) 592END(kvm_taken_branch_trap)
589 593
590 .org kvm_ia64_ivt+0x6000 594 .org kvm_ia64_ivt+0x6000
591//////////////////////////////////////////////////////////////////// 595////////////////////////////////////////////////////////////////////
592// 0x6000 Entry 36 (size 16 bundles) Single Step Trap (69) 596// 0x6000 Entry 36 (size 16 bundles) Single Step Trap (69)
593ENTRY(kvm_single_step_trap) 597ENTRY(kvm_single_step_trap)
594 KVM_REFLECT(36) 598 KVM_REFLECT(36)
595END(kvm_single_step_trap) 599END(kvm_single_step_trap)
596 .global kvm_virtualization_fault_back 600 .global kvm_virtualization_fault_back
597 .org kvm_ia64_ivt+0x6100 601 .org kvm_ia64_ivt+0x6100
598///////////////////////////////////////////////////////////////////// 602/////////////////////////////////////////////////////////////////////
599// 0x6100 Entry 37 (size 16 bundles) Virtualization Fault 603// 0x6100 Entry 37 (size 16 bundles) Virtualization Fault
600ENTRY(kvm_virtualization_fault) 604ENTRY(kvm_virtualization_fault)
601 mov r31=pr 605 mov r31=pr
602 adds r16 = VMM_VCPU_SAVED_GP_OFFSET,r21 606 adds r16 = VMM_VCPU_SAVED_GP_OFFSET,r21
603 ;; 607 ;;
604 st8 [r16] = r1 608 st8 [r16] = r1
605 adds r17 = VMM_VCPU_GP_OFFSET, r21 609 adds r17 = VMM_VCPU_GP_OFFSET, r21
606 ;; 610 ;;
607 ld8 r1 = [r17] 611 ld8 r1 = [r17]
608 cmp.eq p6,p0=EVENT_MOV_FROM_AR,r24 612 cmp.eq p6,p0=EVENT_MOV_FROM_AR,r24
609 cmp.eq p7,p0=EVENT_MOV_FROM_RR,r24 613 cmp.eq p7,p0=EVENT_MOV_FROM_RR,r24
610 cmp.eq p8,p0=EVENT_MOV_TO_RR,r24 614 cmp.eq p8,p0=EVENT_MOV_TO_RR,r24
611 cmp.eq p9,p0=EVENT_RSM,r24 615 cmp.eq p9,p0=EVENT_RSM,r24
612 cmp.eq p10,p0=EVENT_SSM,r24 616 cmp.eq p10,p0=EVENT_SSM,r24
613 cmp.eq p11,p0=EVENT_MOV_TO_PSR,r24 617 cmp.eq p11,p0=EVENT_MOV_TO_PSR,r24
614 cmp.eq p12,p0=EVENT_THASH,r24 618 cmp.eq p12,p0=EVENT_THASH,r24
615 (p6) br.dptk.many kvm_asm_mov_from_ar 619(p6) br.dptk.many kvm_asm_mov_from_ar
616 (p7) br.dptk.many kvm_asm_mov_from_rr 620(p7) br.dptk.many kvm_asm_mov_from_rr
617 (p8) br.dptk.many kvm_asm_mov_to_rr 621(p8) br.dptk.many kvm_asm_mov_to_rr
618 (p9) br.dptk.many kvm_asm_rsm 622(p9) br.dptk.many kvm_asm_rsm
619 (p10) br.dptk.many kvm_asm_ssm 623(p10) br.dptk.many kvm_asm_ssm
620 (p11) br.dptk.many kvm_asm_mov_to_psr 624(p11) br.dptk.many kvm_asm_mov_to_psr
621 (p12) br.dptk.many kvm_asm_thash 625(p12) br.dptk.many kvm_asm_thash
622 ;; 626 ;;
623kvm_virtualization_fault_back: 627kvm_virtualization_fault_back:
624 adds r16 = VMM_VCPU_SAVED_GP_OFFSET,r21 628 adds r16 = VMM_VCPU_SAVED_GP_OFFSET,r21
625 ;; 629 ;;
626 ld8 r1 = [r16] 630 ld8 r1 = [r16]
627 ;; 631 ;;
628 mov r19=37 632 mov r19=37
629 adds r16 = VMM_VCPU_CAUSE_OFFSET,r21 633 adds r16 = VMM_VCPU_CAUSE_OFFSET,r21
630 adds r17 = VMM_VCPU_OPCODE_OFFSET,r21 634 adds r17 = VMM_VCPU_OPCODE_OFFSET,r21
631 ;; 635 ;;
632 st8 [r16] = r24 636 st8 [r16] = r24
633 st8 [r17] = r25 637 st8 [r17] = r25
634 ;; 638 ;;
635 cmp.ne p6,p0=EVENT_RFI, r24 639 cmp.ne p6,p0=EVENT_RFI, r24
636 (p6) br.sptk kvm_dispatch_virtualization_fault 640(p6) br.sptk kvm_dispatch_virtualization_fault
637 ;; 641 ;;
638 adds r18=VMM_VPD_BASE_OFFSET,r21 642 adds r18=VMM_VPD_BASE_OFFSET,r21
639 ;; 643 ;;
640 ld8 r18=[r18] 644 ld8 r18=[r18]
641 ;; 645 ;;
642 adds r18=VMM_VPD_VIFS_OFFSET,r18 646 adds r18=VMM_VPD_VIFS_OFFSET,r18
643 ;; 647 ;;
644 ld8 r18=[r18] 648 ld8 r18=[r18]
645 ;; 649 ;;
646 tbit.z p6,p0=r18,63 650 tbit.z p6,p0=r18,63
647 (p6) br.sptk kvm_dispatch_virtualization_fault 651(p6) br.sptk kvm_dispatch_virtualization_fault
648 ;; 652 ;;
649 //if vifs.v=1 desert current register frame 653//if vifs.v=1 desert current register frame
650 alloc r18=ar.pfs,0,0,0,0 654 alloc r18=ar.pfs,0,0,0,0
651 br.sptk kvm_dispatch_virtualization_fault 655 br.sptk kvm_dispatch_virtualization_fault
652END(kvm_virtualization_fault) 656END(kvm_virtualization_fault)
653 657
654 .org kvm_ia64_ivt+0x6200 658 .org kvm_ia64_ivt+0x6200
655////////////////////////////////////////////////////////////// 659//////////////////////////////////////////////////////////////
656// 0x6200 Entry 38 (size 16 bundles) Reserved 660// 0x6200 Entry 38 (size 16 bundles) Reserved
657 KVM_FAULT(38) 661 KVM_FAULT(38)
658 662
659 .org kvm_ia64_ivt+0x6300 663 .org kvm_ia64_ivt+0x6300
660///////////////////////////////////////////////////////////////// 664/////////////////////////////////////////////////////////////////
661// 0x6300 Entry 39 (size 16 bundles) Reserved 665// 0x6300 Entry 39 (size 16 bundles) Reserved
662 KVM_FAULT(39) 666 KVM_FAULT(39)
663 667
664 .org kvm_ia64_ivt+0x6400 668 .org kvm_ia64_ivt+0x6400
665///////////////////////////////////////////////////////////////// 669/////////////////////////////////////////////////////////////////
666// 0x6400 Entry 40 (size 16 bundles) Reserved 670// 0x6400 Entry 40 (size 16 bundles) Reserved
667 KVM_FAULT(40) 671 KVM_FAULT(40)
668 672
669 .org kvm_ia64_ivt+0x6500 673 .org kvm_ia64_ivt+0x6500
670////////////////////////////////////////////////////////////////// 674//////////////////////////////////////////////////////////////////
671// 0x6500 Entry 41 (size 16 bundles) Reserved 675// 0x6500 Entry 41 (size 16 bundles) Reserved
672 KVM_FAULT(41) 676 KVM_FAULT(41)
673 677
674 .org kvm_ia64_ivt+0x6600 678 .org kvm_ia64_ivt+0x6600
675////////////////////////////////////////////////////////////////// 679//////////////////////////////////////////////////////////////////
676// 0x6600 Entry 42 (size 16 bundles) Reserved 680// 0x6600 Entry 42 (size 16 bundles) Reserved
677 KVM_FAULT(42) 681 KVM_FAULT(42)
678 682
679 .org kvm_ia64_ivt+0x6700 683 .org kvm_ia64_ivt+0x6700
680////////////////////////////////////////////////////////////////// 684//////////////////////////////////////////////////////////////////
681// 0x6700 Entry 43 (size 16 bundles) Reserved 685// 0x6700 Entry 43 (size 16 bundles) Reserved
682 KVM_FAULT(43) 686 KVM_FAULT(43)
683 687
684 .org kvm_ia64_ivt+0x6800 688 .org kvm_ia64_ivt+0x6800
685////////////////////////////////////////////////////////////////// 689//////////////////////////////////////////////////////////////////
686// 0x6800 Entry 44 (size 16 bundles) Reserved 690// 0x6800 Entry 44 (size 16 bundles) Reserved
687 KVM_FAULT(44) 691 KVM_FAULT(44)
688 692
689 .org kvm_ia64_ivt+0x6900 693 .org kvm_ia64_ivt+0x6900
690/////////////////////////////////////////////////////////////////// 694///////////////////////////////////////////////////////////////////
691// 0x6900 Entry 45 (size 16 bundles) IA-32 Exeception 695// 0x6900 Entry 45 (size 16 bundles) IA-32 Exeception
692//(17,18,29,41,42,43,44,58,60,61,62,72,73,75,76,77) 696//(17,18,29,41,42,43,44,58,60,61,62,72,73,75,76,77)
693ENTRY(kvm_ia32_exception) 697ENTRY(kvm_ia32_exception)
694 KVM_FAULT(45) 698 KVM_FAULT(45)
695END(kvm_ia32_exception) 699END(kvm_ia32_exception)
696 700
697 .org kvm_ia64_ivt+0x6a00 701 .org kvm_ia64_ivt+0x6a00
698//////////////////////////////////////////////////////////////////// 702////////////////////////////////////////////////////////////////////
699// 0x6a00 Entry 46 (size 16 bundles) IA-32 Intercept (30,31,59,70,71) 703// 0x6a00 Entry 46 (size 16 bundles) IA-32 Intercept (30,31,59,70,71)
700ENTRY(kvm_ia32_intercept) 704ENTRY(kvm_ia32_intercept)
701 KVM_FAULT(47) 705 KVM_FAULT(47)
702END(kvm_ia32_intercept) 706END(kvm_ia32_intercept)
703 707
704 .org kvm_ia64_ivt+0x6c00 708 .org kvm_ia64_ivt+0x6c00
705///////////////////////////////////////////////////////////////////// 709/////////////////////////////////////////////////////////////////////
706// 0x6c00 Entry 48 (size 16 bundles) Reserved 710// 0x6c00 Entry 48 (size 16 bundles) Reserved
707 KVM_FAULT(48) 711 KVM_FAULT(48)
708 712
709 .org kvm_ia64_ivt+0x6d00 713 .org kvm_ia64_ivt+0x6d00
710////////////////////////////////////////////////////////////////////// 714//////////////////////////////////////////////////////////////////////
711// 0x6d00 Entry 49 (size 16 bundles) Reserved 715// 0x6d00 Entry 49 (size 16 bundles) Reserved
712 KVM_FAULT(49) 716 KVM_FAULT(49)
713 717
714 .org kvm_ia64_ivt+0x6e00 718 .org kvm_ia64_ivt+0x6e00
715////////////////////////////////////////////////////////////////////// 719//////////////////////////////////////////////////////////////////////
716// 0x6e00 Entry 50 (size 16 bundles) Reserved 720// 0x6e00 Entry 50 (size 16 bundles) Reserved
717 KVM_FAULT(50) 721 KVM_FAULT(50)
718 722
719 .org kvm_ia64_ivt+0x6f00 723 .org kvm_ia64_ivt+0x6f00
720///////////////////////////////////////////////////////////////////// 724/////////////////////////////////////////////////////////////////////
721// 0x6f00 Entry 51 (size 16 bundles) Reserved 725// 0x6f00 Entry 51 (size 16 bundles) Reserved
722 KVM_FAULT(52) 726 KVM_FAULT(52)
723 727
724 .org kvm_ia64_ivt+0x7100 728 .org kvm_ia64_ivt+0x7100
725//////////////////////////////////////////////////////////////////// 729////////////////////////////////////////////////////////////////////
726// 0x7100 Entry 53 (size 16 bundles) Reserved 730// 0x7100 Entry 53 (size 16 bundles) Reserved
727 KVM_FAULT(53) 731 KVM_FAULT(53)
728 732
729 .org kvm_ia64_ivt+0x7200 733 .org kvm_ia64_ivt+0x7200
730///////////////////////////////////////////////////////////////////// 734/////////////////////////////////////////////////////////////////////
731// 0x7200 Entry 54 (size 16 bundles) Reserved 735// 0x7200 Entry 54 (size 16 bundles) Reserved
732 KVM_FAULT(54) 736 KVM_FAULT(54)
733 737
734 .org kvm_ia64_ivt+0x7300 738 .org kvm_ia64_ivt+0x7300
735//////////////////////////////////////////////////////////////////// 739////////////////////////////////////////////////////////////////////
736// 0x7300 Entry 55 (size 16 bundles) Reserved 740// 0x7300 Entry 55 (size 16 bundles) Reserved
737 KVM_FAULT(55) 741 KVM_FAULT(55)
738 742
739 .org kvm_ia64_ivt+0x7400 743 .org kvm_ia64_ivt+0x7400
740//////////////////////////////////////////////////////////////////// 744////////////////////////////////////////////////////////////////////
741// 0x7400 Entry 56 (size 16 bundles) Reserved 745// 0x7400 Entry 56 (size 16 bundles) Reserved
742 KVM_FAULT(56) 746 KVM_FAULT(56)
743 747
744 .org kvm_ia64_ivt+0x7500 748 .org kvm_ia64_ivt+0x7500
745///////////////////////////////////////////////////////////////////// 749/////////////////////////////////////////////////////////////////////
746// 0x7500 Entry 57 (size 16 bundles) Reserved 750// 0x7500 Entry 57 (size 16 bundles) Reserved
747 KVM_FAULT(57) 751 KVM_FAULT(57)
748 752
749 .org kvm_ia64_ivt+0x7600 753 .org kvm_ia64_ivt+0x7600
750///////////////////////////////////////////////////////////////////// 754/////////////////////////////////////////////////////////////////////
751// 0x7600 Entry 58 (size 16 bundles) Reserved 755// 0x7600 Entry 58 (size 16 bundles) Reserved
752 KVM_FAULT(58) 756 KVM_FAULT(58)
753 757
754 .org kvm_ia64_ivt+0x7700 758 .org kvm_ia64_ivt+0x7700
755//////////////////////////////////////////////////////////////////// 759////////////////////////////////////////////////////////////////////
756// 0x7700 Entry 59 (size 16 bundles) Reserved 760// 0x7700 Entry 59 (size 16 bundles) Reserved
757 KVM_FAULT(59) 761 KVM_FAULT(59)
758 762
759 .org kvm_ia64_ivt+0x7800 763 .org kvm_ia64_ivt+0x7800
760//////////////////////////////////////////////////////////////////// 764////////////////////////////////////////////////////////////////////
761// 0x7800 Entry 60 (size 16 bundles) Reserved 765// 0x7800 Entry 60 (size 16 bundles) Reserved
762 KVM_FAULT(60) 766 KVM_FAULT(60)
763 767
764 .org kvm_ia64_ivt+0x7900 768 .org kvm_ia64_ivt+0x7900
765///////////////////////////////////////////////////////////////////// 769/////////////////////////////////////////////////////////////////////
766// 0x7900 Entry 61 (size 16 bundles) Reserved 770// 0x7900 Entry 61 (size 16 bundles) Reserved
767 KVM_FAULT(61) 771 KVM_FAULT(61)
768 772
769 .org kvm_ia64_ivt+0x7a00 773 .org kvm_ia64_ivt+0x7a00
770///////////////////////////////////////////////////////////////////// 774/////////////////////////////////////////////////////////////////////
771// 0x7a00 Entry 62 (size 16 bundles) Reserved 775// 0x7a00 Entry 62 (size 16 bundles) Reserved
772 KVM_FAULT(62) 776 KVM_FAULT(62)
773 777
774 .org kvm_ia64_ivt+0x7b00 778 .org kvm_ia64_ivt+0x7b00
775///////////////////////////////////////////////////////////////////// 779/////////////////////////////////////////////////////////////////////
776// 0x7b00 Entry 63 (size 16 bundles) Reserved 780// 0x7b00 Entry 63 (size 16 bundles) Reserved
777 KVM_FAULT(63) 781 KVM_FAULT(63)
778 782
779 .org kvm_ia64_ivt+0x7c00 783 .org kvm_ia64_ivt+0x7c00
780//////////////////////////////////////////////////////////////////// 784////////////////////////////////////////////////////////////////////
781// 0x7c00 Entry 64 (size 16 bundles) Reserved 785// 0x7c00 Entry 64 (size 16 bundles) Reserved
782 KVM_FAULT(64) 786 KVM_FAULT(64)
783 787
784 .org kvm_ia64_ivt+0x7d00 788 .org kvm_ia64_ivt+0x7d00
785///////////////////////////////////////////////////////////////////// 789/////////////////////////////////////////////////////////////////////
786// 0x7d00 Entry 65 (size 16 bundles) Reserved 790// 0x7d00 Entry 65 (size 16 bundles) Reserved
787 KVM_FAULT(65) 791 KVM_FAULT(65)
788 792
789 .org kvm_ia64_ivt+0x7e00 793 .org kvm_ia64_ivt+0x7e00
790///////////////////////////////////////////////////////////////////// 794/////////////////////////////////////////////////////////////////////
791// 0x7e00 Entry 66 (size 16 bundles) Reserved 795// 0x7e00 Entry 66 (size 16 bundles) Reserved
792 KVM_FAULT(66) 796 KVM_FAULT(66)
793 797
794 .org kvm_ia64_ivt+0x7f00 798 .org kvm_ia64_ivt+0x7f00
795//////////////////////////////////////////////////////////////////// 799////////////////////////////////////////////////////////////////////
796// 0x7f00 Entry 67 (size 16 bundles) Reserved 800// 0x7f00 Entry 67 (size 16 bundles) Reserved
797 KVM_FAULT(67) 801 KVM_FAULT(67)
798 802
799 .org kvm_ia64_ivt+0x8000 803 .org kvm_ia64_ivt+0x8000
800// There is no particular reason for this code to be here, other than that 804// There is no particular reason for this code to be here, other than that
@@ -804,132 +808,128 @@ END(kvm_ia32_intercept)
804 808
805 809
806ENTRY(kvm_dtlb_miss_dispatch) 810ENTRY(kvm_dtlb_miss_dispatch)
807 mov r19 = 2 811 mov r19 = 2
808 KVM_SAVE_MIN_WITH_COVER_R19 812 KVM_SAVE_MIN_WITH_COVER_R19
809 alloc r14=ar.pfs,0,0,3,0 813 alloc r14=ar.pfs,0,0,3,0
810 mov out0=cr.ifa 814 mov out0=cr.ifa
811 mov out1=r15 815 mov out1=r15
812 adds r3=8,r2 // set up second base pointer 816 adds r3=8,r2 // set up second base pointer
813 ;; 817 ;;
814 ssm psr.ic 818 ssm psr.ic
815 ;; 819 ;;
816 srlz.i // guarantee that interruption collection is on 820 srlz.i // guarantee that interruption collection is on
817 ;; 821 ;;
818 //(p15) ssm psr.i // restore psr.i 822 //(p15) ssm psr.i // restore psr.i
819 addl r14=@gprel(ia64_leave_hypervisor_prepare),gp 823 addl r14=@gprel(ia64_leave_hypervisor_prepare),gp
820 ;; 824 ;;
821 KVM_SAVE_REST 825 KVM_SAVE_REST
822 KVM_SAVE_EXTRA 826 KVM_SAVE_EXTRA
823 mov rp=r14 827 mov rp=r14
824 ;; 828 ;;
825 adds out2=16,r12 829 adds out2=16,r12
826 br.call.sptk.many b6=kvm_page_fault 830 br.call.sptk.many b6=kvm_page_fault
827END(kvm_dtlb_miss_dispatch) 831END(kvm_dtlb_miss_dispatch)
828 832
829ENTRY(kvm_itlb_miss_dispatch) 833ENTRY(kvm_itlb_miss_dispatch)
830 834
831 KVM_SAVE_MIN_WITH_COVER_R19 835 KVM_SAVE_MIN_WITH_COVER_R19
832 alloc r14=ar.pfs,0,0,3,0 836 alloc r14=ar.pfs,0,0,3,0
833 mov out0=cr.ifa 837 mov out0=cr.ifa
834 mov out1=r15 838 mov out1=r15
835 adds r3=8,r2 // set up second base pointer 839 adds r3=8,r2 // set up second base pointer
836 ;; 840 ;;
837 ssm psr.ic 841 ssm psr.ic
838 ;; 842 ;;
839 srlz.i // guarantee that interruption collection is on 843 srlz.i // guarantee that interruption collection is on
840 ;; 844 ;;
841 //(p15) ssm psr.i // restore psr.i 845 //(p15) ssm psr.i // restore psr.i
842 addl r14=@gprel(ia64_leave_hypervisor),gp 846 addl r14=@gprel(ia64_leave_hypervisor),gp
843 ;; 847 ;;
844 KVM_SAVE_REST 848 KVM_SAVE_REST
845 mov rp=r14 849 mov rp=r14
846 ;; 850 ;;
847 adds out2=16,r12 851 adds out2=16,r12
848 br.call.sptk.many b6=kvm_page_fault 852 br.call.sptk.many b6=kvm_page_fault
849END(kvm_itlb_miss_dispatch) 853END(kvm_itlb_miss_dispatch)
850 854
851ENTRY(kvm_dispatch_reflection) 855ENTRY(kvm_dispatch_reflection)
852 /* 856/*
853 * Input: 857 * Input:
854 * psr.ic: off 858 * psr.ic: off
855 * r19: intr type (offset into ivt, see ia64_int.h) 859 * r19: intr type (offset into ivt, see ia64_int.h)
856 * r31: contains saved predicates (pr) 860 * r31: contains saved predicates (pr)
857 */ 861 */
858 KVM_SAVE_MIN_WITH_COVER_R19 862 KVM_SAVE_MIN_WITH_COVER_R19
859 alloc r14=ar.pfs,0,0,5,0 863 alloc r14=ar.pfs,0,0,5,0
860 mov out0=cr.ifa 864 mov out0=cr.ifa
861 mov out1=cr.isr 865 mov out1=cr.isr
862 mov out2=cr.iim 866 mov out2=cr.iim
863 mov out3=r15 867 mov out3=r15
864 adds r3=8,r2 // set up second base pointer 868 adds r3=8,r2 // set up second base pointer
865 ;; 869 ;;
866 ssm psr.ic 870 ssm psr.ic
867 ;; 871 ;;
868 srlz.i // guarantee that interruption collection is on 872 srlz.i // guarantee that interruption collection is on
869 ;; 873 ;;
870 //(p15) ssm psr.i // restore psr.i 874 //(p15) ssm psr.i // restore psr.i
871 addl r14=@gprel(ia64_leave_hypervisor),gp 875 addl r14=@gprel(ia64_leave_hypervisor),gp
872 ;; 876 ;;
873 KVM_SAVE_REST 877 KVM_SAVE_REST
874 mov rp=r14 878 mov rp=r14
875 ;; 879 ;;
876 adds out4=16,r12 880 adds out4=16,r12
877 br.call.sptk.many b6=reflect_interruption 881 br.call.sptk.many b6=reflect_interruption
878END(kvm_dispatch_reflection) 882END(kvm_dispatch_reflection)
879 883
880ENTRY(kvm_dispatch_virtualization_fault) 884ENTRY(kvm_dispatch_virtualization_fault)
881 adds r16 = VMM_VCPU_CAUSE_OFFSET,r21 885 adds r16 = VMM_VCPU_CAUSE_OFFSET,r21
882 adds r17 = VMM_VCPU_OPCODE_OFFSET,r21 886 adds r17 = VMM_VCPU_OPCODE_OFFSET,r21
883 ;; 887 ;;
884 st8 [r16] = r24 888 st8 [r16] = r24
885 st8 [r17] = r25 889 st8 [r17] = r25
886 ;; 890 ;;
887 KVM_SAVE_MIN_WITH_COVER_R19 891 KVM_SAVE_MIN_WITH_COVER_R19
888 ;; 892 ;;
889 alloc r14=ar.pfs,0,0,2,0 // now it's safe (must be first in insn group!) 893 alloc r14=ar.pfs,0,0,2,0 // (must be first in insn group!)
890 mov out0=r13 //vcpu 894 mov out0=r13 //vcpu
891 adds r3=8,r2 // set up second base pointer 895 adds r3=8,r2 // set up second base pointer
892 ;; 896 ;;
893 ssm psr.ic 897 ssm psr.ic
894 ;; 898 ;;
895 srlz.i // guarantee that interruption collection is on 899 srlz.i // guarantee that interruption collection is on
896 ;; 900 ;;
897 //(p15) ssm psr.i // restore psr.i 901 //(p15) ssm psr.i // restore psr.i
898 addl r14=@gprel(ia64_leave_hypervisor_prepare),gp 902 addl r14=@gprel(ia64_leave_hypervisor_prepare),gp
899 ;; 903 ;;
900 KVM_SAVE_REST 904 KVM_SAVE_REST
901 KVM_SAVE_EXTRA 905 KVM_SAVE_EXTRA
902 mov rp=r14 906 mov rp=r14
903 ;; 907 ;;
904 adds out1=16,sp //regs 908 adds out1=16,sp //regs
905 br.call.sptk.many b6=kvm_emulate 909 br.call.sptk.many b6=kvm_emulate
906END(kvm_dispatch_virtualization_fault) 910END(kvm_dispatch_virtualization_fault)
907 911
908 912
909ENTRY(kvm_dispatch_interrupt) 913ENTRY(kvm_dispatch_interrupt)
910 KVM_SAVE_MIN_WITH_COVER_R19 // uses r31; defines r2 and r3 914 KVM_SAVE_MIN_WITH_COVER_R19 // uses r31; defines r2 and r3
911 ;; 915 ;;
912 alloc r14=ar.pfs,0,0,1,0 // must be first in an insn group 916 alloc r14=ar.pfs,0,0,1,0 // must be first in an insn group
913 //mov out0=cr.ivr // pass cr.ivr as first arg 917 adds r3=8,r2 // set up second base pointer for SAVE_REST
914 adds r3=8,r2 // set up second base pointer for SAVE_REST 918 ;;
915 ;; 919 ssm psr.ic
916 ssm psr.ic 920 ;;
917 ;; 921 srlz.i
918 srlz.i 922 ;;
919 ;; 923 //(p15) ssm psr.i
920 //(p15) ssm psr.i 924 addl r14=@gprel(ia64_leave_hypervisor),gp
921 addl r14=@gprel(ia64_leave_hypervisor),gp 925 ;;
922 ;; 926 KVM_SAVE_REST
923 KVM_SAVE_REST 927 mov rp=r14
924 mov rp=r14 928 ;;
925 ;; 929 mov out0=r13 // pass pointer to pt_regs as second arg
926 mov out0=r13 // pass pointer to pt_regs as second arg 930 br.call.sptk.many b6=kvm_ia64_handle_irq
927 br.call.sptk.many b6=kvm_ia64_handle_irq
928END(kvm_dispatch_interrupt) 931END(kvm_dispatch_interrupt)
929 932
930
931
932
933GLOBAL_ENTRY(ia64_leave_nested) 933GLOBAL_ENTRY(ia64_leave_nested)
934 rsm psr.i 934 rsm psr.i
935 ;; 935 ;;
@@ -1008,7 +1008,7 @@ GLOBAL_ENTRY(ia64_leave_nested)
1008 ;; 1008 ;;
1009 ldf.fill f11=[r2] 1009 ldf.fill f11=[r2]
1010// mov r18=r13 1010// mov r18=r13
1011// mov r21=r13 1011// mov r21=r13
1012 adds r16=PT(CR_IPSR)+16,r12 1012 adds r16=PT(CR_IPSR)+16,r12
1013 adds r17=PT(CR_IIP)+16,r12 1013 adds r17=PT(CR_IIP)+16,r12
1014 ;; 1014 ;;
@@ -1058,138 +1058,135 @@ GLOBAL_ENTRY(ia64_leave_nested)
1058 rfi 1058 rfi
1059END(ia64_leave_nested) 1059END(ia64_leave_nested)
1060 1060
1061
1062
1063GLOBAL_ENTRY(ia64_leave_hypervisor_prepare) 1061GLOBAL_ENTRY(ia64_leave_hypervisor_prepare)
1064 /* 1062/*
1065 * work.need_resched etc. mustn't get changed 1063 * work.need_resched etc. mustn't get changed
1066 *by this CPU before it returns to 1064 *by this CPU before it returns to
1067 ;; 1065 * user- or fsys-mode, hence we disable interrupts early on:
1068 * user- or fsys-mode, hence we disable interrupts early on: 1066 */
1069 */ 1067 adds r2 = PT(R4)+16,r12
1070 adds r2 = PT(R4)+16,r12 1068 adds r3 = PT(R5)+16,r12
1071 adds r3 = PT(R5)+16,r12 1069 adds r8 = PT(EML_UNAT)+16,r12
1072 adds r8 = PT(EML_UNAT)+16,r12 1070 ;;
1073 ;; 1071 ld8 r8 = [r8]
1074 ld8 r8 = [r8] 1072 ;;
1075 ;; 1073 mov ar.unat=r8
1076 mov ar.unat=r8 1074 ;;
1077 ;; 1075 ld8.fill r4=[r2],16 //load r4
1078 ld8.fill r4=[r2],16 //load r4 1076 ld8.fill r5=[r3],16 //load r5
1079 ld8.fill r5=[r3],16 //load r5 1077 ;;
1080 ;; 1078 ld8.fill r6=[r2] //load r6
1081 ld8.fill r6=[r2] //load r6 1079 ld8.fill r7=[r3] //load r7
1082 ld8.fill r7=[r3] //load r7 1080 ;;
1083 ;;
1084END(ia64_leave_hypervisor_prepare) 1081END(ia64_leave_hypervisor_prepare)
1085//fall through 1082//fall through
1086GLOBAL_ENTRY(ia64_leave_hypervisor) 1083GLOBAL_ENTRY(ia64_leave_hypervisor)
1087 rsm psr.i 1084 rsm psr.i
1088 ;; 1085 ;;
1089 br.call.sptk.many b0=leave_hypervisor_tail 1086 br.call.sptk.many b0=leave_hypervisor_tail
1090 ;; 1087 ;;
1091 adds r20=PT(PR)+16,r12 1088 adds r20=PT(PR)+16,r12
1092 adds r8=PT(EML_UNAT)+16,r12 1089 adds r8=PT(EML_UNAT)+16,r12
1093 ;; 1090 ;;
1094 ld8 r8=[r8] 1091 ld8 r8=[r8]
1095 ;; 1092 ;;
1096 mov ar.unat=r8 1093 mov ar.unat=r8
1097 ;; 1094 ;;
1098 lfetch [r20],PT(CR_IPSR)-PT(PR) 1095 lfetch [r20],PT(CR_IPSR)-PT(PR)
1099 adds r2 = PT(B6)+16,r12 1096 adds r2 = PT(B6)+16,r12
1100 adds r3 = PT(B7)+16,r12 1097 adds r3 = PT(B7)+16,r12
1101 ;; 1098 ;;
1102 lfetch [r20] 1099 lfetch [r20]
1103 ;; 1100 ;;
1104 ld8 r24=[r2],16 /* B6 */ 1101 ld8 r24=[r2],16 /* B6 */
1105 ld8 r25=[r3],16 /* B7 */ 1102 ld8 r25=[r3],16 /* B7 */
1106 ;; 1103 ;;
1107 ld8 r26=[r2],16 /* ar_csd */ 1104 ld8 r26=[r2],16 /* ar_csd */
1108 ld8 r27=[r3],16 /* ar_ssd */ 1105 ld8 r27=[r3],16 /* ar_ssd */
1109 mov b6 = r24 1106 mov b6 = r24
1110 ;; 1107 ;;
1111 ld8.fill r8=[r2],16 1108 ld8.fill r8=[r2],16
1112 ld8.fill r9=[r3],16 1109 ld8.fill r9=[r3],16
1113 mov b7 = r25 1110 mov b7 = r25
1114 ;; 1111 ;;
1115 mov ar.csd = r26 1112 mov ar.csd = r26
1116 mov ar.ssd = r27 1113 mov ar.ssd = r27
1117 ;; 1114 ;;
1118 ld8.fill r10=[r2],PT(R15)-PT(R10) 1115 ld8.fill r10=[r2],PT(R15)-PT(R10)
1119 ld8.fill r11=[r3],PT(R14)-PT(R11) 1116 ld8.fill r11=[r3],PT(R14)-PT(R11)
1120 ;; 1117 ;;
1121 ld8.fill r15=[r2],PT(R16)-PT(R15) 1118 ld8.fill r15=[r2],PT(R16)-PT(R15)
1122 ld8.fill r14=[r3],PT(R17)-PT(R14) 1119 ld8.fill r14=[r3],PT(R17)-PT(R14)
1123 ;; 1120 ;;
1124 ld8.fill r16=[r2],16 1121 ld8.fill r16=[r2],16
1125 ld8.fill r17=[r3],16 1122 ld8.fill r17=[r3],16
1126 ;; 1123 ;;
1127 ld8.fill r18=[r2],16 1124 ld8.fill r18=[r2],16
1128 ld8.fill r19=[r3],16 1125 ld8.fill r19=[r3],16
1129 ;; 1126 ;;
1130 ld8.fill r20=[r2],16 1127 ld8.fill r20=[r2],16
1131 ld8.fill r21=[r3],16 1128 ld8.fill r21=[r3],16
1132 ;; 1129 ;;
1133 ld8.fill r22=[r2],16 1130 ld8.fill r22=[r2],16
1134 ld8.fill r23=[r3],16 1131 ld8.fill r23=[r3],16
1135 ;; 1132 ;;
1136 ld8.fill r24=[r2],16 1133 ld8.fill r24=[r2],16
1137 ld8.fill r25=[r3],16 1134 ld8.fill r25=[r3],16
1138 ;; 1135 ;;
1139 ld8.fill r26=[r2],16 1136 ld8.fill r26=[r2],16
1140 ld8.fill r27=[r3],16 1137 ld8.fill r27=[r3],16
1141 ;; 1138 ;;
1142 ld8.fill r28=[r2],16 1139 ld8.fill r28=[r2],16
1143 ld8.fill r29=[r3],16 1140 ld8.fill r29=[r3],16
1144 ;; 1141 ;;
1145 ld8.fill r30=[r2],PT(F6)-PT(R30) 1142 ld8.fill r30=[r2],PT(F6)-PT(R30)
1146 ld8.fill r31=[r3],PT(F7)-PT(R31) 1143 ld8.fill r31=[r3],PT(F7)-PT(R31)
1147 ;; 1144 ;;
1148 rsm psr.i | psr.ic 1145 rsm psr.i | psr.ic
1149 // initiate turning off of interrupt and interruption collection 1146 // initiate turning off of interrupt and interruption collection
1150 invala // invalidate ALAT 1147 invala // invalidate ALAT
1151 ;; 1148 ;;
1152 srlz.i // ensure interruption collection is off 1149 srlz.i // ensure interruption collection is off
1153 ;; 1150 ;;
1154 bsw.0 1151 bsw.0
1155 ;; 1152 ;;
1156 adds r16 = PT(CR_IPSR)+16,r12 1153 adds r16 = PT(CR_IPSR)+16,r12
1157 adds r17 = PT(CR_IIP)+16,r12 1154 adds r17 = PT(CR_IIP)+16,r12
1158 mov r21=r13 // get current 1155 mov r21=r13 // get current
1159 ;; 1156 ;;
1160 ld8 r31=[r16],16 // load cr.ipsr 1157 ld8 r31=[r16],16 // load cr.ipsr
1161 ld8 r30=[r17],16 // load cr.iip 1158 ld8 r30=[r17],16 // load cr.iip
1162 ;; 1159 ;;
1163 ld8 r29=[r16],16 // load cr.ifs 1160 ld8 r29=[r16],16 // load cr.ifs
1164 ld8 r28=[r17],16 // load ar.unat 1161 ld8 r28=[r17],16 // load ar.unat
1165 ;; 1162 ;;
1166 ld8 r27=[r16],16 // load ar.pfs 1163 ld8 r27=[r16],16 // load ar.pfs
1167 ld8 r26=[r17],16 // load ar.rsc 1164 ld8 r26=[r17],16 // load ar.rsc
1168 ;; 1165 ;;
1169 ld8 r25=[r16],16 // load ar.rnat 1166 ld8 r25=[r16],16 // load ar.rnat
1170 ld8 r24=[r17],16 // load ar.bspstore 1167 ld8 r24=[r17],16 // load ar.bspstore
1171 ;; 1168 ;;
1172 ld8 r23=[r16],16 // load predicates 1169 ld8 r23=[r16],16 // load predicates
1173 ld8 r22=[r17],16 // load b0 1170 ld8 r22=[r17],16 // load b0
1174 ;; 1171 ;;
1175 ld8 r20=[r16],16 // load ar.rsc value for "loadrs" 1172 ld8 r20=[r16],16 // load ar.rsc value for "loadrs"
1176 ld8.fill r1=[r17],16 //load r1 1173 ld8.fill r1=[r17],16 //load r1
1177 ;; 1174 ;;
1178 ld8.fill r12=[r16],16 //load r12 1175 ld8.fill r12=[r16],16 //load r12
1179 ld8.fill r13=[r17],PT(R2)-PT(R13) //load r13 1176 ld8.fill r13=[r17],PT(R2)-PT(R13) //load r13
1180 ;; 1177 ;;
1181 ld8 r19=[r16],PT(R3)-PT(AR_FPSR) //load ar_fpsr 1178 ld8 r19=[r16],PT(R3)-PT(AR_FPSR) //load ar_fpsr
1182 ld8.fill r2=[r17],PT(AR_CCV)-PT(R2) //load r2 1179 ld8.fill r2=[r17],PT(AR_CCV)-PT(R2) //load r2
1183 ;; 1180 ;;
1184 ld8.fill r3=[r16] //load r3 1181 ld8.fill r3=[r16] //load r3
1185 ld8 r18=[r17] //load ar_ccv 1182 ld8 r18=[r17] //load ar_ccv
1186 ;; 1183 ;;
1187 mov ar.fpsr=r19 1184 mov ar.fpsr=r19
1188 mov ar.ccv=r18 1185 mov ar.ccv=r18
1189 shr.u r18=r20,16 1186 shr.u r18=r20,16
1190 ;; 1187 ;;
1191kvm_rbs_switch: 1188kvm_rbs_switch:
1192 mov r19=96 1189 mov r19=96
1193 1190
1194kvm_dont_preserve_current_frame: 1191kvm_dont_preserve_current_frame:
1195/* 1192/*
@@ -1201,76 +1198,76 @@ kvm_dont_preserve_current_frame:
1201# define pReturn p7 1198# define pReturn p7
1202# define Nregs 14 1199# define Nregs 14
1203 1200
1204 alloc loc0=ar.pfs,2,Nregs-2,2,0 1201 alloc loc0=ar.pfs,2,Nregs-2,2,0
1205 shr.u loc1=r18,9 // RNaTslots <= floor(dirtySize / (64*8)) 1202 shr.u loc1=r18,9 // RNaTslots <= floor(dirtySize / (64*8))
1206 sub r19=r19,r18 // r19 = (physStackedSize + 8) - dirtySize 1203 sub r19=r19,r18 // r19 = (physStackedSize + 8) - dirtySize
1207 ;; 1204 ;;
1208 mov ar.rsc=r20 // load ar.rsc to be used for "loadrs" 1205 mov ar.rsc=r20 // load ar.rsc to be used for "loadrs"
1209 shladd in0=loc1,3,r19 1206 shladd in0=loc1,3,r19
1210 mov in1=0 1207 mov in1=0
1211 ;; 1208 ;;
1212 TEXT_ALIGN(32) 1209 TEXT_ALIGN(32)
1213kvm_rse_clear_invalid: 1210kvm_rse_clear_invalid:
1214 alloc loc0=ar.pfs,2,Nregs-2,2,0 1211 alloc loc0=ar.pfs,2,Nregs-2,2,0
1215 cmp.lt pRecurse,p0=Nregs*8,in0 1212 cmp.lt pRecurse,p0=Nregs*8,in0
1216 // if more than Nregs regs left to clear, (re)curse 1213 // if more than Nregs regs left to clear, (re)curse
1217 add out0=-Nregs*8,in0 1214 add out0=-Nregs*8,in0
1218 add out1=1,in1 // increment recursion count 1215 add out1=1,in1 // increment recursion count
1219 mov loc1=0 1216 mov loc1=0
1220 mov loc2=0 1217 mov loc2=0
1221 ;; 1218 ;;
1222 mov loc3=0 1219 mov loc3=0
1223 mov loc4=0 1220 mov loc4=0
1224 mov loc5=0 1221 mov loc5=0
1225 mov loc6=0 1222 mov loc6=0
1226 mov loc7=0 1223 mov loc7=0
1227(pRecurse) br.call.dptk.few b0=kvm_rse_clear_invalid 1224(pRecurse) br.call.dptk.few b0=kvm_rse_clear_invalid
1228 ;; 1225 ;;
1229 mov loc8=0 1226 mov loc8=0
1230 mov loc9=0 1227 mov loc9=0
1231 cmp.ne pReturn,p0=r0,in1 1228 cmp.ne pReturn,p0=r0,in1
1232 // if recursion count != 0, we need to do a br.ret 1229 // if recursion count != 0, we need to do a br.ret
1233 mov loc10=0 1230 mov loc10=0
1234 mov loc11=0 1231 mov loc11=0
1235(pReturn) br.ret.dptk.many b0 1232(pReturn) br.ret.dptk.many b0
1236 1233
1237# undef pRecurse 1234# undef pRecurse
1238# undef pReturn 1235# undef pReturn
1239 1236
1240// loadrs has already been shifted 1237// loadrs has already been shifted
1241 alloc r16=ar.pfs,0,0,0,0 // drop current register frame 1238 alloc r16=ar.pfs,0,0,0,0 // drop current register frame
1242 ;; 1239 ;;
1243 loadrs 1240 loadrs
1244 ;; 1241 ;;
1245 mov ar.bspstore=r24 1242 mov ar.bspstore=r24
1246 ;; 1243 ;;
1247 mov ar.unat=r28 1244 mov ar.unat=r28
1248 mov ar.rnat=r25 1245 mov ar.rnat=r25
1249 mov ar.rsc=r26 1246 mov ar.rsc=r26
1250 ;; 1247 ;;
1251 mov cr.ipsr=r31 1248 mov cr.ipsr=r31
1252 mov cr.iip=r30 1249 mov cr.iip=r30
1253 mov cr.ifs=r29 1250 mov cr.ifs=r29
1254 mov ar.pfs=r27 1251 mov ar.pfs=r27
1255 adds r18=VMM_VPD_BASE_OFFSET,r21 1252 adds r18=VMM_VPD_BASE_OFFSET,r21
1256 ;; 1253 ;;
1257 ld8 r18=[r18] //vpd 1254 ld8 r18=[r18] //vpd
1258 adds r17=VMM_VCPU_ISR_OFFSET,r21 1255 adds r17=VMM_VCPU_ISR_OFFSET,r21
1259 ;; 1256 ;;
1260 ld8 r17=[r17] 1257 ld8 r17=[r17]
1261 adds r19=VMM_VPD_VPSR_OFFSET,r18 1258 adds r19=VMM_VPD_VPSR_OFFSET,r18
1262 ;; 1259 ;;
1263 ld8 r19=[r19] //vpsr 1260 ld8 r19=[r19] //vpsr
1264 mov r25=r18 1261 mov r25=r18
1265 adds r16= VMM_VCPU_GP_OFFSET,r21 1262 adds r16= VMM_VCPU_GP_OFFSET,r21
1266 ;; 1263 ;;
1267 ld8 r16= [r16] // Put gp in r24 1264 ld8 r16= [r16] // Put gp in r24
1268 movl r24=@gprel(ia64_vmm_entry) // calculate return address 1265 movl r24=@gprel(ia64_vmm_entry) // calculate return address
1269 ;; 1266 ;;
1270 add r24=r24,r16 1267 add r24=r24,r16
1271 ;; 1268 ;;
1272 br.sptk.many kvm_vps_sync_write // call the service 1269 br.sptk.many kvm_vps_sync_write // call the service
1273 ;; 1270 ;;
1274END(ia64_leave_hypervisor) 1271END(ia64_leave_hypervisor)
1275// fall through 1272// fall through
1276GLOBAL_ENTRY(ia64_vmm_entry) 1273GLOBAL_ENTRY(ia64_vmm_entry)
@@ -1283,16 +1280,14 @@ GLOBAL_ENTRY(ia64_vmm_entry)
1283 * r22:b0 1280 * r22:b0
1284 * r23:predicate 1281 * r23:predicate
1285 */ 1282 */
1286 mov r24=r22 1283 mov r24=r22
1287 mov r25=r18 1284 mov r25=r18
1288 tbit.nz p1,p2 = r19,IA64_PSR_IC_BIT // p1=vpsr.ic 1285 tbit.nz p1,p2 = r19,IA64_PSR_IC_BIT // p1=vpsr.ic
1289 (p1) br.cond.sptk.few kvm_vps_resume_normal 1286(p1) br.cond.sptk.few kvm_vps_resume_normal
1290 (p2) br.cond.sptk.many kvm_vps_resume_handler 1287(p2) br.cond.sptk.many kvm_vps_resume_handler
1291 ;; 1288 ;;
1292END(ia64_vmm_entry) 1289END(ia64_vmm_entry)
1293 1290
1294
1295
1296/* 1291/*
1297 * extern u64 ia64_call_vsa(u64 proc, u64 arg1, u64 arg2, 1292 * extern u64 ia64_call_vsa(u64 proc, u64 arg1, u64 arg2,
1298 * u64 arg3, u64 arg4, u64 arg5, 1293 * u64 arg3, u64 arg4, u64 arg5,
@@ -1310,88 +1305,88 @@ psrsave = loc2
1310entry = loc3 1305entry = loc3
1311hostret = r24 1306hostret = r24
1312 1307
1313 alloc pfssave=ar.pfs,4,4,0,0 1308 alloc pfssave=ar.pfs,4,4,0,0
1314 mov rpsave=rp 1309 mov rpsave=rp
1315 adds entry=VMM_VCPU_VSA_BASE_OFFSET, r13 1310 adds entry=VMM_VCPU_VSA_BASE_OFFSET, r13
1316 ;; 1311 ;;
1317 ld8 entry=[entry] 1312 ld8 entry=[entry]
13181: mov hostret=ip 13131: mov hostret=ip
1319 mov r25=in1 // copy arguments 1314 mov r25=in1 // copy arguments
1320 mov r26=in2 1315 mov r26=in2
1321 mov r27=in3 1316 mov r27=in3
1322 mov psrsave=psr 1317 mov psrsave=psr
1323 ;; 1318 ;;
1324 tbit.nz p6,p0=psrsave,14 // IA64_PSR_I 1319 tbit.nz p6,p0=psrsave,14 // IA64_PSR_I
1325 tbit.nz p7,p0=psrsave,13 // IA64_PSR_IC 1320 tbit.nz p7,p0=psrsave,13 // IA64_PSR_IC
1326 ;; 1321 ;;
1327 add hostret=2f-1b,hostret // calculate return address 1322 add hostret=2f-1b,hostret // calculate return address
1328 add entry=entry,in0 1323 add entry=entry,in0
1329 ;; 1324 ;;
1330 rsm psr.i | psr.ic 1325 rsm psr.i | psr.ic
1331 ;; 1326 ;;
1332 srlz.i 1327 srlz.i
1333 mov b6=entry 1328 mov b6=entry
1334 br.cond.sptk b6 // call the service 1329 br.cond.sptk b6 // call the service
13352: 13302:
1336 // Architectural sequence for enabling interrupts if necessary 1331// Architectural sequence for enabling interrupts if necessary
1337(p7) ssm psr.ic 1332(p7) ssm psr.ic
1338 ;; 1333 ;;
1339(p7) srlz.i 1334(p7) srlz.i
1340 ;; 1335 ;;
1341//(p6) ssm psr.i 1336//(p6) ssm psr.i
1342 ;; 1337 ;;
1343 mov rp=rpsave 1338 mov rp=rpsave
1344 mov ar.pfs=pfssave 1339 mov ar.pfs=pfssave
1345 mov r8=r31 1340 mov r8=r31
1346 ;; 1341 ;;
1347 srlz.d 1342 srlz.d
1348 br.ret.sptk rp 1343 br.ret.sptk rp
1349 1344
1350END(ia64_call_vsa) 1345END(ia64_call_vsa)
1351 1346
1352#define INIT_BSPSTORE ((4<<30)-(12<<20)-0x100) 1347#define INIT_BSPSTORE ((4<<30)-(12<<20)-0x100)
1353 1348
1354GLOBAL_ENTRY(vmm_reset_entry) 1349GLOBAL_ENTRY(vmm_reset_entry)
1355 //set up ipsr, iip, vpd.vpsr, dcr 1350 //set up ipsr, iip, vpd.vpsr, dcr
1356 // For IPSR: it/dt/rt=1, i/ic=1, si=1, vm/bn=1 1351 // For IPSR: it/dt/rt=1, i/ic=1, si=1, vm/bn=1
1357 // For DCR: all bits 0 1352 // For DCR: all bits 0
1358 bsw.0 1353 bsw.0
1359 ;; 1354 ;;
1360 mov r21 =r13 1355 mov r21 =r13
1361 adds r14=-VMM_PT_REGS_SIZE, r12 1356 adds r14=-VMM_PT_REGS_SIZE, r12
1362 ;; 1357 ;;
1363 movl r6=0x501008826000 // IPSR dt/rt/it:1;i/ic:1, si:1, vm/bn:1 1358 movl r6=0x501008826000 // IPSR dt/rt/it:1;i/ic:1, si:1, vm/bn:1
1364 movl r10=0x8000000000000000 1359 movl r10=0x8000000000000000
1365 adds r16=PT(CR_IIP), r14 1360 adds r16=PT(CR_IIP), r14
1366 adds r20=PT(R1), r14 1361 adds r20=PT(R1), r14
1367 ;; 1362 ;;
1368 rsm psr.ic | psr.i 1363 rsm psr.ic | psr.i
1369 ;; 1364 ;;
1370 srlz.i 1365 srlz.i
1371 ;; 1366 ;;
1372 mov ar.rsc = 0 1367 mov ar.rsc = 0
1373 ;; 1368 ;;
1374 flushrs 1369 flushrs
1375 ;; 1370 ;;
1376 mov ar.bspstore = 0 1371 mov ar.bspstore = 0
1377 // clear BSPSTORE 1372 // clear BSPSTORE
1378 ;; 1373 ;;
1379 mov cr.ipsr=r6 1374 mov cr.ipsr=r6
1380 mov cr.ifs=r10 1375 mov cr.ifs=r10
1381 ld8 r4 = [r16] // Set init iip for first run. 1376 ld8 r4 = [r16] // Set init iip for first run.
1382 ld8 r1 = [r20] 1377 ld8 r1 = [r20]
1383 ;; 1378 ;;
1384 mov cr.iip=r4 1379 mov cr.iip=r4
1385 adds r16=VMM_VPD_BASE_OFFSET,r13 1380 adds r16=VMM_VPD_BASE_OFFSET,r13
1386 ;; 1381 ;;
1387 ld8 r18=[r16] 1382 ld8 r18=[r16]
1388 ;; 1383 ;;
1389 adds r19=VMM_VPD_VPSR_OFFSET,r18 1384 adds r19=VMM_VPD_VPSR_OFFSET,r18
1390 ;; 1385 ;;
1391 ld8 r19=[r19] 1386 ld8 r19=[r19]
1392 mov r17=r0 1387 mov r17=r0
1393 mov r22=r0 1388 mov r22=r0
1394 mov r23=r0 1389 mov r23=r0
1395 br.cond.sptk ia64_vmm_entry 1390 br.cond.sptk ia64_vmm_entry
1396 br.ret.sptk b0 1391 br.ret.sptk b0
1397END(vmm_reset_entry) 1392END(vmm_reset_entry)
diff --git a/arch/ia64/kvm/vtlb.c b/arch/ia64/kvm/vtlb.c
index e22b93361e08..6b6307a3bd55 100644
--- a/arch/ia64/kvm/vtlb.c
+++ b/arch/ia64/kvm/vtlb.c
@@ -183,8 +183,8 @@ void mark_pages_dirty(struct kvm_vcpu *v, u64 pte, u64 ps)
183 u64 i, dirty_pages = 1; 183 u64 i, dirty_pages = 1;
184 u64 base_gfn = (pte&_PAGE_PPN_MASK) >> PAGE_SHIFT; 184 u64 base_gfn = (pte&_PAGE_PPN_MASK) >> PAGE_SHIFT;
185 spinlock_t *lock = __kvm_va(v->arch.dirty_log_lock_pa); 185 spinlock_t *lock = __kvm_va(v->arch.dirty_log_lock_pa);
186 void *dirty_bitmap = (void *)v - (KVM_VCPU_OFS + v->vcpu_id * VCPU_SIZE) 186 void *dirty_bitmap = (void *)KVM_MEM_DIRTY_LOG_BASE;
187 + KVM_MEM_DIRTY_LOG_OFS; 187
188 dirty_pages <<= ps <= PAGE_SHIFT ? 0 : ps - PAGE_SHIFT; 188 dirty_pages <<= ps <= PAGE_SHIFT ? 0 : ps - PAGE_SHIFT;
189 189
190 vmm_spin_lock(lock); 190 vmm_spin_lock(lock);
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c
index 054bcd9439aa..56e12903973c 100644
--- a/arch/ia64/mm/init.c
+++ b/arch/ia64/mm/init.c
@@ -692,7 +692,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
692 pgdat = NODE_DATA(nid); 692 pgdat = NODE_DATA(nid);
693 693
694 zone = pgdat->node_zones + ZONE_NORMAL; 694 zone = pgdat->node_zones + ZONE_NORMAL;
695 ret = __add_pages(zone, start_pfn, nr_pages); 695 ret = __add_pages(nid, zone, start_pfn, nr_pages);
696 696
697 if (ret) 697 if (ret)
698 printk("%s: Problem encountered in __add_pages() as ret=%d\n", 698 printk("%s: Problem encountered in __add_pages() as ret=%d\n",
diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
index bc610a6c7851..c5a214026a77 100644
--- a/arch/ia64/sn/kernel/io_acpi_init.c
+++ b/arch/ia64/sn/kernel/io_acpi_init.c
@@ -13,7 +13,6 @@
13#include <asm/sn/sn_sal.h> 13#include <asm/sn/sn_sal.h>
14#include "xtalk/hubdev.h" 14#include "xtalk/hubdev.h"
15#include <linux/acpi.h> 15#include <linux/acpi.h>
16#include <acpi/acnamesp.h>
17 16
18 17
19/* 18/*
@@ -64,6 +63,7 @@ static acpi_status __init
64sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret) 63sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
65{ 64{
66 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 65 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
66 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
67 u64 addr; 67 u64 addr;
68 struct hubdev_info *hubdev; 68 struct hubdev_info *hubdev;
69 struct hubdev_info *hubdev_ptr; 69 struct hubdev_info *hubdev_ptr;
@@ -77,11 +77,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
77 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS, 77 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
78 &sn_uuid, &buffer); 78 &sn_uuid, &buffer);
79 if (ACPI_FAILURE(status)) { 79 if (ACPI_FAILURE(status)) {
80 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
80 printk(KERN_ERR 81 printk(KERN_ERR
81 "sn_acpi_hubdev_init: acpi_get_vendor_resource() " 82 "sn_acpi_hubdev_init: acpi_get_vendor_resource() "
82 "(0x%x) failed for: ", status); 83 "(0x%x) failed for: %s\n", status,
83 acpi_ns_print_node_pathname(handle, NULL); 84 (char *)name_buffer.pointer);
84 printk("\n"); 85 kfree(name_buffer.pointer);
85 return AE_OK; /* Continue walking namespace */ 86 return AE_OK; /* Continue walking namespace */
86 } 87 }
87 88
@@ -89,11 +90,12 @@ sn_acpi_hubdev_init(acpi_handle handle, u32 depth, void *context, void **ret)
89 vendor = &resource->data.vendor_typed; 90 vendor = &resource->data.vendor_typed;
90 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) != 91 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
91 sizeof(struct hubdev_info *)) { 92 sizeof(struct hubdev_info *)) {
93 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
92 printk(KERN_ERR 94 printk(KERN_ERR
93 "sn_acpi_hubdev_init: Invalid vendor data length: %d for: ", 95 "sn_acpi_hubdev_init: Invalid vendor data length: "
94 vendor->byte_length); 96 "%d for: %s\n",
95 acpi_ns_print_node_pathname(handle, NULL); 97 vendor->byte_length, (char *)name_buffer.pointer);
96 printk("\n"); 98 kfree(name_buffer.pointer);
97 goto exit; 99 goto exit;
98 } 100 }
99 101
@@ -120,6 +122,7 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
120{ 122{
121 u64 addr; 123 u64 addr;
122 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 124 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
125 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
123 acpi_handle handle; 126 acpi_handle handle;
124 struct pcibus_bussoft *prom_bussoft_ptr; 127 struct pcibus_bussoft *prom_bussoft_ptr;
125 struct acpi_resource *resource; 128 struct acpi_resource *resource;
@@ -131,11 +134,11 @@ sn_get_bussoft_ptr(struct pci_bus *bus)
131 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS, 134 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
132 &sn_uuid, &buffer); 135 &sn_uuid, &buffer);
133 if (ACPI_FAILURE(status)) { 136 if (ACPI_FAILURE(status)) {
137 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
134 printk(KERN_ERR "%s: " 138 printk(KERN_ERR "%s: "
135 "acpi_get_vendor_resource() failed (0x%x) for: ", 139 "acpi_get_vendor_resource() failed (0x%x) for: %s\n",
136 __func__, status); 140 __func__, status, (char *)name_buffer.pointer);
137 acpi_ns_print_node_pathname(handle, NULL); 141 kfree(name_buffer.pointer);
138 printk("\n");
139 return NULL; 142 return NULL;
140 } 143 }
141 resource = buffer.pointer; 144 resource = buffer.pointer;
@@ -168,6 +171,7 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
168{ 171{
169 u64 addr; 172 u64 addr;
170 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 173 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
174 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
171 struct sn_irq_info *irq_info, *irq_info_prom; 175 struct sn_irq_info *irq_info, *irq_info_prom;
172 struct pcidev_info *pcidev_ptr, *pcidev_prom_ptr; 176 struct pcidev_info *pcidev_ptr, *pcidev_prom_ptr;
173 struct acpi_resource *resource; 177 struct acpi_resource *resource;
@@ -182,11 +186,11 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
182 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS, 186 status = acpi_get_vendor_resource(handle, METHOD_NAME__CRS,
183 &sn_uuid, &buffer); 187 &sn_uuid, &buffer);
184 if (ACPI_FAILURE(status)) { 188 if (ACPI_FAILURE(status)) {
189 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
185 printk(KERN_ERR 190 printk(KERN_ERR
186 "%s: acpi_get_vendor_resource() failed (0x%x) for: ", 191 "%s: acpi_get_vendor_resource() failed (0x%x) for: %s\n",
187 __func__, status); 192 __func__, status, (char *)name_buffer.pointer);
188 acpi_ns_print_node_pathname(handle, NULL); 193 kfree(name_buffer.pointer);
189 printk("\n");
190 return 1; 194 return 1;
191 } 195 }
192 196
@@ -194,11 +198,12 @@ sn_extract_device_info(acpi_handle handle, struct pcidev_info **pcidev_info,
194 vendor = &resource->data.vendor_typed; 198 vendor = &resource->data.vendor_typed;
195 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) != 199 if ((vendor->byte_length - sizeof(struct acpi_vendor_uuid)) !=
196 sizeof(struct pci_devdev_info *)) { 200 sizeof(struct pci_devdev_info *)) {
201 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
197 printk(KERN_ERR 202 printk(KERN_ERR
198 "%s: Invalid vendor data length: %d for: ", 203 "%s: Invalid vendor data length: %d for: %s\n",
199 __func__, vendor->byte_length); 204 __func__, vendor->byte_length,
200 acpi_ns_print_node_pathname(handle, NULL); 205 (char *)name_buffer.pointer);
201 printk("\n"); 206 kfree(name_buffer.pointer);
202 ret = 1; 207 ret = 1;
203 goto exit; 208 goto exit;
204 } 209 }
@@ -239,6 +244,9 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
239 acpi_handle parent; 244 acpi_handle parent;
240 int slot; 245 int slot;
241 acpi_status status; 246 acpi_status status;
247 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
248
249 acpi_get_name(device_handle, ACPI_FULL_PATHNAME, &name_buffer);
242 250
243 /* 251 /*
244 * Do an upward search to find the root bus device, and 252 * Do an upward search to find the root bus device, and
@@ -249,9 +257,8 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
249 status = acpi_get_parent(child, &parent); 257 status = acpi_get_parent(child, &parent);
250 if (ACPI_FAILURE(status)) { 258 if (ACPI_FAILURE(status)) {
251 printk(KERN_ERR "%s: acpi_get_parent() failed " 259 printk(KERN_ERR "%s: acpi_get_parent() failed "
252 "(0x%x) for: ", __func__, status); 260 "(0x%x) for: %s\n", __func__, status,
253 acpi_ns_print_node_pathname(child, NULL); 261 (char *)name_buffer.pointer);
254 printk("\n");
255 panic("%s: Unable to find host devfn\n", __func__); 262 panic("%s: Unable to find host devfn\n", __func__);
256 } 263 }
257 if (parent == rootbus_handle) 264 if (parent == rootbus_handle)
@@ -259,22 +266,20 @@ get_host_devfn(acpi_handle device_handle, acpi_handle rootbus_handle)
259 child = parent; 266 child = parent;
260 } 267 }
261 if (!child) { 268 if (!child) {
262 printk(KERN_ERR "%s: Unable to find root bus for: ", 269 printk(KERN_ERR "%s: Unable to find root bus for: %s\n",
263 __func__); 270 __func__, (char *)name_buffer.pointer);
264 acpi_ns_print_node_pathname(device_handle, NULL);
265 printk("\n");
266 BUG(); 271 BUG();
267 } 272 }
268 273
269 status = acpi_evaluate_integer(child, METHOD_NAME__ADR, NULL, &adr); 274 status = acpi_evaluate_integer(child, METHOD_NAME__ADR, NULL, &adr);
270 if (ACPI_FAILURE(status)) { 275 if (ACPI_FAILURE(status)) {
271 printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: ", 276 printk(KERN_ERR "%s: Unable to get _ADR (0x%x) for: %s\n",
272 __func__, status); 277 __func__, status, (char *)name_buffer.pointer);
273 acpi_ns_print_node_pathname(child, NULL);
274 printk("\n");
275 panic("%s: Unable to find host devfn\n", __func__); 278 panic("%s: Unable to find host devfn\n", __func__);
276 } 279 }
277 280
281 kfree(name_buffer.pointer);
282
278 slot = (adr >> 16) & 0xffff; 283 slot = (adr >> 16) & 0xffff;
279 function = adr & 0xffff; 284 function = adr & 0xffff;
280 devfn = PCI_DEVFN(slot, function); 285 devfn = PCI_DEVFN(slot, function);
@@ -300,27 +305,28 @@ find_matching_device(acpi_handle handle, u32 lvl, void *context, void **rv)
300 int function; 305 int function;
301 int slot; 306 int slot;
302 struct sn_pcidev_match *info = context; 307 struct sn_pcidev_match *info = context;
308 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
303 309
304 status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, 310 status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL,
305 &adr); 311 &adr);
306 if (ACPI_SUCCESS(status)) { 312 if (ACPI_SUCCESS(status)) {
307 status = acpi_get_parent(handle, &parent); 313 status = acpi_get_parent(handle, &parent);
308 if (ACPI_FAILURE(status)) { 314 if (ACPI_FAILURE(status)) {
315 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
309 printk(KERN_ERR 316 printk(KERN_ERR
310 "%s: acpi_get_parent() failed (0x%x) for: ", 317 "%s: acpi_get_parent() failed (0x%x) for: %s\n",
311 __func__, status); 318 __func__, status, (char *)name_buffer.pointer);
312 acpi_ns_print_node_pathname(handle, NULL); 319 kfree(name_buffer.pointer);
313 printk("\n");
314 return AE_OK; 320 return AE_OK;
315 } 321 }
316 status = acpi_evaluate_integer(parent, METHOD_NAME__BBN, 322 status = acpi_evaluate_integer(parent, METHOD_NAME__BBN,
317 NULL, &bbn); 323 NULL, &bbn);
318 if (ACPI_FAILURE(status)) { 324 if (ACPI_FAILURE(status)) {
325 acpi_get_name(handle, ACPI_FULL_PATHNAME, &name_buffer);
319 printk(KERN_ERR 326 printk(KERN_ERR
320 "%s: Failed to find _BBN in parent of: ", 327 "%s: Failed to find _BBN in parent of: %s\n",
321 __func__); 328 __func__, (char *)name_buffer.pointer);
322 acpi_ns_print_node_pathname(handle, NULL); 329 kfree(name_buffer.pointer);
323 printk("\n");
324 return AE_OK; 330 return AE_OK;
325 } 331 }
326 332
@@ -350,24 +356,27 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
350 acpi_handle rootbus_handle; 356 acpi_handle rootbus_handle;
351 unsigned long long segment; 357 unsigned long long segment;
352 acpi_status status; 358 acpi_status status;
359 struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL };
353 360
354 rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle; 361 rootbus_handle = PCI_CONTROLLER(dev)->acpi_handle;
355 status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL, 362 status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL,
356 &segment); 363 &segment);
357 if (ACPI_SUCCESS(status)) { 364 if (ACPI_SUCCESS(status)) {
358 if (segment != pci_domain_nr(dev)) { 365 if (segment != pci_domain_nr(dev)) {
366 acpi_get_name(rootbus_handle, ACPI_FULL_PATHNAME,
367 &name_buffer);
359 printk(KERN_ERR 368 printk(KERN_ERR
360 "%s: Segment number mismatch, 0x%llx vs 0x%x for: ", 369 "%s: Segment number mismatch, 0x%llx vs 0x%x for: %s\n",
361 __func__, segment, pci_domain_nr(dev)); 370 __func__, segment, pci_domain_nr(dev),
362 acpi_ns_print_node_pathname(rootbus_handle, NULL); 371 (char *)name_buffer.pointer);
363 printk("\n"); 372 kfree(name_buffer.pointer);
364 return 1; 373 return 1;
365 } 374 }
366 } else { 375 } else {
367 printk(KERN_ERR "%s: Unable to get __SEG from: ", 376 acpi_get_name(rootbus_handle, ACPI_FULL_PATHNAME, &name_buffer);
368 __func__); 377 printk(KERN_ERR "%s: Unable to get __SEG from: %s\n",
369 acpi_ns_print_node_pathname(rootbus_handle, NULL); 378 __func__, (char *)name_buffer.pointer);
370 printk("\n"); 379 kfree(name_buffer.pointer);
371 return 1; 380 return 1;
372 } 381 }
373 382
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index 8a924a5661dd..0d4ffa4da1da 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -26,7 +26,6 @@
26#include <linux/acpi.h> 26#include <linux/acpi.h>
27#include <asm/sn/sn2/sn_hwperf.h> 27#include <asm/sn/sn2/sn_hwperf.h>
28#include <asm/sn/acpi.h> 28#include <asm/sn/acpi.h>
29#include "acpi/acglobal.h"
30 29
31extern void sn_init_cpei_timer(void); 30extern void sn_init_cpei_timer(void);
32extern void register_sn_procfs(void); 31extern void register_sn_procfs(void);
@@ -473,7 +472,7 @@ sn_io_early_init(void)
473 { 472 {
474 struct acpi_table_header *header = NULL; 473 struct acpi_table_header *header = NULL;
475 474
476 acpi_get_table_by_index(ACPI_TABLE_INDEX_DSDT, &header); 475 acpi_get_table(ACPI_SIG_DSDT, 1, &header);
477 BUG_ON(header == NULL); 476 BUG_ON(header == NULL);
478 sn_acpi_rev = header->oem_revision; 477 sn_acpi_rev = header->oem_revision;
479 } 478 }
@@ -505,7 +504,7 @@ sn_io_early_init(void)
505 504
506 { 505 {
507 struct acpi_table_header *header; 506 struct acpi_table_header *header;
508 (void)acpi_get_table_by_index(ACPI_TABLE_INDEX_DSDT, &header); 507 (void)acpi_get_table(ACPI_SIG_DSDT, 1, &header);
509 printk(KERN_INFO "ACPI DSDT OEM Rev 0x%x\n", 508 printk(KERN_INFO "ACPI DSDT OEM Rev 0x%x\n",
510 header->oem_revision); 509 header->oem_revision);
511 } 510 }
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 0c66dbdd1d72..66fd705e82c0 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -227,14 +227,14 @@ finish_up:
227 return new_irq_info; 227 return new_irq_info;
228} 228}
229 229
230static void sn_set_affinity_irq(unsigned int irq, cpumask_t mask) 230static void sn_set_affinity_irq(unsigned int irq, const struct cpumask *mask)
231{ 231{
232 struct sn_irq_info *sn_irq_info, *sn_irq_info_safe; 232 struct sn_irq_info *sn_irq_info, *sn_irq_info_safe;
233 nasid_t nasid; 233 nasid_t nasid;
234 int slice; 234 int slice;
235 235
236 nasid = cpuid_to_nasid(first_cpu(mask)); 236 nasid = cpuid_to_nasid(cpumask_first(mask));
237 slice = cpuid_to_slice(first_cpu(mask)); 237 slice = cpuid_to_slice(cpumask_first(mask));
238 238
239 list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe, 239 list_for_each_entry_safe(sn_irq_info, sn_irq_info_safe,
240 sn_irq_lh[irq], list) 240 sn_irq_lh[irq], list)
diff --git a/arch/ia64/sn/kernel/msi_sn.c b/arch/ia64/sn/kernel/msi_sn.c
index 83f190ffe350..ca553b0429ce 100644
--- a/arch/ia64/sn/kernel/msi_sn.c
+++ b/arch/ia64/sn/kernel/msi_sn.c
@@ -151,7 +151,8 @@ int sn_setup_msi_irq(struct pci_dev *pdev, struct msi_desc *entry)
151} 151}
152 152
153#ifdef CONFIG_SMP 153#ifdef CONFIG_SMP
154static void sn_set_msi_irq_affinity(unsigned int irq, cpumask_t cpu_mask) 154static void sn_set_msi_irq_affinity(unsigned int irq,
155 const struct cpumask *cpu_mask)
155{ 156{
156 struct msi_msg msg; 157 struct msi_msg msg;
157 int slice; 158 int slice;
@@ -164,7 +165,7 @@ static void sn_set_msi_irq_affinity(unsigned int irq, cpumask_t cpu_mask)
164 struct sn_pcibus_provider *provider; 165 struct sn_pcibus_provider *provider;
165 unsigned int cpu; 166 unsigned int cpu;
166 167
167 cpu = first_cpu(cpu_mask); 168 cpu = cpumask_first(cpu_mask);
168 sn_irq_info = sn_msi_info[irq].sn_irq_info; 169 sn_irq_info = sn_msi_info[irq].sn_irq_info;
169 if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0) 170 if (sn_irq_info == NULL || sn_irq_info->irq_int_bit >= 0)
170 return; 171 return;
@@ -204,7 +205,7 @@ static void sn_set_msi_irq_affinity(unsigned int irq, cpumask_t cpu_mask)
204 msg.address_lo = (u32)(bus_addr & 0x00000000ffffffff); 205 msg.address_lo = (u32)(bus_addr & 0x00000000ffffffff);
205 206
206 write_msi_msg(irq, &msg); 207 write_msi_msg(irq, &msg);
207 irq_desc[irq].affinity = cpu_mask; 208 irq_desc[irq].affinity = *cpu_mask;
208} 209}
209#endif /* CONFIG_SMP */ 210#endif /* CONFIG_SMP */
210 211
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index 636588e7e068..be339477f906 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -385,7 +385,6 @@ static int sn_topology_show(struct seq_file *s, void *d)
385 int j; 385 int j;
386 const char *slabname; 386 const char *slabname;
387 int ordinal; 387 int ordinal;
388 cpumask_t cpumask;
389 char slice; 388 char slice;
390 struct cpuinfo_ia64 *c; 389 struct cpuinfo_ia64 *c;
391 struct sn_hwperf_port_info *ptdata; 390 struct sn_hwperf_port_info *ptdata;
@@ -473,23 +472,21 @@ static int sn_topology_show(struct seq_file *s, void *d)
473 * CPUs on this node, if any 472 * CPUs on this node, if any
474 */ 473 */
475 if (!SN_HWPERF_IS_IONODE(obj)) { 474 if (!SN_HWPERF_IS_IONODE(obj)) {
476 cpumask = node_to_cpumask(ordinal); 475 for_each_cpu_and(i, cpu_online_mask,
477 for_each_online_cpu(i) { 476 cpumask_of_node(ordinal)) {
478 if (cpu_isset(i, cpumask)) { 477 slice = 'a' + cpuid_to_slice(i);
479 slice = 'a' + cpuid_to_slice(i); 478 c = cpu_data(i);
480 c = cpu_data(i); 479 seq_printf(s, "cpu %d %s%c local"
481 seq_printf(s, "cpu %d %s%c local" 480 " freq %luMHz, arch ia64",
482 " freq %luMHz, arch ia64", 481 i, obj->location, slice,
483 i, obj->location, slice, 482 c->proc_freq / 1000000);
484 c->proc_freq / 1000000); 483 for_each_online_cpu(j) {
485 for_each_online_cpu(j) { 484 seq_printf(s, j ? ":%d" : ", dist %d",
486 seq_printf(s, j ? ":%d" : ", dist %d", 485 node_distance(
487 node_distance(
488 cpu_to_node(i), 486 cpu_to_node(i),
489 cpu_to_node(j))); 487 cpu_to_node(j)));
490 }
491 seq_putc(s, '\n');
492 } 488 }
489 seq_putc(s, '\n');
493 } 490 }
494 } 491 }
495 } 492 }
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index a88eba3314d7..3f864238566d 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -206,8 +206,7 @@ cx_device_register(nasid_t nasid, int part_num, int mfg_num,
206 cx_dev->dev.parent = NULL; 206 cx_dev->dev.parent = NULL;
207 cx_dev->dev.bus = &tiocx_bus_type; 207 cx_dev->dev.bus = &tiocx_bus_type;
208 cx_dev->dev.release = tiocx_bus_release; 208 cx_dev->dev.release = tiocx_bus_release;
209 snprintf(cx_dev->dev.bus_id, BUS_ID_SIZE, "%d", 209 dev_set_name(&cx_dev->dev, "%d", cx_dev->cx_id.nasid);
210 cx_dev->cx_id.nasid);
211 device_register(&cx_dev->dev); 210 device_register(&cx_dev->dev);
212 get_device(&cx_dev->dev); 211 get_device(&cx_dev->dev);
213 212
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index 29047d5c259a..cabba332cc48 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -10,6 +10,7 @@ config M32R
10 default y 10 default y
11 select HAVE_IDE 11 select HAVE_IDE
12 select HAVE_OPROFILE 12 select HAVE_OPROFILE
13 select INIT_ALL_POSSIBLE
13 14
14config SBUS 15config SBUS
15 bool 16 bool
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index 39cb6da72dcb..2547d6c4a827 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -73,17 +73,11 @@ static unsigned int bsp_phys_id = -1;
73/* Bitmask of physically existing CPUs */ 73/* Bitmask of physically existing CPUs */
74physid_mask_t phys_cpu_present_map; 74physid_mask_t phys_cpu_present_map;
75 75
76/* Bitmask of currently online CPUs */
77cpumask_t cpu_online_map;
78EXPORT_SYMBOL(cpu_online_map);
79
80cpumask_t cpu_bootout_map; 76cpumask_t cpu_bootout_map;
81cpumask_t cpu_bootin_map; 77cpumask_t cpu_bootin_map;
82static cpumask_t cpu_callin_map; 78static cpumask_t cpu_callin_map;
83cpumask_t cpu_callout_map; 79cpumask_t cpu_callout_map;
84EXPORT_SYMBOL(cpu_callout_map); 80EXPORT_SYMBOL(cpu_callout_map);
85cpumask_t cpu_possible_map = CPU_MASK_ALL;
86EXPORT_SYMBOL(cpu_possible_map);
87 81
88/* Per CPU bogomips and other parameters */ 82/* Per CPU bogomips and other parameters */
89struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned; 83struct cpuinfo_m32r cpu_data[NR_CPUS] __cacheline_aligned;
@@ -598,7 +592,7 @@ int setup_profiling_timer(unsigned int multiplier)
598 * accounting. At that time they also adjust their APIC timers 592 * accounting. At that time they also adjust their APIC timers
599 * accordingly. 593 * accordingly.
600 */ 594 */
601 for (i = 0; i < NR_CPUS; ++i) 595 for_each_possible_cpu(i)
602 per_cpu(prof_multiplier, i) = multiplier; 596 per_cpu(prof_multiplier, i) = multiplier;
603 597
604 return 0; 598 return 0;
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig
index 836fb66f080d..fb87c08c6b57 100644
--- a/arch/m68k/Kconfig
+++ b/arch/m68k/Kconfig
@@ -280,7 +280,6 @@ config M68060
280 280
281config MMU_MOTOROLA 281config MMU_MOTOROLA
282 bool 282 bool
283 depends on MMU && !MMU_SUN3
284 283
285config MMU_SUN3 284config MMU_SUN3
286 bool 285 bool
@@ -304,7 +303,7 @@ config M68KFPU_EMU_EXTRAPREC
304 correct rounding, the emulator can (often) do the same but this 303 correct rounding, the emulator can (often) do the same but this
305 extra calculation can cost quite some time, so you can disable 304 extra calculation can cost quite some time, so you can disable
306 it here. The emulator will then "only" calculate with a 64 bit 305 it here. The emulator will then "only" calculate with a 64 bit
307 mantissa and round slightly incorrect, what is more then enough 306 mantissa and round slightly incorrect, what is more than enough
308 for normal usage. 307 for normal usage.
309 308
310config M68KFPU_EMU_ONLY 309config M68KFPU_EMU_ONLY
diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c
index 907a5533c845..c5b5212cc3f9 100644
--- a/arch/m68k/amiga/amiints.c
+++ b/arch/m68k/amiga/amiints.c
@@ -72,10 +72,14 @@ static struct irq_controller amiga_irq_controller = {
72 72
73void __init amiga_init_IRQ(void) 73void __init amiga_init_IRQ(void)
74{ 74{
75 request_irq(IRQ_AUTO_1, ami_int1, 0, "int1", NULL); 75 if (request_irq(IRQ_AUTO_1, ami_int1, 0, "int1", NULL))
76 request_irq(IRQ_AUTO_3, ami_int3, 0, "int3", NULL); 76 pr_err("Couldn't register int%d\n", 1);
77 request_irq(IRQ_AUTO_4, ami_int4, 0, "int4", NULL); 77 if (request_irq(IRQ_AUTO_3, ami_int3, 0, "int3", NULL))
78 request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL); 78 pr_err("Couldn't register int%d\n", 3);
79 if (request_irq(IRQ_AUTO_4, ami_int4, 0, "int4", NULL))
80 pr_err("Couldn't register int%d\n", 4);
81 if (request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL))
82 pr_err("Couldn't register int%d\n", 5);
79 83
80 m68k_setup_irq_controller(&amiga_irq_controller, IRQ_USER, AMI_STD_IRQS); 84 m68k_setup_irq_controller(&amiga_irq_controller, IRQ_USER, AMI_STD_IRQS);
81 85
diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c
index 343fab49bd9a..ecd0f7ca6f0e 100644
--- a/arch/m68k/amiga/cia.c
+++ b/arch/m68k/amiga/cia.c
@@ -176,5 +176,7 @@ void __init cia_init_IRQ(struct ciabase *base)
176 /* override auto int and install CIA handler */ 176 /* override auto int and install CIA handler */
177 m68k_setup_irq_controller(&auto_irq_controller, base->handler_irq, 1); 177 m68k_setup_irq_controller(&auto_irq_controller, base->handler_irq, 1);
178 m68k_irq_startup(base->handler_irq); 178 m68k_irq_startup(base->handler_irq);
179 request_irq(base->handler_irq, cia_handler, IRQF_SHARED, base->name, base); 179 if (request_irq(base->handler_irq, cia_handler, IRQF_SHARED,
180 base->name, base))
181 pr_err("Couldn't register %s interrupt\n", base->name);
180} 182}
diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index ab9862c3a136..6e562751ad51 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -493,7 +493,8 @@ static void __init amiga_sched_init(irq_handler_t timer_routine)
493 * Please don't change this to use ciaa, as it interferes with the 493 * Please don't change this to use ciaa, as it interferes with the
494 * SCSI code. We'll have to take a look at this later 494 * SCSI code. We'll have to take a look at this later
495 */ 495 */
496 request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL); 496 if (request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL))
497 pr_err("Couldn't register timer interrupt\n");
497 /* start timer */ 498 /* start timer */
498 ciab.cra |= 0x11; 499 ciab.cra |= 0x11;
499} 500}
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c
index 78df98f2029a..8d3eafab1ffe 100644
--- a/arch/m68k/apollo/config.c
+++ b/arch/m68k/apollo/config.c
@@ -31,10 +31,6 @@ extern unsigned long dn_gettimeoffset(void);
31extern int dn_dummy_hwclk(int, struct rtc_time *); 31extern int dn_dummy_hwclk(int, struct rtc_time *);
32extern int dn_dummy_set_clock_mmss(unsigned long); 32extern int dn_dummy_set_clock_mmss(unsigned long);
33extern void dn_dummy_reset(void); 33extern void dn_dummy_reset(void);
34extern void dn_dummy_waitbut(void);
35extern struct fb_info *dn_fb_init(long *);
36extern void dn_dummy_debug_init(void);
37extern irqreturn_t dn_process_int(int irq, struct pt_regs *fp);
38#ifdef CONFIG_HEARTBEAT 34#ifdef CONFIG_HEARTBEAT
39static void dn_heartbeat(int on); 35static void dn_heartbeat(int on);
40#endif 36#endif
@@ -204,7 +200,8 @@ void dn_sched_init(irq_handler_t timer_routine)
204 printk("*(0x10803) %02x\n",*(volatile unsigned char *)(timer+0x3)); 200 printk("*(0x10803) %02x\n",*(volatile unsigned char *)(timer+0x3));
205#endif 201#endif
206 202
207 request_irq(IRQ_APOLLO, dn_timer_int, 0, "time", timer_routine); 203 if (request_irq(IRQ_APOLLO, dn_timer_int, 0, "time", timer_routine))
204 pr_err("Couldn't register timer interrupt\n");
208} 205}
209 206
210unsigned long dn_gettimeoffset(void) { 207unsigned long dn_gettimeoffset(void) {
diff --git a/arch/m68k/atari/atakeyb.c b/arch/m68k/atari/atakeyb.c
index c038b7c7eff0..a5f33c059979 100644
--- a/arch/m68k/atari/atakeyb.c
+++ b/arch/m68k/atari/atakeyb.c
@@ -33,7 +33,6 @@
33#include <asm/atari_joystick.h> 33#include <asm/atari_joystick.h>
34#include <asm/irq.h> 34#include <asm/irq.h>
35 35
36extern unsigned int keymap_count;
37 36
38/* Hook for MIDI serial driver */ 37/* Hook for MIDI serial driver */
39void (*atari_MIDI_interrupt_hook) (void); 38void (*atari_MIDI_interrupt_hook) (void);
@@ -567,14 +566,19 @@ static int atari_keyb_done = 0;
567 566
568int atari_keyb_init(void) 567int atari_keyb_init(void)
569{ 568{
569 int error;
570
570 if (atari_keyb_done) 571 if (atari_keyb_done)
571 return 0; 572 return 0;
572 573
573 kb_state.state = KEYBOARD; 574 kb_state.state = KEYBOARD;
574 kb_state.len = 0; 575 kb_state.len = 0;
575 576
576 request_irq(IRQ_MFP_ACIA, atari_keyboard_interrupt, IRQ_TYPE_SLOW, 577 error = request_irq(IRQ_MFP_ACIA, atari_keyboard_interrupt,
577 "keyboard/mouse/MIDI", atari_keyboard_interrupt); 578 IRQ_TYPE_SLOW, "keyboard/mouse/MIDI",
579 atari_keyboard_interrupt);
580 if (error)
581 return error;
578 582
579 atari_turnoff_irq(IRQ_MFP_ACIA); 583 atari_turnoff_irq(IRQ_MFP_ACIA);
580 do { 584 do {
diff --git a/arch/m68k/atari/stdma.c b/arch/m68k/atari/stdma.c
index d1bd029a34ac..604329fafbb8 100644
--- a/arch/m68k/atari/stdma.c
+++ b/arch/m68k/atari/stdma.c
@@ -179,8 +179,9 @@ EXPORT_SYMBOL(stdma_islocked);
179void __init stdma_init(void) 179void __init stdma_init(void)
180{ 180{
181 stdma_isr = NULL; 181 stdma_isr = NULL;
182 request_irq(IRQ_MFP_FDC, stdma_int, IRQ_TYPE_SLOW | IRQF_SHARED, 182 if (request_irq(IRQ_MFP_FDC, stdma_int, IRQ_TYPE_SLOW | IRQF_SHARED,
183 "ST-DMA: floppy/ACSI/IDE/Falcon-SCSI", stdma_int); 183 "ST-DMA: floppy/ACSI/IDE/Falcon-SCSI", stdma_int))
184 pr_err("Couldn't register ST-DMA interrupt\n");
184} 185}
185 186
186 187
diff --git a/arch/m68k/atari/time.c b/arch/m68k/atari/time.c
index 1edde27fa32d..d076ff8d1b39 100644
--- a/arch/m68k/atari/time.c
+++ b/arch/m68k/atari/time.c
@@ -31,8 +31,9 @@ atari_sched_init(irq_handler_t timer_routine)
31 /* start timer C, div = 1:100 */ 31 /* start timer C, div = 1:100 */
32 mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60; 32 mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60;
33 /* install interrupt service routine for MFP Timer C */ 33 /* install interrupt service routine for MFP Timer C */
34 request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW, 34 if (request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW,
35 "timer", timer_routine); 35 "timer", timer_routine))
36 pr_err("Couldn't register timer interrupt\n");
36} 37}
37 38
38/* ++andreas: gettimeoffset fixed to check for pending interrupt */ 39/* ++andreas: gettimeoffset fixed to check for pending interrupt */
diff --git a/arch/m68k/bvme6000/config.c b/arch/m68k/bvme6000/config.c
index c072595928c0..9fe6fefb5e14 100644
--- a/arch/m68k/bvme6000/config.c
+++ b/arch/m68k/bvme6000/config.c
@@ -43,7 +43,6 @@ extern unsigned long bvme6000_gettimeoffset (void);
43extern int bvme6000_hwclk (int, struct rtc_time *); 43extern int bvme6000_hwclk (int, struct rtc_time *);
44extern int bvme6000_set_clock_mmss (unsigned long); 44extern int bvme6000_set_clock_mmss (unsigned long);
45extern void bvme6000_reset (void); 45extern void bvme6000_reset (void);
46extern void bvme6000_waitbut(void);
47void bvme6000_set_vectors (void); 46void bvme6000_set_vectors (void);
48 47
49/* Save tick handler routine pointer, will point to do_timer() in 48/* Save tick handler routine pointer, will point to do_timer() in
diff --git a/arch/m68k/hp300/time.c b/arch/m68k/hp300/time.c
index dd7c8a2583d3..f6312c7d8727 100644
--- a/arch/m68k/hp300/time.c
+++ b/arch/m68k/hp300/time.c
@@ -70,7 +70,8 @@ void __init hp300_sched_init(irq_handler_t vector)
70 70
71 asm volatile(" movpw %0,%1@(5)" : : "d" (INTVAL), "a" (CLOCKBASE)); 71 asm volatile(" movpw %0,%1@(5)" : : "d" (INTVAL), "a" (CLOCKBASE));
72 72
73 request_irq(IRQ_AUTO_6, hp300_tick, IRQ_FLG_STD, "timer tick", vector); 73 if (request_irq(IRQ_AUTO_6, hp300_tick, IRQ_FLG_STD, "timer tick", vector))
74 pr_err("Couldn't register timer interrupt\n");
74 75
75 out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */ 76 out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */
76 out_8(CLOCKBASE + CLKCR1, 0x40); /* enable irq */ 77 out_8(CLOCKBASE + CLKCR1, 0x40); /* enable irq */
diff --git a/arch/m68k/kernel/.gitignore b/arch/m68k/kernel/.gitignore
new file mode 100644
index 000000000000..c5f676c3c224
--- /dev/null
+++ b/arch/m68k/kernel/.gitignore
@@ -0,0 +1 @@
vmlinux.lds
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index f28404d9a2bc..5b780826647c 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -424,7 +424,7 @@ resume:
424.data 424.data
425ALIGN 425ALIGN
426sys_call_table: 426sys_call_table:
427 .long sys_ni_syscall /* 0 - old "setup()" system call*/ 427 .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
428 .long sys_exit 428 .long sys_exit
429 .long sys_fork 429 .long sys_fork
430 .long sys_read 430 .long sys_read
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c
index 4d97bd2bd573..303730afb1c9 100644
--- a/arch/m68k/kernel/setup.c
+++ b/arch/m68k/kernel/setup.c
@@ -26,6 +26,7 @@
26#include <linux/initrd.h> 26#include <linux/initrd.h>
27 27
28#include <asm/bootinfo.h> 28#include <asm/bootinfo.h>
29#include <asm/sections.h>
29#include <asm/setup.h> 30#include <asm/setup.h>
30#include <asm/fpu.h> 31#include <asm/fpu.h>
31#include <asm/irq.h> 32#include <asm/irq.h>
@@ -62,7 +63,6 @@ EXPORT_SYMBOL(vme_brdtype);
62int m68k_is040or060; 63int m68k_is040or060;
63EXPORT_SYMBOL(m68k_is040or060); 64EXPORT_SYMBOL(m68k_is040or060);
64 65
65extern int end;
66extern unsigned long availmem; 66extern unsigned long availmem;
67 67
68int m68k_num_memory; 68int m68k_num_memory;
@@ -215,11 +215,10 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
215 215
216void __init setup_arch(char **cmdline_p) 216void __init setup_arch(char **cmdline_p)
217{ 217{
218 extern int _etext, _edata, _end;
219 int i; 218 int i;
220 219
221 /* The bootinfo is located right after the kernel bss */ 220 /* The bootinfo is located right after the kernel bss */
222 m68k_parse_bootinfo((const struct bi_record *)&_end); 221 m68k_parse_bootinfo((const struct bi_record *)_end);
223 222
224 if (CPU_IS_040) 223 if (CPU_IS_040)
225 m68k_is040or060 = 4; 224 m68k_is040or060 = 4;
@@ -252,9 +251,9 @@ void __init setup_arch(char **cmdline_p)
252 } 251 }
253 252
254 init_mm.start_code = PAGE_OFFSET; 253 init_mm.start_code = PAGE_OFFSET;
255 init_mm.end_code = (unsigned long) &_etext; 254 init_mm.end_code = (unsigned long)_etext;
256 init_mm.end_data = (unsigned long) &_edata; 255 init_mm.end_data = (unsigned long)_edata;
257 init_mm.brk = (unsigned long) &_end; 256 init_mm.brk = (unsigned long)_end;
258 257
259 *cmdline_p = m68k_command_line; 258 *cmdline_p = m68k_command_line;
260 memcpy(boot_command_line, *cmdline_p, CL_SIZE); 259 memcpy(boot_command_line, *cmdline_p, CL_SIZE);
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c
index f9af893cd289..de2d05ddd86d 100644
--- a/arch/m68k/kernel/signal.c
+++ b/arch/m68k/kernel/signal.c
@@ -326,6 +326,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *usc, void __u
326 struct sigcontext context; 326 struct sigcontext context;
327 int err; 327 int err;
328 328
329 /* Always make any pending restarted system calls return -EINTR */
330 current_thread_info()->restart_block.fn = do_no_restart_syscall;
331
329 /* get previous context */ 332 /* get previous context */
330 if (copy_from_user(&context, usc, sizeof(context))) 333 if (copy_from_user(&context, usc, sizeof(context)))
331 goto badframe; 334 goto badframe;
@@ -411,6 +414,9 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw,
411 unsigned long usp; 414 unsigned long usp;
412 int err; 415 int err;
413 416
417 /* Always make any pending restarted system calls return -EINTR */
418 current_thread_info()->restart_block.fn = do_no_restart_syscall;
419
414 err = __get_user(temp, &uc->uc_mcontext.version); 420 err = __get_user(temp, &uc->uc_mcontext.version);
415 if (temp != MCONTEXT_VERSION) 421 if (temp != MCONTEXT_VERSION)
416 goto badframe; 422 goto badframe;
@@ -937,6 +943,15 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
937 regs->d0 = -EINTR; 943 regs->d0 = -EINTR;
938 break; 944 break;
939 945
946 case -ERESTART_RESTARTBLOCK:
947 if (!has_handler) {
948 regs->d0 = __NR_restart_syscall;
949 regs->pc -= 2;
950 break;
951 }
952 regs->d0 = -EINTR;
953 break;
954
940 case -ERESTARTSYS: 955 case -ERESTARTSYS:
941 if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) { 956 if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) {
942 regs->d0 = -EINTR; 957 regs->d0 = -EINTR;
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index 6d813de2baf1..184acc90808d 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -401,7 +401,7 @@ static inline void do_040writebacks(struct frame *fp)
401 * called from sigreturn(), must ensure userspace code didn't 401 * called from sigreturn(), must ensure userspace code didn't
402 * manipulate exception frame to circumvent protection, then complete 402 * manipulate exception frame to circumvent protection, then complete
403 * pending writebacks 403 * pending writebacks
404 * we just clear TM2 to turn it into an userspace access 404 * we just clear TM2 to turn it into a userspace access
405 */ 405 */
406asmlinkage void berr_040cleanup(struct frame *fp) 406asmlinkage void berr_040cleanup(struct frame *fp)
407{ 407{
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 8a4919e4d36a..d9368c0709ba 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -33,6 +33,7 @@ SECTIONS
33 } :data 33 } :data
34 /* End of data goes *here* so that freeing init code works properly. */ 34 /* End of data goes *here* so that freeing init code works properly. */
35 _edata = .; 35 _edata = .;
36 NOTES
36 37
37 /* will be freed after init */ 38 /* will be freed after init */
38 . = ALIGN(PAGE_SIZE); /* Init code and data */ 39 . = ALIGN(PAGE_SIZE); /* Init code and data */
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c
index 245d16d078ad..2a96bebd8969 100644
--- a/arch/m68k/mac/baboon.c
+++ b/arch/m68k/mac/baboon.c
@@ -92,7 +92,8 @@ static irqreturn_t baboon_irq(int irq, void *dev_id)
92void __init baboon_register_interrupts(void) 92void __init baboon_register_interrupts(void)
93{ 93{
94 baboon_disabled = 0; 94 baboon_disabled = 0;
95 request_irq(IRQ_NUBUS_C, baboon_irq, 0, "baboon", (void *)baboon); 95 if (request_irq(IRQ_NUBUS_C, baboon_irq, 0, "baboon", (void *)baboon))
96 pr_err("Couldn't register baboon interrupt\n");
96} 97}
97 98
98/* 99/*
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index 8819b97be324..98b6bcfb37bf 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -47,13 +47,6 @@
47 47
48struct mac_booter_data mac_bi_data; 48struct mac_booter_data mac_bi_data;
49 49
50/* New m68k bootinfo stuff and videobase */
51
52extern int m68k_num_memory;
53extern struct mem_info m68k_memory[NUM_MEMINFO];
54
55extern struct mem_info m68k_ramdisk;
56
57/* The phys. video addr. - might be bogus on some machines */ 50/* The phys. video addr. - might be bogus on some machines */
58static unsigned long mac_orig_videoaddr; 51static unsigned long mac_orig_videoaddr;
59 52
@@ -61,7 +54,6 @@ static unsigned long mac_orig_videoaddr;
61extern unsigned long mac_gettimeoffset(void); 54extern unsigned long mac_gettimeoffset(void);
62extern int mac_hwclk(int, struct rtc_time *); 55extern int mac_hwclk(int, struct rtc_time *);
63extern int mac_set_clock_mmss(unsigned long); 56extern int mac_set_clock_mmss(unsigned long);
64extern int show_mac_interrupts(struct seq_file *, void *);
65extern void iop_preinit(void); 57extern void iop_preinit(void);
66extern void iop_init(void); 58extern void iop_init(void);
67extern void via_init(void); 59extern void via_init(void);
@@ -805,10 +797,6 @@ static void __init mac_identify(void)
805 mac_bi_data.boottime, mac_bi_data.gmtbias); 797 mac_bi_data.boottime, mac_bi_data.gmtbias);
806 printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n", 798 printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
807 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); 799 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
808#if 0
809 printk("Ramdisk: addr 0x%lx size 0x%lx\n",
810 m68k_ramdisk.addr, m68k_ramdisk.size);
811#endif
812 800
813 iop_init(); 801 iop_init();
814 via_init(); 802 via_init();
diff --git a/arch/m68k/mac/debug.c b/arch/m68k/mac/debug.c
index 65dd77a742a3..bce074ceb768 100644
--- a/arch/m68k/mac/debug.c
+++ b/arch/m68k/mac/debug.c
@@ -27,7 +27,6 @@
27#include <asm/macints.h> 27#include <asm/macints.h>
28 28
29extern unsigned long mac_videobase; 29extern unsigned long mac_videobase;
30extern unsigned long mac_videodepth;
31extern unsigned long mac_rowbytes; 30extern unsigned long mac_rowbytes;
32 31
33extern void mac_serial_print(const char *); 32extern void mac_serial_print(const char *);
diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c
index 326fb9978094..1ad4e9d80eba 100644
--- a/arch/m68k/mac/iop.c
+++ b/arch/m68k/mac/iop.c
@@ -305,14 +305,16 @@ void __init iop_register_interrupts(void)
305{ 305{
306 if (iop_ism_present) { 306 if (iop_ism_present) {
307 if (oss_present) { 307 if (oss_present) {
308 request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, 308 if (request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq,
309 IRQ_FLG_LOCK, "ISM IOP", 309 IRQ_FLG_LOCK, "ISM IOP",
310 (void *) IOP_NUM_ISM); 310 (void *) IOP_NUM_ISM))
311 pr_err("Couldn't register ISM IOP interrupt\n");
311 oss_irq_enable(IRQ_MAC_ADB); 312 oss_irq_enable(IRQ_MAC_ADB);
312 } else { 313 } else {
313 request_irq(IRQ_VIA2_0, iop_ism_irq, 314 if (request_irq(IRQ_VIA2_0, iop_ism_irq,
314 IRQ_FLG_LOCK|IRQ_FLG_FAST, "ISM IOP", 315 IRQ_FLG_LOCK|IRQ_FLG_FAST, "ISM IOP",
315 (void *) IOP_NUM_ISM); 316 (void *) IOP_NUM_ISM))
317 pr_err("Couldn't register ISM IOP interrupt\n");
316 } 318 }
317 if (!iop_alive(iop_base[IOP_NUM_ISM])) { 319 if (!iop_alive(iop_base[IOP_NUM_ISM])) {
318 printk("IOP: oh my god, they killed the ISM IOP!\n"); 320 printk("IOP: oh my god, they killed the ISM IOP!\n");
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index 82e560c076ce..23711074e0e2 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -134,6 +134,7 @@
134#include <asm/errno.h> 134#include <asm/errno.h>
135#include <asm/macints.h> 135#include <asm/macints.h>
136#include <asm/irq_regs.h> 136#include <asm/irq_regs.h>
137#include <asm/mac_oss.h>
137 138
138#define DEBUG_SPURIOUS 139#define DEBUG_SPURIOUS
139#define SHUTUP_SONIC 140#define SHUTUP_SONIC
@@ -146,7 +147,6 @@ static int scc_mask;
146 * VIA/RBV hooks 147 * VIA/RBV hooks
147 */ 148 */
148 149
149extern void via_init(void);
150extern void via_register_interrupts(void); 150extern void via_register_interrupts(void);
151extern void via_irq_enable(int); 151extern void via_irq_enable(int);
152extern void via_irq_disable(int); 152extern void via_irq_disable(int);
@@ -157,9 +157,6 @@ extern int via_irq_pending(int);
157 * OSS hooks 157 * OSS hooks
158 */ 158 */
159 159
160extern int oss_present;
161
162extern void oss_init(void);
163extern void oss_register_interrupts(void); 160extern void oss_register_interrupts(void);
164extern void oss_irq_enable(int); 161extern void oss_irq_enable(int);
165extern void oss_irq_disable(int); 162extern void oss_irq_disable(int);
@@ -170,9 +167,6 @@ extern int oss_irq_pending(int);
170 * PSC hooks 167 * PSC hooks
171 */ 168 */
172 169
173extern int psc_present;
174
175extern void psc_init(void);
176extern void psc_register_interrupts(void); 170extern void psc_register_interrupts(void);
177extern void psc_irq_enable(int); 171extern void psc_irq_enable(int);
178extern void psc_irq_disable(int); 172extern void psc_irq_disable(int);
@@ -191,12 +185,10 @@ extern void iop_register_interrupts(void);
191 185
192extern int baboon_present; 186extern int baboon_present;
193 187
194extern void baboon_init(void);
195extern void baboon_register_interrupts(void); 188extern void baboon_register_interrupts(void);
196extern void baboon_irq_enable(int); 189extern void baboon_irq_enable(int);
197extern void baboon_irq_disable(int); 190extern void baboon_irq_disable(int);
198extern void baboon_irq_clear(int); 191extern void baboon_irq_clear(int);
199extern int baboon_irq_pending(int);
200 192
201/* 193/*
202 * SCC interrupt routines 194 * SCC interrupt routines
@@ -258,8 +250,9 @@ void __init mac_init_IRQ(void)
258 if (baboon_present) 250 if (baboon_present)
259 baboon_register_interrupts(); 251 baboon_register_interrupts();
260 iop_register_interrupts(); 252 iop_register_interrupts();
261 request_irq(IRQ_AUTO_7, mac_nmi_handler, 0, "NMI", 253 if (request_irq(IRQ_AUTO_7, mac_nmi_handler, 0, "NMI",
262 mac_nmi_handler); 254 mac_nmi_handler))
255 pr_err("Couldn't register NMI\n");
263#ifdef DEBUG_MACINTS 256#ifdef DEBUG_MACINTS
264 printk("mac_init_IRQ(): Done!\n"); 257 printk("mac_init_IRQ(): Done!\n");
265#endif 258#endif
diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index a44c7086ab39..5d818568b343 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -35,7 +35,6 @@
35 35
36#define RTC_OFFSET 2082844800 36#define RTC_OFFSET 2082844800
37 37
38extern struct mac_booter_data mac_bi_data;
39static void (*rom_reset)(void); 38static void (*rom_reset)(void);
40 39
41#ifdef CONFIG_ADB_CUDA 40#ifdef CONFIG_ADB_CUDA
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c
index 8426501119ca..f3d23d6ebcf8 100644
--- a/arch/m68k/mac/oss.c
+++ b/arch/m68k/mac/oss.c
@@ -66,16 +66,21 @@ void __init oss_init(void)
66 66
67void __init oss_register_interrupts(void) 67void __init oss_register_interrupts(void)
68{ 68{
69 request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, 69 if (request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK,
70 "scsi", (void *) oss); 70 "scsi", (void *) oss))
71 request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK, 71 pr_err("Couldn't register %s interrupt\n", "scsi");
72 "scc", mac_scc_dispatch); 72 if (request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK,
73 request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, 73 "scc", mac_scc_dispatch))
74 "nubus", (void *) oss); 74 pr_err("Couldn't register %s interrupt\n", "scc");
75 request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK, 75 if (request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK,
76 "sound", (void *) oss); 76 "nubus", (void *) oss))
77 request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK, 77 pr_err("Couldn't register %s interrupt\n", "nubus");
78 "via1", (void *) via1); 78 if (request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK,
79 "sound", (void *) oss))
80 pr_err("Couldn't register %s interrupt\n", "sound");
81 if (request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK,
82 "via1", (void *) via1))
83 pr_err("Couldn't register %s interrupt\n", "via1");
79} 84}
80 85
81/* 86/*
diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c
index f84a4dd64f94..ba6ccab64018 100644
--- a/arch/m68k/mac/psc.c
+++ b/arch/m68k/mac/psc.c
@@ -117,10 +117,14 @@ void __init psc_init(void)
117 117
118void __init psc_register_interrupts(void) 118void __init psc_register_interrupts(void)
119{ 119{
120 request_irq(IRQ_AUTO_3, psc_irq, 0, "psc3", (void *) 0x30); 120 if (request_irq(IRQ_AUTO_3, psc_irq, 0, "psc3", (void *) 0x30))
121 request_irq(IRQ_AUTO_4, psc_irq, 0, "psc4", (void *) 0x40); 121 pr_err("Couldn't register psc%d interrupt\n", 3);
122 request_irq(IRQ_AUTO_5, psc_irq, 0, "psc5", (void *) 0x50); 122 if (request_irq(IRQ_AUTO_4, psc_irq, 0, "psc4", (void *) 0x40))
123 request_irq(IRQ_AUTO_6, psc_irq, 0, "psc6", (void *) 0x60); 123 pr_err("Couldn't register psc%d interrupt\n", 4);
124 if (request_irq(IRQ_AUTO_5, psc_irq, 0, "psc5", (void *) 0x50))
125 pr_err("Couldn't register psc%d interrupt\n", 5);
126 if (request_irq(IRQ_AUTO_6, psc_irq, 0, "psc6", (void *) 0x60))
127 pr_err("Couldn't register psc%d interrupt\n", 6);
124} 128}
125 129
126/* 130/*
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c
index f01d418e64fe..7d97ba54536e 100644
--- a/arch/m68k/mac/via.c
+++ b/arch/m68k/mac/via.c
@@ -34,6 +34,7 @@
34#include <asm/macints.h> 34#include <asm/macints.h>
35#include <asm/mac_via.h> 35#include <asm/mac_via.h>
36#include <asm/mac_psc.h> 36#include <asm/mac_psc.h>
37#include <asm/mac_oss.h>
37 38
38volatile __u8 *via1, *via2; 39volatile __u8 *via1, *via2;
39int rbv_present; 40int rbv_present;
@@ -84,7 +85,6 @@ void via_irq_disable(int irq);
84void via_irq_clear(int irq); 85void via_irq_clear(int irq);
85 86
86extern irqreturn_t mac_scc_dispatch(int, void *); 87extern irqreturn_t mac_scc_dispatch(int, void *);
87extern int oss_present;
88 88
89/* 89/*
90 * Initialize the VIAs 90 * Initialize the VIAs
@@ -283,7 +283,8 @@ void __init via_init_clock(irq_handler_t func)
283 via1[vT1CL] = MAC_CLOCK_LOW; 283 via1[vT1CL] = MAC_CLOCK_LOW;
284 via1[vT1CH] = MAC_CLOCK_HIGH; 284 via1[vT1CH] = MAC_CLOCK_HIGH;
285 285
286 request_irq(IRQ_MAC_TIMER_1, func, IRQ_FLG_LOCK, "timer", func); 286 if (request_irq(IRQ_MAC_TIMER_1, func, IRQ_FLG_LOCK, "timer", func))
287 pr_err("Couldn't register %s interrupt\n", "timer");
287} 288}
288 289
289/* 290/*
@@ -293,25 +294,31 @@ void __init via_init_clock(irq_handler_t func)
293void __init via_register_interrupts(void) 294void __init via_register_interrupts(void)
294{ 295{
295 if (via_alt_mapping) { 296 if (via_alt_mapping) {
296 request_irq(IRQ_AUTO_1, via1_irq, 297 if (request_irq(IRQ_AUTO_1, via1_irq,
297 IRQ_FLG_LOCK|IRQ_FLG_FAST, "software", 298 IRQ_FLG_LOCK|IRQ_FLG_FAST, "software",
298 (void *) via1); 299 (void *) via1))
299 request_irq(IRQ_AUTO_6, via1_irq, 300 pr_err("Couldn't register %s interrupt\n", "software");
301 if (request_irq(IRQ_AUTO_6, via1_irq,
300 IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", 302 IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
301 (void *) via1); 303 (void *) via1))
304 pr_err("Couldn't register %s interrupt\n", "via1");
302 } else { 305 } else {
303 request_irq(IRQ_AUTO_1, via1_irq, 306 if (request_irq(IRQ_AUTO_1, via1_irq,
304 IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", 307 IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
305 (void *) via1); 308 (void *) via1))
309 pr_err("Couldn't register %s interrupt\n", "via1");
306 } 310 }
307 request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, 311 if (request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
308 "via2", (void *) via2); 312 "via2", (void *) via2))
313 pr_err("Couldn't register %s interrupt\n", "via2");
309 if (!psc_present) { 314 if (!psc_present) {
310 request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK, 315 if (request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK,
311 "scc", mac_scc_dispatch); 316 "scc", mac_scc_dispatch))
317 pr_err("Couldn't register %s interrupt\n", "scc");
312 } 318 }
313 request_irq(IRQ_MAC_NUBUS, via_nubus_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, 319 if (request_irq(IRQ_MAC_NUBUS, via_nubus_irq,
314 "nubus", (void *) via2); 320 IRQ_FLG_LOCK|IRQ_FLG_FAST, "nubus", (void *) via2))
321 pr_err("Couldn't register %s interrupt\n", "nubus");
315} 322}
316 323
317/* 324/*
diff --git a/arch/m68k/math-emu/fp_log.c b/arch/m68k/math-emu/fp_log.c
index b1033ae0d6f0..367ecee2f981 100644
--- a/arch/m68k/math-emu/fp_log.c
+++ b/arch/m68k/math-emu/fp_log.c
@@ -24,7 +24,6 @@ static const struct fp_ext fp_one =
24 24
25extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src); 25extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src);
26extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *src); 26extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *src);
27extern struct fp_ext *fp_fmul(struct fp_ext *dest, const struct fp_ext *src);
28 27
29struct fp_ext * 28struct fp_ext *
30fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) 29fp_fsqrt(struct fp_ext *dest, struct fp_ext *src)
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index 81bb08ceec18..0007b2adf3a3 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -28,6 +28,7 @@
28#ifdef CONFIG_ATARI 28#ifdef CONFIG_ATARI
29#include <asm/atari_stram.h> 29#include <asm/atari_stram.h>
30#endif 30#endif
31#include <asm/sections.h>
31#include <asm/tlb.h> 32#include <asm/tlb.h>
32 33
33DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 34DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
@@ -73,9 +74,6 @@ extern void init_pointer_table(unsigned long ptable);
73 74
74/* References to section boundaries */ 75/* References to section boundaries */
75 76
76extern char _text[], _etext[];
77extern char __init_begin[], __init_end[];
78
79extern pmd_t *zero_pgtable; 77extern pmd_t *zero_pgtable;
80 78
81void __init mem_init(void) 79void __init mem_init(void)
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index c5dbb9bdb322..4665fc84b7dc 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -30,6 +30,7 @@
30#ifdef CONFIG_ATARI 30#ifdef CONFIG_ATARI
31#include <asm/atari_stram.h> 31#include <asm/atari_stram.h>
32#endif 32#endif
33#include <asm/sections.h>
33 34
34#undef DEBUG 35#undef DEBUG
35 36
@@ -301,14 +302,12 @@ void __init paging_init(void)
301 } 302 }
302} 303}
303 304
304extern char __init_begin, __init_end;
305
306void free_initmem(void) 305void free_initmem(void)
307{ 306{
308 unsigned long addr; 307 unsigned long addr;
309 308
310 addr = (unsigned long)&__init_begin; 309 addr = (unsigned long)__init_begin;
311 for (; addr < (unsigned long)&__init_end; addr += PAGE_SIZE) { 310 for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) {
312 virt_to_page(addr)->flags &= ~(1 << PG_reserved); 311 virt_to_page(addr)->flags &= ~(1 << PG_reserved);
313 init_page_count(virt_to_page(addr)); 312 init_page_count(virt_to_page(addr));
314 free_page(addr); 313 free_page(addr);
diff --git a/arch/m68k/mvme147/config.c b/arch/m68k/mvme147/config.c
index 43cdf476ffab..100baaa692a1 100644
--- a/arch/m68k/mvme147/config.c
+++ b/arch/m68k/mvme147/config.c
@@ -42,7 +42,6 @@ extern unsigned long mvme147_gettimeoffset (void);
42extern int mvme147_hwclk (int, struct rtc_time *); 42extern int mvme147_hwclk (int, struct rtc_time *);
43extern int mvme147_set_clock_mmss (unsigned long); 43extern int mvme147_set_clock_mmss (unsigned long);
44extern void mvme147_reset (void); 44extern void mvme147_reset (void);
45extern void mvme147_waitbut(void);
46 45
47 46
48static int bcd2int (unsigned char b); 47static int bcd2int (unsigned char b);
@@ -115,8 +114,9 @@ static irqreturn_t mvme147_timer_int (int irq, void *dev_id)
115void mvme147_sched_init (irq_handler_t timer_routine) 114void mvme147_sched_init (irq_handler_t timer_routine)
116{ 115{
117 tick_handler = timer_routine; 116 tick_handler = timer_routine;
118 request_irq (PCC_IRQ_TIMER1, mvme147_timer_int, 117 if (request_irq(PCC_IRQ_TIMER1, mvme147_timer_int, IRQ_FLG_REPLACE,
119 IRQ_FLG_REPLACE, "timer 1", NULL); 118 "timer 1", NULL))
119 pr_err("Couldn't register timer interrupt\n");
120 120
121 /* Init the clock with a value */ 121 /* Init the clock with a value */
122 /* our clock goes off every 6.25us */ 122 /* our clock goes off every 6.25us */
diff --git a/arch/m68k/mvme16x/config.c b/arch/m68k/mvme16x/config.c
index 1521826fc3c7..11edf61cc2c4 100644
--- a/arch/m68k/mvme16x/config.c
+++ b/arch/m68k/mvme16x/config.c
@@ -48,7 +48,6 @@ extern unsigned long mvme16x_gettimeoffset (void);
48extern int mvme16x_hwclk (int, struct rtc_time *); 48extern int mvme16x_hwclk (int, struct rtc_time *);
49extern int mvme16x_set_clock_mmss (unsigned long); 49extern int mvme16x_set_clock_mmss (unsigned long);
50extern void mvme16x_reset (void); 50extern void mvme16x_reset (void);
51extern void mvme16x_waitbut(void);
52 51
53int bcd2int (unsigned char b); 52int bcd2int (unsigned char b);
54 53
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index 7110546e3c00..31ab3f08bbda 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -36,7 +36,6 @@
36#include <asm/machdep.h> 36#include <asm/machdep.h>
37#include <asm/q40_master.h> 37#include <asm/q40_master.h>
38 38
39extern irqreturn_t q40_process_int(int level, struct pt_regs *regs);
40extern void q40_init_IRQ(void); 39extern void q40_init_IRQ(void);
41static void q40_get_model(char *model); 40static void q40_get_model(char *model);
42extern void q40_sched_init(irq_handler_t handler); 41extern void q40_sched_init(irq_handler_t handler);
@@ -47,8 +46,6 @@ static unsigned int q40_get_ss(void);
47static int q40_set_clock_mmss(unsigned long); 46static int q40_set_clock_mmss(unsigned long);
48static int q40_get_rtc_pll(struct rtc_pll_info *pll); 47static int q40_get_rtc_pll(struct rtc_pll_info *pll);
49static int q40_set_rtc_pll(struct rtc_pll_info *pll); 48static int q40_set_rtc_pll(struct rtc_pll_info *pll);
50extern void q40_waitbut(void);
51void q40_set_vectors(void);
52 49
53extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/); 50extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/);
54 51
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index 8dfaa201342e..2ca25bd01a96 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -27,23 +27,21 @@
27#include <asm/sun3mmu.h> 27#include <asm/sun3mmu.h>
28#include <asm/rtc.h> 28#include <asm/rtc.h>
29#include <asm/machdep.h> 29#include <asm/machdep.h>
30#include <asm/idprom.h>
30#include <asm/intersil.h> 31#include <asm/intersil.h>
31#include <asm/irq.h> 32#include <asm/irq.h>
33#include <asm/sections.h>
32#include <asm/segment.h> 34#include <asm/segment.h>
33#include <asm/sun3ints.h> 35#include <asm/sun3ints.h>
34 36
35extern char _text, _end;
36
37char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; 37char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
38 38
39extern unsigned long sun3_gettimeoffset(void); 39extern unsigned long sun3_gettimeoffset(void);
40static void sun3_sched_init(irq_handler_t handler); 40static void sun3_sched_init(irq_handler_t handler);
41extern void sun3_get_model (char* model); 41extern void sun3_get_model (char* model);
42extern void idprom_init (void);
43extern int sun3_hwclk(int set, struct rtc_time *t); 42extern int sun3_hwclk(int set, struct rtc_time *t);
44 43
45volatile char* clock_va; 44volatile char* clock_va;
46extern volatile unsigned char* sun3_intreg;
47extern unsigned long availmem; 45extern unsigned long availmem;
48unsigned long num_pages; 46unsigned long num_pages;
49 47
@@ -149,7 +147,7 @@ void __init config_sun3(void)
149 mach_halt = sun3_halt; 147 mach_halt = sun3_halt;
150 mach_get_hardware_list = sun3_get_hardware_list; 148 mach_get_hardware_list = sun3_get_hardware_list;
151 149
152 memory_start = ((((int)&_end) + 0x2000) & ~0x1fff); 150 memory_start = ((((unsigned long)_end) + 0x2000) & ~0x1fff);
153// PROM seems to want the last couple of physical pages. --m 151// PROM seems to want the last couple of physical pages. --m
154 memory_end = *(romvec->pv_sun3mem) + PAGE_OFFSET - 2*PAGE_SIZE; 152 memory_end = *(romvec->pv_sun3mem) + PAGE_OFFSET - 2*PAGE_SIZE;
155 153
diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c
index 60f9d4500d72..3cd19390aae5 100644
--- a/arch/m68k/sun3/mmu_emu.c
+++ b/arch/m68k/sun3/mmu_emu.c
@@ -27,7 +27,6 @@
27#include <asm/mmu_context.h> 27#include <asm/mmu_context.h>
28#include <asm/dvma.h> 28#include <asm/dvma.h>
29 29
30extern void prom_reboot (char *) __attribute__ ((__noreturn__));
31 30
32#undef DEBUG_MMU_EMU 31#undef DEBUG_MMU_EMU
33#define DEBUG_PROM_MAPS 32#define DEBUG_PROM_MAPS
diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c
index 7364cd67455e..ad90393a3361 100644
--- a/arch/m68k/sun3/sun3ints.c
+++ b/arch/m68k/sun3/sun3ints.c
@@ -105,7 +105,10 @@ void __init sun3_init_IRQ(void)
105 m68k_setup_irq_controller(&sun3_irq_controller, IRQ_AUTO_1, 7); 105 m68k_setup_irq_controller(&sun3_irq_controller, IRQ_AUTO_1, 7);
106 m68k_setup_user_interrupt(VEC_USER, 128, NULL); 106 m68k_setup_user_interrupt(VEC_USER, 128, NULL);
107 107
108 request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL); 108 if (request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL))
109 request_irq(IRQ_AUTO_7, sun3_int7, 0, "int7", NULL); 109 pr_err("Couldn't register %s interrupt\n", "int5");
110 request_irq(IRQ_USER+127, sun3_vec255, 0, "vec255", NULL); 110 if (request_irq(IRQ_AUTO_7, sun3_int7, 0, "int7", NULL))
111 pr_err("Couldn't register %s interrupt\n", "int7");
112 if (request_irq(IRQ_USER+127, sun3_vec255, 0, "vec255", NULL))
113 pr_err("Couldn't register %s interrupt\n", "vec255");
111} 114}
diff --git a/arch/m68k/sun3x/config.c b/arch/m68k/sun3x/config.c
index 2b1ca2db070f..fc599fad4a54 100644
--- a/arch/m68k/sun3x/config.c
+++ b/arch/m68k/sun3x/config.c
@@ -23,7 +23,6 @@
23#include "time.h" 23#include "time.h"
24 24
25volatile char *clock_va; 25volatile char *clock_va;
26extern volatile unsigned char *sun3_intreg;
27 26
28extern void sun3_get_model(char *model); 27extern void sun3_get_model(char *model);
29 28
diff --git a/arch/m68knommu/include/asm/Kbuild b/arch/m68knommu/include/asm/Kbuild
index c68e1680da01..58c02a454130 100644
--- a/arch/m68knommu/include/asm/Kbuild
+++ b/arch/m68knommu/include/asm/Kbuild
@@ -1 +1,3 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2
3unifdef-y += swab.h
diff --git a/arch/m68knommu/include/asm/atomic.h b/arch/m68knommu/include/asm/atomic.h
index d5632a305dae..6bb674855a3f 100644
--- a/arch/m68knommu/include/asm/atomic.h
+++ b/arch/m68knommu/include/asm/atomic.h
@@ -1,6 +1,7 @@
1#ifndef __ARCH_M68KNOMMU_ATOMIC__ 1#ifndef __ARCH_M68KNOMMU_ATOMIC__
2#define __ARCH_M68KNOMMU_ATOMIC__ 2#define __ARCH_M68KNOMMU_ATOMIC__
3 3
4#include <linux/types.h>
4#include <asm/system.h> 5#include <asm/system.h>
5 6
6/* 7/*
@@ -12,7 +13,6 @@
12 * We do not have SMP m68k systems, so we don't have to deal with that. 13 * We do not have SMP m68k systems, so we don't have to deal with that.
13 */ 14 */
14 15
15typedef struct { int counter; } atomic_t;
16#define ATOMIC_INIT(i) { (i) } 16#define ATOMIC_INIT(i) { (i) }
17 17
18#define atomic_read(v) ((v)->counter) 18#define atomic_read(v) ((v)->counter)
diff --git a/arch/m68knommu/include/asm/bitops.h b/arch/m68knommu/include/asm/bitops.h
index 6f3685eab44c..9d3cbe5fad1e 100644
--- a/arch/m68knommu/include/asm/bitops.h
+++ b/arch/m68knommu/include/asm/bitops.h
@@ -331,6 +331,7 @@ found_middle:
331#endif /* __KERNEL__ */ 331#endif /* __KERNEL__ */
332 332
333#include <asm-generic/bitops/fls.h> 333#include <asm-generic/bitops/fls.h>
334#include <asm-generic/bitops/__fls.h>
334#include <asm-generic/bitops/fls64.h> 335#include <asm-generic/bitops/fls64.h>
335 336
336#endif /* _M68KNOMMU_BITOPS_H */ 337#endif /* _M68KNOMMU_BITOPS_H */
diff --git a/arch/m68knommu/include/asm/byteorder.h b/arch/m68knommu/include/asm/byteorder.h
index 20bb4426b610..a6f0b8f7f622 100644
--- a/arch/m68knommu/include/asm/byteorder.h
+++ b/arch/m68knommu/include/asm/byteorder.h
@@ -1,27 +1,7 @@
1#ifndef _M68KNOMMU_BYTEORDER_H 1#ifndef _M68KNOMMU_BYTEORDER_H
2#define _M68KNOMMU_BYTEORDER_H 2#define _M68KNOMMU_BYTEORDER_H
3 3
4#include <linux/types.h> 4#include <asm/swab.h>
5
6#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
7# define __BYTEORDER_HAS_U64__
8# define __SWAB_64_THRU_32__
9#endif
10
11#if defined (__mcfisaaplus__) || defined (__mcfisac__)
12static inline __attribute_const__ __u32 ___arch__swab32(__u32 val)
13{
14 asm(
15 "byterev %0"
16 : "=d" (val)
17 : "0" (val)
18 );
19 return val;
20}
21
22#define __arch__swab32(x) ___arch__swab32(x)
23#endif
24
25#include <linux/byteorder/big_endian.h> 5#include <linux/byteorder/big_endian.h>
26 6
27#endif /* _M68KNOMMU_BYTEORDER_H */ 7#endif /* _M68KNOMMU_BYTEORDER_H */
diff --git a/arch/m68knommu/include/asm/mmu.h b/arch/m68knommu/include/asm/mmu.h
index 5fa6b68353ba..e2da1e6f09fe 100644
--- a/arch/m68knommu/include/asm/mmu.h
+++ b/arch/m68knommu/include/asm/mmu.h
@@ -4,7 +4,6 @@
4/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */ 4/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
5 5
6typedef struct { 6typedef struct {
7 struct vm_list_struct *vmlist;
8 unsigned long end_brk; 7 unsigned long end_brk;
9} mm_context_t; 8} mm_context_t;
10 9
diff --git a/arch/m68knommu/include/asm/swab.h b/arch/m68knommu/include/asm/swab.h
new file mode 100644
index 000000000000..e582257db300
--- /dev/null
+++ b/arch/m68knommu/include/asm/swab.h
@@ -0,0 +1,24 @@
1#ifndef _M68KNOMMU_SWAB_H
2#define _M68KNOMMU_SWAB_H
3
4#include <linux/types.h>
5
6#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
7# define __SWAB_64_THRU_32__
8#endif
9
10#if defined (__mcfisaaplus__) || defined (__mcfisac__)
11static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
12{
13 asm(
14 "byterev %0"
15 : "=d" (val)
16 : "0" (val)
17 );
18 return val;
19}
20
21#define __arch_swab32 __arch_swab32
22#endif
23
24#endif /* _M68KNOMMU_SWAB_H */
diff --git a/arch/m68knommu/platform/coldfire/pit.c b/arch/m68knommu/platform/coldfire/pit.c
index c5b916700b22..2a12e7fa9748 100644
--- a/arch/m68knommu/platform/coldfire/pit.c
+++ b/arch/m68knommu/platform/coldfire/pit.c
@@ -156,7 +156,7 @@ void hw_timer_init(void)
156{ 156{
157 u32 imr; 157 u32 imr;
158 158
159 cf_pit_clockevent.cpumask = cpumask_of_cpu(smp_processor_id()); 159 cf_pit_clockevent.cpumask = cpumask_of(smp_processor_id());
160 cf_pit_clockevent.mult = div_sc(FREQ, NSEC_PER_SEC, 32); 160 cf_pit_clockevent.mult = div_sc(FREQ, NSEC_PER_SEC, 32);
161 cf_pit_clockevent.max_delta_ns = 161 cf_pit_clockevent.max_delta_ns =
162 clockevent_delta2ns(0xFFFF, &cf_pit_clockevent); 162 clockevent_delta2ns(0xFFFF, &cf_pit_clockevent);
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index a5255e7c79e0..52c80c2a57f2 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -595,6 +595,44 @@ config WR_PPMC
595 This enables support for the Wind River MIPS32 4KC PPMC evaluation 595 This enables support for the Wind River MIPS32 4KC PPMC evaluation
596 board, which is based on GT64120 bridge chip. 596 board, which is based on GT64120 bridge chip.
597 597
598config CAVIUM_OCTEON_SIMULATOR
599 bool "Support for the Cavium Networks Octeon Simulator"
600 select CEVT_R4K
601 select 64BIT_PHYS_ADDR
602 select DMA_COHERENT
603 select SYS_SUPPORTS_64BIT_KERNEL
604 select SYS_SUPPORTS_BIG_ENDIAN
605 select SYS_SUPPORTS_HIGHMEM
606 select CPU_CAVIUM_OCTEON
607 help
608 The Octeon simulator is software performance model of the Cavium
609 Octeon Processor. It supports simulating Octeon processors on x86
610 hardware.
611
612config CAVIUM_OCTEON_REFERENCE_BOARD
613 bool "Support for the Cavium Networks Octeon reference board"
614 select CEVT_R4K
615 select 64BIT_PHYS_ADDR
616 select DMA_COHERENT
617 select SYS_SUPPORTS_64BIT_KERNEL
618 select SYS_SUPPORTS_BIG_ENDIAN
619 select SYS_SUPPORTS_HIGHMEM
620 select SYS_HAS_EARLY_PRINTK
621 select CPU_CAVIUM_OCTEON
622 select SWAP_IO_SPACE
623 help
624 This option supports all of the Octeon reference boards from Cavium
625 Networks. It builds a kernel that dynamically determines the Octeon
626 CPU type and supports all known board reference implementations.
627 Some of the supported boards are:
628 EBT3000
629 EBH3000
630 EBH3100
631 Thunder
632 Kodama
633 Hikari
634 Say Y here for most Octeon reference boards.
635
598endchoice 636endchoice
599 637
600source "arch/mips/alchemy/Kconfig" 638source "arch/mips/alchemy/Kconfig"
@@ -607,6 +645,7 @@ source "arch/mips/sgi-ip27/Kconfig"
607source "arch/mips/sibyte/Kconfig" 645source "arch/mips/sibyte/Kconfig"
608source "arch/mips/txx9/Kconfig" 646source "arch/mips/txx9/Kconfig"
609source "arch/mips/vr41xx/Kconfig" 647source "arch/mips/vr41xx/Kconfig"
648source "arch/mips/cavium-octeon/Kconfig"
610 649
611endmenu 650endmenu
612 651
@@ -682,7 +721,11 @@ config CEVT_DS1287
682config CEVT_GT641XX 721config CEVT_GT641XX
683 bool 722 bool
684 723
724config CEVT_R4K_LIB
725 bool
726
685config CEVT_R4K 727config CEVT_R4K
728 select CEVT_R4K_LIB
686 bool 729 bool
687 730
688config CEVT_SB1250 731config CEVT_SB1250
@@ -697,7 +740,11 @@ config CSRC_BCM1480
697config CSRC_IOASIC 740config CSRC_IOASIC
698 bool 741 bool
699 742
743config CSRC_R4K_LIB
744 bool
745
700config CSRC_R4K 746config CSRC_R4K
747 select CSRC_R4K_LIB
701 bool 748 bool
702 749
703config CSRC_SB1250 750config CSRC_SB1250
@@ -835,6 +882,9 @@ config IRQ_GT641XX
835config IRQ_GIC 882config IRQ_GIC
836 bool 883 bool
837 884
885config IRQ_CPU_OCTEON
886 bool
887
838config MIPS_BOARDS_GEN 888config MIPS_BOARDS_GEN
839 bool 889 bool
840 890
@@ -924,7 +974,7 @@ config BOOT_ELF32
924config MIPS_L1_CACHE_SHIFT 974config MIPS_L1_CACHE_SHIFT
925 int 975 int
926 default "4" if MACH_DECSTATION || MIKROTIK_RB532 976 default "4" if MACH_DECSTATION || MIKROTIK_RB532
927 default "7" if SGI_IP22 || SGI_IP27 || SGI_IP28 || SNI_RM 977 default "7" if SGI_IP22 || SGI_IP27 || SGI_IP28 || SNI_RM || CPU_CAVIUM_OCTEON
928 default "4" if PMC_MSP4200_EVAL 978 default "4" if PMC_MSP4200_EVAL
929 default "5" 979 default "5"
930 980
@@ -1185,6 +1235,23 @@ config CPU_SB1
1185 select CPU_SUPPORTS_HIGHMEM 1235 select CPU_SUPPORTS_HIGHMEM
1186 select WEAK_ORDERING 1236 select WEAK_ORDERING
1187 1237
1238config CPU_CAVIUM_OCTEON
1239 bool "Cavium Octeon processor"
1240 select IRQ_CPU
1241 select IRQ_CPU_OCTEON
1242 select CPU_HAS_PREFETCH
1243 select CPU_SUPPORTS_64BIT_KERNEL
1244 select SYS_SUPPORTS_SMP
1245 select NR_CPUS_DEFAULT_16
1246 select WEAK_ORDERING
1247 select WEAK_REORDERING_BEYOND_LLSC
1248 select CPU_SUPPORTS_HIGHMEM
1249 help
1250 The Cavium Octeon processor is a highly integrated chip containing
1251 many ethernet hardware widgets for networking tasks. The processor
1252 can have up to 16 Mips64v2 cores and 8 integrated gigabit ethernets.
1253 Full details can be found at http://www.caviumnetworks.com.
1254
1188endchoice 1255endchoice
1189 1256
1190config SYS_HAS_CPU_LOONGSON2 1257config SYS_HAS_CPU_LOONGSON2
@@ -1285,7 +1352,7 @@ config CPU_MIPSR1
1285 1352
1286config CPU_MIPSR2 1353config CPU_MIPSR2
1287 bool 1354 bool
1288 default y if CPU_MIPS32_R2 || CPU_MIPS64_R2 1355 default y if CPU_MIPS32_R2 || CPU_MIPS64_R2 || CPU_CAVIUM_OCTEON
1289 1356
1290config SYS_SUPPORTS_32BIT_KERNEL 1357config SYS_SUPPORTS_32BIT_KERNEL
1291 bool 1358 bool
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 28c55f608913..21b00e95daef 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -144,6 +144,10 @@ cflags-$(CONFIG_CPU_SB1) += $(call cc-option,-march=sb1,-march=r5000) \
144cflags-$(CONFIG_CPU_R8000) += -march=r8000 -Wa,--trap 144cflags-$(CONFIG_CPU_R8000) += -march=r8000 -Wa,--trap
145cflags-$(CONFIG_CPU_R10000) += $(call cc-option,-march=r10000,-march=r8000) \ 145cflags-$(CONFIG_CPU_R10000) += $(call cc-option,-march=r10000,-march=r8000) \
146 -Wa,--trap 146 -Wa,--trap
147cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += $(call cc-option,-march=octeon) -Wa,--trap
148ifeq (,$(findstring march=octeon, $(cflags-$(CONFIG_CPU_CAVIUM_OCTEON))))
149cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += -Wa,-march=octeon
150endif
147 151
148cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,) 152cflags-$(CONFIG_CPU_R4000_WORKAROUNDS) += $(call cc-option,-mfix-r4000,)
149cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,) 153cflags-$(CONFIG_CPU_R4400_WORKAROUNDS) += $(call cc-option,-mfix-r4400,)
@@ -184,84 +188,84 @@ cflags-$(CONFIG_SOC_AU1X00) += -I$(srctree)/arch/mips/include/asm/mach-au1x00
184# 188#
185# AMD Alchemy Pb1000 eval board 189# AMD Alchemy Pb1000 eval board
186# 190#
187libs-$(CONFIG_MIPS_PB1000) += arch/mips/alchemy/pb1000/ 191core-$(CONFIG_MIPS_PB1000) += arch/mips/alchemy/devboards/
188cflags-$(CONFIG_MIPS_PB1000) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 192cflags-$(CONFIG_MIPS_PB1000) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00
189load-$(CONFIG_MIPS_PB1000) += 0xffffffff80100000 193load-$(CONFIG_MIPS_PB1000) += 0xffffffff80100000
190 194
191# 195#
192# AMD Alchemy Pb1100 eval board 196# AMD Alchemy Pb1100 eval board
193# 197#
194libs-$(CONFIG_MIPS_PB1100) += arch/mips/alchemy/pb1100/ 198core-$(CONFIG_MIPS_PB1100) += arch/mips/alchemy/devboards/
195cflags-$(CONFIG_MIPS_PB1100) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 199cflags-$(CONFIG_MIPS_PB1100) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00
196load-$(CONFIG_MIPS_PB1100) += 0xffffffff80100000 200load-$(CONFIG_MIPS_PB1100) += 0xffffffff80100000
197 201
198# 202#
199# AMD Alchemy Pb1500 eval board 203# AMD Alchemy Pb1500 eval board
200# 204#
201libs-$(CONFIG_MIPS_PB1500) += arch/mips/alchemy/pb1500/ 205core-$(CONFIG_MIPS_PB1500) += arch/mips/alchemy/devboards/
202cflags-$(CONFIG_MIPS_PB1500) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 206cflags-$(CONFIG_MIPS_PB1500) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00
203load-$(CONFIG_MIPS_PB1500) += 0xffffffff80100000 207load-$(CONFIG_MIPS_PB1500) += 0xffffffff80100000
204 208
205# 209#
206# AMD Alchemy Pb1550 eval board 210# AMD Alchemy Pb1550 eval board
207# 211#
208libs-$(CONFIG_MIPS_PB1550) += arch/mips/alchemy/pb1550/ 212core-$(CONFIG_MIPS_PB1550) += arch/mips/alchemy/devboards/
209cflags-$(CONFIG_MIPS_PB1550) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 213cflags-$(CONFIG_MIPS_PB1550) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00
210load-$(CONFIG_MIPS_PB1550) += 0xffffffff80100000 214load-$(CONFIG_MIPS_PB1550) += 0xffffffff80100000
211 215
212# 216#
213# AMD Alchemy Pb1200 eval board 217# AMD Alchemy Pb1200 eval board
214# 218#
215libs-$(CONFIG_MIPS_PB1200) += arch/mips/alchemy/pb1200/ 219core-$(CONFIG_MIPS_PB1200) += arch/mips/alchemy/devboards/
216cflags-$(CONFIG_MIPS_PB1200) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00 220cflags-$(CONFIG_MIPS_PB1200) += -I$(srctree)/arch/mips/include/asm/mach-pb1x00
217load-$(CONFIG_MIPS_PB1200) += 0xffffffff80100000 221load-$(CONFIG_MIPS_PB1200) += 0xffffffff80100000
218 222
219# 223#
220# AMD Alchemy Db1000 eval board 224# AMD Alchemy Db1000 eval board
221# 225#
222libs-$(CONFIG_MIPS_DB1000) += arch/mips/alchemy/db1x00/ 226core-$(CONFIG_MIPS_DB1000) += arch/mips/alchemy/devboards/
223cflags-$(CONFIG_MIPS_DB1000) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 227cflags-$(CONFIG_MIPS_DB1000) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
224load-$(CONFIG_MIPS_DB1000) += 0xffffffff80100000 228load-$(CONFIG_MIPS_DB1000) += 0xffffffff80100000
225 229
226# 230#
227# AMD Alchemy Db1100 eval board 231# AMD Alchemy Db1100 eval board
228# 232#
229libs-$(CONFIG_MIPS_DB1100) += arch/mips/alchemy/db1x00/ 233core-$(CONFIG_MIPS_DB1100) += arch/mips/alchemy/devboards/
230cflags-$(CONFIG_MIPS_DB1100) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 234cflags-$(CONFIG_MIPS_DB1100) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
231load-$(CONFIG_MIPS_DB1100) += 0xffffffff80100000 235load-$(CONFIG_MIPS_DB1100) += 0xffffffff80100000
232 236
233# 237#
234# AMD Alchemy Db1500 eval board 238# AMD Alchemy Db1500 eval board
235# 239#
236libs-$(CONFIG_MIPS_DB1500) += arch/mips/alchemy/db1x00/ 240core-$(CONFIG_MIPS_DB1500) += arch/mips/alchemy/devboards/
237cflags-$(CONFIG_MIPS_DB1500) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 241cflags-$(CONFIG_MIPS_DB1500) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
238load-$(CONFIG_MIPS_DB1500) += 0xffffffff80100000 242load-$(CONFIG_MIPS_DB1500) += 0xffffffff80100000
239 243
240# 244#
241# AMD Alchemy Db1550 eval board 245# AMD Alchemy Db1550 eval board
242# 246#
243libs-$(CONFIG_MIPS_DB1550) += arch/mips/alchemy/db1x00/ 247core-$(CONFIG_MIPS_DB1550) += arch/mips/alchemy/devboards/
244cflags-$(CONFIG_MIPS_DB1550) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 248cflags-$(CONFIG_MIPS_DB1550) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
245load-$(CONFIG_MIPS_DB1550) += 0xffffffff80100000 249load-$(CONFIG_MIPS_DB1550) += 0xffffffff80100000
246 250
247# 251#
248# AMD Alchemy Db1200 eval board 252# AMD Alchemy Db1200 eval board
249# 253#
250libs-$(CONFIG_MIPS_DB1200) += arch/mips/alchemy/pb1200/ 254core-$(CONFIG_MIPS_DB1200) += arch/mips/alchemy/devboards/
251cflags-$(CONFIG_MIPS_DB1200) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 255cflags-$(CONFIG_MIPS_DB1200) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
252load-$(CONFIG_MIPS_DB1200) += 0xffffffff80100000 256load-$(CONFIG_MIPS_DB1200) += 0xffffffff80100000
253 257
254# 258#
255# AMD Alchemy Bosporus eval board 259# AMD Alchemy Bosporus eval board
256# 260#
257libs-$(CONFIG_MIPS_BOSPORUS) += arch/mips/alchemy/db1x00/ 261core-$(CONFIG_MIPS_BOSPORUS) += arch/mips/alchemy/devboards/
258cflags-$(CONFIG_MIPS_BOSPORUS) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 262cflags-$(CONFIG_MIPS_BOSPORUS) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
259load-$(CONFIG_MIPS_BOSPORUS) += 0xffffffff80100000 263load-$(CONFIG_MIPS_BOSPORUS) += 0xffffffff80100000
260 264
261# 265#
262# AMD Alchemy Mirage eval board 266# AMD Alchemy Mirage eval board
263# 267#
264libs-$(CONFIG_MIPS_MIRAGE) += arch/mips/alchemy/db1x00/ 268core-$(CONFIG_MIPS_MIRAGE) += arch/mips/alchemy/devboards/
265cflags-$(CONFIG_MIPS_MIRAGE) += -I$(srctree)/arch/mips/include/asm/mach-db1x00 269cflags-$(CONFIG_MIPS_MIRAGE) += -I$(srctree)/arch/mips/include/asm/mach-db1x00
266load-$(CONFIG_MIPS_MIRAGE) += 0xffffffff80100000 270load-$(CONFIG_MIPS_MIRAGE) += 0xffffffff80100000
267 271
@@ -586,6 +590,18 @@ core-$(CONFIG_TOSHIBA_RBTX4927) += arch/mips/txx9/rbtx4927/
586core-$(CONFIG_TOSHIBA_RBTX4938) += arch/mips/txx9/rbtx4938/ 590core-$(CONFIG_TOSHIBA_RBTX4938) += arch/mips/txx9/rbtx4938/
587core-$(CONFIG_TOSHIBA_RBTX4939) += arch/mips/txx9/rbtx4939/ 591core-$(CONFIG_TOSHIBA_RBTX4939) += arch/mips/txx9/rbtx4939/
588 592
593#
594# Cavium Octeon
595#
596core-$(CONFIG_CPU_CAVIUM_OCTEON) += arch/mips/cavium-octeon/
597cflags-$(CONFIG_CPU_CAVIUM_OCTEON) += -I$(srctree)/arch/mips/include/asm/mach-cavium-octeon
598core-$(CONFIG_CPU_CAVIUM_OCTEON) += arch/mips/cavium-octeon/executive/
599ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL
600load-$(CONFIG_CPU_CAVIUM_OCTEON) += 0xffffffff84100000
601else
602load-$(CONFIG_CPU_CAVIUM_OCTEON) += 0xffffffff81100000
603endif
604
589cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic 605cflags-y += -I$(srctree)/arch/mips/include/asm/mach-generic
590drivers-$(CONFIG_PCI) += arch/mips/pci/ 606drivers-$(CONFIG_PCI) += arch/mips/pci/
591 607
diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig
index e4a057d80ab6..7f8ef13d0014 100644
--- a/arch/mips/alchemy/Kconfig
+++ b/arch/mips/alchemy/Kconfig
@@ -128,9 +128,10 @@ config SOC_AU1200
128config SOC_AU1X00 128config SOC_AU1X00
129 bool 129 bool
130 select 64BIT_PHYS_ADDR 130 select 64BIT_PHYS_ADDR
131 select CEVT_R4K 131 select CEVT_R4K_LIB
132 select CSRC_R4K 132 select CSRC_R4K_LIB
133 select IRQ_CPU 133 select IRQ_CPU
134 select SYS_HAS_CPU_MIPS32_R1 134 select SYS_HAS_CPU_MIPS32_R1
135 select SYS_SUPPORTS_32BIT_KERNEL 135 select SYS_SUPPORTS_32BIT_KERNEL
136 select SYS_SUPPORTS_APM_EMULATION 136 select SYS_SUPPORTS_APM_EMULATION
137 select GENERIC_HARDIRQS_NO__DO_IRQ
diff --git a/arch/mips/alchemy/common/Makefile b/arch/mips/alchemy/common/Makefile
index df48fd65bbf3..d50d4764eafe 100644
--- a/arch/mips/alchemy/common/Makefile
+++ b/arch/mips/alchemy/common/Makefile
@@ -6,8 +6,8 @@
6# 6#
7 7
8obj-y += prom.o irq.o puts.o time.o reset.o \ 8obj-y += prom.o irq.o puts.o time.o reset.o \
9 au1xxx_irqmap.o clocks.o platform.o power.o setup.o \ 9 clocks.o platform.o power.o setup.o \
10 sleeper.o cputable.o dma.o dbdma.o gpio.o 10 sleeper.o dma.o dbdma.o gpio.o
11 11
12obj-$(CONFIG_PCI) += pci.o 12obj-$(CONFIG_PCI) += pci.o
13 13
diff --git a/arch/mips/alchemy/common/au1xxx_irqmap.c b/arch/mips/alchemy/common/au1xxx_irqmap.c
deleted file mode 100644
index c7ca1596394c..000000000000
--- a/arch/mips/alchemy/common/au1xxx_irqmap.c
+++ /dev/null
@@ -1,205 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xxx processor specific IRQ tables
4 *
5 * Copyright 2004 Embedded Edge, LLC
6 * dan@embeddededge.com
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28#include <linux/init.h>
29#include <linux/kernel.h>
30
31#include <au1000.h>
32
33/* The IC0 interrupt table. This is processor, rather than
34 * board dependent, so no reason to keep this info in the board
35 * dependent files.
36 *
37 * Careful if you change match 2 request!
38 * The interrupt handler is called directly from the low level dispatch code.
39 */
40struct au1xxx_irqmap __initdata au1xxx_ic0_map[] = {
41
42#if defined(CONFIG_SOC_AU1000)
43 { AU1000_UART0_INT, INTC_INT_HIGH_LEVEL, 0 },
44 { AU1000_UART1_INT, INTC_INT_HIGH_LEVEL, 0 },
45 { AU1000_UART2_INT, INTC_INT_HIGH_LEVEL, 0 },
46 { AU1000_UART3_INT, INTC_INT_HIGH_LEVEL, 0 },
47 { AU1000_SSI0_INT, INTC_INT_HIGH_LEVEL, 0 },
48 { AU1000_SSI1_INT, INTC_INT_HIGH_LEVEL, 0 },
49 { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0 },
50 { AU1000_DMA_INT_BASE+1, INTC_INT_HIGH_LEVEL, 0 },
51 { AU1000_DMA_INT_BASE+2, INTC_INT_HIGH_LEVEL, 0 },
52 { AU1000_DMA_INT_BASE+3, INTC_INT_HIGH_LEVEL, 0 },
53 { AU1000_DMA_INT_BASE+4, INTC_INT_HIGH_LEVEL, 0 },
54 { AU1000_DMA_INT_BASE+5, INTC_INT_HIGH_LEVEL, 0 },
55 { AU1000_DMA_INT_BASE+6, INTC_INT_HIGH_LEVEL, 0 },
56 { AU1000_DMA_INT_BASE+7, INTC_INT_HIGH_LEVEL, 0 },
57 { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
58 { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
59 { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
60 { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
61 { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
62 { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
63 { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
64 { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
65 { AU1000_IRDA_TX_INT, INTC_INT_HIGH_LEVEL, 0 },
66 { AU1000_IRDA_RX_INT, INTC_INT_HIGH_LEVEL, 0 },
67 { AU1000_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 },
68 { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
69 { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 },
70 { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 },
71 { AU1000_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0 },
72 { AU1000_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0 },
73 { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 },
74
75#elif defined(CONFIG_SOC_AU1500)
76
77 { AU1500_UART0_INT, INTC_INT_HIGH_LEVEL, 0 },
78 { AU1000_PCI_INTA, INTC_INT_LOW_LEVEL, 0 },
79 { AU1000_PCI_INTB, INTC_INT_LOW_LEVEL, 0 },
80 { AU1500_UART3_INT, INTC_INT_HIGH_LEVEL, 0 },
81 { AU1000_PCI_INTC, INTC_INT_LOW_LEVEL, 0 },
82 { AU1000_PCI_INTD, INTC_INT_LOW_LEVEL, 0 },
83 { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0 },
84 { AU1000_DMA_INT_BASE+1, INTC_INT_HIGH_LEVEL, 0 },
85 { AU1000_DMA_INT_BASE+2, INTC_INT_HIGH_LEVEL, 0 },
86 { AU1000_DMA_INT_BASE+3, INTC_INT_HIGH_LEVEL, 0 },
87 { AU1000_DMA_INT_BASE+4, INTC_INT_HIGH_LEVEL, 0 },
88 { AU1000_DMA_INT_BASE+5, INTC_INT_HIGH_LEVEL, 0 },
89 { AU1000_DMA_INT_BASE+6, INTC_INT_HIGH_LEVEL, 0 },
90 { AU1000_DMA_INT_BASE+7, INTC_INT_HIGH_LEVEL, 0 },
91 { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
92 { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
93 { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
94 { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
95 { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
96 { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
97 { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
98 { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
99 { AU1000_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 },
100 { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
101 { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 },
102 { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 },
103 { AU1500_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0 },
104 { AU1500_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0 },
105 { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 },
106
107#elif defined(CONFIG_SOC_AU1100)
108
109 { AU1100_UART0_INT, INTC_INT_HIGH_LEVEL, 0 },
110 { AU1100_UART1_INT, INTC_INT_HIGH_LEVEL, 0 },
111 { AU1100_SD_INT, INTC_INT_HIGH_LEVEL, 0 },
112 { AU1100_UART3_INT, INTC_INT_HIGH_LEVEL, 0 },
113 { AU1000_SSI0_INT, INTC_INT_HIGH_LEVEL, 0 },
114 { AU1000_SSI1_INT, INTC_INT_HIGH_LEVEL, 0 },
115 { AU1000_DMA_INT_BASE, INTC_INT_HIGH_LEVEL, 0 },
116 { AU1000_DMA_INT_BASE+1, INTC_INT_HIGH_LEVEL, 0 },
117 { AU1000_DMA_INT_BASE+2, INTC_INT_HIGH_LEVEL, 0 },
118 { AU1000_DMA_INT_BASE+3, INTC_INT_HIGH_LEVEL, 0 },
119 { AU1000_DMA_INT_BASE+4, INTC_INT_HIGH_LEVEL, 0 },
120 { AU1000_DMA_INT_BASE+5, INTC_INT_HIGH_LEVEL, 0 },
121 { AU1000_DMA_INT_BASE+6, INTC_INT_HIGH_LEVEL, 0 },
122 { AU1000_DMA_INT_BASE+7, INTC_INT_HIGH_LEVEL, 0 },
123 { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
124 { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
125 { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
126 { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
127 { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
128 { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
129 { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
130 { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
131 { AU1000_IRDA_TX_INT, INTC_INT_HIGH_LEVEL, 0 },
132 { AU1000_IRDA_RX_INT, INTC_INT_HIGH_LEVEL, 0 },
133 { AU1000_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 },
134 { AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
135 { AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 },
136 { AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 },
137 { AU1100_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0 },
138 /* { AU1000_GPIO215_208_INT, INTC_INT_HIGH_LEVEL, 0 }, */
139 { AU1100_LCD_INT, INTC_INT_HIGH_LEVEL, 0 },
140 { AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 },
141
142#elif defined(CONFIG_SOC_AU1550)
143
144 { AU1550_UART0_INT, INTC_INT_HIGH_LEVEL, 0 },
145 { AU1550_PCI_INTA, INTC_INT_LOW_LEVEL, 0 },
146 { AU1550_PCI_INTB, INTC_INT_LOW_LEVEL, 0 },
147 { AU1550_DDMA_INT, INTC_INT_HIGH_LEVEL, 0 },
148 { AU1550_CRYPTO_INT, INTC_INT_HIGH_LEVEL, 0 },
149 { AU1550_PCI_INTC, INTC_INT_LOW_LEVEL, 0 },
150 { AU1550_PCI_INTD, INTC_INT_LOW_LEVEL, 0 },
151 { AU1550_PCI_RST_INT, INTC_INT_LOW_LEVEL, 0 },
152 { AU1550_UART1_INT, INTC_INT_HIGH_LEVEL, 0 },
153 { AU1550_UART3_INT, INTC_INT_HIGH_LEVEL, 0 },
154 { AU1550_PSC0_INT, INTC_INT_HIGH_LEVEL, 0 },
155 { AU1550_PSC1_INT, INTC_INT_HIGH_LEVEL, 0 },
156 { AU1550_PSC2_INT, INTC_INT_HIGH_LEVEL, 0 },
157 { AU1550_PSC3_INT, INTC_INT_HIGH_LEVEL, 0 },
158 { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
159 { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
160 { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
161 { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
162 { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
163 { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
164 { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
165 { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
166 { AU1550_NAND_INT, INTC_INT_RISE_EDGE, 0 },
167 { AU1550_USB_DEV_REQ_INT, INTC_INT_HIGH_LEVEL, 0 },
168 { AU1550_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
169 { AU1550_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 },
170 { AU1550_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0 },
171 { AU1550_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0 },
172
173#elif defined(CONFIG_SOC_AU1200)
174
175 { AU1200_UART0_INT, INTC_INT_HIGH_LEVEL, 0 },
176 { AU1200_SWT_INT, INTC_INT_RISE_EDGE, 0 },
177 { AU1200_SD_INT, INTC_INT_HIGH_LEVEL, 0 },
178 { AU1200_DDMA_INT, INTC_INT_HIGH_LEVEL, 0 },
179 { AU1200_MAE_BE_INT, INTC_INT_HIGH_LEVEL, 0 },
180 { AU1200_UART1_INT, INTC_INT_HIGH_LEVEL, 0 },
181 { AU1200_MAE_FE_INT, INTC_INT_HIGH_LEVEL, 0 },
182 { AU1200_PSC0_INT, INTC_INT_HIGH_LEVEL, 0 },
183 { AU1200_PSC1_INT, INTC_INT_HIGH_LEVEL, 0 },
184 { AU1200_AES_INT, INTC_INT_HIGH_LEVEL, 0 },
185 { AU1200_CAMERA_INT, INTC_INT_HIGH_LEVEL, 0 },
186 { AU1000_TOY_INT, INTC_INT_RISE_EDGE, 0 },
187 { AU1000_TOY_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
188 { AU1000_TOY_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
189 { AU1000_TOY_MATCH2_INT, INTC_INT_RISE_EDGE, 1 },
190 { AU1000_RTC_INT, INTC_INT_RISE_EDGE, 0 },
191 { AU1000_RTC_MATCH0_INT, INTC_INT_RISE_EDGE, 0 },
192 { AU1000_RTC_MATCH1_INT, INTC_INT_RISE_EDGE, 0 },
193 { AU1000_RTC_MATCH2_INT, INTC_INT_RISE_EDGE, 0 },
194 { AU1200_NAND_INT, INTC_INT_RISE_EDGE, 0 },
195 { AU1200_USB_INT, INTC_INT_HIGH_LEVEL, 0 },
196 { AU1200_LCD_INT, INTC_INT_HIGH_LEVEL, 0 },
197 { AU1200_MAE_BOTH_INT, INTC_INT_HIGH_LEVEL, 0 },
198
199#else
200#error "Error: Unknown Alchemy SOC"
201#endif
202
203};
204
205int __initdata au1xxx_ic0_nr_irqs = ARRAY_SIZE(au1xxx_ic0_map);
diff --git a/arch/mips/alchemy/common/clocks.c b/arch/mips/alchemy/common/clocks.c
index 043429d17c5f..d8991854530e 100644
--- a/arch/mips/alchemy/common/clocks.c
+++ b/arch/mips/alchemy/common/clocks.c
@@ -27,12 +27,21 @@
27 */ 27 */
28 28
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/spinlock.h>
31#include <asm/time.h>
30#include <asm/mach-au1x00/au1000.h> 32#include <asm/mach-au1x00/au1000.h>
31 33
34/*
35 * I haven't found anyone that doesn't use a 12 MHz source clock,
36 * but just in case.....
37 */
38#define AU1000_SRC_CLK 12000000
39
32static unsigned int au1x00_clock; /* Hz */ 40static unsigned int au1x00_clock; /* Hz */
33static unsigned int lcd_clock; /* KHz */
34static unsigned long uart_baud_base; 41static unsigned long uart_baud_base;
35 42
43static DEFINE_SPINLOCK(time_lock);
44
36/* 45/*
37 * Set the au1000_clock 46 * Set the au1000_clock
38 */ 47 */
@@ -63,31 +72,45 @@ void set_au1x00_uart_baud_base(unsigned long new_baud_base)
63} 72}
64 73
65/* 74/*
66 * Calculate the Au1x00's LCD clock based on the current 75 * We read the real processor speed from the PLL. This is important
67 * cpu clock and the system bus clock, and try to keep it 76 * because it is more accurate than computing it from the 32 KHz
68 * below 40 MHz (the Pb1000 board can lock-up if the LCD 77 * counter, if it exists. If we don't have an accurate processor
69 * clock is over 40 MHz). 78 * speed, all of the peripherals that derive their clocks based on
79 * this advertised speed will introduce error and sometimes not work
80 * properly. This function is futher convoluted to still allow configurations
81 * to do that in case they have really, really old silicon with a
82 * write-only PLL register. -- Dan
70 */ 83 */
71void set_au1x00_lcd_clock(void) 84unsigned long au1xxx_calc_clock(void)
72{ 85{
73 unsigned int static_cfg0; 86 unsigned long cpu_speed;
74 unsigned int sys_busclk = (get_au1x00_speed() / 1000) / 87 unsigned long flags;
75 ((int)(au_readl(SYS_POWERCTRL) & 0x03) + 2);
76 88
77 static_cfg0 = au_readl(MEM_STCFG0); 89 spin_lock_irqsave(&time_lock, flags);
78 90
79 if (static_cfg0 & (1 << 11)) 91 /*
80 lcd_clock = sys_busclk / 5; /* note: BCLK switching fails with D5 */ 92 * On early Au1000, sys_cpupll was write-only. Since these
93 * silicon versions of Au1000 are not sold by AMD, we don't bend
94 * over backwards trying to determine the frequency.
95 */
96 if (au1xxx_cpu_has_pll_wo())
97#ifdef CONFIG_SOC_AU1000_FREQUENCY
98 cpu_speed = CONFIG_SOC_AU1000_FREQUENCY;
99#else
100 cpu_speed = 396000000;
101#endif
81 else 102 else
82 lcd_clock = sys_busclk / 4; 103 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK;
83 104
84 if (lcd_clock > 50000) /* Epson MAX */ 105 /* On Alchemy CPU:counter ratio is 1:1 */
85 printk(KERN_WARNING "warning: LCD clock too high (%u KHz)\n", 106 mips_hpt_frequency = cpu_speed;
86 lcd_clock); 107 /* Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16) */
87} 108 set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)
109 & 0x03) + 2) * 16));
88 110
89unsigned int get_au1x00_lcd_clock(void) 111 spin_unlock_irqrestore(&time_lock, flags);
90{ 112
91 return lcd_clock; 113 set_au1x00_speed(cpu_speed);
114
115 return cpu_speed;
92} 116}
93EXPORT_SYMBOL(get_au1x00_lcd_clock);
diff --git a/arch/mips/alchemy/common/cputable.c b/arch/mips/alchemy/common/cputable.c
deleted file mode 100644
index ba6430bc2d03..000000000000
--- a/arch/mips/alchemy/common/cputable.c
+++ /dev/null
@@ -1,52 +0,0 @@
1/*
2 * arch/mips/au1000/common/cputable.c
3 *
4 * Copyright (C) 2004 Dan Malek (dan@embeddededge.com)
5 * Copied from PowerPC and updated for Alchemy Au1xxx processors.
6 *
7 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15#include <asm/mach-au1x00/au1000.h>
16
17struct cpu_spec *cur_cpu_spec[NR_CPUS];
18
19/* With some thought, we can probably use the mask to reduce the
20 * size of the table.
21 */
22struct cpu_spec cpu_specs[] = {
23 { 0xffffffff, 0x00030100, "Au1000 DA", 1, 0, 1 },
24 { 0xffffffff, 0x00030201, "Au1000 HA", 1, 0, 1 },
25 { 0xffffffff, 0x00030202, "Au1000 HB", 1, 0, 1 },
26 { 0xffffffff, 0x00030203, "Au1000 HC", 1, 1, 0 },
27 { 0xffffffff, 0x00030204, "Au1000 HD", 1, 1, 0 },
28 { 0xffffffff, 0x01030200, "Au1500 AB", 1, 1, 0 },
29 { 0xffffffff, 0x01030201, "Au1500 AC", 0, 1, 0 },
30 { 0xffffffff, 0x01030202, "Au1500 AD", 0, 1, 0 },
31 { 0xffffffff, 0x02030200, "Au1100 AB", 1, 1, 0 },
32 { 0xffffffff, 0x02030201, "Au1100 BA", 1, 1, 0 },
33 { 0xffffffff, 0x02030202, "Au1100 BC", 1, 1, 0 },
34 { 0xffffffff, 0x02030203, "Au1100 BD", 0, 1, 0 },
35 { 0xffffffff, 0x02030204, "Au1100 BE", 0, 1, 0 },
36 { 0xffffffff, 0x03030200, "Au1550 AA", 0, 1, 0 },
37 { 0xffffffff, 0x04030200, "Au1200 AB", 0, 0, 0 },
38 { 0xffffffff, 0x04030201, "Au1200 AC", 1, 0, 0 },
39 { 0x00000000, 0x00000000, "Unknown Au1xxx", 1, 0, 0 }
40};
41
42void set_cpuspec(void)
43{
44 struct cpu_spec *sp;
45 u32 prid;
46
47 prid = read_c0_prid();
48 sp = cpu_specs;
49 while ((prid & sp->prid_mask) != sp->prid_value)
50 sp++;
51 cur_cpu_spec[0] = sp;
52}
diff --git a/arch/mips/alchemy/common/dbdma.c b/arch/mips/alchemy/common/dbdma.c
index 601ee9180ee4..3ab6d80d150d 100644
--- a/arch/mips/alchemy/common/dbdma.c
+++ b/arch/mips/alchemy/common/dbdma.c
@@ -174,6 +174,11 @@ static dbdev_tab_t dbdev_tab[] = {
174 174
175#define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab) 175#define DBDEV_TAB_SIZE ARRAY_SIZE(dbdev_tab)
176 176
177#ifdef CONFIG_PM
178static u32 au1xxx_dbdma_pm_regs[NUM_DBDMA_CHANS + 1][8];
179#endif
180
181
177static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS]; 182static chan_tab_t *chan_tab_ptr[NUM_DBDMA_CHANS];
178 183
179static dbdev_tab_t *find_dbdev_id(u32 id) 184static dbdev_tab_t *find_dbdev_id(u32 id)
@@ -975,4 +980,64 @@ u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr)
975 return nbytes; 980 return nbytes;
976} 981}
977 982
983#ifdef CONFIG_PM
984void au1xxx_dbdma_suspend(void)
985{
986 int i;
987 u32 addr;
988
989 addr = DDMA_GLOBAL_BASE;
990 au1xxx_dbdma_pm_regs[0][0] = au_readl(addr + 0x00);
991 au1xxx_dbdma_pm_regs[0][1] = au_readl(addr + 0x04);
992 au1xxx_dbdma_pm_regs[0][2] = au_readl(addr + 0x08);
993 au1xxx_dbdma_pm_regs[0][3] = au_readl(addr + 0x0c);
994
995 /* save channel configurations */
996 for (i = 1, addr = DDMA_CHANNEL_BASE; i < NUM_DBDMA_CHANS; i++) {
997 au1xxx_dbdma_pm_regs[i][0] = au_readl(addr + 0x00);
998 au1xxx_dbdma_pm_regs[i][1] = au_readl(addr + 0x04);
999 au1xxx_dbdma_pm_regs[i][2] = au_readl(addr + 0x08);
1000 au1xxx_dbdma_pm_regs[i][3] = au_readl(addr + 0x0c);
1001 au1xxx_dbdma_pm_regs[i][4] = au_readl(addr + 0x10);
1002 au1xxx_dbdma_pm_regs[i][5] = au_readl(addr + 0x14);
1003 au1xxx_dbdma_pm_regs[i][6] = au_readl(addr + 0x18);
1004
1005 /* halt channel */
1006 au_writel(au1xxx_dbdma_pm_regs[i][0] & ~1, addr + 0x00);
1007 au_sync();
1008 while (!(au_readl(addr + 0x14) & 1))
1009 au_sync();
1010
1011 addr += 0x100; /* next channel base */
1012 }
1013 /* disable channel interrupts */
1014 au_writel(0, DDMA_GLOBAL_BASE + 0x0c);
1015 au_sync();
1016}
1017
1018void au1xxx_dbdma_resume(void)
1019{
1020 int i;
1021 u32 addr;
1022
1023 addr = DDMA_GLOBAL_BASE;
1024 au_writel(au1xxx_dbdma_pm_regs[0][0], addr + 0x00);
1025 au_writel(au1xxx_dbdma_pm_regs[0][1], addr + 0x04);
1026 au_writel(au1xxx_dbdma_pm_regs[0][2], addr + 0x08);
1027 au_writel(au1xxx_dbdma_pm_regs[0][3], addr + 0x0c);
1028
1029 /* restore channel configurations */
1030 for (i = 1, addr = DDMA_CHANNEL_BASE; i < NUM_DBDMA_CHANS; i++) {
1031 au_writel(au1xxx_dbdma_pm_regs[i][0], addr + 0x00);
1032 au_writel(au1xxx_dbdma_pm_regs[i][1], addr + 0x04);
1033 au_writel(au1xxx_dbdma_pm_regs[i][2], addr + 0x08);
1034 au_writel(au1xxx_dbdma_pm_regs[i][3], addr + 0x0c);
1035 au_writel(au1xxx_dbdma_pm_regs[i][4], addr + 0x10);
1036 au_writel(au1xxx_dbdma_pm_regs[i][5], addr + 0x14);
1037 au_writel(au1xxx_dbdma_pm_regs[i][6], addr + 0x18);
1038 au_sync();
1039 addr += 0x100; /* next channel base */
1040 }
1041}
1042#endif /* CONFIG_PM */
978#endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */ 1043#endif /* defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200) */
diff --git a/arch/mips/alchemy/common/irq.c b/arch/mips/alchemy/common/irq.c
index 40c6ceceb5f9..c88c821b4c36 100644
--- a/arch/mips/alchemy/common/irq.c
+++ b/arch/mips/alchemy/common/irq.c
@@ -24,6 +24,7 @@
24 * with this program; if not, write to the Free Software Foundation, Inc., 24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 675 Mass Ave, Cambridge, MA 02139, USA. 25 * 675 Mass Ave, Cambridge, MA 02139, USA.
26 */ 26 */
27
27#include <linux/bitops.h> 28#include <linux/bitops.h>
28#include <linux/init.h> 29#include <linux/init.h>
29#include <linux/interrupt.h> 30#include <linux/interrupt.h>
@@ -36,15 +37,172 @@
36#include <asm/mach-pb1x00/pb1000.h> 37#include <asm/mach-pb1x00/pb1000.h>
37#endif 38#endif
38 39
39#define EXT_INTC0_REQ0 2 /* IP 2 */ 40static int au1x_ic_settype(unsigned int irq, unsigned int flow_type);
40#define EXT_INTC0_REQ1 3 /* IP 3 */ 41
41#define EXT_INTC1_REQ0 4 /* IP 4 */ 42/* per-processor fixed function irqs */
42#define EXT_INTC1_REQ1 5 /* IP 5 */ 43struct au1xxx_irqmap au1xxx_ic0_map[] __initdata = {
43#define MIPS_TIMER_IP 7 /* IP 7 */ 44
44 45#if defined(CONFIG_SOC_AU1000)
45void (*board_init_irq)(void) __initdata = NULL; 46 { AU1000_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
47 { AU1000_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
48 { AU1000_UART2_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
49 { AU1000_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
50 { AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
51 { AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
52 { AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
53 { AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
54 { AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
55 { AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
56 { AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
57 { AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
58 { AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
59 { AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
60 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
61 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
62 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
63 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
64 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
65 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
66 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
67 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
68 { AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
69 { AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
70 { AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
71 { AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
72 { AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
73 { AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 },
74 { AU1000_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
75 { AU1000_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
76 { AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
77
78#elif defined(CONFIG_SOC_AU1500)
79
80 { AU1500_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
81 { AU1000_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 0 },
82 { AU1000_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 0 },
83 { AU1500_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
84 { AU1000_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 0 },
85 { AU1000_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 0 },
86 { AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
87 { AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
88 { AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
89 { AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
90 { AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
91 { AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
92 { AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
93 { AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
94 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
95 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
96 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
97 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
98 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
99 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
100 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
101 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
102 { AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
103 { AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
104 { AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
105 { AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 },
106 { AU1500_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
107 { AU1500_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
108 { AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
109
110#elif defined(CONFIG_SOC_AU1100)
111
112 { AU1100_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
113 { AU1100_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
114 { AU1100_SD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
115 { AU1100_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
116 { AU1000_SSI0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
117 { AU1000_SSI1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
118 { AU1000_DMA_INT_BASE, IRQ_TYPE_LEVEL_HIGH, 0 },
119 { AU1000_DMA_INT_BASE+1, IRQ_TYPE_LEVEL_HIGH, 0 },
120 { AU1000_DMA_INT_BASE+2, IRQ_TYPE_LEVEL_HIGH, 0 },
121 { AU1000_DMA_INT_BASE+3, IRQ_TYPE_LEVEL_HIGH, 0 },
122 { AU1000_DMA_INT_BASE+4, IRQ_TYPE_LEVEL_HIGH, 0 },
123 { AU1000_DMA_INT_BASE+5, IRQ_TYPE_LEVEL_HIGH, 0 },
124 { AU1000_DMA_INT_BASE+6, IRQ_TYPE_LEVEL_HIGH, 0 },
125 { AU1000_DMA_INT_BASE+7, IRQ_TYPE_LEVEL_HIGH, 0 },
126 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
127 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
128 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
129 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
130 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
131 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
132 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
133 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
134 { AU1000_IRDA_TX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
135 { AU1000_IRDA_RX_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
136 { AU1000_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
137 { AU1000_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
138 { AU1000_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
139 { AU1000_ACSYNC_INT, IRQ_TYPE_EDGE_RISING, 0 },
140 { AU1100_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
141 { AU1100_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
142 { AU1000_AC97C_INT, IRQ_TYPE_EDGE_RISING, 0 },
143
144#elif defined(CONFIG_SOC_AU1550)
145
146 { AU1550_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
147 { AU1550_PCI_INTA, IRQ_TYPE_LEVEL_LOW, 0 },
148 { AU1550_PCI_INTB, IRQ_TYPE_LEVEL_LOW, 0 },
149 { AU1550_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
150 { AU1550_CRYPTO_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
151 { AU1550_PCI_INTC, IRQ_TYPE_LEVEL_LOW, 0 },
152 { AU1550_PCI_INTD, IRQ_TYPE_LEVEL_LOW, 0 },
153 { AU1550_PCI_RST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
154 { AU1550_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
155 { AU1550_UART3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
156 { AU1550_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
157 { AU1550_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
158 { AU1550_PSC2_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
159 { AU1550_PSC3_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
160 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
161 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
162 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
163 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
164 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
165 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
166 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
167 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
168 { AU1550_NAND_INT, IRQ_TYPE_EDGE_RISING, 0 },
169 { AU1550_USB_DEV_REQ_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
170 { AU1550_USB_DEV_SUS_INT, IRQ_TYPE_EDGE_RISING, 0 },
171 { AU1550_USB_HOST_INT, IRQ_TYPE_LEVEL_LOW, 0 },
172 { AU1550_MAC0_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
173 { AU1550_MAC1_DMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
174
175#elif defined(CONFIG_SOC_AU1200)
176
177 { AU1200_UART0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
178 { AU1200_SWT_INT, IRQ_TYPE_EDGE_RISING, 0 },
179 { AU1200_SD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
180 { AU1200_DDMA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
181 { AU1200_MAE_BE_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
182 { AU1200_UART1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
183 { AU1200_MAE_FE_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
184 { AU1200_PSC0_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
185 { AU1200_PSC1_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
186 { AU1200_AES_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
187 { AU1200_CAMERA_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
188 { AU1000_TOY_INT, IRQ_TYPE_EDGE_RISING, 0 },
189 { AU1000_TOY_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
190 { AU1000_TOY_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
191 { AU1000_TOY_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 1 },
192 { AU1000_RTC_INT, IRQ_TYPE_EDGE_RISING, 0 },
193 { AU1000_RTC_MATCH0_INT, IRQ_TYPE_EDGE_RISING, 0 },
194 { AU1000_RTC_MATCH1_INT, IRQ_TYPE_EDGE_RISING, 0 },
195 { AU1000_RTC_MATCH2_INT, IRQ_TYPE_EDGE_RISING, 0 },
196 { AU1200_NAND_INT, IRQ_TYPE_EDGE_RISING, 0 },
197 { AU1200_USB_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
198 { AU1200_LCD_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
199 { AU1200_MAE_BOTH_INT, IRQ_TYPE_LEVEL_HIGH, 0 },
200
201#else
202#error "Error: Unknown Alchemy SOC"
203#endif
204};
46 205
47static DEFINE_SPINLOCK(irq_lock);
48 206
49#ifdef CONFIG_PM 207#ifdef CONFIG_PM
50 208
@@ -130,67 +288,47 @@ void restore_au1xxx_intctl(void)
130#endif /* CONFIG_PM */ 288#endif /* CONFIG_PM */
131 289
132 290
133inline void local_enable_irq(unsigned int irq_nr) 291static void au1x_ic0_unmask(unsigned int irq_nr)
134{ 292{
135 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; 293 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE;
136 294 au_writel(1 << bit, IC0_MASKSET);
137 if (bit >= 32) { 295 au_writel(1 << bit, IC0_WAKESET);
138 au_writel(1 << (bit - 32), IC1_MASKSET);
139 au_writel(1 << (bit - 32), IC1_WAKESET);
140 } else {
141 au_writel(1 << bit, IC0_MASKSET);
142 au_writel(1 << bit, IC0_WAKESET);
143 }
144 au_sync(); 296 au_sync();
145} 297}
146 298
147 299static void au1x_ic1_unmask(unsigned int irq_nr)
148inline void local_disable_irq(unsigned int irq_nr)
149{ 300{
150 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; 301 unsigned int bit = irq_nr - AU1000_INTC1_INT_BASE;
302 au_writel(1 << bit, IC1_MASKSET);
303 au_writel(1 << bit, IC1_WAKESET);
151 304
152 if (bit >= 32) { 305/* very hacky. does the pb1000 cpld auto-disable this int?
153 au_writel(1 << (bit - 32), IC1_MASKCLR); 306 * nowhere in the current kernel sources is it disabled. --mlau
154 au_writel(1 << (bit - 32), IC1_WAKECLR); 307 */
155 } else { 308#if defined(CONFIG_MIPS_PB1000)
156 au_writel(1 << bit, IC0_MASKCLR); 309 if (irq_nr == AU1000_GPIO_15)
157 au_writel(1 << bit, IC0_WAKECLR); 310 au_writel(0x4000, PB1000_MDR); /* enable int */
158 } 311#endif
159 au_sync(); 312 au_sync();
160} 313}
161 314
162 315static void au1x_ic0_mask(unsigned int irq_nr)
163static inline void mask_and_ack_rise_edge_irq(unsigned int irq_nr)
164{ 316{
165 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; 317 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE;
166 318 au_writel(1 << bit, IC0_MASKCLR);
167 if (bit >= 32) { 319 au_writel(1 << bit, IC0_WAKECLR);
168 au_writel(1 << (bit - 32), IC1_RISINGCLR);
169 au_writel(1 << (bit - 32), IC1_MASKCLR);
170 } else {
171 au_writel(1 << bit, IC0_RISINGCLR);
172 au_writel(1 << bit, IC0_MASKCLR);
173 }
174 au_sync(); 320 au_sync();
175} 321}
176 322
177 323static void au1x_ic1_mask(unsigned int irq_nr)
178static inline void mask_and_ack_fall_edge_irq(unsigned int irq_nr)
179{ 324{
180 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; 325 unsigned int bit = irq_nr - AU1000_INTC1_INT_BASE;
181 326 au_writel(1 << bit, IC1_MASKCLR);
182 if (bit >= 32) { 327 au_writel(1 << bit, IC1_WAKECLR);
183 au_writel(1 << (bit - 32), IC1_FALLINGCLR);
184 au_writel(1 << (bit - 32), IC1_MASKCLR);
185 } else {
186 au_writel(1 << bit, IC0_FALLINGCLR);
187 au_writel(1 << bit, IC0_MASKCLR);
188 }
189 au_sync(); 328 au_sync();
190} 329}
191 330
192 331static void au1x_ic0_ack(unsigned int irq_nr)
193static inline void mask_and_ack_either_edge_irq(unsigned int irq_nr)
194{ 332{
195 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; 333 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE;
196 334
@@ -198,349 +336,229 @@ static inline void mask_and_ack_either_edge_irq(unsigned int irq_nr)
198 * This may assume that we don't get interrupts from 336 * This may assume that we don't get interrupts from
199 * both edges at once, or if we do, that we don't care. 337 * both edges at once, or if we do, that we don't care.
200 */ 338 */
201 if (bit >= 32) { 339 au_writel(1 << bit, IC0_FALLINGCLR);
202 au_writel(1 << (bit - 32), IC1_FALLINGCLR); 340 au_writel(1 << bit, IC0_RISINGCLR);
203 au_writel(1 << (bit - 32), IC1_RISINGCLR);
204 au_writel(1 << (bit - 32), IC1_MASKCLR);
205 } else {
206 au_writel(1 << bit, IC0_FALLINGCLR);
207 au_writel(1 << bit, IC0_RISINGCLR);
208 au_writel(1 << bit, IC0_MASKCLR);
209 }
210 au_sync(); 341 au_sync();
211} 342}
212 343
213static inline void mask_and_ack_level_irq(unsigned int irq_nr) 344static void au1x_ic1_ack(unsigned int irq_nr)
214{ 345{
215 local_disable_irq(irq_nr); 346 unsigned int bit = irq_nr - AU1000_INTC1_INT_BASE;
216 au_sync();
217#if defined(CONFIG_MIPS_PB1000)
218 if (irq_nr == AU1000_GPIO_15) {
219 au_writel(0x8000, PB1000_MDR); /* ack int */
220 au_sync();
221 }
222#endif
223}
224
225static void end_irq(unsigned int irq_nr)
226{
227 if (!(irq_desc[irq_nr].status & (IRQ_DISABLED | IRQ_INPROGRESS)))
228 local_enable_irq(irq_nr);
229 347
230#if defined(CONFIG_MIPS_PB1000) 348 /*
231 if (irq_nr == AU1000_GPIO_15) { 349 * This may assume that we don't get interrupts from
232 au_writel(0x4000, PB1000_MDR); /* enable int */ 350 * both edges at once, or if we do, that we don't care.
233 au_sync(); 351 */
234 } 352 au_writel(1 << bit, IC1_FALLINGCLR);
235#endif 353 au_writel(1 << bit, IC1_RISINGCLR);
354 au_sync();
236} 355}
237 356
238unsigned long save_local_and_disable(int controller) 357static int au1x_ic1_setwake(unsigned int irq, unsigned int on)
239{ 358{
240 int i; 359 unsigned int bit = irq - AU1000_INTC1_INT_BASE;
241 unsigned long flags, mask; 360 unsigned long wakemsk, flags;
242
243 spin_lock_irqsave(&irq_lock, flags);
244 if (controller) {
245 mask = au_readl(IC1_MASKSET);
246 for (i = 32; i < 64; i++)
247 local_disable_irq(i);
248 } else {
249 mask = au_readl(IC0_MASKSET);
250 for (i = 0; i < 32; i++)
251 local_disable_irq(i);
252 }
253 spin_unlock_irqrestore(&irq_lock, flags);
254
255 return mask;
256}
257 361
258void restore_local_and_enable(int controller, unsigned long mask) 362 /* only GPIO 0-7 can act as wakeup source: */
259{ 363 if ((irq < AU1000_GPIO_0) || (irq > AU1000_GPIO_7))
260 int i; 364 return -EINVAL;
261 unsigned long flags, new_mask;
262
263 spin_lock_irqsave(&irq_lock, flags);
264 for (i = 0; i < 32; i++)
265 if (mask & (1 << i)) {
266 if (controller)
267 local_enable_irq(i + 32);
268 else
269 local_enable_irq(i);
270 }
271 365
272 if (controller) 366 local_irq_save(flags);
273 new_mask = au_readl(IC1_MASKSET); 367 wakemsk = au_readl(SYS_WAKEMSK);
368 if (on)
369 wakemsk |= 1 << bit;
274 else 370 else
275 new_mask = au_readl(IC0_MASKSET); 371 wakemsk &= ~(1 << bit);
372 au_writel(wakemsk, SYS_WAKEMSK);
373 au_sync();
374 local_irq_restore(flags);
276 375
277 spin_unlock_irqrestore(&irq_lock, flags); 376 return 0;
278} 377}
279 378
280 379/*
281static struct irq_chip rise_edge_irq_type = { 380 * irq_chips for both ICs; this way the mask handlers can be
282 .name = "Au1000 Rise Edge", 381 * as short as possible.
283 .ack = mask_and_ack_rise_edge_irq, 382 *
284 .mask = local_disable_irq, 383 * NOTE: the ->ack() callback is used by the handle_edge_irq
285 .mask_ack = mask_and_ack_rise_edge_irq, 384 * flowhandler only, the ->mask_ack() one by handle_level_irq,
286 .unmask = local_enable_irq, 385 * so no need for an irq_chip for each type of irq (level/edge).
287 .end = end_irq, 386 */
288}; 387static struct irq_chip au1x_ic0_chip = {
289 388 .name = "Alchemy-IC0",
290static struct irq_chip fall_edge_irq_type = { 389 .ack = au1x_ic0_ack, /* edge */
291 .name = "Au1000 Fall Edge", 390 .mask = au1x_ic0_mask,
292 .ack = mask_and_ack_fall_edge_irq, 391 .mask_ack = au1x_ic0_mask, /* level */
293 .mask = local_disable_irq, 392 .unmask = au1x_ic0_unmask,
294 .mask_ack = mask_and_ack_fall_edge_irq, 393 .set_type = au1x_ic_settype,
295 .unmask = local_enable_irq,
296 .end = end_irq,
297};
298
299static struct irq_chip either_edge_irq_type = {
300 .name = "Au1000 Rise or Fall Edge",
301 .ack = mask_and_ack_either_edge_irq,
302 .mask = local_disable_irq,
303 .mask_ack = mask_and_ack_either_edge_irq,
304 .unmask = local_enable_irq,
305 .end = end_irq,
306}; 394};
307 395
308static struct irq_chip level_irq_type = { 396static struct irq_chip au1x_ic1_chip = {
309 .name = "Au1000 Level", 397 .name = "Alchemy-IC1",
310 .ack = mask_and_ack_level_irq, 398 .ack = au1x_ic1_ack, /* edge */
311 .mask = local_disable_irq, 399 .mask = au1x_ic1_mask,
312 .mask_ack = mask_and_ack_level_irq, 400 .mask_ack = au1x_ic1_mask, /* level */
313 .unmask = local_enable_irq, 401 .unmask = au1x_ic1_unmask,
314 .end = end_irq, 402 .set_type = au1x_ic_settype,
403 .set_wake = au1x_ic1_setwake,
315}; 404};
316 405
317static void __init setup_local_irq(unsigned int irq_nr, int type, int int_req) 406static int au1x_ic_settype(unsigned int irq, unsigned int flow_type)
318{ 407{
319 unsigned int bit = irq_nr - AU1000_INTC0_INT_BASE; 408 struct irq_chip *chip;
320 409 unsigned long icr[6];
321 if (irq_nr > AU1000_MAX_INTR) 410 unsigned int bit, ic;
322 return; 411 int ret;
323 412
324 /* Config2[n], Config1[n], Config0[n] */ 413 if (irq >= AU1000_INTC1_INT_BASE) {
325 if (bit >= 32) { 414 bit = irq - AU1000_INTC1_INT_BASE;
326 switch (type) { 415 chip = &au1x_ic1_chip;
327 case INTC_INT_RISE_EDGE: /* 0:0:1 */ 416 ic = 1;
328 au_writel(1 << (bit - 32), IC1_CFG2CLR);
329 au_writel(1 << (bit - 32), IC1_CFG1CLR);
330 au_writel(1 << (bit - 32), IC1_CFG0SET);
331 set_irq_chip(irq_nr, &rise_edge_irq_type);
332 break;
333 case INTC_INT_FALL_EDGE: /* 0:1:0 */
334 au_writel(1 << (bit - 32), IC1_CFG2CLR);
335 au_writel(1 << (bit - 32), IC1_CFG1SET);
336 au_writel(1 << (bit - 32), IC1_CFG0CLR);
337 set_irq_chip(irq_nr, &fall_edge_irq_type);
338 break;
339 case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */
340 au_writel(1 << (bit - 32), IC1_CFG2CLR);
341 au_writel(1 << (bit - 32), IC1_CFG1SET);
342 au_writel(1 << (bit - 32), IC1_CFG0SET);
343 set_irq_chip(irq_nr, &either_edge_irq_type);
344 break;
345 case INTC_INT_HIGH_LEVEL: /* 1:0:1 */
346 au_writel(1 << (bit - 32), IC1_CFG2SET);
347 au_writel(1 << (bit - 32), IC1_CFG1CLR);
348 au_writel(1 << (bit - 32), IC1_CFG0SET);
349 set_irq_chip(irq_nr, &level_irq_type);
350 break;
351 case INTC_INT_LOW_LEVEL: /* 1:1:0 */
352 au_writel(1 << (bit - 32), IC1_CFG2SET);
353 au_writel(1 << (bit - 32), IC1_CFG1SET);
354 au_writel(1 << (bit - 32), IC1_CFG0CLR);
355 set_irq_chip(irq_nr, &level_irq_type);
356 break;
357 case INTC_INT_DISABLED: /* 0:0:0 */
358 au_writel(1 << (bit - 32), IC1_CFG0CLR);
359 au_writel(1 << (bit - 32), IC1_CFG1CLR);
360 au_writel(1 << (bit - 32), IC1_CFG2CLR);
361 break;
362 default: /* disable the interrupt */
363 printk(KERN_WARNING "unexpected int type %d (irq %d)\n",
364 type, irq_nr);
365 au_writel(1 << (bit - 32), IC1_CFG0CLR);
366 au_writel(1 << (bit - 32), IC1_CFG1CLR);
367 au_writel(1 << (bit - 32), IC1_CFG2CLR);
368 return;
369 }
370 if (int_req) /* assign to interrupt request 1 */
371 au_writel(1 << (bit - 32), IC1_ASSIGNCLR);
372 else /* assign to interrupt request 0 */
373 au_writel(1 << (bit - 32), IC1_ASSIGNSET);
374 au_writel(1 << (bit - 32), IC1_SRCSET);
375 au_writel(1 << (bit - 32), IC1_MASKCLR);
376 au_writel(1 << (bit - 32), IC1_WAKECLR);
377 } else { 417 } else {
378 switch (type) { 418 bit = irq - AU1000_INTC0_INT_BASE;
379 case INTC_INT_RISE_EDGE: /* 0:0:1 */ 419 chip = &au1x_ic0_chip;
380 au_writel(1 << bit, IC0_CFG2CLR); 420 ic = 0;
381 au_writel(1 << bit, IC0_CFG1CLR); 421 }
382 au_writel(1 << bit, IC0_CFG0SET); 422
383 set_irq_chip(irq_nr, &rise_edge_irq_type); 423 if (bit > 31)
384 break; 424 return -EINVAL;
385 case INTC_INT_FALL_EDGE: /* 0:1:0 */ 425
386 au_writel(1 << bit, IC0_CFG2CLR); 426 icr[0] = ic ? IC1_CFG0SET : IC0_CFG0SET;
387 au_writel(1 << bit, IC0_CFG1SET); 427 icr[1] = ic ? IC1_CFG1SET : IC0_CFG1SET;
388 au_writel(1 << bit, IC0_CFG0CLR); 428 icr[2] = ic ? IC1_CFG2SET : IC0_CFG2SET;
389 set_irq_chip(irq_nr, &fall_edge_irq_type); 429 icr[3] = ic ? IC1_CFG0CLR : IC0_CFG0CLR;
390 break; 430 icr[4] = ic ? IC1_CFG1CLR : IC0_CFG1CLR;
391 case INTC_INT_RISE_AND_FALL_EDGE: /* 0:1:1 */ 431 icr[5] = ic ? IC1_CFG2CLR : IC0_CFG2CLR;
392 au_writel(1 << bit, IC0_CFG2CLR); 432
393 au_writel(1 << bit, IC0_CFG1SET); 433 ret = 0;
394 au_writel(1 << bit, IC0_CFG0SET); 434
395 set_irq_chip(irq_nr, &either_edge_irq_type); 435 switch (flow_type) { /* cfgregs 2:1:0 */
396 break; 436 case IRQ_TYPE_EDGE_RISING: /* 0:0:1 */
397 case INTC_INT_HIGH_LEVEL: /* 1:0:1 */ 437 au_writel(1 << bit, icr[5]);
398 au_writel(1 << bit, IC0_CFG2SET); 438 au_writel(1 << bit, icr[4]);
399 au_writel(1 << bit, IC0_CFG1CLR); 439 au_writel(1 << bit, icr[0]);
400 au_writel(1 << bit, IC0_CFG0SET); 440 set_irq_chip_and_handler_name(irq, chip,
401 set_irq_chip(irq_nr, &level_irq_type); 441 handle_edge_irq, "riseedge");
402 break; 442 break;
403 case INTC_INT_LOW_LEVEL: /* 1:1:0 */ 443 case IRQ_TYPE_EDGE_FALLING: /* 0:1:0 */
404 au_writel(1 << bit, IC0_CFG2SET); 444 au_writel(1 << bit, icr[5]);
405 au_writel(1 << bit, IC0_CFG1SET); 445 au_writel(1 << bit, icr[1]);
406 au_writel(1 << bit, IC0_CFG0CLR); 446 au_writel(1 << bit, icr[3]);
407 set_irq_chip(irq_nr, &level_irq_type); 447 set_irq_chip_and_handler_name(irq, chip,
408 break; 448 handle_edge_irq, "falledge");
409 case INTC_INT_DISABLED: /* 0:0:0 */ 449 break;
410 au_writel(1 << bit, IC0_CFG0CLR); 450 case IRQ_TYPE_EDGE_BOTH: /* 0:1:1 */
411 au_writel(1 << bit, IC0_CFG1CLR); 451 au_writel(1 << bit, icr[5]);
412 au_writel(1 << bit, IC0_CFG2CLR); 452 au_writel(1 << bit, icr[1]);
413 break; 453 au_writel(1 << bit, icr[0]);
414 default: /* disable the interrupt */ 454 set_irq_chip_and_handler_name(irq, chip,
415 printk(KERN_WARNING "unexpected int type %d (irq %d)\n", 455 handle_edge_irq, "bothedge");
416 type, irq_nr); 456 break;
417 au_writel(1 << bit, IC0_CFG0CLR); 457 case IRQ_TYPE_LEVEL_HIGH: /* 1:0:1 */
418 au_writel(1 << bit, IC0_CFG1CLR); 458 au_writel(1 << bit, icr[2]);
419 au_writel(1 << bit, IC0_CFG2CLR); 459 au_writel(1 << bit, icr[4]);
420 return; 460 au_writel(1 << bit, icr[0]);
421 } 461 set_irq_chip_and_handler_name(irq, chip,
422 if (int_req) /* assign to interrupt request 1 */ 462 handle_level_irq, "hilevel");
423 au_writel(1 << bit, IC0_ASSIGNCLR); 463 break;
424 else /* assign to interrupt request 0 */ 464 case IRQ_TYPE_LEVEL_LOW: /* 1:1:0 */
425 au_writel(1 << bit, IC0_ASSIGNSET); 465 au_writel(1 << bit, icr[2]);
426 au_writel(1 << bit, IC0_SRCSET); 466 au_writel(1 << bit, icr[1]);
427 au_writel(1 << bit, IC0_MASKCLR); 467 au_writel(1 << bit, icr[3]);
428 au_writel(1 << bit, IC0_WAKECLR); 468 set_irq_chip_and_handler_name(irq, chip,
469 handle_level_irq, "lowlevel");
470 break;
471 case IRQ_TYPE_NONE: /* 0:0:0 */
472 au_writel(1 << bit, icr[5]);
473 au_writel(1 << bit, icr[4]);
474 au_writel(1 << bit, icr[3]);
475 /* set at least chip so we can call set_irq_type() on it */
476 set_irq_chip(irq, chip);
477 break;
478 default:
479 ret = -EINVAL;
429 } 480 }
430 au_sync(); 481 au_sync();
431}
432 482
433/* 483 return ret;
434 * Interrupts are nested. Even if an interrupt handler is registered 484}
435 * as "fast", we might get another interrupt before we return from
436 * intcX_reqX_irqdispatch().
437 */
438 485
439static void intc0_req0_irqdispatch(void) 486asmlinkage void plat_irq_dispatch(void)
440{ 487{
441 static unsigned long intc0_req0; 488 unsigned int pending = read_c0_status() & read_c0_cause();
442 unsigned int bit; 489 unsigned long s, off, bit;
443
444 intc0_req0 |= au_readl(IC0_REQ0INT);
445 490
446 if (!intc0_req0) 491 if (pending & CAUSEF_IP7) {
492 do_IRQ(MIPS_CPU_IRQ_BASE + 7);
447 return; 493 return;
448 494 } else if (pending & CAUSEF_IP2) {
495 s = IC0_REQ0INT;
496 off = AU1000_INTC0_INT_BASE;
497 } else if (pending & CAUSEF_IP3) {
498 s = IC0_REQ1INT;
499 off = AU1000_INTC0_INT_BASE;
500 } else if (pending & CAUSEF_IP4) {
501 s = IC1_REQ0INT;
502 off = AU1000_INTC1_INT_BASE;
503 } else if (pending & CAUSEF_IP5) {
504 s = IC1_REQ1INT;
505 off = AU1000_INTC1_INT_BASE;
506 } else
507 goto spurious;
508
509 bit = 0;
510 s = au_readl(s);
511 if (unlikely(!s)) {
512spurious:
513 spurious_interrupt();
514 return;
515 }
449#ifdef AU1000_USB_DEV_REQ_INT 516#ifdef AU1000_USB_DEV_REQ_INT
450 /* 517 /*
451 * Because of the tight timing of SETUP token to reply 518 * Because of the tight timing of SETUP token to reply
452 * transactions, the USB devices-side packet complete 519 * transactions, the USB devices-side packet complete
453 * interrupt needs the highest priority. 520 * interrupt needs the highest priority.
454 */ 521 */
455 if ((intc0_req0 & (1 << AU1000_USB_DEV_REQ_INT))) { 522 bit = 1 << (AU1000_USB_DEV_REQ_INT - AU1000_INTC0_INT_BASE);
456 intc0_req0 &= ~(1 << AU1000_USB_DEV_REQ_INT); 523 if ((pending & CAUSEF_IP2) && (s & bit)) {
457 do_IRQ(AU1000_USB_DEV_REQ_INT); 524 do_IRQ(AU1000_USB_DEV_REQ_INT);
458 return; 525 return;
459 } 526 }
460#endif 527#endif
461 bit = __ffs(intc0_req0); 528 do_IRQ(__ffs(s) + off);
462 intc0_req0 &= ~(1 << bit);
463 do_IRQ(AU1000_INTC0_INT_BASE + bit);
464} 529}
465 530
466 531/* setup edge/level and assign request 0/1 */
467static void intc0_req1_irqdispatch(void) 532void __init au1xxx_setup_irqmap(struct au1xxx_irqmap *map, int count)
468{
469 static unsigned long intc0_req1;
470 unsigned int bit;
471
472 intc0_req1 |= au_readl(IC0_REQ1INT);
473
474 if (!intc0_req1)
475 return;
476
477 bit = __ffs(intc0_req1);
478 intc0_req1 &= ~(1 << bit);
479 do_IRQ(AU1000_INTC0_INT_BASE + bit);
480}
481
482
483/*
484 * Interrupt Controller 1:
485 * interrupts 32 - 63
486 */
487static void intc1_req0_irqdispatch(void)
488{ 533{
489 static unsigned long intc1_req0; 534 unsigned int bit, irq_nr;
490 unsigned int bit; 535
491 536 while (count--) {
492 intc1_req0 |= au_readl(IC1_REQ0INT); 537 irq_nr = map[count].im_irq;
493 538
494 if (!intc1_req0) 539 if (((irq_nr < AU1000_INTC0_INT_BASE) ||
495 return; 540 (irq_nr >= AU1000_INTC0_INT_BASE + 32)) &&
496 541 ((irq_nr < AU1000_INTC1_INT_BASE) ||
497 bit = __ffs(intc1_req0); 542 (irq_nr >= AU1000_INTC1_INT_BASE + 32)))
498 intc1_req0 &= ~(1 << bit); 543 continue;
499 do_IRQ(AU1000_INTC1_INT_BASE + bit); 544
500} 545 if (irq_nr >= AU1000_INTC1_INT_BASE) {
501 546 bit = irq_nr - AU1000_INTC1_INT_BASE;
502 547 if (map[count].im_request)
503static void intc1_req1_irqdispatch(void) 548 au_writel(1 << bit, IC1_ASSIGNCLR);
504{ 549 } else {
505 static unsigned long intc1_req1; 550 bit = irq_nr - AU1000_INTC0_INT_BASE;
506 unsigned int bit; 551 if (map[count].im_request)
507 552 au_writel(1 << bit, IC0_ASSIGNCLR);
508 intc1_req1 |= au_readl(IC1_REQ1INT); 553 }
509
510 if (!intc1_req1)
511 return;
512
513 bit = __ffs(intc1_req1);
514 intc1_req1 &= ~(1 << bit);
515 do_IRQ(AU1000_INTC1_INT_BASE + bit);
516}
517
518asmlinkage void plat_irq_dispatch(void)
519{
520 unsigned int pending = read_c0_status() & read_c0_cause();
521 554
522 if (pending & CAUSEF_IP7) 555 au1x_ic_settype(irq_nr, map[count].im_type);
523 do_IRQ(MIPS_CPU_IRQ_BASE + 7); 556 }
524 else if (pending & CAUSEF_IP2)
525 intc0_req0_irqdispatch();
526 else if (pending & CAUSEF_IP3)
527 intc0_req1_irqdispatch();
528 else if (pending & CAUSEF_IP4)
529 intc1_req0_irqdispatch();
530 else if (pending & CAUSEF_IP5)
531 intc1_req1_irqdispatch();
532 else
533 spurious_interrupt();
534} 557}
535 558
536void __init arch_init_irq(void) 559void __init arch_init_irq(void)
537{ 560{
538 int i; 561 int i;
539 struct au1xxx_irqmap *imp;
540 extern struct au1xxx_irqmap au1xxx_irq_map[];
541 extern struct au1xxx_irqmap au1xxx_ic0_map[];
542 extern int au1xxx_nr_irqs;
543 extern int au1xxx_ic0_nr_irqs;
544 562
545 /* 563 /*
546 * Initialize interrupt controllers to a safe state. 564 * Initialize interrupt controllers to a safe state.
@@ -569,28 +587,25 @@ void __init arch_init_irq(void)
569 587
570 mips_cpu_irq_init(); 588 mips_cpu_irq_init();
571 589
572 /* 590 /* register all 64 possible IC0+IC1 irq sources as type "none".
573 * Initialize IC0, which is fixed per processor. 591 * Use set_irq_type() to set edge/level behaviour at runtime.
574 */ 592 */
575 imp = au1xxx_ic0_map; 593 for (i = AU1000_INTC0_INT_BASE;
576 for (i = 0; i < au1xxx_ic0_nr_irqs; i++) { 594 (i < AU1000_INTC0_INT_BASE + 32); i++)
577 setup_local_irq(imp->im_irq, imp->im_type, imp->im_request); 595 au1x_ic_settype(i, IRQ_TYPE_NONE);
578 imp++; 596
579 } 597 for (i = AU1000_INTC1_INT_BASE;
598 (i < AU1000_INTC1_INT_BASE + 32); i++)
599 au1x_ic_settype(i, IRQ_TYPE_NONE);
580 600
581 /* 601 /*
582 * Now set up the irq mapping for the board. 602 * Initialize IC0, which is fixed per processor.
583 */ 603 */
584 imp = au1xxx_irq_map; 604 au1xxx_setup_irqmap(au1xxx_ic0_map, ARRAY_SIZE(au1xxx_ic0_map));
585 for (i = 0; i < au1xxx_nr_irqs; i++) {
586 setup_local_irq(imp->im_irq, imp->im_type, imp->im_request);
587 imp++;
588 }
589
590 set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3 | IE_IRQ4);
591 605
592 /* Board specific IRQ initialization. 606 /* Boards can register additional (GPIO-based) IRQs.
593 */ 607 */
594 if (board_init_irq) 608 board_init_irq();
595 board_init_irq(); 609
610 set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | IE_IRQ3);
596} 611}
diff --git a/arch/mips/alchemy/common/power.c b/arch/mips/alchemy/common/power.c
index bd854a6d1d89..6ab7b42aa1be 100644
--- a/arch/mips/alchemy/common/power.c
+++ b/arch/mips/alchemy/common/power.c
@@ -35,25 +35,12 @@
35#include <linux/jiffies.h> 35#include <linux/jiffies.h>
36 36
37#include <asm/uaccess.h> 37#include <asm/uaccess.h>
38#include <asm/cacheflush.h>
39#include <asm/mach-au1x00/au1000.h> 38#include <asm/mach-au1x00/au1000.h>
40 39#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
41#ifdef CONFIG_PM 40#include <asm/mach-au1x00/au1xxx_dbdma.h>
42
43#define DEBUG 1
44#ifdef DEBUG
45#define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__, ## args)
46#else
47#define DPRINTK(fmt, args...)
48#endif 41#endif
49 42
50static void au1000_calibrate_delay(void); 43#ifdef CONFIG_PM
51
52extern unsigned long save_local_and_disable(int controller);
53extern void restore_local_and_enable(int controller, unsigned long mask);
54extern void local_enable_irq(unsigned int irq_nr);
55
56static DEFINE_SPINLOCK(pm_lock);
57 44
58/* 45/*
59 * We need to save/restore a bunch of core registers that are 46 * We need to save/restore a bunch of core registers that are
@@ -65,29 +52,16 @@ static DEFINE_SPINLOCK(pm_lock);
65 * We only have to save/restore registers that aren't otherwise 52 * We only have to save/restore registers that aren't otherwise
66 * done as part of a driver pm_* function. 53 * done as part of a driver pm_* function.
67 */ 54 */
68static unsigned int sleep_aux_pll_cntrl; 55static unsigned int sleep_uart0_inten;
69static unsigned int sleep_cpu_pll_cntrl; 56static unsigned int sleep_uart0_fifoctl;
70static unsigned int sleep_pin_function; 57static unsigned int sleep_uart0_linectl;
71static unsigned int sleep_uart0_inten; 58static unsigned int sleep_uart0_clkdiv;
72static unsigned int sleep_uart0_fifoctl; 59static unsigned int sleep_uart0_enable;
73static unsigned int sleep_uart0_linectl; 60static unsigned int sleep_usb[2];
74static unsigned int sleep_uart0_clkdiv; 61static unsigned int sleep_sys_clocks[5];
75static unsigned int sleep_uart0_enable; 62static unsigned int sleep_sys_pinfunc;
76static unsigned int sleep_usbhost_enable; 63static unsigned int sleep_static_memctlr[4][3];
77static unsigned int sleep_usbdev_enable;
78static unsigned int sleep_static_memctlr[4][3];
79 64
80/*
81 * Define this to cause the value you write to /proc/sys/pm/sleep to
82 * set the TOY timer for the amount of time you want to sleep.
83 * This is done mainly for testing, but may be useful in other cases.
84 * The value is number of 32KHz ticks to sleep.
85 */
86#define SLEEP_TEST_TIMEOUT 1
87#ifdef SLEEP_TEST_TIMEOUT
88static int sleep_ticks;
89void wakeup_counter0_set(int ticks);
90#endif
91 65
92static void save_core_regs(void) 66static void save_core_regs(void)
93{ 67{
@@ -105,31 +79,45 @@ static void save_core_regs(void)
105 sleep_uart0_linectl = au_readl(UART0_ADDR + UART_LCR); 79 sleep_uart0_linectl = au_readl(UART0_ADDR + UART_LCR);
106 sleep_uart0_clkdiv = au_readl(UART0_ADDR + UART_CLK); 80 sleep_uart0_clkdiv = au_readl(UART0_ADDR + UART_CLK);
107 sleep_uart0_enable = au_readl(UART0_ADDR + UART_MOD_CNTRL); 81 sleep_uart0_enable = au_readl(UART0_ADDR + UART_MOD_CNTRL);
82 au_sync();
108 83
84#ifndef CONFIG_SOC_AU1200
109 /* Shutdown USB host/device. */ 85 /* Shutdown USB host/device. */
110 sleep_usbhost_enable = au_readl(USB_HOST_CONFIG); 86 sleep_usb[0] = au_readl(USB_HOST_CONFIG);
111 87
112 /* There appears to be some undocumented reset register.... */ 88 /* There appears to be some undocumented reset register.... */
113 au_writel(0, 0xb0100004); au_sync(); 89 au_writel(0, 0xb0100004);
114 au_writel(0, USB_HOST_CONFIG); au_sync(); 90 au_sync();
91 au_writel(0, USB_HOST_CONFIG);
92 au_sync();
115 93
116 sleep_usbdev_enable = au_readl(USBD_ENABLE); 94 sleep_usb[1] = au_readl(USBD_ENABLE);
117 au_writel(0, USBD_ENABLE); au_sync(); 95 au_writel(0, USBD_ENABLE);
96 au_sync();
97
98#else /* AU1200 */
99
100 /* enable access to OTG mmio so we can save OTG CAP/MUX.
101 * FIXME: write an OTG driver and move this stuff there!
102 */
103 au_writel(au_readl(USB_MSR_BASE + 4) | (1 << 6), USB_MSR_BASE + 4);
104 au_sync();
105 sleep_usb[0] = au_readl(0xb4020020); /* OTG_CAP */
106 sleep_usb[1] = au_readl(0xb4020024); /* OTG_MUX */
107#endif
118 108
119 /* Save interrupt controller state. */ 109 /* Save interrupt controller state. */
120 save_au1xxx_intctl(); 110 save_au1xxx_intctl();
121 111
122 /* Clocks and PLLs. */ 112 /* Clocks and PLLs. */
123 sleep_aux_pll_cntrl = au_readl(SYS_AUXPLL); 113 sleep_sys_clocks[0] = au_readl(SYS_FREQCTRL0);
114 sleep_sys_clocks[1] = au_readl(SYS_FREQCTRL1);
115 sleep_sys_clocks[2] = au_readl(SYS_CLKSRC);
116 sleep_sys_clocks[3] = au_readl(SYS_CPUPLL);
117 sleep_sys_clocks[4] = au_readl(SYS_AUXPLL);
124 118
125 /* 119 /* pin mux config */
126 * We don't really need to do this one, but unless we 120 sleep_sys_pinfunc = au_readl(SYS_PINFUNC);
127 * write it again it won't have a valid value if we
128 * happen to read it.
129 */
130 sleep_cpu_pll_cntrl = au_readl(SYS_CPUPLL);
131
132 sleep_pin_function = au_readl(SYS_PINFUNC);
133 121
134 /* Save the static memory controller configuration. */ 122 /* Save the static memory controller configuration. */
135 sleep_static_memctlr[0][0] = au_readl(MEM_STCFG0); 123 sleep_static_memctlr[0][0] = au_readl(MEM_STCFG0);
@@ -144,16 +132,45 @@ static void save_core_regs(void)
144 sleep_static_memctlr[3][0] = au_readl(MEM_STCFG3); 132 sleep_static_memctlr[3][0] = au_readl(MEM_STCFG3);
145 sleep_static_memctlr[3][1] = au_readl(MEM_STTIME3); 133 sleep_static_memctlr[3][1] = au_readl(MEM_STTIME3);
146 sleep_static_memctlr[3][2] = au_readl(MEM_STADDR3); 134 sleep_static_memctlr[3][2] = au_readl(MEM_STADDR3);
135
136#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
137 au1xxx_dbdma_suspend();
138#endif
147} 139}
148 140
149static void restore_core_regs(void) 141static void restore_core_regs(void)
150{ 142{
151 extern void restore_au1xxx_intctl(void); 143 /* restore clock configuration. Writing CPUPLL last will
152 extern void wakeup_counter0_adjust(void); 144 * stall a bit and stabilize other clocks (unless this is
145 * one of those Au1000 with a write-only PLL, where we dont
146 * have a valid value)
147 */
148 au_writel(sleep_sys_clocks[0], SYS_FREQCTRL0);
149 au_writel(sleep_sys_clocks[1], SYS_FREQCTRL1);
150 au_writel(sleep_sys_clocks[2], SYS_CLKSRC);
151 au_writel(sleep_sys_clocks[4], SYS_AUXPLL);
152 if (!au1xxx_cpu_has_pll_wo())
153 au_writel(sleep_sys_clocks[3], SYS_CPUPLL);
154 au_sync();
153 155
154 au_writel(sleep_aux_pll_cntrl, SYS_AUXPLL); au_sync(); 156 au_writel(sleep_sys_pinfunc, SYS_PINFUNC);
155 au_writel(sleep_cpu_pll_cntrl, SYS_CPUPLL); au_sync(); 157 au_sync();
156 au_writel(sleep_pin_function, SYS_PINFUNC); au_sync(); 158
159#ifndef CONFIG_SOC_AU1200
160 au_writel(sleep_usb[0], USB_HOST_CONFIG);
161 au_writel(sleep_usb[1], USBD_ENABLE);
162 au_sync();
163#else
164 /* enable accces to OTG memory */
165 au_writel(au_readl(USB_MSR_BASE + 4) | (1 << 6), USB_MSR_BASE + 4);
166 au_sync();
167
168 /* restore OTG caps and port mux. */
169 au_writel(sleep_usb[0], 0xb4020020 + 0); /* OTG_CAP */
170 au_sync();
171 au_writel(sleep_usb[1], 0xb4020020 + 4); /* OTG_MUX */
172 au_sync();
173#endif
157 174
158 /* Restore the static memory controller configuration. */ 175 /* Restore the static memory controller configuration. */
159 au_writel(sleep_static_memctlr[0][0], MEM_STCFG0); 176 au_writel(sleep_static_memctlr[0][0], MEM_STCFG0);
@@ -184,282 +201,17 @@ static void restore_core_regs(void)
184 } 201 }
185 202
186 restore_au1xxx_intctl(); 203 restore_au1xxx_intctl();
187 wakeup_counter0_adjust();
188}
189
190unsigned long suspend_mode;
191 204
192void wakeup_from_suspend(void) 205#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
193{ 206 au1xxx_dbdma_resume();
194 suspend_mode = 0; 207#endif
195} 208}
196 209
197int au_sleep(void) 210void au_sleep(void)
198{ 211{
199 unsigned long wakeup, flags;
200 extern void save_and_sleep(void);
201
202 spin_lock_irqsave(&pm_lock, flags);
203
204 save_core_regs(); 212 save_core_regs();
205 213 au1xxx_save_and_sleep();
206 flush_cache_all();
207
208 /**
209 ** The code below is all system dependent and we should probably
210 ** have a function call out of here to set this up. You need
211 ** to configure the GPIO or timer interrupts that will bring
212 ** you out of sleep.
213 ** For testing, the TOY counter wakeup is useful.
214 **/
215#if 0
216 au_writel(au_readl(SYS_PINSTATERD) & ~(1 << 11), SYS_PINSTATERD);
217
218 /* GPIO 6 can cause a wake up event */
219 wakeup = au_readl(SYS_WAKEMSK);
220 wakeup &= ~(1 << 8); /* turn off match20 wakeup */
221 wakeup |= 1 << 6; /* turn on GPIO 6 wakeup */
222#else
223 /* For testing, allow match20 to wake us up. */
224#ifdef SLEEP_TEST_TIMEOUT
225 wakeup_counter0_set(sleep_ticks);
226#endif
227 wakeup = 1 << 8; /* turn on match20 wakeup */
228 wakeup = 0;
229#endif
230 au_writel(1, SYS_WAKESRC); /* clear cause */
231 au_sync();
232 au_writel(wakeup, SYS_WAKEMSK);
233 au_sync();
234
235 save_and_sleep();
236
237 /*
238 * After a wakeup, the cpu vectors back to 0x1fc00000, so
239 * it's up to the boot code to get us back here.
240 */
241 restore_core_regs(); 214 restore_core_regs();
242 spin_unlock_irqrestore(&pm_lock, flags);
243 return 0;
244}
245
246static int pm_do_sleep(ctl_table *ctl, int write, struct file *file,
247 void __user *buffer, size_t *len, loff_t *ppos)
248{
249#ifdef SLEEP_TEST_TIMEOUT
250#define TMPBUFLEN2 16
251 char buf[TMPBUFLEN2], *p;
252#endif
253
254 if (!write)
255 *len = 0;
256 else {
257#ifdef SLEEP_TEST_TIMEOUT
258 if (*len > TMPBUFLEN2 - 1)
259 return -EFAULT;
260 if (copy_from_user(buf, buffer, *len))
261 return -EFAULT;
262 buf[*len] = 0;
263 p = buf;
264 sleep_ticks = simple_strtoul(p, &p, 0);
265#endif
266
267 au_sleep();
268 }
269 return 0;
270}
271
272static int pm_do_freq(ctl_table *ctl, int write, struct file *file,
273 void __user *buffer, size_t *len, loff_t *ppos)
274{
275 int retval = 0, i;
276 unsigned long val, pll;
277#define TMPBUFLEN 64
278#define MAX_CPU_FREQ 396
279 char buf[TMPBUFLEN], *p;
280 unsigned long flags, intc0_mask, intc1_mask;
281 unsigned long old_baud_base, old_cpu_freq, old_clk, old_refresh;
282 unsigned long new_baud_base, new_cpu_freq, new_clk, new_refresh;
283 unsigned long baud_rate;
284
285 spin_lock_irqsave(&pm_lock, flags);
286 if (!write)
287 *len = 0;
288 else {
289 /* Parse the new frequency */
290 if (*len > TMPBUFLEN - 1) {
291 spin_unlock_irqrestore(&pm_lock, flags);
292 return -EFAULT;
293 }
294 if (copy_from_user(buf, buffer, *len)) {
295 spin_unlock_irqrestore(&pm_lock, flags);
296 return -EFAULT;
297 }
298 buf[*len] = 0;
299 p = buf;
300 val = simple_strtoul(p, &p, 0);
301 if (val > MAX_CPU_FREQ) {
302 spin_unlock_irqrestore(&pm_lock, flags);
303 return -EFAULT;
304 }
305
306 pll = val / 12;
307 if ((pll > 33) || (pll < 7)) { /* 396 MHz max, 84 MHz min */
308 /* Revisit this for higher speed CPUs */
309 spin_unlock_irqrestore(&pm_lock, flags);
310 return -EFAULT;
311 }
312
313 old_baud_base = get_au1x00_uart_baud_base();
314 old_cpu_freq = get_au1x00_speed();
315
316 new_cpu_freq = pll * 12 * 1000000;
317 new_baud_base = (new_cpu_freq / (2 * ((int)(au_readl(SYS_POWERCTRL)
318 & 0x03) + 2) * 16));
319 set_au1x00_speed(new_cpu_freq);
320 set_au1x00_uart_baud_base(new_baud_base);
321
322 old_refresh = au_readl(MEM_SDREFCFG) & 0x1ffffff;
323 new_refresh = ((old_refresh * new_cpu_freq) / old_cpu_freq) |
324 (au_readl(MEM_SDREFCFG) & ~0x1ffffff);
325
326 au_writel(pll, SYS_CPUPLL);
327 au_sync_delay(1);
328 au_writel(new_refresh, MEM_SDREFCFG);
329 au_sync_delay(1);
330
331 for (i = 0; i < 4; i++)
332 if (au_readl(UART_BASE + UART_MOD_CNTRL +
333 i * 0x00100000) == 3) {
334 old_clk = au_readl(UART_BASE + UART_CLK +
335 i * 0x00100000);
336 baud_rate = old_baud_base / old_clk;
337 /*
338 * We won't get an exact baud rate and the error
339 * could be significant enough that our new
340 * calculation will result in a clock that will
341 * give us a baud rate that's too far off from
342 * what we really want.
343 */
344 if (baud_rate > 100000)
345 baud_rate = 115200;
346 else if (baud_rate > 50000)
347 baud_rate = 57600;
348 else if (baud_rate > 30000)
349 baud_rate = 38400;
350 else if (baud_rate > 17000)
351 baud_rate = 19200;
352 else
353 baud_rate = 9600;
354 new_clk = new_baud_base / baud_rate;
355 au_writel(new_clk, UART_BASE + UART_CLK +
356 i * 0x00100000);
357 au_sync_delay(10);
358 }
359 }
360
361 /*
362 * We don't want _any_ interrupts other than match20. Otherwise our
363 * au1000_calibrate_delay() calculation will be off, potentially a lot.
364 */
365 intc0_mask = save_local_and_disable(0);
366 intc1_mask = save_local_and_disable(1);
367 local_enable_irq(AU1000_TOY_MATCH2_INT);
368 spin_unlock_irqrestore(&pm_lock, flags);
369 au1000_calibrate_delay();
370 restore_local_and_enable(0, intc0_mask);
371 restore_local_and_enable(1, intc1_mask);
372
373 return retval;
374} 215}
375 216
376
377static struct ctl_table pm_table[] = {
378 {
379 .ctl_name = CTL_UNNUMBERED,
380 .procname = "sleep",
381 .data = NULL,
382 .maxlen = 0,
383 .mode = 0600,
384 .proc_handler = &pm_do_sleep
385 },
386 {
387 .ctl_name = CTL_UNNUMBERED,
388 .procname = "freq",
389 .data = NULL,
390 .maxlen = 0,
391 .mode = 0600,
392 .proc_handler = &pm_do_freq
393 },
394 {}
395};
396
397static struct ctl_table pm_dir_table[] = {
398 {
399 .ctl_name = CTL_UNNUMBERED,
400 .procname = "pm",
401 .mode = 0555,
402 .child = pm_table
403 },
404 {}
405};
406
407/*
408 * Initialize power interface
409 */
410static int __init pm_init(void)
411{
412 register_sysctl_table(pm_dir_table);
413 return 0;
414}
415
416__initcall(pm_init);
417
418/*
419 * This is right out of init/main.c
420 */
421
422/*
423 * This is the number of bits of precision for the loops_per_jiffy.
424 * Each bit takes on average 1.5/HZ seconds. This (like the original)
425 * is a little better than 1%.
426 */
427#define LPS_PREC 8
428
429static void au1000_calibrate_delay(void)
430{
431 unsigned long ticks, loopbit;
432 int lps_precision = LPS_PREC;
433
434 loops_per_jiffy = 1 << 12;
435
436 while (loops_per_jiffy <<= 1) {
437 /* Wait for "start of" clock tick */
438 ticks = jiffies;
439 while (ticks == jiffies)
440 /* nothing */ ;
441 /* Go ... */
442 ticks = jiffies;
443 __delay(loops_per_jiffy);
444 ticks = jiffies - ticks;
445 if (ticks)
446 break;
447 }
448
449 /*
450 * Do a binary approximation to get loops_per_jiffy set to be equal
451 * one clock (up to lps_precision bits)
452 */
453 loops_per_jiffy >>= 1;
454 loopbit = loops_per_jiffy;
455 while (lps_precision-- && (loopbit >>= 1)) {
456 loops_per_jiffy |= loopbit;
457 ticks = jiffies;
458 while (ticks == jiffies);
459 ticks = jiffies;
460 __delay(loops_per_jiffy);
461 if (jiffies != ticks) /* longer than 1 tick */
462 loops_per_jiffy &= ~loopbit;
463 }
464}
465#endif /* CONFIG_PM */ 217#endif /* CONFIG_PM */
diff --git a/arch/mips/alchemy/common/reset.c b/arch/mips/alchemy/common/reset.c
index d555429c8d6f..0191c936cb5e 100644
--- a/arch/mips/alchemy/common/reset.c
+++ b/arch/mips/alchemy/common/reset.c
@@ -31,8 +31,6 @@
31 31
32#include <asm/mach-au1x00/au1000.h> 32#include <asm/mach-au1x00/au1000.h>
33 33
34extern int au_sleep(void);
35
36void au1000_restart(char *command) 34void au1000_restart(char *command)
37{ 35{
38 /* Set all integrated peripherals to disabled states */ 36 /* Set all integrated peripherals to disabled states */
diff --git a/arch/mips/alchemy/common/setup.c b/arch/mips/alchemy/common/setup.c
index 1ac6b06f42a3..3f036b3d400e 100644
--- a/arch/mips/alchemy/common/setup.c
+++ b/arch/mips/alchemy/common/setup.c
@@ -35,7 +35,6 @@
35#include <asm/time.h> 35#include <asm/time.h>
36 36
37#include <au1000.h> 37#include <au1000.h>
38#include <prom.h>
39 38
40extern void __init board_setup(void); 39extern void __init board_setup(void);
41extern void au1000_restart(char *); 40extern void au1000_restart(char *);
@@ -45,80 +44,34 @@ extern void set_cpuspec(void);
45 44
46void __init plat_mem_setup(void) 45void __init plat_mem_setup(void)
47{ 46{
48 struct cpu_spec *sp; 47 unsigned long est_freq;
49 char *argptr;
50 unsigned long prid, cpufreq, bclk;
51 48
52 set_cpuspec(); 49 /* determine core clock */
53 sp = cur_cpu_spec[0]; 50 est_freq = au1xxx_calc_clock();
51 est_freq += 5000; /* round */
52 est_freq -= est_freq % 10000;
53 printk(KERN_INFO "(PRId %08x) @ %lu.%02lu MHz\n", read_c0_prid(),
54 est_freq / 1000000, ((est_freq % 1000000) * 100) / 1000000);
54 55
55 board_setup(); /* board specific setup */ 56 _machine_restart = au1000_restart;
56 57 _machine_halt = au1000_halt;
57 prid = read_c0_prid(); 58 pm_power_off = au1000_power_off;
58 if (sp->cpu_pll_wo)
59#ifdef CONFIG_SOC_AU1000_FREQUENCY
60 cpufreq = CONFIG_SOC_AU1000_FREQUENCY / 1000000;
61#else
62 cpufreq = 396;
63#endif
64 else
65 cpufreq = (au_readl(SYS_CPUPLL) & 0x3F) * 12;
66 printk(KERN_INFO "(PRID %08lx) @ %ld MHz\n", prid, cpufreq);
67 59
68 if (sp->cpu_bclk) { 60 board_setup(); /* board specific setup */
69 /* Enable BCLK switching */
70 bclk = au_readl(SYS_POWERCTRL);
71 au_writel(bclk | 0x60, SYS_POWERCTRL);
72 printk(KERN_INFO "BCLK switching enabled!\n");
73 }
74 61
75 if (sp->cpu_od) 62 if (au1xxx_cpu_needs_config_od())
76 /* Various early Au1xx0 errata corrected by this */ 63 /* Various early Au1xx0 errata corrected by this */
77 set_c0_config(1 << 19); /* Set Config[OD] */ 64 set_c0_config(1 << 19); /* Set Config[OD] */
78 else 65 else
79 /* Clear to obtain best system bus performance */ 66 /* Clear to obtain best system bus performance */
80 clear_c0_config(1 << 19); /* Clear Config[OD] */ 67 clear_c0_config(1 << 19); /* Clear Config[OD] */
81 68
82 argptr = prom_getcmdline();
83
84#ifdef CONFIG_SERIAL_8250_CONSOLE
85 argptr = strstr(argptr, "console=");
86 if (argptr == NULL) {
87 argptr = prom_getcmdline();
88 strcat(argptr, " console=ttyS0,115200");
89 }
90#endif
91
92#ifdef CONFIG_FB_AU1100
93 argptr = strstr(argptr, "video=");
94 if (argptr == NULL) {
95 argptr = prom_getcmdline();
96 /* default panel */
97 /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/
98 }
99#endif
100
101#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000)
102 /* au1000 does not support vra, au1500 and au1100 do */
103 strcat(argptr, " au1000_audio=vra");
104 argptr = prom_getcmdline();
105#endif
106 _machine_restart = au1000_restart;
107 _machine_halt = au1000_halt;
108 pm_power_off = au1000_power_off;
109
110 /* IO/MEM resources. */ 69 /* IO/MEM resources. */
111 set_io_port_base(0); 70 set_io_port_base(0);
112 ioport_resource.start = IOPORT_RESOURCE_START; 71 ioport_resource.start = IOPORT_RESOURCE_START;
113 ioport_resource.end = IOPORT_RESOURCE_END; 72 ioport_resource.end = IOPORT_RESOURCE_END;
114 iomem_resource.start = IOMEM_RESOURCE_START; 73 iomem_resource.start = IOMEM_RESOURCE_START;
115 iomem_resource.end = IOMEM_RESOURCE_END; 74 iomem_resource.end = IOMEM_RESOURCE_END;
116
117 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_E0S);
118 au_writel(SYS_CNTRL_E0 | SYS_CNTRL_EN0, SYS_COUNTER_CNTRL);
119 au_sync();
120 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T0S);
121 au_writel(0, SYS_TOYTRIM);
122} 75}
123 76
124#if defined(CONFIG_64BIT_PHYS_ADDR) 77#if defined(CONFIG_64BIT_PHYS_ADDR)
diff --git a/arch/mips/alchemy/common/sleeper.S b/arch/mips/alchemy/common/sleeper.S
index 3006e270c8bc..4f4b16741d12 100644
--- a/arch/mips/alchemy/common/sleeper.S
+++ b/arch/mips/alchemy/common/sleeper.S
@@ -15,16 +15,17 @@
15#include <asm/regdef.h> 15#include <asm/regdef.h>
16#include <asm/stackframe.h> 16#include <asm/stackframe.h>
17 17
18 .extern __flush_cache_all
19
18 .text 20 .text
19 .set macro 21 .set noreorder
20 .set noat 22 .set noat
21 .align 5 23 .align 5
22 24
23/* Save all of the processor general registers and go to sleep. 25/* Save all of the processor general registers and go to sleep.
24 * A wakeup condition will get us back here to restore the registers. 26 * A wakeup condition will get us back here to restore the registers.
25 */ 27 */
26LEAF(save_and_sleep) 28LEAF(au1xxx_save_and_sleep)
27
28 subu sp, PT_SIZE 29 subu sp, PT_SIZE
29 sw $1, PT_R1(sp) 30 sw $1, PT_R1(sp)
30 sw $2, PT_R2(sp) 31 sw $2, PT_R2(sp)
@@ -33,14 +34,6 @@ LEAF(save_and_sleep)
33 sw $5, PT_R5(sp) 34 sw $5, PT_R5(sp)
34 sw $6, PT_R6(sp) 35 sw $6, PT_R6(sp)
35 sw $7, PT_R7(sp) 36 sw $7, PT_R7(sp)
36 sw $8, PT_R8(sp)
37 sw $9, PT_R9(sp)
38 sw $10, PT_R10(sp)
39 sw $11, PT_R11(sp)
40 sw $12, PT_R12(sp)
41 sw $13, PT_R13(sp)
42 sw $14, PT_R14(sp)
43 sw $15, PT_R15(sp)
44 sw $16, PT_R16(sp) 37 sw $16, PT_R16(sp)
45 sw $17, PT_R17(sp) 38 sw $17, PT_R17(sp)
46 sw $18, PT_R18(sp) 39 sw $18, PT_R18(sp)
@@ -49,12 +42,9 @@ LEAF(save_and_sleep)
49 sw $21, PT_R21(sp) 42 sw $21, PT_R21(sp)
50 sw $22, PT_R22(sp) 43 sw $22, PT_R22(sp)
51 sw $23, PT_R23(sp) 44 sw $23, PT_R23(sp)
52 sw $24, PT_R24(sp)
53 sw $25, PT_R25(sp)
54 sw $26, PT_R26(sp) 45 sw $26, PT_R26(sp)
55 sw $27, PT_R27(sp) 46 sw $27, PT_R27(sp)
56 sw $28, PT_R28(sp) 47 sw $28, PT_R28(sp)
57 sw $29, PT_R29(sp)
58 sw $30, PT_R30(sp) 48 sw $30, PT_R30(sp)
59 sw $31, PT_R31(sp) 49 sw $31, PT_R31(sp)
60 mfc0 k0, CP0_STATUS 50 mfc0 k0, CP0_STATUS
@@ -66,20 +56,26 @@ LEAF(save_and_sleep)
66 mfc0 k0, CP0_CONFIG 56 mfc0 k0, CP0_CONFIG
67 sw k0, 0x14(sp) 57 sw k0, 0x14(sp)
68 58
59 /* flush caches to make sure context is in memory */
60 la t1, __flush_cache_all
61 lw t0, 0(t1)
62 jalr t0
63 nop
64
69 /* Now set up the scratch registers so the boot rom will 65 /* Now set up the scratch registers so the boot rom will
70 * return to this point upon wakeup. 66 * return to this point upon wakeup.
67 * sys_scratch0 : SP
68 * sys_scratch1 : RA
71 */ 69 */
72 la k0, 1f 70 lui t3, 0xb190 /* sys_xxx */
73 lui k1, 0xb190 71 sw sp, 0x0018(t3)
74 ori k1, 0x18 72 la k0, 3f /* resume path */
75 sw sp, 0(k1) 73 sw k0, 0x001c(t3)
76 ori k1, 0x1c
77 sw k0, 0(k1)
78 74
79/* Put SDRAM into self refresh. Preload instructions into cache, 75 /* Put SDRAM into self refresh: Preload instructions into cache,
80 * issue a precharge, then auto refresh, then sleep commands to it. 76 * issue a precharge, auto/self refresh, then sleep commands to it.
81 */ 77 */
82 la t0, sdsleep 78 la t0, 1f
83 .set mips3 79 .set mips3
84 cache 0x14, 0(t0) 80 cache 0x14, 0(t0)
85 cache 0x14, 32(t0) 81 cache 0x14, 32(t0)
@@ -87,24 +83,57 @@ LEAF(save_and_sleep)
87 cache 0x14, 96(t0) 83 cache 0x14, 96(t0)
88 .set mips0 84 .set mips0
89 85
90sdsleep: 861: lui a0, 0xb400 /* mem_xxx */
91 lui k0, 0xb400 87#if defined(CONFIG_SOC_AU1000) || defined(CONFIG_SOC_AU1100) || \
92 sw zero, 0x001c(k0) /* Precharge */ 88 defined(CONFIG_SOC_AU1500)
93 sw zero, 0x0020(k0) /* Auto refresh */ 89 sw zero, 0x001c(a0) /* Precharge */
94 sw zero, 0x0030(k0) /* SDRAM sleep */ 90 sync
91 sw zero, 0x0020(a0) /* Auto Refresh */
92 sync
93 sw zero, 0x0030(a0) /* Sleep */
94 sync
95#endif
96
97#if defined(CONFIG_SOC_AU1550) || defined(CONFIG_SOC_AU1200)
98 sw zero, 0x08c0(a0) /* Precharge */
95 sync 99 sync
100 sw zero, 0x08d0(a0) /* Self Refresh */
101 sync
102
103 /* wait for sdram to enter self-refresh mode */
104 lui t0, 0x0100
1052: lw t1, 0x0850(a0) /* mem_sdstat */
106 and t2, t1, t0
107 beq t2, zero, 2b
108 nop
96 109
97 lui k1, 0xb190 110 /* disable SDRAM clocks */
98 sw zero, 0x0078(k1) /* get ready to sleep */ 111 lui t0, 0xcfff
112 ori t0, t0, 0xffff
113 lw t1, 0x0840(a0) /* mem_sdconfiga */
114 and t1, t0, t1 /* clear CE[1:0] */
115 sw t1, 0x0840(a0) /* mem_sdconfiga */
99 sync 116 sync
100 sw zero, 0x007c(k1) /* Put processor to sleep */ 117#endif
118
119 /* put power supply and processor to sleep */
120 sw zero, 0x0078(t3) /* sys_slppwr */
121 sync
122 sw zero, 0x007c(t3) /* sys_sleep */
101 sync 123 sync
124 nop
125 nop
126 nop
127 nop
128 nop
129 nop
130 nop
131 nop
102 132
103 /* This is where we return upon wakeup. 133 /* This is where we return upon wakeup.
104 * Reload all of the registers and return. 134 * Reload all of the registers and return.
105 */ 135 */
1061: nop 1363: lw k0, 0x20(sp)
107 lw k0, 0x20(sp)
108 mtc0 k0, CP0_STATUS 137 mtc0 k0, CP0_STATUS
109 lw k0, 0x1c(sp) 138 lw k0, 0x1c(sp)
110 mtc0 k0, CP0_CONTEXT 139 mtc0 k0, CP0_CONTEXT
@@ -113,10 +142,11 @@ sdsleep:
113 lw k0, 0x14(sp) 142 lw k0, 0x14(sp)
114 mtc0 k0, CP0_CONFIG 143 mtc0 k0, CP0_CONFIG
115 144
116 /* We need to catch the ealry Alchemy SOCs with 145 /* We need to catch the early Alchemy SOCs with
117 * the write-only Config[OD] bit and set it back to one... 146 * the write-only Config[OD] bit and set it back to one...
118 */ 147 */
119 jal au1x00_fixup_config_od 148 jal au1x00_fixup_config_od
149 nop
120 lw $1, PT_R1(sp) 150 lw $1, PT_R1(sp)
121 lw $2, PT_R2(sp) 151 lw $2, PT_R2(sp)
122 lw $3, PT_R3(sp) 152 lw $3, PT_R3(sp)
@@ -124,14 +154,6 @@ sdsleep:
124 lw $5, PT_R5(sp) 154 lw $5, PT_R5(sp)
125 lw $6, PT_R6(sp) 155 lw $6, PT_R6(sp)
126 lw $7, PT_R7(sp) 156 lw $7, PT_R7(sp)
127 lw $8, PT_R8(sp)
128 lw $9, PT_R9(sp)
129 lw $10, PT_R10(sp)
130 lw $11, PT_R11(sp)
131 lw $12, PT_R12(sp)
132 lw $13, PT_R13(sp)
133 lw $14, PT_R14(sp)
134 lw $15, PT_R15(sp)
135 lw $16, PT_R16(sp) 157 lw $16, PT_R16(sp)
136 lw $17, PT_R17(sp) 158 lw $17, PT_R17(sp)
137 lw $18, PT_R18(sp) 159 lw $18, PT_R18(sp)
@@ -140,15 +162,11 @@ sdsleep:
140 lw $21, PT_R21(sp) 162 lw $21, PT_R21(sp)
141 lw $22, PT_R22(sp) 163 lw $22, PT_R22(sp)
142 lw $23, PT_R23(sp) 164 lw $23, PT_R23(sp)
143 lw $24, PT_R24(sp)
144 lw $25, PT_R25(sp)
145 lw $26, PT_R26(sp) 165 lw $26, PT_R26(sp)
146 lw $27, PT_R27(sp) 166 lw $27, PT_R27(sp)
147 lw $28, PT_R28(sp) 167 lw $28, PT_R28(sp)
148 lw $29, PT_R29(sp)
149 lw $30, PT_R30(sp) 168 lw $30, PT_R30(sp)
150 lw $31, PT_R31(sp) 169 lw $31, PT_R31(sp)
151 addiu sp, PT_SIZE
152
153 jr ra 170 jr ra
154END(save_and_sleep) 171 addiu sp, PT_SIZE
172END(au1xxx_save_and_sleep)
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c
index 563d9390a872..32880146cbc1 100644
--- a/arch/mips/alchemy/common/time.c
+++ b/arch/mips/alchemy/common/time.c
@@ -1,5 +1,7 @@
1/* 1/*
2 * Copyright (C) 2008 Manuel Lauss <mano@roarinelk.homelinux.net>
2 * 3 *
4 * Previous incarnations were:
3 * Copyright (C) 2001, 2006, 2008 MontaVista Software, <source@mvista.com> 5 * Copyright (C) 2001, 2006, 2008 MontaVista Software, <source@mvista.com>
4 * Copied and modified Carsten Langgaard's time.c 6 * Copied and modified Carsten Langgaard's time.c
5 * 7 *
@@ -23,244 +25,141 @@
23 * 25 *
24 * ######################################################################## 26 * ########################################################################
25 * 27 *
26 * Setting up the clock on the MIPS boards. 28 * Clocksource/event using the 32.768kHz-clocked Counter1 ('RTC' in the
27 * 29 * databooks). Firmware/Board init code must enable the counters in the
28 * We provide the clock interrupt processing and the timer offset compute 30 * counter control register, otherwise the CP0 counter clocksource/event
29 * functions. If CONFIG_PM is selected, we also ensure the 32KHz timer is 31 * will be installed instead (and use of 'wait' instruction is prohibited).
30 * available. -- Dan
31 */ 32 */
32 33
33#include <linux/types.h> 34#include <linux/clockchips.h>
34#include <linux/init.h> 35#include <linux/clocksource.h>
36#include <linux/interrupt.h>
35#include <linux/spinlock.h> 37#include <linux/spinlock.h>
36 38
37#include <asm/mipsregs.h>
38#include <asm/time.h> 39#include <asm/time.h>
39#include <asm/mach-au1x00/au1000.h> 40#include <asm/mach-au1x00/au1000.h>
40 41
41static int no_au1xxx_32khz; 42/* 32kHz clock enabled and detected */
42extern int allow_au1k_wait; /* default off for CP0 Counter */ 43#define CNTR_OK (SYS_CNTRL_E0 | SYS_CNTRL_32S)
43
44#ifdef CONFIG_PM
45#if HZ < 100 || HZ > 1000
46#error "unsupported HZ value! Must be in [100,1000]"
47#endif
48#define MATCH20_INC (328 * 100 / HZ) /* magic number 328 is for HZ=100... */
49static unsigned long last_pc0, last_match20;
50#endif
51 44
52static DEFINE_SPINLOCK(time_lock); 45extern int allow_au1k_wait; /* default off for CP0 Counter */
53
54unsigned long wtimer;
55 46
56#ifdef CONFIG_PM 47static cycle_t au1x_counter1_read(void)
57static irqreturn_t counter0_irq(int irq, void *dev_id)
58{ 48{
59 unsigned long pc0; 49 return au_readl(SYS_RTCREAD);
60 int time_elapsed;
61 static int jiffie_drift;
62
63 if (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20) {
64 /* should never happen! */
65 printk(KERN_WARNING "counter 0 w status error\n");
66 return IRQ_NONE;
67 }
68
69 pc0 = au_readl(SYS_TOYREAD);
70 if (pc0 < last_match20)
71 /* counter overflowed */
72 time_elapsed = (0xffffffff - last_match20) + pc0;
73 else
74 time_elapsed = pc0 - last_match20;
75
76 while (time_elapsed > 0) {
77 do_timer(1);
78#ifndef CONFIG_SMP
79 update_process_times(user_mode(get_irq_regs()));
80#endif
81 time_elapsed -= MATCH20_INC;
82 last_match20 += MATCH20_INC;
83 jiffie_drift++;
84 }
85
86 last_pc0 = pc0;
87 au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
88 au_sync();
89
90 /*
91 * Our counter ticks at 10.009765625 ms/tick, we we're running
92 * almost 10 uS too slow per tick.
93 */
94
95 if (jiffie_drift >= 999) {
96 jiffie_drift -= 999;
97 do_timer(1); /* increment jiffies by one */
98#ifndef CONFIG_SMP
99 update_process_times(user_mode(get_irq_regs()));
100#endif
101 }
102
103 return IRQ_HANDLED;
104} 50}
105 51
106struct irqaction counter0_action = { 52static struct clocksource au1x_counter1_clocksource = {
107 .handler = counter0_irq, 53 .name = "alchemy-counter1",
108 .flags = IRQF_DISABLED, 54 .read = au1x_counter1_read,
109 .name = "alchemy-toy", 55 .mask = CLOCKSOURCE_MASK(32),
110 .dev_id = NULL, 56 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
57 .rating = 100,
111}; 58};
112 59
113/* When we wakeup from sleep, we have to "catch up" on all of the 60static int au1x_rtcmatch2_set_next_event(unsigned long delta,
114 * timer ticks we have missed. 61 struct clock_event_device *cd)
115 */
116void wakeup_counter0_adjust(void)
117{ 62{
118 unsigned long pc0; 63 delta += au_readl(SYS_RTCREAD);
119 int time_elapsed; 64 /* wait for register access */
120 65 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M21)
121 pc0 = au_readl(SYS_TOYREAD); 66 ;
122 if (pc0 < last_match20) 67 au_writel(delta, SYS_RTCMATCH2);
123 /* counter overflowed */
124 time_elapsed = (0xffffffff - last_match20) + pc0;
125 else
126 time_elapsed = pc0 - last_match20;
127
128 while (time_elapsed > 0) {
129 time_elapsed -= MATCH20_INC;
130 last_match20 += MATCH20_INC;
131 }
132
133 last_pc0 = pc0;
134 au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
135 au_sync(); 68 au_sync();
136 69
70 return 0;
137} 71}
138 72
139/* This is just for debugging to set the timer for a sleep delay. */ 73static void au1x_rtcmatch2_set_mode(enum clock_event_mode mode,
140void wakeup_counter0_set(int ticks) 74 struct clock_event_device *cd)
141{ 75{
142 unsigned long pc0;
143
144 pc0 = au_readl(SYS_TOYREAD);
145 last_pc0 = pc0;
146 au_writel(last_match20 + (MATCH20_INC * ticks), SYS_TOYMATCH2);
147 au_sync();
148} 76}
149#endif
150 77
151/* 78static irqreturn_t au1x_rtcmatch2_irq(int irq, void *dev_id)
152 * I haven't found anyone that doesn't use a 12 MHz source clock,
153 * but just in case.....
154 */
155#define AU1000_SRC_CLK 12000000
156
157/*
158 * We read the real processor speed from the PLL. This is important
159 * because it is more accurate than computing it from the 32 KHz
160 * counter, if it exists. If we don't have an accurate processor
161 * speed, all of the peripherals that derive their clocks based on
162 * this advertised speed will introduce error and sometimes not work
163 * properly. This function is futher convoluted to still allow configurations
164 * to do that in case they have really, really old silicon with a
165 * write-only PLL register, that we need the 32 KHz when power management
166 * "wait" is enabled, and we need to detect if the 32 KHz isn't present
167 * but requested......got it? :-) -- Dan
168 */
169unsigned long calc_clock(void)
170{ 79{
171 unsigned long cpu_speed; 80 struct clock_event_device *cd = dev_id;
172 unsigned long flags; 81 cd->event_handler(cd);
173 unsigned long counter; 82 return IRQ_HANDLED;
174 83}
175 spin_lock_irqsave(&time_lock, flags);
176
177 /* Power management cares if we don't have a 32 KHz counter. */
178 no_au1xxx_32khz = 0;
179 counter = au_readl(SYS_COUNTER_CNTRL);
180 if (counter & SYS_CNTRL_E0) {
181 int trim_divide = 16;
182
183 au_writel(counter | SYS_CNTRL_EN1, SYS_COUNTER_CNTRL);
184
185 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S);
186 /* RTC now ticks at 32.768/16 kHz */
187 au_writel(trim_divide - 1, SYS_RTCTRIM);
188 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S);
189 84
190 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); 85static struct clock_event_device au1x_rtcmatch2_clockdev = {
191 au_writel(0, SYS_TOYWRITE); 86 .name = "rtcmatch2",
192 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S); 87 .features = CLOCK_EVT_FEAT_ONESHOT,
193 } else 88 .rating = 100,
194 no_au1xxx_32khz = 1; 89 .irq = AU1000_RTC_MATCH2_INT,
90 .set_next_event = au1x_rtcmatch2_set_next_event,
91 .set_mode = au1x_rtcmatch2_set_mode,
92 .cpumask = CPU_MASK_ALL,
93};
195 94
196 /* 95static struct irqaction au1x_rtcmatch2_irqaction = {
197 * On early Au1000, sys_cpupll was write-only. Since these 96 .handler = au1x_rtcmatch2_irq,
198 * silicon versions of Au1000 are not sold by AMD, we don't bend 97 .flags = IRQF_DISABLED | IRQF_TIMER,
199 * over backwards trying to determine the frequency. 98 .name = "timer",
200 */ 99 .dev_id = &au1x_rtcmatch2_clockdev,
201 if (cur_cpu_spec[0]->cpu_pll_wo) 100};
202#ifdef CONFIG_SOC_AU1000_FREQUENCY
203 cpu_speed = CONFIG_SOC_AU1000_FREQUENCY;
204#else
205 cpu_speed = 396000000;
206#endif
207 else
208 cpu_speed = (au_readl(SYS_CPUPLL) & 0x0000003f) * AU1000_SRC_CLK;
209 /* On Alchemy CPU:counter ratio is 1:1 */
210 mips_hpt_frequency = cpu_speed;
211 /* Equation: Baudrate = CPU / (SD * 2 * CLKDIV * 16) */
212 set_au1x00_uart_baud_base(cpu_speed / (2 * ((int)(au_readl(SYS_POWERCTRL)
213 & 0x03) + 2) * 16));
214 spin_unlock_irqrestore(&time_lock, flags);
215 return cpu_speed;
216}
217 101
218void __init plat_time_init(void) 102void __init plat_time_init(void)
219{ 103{
220 unsigned int est_freq = calc_clock(); 104 struct clock_event_device *cd = &au1x_rtcmatch2_clockdev;
221 105 unsigned long t;
222 est_freq += 5000; /* round */ 106
223 est_freq -= est_freq%10000; 107 /* Check if firmware (YAMON, ...) has enabled 32kHz and clock
224 printk(KERN_INFO "CPU frequency %u.%02u MHz\n", 108 * has been detected. If so install the rtcmatch2 clocksource,
225 est_freq / 1000000, ((est_freq % 1000000) * 100) / 1000000); 109 * otherwise don't bother. Note that both bits being set is by
226 set_au1x00_speed(est_freq); 110 * no means a definite guarantee that the counters actually work
227 set_au1x00_lcd_clock(); /* program the LCD clock */ 111 * (the 32S bit seems to be stuck set to 1 once a single clock-
112 * edge is detected, hence the timeouts).
113 */
114 if (CNTR_OK != (au_readl(SYS_COUNTER_CNTRL) & CNTR_OK))
115 goto cntr_err;
228 116
229#ifdef CONFIG_PM
230 /* 117 /*
231 * setup counter 0, since it keeps ticking after a 118 * setup counter 1 (RTC) to tick at full speed
232 * 'wait' instruction has been executed. The CP0 timer and
233 * counter 1 do NOT continue running after 'wait'
234 *
235 * It's too early to call request_irq() here, so we handle
236 * counter 0 interrupt as a special irq and it doesn't show
237 * up under /proc/interrupts.
238 *
239 * Check to ensure we really have a 32 KHz oscillator before
240 * we do this.
241 */ 119 */
242 if (no_au1xxx_32khz) 120 t = 0xffffff;
243 printk(KERN_WARNING "WARNING: no 32KHz clock found.\n"); 121 while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && t--)
244 else { 122 asm volatile ("nop");
245 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S); 123 if (!t)
246 au_writel(0, SYS_TOYWRITE); 124 goto cntr_err;
247 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C0S);
248
249 au_writel(au_readl(SYS_WAKEMSK) | (1 << 8), SYS_WAKEMSK);
250 au_writel(~0, SYS_WAKESRC);
251 au_sync();
252 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
253 125
254 /* Setup match20 to interrupt once every HZ */ 126 au_writel(0, SYS_RTCTRIM); /* 32.768 kHz */
255 last_pc0 = last_match20 = au_readl(SYS_TOYREAD); 127 au_sync();
256 au_writel(last_match20 + MATCH20_INC, SYS_TOYMATCH2);
257 au_sync();
258 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20);
259 setup_irq(AU1000_TOY_MATCH2_INT, &counter0_action);
260 128
261 /* We can use the real 'wait' instruction. */ 129 t = 0xffffff;
262 allow_au1k_wait = 1; 130 while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--)
263 } 131 asm volatile ("nop");
132 if (!t)
133 goto cntr_err;
134 au_writel(0, SYS_RTCWRITE);
135 au_sync();
264 136
265#endif 137 t = 0xffffff;
138 while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--)
139 asm volatile ("nop");
140 if (!t)
141 goto cntr_err;
142
143 /* register counter1 clocksource and event device */
144 clocksource_set_clock(&au1x_counter1_clocksource, 32768);
145 clocksource_register(&au1x_counter1_clocksource);
146
147 cd->shift = 32;
148 cd->mult = div_sc(32768, NSEC_PER_SEC, cd->shift);
149 cd->max_delta_ns = clockevent_delta2ns(0xffffffff, cd);
150 cd->min_delta_ns = clockevent_delta2ns(8, cd); /* ~0.25ms */
151 clockevents_register_device(cd);
152 setup_irq(AU1000_RTC_MATCH2_INT, &au1x_rtcmatch2_irqaction);
153
154 printk(KERN_INFO "Alchemy clocksource installed\n");
155
156 /* can now use 'wait' */
157 allow_au1k_wait = 1;
158 return;
159
160cntr_err:
161 /* counters unusable, use C0 counter */
162 r4k_clockevent_init();
163 init_r4k_clocksource();
164 allow_au1k_wait = 0;
266} 165}
diff --git a/arch/mips/alchemy/db1x00/init.c b/arch/mips/alchemy/db1x00/init.c
deleted file mode 100644
index 847413514964..000000000000
--- a/arch/mips/alchemy/db1x00/init.c
+++ /dev/null
@@ -1,62 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * PB1000 board setup
4 *
5 * Copyright 2001, 2008 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc. <source@mvista.com>
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#include <linux/init.h>
30#include <linux/kernel.h>
31
32#include <asm/bootinfo.h>
33
34#include <prom.h>
35
36const char *get_system_type(void)
37{
38#ifdef CONFIG_MIPS_BOSPORUS
39 return "Alchemy Bosporus Gateway Reference";
40#else
41 return "Alchemy Db1x00";
42#endif
43}
44
45void __init prom_init(void)
46{
47 unsigned char *memsize_str;
48 unsigned long memsize;
49
50 prom_argc = fw_arg0;
51 prom_argv = (char **)fw_arg1;
52 prom_envp = (char **)fw_arg2;
53
54 prom_init_cmdline();
55
56 memsize_str = prom_getenv("memsize");
57 if (!memsize_str)
58 memsize = 0x04000000;
59 else
60 strict_strtol(memsize_str, 0, &memsize);
61 add_memory_region(0, memsize, BOOT_MEM_RAM);
62}
diff --git a/arch/mips/alchemy/devboards/Makefile b/arch/mips/alchemy/devboards/Makefile
new file mode 100644
index 000000000000..730f9f2b30e8
--- /dev/null
+++ b/arch/mips/alchemy/devboards/Makefile
@@ -0,0 +1,18 @@
1#
2# Alchemy Develboards
3#
4
5obj-y += prom.o
6obj-$(CONFIG_PM) += pm.o
7obj-$(CONFIG_MIPS_PB1000) += pb1000/
8obj-$(CONFIG_MIPS_PB1100) += pb1100/
9obj-$(CONFIG_MIPS_PB1200) += pb1200/
10obj-$(CONFIG_MIPS_PB1500) += pb1500/
11obj-$(CONFIG_MIPS_PB1550) += pb1550/
12obj-$(CONFIG_MIPS_DB1000) += db1x00/
13obj-$(CONFIG_MIPS_DB1100) += db1x00/
14obj-$(CONFIG_MIPS_DB1200) += pb1200/
15obj-$(CONFIG_MIPS_DB1500) += db1x00/
16obj-$(CONFIG_MIPS_DB1550) += db1x00/
17obj-$(CONFIG_MIPS_BOSPORUS) += db1x00/
18obj-$(CONFIG_MIPS_MIRAGE) += db1x00/
diff --git a/arch/mips/alchemy/db1x00/Makefile b/arch/mips/alchemy/devboards/db1x00/Makefile
index 274db3b55d82..432241ab8677 100644
--- a/arch/mips/alchemy/db1x00/Makefile
+++ b/arch/mips/alchemy/devboards/db1x00/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor DBAu1xx0 boards. 5# Makefile for the Alchemy Semiconductor DBAu1xx0 boards.
6# 6#
7 7
8lib-y := init.o board_setup.o irqmap.o 8obj-y := board_setup.o irqmap.o
diff --git a/arch/mips/alchemy/db1x00/board_setup.c b/arch/mips/alchemy/devboards/db1x00/board_setup.c
index 9e5ccbbfcedd..a75ffbf99f25 100644
--- a/arch/mips/alchemy/db1x00/board_setup.c
+++ b/arch/mips/alchemy/devboards/db1x00/board_setup.c
@@ -32,8 +32,20 @@
32#include <asm/mach-au1x00/au1000.h> 32#include <asm/mach-au1x00/au1000.h>
33#include <asm/mach-db1x00/db1x00.h> 33#include <asm/mach-db1x00/db1x00.h>
34 34
35#include <prom.h>
36
37
35static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR; 38static BCSR * const bcsr = (BCSR *)BCSR_KSEG1_ADDR;
36 39
40const char *get_system_type(void)
41{
42#ifdef CONFIG_MIPS_BOSPORUS
43 return "Alchemy Bosporus Gateway Reference";
44#else
45 return "Alchemy Db1x00";
46#endif
47}
48
37void board_reset(void) 49void board_reset(void)
38{ 50{
39 /* Hit BCSR.SW_RESET[RESET] */ 51 /* Hit BCSR.SW_RESET[RESET] */
@@ -43,6 +55,31 @@ void board_reset(void)
43void __init board_setup(void) 55void __init board_setup(void)
44{ 56{
45 u32 pin_func = 0; 57 u32 pin_func = 0;
58 char *argptr;
59
60 argptr = prom_getcmdline();
61#ifdef CONFIG_SERIAL_8250_CONSOLE
62 argptr = strstr(argptr, "console=");
63 if (argptr == NULL) {
64 argptr = prom_getcmdline();
65 strcat(argptr, " console=ttyS0,115200");
66 }
67#endif
68
69#ifdef CONFIG_FB_AU1100
70 argptr = strstr(argptr, "video=");
71 if (argptr == NULL) {
72 argptr = prom_getcmdline();
73 /* default panel */
74 /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/
75 }
76#endif
77
78#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000)
79 /* au1000 does not support vra, au1500 and au1100 do */
80 strcat(argptr, " au1000_audio=vra");
81 argptr = prom_getcmdline();
82#endif
46 83
47 /* Not valid for Au1550 */ 84 /* Not valid for Au1550 */
48#if defined(CONFIG_IRDA) && \ 85#if defined(CONFIG_IRDA) && \
diff --git a/arch/mips/alchemy/db1x00/irqmap.c b/arch/mips/alchemy/devboards/db1x00/irqmap.c
index 94c090e8bf7a..0b09025087c6 100644
--- a/arch/mips/alchemy/db1x00/irqmap.c
+++ b/arch/mips/alchemy/devboards/db1x00/irqmap.c
@@ -27,6 +27,7 @@
27 */ 27 */
28 28
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/interrupt.h>
30 31
31#include <asm/mach-au1x00/au1000.h> 32#include <asm/mach-au1x00/au1000.h>
32 33
@@ -66,21 +67,24 @@ struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
66 67
67#ifndef CONFIG_MIPS_MIRAGE 68#ifndef CONFIG_MIPS_MIRAGE
68#ifdef CONFIG_MIPS_DB1550 69#ifdef CONFIG_MIPS_DB1550
69 { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 IRQ# */ 70 { AU1000_GPIO_3, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 IRQ# */
70 { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 IRQ# */ 71 { AU1000_GPIO_5, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 IRQ# */
71#else 72#else
72 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 Fully_Interted# */ 73 { AU1000_GPIO_0, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 Fully_Interted# */
73 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 STSCHG# */ 74 { AU1000_GPIO_1, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 STSCHG# */
74 { AU1000_GPIO_2, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 0 IRQ# */ 75 { AU1000_GPIO_2, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 0 IRQ# */
75 76
76 { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 Fully_Interted# */ 77 { AU1000_GPIO_3, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 Fully_Interted# */
77 { AU1000_GPIO_4, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 STSCHG# */ 78 { AU1000_GPIO_4, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 STSCHG# */
78 { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card 1 IRQ# */ 79 { AU1000_GPIO_5, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card 1 IRQ# */
79#endif 80#endif
80#else 81#else
81 { AU1000_GPIO_7, INTC_INT_RISE_EDGE, 0 }, /* touchscreen pen down */ 82 { AU1000_GPIO_7, IRQF_TRIGGER_RISING, 0 }, /* touchscreen pen down */
82#endif 83#endif
83 84
84}; 85};
85 86
86int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); 87void __init board_init_irq(void)
88{
89 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
90}
diff --git a/arch/mips/alchemy/pb1000/Makefile b/arch/mips/alchemy/devboards/pb1000/Makefile
index 99bbec0ca41b..97c6615ba2bb 100644
--- a/arch/mips/alchemy/pb1000/Makefile
+++ b/arch/mips/alchemy/devboards/pb1000/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor Pb1000 board. 5# Makefile for the Alchemy Semiconductor Pb1000 board.
6# 6#
7 7
8lib-y := init.o board_setup.o irqmap.o 8obj-y := board_setup.o
diff --git a/arch/mips/alchemy/pb1000/board_setup.c b/arch/mips/alchemy/devboards/pb1000/board_setup.c
index 25df167a95b3..aed2fdecc709 100644
--- a/arch/mips/alchemy/pb1000/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1000/board_setup.c
@@ -23,22 +23,48 @@
23 * 675 Mass Ave, Cambridge, MA 02139, USA. 23 * 675 Mass Ave, Cambridge, MA 02139, USA.
24 */ 24 */
25 25
26#include <linux/init.h>
27#include <linux/delay.h> 26#include <linux/delay.h>
28 27#include <linux/init.h>
28#include <linux/interrupt.h>
29#include <asm/mach-au1x00/au1000.h> 29#include <asm/mach-au1x00/au1000.h>
30#include <asm/mach-pb1x00/pb1000.h> 30#include <asm/mach-pb1x00/pb1000.h>
31#include <prom.h>
32
33
34struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
35 { AU1000_GPIO_15, IRQF_TRIGGER_LOW, 0 },
36};
37
38
39const char *get_system_type(void)
40{
41 return "Alchemy Pb1000";
42}
31 43
32void board_reset(void) 44void board_reset(void)
33{ 45{
34} 46}
35 47
48void __init board_init_irq(void)
49{
50 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
51}
52
36void __init board_setup(void) 53void __init board_setup(void)
37{ 54{
38 u32 pin_func, static_cfg0; 55 u32 pin_func, static_cfg0;
39 u32 sys_freqctrl, sys_clksrc; 56 u32 sys_freqctrl, sys_clksrc;
40 u32 prid = read_c0_prid(); 57 u32 prid = read_c0_prid();
41 58
59#ifdef CONFIG_SERIAL_8250_CONSOLE
60 char *argptr = prom_getcmdline();
61 argptr = strstr(argptr, "console=");
62 if (argptr == NULL) {
63 argptr = prom_getcmdline();
64 strcat(argptr, " console=ttyS0,115200");
65 }
66#endif
67
42 /* Set AUX clock to 12 MHz * 8 = 96 MHz */ 68 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
43 au_writel(8, SYS_AUXPLL); 69 au_writel(8, SYS_AUXPLL);
44 au_writel(0, SYS_PINSTATERD); 70 au_writel(0, SYS_PINSTATERD);
diff --git a/arch/mips/alchemy/pb1100/Makefile b/arch/mips/alchemy/devboards/pb1100/Makefile
index 793e97c49e46..c586dd7e91dc 100644
--- a/arch/mips/alchemy/pb1100/Makefile
+++ b/arch/mips/alchemy/devboards/pb1100/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor Pb1100 board. 5# Makefile for the Alchemy Semiconductor Pb1100 board.
6# 6#
7 7
8lib-y := init.o board_setup.o irqmap.o 8obj-y := board_setup.o
diff --git a/arch/mips/alchemy/pb1100/board_setup.c b/arch/mips/alchemy/devboards/pb1100/board_setup.c
index c0bfd59a7a36..4df57fae15d4 100644
--- a/arch/mips/alchemy/pb1100/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1100/board_setup.c
@@ -25,19 +25,66 @@
25 25
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/interrupt.h>
28 29
29#include <asm/mach-au1x00/au1000.h> 30#include <asm/mach-au1x00/au1000.h>
30#include <asm/mach-pb1x00/pb1100.h> 31#include <asm/mach-pb1x00/pb1100.h>
31 32
33#include <prom.h>
34
35
36struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
37 { AU1000_GPIO_9, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card Fully_Inserted# */
38 { AU1000_GPIO_10, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card STSCHG# */
39 { AU1000_GPIO_11, IRQF_TRIGGER_LOW, 0 }, /* PCMCIA Card IRQ# */
40 { AU1000_GPIO_13, IRQF_TRIGGER_LOW, 0 }, /* DC_IRQ# */
41};
42
43
44const char *get_system_type(void)
45{
46 return "Alchemy Pb1100";
47}
48
32void board_reset(void) 49void board_reset(void)
33{ 50{
34 /* Hit BCSR.RST_VDDI[SOFT_RESET] */ 51 /* Hit BCSR.RST_VDDI[SOFT_RESET] */
35 au_writel(0x00000000, PB1100_RST_VDDI); 52 au_writel(0x00000000, PB1100_RST_VDDI);
36} 53}
37 54
55void __init board_init_irq(void)
56{
57 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
58}
59
38void __init board_setup(void) 60void __init board_setup(void)
39{ 61{
40 volatile void __iomem *base = (volatile void __iomem *)0xac000000UL; 62 volatile void __iomem *base = (volatile void __iomem *)0xac000000UL;
63 char *argptr;
64
65 argptr = prom_getcmdline();
66#ifdef CONFIG_SERIAL_8250_CONSOLE
67 argptr = strstr(argptr, "console=");
68 if (argptr == NULL) {
69 argptr = prom_getcmdline();
70 strcat(argptr, " console=ttyS0,115200");
71 }
72#endif
73
74#ifdef CONFIG_FB_AU1100
75 argptr = strstr(argptr, "video=");
76 if (argptr == NULL) {
77 argptr = prom_getcmdline();
78 /* default panel */
79 /*strcat(argptr, " video=au1100fb:panel:Sharp_320x240_16");*/
80 }
81#endif
82
83#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000)
84 /* au1000 does not support vra, au1500 and au1100 do */
85 strcat(argptr, " au1000_audio=vra");
86 argptr = prom_getcmdline();
87#endif
41 88
42 /* Set AUX clock to 12 MHz * 8 = 96 MHz */ 89 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
43 au_writel(8, SYS_AUXPLL); 90 au_writel(8, SYS_AUXPLL);
diff --git a/arch/mips/alchemy/pb1200/Makefile b/arch/mips/alchemy/devboards/pb1200/Makefile
index d678adf7ce85..c8c3a99fb68a 100644
--- a/arch/mips/alchemy/pb1200/Makefile
+++ b/arch/mips/alchemy/devboards/pb1200/Makefile
@@ -2,7 +2,6 @@
2# Makefile for the Alchemy Semiconductor Pb1200/DBAu1200 boards. 2# Makefile for the Alchemy Semiconductor Pb1200/DBAu1200 boards.
3# 3#
4 4
5lib-y := init.o board_setup.o irqmap.o 5obj-y := board_setup.o irqmap.o platform.o
6obj-y += platform.o
7 6
8EXTRA_CFLAGS += -Werror 7EXTRA_CFLAGS += -Werror
diff --git a/arch/mips/alchemy/pb1200/board_setup.c b/arch/mips/alchemy/devboards/pb1200/board_setup.c
index 6cb2115059ad..94e6b7e7753d 100644
--- a/arch/mips/alchemy/pb1200/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1200/board_setup.c
@@ -30,8 +30,11 @@
30#include <prom.h> 30#include <prom.h>
31#include <au1xxx.h> 31#include <au1xxx.h>
32 32
33extern void _board_init_irq(void); 33
34extern void (*board_init_irq)(void); 34const char *get_system_type(void)
35{
36 return "Alchemy Pb1200";
37}
35 38
36void board_reset(void) 39void board_reset(void)
37{ 40{
@@ -41,7 +44,19 @@ void board_reset(void)
41 44
42void __init board_setup(void) 45void __init board_setup(void)
43{ 46{
44 char *argptr = NULL; 47 char *argptr;
48
49 argptr = prom_getcmdline();
50#ifdef CONFIG_SERIAL_8250_CONSOLE
51 argptr = strstr(argptr, "console=");
52 if (argptr == NULL) {
53 argptr = prom_getcmdline();
54 strcat(argptr, " console=ttyS0,115200");
55 }
56#endif
57#ifdef CONFIG_FB_AU1200
58 strcat(argptr, " video=au1200fb:panel:bs");
59#endif
45 60
46#if 0 61#if 0
47 { 62 {
@@ -99,16 +114,6 @@ void __init board_setup(void)
99 } 114 }
100#endif 115#endif
101 116
102#ifdef CONFIG_FB_AU1200
103 argptr = prom_getcmdline();
104#ifdef CONFIG_MIPS_PB1200
105 strcat(argptr, " video=au1200fb:panel:bs");
106#endif
107#ifdef CONFIG_MIPS_DB1200
108 strcat(argptr, " video=au1200fb:panel:bs");
109#endif
110#endif
111
112 /* 117 /*
113 * The Pb1200 development board uses external MUX for PSC0 to 118 * The Pb1200 development board uses external MUX for PSC0 to
114 * support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI 119 * support SMB/SPI. bcsr->resets bit 12: 0=SMB 1=SPI
@@ -124,9 +129,6 @@ void __init board_setup(void)
124#ifdef CONFIG_MIPS_DB1200 129#ifdef CONFIG_MIPS_DB1200
125 printk(KERN_INFO "AMD Alchemy Db1200 Board\n"); 130 printk(KERN_INFO "AMD Alchemy Db1200 Board\n");
126#endif 131#endif
127
128 /* Setup Pb1200 External Interrupt Controller */
129 board_init_irq = _board_init_irq;
130} 132}
131 133
132int board_au1200fb_panel(void) 134int board_au1200fb_panel(void)
diff --git a/arch/mips/alchemy/pb1200/irqmap.c b/arch/mips/alchemy/devboards/pb1200/irqmap.c
index 2a505ad8715b..fe47498da280 100644
--- a/arch/mips/alchemy/pb1200/irqmap.c
+++ b/arch/mips/alchemy/devboards/pb1200/irqmap.c
@@ -40,91 +40,65 @@
40 40
41struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 41struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
42 /* This is external interrupt cascade */ 42 /* This is external interrupt cascade */
43 { AU1000_GPIO_7, INTC_INT_LOW_LEVEL, 0 }, 43 { AU1000_GPIO_7, IRQF_TRIGGER_LOW, 0 },
44}; 44};
45 45
46int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);
47 46
48/* 47/*
49 * Support for External interrupts on the Pb1200 Development platform. 48 * Support for External interrupts on the Pb1200 Development platform.
50 */ 49 */
51static volatile int pb1200_cascade_en;
52 50
53irqreturn_t pb1200_cascade_handler(int irq, void *dev_id) 51static void pb1200_cascade_handler(unsigned int irq, struct irq_desc *d)
54{ 52{
55 unsigned short bisr = bcsr->int_status; 53 unsigned short bisr = bcsr->int_status;
56 int extirq_nr = 0;
57
58 /* Clear all the edge interrupts. This has no effect on level. */
59 bcsr->int_status = bisr;
60 for ( ; bisr; bisr &= bisr - 1) {
61 extirq_nr = PB1200_INT_BEGIN + __ffs(bisr);
62 /* Ack and dispatch IRQ */
63 do_IRQ(extirq_nr);
64 }
65
66 return IRQ_RETVAL(1);
67}
68 54
69inline void pb1200_enable_irq(unsigned int irq_nr) 55 for ( ; bisr; bisr &= bisr - 1)
70{ 56 generic_handle_irq(PB1200_INT_BEGIN + __ffs(bisr));
71 bcsr->intset_mask = 1 << (irq_nr - PB1200_INT_BEGIN);
72 bcsr->intset = 1 << (irq_nr - PB1200_INT_BEGIN);
73} 57}
74 58
75inline void pb1200_disable_irq(unsigned int irq_nr) 59/* NOTE: both the enable and mask bits must be cleared, otherwise the
60 * CPLD generates tons of spurious interrupts (at least on the DB1200).
61 */
62static void pb1200_mask_irq(unsigned int irq_nr)
76{ 63{
77 bcsr->intclr_mask = 1 << (irq_nr - PB1200_INT_BEGIN); 64 bcsr->intclr_mask = 1 << (irq_nr - PB1200_INT_BEGIN);
78 bcsr->intclr = 1 << (irq_nr - PB1200_INT_BEGIN); 65 bcsr->intclr = 1 << (irq_nr - PB1200_INT_BEGIN);
66 au_sync();
79} 67}
80 68
81static unsigned int pb1200_setup_cascade(void) 69static void pb1200_maskack_irq(unsigned int irq_nr)
82{
83 return request_irq(AU1000_GPIO_7, &pb1200_cascade_handler,
84 0, "Pb1200 Cascade", &pb1200_cascade_handler);
85}
86
87static unsigned int pb1200_startup_irq(unsigned int irq)
88{ 70{
89 if (++pb1200_cascade_en == 1) { 71 bcsr->intclr_mask = 1 << (irq_nr - PB1200_INT_BEGIN);
90 int res; 72 bcsr->intclr = 1 << (irq_nr - PB1200_INT_BEGIN);
91 73 bcsr->int_status = 1 << (irq_nr - PB1200_INT_BEGIN); /* ack */
92 res = pb1200_setup_cascade(); 74 au_sync();
93 if (res)
94 return res;
95 }
96
97 pb1200_enable_irq(irq);
98
99 return 0;
100} 75}
101 76
102static void pb1200_shutdown_irq(unsigned int irq) 77static void pb1200_unmask_irq(unsigned int irq_nr)
103{ 78{
104 pb1200_disable_irq(irq); 79 bcsr->intset = 1 << (irq_nr - PB1200_INT_BEGIN);
105 if (--pb1200_cascade_en == 0) 80 bcsr->intset_mask = 1 << (irq_nr - PB1200_INT_BEGIN);
106 free_irq(AU1000_GPIO_7, &pb1200_cascade_handler); 81 au_sync();
107} 82}
108 83
109static struct irq_chip external_irq_type = { 84static struct irq_chip pb1200_cpld_irq_type = {
110#ifdef CONFIG_MIPS_PB1200 85#ifdef CONFIG_MIPS_PB1200
111 .name = "Pb1200 Ext", 86 .name = "Pb1200 Ext",
112#endif 87#endif
113#ifdef CONFIG_MIPS_DB1200 88#ifdef CONFIG_MIPS_DB1200
114 .name = "Db1200 Ext", 89 .name = "Db1200 Ext",
115#endif 90#endif
116 .startup = pb1200_startup_irq, 91 .mask = pb1200_mask_irq,
117 .shutdown = pb1200_shutdown_irq, 92 .mask_ack = pb1200_maskack_irq,
118 .ack = pb1200_disable_irq, 93 .unmask = pb1200_unmask_irq,
119 .mask = pb1200_disable_irq,
120 .mask_ack = pb1200_disable_irq,
121 .unmask = pb1200_enable_irq,
122}; 94};
123 95
124void _board_init_irq(void) 96void __init board_init_irq(void)
125{ 97{
126 unsigned int irq; 98 unsigned int irq;
127 99
100 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
101
128#ifdef CONFIG_MIPS_PB1200 102#ifdef CONFIG_MIPS_PB1200
129 /* We have a problem with CPLD rev 3. */ 103 /* We have a problem with CPLD rev 3. */
130 if (((bcsr->whoami & BCSR_WHOAMI_CPLD) >> 4) <= 3) { 104 if (((bcsr->whoami & BCSR_WHOAMI_CPLD) >> 4) <= 3) {
@@ -146,15 +120,15 @@ void _board_init_irq(void)
146 panic("Game over. Your score is 0."); 120 panic("Game over. Your score is 0.");
147 } 121 }
148#endif 122#endif
123 /* mask & disable & ack all */
124 bcsr->intclr_mask = 0xffff;
125 bcsr->intclr = 0xffff;
126 bcsr->int_status = 0xffff;
127 au_sync();
149 128
150 for (irq = PB1200_INT_BEGIN; irq <= PB1200_INT_END; irq++) { 129 for (irq = PB1200_INT_BEGIN; irq <= PB1200_INT_END; irq++)
151 set_irq_chip_and_handler(irq, &external_irq_type, 130 set_irq_chip_and_handler_name(irq, &pb1200_cpld_irq_type,
152 handle_level_irq); 131 handle_level_irq, "level");
153 pb1200_disable_irq(irq);
154 }
155 132
156 /* 133 set_irq_chained_handler(AU1000_GPIO_7, pb1200_cascade_handler);
157 * GPIO_7 can not be hooked here, so it is hooked upon first
158 * request of any source attached to the cascade.
159 */
160} 134}
diff --git a/arch/mips/alchemy/pb1200/platform.c b/arch/mips/alchemy/devboards/pb1200/platform.c
index 95303297c534..95303297c534 100644
--- a/arch/mips/alchemy/pb1200/platform.c
+++ b/arch/mips/alchemy/devboards/pb1200/platform.c
diff --git a/arch/mips/alchemy/pb1500/Makefile b/arch/mips/alchemy/devboards/pb1500/Makefile
index 602f38df20bb..173b419a7479 100644
--- a/arch/mips/alchemy/pb1500/Makefile
+++ b/arch/mips/alchemy/devboards/pb1500/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor Pb1500 board. 5# Makefile for the Alchemy Semiconductor Pb1500 board.
6# 6#
7 7
8lib-y := init.o board_setup.o irqmap.o 8obj-y := board_setup.o
diff --git a/arch/mips/alchemy/pb1500/board_setup.c b/arch/mips/alchemy/devboards/pb1500/board_setup.c
index 035771c6e5b8..fed3b093156a 100644
--- a/arch/mips/alchemy/pb1500/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1500/board_setup.c
@@ -25,20 +25,64 @@
25 25
26#include <linux/init.h> 26#include <linux/init.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/interrupt.h>
28 29
29#include <asm/mach-au1x00/au1000.h> 30#include <asm/mach-au1x00/au1000.h>
30#include <asm/mach-pb1x00/pb1500.h> 31#include <asm/mach-pb1x00/pb1500.h>
31 32
33#include <prom.h>
34
35
36char irq_tab_alchemy[][5] __initdata = {
37 [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - HPT370 */
38 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot */
39};
40
41struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
42 { AU1500_GPIO_204, IRQF_TRIGGER_HIGH, 0 },
43 { AU1500_GPIO_201, IRQF_TRIGGER_LOW, 0 },
44 { AU1500_GPIO_202, IRQF_TRIGGER_LOW, 0 },
45 { AU1500_GPIO_203, IRQF_TRIGGER_LOW, 0 },
46 { AU1500_GPIO_205, IRQF_TRIGGER_LOW, 0 },
47};
48
49
50const char *get_system_type(void)
51{
52 return "Alchemy Pb1500";
53}
54
32void board_reset(void) 55void board_reset(void)
33{ 56{
34 /* Hit BCSR.RST_VDDI[SOFT_RESET] */ 57 /* Hit BCSR.RST_VDDI[SOFT_RESET] */
35 au_writel(0x00000000, PB1500_RST_VDDI); 58 au_writel(0x00000000, PB1500_RST_VDDI);
36} 59}
37 60
61void __init board_init_irq(void)
62{
63 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
64}
65
38void __init board_setup(void) 66void __init board_setup(void)
39{ 67{
40 u32 pin_func; 68 u32 pin_func;
41 u32 sys_freqctrl, sys_clksrc; 69 u32 sys_freqctrl, sys_clksrc;
70 char *argptr;
71
72 argptr = prom_getcmdline();
73#ifdef CONFIG_SERIAL_8250_CONSOLE
74 argptr = strstr(argptr, "console=");
75 if (argptr == NULL) {
76 argptr = prom_getcmdline();
77 strcat(argptr, " console=ttyS0,115200");
78 }
79#endif
80
81#if defined(CONFIG_SOUND_AU1X00) && !defined(CONFIG_SOC_AU1000)
82 /* au1000 does not support vra, au1500 and au1100 do */
83 strcat(argptr, " au1000_audio=vra");
84 argptr = prom_getcmdline();
85#endif
42 86
43 sys_clksrc = sys_freqctrl = pin_func = 0; 87 sys_clksrc = sys_freqctrl = pin_func = 0;
44 /* Set AUX clock to 12 MHz * 8 = 96 MHz */ 88 /* Set AUX clock to 12 MHz * 8 = 96 MHz */
diff --git a/arch/mips/alchemy/pb1550/Makefile b/arch/mips/alchemy/devboards/pb1550/Makefile
index 7d8beca87fa5..cff95bcdb2ca 100644
--- a/arch/mips/alchemy/pb1550/Makefile
+++ b/arch/mips/alchemy/devboards/pb1550/Makefile
@@ -5,4 +5,4 @@
5# Makefile for the Alchemy Semiconductor Pb1550 board. 5# Makefile for the Alchemy Semiconductor Pb1550 board.
6# 6#
7 7
8lib-y := init.o board_setup.o irqmap.o 8obj-y := board_setup.o
diff --git a/arch/mips/alchemy/pb1550/board_setup.c b/arch/mips/alchemy/devboards/pb1550/board_setup.c
index 0ed76b64b6ab..b6e9e7d247a3 100644
--- a/arch/mips/alchemy/pb1550/board_setup.c
+++ b/arch/mips/alchemy/devboards/pb1550/board_setup.c
@@ -28,20 +28,54 @@
28 */ 28 */
29 29
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/interrupt.h>
31 32
32#include <asm/mach-au1x00/au1000.h> 33#include <asm/mach-au1x00/au1000.h>
33#include <asm/mach-pb1x00/pb1550.h> 34#include <asm/mach-pb1x00/pb1550.h>
34 35
36#include <prom.h>
37
38
39char irq_tab_alchemy[][5] __initdata = {
40 [12] = { -1, INTB, INTC, INTD, INTA }, /* IDSEL 12 - PCI slot 2 (left) */
41 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot 1 (right) */
42};
43
44struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
45 { AU1000_GPIO_0, IRQF_TRIGGER_LOW, 0 },
46 { AU1000_GPIO_1, IRQF_TRIGGER_LOW, 0 },
47};
48
49const char *get_system_type(void)
50{
51 return "Alchemy Pb1550";
52}
53
35void board_reset(void) 54void board_reset(void)
36{ 55{
37 /* Hit BCSR.SYSTEM[RESET] */ 56 /* Hit BCSR.SYSTEM[RESET] */
38 au_writew(au_readw(0xAF00001C) & ~BCSR_SYSTEM_RESET, 0xAF00001C); 57 au_writew(au_readw(0xAF00001C) & ~BCSR_SYSTEM_RESET, 0xAF00001C);
39} 58}
40 59
60void __init board_init_irq(void)
61{
62 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
63}
64
41void __init board_setup(void) 65void __init board_setup(void)
42{ 66{
43 u32 pin_func; 67 u32 pin_func;
44 68
69#ifdef CONFIG_SERIAL_8250_CONSOLE
70 char *argptr;
71 argptr = prom_getcmdline();
72 argptr = strstr(argptr, "console=");
73 if (argptr == NULL) {
74 argptr = prom_getcmdline();
75 strcat(argptr, " console=ttyS0,115200");
76 }
77#endif
78
45 /* 79 /*
46 * Enable PSC1 SYNC for AC'97. Normaly done in audio driver, 80 * Enable PSC1 SYNC for AC'97. Normaly done in audio driver,
47 * but it is board specific code, so put it here. 81 * but it is board specific code, so put it here.
diff --git a/arch/mips/alchemy/devboards/pm.c b/arch/mips/alchemy/devboards/pm.c
new file mode 100644
index 000000000000..d5eb9c325ed0
--- /dev/null
+++ b/arch/mips/alchemy/devboards/pm.c
@@ -0,0 +1,229 @@
1/*
2 * Alchemy Development Board example suspend userspace interface.
3 *
4 * (c) 2008 Manuel Lauss <mano@roarinelk.homelinux.net>
5 */
6
7#include <linux/init.h>
8#include <linux/kobject.h>
9#include <linux/suspend.h>
10#include <linux/sysfs.h>
11#include <asm/mach-au1x00/au1000.h>
12
13/*
14 * Generic suspend userspace interface for Alchemy development boards.
15 * This code exports a few sysfs nodes under /sys/power/db1x/ which
16 * can be used by userspace to en/disable all au1x-provided wakeup
17 * sources and configure the timeout after which the the TOYMATCH2 irq
18 * is to trigger a wakeup.
19 */
20
21
22static unsigned long db1x_pm_sleep_secs;
23static unsigned long db1x_pm_wakemsk;
24static unsigned long db1x_pm_last_wakesrc;
25
26static int db1x_pm_enter(suspend_state_t state)
27{
28 /* enable GPIO based wakeup */
29 au_writel(1, SYS_PININPUTEN);
30
31 /* clear and setup wake cause and source */
32 au_writel(0, SYS_WAKEMSK);
33 au_sync();
34 au_writel(0, SYS_WAKESRC);
35 au_sync();
36
37 au_writel(db1x_pm_wakemsk, SYS_WAKEMSK);
38 au_sync();
39
40 /* setup 1Hz-timer-based wakeup: wait for reg access */
41 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20)
42 asm volatile ("nop");
43
44 au_writel(au_readl(SYS_TOYREAD) + db1x_pm_sleep_secs, SYS_TOYMATCH2);
45 au_sync();
46
47 /* wait for value to really hit the register */
48 while (au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_M20)
49 asm volatile ("nop");
50
51 /* ...and now the sandman can come! */
52 au_sleep();
53
54 return 0;
55}
56
57static int db1x_pm_begin(suspend_state_t state)
58{
59 if (!db1x_pm_wakemsk) {
60 printk(KERN_ERR "db1x: no wakeup source activated!\n");
61 return -EINVAL;
62 }
63
64 return 0;
65}
66
67static void db1x_pm_end(void)
68{
69 /* read and store wakeup source, the clear the register. To
70 * be able to clear it, WAKEMSK must be cleared first.
71 */
72 db1x_pm_last_wakesrc = au_readl(SYS_WAKESRC);
73
74 au_writel(0, SYS_WAKEMSK);
75 au_writel(0, SYS_WAKESRC);
76 au_sync();
77
78}
79
80static struct platform_suspend_ops db1x_pm_ops = {
81 .valid = suspend_valid_only_mem,
82 .begin = db1x_pm_begin,
83 .enter = db1x_pm_enter,
84 .end = db1x_pm_end,
85};
86
87#define ATTRCMP(x) (0 == strcmp(attr->attr.name, #x))
88
89static ssize_t db1x_pmattr_show(struct kobject *kobj,
90 struct kobj_attribute *attr,
91 char *buf)
92{
93 int idx;
94
95 if (ATTRCMP(timer_timeout))
96 return sprintf(buf, "%lu\n", db1x_pm_sleep_secs);
97
98 else if (ATTRCMP(timer))
99 return sprintf(buf, "%u\n",
100 !!(db1x_pm_wakemsk & SYS_WAKEMSK_M2));
101
102 else if (ATTRCMP(wakesrc))
103 return sprintf(buf, "%lu\n", db1x_pm_last_wakesrc);
104
105 else if (ATTRCMP(gpio0) || ATTRCMP(gpio1) || ATTRCMP(gpio2) ||
106 ATTRCMP(gpio3) || ATTRCMP(gpio4) || ATTRCMP(gpio5) ||
107 ATTRCMP(gpio6) || ATTRCMP(gpio7)) {
108 idx = (attr->attr.name)[4] - '0';
109 return sprintf(buf, "%d\n",
110 !!(db1x_pm_wakemsk & SYS_WAKEMSK_GPIO(idx)));
111
112 } else if (ATTRCMP(wakemsk)) {
113 return sprintf(buf, "%08lx\n", db1x_pm_wakemsk);
114 }
115
116 return -ENOENT;
117}
118
119static ssize_t db1x_pmattr_store(struct kobject *kobj,
120 struct kobj_attribute *attr,
121 const char *instr,
122 size_t bytes)
123{
124 unsigned long l;
125 int tmp;
126
127 if (ATTRCMP(timer_timeout)) {
128 tmp = strict_strtoul(instr, 0, &l);
129 if (tmp)
130 return tmp;
131
132 db1x_pm_sleep_secs = l;
133
134 } else if (ATTRCMP(timer)) {
135 if (instr[0] != '0')
136 db1x_pm_wakemsk |= SYS_WAKEMSK_M2;
137 else
138 db1x_pm_wakemsk &= ~SYS_WAKEMSK_M2;
139
140 } else if (ATTRCMP(gpio0) || ATTRCMP(gpio1) || ATTRCMP(gpio2) ||
141 ATTRCMP(gpio3) || ATTRCMP(gpio4) || ATTRCMP(gpio5) ||
142 ATTRCMP(gpio6) || ATTRCMP(gpio7)) {
143 tmp = (attr->attr.name)[4] - '0';
144 if (instr[0] != '0') {
145 db1x_pm_wakemsk |= SYS_WAKEMSK_GPIO(tmp);
146 } else {
147 db1x_pm_wakemsk &= ~SYS_WAKEMSK_GPIO(tmp);
148 }
149
150 } else if (ATTRCMP(wakemsk)) {
151 tmp = strict_strtoul(instr, 0, &l);
152 if (tmp)
153 return tmp;
154
155 db1x_pm_wakemsk = l & 0x0000003f;
156
157 } else
158 bytes = -ENOENT;
159
160 return bytes;
161}
162
163#define ATTR(x) \
164 static struct kobj_attribute x##_attribute = \
165 __ATTR(x, 0664, db1x_pmattr_show, \
166 db1x_pmattr_store);
167
168ATTR(gpio0) /* GPIO-based wakeup enable */
169ATTR(gpio1)
170ATTR(gpio2)
171ATTR(gpio3)
172ATTR(gpio4)
173ATTR(gpio5)
174ATTR(gpio6)
175ATTR(gpio7)
176ATTR(timer) /* TOYMATCH2-based wakeup enable */
177ATTR(timer_timeout) /* timer-based wakeup timeout value, in seconds */
178ATTR(wakesrc) /* contents of SYS_WAKESRC after last wakeup */
179ATTR(wakemsk) /* direct access to SYS_WAKEMSK */
180
181#define ATTR_LIST(x) & x ## _attribute.attr
182static struct attribute *db1x_pmattrs[] = {
183 ATTR_LIST(gpio0),
184 ATTR_LIST(gpio1),
185 ATTR_LIST(gpio2),
186 ATTR_LIST(gpio3),
187 ATTR_LIST(gpio4),
188 ATTR_LIST(gpio5),
189 ATTR_LIST(gpio6),
190 ATTR_LIST(gpio7),
191 ATTR_LIST(timer),
192 ATTR_LIST(timer_timeout),
193 ATTR_LIST(wakesrc),
194 ATTR_LIST(wakemsk),
195 NULL, /* terminator */
196};
197
198static struct attribute_group db1x_pmattr_group = {
199 .name = "db1x",
200 .attrs = db1x_pmattrs,
201};
202
203/*
204 * Initialize suspend interface
205 */
206static int __init pm_init(void)
207{
208 /* init TOY to tick at 1Hz if not already done. No need to wait
209 * for confirmation since there's plenty of time from here to
210 * the next suspend cycle.
211 */
212 if (au_readl(SYS_TOYTRIM) != 32767) {
213 au_writel(32767, SYS_TOYTRIM);
214 au_sync();
215 }
216
217 db1x_pm_last_wakesrc = au_readl(SYS_WAKESRC);
218
219 au_writel(0, SYS_WAKESRC);
220 au_sync();
221 au_writel(0, SYS_WAKEMSK);
222 au_sync();
223
224 suspend_set_ops(&db1x_pm_ops);
225
226 return sysfs_create_group(power_kobj, &db1x_pmattr_group);
227}
228
229late_initcall(pm_init);
diff --git a/arch/mips/alchemy/pb1500/init.c b/arch/mips/alchemy/devboards/prom.c
index 3b6e395cf952..0042bd6b1d7d 100644
--- a/arch/mips/alchemy/pb1500/init.c
+++ b/arch/mips/alchemy/devboards/prom.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * Common code used by all Alchemy develboards.
2 * 3 *
3 * BRIEF MODULE DESCRIPTION 4 * Extracted from files which had this to say:
4 * Pb1500 board setup
5 * 5 *
6 * Copyright 2001, 2008 MontaVista Software Inc. 6 * Copyright 2000, 2008 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. <source@mvista.com> 7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify it 9 * This program is free software; you can redistribute it and/or modify it
@@ -29,15 +29,19 @@
29 29
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32
33#include <asm/bootinfo.h> 32#include <asm/bootinfo.h>
34 33#include <asm/mach-au1x00/au1000.h>
35#include <prom.h> 34#include <prom.h>
36 35
37const char *get_system_type(void) 36#if defined(CONFIG_MIPS_PB1000) || defined(CONFIG_MIPS_DB1000) || \
38{ 37 defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_DB1100) || \
39 return "Alchemy Pb1500"; 38 defined(CONFIG_MIPS_PB1500) || defined(CONFIG_MIPS_DB1500) || \
40} 39 defined(CONFIG_MIPS_BOSPORUS) || defined(CONFIG_MIPS_MIRAGE)
40#define ALCHEMY_BOARD_DEFAULT_MEMSIZE 0x04000000
41
42#else /* Au1550/Au1200-based develboards */
43#define ALCHEMY_BOARD_DEFAULT_MEMSIZE 0x08000000
44#endif
41 45
42void __init prom_init(void) 46void __init prom_init(void)
43{ 47{
@@ -51,8 +55,8 @@ void __init prom_init(void)
51 prom_init_cmdline(); 55 prom_init_cmdline();
52 memsize_str = prom_getenv("memsize"); 56 memsize_str = prom_getenv("memsize");
53 if (!memsize_str) 57 if (!memsize_str)
54 memsize = 0x04000000; 58 memsize = ALCHEMY_BOARD_DEFAULT_MEMSIZE;
55 else 59 else
56 strict_strtol(memsize_str, 0, &memsize); 60 strict_strtoul(memsize_str, 0, &memsize);
57 add_memory_region(0, memsize, BOOT_MEM_RAM); 61 add_memory_region(0, memsize, BOOT_MEM_RAM);
58} 62}
diff --git a/arch/mips/alchemy/mtx-1/board_setup.c b/arch/mips/alchemy/mtx-1/board_setup.c
index 3f8079186cf2..8ed1ae12bc55 100644
--- a/arch/mips/alchemy/mtx-1/board_setup.c
+++ b/arch/mips/alchemy/mtx-1/board_setup.c
@@ -32,6 +32,8 @@
32 32
33#include <asm/mach-au1x00/au1000.h> 33#include <asm/mach-au1x00/au1000.h>
34 34
35#include <prom.h>
36
35extern int (*board_pci_idsel)(unsigned int devsel, int assert); 37extern int (*board_pci_idsel)(unsigned int devsel, int assert);
36int mtx1_pci_idsel(unsigned int devsel, int assert); 38int mtx1_pci_idsel(unsigned int devsel, int assert);
37 39
@@ -43,6 +45,16 @@ void board_reset(void)
43 45
44void __init board_setup(void) 46void __init board_setup(void)
45{ 47{
48#ifdef CONFIG_SERIAL_8250_CONSOLE
49 char *argptr;
50 argptr = prom_getcmdline();
51 argptr = strstr(argptr, "console=");
52 if (argptr == NULL) {
53 argptr = prom_getcmdline();
54 strcat(argptr, " console=ttyS0,115200");
55 }
56#endif
57
46#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 58#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
47 /* Enable USB power switch */ 59 /* Enable USB power switch */
48 au_writel(au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR); 60 au_writel(au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR);
diff --git a/arch/mips/alchemy/mtx-1/init.c b/arch/mips/alchemy/mtx-1/init.c
index 3bae13c28954..5e871c8d9e96 100644
--- a/arch/mips/alchemy/mtx-1/init.c
+++ b/arch/mips/alchemy/mtx-1/init.c
@@ -55,6 +55,6 @@ void __init prom_init(void)
55 if (!memsize_str) 55 if (!memsize_str)
56 memsize = 0x04000000; 56 memsize = 0x04000000;
57 else 57 else
58 strict_strtol(memsize_str, 0, &memsize); 58 strict_strtoul(memsize_str, 0, &memsize);
59 add_memory_region(0, memsize, BOOT_MEM_RAM); 59 add_memory_region(0, memsize, BOOT_MEM_RAM);
60} 60}
diff --git a/arch/mips/alchemy/mtx-1/irqmap.c b/arch/mips/alchemy/mtx-1/irqmap.c
index f2bf02951e9c..f1ab12ab3433 100644
--- a/arch/mips/alchemy/mtx-1/irqmap.c
+++ b/arch/mips/alchemy/mtx-1/irqmap.c
@@ -27,7 +27,7 @@
27 */ 27 */
28 28
29#include <linux/init.h> 29#include <linux/init.h>
30 30#include <linux/interrupt.h>
31#include <asm/mach-au1x00/au1000.h> 31#include <asm/mach-au1x00/au1000.h>
32 32
33char irq_tab_alchemy[][5] __initdata = { 33char irq_tab_alchemy[][5] __initdata = {
@@ -42,11 +42,15 @@ char irq_tab_alchemy[][5] __initdata = {
42}; 42};
43 43
44struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 44struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
45 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0 }, 45 { AU1500_GPIO_204, IRQF_TRIGGER_HIGH, 0 },
46 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, 46 { AU1500_GPIO_201, IRQF_TRIGGER_LOW, 0 },
47 { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 }, 47 { AU1500_GPIO_202, IRQF_TRIGGER_LOW, 0 },
48 { AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 }, 48 { AU1500_GPIO_203, IRQF_TRIGGER_LOW, 0 },
49 { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 }, 49 { AU1500_GPIO_205, IRQF_TRIGGER_LOW, 0 },
50}; 50};
51 51
52int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); 52
53void __init board_init_irq(void)
54{
55 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
56}
diff --git a/arch/mips/alchemy/pb1000/init.c b/arch/mips/alchemy/pb1000/init.c
deleted file mode 100644
index 8a9c7d57208d..000000000000
--- a/arch/mips/alchemy/pb1000/init.c
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Pb1000 board setup
4 *
5 * Copyright 2001, 2008 MontaVista Software Inc.
6 * Author: MontaVista Software, Inc. <source@mvista.com>
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#include <linux/init.h>
30#include <linux/kernel.h>
31
32#include <asm/bootinfo.h>
33
34#include <prom.h>
35
36const char *get_system_type(void)
37{
38 return "Alchemy Pb1000";
39}
40
41void __init prom_init(void)
42{
43 unsigned char *memsize_str;
44 unsigned long memsize;
45
46 prom_argc = (int)fw_arg0;
47 prom_argv = (char **)fw_arg1;
48 prom_envp = (char **)fw_arg2;
49
50 prom_init_cmdline();
51 memsize_str = prom_getenv("memsize");
52 if (!memsize_str)
53 memsize = 0x04000000;
54 else
55 strict_strtol(memsize_str, 0, &memsize);
56 add_memory_region(0, memsize, BOOT_MEM_RAM);
57}
diff --git a/arch/mips/alchemy/pb1000/irqmap.c b/arch/mips/alchemy/pb1000/irqmap.c
deleted file mode 100644
index b3d56b0af321..000000000000
--- a/arch/mips/alchemy/pb1000/irqmap.c
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xxx irq map table
4 *
5 * Copyright 2003 Embedded Edge, LLC
6 * dan@embeddededge.com
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#include <linux/init.h>
30#include <linux/interrupt.h>
31
32#include <asm/mach-au1x00/au1000.h>
33
34struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
35 { AU1000_GPIO_15, INTC_INT_LOW_LEVEL, 0 },
36};
37
38int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);
diff --git a/arch/mips/alchemy/pb1100/init.c b/arch/mips/alchemy/pb1100/init.c
deleted file mode 100644
index 7c6792308bc5..000000000000
--- a/arch/mips/alchemy/pb1100/init.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Pb1100 board setup
5 *
6 * Copyright 2002, 2008 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#include <linux/init.h>
31#include <linux/kernel.h>
32
33#include <asm/bootinfo.h>
34
35#include <prom.h>
36
37const char *get_system_type(void)
38{
39 return "Alchemy Pb1100";
40}
41
42void __init prom_init(void)
43{
44 unsigned char *memsize_str;
45 unsigned long memsize;
46
47 prom_argc = fw_arg0;
48 prom_argv = (char **)fw_arg1;
49 prom_envp = (char **)fw_arg3;
50
51 prom_init_cmdline();
52
53 memsize_str = prom_getenv("memsize");
54 if (!memsize_str)
55 memsize = 0x04000000;
56 else
57 strict_strtol(memsize_str, 0, &memsize);
58
59 add_memory_region(0, memsize, BOOT_MEM_RAM);
60}
diff --git a/arch/mips/alchemy/pb1100/irqmap.c b/arch/mips/alchemy/pb1100/irqmap.c
deleted file mode 100644
index 9b7dd8b41283..000000000000
--- a/arch/mips/alchemy/pb1100/irqmap.c
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xx0 IRQ map table
4 *
5 * Copyright 2003 Embedded Edge, LLC
6 * dan@embeddededge.com
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#include <linux/init.h>
30
31#include <asm/mach-au1x00/au1000.h>
32
33struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
34 { AU1000_GPIO_9, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card Fully_Inserted# */
35 { AU1000_GPIO_10, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card STSCHG# */
36 { AU1000_GPIO_11, INTC_INT_LOW_LEVEL, 0 }, /* PCMCIA Card IRQ# */
37 { AU1000_GPIO_13, INTC_INT_LOW_LEVEL, 0 }, /* DC_IRQ# */
38};
39
40int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);
diff --git a/arch/mips/alchemy/pb1200/init.c b/arch/mips/alchemy/pb1200/init.c
deleted file mode 100644
index e9b2a0fd48ae..000000000000
--- a/arch/mips/alchemy/pb1200/init.c
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * PB1200 board setup
5 *
6 * Copyright 2001, 2008 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#include <linux/init.h>
31#include <linux/kernel.h>
32
33#include <asm/bootinfo.h>
34
35#include <prom.h>
36
37const char *get_system_type(void)
38{
39 return "Alchemy Pb1200";
40}
41
42void __init prom_init(void)
43{
44 unsigned char *memsize_str;
45 unsigned long memsize;
46
47 prom_argc = (int)fw_arg0;
48 prom_argv = (char **)fw_arg1;
49 prom_envp = (char **)fw_arg2;
50
51 prom_init_cmdline();
52 memsize_str = prom_getenv("memsize");
53 if (!memsize_str)
54 memsize = 0x08000000;
55 else
56 strict_strtol(memsize_str, 0, &memsize);
57 add_memory_region(0, memsize, BOOT_MEM_RAM);
58}
diff --git a/arch/mips/alchemy/pb1500/irqmap.c b/arch/mips/alchemy/pb1500/irqmap.c
deleted file mode 100644
index 39c4682766a8..000000000000
--- a/arch/mips/alchemy/pb1500/irqmap.c
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xxx irq map table
4 *
5 * Copyright 2003 Embedded Edge, LLC
6 * dan@embeddededge.com
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#include <linux/init.h>
30
31#include <asm/mach-au1x00/au1000.h>
32
33char irq_tab_alchemy[][5] __initdata = {
34 [12] = { -1, INTA, INTX, INTX, INTX }, /* IDSEL 12 - HPT370 */
35 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot */
36};
37
38struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
39 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0 },
40 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 },
41 { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 },
42 { AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 },
43 { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 },
44};
45
46int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);
diff --git a/arch/mips/alchemy/pb1550/init.c b/arch/mips/alchemy/pb1550/init.c
deleted file mode 100644
index e1055a13a1a0..000000000000
--- a/arch/mips/alchemy/pb1550/init.c
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 *
3 * BRIEF MODULE DESCRIPTION
4 * Pb1550 board setup
5 *
6 * Copyright 2001, 2008 MontaVista Software Inc.
7 * Author: MontaVista Software, Inc. <source@mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
17 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
20 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * You should have received a copy of the GNU General Public License along
26 * with this program; if not, write to the Free Software Foundation, Inc.,
27 * 675 Mass Ave, Cambridge, MA 02139, USA.
28 */
29
30#include <linux/init.h>
31#include <linux/kernel.h>
32
33#include <asm/bootinfo.h>
34
35#include <prom.h>
36
37const char *get_system_type(void)
38{
39 return "Alchemy Pb1550";
40}
41
42void __init prom_init(void)
43{
44 unsigned char *memsize_str;
45 unsigned long memsize;
46
47 prom_argc = (int)fw_arg0;
48 prom_argv = (char **)fw_arg1;
49 prom_envp = (char **)fw_arg2;
50
51 prom_init_cmdline();
52 memsize_str = prom_getenv("memsize");
53 if (!memsize_str)
54 memsize = 0x08000000;
55 else
56 strict_strtol(memsize_str, 0, &memsize);
57 add_memory_region(0, memsize, BOOT_MEM_RAM);
58}
diff --git a/arch/mips/alchemy/pb1550/irqmap.c b/arch/mips/alchemy/pb1550/irqmap.c
deleted file mode 100644
index a02a4d1fa899..000000000000
--- a/arch/mips/alchemy/pb1550/irqmap.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * BRIEF MODULE DESCRIPTION
3 * Au1xx0 IRQ map table
4 *
5 * Copyright 2003 Embedded Edge, LLC
6 * dan@embeddededge.com
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 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
14 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
16 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
19 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 675 Mass Ave, Cambridge, MA 02139, USA.
27 */
28
29#include <linux/init.h>
30
31#include <asm/mach-au1x00/au1000.h>
32
33char irq_tab_alchemy[][5] __initdata = {
34 [12] = { -1, INTB, INTC, INTD, INTA }, /* IDSEL 12 - PCI slot 2 (left) */
35 [13] = { -1, INTA, INTB, INTC, INTD }, /* IDSEL 13 - PCI slot 1 (right) */
36};
37
38struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
39 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 },
40 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 },
41};
42
43int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map);
diff --git a/arch/mips/alchemy/xxs1500/board_setup.c b/arch/mips/alchemy/xxs1500/board_setup.c
index 4c587acac5c3..a2634fabc50d 100644
--- a/arch/mips/alchemy/xxs1500/board_setup.c
+++ b/arch/mips/alchemy/xxs1500/board_setup.c
@@ -28,6 +28,8 @@
28 28
29#include <asm/mach-au1x00/au1000.h> 29#include <asm/mach-au1x00/au1000.h>
30 30
31#include <prom.h>
32
31void board_reset(void) 33void board_reset(void)
32{ 34{
33 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */ 35 /* Hit BCSR.SYSTEM_CONTROL[SW_RST] */
@@ -38,6 +40,16 @@ void __init board_setup(void)
38{ 40{
39 u32 pin_func; 41 u32 pin_func;
40 42
43#ifdef CONFIG_SERIAL_8250_CONSOLE
44 char *argptr;
45 argptr = prom_getcmdline();
46 argptr = strstr(argptr, "console=");
47 if (argptr == NULL) {
48 argptr = prom_getcmdline();
49 strcat(argptr, " console=ttyS0,115200");
50 }
51#endif
52
41 /* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */ 53 /* Set multiple use pins (UART3/GPIO) to UART (it's used as UART too) */
42 pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3; 54 pin_func = au_readl(SYS_PINFUNC) & ~SYS_PF_UR3;
43 pin_func |= SYS_PF_UR3; 55 pin_func |= SYS_PF_UR3;
diff --git a/arch/mips/alchemy/xxs1500/init.c b/arch/mips/alchemy/xxs1500/init.c
index 7516434760a1..456fa142c093 100644
--- a/arch/mips/alchemy/xxs1500/init.c
+++ b/arch/mips/alchemy/xxs1500/init.c
@@ -53,6 +53,6 @@ void __init prom_init(void)
53 if (!memsize_str) 53 if (!memsize_str)
54 memsize = 0x04000000; 54 memsize = 0x04000000;
55 else 55 else
56 strict_strtol(memsize_str, 0, &memsize); 56 strict_strtoul(memsize_str, 0, &memsize);
57 add_memory_region(0, memsize, BOOT_MEM_RAM); 57 add_memory_region(0, memsize, BOOT_MEM_RAM);
58} 58}
diff --git a/arch/mips/alchemy/xxs1500/irqmap.c b/arch/mips/alchemy/xxs1500/irqmap.c
index edf06ed11870..0f0f3012e5fd 100644
--- a/arch/mips/alchemy/xxs1500/irqmap.c
+++ b/arch/mips/alchemy/xxs1500/irqmap.c
@@ -27,23 +27,26 @@
27 */ 27 */
28 28
29#include <linux/init.h> 29#include <linux/init.h>
30 30#include <linux/interrupt.h>
31#include <asm/mach-au1x00/au1000.h> 31#include <asm/mach-au1x00/au1000.h>
32 32
33struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { 33struct au1xxx_irqmap __initdata au1xxx_irq_map[] = {
34 { AU1500_GPIO_204, INTC_INT_HIGH_LEVEL, 0 }, 34 { AU1500_GPIO_204, IRQF_TRIGGER_HIGH, 0 },
35 { AU1500_GPIO_201, INTC_INT_LOW_LEVEL, 0 }, 35 { AU1500_GPIO_201, IRQF_TRIGGER_LOW, 0 },
36 { AU1500_GPIO_202, INTC_INT_LOW_LEVEL, 0 }, 36 { AU1500_GPIO_202, IRQF_TRIGGER_LOW, 0 },
37 { AU1500_GPIO_203, INTC_INT_LOW_LEVEL, 0 }, 37 { AU1500_GPIO_203, IRQF_TRIGGER_LOW, 0 },
38 { AU1500_GPIO_205, INTC_INT_LOW_LEVEL, 0 }, 38 { AU1500_GPIO_205, IRQF_TRIGGER_LOW, 0 },
39 { AU1500_GPIO_207, INTC_INT_LOW_LEVEL, 0 }, 39 { AU1500_GPIO_207, IRQF_TRIGGER_LOW, 0 },
40 40
41 { AU1000_GPIO_0, INTC_INT_LOW_LEVEL, 0 }, 41 { AU1000_GPIO_0, IRQF_TRIGGER_LOW, 0 },
42 { AU1000_GPIO_1, INTC_INT_LOW_LEVEL, 0 }, 42 { AU1000_GPIO_1, IRQF_TRIGGER_LOW, 0 },
43 { AU1000_GPIO_2, INTC_INT_LOW_LEVEL, 0 }, 43 { AU1000_GPIO_2, IRQF_TRIGGER_LOW, 0 },
44 { AU1000_GPIO_3, INTC_INT_LOW_LEVEL, 0 }, 44 { AU1000_GPIO_3, IRQF_TRIGGER_LOW, 0 },
45 { AU1000_GPIO_4, INTC_INT_LOW_LEVEL, 0 }, /* CF interrupt */ 45 { AU1000_GPIO_4, IRQF_TRIGGER_LOW, 0 }, /* CF interrupt */
46 { AU1000_GPIO_5, INTC_INT_LOW_LEVEL, 0 }, 46 { AU1000_GPIO_5, IRQF_TRIGGER_LOW, 0 },
47}; 47};
48 48
49int __initdata au1xxx_nr_irqs = ARRAY_SIZE(au1xxx_irq_map); 49void __init board_init_irq(void)
50{
51 au1xxx_setup_irqmap(au1xxx_irq_map, ARRAY_SIZE(au1xxx_irq_map));
52}
diff --git a/arch/mips/cavium-octeon/Kconfig b/arch/mips/cavium-octeon/Kconfig
new file mode 100644
index 000000000000..094c17e38e16
--- /dev/null
+++ b/arch/mips/cavium-octeon/Kconfig
@@ -0,0 +1,85 @@
1config CAVIUM_OCTEON_SPECIFIC_OPTIONS
2 bool "Enable Octeon specific options"
3 depends on CPU_CAVIUM_OCTEON
4 default "y"
5
6config CAVIUM_OCTEON_2ND_KERNEL
7 bool "Build the kernel to be used as a 2nd kernel on the same chip"
8 depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS
9 default "n"
10 help
11 This option configures this kernel to be linked at a different
12 address and use the 2nd uart for output. This allows a kernel built
13 with this option to be run at the same time as one built without this
14 option.
15
16config CAVIUM_OCTEON_HW_FIX_UNALIGNED
17 bool "Enable hardware fixups of unaligned loads and stores"
18 depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS
19 default "y"
20 help
21 Configure the Octeon hardware to automatically fix unaligned loads
22 and stores. Normally unaligned accesses are fixed using a kernel
23 exception handler. This option enables the hardware automatic fixups,
24 which requires only an extra 3 cycles. Disable this option if you
25 are running code that relies on address exceptions on unaligned
26 accesses.
27
28config CAVIUM_OCTEON_CVMSEG_SIZE
29 int "Number of L1 cache lines reserved for CVMSEG memory"
30 depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS
31 range 0 54
32 default 1
33 help
34 CVMSEG LM is a segment that accesses portions of the dcache as a
35 local memory; the larger CVMSEG is, the smaller the cache is.
36 This selects the size of CVMSEG LM, which is in cache blocks. The
37 legally range is from zero to 54 cache blocks (i.e. CVMSEG LM is
38 between zero and 6192 bytes).
39
40config CAVIUM_OCTEON_LOCK_L2
41 bool "Lock often used kernel code in the L2"
42 depends on CAVIUM_OCTEON_SPECIFIC_OPTIONS
43 default "y"
44 help
45 Enable locking parts of the kernel into the L2 cache.
46
47config CAVIUM_OCTEON_LOCK_L2_TLB
48 bool "Lock the TLB handler in L2"
49 depends on CAVIUM_OCTEON_LOCK_L2
50 default "y"
51 help
52 Lock the low level TLB fast path into L2.
53
54config CAVIUM_OCTEON_LOCK_L2_EXCEPTION
55 bool "Lock the exception handler in L2"
56 depends on CAVIUM_OCTEON_LOCK_L2
57 default "y"
58 help
59 Lock the low level exception handler into L2.
60
61config CAVIUM_OCTEON_LOCK_L2_LOW_LEVEL_INTERRUPT
62 bool "Lock the interrupt handler in L2"
63 depends on CAVIUM_OCTEON_LOCK_L2
64 default "y"
65 help
66 Lock the low level interrupt handler into L2.
67
68config CAVIUM_OCTEON_LOCK_L2_INTERRUPT
69 bool "Lock the 2nd level interrupt handler in L2"
70 depends on CAVIUM_OCTEON_LOCK_L2
71 default "y"
72 help
73 Lock the 2nd level interrupt handler in L2.
74
75config CAVIUM_OCTEON_LOCK_L2_MEMCPY
76 bool "Lock memcpy() in L2"
77 depends on CAVIUM_OCTEON_LOCK_L2
78 default "y"
79 help
80 Lock the kernel's implementation of memcpy() into L2.
81
82config ARCH_SPARSEMEM_ENABLE
83 def_bool y
84 select SPARSEMEM_STATIC
85 depends on CPU_CAVIUM_OCTEON
diff --git a/arch/mips/cavium-octeon/Makefile b/arch/mips/cavium-octeon/Makefile
new file mode 100644
index 000000000000..1c2a7faf5881
--- /dev/null
+++ b/arch/mips/cavium-octeon/Makefile
@@ -0,0 +1,16 @@
1#
2# Makefile for the Cavium Octeon specific kernel interface routines
3# under Linux.
4#
5# This file is subject to the terms and conditions of the GNU General Public
6# License. See the file "COPYING" in the main directory of this archive
7# for more details.
8#
9# Copyright (C) 2005-2008 Cavium Networks
10#
11
12obj-y := setup.o serial.o octeon-irq.o csrc-octeon.o
13obj-y += dma-octeon.o flash_setup.o
14obj-y += octeon-memcpy.o
15
16obj-$(CONFIG_SMP) += smp.o
diff --git a/arch/mips/cavium-octeon/csrc-octeon.c b/arch/mips/cavium-octeon/csrc-octeon.c
new file mode 100644
index 000000000000..70fd92c31657
--- /dev/null
+++ b/arch/mips/cavium-octeon/csrc-octeon.c
@@ -0,0 +1,58 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2007 by Ralf Baechle
7 */
8#include <linux/clocksource.h>
9#include <linux/init.h>
10
11#include <asm/time.h>
12
13#include <asm/octeon/octeon.h>
14#include <asm/octeon/cvmx-ipd-defs.h>
15
16/*
17 * Set the current core's cvmcount counter to the value of the
18 * IPD_CLK_COUNT. We do this on all cores as they are brought
19 * on-line. This allows for a read from a local cpu register to
20 * access a synchronized counter.
21 *
22 */
23void octeon_init_cvmcount(void)
24{
25 unsigned long flags;
26 unsigned loops = 2;
27
28 /* Clobber loops so GCC will not unroll the following while loop. */
29 asm("" : "+r" (loops));
30
31 local_irq_save(flags);
32 /*
33 * Loop several times so we are executing from the cache,
34 * which should give more deterministic timing.
35 */
36 while (loops--)
37 write_c0_cvmcount(cvmx_read_csr(CVMX_IPD_CLK_COUNT));
38 local_irq_restore(flags);
39}
40
41static cycle_t octeon_cvmcount_read(void)
42{
43 return read_c0_cvmcount();
44}
45
46static struct clocksource clocksource_mips = {
47 .name = "OCTEON_CVMCOUNT",
48 .read = octeon_cvmcount_read,
49 .mask = CLOCKSOURCE_MASK(64),
50 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
51};
52
53void __init plat_time_init(void)
54{
55 clocksource_mips.rating = 300;
56 clocksource_set_clock(&clocksource_mips, mips_hpt_frequency);
57 clocksource_register(&clocksource_mips);
58}
diff --git a/arch/mips/cavium-octeon/dma-octeon.c b/arch/mips/cavium-octeon/dma-octeon.c
new file mode 100644
index 000000000000..01b1ef94b361
--- /dev/null
+++ b/arch/mips/cavium-octeon/dma-octeon.c
@@ -0,0 +1,32 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2000 Ani Joshi <ajoshi@unixbox.com>
7 * Copyright (C) 2000, 2001 Ralf Baechle <ralf@gnu.org>
8 * Copyright (C) 2005 Ilya A. Volynets-Evenbakh <ilya@total-knowledge.com>
9 * swiped from i386, and cloned for MIPS by Geert, polished by Ralf.
10 * IP32 changes by Ilya.
11 * Cavium Networks: Create new dma setup for Cavium Networks Octeon based on
12 * the kernels original.
13 */
14#include <linux/types.h>
15#include <linux/mm.h>
16
17#include <dma-coherence.h>
18
19dma_addr_t octeon_map_dma_mem(struct device *dev, void *ptr, size_t size)
20{
21 /* Without PCI/PCIe this function can be called for Octeon internal
22 devices such as USB. These devices all support 64bit addressing */
23 mb();
24 return virt_to_phys(ptr);
25}
26
27void octeon_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
28{
29 /* Without PCI/PCIe this function can be called for Octeon internal
30 * devices such as USB. These devices all support 64bit addressing */
31 return;
32}
diff --git a/arch/mips/cavium-octeon/executive/Makefile b/arch/mips/cavium-octeon/executive/Makefile
new file mode 100644
index 000000000000..80d6cb26766b
--- /dev/null
+++ b/arch/mips/cavium-octeon/executive/Makefile
@@ -0,0 +1,13 @@
1#
2# Makefile for the Cavium Octeon specific kernel interface routines
3# under Linux.
4#
5# This file is subject to the terms and conditions of the GNU General Public
6# License. See the file "COPYING" in the main directory of this archive
7# for more details.
8#
9# Copyright (C) 2005-2008 Cavium Networks
10#
11
12obj-y += cvmx-bootmem.o cvmx-l2c.o cvmx-sysinfo.o octeon-model.o
13
diff --git a/arch/mips/cavium-octeon/executive/cvmx-bootmem.c b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
new file mode 100644
index 000000000000..4f5a08b37ccd
--- /dev/null
+++ b/arch/mips/cavium-octeon/executive/cvmx-bootmem.c
@@ -0,0 +1,586 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 * Simple allocate only memory allocator. Used to allocate memory at
30 * application start time.
31 */
32
33#include <linux/kernel.h>
34
35#include <asm/octeon/cvmx.h>
36#include <asm/octeon/cvmx-spinlock.h>
37#include <asm/octeon/cvmx-bootmem.h>
38
39/*#define DEBUG */
40
41
42static struct cvmx_bootmem_desc *cvmx_bootmem_desc;
43
44/* See header file for descriptions of functions */
45
46/*
47 * Wrapper functions are provided for reading/writing the size and
48 * next block values as these may not be directly addressible (in 32
49 * bit applications, for instance.) Offsets of data elements in
50 * bootmem list, must match cvmx_bootmem_block_header_t.
51 */
52#define NEXT_OFFSET 0
53#define SIZE_OFFSET 8
54
55static void cvmx_bootmem_phy_set_size(uint64_t addr, uint64_t size)
56{
57 cvmx_write64_uint64((addr + SIZE_OFFSET) | (1ull << 63), size);
58}
59
60static void cvmx_bootmem_phy_set_next(uint64_t addr, uint64_t next)
61{
62 cvmx_write64_uint64((addr + NEXT_OFFSET) | (1ull << 63), next);
63}
64
65static uint64_t cvmx_bootmem_phy_get_size(uint64_t addr)
66{
67 return cvmx_read64_uint64((addr + SIZE_OFFSET) | (1ull << 63));
68}
69
70static uint64_t cvmx_bootmem_phy_get_next(uint64_t addr)
71{
72 return cvmx_read64_uint64((addr + NEXT_OFFSET) | (1ull << 63));
73}
74
75void *cvmx_bootmem_alloc_range(uint64_t size, uint64_t alignment,
76 uint64_t min_addr, uint64_t max_addr)
77{
78 int64_t address;
79 address =
80 cvmx_bootmem_phy_alloc(size, min_addr, max_addr, alignment, 0);
81
82 if (address > 0)
83 return cvmx_phys_to_ptr(address);
84 else
85 return NULL;
86}
87
88void *cvmx_bootmem_alloc_address(uint64_t size, uint64_t address,
89 uint64_t alignment)
90{
91 return cvmx_bootmem_alloc_range(size, alignment, address,
92 address + size);
93}
94
95void *cvmx_bootmem_alloc(uint64_t size, uint64_t alignment)
96{
97 return cvmx_bootmem_alloc_range(size, alignment, 0, 0);
98}
99
100int cvmx_bootmem_free_named(char *name)
101{
102 return cvmx_bootmem_phy_named_block_free(name, 0);
103}
104
105struct cvmx_bootmem_named_block_desc *cvmx_bootmem_find_named_block(char *name)
106{
107 return cvmx_bootmem_phy_named_block_find(name, 0);
108}
109
110void cvmx_bootmem_lock(void)
111{
112 cvmx_spinlock_lock((cvmx_spinlock_t *) &(cvmx_bootmem_desc->lock));
113}
114
115void cvmx_bootmem_unlock(void)
116{
117 cvmx_spinlock_unlock((cvmx_spinlock_t *) &(cvmx_bootmem_desc->lock));
118}
119
120int cvmx_bootmem_init(void *mem_desc_ptr)
121{
122 /* Here we set the global pointer to the bootmem descriptor
123 * block. This pointer will be used directly, so we will set
124 * it up to be directly usable by the application. It is set
125 * up as follows for the various runtime/ABI combinations:
126 *
127 * Linux 64 bit: Set XKPHYS bit
128 * Linux 32 bit: use mmap to create mapping, use virtual address
129 * CVMX 64 bit: use physical address directly
130 * CVMX 32 bit: use physical address directly
131 *
132 * Note that the CVMX environment assumes the use of 1-1 TLB
133 * mappings so that the physical addresses can be used
134 * directly
135 */
136 if (!cvmx_bootmem_desc) {
137#if defined(CVMX_ABI_64)
138 /* Set XKPHYS bit */
139 cvmx_bootmem_desc = cvmx_phys_to_ptr(CAST64(mem_desc_ptr));
140#else
141 cvmx_bootmem_desc = (struct cvmx_bootmem_desc *) mem_desc_ptr;
142#endif
143 }
144
145 return 0;
146}
147
148/*
149 * The cvmx_bootmem_phy* functions below return 64 bit physical
150 * addresses, and expose more features that the cvmx_bootmem_functions
151 * above. These are required for full memory space access in 32 bit
152 * applications, as well as for using some advance features. Most
153 * applications should not need to use these.
154 */
155
156int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min,
157 uint64_t address_max, uint64_t alignment,
158 uint32_t flags)
159{
160
161 uint64_t head_addr;
162 uint64_t ent_addr;
163 /* points to previous list entry, NULL current entry is head of list */
164 uint64_t prev_addr = 0;
165 uint64_t new_ent_addr = 0;
166 uint64_t desired_min_addr;
167
168#ifdef DEBUG
169 cvmx_dprintf("cvmx_bootmem_phy_alloc: req_size: 0x%llx, "
170 "min_addr: 0x%llx, max_addr: 0x%llx, align: 0x%llx\n",
171 (unsigned long long)req_size,
172 (unsigned long long)address_min,
173 (unsigned long long)address_max,
174 (unsigned long long)alignment);
175#endif
176
177 if (cvmx_bootmem_desc->major_version > 3) {
178 cvmx_dprintf("ERROR: Incompatible bootmem descriptor "
179 "version: %d.%d at addr: %p\n",
180 (int)cvmx_bootmem_desc->major_version,
181 (int)cvmx_bootmem_desc->minor_version,
182 cvmx_bootmem_desc);
183 goto error_out;
184 }
185
186 /*
187 * Do a variety of checks to validate the arguments. The
188 * allocator code will later assume that these checks have
189 * been made. We validate that the requested constraints are
190 * not self-contradictory before we look through the list of
191 * available memory.
192 */
193
194 /* 0 is not a valid req_size for this allocator */
195 if (!req_size)
196 goto error_out;
197
198 /* Round req_size up to mult of minimum alignment bytes */
199 req_size = (req_size + (CVMX_BOOTMEM_ALIGNMENT_SIZE - 1)) &
200 ~(CVMX_BOOTMEM_ALIGNMENT_SIZE - 1);
201
202 /*
203 * Convert !0 address_min and 0 address_max to special case of
204 * range that specifies an exact memory block to allocate. Do
205 * this before other checks and adjustments so that this
206 * tranformation will be validated.
207 */
208 if (address_min && !address_max)
209 address_max = address_min + req_size;
210 else if (!address_min && !address_max)
211 address_max = ~0ull; /* If no limits given, use max limits */
212
213
214 /*
215 * Enforce minimum alignment (this also keeps the minimum free block
216 * req_size the same as the alignment req_size.
217 */
218 if (alignment < CVMX_BOOTMEM_ALIGNMENT_SIZE)
219 alignment = CVMX_BOOTMEM_ALIGNMENT_SIZE;
220
221 /*
222 * Adjust address minimum based on requested alignment (round
223 * up to meet alignment). Do this here so we can reject
224 * impossible requests up front. (NOP for address_min == 0)
225 */
226 if (alignment)
227 address_min = __ALIGN_MASK(address_min, (alignment - 1));
228
229 /*
230 * Reject inconsistent args. We have adjusted these, so this
231 * may fail due to our internal changes even if this check
232 * would pass for the values the user supplied.
233 */
234 if (req_size > address_max - address_min)
235 goto error_out;
236
237 /* Walk through the list entries - first fit found is returned */
238
239 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
240 cvmx_bootmem_lock();
241 head_addr = cvmx_bootmem_desc->head_addr;
242 ent_addr = head_addr;
243 for (; ent_addr;
244 prev_addr = ent_addr,
245 ent_addr = cvmx_bootmem_phy_get_next(ent_addr)) {
246 uint64_t usable_base, usable_max;
247 uint64_t ent_size = cvmx_bootmem_phy_get_size(ent_addr);
248
249 if (cvmx_bootmem_phy_get_next(ent_addr)
250 && ent_addr > cvmx_bootmem_phy_get_next(ent_addr)) {
251 cvmx_dprintf("Internal bootmem_alloc() error: ent: "
252 "0x%llx, next: 0x%llx\n",
253 (unsigned long long)ent_addr,
254 (unsigned long long)
255 cvmx_bootmem_phy_get_next(ent_addr));
256 goto error_out;
257 }
258
259 /*
260 * Determine if this is an entry that can satisify the
261 * request Check to make sure entry is large enough to
262 * satisfy request.
263 */
264 usable_base =
265 __ALIGN_MASK(max(address_min, ent_addr), alignment - 1);
266 usable_max = min(address_max, ent_addr + ent_size);
267 /*
268 * We should be able to allocate block at address
269 * usable_base.
270 */
271
272 desired_min_addr = usable_base;
273 /*
274 * Determine if request can be satisfied from the
275 * current entry.
276 */
277 if (!((ent_addr + ent_size) > usable_base
278 && ent_addr < address_max
279 && req_size <= usable_max - usable_base))
280 continue;
281 /*
282 * We have found an entry that has room to satisfy the
283 * request, so allocate it from this entry. If end
284 * CVMX_BOOTMEM_FLAG_END_ALLOC set, then allocate from
285 * the end of this block rather than the beginning.
286 */
287 if (flags & CVMX_BOOTMEM_FLAG_END_ALLOC) {
288 desired_min_addr = usable_max - req_size;
289 /*
290 * Align desired address down to required
291 * alignment.
292 */
293 desired_min_addr &= ~(alignment - 1);
294 }
295
296 /* Match at start of entry */
297 if (desired_min_addr == ent_addr) {
298 if (req_size < ent_size) {
299 /*
300 * big enough to create a new block
301 * from top portion of block.
302 */
303 new_ent_addr = ent_addr + req_size;
304 cvmx_bootmem_phy_set_next(new_ent_addr,
305 cvmx_bootmem_phy_get_next(ent_addr));
306 cvmx_bootmem_phy_set_size(new_ent_addr,
307 ent_size -
308 req_size);
309
310 /*
311 * Adjust next pointer as following
312 * code uses this.
313 */
314 cvmx_bootmem_phy_set_next(ent_addr,
315 new_ent_addr);
316 }
317
318 /*
319 * adjust prev ptr or head to remove this
320 * entry from list.
321 */
322 if (prev_addr)
323 cvmx_bootmem_phy_set_next(prev_addr,
324 cvmx_bootmem_phy_get_next(ent_addr));
325 else
326 /*
327 * head of list being returned, so
328 * update head ptr.
329 */
330 cvmx_bootmem_desc->head_addr =
331 cvmx_bootmem_phy_get_next(ent_addr);
332
333 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
334 cvmx_bootmem_unlock();
335 return desired_min_addr;
336 }
337 /*
338 * block returned doesn't start at beginning of entry,
339 * so we know that we will be splitting a block off
340 * the front of this one. Create a new block from the
341 * beginning, add to list, and go to top of loop
342 * again.
343 *
344 * create new block from high portion of
345 * block, so that top block starts at desired
346 * addr.
347 */
348 new_ent_addr = desired_min_addr;
349 cvmx_bootmem_phy_set_next(new_ent_addr,
350 cvmx_bootmem_phy_get_next
351 (ent_addr));
352 cvmx_bootmem_phy_set_size(new_ent_addr,
353 cvmx_bootmem_phy_get_size
354 (ent_addr) -
355 (desired_min_addr -
356 ent_addr));
357 cvmx_bootmem_phy_set_size(ent_addr,
358 desired_min_addr - ent_addr);
359 cvmx_bootmem_phy_set_next(ent_addr, new_ent_addr);
360 /* Loop again to handle actual alloc from new block */
361 }
362error_out:
363 /* We didn't find anything, so return error */
364 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
365 cvmx_bootmem_unlock();
366 return -1;
367}
368
369int __cvmx_bootmem_phy_free(uint64_t phy_addr, uint64_t size, uint32_t flags)
370{
371 uint64_t cur_addr;
372 uint64_t prev_addr = 0; /* zero is invalid */
373 int retval = 0;
374
375#ifdef DEBUG
376 cvmx_dprintf("__cvmx_bootmem_phy_free addr: 0x%llx, size: 0x%llx\n",
377 (unsigned long long)phy_addr, (unsigned long long)size);
378#endif
379 if (cvmx_bootmem_desc->major_version > 3) {
380 cvmx_dprintf("ERROR: Incompatible bootmem descriptor "
381 "version: %d.%d at addr: %p\n",
382 (int)cvmx_bootmem_desc->major_version,
383 (int)cvmx_bootmem_desc->minor_version,
384 cvmx_bootmem_desc);
385 return 0;
386 }
387
388 /* 0 is not a valid size for this allocator */
389 if (!size)
390 return 0;
391
392 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
393 cvmx_bootmem_lock();
394 cur_addr = cvmx_bootmem_desc->head_addr;
395 if (cur_addr == 0 || phy_addr < cur_addr) {
396 /* add at front of list - special case with changing head ptr */
397 if (cur_addr && phy_addr + size > cur_addr)
398 goto bootmem_free_done; /* error, overlapping section */
399 else if (phy_addr + size == cur_addr) {
400 /* Add to front of existing first block */
401 cvmx_bootmem_phy_set_next(phy_addr,
402 cvmx_bootmem_phy_get_next
403 (cur_addr));
404 cvmx_bootmem_phy_set_size(phy_addr,
405 cvmx_bootmem_phy_get_size
406 (cur_addr) + size);
407 cvmx_bootmem_desc->head_addr = phy_addr;
408
409 } else {
410 /* New block before first block. OK if cur_addr is 0 */
411 cvmx_bootmem_phy_set_next(phy_addr, cur_addr);
412 cvmx_bootmem_phy_set_size(phy_addr, size);
413 cvmx_bootmem_desc->head_addr = phy_addr;
414 }
415 retval = 1;
416 goto bootmem_free_done;
417 }
418
419 /* Find place in list to add block */
420 while (cur_addr && phy_addr > cur_addr) {
421 prev_addr = cur_addr;
422 cur_addr = cvmx_bootmem_phy_get_next(cur_addr);
423 }
424
425 if (!cur_addr) {
426 /*
427 * We have reached the end of the list, add on to end,
428 * checking to see if we need to combine with last
429 * block
430 */
431 if (prev_addr + cvmx_bootmem_phy_get_size(prev_addr) ==
432 phy_addr) {
433 cvmx_bootmem_phy_set_size(prev_addr,
434 cvmx_bootmem_phy_get_size
435 (prev_addr) + size);
436 } else {
437 cvmx_bootmem_phy_set_next(prev_addr, phy_addr);
438 cvmx_bootmem_phy_set_size(phy_addr, size);
439 cvmx_bootmem_phy_set_next(phy_addr, 0);
440 }
441 retval = 1;
442 goto bootmem_free_done;
443 } else {
444 /*
445 * insert between prev and cur nodes, checking for
446 * merge with either/both.
447 */
448 if (prev_addr + cvmx_bootmem_phy_get_size(prev_addr) ==
449 phy_addr) {
450 /* Merge with previous */
451 cvmx_bootmem_phy_set_size(prev_addr,
452 cvmx_bootmem_phy_get_size
453 (prev_addr) + size);
454 if (phy_addr + size == cur_addr) {
455 /* Also merge with current */
456 cvmx_bootmem_phy_set_size(prev_addr,
457 cvmx_bootmem_phy_get_size(cur_addr) +
458 cvmx_bootmem_phy_get_size(prev_addr));
459 cvmx_bootmem_phy_set_next(prev_addr,
460 cvmx_bootmem_phy_get_next(cur_addr));
461 }
462 retval = 1;
463 goto bootmem_free_done;
464 } else if (phy_addr + size == cur_addr) {
465 /* Merge with current */
466 cvmx_bootmem_phy_set_size(phy_addr,
467 cvmx_bootmem_phy_get_size
468 (cur_addr) + size);
469 cvmx_bootmem_phy_set_next(phy_addr,
470 cvmx_bootmem_phy_get_next
471 (cur_addr));
472 cvmx_bootmem_phy_set_next(prev_addr, phy_addr);
473 retval = 1;
474 goto bootmem_free_done;
475 }
476
477 /* It is a standalone block, add in between prev and cur */
478 cvmx_bootmem_phy_set_size(phy_addr, size);
479 cvmx_bootmem_phy_set_next(phy_addr, cur_addr);
480 cvmx_bootmem_phy_set_next(prev_addr, phy_addr);
481
482 }
483 retval = 1;
484
485bootmem_free_done:
486 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
487 cvmx_bootmem_unlock();
488 return retval;
489
490}
491
492struct cvmx_bootmem_named_block_desc *
493 cvmx_bootmem_phy_named_block_find(char *name, uint32_t flags)
494{
495 unsigned int i;
496 struct cvmx_bootmem_named_block_desc *named_block_array_ptr;
497
498#ifdef DEBUG
499 cvmx_dprintf("cvmx_bootmem_phy_named_block_find: %s\n", name);
500#endif
501 /*
502 * Lock the structure to make sure that it is not being
503 * changed while we are examining it.
504 */
505 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
506 cvmx_bootmem_lock();
507
508 /* Use XKPHYS for 64 bit linux */
509 named_block_array_ptr = (struct cvmx_bootmem_named_block_desc *)
510 cvmx_phys_to_ptr(cvmx_bootmem_desc->named_block_array_addr);
511
512#ifdef DEBUG
513 cvmx_dprintf
514 ("cvmx_bootmem_phy_named_block_find: named_block_array_ptr: %p\n",
515 named_block_array_ptr);
516#endif
517 if (cvmx_bootmem_desc->major_version == 3) {
518 for (i = 0;
519 i < cvmx_bootmem_desc->named_block_num_blocks; i++) {
520 if ((name && named_block_array_ptr[i].size
521 && !strncmp(name, named_block_array_ptr[i].name,
522 cvmx_bootmem_desc->named_block_name_len
523 - 1))
524 || (!name && !named_block_array_ptr[i].size)) {
525 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
526 cvmx_bootmem_unlock();
527
528 return &(named_block_array_ptr[i]);
529 }
530 }
531 } else {
532 cvmx_dprintf("ERROR: Incompatible bootmem descriptor "
533 "version: %d.%d at addr: %p\n",
534 (int)cvmx_bootmem_desc->major_version,
535 (int)cvmx_bootmem_desc->minor_version,
536 cvmx_bootmem_desc);
537 }
538 if (!(flags & CVMX_BOOTMEM_FLAG_NO_LOCKING))
539 cvmx_bootmem_unlock();
540
541 return NULL;
542}
543
544int cvmx_bootmem_phy_named_block_free(char *name, uint32_t flags)
545{
546 struct cvmx_bootmem_named_block_desc *named_block_ptr;
547
548 if (cvmx_bootmem_desc->major_version != 3) {
549 cvmx_dprintf("ERROR: Incompatible bootmem descriptor version: "
550 "%d.%d at addr: %p\n",
551 (int)cvmx_bootmem_desc->major_version,
552 (int)cvmx_bootmem_desc->minor_version,
553 cvmx_bootmem_desc);
554 return 0;
555 }
556#ifdef DEBUG
557 cvmx_dprintf("cvmx_bootmem_phy_named_block_free: %s\n", name);
558#endif
559
560 /*
561 * Take lock here, as name lookup/block free/name free need to
562 * be atomic.
563 */
564 cvmx_bootmem_lock();
565
566 named_block_ptr =
567 cvmx_bootmem_phy_named_block_find(name,
568 CVMX_BOOTMEM_FLAG_NO_LOCKING);
569 if (named_block_ptr) {
570#ifdef DEBUG
571 cvmx_dprintf("cvmx_bootmem_phy_named_block_free: "
572 "%s, base: 0x%llx, size: 0x%llx\n",
573 name,
574 (unsigned long long)named_block_ptr->base_addr,
575 (unsigned long long)named_block_ptr->size);
576#endif
577 __cvmx_bootmem_phy_free(named_block_ptr->base_addr,
578 named_block_ptr->size,
579 CVMX_BOOTMEM_FLAG_NO_LOCKING);
580 named_block_ptr->size = 0;
581 /* Set size to zero to indicate block not used. */
582 }
583
584 cvmx_bootmem_unlock();
585 return named_block_ptr != NULL; /* 0 on failure, 1 on success */
586}
diff --git a/arch/mips/cavium-octeon/executive/cvmx-l2c.c b/arch/mips/cavium-octeon/executive/cvmx-l2c.c
new file mode 100644
index 000000000000..6abe56f1e097
--- /dev/null
+++ b/arch/mips/cavium-octeon/executive/cvmx-l2c.c
@@ -0,0 +1,734 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 * Implementation of the Level 2 Cache (L2C) control, measurement, and
30 * debugging facilities.
31 */
32
33#include <asm/octeon/cvmx.h>
34#include <asm/octeon/cvmx-l2c.h>
35#include <asm/octeon/cvmx-spinlock.h>
36
37/*
38 * This spinlock is used internally to ensure that only one core is
39 * performing certain L2 operations at a time.
40 *
41 * NOTE: This only protects calls from within a single application -
42 * if multiple applications or operating systems are running, then it
43 * is up to the user program to coordinate between them.
44 */
45static cvmx_spinlock_t cvmx_l2c_spinlock;
46
47static inline int l2_size_half(void)
48{
49 uint64_t val = cvmx_read_csr(CVMX_L2D_FUS3);
50 return !!(val & (1ull << 34));
51}
52
53int cvmx_l2c_get_core_way_partition(uint32_t core)
54{
55 uint32_t field;
56
57 /* Validate the core number */
58 if (core >= cvmx_octeon_num_cores())
59 return -1;
60
61 /*
62 * Use the lower two bits of the coreNumber to determine the
63 * bit offset of the UMSK[] field in the L2C_SPAR register.
64 */
65 field = (core & 0x3) * 8;
66
67 /*
68 * Return the UMSK[] field from the appropriate L2C_SPAR
69 * register based on the coreNumber.
70 */
71
72 switch (core & 0xC) {
73 case 0x0:
74 return (cvmx_read_csr(CVMX_L2C_SPAR0) & (0xFF << field)) >>
75 field;
76 case 0x4:
77 return (cvmx_read_csr(CVMX_L2C_SPAR1) & (0xFF << field)) >>
78 field;
79 case 0x8:
80 return (cvmx_read_csr(CVMX_L2C_SPAR2) & (0xFF << field)) >>
81 field;
82 case 0xC:
83 return (cvmx_read_csr(CVMX_L2C_SPAR3) & (0xFF << field)) >>
84 field;
85 }
86 return 0;
87}
88
89int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask)
90{
91 uint32_t field;
92 uint32_t valid_mask;
93
94 valid_mask = (0x1 << cvmx_l2c_get_num_assoc()) - 1;
95
96 mask &= valid_mask;
97
98 /* A UMSK setting which blocks all L2C Ways is an error. */
99 if (mask == valid_mask)
100 return -1;
101
102 /* Validate the core number */
103 if (core >= cvmx_octeon_num_cores())
104 return -1;
105
106 /* Check to make sure current mask & new mask don't block all ways */
107 if (((mask | cvmx_l2c_get_core_way_partition(core)) & valid_mask) ==
108 valid_mask)
109 return -1;
110
111 /* Use the lower two bits of core to determine the bit offset of the
112 * UMSK[] field in the L2C_SPAR register.
113 */
114 field = (core & 0x3) * 8;
115
116 /* Assign the new mask setting to the UMSK[] field in the appropriate
117 * L2C_SPAR register based on the core_num.
118 *
119 */
120 switch (core & 0xC) {
121 case 0x0:
122 cvmx_write_csr(CVMX_L2C_SPAR0,
123 (cvmx_read_csr(CVMX_L2C_SPAR0) &
124 ~(0xFF << field)) | mask << field);
125 break;
126 case 0x4:
127 cvmx_write_csr(CVMX_L2C_SPAR1,
128 (cvmx_read_csr(CVMX_L2C_SPAR1) &
129 ~(0xFF << field)) | mask << field);
130 break;
131 case 0x8:
132 cvmx_write_csr(CVMX_L2C_SPAR2,
133 (cvmx_read_csr(CVMX_L2C_SPAR2) &
134 ~(0xFF << field)) | mask << field);
135 break;
136 case 0xC:
137 cvmx_write_csr(CVMX_L2C_SPAR3,
138 (cvmx_read_csr(CVMX_L2C_SPAR3) &
139 ~(0xFF << field)) | mask << field);
140 break;
141 }
142 return 0;
143}
144
145int cvmx_l2c_set_hw_way_partition(uint32_t mask)
146{
147 uint32_t valid_mask;
148
149 valid_mask = 0xff;
150
151 if (OCTEON_IS_MODEL(OCTEON_CN58XX) || OCTEON_IS_MODEL(OCTEON_CN38XX)) {
152 if (l2_size_half())
153 valid_mask = 0xf;
154 } else if (l2_size_half())
155 valid_mask = 0x3;
156
157 mask &= valid_mask;
158
159 /* A UMSK setting which blocks all L2C Ways is an error. */
160 if (mask == valid_mask)
161 return -1;
162 /* Check to make sure current mask & new mask don't block all ways */
163 if (((mask | cvmx_l2c_get_hw_way_partition()) & valid_mask) ==
164 valid_mask)
165 return -1;
166
167 cvmx_write_csr(CVMX_L2C_SPAR4,
168 (cvmx_read_csr(CVMX_L2C_SPAR4) & ~0xFF) | mask);
169 return 0;
170}
171
172int cvmx_l2c_get_hw_way_partition(void)
173{
174 return cvmx_read_csr(CVMX_L2C_SPAR4) & (0xFF);
175}
176
177void cvmx_l2c_config_perf(uint32_t counter, enum cvmx_l2c_event event,
178 uint32_t clear_on_read)
179{
180 union cvmx_l2c_pfctl pfctl;
181
182 pfctl.u64 = cvmx_read_csr(CVMX_L2C_PFCTL);
183
184 switch (counter) {
185 case 0:
186 pfctl.s.cnt0sel = event;
187 pfctl.s.cnt0ena = 1;
188 if (!cvmx_octeon_is_pass1())
189 pfctl.s.cnt0rdclr = clear_on_read;
190 break;
191 case 1:
192 pfctl.s.cnt1sel = event;
193 pfctl.s.cnt1ena = 1;
194 if (!cvmx_octeon_is_pass1())
195 pfctl.s.cnt1rdclr = clear_on_read;
196 break;
197 case 2:
198 pfctl.s.cnt2sel = event;
199 pfctl.s.cnt2ena = 1;
200 if (!cvmx_octeon_is_pass1())
201 pfctl.s.cnt2rdclr = clear_on_read;
202 break;
203 case 3:
204 default:
205 pfctl.s.cnt3sel = event;
206 pfctl.s.cnt3ena = 1;
207 if (!cvmx_octeon_is_pass1())
208 pfctl.s.cnt3rdclr = clear_on_read;
209 break;
210 }
211
212 cvmx_write_csr(CVMX_L2C_PFCTL, pfctl.u64);
213}
214
215uint64_t cvmx_l2c_read_perf(uint32_t counter)
216{
217 switch (counter) {
218 case 0:
219 return cvmx_read_csr(CVMX_L2C_PFC0);
220 case 1:
221 return cvmx_read_csr(CVMX_L2C_PFC1);
222 case 2:
223 return cvmx_read_csr(CVMX_L2C_PFC2);
224 case 3:
225 default:
226 return cvmx_read_csr(CVMX_L2C_PFC3);
227 }
228}
229
230/**
231 * @INTERNAL
232 * Helper function use to fault in cache lines for L2 cache locking
233 *
234 * @addr: Address of base of memory region to read into L2 cache
235 * @len: Length (in bytes) of region to fault in
236 */
237static void fault_in(uint64_t addr, int len)
238{
239 volatile char *ptr;
240 volatile char dummy;
241 /*
242 * Adjust addr and length so we get all cache lines even for
243 * small ranges spanning two cache lines
244 */
245 len += addr & CVMX_CACHE_LINE_MASK;
246 addr &= ~CVMX_CACHE_LINE_MASK;
247 ptr = (volatile char *)cvmx_phys_to_ptr(addr);
248 /*
249 * Invalidate L1 cache to make sure all loads result in data
250 * being in L2.
251 */
252 CVMX_DCACHE_INVALIDATE;
253 while (len > 0) {
254 dummy += *ptr;
255 len -= CVMX_CACHE_LINE_SIZE;
256 ptr += CVMX_CACHE_LINE_SIZE;
257 }
258}
259
260int cvmx_l2c_lock_line(uint64_t addr)
261{
262 int retval = 0;
263 union cvmx_l2c_dbg l2cdbg;
264 union cvmx_l2c_lckbase lckbase;
265 union cvmx_l2c_lckoff lckoff;
266 union cvmx_l2t_err l2t_err;
267 l2cdbg.u64 = 0;
268 lckbase.u64 = 0;
269 lckoff.u64 = 0;
270
271 cvmx_spinlock_lock(&cvmx_l2c_spinlock);
272
273 /* Clear l2t error bits if set */
274 l2t_err.u64 = cvmx_read_csr(CVMX_L2T_ERR);
275 l2t_err.s.lckerr = 1;
276 l2t_err.s.lckerr2 = 1;
277 cvmx_write_csr(CVMX_L2T_ERR, l2t_err.u64);
278
279 addr &= ~CVMX_CACHE_LINE_MASK;
280
281 /* Set this core as debug core */
282 l2cdbg.s.ppnum = cvmx_get_core_num();
283 CVMX_SYNC;
284 cvmx_write_csr(CVMX_L2C_DBG, l2cdbg.u64);
285 cvmx_read_csr(CVMX_L2C_DBG);
286
287 lckoff.s.lck_offset = 0; /* Only lock 1 line at a time */
288 cvmx_write_csr(CVMX_L2C_LCKOFF, lckoff.u64);
289 cvmx_read_csr(CVMX_L2C_LCKOFF);
290
291 if (((union cvmx_l2c_cfg) (cvmx_read_csr(CVMX_L2C_CFG))).s.idxalias) {
292 int alias_shift =
293 CVMX_L2C_IDX_ADDR_SHIFT + 2 * CVMX_L2_SET_BITS - 1;
294 uint64_t addr_tmp =
295 addr ^ (addr & ((1 << alias_shift) - 1)) >>
296 CVMX_L2_SET_BITS;
297 lckbase.s.lck_base = addr_tmp >> 7;
298 } else {
299 lckbase.s.lck_base = addr >> 7;
300 }
301
302 lckbase.s.lck_ena = 1;
303 cvmx_write_csr(CVMX_L2C_LCKBASE, lckbase.u64);
304 cvmx_read_csr(CVMX_L2C_LCKBASE); /* Make sure it gets there */
305
306 fault_in(addr, CVMX_CACHE_LINE_SIZE);
307
308 lckbase.s.lck_ena = 0;
309 cvmx_write_csr(CVMX_L2C_LCKBASE, lckbase.u64);
310 cvmx_read_csr(CVMX_L2C_LCKBASE); /* Make sure it gets there */
311
312 /* Stop being debug core */
313 cvmx_write_csr(CVMX_L2C_DBG, 0);
314 cvmx_read_csr(CVMX_L2C_DBG);
315
316 l2t_err.u64 = cvmx_read_csr(CVMX_L2T_ERR);
317 if (l2t_err.s.lckerr || l2t_err.s.lckerr2)
318 retval = 1; /* We were unable to lock the line */
319
320 cvmx_spinlock_unlock(&cvmx_l2c_spinlock);
321
322 return retval;
323}
324
325int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len)
326{
327 int retval = 0;
328
329 /* Round start/end to cache line boundaries */
330 len += start & CVMX_CACHE_LINE_MASK;
331 start &= ~CVMX_CACHE_LINE_MASK;
332 len = (len + CVMX_CACHE_LINE_MASK) & ~CVMX_CACHE_LINE_MASK;
333
334 while (len) {
335 retval += cvmx_l2c_lock_line(start);
336 start += CVMX_CACHE_LINE_SIZE;
337 len -= CVMX_CACHE_LINE_SIZE;
338 }
339
340 return retval;
341}
342
343void cvmx_l2c_flush(void)
344{
345 uint64_t assoc, set;
346 uint64_t n_assoc, n_set;
347 union cvmx_l2c_dbg l2cdbg;
348
349 cvmx_spinlock_lock(&cvmx_l2c_spinlock);
350
351 l2cdbg.u64 = 0;
352 if (!OCTEON_IS_MODEL(OCTEON_CN30XX))
353 l2cdbg.s.ppnum = cvmx_get_core_num();
354 l2cdbg.s.finv = 1;
355 n_set = CVMX_L2_SETS;
356 n_assoc = l2_size_half() ? (CVMX_L2_ASSOC / 2) : CVMX_L2_ASSOC;
357 for (set = 0; set < n_set; set++) {
358 for (assoc = 0; assoc < n_assoc; assoc++) {
359 l2cdbg.s.set = assoc;
360 /* Enter debug mode, and make sure all other
361 ** writes complete before we enter debug
362 ** mode */
363 CVMX_SYNCW;
364 cvmx_write_csr(CVMX_L2C_DBG, l2cdbg.u64);
365 cvmx_read_csr(CVMX_L2C_DBG);
366
367 CVMX_PREPARE_FOR_STORE(CVMX_ADD_SEG
368 (CVMX_MIPS_SPACE_XKPHYS,
369 set * CVMX_CACHE_LINE_SIZE), 0);
370 CVMX_SYNCW; /* Push STF out to L2 */
371 /* Exit debug mode */
372 CVMX_SYNC;
373 cvmx_write_csr(CVMX_L2C_DBG, 0);
374 cvmx_read_csr(CVMX_L2C_DBG);
375 }
376 }
377
378 cvmx_spinlock_unlock(&cvmx_l2c_spinlock);
379}
380
381int cvmx_l2c_unlock_line(uint64_t address)
382{
383 int assoc;
384 union cvmx_l2c_tag tag;
385 union cvmx_l2c_dbg l2cdbg;
386 uint32_t tag_addr;
387
388 uint32_t index = cvmx_l2c_address_to_index(address);
389
390 cvmx_spinlock_lock(&cvmx_l2c_spinlock);
391 /* Compute portion of address that is stored in tag */
392 tag_addr =
393 ((address >> CVMX_L2C_TAG_ADDR_ALIAS_SHIFT) &
394 ((1 << CVMX_L2C_TAG_ADDR_ALIAS_SHIFT) - 1));
395 for (assoc = 0; assoc < CVMX_L2_ASSOC; assoc++) {
396 tag = cvmx_get_l2c_tag(assoc, index);
397
398 if (tag.s.V && (tag.s.addr == tag_addr)) {
399 l2cdbg.u64 = 0;
400 l2cdbg.s.ppnum = cvmx_get_core_num();
401 l2cdbg.s.set = assoc;
402 l2cdbg.s.finv = 1;
403
404 CVMX_SYNC;
405 /* Enter debug mode */
406 cvmx_write_csr(CVMX_L2C_DBG, l2cdbg.u64);
407 cvmx_read_csr(CVMX_L2C_DBG);
408
409 CVMX_PREPARE_FOR_STORE(CVMX_ADD_SEG
410 (CVMX_MIPS_SPACE_XKPHYS,
411 address), 0);
412 CVMX_SYNC;
413 /* Exit debug mode */
414 cvmx_write_csr(CVMX_L2C_DBG, 0);
415 cvmx_read_csr(CVMX_L2C_DBG);
416 cvmx_spinlock_unlock(&cvmx_l2c_spinlock);
417 return tag.s.L;
418 }
419 }
420 cvmx_spinlock_unlock(&cvmx_l2c_spinlock);
421 return 0;
422}
423
424int cvmx_l2c_unlock_mem_region(uint64_t start, uint64_t len)
425{
426 int num_unlocked = 0;
427 /* Round start/end to cache line boundaries */
428 len += start & CVMX_CACHE_LINE_MASK;
429 start &= ~CVMX_CACHE_LINE_MASK;
430 len = (len + CVMX_CACHE_LINE_MASK) & ~CVMX_CACHE_LINE_MASK;
431 while (len > 0) {
432 num_unlocked += cvmx_l2c_unlock_line(start);
433 start += CVMX_CACHE_LINE_SIZE;
434 len -= CVMX_CACHE_LINE_SIZE;
435 }
436
437 return num_unlocked;
438}
439
440/*
441 * Internal l2c tag types. These are converted to a generic structure
442 * that can be used on all chips.
443 */
444union __cvmx_l2c_tag {
445 uint64_t u64;
446 struct cvmx_l2c_tag_cn50xx {
447 uint64_t reserved:40;
448 uint64_t V:1; /* Line valid */
449 uint64_t D:1; /* Line dirty */
450 uint64_t L:1; /* Line locked */
451 uint64_t U:1; /* Use, LRU eviction */
452 uint64_t addr:20; /* Phys mem addr (33..14) */
453 } cn50xx;
454 struct cvmx_l2c_tag_cn30xx {
455 uint64_t reserved:41;
456 uint64_t V:1; /* Line valid */
457 uint64_t D:1; /* Line dirty */
458 uint64_t L:1; /* Line locked */
459 uint64_t U:1; /* Use, LRU eviction */
460 uint64_t addr:19; /* Phys mem addr (33..15) */
461 } cn30xx;
462 struct cvmx_l2c_tag_cn31xx {
463 uint64_t reserved:42;
464 uint64_t V:1; /* Line valid */
465 uint64_t D:1; /* Line dirty */
466 uint64_t L:1; /* Line locked */
467 uint64_t U:1; /* Use, LRU eviction */
468 uint64_t addr:18; /* Phys mem addr (33..16) */
469 } cn31xx;
470 struct cvmx_l2c_tag_cn38xx {
471 uint64_t reserved:43;
472 uint64_t V:1; /* Line valid */
473 uint64_t D:1; /* Line dirty */
474 uint64_t L:1; /* Line locked */
475 uint64_t U:1; /* Use, LRU eviction */
476 uint64_t addr:17; /* Phys mem addr (33..17) */
477 } cn38xx;
478 struct cvmx_l2c_tag_cn58xx {
479 uint64_t reserved:44;
480 uint64_t V:1; /* Line valid */
481 uint64_t D:1; /* Line dirty */
482 uint64_t L:1; /* Line locked */
483 uint64_t U:1; /* Use, LRU eviction */
484 uint64_t addr:16; /* Phys mem addr (33..18) */
485 } cn58xx;
486 struct cvmx_l2c_tag_cn58xx cn56xx; /* 2048 sets */
487 struct cvmx_l2c_tag_cn31xx cn52xx; /* 512 sets */
488};
489
490/**
491 * @INTERNAL
492 * Function to read a L2C tag. This code make the current core
493 * the 'debug core' for the L2. This code must only be executed by
494 * 1 core at a time.
495 *
496 * @assoc: Association (way) of the tag to dump
497 * @index: Index of the cacheline
498 *
499 * Returns The Octeon model specific tag structure. This is
500 * translated by a wrapper function to a generic form that is
501 * easier for applications to use.
502 */
503static union __cvmx_l2c_tag __read_l2_tag(uint64_t assoc, uint64_t index)
504{
505
506 uint64_t debug_tag_addr = (((1ULL << 63) | (index << 7)) + 96);
507 uint64_t core = cvmx_get_core_num();
508 union __cvmx_l2c_tag tag_val;
509 uint64_t dbg_addr = CVMX_L2C_DBG;
510 unsigned long flags;
511
512 union cvmx_l2c_dbg debug_val;
513 debug_val.u64 = 0;
514 /*
515 * For low core count parts, the core number is always small enough
516 * to stay in the correct field and not set any reserved bits.
517 */
518 debug_val.s.ppnum = core;
519 debug_val.s.l2t = 1;
520 debug_val.s.set = assoc;
521 /*
522 * Make sure core is quiet (no prefetches, etc.) before
523 * entering debug mode.
524 */
525 CVMX_SYNC;
526 /* Flush L1 to make sure debug load misses L1 */
527 CVMX_DCACHE_INVALIDATE;
528
529 local_irq_save(flags);
530
531 /*
532 * The following must be done in assembly as when in debug
533 * mode all data loads from L2 return special debug data, not
534 * normal memory contents. Also, interrupts must be
535 * disabled, since if an interrupt occurs while in debug mode
536 * the ISR will get debug data from all its memory reads
537 * instead of the contents of memory
538 */
539
540 asm volatile (".set push \n"
541 " .set mips64 \n"
542 " .set noreorder \n"
543 /* Enter debug mode, wait for store */
544 " sd %[dbg_val], 0(%[dbg_addr]) \n"
545 " ld $0, 0(%[dbg_addr]) \n"
546 /* Read L2C tag data */
547 " ld %[tag_val], 0(%[tag_addr]) \n"
548 /* Exit debug mode, wait for store */
549 " sd $0, 0(%[dbg_addr]) \n"
550 " ld $0, 0(%[dbg_addr]) \n"
551 /* Invalidate dcache to discard debug data */
552 " cache 9, 0($0) \n"
553 " .set pop" :
554 [tag_val] "=r"(tag_val.u64) : [dbg_addr] "r"(dbg_addr),
555 [dbg_val] "r"(debug_val.u64),
556 [tag_addr] "r"(debug_tag_addr) : "memory");
557
558 local_irq_restore(flags);
559 return tag_val;
560
561}
562
563union cvmx_l2c_tag cvmx_l2c_get_tag(uint32_t association, uint32_t index)
564{
565 union __cvmx_l2c_tag tmp_tag;
566 union cvmx_l2c_tag tag;
567 tag.u64 = 0;
568
569 if ((int)association >= cvmx_l2c_get_num_assoc()) {
570 cvmx_dprintf
571 ("ERROR: cvmx_get_l2c_tag association out of range\n");
572 return tag;
573 }
574 if ((int)index >= cvmx_l2c_get_num_sets()) {
575 cvmx_dprintf("ERROR: cvmx_get_l2c_tag "
576 "index out of range (arg: %d, max: %d\n",
577 index, cvmx_l2c_get_num_sets());
578 return tag;
579 }
580 /* __read_l2_tag is intended for internal use only */
581 tmp_tag = __read_l2_tag(association, index);
582
583 /*
584 * Convert all tag structure types to generic version, as it
585 * can represent all models.
586 */
587 if (OCTEON_IS_MODEL(OCTEON_CN58XX) || OCTEON_IS_MODEL(OCTEON_CN56XX)) {
588 tag.s.V = tmp_tag.cn58xx.V;
589 tag.s.D = tmp_tag.cn58xx.D;
590 tag.s.L = tmp_tag.cn58xx.L;
591 tag.s.U = tmp_tag.cn58xx.U;
592 tag.s.addr = tmp_tag.cn58xx.addr;
593 } else if (OCTEON_IS_MODEL(OCTEON_CN38XX)) {
594 tag.s.V = tmp_tag.cn38xx.V;
595 tag.s.D = tmp_tag.cn38xx.D;
596 tag.s.L = tmp_tag.cn38xx.L;
597 tag.s.U = tmp_tag.cn38xx.U;
598 tag.s.addr = tmp_tag.cn38xx.addr;
599 } else if (OCTEON_IS_MODEL(OCTEON_CN31XX)
600 || OCTEON_IS_MODEL(OCTEON_CN52XX)) {
601 tag.s.V = tmp_tag.cn31xx.V;
602 tag.s.D = tmp_tag.cn31xx.D;
603 tag.s.L = tmp_tag.cn31xx.L;
604 tag.s.U = tmp_tag.cn31xx.U;
605 tag.s.addr = tmp_tag.cn31xx.addr;
606 } else if (OCTEON_IS_MODEL(OCTEON_CN30XX)) {
607 tag.s.V = tmp_tag.cn30xx.V;
608 tag.s.D = tmp_tag.cn30xx.D;
609 tag.s.L = tmp_tag.cn30xx.L;
610 tag.s.U = tmp_tag.cn30xx.U;
611 tag.s.addr = tmp_tag.cn30xx.addr;
612 } else if (OCTEON_IS_MODEL(OCTEON_CN50XX)) {
613 tag.s.V = tmp_tag.cn50xx.V;
614 tag.s.D = tmp_tag.cn50xx.D;
615 tag.s.L = tmp_tag.cn50xx.L;
616 tag.s.U = tmp_tag.cn50xx.U;
617 tag.s.addr = tmp_tag.cn50xx.addr;
618 } else {
619 cvmx_dprintf("Unsupported OCTEON Model in %s\n", __func__);
620 }
621
622 return tag;
623}
624
625uint32_t cvmx_l2c_address_to_index(uint64_t addr)
626{
627 uint64_t idx = addr >> CVMX_L2C_IDX_ADDR_SHIFT;
628 union cvmx_l2c_cfg l2c_cfg;
629 l2c_cfg.u64 = cvmx_read_csr(CVMX_L2C_CFG);
630
631 if (l2c_cfg.s.idxalias) {
632 idx ^=
633 ((addr & CVMX_L2C_ALIAS_MASK) >>
634 CVMX_L2C_TAG_ADDR_ALIAS_SHIFT);
635 }
636 idx &= CVMX_L2C_IDX_MASK;
637 return idx;
638}
639
640int cvmx_l2c_get_cache_size_bytes(void)
641{
642 return cvmx_l2c_get_num_sets() * cvmx_l2c_get_num_assoc() *
643 CVMX_CACHE_LINE_SIZE;
644}
645
646/**
647 * Return log base 2 of the number of sets in the L2 cache
648 * Returns
649 */
650int cvmx_l2c_get_set_bits(void)
651{
652 int l2_set_bits;
653 if (OCTEON_IS_MODEL(OCTEON_CN56XX) || OCTEON_IS_MODEL(OCTEON_CN58XX))
654 l2_set_bits = 11; /* 2048 sets */
655 else if (OCTEON_IS_MODEL(OCTEON_CN38XX))
656 l2_set_bits = 10; /* 1024 sets */
657 else if (OCTEON_IS_MODEL(OCTEON_CN31XX)
658 || OCTEON_IS_MODEL(OCTEON_CN52XX))
659 l2_set_bits = 9; /* 512 sets */
660 else if (OCTEON_IS_MODEL(OCTEON_CN30XX))
661 l2_set_bits = 8; /* 256 sets */
662 else if (OCTEON_IS_MODEL(OCTEON_CN50XX))
663 l2_set_bits = 7; /* 128 sets */
664 else {
665 cvmx_dprintf("Unsupported OCTEON Model in %s\n", __func__);
666 l2_set_bits = 11; /* 2048 sets */
667 }
668 return l2_set_bits;
669
670}
671
672/* Return the number of sets in the L2 Cache */
673int cvmx_l2c_get_num_sets(void)
674{
675 return 1 << cvmx_l2c_get_set_bits();
676}
677
678/* Return the number of associations in the L2 Cache */
679int cvmx_l2c_get_num_assoc(void)
680{
681 int l2_assoc;
682 if (OCTEON_IS_MODEL(OCTEON_CN56XX) ||
683 OCTEON_IS_MODEL(OCTEON_CN52XX) ||
684 OCTEON_IS_MODEL(OCTEON_CN58XX) ||
685 OCTEON_IS_MODEL(OCTEON_CN50XX) || OCTEON_IS_MODEL(OCTEON_CN38XX))
686 l2_assoc = 8;
687 else if (OCTEON_IS_MODEL(OCTEON_CN31XX) ||
688 OCTEON_IS_MODEL(OCTEON_CN30XX))
689 l2_assoc = 4;
690 else {
691 cvmx_dprintf("Unsupported OCTEON Model in %s\n", __func__);
692 l2_assoc = 8;
693 }
694
695 /* Check to see if part of the cache is disabled */
696 if (cvmx_fuse_read(265))
697 l2_assoc = l2_assoc >> 2;
698 else if (cvmx_fuse_read(264))
699 l2_assoc = l2_assoc >> 1;
700
701 return l2_assoc;
702}
703
704/**
705 * Flush a line from the L2 cache
706 * This should only be called from one core at a time, as this routine
707 * sets the core to the 'debug' core in order to flush the line.
708 *
709 * @assoc: Association (or way) to flush
710 * @index: Index to flush
711 */
712void cvmx_l2c_flush_line(uint32_t assoc, uint32_t index)
713{
714 union cvmx_l2c_dbg l2cdbg;
715
716 l2cdbg.u64 = 0;
717 l2cdbg.s.ppnum = cvmx_get_core_num();
718 l2cdbg.s.finv = 1;
719
720 l2cdbg.s.set = assoc;
721 /*
722 * Enter debug mode, and make sure all other writes complete
723 * before we enter debug mode.
724 */
725 asm volatile ("sync" : : : "memory");
726 cvmx_write_csr(CVMX_L2C_DBG, l2cdbg.u64);
727 cvmx_read_csr(CVMX_L2C_DBG);
728
729 CVMX_PREPARE_FOR_STORE(((1ULL << 63) + (index) * 128), 0);
730 /* Exit debug mode */
731 asm volatile ("sync" : : : "memory");
732 cvmx_write_csr(CVMX_L2C_DBG, 0);
733 cvmx_read_csr(CVMX_L2C_DBG);
734}
diff --git a/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c b/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c
new file mode 100644
index 000000000000..4812370706a1
--- /dev/null
+++ b/arch/mips/cavium-octeon/executive/cvmx-sysinfo.c
@@ -0,0 +1,116 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 * This module provides system/board/application information obtained
30 * by the bootloader.
31 */
32
33#include <asm/octeon/cvmx.h>
34#include <asm/octeon/cvmx-spinlock.h>
35#include <asm/octeon/cvmx-sysinfo.h>
36
37/**
38 * This structure defines the private state maintained by sysinfo module.
39 *
40 */
41static struct {
42 struct cvmx_sysinfo sysinfo; /* system information */
43 cvmx_spinlock_t lock; /* mutex spinlock */
44
45} state = {
46 .lock = CVMX_SPINLOCK_UNLOCKED_INITIALIZER
47};
48
49
50/*
51 * Global variables that define the min/max of the memory region set
52 * up for 32 bit userspace access.
53 */
54uint64_t linux_mem32_min;
55uint64_t linux_mem32_max;
56uint64_t linux_mem32_wired;
57uint64_t linux_mem32_offset;
58
59/**
60 * This function returns the application information as obtained
61 * by the bootloader. This provides the core mask of the cores
62 * running the same application image, as well as the physical
63 * memory regions available to the core.
64 *
65 * Returns Pointer to the boot information structure
66 *
67 */
68struct cvmx_sysinfo *cvmx_sysinfo_get(void)
69{
70 return &(state.sysinfo);
71}
72
73/**
74 * This function is used in non-simple executive environments (such as
75 * Linux kernel, u-boot, etc.) to configure the minimal fields that
76 * are required to use simple executive files directly.
77 *
78 * Locking (if required) must be handled outside of this
79 * function
80 *
81 * @phy_mem_desc_ptr:
82 * Pointer to global physical memory descriptor
83 * (bootmem descriptor) @board_type: Octeon board
84 * type enumeration
85 *
86 * @board_rev_major:
87 * Board major revision
88 * @board_rev_minor:
89 * Board minor revision
90 * @cpu_clock_hz:
91 * CPU clock freqency in hertz
92 *
93 * Returns 0: Failure
94 * 1: success
95 */
96int cvmx_sysinfo_minimal_initialize(void *phy_mem_desc_ptr,
97 uint16_t board_type,
98 uint8_t board_rev_major,
99 uint8_t board_rev_minor,
100 uint32_t cpu_clock_hz)
101{
102
103 /* The sysinfo structure was already initialized */
104 if (state.sysinfo.board_type)
105 return 0;
106
107 memset(&(state.sysinfo), 0x0, sizeof(state.sysinfo));
108 state.sysinfo.phy_mem_desc_ptr = phy_mem_desc_ptr;
109 state.sysinfo.board_type = board_type;
110 state.sysinfo.board_rev_major = board_rev_major;
111 state.sysinfo.board_rev_minor = board_rev_minor;
112 state.sysinfo.cpu_clock_hz = cpu_clock_hz;
113
114 return 1;
115}
116
diff --git a/arch/mips/cavium-octeon/executive/octeon-model.c b/arch/mips/cavium-octeon/executive/octeon-model.c
new file mode 100644
index 000000000000..9afc3794ed1b
--- /dev/null
+++ b/arch/mips/cavium-octeon/executive/octeon-model.c
@@ -0,0 +1,358 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 * File defining functions for working with different Octeon
30 * models.
31 */
32#include <asm/octeon/octeon.h>
33
34/**
35 * Given the chip processor ID from COP0, this function returns a
36 * string representing the chip model number. The string is of the
37 * form CNXXXXpX.X-FREQ-SUFFIX.
38 * - XXXX = The chip model number
39 * - X.X = Chip pass number
40 * - FREQ = Current frequency in Mhz
41 * - SUFFIX = NSP, EXP, SCP, SSP, or CP
42 *
43 * @chip_id: Chip ID
44 *
45 * Returns Model string
46 */
47const char *octeon_model_get_string(uint32_t chip_id)
48{
49 static char buffer[32];
50 return octeon_model_get_string_buffer(chip_id, buffer);
51}
52
53/*
54 * Version of octeon_model_get_string() that takes buffer as argument,
55 * as running early in u-boot static/global variables don't work when
56 * running from flash.
57 */
58const char *octeon_model_get_string_buffer(uint32_t chip_id, char *buffer)
59{
60 const char *family;
61 const char *core_model;
62 char pass[4];
63 int clock_mhz;
64 const char *suffix;
65 union cvmx_l2d_fus3 fus3;
66 int num_cores;
67 union cvmx_mio_fus_dat2 fus_dat2;
68 union cvmx_mio_fus_dat3 fus_dat3;
69 char fuse_model[10];
70 uint32_t fuse_data = 0;
71
72 fus3.u64 = cvmx_read_csr(CVMX_L2D_FUS3);
73 fus_dat2.u64 = cvmx_read_csr(CVMX_MIO_FUS_DAT2);
74 fus_dat3.u64 = cvmx_read_csr(CVMX_MIO_FUS_DAT3);
75
76 num_cores = cvmx_octeon_num_cores();
77
78 /* Make sure the non existant devices look disabled */
79 switch ((chip_id >> 8) & 0xff) {
80 case 6: /* CN50XX */
81 case 2: /* CN30XX */
82 fus_dat3.s.nodfa_dte = 1;
83 fus_dat3.s.nozip = 1;
84 break;
85 case 4: /* CN57XX or CN56XX */
86 fus_dat3.s.nodfa_dte = 1;
87 break;
88 default:
89 break;
90 }
91
92 /* Make a guess at the suffix */
93 /* NSP = everything */
94 /* EXP = No crypto */
95 /* SCP = No DFA, No zip */
96 /* CP = No DFA, No crypto, No zip */
97 if (fus_dat3.s.nodfa_dte) {
98 if (fus_dat2.s.nocrypto)
99 suffix = "CP";
100 else
101 suffix = "SCP";
102 } else if (fus_dat2.s.nocrypto)
103 suffix = "EXP";
104 else
105 suffix = "NSP";
106
107 /*
108 * Assume pass number is encoded using <5:3><2:0>. Exceptions
109 * will be fixed later.
110 */
111 sprintf(pass, "%u.%u", ((chip_id >> 3) & 7) + 1, chip_id & 7);
112
113 /*
114 * Use the number of cores to determine the last 2 digits of
115 * the model number. There are some exceptions that are fixed
116 * later.
117 */
118 switch (num_cores) {
119 case 16:
120 core_model = "60";
121 break;
122 case 15:
123 core_model = "58";
124 break;
125 case 14:
126 core_model = "55";
127 break;
128 case 13:
129 core_model = "52";
130 break;
131 case 12:
132 core_model = "50";
133 break;
134 case 11:
135 core_model = "48";
136 break;
137 case 10:
138 core_model = "45";
139 break;
140 case 9:
141 core_model = "42";
142 break;
143 case 8:
144 core_model = "40";
145 break;
146 case 7:
147 core_model = "38";
148 break;
149 case 6:
150 core_model = "34";
151 break;
152 case 5:
153 core_model = "32";
154 break;
155 case 4:
156 core_model = "30";
157 break;
158 case 3:
159 core_model = "25";
160 break;
161 case 2:
162 core_model = "20";
163 break;
164 case 1:
165 core_model = "10";
166 break;
167 default:
168 core_model = "XX";
169 break;
170 }
171
172 /* Now figure out the family, the first two digits */
173 switch ((chip_id >> 8) & 0xff) {
174 case 0: /* CN38XX, CN37XX or CN36XX */
175 if (fus3.cn38xx.crip_512k) {
176 /*
177 * For some unknown reason, the 16 core one is
178 * called 37 instead of 36.
179 */
180 if (num_cores >= 16)
181 family = "37";
182 else
183 family = "36";
184 } else
185 family = "38";
186 /*
187 * This series of chips didn't follow the standard
188 * pass numbering.
189 */
190 switch (chip_id & 0xf) {
191 case 0:
192 strcpy(pass, "1.X");
193 break;
194 case 1:
195 strcpy(pass, "2.X");
196 break;
197 case 3:
198 strcpy(pass, "3.X");
199 break;
200 default:
201 strcpy(pass, "X.X");
202 break;
203 }
204 break;
205 case 1: /* CN31XX or CN3020 */
206 if ((chip_id & 0x10) || fus3.cn31xx.crip_128k)
207 family = "30";
208 else
209 family = "31";
210 /*
211 * This series of chips didn't follow the standard
212 * pass numbering.
213 */
214 switch (chip_id & 0xf) {
215 case 0:
216 strcpy(pass, "1.0");
217 break;
218 case 2:
219 strcpy(pass, "1.1");
220 break;
221 default:
222 strcpy(pass, "X.X");
223 break;
224 }
225 break;
226 case 2: /* CN3010 or CN3005 */
227 family = "30";
228 /* A chip with half cache is an 05 */
229 if (fus3.cn30xx.crip_64k)
230 core_model = "05";
231 /*
232 * This series of chips didn't follow the standard
233 * pass numbering.
234 */
235 switch (chip_id & 0xf) {
236 case 0:
237 strcpy(pass, "1.0");
238 break;
239 case 2:
240 strcpy(pass, "1.1");
241 break;
242 default:
243 strcpy(pass, "X.X");
244 break;
245 }
246 break;
247 case 3: /* CN58XX */
248 family = "58";
249 /* Special case. 4 core, no crypto */
250 if ((num_cores == 4) && fus_dat2.cn38xx.nocrypto)
251 core_model = "29";
252
253 /* Pass 1 uses different encodings for pass numbers */
254 if ((chip_id & 0xFF) < 0x8) {
255 switch (chip_id & 0x3) {
256 case 0:
257 strcpy(pass, "1.0");
258 break;
259 case 1:
260 strcpy(pass, "1.1");
261 break;
262 case 3:
263 strcpy(pass, "1.2");
264 break;
265 default:
266 strcpy(pass, "1.X");
267 break;
268 }
269 }
270 break;
271 case 4: /* CN57XX, CN56XX, CN55XX, CN54XX */
272 if (fus_dat2.cn56xx.raid_en) {
273 if (fus3.cn56xx.crip_1024k)
274 family = "55";
275 else
276 family = "57";
277 if (fus_dat2.cn56xx.nocrypto)
278 suffix = "SP";
279 else
280 suffix = "SSP";
281 } else {
282 if (fus_dat2.cn56xx.nocrypto)
283 suffix = "CP";
284 else {
285 suffix = "NSP";
286 if (fus_dat3.s.nozip)
287 suffix = "SCP";
288 }
289 if (fus3.cn56xx.crip_1024k)
290 family = "54";
291 else
292 family = "56";
293 }
294 break;
295 case 6: /* CN50XX */
296 family = "50";
297 break;
298 case 7: /* CN52XX */
299 if (fus3.cn52xx.crip_256k)
300 family = "51";
301 else
302 family = "52";
303 break;
304 default:
305 family = "XX";
306 core_model = "XX";
307 strcpy(pass, "X.X");
308 suffix = "XXX";
309 break;
310 }
311
312 clock_mhz = octeon_get_clock_rate() / 1000000;
313
314 if (family[0] != '3') {
315 /* Check for model in fuses, overrides normal decode */
316 /* This is _not_ valid for Octeon CN3XXX models */
317 fuse_data |= cvmx_fuse_read_byte(51);
318 fuse_data = fuse_data << 8;
319 fuse_data |= cvmx_fuse_read_byte(50);
320 fuse_data = fuse_data << 8;
321 fuse_data |= cvmx_fuse_read_byte(49);
322 fuse_data = fuse_data << 8;
323 fuse_data |= cvmx_fuse_read_byte(48);
324 if (fuse_data & 0x7ffff) {
325 int model = fuse_data & 0x3fff;
326 int suffix = (fuse_data >> 14) & 0x1f;
327 if (suffix && model) {
328 /*
329 * Have both number and suffix in
330 * fuses, so both
331 */
332 sprintf(fuse_model, "%d%c",
333 model, 'A' + suffix - 1);
334 core_model = "";
335 family = fuse_model;
336 } else if (suffix && !model) {
337 /*
338 * Only have suffix, so add suffix to
339 * 'normal' model number.
340 */
341 sprintf(fuse_model, "%s%c", core_model,
342 'A' + suffix - 1);
343 core_model = fuse_model;
344 } else {
345 /*
346 * Don't have suffix, so just use
347 * model from fuses.
348 */
349 sprintf(fuse_model, "%d", model);
350 core_model = "";
351 family = fuse_model;
352 }
353 }
354 }
355 sprintf(buffer, "CN%s%sp%s-%d-%s",
356 family, core_model, pass, clock_mhz, suffix);
357 return buffer;
358}
diff --git a/arch/mips/cavium-octeon/flash_setup.c b/arch/mips/cavium-octeon/flash_setup.c
new file mode 100644
index 000000000000..553d36cbcc42
--- /dev/null
+++ b/arch/mips/cavium-octeon/flash_setup.c
@@ -0,0 +1,84 @@
1/*
2 * Octeon Bootbus flash setup
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2007, 2008 Cavium Networks
9 */
10#include <linux/kernel.h>
11#include <linux/mtd/mtd.h>
12#include <linux/mtd/map.h>
13#include <linux/mtd/partitions.h>
14
15#include <asm/octeon/octeon.h>
16
17static struct map_info flash_map;
18static struct mtd_info *mymtd;
19#ifdef CONFIG_MTD_PARTITIONS
20static int nr_parts;
21static struct mtd_partition *parts;
22static const char *part_probe_types[] = {
23 "cmdlinepart",
24#ifdef CONFIG_MTD_REDBOOT_PARTS
25 "RedBoot",
26#endif
27 NULL
28};
29#endif
30
31/**
32 * Module/ driver initialization.
33 *
34 * Returns Zero on success
35 */
36static int __init flash_init(void)
37{
38 /*
39 * Read the bootbus region 0 setup to determine the base
40 * address of the flash.
41 */
42 union cvmx_mio_boot_reg_cfgx region_cfg;
43 region_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(0));
44 if (region_cfg.s.en) {
45 /*
46 * The bootloader always takes the flash and sets its
47 * address so the entire flash fits below
48 * 0x1fc00000. This way the flash aliases to
49 * 0x1fc00000 for booting. Software can access the
50 * full flash at the true address, while core boot can
51 * access 4MB.
52 */
53 /* Use this name so old part lines work */
54 flash_map.name = "phys_mapped_flash";
55 flash_map.phys = region_cfg.s.base << 16;
56 flash_map.size = 0x1fc00000 - flash_map.phys;
57 flash_map.bankwidth = 1;
58 flash_map.virt = ioremap(flash_map.phys, flash_map.size);
59 pr_notice("Bootbus flash: Setting flash for %luMB flash at "
60 "0x%08lx\n", flash_map.size >> 20, flash_map.phys);
61 simple_map_init(&flash_map);
62 mymtd = do_map_probe("cfi_probe", &flash_map);
63 if (mymtd) {
64 mymtd->owner = THIS_MODULE;
65
66#ifdef CONFIG_MTD_PARTITIONS
67 nr_parts = parse_mtd_partitions(mymtd,
68 part_probe_types,
69 &parts, 0);
70 if (nr_parts > 0)
71 add_mtd_partitions(mymtd, parts, nr_parts);
72 else
73 add_mtd_device(mymtd);
74#else
75 add_mtd_device(mymtd);
76#endif
77 } else {
78 pr_err("Failed to register MTD device for flash\n");
79 }
80 }
81 return 0;
82}
83
84late_initcall(flash_init);
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c
new file mode 100644
index 000000000000..fc72984a5dae
--- /dev/null
+++ b/arch/mips/cavium-octeon/octeon-irq.c
@@ -0,0 +1,497 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004-2008 Cavium Networks
7 */
8#include <linux/irq.h>
9#include <linux/interrupt.h>
10#include <linux/hardirq.h>
11
12#include <asm/octeon/octeon.h>
13
14DEFINE_RWLOCK(octeon_irq_ciu0_rwlock);
15DEFINE_RWLOCK(octeon_irq_ciu1_rwlock);
16DEFINE_SPINLOCK(octeon_irq_msi_lock);
17
18static void octeon_irq_core_ack(unsigned int irq)
19{
20 unsigned int bit = irq - OCTEON_IRQ_SW0;
21 /*
22 * We don't need to disable IRQs to make these atomic since
23 * they are already disabled earlier in the low level
24 * interrupt code.
25 */
26 clear_c0_status(0x100 << bit);
27 /* The two user interrupts must be cleared manually. */
28 if (bit < 2)
29 clear_c0_cause(0x100 << bit);
30}
31
32static void octeon_irq_core_eoi(unsigned int irq)
33{
34 irq_desc_t *desc = irq_desc + irq;
35 unsigned int bit = irq - OCTEON_IRQ_SW0;
36 /*
37 * If an IRQ is being processed while we are disabling it the
38 * handler will attempt to unmask the interrupt after it has
39 * been disabled.
40 */
41 if (desc->status & IRQ_DISABLED)
42 return;
43
44 /* There is a race here. We should fix it. */
45
46 /*
47 * We don't need to disable IRQs to make these atomic since
48 * they are already disabled earlier in the low level
49 * interrupt code.
50 */
51 set_c0_status(0x100 << bit);
52}
53
54static void octeon_irq_core_enable(unsigned int irq)
55{
56 unsigned long flags;
57 unsigned int bit = irq - OCTEON_IRQ_SW0;
58
59 /*
60 * We need to disable interrupts to make sure our updates are
61 * atomic.
62 */
63 local_irq_save(flags);
64 set_c0_status(0x100 << bit);
65 local_irq_restore(flags);
66}
67
68static void octeon_irq_core_disable_local(unsigned int irq)
69{
70 unsigned long flags;
71 unsigned int bit = irq - OCTEON_IRQ_SW0;
72 /*
73 * We need to disable interrupts to make sure our updates are
74 * atomic.
75 */
76 local_irq_save(flags);
77 clear_c0_status(0x100 << bit);
78 local_irq_restore(flags);
79}
80
81static void octeon_irq_core_disable(unsigned int irq)
82{
83#ifdef CONFIG_SMP
84 on_each_cpu((void (*)(void *)) octeon_irq_core_disable_local,
85 (void *) (long) irq, 1);
86#else
87 octeon_irq_core_disable_local(irq);
88#endif
89}
90
91static struct irq_chip octeon_irq_chip_core = {
92 .name = "Core",
93 .enable = octeon_irq_core_enable,
94 .disable = octeon_irq_core_disable,
95 .ack = octeon_irq_core_ack,
96 .eoi = octeon_irq_core_eoi,
97};
98
99
100static void octeon_irq_ciu0_ack(unsigned int irq)
101{
102 /*
103 * In order to avoid any locking accessing the CIU, we
104 * acknowledge CIU interrupts by disabling all of them. This
105 * way we can use a per core register and avoid any out of
106 * core locking requirements. This has the side affect that
107 * CIU interrupts can't be processed recursively.
108 *
109 * We don't need to disable IRQs to make these atomic since
110 * they are already disabled earlier in the low level
111 * interrupt code.
112 */
113 clear_c0_status(0x100 << 2);
114}
115
116static void octeon_irq_ciu0_eoi(unsigned int irq)
117{
118 /*
119 * Enable all CIU interrupts again. We don't need to disable
120 * IRQs to make these atomic since they are already disabled
121 * earlier in the low level interrupt code.
122 */
123 set_c0_status(0x100 << 2);
124}
125
126static void octeon_irq_ciu0_enable(unsigned int irq)
127{
128 int coreid = cvmx_get_core_num();
129 unsigned long flags;
130 uint64_t en0;
131 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
132
133 /*
134 * A read lock is used here to make sure only one core is ever
135 * updating the CIU enable bits at a time. During an enable
136 * the cores don't interfere with each other. During a disable
137 * the write lock stops any enables that might cause a
138 * problem.
139 */
140 read_lock_irqsave(&octeon_irq_ciu0_rwlock, flags);
141 en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
142 en0 |= 1ull << bit;
143 cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
144 cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
145 read_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags);
146}
147
148static void octeon_irq_ciu0_disable(unsigned int irq)
149{
150 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
151 unsigned long flags;
152 uint64_t en0;
153#ifdef CONFIG_SMP
154 int cpu;
155 write_lock_irqsave(&octeon_irq_ciu0_rwlock, flags);
156 for_each_online_cpu(cpu) {
157 int coreid = cpu_logical_map(cpu);
158 en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
159 en0 &= ~(1ull << bit);
160 cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
161 }
162 /*
163 * We need to do a read after the last update to make sure all
164 * of them are done.
165 */
166 cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2));
167 write_unlock_irqrestore(&octeon_irq_ciu0_rwlock, flags);
168#else
169 int coreid = cvmx_get_core_num();
170 local_irq_save(flags);
171 en0 = cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
172 en0 &= ~(1ull << bit);
173 cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
174 cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
175 local_irq_restore(flags);
176#endif
177}
178
179#ifdef CONFIG_SMP
180static void octeon_irq_ciu0_set_affinity(unsigned int irq, const struct cpumask *dest)
181{
182 int cpu;
183 int bit = irq - OCTEON_IRQ_WORKQ0; /* Bit 0-63 of EN0 */
184
185 write_lock(&octeon_irq_ciu0_rwlock);
186 for_each_online_cpu(cpu) {
187 int coreid = cpu_logical_map(cpu);
188 uint64_t en0 =
189 cvmx_read_csr(CVMX_CIU_INTX_EN0(coreid * 2));
190 if (cpumask_test_cpu(cpu, dest))
191 en0 |= 1ull << bit;
192 else
193 en0 &= ~(1ull << bit);
194 cvmx_write_csr(CVMX_CIU_INTX_EN0(coreid * 2), en0);
195 }
196 /*
197 * We need to do a read after the last update to make sure all
198 * of them are done.
199 */
200 cvmx_read_csr(CVMX_CIU_INTX_EN0(cvmx_get_core_num() * 2));
201 write_unlock(&octeon_irq_ciu0_rwlock);
202}
203#endif
204
205static struct irq_chip octeon_irq_chip_ciu0 = {
206 .name = "CIU0",
207 .enable = octeon_irq_ciu0_enable,
208 .disable = octeon_irq_ciu0_disable,
209 .ack = octeon_irq_ciu0_ack,
210 .eoi = octeon_irq_ciu0_eoi,
211#ifdef CONFIG_SMP
212 .set_affinity = octeon_irq_ciu0_set_affinity,
213#endif
214};
215
216
217static void octeon_irq_ciu1_ack(unsigned int irq)
218{
219 /*
220 * In order to avoid any locking accessing the CIU, we
221 * acknowledge CIU interrupts by disabling all of them. This
222 * way we can use a per core register and avoid any out of
223 * core locking requirements. This has the side affect that
224 * CIU interrupts can't be processed recursively. We don't
225 * need to disable IRQs to make these atomic since they are
226 * already disabled earlier in the low level interrupt code.
227 */
228 clear_c0_status(0x100 << 3);
229}
230
231static void octeon_irq_ciu1_eoi(unsigned int irq)
232{
233 /*
234 * Enable all CIU interrupts again. We don't need to disable
235 * IRQs to make these atomic since they are already disabled
236 * earlier in the low level interrupt code.
237 */
238 set_c0_status(0x100 << 3);
239}
240
241static void octeon_irq_ciu1_enable(unsigned int irq)
242{
243 int coreid = cvmx_get_core_num();
244 unsigned long flags;
245 uint64_t en1;
246 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
247
248 /*
249 * A read lock is used here to make sure only one core is ever
250 * updating the CIU enable bits at a time. During an enable
251 * the cores don't interfere with each other. During a disable
252 * the write lock stops any enables that might cause a
253 * problem.
254 */
255 read_lock_irqsave(&octeon_irq_ciu1_rwlock, flags);
256 en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
257 en1 |= 1ull << bit;
258 cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
259 cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
260 read_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags);
261}
262
263static void octeon_irq_ciu1_disable(unsigned int irq)
264{
265 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
266 unsigned long flags;
267 uint64_t en1;
268#ifdef CONFIG_SMP
269 int cpu;
270 write_lock_irqsave(&octeon_irq_ciu1_rwlock, flags);
271 for_each_online_cpu(cpu) {
272 int coreid = cpu_logical_map(cpu);
273 en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
274 en1 &= ~(1ull << bit);
275 cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
276 }
277 /*
278 * We need to do a read after the last update to make sure all
279 * of them are done.
280 */
281 cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1));
282 write_unlock_irqrestore(&octeon_irq_ciu1_rwlock, flags);
283#else
284 int coreid = cvmx_get_core_num();
285 local_irq_save(flags);
286 en1 = cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
287 en1 &= ~(1ull << bit);
288 cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
289 cvmx_read_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1));
290 local_irq_restore(flags);
291#endif
292}
293
294#ifdef CONFIG_SMP
295static void octeon_irq_ciu1_set_affinity(unsigned int irq, const struct cpumask *dest)
296{
297 int cpu;
298 int bit = irq - OCTEON_IRQ_WDOG0; /* Bit 0-63 of EN1 */
299
300 write_lock(&octeon_irq_ciu1_rwlock);
301 for_each_online_cpu(cpu) {
302 int coreid = cpu_logical_map(cpu);
303 uint64_t en1 =
304 cvmx_read_csr(CVMX_CIU_INTX_EN1
305 (coreid * 2 + 1));
306 if (cpumask_test_cpu(cpu, dest))
307 en1 |= 1ull << bit;
308 else
309 en1 &= ~(1ull << bit);
310 cvmx_write_csr(CVMX_CIU_INTX_EN1(coreid * 2 + 1), en1);
311 }
312 /*
313 * We need to do a read after the last update to make sure all
314 * of them are done.
315 */
316 cvmx_read_csr(CVMX_CIU_INTX_EN1(cvmx_get_core_num() * 2 + 1));
317 write_unlock(&octeon_irq_ciu1_rwlock);
318}
319#endif
320
321static struct irq_chip octeon_irq_chip_ciu1 = {
322 .name = "CIU1",
323 .enable = octeon_irq_ciu1_enable,
324 .disable = octeon_irq_ciu1_disable,
325 .ack = octeon_irq_ciu1_ack,
326 .eoi = octeon_irq_ciu1_eoi,
327#ifdef CONFIG_SMP
328 .set_affinity = octeon_irq_ciu1_set_affinity,
329#endif
330};
331
332#ifdef CONFIG_PCI_MSI
333
334static void octeon_irq_msi_ack(unsigned int irq)
335{
336 if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) {
337 /* These chips have PCI */
338 cvmx_write_csr(CVMX_NPI_NPI_MSI_RCV,
339 1ull << (irq - OCTEON_IRQ_MSI_BIT0));
340 } else {
341 /*
342 * These chips have PCIe. Thankfully the ACK doesn't
343 * need any locking.
344 */
345 cvmx_write_csr(CVMX_PEXP_NPEI_MSI_RCV0,
346 1ull << (irq - OCTEON_IRQ_MSI_BIT0));
347 }
348}
349
350static void octeon_irq_msi_eoi(unsigned int irq)
351{
352 /* Nothing needed */
353}
354
355static void octeon_irq_msi_enable(unsigned int irq)
356{
357 if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) {
358 /*
359 * Octeon PCI doesn't have the ability to mask/unmask
360 * MSI interrupts individually. Instead of
361 * masking/unmasking them in groups of 16, we simple
362 * assume MSI devices are well behaved. MSI
363 * interrupts are always enable and the ACK is assumed
364 * to be enough.
365 */
366 } else {
367 /* These chips have PCIe. Note that we only support
368 * the first 64 MSI interrupts. Unfortunately all the
369 * MSI enables are in the same register. We use
370 * MSI0's lock to control access to them all.
371 */
372 uint64_t en;
373 unsigned long flags;
374 spin_lock_irqsave(&octeon_irq_msi_lock, flags);
375 en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
376 en |= 1ull << (irq - OCTEON_IRQ_MSI_BIT0);
377 cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en);
378 cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
379 spin_unlock_irqrestore(&octeon_irq_msi_lock, flags);
380 }
381}
382
383static void octeon_irq_msi_disable(unsigned int irq)
384{
385 if (!octeon_has_feature(OCTEON_FEATURE_PCIE)) {
386 /* See comment in enable */
387 } else {
388 /*
389 * These chips have PCIe. Note that we only support
390 * the first 64 MSI interrupts. Unfortunately all the
391 * MSI enables are in the same register. We use
392 * MSI0's lock to control access to them all.
393 */
394 uint64_t en;
395 unsigned long flags;
396 spin_lock_irqsave(&octeon_irq_msi_lock, flags);
397 en = cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
398 en &= ~(1ull << (irq - OCTEON_IRQ_MSI_BIT0));
399 cvmx_write_csr(CVMX_PEXP_NPEI_MSI_ENB0, en);
400 cvmx_read_csr(CVMX_PEXP_NPEI_MSI_ENB0);
401 spin_unlock_irqrestore(&octeon_irq_msi_lock, flags);
402 }
403}
404
405static struct irq_chip octeon_irq_chip_msi = {
406 .name = "MSI",
407 .enable = octeon_irq_msi_enable,
408 .disable = octeon_irq_msi_disable,
409 .ack = octeon_irq_msi_ack,
410 .eoi = octeon_irq_msi_eoi,
411};
412#endif
413
414void __init arch_init_irq(void)
415{
416 int irq;
417
418#ifdef CONFIG_SMP
419 /* Set the default affinity to the boot cpu. */
420 cpumask_clear(irq_default_affinity);
421 cpumask_set_cpu(smp_processor_id(), irq_default_affinity);
422#endif
423
424 if (NR_IRQS < OCTEON_IRQ_LAST)
425 pr_err("octeon_irq_init: NR_IRQS is set too low\n");
426
427 /* 0 - 15 reserved for i8259 master and slave controller. */
428
429 /* 17 - 23 Mips internal */
430 for (irq = OCTEON_IRQ_SW0; irq <= OCTEON_IRQ_TIMER; irq++) {
431 set_irq_chip_and_handler(irq, &octeon_irq_chip_core,
432 handle_percpu_irq);
433 }
434
435 /* 24 - 87 CIU_INT_SUM0 */
436 for (irq = OCTEON_IRQ_WORKQ0; irq <= OCTEON_IRQ_BOOTDMA; irq++) {
437 set_irq_chip_and_handler(irq, &octeon_irq_chip_ciu0,
438 handle_percpu_irq);
439 }
440
441 /* 88 - 151 CIU_INT_SUM1 */
442 for (irq = OCTEON_IRQ_WDOG0; irq <= OCTEON_IRQ_RESERVED151; irq++) {
443 set_irq_chip_and_handler(irq, &octeon_irq_chip_ciu1,
444 handle_percpu_irq);
445 }
446
447#ifdef CONFIG_PCI_MSI
448 /* 152 - 215 PCI/PCIe MSI interrupts */
449 for (irq = OCTEON_IRQ_MSI_BIT0; irq <= OCTEON_IRQ_MSI_BIT63; irq++) {
450 set_irq_chip_and_handler(irq, &octeon_irq_chip_msi,
451 handle_percpu_irq);
452 }
453#endif
454 set_c0_status(0x300 << 2);
455}
456
457asmlinkage void plat_irq_dispatch(void)
458{
459 const unsigned long core_id = cvmx_get_core_num();
460 const uint64_t ciu_sum0_address = CVMX_CIU_INTX_SUM0(core_id * 2);
461 const uint64_t ciu_en0_address = CVMX_CIU_INTX_EN0(core_id * 2);
462 const uint64_t ciu_sum1_address = CVMX_CIU_INT_SUM1;
463 const uint64_t ciu_en1_address = CVMX_CIU_INTX_EN1(core_id * 2 + 1);
464 unsigned long cop0_cause;
465 unsigned long cop0_status;
466 uint64_t ciu_en;
467 uint64_t ciu_sum;
468
469 while (1) {
470 cop0_cause = read_c0_cause();
471 cop0_status = read_c0_status();
472 cop0_cause &= cop0_status;
473 cop0_cause &= ST0_IM;
474
475 if (unlikely(cop0_cause & STATUSF_IP2)) {
476 ciu_sum = cvmx_read_csr(ciu_sum0_address);
477 ciu_en = cvmx_read_csr(ciu_en0_address);
478 ciu_sum &= ciu_en;
479 if (likely(ciu_sum))
480 do_IRQ(fls64(ciu_sum) + OCTEON_IRQ_WORKQ0 - 1);
481 else
482 spurious_interrupt();
483 } else if (unlikely(cop0_cause & STATUSF_IP3)) {
484 ciu_sum = cvmx_read_csr(ciu_sum1_address);
485 ciu_en = cvmx_read_csr(ciu_en1_address);
486 ciu_sum &= ciu_en;
487 if (likely(ciu_sum))
488 do_IRQ(fls64(ciu_sum) + OCTEON_IRQ_WDOG0 - 1);
489 else
490 spurious_interrupt();
491 } else if (likely(cop0_cause)) {
492 do_IRQ(fls(cop0_cause) - 9 + MIPS_CPU_IRQ_BASE);
493 } else {
494 break;
495 }
496 }
497}
diff --git a/arch/mips/cavium-octeon/octeon-memcpy.S b/arch/mips/cavium-octeon/octeon-memcpy.S
new file mode 100644
index 000000000000..88e0cddca205
--- /dev/null
+++ b/arch/mips/cavium-octeon/octeon-memcpy.S
@@ -0,0 +1,521 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Unified implementation of memcpy, memmove and the __copy_user backend.
7 *
8 * Copyright (C) 1998, 99, 2000, 01, 2002 Ralf Baechle (ralf@gnu.org)
9 * Copyright (C) 1999, 2000, 01, 2002 Silicon Graphics, Inc.
10 * Copyright (C) 2002 Broadcom, Inc.
11 * memcpy/copy_user author: Mark Vandevoorde
12 *
13 * Mnemonic names for arguments to memcpy/__copy_user
14 */
15
16#include <asm/asm.h>
17#include <asm/asm-offsets.h>
18#include <asm/regdef.h>
19
20#define dst a0
21#define src a1
22#define len a2
23
24/*
25 * Spec
26 *
27 * memcpy copies len bytes from src to dst and sets v0 to dst.
28 * It assumes that
29 * - src and dst don't overlap
30 * - src is readable
31 * - dst is writable
32 * memcpy uses the standard calling convention
33 *
34 * __copy_user copies up to len bytes from src to dst and sets a2 (len) to
35 * the number of uncopied bytes due to an exception caused by a read or write.
36 * __copy_user assumes that src and dst don't overlap, and that the call is
37 * implementing one of the following:
38 * copy_to_user
39 * - src is readable (no exceptions when reading src)
40 * copy_from_user
41 * - dst is writable (no exceptions when writing dst)
42 * __copy_user uses a non-standard calling convention; see
43 * arch/mips/include/asm/uaccess.h
44 *
45 * When an exception happens on a load, the handler must
46 # ensure that all of the destination buffer is overwritten to prevent
47 * leaking information to user mode programs.
48 */
49
50/*
51 * Implementation
52 */
53
54/*
55 * The exception handler for loads requires that:
56 * 1- AT contain the address of the byte just past the end of the source
57 * of the copy,
58 * 2- src_entry <= src < AT, and
59 * 3- (dst - src) == (dst_entry - src_entry),
60 * The _entry suffix denotes values when __copy_user was called.
61 *
62 * (1) is set up up by uaccess.h and maintained by not writing AT in copy_user
63 * (2) is met by incrementing src by the number of bytes copied
64 * (3) is met by not doing loads between a pair of increments of dst and src
65 *
66 * The exception handlers for stores adjust len (if necessary) and return.
67 * These handlers do not need to overwrite any data.
68 *
69 * For __rmemcpy and memmove an exception is always a kernel bug, therefore
70 * they're not protected.
71 */
72
73#define EXC(inst_reg,addr,handler) \
749: inst_reg, addr; \
75 .section __ex_table,"a"; \
76 PTR 9b, handler; \
77 .previous
78
79/*
80 * Only on the 64-bit kernel we can made use of 64-bit registers.
81 */
82#ifdef CONFIG_64BIT
83#define USE_DOUBLE
84#endif
85
86#ifdef USE_DOUBLE
87
88#define LOAD ld
89#define LOADL ldl
90#define LOADR ldr
91#define STOREL sdl
92#define STORER sdr
93#define STORE sd
94#define ADD daddu
95#define SUB dsubu
96#define SRL dsrl
97#define SRA dsra
98#define SLL dsll
99#define SLLV dsllv
100#define SRLV dsrlv
101#define NBYTES 8
102#define LOG_NBYTES 3
103
104/*
105 * As we are sharing code base with the mips32 tree (which use the o32 ABI
106 * register definitions). We need to redefine the register definitions from
107 * the n64 ABI register naming to the o32 ABI register naming.
108 */
109#undef t0
110#undef t1
111#undef t2
112#undef t3
113#define t0 $8
114#define t1 $9
115#define t2 $10
116#define t3 $11
117#define t4 $12
118#define t5 $13
119#define t6 $14
120#define t7 $15
121
122#else
123
124#define LOAD lw
125#define LOADL lwl
126#define LOADR lwr
127#define STOREL swl
128#define STORER swr
129#define STORE sw
130#define ADD addu
131#define SUB subu
132#define SRL srl
133#define SLL sll
134#define SRA sra
135#define SLLV sllv
136#define SRLV srlv
137#define NBYTES 4
138#define LOG_NBYTES 2
139
140#endif /* USE_DOUBLE */
141
142#ifdef CONFIG_CPU_LITTLE_ENDIAN
143#define LDFIRST LOADR
144#define LDREST LOADL
145#define STFIRST STORER
146#define STREST STOREL
147#define SHIFT_DISCARD SLLV
148#else
149#define LDFIRST LOADL
150#define LDREST LOADR
151#define STFIRST STOREL
152#define STREST STORER
153#define SHIFT_DISCARD SRLV
154#endif
155
156#define FIRST(unit) ((unit)*NBYTES)
157#define REST(unit) (FIRST(unit)+NBYTES-1)
158#define UNIT(unit) FIRST(unit)
159
160#define ADDRMASK (NBYTES-1)
161
162 .text
163 .set noreorder
164 .set noat
165
166/*
167 * A combined memcpy/__copy_user
168 * __copy_user sets len to 0 for success; else to an upper bound of
169 * the number of uncopied bytes.
170 * memcpy sets v0 to dst.
171 */
172 .align 5
173LEAF(memcpy) /* a0=dst a1=src a2=len */
174 move v0, dst /* return value */
175__memcpy:
176FEXPORT(__copy_user)
177 /*
178 * Note: dst & src may be unaligned, len may be 0
179 * Temps
180 */
181 #
182 # Octeon doesn't care if the destination is unaligned. The hardware
183 # can fix it faster than we can special case the assembly.
184 #
185 pref 0, 0(src)
186 sltu t0, len, NBYTES # Check if < 1 word
187 bnez t0, copy_bytes_checklen
188 and t0, src, ADDRMASK # Check if src unaligned
189 bnez t0, src_unaligned
190 sltu t0, len, 4*NBYTES # Check if < 4 words
191 bnez t0, less_than_4units
192 sltu t0, len, 8*NBYTES # Check if < 8 words
193 bnez t0, less_than_8units
194 sltu t0, len, 16*NBYTES # Check if < 16 words
195 bnez t0, cleanup_both_aligned
196 sltu t0, len, 128+1 # Check if len < 129
197 bnez t0, 1f # Skip prefetch if len is too short
198 sltu t0, len, 256+1 # Check if len < 257
199 bnez t0, 1f # Skip prefetch if len is too short
200 pref 0, 128(src) # We must not prefetch invalid addresses
201 #
202 # This is where we loop if there is more than 128 bytes left
2032: pref 0, 256(src) # We must not prefetch invalid addresses
204 #
205 # This is where we loop if we can't prefetch anymore
2061:
207EXC( LOAD t0, UNIT(0)(src), l_exc)
208EXC( LOAD t1, UNIT(1)(src), l_exc_copy)
209EXC( LOAD t2, UNIT(2)(src), l_exc_copy)
210EXC( LOAD t3, UNIT(3)(src), l_exc_copy)
211 SUB len, len, 16*NBYTES
212EXC( STORE t0, UNIT(0)(dst), s_exc_p16u)
213EXC( STORE t1, UNIT(1)(dst), s_exc_p15u)
214EXC( STORE t2, UNIT(2)(dst), s_exc_p14u)
215EXC( STORE t3, UNIT(3)(dst), s_exc_p13u)
216EXC( LOAD t0, UNIT(4)(src), l_exc_copy)
217EXC( LOAD t1, UNIT(5)(src), l_exc_copy)
218EXC( LOAD t2, UNIT(6)(src), l_exc_copy)
219EXC( LOAD t3, UNIT(7)(src), l_exc_copy)
220EXC( STORE t0, UNIT(4)(dst), s_exc_p12u)
221EXC( STORE t1, UNIT(5)(dst), s_exc_p11u)
222EXC( STORE t2, UNIT(6)(dst), s_exc_p10u)
223 ADD src, src, 16*NBYTES
224EXC( STORE t3, UNIT(7)(dst), s_exc_p9u)
225 ADD dst, dst, 16*NBYTES
226EXC( LOAD t0, UNIT(-8)(src), l_exc_copy)
227EXC( LOAD t1, UNIT(-7)(src), l_exc_copy)
228EXC( LOAD t2, UNIT(-6)(src), l_exc_copy)
229EXC( LOAD t3, UNIT(-5)(src), l_exc_copy)
230EXC( STORE t0, UNIT(-8)(dst), s_exc_p8u)
231EXC( STORE t1, UNIT(-7)(dst), s_exc_p7u)
232EXC( STORE t2, UNIT(-6)(dst), s_exc_p6u)
233EXC( STORE t3, UNIT(-5)(dst), s_exc_p5u)
234EXC( LOAD t0, UNIT(-4)(src), l_exc_copy)
235EXC( LOAD t1, UNIT(-3)(src), l_exc_copy)
236EXC( LOAD t2, UNIT(-2)(src), l_exc_copy)
237EXC( LOAD t3, UNIT(-1)(src), l_exc_copy)
238EXC( STORE t0, UNIT(-4)(dst), s_exc_p4u)
239EXC( STORE t1, UNIT(-3)(dst), s_exc_p3u)
240EXC( STORE t2, UNIT(-2)(dst), s_exc_p2u)
241EXC( STORE t3, UNIT(-1)(dst), s_exc_p1u)
242 sltu t0, len, 256+1 # See if we can prefetch more
243 beqz t0, 2b
244 sltu t0, len, 128 # See if we can loop more time
245 beqz t0, 1b
246 nop
247 #
248 # Jump here if there are less than 16*NBYTES left.
249 #
250cleanup_both_aligned:
251 beqz len, done
252 sltu t0, len, 8*NBYTES
253 bnez t0, less_than_8units
254 nop
255EXC( LOAD t0, UNIT(0)(src), l_exc)
256EXC( LOAD t1, UNIT(1)(src), l_exc_copy)
257EXC( LOAD t2, UNIT(2)(src), l_exc_copy)
258EXC( LOAD t3, UNIT(3)(src), l_exc_copy)
259 SUB len, len, 8*NBYTES
260EXC( STORE t0, UNIT(0)(dst), s_exc_p8u)
261EXC( STORE t1, UNIT(1)(dst), s_exc_p7u)
262EXC( STORE t2, UNIT(2)(dst), s_exc_p6u)
263EXC( STORE t3, UNIT(3)(dst), s_exc_p5u)
264EXC( LOAD t0, UNIT(4)(src), l_exc_copy)
265EXC( LOAD t1, UNIT(5)(src), l_exc_copy)
266EXC( LOAD t2, UNIT(6)(src), l_exc_copy)
267EXC( LOAD t3, UNIT(7)(src), l_exc_copy)
268EXC( STORE t0, UNIT(4)(dst), s_exc_p4u)
269EXC( STORE t1, UNIT(5)(dst), s_exc_p3u)
270EXC( STORE t2, UNIT(6)(dst), s_exc_p2u)
271EXC( STORE t3, UNIT(7)(dst), s_exc_p1u)
272 ADD src, src, 8*NBYTES
273 beqz len, done
274 ADD dst, dst, 8*NBYTES
275 #
276 # Jump here if there are less than 8*NBYTES left.
277 #
278less_than_8units:
279 sltu t0, len, 4*NBYTES
280 bnez t0, less_than_4units
281 nop
282EXC( LOAD t0, UNIT(0)(src), l_exc)
283EXC( LOAD t1, UNIT(1)(src), l_exc_copy)
284EXC( LOAD t2, UNIT(2)(src), l_exc_copy)
285EXC( LOAD t3, UNIT(3)(src), l_exc_copy)
286 SUB len, len, 4*NBYTES
287EXC( STORE t0, UNIT(0)(dst), s_exc_p4u)
288EXC( STORE t1, UNIT(1)(dst), s_exc_p3u)
289EXC( STORE t2, UNIT(2)(dst), s_exc_p2u)
290EXC( STORE t3, UNIT(3)(dst), s_exc_p1u)
291 ADD src, src, 4*NBYTES
292 beqz len, done
293 ADD dst, dst, 4*NBYTES
294 #
295 # Jump here if there are less than 4*NBYTES left. This means
296 # we may need to copy up to 3 NBYTES words.
297 #
298less_than_4units:
299 sltu t0, len, 1*NBYTES
300 bnez t0, copy_bytes_checklen
301 nop
302 #
303 # 1) Copy NBYTES, then check length again
304 #
305EXC( LOAD t0, 0(src), l_exc)
306 SUB len, len, NBYTES
307 sltu t1, len, 8
308EXC( STORE t0, 0(dst), s_exc_p1u)
309 ADD src, src, NBYTES
310 bnez t1, copy_bytes_checklen
311 ADD dst, dst, NBYTES
312 #
313 # 2) Copy NBYTES, then check length again
314 #
315EXC( LOAD t0, 0(src), l_exc)
316 SUB len, len, NBYTES
317 sltu t1, len, 8
318EXC( STORE t0, 0(dst), s_exc_p1u)
319 ADD src, src, NBYTES
320 bnez t1, copy_bytes_checklen
321 ADD dst, dst, NBYTES
322 #
323 # 3) Copy NBYTES, then check length again
324 #
325EXC( LOAD t0, 0(src), l_exc)
326 SUB len, len, NBYTES
327 ADD src, src, NBYTES
328 ADD dst, dst, NBYTES
329 b copy_bytes_checklen
330EXC( STORE t0, -8(dst), s_exc_p1u)
331
332src_unaligned:
333#define rem t8
334 SRL t0, len, LOG_NBYTES+2 # +2 for 4 units/iter
335 beqz t0, cleanup_src_unaligned
336 and rem, len, (4*NBYTES-1) # rem = len % 4*NBYTES
3371:
338/*
339 * Avoid consecutive LD*'s to the same register since some mips
340 * implementations can't issue them in the same cycle.
341 * It's OK to load FIRST(N+1) before REST(N) because the two addresses
342 * are to the same unit (unless src is aligned, but it's not).
343 */
344EXC( LDFIRST t0, FIRST(0)(src), l_exc)
345EXC( LDFIRST t1, FIRST(1)(src), l_exc_copy)
346 SUB len, len, 4*NBYTES
347EXC( LDREST t0, REST(0)(src), l_exc_copy)
348EXC( LDREST t1, REST(1)(src), l_exc_copy)
349EXC( LDFIRST t2, FIRST(2)(src), l_exc_copy)
350EXC( LDFIRST t3, FIRST(3)(src), l_exc_copy)
351EXC( LDREST t2, REST(2)(src), l_exc_copy)
352EXC( LDREST t3, REST(3)(src), l_exc_copy)
353 ADD src, src, 4*NBYTES
354EXC( STORE t0, UNIT(0)(dst), s_exc_p4u)
355EXC( STORE t1, UNIT(1)(dst), s_exc_p3u)
356EXC( STORE t2, UNIT(2)(dst), s_exc_p2u)
357EXC( STORE t3, UNIT(3)(dst), s_exc_p1u)
358 bne len, rem, 1b
359 ADD dst, dst, 4*NBYTES
360
361cleanup_src_unaligned:
362 beqz len, done
363 and rem, len, NBYTES-1 # rem = len % NBYTES
364 beq rem, len, copy_bytes
365 nop
3661:
367EXC( LDFIRST t0, FIRST(0)(src), l_exc)
368EXC( LDREST t0, REST(0)(src), l_exc_copy)
369 SUB len, len, NBYTES
370EXC( STORE t0, 0(dst), s_exc_p1u)
371 ADD src, src, NBYTES
372 bne len, rem, 1b
373 ADD dst, dst, NBYTES
374
375copy_bytes_checklen:
376 beqz len, done
377 nop
378copy_bytes:
379 /* 0 < len < NBYTES */
380#define COPY_BYTE(N) \
381EXC( lb t0, N(src), l_exc); \
382 SUB len, len, 1; \
383 beqz len, done; \
384EXC( sb t0, N(dst), s_exc_p1)
385
386 COPY_BYTE(0)
387 COPY_BYTE(1)
388#ifdef USE_DOUBLE
389 COPY_BYTE(2)
390 COPY_BYTE(3)
391 COPY_BYTE(4)
392 COPY_BYTE(5)
393#endif
394EXC( lb t0, NBYTES-2(src), l_exc)
395 SUB len, len, 1
396 jr ra
397EXC( sb t0, NBYTES-2(dst), s_exc_p1)
398done:
399 jr ra
400 nop
401 END(memcpy)
402
403l_exc_copy:
404 /*
405 * Copy bytes from src until faulting load address (or until a
406 * lb faults)
407 *
408 * When reached by a faulting LDFIRST/LDREST, THREAD_BUADDR($28)
409 * may be more than a byte beyond the last address.
410 * Hence, the lb below may get an exception.
411 *
412 * Assumes src < THREAD_BUADDR($28)
413 */
414 LOAD t0, TI_TASK($28)
415 nop
416 LOAD t0, THREAD_BUADDR(t0)
4171:
418EXC( lb t1, 0(src), l_exc)
419 ADD src, src, 1
420 sb t1, 0(dst) # can't fault -- we're copy_from_user
421 bne src, t0, 1b
422 ADD dst, dst, 1
423l_exc:
424 LOAD t0, TI_TASK($28)
425 nop
426 LOAD t0, THREAD_BUADDR(t0) # t0 is just past last good address
427 nop
428 SUB len, AT, t0 # len number of uncopied bytes
429 /*
430 * Here's where we rely on src and dst being incremented in tandem,
431 * See (3) above.
432 * dst += (fault addr - src) to put dst at first byte to clear
433 */
434 ADD dst, t0 # compute start address in a1
435 SUB dst, src
436 /*
437 * Clear len bytes starting at dst. Can't call __bzero because it
438 * might modify len. An inefficient loop for these rare times...
439 */
440 beqz len, done
441 SUB src, len, 1
4421: sb zero, 0(dst)
443 ADD dst, dst, 1
444 bnez src, 1b
445 SUB src, src, 1
446 jr ra
447 nop
448
449
450#define SEXC(n) \
451s_exc_p ## n ## u: \
452 jr ra; \
453 ADD len, len, n*NBYTES
454
455SEXC(16)
456SEXC(15)
457SEXC(14)
458SEXC(13)
459SEXC(12)
460SEXC(11)
461SEXC(10)
462SEXC(9)
463SEXC(8)
464SEXC(7)
465SEXC(6)
466SEXC(5)
467SEXC(4)
468SEXC(3)
469SEXC(2)
470SEXC(1)
471
472s_exc_p1:
473 jr ra
474 ADD len, len, 1
475s_exc:
476 jr ra
477 nop
478
479 .align 5
480LEAF(memmove)
481 ADD t0, a0, a2
482 ADD t1, a1, a2
483 sltu t0, a1, t0 # dst + len <= src -> memcpy
484 sltu t1, a0, t1 # dst >= src + len -> memcpy
485 and t0, t1
486 beqz t0, __memcpy
487 move v0, a0 /* return value */
488 beqz a2, r_out
489 END(memmove)
490
491 /* fall through to __rmemcpy */
492LEAF(__rmemcpy) /* a0=dst a1=src a2=len */
493 sltu t0, a1, a0
494 beqz t0, r_end_bytes_up # src >= dst
495 nop
496 ADD a0, a2 # dst = dst + len
497 ADD a1, a2 # src = src + len
498
499r_end_bytes:
500 lb t0, -1(a1)
501 SUB a2, a2, 0x1
502 sb t0, -1(a0)
503 SUB a1, a1, 0x1
504 bnez a2, r_end_bytes
505 SUB a0, a0, 0x1
506
507r_out:
508 jr ra
509 move a2, zero
510
511r_end_bytes_up:
512 lb t0, (a1)
513 SUB a2, a2, 0x1
514 sb t0, (a0)
515 ADD a1, a1, 0x1
516 bnez a2, r_end_bytes_up
517 ADD a0, a0, 0x1
518
519 jr ra
520 move a2, zero
521 END(__rmemcpy)
diff --git a/arch/mips/cavium-octeon/serial.c b/arch/mips/cavium-octeon/serial.c
new file mode 100644
index 000000000000..8240728d485a
--- /dev/null
+++ b/arch/mips/cavium-octeon/serial.c
@@ -0,0 +1,136 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004-2007 Cavium Networks
7 */
8#include <linux/console.h>
9#include <linux/module.h>
10#include <linux/init.h>
11#include <linux/platform_device.h>
12#include <linux/serial.h>
13#include <linux/serial_8250.h>
14#include <linux/serial_reg.h>
15#include <linux/tty.h>
16
17#include <asm/time.h>
18
19#include <asm/octeon/octeon.h>
20
21#ifdef CONFIG_GDB_CONSOLE
22#define DEBUG_UART 0
23#else
24#define DEBUG_UART 1
25#endif
26
27unsigned int octeon_serial_in(struct uart_port *up, int offset)
28{
29 int rv = cvmx_read_csr((uint64_t)(up->membase + (offset << 3)));
30 if (offset == UART_IIR && (rv & 0xf) == 7) {
31 /* Busy interrupt, read the USR (39) and try again. */
32 cvmx_read_csr((uint64_t)(up->membase + (39 << 3)));
33 rv = cvmx_read_csr((uint64_t)(up->membase + (offset << 3)));
34 }
35 return rv;
36}
37
38void octeon_serial_out(struct uart_port *up, int offset, int value)
39{
40 /*
41 * If bits 6 or 7 of the OCTEON UART's LCR are set, it quits
42 * working.
43 */
44 if (offset == UART_LCR)
45 value &= 0x9f;
46 cvmx_write_csr((uint64_t)(up->membase + (offset << 3)), (u8)value);
47}
48
49/*
50 * Allocated in .bss, so it is all zeroed.
51 */
52#define OCTEON_MAX_UARTS 3
53static struct plat_serial8250_port octeon_uart8250_data[OCTEON_MAX_UARTS + 1];
54static struct platform_device octeon_uart8250_device = {
55 .name = "serial8250",
56 .id = PLAT8250_DEV_PLATFORM,
57 .dev = {
58 .platform_data = octeon_uart8250_data,
59 },
60};
61
62static void __init octeon_uart_set_common(struct plat_serial8250_port *p)
63{
64 p->flags = ASYNC_SKIP_TEST | UPF_SHARE_IRQ | UPF_FIXED_TYPE;
65 p->type = PORT_OCTEON;
66 p->iotype = UPIO_MEM;
67 p->regshift = 3; /* I/O addresses are every 8 bytes */
68 p->uartclk = mips_hpt_frequency;
69 p->serial_in = octeon_serial_in;
70 p->serial_out = octeon_serial_out;
71}
72
73static int __init octeon_serial_init(void)
74{
75 int enable_uart0;
76 int enable_uart1;
77 int enable_uart2;
78 struct plat_serial8250_port *p;
79
80#ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL
81 /*
82 * If we are configured to run as the second of two kernels,
83 * disable uart0 and enable uart1. Uart0 is owned by the first
84 * kernel
85 */
86 enable_uart0 = 0;
87 enable_uart1 = 1;
88#else
89 /*
90 * We are configured for the first kernel. We'll enable uart0
91 * if the bootloader told us to use 0, otherwise will enable
92 * uart 1.
93 */
94 enable_uart0 = (octeon_get_boot_uart() == 0);
95 enable_uart1 = (octeon_get_boot_uart() == 1);
96#ifdef CONFIG_KGDB
97 enable_uart1 = 1;
98#endif
99#endif
100
101 /* Right now CN52XX is the only chip with a third uart */
102 enable_uart2 = OCTEON_IS_MODEL(OCTEON_CN52XX);
103
104 p = octeon_uart8250_data;
105 if (enable_uart0) {
106 /* Add a ttyS device for hardware uart 0 */
107 octeon_uart_set_common(p);
108 p->membase = (void *) CVMX_MIO_UARTX_RBR(0);
109 p->mapbase = CVMX_MIO_UARTX_RBR(0) & ((1ull << 49) - 1);
110 p->irq = OCTEON_IRQ_UART0;
111 p++;
112 }
113
114 if (enable_uart1) {
115 /* Add a ttyS device for hardware uart 1 */
116 octeon_uart_set_common(p);
117 p->membase = (void *) CVMX_MIO_UARTX_RBR(1);
118 p->mapbase = CVMX_MIO_UARTX_RBR(1) & ((1ull << 49) - 1);
119 p->irq = OCTEON_IRQ_UART1;
120 p++;
121 }
122 if (enable_uart2) {
123 /* Add a ttyS device for hardware uart 2 */
124 octeon_uart_set_common(p);
125 p->membase = (void *) CVMX_MIO_UART2_RBR;
126 p->mapbase = CVMX_MIO_UART2_RBR & ((1ull << 49) - 1);
127 p->irq = OCTEON_IRQ_UART2;
128 p++;
129 }
130
131 BUG_ON(p > &octeon_uart8250_data[OCTEON_MAX_UARTS]);
132
133 return platform_device_register(&octeon_uart8250_device);
134}
135
136device_initcall(octeon_serial_init);
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
new file mode 100644
index 000000000000..e085feddb4a4
--- /dev/null
+++ b/arch/mips/cavium-octeon/setup.c
@@ -0,0 +1,929 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004-2007 Cavium Networks
7 * Copyright (C) 2008 Wind River Systems
8 */
9#include <linux/init.h>
10#include <linux/console.h>
11#include <linux/delay.h>
12#include <linux/interrupt.h>
13#include <linux/io.h>
14#include <linux/irq.h>
15#include <linux/serial.h>
16#include <linux/types.h>
17#include <linux/string.h> /* for memset */
18#include <linux/serial.h>
19#include <linux/tty.h>
20#include <linux/time.h>
21#include <linux/platform_device.h>
22#include <linux/serial_core.h>
23#include <linux/serial_8250.h>
24#include <linux/string.h>
25
26#include <asm/processor.h>
27#include <asm/reboot.h>
28#include <asm/smp-ops.h>
29#include <asm/system.h>
30#include <asm/irq_cpu.h>
31#include <asm/mipsregs.h>
32#include <asm/bootinfo.h>
33#include <asm/sections.h>
34#include <asm/time.h>
35
36#include <asm/octeon/octeon.h>
37
38#ifdef CONFIG_CAVIUM_DECODE_RSL
39extern void cvmx_interrupt_rsl_decode(void);
40extern int __cvmx_interrupt_ecc_report_single_bit_errors;
41extern void cvmx_interrupt_rsl_enable(void);
42#endif
43
44extern struct plat_smp_ops octeon_smp_ops;
45
46#ifdef CONFIG_PCI
47extern void pci_console_init(const char *arg);
48#endif
49
50#ifdef CONFIG_CAVIUM_RESERVE32
51extern uint64_t octeon_reserve32_memory;
52#endif
53static unsigned long long MAX_MEMORY = 512ull << 20;
54
55struct octeon_boot_descriptor *octeon_boot_desc_ptr;
56
57struct cvmx_bootinfo *octeon_bootinfo;
58EXPORT_SYMBOL(octeon_bootinfo);
59
60#ifdef CONFIG_CAVIUM_RESERVE32
61uint64_t octeon_reserve32_memory;
62EXPORT_SYMBOL(octeon_reserve32_memory);
63#endif
64
65static int octeon_uart;
66
67extern asmlinkage void handle_int(void);
68extern asmlinkage void plat_irq_dispatch(void);
69
70/**
71 * Return non zero if we are currently running in the Octeon simulator
72 *
73 * Returns
74 */
75int octeon_is_simulation(void)
76{
77 return octeon_bootinfo->board_type == CVMX_BOARD_TYPE_SIM;
78}
79EXPORT_SYMBOL(octeon_is_simulation);
80
81/**
82 * Return true if Octeon is in PCI Host mode. This means
83 * Linux can control the PCI bus.
84 *
85 * Returns Non zero if Octeon in host mode.
86 */
87int octeon_is_pci_host(void)
88{
89#ifdef CONFIG_PCI
90 return octeon_bootinfo->config_flags & CVMX_BOOTINFO_CFG_FLAG_PCI_HOST;
91#else
92 return 0;
93#endif
94}
95
96/**
97 * Get the clock rate of Octeon
98 *
99 * Returns Clock rate in HZ
100 */
101uint64_t octeon_get_clock_rate(void)
102{
103 if (octeon_is_simulation())
104 octeon_bootinfo->eclock_hz = 6000000;
105 return octeon_bootinfo->eclock_hz;
106}
107EXPORT_SYMBOL(octeon_get_clock_rate);
108
109/**
110 * Write to the LCD display connected to the bootbus. This display
111 * exists on most Cavium evaluation boards. If it doesn't exist, then
112 * this function doesn't do anything.
113 *
114 * @s: String to write
115 */
116void octeon_write_lcd(const char *s)
117{
118 if (octeon_bootinfo->led_display_base_addr) {
119 void __iomem *lcd_address =
120 ioremap_nocache(octeon_bootinfo->led_display_base_addr,
121 8);
122 int i;
123 for (i = 0; i < 8; i++, s++) {
124 if (*s)
125 iowrite8(*s, lcd_address + i);
126 else
127 iowrite8(' ', lcd_address + i);
128 }
129 iounmap(lcd_address);
130 }
131}
132
133/**
134 * Return the console uart passed by the bootloader
135 *
136 * Returns uart (0 or 1)
137 */
138int octeon_get_boot_uart(void)
139{
140 int uart;
141#ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL
142 uart = 1;
143#else
144 uart = (octeon_boot_desc_ptr->flags & OCTEON_BL_FLAG_CONSOLE_UART1) ?
145 1 : 0;
146#endif
147 return uart;
148}
149
150/**
151 * Get the coremask Linux was booted on.
152 *
153 * Returns Core mask
154 */
155int octeon_get_boot_coremask(void)
156{
157 return octeon_boot_desc_ptr->core_mask;
158}
159
160/**
161 * Check the hardware BIST results for a CPU
162 */
163void octeon_check_cpu_bist(void)
164{
165 const int coreid = cvmx_get_core_num();
166 unsigned long long mask;
167 unsigned long long bist_val;
168
169 /* Check BIST results for COP0 registers */
170 mask = 0x1f00000000ull;
171 bist_val = read_octeon_c0_icacheerr();
172 if (bist_val & mask)
173 pr_err("Core%d BIST Failure: CacheErr(icache) = 0x%llx\n",
174 coreid, bist_val);
175
176 bist_val = read_octeon_c0_dcacheerr();
177 if (bist_val & 1)
178 pr_err("Core%d L1 Dcache parity error: "
179 "CacheErr(dcache) = 0x%llx\n",
180 coreid, bist_val);
181
182 mask = 0xfc00000000000000ull;
183 bist_val = read_c0_cvmmemctl();
184 if (bist_val & mask)
185 pr_err("Core%d BIST Failure: COP0_CVM_MEM_CTL = 0x%llx\n",
186 coreid, bist_val);
187
188 write_octeon_c0_dcacheerr(0);
189}
190
191#ifdef CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB
192/**
193 * Called on every core to setup the wired tlb entry needed
194 * if CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB is set.
195 *
196 */
197static void octeon_hal_setup_per_cpu_reserved32(void *unused)
198{
199 /*
200 * The config has selected to wire the reserve32 memory for all
201 * userspace applications. We need to put a wired TLB entry in for each
202 * 512MB of reserve32 memory. We only handle double 256MB pages here,
203 * so reserve32 must be multiple of 512MB.
204 */
205 uint32_t size = CONFIG_CAVIUM_RESERVE32;
206 uint32_t entrylo0 =
207 0x7 | ((octeon_reserve32_memory & ((1ul << 40) - 1)) >> 6);
208 uint32_t entrylo1 = entrylo0 + (256 << 14);
209 uint32_t entryhi = (0x80000000UL - (CONFIG_CAVIUM_RESERVE32 << 20));
210 while (size >= 512) {
211#if 0
212 pr_info("CPU%d: Adding double wired TLB entry for 0x%lx\n",
213 smp_processor_id(), entryhi);
214#endif
215 add_wired_entry(entrylo0, entrylo1, entryhi, PM_256M);
216 entrylo0 += 512 << 14;
217 entrylo1 += 512 << 14;
218 entryhi += 512 << 20;
219 size -= 512;
220 }
221}
222#endif /* CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB */
223
224/**
225 * Called to release the named block which was used to made sure
226 * that nobody used the memory for something else during
227 * init. Now we'll free it so userspace apps can use this
228 * memory region with bootmem_alloc.
229 *
230 * This function is called only once from prom_free_prom_memory().
231 */
232void octeon_hal_setup_reserved32(void)
233{
234#ifdef CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB
235 on_each_cpu(octeon_hal_setup_per_cpu_reserved32, NULL, 0, 1);
236#endif
237}
238
239/**
240 * Reboot Octeon
241 *
242 * @command: Command to pass to the bootloader. Currently ignored.
243 */
244static void octeon_restart(char *command)
245{
246 /* Disable all watchdogs before soft reset. They don't get cleared */
247#ifdef CONFIG_SMP
248 int cpu;
249 for_each_online_cpu(cpu)
250 cvmx_write_csr(CVMX_CIU_WDOGX(cpu_logical_map(cpu)), 0);
251#else
252 cvmx_write_csr(CVMX_CIU_WDOGX(cvmx_get_core_num()), 0);
253#endif
254
255 mb();
256 while (1)
257 cvmx_write_csr(CVMX_CIU_SOFT_RST, 1);
258}
259
260
261/**
262 * Permanently stop a core.
263 *
264 * @arg: Ignored.
265 */
266static void octeon_kill_core(void *arg)
267{
268 mb();
269 if (octeon_is_simulation()) {
270 /* The simulator needs the watchdog to stop for dead cores */
271 cvmx_write_csr(CVMX_CIU_WDOGX(cvmx_get_core_num()), 0);
272 /* A break instruction causes the simulator stop a core */
273 asm volatile ("sync\nbreak");
274 }
275}
276
277
278/**
279 * Halt the system
280 */
281static void octeon_halt(void)
282{
283 smp_call_function(octeon_kill_core, NULL, 0);
284
285 switch (octeon_bootinfo->board_type) {
286 case CVMX_BOARD_TYPE_NAO38:
287 /* Driving a 1 to GPIO 12 shuts off this board */
288 cvmx_write_csr(CVMX_GPIO_BIT_CFGX(12), 1);
289 cvmx_write_csr(CVMX_GPIO_TX_SET, 0x1000);
290 break;
291 default:
292 octeon_write_lcd("PowerOff");
293 break;
294 }
295
296 octeon_kill_core(NULL);
297}
298
299#if 0
300/**
301 * Platform time init specifics.
302 * Returns
303 */
304void __init plat_time_init(void)
305{
306 /* Nothing special here, but we are required to have one */
307}
308
309#endif
310
311/**
312 * Handle all the error condition interrupts that might occur.
313 *
314 */
315#ifdef CONFIG_CAVIUM_DECODE_RSL
316static irqreturn_t octeon_rlm_interrupt(int cpl, void *dev_id)
317{
318 cvmx_interrupt_rsl_decode();
319 return IRQ_HANDLED;
320}
321#endif
322
323/**
324 * Return a string representing the system type
325 *
326 * Returns
327 */
328const char *octeon_board_type_string(void)
329{
330 static char name[80];
331 sprintf(name, "%s (%s)",
332 cvmx_board_type_to_string(octeon_bootinfo->board_type),
333 octeon_model_get_string(read_c0_prid()));
334 return name;
335}
336
337const char *get_system_type(void)
338 __attribute__ ((alias("octeon_board_type_string")));
339
340void octeon_user_io_init(void)
341{
342 union octeon_cvmemctl cvmmemctl;
343 union cvmx_iob_fau_timeout fau_timeout;
344 union cvmx_pow_nw_tim nm_tim;
345 uint64_t cvmctl;
346
347 /* Get the current settings for CP0_CVMMEMCTL_REG */
348 cvmmemctl.u64 = read_c0_cvmmemctl();
349 /* R/W If set, marked write-buffer entries time out the same
350 * as as other entries; if clear, marked write-buffer entries
351 * use the maximum timeout. */
352 cvmmemctl.s.dismarkwblongto = 1;
353 /* R/W If set, a merged store does not clear the write-buffer
354 * entry timeout state. */
355 cvmmemctl.s.dismrgclrwbto = 0;
356 /* R/W Two bits that are the MSBs of the resultant CVMSEG LM
357 * word location for an IOBDMA. The other 8 bits come from the
358 * SCRADDR field of the IOBDMA. */
359 cvmmemctl.s.iobdmascrmsb = 0;
360 /* R/W If set, SYNCWS and SYNCS only order marked stores; if
361 * clear, SYNCWS and SYNCS only order unmarked
362 * stores. SYNCWSMARKED has no effect when DISSYNCWS is
363 * set. */
364 cvmmemctl.s.syncwsmarked = 0;
365 /* R/W If set, SYNCWS acts as SYNCW and SYNCS acts as SYNC. */
366 cvmmemctl.s.dissyncws = 0;
367 /* R/W If set, no stall happens on write buffer full. */
368 if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS2))
369 cvmmemctl.s.diswbfst = 1;
370 else
371 cvmmemctl.s.diswbfst = 0;
372 /* R/W If set (and SX set), supervisor-level loads/stores can
373 * use XKPHYS addresses with <48>==0 */
374 cvmmemctl.s.xkmemenas = 0;
375
376 /* R/W If set (and UX set), user-level loads/stores can use
377 * XKPHYS addresses with VA<48>==0 */
378 cvmmemctl.s.xkmemenau = 0;
379
380 /* R/W If set (and SX set), supervisor-level loads/stores can
381 * use XKPHYS addresses with VA<48>==1 */
382 cvmmemctl.s.xkioenas = 0;
383
384 /* R/W If set (and UX set), user-level loads/stores can use
385 * XKPHYS addresses with VA<48>==1 */
386 cvmmemctl.s.xkioenau = 0;
387
388 /* R/W If set, all stores act as SYNCW (NOMERGE must be set
389 * when this is set) RW, reset to 0. */
390 cvmmemctl.s.allsyncw = 0;
391
392 /* R/W If set, no stores merge, and all stores reach the
393 * coherent bus in order. */
394 cvmmemctl.s.nomerge = 0;
395 /* R/W Selects the bit in the counter used for DID time-outs 0
396 * = 231, 1 = 230, 2 = 229, 3 = 214. Actual time-out is
397 * between 1x and 2x this interval. For example, with
398 * DIDTTO=3, expiration interval is between 16K and 32K. */
399 cvmmemctl.s.didtto = 0;
400 /* R/W If set, the (mem) CSR clock never turns off. */
401 cvmmemctl.s.csrckalwys = 0;
402 /* R/W If set, mclk never turns off. */
403 cvmmemctl.s.mclkalwys = 0;
404 /* R/W Selects the bit in the counter used for write buffer
405 * flush time-outs (WBFLT+11) is the bit position in an
406 * internal counter used to determine expiration. The write
407 * buffer expires between 1x and 2x this interval. For
408 * example, with WBFLT = 0, a write buffer expires between 2K
409 * and 4K cycles after the write buffer entry is allocated. */
410 cvmmemctl.s.wbfltime = 0;
411 /* R/W If set, do not put Istream in the L2 cache. */
412 cvmmemctl.s.istrnol2 = 0;
413 /* R/W The write buffer threshold. */
414 cvmmemctl.s.wbthresh = 10;
415 /* R/W If set, CVMSEG is available for loads/stores in
416 * kernel/debug mode. */
417#if CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0
418 cvmmemctl.s.cvmsegenak = 1;
419#else
420 cvmmemctl.s.cvmsegenak = 0;
421#endif
422 /* R/W If set, CVMSEG is available for loads/stores in
423 * supervisor mode. */
424 cvmmemctl.s.cvmsegenas = 0;
425 /* R/W If set, CVMSEG is available for loads/stores in user
426 * mode. */
427 cvmmemctl.s.cvmsegenau = 0;
428 /* R/W Size of local memory in cache blocks, 54 (6912 bytes)
429 * is max legal value. */
430 cvmmemctl.s.lmemsz = CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE;
431
432
433 if (smp_processor_id() == 0)
434 pr_notice("CVMSEG size: %d cache lines (%d bytes)\n",
435 CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE,
436 CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE * 128);
437
438 write_c0_cvmmemctl(cvmmemctl.u64);
439
440 /* Move the performance counter interrupts to IRQ 6 */
441 cvmctl = read_c0_cvmctl();
442 cvmctl &= ~(7 << 7);
443 cvmctl |= 6 << 7;
444 write_c0_cvmctl(cvmctl);
445
446 /* Set a default for the hardware timeouts */
447 fau_timeout.u64 = 0;
448 fau_timeout.s.tout_val = 0xfff;
449 /* Disable tagwait FAU timeout */
450 fau_timeout.s.tout_enb = 0;
451 cvmx_write_csr(CVMX_IOB_FAU_TIMEOUT, fau_timeout.u64);
452
453 nm_tim.u64 = 0;
454 /* 4096 cycles */
455 nm_tim.s.nw_tim = 3;
456 cvmx_write_csr(CVMX_POW_NW_TIM, nm_tim.u64);
457
458 write_octeon_c0_icacheerr(0);
459 write_c0_derraddr1(0);
460}
461
462/**
463 * Early entry point for arch setup
464 */
465void __init prom_init(void)
466{
467 struct cvmx_sysinfo *sysinfo;
468 const int coreid = cvmx_get_core_num();
469 int i;
470 int argc;
471 struct uart_port octeon_port;
472#ifdef CONFIG_CAVIUM_RESERVE32
473 int64_t addr = -1;
474#endif
475 /*
476 * The bootloader passes a pointer to the boot descriptor in
477 * $a3, this is available as fw_arg3.
478 */
479 octeon_boot_desc_ptr = (struct octeon_boot_descriptor *)fw_arg3;
480 octeon_bootinfo =
481 cvmx_phys_to_ptr(octeon_boot_desc_ptr->cvmx_desc_vaddr);
482 cvmx_bootmem_init(cvmx_phys_to_ptr(octeon_bootinfo->phy_mem_desc_addr));
483
484 /*
485 * Only enable the LED controller if we're running on a CN38XX, CN58XX,
486 * or CN56XX. The CN30XX and CN31XX don't have an LED controller.
487 */
488 if (!octeon_is_simulation() &&
489 octeon_has_feature(OCTEON_FEATURE_LED_CONTROLLER)) {
490 cvmx_write_csr(CVMX_LED_EN, 0);
491 cvmx_write_csr(CVMX_LED_PRT, 0);
492 cvmx_write_csr(CVMX_LED_DBG, 0);
493 cvmx_write_csr(CVMX_LED_PRT_FMT, 0);
494 cvmx_write_csr(CVMX_LED_UDD_CNTX(0), 32);
495 cvmx_write_csr(CVMX_LED_UDD_CNTX(1), 32);
496 cvmx_write_csr(CVMX_LED_UDD_DATX(0), 0);
497 cvmx_write_csr(CVMX_LED_UDD_DATX(1), 0);
498 cvmx_write_csr(CVMX_LED_EN, 1);
499 }
500#ifdef CONFIG_CAVIUM_RESERVE32
501 /*
502 * We need to temporarily allocate all memory in the reserve32
503 * region. This makes sure the kernel doesn't allocate this
504 * memory when it is getting memory from the
505 * bootloader. Later, after the memory allocations are
506 * complete, the reserve32 will be freed.
507 */
508#ifdef CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB
509 if (CONFIG_CAVIUM_RESERVE32 & 0x1ff)
510 pr_err("CAVIUM_RESERVE32 isn't a multiple of 512MB. "
511 "This is required if CAVIUM_RESERVE32_USE_WIRED_TLB "
512 "is set\n");
513 else
514 addr = cvmx_bootmem_phy_named_block_alloc(CONFIG_CAVIUM_RESERVE32 << 20,
515 0, 0, 512 << 20,
516 "CAVIUM_RESERVE32", 0);
517#else
518 /*
519 * Allocate memory for RESERVED32 aligned on 2MB boundary. This
520 * is in case we later use hugetlb entries with it.
521 */
522 addr = cvmx_bootmem_phy_named_block_alloc(CONFIG_CAVIUM_RESERVE32 << 20,
523 0, 0, 2 << 20,
524 "CAVIUM_RESERVE32", 0);
525#endif
526 if (addr < 0)
527 pr_err("Failed to allocate CAVIUM_RESERVE32 memory area\n");
528 else
529 octeon_reserve32_memory = addr;
530#endif
531
532#ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2
533 if (cvmx_read_csr(CVMX_L2D_FUS3) & (3ull << 34)) {
534 pr_info("Skipping L2 locking due to reduced L2 cache size\n");
535 } else {
536 uint32_t ebase = read_c0_ebase() & 0x3ffff000;
537#ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_TLB
538 /* TLB refill */
539 cvmx_l2c_lock_mem_region(ebase, 0x100);
540#endif
541#ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_EXCEPTION
542 /* General exception */
543 cvmx_l2c_lock_mem_region(ebase + 0x180, 0x80);
544#endif
545#ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_LOW_LEVEL_INTERRUPT
546 /* Interrupt handler */
547 cvmx_l2c_lock_mem_region(ebase + 0x200, 0x80);
548#endif
549#ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_INTERRUPT
550 cvmx_l2c_lock_mem_region(__pa_symbol(handle_int), 0x100);
551 cvmx_l2c_lock_mem_region(__pa_symbol(plat_irq_dispatch), 0x80);
552#endif
553#ifdef CONFIG_CAVIUM_OCTEON_LOCK_L2_MEMCPY
554 cvmx_l2c_lock_mem_region(__pa_symbol(memcpy), 0x480);
555#endif
556 }
557#endif
558
559 sysinfo = cvmx_sysinfo_get();
560 memset(sysinfo, 0, sizeof(*sysinfo));
561 sysinfo->system_dram_size = octeon_bootinfo->dram_size << 20;
562 sysinfo->phy_mem_desc_ptr =
563 cvmx_phys_to_ptr(octeon_bootinfo->phy_mem_desc_addr);
564 sysinfo->core_mask = octeon_bootinfo->core_mask;
565 sysinfo->exception_base_addr = octeon_bootinfo->exception_base_addr;
566 sysinfo->cpu_clock_hz = octeon_bootinfo->eclock_hz;
567 sysinfo->dram_data_rate_hz = octeon_bootinfo->dclock_hz * 2;
568 sysinfo->board_type = octeon_bootinfo->board_type;
569 sysinfo->board_rev_major = octeon_bootinfo->board_rev_major;
570 sysinfo->board_rev_minor = octeon_bootinfo->board_rev_minor;
571 memcpy(sysinfo->mac_addr_base, octeon_bootinfo->mac_addr_base,
572 sizeof(sysinfo->mac_addr_base));
573 sysinfo->mac_addr_count = octeon_bootinfo->mac_addr_count;
574 memcpy(sysinfo->board_serial_number,
575 octeon_bootinfo->board_serial_number,
576 sizeof(sysinfo->board_serial_number));
577 sysinfo->compact_flash_common_base_addr =
578 octeon_bootinfo->compact_flash_common_base_addr;
579 sysinfo->compact_flash_attribute_base_addr =
580 octeon_bootinfo->compact_flash_attribute_base_addr;
581 sysinfo->led_display_base_addr = octeon_bootinfo->led_display_base_addr;
582 sysinfo->dfa_ref_clock_hz = octeon_bootinfo->dfa_ref_clock_hz;
583 sysinfo->bootloader_config_flags = octeon_bootinfo->config_flags;
584
585
586 octeon_check_cpu_bist();
587
588 octeon_uart = octeon_get_boot_uart();
589
590 /*
591 * Disable All CIU Interrupts. The ones we need will be
592 * enabled later. Read the SUM register so we know the write
593 * completed.
594 */
595 cvmx_write_csr(CVMX_CIU_INTX_EN0((coreid * 2)), 0);
596 cvmx_write_csr(CVMX_CIU_INTX_EN0((coreid * 2 + 1)), 0);
597 cvmx_write_csr(CVMX_CIU_INTX_EN1((coreid * 2)), 0);
598 cvmx_write_csr(CVMX_CIU_INTX_EN1((coreid * 2 + 1)), 0);
599 cvmx_read_csr(CVMX_CIU_INTX_SUM0((coreid * 2)));
600
601#ifdef CONFIG_SMP
602 octeon_write_lcd("LinuxSMP");
603#else
604 octeon_write_lcd("Linux");
605#endif
606
607#ifdef CONFIG_CAVIUM_GDB
608 /*
609 * When debugging the linux kernel, force the cores to enter
610 * the debug exception handler to break in.
611 */
612 if (octeon_get_boot_debug_flag()) {
613 cvmx_write_csr(CVMX_CIU_DINT, 1 << cvmx_get_core_num());
614 cvmx_read_csr(CVMX_CIU_DINT);
615 }
616#endif
617
618 /*
619 * BIST should always be enabled when doing a soft reset. L2
620 * Cache locking for instance is not cleared unless BIST is
621 * enabled. Unfortunately due to a chip errata G-200 for
622 * Cn38XX and CN31XX, BIST msut be disabled on these parts.
623 */
624 if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS2) ||
625 OCTEON_IS_MODEL(OCTEON_CN31XX))
626 cvmx_write_csr(CVMX_CIU_SOFT_BIST, 0);
627 else
628 cvmx_write_csr(CVMX_CIU_SOFT_BIST, 1);
629
630 /* Default to 64MB in the simulator to speed things up */
631 if (octeon_is_simulation())
632 MAX_MEMORY = 64ull << 20;
633
634 arcs_cmdline[0] = 0;
635 argc = octeon_boot_desc_ptr->argc;
636 for (i = 0; i < argc; i++) {
637 const char *arg =
638 cvmx_phys_to_ptr(octeon_boot_desc_ptr->argv[i]);
639 if ((strncmp(arg, "MEM=", 4) == 0) ||
640 (strncmp(arg, "mem=", 4) == 0)) {
641 sscanf(arg + 4, "%llu", &MAX_MEMORY);
642 MAX_MEMORY <<= 20;
643 if (MAX_MEMORY == 0)
644 MAX_MEMORY = 32ull << 30;
645 } else if (strcmp(arg, "ecc_verbose") == 0) {
646#ifdef CONFIG_CAVIUM_REPORT_SINGLE_BIT_ECC
647 __cvmx_interrupt_ecc_report_single_bit_errors = 1;
648 pr_notice("Reporting of single bit ECC errors is "
649 "turned on\n");
650#endif
651 } else if (strlen(arcs_cmdline) + strlen(arg) + 1 <
652 sizeof(arcs_cmdline) - 1) {
653 strcat(arcs_cmdline, " ");
654 strcat(arcs_cmdline, arg);
655 }
656 }
657
658 if (strstr(arcs_cmdline, "console=") == NULL) {
659#ifdef CONFIG_GDB_CONSOLE
660 strcat(arcs_cmdline, " console=gdb");
661#else
662#ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL
663 strcat(arcs_cmdline, " console=ttyS0,115200");
664#else
665 if (octeon_uart == 1)
666 strcat(arcs_cmdline, " console=ttyS1,115200");
667 else
668 strcat(arcs_cmdline, " console=ttyS0,115200");
669#endif
670#endif
671 }
672
673 if (octeon_is_simulation()) {
674 /*
675 * The simulator uses a mtdram device pre filled with
676 * the filesystem. Also specify the calibration delay
677 * to avoid calculating it every time.
678 */
679 strcat(arcs_cmdline, " rw root=1f00"
680 " lpj=60176 slram=root,0x40000000,+1073741824");
681 }
682
683 mips_hpt_frequency = octeon_get_clock_rate();
684
685 octeon_init_cvmcount();
686
687 _machine_restart = octeon_restart;
688 _machine_halt = octeon_halt;
689
690 memset(&octeon_port, 0, sizeof(octeon_port));
691 /*
692 * For early_serial_setup we don't set the port type or
693 * UPF_FIXED_TYPE.
694 */
695 octeon_port.flags = ASYNC_SKIP_TEST | UPF_SHARE_IRQ;
696 octeon_port.iotype = UPIO_MEM;
697 /* I/O addresses are every 8 bytes */
698 octeon_port.regshift = 3;
699 /* Clock rate of the chip */
700 octeon_port.uartclk = mips_hpt_frequency;
701 octeon_port.fifosize = 64;
702 octeon_port.mapbase = 0x0001180000000800ull + (1024 * octeon_uart);
703 octeon_port.membase = cvmx_phys_to_ptr(octeon_port.mapbase);
704 octeon_port.serial_in = octeon_serial_in;
705 octeon_port.serial_out = octeon_serial_out;
706#ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL
707 octeon_port.line = 0;
708#else
709 octeon_port.line = octeon_uart;
710#endif
711 octeon_port.irq = 42 + octeon_uart;
712 early_serial_setup(&octeon_port);
713
714 octeon_user_io_init();
715 register_smp_ops(&octeon_smp_ops);
716}
717
718void __init plat_mem_setup(void)
719{
720 uint64_t mem_alloc_size;
721 uint64_t total;
722 int64_t memory;
723
724 total = 0;
725
726 /* First add the init memory we will be returning. */
727 memory = __pa_symbol(&__init_begin) & PAGE_MASK;
728 mem_alloc_size = (__pa_symbol(&__init_end) & PAGE_MASK) - memory;
729 if (mem_alloc_size > 0) {
730 add_memory_region(memory, mem_alloc_size, BOOT_MEM_RAM);
731 total += mem_alloc_size;
732 }
733
734 /*
735 * The Mips memory init uses the first memory location for
736 * some memory vectors. When SPARSEMEM is in use, it doesn't
737 * verify that the size is big enough for the final
738 * vectors. Making the smallest chuck 4MB seems to be enough
739 * to consistantly work.
740 */
741 mem_alloc_size = 4 << 20;
742 if (mem_alloc_size > MAX_MEMORY)
743 mem_alloc_size = MAX_MEMORY;
744
745 /*
746 * When allocating memory, we want incrementing addresses from
747 * bootmem_alloc so the code in add_memory_region can merge
748 * regions next to each other.
749 */
750 cvmx_bootmem_lock();
751 while ((boot_mem_map.nr_map < BOOT_MEM_MAP_MAX)
752 && (total < MAX_MEMORY)) {
753#if defined(CONFIG_64BIT) || defined(CONFIG_64BIT_PHYS_ADDR)
754 memory = cvmx_bootmem_phy_alloc(mem_alloc_size,
755 __pa_symbol(&__init_end), -1,
756 0x100000,
757 CVMX_BOOTMEM_FLAG_NO_LOCKING);
758#elif defined(CONFIG_HIGHMEM)
759 memory = cvmx_bootmem_phy_alloc(mem_alloc_size, 0, 1ull << 31,
760 0x100000,
761 CVMX_BOOTMEM_FLAG_NO_LOCKING);
762#else
763 memory = cvmx_bootmem_phy_alloc(mem_alloc_size, 0, 512 << 20,
764 0x100000,
765 CVMX_BOOTMEM_FLAG_NO_LOCKING);
766#endif
767 if (memory >= 0) {
768 /*
769 * This function automatically merges address
770 * regions next to each other if they are
771 * received in incrementing order.
772 */
773 add_memory_region(memory, mem_alloc_size, BOOT_MEM_RAM);
774 total += mem_alloc_size;
775 } else {
776 break;
777 }
778 }
779 cvmx_bootmem_unlock();
780
781#ifdef CONFIG_CAVIUM_RESERVE32
782 /*
783 * Now that we've allocated the kernel memory it is safe to
784 * free the reserved region. We free it here so that builtin
785 * drivers can use the memory.
786 */
787 if (octeon_reserve32_memory)
788 cvmx_bootmem_free_named("CAVIUM_RESERVE32");
789#endif /* CONFIG_CAVIUM_RESERVE32 */
790
791 if (total == 0)
792 panic("Unable to allocate memory from "
793 "cvmx_bootmem_phy_alloc\n");
794}
795
796
797int prom_putchar(char c)
798{
799 uint64_t lsrval;
800
801 /* Spin until there is room */
802 do {
803 lsrval = cvmx_read_csr(CVMX_MIO_UARTX_LSR(octeon_uart));
804 } while ((lsrval & 0x20) == 0);
805
806 /* Write the byte */
807 cvmx_write_csr(CVMX_MIO_UARTX_THR(octeon_uart), c);
808 return 1;
809}
810
811void prom_free_prom_memory(void)
812{
813#ifdef CONFIG_CAVIUM_DECODE_RSL
814 cvmx_interrupt_rsl_enable();
815
816 /* Add an interrupt handler for general failures. */
817 if (request_irq(OCTEON_IRQ_RML, octeon_rlm_interrupt, IRQF_SHARED,
818 "RML/RSL", octeon_rlm_interrupt)) {
819 panic("Unable to request_irq(OCTEON_IRQ_RML)\n");
820 }
821#endif
822
823 /* This call is here so that it is performed after any TLB
824 initializations. It needs to be after these in case the
825 CONFIG_CAVIUM_RESERVE32_USE_WIRED_TLB option is set */
826 octeon_hal_setup_reserved32();
827}
828
829static struct octeon_cf_data octeon_cf_data;
830
831static int __init octeon_cf_device_init(void)
832{
833 union cvmx_mio_boot_reg_cfgx mio_boot_reg_cfg;
834 unsigned long base_ptr, region_base, region_size;
835 struct platform_device *pd;
836 struct resource cf_resources[3];
837 unsigned int num_resources;
838 int i;
839 int ret = 0;
840
841 /* Setup octeon-cf platform device if present. */
842 base_ptr = 0;
843 if (octeon_bootinfo->major_version == 1
844 && octeon_bootinfo->minor_version >= 1) {
845 if (octeon_bootinfo->compact_flash_common_base_addr)
846 base_ptr =
847 octeon_bootinfo->compact_flash_common_base_addr;
848 } else {
849 base_ptr = 0x1d000800;
850 }
851
852 if (!base_ptr)
853 return ret;
854
855 /* Find CS0 region. */
856 for (i = 0; i < 8; i++) {
857 mio_boot_reg_cfg.u64 = cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(i));
858 region_base = mio_boot_reg_cfg.s.base << 16;
859 region_size = (mio_boot_reg_cfg.s.size + 1) << 16;
860 if (mio_boot_reg_cfg.s.en && base_ptr >= region_base
861 && base_ptr < region_base + region_size)
862 break;
863 }
864 if (i >= 7) {
865 /* i and i + 1 are CS0 and CS1, both must be less than 8. */
866 goto out;
867 }
868 octeon_cf_data.base_region = i;
869 octeon_cf_data.is16bit = mio_boot_reg_cfg.s.width;
870 octeon_cf_data.base_region_bias = base_ptr - region_base;
871 memset(cf_resources, 0, sizeof(cf_resources));
872 num_resources = 0;
873 cf_resources[num_resources].flags = IORESOURCE_MEM;
874 cf_resources[num_resources].start = region_base;
875 cf_resources[num_resources].end = region_base + region_size - 1;
876 num_resources++;
877
878
879 if (!(base_ptr & 0xfffful)) {
880 /*
881 * Boot loader signals availability of DMA (true_ide
882 * mode) by setting low order bits of base_ptr to
883 * zero.
884 */
885
886 /* Asume that CS1 immediately follows. */
887 mio_boot_reg_cfg.u64 =
888 cvmx_read_csr(CVMX_MIO_BOOT_REG_CFGX(i + 1));
889 region_base = mio_boot_reg_cfg.s.base << 16;
890 region_size = (mio_boot_reg_cfg.s.size + 1) << 16;
891 if (!mio_boot_reg_cfg.s.en)
892 goto out;
893
894 cf_resources[num_resources].flags = IORESOURCE_MEM;
895 cf_resources[num_resources].start = region_base;
896 cf_resources[num_resources].end = region_base + region_size - 1;
897 num_resources++;
898
899 octeon_cf_data.dma_engine = 0;
900 cf_resources[num_resources].flags = IORESOURCE_IRQ;
901 cf_resources[num_resources].start = OCTEON_IRQ_BOOTDMA;
902 cf_resources[num_resources].end = OCTEON_IRQ_BOOTDMA;
903 num_resources++;
904 } else {
905 octeon_cf_data.dma_engine = -1;
906 }
907
908 pd = platform_device_alloc("pata_octeon_cf", -1);
909 if (!pd) {
910 ret = -ENOMEM;
911 goto out;
912 }
913 pd->dev.platform_data = &octeon_cf_data;
914
915 ret = platform_device_add_resources(pd, cf_resources, num_resources);
916 if (ret)
917 goto fail;
918
919 ret = platform_device_add(pd);
920 if (ret)
921 goto fail;
922
923 return ret;
924fail:
925 platform_device_put(pd);
926out:
927 return ret;
928}
929device_initcall(octeon_cf_device_init);
diff --git a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
new file mode 100644
index 000000000000..24e0ad63980a
--- /dev/null
+++ b/arch/mips/cavium-octeon/smp.c
@@ -0,0 +1,211 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004-2008 Cavium Networks
7 */
8#include <linux/init.h>
9#include <linux/delay.h>
10#include <linux/smp.h>
11#include <linux/interrupt.h>
12#include <linux/kernel_stat.h>
13#include <linux/sched.h>
14#include <linux/module.h>
15
16#include <asm/mmu_context.h>
17#include <asm/system.h>
18#include <asm/time.h>
19
20#include <asm/octeon/octeon.h>
21
22volatile unsigned long octeon_processor_boot = 0xff;
23volatile unsigned long octeon_processor_sp;
24volatile unsigned long octeon_processor_gp;
25
26static irqreturn_t mailbox_interrupt(int irq, void *dev_id)
27{
28 const int coreid = cvmx_get_core_num();
29 uint64_t action;
30
31 /* Load the mailbox register to figure out what we're supposed to do */
32 action = cvmx_read_csr(CVMX_CIU_MBOX_CLRX(coreid));
33
34 /* Clear the mailbox to clear the interrupt */
35 cvmx_write_csr(CVMX_CIU_MBOX_CLRX(coreid), action);
36
37 if (action & SMP_CALL_FUNCTION)
38 smp_call_function_interrupt();
39
40 /* Check if we've been told to flush the icache */
41 if (action & SMP_ICACHE_FLUSH)
42 asm volatile ("synci 0($0)\n");
43 return IRQ_HANDLED;
44}
45
46/**
47 * Cause the function described by call_data to be executed on the passed
48 * cpu. When the function has finished, increment the finished field of
49 * call_data.
50 */
51void octeon_send_ipi_single(int cpu, unsigned int action)
52{
53 int coreid = cpu_logical_map(cpu);
54 /*
55 pr_info("SMP: Mailbox send cpu=%d, coreid=%d, action=%u\n", cpu,
56 coreid, action);
57 */
58 cvmx_write_csr(CVMX_CIU_MBOX_SETX(coreid), action);
59}
60
61static inline void octeon_send_ipi_mask(cpumask_t mask, unsigned int action)
62{
63 unsigned int i;
64
65 for_each_cpu_mask(i, mask)
66 octeon_send_ipi_single(i, action);
67}
68
69/**
70 * Detect available CPUs, populate phys_cpu_present_map
71 */
72static void octeon_smp_setup(void)
73{
74 const int coreid = cvmx_get_core_num();
75 int cpus;
76 int id;
77
78 int core_mask = octeon_get_boot_coremask();
79
80 cpus_clear(cpu_possible_map);
81 __cpu_number_map[coreid] = 0;
82 __cpu_logical_map[0] = coreid;
83 cpu_set(0, cpu_possible_map);
84
85 cpus = 1;
86 for (id = 0; id < 16; id++) {
87 if ((id != coreid) && (core_mask & (1 << id))) {
88 cpu_set(cpus, cpu_possible_map);
89 __cpu_number_map[id] = cpus;
90 __cpu_logical_map[cpus] = id;
91 cpus++;
92 }
93 }
94}
95
96/**
97 * Firmware CPU startup hook
98 *
99 */
100static void octeon_boot_secondary(int cpu, struct task_struct *idle)
101{
102 int count;
103
104 pr_info("SMP: Booting CPU%02d (CoreId %2d)...\n", cpu,
105 cpu_logical_map(cpu));
106
107 octeon_processor_sp = __KSTK_TOS(idle);
108 octeon_processor_gp = (unsigned long)(task_thread_info(idle));
109 octeon_processor_boot = cpu_logical_map(cpu);
110 mb();
111
112 count = 10000;
113 while (octeon_processor_sp && count) {
114 /* Waiting for processor to get the SP and GP */
115 udelay(1);
116 count--;
117 }
118 if (count == 0)
119 pr_err("Secondary boot timeout\n");
120}
121
122/**
123 * After we've done initial boot, this function is called to allow the
124 * board code to clean up state, if needed
125 */
126static void octeon_init_secondary(void)
127{
128 const int coreid = cvmx_get_core_num();
129 union cvmx_ciu_intx_sum0 interrupt_enable;
130
131 octeon_check_cpu_bist();
132 octeon_init_cvmcount();
133 /*
134 pr_info("SMP: CPU%d (CoreId %lu) started\n", cpu, coreid);
135 */
136 /* Enable Mailbox interrupts to this core. These are the only
137 interrupts allowed on line 3 */
138 cvmx_write_csr(CVMX_CIU_MBOX_CLRX(coreid), 0xffffffff);
139 interrupt_enable.u64 = 0;
140 interrupt_enable.s.mbox = 0x3;
141 cvmx_write_csr(CVMX_CIU_INTX_EN0((coreid * 2)), interrupt_enable.u64);
142 cvmx_write_csr(CVMX_CIU_INTX_EN0((coreid * 2 + 1)), 0);
143 cvmx_write_csr(CVMX_CIU_INTX_EN1((coreid * 2)), 0);
144 cvmx_write_csr(CVMX_CIU_INTX_EN1((coreid * 2 + 1)), 0);
145 /* Enable core interrupt processing for 2,3 and 7 */
146 set_c0_status(0x8c01);
147}
148
149/**
150 * Callout to firmware before smp_init
151 *
152 */
153void octeon_prepare_cpus(unsigned int max_cpus)
154{
155 cvmx_write_csr(CVMX_CIU_MBOX_CLRX(cvmx_get_core_num()), 0xffffffff);
156 if (request_irq(OCTEON_IRQ_MBOX0, mailbox_interrupt, IRQF_SHARED,
157 "mailbox0", mailbox_interrupt)) {
158 panic("Cannot request_irq(OCTEON_IRQ_MBOX0)\n");
159 }
160 if (request_irq(OCTEON_IRQ_MBOX1, mailbox_interrupt, IRQF_SHARED,
161 "mailbox1", mailbox_interrupt)) {
162 panic("Cannot request_irq(OCTEON_IRQ_MBOX1)\n");
163 }
164}
165
166/**
167 * Last chance for the board code to finish SMP initialization before
168 * the CPU is "online".
169 */
170static void octeon_smp_finish(void)
171{
172#ifdef CONFIG_CAVIUM_GDB
173 unsigned long tmp;
174 /* Pulse MCD0 signal on Ctrl-C to stop all the cores. Also set the MCD0
175 to be not masked by this core so we know the signal is received by
176 someone */
177 asm volatile ("dmfc0 %0, $22\n"
178 "ori %0, %0, 0x9100\n" "dmtc0 %0, $22\n" : "=r" (tmp));
179#endif
180
181 octeon_user_io_init();
182
183 /* to generate the first CPU timer interrupt */
184 write_c0_compare(read_c0_count() + mips_hpt_frequency / HZ);
185}
186
187/**
188 * Hook for after all CPUs are online
189 */
190static void octeon_cpus_done(void)
191{
192#ifdef CONFIG_CAVIUM_GDB
193 unsigned long tmp;
194 /* Pulse MCD0 signal on Ctrl-C to stop all the cores. Also set the MCD0
195 to be not masked by this core so we know the signal is received by
196 someone */
197 asm volatile ("dmfc0 %0, $22\n"
198 "ori %0, %0, 0x9100\n" "dmtc0 %0, $22\n" : "=r" (tmp));
199#endif
200}
201
202struct plat_smp_ops octeon_smp_ops = {
203 .send_ipi_single = octeon_send_ipi_single,
204 .send_ipi_mask = octeon_send_ipi_mask,
205 .init_secondary = octeon_init_secondary,
206 .smp_finish = octeon_smp_finish,
207 .cpus_done = octeon_cpus_done,
208 .boot_secondary = octeon_boot_secondary,
209 .smp_setup = octeon_smp_setup,
210 .prepare_cpus = octeon_prepare_cpus,
211};
diff --git a/arch/mips/configs/cavium-octeon_defconfig b/arch/mips/configs/cavium-octeon_defconfig
new file mode 100644
index 000000000000..7afaa28a3768
--- /dev/null
+++ b/arch/mips/configs/cavium-octeon_defconfig
@@ -0,0 +1,943 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc6
4# Wed Dec 3 11:00:58 2008
5#
6CONFIG_MIPS=y
7
8#
9# Machine selection
10#
11# CONFIG_MACH_ALCHEMY is not set
12# CONFIG_BASLER_EXCITE is not set
13# CONFIG_BCM47XX is not set
14# CONFIG_MIPS_COBALT is not set
15# CONFIG_MACH_DECSTATION is not set
16# CONFIG_MACH_JAZZ is not set
17# CONFIG_LASAT is not set
18# CONFIG_LEMOTE_FULONG is not set
19# CONFIG_MIPS_MALTA is not set
20# CONFIG_MIPS_SIM is not set
21# CONFIG_MACH_EMMA is not set
22# CONFIG_MACH_VR41XX is not set
23# CONFIG_NXP_STB220 is not set
24# CONFIG_NXP_STB225 is not set
25# CONFIG_PNX8550_JBS is not set
26# CONFIG_PNX8550_STB810 is not set
27# CONFIG_PMC_MSP is not set
28# CONFIG_PMC_YOSEMITE is not set
29# CONFIG_SGI_IP22 is not set
30# CONFIG_SGI_IP27 is not set
31# CONFIG_SGI_IP28 is not set
32# CONFIG_SGI_IP32 is not set
33# CONFIG_SIBYTE_CRHINE is not set
34# CONFIG_SIBYTE_CARMEL is not set
35# CONFIG_SIBYTE_CRHONE is not set
36# CONFIG_SIBYTE_RHONE is not set
37# CONFIG_SIBYTE_SWARM is not set
38# CONFIG_SIBYTE_LITTLESUR is not set
39# CONFIG_SIBYTE_SENTOSA is not set
40# CONFIG_SIBYTE_BIGSUR is not set
41# CONFIG_SNI_RM is not set
42# CONFIG_MACH_TX39XX is not set
43# CONFIG_MACH_TX49XX is not set
44# CONFIG_MIKROTIK_RB532 is not set
45# CONFIG_WR_PPMC is not set
46# CONFIG_CAVIUM_OCTEON_SIMULATOR is not set
47CONFIG_CAVIUM_OCTEON_REFERENCE_BOARD=y
48CONFIG_CAVIUM_OCTEON_SPECIFIC_OPTIONS=y
49# CONFIG_CAVIUM_OCTEON_2ND_KERNEL is not set
50CONFIG_CAVIUM_OCTEON_HW_FIX_UNALIGNED=y
51CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE=2
52CONFIG_CAVIUM_OCTEON_LOCK_L2=y
53CONFIG_CAVIUM_OCTEON_LOCK_L2_TLB=y
54CONFIG_CAVIUM_OCTEON_LOCK_L2_EXCEPTION=y
55CONFIG_CAVIUM_OCTEON_LOCK_L2_LOW_LEVEL_INTERRUPT=y
56CONFIG_CAVIUM_OCTEON_LOCK_L2_INTERRUPT=y
57CONFIG_CAVIUM_OCTEON_LOCK_L2_MEMCPY=y
58CONFIG_ARCH_SPARSEMEM_ENABLE=y
59CONFIG_RWSEM_GENERIC_SPINLOCK=y
60# CONFIG_ARCH_HAS_ILOG2_U32 is not set
61# CONFIG_ARCH_HAS_ILOG2_U64 is not set
62CONFIG_ARCH_SUPPORTS_OPROFILE=y
63CONFIG_GENERIC_FIND_NEXT_BIT=y
64CONFIG_GENERIC_HWEIGHT=y
65CONFIG_GENERIC_CALIBRATE_DELAY=y
66CONFIG_GENERIC_CLOCKEVENTS=y
67CONFIG_GENERIC_TIME=y
68CONFIG_GENERIC_CMOS_UPDATE=y
69CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
70# CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ is not set
71CONFIG_CEVT_R4K=y
72CONFIG_CSRC_R4K=y
73CONFIG_DMA_COHERENT=y
74# CONFIG_EARLY_PRINTK is not set
75CONFIG_SYS_HAS_EARLY_PRINTK=y
76# CONFIG_HOTPLUG_CPU is not set
77# CONFIG_NO_IOPORT is not set
78CONFIG_CPU_BIG_ENDIAN=y
79# CONFIG_CPU_LITTLE_ENDIAN is not set
80CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y
81CONFIG_IRQ_CPU=y
82CONFIG_IRQ_CPU_OCTEON=y
83CONFIG_SWAP_IO_SPACE=y
84CONFIG_MIPS_L1_CACHE_SHIFT=7
85
86#
87# CPU selection
88#
89# CONFIG_CPU_LOONGSON2 is not set
90# CONFIG_CPU_MIPS32_R1 is not set
91# CONFIG_CPU_MIPS32_R2 is not set
92# CONFIG_CPU_MIPS64_R1 is not set
93# CONFIG_CPU_MIPS64_R2 is not set
94# CONFIG_CPU_R3000 is not set
95# CONFIG_CPU_TX39XX is not set
96# CONFIG_CPU_VR41XX is not set
97# CONFIG_CPU_R4300 is not set
98# CONFIG_CPU_R4X00 is not set
99# CONFIG_CPU_TX49XX is not set
100# CONFIG_CPU_R5000 is not set
101# CONFIG_CPU_R5432 is not set
102# CONFIG_CPU_R5500 is not set
103# CONFIG_CPU_R6000 is not set
104# CONFIG_CPU_NEVADA is not set
105# CONFIG_CPU_R8000 is not set
106# CONFIG_CPU_R10000 is not set
107# CONFIG_CPU_RM7000 is not set
108# CONFIG_CPU_RM9000 is not set
109# CONFIG_CPU_SB1 is not set
110CONFIG_CPU_CAVIUM_OCTEON=y
111CONFIG_WEAK_ORDERING=y
112CONFIG_WEAK_REORDERING_BEYOND_LLSC=y
113CONFIG_CPU_MIPSR2=y
114CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y
115CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y
116
117#
118# Kernel type
119#
120# CONFIG_32BIT is not set
121CONFIG_64BIT=y
122CONFIG_PAGE_SIZE_4KB=y
123# CONFIG_PAGE_SIZE_8KB is not set
124# CONFIG_PAGE_SIZE_16KB is not set
125# CONFIG_PAGE_SIZE_64KB is not set
126CONFIG_CPU_HAS_PREFETCH=y
127CONFIG_MIPS_MT_DISABLED=y
128# CONFIG_MIPS_MT_SMP is not set
129# CONFIG_MIPS_MT_SMTC is not set
130CONFIG_64BIT_PHYS_ADDR=y
131CONFIG_CPU_HAS_SYNC=y
132CONFIG_GENERIC_HARDIRQS=y
133CONFIG_GENERIC_IRQ_PROBE=y
134CONFIG_IRQ_PER_CPU=y
135CONFIG_CPU_SUPPORTS_HIGHMEM=y
136CONFIG_SYS_SUPPORTS_HIGHMEM=y
137CONFIG_ARCH_FLATMEM_ENABLE=y
138CONFIG_ARCH_POPULATES_NODE_MAP=y
139CONFIG_SELECT_MEMORY_MODEL=y
140# CONFIG_FLATMEM_MANUAL is not set
141# CONFIG_DISCONTIGMEM_MANUAL is not set
142CONFIG_SPARSEMEM_MANUAL=y
143CONFIG_SPARSEMEM=y
144CONFIG_HAVE_MEMORY_PRESENT=y
145CONFIG_SPARSEMEM_STATIC=y
146CONFIG_PAGEFLAGS_EXTENDED=y
147CONFIG_SPLIT_PTLOCK_CPUS=4
148CONFIG_RESOURCES_64BIT=y
149CONFIG_PHYS_ADDR_T_64BIT=y
150CONFIG_ZONE_DMA_FLAG=0
151CONFIG_VIRT_TO_BUS=y
152CONFIG_UNEVICTABLE_LRU=y
153CONFIG_SMP=y
154CONFIG_SYS_SUPPORTS_SMP=y
155CONFIG_NR_CPUS_DEFAULT_16=y
156CONFIG_NR_CPUS=16
157# CONFIG_NO_HZ is not set
158# CONFIG_HIGH_RES_TIMERS is not set
159CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
160# CONFIG_HZ_48 is not set
161# CONFIG_HZ_100 is not set
162# CONFIG_HZ_128 is not set
163CONFIG_HZ_250=y
164# CONFIG_HZ_256 is not set
165# CONFIG_HZ_1000 is not set
166# CONFIG_HZ_1024 is not set
167CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
168CONFIG_HZ=250
169# CONFIG_PREEMPT_NONE is not set
170# CONFIG_PREEMPT_VOLUNTARY is not set
171CONFIG_PREEMPT=y
172# CONFIG_PREEMPT_RCU is not set
173# CONFIG_KEXEC is not set
174CONFIG_SECCOMP=y
175CONFIG_LOCKDEP_SUPPORT=y
176CONFIG_STACKTRACE_SUPPORT=y
177CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
178
179#
180# General setup
181#
182CONFIG_EXPERIMENTAL=y
183CONFIG_LOCK_KERNEL=y
184CONFIG_INIT_ENV_ARG_LIMIT=32
185CONFIG_LOCALVERSION=""
186CONFIG_LOCALVERSION_AUTO=y
187CONFIG_SWAP=y
188CONFIG_SYSVIPC=y
189CONFIG_SYSVIPC_SYSCTL=y
190CONFIG_POSIX_MQUEUE=y
191CONFIG_BSD_PROCESS_ACCT=y
192CONFIG_BSD_PROCESS_ACCT_V3=y
193# CONFIG_TASKSTATS is not set
194# CONFIG_AUDIT is not set
195CONFIG_IKCONFIG=y
196CONFIG_IKCONFIG_PROC=y
197CONFIG_LOG_BUF_SHIFT=14
198# CONFIG_CGROUPS is not set
199CONFIG_GROUP_SCHED=y
200CONFIG_FAIR_GROUP_SCHED=y
201# CONFIG_RT_GROUP_SCHED is not set
202CONFIG_USER_SCHED=y
203# CONFIG_CGROUP_SCHED is not set
204CONFIG_SYSFS_DEPRECATED=y
205CONFIG_SYSFS_DEPRECATED_V2=y
206CONFIG_RELAY=y
207# CONFIG_NAMESPACES is not set
208CONFIG_BLK_DEV_INITRD=y
209CONFIG_INITRAMFS_SOURCE=""
210# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
211CONFIG_SYSCTL=y
212CONFIG_EMBEDDED=y
213CONFIG_SYSCTL_SYSCALL=y
214CONFIG_KALLSYMS=y
215# CONFIG_KALLSYMS_ALL is not set
216# CONFIG_KALLSYMS_EXTRA_PASS is not set
217CONFIG_HOTPLUG=y
218CONFIG_PRINTK=y
219CONFIG_BUG=y
220CONFIG_ELF_CORE=y
221# CONFIG_PCSPKR_PLATFORM is not set
222CONFIG_COMPAT_BRK=y
223CONFIG_BASE_FULL=y
224CONFIG_FUTEX=y
225CONFIG_ANON_INODES=y
226CONFIG_EPOLL=y
227CONFIG_SIGNALFD=y
228CONFIG_TIMERFD=y
229CONFIG_EVENTFD=y
230CONFIG_SHMEM=y
231CONFIG_AIO=y
232CONFIG_VM_EVENT_COUNTERS=y
233CONFIG_SLAB=y
234# CONFIG_SLUB is not set
235# CONFIG_SLOB is not set
236# CONFIG_PROFILING is not set
237# CONFIG_MARKERS is not set
238CONFIG_HAVE_OPROFILE=y
239CONFIG_USE_GENERIC_SMP_HELPERS=y
240# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
241CONFIG_SLABINFO=y
242CONFIG_RT_MUTEXES=y
243# CONFIG_TINY_SHMEM is not set
244CONFIG_BASE_SMALL=0
245CONFIG_MODULES=y
246# CONFIG_MODULE_FORCE_LOAD is not set
247CONFIG_MODULE_UNLOAD=y
248# CONFIG_MODULE_FORCE_UNLOAD is not set
249# CONFIG_MODVERSIONS is not set
250# CONFIG_MODULE_SRCVERSION_ALL is not set
251CONFIG_KMOD=y
252CONFIG_STOP_MACHINE=y
253CONFIG_BLOCK=y
254# CONFIG_BLK_DEV_IO_TRACE is not set
255# CONFIG_BLK_DEV_BSG is not set
256# CONFIG_BLK_DEV_INTEGRITY is not set
257CONFIG_BLOCK_COMPAT=y
258
259#
260# IO Schedulers
261#
262CONFIG_IOSCHED_NOOP=y
263CONFIG_IOSCHED_AS=y
264CONFIG_IOSCHED_DEADLINE=y
265CONFIG_IOSCHED_CFQ=y
266# CONFIG_DEFAULT_AS is not set
267# CONFIG_DEFAULT_DEADLINE is not set
268CONFIG_DEFAULT_CFQ=y
269# CONFIG_DEFAULT_NOOP is not set
270CONFIG_DEFAULT_IOSCHED="cfq"
271CONFIG_CLASSIC_RCU=y
272# CONFIG_PROBE_INITRD_HEADER is not set
273# CONFIG_FREEZER is not set
274
275#
276# Bus options (PCI, PCMCIA, EISA, ISA, TC)
277#
278# CONFIG_ARCH_SUPPORTS_MSI is not set
279CONFIG_MMU=y
280# CONFIG_PCCARD is not set
281
282#
283# Executable file formats
284#
285CONFIG_BINFMT_ELF=y
286# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
287# CONFIG_HAVE_AOUT is not set
288# CONFIG_BINFMT_MISC is not set
289CONFIG_MIPS32_COMPAT=y
290CONFIG_COMPAT=y
291CONFIG_SYSVIPC_COMPAT=y
292CONFIG_MIPS32_O32=y
293CONFIG_MIPS32_N32=y
294CONFIG_BINFMT_ELF32=y
295
296#
297# Power management options
298#
299# CONFIG_PM is not set
300CONFIG_NET=y
301
302#
303# Networking options
304#
305CONFIG_PACKET=y
306CONFIG_PACKET_MMAP=y
307CONFIG_UNIX=y
308CONFIG_XFRM=y
309# CONFIG_XFRM_USER is not set
310# CONFIG_XFRM_SUB_POLICY is not set
311# CONFIG_XFRM_MIGRATE is not set
312# CONFIG_XFRM_STATISTICS is not set
313# CONFIG_NET_KEY is not set
314CONFIG_INET=y
315CONFIG_IP_MULTICAST=y
316CONFIG_IP_ADVANCED_ROUTER=y
317CONFIG_ASK_IP_FIB_HASH=y
318# CONFIG_IP_FIB_TRIE is not set
319CONFIG_IP_FIB_HASH=y
320CONFIG_IP_MULTIPLE_TABLES=y
321CONFIG_IP_ROUTE_MULTIPATH=y
322CONFIG_IP_ROUTE_VERBOSE=y
323CONFIG_IP_PNP=y
324CONFIG_IP_PNP_DHCP=y
325CONFIG_IP_PNP_BOOTP=y
326CONFIG_IP_PNP_RARP=y
327# CONFIG_NET_IPIP is not set
328# CONFIG_NET_IPGRE is not set
329CONFIG_IP_MROUTE=y
330CONFIG_IP_PIMSM_V1=y
331CONFIG_IP_PIMSM_V2=y
332# CONFIG_ARPD is not set
333CONFIG_SYN_COOKIES=y
334# CONFIG_INET_AH is not set
335# CONFIG_INET_ESP is not set
336# CONFIG_INET_IPCOMP is not set
337# CONFIG_INET_XFRM_TUNNEL is not set
338# CONFIG_INET_TUNNEL is not set
339CONFIG_INET_XFRM_MODE_TRANSPORT=y
340CONFIG_INET_XFRM_MODE_TUNNEL=y
341CONFIG_INET_XFRM_MODE_BEET=y
342# CONFIG_INET_LRO is not set
343CONFIG_INET_DIAG=y
344CONFIG_INET_TCP_DIAG=y
345# CONFIG_TCP_CONG_ADVANCED is not set
346CONFIG_TCP_CONG_CUBIC=y
347CONFIG_DEFAULT_TCP_CONG="cubic"
348# CONFIG_TCP_MD5SIG is not set
349# CONFIG_IPV6 is not set
350# CONFIG_NETLABEL is not set
351# CONFIG_NETWORK_SECMARK is not set
352# CONFIG_NETFILTER is not set
353# CONFIG_IP_DCCP is not set
354# CONFIG_IP_SCTP is not set
355# CONFIG_TIPC is not set
356# CONFIG_ATM is not set
357# CONFIG_BRIDGE is not set
358# CONFIG_NET_DSA is not set
359# CONFIG_VLAN_8021Q is not set
360# CONFIG_DECNET is not set
361# CONFIG_LLC2 is not set
362# CONFIG_IPX is not set
363# CONFIG_ATALK is not set
364# CONFIG_X25 is not set
365# CONFIG_LAPB is not set
366# CONFIG_ECONET is not set
367# CONFIG_WAN_ROUTER is not set
368# CONFIG_NET_SCHED is not set
369
370#
371# Network testing
372#
373# CONFIG_NET_PKTGEN is not set
374# CONFIG_HAMRADIO is not set
375# CONFIG_CAN is not set
376# CONFIG_IRDA is not set
377# CONFIG_BT is not set
378# CONFIG_AF_RXRPC is not set
379# CONFIG_PHONET is not set
380CONFIG_FIB_RULES=y
381# CONFIG_WIRELESS is not set
382# CONFIG_RFKILL is not set
383# CONFIG_NET_9P is not set
384
385#
386# Device Drivers
387#
388
389#
390# Generic Driver Options
391#
392CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
393CONFIG_STANDALONE=y
394CONFIG_PREVENT_FIRMWARE_BUILD=y
395# CONFIG_FW_LOADER is not set
396# CONFIG_DEBUG_DRIVER is not set
397# CONFIG_DEBUG_DEVRES is not set
398# CONFIG_SYS_HYPERVISOR is not set
399# CONFIG_CONNECTOR is not set
400CONFIG_MTD=y
401# CONFIG_MTD_DEBUG is not set
402# CONFIG_MTD_CONCAT is not set
403CONFIG_MTD_PARTITIONS=y
404# CONFIG_MTD_REDBOOT_PARTS is not set
405# CONFIG_MTD_CMDLINE_PARTS is not set
406# CONFIG_MTD_AR7_PARTS is not set
407
408#
409# User Modules And Translation Layers
410#
411CONFIG_MTD_CHAR=y
412CONFIG_MTD_BLKDEVS=y
413CONFIG_MTD_BLOCK=y
414# CONFIG_FTL is not set
415# CONFIG_NFTL is not set
416# CONFIG_INFTL is not set
417# CONFIG_RFD_FTL is not set
418# CONFIG_SSFDC is not set
419# CONFIG_MTD_OOPS is not set
420
421#
422# RAM/ROM/Flash chip drivers
423#
424CONFIG_MTD_CFI=y
425# CONFIG_MTD_JEDECPROBE is not set
426CONFIG_MTD_GEN_PROBE=y
427# CONFIG_MTD_CFI_ADV_OPTIONS is not set
428CONFIG_MTD_MAP_BANK_WIDTH_1=y
429CONFIG_MTD_MAP_BANK_WIDTH_2=y
430CONFIG_MTD_MAP_BANK_WIDTH_4=y
431# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
432# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
433# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
434CONFIG_MTD_CFI_I1=y
435CONFIG_MTD_CFI_I2=y
436# CONFIG_MTD_CFI_I4 is not set
437# CONFIG_MTD_CFI_I8 is not set
438# CONFIG_MTD_CFI_INTELEXT is not set
439CONFIG_MTD_CFI_AMDSTD=y
440# CONFIG_MTD_CFI_STAA is not set
441CONFIG_MTD_CFI_UTIL=y
442# CONFIG_MTD_RAM is not set
443# CONFIG_MTD_ROM is not set
444# CONFIG_MTD_ABSENT is not set
445
446#
447# Mapping drivers for chip access
448#
449# CONFIG_MTD_COMPLEX_MAPPINGS is not set
450CONFIG_MTD_PHYSMAP=y
451CONFIG_MTD_PHYSMAP_START=0x8000000
452CONFIG_MTD_PHYSMAP_LEN=0x0
453CONFIG_MTD_PHYSMAP_BANKWIDTH=2
454# CONFIG_MTD_PLATRAM is not set
455
456#
457# Self-contained MTD device drivers
458#
459# CONFIG_MTD_SLRAM is not set
460# CONFIG_MTD_PHRAM is not set
461# CONFIG_MTD_MTDRAM is not set
462# CONFIG_MTD_BLOCK2MTD is not set
463
464#
465# Disk-On-Chip Device Drivers
466#
467# CONFIG_MTD_DOC2000 is not set
468# CONFIG_MTD_DOC2001 is not set
469# CONFIG_MTD_DOC2001PLUS is not set
470# CONFIG_MTD_NAND is not set
471# CONFIG_MTD_ONENAND is not set
472
473#
474# UBI - Unsorted block images
475#
476# CONFIG_MTD_UBI is not set
477# CONFIG_PARPORT is not set
478CONFIG_BLK_DEV=y
479# CONFIG_BLK_DEV_COW_COMMON is not set
480CONFIG_BLK_DEV_LOOP=y
481# CONFIG_BLK_DEV_CRYPTOLOOP is not set
482# CONFIG_BLK_DEV_NBD is not set
483# CONFIG_BLK_DEV_RAM is not set
484# CONFIG_CDROM_PKTCDVD is not set
485# CONFIG_ATA_OVER_ETH is not set
486# CONFIG_BLK_DEV_HD is not set
487# CONFIG_MISC_DEVICES is not set
488CONFIG_HAVE_IDE=y
489# CONFIG_IDE is not set
490
491#
492# SCSI device support
493#
494# CONFIG_RAID_ATTRS is not set
495# CONFIG_SCSI is not set
496# CONFIG_SCSI_DMA is not set
497# CONFIG_SCSI_NETLINK is not set
498# CONFIG_ATA is not set
499# CONFIG_MD is not set
500CONFIG_NETDEVICES=y
501# CONFIG_DUMMY is not set
502# CONFIG_BONDING is not set
503# CONFIG_MACVLAN is not set
504# CONFIG_EQUALIZER is not set
505# CONFIG_TUN is not set
506# CONFIG_VETH is not set
507# CONFIG_PHYLIB is not set
508CONFIG_NET_ETHERNET=y
509CONFIG_MII=y
510# CONFIG_AX88796 is not set
511# CONFIG_SMC91X is not set
512# CONFIG_DM9000 is not set
513# CONFIG_IBM_NEW_EMAC_ZMII is not set
514# CONFIG_IBM_NEW_EMAC_RGMII is not set
515# CONFIG_IBM_NEW_EMAC_TAH is not set
516# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
517# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
518# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
519# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
520# CONFIG_B44 is not set
521CONFIG_NETDEV_1000=y
522# CONFIG_NETDEV_10000 is not set
523
524#
525# Wireless LAN
526#
527# CONFIG_WLAN_PRE80211 is not set
528# CONFIG_WLAN_80211 is not set
529# CONFIG_IWLWIFI_LEDS is not set
530# CONFIG_WAN is not set
531# CONFIG_PPP is not set
532# CONFIG_SLIP is not set
533# CONFIG_NETCONSOLE is not set
534# CONFIG_NETPOLL is not set
535# CONFIG_NET_POLL_CONTROLLER is not set
536# CONFIG_ISDN is not set
537# CONFIG_PHONE is not set
538
539#
540# Input device support
541#
542# CONFIG_INPUT is not set
543
544#
545# Hardware I/O ports
546#
547# CONFIG_SERIO is not set
548# CONFIG_GAMEPORT is not set
549
550#
551# Character devices
552#
553# CONFIG_VT is not set
554CONFIG_DEVKMEM=y
555# CONFIG_SERIAL_NONSTANDARD is not set
556
557#
558# Serial drivers
559#
560CONFIG_SERIAL_8250=y
561CONFIG_SERIAL_8250_CONSOLE=y
562CONFIG_SERIAL_8250_NR_UARTS=2
563CONFIG_SERIAL_8250_RUNTIME_UARTS=2
564# CONFIG_SERIAL_8250_EXTENDED is not set
565
566#
567# Non-8250 serial port support
568#
569CONFIG_SERIAL_CORE=y
570CONFIG_SERIAL_CORE_CONSOLE=y
571CONFIG_UNIX98_PTYS=y
572CONFIG_LEGACY_PTYS=y
573CONFIG_LEGACY_PTY_COUNT=256
574# CONFIG_IPMI_HANDLER is not set
575# CONFIG_HW_RANDOM is not set
576# CONFIG_R3964 is not set
577# CONFIG_RAW_DRIVER is not set
578# CONFIG_TCG_TPM is not set
579# CONFIG_I2C is not set
580# CONFIG_SPI is not set
581# CONFIG_W1 is not set
582# CONFIG_POWER_SUPPLY is not set
583# CONFIG_HWMON is not set
584# CONFIG_THERMAL is not set
585# CONFIG_THERMAL_HWMON is not set
586CONFIG_WATCHDOG=y
587# CONFIG_WATCHDOG_NOWAYOUT is not set
588
589#
590# Watchdog Device Drivers
591#
592# CONFIG_SOFT_WATCHDOG is not set
593CONFIG_SSB_POSSIBLE=y
594
595#
596# Sonics Silicon Backplane
597#
598# CONFIG_SSB is not set
599
600#
601# Multifunction device drivers
602#
603# CONFIG_MFD_CORE is not set
604# CONFIG_MFD_SM501 is not set
605# CONFIG_HTC_PASIC3 is not set
606# CONFIG_MFD_TMIO is not set
607# CONFIG_REGULATOR is not set
608
609#
610# Multimedia devices
611#
612
613#
614# Multimedia core support
615#
616# CONFIG_VIDEO_DEV is not set
617# CONFIG_DVB_CORE is not set
618# CONFIG_VIDEO_MEDIA is not set
619
620#
621# Multimedia drivers
622#
623# CONFIG_DAB is not set
624
625#
626# Graphics support
627#
628# CONFIG_VGASTATE is not set
629# CONFIG_VIDEO_OUTPUT_CONTROL is not set
630# CONFIG_FB is not set
631# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
632
633#
634# Display device support
635#
636# CONFIG_DISPLAY_SUPPORT is not set
637# CONFIG_SOUND is not set
638# CONFIG_USB_SUPPORT is not set
639# CONFIG_MMC is not set
640# CONFIG_MEMSTICK is not set
641# CONFIG_NEW_LEDS is not set
642# CONFIG_ACCESSIBILITY is not set
643CONFIG_RTC_LIB=y
644# CONFIG_RTC_CLASS is not set
645# CONFIG_DMADEVICES is not set
646# CONFIG_UIO is not set
647# CONFIG_STAGING is not set
648CONFIG_STAGING_EXCLUDE_BUILD=y
649
650#
651# File systems
652#
653# CONFIG_EXT2_FS is not set
654# CONFIG_EXT3_FS is not set
655# CONFIG_EXT4_FS is not set
656# CONFIG_REISERFS_FS is not set
657# CONFIG_JFS_FS is not set
658# CONFIG_FS_POSIX_ACL is not set
659CONFIG_FILE_LOCKING=y
660# CONFIG_XFS_FS is not set
661# CONFIG_GFS2_FS is not set
662# CONFIG_OCFS2_FS is not set
663CONFIG_DNOTIFY=y
664CONFIG_INOTIFY=y
665CONFIG_INOTIFY_USER=y
666# CONFIG_QUOTA is not set
667# CONFIG_AUTOFS_FS is not set
668# CONFIG_AUTOFS4_FS is not set
669# CONFIG_FUSE_FS is not set
670
671#
672# CD-ROM/DVD Filesystems
673#
674# CONFIG_ISO9660_FS is not set
675# CONFIG_UDF_FS is not set
676
677#
678# DOS/FAT/NT Filesystems
679#
680# CONFIG_MSDOS_FS is not set
681# CONFIG_VFAT_FS is not set
682# CONFIG_NTFS_FS is not set
683
684#
685# Pseudo filesystems
686#
687CONFIG_PROC_FS=y
688CONFIG_PROC_KCORE=y
689CONFIG_PROC_SYSCTL=y
690CONFIG_PROC_PAGE_MONITOR=y
691CONFIG_SYSFS=y
692CONFIG_TMPFS=y
693# CONFIG_TMPFS_POSIX_ACL is not set
694# CONFIG_HUGETLB_PAGE is not set
695# CONFIG_CONFIGFS_FS is not set
696
697#
698# Miscellaneous filesystems
699#
700# CONFIG_ADFS_FS is not set
701# CONFIG_AFFS_FS is not set
702# CONFIG_HFS_FS is not set
703# CONFIG_HFSPLUS_FS is not set
704# CONFIG_BEFS_FS is not set
705# CONFIG_BFS_FS is not set
706# CONFIG_EFS_FS is not set
707# CONFIG_JFFS2_FS is not set
708# CONFIG_CRAMFS is not set
709# CONFIG_VXFS_FS is not set
710# CONFIG_MINIX_FS is not set
711# CONFIG_OMFS_FS is not set
712# CONFIG_HPFS_FS is not set
713# CONFIG_QNX4FS_FS is not set
714# CONFIG_ROMFS_FS is not set
715# CONFIG_SYSV_FS is not set
716# CONFIG_UFS_FS is not set
717# CONFIG_NETWORK_FILESYSTEMS is not set
718
719#
720# Partition Types
721#
722# CONFIG_PARTITION_ADVANCED is not set
723CONFIG_MSDOS_PARTITION=y
724CONFIG_NLS=y
725CONFIG_NLS_DEFAULT="iso8859-1"
726CONFIG_NLS_CODEPAGE_437=y
727# CONFIG_NLS_CODEPAGE_737 is not set
728# CONFIG_NLS_CODEPAGE_775 is not set
729# CONFIG_NLS_CODEPAGE_850 is not set
730# CONFIG_NLS_CODEPAGE_852 is not set
731# CONFIG_NLS_CODEPAGE_855 is not set
732# CONFIG_NLS_CODEPAGE_857 is not set
733# CONFIG_NLS_CODEPAGE_860 is not set
734# CONFIG_NLS_CODEPAGE_861 is not set
735# CONFIG_NLS_CODEPAGE_862 is not set
736# CONFIG_NLS_CODEPAGE_863 is not set
737# CONFIG_NLS_CODEPAGE_864 is not set
738# CONFIG_NLS_CODEPAGE_865 is not set
739# CONFIG_NLS_CODEPAGE_866 is not set
740# CONFIG_NLS_CODEPAGE_869 is not set
741# CONFIG_NLS_CODEPAGE_936 is not set
742# CONFIG_NLS_CODEPAGE_950 is not set
743# CONFIG_NLS_CODEPAGE_932 is not set
744# CONFIG_NLS_CODEPAGE_949 is not set
745# CONFIG_NLS_CODEPAGE_874 is not set
746# CONFIG_NLS_ISO8859_8 is not set
747# CONFIG_NLS_CODEPAGE_1250 is not set
748# CONFIG_NLS_CODEPAGE_1251 is not set
749# CONFIG_NLS_ASCII is not set
750CONFIG_NLS_ISO8859_1=y
751# CONFIG_NLS_ISO8859_2 is not set
752# CONFIG_NLS_ISO8859_3 is not set
753# CONFIG_NLS_ISO8859_4 is not set
754# CONFIG_NLS_ISO8859_5 is not set
755# CONFIG_NLS_ISO8859_6 is not set
756# CONFIG_NLS_ISO8859_7 is not set
757# CONFIG_NLS_ISO8859_9 is not set
758# CONFIG_NLS_ISO8859_13 is not set
759# CONFIG_NLS_ISO8859_14 is not set
760# CONFIG_NLS_ISO8859_15 is not set
761# CONFIG_NLS_KOI8_R is not set
762# CONFIG_NLS_KOI8_U is not set
763# CONFIG_NLS_UTF8 is not set
764# CONFIG_DLM is not set
765
766#
767# Kernel hacking
768#
769CONFIG_TRACE_IRQFLAGS_SUPPORT=y
770# CONFIG_PRINTK_TIME is not set
771CONFIG_ENABLE_WARN_DEPRECATED=y
772CONFIG_ENABLE_MUST_CHECK=y
773CONFIG_FRAME_WARN=2048
774CONFIG_MAGIC_SYSRQ=y
775# CONFIG_UNUSED_SYMBOLS is not set
776CONFIG_DEBUG_FS=y
777# CONFIG_HEADERS_CHECK is not set
778CONFIG_DEBUG_KERNEL=y
779# CONFIG_DEBUG_SHIRQ is not set
780CONFIG_DETECT_SOFTLOCKUP=y
781# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
782CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
783CONFIG_SCHED_DEBUG=y
784# CONFIG_SCHEDSTATS is not set
785# CONFIG_TIMER_STATS is not set
786# CONFIG_DEBUG_OBJECTS is not set
787# CONFIG_DEBUG_SLAB is not set
788CONFIG_DEBUG_PREEMPT=y
789# CONFIG_DEBUG_RT_MUTEXES is not set
790# CONFIG_RT_MUTEX_TESTER is not set
791CONFIG_DEBUG_SPINLOCK=y
792# CONFIG_DEBUG_MUTEXES is not set
793# CONFIG_DEBUG_LOCK_ALLOC is not set
794# CONFIG_PROVE_LOCKING is not set
795# CONFIG_LOCK_STAT is not set
796CONFIG_DEBUG_SPINLOCK_SLEEP=y
797# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
798# CONFIG_DEBUG_KOBJECT is not set
799CONFIG_DEBUG_INFO=y
800# CONFIG_DEBUG_VM is not set
801# CONFIG_DEBUG_WRITECOUNT is not set
802# CONFIG_DEBUG_MEMORY_INIT is not set
803# CONFIG_DEBUG_LIST is not set
804# CONFIG_DEBUG_SG is not set
805# CONFIG_BOOT_PRINTK_DELAY is not set
806# CONFIG_RCU_TORTURE_TEST is not set
807# CONFIG_RCU_CPU_STALL_DETECTOR is not set
808# CONFIG_BACKTRACE_SELF_TEST is not set
809# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
810# CONFIG_FAULT_INJECTION is not set
811CONFIG_SYSCTL_SYSCALL_CHECK=y
812
813#
814# Tracers
815#
816# CONFIG_IRQSOFF_TRACER is not set
817# CONFIG_PREEMPT_TRACER is not set
818# CONFIG_SCHED_TRACER is not set
819# CONFIG_CONTEXT_SWITCH_TRACER is not set
820# CONFIG_BOOT_TRACER is not set
821# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
822# CONFIG_SAMPLES is not set
823CONFIG_HAVE_ARCH_KGDB=y
824# CONFIG_KGDB is not set
825CONFIG_CMDLINE=""
826# CONFIG_DEBUG_STACK_USAGE is not set
827# CONFIG_RUNTIME_DEBUG is not set
828
829#
830# Security options
831#
832# CONFIG_KEYS is not set
833CONFIG_SECURITY=y
834# CONFIG_SECURITYFS is not set
835CONFIG_SECURITY_NETWORK=y
836# CONFIG_SECURITY_NETWORK_XFRM is not set
837# CONFIG_SECURITY_FILE_CAPABILITIES is not set
838CONFIG_SECURITY_DEFAULT_MMAP_MIN_ADDR=0
839CONFIG_CRYPTO=y
840
841#
842# Crypto core or helper
843#
844# CONFIG_CRYPTO_FIPS is not set
845CONFIG_CRYPTO_ALGAPI=y
846CONFIG_CRYPTO_AEAD=y
847CONFIG_CRYPTO_BLKCIPHER=y
848CONFIG_CRYPTO_HASH=y
849CONFIG_CRYPTO_RNG=y
850CONFIG_CRYPTO_MANAGER=y
851# CONFIG_CRYPTO_GF128MUL is not set
852# CONFIG_CRYPTO_NULL is not set
853# CONFIG_CRYPTO_CRYPTD is not set
854# CONFIG_CRYPTO_AUTHENC is not set
855# CONFIG_CRYPTO_TEST is not set
856
857#
858# Authenticated Encryption with Associated Data
859#
860# CONFIG_CRYPTO_CCM is not set
861# CONFIG_CRYPTO_GCM is not set
862# CONFIG_CRYPTO_SEQIV is not set
863
864#
865# Block modes
866#
867CONFIG_CRYPTO_CBC=y
868# CONFIG_CRYPTO_CTR is not set
869# CONFIG_CRYPTO_CTS is not set
870# CONFIG_CRYPTO_ECB is not set
871# CONFIG_CRYPTO_LRW is not set
872# CONFIG_CRYPTO_PCBC is not set
873# CONFIG_CRYPTO_XTS is not set
874
875#
876# Hash modes
877#
878CONFIG_CRYPTO_HMAC=y
879# CONFIG_CRYPTO_XCBC is not set
880
881#
882# Digest
883#
884# CONFIG_CRYPTO_CRC32C is not set
885# CONFIG_CRYPTO_MD4 is not set
886CONFIG_CRYPTO_MD5=y
887# CONFIG_CRYPTO_MICHAEL_MIC is not set
888# CONFIG_CRYPTO_RMD128 is not set
889# CONFIG_CRYPTO_RMD160 is not set
890# CONFIG_CRYPTO_RMD256 is not set
891# CONFIG_CRYPTO_RMD320 is not set
892# CONFIG_CRYPTO_SHA1 is not set
893# CONFIG_CRYPTO_SHA256 is not set
894# CONFIG_CRYPTO_SHA512 is not set
895# CONFIG_CRYPTO_TGR192 is not set
896# CONFIG_CRYPTO_WP512 is not set
897
898#
899# Ciphers
900#
901# CONFIG_CRYPTO_AES is not set
902# CONFIG_CRYPTO_ANUBIS is not set
903# CONFIG_CRYPTO_ARC4 is not set
904# CONFIG_CRYPTO_BLOWFISH is not set
905# CONFIG_CRYPTO_CAMELLIA is not set
906# CONFIG_CRYPTO_CAST5 is not set
907# CONFIG_CRYPTO_CAST6 is not set
908CONFIG_CRYPTO_DES=y
909# CONFIG_CRYPTO_FCRYPT is not set
910# CONFIG_CRYPTO_KHAZAD is not set
911# CONFIG_CRYPTO_SALSA20 is not set
912# CONFIG_CRYPTO_SEED is not set
913# CONFIG_CRYPTO_SERPENT is not set
914# CONFIG_CRYPTO_TEA is not set
915# CONFIG_CRYPTO_TWOFISH is not set
916
917#
918# Compression
919#
920# CONFIG_CRYPTO_DEFLATE is not set
921# CONFIG_CRYPTO_LZO is not set
922
923#
924# Random Number Generation
925#
926# CONFIG_CRYPTO_ANSI_CPRNG is not set
927CONFIG_CRYPTO_HW=y
928
929#
930# Library routines
931#
932CONFIG_BITREVERSE=y
933# CONFIG_CRC_CCITT is not set
934# CONFIG_CRC16 is not set
935# CONFIG_CRC_T10DIF is not set
936# CONFIG_CRC_ITU_T is not set
937CONFIG_CRC32=y
938# CONFIG_CRC7 is not set
939# CONFIG_LIBCRC32C is not set
940CONFIG_PLIST=y
941CONFIG_HAS_IOMEM=y
942CONFIG_HAS_IOPORT=y
943CONFIG_HAS_DMA=y
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild
index 7897f05e3165..023866c0c102 100644
--- a/arch/mips/include/asm/Kbuild
+++ b/arch/mips/include/asm/Kbuild
@@ -1,3 +1,4 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3header-y += cachectl.h sgidefs.h sysmips.h 3header-y += cachectl.h sgidefs.h sysmips.h
4header-y += swab.h
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h
index 1232be3885b0..c996c3b4d074 100644
--- a/arch/mips/include/asm/atomic.h
+++ b/arch/mips/include/asm/atomic.h
@@ -15,13 +15,12 @@
15#define _ASM_ATOMIC_H 15#define _ASM_ATOMIC_H
16 16
17#include <linux/irqflags.h> 17#include <linux/irqflags.h>
18#include <linux/types.h>
18#include <asm/barrier.h> 19#include <asm/barrier.h>
19#include <asm/cpu-features.h> 20#include <asm/cpu-features.h>
20#include <asm/war.h> 21#include <asm/war.h>
21#include <asm/system.h> 22#include <asm/system.h>
22 23
23typedef struct { volatile int counter; } atomic_t;
24
25#define ATOMIC_INIT(i) { (i) } 24#define ATOMIC_INIT(i) { (i) }
26 25
27/* 26/*
@@ -404,8 +403,6 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
404 403
405#ifdef CONFIG_64BIT 404#ifdef CONFIG_64BIT
406 405
407typedef struct { volatile long counter; } atomic64_t;
408
409#define ATOMIC64_INIT(i) { (i) } 406#define ATOMIC64_INIT(i) { (i) }
410 407
411/* 408/*
diff --git a/arch/mips/include/asm/byteorder.h b/arch/mips/include/asm/byteorder.h
index 33790b9e0cc0..607b71830707 100644
--- a/arch/mips/include/asm/byteorder.h
+++ b/arch/mips/include/asm/byteorder.h
@@ -8,60 +8,14 @@
8#ifndef _ASM_BYTEORDER_H 8#ifndef _ASM_BYTEORDER_H
9#define _ASM_BYTEORDER_H 9#define _ASM_BYTEORDER_H
10 10
11#include <linux/compiler.h> 11#include <asm/swab.h>
12#include <asm/types.h>
13 12
14#if defined(__MIPSEB__) 13#if defined(__MIPSEB__)
15# define __BIG_ENDIAN 14#include <linux/byteorder/big_endian.h>
16#elif defined(__MIPSEL__) 15#elif defined(__MIPSEL__)
17# define __LITTLE_ENDIAN 16#include <linux/byteorder/little_endian.h>
18#else 17#else
19# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" 18# error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???"
20#endif 19#endif
21 20
22#define __SWAB_64_THRU_32__
23
24#ifdef CONFIG_CPU_MIPSR2
25
26static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
27{
28 __asm__(
29 " wsbh %0, %1 \n"
30 : "=r" (x)
31 : "r" (x));
32
33 return x;
34}
35#define __arch_swab16 __arch_swab16
36
37static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
38{
39 __asm__(
40 " wsbh %0, %1 \n"
41 " rotr %0, %0, 16 \n"
42 : "=r" (x)
43 : "r" (x));
44
45 return x;
46}
47#define __arch_swab32 __arch_swab32
48
49#ifdef CONFIG_CPU_MIPS64_R2
50static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
51{
52 __asm__(
53 " dsbh %0, %1\n"
54 " dshd %0, %0"
55 : "=r" (x)
56 : "r" (x));
57
58 return x;
59}
60#define __arch_swab64 __arch_swab64
61#endif /* CONFIG_CPU_MIPS64_R2 */
62
63#endif /* CONFIG_CPU_MIPSR2 */
64
65#include <linux/byteorder.h>
66
67#endif /* _ASM_BYTEORDER_H */ 21#endif /* _ASM_BYTEORDER_H */
diff --git a/arch/mips/include/asm/cpu-features.h b/arch/mips/include/asm/cpu-features.h
index 12d12dfe73c0..a0d14f85b781 100644
--- a/arch/mips/include/asm/cpu-features.h
+++ b/arch/mips/include/asm/cpu-features.h
@@ -38,6 +38,9 @@
38#ifndef cpu_has_tx39_cache 38#ifndef cpu_has_tx39_cache
39#define cpu_has_tx39_cache (cpu_data[0].options & MIPS_CPU_TX39_CACHE) 39#define cpu_has_tx39_cache (cpu_data[0].options & MIPS_CPU_TX39_CACHE)
40#endif 40#endif
41#ifndef cpu_has_octeon_cache
42#define cpu_has_octeon_cache 0
43#endif
41#ifndef cpu_has_fpu 44#ifndef cpu_has_fpu
42#define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) 45#define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU)
43#define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU) 46#define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU)
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 229a786101d9..c018727c7ddc 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -33,6 +33,7 @@
33#define PRID_COMP_TOSHIBA 0x070000 33#define PRID_COMP_TOSHIBA 0x070000
34#define PRID_COMP_LSI 0x080000 34#define PRID_COMP_LSI 0x080000
35#define PRID_COMP_LEXRA 0x0b0000 35#define PRID_COMP_LEXRA 0x0b0000
36#define PRID_COMP_CAVIUM 0x0d0000
36 37
37 38
38/* 39/*
@@ -114,6 +115,18 @@
114#define PRID_IMP_BCM3302 0x9000 115#define PRID_IMP_BCM3302 0x9000
115 116
116/* 117/*
118 * These are the PRID's for when 23:16 == PRID_COMP_CAVIUM
119 */
120
121#define PRID_IMP_CAVIUM_CN38XX 0x0000
122#define PRID_IMP_CAVIUM_CN31XX 0x0100
123#define PRID_IMP_CAVIUM_CN30XX 0x0200
124#define PRID_IMP_CAVIUM_CN58XX 0x0300
125#define PRID_IMP_CAVIUM_CN56XX 0x0400
126#define PRID_IMP_CAVIUM_CN50XX 0x0600
127#define PRID_IMP_CAVIUM_CN52XX 0x0700
128
129/*
117 * Definitions for 7:0 on legacy processors 130 * Definitions for 7:0 on legacy processors
118 */ 131 */
119 132
@@ -203,6 +216,7 @@ enum cpu_type_enum {
203 * MIPS64 class processors 216 * MIPS64 class processors
204 */ 217 */
205 CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2, 218 CPU_5KC, CPU_20KC, CPU_25KF, CPU_SB1, CPU_SB1A, CPU_LOONGSON2,
219 CPU_CAVIUM_OCTEON,
206 220
207 CPU_LAST 221 CPU_LAST
208}; 222};
diff --git a/arch/mips/include/asm/hazards.h b/arch/mips/include/asm/hazards.h
index 2de638f84c86..43baed16a109 100644
--- a/arch/mips/include/asm/hazards.h
+++ b/arch/mips/include/asm/hazards.h
@@ -42,7 +42,7 @@ ASMMACRO(_ehb,
42/* 42/*
43 * TLB hazards 43 * TLB hazards
44 */ 44 */
45#if defined(CONFIG_CPU_MIPSR2) 45#if defined(CONFIG_CPU_MIPSR2) && !defined(CONFIG_CPU_CAVIUM_OCTEON)
46 46
47/* 47/*
48 * MIPSR2 defines ehb for hazard avoidance 48 * MIPSR2 defines ehb for hazard avoidance
@@ -138,7 +138,7 @@ do { \
138 __instruction_hazard(); \ 138 __instruction_hazard(); \
139} while (0) 139} while (0)
140 140
141#elif defined(CONFIG_CPU_R10000) 141#elif defined(CONFIG_CPU_R10000) || defined(CONFIG_CPU_CAVIUM_OCTEON)
142 142
143/* 143/*
144 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer. 144 * R10000 rocks - all hazards handled in hardware, so this becomes a nobrainer.
diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h
index 501a40b9f18d..436878e4e063 100644
--- a/arch/mips/include/asm/io.h
+++ b/arch/mips/include/asm/io.h
@@ -295,6 +295,12 @@ static inline void iounmap(const volatile void __iomem *addr)
295#undef __IS_KSEG1 295#undef __IS_KSEG1
296} 296}
297 297
298#ifdef CONFIG_CPU_CAVIUM_OCTEON
299#define war_octeon_io_reorder_wmb() wmb()
300#else
301#define war_octeon_io_reorder_wmb() do { } while (0)
302#endif
303
298#define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \ 304#define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \
299 \ 305 \
300static inline void pfx##write##bwlq(type val, \ 306static inline void pfx##write##bwlq(type val, \
@@ -303,6 +309,8 @@ static inline void pfx##write##bwlq(type val, \
303 volatile type *__mem; \ 309 volatile type *__mem; \
304 type __val; \ 310 type __val; \
305 \ 311 \
312 war_octeon_io_reorder_wmb(); \
313 \
306 __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \ 314 __mem = (void *)__swizzle_addr_##bwlq((unsigned long)(mem)); \
307 \ 315 \
308 __val = pfx##ioswab##bwlq(__mem, val); \ 316 __val = pfx##ioswab##bwlq(__mem, val); \
@@ -370,6 +378,8 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \
370 volatile type *__addr; \ 378 volatile type *__addr; \
371 type __val; \ 379 type __val; \
372 \ 380 \
381 war_octeon_io_reorder_wmb(); \
382 \
373 __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \ 383 __addr = (void *)__swizzle_addr_##bwlq(mips_io_port_base + port); \
374 \ 384 \
375 __val = pfx##ioswab##bwlq(__addr, val); \ 385 __val = pfx##ioswab##bwlq(__addr, val); \
@@ -504,8 +514,12 @@ BUILDSTRING(q, u64)
504#endif 514#endif
505 515
506 516
517#ifdef CONFIG_CPU_CAVIUM_OCTEON
518#define mmiowb() wmb()
519#else
507/* Depends on MIPS II instruction set */ 520/* Depends on MIPS II instruction set */
508#define mmiowb() asm volatile ("sync" ::: "memory") 521#define mmiowb() asm volatile ("sync" ::: "memory")
522#endif
509 523
510static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count) 524static inline void memset_io(volatile void __iomem *addr, unsigned char val, int count)
511{ 525{
diff --git a/arch/mips/include/asm/irq.h b/arch/mips/include/asm/irq.h
index a58f0eecc68f..abc62aa744ac 100644
--- a/arch/mips/include/asm/irq.h
+++ b/arch/mips/include/asm/irq.h
@@ -49,7 +49,8 @@ static inline void smtc_im_ack_irq(unsigned int irq)
49#ifdef CONFIG_MIPS_MT_SMTC_IRQAFF 49#ifdef CONFIG_MIPS_MT_SMTC_IRQAFF
50#include <linux/cpumask.h> 50#include <linux/cpumask.h>
51 51
52extern void plat_set_irq_affinity(unsigned int irq, cpumask_t affinity); 52extern void plat_set_irq_affinity(unsigned int irq,
53 const struct cpumask *affinity);
53extern void smtc_forward_irq(unsigned int irq); 54extern void smtc_forward_irq(unsigned int irq);
54 55
55/* 56/*
diff --git a/arch/mips/include/asm/mach-au1x00/au1000.h b/arch/mips/include/asm/mach-au1x00/au1000.h
index 0d302bad4492..62f91f50b5b5 100644
--- a/arch/mips/include/asm/mach-au1x00/au1000.h
+++ b/arch/mips/include/asm/mach-au1x00/au1000.h
@@ -91,14 +91,57 @@ static inline u32 au_readl(unsigned long reg)
91 return *(volatile u32 *)reg; 91 return *(volatile u32 *)reg;
92} 92}
93 93
94/* Early Au1000 have a write-only SYS_CPUPLL register. */
95static inline int au1xxx_cpu_has_pll_wo(void)
96{
97 switch (read_c0_prid()) {
98 case 0x00030100: /* Au1000 DA */
99 case 0x00030201: /* Au1000 HA */
100 case 0x00030202: /* Au1000 HB */
101 return 1;
102 }
103 return 0;
104}
105
106/* does CPU need CONFIG[OD] set to fix tons of errata? */
107static inline int au1xxx_cpu_needs_config_od(void)
108{
109 /*
110 * c0_config.od (bit 19) was write only (and read as 0) on the
111 * early revisions of Alchemy SOCs. It disables the bus trans-
112 * action overlapping and needs to be set to fix various errata.
113 */
114 switch (read_c0_prid()) {
115 case 0x00030100: /* Au1000 DA */
116 case 0x00030201: /* Au1000 HA */
117 case 0x00030202: /* Au1000 HB */
118 case 0x01030200: /* Au1500 AB */
119 /*
120 * Au1100/Au1200 errata actually keep silence about this bit,
121 * so we set it just in case for those revisions that require
122 * it to be set according to the (now gone) cpu_table.
123 */
124 case 0x02030200: /* Au1100 AB */
125 case 0x02030201: /* Au1100 BA */
126 case 0x02030202: /* Au1100 BC */
127 case 0x04030201: /* Au1200 AC */
128 return 1;
129 }
130 return 0;
131}
94 132
95/* arch/mips/au1000/common/clocks.c */ 133/* arch/mips/au1000/common/clocks.c */
96extern void set_au1x00_speed(unsigned int new_freq); 134extern void set_au1x00_speed(unsigned int new_freq);
97extern unsigned int get_au1x00_speed(void); 135extern unsigned int get_au1x00_speed(void);
98extern void set_au1x00_uart_baud_base(unsigned long new_baud_base); 136extern void set_au1x00_uart_baud_base(unsigned long new_baud_base);
99extern unsigned long get_au1x00_uart_baud_base(void); 137extern unsigned long get_au1x00_uart_baud_base(void);
100extern void set_au1x00_lcd_clock(void); 138extern unsigned long au1xxx_calc_clock(void);
101extern unsigned int get_au1x00_lcd_clock(void); 139
140/* PM: arch/mips/alchemy/common/sleeper.S, power.c, irq.c */
141void au1xxx_save_and_sleep(void);
142void au_sleep(void);
143void save_au1xxx_intctl(void);
144void restore_au1xxx_intctl(void);
102 145
103/* 146/*
104 * Every board describes its IRQ mapping with this table. 147 * Every board describes its IRQ mapping with this table.
@@ -109,10 +152,11 @@ struct au1xxx_irqmap {
109 int im_request; 152 int im_request;
110}; 153};
111 154
112/* 155/* core calls this function to let boards initialize other IRQ sources */
113 * init_IRQ looks for a table with this name. 156void board_init_irq(void);
114 */ 157
115extern struct au1xxx_irqmap au1xxx_irq_map[]; 158/* boards call this to register additional (GPIO) interrupts */
159void au1xxx_setup_irqmap(struct au1xxx_irqmap *map, int count);
116 160
117#endif /* !defined (_LANGUAGE_ASSEMBLY) */ 161#endif /* !defined (_LANGUAGE_ASSEMBLY) */
118 162
@@ -505,15 +549,6 @@ extern struct au1xxx_irqmap au1xxx_irq_map[];
505 549
506#define IC1_TESTBIT 0xB1800080 550#define IC1_TESTBIT 0xB1800080
507 551
508/* Interrupt Configuration Modes */
509#define INTC_INT_DISABLED 0x0
510#define INTC_INT_RISE_EDGE 0x1
511#define INTC_INT_FALL_EDGE 0x2
512#define INTC_INT_RISE_AND_FALL_EDGE 0x3
513#define INTC_INT_HIGH_LEVEL 0x5
514#define INTC_INT_LOW_LEVEL 0x6
515#define INTC_INT_HIGH_AND_LOW_LEVEL 0x7
516
517/* Interrupt Numbers */ 552/* Interrupt Numbers */
518/* Au1000 */ 553/* Au1000 */
519#ifdef CONFIG_SOC_AU1000 554#ifdef CONFIG_SOC_AU1000
@@ -1525,6 +1560,10 @@ enum soc_au1200_ints {
1525#define SYS_SLPPWR 0xB1900078 1560#define SYS_SLPPWR 0xB1900078
1526#define SYS_SLEEP 0xB190007C 1561#define SYS_SLEEP 0xB190007C
1527 1562
1563#define SYS_WAKEMSK_D2 (1 << 9)
1564#define SYS_WAKEMSK_M2 (1 << 8)
1565#define SYS_WAKEMSK_GPIO(x) (1 << (x))
1566
1528/* Clock Controller */ 1567/* Clock Controller */
1529#define SYS_FREQCTRL0 0xB1900020 1568#define SYS_FREQCTRL0 0xB1900020
1530# define SYS_FC_FRDIV2_BIT 22 1569# define SYS_FC_FRDIV2_BIT 22
@@ -1749,24 +1788,4 @@ static AU1X00_SYS * const sys = (AU1X00_SYS *)SYS_BASE;
1749 1788
1750#endif 1789#endif
1751 1790
1752/*
1753 * Processor information based on PRID.
1754 * Copied from PowerPC.
1755 */
1756#ifndef _LANGUAGE_ASSEMBLY
1757struct cpu_spec {
1758 /* CPU is matched via (PRID & prid_mask) == prid_value */
1759 unsigned int prid_mask;
1760 unsigned int prid_value;
1761
1762 char *cpu_name;
1763 unsigned char cpu_od; /* Set Config[OD] */
1764 unsigned char cpu_bclk; /* Enable BCLK switching */
1765 unsigned char cpu_pll_wo; /* sys_cpupll reg. write-only */
1766};
1767
1768extern struct cpu_spec cpu_specs[];
1769extern struct cpu_spec *cur_cpu_spec[];
1770#endif
1771
1772#endif 1791#endif
diff --git a/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h b/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
index 44a67bf05dc1..06f68f43800a 100644
--- a/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
+++ b/arch/mips/include/asm/mach-au1x00/au1xxx_dbdma.h
@@ -357,6 +357,11 @@ u32 au1xxx_dbdma_put_dscr(u32 chanid, au1x_ddma_desc_t *dscr);
357u32 au1xxx_ddma_add_device(dbdev_tab_t *dev); 357u32 au1xxx_ddma_add_device(dbdev_tab_t *dev);
358extern void au1xxx_ddma_del_device(u32 devid); 358extern void au1xxx_ddma_del_device(u32 devid);
359void *au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp); 359void *au1xxx_ddma_get_nextptr_virt(au1x_ddma_desc_t *dp);
360#ifdef CONFIG_PM
361void au1xxx_dbdma_suspend(void);
362void au1xxx_dbdma_resume(void);
363#endif
364
360 365
361/* 366/*
362 * Some compatibilty macros -- needed to make changes to API 367 * Some compatibilty macros -- needed to make changes to API
diff --git a/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
new file mode 100644
index 000000000000..04ce6e6569da
--- /dev/null
+++ b/arch/mips/include/asm/mach-cavium-octeon/cpu-feature-overrides.h
@@ -0,0 +1,78 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004 Cavium Networks
7 */
8#ifndef __ASM_MACH_CAVIUM_OCTEON_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_CAVIUM_OCTEON_CPU_FEATURE_OVERRIDES_H
10
11#include <linux/types.h>
12#include <asm/mipsregs.h>
13
14/*
15 * Cavium Octeons are MIPS64v2 processors
16 */
17#define cpu_dcache_line_size() 128
18#define cpu_icache_line_size() 128
19
20
21#define cpu_has_4kex 1
22#define cpu_has_3k_cache 0
23#define cpu_has_4k_cache 0
24#define cpu_has_tx39_cache 0
25#define cpu_has_fpu 0
26#define cpu_has_counter 1
27#define cpu_has_watch 1
28#define cpu_has_divec 1
29#define cpu_has_vce 0
30#define cpu_has_cache_cdex_p 0
31#define cpu_has_cache_cdex_s 0
32#define cpu_has_prefetch 1
33
34/*
35 * We should disable LL/SC on non SMP systems as it is faster to
36 * disable interrupts for atomic access than a LL/SC. Unfortunatly we
37 * cannot as this breaks asm/futex.h
38 */
39#define cpu_has_llsc 1
40#define cpu_has_vtag_icache 1
41#define cpu_has_dc_aliases 0
42#define cpu_has_ic_fills_f_dc 0
43#define cpu_has_64bits 1
44#define cpu_has_octeon_cache 1
45#define cpu_has_saa octeon_has_saa()
46#define cpu_has_mips32r1 0
47#define cpu_has_mips32r2 0
48#define cpu_has_mips64r1 0
49#define cpu_has_mips64r2 1
50#define cpu_has_dsp 0
51#define cpu_has_mipsmt 0
52#define cpu_has_userlocal 0
53#define cpu_has_vint 0
54#define cpu_has_veic 0
55#define ARCH_HAS_READ_CURRENT_TIMER 1
56#define ARCH_HAS_IRQ_PER_CPU 1
57#define ARCH_HAS_SPINLOCK_PREFETCH 1
58#define spin_lock_prefetch(x) prefetch(x)
59#define PREFETCH_STRIDE 128
60
61static inline int read_current_timer(unsigned long *result)
62{
63 asm volatile ("rdhwr %0,$31\n"
64#ifndef CONFIG_64BIT
65 "\tsll %0, 0"
66#endif
67 : "=r" (*result));
68 return 0;
69}
70
71static inline int octeon_has_saa(void)
72{
73 int id;
74 asm volatile ("mfc0 %0, $15,0" : "=r" (id));
75 return id >= 0x000d0300;
76}
77
78#endif
diff --git a/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
new file mode 100644
index 000000000000..f30fce92aabb
--- /dev/null
+++ b/arch/mips/include/asm/mach-cavium-octeon/dma-coherence.h
@@ -0,0 +1,64 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2006 Ralf Baechle <ralf@linux-mips.org>
7 *
8 *
9 * Similar to mach-generic/dma-coherence.h except
10 * plat_device_is_coherent hard coded to return 1.
11 *
12 */
13#ifndef __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H
14#define __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H
15
16struct device;
17
18dma_addr_t octeon_map_dma_mem(struct device *, void *, size_t);
19void octeon_unmap_dma_mem(struct device *, dma_addr_t);
20
21static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
22 size_t size)
23{
24 return octeon_map_dma_mem(dev, addr, size);
25}
26
27static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
28 struct page *page)
29{
30 return octeon_map_dma_mem(dev, page_address(page), PAGE_SIZE);
31}
32
33static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
34{
35 return dma_addr;
36}
37
38static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
39{
40 octeon_unmap_dma_mem(dev, dma_addr);
41}
42
43static inline int plat_dma_supported(struct device *dev, u64 mask)
44{
45 return 1;
46}
47
48static inline void plat_extra_sync_for_device(struct device *dev)
49{
50 mb();
51}
52
53static inline int plat_device_is_coherent(struct device *dev)
54{
55 return 1;
56}
57
58static inline int plat_dma_mapping_error(struct device *dev,
59 dma_addr_t dma_addr)
60{
61 return dma_addr == -1;
62}
63
64#endif /* __ASM_MACH_CAVIUM_OCTEON_DMA_COHERENCE_H */
diff --git a/arch/mips/include/asm/mach-cavium-octeon/irq.h b/arch/mips/include/asm/mach-cavium-octeon/irq.h
new file mode 100644
index 000000000000..d32220fbf4f1
--- /dev/null
+++ b/arch/mips/include/asm/mach-cavium-octeon/irq.h
@@ -0,0 +1,244 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004-2008 Cavium Networks
7 */
8#ifndef __OCTEON_IRQ_H__
9#define __OCTEON_IRQ_H__
10
11#define NR_IRQS OCTEON_IRQ_LAST
12#define MIPS_CPU_IRQ_BASE OCTEON_IRQ_SW0
13
14/* 0 - 7 represent the i8259 master */
15#define OCTEON_IRQ_I8259M0 0
16#define OCTEON_IRQ_I8259M1 1
17#define OCTEON_IRQ_I8259M2 2
18#define OCTEON_IRQ_I8259M3 3
19#define OCTEON_IRQ_I8259M4 4
20#define OCTEON_IRQ_I8259M5 5
21#define OCTEON_IRQ_I8259M6 6
22#define OCTEON_IRQ_I8259M7 7
23/* 8 - 15 represent the i8259 slave */
24#define OCTEON_IRQ_I8259S0 8
25#define OCTEON_IRQ_I8259S1 9
26#define OCTEON_IRQ_I8259S2 10
27#define OCTEON_IRQ_I8259S3 11
28#define OCTEON_IRQ_I8259S4 12
29#define OCTEON_IRQ_I8259S5 13
30#define OCTEON_IRQ_I8259S6 14
31#define OCTEON_IRQ_I8259S7 15
32/* 16 - 23 represent the 8 MIPS standard interrupt sources */
33#define OCTEON_IRQ_SW0 16
34#define OCTEON_IRQ_SW1 17
35#define OCTEON_IRQ_CIU0 18
36#define OCTEON_IRQ_CIU1 19
37#define OCTEON_IRQ_CIU4 20
38#define OCTEON_IRQ_5 21
39#define OCTEON_IRQ_PERF 22
40#define OCTEON_IRQ_TIMER 23
41/* 24 - 87 represent the sources in CIU_INTX_EN0 */
42#define OCTEON_IRQ_WORKQ0 24
43#define OCTEON_IRQ_WORKQ1 25
44#define OCTEON_IRQ_WORKQ2 26
45#define OCTEON_IRQ_WORKQ3 27
46#define OCTEON_IRQ_WORKQ4 28
47#define OCTEON_IRQ_WORKQ5 29
48#define OCTEON_IRQ_WORKQ6 30
49#define OCTEON_IRQ_WORKQ7 31
50#define OCTEON_IRQ_WORKQ8 32
51#define OCTEON_IRQ_WORKQ9 33
52#define OCTEON_IRQ_WORKQ10 34
53#define OCTEON_IRQ_WORKQ11 35
54#define OCTEON_IRQ_WORKQ12 36
55#define OCTEON_IRQ_WORKQ13 37
56#define OCTEON_IRQ_WORKQ14 38
57#define OCTEON_IRQ_WORKQ15 39
58#define OCTEON_IRQ_GPIO0 40
59#define OCTEON_IRQ_GPIO1 41
60#define OCTEON_IRQ_GPIO2 42
61#define OCTEON_IRQ_GPIO3 43
62#define OCTEON_IRQ_GPIO4 44
63#define OCTEON_IRQ_GPIO5 45
64#define OCTEON_IRQ_GPIO6 46
65#define OCTEON_IRQ_GPIO7 47
66#define OCTEON_IRQ_GPIO8 48
67#define OCTEON_IRQ_GPIO9 49
68#define OCTEON_IRQ_GPIO10 50
69#define OCTEON_IRQ_GPIO11 51
70#define OCTEON_IRQ_GPIO12 52
71#define OCTEON_IRQ_GPIO13 53
72#define OCTEON_IRQ_GPIO14 54
73#define OCTEON_IRQ_GPIO15 55
74#define OCTEON_IRQ_MBOX0 56
75#define OCTEON_IRQ_MBOX1 57
76#define OCTEON_IRQ_UART0 58
77#define OCTEON_IRQ_UART1 59
78#define OCTEON_IRQ_PCI_INT0 60
79#define OCTEON_IRQ_PCI_INT1 61
80#define OCTEON_IRQ_PCI_INT2 62
81#define OCTEON_IRQ_PCI_INT3 63
82#define OCTEON_IRQ_PCI_MSI0 64
83#define OCTEON_IRQ_PCI_MSI1 65
84#define OCTEON_IRQ_PCI_MSI2 66
85#define OCTEON_IRQ_PCI_MSI3 67
86#define OCTEON_IRQ_RESERVED68 68 /* Summary of CIU_INT_SUM1 */
87#define OCTEON_IRQ_TWSI 69
88#define OCTEON_IRQ_RML 70
89#define OCTEON_IRQ_TRACE 71
90#define OCTEON_IRQ_GMX_DRP0 72
91#define OCTEON_IRQ_GMX_DRP1 73
92#define OCTEON_IRQ_IPD_DRP 74
93#define OCTEON_IRQ_KEY_ZERO 75
94#define OCTEON_IRQ_TIMER0 76
95#define OCTEON_IRQ_TIMER1 77
96#define OCTEON_IRQ_TIMER2 78
97#define OCTEON_IRQ_TIMER3 79
98#define OCTEON_IRQ_USB0 80
99#define OCTEON_IRQ_PCM 81
100#define OCTEON_IRQ_MPI 82
101#define OCTEON_IRQ_TWSI2 83
102#define OCTEON_IRQ_POWIQ 84
103#define OCTEON_IRQ_IPDPPTHR 85
104#define OCTEON_IRQ_MII0 86
105#define OCTEON_IRQ_BOOTDMA 87
106/* 88 - 151 represent the sources in CIU_INTX_EN1 */
107#define OCTEON_IRQ_WDOG0 88
108#define OCTEON_IRQ_WDOG1 89
109#define OCTEON_IRQ_WDOG2 90
110#define OCTEON_IRQ_WDOG3 91
111#define OCTEON_IRQ_WDOG4 92
112#define OCTEON_IRQ_WDOG5 93
113#define OCTEON_IRQ_WDOG6 94
114#define OCTEON_IRQ_WDOG7 95
115#define OCTEON_IRQ_WDOG8 96
116#define OCTEON_IRQ_WDOG9 97
117#define OCTEON_IRQ_WDOG10 98
118#define OCTEON_IRQ_WDOG11 99
119#define OCTEON_IRQ_WDOG12 100
120#define OCTEON_IRQ_WDOG13 101
121#define OCTEON_IRQ_WDOG14 102
122#define OCTEON_IRQ_WDOG15 103
123#define OCTEON_IRQ_UART2 104
124#define OCTEON_IRQ_USB1 105
125#define OCTEON_IRQ_MII1 106
126#define OCTEON_IRQ_RESERVED107 107
127#define OCTEON_IRQ_RESERVED108 108
128#define OCTEON_IRQ_RESERVED109 109
129#define OCTEON_IRQ_RESERVED110 110
130#define OCTEON_IRQ_RESERVED111 111
131#define OCTEON_IRQ_RESERVED112 112
132#define OCTEON_IRQ_RESERVED113 113
133#define OCTEON_IRQ_RESERVED114 114
134#define OCTEON_IRQ_RESERVED115 115
135#define OCTEON_IRQ_RESERVED116 116
136#define OCTEON_IRQ_RESERVED117 117
137#define OCTEON_IRQ_RESERVED118 118
138#define OCTEON_IRQ_RESERVED119 119
139#define OCTEON_IRQ_RESERVED120 120
140#define OCTEON_IRQ_RESERVED121 121
141#define OCTEON_IRQ_RESERVED122 122
142#define OCTEON_IRQ_RESERVED123 123
143#define OCTEON_IRQ_RESERVED124 124
144#define OCTEON_IRQ_RESERVED125 125
145#define OCTEON_IRQ_RESERVED126 126
146#define OCTEON_IRQ_RESERVED127 127
147#define OCTEON_IRQ_RESERVED128 128
148#define OCTEON_IRQ_RESERVED129 129
149#define OCTEON_IRQ_RESERVED130 130
150#define OCTEON_IRQ_RESERVED131 131
151#define OCTEON_IRQ_RESERVED132 132
152#define OCTEON_IRQ_RESERVED133 133
153#define OCTEON_IRQ_RESERVED134 134
154#define OCTEON_IRQ_RESERVED135 135
155#define OCTEON_IRQ_RESERVED136 136
156#define OCTEON_IRQ_RESERVED137 137
157#define OCTEON_IRQ_RESERVED138 138
158#define OCTEON_IRQ_RESERVED139 139
159#define OCTEON_IRQ_RESERVED140 140
160#define OCTEON_IRQ_RESERVED141 141
161#define OCTEON_IRQ_RESERVED142 142
162#define OCTEON_IRQ_RESERVED143 143
163#define OCTEON_IRQ_RESERVED144 144
164#define OCTEON_IRQ_RESERVED145 145
165#define OCTEON_IRQ_RESERVED146 146
166#define OCTEON_IRQ_RESERVED147 147
167#define OCTEON_IRQ_RESERVED148 148
168#define OCTEON_IRQ_RESERVED149 149
169#define OCTEON_IRQ_RESERVED150 150
170#define OCTEON_IRQ_RESERVED151 151
171
172#ifdef CONFIG_PCI_MSI
173/* 152 - 215 represent the MSI interrupts 0-63 */
174#define OCTEON_IRQ_MSI_BIT0 152
175#define OCTEON_IRQ_MSI_BIT1 153
176#define OCTEON_IRQ_MSI_BIT2 154
177#define OCTEON_IRQ_MSI_BIT3 155
178#define OCTEON_IRQ_MSI_BIT4 156
179#define OCTEON_IRQ_MSI_BIT5 157
180#define OCTEON_IRQ_MSI_BIT6 158
181#define OCTEON_IRQ_MSI_BIT7 159
182#define OCTEON_IRQ_MSI_BIT8 160
183#define OCTEON_IRQ_MSI_BIT9 161
184#define OCTEON_IRQ_MSI_BIT10 162
185#define OCTEON_IRQ_MSI_BIT11 163
186#define OCTEON_IRQ_MSI_BIT12 164
187#define OCTEON_IRQ_MSI_BIT13 165
188#define OCTEON_IRQ_MSI_BIT14 166
189#define OCTEON_IRQ_MSI_BIT15 167
190#define OCTEON_IRQ_MSI_BIT16 168
191#define OCTEON_IRQ_MSI_BIT17 169
192#define OCTEON_IRQ_MSI_BIT18 170
193#define OCTEON_IRQ_MSI_BIT19 171
194#define OCTEON_IRQ_MSI_BIT20 172
195#define OCTEON_IRQ_MSI_BIT21 173
196#define OCTEON_IRQ_MSI_BIT22 174
197#define OCTEON_IRQ_MSI_BIT23 175
198#define OCTEON_IRQ_MSI_BIT24 176
199#define OCTEON_IRQ_MSI_BIT25 177
200#define OCTEON_IRQ_MSI_BIT26 178
201#define OCTEON_IRQ_MSI_BIT27 179
202#define OCTEON_IRQ_MSI_BIT28 180
203#define OCTEON_IRQ_MSI_BIT29 181
204#define OCTEON_IRQ_MSI_BIT30 182
205#define OCTEON_IRQ_MSI_BIT31 183
206#define OCTEON_IRQ_MSI_BIT32 184
207#define OCTEON_IRQ_MSI_BIT33 185
208#define OCTEON_IRQ_MSI_BIT34 186
209#define OCTEON_IRQ_MSI_BIT35 187
210#define OCTEON_IRQ_MSI_BIT36 188
211#define OCTEON_IRQ_MSI_BIT37 189
212#define OCTEON_IRQ_MSI_BIT38 190
213#define OCTEON_IRQ_MSI_BIT39 191
214#define OCTEON_IRQ_MSI_BIT40 192
215#define OCTEON_IRQ_MSI_BIT41 193
216#define OCTEON_IRQ_MSI_BIT42 194
217#define OCTEON_IRQ_MSI_BIT43 195
218#define OCTEON_IRQ_MSI_BIT44 196
219#define OCTEON_IRQ_MSI_BIT45 197
220#define OCTEON_IRQ_MSI_BIT46 198
221#define OCTEON_IRQ_MSI_BIT47 199
222#define OCTEON_IRQ_MSI_BIT48 200
223#define OCTEON_IRQ_MSI_BIT49 201
224#define OCTEON_IRQ_MSI_BIT50 202
225#define OCTEON_IRQ_MSI_BIT51 203
226#define OCTEON_IRQ_MSI_BIT52 204
227#define OCTEON_IRQ_MSI_BIT53 205
228#define OCTEON_IRQ_MSI_BIT54 206
229#define OCTEON_IRQ_MSI_BIT55 207
230#define OCTEON_IRQ_MSI_BIT56 208
231#define OCTEON_IRQ_MSI_BIT57 209
232#define OCTEON_IRQ_MSI_BIT58 210
233#define OCTEON_IRQ_MSI_BIT59 211
234#define OCTEON_IRQ_MSI_BIT60 212
235#define OCTEON_IRQ_MSI_BIT61 213
236#define OCTEON_IRQ_MSI_BIT62 214
237#define OCTEON_IRQ_MSI_BIT63 215
238
239#define OCTEON_IRQ_LAST 216
240#else
241#define OCTEON_IRQ_LAST 152
242#endif
243
244#endif
diff --git a/arch/mips/include/asm/mach-cavium-octeon/kernel-entry-init.h b/arch/mips/include/asm/mach-cavium-octeon/kernel-entry-init.h
new file mode 100644
index 000000000000..0b2b5eb22e9b
--- /dev/null
+++ b/arch/mips/include/asm/mach-cavium-octeon/kernel-entry-init.h
@@ -0,0 +1,131 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005-2008 Cavium Networks, Inc
7 */
8#ifndef __ASM_MACH_CAVIUM_OCTEON_KERNEL_ENTRY_H
9#define __ASM_MACH_CAVIUM_OCTEON_KERNEL_ENTRY_H
10
11
12#define CP0_CYCLE_COUNTER $9, 6
13#define CP0_CVMCTL_REG $9, 7
14#define CP0_CVMMEMCTL_REG $11,7
15#define CP0_PRID_REG $15, 0
16#define CP0_PRID_OCTEON_PASS1 0x000d0000
17#define CP0_PRID_OCTEON_CN30XX 0x000d0200
18
19.macro kernel_entry_setup
20 # Registers set by bootloader:
21 # (only 32 bits set by bootloader, all addresses are physical
22 # addresses, and need to have the appropriate memory region set
23 # by the kernel
24 # a0 = argc
25 # a1 = argv (kseg0 compat addr)
26 # a2 = 1 if init core, zero otherwise
27 # a3 = address of boot descriptor block
28 .set push
29 .set arch=octeon
30 # Read the cavium mem control register
31 dmfc0 v0, CP0_CVMMEMCTL_REG
32 # Clear the lower 6 bits, the CVMSEG size
33 dins v0, $0, 0, 6
34 ori v0, CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE
35 dmtc0 v0, CP0_CVMMEMCTL_REG # Write the cavium mem control register
36 dmfc0 v0, CP0_CVMCTL_REG # Read the cavium control register
37#ifdef CONFIG_CAVIUM_OCTEON_HW_FIX_UNALIGNED
38 # Disable unaligned load/store support but leave HW fixup enabled
39 or v0, v0, 0x5001
40 xor v0, v0, 0x1001
41#else
42 # Disable unaligned load/store and HW fixup support
43 or v0, v0, 0x5001
44 xor v0, v0, 0x5001
45#endif
46 # Read the processor ID register
47 mfc0 v1, CP0_PRID_REG
48 # Disable instruction prefetching (Octeon Pass1 errata)
49 or v0, v0, 0x2000
50 # Skip reenable of prefetching for Octeon Pass1
51 beq v1, CP0_PRID_OCTEON_PASS1, skip
52 nop
53 # Reenable instruction prefetching, not on Pass1
54 xor v0, v0, 0x2000
55 # Strip off pass number off of processor id
56 srl v1, 8
57 sll v1, 8
58 # CN30XX needs some extra stuff turned off for better performance
59 bne v1, CP0_PRID_OCTEON_CN30XX, skip
60 nop
61 # CN30XX Use random Icache replacement
62 or v0, v0, 0x400
63 # CN30XX Disable instruction prefetching
64 or v0, v0, 0x2000
65skip:
66 # Write the cavium control register
67 dmtc0 v0, CP0_CVMCTL_REG
68 sync
69 # Flush dcache after config change
70 cache 9, 0($0)
71 # Get my core id
72 rdhwr v0, $0
73 # Jump the master to kernel_entry
74 bne a2, zero, octeon_main_processor
75 nop
76
77#ifdef CONFIG_SMP
78
79 #
80 # All cores other than the master need to wait here for SMP bootstrap
81 # to begin
82 #
83
84 # This is the variable where the next core to boot os stored
85 PTR_LA t0, octeon_processor_boot
86octeon_spin_wait_boot:
87 # Get the core id of the next to be booted
88 LONG_L t1, (t0)
89 # Keep looping if it isn't me
90 bne t1, v0, octeon_spin_wait_boot
91 nop
92 # Get my GP from the global variable
93 PTR_LA t0, octeon_processor_gp
94 LONG_L gp, (t0)
95 # Get my SP from the global variable
96 PTR_LA t0, octeon_processor_sp
97 LONG_L sp, (t0)
98 # Set the SP global variable to zero so the master knows we've started
99 LONG_S zero, (t0)
100#ifdef __OCTEON__
101 syncw
102 syncw
103#else
104 sync
105#endif
106 # Jump to the normal Linux SMP entry point
107 j smp_bootstrap
108 nop
109#else /* CONFIG_SMP */
110
111 #
112 # Someone tried to boot SMP with a non SMP kernel. All extra cores
113 # will halt here.
114 #
115octeon_wait_forever:
116 wait
117 b octeon_wait_forever
118 nop
119
120#endif /* CONFIG_SMP */
121octeon_main_processor:
122 .set pop
123.endm
124
125/*
126 * Do SMP slave processor setup necessary before we can savely execute C code.
127 */
128 .macro smp_slave_setup
129 .endm
130
131#endif /* __ASM_MACH_CAVIUM_OCTEON_KERNEL_ENTRY_H */
diff --git a/arch/mips/include/asm/mach-cavium-octeon/war.h b/arch/mips/include/asm/mach-cavium-octeon/war.h
new file mode 100644
index 000000000000..c4712d7cc81d
--- /dev/null
+++ b/arch/mips/include/asm/mach-cavium-octeon/war.h
@@ -0,0 +1,26 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org>
7 * Copyright (C) 2008 Cavium Networks <support@caviumnetworks.com>
8 */
9#ifndef __ASM_MIPS_MACH_CAVIUM_OCTEON_WAR_H
10#define __ASM_MIPS_MACH_CAVIUM_OCTEON_WAR_H
11
12#define R4600_V1_INDEX_ICACHEOP_WAR 0
13#define R4600_V1_HIT_CACHEOP_WAR 0
14#define R4600_V2_HIT_CACHEOP_WAR 0
15#define R5432_CP0_INTERRUPT_WAR 0
16#define BCM1250_M3_WAR 0
17#define SIBYTE_1956_WAR 0
18#define MIPS4K_ICACHE_REFILL_WAR 0
19#define MIPS_CACHE_SYNC_WAR 0
20#define TX49XX_ICACHE_INDEX_INV_WAR 0
21#define RM9000_CDEX_SMP_WAR 0
22#define ICACHE_REFILLS_WORKAROUND_WAR 0
23#define R10000_LLSC_WAR 0
24#define MIPS34K_MISSED_ITLB_WAR 0
25
26#endif /* __ASM_MIPS_MACH_CAVIUM_OCTEON_WAR_H */
diff --git a/arch/mips/include/asm/mach-generic/dma-coherence.h b/arch/mips/include/asm/mach-generic/dma-coherence.h
index 76e04e7feb84..36c611b6c597 100644
--- a/arch/mips/include/asm/mach-generic/dma-coherence.h
+++ b/arch/mips/include/asm/mach-generic/dma-coherence.h
@@ -28,10 +28,34 @@ static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
28 return dma_addr; 28 return dma_addr;
29} 29}
30 30
31static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) 31static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
32{ 32{
33} 33}
34 34
35static inline int plat_dma_supported(struct device *dev, u64 mask)
36{
37 /*
38 * we fall back to GFP_DMA when the mask isn't all 1s,
39 * so we can't guarantee allocations that must be
40 * within a tighter range than GFP_DMA..
41 */
42 if (mask < DMA_BIT_MASK(24))
43 return 0;
44
45 return 1;
46}
47
48static inline void plat_extra_sync_for_device(struct device *dev)
49{
50 return;
51}
52
53static inline int plat_dma_mapping_error(struct device *dev,
54 dma_addr_t dma_addr)
55{
56 return 0;
57}
58
35static inline int plat_device_is_coherent(struct device *dev) 59static inline int plat_device_is_coherent(struct device *dev)
36{ 60{
37#ifdef CONFIG_DMA_COHERENT 61#ifdef CONFIG_DMA_COHERENT
diff --git a/arch/mips/include/asm/mach-ip27/dma-coherence.h b/arch/mips/include/asm/mach-ip27/dma-coherence.h
index ed7e6222dc15..4c21bfca10c3 100644
--- a/arch/mips/include/asm/mach-ip27/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip27/dma-coherence.h
@@ -38,10 +38,34 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
38 return dma_addr & ~(0xffUL << 56); 38 return dma_addr & ~(0xffUL << 56);
39} 39}
40 40
41static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) 41static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
42{ 42{
43} 43}
44 44
45static inline int plat_dma_supported(struct device *dev, u64 mask)
46{
47 /*
48 * we fall back to GFP_DMA when the mask isn't all 1s,
49 * so we can't guarantee allocations that must be
50 * within a tighter range than GFP_DMA..
51 */
52 if (mask < DMA_BIT_MASK(24))
53 return 0;
54
55 return 1;
56}
57
58static inline void plat_extra_sync_for_device(struct device *dev)
59{
60 return;
61}
62
63static inline int plat_dma_mapping_error(struct device *dev,
64 dma_addr_t dma_addr)
65{
66 return 0;
67}
68
45static inline int plat_device_is_coherent(struct device *dev) 69static inline int plat_device_is_coherent(struct device *dev)
46{ 70{
47 return 1; /* IP27 non-cohernet mode is unsupported */ 71 return 1; /* IP27 non-cohernet mode is unsupported */
diff --git a/arch/mips/include/asm/mach-ip27/topology.h b/arch/mips/include/asm/mach-ip27/topology.h
index 7785bec732f2..55d481569a1f 100644
--- a/arch/mips/include/asm/mach-ip27/topology.h
+++ b/arch/mips/include/asm/mach-ip27/topology.h
@@ -25,11 +25,13 @@ extern struct cpuinfo_ip27 sn_cpu_info[NR_CPUS];
25#define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid) 25#define cpu_to_node(cpu) (sn_cpu_info[(cpu)].p_nodeid)
26#define parent_node(node) (node) 26#define parent_node(node) (node)
27#define node_to_cpumask(node) (hub_data(node)->h_cpus) 27#define node_to_cpumask(node) (hub_data(node)->h_cpus)
28#define node_to_first_cpu(node) (first_cpu(node_to_cpumask(node))) 28#define cpumask_of_node(node) (&hub_data(node)->h_cpus)
29#define node_to_first_cpu(node) (cpumask_first(cpumask_of_node(node)))
29struct pci_bus; 30struct pci_bus;
30extern int pcibus_to_node(struct pci_bus *); 31extern int pcibus_to_node(struct pci_bus *);
31 32
32#define pcibus_to_cpumask(bus) (cpu_online_map) 33#define pcibus_to_cpumask(bus) (cpu_online_map)
34#define cpumask_of_pcibus(bus) (cpu_online_mask)
33 35
34extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES]; 36extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
35 37
@@ -37,7 +39,6 @@ extern unsigned char __node_distances[MAX_COMPACT_NODES][MAX_COMPACT_NODES];
37 39
38/* sched_domains SD_NODE_INIT for SGI IP27 machines */ 40/* sched_domains SD_NODE_INIT for SGI IP27 machines */
39#define SD_NODE_INIT (struct sched_domain) { \ 41#define SD_NODE_INIT (struct sched_domain) { \
40 .span = CPU_MASK_NONE, \
41 .parent = NULL, \ 42 .parent = NULL, \
42 .child = NULL, \ 43 .child = NULL, \
43 .groups = NULL, \ 44 .groups = NULL, \
diff --git a/arch/mips/include/asm/mach-ip32/dma-coherence.h b/arch/mips/include/asm/mach-ip32/dma-coherence.h
index a5511ebb2d53..7ae40f4b1c80 100644
--- a/arch/mips/include/asm/mach-ip32/dma-coherence.h
+++ b/arch/mips/include/asm/mach-ip32/dma-coherence.h
@@ -60,10 +60,34 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
60 return addr; 60 return addr;
61} 61}
62 62
63static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) 63static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
64{ 64{
65} 65}
66 66
67static inline int plat_dma_supported(struct device *dev, u64 mask)
68{
69 /*
70 * we fall back to GFP_DMA when the mask isn't all 1s,
71 * so we can't guarantee allocations that must be
72 * within a tighter range than GFP_DMA..
73 */
74 if (mask < DMA_BIT_MASK(24))
75 return 0;
76
77 return 1;
78}
79
80static inline void plat_extra_sync_for_device(struct device *dev)
81{
82 return;
83}
84
85static inline int plat_dma_mapping_error(struct device *dev,
86 dma_addr_t dma_addr)
87{
88 return 0;
89}
90
67static inline int plat_device_is_coherent(struct device *dev) 91static inline int plat_device_is_coherent(struct device *dev)
68{ 92{
69 return 0; /* IP32 is non-cohernet */ 93 return 0; /* IP32 is non-cohernet */
diff --git a/arch/mips/include/asm/mach-jazz/dma-coherence.h b/arch/mips/include/asm/mach-jazz/dma-coherence.h
index d66979a124a8..1c7cd27efa7b 100644
--- a/arch/mips/include/asm/mach-jazz/dma-coherence.h
+++ b/arch/mips/include/asm/mach-jazz/dma-coherence.h
@@ -27,11 +27,35 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
27 return vdma_log2phys(dma_addr); 27 return vdma_log2phys(dma_addr);
28} 28}
29 29
30static void plat_unmap_dma_mem(dma_addr_t dma_addr) 30static void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
31{ 31{
32 vdma_free(dma_addr); 32 vdma_free(dma_addr);
33} 33}
34 34
35static inline int plat_dma_supported(struct device *dev, u64 mask)
36{
37 /*
38 * we fall back to GFP_DMA when the mask isn't all 1s,
39 * so we can't guarantee allocations that must be
40 * within a tighter range than GFP_DMA..
41 */
42 if (mask < DMA_BIT_MASK(24))
43 return 0;
44
45 return 1;
46}
47
48static inline void plat_extra_sync_for_device(struct device *dev)
49{
50 return;
51}
52
53static inline int plat_dma_mapping_error(struct device *dev,
54 dma_addr_t dma_addr)
55{
56 return 0;
57}
58
35static inline int plat_device_is_coherent(struct device *dev) 59static inline int plat_device_is_coherent(struct device *dev)
36{ 60{
37 return 0; 61 return 0;
diff --git a/arch/mips/include/asm/mach-lemote/dma-coherence.h b/arch/mips/include/asm/mach-lemote/dma-coherence.h
index 7e914777ebc4..38fad7dfe7da 100644
--- a/arch/mips/include/asm/mach-lemote/dma-coherence.h
+++ b/arch/mips/include/asm/mach-lemote/dma-coherence.h
@@ -30,10 +30,34 @@ static inline unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr)
30 return dma_addr & 0x7fffffff; 30 return dma_addr & 0x7fffffff;
31} 31}
32 32
33static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) 33static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr)
34{ 34{
35} 35}
36 36
37static inline int plat_dma_supported(struct device *dev, u64 mask)
38{
39 /*
40 * we fall back to GFP_DMA when the mask isn't all 1s,
41 * so we can't guarantee allocations that must be
42 * within a tighter range than GFP_DMA..
43 */
44 if (mask < DMA_BIT_MASK(24))
45 return 0;
46
47 return 1;
48}
49
50static inline void plat_extra_sync_for_device(struct device *dev)
51{
52 return;
53}
54
55static inline int plat_dma_mapping_error(struct device *dev,
56 dma_addr_t dma_addr)
57{
58 return 0;
59}
60
37static inline int plat_device_is_coherent(struct device *dev) 61static inline int plat_device_is_coherent(struct device *dev)
38{ 62{
39 return 0; 63 return 0;
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h
index 9316324d070d..0417516503f6 100644
--- a/arch/mips/include/asm/mipsregs.h
+++ b/arch/mips/include/asm/mipsregs.h
@@ -1000,6 +1000,26 @@ do { \
1000#define read_c0_ebase() __read_32bit_c0_register($15, 1) 1000#define read_c0_ebase() __read_32bit_c0_register($15, 1)
1001#define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val) 1001#define write_c0_ebase(val) __write_32bit_c0_register($15, 1, val)
1002 1002
1003
1004/* Cavium OCTEON (cnMIPS) */
1005#define read_c0_cvmcount() __read_ulong_c0_register($9, 6)
1006#define write_c0_cvmcount(val) __write_ulong_c0_register($9, 6, val)
1007
1008#define read_c0_cvmctl() __read_64bit_c0_register($9, 7)
1009#define write_c0_cvmctl(val) __write_64bit_c0_register($9, 7, val)
1010
1011#define read_c0_cvmmemctl() __read_64bit_c0_register($11, 7)
1012#define write_c0_cvmmemctl(val) __write_64bit_c0_register($11, 7, val)
1013/*
1014 * The cacheerr registers are not standardized. On OCTEON, they are
1015 * 64 bits wide.
1016 */
1017#define read_octeon_c0_icacheerr() __read_64bit_c0_register($27, 0)
1018#define write_octeon_c0_icacheerr(val) __write_64bit_c0_register($27, 0, val)
1019
1020#define read_octeon_c0_dcacheerr() __read_64bit_c0_register($27, 1)
1021#define write_octeon_c0_dcacheerr(val) __write_64bit_c0_register($27, 1, val)
1022
1003/* 1023/*
1004 * Macros to access the floating point coprocessor control registers 1024 * Macros to access the floating point coprocessor control registers
1005 */ 1025 */
@@ -1008,6 +1028,8 @@ do { \
1008 __asm__ __volatile__( \ 1028 __asm__ __volatile__( \
1009 ".set\tpush\n\t" \ 1029 ".set\tpush\n\t" \
1010 ".set\treorder\n\t" \ 1030 ".set\treorder\n\t" \
1031 /* gas fails to assemble cfc1 for some archs (octeon).*/ \
1032 ".set\tmips1\n\t" \
1011 "cfc1\t%0,"STR(source)"\n\t" \ 1033 "cfc1\t%0,"STR(source)"\n\t" \
1012 ".set\tpop" \ 1034 ".set\tpop" \
1013 : "=r" (__res)); \ 1035 : "=r" (__res)); \
diff --git a/arch/mips/include/asm/module.h b/arch/mips/include/asm/module.h
index e2e09b2cd265..d94085a3eafb 100644
--- a/arch/mips/include/asm/module.h
+++ b/arch/mips/include/asm/module.h
@@ -116,6 +116,8 @@ search_module_dbetables(unsigned long addr)
116#define MODULE_PROC_FAMILY "SB1 " 116#define MODULE_PROC_FAMILY "SB1 "
117#elif defined CONFIG_CPU_LOONGSON2 117#elif defined CONFIG_CPU_LOONGSON2
118#define MODULE_PROC_FAMILY "LOONGSON2 " 118#define MODULE_PROC_FAMILY "LOONGSON2 "
119#elif defined CONFIG_CPU_CAVIUM_OCTEON
120#define MODULE_PROC_FAMILY "OCTEON "
119#else 121#else
120#error MODULE_PROC_FAMILY undefined for your processor configuration 122#error MODULE_PROC_FAMILY undefined for your processor configuration
121#endif 123#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-asm.h b/arch/mips/include/asm/octeon/cvmx-asm.h
new file mode 100644
index 000000000000..b21d3fc1ef91
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-asm.h
@@ -0,0 +1,128 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 *
30 * This is file defines ASM primitives for the executive.
31 */
32#ifndef __CVMX_ASM_H__
33#define __CVMX_ASM_H__
34
35#include "octeon-model.h"
36
37/* other useful stuff */
38#define CVMX_SYNC asm volatile ("sync" : : : "memory")
39/* String version of SYNCW macro for using in inline asm constructs */
40#define CVMX_SYNCW_STR "syncw\nsyncw\n"
41#ifdef __OCTEON__
42
43/* Deprecated, will be removed in future release */
44#define CVMX_SYNCIO asm volatile ("nop")
45
46#define CVMX_SYNCIOBDMA asm volatile ("synciobdma" : : : "memory")
47
48/* Deprecated, will be removed in future release */
49#define CVMX_SYNCIOALL asm volatile ("nop")
50
51/*
52 * We actually use two syncw instructions in a row when we need a write
53 * memory barrier. This is because the CN3XXX series of Octeons have
54 * errata Core-401. This can cause a single syncw to not enforce
55 * ordering under very rare conditions. Even if it is rare, better safe
56 * than sorry.
57 */
58#define CVMX_SYNCW asm volatile ("syncw\n\tsyncw" : : : "memory")
59
60/*
61 * Define new sync instructions to be normal SYNC instructions for
62 * operating systems that use threads.
63 */
64#define CVMX_SYNCWS CVMX_SYNCW
65#define CVMX_SYNCS CVMX_SYNC
66#define CVMX_SYNCWS_STR CVMX_SYNCW_STR
67#else
68/*
69 * Not using a Cavium compiler, always use the slower sync so the
70 * assembler stays happy.
71 */
72/* Deprecated, will be removed in future release */
73#define CVMX_SYNCIO asm volatile ("nop")
74
75#define CVMX_SYNCIOBDMA asm volatile ("sync" : : : "memory")
76
77/* Deprecated, will be removed in future release */
78#define CVMX_SYNCIOALL asm volatile ("nop")
79
80#define CVMX_SYNCW asm volatile ("sync" : : : "memory")
81#define CVMX_SYNCWS CVMX_SYNCW
82#define CVMX_SYNCS CVMX_SYNC
83#define CVMX_SYNCWS_STR CVMX_SYNCW_STR
84#endif
85
86/*
87 * CVMX_PREPARE_FOR_STORE makes each byte of the block unpredictable
88 * (actually old value or zero) until that byte is stored to (by this or
89 * another processor. Note that the value of each byte is not only
90 * unpredictable, but may also change again - up until the point when one
91 * of the cores stores to the byte.
92 */
93#define CVMX_PREPARE_FOR_STORE(address, offset) \
94 asm volatile ("pref 30, " CVMX_TMP_STR(offset) "(%[rbase])" : : \
95 [rbase] "d" (address))
96/*
97 * This is a command headed to the L2 controller to tell it to clear
98 * its dirty bit for a block. Basically, SW is telling HW that the
99 * current version of the block will not be used.
100 */
101#define CVMX_DONT_WRITE_BACK(address, offset) \
102 asm volatile ("pref 29, " CVMX_TMP_STR(offset) "(%[rbase])" : : \
103 [rbase] "d" (address))
104
105/* flush stores, invalidate entire icache */
106#define CVMX_ICACHE_INVALIDATE \
107 { CVMX_SYNC; asm volatile ("synci 0($0)" : : ); }
108
109/* flush stores, invalidate entire icache */
110#define CVMX_ICACHE_INVALIDATE2 \
111 { CVMX_SYNC; asm volatile ("cache 0, 0($0)" : : ); }
112
113/* complete prefetches, invalidate entire dcache */
114#define CVMX_DCACHE_INVALIDATE \
115 { CVMX_SYNC; asm volatile ("cache 9, 0($0)" : : ); }
116
117
118#define CVMX_POP(result, input) \
119 asm ("pop %[rd],%[rs]" : [rd] "=d" (result) : [rs] "d" (input))
120#define CVMX_DPOP(result, input) \
121 asm ("dpop %[rd],%[rs]" : [rd] "=d" (result) : [rs] "d" (input))
122
123/* some new cop0-like stuff */
124#define CVMX_RDHWR(result, regstr) \
125 asm volatile ("rdhwr %[rt],$" CVMX_TMP_STR(regstr) : [rt] "=d" (result))
126#define CVMX_RDHWRNV(result, regstr) \
127 asm ("rdhwr %[rt],$" CVMX_TMP_STR(regstr) : [rt] "=d" (result))
128#endif /* __CVMX_ASM_H__ */
diff --git a/arch/mips/include/asm/octeon/cvmx-bootinfo.h b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
new file mode 100644
index 000000000000..692989acd8a9
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h
@@ -0,0 +1,262 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 * Header file containing the ABI with the bootloader.
30 */
31
32#ifndef __CVMX_BOOTINFO_H__
33#define __CVMX_BOOTINFO_H__
34
35/*
36 * Current major and minor versions of the CVMX bootinfo block that is
37 * passed from the bootloader to the application. This is versioned
38 * so that applications can properly handle multiple bootloader
39 * versions.
40 */
41#define CVMX_BOOTINFO_MAJ_VER 1
42#define CVMX_BOOTINFO_MIN_VER 2
43
44#if (CVMX_BOOTINFO_MAJ_VER == 1)
45#define CVMX_BOOTINFO_OCTEON_SERIAL_LEN 20
46/*
47 * This structure is populated by the bootloader. For binary
48 * compatibility the only changes that should be made are
49 * adding members to the end of the structure, and the minor
50 * version should be incremented at that time.
51 * If an incompatible change is made, the major version
52 * must be incremented, and the minor version should be reset
53 * to 0.
54 */
55struct cvmx_bootinfo {
56 uint32_t major_version;
57 uint32_t minor_version;
58
59 uint64_t stack_top;
60 uint64_t heap_base;
61 uint64_t heap_end;
62 uint64_t desc_vaddr;
63
64 uint32_t exception_base_addr;
65 uint32_t stack_size;
66 uint32_t flags;
67 uint32_t core_mask;
68 /* DRAM size in megabytes */
69 uint32_t dram_size;
70 /* physical address of free memory descriptor block*/
71 uint32_t phy_mem_desc_addr;
72 /* used to pass flags from app to debugger */
73 uint32_t debugger_flags_base_addr;
74
75 /* CPU clock speed, in hz */
76 uint32_t eclock_hz;
77
78 /* DRAM clock speed, in hz */
79 uint32_t dclock_hz;
80
81 uint32_t reserved0;
82 uint16_t board_type;
83 uint8_t board_rev_major;
84 uint8_t board_rev_minor;
85 uint16_t reserved1;
86 uint8_t reserved2;
87 uint8_t reserved3;
88 char board_serial_number[CVMX_BOOTINFO_OCTEON_SERIAL_LEN];
89 uint8_t mac_addr_base[6];
90 uint8_t mac_addr_count;
91#if (CVMX_BOOTINFO_MIN_VER >= 1)
92 /*
93 * Several boards support compact flash on the Octeon boot
94 * bus. The CF memory spaces may be mapped to different
95 * addresses on different boards. These are the physical
96 * addresses, so care must be taken to use the correct
97 * XKPHYS/KSEG0 addressing depending on the application's
98 * ABI. These values will be 0 if CF is not present.
99 */
100 uint64_t compact_flash_common_base_addr;
101 uint64_t compact_flash_attribute_base_addr;
102 /*
103 * Base address of the LED display (as on EBT3000 board)
104 * This will be 0 if LED display not present.
105 */
106 uint64_t led_display_base_addr;
107#endif
108#if (CVMX_BOOTINFO_MIN_VER >= 2)
109 /* DFA reference clock in hz (if applicable)*/
110 uint32_t dfa_ref_clock_hz;
111
112 /*
113 * flags indicating various configuration options. These
114 * flags supercede the 'flags' variable and should be used
115 * instead if available.
116 */
117 uint32_t config_flags;
118#endif
119
120};
121
122#define CVMX_BOOTINFO_CFG_FLAG_PCI_HOST (1ull << 0)
123#define CVMX_BOOTINFO_CFG_FLAG_PCI_TARGET (1ull << 1)
124#define CVMX_BOOTINFO_CFG_FLAG_DEBUG (1ull << 2)
125#define CVMX_BOOTINFO_CFG_FLAG_NO_MAGIC (1ull << 3)
126/* This flag is set if the TLB mappings are not contained in the
127 * 0x10000000 - 0x20000000 boot bus region. */
128#define CVMX_BOOTINFO_CFG_FLAG_OVERSIZE_TLB_MAPPING (1ull << 4)
129#define CVMX_BOOTINFO_CFG_FLAG_BREAK (1ull << 5)
130
131#endif /* (CVMX_BOOTINFO_MAJ_VER == 1) */
132
133/* Type defines for board and chip types */
134enum cvmx_board_types_enum {
135 CVMX_BOARD_TYPE_NULL = 0,
136 CVMX_BOARD_TYPE_SIM = 1,
137 CVMX_BOARD_TYPE_EBT3000 = 2,
138 CVMX_BOARD_TYPE_KODAMA = 3,
139 CVMX_BOARD_TYPE_NIAGARA = 4,
140 CVMX_BOARD_TYPE_NAC38 = 5, /* formerly NAO38 */
141 CVMX_BOARD_TYPE_THUNDER = 6,
142 CVMX_BOARD_TYPE_TRANTOR = 7,
143 CVMX_BOARD_TYPE_EBH3000 = 8,
144 CVMX_BOARD_TYPE_EBH3100 = 9,
145 CVMX_BOARD_TYPE_HIKARI = 10,
146 CVMX_BOARD_TYPE_CN3010_EVB_HS5 = 11,
147 CVMX_BOARD_TYPE_CN3005_EVB_HS5 = 12,
148 CVMX_BOARD_TYPE_KBP = 13,
149 /* Deprecated, CVMX_BOARD_TYPE_CN3010_EVB_HS5 supports the CN3020 */
150 CVMX_BOARD_TYPE_CN3020_EVB_HS5 = 14,
151 CVMX_BOARD_TYPE_EBT5800 = 15,
152 CVMX_BOARD_TYPE_NICPRO2 = 16,
153 CVMX_BOARD_TYPE_EBH5600 = 17,
154 CVMX_BOARD_TYPE_EBH5601 = 18,
155 CVMX_BOARD_TYPE_EBH5200 = 19,
156 CVMX_BOARD_TYPE_BBGW_REF = 20,
157 CVMX_BOARD_TYPE_NIC_XLE_4G = 21,
158 CVMX_BOARD_TYPE_EBT5600 = 22,
159 CVMX_BOARD_TYPE_EBH5201 = 23,
160 CVMX_BOARD_TYPE_MAX,
161
162 /*
163 * The range from CVMX_BOARD_TYPE_MAX to
164 * CVMX_BOARD_TYPE_CUST_DEFINED_MIN is reserved for future
165 * SDK use.
166 */
167
168 /*
169 * Set aside a range for customer boards. These numbers are managed
170 * by Cavium.
171 */
172 CVMX_BOARD_TYPE_CUST_DEFINED_MIN = 10000,
173 CVMX_BOARD_TYPE_CUST_WSX16 = 10001,
174 CVMX_BOARD_TYPE_CUST_NS0216 = 10002,
175 CVMX_BOARD_TYPE_CUST_NB5 = 10003,
176 CVMX_BOARD_TYPE_CUST_WMR500 = 10004,
177 CVMX_BOARD_TYPE_CUST_DEFINED_MAX = 20000,
178
179 /*
180 * Set aside a range for customer private use. The SDK won't
181 * use any numbers in this range.
182 */
183 CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001,
184 CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000,
185
186 /* The remaining range is reserved for future use. */
187};
188
189enum cvmx_chip_types_enum {
190 CVMX_CHIP_TYPE_NULL = 0,
191 CVMX_CHIP_SIM_TYPE_DEPRECATED = 1,
192 CVMX_CHIP_TYPE_OCTEON_SAMPLE = 2,
193 CVMX_CHIP_TYPE_MAX,
194};
195
196/* Compatability alias for NAC38 name change, planned to be removed
197 * from SDK 1.7 */
198#define CVMX_BOARD_TYPE_NAO38 CVMX_BOARD_TYPE_NAC38
199
200/* Functions to return string based on type */
201#define ENUM_BRD_TYPE_CASE(x) \
202 case x: return(#x + 16); /* Skip CVMX_BOARD_TYPE_ */
203static inline const char *cvmx_board_type_to_string(enum
204 cvmx_board_types_enum type)
205{
206 switch (type) {
207 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NULL)
208 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_SIM)
209 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT3000)
210 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KODAMA)
211 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIAGARA)
212 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NAC38)
213 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_THUNDER)
214 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_TRANTOR)
215 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH3000)
216 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH3100)
217 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_HIKARI)
218 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3010_EVB_HS5)
219 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3005_EVB_HS5)
220 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KBP)
221 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CN3020_EVB_HS5)
222 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5800)
223 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NICPRO2)
224 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5600)
225 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5601)
226 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5200)
227 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_BBGW_REF)
228 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_NIC_XLE_4G)
229 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBT5600)
230 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_EBH5201)
231 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_MAX)
232
233 /* Customer boards listed here */
234 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MIN)
235 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WSX16)
236 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NS0216)
237 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_NB5)
238 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_WMR500)
239 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DEFINED_MAX)
240
241 /* Customer private range */
242 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN)
243 ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX)
244 }
245 return "Unsupported Board";
246}
247
248#define ENUM_CHIP_TYPE_CASE(x) \
249 case x: return(#x + 15); /* Skip CVMX_CHIP_TYPE */
250static inline const char *cvmx_chip_type_to_string(enum
251 cvmx_chip_types_enum type)
252{
253 switch (type) {
254 ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_NULL)
255 ENUM_CHIP_TYPE_CASE(CVMX_CHIP_SIM_TYPE_DEPRECATED)
256 ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_OCTEON_SAMPLE)
257 ENUM_CHIP_TYPE_CASE(CVMX_CHIP_TYPE_MAX)
258 }
259 return "Unsupported Chip";
260}
261
262#endif /* __CVMX_BOOTINFO_H__ */
diff --git a/arch/mips/include/asm/octeon/cvmx-bootmem.h b/arch/mips/include/asm/octeon/cvmx-bootmem.h
new file mode 100644
index 000000000000..1cbe4b55889d
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-bootmem.h
@@ -0,0 +1,288 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 * Simple allocate only memory allocator. Used to allocate memory at
30 * application start time.
31 */
32
33#ifndef __CVMX_BOOTMEM_H__
34#define __CVMX_BOOTMEM_H__
35/* Must be multiple of 8, changing breaks ABI */
36#define CVMX_BOOTMEM_NAME_LEN 128
37
38/* Can change without breaking ABI */
39#define CVMX_BOOTMEM_NUM_NAMED_BLOCKS 64
40
41/* minimum alignment of bootmem alloced blocks */
42#define CVMX_BOOTMEM_ALIGNMENT_SIZE (16ull)
43
44/* Flags for cvmx_bootmem_phy_mem* functions */
45/* Allocate from end of block instead of beginning */
46#define CVMX_BOOTMEM_FLAG_END_ALLOC (1 << 0)
47
48/* Don't do any locking. */
49#define CVMX_BOOTMEM_FLAG_NO_LOCKING (1 << 1)
50
51/* First bytes of each free physical block of memory contain this structure,
52 * which is used to maintain the free memory list. Since the bootloader is
53 * only 32 bits, there is a union providing 64 and 32 bit versions. The
54 * application init code converts addresses to 64 bit addresses before the
55 * application starts.
56 */
57struct cvmx_bootmem_block_header {
58 /*
59 * Note: these are referenced from assembly routines in the
60 * bootloader, so this structure should not be changed
61 * without changing those routines as well.
62 */
63 uint64_t next_block_addr;
64 uint64_t size;
65
66};
67
68/*
69 * Structure for named memory blocks. Number of descriptors available
70 * can be changed without affecting compatiblity, but name length
71 * changes require a bump in the bootmem descriptor version Note: This
72 * structure must be naturally 64 bit aligned, as a single memory
73 * image will be used by both 32 and 64 bit programs.
74 */
75struct cvmx_bootmem_named_block_desc {
76 /* Base address of named block */
77 uint64_t base_addr;
78 /*
79 * Size actually allocated for named block (may differ from
80 * requested).
81 */
82 uint64_t size;
83 /* name of named block */
84 char name[CVMX_BOOTMEM_NAME_LEN];
85};
86
87/* Current descriptor versions */
88/* CVMX bootmem descriptor major version */
89#define CVMX_BOOTMEM_DESC_MAJ_VER 3
90
91/* CVMX bootmem descriptor minor version */
92#define CVMX_BOOTMEM_DESC_MIN_VER 0
93
94/* First three members of cvmx_bootmem_desc_t are left in original
95 * positions for backwards compatibility.
96 */
97struct cvmx_bootmem_desc {
98 /* spinlock to control access to list */
99 uint32_t lock;
100 /* flags for indicating various conditions */
101 uint32_t flags;
102 uint64_t head_addr;
103
104 /* Incremented when incompatible changes made */
105 uint32_t major_version;
106
107 /*
108 * Incremented changed when compatible changes made, reset to
109 * zero when major incremented.
110 */
111 uint32_t minor_version;
112
113 uint64_t app_data_addr;
114 uint64_t app_data_size;
115
116 /* number of elements in named blocks array */
117 uint32_t named_block_num_blocks;
118
119 /* length of name array in bootmem blocks */
120 uint32_t named_block_name_len;
121 /* address of named memory block descriptors */
122 uint64_t named_block_array_addr;
123
124};
125
126/**
127 * Initialize the boot alloc memory structures. This is
128 * normally called inside of cvmx_user_app_init()
129 *
130 * @mem_desc_ptr: Address of the free memory list
131 */
132extern int cvmx_bootmem_init(void *mem_desc_ptr);
133
134/**
135 * Allocate a block of memory from the free list that was passed
136 * to the application by the bootloader.
137 * This is an allocate-only algorithm, so freeing memory is not possible.
138 *
139 * @size: Size in bytes of block to allocate
140 * @alignment: Alignment required - must be power of 2
141 *
142 * Returns pointer to block of memory, NULL on error
143 */
144extern void *cvmx_bootmem_alloc(uint64_t size, uint64_t alignment);
145
146/**
147 * Allocate a block of memory from the free list that was
148 * passed to the application by the bootloader at a specific
149 * address. This is an allocate-only algorithm, so
150 * freeing memory is not possible. Allocation will fail if
151 * memory cannot be allocated at the specified address.
152 *
153 * @size: Size in bytes of block to allocate
154 * @address: Physical address to allocate memory at. If this memory is not
155 * available, the allocation fails.
156 * @alignment: Alignment required - must be power of 2
157 * Returns pointer to block of memory, NULL on error
158 */
159extern void *cvmx_bootmem_alloc_address(uint64_t size, uint64_t address,
160 uint64_t alignment);
161
162/**
163 * Allocate a block of memory from the free list that was
164 * passed to the application by the bootloader within a specified
165 * address range. This is an allocate-only algorithm, so
166 * freeing memory is not possible. Allocation will fail if
167 * memory cannot be allocated in the requested range.
168 *
169 * @size: Size in bytes of block to allocate
170 * @min_addr: defines the minimum address of the range
171 * @max_addr: defines the maximum address of the range
172 * @alignment: Alignment required - must be power of 2
173 * Returns pointer to block of memory, NULL on error
174 */
175extern void *cvmx_bootmem_alloc_range(uint64_t size, uint64_t alignment,
176 uint64_t min_addr, uint64_t max_addr);
177
178/**
179 * Frees a previously allocated named bootmem block.
180 *
181 * @name: name of block to free
182 *
183 * Returns 0 on failure,
184 * !0 on success
185 */
186extern int cvmx_bootmem_free_named(char *name);
187
188/**
189 * Finds a named bootmem block by name.
190 *
191 * @name: name of block to free
192 *
193 * Returns pointer to named block descriptor on success
194 * 0 on failure
195 */
196struct cvmx_bootmem_named_block_desc *cvmx_bootmem_find_named_block(char *name);
197
198/**
199 * Allocates a block of physical memory from the free list, at
200 * (optional) requested address and alignment.
201 *
202 * @req_size: size of region to allocate. All requests are rounded up
203 * to be a multiple CVMX_BOOTMEM_ALIGNMENT_SIZE bytes size
204 *
205 * @address_min: Minimum address that block can occupy.
206 *
207 * @address_max: Specifies the maximum address_min (inclusive) that
208 * the allocation can use.
209 *
210 * @alignment: Requested alignment of the block. If this alignment
211 * cannot be met, the allocation fails. This must be a
212 * power of 2. (Note: Alignment of
213 * CVMX_BOOTMEM_ALIGNMENT_SIZE bytes is required, and
214 * internally enforced. Requested alignments of less than
215 * CVMX_BOOTMEM_ALIGNMENT_SIZE are set to
216 * CVMX_BOOTMEM_ALIGNMENT_SIZE.)
217 *
218 * @flags: Flags to control options for the allocation.
219 *
220 * Returns physical address of block allocated, or -1 on failure
221 */
222int64_t cvmx_bootmem_phy_alloc(uint64_t req_size, uint64_t address_min,
223 uint64_t address_max, uint64_t alignment,
224 uint32_t flags);
225
226/**
227 * Finds a named memory block by name.
228 * Also used for finding an unused entry in the named block table.
229 *
230 * @name: Name of memory block to find. If NULL pointer given, then
231 * finds unused descriptor, if available.
232 *
233 * @flags: Flags to control options for the allocation.
234 *
235 * Returns Pointer to memory block descriptor, NULL if not found.
236 * If NULL returned when name parameter is NULL, then no memory
237 * block descriptors are available.
238 */
239struct cvmx_bootmem_named_block_desc *
240cvmx_bootmem_phy_named_block_find(char *name, uint32_t flags);
241
242/**
243 * Frees a named block.
244 *
245 * @name: name of block to free
246 * @flags: flags for passing options
247 *
248 * Returns 0 on failure
249 * 1 on success
250 */
251int cvmx_bootmem_phy_named_block_free(char *name, uint32_t flags);
252
253/**
254 * Frees a block to the bootmem allocator list. This must
255 * be used with care, as the size provided must match the size
256 * of the block that was allocated, or the list will become
257 * corrupted.
258 *
259 * IMPORTANT: This is only intended to be used as part of named block
260 * frees and initial population of the free memory list.
261 * *
262 *
263 * @phy_addr: physical address of block
264 * @size: size of block in bytes.
265 * @flags: flags for passing options
266 *
267 * Returns 1 on success,
268 * 0 on failure
269 */
270int __cvmx_bootmem_phy_free(uint64_t phy_addr, uint64_t size, uint32_t flags);
271
272/**
273 * Locks the bootmem allocator. This is useful in certain situations
274 * where multiple allocations must be made without being interrupted.
275 * This should be used with the CVMX_BOOTMEM_FLAG_NO_LOCKING flag.
276 *
277 */
278void cvmx_bootmem_lock(void);
279
280/**
281 * Unlocks the bootmem allocator. This is useful in certain situations
282 * where multiple allocations must be made without being interrupted.
283 * This should be used with the CVMX_BOOTMEM_FLAG_NO_LOCKING flag.
284 *
285 */
286void cvmx_bootmem_unlock(void);
287
288#endif /* __CVMX_BOOTMEM_H__ */
diff --git a/arch/mips/include/asm/octeon/cvmx-ciu-defs.h b/arch/mips/include/asm/octeon/cvmx-ciu-defs.h
new file mode 100644
index 000000000000..f8f05b7764b7
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-ciu-defs.h
@@ -0,0 +1,1616 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_CIU_DEFS_H__
29#define __CVMX_CIU_DEFS_H__
30
31#define CVMX_CIU_BIST \
32 CVMX_ADD_IO_SEG(0x0001070000000730ull)
33#define CVMX_CIU_DINT \
34 CVMX_ADD_IO_SEG(0x0001070000000720ull)
35#define CVMX_CIU_FUSE \
36 CVMX_ADD_IO_SEG(0x0001070000000728ull)
37#define CVMX_CIU_GSTOP \
38 CVMX_ADD_IO_SEG(0x0001070000000710ull)
39#define CVMX_CIU_INTX_EN0(offset) \
40 CVMX_ADD_IO_SEG(0x0001070000000200ull + (((offset) & 63) * 16))
41#define CVMX_CIU_INTX_EN0_W1C(offset) \
42 CVMX_ADD_IO_SEG(0x0001070000002200ull + (((offset) & 63) * 16))
43#define CVMX_CIU_INTX_EN0_W1S(offset) \
44 CVMX_ADD_IO_SEG(0x0001070000006200ull + (((offset) & 63) * 16))
45#define CVMX_CIU_INTX_EN1(offset) \
46 CVMX_ADD_IO_SEG(0x0001070000000208ull + (((offset) & 63) * 16))
47#define CVMX_CIU_INTX_EN1_W1C(offset) \
48 CVMX_ADD_IO_SEG(0x0001070000002208ull + (((offset) & 63) * 16))
49#define CVMX_CIU_INTX_EN1_W1S(offset) \
50 CVMX_ADD_IO_SEG(0x0001070000006208ull + (((offset) & 63) * 16))
51#define CVMX_CIU_INTX_EN4_0(offset) \
52 CVMX_ADD_IO_SEG(0x0001070000000C80ull + (((offset) & 15) * 16))
53#define CVMX_CIU_INTX_EN4_0_W1C(offset) \
54 CVMX_ADD_IO_SEG(0x0001070000002C80ull + (((offset) & 15) * 16))
55#define CVMX_CIU_INTX_EN4_0_W1S(offset) \
56 CVMX_ADD_IO_SEG(0x0001070000006C80ull + (((offset) & 15) * 16))
57#define CVMX_CIU_INTX_EN4_1(offset) \
58 CVMX_ADD_IO_SEG(0x0001070000000C88ull + (((offset) & 15) * 16))
59#define CVMX_CIU_INTX_EN4_1_W1C(offset) \
60 CVMX_ADD_IO_SEG(0x0001070000002C88ull + (((offset) & 15) * 16))
61#define CVMX_CIU_INTX_EN4_1_W1S(offset) \
62 CVMX_ADD_IO_SEG(0x0001070000006C88ull + (((offset) & 15) * 16))
63#define CVMX_CIU_INTX_SUM0(offset) \
64 CVMX_ADD_IO_SEG(0x0001070000000000ull + (((offset) & 63) * 8))
65#define CVMX_CIU_INTX_SUM4(offset) \
66 CVMX_ADD_IO_SEG(0x0001070000000C00ull + (((offset) & 15) * 8))
67#define CVMX_CIU_INT_SUM1 \
68 CVMX_ADD_IO_SEG(0x0001070000000108ull)
69#define CVMX_CIU_MBOX_CLRX(offset) \
70 CVMX_ADD_IO_SEG(0x0001070000000680ull + (((offset) & 15) * 8))
71#define CVMX_CIU_MBOX_SETX(offset) \
72 CVMX_ADD_IO_SEG(0x0001070000000600ull + (((offset) & 15) * 8))
73#define CVMX_CIU_NMI \
74 CVMX_ADD_IO_SEG(0x0001070000000718ull)
75#define CVMX_CIU_PCI_INTA \
76 CVMX_ADD_IO_SEG(0x0001070000000750ull)
77#define CVMX_CIU_PP_DBG \
78 CVMX_ADD_IO_SEG(0x0001070000000708ull)
79#define CVMX_CIU_PP_POKEX(offset) \
80 CVMX_ADD_IO_SEG(0x0001070000000580ull + (((offset) & 15) * 8))
81#define CVMX_CIU_PP_RST \
82 CVMX_ADD_IO_SEG(0x0001070000000700ull)
83#define CVMX_CIU_QLM_DCOK \
84 CVMX_ADD_IO_SEG(0x0001070000000760ull)
85#define CVMX_CIU_QLM_JTGC \
86 CVMX_ADD_IO_SEG(0x0001070000000768ull)
87#define CVMX_CIU_QLM_JTGD \
88 CVMX_ADD_IO_SEG(0x0001070000000770ull)
89#define CVMX_CIU_SOFT_BIST \
90 CVMX_ADD_IO_SEG(0x0001070000000738ull)
91#define CVMX_CIU_SOFT_PRST \
92 CVMX_ADD_IO_SEG(0x0001070000000748ull)
93#define CVMX_CIU_SOFT_PRST1 \
94 CVMX_ADD_IO_SEG(0x0001070000000758ull)
95#define CVMX_CIU_SOFT_RST \
96 CVMX_ADD_IO_SEG(0x0001070000000740ull)
97#define CVMX_CIU_TIMX(offset) \
98 CVMX_ADD_IO_SEG(0x0001070000000480ull + (((offset) & 3) * 8))
99#define CVMX_CIU_WDOGX(offset) \
100 CVMX_ADD_IO_SEG(0x0001070000000500ull + (((offset) & 15) * 8))
101
102union cvmx_ciu_bist {
103 uint64_t u64;
104 struct cvmx_ciu_bist_s {
105 uint64_t reserved_4_63:60;
106 uint64_t bist:4;
107 } s;
108 struct cvmx_ciu_bist_s cn30xx;
109 struct cvmx_ciu_bist_s cn31xx;
110 struct cvmx_ciu_bist_s cn38xx;
111 struct cvmx_ciu_bist_s cn38xxp2;
112 struct cvmx_ciu_bist_cn50xx {
113 uint64_t reserved_2_63:62;
114 uint64_t bist:2;
115 } cn50xx;
116 struct cvmx_ciu_bist_cn52xx {
117 uint64_t reserved_3_63:61;
118 uint64_t bist:3;
119 } cn52xx;
120 struct cvmx_ciu_bist_cn52xx cn52xxp1;
121 struct cvmx_ciu_bist_s cn56xx;
122 struct cvmx_ciu_bist_s cn56xxp1;
123 struct cvmx_ciu_bist_s cn58xx;
124 struct cvmx_ciu_bist_s cn58xxp1;
125};
126
127union cvmx_ciu_dint {
128 uint64_t u64;
129 struct cvmx_ciu_dint_s {
130 uint64_t reserved_16_63:48;
131 uint64_t dint:16;
132 } s;
133 struct cvmx_ciu_dint_cn30xx {
134 uint64_t reserved_1_63:63;
135 uint64_t dint:1;
136 } cn30xx;
137 struct cvmx_ciu_dint_cn31xx {
138 uint64_t reserved_2_63:62;
139 uint64_t dint:2;
140 } cn31xx;
141 struct cvmx_ciu_dint_s cn38xx;
142 struct cvmx_ciu_dint_s cn38xxp2;
143 struct cvmx_ciu_dint_cn31xx cn50xx;
144 struct cvmx_ciu_dint_cn52xx {
145 uint64_t reserved_4_63:60;
146 uint64_t dint:4;
147 } cn52xx;
148 struct cvmx_ciu_dint_cn52xx cn52xxp1;
149 struct cvmx_ciu_dint_cn56xx {
150 uint64_t reserved_12_63:52;
151 uint64_t dint:12;
152 } cn56xx;
153 struct cvmx_ciu_dint_cn56xx cn56xxp1;
154 struct cvmx_ciu_dint_s cn58xx;
155 struct cvmx_ciu_dint_s cn58xxp1;
156};
157
158union cvmx_ciu_fuse {
159 uint64_t u64;
160 struct cvmx_ciu_fuse_s {
161 uint64_t reserved_16_63:48;
162 uint64_t fuse:16;
163 } s;
164 struct cvmx_ciu_fuse_cn30xx {
165 uint64_t reserved_1_63:63;
166 uint64_t fuse:1;
167 } cn30xx;
168 struct cvmx_ciu_fuse_cn31xx {
169 uint64_t reserved_2_63:62;
170 uint64_t fuse:2;
171 } cn31xx;
172 struct cvmx_ciu_fuse_s cn38xx;
173 struct cvmx_ciu_fuse_s cn38xxp2;
174 struct cvmx_ciu_fuse_cn31xx cn50xx;
175 struct cvmx_ciu_fuse_cn52xx {
176 uint64_t reserved_4_63:60;
177 uint64_t fuse:4;
178 } cn52xx;
179 struct cvmx_ciu_fuse_cn52xx cn52xxp1;
180 struct cvmx_ciu_fuse_cn56xx {
181 uint64_t reserved_12_63:52;
182 uint64_t fuse:12;
183 } cn56xx;
184 struct cvmx_ciu_fuse_cn56xx cn56xxp1;
185 struct cvmx_ciu_fuse_s cn58xx;
186 struct cvmx_ciu_fuse_s cn58xxp1;
187};
188
189union cvmx_ciu_gstop {
190 uint64_t u64;
191 struct cvmx_ciu_gstop_s {
192 uint64_t reserved_1_63:63;
193 uint64_t gstop:1;
194 } s;
195 struct cvmx_ciu_gstop_s cn30xx;
196 struct cvmx_ciu_gstop_s cn31xx;
197 struct cvmx_ciu_gstop_s cn38xx;
198 struct cvmx_ciu_gstop_s cn38xxp2;
199 struct cvmx_ciu_gstop_s cn50xx;
200 struct cvmx_ciu_gstop_s cn52xx;
201 struct cvmx_ciu_gstop_s cn52xxp1;
202 struct cvmx_ciu_gstop_s cn56xx;
203 struct cvmx_ciu_gstop_s cn56xxp1;
204 struct cvmx_ciu_gstop_s cn58xx;
205 struct cvmx_ciu_gstop_s cn58xxp1;
206};
207
208union cvmx_ciu_intx_en0 {
209 uint64_t u64;
210 struct cvmx_ciu_intx_en0_s {
211 uint64_t bootdma:1;
212 uint64_t mii:1;
213 uint64_t ipdppthr:1;
214 uint64_t powiq:1;
215 uint64_t twsi2:1;
216 uint64_t mpi:1;
217 uint64_t pcm:1;
218 uint64_t usb:1;
219 uint64_t timer:4;
220 uint64_t key_zero:1;
221 uint64_t ipd_drp:1;
222 uint64_t gmx_drp:2;
223 uint64_t trace:1;
224 uint64_t rml:1;
225 uint64_t twsi:1;
226 uint64_t reserved_44_44:1;
227 uint64_t pci_msi:4;
228 uint64_t pci_int:4;
229 uint64_t uart:2;
230 uint64_t mbox:2;
231 uint64_t gpio:16;
232 uint64_t workq:16;
233 } s;
234 struct cvmx_ciu_intx_en0_cn30xx {
235 uint64_t reserved_59_63:5;
236 uint64_t mpi:1;
237 uint64_t pcm:1;
238 uint64_t usb:1;
239 uint64_t timer:4;
240 uint64_t reserved_51_51:1;
241 uint64_t ipd_drp:1;
242 uint64_t reserved_49_49:1;
243 uint64_t gmx_drp:1;
244 uint64_t reserved_47_47:1;
245 uint64_t rml:1;
246 uint64_t twsi:1;
247 uint64_t reserved_44_44:1;
248 uint64_t pci_msi:4;
249 uint64_t pci_int:4;
250 uint64_t uart:2;
251 uint64_t mbox:2;
252 uint64_t gpio:16;
253 uint64_t workq:16;
254 } cn30xx;
255 struct cvmx_ciu_intx_en0_cn31xx {
256 uint64_t reserved_59_63:5;
257 uint64_t mpi:1;
258 uint64_t pcm:1;
259 uint64_t usb:1;
260 uint64_t timer:4;
261 uint64_t reserved_51_51:1;
262 uint64_t ipd_drp:1;
263 uint64_t reserved_49_49:1;
264 uint64_t gmx_drp:1;
265 uint64_t trace:1;
266 uint64_t rml:1;
267 uint64_t twsi:1;
268 uint64_t reserved_44_44:1;
269 uint64_t pci_msi:4;
270 uint64_t pci_int:4;
271 uint64_t uart:2;
272 uint64_t mbox:2;
273 uint64_t gpio:16;
274 uint64_t workq:16;
275 } cn31xx;
276 struct cvmx_ciu_intx_en0_cn38xx {
277 uint64_t reserved_56_63:8;
278 uint64_t timer:4;
279 uint64_t key_zero:1;
280 uint64_t ipd_drp:1;
281 uint64_t gmx_drp:2;
282 uint64_t trace:1;
283 uint64_t rml:1;
284 uint64_t twsi:1;
285 uint64_t reserved_44_44:1;
286 uint64_t pci_msi:4;
287 uint64_t pci_int:4;
288 uint64_t uart:2;
289 uint64_t mbox:2;
290 uint64_t gpio:16;
291 uint64_t workq:16;
292 } cn38xx;
293 struct cvmx_ciu_intx_en0_cn38xx cn38xxp2;
294 struct cvmx_ciu_intx_en0_cn30xx cn50xx;
295 struct cvmx_ciu_intx_en0_cn52xx {
296 uint64_t bootdma:1;
297 uint64_t mii:1;
298 uint64_t ipdppthr:1;
299 uint64_t powiq:1;
300 uint64_t twsi2:1;
301 uint64_t reserved_57_58:2;
302 uint64_t usb:1;
303 uint64_t timer:4;
304 uint64_t reserved_51_51:1;
305 uint64_t ipd_drp:1;
306 uint64_t reserved_49_49:1;
307 uint64_t gmx_drp:1;
308 uint64_t trace:1;
309 uint64_t rml:1;
310 uint64_t twsi:1;
311 uint64_t reserved_44_44:1;
312 uint64_t pci_msi:4;
313 uint64_t pci_int:4;
314 uint64_t uart:2;
315 uint64_t mbox:2;
316 uint64_t gpio:16;
317 uint64_t workq:16;
318 } cn52xx;
319 struct cvmx_ciu_intx_en0_cn52xx cn52xxp1;
320 struct cvmx_ciu_intx_en0_cn56xx {
321 uint64_t bootdma:1;
322 uint64_t mii:1;
323 uint64_t ipdppthr:1;
324 uint64_t powiq:1;
325 uint64_t twsi2:1;
326 uint64_t reserved_57_58:2;
327 uint64_t usb:1;
328 uint64_t timer:4;
329 uint64_t key_zero:1;
330 uint64_t ipd_drp:1;
331 uint64_t gmx_drp:2;
332 uint64_t trace:1;
333 uint64_t rml:1;
334 uint64_t twsi:1;
335 uint64_t reserved_44_44:1;
336 uint64_t pci_msi:4;
337 uint64_t pci_int:4;
338 uint64_t uart:2;
339 uint64_t mbox:2;
340 uint64_t gpio:16;
341 uint64_t workq:16;
342 } cn56xx;
343 struct cvmx_ciu_intx_en0_cn56xx cn56xxp1;
344 struct cvmx_ciu_intx_en0_cn38xx cn58xx;
345 struct cvmx_ciu_intx_en0_cn38xx cn58xxp1;
346};
347
348union cvmx_ciu_intx_en0_w1c {
349 uint64_t u64;
350 struct cvmx_ciu_intx_en0_w1c_s {
351 uint64_t bootdma:1;
352 uint64_t mii:1;
353 uint64_t ipdppthr:1;
354 uint64_t powiq:1;
355 uint64_t twsi2:1;
356 uint64_t reserved_57_58:2;
357 uint64_t usb:1;
358 uint64_t timer:4;
359 uint64_t key_zero:1;
360 uint64_t ipd_drp:1;
361 uint64_t gmx_drp:2;
362 uint64_t trace:1;
363 uint64_t rml:1;
364 uint64_t twsi:1;
365 uint64_t reserved_44_44:1;
366 uint64_t pci_msi:4;
367 uint64_t pci_int:4;
368 uint64_t uart:2;
369 uint64_t mbox:2;
370 uint64_t gpio:16;
371 uint64_t workq:16;
372 } s;
373 struct cvmx_ciu_intx_en0_w1c_cn52xx {
374 uint64_t bootdma:1;
375 uint64_t mii:1;
376 uint64_t ipdppthr:1;
377 uint64_t powiq:1;
378 uint64_t twsi2:1;
379 uint64_t reserved_57_58:2;
380 uint64_t usb:1;
381 uint64_t timer:4;
382 uint64_t reserved_51_51:1;
383 uint64_t ipd_drp:1;
384 uint64_t reserved_49_49:1;
385 uint64_t gmx_drp:1;
386 uint64_t trace:1;
387 uint64_t rml:1;
388 uint64_t twsi:1;
389 uint64_t reserved_44_44:1;
390 uint64_t pci_msi:4;
391 uint64_t pci_int:4;
392 uint64_t uart:2;
393 uint64_t mbox:2;
394 uint64_t gpio:16;
395 uint64_t workq:16;
396 } cn52xx;
397 struct cvmx_ciu_intx_en0_w1c_s cn56xx;
398 struct cvmx_ciu_intx_en0_w1c_cn58xx {
399 uint64_t reserved_56_63:8;
400 uint64_t timer:4;
401 uint64_t key_zero:1;
402 uint64_t ipd_drp:1;
403 uint64_t gmx_drp:2;
404 uint64_t trace:1;
405 uint64_t rml:1;
406 uint64_t twsi:1;
407 uint64_t reserved_44_44:1;
408 uint64_t pci_msi:4;
409 uint64_t pci_int:4;
410 uint64_t uart:2;
411 uint64_t mbox:2;
412 uint64_t gpio:16;
413 uint64_t workq:16;
414 } cn58xx;
415};
416
417union cvmx_ciu_intx_en0_w1s {
418 uint64_t u64;
419 struct cvmx_ciu_intx_en0_w1s_s {
420 uint64_t bootdma:1;
421 uint64_t mii:1;
422 uint64_t ipdppthr:1;
423 uint64_t powiq:1;
424 uint64_t twsi2:1;
425 uint64_t reserved_57_58:2;
426 uint64_t usb:1;
427 uint64_t timer:4;
428 uint64_t key_zero:1;
429 uint64_t ipd_drp:1;
430 uint64_t gmx_drp:2;
431 uint64_t trace:1;
432 uint64_t rml:1;
433 uint64_t twsi:1;
434 uint64_t reserved_44_44:1;
435 uint64_t pci_msi:4;
436 uint64_t pci_int:4;
437 uint64_t uart:2;
438 uint64_t mbox:2;
439 uint64_t gpio:16;
440 uint64_t workq:16;
441 } s;
442 struct cvmx_ciu_intx_en0_w1s_cn52xx {
443 uint64_t bootdma:1;
444 uint64_t mii:1;
445 uint64_t ipdppthr:1;
446 uint64_t powiq:1;
447 uint64_t twsi2:1;
448 uint64_t reserved_57_58:2;
449 uint64_t usb:1;
450 uint64_t timer:4;
451 uint64_t reserved_51_51:1;
452 uint64_t ipd_drp:1;
453 uint64_t reserved_49_49:1;
454 uint64_t gmx_drp:1;
455 uint64_t trace:1;
456 uint64_t rml:1;
457 uint64_t twsi:1;
458 uint64_t reserved_44_44:1;
459 uint64_t pci_msi:4;
460 uint64_t pci_int:4;
461 uint64_t uart:2;
462 uint64_t mbox:2;
463 uint64_t gpio:16;
464 uint64_t workq:16;
465 } cn52xx;
466 struct cvmx_ciu_intx_en0_w1s_s cn56xx;
467 struct cvmx_ciu_intx_en0_w1s_cn58xx {
468 uint64_t reserved_56_63:8;
469 uint64_t timer:4;
470 uint64_t key_zero:1;
471 uint64_t ipd_drp:1;
472 uint64_t gmx_drp:2;
473 uint64_t trace:1;
474 uint64_t rml:1;
475 uint64_t twsi:1;
476 uint64_t reserved_44_44:1;
477 uint64_t pci_msi:4;
478 uint64_t pci_int:4;
479 uint64_t uart:2;
480 uint64_t mbox:2;
481 uint64_t gpio:16;
482 uint64_t workq:16;
483 } cn58xx;
484};
485
486union cvmx_ciu_intx_en1 {
487 uint64_t u64;
488 struct cvmx_ciu_intx_en1_s {
489 uint64_t reserved_20_63:44;
490 uint64_t nand:1;
491 uint64_t mii1:1;
492 uint64_t usb1:1;
493 uint64_t uart2:1;
494 uint64_t wdog:16;
495 } s;
496 struct cvmx_ciu_intx_en1_cn30xx {
497 uint64_t reserved_1_63:63;
498 uint64_t wdog:1;
499 } cn30xx;
500 struct cvmx_ciu_intx_en1_cn31xx {
501 uint64_t reserved_2_63:62;
502 uint64_t wdog:2;
503 } cn31xx;
504 struct cvmx_ciu_intx_en1_cn38xx {
505 uint64_t reserved_16_63:48;
506 uint64_t wdog:16;
507 } cn38xx;
508 struct cvmx_ciu_intx_en1_cn38xx cn38xxp2;
509 struct cvmx_ciu_intx_en1_cn31xx cn50xx;
510 struct cvmx_ciu_intx_en1_cn52xx {
511 uint64_t reserved_20_63:44;
512 uint64_t nand:1;
513 uint64_t mii1:1;
514 uint64_t usb1:1;
515 uint64_t uart2:1;
516 uint64_t reserved_4_15:12;
517 uint64_t wdog:4;
518 } cn52xx;
519 struct cvmx_ciu_intx_en1_cn52xxp1 {
520 uint64_t reserved_19_63:45;
521 uint64_t mii1:1;
522 uint64_t usb1:1;
523 uint64_t uart2:1;
524 uint64_t reserved_4_15:12;
525 uint64_t wdog:4;
526 } cn52xxp1;
527 struct cvmx_ciu_intx_en1_cn56xx {
528 uint64_t reserved_12_63:52;
529 uint64_t wdog:12;
530 } cn56xx;
531 struct cvmx_ciu_intx_en1_cn56xx cn56xxp1;
532 struct cvmx_ciu_intx_en1_cn38xx cn58xx;
533 struct cvmx_ciu_intx_en1_cn38xx cn58xxp1;
534};
535
536union cvmx_ciu_intx_en1_w1c {
537 uint64_t u64;
538 struct cvmx_ciu_intx_en1_w1c_s {
539 uint64_t reserved_20_63:44;
540 uint64_t nand:1;
541 uint64_t mii1:1;
542 uint64_t usb1:1;
543 uint64_t uart2:1;
544 uint64_t wdog:16;
545 } s;
546 struct cvmx_ciu_intx_en1_w1c_cn52xx {
547 uint64_t reserved_20_63:44;
548 uint64_t nand:1;
549 uint64_t mii1:1;
550 uint64_t usb1:1;
551 uint64_t uart2:1;
552 uint64_t reserved_4_15:12;
553 uint64_t wdog:4;
554 } cn52xx;
555 struct cvmx_ciu_intx_en1_w1c_cn56xx {
556 uint64_t reserved_12_63:52;
557 uint64_t wdog:12;
558 } cn56xx;
559 struct cvmx_ciu_intx_en1_w1c_cn58xx {
560 uint64_t reserved_16_63:48;
561 uint64_t wdog:16;
562 } cn58xx;
563};
564
565union cvmx_ciu_intx_en1_w1s {
566 uint64_t u64;
567 struct cvmx_ciu_intx_en1_w1s_s {
568 uint64_t reserved_20_63:44;
569 uint64_t nand:1;
570 uint64_t mii1:1;
571 uint64_t usb1:1;
572 uint64_t uart2:1;
573 uint64_t wdog:16;
574 } s;
575 struct cvmx_ciu_intx_en1_w1s_cn52xx {
576 uint64_t reserved_20_63:44;
577 uint64_t nand:1;
578 uint64_t mii1:1;
579 uint64_t usb1:1;
580 uint64_t uart2:1;
581 uint64_t reserved_4_15:12;
582 uint64_t wdog:4;
583 } cn52xx;
584 struct cvmx_ciu_intx_en1_w1s_cn56xx {
585 uint64_t reserved_12_63:52;
586 uint64_t wdog:12;
587 } cn56xx;
588 struct cvmx_ciu_intx_en1_w1s_cn58xx {
589 uint64_t reserved_16_63:48;
590 uint64_t wdog:16;
591 } cn58xx;
592};
593
594union cvmx_ciu_intx_en4_0 {
595 uint64_t u64;
596 struct cvmx_ciu_intx_en4_0_s {
597 uint64_t bootdma:1;
598 uint64_t mii:1;
599 uint64_t ipdppthr:1;
600 uint64_t powiq:1;
601 uint64_t twsi2:1;
602 uint64_t mpi:1;
603 uint64_t pcm:1;
604 uint64_t usb:1;
605 uint64_t timer:4;
606 uint64_t key_zero:1;
607 uint64_t ipd_drp:1;
608 uint64_t gmx_drp:2;
609 uint64_t trace:1;
610 uint64_t rml:1;
611 uint64_t twsi:1;
612 uint64_t reserved_44_44:1;
613 uint64_t pci_msi:4;
614 uint64_t pci_int:4;
615 uint64_t uart:2;
616 uint64_t mbox:2;
617 uint64_t gpio:16;
618 uint64_t workq:16;
619 } s;
620 struct cvmx_ciu_intx_en4_0_cn50xx {
621 uint64_t reserved_59_63:5;
622 uint64_t mpi:1;
623 uint64_t pcm:1;
624 uint64_t usb:1;
625 uint64_t timer:4;
626 uint64_t reserved_51_51:1;
627 uint64_t ipd_drp:1;
628 uint64_t reserved_49_49:1;
629 uint64_t gmx_drp:1;
630 uint64_t reserved_47_47:1;
631 uint64_t rml:1;
632 uint64_t twsi:1;
633 uint64_t reserved_44_44:1;
634 uint64_t pci_msi:4;
635 uint64_t pci_int:4;
636 uint64_t uart:2;
637 uint64_t mbox:2;
638 uint64_t gpio:16;
639 uint64_t workq:16;
640 } cn50xx;
641 struct cvmx_ciu_intx_en4_0_cn52xx {
642 uint64_t bootdma:1;
643 uint64_t mii:1;
644 uint64_t ipdppthr:1;
645 uint64_t powiq:1;
646 uint64_t twsi2:1;
647 uint64_t reserved_57_58:2;
648 uint64_t usb:1;
649 uint64_t timer:4;
650 uint64_t reserved_51_51:1;
651 uint64_t ipd_drp:1;
652 uint64_t reserved_49_49:1;
653 uint64_t gmx_drp:1;
654 uint64_t trace:1;
655 uint64_t rml:1;
656 uint64_t twsi:1;
657 uint64_t reserved_44_44:1;
658 uint64_t pci_msi:4;
659 uint64_t pci_int:4;
660 uint64_t uart:2;
661 uint64_t mbox:2;
662 uint64_t gpio:16;
663 uint64_t workq:16;
664 } cn52xx;
665 struct cvmx_ciu_intx_en4_0_cn52xx cn52xxp1;
666 struct cvmx_ciu_intx_en4_0_cn56xx {
667 uint64_t bootdma:1;
668 uint64_t mii:1;
669 uint64_t ipdppthr:1;
670 uint64_t powiq:1;
671 uint64_t twsi2:1;
672 uint64_t reserved_57_58:2;
673 uint64_t usb:1;
674 uint64_t timer:4;
675 uint64_t key_zero:1;
676 uint64_t ipd_drp:1;
677 uint64_t gmx_drp:2;
678 uint64_t trace:1;
679 uint64_t rml:1;
680 uint64_t twsi:1;
681 uint64_t reserved_44_44:1;
682 uint64_t pci_msi:4;
683 uint64_t pci_int:4;
684 uint64_t uart:2;
685 uint64_t mbox:2;
686 uint64_t gpio:16;
687 uint64_t workq:16;
688 } cn56xx;
689 struct cvmx_ciu_intx_en4_0_cn56xx cn56xxp1;
690 struct cvmx_ciu_intx_en4_0_cn58xx {
691 uint64_t reserved_56_63:8;
692 uint64_t timer:4;
693 uint64_t key_zero:1;
694 uint64_t ipd_drp:1;
695 uint64_t gmx_drp:2;
696 uint64_t trace:1;
697 uint64_t rml:1;
698 uint64_t twsi:1;
699 uint64_t reserved_44_44:1;
700 uint64_t pci_msi:4;
701 uint64_t pci_int:4;
702 uint64_t uart:2;
703 uint64_t mbox:2;
704 uint64_t gpio:16;
705 uint64_t workq:16;
706 } cn58xx;
707 struct cvmx_ciu_intx_en4_0_cn58xx cn58xxp1;
708};
709
710union cvmx_ciu_intx_en4_0_w1c {
711 uint64_t u64;
712 struct cvmx_ciu_intx_en4_0_w1c_s {
713 uint64_t bootdma:1;
714 uint64_t mii:1;
715 uint64_t ipdppthr:1;
716 uint64_t powiq:1;
717 uint64_t twsi2:1;
718 uint64_t reserved_57_58:2;
719 uint64_t usb:1;
720 uint64_t timer:4;
721 uint64_t key_zero:1;
722 uint64_t ipd_drp:1;
723 uint64_t gmx_drp:2;
724 uint64_t trace:1;
725 uint64_t rml:1;
726 uint64_t twsi:1;
727 uint64_t reserved_44_44:1;
728 uint64_t pci_msi:4;
729 uint64_t pci_int:4;
730 uint64_t uart:2;
731 uint64_t mbox:2;
732 uint64_t gpio:16;
733 uint64_t workq:16;
734 } s;
735 struct cvmx_ciu_intx_en4_0_w1c_cn52xx {
736 uint64_t bootdma:1;
737 uint64_t mii:1;
738 uint64_t ipdppthr:1;
739 uint64_t powiq:1;
740 uint64_t twsi2:1;
741 uint64_t reserved_57_58:2;
742 uint64_t usb:1;
743 uint64_t timer:4;
744 uint64_t reserved_51_51:1;
745 uint64_t ipd_drp:1;
746 uint64_t reserved_49_49:1;
747 uint64_t gmx_drp:1;
748 uint64_t trace:1;
749 uint64_t rml:1;
750 uint64_t twsi:1;
751 uint64_t reserved_44_44:1;
752 uint64_t pci_msi:4;
753 uint64_t pci_int:4;
754 uint64_t uart:2;
755 uint64_t mbox:2;
756 uint64_t gpio:16;
757 uint64_t workq:16;
758 } cn52xx;
759 struct cvmx_ciu_intx_en4_0_w1c_s cn56xx;
760 struct cvmx_ciu_intx_en4_0_w1c_cn58xx {
761 uint64_t reserved_56_63:8;
762 uint64_t timer:4;
763 uint64_t key_zero:1;
764 uint64_t ipd_drp:1;
765 uint64_t gmx_drp:2;
766 uint64_t trace:1;
767 uint64_t rml:1;
768 uint64_t twsi:1;
769 uint64_t reserved_44_44:1;
770 uint64_t pci_msi:4;
771 uint64_t pci_int:4;
772 uint64_t uart:2;
773 uint64_t mbox:2;
774 uint64_t gpio:16;
775 uint64_t workq:16;
776 } cn58xx;
777};
778
779union cvmx_ciu_intx_en4_0_w1s {
780 uint64_t u64;
781 struct cvmx_ciu_intx_en4_0_w1s_s {
782 uint64_t bootdma:1;
783 uint64_t mii:1;
784 uint64_t ipdppthr:1;
785 uint64_t powiq:1;
786 uint64_t twsi2:1;
787 uint64_t reserved_57_58:2;
788 uint64_t usb:1;
789 uint64_t timer:4;
790 uint64_t key_zero:1;
791 uint64_t ipd_drp:1;
792 uint64_t gmx_drp:2;
793 uint64_t trace:1;
794 uint64_t rml:1;
795 uint64_t twsi:1;
796 uint64_t reserved_44_44:1;
797 uint64_t pci_msi:4;
798 uint64_t pci_int:4;
799 uint64_t uart:2;
800 uint64_t mbox:2;
801 uint64_t gpio:16;
802 uint64_t workq:16;
803 } s;
804 struct cvmx_ciu_intx_en4_0_w1s_cn52xx {
805 uint64_t bootdma:1;
806 uint64_t mii:1;
807 uint64_t ipdppthr:1;
808 uint64_t powiq:1;
809 uint64_t twsi2:1;
810 uint64_t reserved_57_58:2;
811 uint64_t usb:1;
812 uint64_t timer:4;
813 uint64_t reserved_51_51:1;
814 uint64_t ipd_drp:1;
815 uint64_t reserved_49_49:1;
816 uint64_t gmx_drp:1;
817 uint64_t trace:1;
818 uint64_t rml:1;
819 uint64_t twsi:1;
820 uint64_t reserved_44_44:1;
821 uint64_t pci_msi:4;
822 uint64_t pci_int:4;
823 uint64_t uart:2;
824 uint64_t mbox:2;
825 uint64_t gpio:16;
826 uint64_t workq:16;
827 } cn52xx;
828 struct cvmx_ciu_intx_en4_0_w1s_s cn56xx;
829 struct cvmx_ciu_intx_en4_0_w1s_cn58xx {
830 uint64_t reserved_56_63:8;
831 uint64_t timer:4;
832 uint64_t key_zero:1;
833 uint64_t ipd_drp:1;
834 uint64_t gmx_drp:2;
835 uint64_t trace:1;
836 uint64_t rml:1;
837 uint64_t twsi:1;
838 uint64_t reserved_44_44:1;
839 uint64_t pci_msi:4;
840 uint64_t pci_int:4;
841 uint64_t uart:2;
842 uint64_t mbox:2;
843 uint64_t gpio:16;
844 uint64_t workq:16;
845 } cn58xx;
846};
847
848union cvmx_ciu_intx_en4_1 {
849 uint64_t u64;
850 struct cvmx_ciu_intx_en4_1_s {
851 uint64_t reserved_20_63:44;
852 uint64_t nand:1;
853 uint64_t mii1:1;
854 uint64_t usb1:1;
855 uint64_t uart2:1;
856 uint64_t wdog:16;
857 } s;
858 struct cvmx_ciu_intx_en4_1_cn50xx {
859 uint64_t reserved_2_63:62;
860 uint64_t wdog:2;
861 } cn50xx;
862 struct cvmx_ciu_intx_en4_1_cn52xx {
863 uint64_t reserved_20_63:44;
864 uint64_t nand:1;
865 uint64_t mii1:1;
866 uint64_t usb1:1;
867 uint64_t uart2:1;
868 uint64_t reserved_4_15:12;
869 uint64_t wdog:4;
870 } cn52xx;
871 struct cvmx_ciu_intx_en4_1_cn52xxp1 {
872 uint64_t reserved_19_63:45;
873 uint64_t mii1:1;
874 uint64_t usb1:1;
875 uint64_t uart2:1;
876 uint64_t reserved_4_15:12;
877 uint64_t wdog:4;
878 } cn52xxp1;
879 struct cvmx_ciu_intx_en4_1_cn56xx {
880 uint64_t reserved_12_63:52;
881 uint64_t wdog:12;
882 } cn56xx;
883 struct cvmx_ciu_intx_en4_1_cn56xx cn56xxp1;
884 struct cvmx_ciu_intx_en4_1_cn58xx {
885 uint64_t reserved_16_63:48;
886 uint64_t wdog:16;
887 } cn58xx;
888 struct cvmx_ciu_intx_en4_1_cn58xx cn58xxp1;
889};
890
891union cvmx_ciu_intx_en4_1_w1c {
892 uint64_t u64;
893 struct cvmx_ciu_intx_en4_1_w1c_s {
894 uint64_t reserved_20_63:44;
895 uint64_t nand:1;
896 uint64_t mii1:1;
897 uint64_t usb1:1;
898 uint64_t uart2:1;
899 uint64_t wdog:16;
900 } s;
901 struct cvmx_ciu_intx_en4_1_w1c_cn52xx {
902 uint64_t reserved_20_63:44;
903 uint64_t nand:1;
904 uint64_t mii1:1;
905 uint64_t usb1:1;
906 uint64_t uart2:1;
907 uint64_t reserved_4_15:12;
908 uint64_t wdog:4;
909 } cn52xx;
910 struct cvmx_ciu_intx_en4_1_w1c_cn56xx {
911 uint64_t reserved_12_63:52;
912 uint64_t wdog:12;
913 } cn56xx;
914 struct cvmx_ciu_intx_en4_1_w1c_cn58xx {
915 uint64_t reserved_16_63:48;
916 uint64_t wdog:16;
917 } cn58xx;
918};
919
920union cvmx_ciu_intx_en4_1_w1s {
921 uint64_t u64;
922 struct cvmx_ciu_intx_en4_1_w1s_s {
923 uint64_t reserved_20_63:44;
924 uint64_t nand:1;
925 uint64_t mii1:1;
926 uint64_t usb1:1;
927 uint64_t uart2:1;
928 uint64_t wdog:16;
929 } s;
930 struct cvmx_ciu_intx_en4_1_w1s_cn52xx {
931 uint64_t reserved_20_63:44;
932 uint64_t nand:1;
933 uint64_t mii1:1;
934 uint64_t usb1:1;
935 uint64_t uart2:1;
936 uint64_t reserved_4_15:12;
937 uint64_t wdog:4;
938 } cn52xx;
939 struct cvmx_ciu_intx_en4_1_w1s_cn56xx {
940 uint64_t reserved_12_63:52;
941 uint64_t wdog:12;
942 } cn56xx;
943 struct cvmx_ciu_intx_en4_1_w1s_cn58xx {
944 uint64_t reserved_16_63:48;
945 uint64_t wdog:16;
946 } cn58xx;
947};
948
949union cvmx_ciu_intx_sum0 {
950 uint64_t u64;
951 struct cvmx_ciu_intx_sum0_s {
952 uint64_t bootdma:1;
953 uint64_t mii:1;
954 uint64_t ipdppthr:1;
955 uint64_t powiq:1;
956 uint64_t twsi2:1;
957 uint64_t mpi:1;
958 uint64_t pcm:1;
959 uint64_t usb:1;
960 uint64_t timer:4;
961 uint64_t key_zero:1;
962 uint64_t ipd_drp:1;
963 uint64_t gmx_drp:2;
964 uint64_t trace:1;
965 uint64_t rml:1;
966 uint64_t twsi:1;
967 uint64_t wdog_sum:1;
968 uint64_t pci_msi:4;
969 uint64_t pci_int:4;
970 uint64_t uart:2;
971 uint64_t mbox:2;
972 uint64_t gpio:16;
973 uint64_t workq:16;
974 } s;
975 struct cvmx_ciu_intx_sum0_cn30xx {
976 uint64_t reserved_59_63:5;
977 uint64_t mpi:1;
978 uint64_t pcm:1;
979 uint64_t usb:1;
980 uint64_t timer:4;
981 uint64_t reserved_51_51:1;
982 uint64_t ipd_drp:1;
983 uint64_t reserved_49_49:1;
984 uint64_t gmx_drp:1;
985 uint64_t reserved_47_47:1;
986 uint64_t rml:1;
987 uint64_t twsi:1;
988 uint64_t wdog_sum:1;
989 uint64_t pci_msi:4;
990 uint64_t pci_int:4;
991 uint64_t uart:2;
992 uint64_t mbox:2;
993 uint64_t gpio:16;
994 uint64_t workq:16;
995 } cn30xx;
996 struct cvmx_ciu_intx_sum0_cn31xx {
997 uint64_t reserved_59_63:5;
998 uint64_t mpi:1;
999 uint64_t pcm:1;
1000 uint64_t usb:1;
1001 uint64_t timer:4;
1002 uint64_t reserved_51_51:1;
1003 uint64_t ipd_drp:1;
1004 uint64_t reserved_49_49:1;
1005 uint64_t gmx_drp:1;
1006 uint64_t trace:1;
1007 uint64_t rml:1;
1008 uint64_t twsi:1;
1009 uint64_t wdog_sum:1;
1010 uint64_t pci_msi:4;
1011 uint64_t pci_int:4;
1012 uint64_t uart:2;
1013 uint64_t mbox:2;
1014 uint64_t gpio:16;
1015 uint64_t workq:16;
1016 } cn31xx;
1017 struct cvmx_ciu_intx_sum0_cn38xx {
1018 uint64_t reserved_56_63:8;
1019 uint64_t timer:4;
1020 uint64_t key_zero:1;
1021 uint64_t ipd_drp:1;
1022 uint64_t gmx_drp:2;
1023 uint64_t trace:1;
1024 uint64_t rml:1;
1025 uint64_t twsi:1;
1026 uint64_t wdog_sum:1;
1027 uint64_t pci_msi:4;
1028 uint64_t pci_int:4;
1029 uint64_t uart:2;
1030 uint64_t mbox:2;
1031 uint64_t gpio:16;
1032 uint64_t workq:16;
1033 } cn38xx;
1034 struct cvmx_ciu_intx_sum0_cn38xx cn38xxp2;
1035 struct cvmx_ciu_intx_sum0_cn30xx cn50xx;
1036 struct cvmx_ciu_intx_sum0_cn52xx {
1037 uint64_t bootdma:1;
1038 uint64_t mii:1;
1039 uint64_t ipdppthr:1;
1040 uint64_t powiq:1;
1041 uint64_t twsi2:1;
1042 uint64_t reserved_57_58:2;
1043 uint64_t usb:1;
1044 uint64_t timer:4;
1045 uint64_t reserved_51_51:1;
1046 uint64_t ipd_drp:1;
1047 uint64_t reserved_49_49:1;
1048 uint64_t gmx_drp:1;
1049 uint64_t trace:1;
1050 uint64_t rml:1;
1051 uint64_t twsi:1;
1052 uint64_t wdog_sum:1;
1053 uint64_t pci_msi:4;
1054 uint64_t pci_int:4;
1055 uint64_t uart:2;
1056 uint64_t mbox:2;
1057 uint64_t gpio:16;
1058 uint64_t workq:16;
1059 } cn52xx;
1060 struct cvmx_ciu_intx_sum0_cn52xx cn52xxp1;
1061 struct cvmx_ciu_intx_sum0_cn56xx {
1062 uint64_t bootdma:1;
1063 uint64_t mii:1;
1064 uint64_t ipdppthr:1;
1065 uint64_t powiq:1;
1066 uint64_t twsi2:1;
1067 uint64_t reserved_57_58:2;
1068 uint64_t usb:1;
1069 uint64_t timer:4;
1070 uint64_t key_zero:1;
1071 uint64_t ipd_drp:1;
1072 uint64_t gmx_drp:2;
1073 uint64_t trace:1;
1074 uint64_t rml:1;
1075 uint64_t twsi:1;
1076 uint64_t wdog_sum:1;
1077 uint64_t pci_msi:4;
1078 uint64_t pci_int:4;
1079 uint64_t uart:2;
1080 uint64_t mbox:2;
1081 uint64_t gpio:16;
1082 uint64_t workq:16;
1083 } cn56xx;
1084 struct cvmx_ciu_intx_sum0_cn56xx cn56xxp1;
1085 struct cvmx_ciu_intx_sum0_cn38xx cn58xx;
1086 struct cvmx_ciu_intx_sum0_cn38xx cn58xxp1;
1087};
1088
1089union cvmx_ciu_intx_sum4 {
1090 uint64_t u64;
1091 struct cvmx_ciu_intx_sum4_s {
1092 uint64_t bootdma:1;
1093 uint64_t mii:1;
1094 uint64_t ipdppthr:1;
1095 uint64_t powiq:1;
1096 uint64_t twsi2:1;
1097 uint64_t mpi:1;
1098 uint64_t pcm:1;
1099 uint64_t usb:1;
1100 uint64_t timer:4;
1101 uint64_t key_zero:1;
1102 uint64_t ipd_drp:1;
1103 uint64_t gmx_drp:2;
1104 uint64_t trace:1;
1105 uint64_t rml:1;
1106 uint64_t twsi:1;
1107 uint64_t wdog_sum:1;
1108 uint64_t pci_msi:4;
1109 uint64_t pci_int:4;
1110 uint64_t uart:2;
1111 uint64_t mbox:2;
1112 uint64_t gpio:16;
1113 uint64_t workq:16;
1114 } s;
1115 struct cvmx_ciu_intx_sum4_cn50xx {
1116 uint64_t reserved_59_63:5;
1117 uint64_t mpi:1;
1118 uint64_t pcm:1;
1119 uint64_t usb:1;
1120 uint64_t timer:4;
1121 uint64_t reserved_51_51:1;
1122 uint64_t ipd_drp:1;
1123 uint64_t reserved_49_49:1;
1124 uint64_t gmx_drp:1;
1125 uint64_t reserved_47_47:1;
1126 uint64_t rml:1;
1127 uint64_t twsi:1;
1128 uint64_t wdog_sum:1;
1129 uint64_t pci_msi:4;
1130 uint64_t pci_int:4;
1131 uint64_t uart:2;
1132 uint64_t mbox:2;
1133 uint64_t gpio:16;
1134 uint64_t workq:16;
1135 } cn50xx;
1136 struct cvmx_ciu_intx_sum4_cn52xx {
1137 uint64_t bootdma:1;
1138 uint64_t mii:1;
1139 uint64_t ipdppthr:1;
1140 uint64_t powiq:1;
1141 uint64_t twsi2:1;
1142 uint64_t reserved_57_58:2;
1143 uint64_t usb:1;
1144 uint64_t timer:4;
1145 uint64_t reserved_51_51:1;
1146 uint64_t ipd_drp:1;
1147 uint64_t reserved_49_49:1;
1148 uint64_t gmx_drp:1;
1149 uint64_t trace:1;
1150 uint64_t rml:1;
1151 uint64_t twsi:1;
1152 uint64_t wdog_sum:1;
1153 uint64_t pci_msi:4;
1154 uint64_t pci_int:4;
1155 uint64_t uart:2;
1156 uint64_t mbox:2;
1157 uint64_t gpio:16;
1158 uint64_t workq:16;
1159 } cn52xx;
1160 struct cvmx_ciu_intx_sum4_cn52xx cn52xxp1;
1161 struct cvmx_ciu_intx_sum4_cn56xx {
1162 uint64_t bootdma:1;
1163 uint64_t mii:1;
1164 uint64_t ipdppthr:1;
1165 uint64_t powiq:1;
1166 uint64_t twsi2:1;
1167 uint64_t reserved_57_58:2;
1168 uint64_t usb:1;
1169 uint64_t timer:4;
1170 uint64_t key_zero:1;
1171 uint64_t ipd_drp:1;
1172 uint64_t gmx_drp:2;
1173 uint64_t trace:1;
1174 uint64_t rml:1;
1175 uint64_t twsi:1;
1176 uint64_t wdog_sum:1;
1177 uint64_t pci_msi:4;
1178 uint64_t pci_int:4;
1179 uint64_t uart:2;
1180 uint64_t mbox:2;
1181 uint64_t gpio:16;
1182 uint64_t workq:16;
1183 } cn56xx;
1184 struct cvmx_ciu_intx_sum4_cn56xx cn56xxp1;
1185 struct cvmx_ciu_intx_sum4_cn58xx {
1186 uint64_t reserved_56_63:8;
1187 uint64_t timer:4;
1188 uint64_t key_zero:1;
1189 uint64_t ipd_drp:1;
1190 uint64_t gmx_drp:2;
1191 uint64_t trace:1;
1192 uint64_t rml:1;
1193 uint64_t twsi:1;
1194 uint64_t wdog_sum:1;
1195 uint64_t pci_msi:4;
1196 uint64_t pci_int:4;
1197 uint64_t uart:2;
1198 uint64_t mbox:2;
1199 uint64_t gpio:16;
1200 uint64_t workq:16;
1201 } cn58xx;
1202 struct cvmx_ciu_intx_sum4_cn58xx cn58xxp1;
1203};
1204
1205union cvmx_ciu_int_sum1 {
1206 uint64_t u64;
1207 struct cvmx_ciu_int_sum1_s {
1208 uint64_t reserved_20_63:44;
1209 uint64_t nand:1;
1210 uint64_t mii1:1;
1211 uint64_t usb1:1;
1212 uint64_t uart2:1;
1213 uint64_t wdog:16;
1214 } s;
1215 struct cvmx_ciu_int_sum1_cn30xx {
1216 uint64_t reserved_1_63:63;
1217 uint64_t wdog:1;
1218 } cn30xx;
1219 struct cvmx_ciu_int_sum1_cn31xx {
1220 uint64_t reserved_2_63:62;
1221 uint64_t wdog:2;
1222 } cn31xx;
1223 struct cvmx_ciu_int_sum1_cn38xx {
1224 uint64_t reserved_16_63:48;
1225 uint64_t wdog:16;
1226 } cn38xx;
1227 struct cvmx_ciu_int_sum1_cn38xx cn38xxp2;
1228 struct cvmx_ciu_int_sum1_cn31xx cn50xx;
1229 struct cvmx_ciu_int_sum1_cn52xx {
1230 uint64_t reserved_20_63:44;
1231 uint64_t nand:1;
1232 uint64_t mii1:1;
1233 uint64_t usb1:1;
1234 uint64_t uart2:1;
1235 uint64_t reserved_4_15:12;
1236 uint64_t wdog:4;
1237 } cn52xx;
1238 struct cvmx_ciu_int_sum1_cn52xxp1 {
1239 uint64_t reserved_19_63:45;
1240 uint64_t mii1:1;
1241 uint64_t usb1:1;
1242 uint64_t uart2:1;
1243 uint64_t reserved_4_15:12;
1244 uint64_t wdog:4;
1245 } cn52xxp1;
1246 struct cvmx_ciu_int_sum1_cn56xx {
1247 uint64_t reserved_12_63:52;
1248 uint64_t wdog:12;
1249 } cn56xx;
1250 struct cvmx_ciu_int_sum1_cn56xx cn56xxp1;
1251 struct cvmx_ciu_int_sum1_cn38xx cn58xx;
1252 struct cvmx_ciu_int_sum1_cn38xx cn58xxp1;
1253};
1254
1255union cvmx_ciu_mbox_clrx {
1256 uint64_t u64;
1257 struct cvmx_ciu_mbox_clrx_s {
1258 uint64_t reserved_32_63:32;
1259 uint64_t bits:32;
1260 } s;
1261 struct cvmx_ciu_mbox_clrx_s cn30xx;
1262 struct cvmx_ciu_mbox_clrx_s cn31xx;
1263 struct cvmx_ciu_mbox_clrx_s cn38xx;
1264 struct cvmx_ciu_mbox_clrx_s cn38xxp2;
1265 struct cvmx_ciu_mbox_clrx_s cn50xx;
1266 struct cvmx_ciu_mbox_clrx_s cn52xx;
1267 struct cvmx_ciu_mbox_clrx_s cn52xxp1;
1268 struct cvmx_ciu_mbox_clrx_s cn56xx;
1269 struct cvmx_ciu_mbox_clrx_s cn56xxp1;
1270 struct cvmx_ciu_mbox_clrx_s cn58xx;
1271 struct cvmx_ciu_mbox_clrx_s cn58xxp1;
1272};
1273
1274union cvmx_ciu_mbox_setx {
1275 uint64_t u64;
1276 struct cvmx_ciu_mbox_setx_s {
1277 uint64_t reserved_32_63:32;
1278 uint64_t bits:32;
1279 } s;
1280 struct cvmx_ciu_mbox_setx_s cn30xx;
1281 struct cvmx_ciu_mbox_setx_s cn31xx;
1282 struct cvmx_ciu_mbox_setx_s cn38xx;
1283 struct cvmx_ciu_mbox_setx_s cn38xxp2;
1284 struct cvmx_ciu_mbox_setx_s cn50xx;
1285 struct cvmx_ciu_mbox_setx_s cn52xx;
1286 struct cvmx_ciu_mbox_setx_s cn52xxp1;
1287 struct cvmx_ciu_mbox_setx_s cn56xx;
1288 struct cvmx_ciu_mbox_setx_s cn56xxp1;
1289 struct cvmx_ciu_mbox_setx_s cn58xx;
1290 struct cvmx_ciu_mbox_setx_s cn58xxp1;
1291};
1292
1293union cvmx_ciu_nmi {
1294 uint64_t u64;
1295 struct cvmx_ciu_nmi_s {
1296 uint64_t reserved_16_63:48;
1297 uint64_t nmi:16;
1298 } s;
1299 struct cvmx_ciu_nmi_cn30xx {
1300 uint64_t reserved_1_63:63;
1301 uint64_t nmi:1;
1302 } cn30xx;
1303 struct cvmx_ciu_nmi_cn31xx {
1304 uint64_t reserved_2_63:62;
1305 uint64_t nmi:2;
1306 } cn31xx;
1307 struct cvmx_ciu_nmi_s cn38xx;
1308 struct cvmx_ciu_nmi_s cn38xxp2;
1309 struct cvmx_ciu_nmi_cn31xx cn50xx;
1310 struct cvmx_ciu_nmi_cn52xx {
1311 uint64_t reserved_4_63:60;
1312 uint64_t nmi:4;
1313 } cn52xx;
1314 struct cvmx_ciu_nmi_cn52xx cn52xxp1;
1315 struct cvmx_ciu_nmi_cn56xx {
1316 uint64_t reserved_12_63:52;
1317 uint64_t nmi:12;
1318 } cn56xx;
1319 struct cvmx_ciu_nmi_cn56xx cn56xxp1;
1320 struct cvmx_ciu_nmi_s cn58xx;
1321 struct cvmx_ciu_nmi_s cn58xxp1;
1322};
1323
1324union cvmx_ciu_pci_inta {
1325 uint64_t u64;
1326 struct cvmx_ciu_pci_inta_s {
1327 uint64_t reserved_2_63:62;
1328 uint64_t intr:2;
1329 } s;
1330 struct cvmx_ciu_pci_inta_s cn30xx;
1331 struct cvmx_ciu_pci_inta_s cn31xx;
1332 struct cvmx_ciu_pci_inta_s cn38xx;
1333 struct cvmx_ciu_pci_inta_s cn38xxp2;
1334 struct cvmx_ciu_pci_inta_s cn50xx;
1335 struct cvmx_ciu_pci_inta_s cn52xx;
1336 struct cvmx_ciu_pci_inta_s cn52xxp1;
1337 struct cvmx_ciu_pci_inta_s cn56xx;
1338 struct cvmx_ciu_pci_inta_s cn56xxp1;
1339 struct cvmx_ciu_pci_inta_s cn58xx;
1340 struct cvmx_ciu_pci_inta_s cn58xxp1;
1341};
1342
1343union cvmx_ciu_pp_dbg {
1344 uint64_t u64;
1345 struct cvmx_ciu_pp_dbg_s {
1346 uint64_t reserved_16_63:48;
1347 uint64_t ppdbg:16;
1348 } s;
1349 struct cvmx_ciu_pp_dbg_cn30xx {
1350 uint64_t reserved_1_63:63;
1351 uint64_t ppdbg:1;
1352 } cn30xx;
1353 struct cvmx_ciu_pp_dbg_cn31xx {
1354 uint64_t reserved_2_63:62;
1355 uint64_t ppdbg:2;
1356 } cn31xx;
1357 struct cvmx_ciu_pp_dbg_s cn38xx;
1358 struct cvmx_ciu_pp_dbg_s cn38xxp2;
1359 struct cvmx_ciu_pp_dbg_cn31xx cn50xx;
1360 struct cvmx_ciu_pp_dbg_cn52xx {
1361 uint64_t reserved_4_63:60;
1362 uint64_t ppdbg:4;
1363 } cn52xx;
1364 struct cvmx_ciu_pp_dbg_cn52xx cn52xxp1;
1365 struct cvmx_ciu_pp_dbg_cn56xx {
1366 uint64_t reserved_12_63:52;
1367 uint64_t ppdbg:12;
1368 } cn56xx;
1369 struct cvmx_ciu_pp_dbg_cn56xx cn56xxp1;
1370 struct cvmx_ciu_pp_dbg_s cn58xx;
1371 struct cvmx_ciu_pp_dbg_s cn58xxp1;
1372};
1373
1374union cvmx_ciu_pp_pokex {
1375 uint64_t u64;
1376 struct cvmx_ciu_pp_pokex_s {
1377 uint64_t reserved_0_63:64;
1378 } s;
1379 struct cvmx_ciu_pp_pokex_s cn30xx;
1380 struct cvmx_ciu_pp_pokex_s cn31xx;
1381 struct cvmx_ciu_pp_pokex_s cn38xx;
1382 struct cvmx_ciu_pp_pokex_s cn38xxp2;
1383 struct cvmx_ciu_pp_pokex_s cn50xx;
1384 struct cvmx_ciu_pp_pokex_s cn52xx;
1385 struct cvmx_ciu_pp_pokex_s cn52xxp1;
1386 struct cvmx_ciu_pp_pokex_s cn56xx;
1387 struct cvmx_ciu_pp_pokex_s cn56xxp1;
1388 struct cvmx_ciu_pp_pokex_s cn58xx;
1389 struct cvmx_ciu_pp_pokex_s cn58xxp1;
1390};
1391
1392union cvmx_ciu_pp_rst {
1393 uint64_t u64;
1394 struct cvmx_ciu_pp_rst_s {
1395 uint64_t reserved_16_63:48;
1396 uint64_t rst:15;
1397 uint64_t rst0:1;
1398 } s;
1399 struct cvmx_ciu_pp_rst_cn30xx {
1400 uint64_t reserved_1_63:63;
1401 uint64_t rst0:1;
1402 } cn30xx;
1403 struct cvmx_ciu_pp_rst_cn31xx {
1404 uint64_t reserved_2_63:62;
1405 uint64_t rst:1;
1406 uint64_t rst0:1;
1407 } cn31xx;
1408 struct cvmx_ciu_pp_rst_s cn38xx;
1409 struct cvmx_ciu_pp_rst_s cn38xxp2;
1410 struct cvmx_ciu_pp_rst_cn31xx cn50xx;
1411 struct cvmx_ciu_pp_rst_cn52xx {
1412 uint64_t reserved_4_63:60;
1413 uint64_t rst:3;
1414 uint64_t rst0:1;
1415 } cn52xx;
1416 struct cvmx_ciu_pp_rst_cn52xx cn52xxp1;
1417 struct cvmx_ciu_pp_rst_cn56xx {
1418 uint64_t reserved_12_63:52;
1419 uint64_t rst:11;
1420 uint64_t rst0:1;
1421 } cn56xx;
1422 struct cvmx_ciu_pp_rst_cn56xx cn56xxp1;
1423 struct cvmx_ciu_pp_rst_s cn58xx;
1424 struct cvmx_ciu_pp_rst_s cn58xxp1;
1425};
1426
1427union cvmx_ciu_qlm_dcok {
1428 uint64_t u64;
1429 struct cvmx_ciu_qlm_dcok_s {
1430 uint64_t reserved_4_63:60;
1431 uint64_t qlm_dcok:4;
1432 } s;
1433 struct cvmx_ciu_qlm_dcok_cn52xx {
1434 uint64_t reserved_2_63:62;
1435 uint64_t qlm_dcok:2;
1436 } cn52xx;
1437 struct cvmx_ciu_qlm_dcok_cn52xx cn52xxp1;
1438 struct cvmx_ciu_qlm_dcok_s cn56xx;
1439 struct cvmx_ciu_qlm_dcok_s cn56xxp1;
1440};
1441
1442union cvmx_ciu_qlm_jtgc {
1443 uint64_t u64;
1444 struct cvmx_ciu_qlm_jtgc_s {
1445 uint64_t reserved_11_63:53;
1446 uint64_t clk_div:3;
1447 uint64_t reserved_6_7:2;
1448 uint64_t mux_sel:2;
1449 uint64_t bypass:4;
1450 } s;
1451 struct cvmx_ciu_qlm_jtgc_cn52xx {
1452 uint64_t reserved_11_63:53;
1453 uint64_t clk_div:3;
1454 uint64_t reserved_5_7:3;
1455 uint64_t mux_sel:1;
1456 uint64_t reserved_2_3:2;
1457 uint64_t bypass:2;
1458 } cn52xx;
1459 struct cvmx_ciu_qlm_jtgc_cn52xx cn52xxp1;
1460 struct cvmx_ciu_qlm_jtgc_s cn56xx;
1461 struct cvmx_ciu_qlm_jtgc_s cn56xxp1;
1462};
1463
1464union cvmx_ciu_qlm_jtgd {
1465 uint64_t u64;
1466 struct cvmx_ciu_qlm_jtgd_s {
1467 uint64_t capture:1;
1468 uint64_t shift:1;
1469 uint64_t update:1;
1470 uint64_t reserved_44_60:17;
1471 uint64_t select:4;
1472 uint64_t reserved_37_39:3;
1473 uint64_t shft_cnt:5;
1474 uint64_t shft_reg:32;
1475 } s;
1476 struct cvmx_ciu_qlm_jtgd_cn52xx {
1477 uint64_t capture:1;
1478 uint64_t shift:1;
1479 uint64_t update:1;
1480 uint64_t reserved_42_60:19;
1481 uint64_t select:2;
1482 uint64_t reserved_37_39:3;
1483 uint64_t shft_cnt:5;
1484 uint64_t shft_reg:32;
1485 } cn52xx;
1486 struct cvmx_ciu_qlm_jtgd_cn52xx cn52xxp1;
1487 struct cvmx_ciu_qlm_jtgd_s cn56xx;
1488 struct cvmx_ciu_qlm_jtgd_cn56xxp1 {
1489 uint64_t capture:1;
1490 uint64_t shift:1;
1491 uint64_t update:1;
1492 uint64_t reserved_37_60:24;
1493 uint64_t shft_cnt:5;
1494 uint64_t shft_reg:32;
1495 } cn56xxp1;
1496};
1497
1498union cvmx_ciu_soft_bist {
1499 uint64_t u64;
1500 struct cvmx_ciu_soft_bist_s {
1501 uint64_t reserved_1_63:63;
1502 uint64_t soft_bist:1;
1503 } s;
1504 struct cvmx_ciu_soft_bist_s cn30xx;
1505 struct cvmx_ciu_soft_bist_s cn31xx;
1506 struct cvmx_ciu_soft_bist_s cn38xx;
1507 struct cvmx_ciu_soft_bist_s cn38xxp2;
1508 struct cvmx_ciu_soft_bist_s cn50xx;
1509 struct cvmx_ciu_soft_bist_s cn52xx;
1510 struct cvmx_ciu_soft_bist_s cn52xxp1;
1511 struct cvmx_ciu_soft_bist_s cn56xx;
1512 struct cvmx_ciu_soft_bist_s cn56xxp1;
1513 struct cvmx_ciu_soft_bist_s cn58xx;
1514 struct cvmx_ciu_soft_bist_s cn58xxp1;
1515};
1516
1517union cvmx_ciu_soft_prst {
1518 uint64_t u64;
1519 struct cvmx_ciu_soft_prst_s {
1520 uint64_t reserved_3_63:61;
1521 uint64_t host64:1;
1522 uint64_t npi:1;
1523 uint64_t soft_prst:1;
1524 } s;
1525 struct cvmx_ciu_soft_prst_s cn30xx;
1526 struct cvmx_ciu_soft_prst_s cn31xx;
1527 struct cvmx_ciu_soft_prst_s cn38xx;
1528 struct cvmx_ciu_soft_prst_s cn38xxp2;
1529 struct cvmx_ciu_soft_prst_s cn50xx;
1530 struct cvmx_ciu_soft_prst_cn52xx {
1531 uint64_t reserved_1_63:63;
1532 uint64_t soft_prst:1;
1533 } cn52xx;
1534 struct cvmx_ciu_soft_prst_cn52xx cn52xxp1;
1535 struct cvmx_ciu_soft_prst_cn52xx cn56xx;
1536 struct cvmx_ciu_soft_prst_cn52xx cn56xxp1;
1537 struct cvmx_ciu_soft_prst_s cn58xx;
1538 struct cvmx_ciu_soft_prst_s cn58xxp1;
1539};
1540
1541union cvmx_ciu_soft_prst1 {
1542 uint64_t u64;
1543 struct cvmx_ciu_soft_prst1_s {
1544 uint64_t reserved_1_63:63;
1545 uint64_t soft_prst:1;
1546 } s;
1547 struct cvmx_ciu_soft_prst1_s cn52xx;
1548 struct cvmx_ciu_soft_prst1_s cn52xxp1;
1549 struct cvmx_ciu_soft_prst1_s cn56xx;
1550 struct cvmx_ciu_soft_prst1_s cn56xxp1;
1551};
1552
1553union cvmx_ciu_soft_rst {
1554 uint64_t u64;
1555 struct cvmx_ciu_soft_rst_s {
1556 uint64_t reserved_1_63:63;
1557 uint64_t soft_rst:1;
1558 } s;
1559 struct cvmx_ciu_soft_rst_s cn30xx;
1560 struct cvmx_ciu_soft_rst_s cn31xx;
1561 struct cvmx_ciu_soft_rst_s cn38xx;
1562 struct cvmx_ciu_soft_rst_s cn38xxp2;
1563 struct cvmx_ciu_soft_rst_s cn50xx;
1564 struct cvmx_ciu_soft_rst_s cn52xx;
1565 struct cvmx_ciu_soft_rst_s cn52xxp1;
1566 struct cvmx_ciu_soft_rst_s cn56xx;
1567 struct cvmx_ciu_soft_rst_s cn56xxp1;
1568 struct cvmx_ciu_soft_rst_s cn58xx;
1569 struct cvmx_ciu_soft_rst_s cn58xxp1;
1570};
1571
1572union cvmx_ciu_timx {
1573 uint64_t u64;
1574 struct cvmx_ciu_timx_s {
1575 uint64_t reserved_37_63:27;
1576 uint64_t one_shot:1;
1577 uint64_t len:36;
1578 } s;
1579 struct cvmx_ciu_timx_s cn30xx;
1580 struct cvmx_ciu_timx_s cn31xx;
1581 struct cvmx_ciu_timx_s cn38xx;
1582 struct cvmx_ciu_timx_s cn38xxp2;
1583 struct cvmx_ciu_timx_s cn50xx;
1584 struct cvmx_ciu_timx_s cn52xx;
1585 struct cvmx_ciu_timx_s cn52xxp1;
1586 struct cvmx_ciu_timx_s cn56xx;
1587 struct cvmx_ciu_timx_s cn56xxp1;
1588 struct cvmx_ciu_timx_s cn58xx;
1589 struct cvmx_ciu_timx_s cn58xxp1;
1590};
1591
1592union cvmx_ciu_wdogx {
1593 uint64_t u64;
1594 struct cvmx_ciu_wdogx_s {
1595 uint64_t reserved_46_63:18;
1596 uint64_t gstopen:1;
1597 uint64_t dstop:1;
1598 uint64_t cnt:24;
1599 uint64_t len:16;
1600 uint64_t state:2;
1601 uint64_t mode:2;
1602 } s;
1603 struct cvmx_ciu_wdogx_s cn30xx;
1604 struct cvmx_ciu_wdogx_s cn31xx;
1605 struct cvmx_ciu_wdogx_s cn38xx;
1606 struct cvmx_ciu_wdogx_s cn38xxp2;
1607 struct cvmx_ciu_wdogx_s cn50xx;
1608 struct cvmx_ciu_wdogx_s cn52xx;
1609 struct cvmx_ciu_wdogx_s cn52xxp1;
1610 struct cvmx_ciu_wdogx_s cn56xx;
1611 struct cvmx_ciu_wdogx_s cn56xxp1;
1612 struct cvmx_ciu_wdogx_s cn58xx;
1613 struct cvmx_ciu_wdogx_s cn58xxp1;
1614};
1615
1616#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-gpio-defs.h b/arch/mips/include/asm/octeon/cvmx-gpio-defs.h
new file mode 100644
index 000000000000..5fdd6ba48a05
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-gpio-defs.h
@@ -0,0 +1,219 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_GPIO_DEFS_H__
29#define __CVMX_GPIO_DEFS_H__
30
31#define CVMX_GPIO_BIT_CFGX(offset) \
32 CVMX_ADD_IO_SEG(0x0001070000000800ull + (((offset) & 15) * 8))
33#define CVMX_GPIO_BOOT_ENA \
34 CVMX_ADD_IO_SEG(0x00010700000008A8ull)
35#define CVMX_GPIO_CLK_GENX(offset) \
36 CVMX_ADD_IO_SEG(0x00010700000008C0ull + (((offset) & 3) * 8))
37#define CVMX_GPIO_DBG_ENA \
38 CVMX_ADD_IO_SEG(0x00010700000008A0ull)
39#define CVMX_GPIO_INT_CLR \
40 CVMX_ADD_IO_SEG(0x0001070000000898ull)
41#define CVMX_GPIO_RX_DAT \
42 CVMX_ADD_IO_SEG(0x0001070000000880ull)
43#define CVMX_GPIO_TX_CLR \
44 CVMX_ADD_IO_SEG(0x0001070000000890ull)
45#define CVMX_GPIO_TX_SET \
46 CVMX_ADD_IO_SEG(0x0001070000000888ull)
47#define CVMX_GPIO_XBIT_CFGX(offset) \
48 CVMX_ADD_IO_SEG(0x0001070000000900ull + (((offset) & 31) * 8) - 8 * 16)
49
50union cvmx_gpio_bit_cfgx {
51 uint64_t u64;
52 struct cvmx_gpio_bit_cfgx_s {
53 uint64_t reserved_15_63:49;
54 uint64_t clk_gen:1;
55 uint64_t clk_sel:2;
56 uint64_t fil_sel:4;
57 uint64_t fil_cnt:4;
58 uint64_t int_type:1;
59 uint64_t int_en:1;
60 uint64_t rx_xor:1;
61 uint64_t tx_oe:1;
62 } s;
63 struct cvmx_gpio_bit_cfgx_cn30xx {
64 uint64_t reserved_12_63:52;
65 uint64_t fil_sel:4;
66 uint64_t fil_cnt:4;
67 uint64_t int_type:1;
68 uint64_t int_en:1;
69 uint64_t rx_xor:1;
70 uint64_t tx_oe:1;
71 } cn30xx;
72 struct cvmx_gpio_bit_cfgx_cn30xx cn31xx;
73 struct cvmx_gpio_bit_cfgx_cn30xx cn38xx;
74 struct cvmx_gpio_bit_cfgx_cn30xx cn38xxp2;
75 struct cvmx_gpio_bit_cfgx_cn30xx cn50xx;
76 struct cvmx_gpio_bit_cfgx_s cn52xx;
77 struct cvmx_gpio_bit_cfgx_s cn52xxp1;
78 struct cvmx_gpio_bit_cfgx_s cn56xx;
79 struct cvmx_gpio_bit_cfgx_s cn56xxp1;
80 struct cvmx_gpio_bit_cfgx_cn30xx cn58xx;
81 struct cvmx_gpio_bit_cfgx_cn30xx cn58xxp1;
82};
83
84union cvmx_gpio_boot_ena {
85 uint64_t u64;
86 struct cvmx_gpio_boot_ena_s {
87 uint64_t reserved_12_63:52;
88 uint64_t boot_ena:4;
89 uint64_t reserved_0_7:8;
90 } s;
91 struct cvmx_gpio_boot_ena_s cn30xx;
92 struct cvmx_gpio_boot_ena_s cn31xx;
93 struct cvmx_gpio_boot_ena_s cn50xx;
94};
95
96union cvmx_gpio_clk_genx {
97 uint64_t u64;
98 struct cvmx_gpio_clk_genx_s {
99 uint64_t reserved_32_63:32;
100 uint64_t n:32;
101 } s;
102 struct cvmx_gpio_clk_genx_s cn52xx;
103 struct cvmx_gpio_clk_genx_s cn52xxp1;
104 struct cvmx_gpio_clk_genx_s cn56xx;
105 struct cvmx_gpio_clk_genx_s cn56xxp1;
106};
107
108union cvmx_gpio_dbg_ena {
109 uint64_t u64;
110 struct cvmx_gpio_dbg_ena_s {
111 uint64_t reserved_21_63:43;
112 uint64_t dbg_ena:21;
113 } s;
114 struct cvmx_gpio_dbg_ena_s cn30xx;
115 struct cvmx_gpio_dbg_ena_s cn31xx;
116 struct cvmx_gpio_dbg_ena_s cn50xx;
117};
118
119union cvmx_gpio_int_clr {
120 uint64_t u64;
121 struct cvmx_gpio_int_clr_s {
122 uint64_t reserved_16_63:48;
123 uint64_t type:16;
124 } s;
125 struct cvmx_gpio_int_clr_s cn30xx;
126 struct cvmx_gpio_int_clr_s cn31xx;
127 struct cvmx_gpio_int_clr_s cn38xx;
128 struct cvmx_gpio_int_clr_s cn38xxp2;
129 struct cvmx_gpio_int_clr_s cn50xx;
130 struct cvmx_gpio_int_clr_s cn52xx;
131 struct cvmx_gpio_int_clr_s cn52xxp1;
132 struct cvmx_gpio_int_clr_s cn56xx;
133 struct cvmx_gpio_int_clr_s cn56xxp1;
134 struct cvmx_gpio_int_clr_s cn58xx;
135 struct cvmx_gpio_int_clr_s cn58xxp1;
136};
137
138union cvmx_gpio_rx_dat {
139 uint64_t u64;
140 struct cvmx_gpio_rx_dat_s {
141 uint64_t reserved_24_63:40;
142 uint64_t dat:24;
143 } s;
144 struct cvmx_gpio_rx_dat_s cn30xx;
145 struct cvmx_gpio_rx_dat_s cn31xx;
146 struct cvmx_gpio_rx_dat_cn38xx {
147 uint64_t reserved_16_63:48;
148 uint64_t dat:16;
149 } cn38xx;
150 struct cvmx_gpio_rx_dat_cn38xx cn38xxp2;
151 struct cvmx_gpio_rx_dat_s cn50xx;
152 struct cvmx_gpio_rx_dat_cn38xx cn52xx;
153 struct cvmx_gpio_rx_dat_cn38xx cn52xxp1;
154 struct cvmx_gpio_rx_dat_cn38xx cn56xx;
155 struct cvmx_gpio_rx_dat_cn38xx cn56xxp1;
156 struct cvmx_gpio_rx_dat_cn38xx cn58xx;
157 struct cvmx_gpio_rx_dat_cn38xx cn58xxp1;
158};
159
160union cvmx_gpio_tx_clr {
161 uint64_t u64;
162 struct cvmx_gpio_tx_clr_s {
163 uint64_t reserved_24_63:40;
164 uint64_t clr:24;
165 } s;
166 struct cvmx_gpio_tx_clr_s cn30xx;
167 struct cvmx_gpio_tx_clr_s cn31xx;
168 struct cvmx_gpio_tx_clr_cn38xx {
169 uint64_t reserved_16_63:48;
170 uint64_t clr:16;
171 } cn38xx;
172 struct cvmx_gpio_tx_clr_cn38xx cn38xxp2;
173 struct cvmx_gpio_tx_clr_s cn50xx;
174 struct cvmx_gpio_tx_clr_cn38xx cn52xx;
175 struct cvmx_gpio_tx_clr_cn38xx cn52xxp1;
176 struct cvmx_gpio_tx_clr_cn38xx cn56xx;
177 struct cvmx_gpio_tx_clr_cn38xx cn56xxp1;
178 struct cvmx_gpio_tx_clr_cn38xx cn58xx;
179 struct cvmx_gpio_tx_clr_cn38xx cn58xxp1;
180};
181
182union cvmx_gpio_tx_set {
183 uint64_t u64;
184 struct cvmx_gpio_tx_set_s {
185 uint64_t reserved_24_63:40;
186 uint64_t set:24;
187 } s;
188 struct cvmx_gpio_tx_set_s cn30xx;
189 struct cvmx_gpio_tx_set_s cn31xx;
190 struct cvmx_gpio_tx_set_cn38xx {
191 uint64_t reserved_16_63:48;
192 uint64_t set:16;
193 } cn38xx;
194 struct cvmx_gpio_tx_set_cn38xx cn38xxp2;
195 struct cvmx_gpio_tx_set_s cn50xx;
196 struct cvmx_gpio_tx_set_cn38xx cn52xx;
197 struct cvmx_gpio_tx_set_cn38xx cn52xxp1;
198 struct cvmx_gpio_tx_set_cn38xx cn56xx;
199 struct cvmx_gpio_tx_set_cn38xx cn56xxp1;
200 struct cvmx_gpio_tx_set_cn38xx cn58xx;
201 struct cvmx_gpio_tx_set_cn38xx cn58xxp1;
202};
203
204union cvmx_gpio_xbit_cfgx {
205 uint64_t u64;
206 struct cvmx_gpio_xbit_cfgx_s {
207 uint64_t reserved_12_63:52;
208 uint64_t fil_sel:4;
209 uint64_t fil_cnt:4;
210 uint64_t reserved_2_3:2;
211 uint64_t rx_xor:1;
212 uint64_t tx_oe:1;
213 } s;
214 struct cvmx_gpio_xbit_cfgx_s cn30xx;
215 struct cvmx_gpio_xbit_cfgx_s cn31xx;
216 struct cvmx_gpio_xbit_cfgx_s cn50xx;
217};
218
219#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-iob-defs.h b/arch/mips/include/asm/octeon/cvmx-iob-defs.h
new file mode 100644
index 000000000000..0ee36baec500
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-iob-defs.h
@@ -0,0 +1,530 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_IOB_DEFS_H__
29#define __CVMX_IOB_DEFS_H__
30
31#define CVMX_IOB_BIST_STATUS \
32 CVMX_ADD_IO_SEG(0x00011800F00007F8ull)
33#define CVMX_IOB_CTL_STATUS \
34 CVMX_ADD_IO_SEG(0x00011800F0000050ull)
35#define CVMX_IOB_DWB_PRI_CNT \
36 CVMX_ADD_IO_SEG(0x00011800F0000028ull)
37#define CVMX_IOB_FAU_TIMEOUT \
38 CVMX_ADD_IO_SEG(0x00011800F0000000ull)
39#define CVMX_IOB_I2C_PRI_CNT \
40 CVMX_ADD_IO_SEG(0x00011800F0000010ull)
41#define CVMX_IOB_INB_CONTROL_MATCH \
42 CVMX_ADD_IO_SEG(0x00011800F0000078ull)
43#define CVMX_IOB_INB_CONTROL_MATCH_ENB \
44 CVMX_ADD_IO_SEG(0x00011800F0000088ull)
45#define CVMX_IOB_INB_DATA_MATCH \
46 CVMX_ADD_IO_SEG(0x00011800F0000070ull)
47#define CVMX_IOB_INB_DATA_MATCH_ENB \
48 CVMX_ADD_IO_SEG(0x00011800F0000080ull)
49#define CVMX_IOB_INT_ENB \
50 CVMX_ADD_IO_SEG(0x00011800F0000060ull)
51#define CVMX_IOB_INT_SUM \
52 CVMX_ADD_IO_SEG(0x00011800F0000058ull)
53#define CVMX_IOB_N2C_L2C_PRI_CNT \
54 CVMX_ADD_IO_SEG(0x00011800F0000020ull)
55#define CVMX_IOB_N2C_RSP_PRI_CNT \
56 CVMX_ADD_IO_SEG(0x00011800F0000008ull)
57#define CVMX_IOB_OUTB_COM_PRI_CNT \
58 CVMX_ADD_IO_SEG(0x00011800F0000040ull)
59#define CVMX_IOB_OUTB_CONTROL_MATCH \
60 CVMX_ADD_IO_SEG(0x00011800F0000098ull)
61#define CVMX_IOB_OUTB_CONTROL_MATCH_ENB \
62 CVMX_ADD_IO_SEG(0x00011800F00000A8ull)
63#define CVMX_IOB_OUTB_DATA_MATCH \
64 CVMX_ADD_IO_SEG(0x00011800F0000090ull)
65#define CVMX_IOB_OUTB_DATA_MATCH_ENB \
66 CVMX_ADD_IO_SEG(0x00011800F00000A0ull)
67#define CVMX_IOB_OUTB_FPA_PRI_CNT \
68 CVMX_ADD_IO_SEG(0x00011800F0000048ull)
69#define CVMX_IOB_OUTB_REQ_PRI_CNT \
70 CVMX_ADD_IO_SEG(0x00011800F0000038ull)
71#define CVMX_IOB_P2C_REQ_PRI_CNT \
72 CVMX_ADD_IO_SEG(0x00011800F0000018ull)
73#define CVMX_IOB_PKT_ERR \
74 CVMX_ADD_IO_SEG(0x00011800F0000068ull)
75
76union cvmx_iob_bist_status {
77 uint64_t u64;
78 struct cvmx_iob_bist_status_s {
79 uint64_t reserved_18_63:46;
80 uint64_t icnrcb:1;
81 uint64_t icr0:1;
82 uint64_t icr1:1;
83 uint64_t icnr1:1;
84 uint64_t icnr0:1;
85 uint64_t ibdr0:1;
86 uint64_t ibdr1:1;
87 uint64_t ibr0:1;
88 uint64_t ibr1:1;
89 uint64_t icnrt:1;
90 uint64_t ibrq0:1;
91 uint64_t ibrq1:1;
92 uint64_t icrn0:1;
93 uint64_t icrn1:1;
94 uint64_t icrp0:1;
95 uint64_t icrp1:1;
96 uint64_t ibd:1;
97 uint64_t icd:1;
98 } s;
99 struct cvmx_iob_bist_status_s cn30xx;
100 struct cvmx_iob_bist_status_s cn31xx;
101 struct cvmx_iob_bist_status_s cn38xx;
102 struct cvmx_iob_bist_status_s cn38xxp2;
103 struct cvmx_iob_bist_status_s cn50xx;
104 struct cvmx_iob_bist_status_s cn52xx;
105 struct cvmx_iob_bist_status_s cn52xxp1;
106 struct cvmx_iob_bist_status_s cn56xx;
107 struct cvmx_iob_bist_status_s cn56xxp1;
108 struct cvmx_iob_bist_status_s cn58xx;
109 struct cvmx_iob_bist_status_s cn58xxp1;
110};
111
112union cvmx_iob_ctl_status {
113 uint64_t u64;
114 struct cvmx_iob_ctl_status_s {
115 uint64_t reserved_5_63:59;
116 uint64_t outb_mat:1;
117 uint64_t inb_mat:1;
118 uint64_t pko_enb:1;
119 uint64_t dwb_enb:1;
120 uint64_t fau_end:1;
121 } s;
122 struct cvmx_iob_ctl_status_s cn30xx;
123 struct cvmx_iob_ctl_status_s cn31xx;
124 struct cvmx_iob_ctl_status_s cn38xx;
125 struct cvmx_iob_ctl_status_s cn38xxp2;
126 struct cvmx_iob_ctl_status_s cn50xx;
127 struct cvmx_iob_ctl_status_s cn52xx;
128 struct cvmx_iob_ctl_status_s cn52xxp1;
129 struct cvmx_iob_ctl_status_s cn56xx;
130 struct cvmx_iob_ctl_status_s cn56xxp1;
131 struct cvmx_iob_ctl_status_s cn58xx;
132 struct cvmx_iob_ctl_status_s cn58xxp1;
133};
134
135union cvmx_iob_dwb_pri_cnt {
136 uint64_t u64;
137 struct cvmx_iob_dwb_pri_cnt_s {
138 uint64_t reserved_16_63:48;
139 uint64_t cnt_enb:1;
140 uint64_t cnt_val:15;
141 } s;
142 struct cvmx_iob_dwb_pri_cnt_s cn38xx;
143 struct cvmx_iob_dwb_pri_cnt_s cn38xxp2;
144 struct cvmx_iob_dwb_pri_cnt_s cn52xx;
145 struct cvmx_iob_dwb_pri_cnt_s cn52xxp1;
146 struct cvmx_iob_dwb_pri_cnt_s cn56xx;
147 struct cvmx_iob_dwb_pri_cnt_s cn56xxp1;
148 struct cvmx_iob_dwb_pri_cnt_s cn58xx;
149 struct cvmx_iob_dwb_pri_cnt_s cn58xxp1;
150};
151
152union cvmx_iob_fau_timeout {
153 uint64_t u64;
154 struct cvmx_iob_fau_timeout_s {
155 uint64_t reserved_13_63:51;
156 uint64_t tout_enb:1;
157 uint64_t tout_val:12;
158 } s;
159 struct cvmx_iob_fau_timeout_s cn30xx;
160 struct cvmx_iob_fau_timeout_s cn31xx;
161 struct cvmx_iob_fau_timeout_s cn38xx;
162 struct cvmx_iob_fau_timeout_s cn38xxp2;
163 struct cvmx_iob_fau_timeout_s cn50xx;
164 struct cvmx_iob_fau_timeout_s cn52xx;
165 struct cvmx_iob_fau_timeout_s cn52xxp1;
166 struct cvmx_iob_fau_timeout_s cn56xx;
167 struct cvmx_iob_fau_timeout_s cn56xxp1;
168 struct cvmx_iob_fau_timeout_s cn58xx;
169 struct cvmx_iob_fau_timeout_s cn58xxp1;
170};
171
172union cvmx_iob_i2c_pri_cnt {
173 uint64_t u64;
174 struct cvmx_iob_i2c_pri_cnt_s {
175 uint64_t reserved_16_63:48;
176 uint64_t cnt_enb:1;
177 uint64_t cnt_val:15;
178 } s;
179 struct cvmx_iob_i2c_pri_cnt_s cn38xx;
180 struct cvmx_iob_i2c_pri_cnt_s cn38xxp2;
181 struct cvmx_iob_i2c_pri_cnt_s cn52xx;
182 struct cvmx_iob_i2c_pri_cnt_s cn52xxp1;
183 struct cvmx_iob_i2c_pri_cnt_s cn56xx;
184 struct cvmx_iob_i2c_pri_cnt_s cn56xxp1;
185 struct cvmx_iob_i2c_pri_cnt_s cn58xx;
186 struct cvmx_iob_i2c_pri_cnt_s cn58xxp1;
187};
188
189union cvmx_iob_inb_control_match {
190 uint64_t u64;
191 struct cvmx_iob_inb_control_match_s {
192 uint64_t reserved_29_63:35;
193 uint64_t mask:8;
194 uint64_t opc:4;
195 uint64_t dst:9;
196 uint64_t src:8;
197 } s;
198 struct cvmx_iob_inb_control_match_s cn30xx;
199 struct cvmx_iob_inb_control_match_s cn31xx;
200 struct cvmx_iob_inb_control_match_s cn38xx;
201 struct cvmx_iob_inb_control_match_s cn38xxp2;
202 struct cvmx_iob_inb_control_match_s cn50xx;
203 struct cvmx_iob_inb_control_match_s cn52xx;
204 struct cvmx_iob_inb_control_match_s cn52xxp1;
205 struct cvmx_iob_inb_control_match_s cn56xx;
206 struct cvmx_iob_inb_control_match_s cn56xxp1;
207 struct cvmx_iob_inb_control_match_s cn58xx;
208 struct cvmx_iob_inb_control_match_s cn58xxp1;
209};
210
211union cvmx_iob_inb_control_match_enb {
212 uint64_t u64;
213 struct cvmx_iob_inb_control_match_enb_s {
214 uint64_t reserved_29_63:35;
215 uint64_t mask:8;
216 uint64_t opc:4;
217 uint64_t dst:9;
218 uint64_t src:8;
219 } s;
220 struct cvmx_iob_inb_control_match_enb_s cn30xx;
221 struct cvmx_iob_inb_control_match_enb_s cn31xx;
222 struct cvmx_iob_inb_control_match_enb_s cn38xx;
223 struct cvmx_iob_inb_control_match_enb_s cn38xxp2;
224 struct cvmx_iob_inb_control_match_enb_s cn50xx;
225 struct cvmx_iob_inb_control_match_enb_s cn52xx;
226 struct cvmx_iob_inb_control_match_enb_s cn52xxp1;
227 struct cvmx_iob_inb_control_match_enb_s cn56xx;
228 struct cvmx_iob_inb_control_match_enb_s cn56xxp1;
229 struct cvmx_iob_inb_control_match_enb_s cn58xx;
230 struct cvmx_iob_inb_control_match_enb_s cn58xxp1;
231};
232
233union cvmx_iob_inb_data_match {
234 uint64_t u64;
235 struct cvmx_iob_inb_data_match_s {
236 uint64_t data:64;
237 } s;
238 struct cvmx_iob_inb_data_match_s cn30xx;
239 struct cvmx_iob_inb_data_match_s cn31xx;
240 struct cvmx_iob_inb_data_match_s cn38xx;
241 struct cvmx_iob_inb_data_match_s cn38xxp2;
242 struct cvmx_iob_inb_data_match_s cn50xx;
243 struct cvmx_iob_inb_data_match_s cn52xx;
244 struct cvmx_iob_inb_data_match_s cn52xxp1;
245 struct cvmx_iob_inb_data_match_s cn56xx;
246 struct cvmx_iob_inb_data_match_s cn56xxp1;
247 struct cvmx_iob_inb_data_match_s cn58xx;
248 struct cvmx_iob_inb_data_match_s cn58xxp1;
249};
250
251union cvmx_iob_inb_data_match_enb {
252 uint64_t u64;
253 struct cvmx_iob_inb_data_match_enb_s {
254 uint64_t data:64;
255 } s;
256 struct cvmx_iob_inb_data_match_enb_s cn30xx;
257 struct cvmx_iob_inb_data_match_enb_s cn31xx;
258 struct cvmx_iob_inb_data_match_enb_s cn38xx;
259 struct cvmx_iob_inb_data_match_enb_s cn38xxp2;
260 struct cvmx_iob_inb_data_match_enb_s cn50xx;
261 struct cvmx_iob_inb_data_match_enb_s cn52xx;
262 struct cvmx_iob_inb_data_match_enb_s cn52xxp1;
263 struct cvmx_iob_inb_data_match_enb_s cn56xx;
264 struct cvmx_iob_inb_data_match_enb_s cn56xxp1;
265 struct cvmx_iob_inb_data_match_enb_s cn58xx;
266 struct cvmx_iob_inb_data_match_enb_s cn58xxp1;
267};
268
269union cvmx_iob_int_enb {
270 uint64_t u64;
271 struct cvmx_iob_int_enb_s {
272 uint64_t reserved_6_63:58;
273 uint64_t p_dat:1;
274 uint64_t np_dat:1;
275 uint64_t p_eop:1;
276 uint64_t p_sop:1;
277 uint64_t np_eop:1;
278 uint64_t np_sop:1;
279 } s;
280 struct cvmx_iob_int_enb_cn30xx {
281 uint64_t reserved_4_63:60;
282 uint64_t p_eop:1;
283 uint64_t p_sop:1;
284 uint64_t np_eop:1;
285 uint64_t np_sop:1;
286 } cn30xx;
287 struct cvmx_iob_int_enb_cn30xx cn31xx;
288 struct cvmx_iob_int_enb_cn30xx cn38xx;
289 struct cvmx_iob_int_enb_cn30xx cn38xxp2;
290 struct cvmx_iob_int_enb_s cn50xx;
291 struct cvmx_iob_int_enb_s cn52xx;
292 struct cvmx_iob_int_enb_s cn52xxp1;
293 struct cvmx_iob_int_enb_s cn56xx;
294 struct cvmx_iob_int_enb_s cn56xxp1;
295 struct cvmx_iob_int_enb_s cn58xx;
296 struct cvmx_iob_int_enb_s cn58xxp1;
297};
298
299union cvmx_iob_int_sum {
300 uint64_t u64;
301 struct cvmx_iob_int_sum_s {
302 uint64_t reserved_6_63:58;
303 uint64_t p_dat:1;
304 uint64_t np_dat:1;
305 uint64_t p_eop:1;
306 uint64_t p_sop:1;
307 uint64_t np_eop:1;
308 uint64_t np_sop:1;
309 } s;
310 struct cvmx_iob_int_sum_cn30xx {
311 uint64_t reserved_4_63:60;
312 uint64_t p_eop:1;
313 uint64_t p_sop:1;
314 uint64_t np_eop:1;
315 uint64_t np_sop:1;
316 } cn30xx;
317 struct cvmx_iob_int_sum_cn30xx cn31xx;
318 struct cvmx_iob_int_sum_cn30xx cn38xx;
319 struct cvmx_iob_int_sum_cn30xx cn38xxp2;
320 struct cvmx_iob_int_sum_s cn50xx;
321 struct cvmx_iob_int_sum_s cn52xx;
322 struct cvmx_iob_int_sum_s cn52xxp1;
323 struct cvmx_iob_int_sum_s cn56xx;
324 struct cvmx_iob_int_sum_s cn56xxp1;
325 struct cvmx_iob_int_sum_s cn58xx;
326 struct cvmx_iob_int_sum_s cn58xxp1;
327};
328
329union cvmx_iob_n2c_l2c_pri_cnt {
330 uint64_t u64;
331 struct cvmx_iob_n2c_l2c_pri_cnt_s {
332 uint64_t reserved_16_63:48;
333 uint64_t cnt_enb:1;
334 uint64_t cnt_val:15;
335 } s;
336 struct cvmx_iob_n2c_l2c_pri_cnt_s cn38xx;
337 struct cvmx_iob_n2c_l2c_pri_cnt_s cn38xxp2;
338 struct cvmx_iob_n2c_l2c_pri_cnt_s cn52xx;
339 struct cvmx_iob_n2c_l2c_pri_cnt_s cn52xxp1;
340 struct cvmx_iob_n2c_l2c_pri_cnt_s cn56xx;
341 struct cvmx_iob_n2c_l2c_pri_cnt_s cn56xxp1;
342 struct cvmx_iob_n2c_l2c_pri_cnt_s cn58xx;
343 struct cvmx_iob_n2c_l2c_pri_cnt_s cn58xxp1;
344};
345
346union cvmx_iob_n2c_rsp_pri_cnt {
347 uint64_t u64;
348 struct cvmx_iob_n2c_rsp_pri_cnt_s {
349 uint64_t reserved_16_63:48;
350 uint64_t cnt_enb:1;
351 uint64_t cnt_val:15;
352 } s;
353 struct cvmx_iob_n2c_rsp_pri_cnt_s cn38xx;
354 struct cvmx_iob_n2c_rsp_pri_cnt_s cn38xxp2;
355 struct cvmx_iob_n2c_rsp_pri_cnt_s cn52xx;
356 struct cvmx_iob_n2c_rsp_pri_cnt_s cn52xxp1;
357 struct cvmx_iob_n2c_rsp_pri_cnt_s cn56xx;
358 struct cvmx_iob_n2c_rsp_pri_cnt_s cn56xxp1;
359 struct cvmx_iob_n2c_rsp_pri_cnt_s cn58xx;
360 struct cvmx_iob_n2c_rsp_pri_cnt_s cn58xxp1;
361};
362
363union cvmx_iob_outb_com_pri_cnt {
364 uint64_t u64;
365 struct cvmx_iob_outb_com_pri_cnt_s {
366 uint64_t reserved_16_63:48;
367 uint64_t cnt_enb:1;
368 uint64_t cnt_val:15;
369 } s;
370 struct cvmx_iob_outb_com_pri_cnt_s cn38xx;
371 struct cvmx_iob_outb_com_pri_cnt_s cn38xxp2;
372 struct cvmx_iob_outb_com_pri_cnt_s cn52xx;
373 struct cvmx_iob_outb_com_pri_cnt_s cn52xxp1;
374 struct cvmx_iob_outb_com_pri_cnt_s cn56xx;
375 struct cvmx_iob_outb_com_pri_cnt_s cn56xxp1;
376 struct cvmx_iob_outb_com_pri_cnt_s cn58xx;
377 struct cvmx_iob_outb_com_pri_cnt_s cn58xxp1;
378};
379
380union cvmx_iob_outb_control_match {
381 uint64_t u64;
382 struct cvmx_iob_outb_control_match_s {
383 uint64_t reserved_26_63:38;
384 uint64_t mask:8;
385 uint64_t eot:1;
386 uint64_t dst:8;
387 uint64_t src:9;
388 } s;
389 struct cvmx_iob_outb_control_match_s cn30xx;
390 struct cvmx_iob_outb_control_match_s cn31xx;
391 struct cvmx_iob_outb_control_match_s cn38xx;
392 struct cvmx_iob_outb_control_match_s cn38xxp2;
393 struct cvmx_iob_outb_control_match_s cn50xx;
394 struct cvmx_iob_outb_control_match_s cn52xx;
395 struct cvmx_iob_outb_control_match_s cn52xxp1;
396 struct cvmx_iob_outb_control_match_s cn56xx;
397 struct cvmx_iob_outb_control_match_s cn56xxp1;
398 struct cvmx_iob_outb_control_match_s cn58xx;
399 struct cvmx_iob_outb_control_match_s cn58xxp1;
400};
401
402union cvmx_iob_outb_control_match_enb {
403 uint64_t u64;
404 struct cvmx_iob_outb_control_match_enb_s {
405 uint64_t reserved_26_63:38;
406 uint64_t mask:8;
407 uint64_t eot:1;
408 uint64_t dst:8;
409 uint64_t src:9;
410 } s;
411 struct cvmx_iob_outb_control_match_enb_s cn30xx;
412 struct cvmx_iob_outb_control_match_enb_s cn31xx;
413 struct cvmx_iob_outb_control_match_enb_s cn38xx;
414 struct cvmx_iob_outb_control_match_enb_s cn38xxp2;
415 struct cvmx_iob_outb_control_match_enb_s cn50xx;
416 struct cvmx_iob_outb_control_match_enb_s cn52xx;
417 struct cvmx_iob_outb_control_match_enb_s cn52xxp1;
418 struct cvmx_iob_outb_control_match_enb_s cn56xx;
419 struct cvmx_iob_outb_control_match_enb_s cn56xxp1;
420 struct cvmx_iob_outb_control_match_enb_s cn58xx;
421 struct cvmx_iob_outb_control_match_enb_s cn58xxp1;
422};
423
424union cvmx_iob_outb_data_match {
425 uint64_t u64;
426 struct cvmx_iob_outb_data_match_s {
427 uint64_t data:64;
428 } s;
429 struct cvmx_iob_outb_data_match_s cn30xx;
430 struct cvmx_iob_outb_data_match_s cn31xx;
431 struct cvmx_iob_outb_data_match_s cn38xx;
432 struct cvmx_iob_outb_data_match_s cn38xxp2;
433 struct cvmx_iob_outb_data_match_s cn50xx;
434 struct cvmx_iob_outb_data_match_s cn52xx;
435 struct cvmx_iob_outb_data_match_s cn52xxp1;
436 struct cvmx_iob_outb_data_match_s cn56xx;
437 struct cvmx_iob_outb_data_match_s cn56xxp1;
438 struct cvmx_iob_outb_data_match_s cn58xx;
439 struct cvmx_iob_outb_data_match_s cn58xxp1;
440};
441
442union cvmx_iob_outb_data_match_enb {
443 uint64_t u64;
444 struct cvmx_iob_outb_data_match_enb_s {
445 uint64_t data:64;
446 } s;
447 struct cvmx_iob_outb_data_match_enb_s cn30xx;
448 struct cvmx_iob_outb_data_match_enb_s cn31xx;
449 struct cvmx_iob_outb_data_match_enb_s cn38xx;
450 struct cvmx_iob_outb_data_match_enb_s cn38xxp2;
451 struct cvmx_iob_outb_data_match_enb_s cn50xx;
452 struct cvmx_iob_outb_data_match_enb_s cn52xx;
453 struct cvmx_iob_outb_data_match_enb_s cn52xxp1;
454 struct cvmx_iob_outb_data_match_enb_s cn56xx;
455 struct cvmx_iob_outb_data_match_enb_s cn56xxp1;
456 struct cvmx_iob_outb_data_match_enb_s cn58xx;
457 struct cvmx_iob_outb_data_match_enb_s cn58xxp1;
458};
459
460union cvmx_iob_outb_fpa_pri_cnt {
461 uint64_t u64;
462 struct cvmx_iob_outb_fpa_pri_cnt_s {
463 uint64_t reserved_16_63:48;
464 uint64_t cnt_enb:1;
465 uint64_t cnt_val:15;
466 } s;
467 struct cvmx_iob_outb_fpa_pri_cnt_s cn38xx;
468 struct cvmx_iob_outb_fpa_pri_cnt_s cn38xxp2;
469 struct cvmx_iob_outb_fpa_pri_cnt_s cn52xx;
470 struct cvmx_iob_outb_fpa_pri_cnt_s cn52xxp1;
471 struct cvmx_iob_outb_fpa_pri_cnt_s cn56xx;
472 struct cvmx_iob_outb_fpa_pri_cnt_s cn56xxp1;
473 struct cvmx_iob_outb_fpa_pri_cnt_s cn58xx;
474 struct cvmx_iob_outb_fpa_pri_cnt_s cn58xxp1;
475};
476
477union cvmx_iob_outb_req_pri_cnt {
478 uint64_t u64;
479 struct cvmx_iob_outb_req_pri_cnt_s {
480 uint64_t reserved_16_63:48;
481 uint64_t cnt_enb:1;
482 uint64_t cnt_val:15;
483 } s;
484 struct cvmx_iob_outb_req_pri_cnt_s cn38xx;
485 struct cvmx_iob_outb_req_pri_cnt_s cn38xxp2;
486 struct cvmx_iob_outb_req_pri_cnt_s cn52xx;
487 struct cvmx_iob_outb_req_pri_cnt_s cn52xxp1;
488 struct cvmx_iob_outb_req_pri_cnt_s cn56xx;
489 struct cvmx_iob_outb_req_pri_cnt_s cn56xxp1;
490 struct cvmx_iob_outb_req_pri_cnt_s cn58xx;
491 struct cvmx_iob_outb_req_pri_cnt_s cn58xxp1;
492};
493
494union cvmx_iob_p2c_req_pri_cnt {
495 uint64_t u64;
496 struct cvmx_iob_p2c_req_pri_cnt_s {
497 uint64_t reserved_16_63:48;
498 uint64_t cnt_enb:1;
499 uint64_t cnt_val:15;
500 } s;
501 struct cvmx_iob_p2c_req_pri_cnt_s cn38xx;
502 struct cvmx_iob_p2c_req_pri_cnt_s cn38xxp2;
503 struct cvmx_iob_p2c_req_pri_cnt_s cn52xx;
504 struct cvmx_iob_p2c_req_pri_cnt_s cn52xxp1;
505 struct cvmx_iob_p2c_req_pri_cnt_s cn56xx;
506 struct cvmx_iob_p2c_req_pri_cnt_s cn56xxp1;
507 struct cvmx_iob_p2c_req_pri_cnt_s cn58xx;
508 struct cvmx_iob_p2c_req_pri_cnt_s cn58xxp1;
509};
510
511union cvmx_iob_pkt_err {
512 uint64_t u64;
513 struct cvmx_iob_pkt_err_s {
514 uint64_t reserved_6_63:58;
515 uint64_t port:6;
516 } s;
517 struct cvmx_iob_pkt_err_s cn30xx;
518 struct cvmx_iob_pkt_err_s cn31xx;
519 struct cvmx_iob_pkt_err_s cn38xx;
520 struct cvmx_iob_pkt_err_s cn38xxp2;
521 struct cvmx_iob_pkt_err_s cn50xx;
522 struct cvmx_iob_pkt_err_s cn52xx;
523 struct cvmx_iob_pkt_err_s cn52xxp1;
524 struct cvmx_iob_pkt_err_s cn56xx;
525 struct cvmx_iob_pkt_err_s cn56xxp1;
526 struct cvmx_iob_pkt_err_s cn58xx;
527 struct cvmx_iob_pkt_err_s cn58xxp1;
528};
529
530#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-ipd-defs.h b/arch/mips/include/asm/octeon/cvmx-ipd-defs.h
new file mode 100644
index 000000000000..f8b8fc657d2c
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-ipd-defs.h
@@ -0,0 +1,877 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_IPD_DEFS_H__
29#define __CVMX_IPD_DEFS_H__
30
31#define CVMX_IPD_1ST_MBUFF_SKIP \
32 CVMX_ADD_IO_SEG(0x00014F0000000000ull)
33#define CVMX_IPD_1st_NEXT_PTR_BACK \
34 CVMX_ADD_IO_SEG(0x00014F0000000150ull)
35#define CVMX_IPD_2nd_NEXT_PTR_BACK \
36 CVMX_ADD_IO_SEG(0x00014F0000000158ull)
37#define CVMX_IPD_BIST_STATUS \
38 CVMX_ADD_IO_SEG(0x00014F00000007F8ull)
39#define CVMX_IPD_BP_PRT_RED_END \
40 CVMX_ADD_IO_SEG(0x00014F0000000328ull)
41#define CVMX_IPD_CLK_COUNT \
42 CVMX_ADD_IO_SEG(0x00014F0000000338ull)
43#define CVMX_IPD_CTL_STATUS \
44 CVMX_ADD_IO_SEG(0x00014F0000000018ull)
45#define CVMX_IPD_INT_ENB \
46 CVMX_ADD_IO_SEG(0x00014F0000000160ull)
47#define CVMX_IPD_INT_SUM \
48 CVMX_ADD_IO_SEG(0x00014F0000000168ull)
49#define CVMX_IPD_NOT_1ST_MBUFF_SKIP \
50 CVMX_ADD_IO_SEG(0x00014F0000000008ull)
51#define CVMX_IPD_PACKET_MBUFF_SIZE \
52 CVMX_ADD_IO_SEG(0x00014F0000000010ull)
53#define CVMX_IPD_PKT_PTR_VALID \
54 CVMX_ADD_IO_SEG(0x00014F0000000358ull)
55#define CVMX_IPD_PORTX_BP_PAGE_CNT(offset) \
56 CVMX_ADD_IO_SEG(0x00014F0000000028ull + (((offset) & 63) * 8))
57#define CVMX_IPD_PORTX_BP_PAGE_CNT2(offset) \
58 CVMX_ADD_IO_SEG(0x00014F0000000368ull + (((offset) & 63) * 8) - 8 * 36)
59#define CVMX_IPD_PORT_BP_COUNTERS2_PAIRX(offset) \
60 CVMX_ADD_IO_SEG(0x00014F0000000388ull + (((offset) & 63) * 8) - 8 * 36)
61#define CVMX_IPD_PORT_BP_COUNTERS_PAIRX(offset) \
62 CVMX_ADD_IO_SEG(0x00014F00000001B8ull + (((offset) & 63) * 8))
63#define CVMX_IPD_PORT_QOS_INTX(offset) \
64 CVMX_ADD_IO_SEG(0x00014F0000000808ull + (((offset) & 7) * 8))
65#define CVMX_IPD_PORT_QOS_INT_ENBX(offset) \
66 CVMX_ADD_IO_SEG(0x00014F0000000848ull + (((offset) & 7) * 8))
67#define CVMX_IPD_PORT_QOS_X_CNT(offset) \
68 CVMX_ADD_IO_SEG(0x00014F0000000888ull + (((offset) & 511) * 8))
69#define CVMX_IPD_PRC_HOLD_PTR_FIFO_CTL \
70 CVMX_ADD_IO_SEG(0x00014F0000000348ull)
71#define CVMX_IPD_PRC_PORT_PTR_FIFO_CTL \
72 CVMX_ADD_IO_SEG(0x00014F0000000350ull)
73#define CVMX_IPD_PTR_COUNT \
74 CVMX_ADD_IO_SEG(0x00014F0000000320ull)
75#define CVMX_IPD_PWP_PTR_FIFO_CTL \
76 CVMX_ADD_IO_SEG(0x00014F0000000340ull)
77#define CVMX_IPD_QOS0_RED_MARKS \
78 CVMX_ADD_IO_SEG(0x00014F0000000178ull)
79#define CVMX_IPD_QOS1_RED_MARKS \
80 CVMX_ADD_IO_SEG(0x00014F0000000180ull)
81#define CVMX_IPD_QOS2_RED_MARKS \
82 CVMX_ADD_IO_SEG(0x00014F0000000188ull)
83#define CVMX_IPD_QOS3_RED_MARKS \
84 CVMX_ADD_IO_SEG(0x00014F0000000190ull)
85#define CVMX_IPD_QOS4_RED_MARKS \
86 CVMX_ADD_IO_SEG(0x00014F0000000198ull)
87#define CVMX_IPD_QOS5_RED_MARKS \
88 CVMX_ADD_IO_SEG(0x00014F00000001A0ull)
89#define CVMX_IPD_QOS6_RED_MARKS \
90 CVMX_ADD_IO_SEG(0x00014F00000001A8ull)
91#define CVMX_IPD_QOS7_RED_MARKS \
92 CVMX_ADD_IO_SEG(0x00014F00000001B0ull)
93#define CVMX_IPD_QOSX_RED_MARKS(offset) \
94 CVMX_ADD_IO_SEG(0x00014F0000000178ull + (((offset) & 7) * 8))
95#define CVMX_IPD_QUE0_FREE_PAGE_CNT \
96 CVMX_ADD_IO_SEG(0x00014F0000000330ull)
97#define CVMX_IPD_RED_PORT_ENABLE \
98 CVMX_ADD_IO_SEG(0x00014F00000002D8ull)
99#define CVMX_IPD_RED_PORT_ENABLE2 \
100 CVMX_ADD_IO_SEG(0x00014F00000003A8ull)
101#define CVMX_IPD_RED_QUE0_PARAM \
102 CVMX_ADD_IO_SEG(0x00014F00000002E0ull)
103#define CVMX_IPD_RED_QUE1_PARAM \
104 CVMX_ADD_IO_SEG(0x00014F00000002E8ull)
105#define CVMX_IPD_RED_QUE2_PARAM \
106 CVMX_ADD_IO_SEG(0x00014F00000002F0ull)
107#define CVMX_IPD_RED_QUE3_PARAM \
108 CVMX_ADD_IO_SEG(0x00014F00000002F8ull)
109#define CVMX_IPD_RED_QUE4_PARAM \
110 CVMX_ADD_IO_SEG(0x00014F0000000300ull)
111#define CVMX_IPD_RED_QUE5_PARAM \
112 CVMX_ADD_IO_SEG(0x00014F0000000308ull)
113#define CVMX_IPD_RED_QUE6_PARAM \
114 CVMX_ADD_IO_SEG(0x00014F0000000310ull)
115#define CVMX_IPD_RED_QUE7_PARAM \
116 CVMX_ADD_IO_SEG(0x00014F0000000318ull)
117#define CVMX_IPD_RED_QUEX_PARAM(offset) \
118 CVMX_ADD_IO_SEG(0x00014F00000002E0ull + (((offset) & 7) * 8))
119#define CVMX_IPD_SUB_PORT_BP_PAGE_CNT \
120 CVMX_ADD_IO_SEG(0x00014F0000000148ull)
121#define CVMX_IPD_SUB_PORT_FCS \
122 CVMX_ADD_IO_SEG(0x00014F0000000170ull)
123#define CVMX_IPD_SUB_PORT_QOS_CNT \
124 CVMX_ADD_IO_SEG(0x00014F0000000800ull)
125#define CVMX_IPD_WQE_FPA_QUEUE \
126 CVMX_ADD_IO_SEG(0x00014F0000000020ull)
127#define CVMX_IPD_WQE_PTR_VALID \
128 CVMX_ADD_IO_SEG(0x00014F0000000360ull)
129
130union cvmx_ipd_1st_mbuff_skip {
131 uint64_t u64;
132 struct cvmx_ipd_1st_mbuff_skip_s {
133 uint64_t reserved_6_63:58;
134 uint64_t skip_sz:6;
135 } s;
136 struct cvmx_ipd_1st_mbuff_skip_s cn30xx;
137 struct cvmx_ipd_1st_mbuff_skip_s cn31xx;
138 struct cvmx_ipd_1st_mbuff_skip_s cn38xx;
139 struct cvmx_ipd_1st_mbuff_skip_s cn38xxp2;
140 struct cvmx_ipd_1st_mbuff_skip_s cn50xx;
141 struct cvmx_ipd_1st_mbuff_skip_s cn52xx;
142 struct cvmx_ipd_1st_mbuff_skip_s cn52xxp1;
143 struct cvmx_ipd_1st_mbuff_skip_s cn56xx;
144 struct cvmx_ipd_1st_mbuff_skip_s cn56xxp1;
145 struct cvmx_ipd_1st_mbuff_skip_s cn58xx;
146 struct cvmx_ipd_1st_mbuff_skip_s cn58xxp1;
147};
148
149union cvmx_ipd_1st_next_ptr_back {
150 uint64_t u64;
151 struct cvmx_ipd_1st_next_ptr_back_s {
152 uint64_t reserved_4_63:60;
153 uint64_t back:4;
154 } s;
155 struct cvmx_ipd_1st_next_ptr_back_s cn30xx;
156 struct cvmx_ipd_1st_next_ptr_back_s cn31xx;
157 struct cvmx_ipd_1st_next_ptr_back_s cn38xx;
158 struct cvmx_ipd_1st_next_ptr_back_s cn38xxp2;
159 struct cvmx_ipd_1st_next_ptr_back_s cn50xx;
160 struct cvmx_ipd_1st_next_ptr_back_s cn52xx;
161 struct cvmx_ipd_1st_next_ptr_back_s cn52xxp1;
162 struct cvmx_ipd_1st_next_ptr_back_s cn56xx;
163 struct cvmx_ipd_1st_next_ptr_back_s cn56xxp1;
164 struct cvmx_ipd_1st_next_ptr_back_s cn58xx;
165 struct cvmx_ipd_1st_next_ptr_back_s cn58xxp1;
166};
167
168union cvmx_ipd_2nd_next_ptr_back {
169 uint64_t u64;
170 struct cvmx_ipd_2nd_next_ptr_back_s {
171 uint64_t reserved_4_63:60;
172 uint64_t back:4;
173 } s;
174 struct cvmx_ipd_2nd_next_ptr_back_s cn30xx;
175 struct cvmx_ipd_2nd_next_ptr_back_s cn31xx;
176 struct cvmx_ipd_2nd_next_ptr_back_s cn38xx;
177 struct cvmx_ipd_2nd_next_ptr_back_s cn38xxp2;
178 struct cvmx_ipd_2nd_next_ptr_back_s cn50xx;
179 struct cvmx_ipd_2nd_next_ptr_back_s cn52xx;
180 struct cvmx_ipd_2nd_next_ptr_back_s cn52xxp1;
181 struct cvmx_ipd_2nd_next_ptr_back_s cn56xx;
182 struct cvmx_ipd_2nd_next_ptr_back_s cn56xxp1;
183 struct cvmx_ipd_2nd_next_ptr_back_s cn58xx;
184 struct cvmx_ipd_2nd_next_ptr_back_s cn58xxp1;
185};
186
187union cvmx_ipd_bist_status {
188 uint64_t u64;
189 struct cvmx_ipd_bist_status_s {
190 uint64_t reserved_18_63:46;
191 uint64_t csr_mem:1;
192 uint64_t csr_ncmd:1;
193 uint64_t pwq_wqed:1;
194 uint64_t pwq_wp1:1;
195 uint64_t pwq_pow:1;
196 uint64_t ipq_pbe1:1;
197 uint64_t ipq_pbe0:1;
198 uint64_t pbm3:1;
199 uint64_t pbm2:1;
200 uint64_t pbm1:1;
201 uint64_t pbm0:1;
202 uint64_t pbm_word:1;
203 uint64_t pwq1:1;
204 uint64_t pwq0:1;
205 uint64_t prc_off:1;
206 uint64_t ipd_old:1;
207 uint64_t ipd_new:1;
208 uint64_t pwp:1;
209 } s;
210 struct cvmx_ipd_bist_status_cn30xx {
211 uint64_t reserved_16_63:48;
212 uint64_t pwq_wqed:1;
213 uint64_t pwq_wp1:1;
214 uint64_t pwq_pow:1;
215 uint64_t ipq_pbe1:1;
216 uint64_t ipq_pbe0:1;
217 uint64_t pbm3:1;
218 uint64_t pbm2:1;
219 uint64_t pbm1:1;
220 uint64_t pbm0:1;
221 uint64_t pbm_word:1;
222 uint64_t pwq1:1;
223 uint64_t pwq0:1;
224 uint64_t prc_off:1;
225 uint64_t ipd_old:1;
226 uint64_t ipd_new:1;
227 uint64_t pwp:1;
228 } cn30xx;
229 struct cvmx_ipd_bist_status_cn30xx cn31xx;
230 struct cvmx_ipd_bist_status_cn30xx cn38xx;
231 struct cvmx_ipd_bist_status_cn30xx cn38xxp2;
232 struct cvmx_ipd_bist_status_cn30xx cn50xx;
233 struct cvmx_ipd_bist_status_s cn52xx;
234 struct cvmx_ipd_bist_status_s cn52xxp1;
235 struct cvmx_ipd_bist_status_s cn56xx;
236 struct cvmx_ipd_bist_status_s cn56xxp1;
237 struct cvmx_ipd_bist_status_cn30xx cn58xx;
238 struct cvmx_ipd_bist_status_cn30xx cn58xxp1;
239};
240
241union cvmx_ipd_bp_prt_red_end {
242 uint64_t u64;
243 struct cvmx_ipd_bp_prt_red_end_s {
244 uint64_t reserved_40_63:24;
245 uint64_t prt_enb:40;
246 } s;
247 struct cvmx_ipd_bp_prt_red_end_cn30xx {
248 uint64_t reserved_36_63:28;
249 uint64_t prt_enb:36;
250 } cn30xx;
251 struct cvmx_ipd_bp_prt_red_end_cn30xx cn31xx;
252 struct cvmx_ipd_bp_prt_red_end_cn30xx cn38xx;
253 struct cvmx_ipd_bp_prt_red_end_cn30xx cn38xxp2;
254 struct cvmx_ipd_bp_prt_red_end_cn30xx cn50xx;
255 struct cvmx_ipd_bp_prt_red_end_s cn52xx;
256 struct cvmx_ipd_bp_prt_red_end_s cn52xxp1;
257 struct cvmx_ipd_bp_prt_red_end_s cn56xx;
258 struct cvmx_ipd_bp_prt_red_end_s cn56xxp1;
259 struct cvmx_ipd_bp_prt_red_end_cn30xx cn58xx;
260 struct cvmx_ipd_bp_prt_red_end_cn30xx cn58xxp1;
261};
262
263union cvmx_ipd_clk_count {
264 uint64_t u64;
265 struct cvmx_ipd_clk_count_s {
266 uint64_t clk_cnt:64;
267 } s;
268 struct cvmx_ipd_clk_count_s cn30xx;
269 struct cvmx_ipd_clk_count_s cn31xx;
270 struct cvmx_ipd_clk_count_s cn38xx;
271 struct cvmx_ipd_clk_count_s cn38xxp2;
272 struct cvmx_ipd_clk_count_s cn50xx;
273 struct cvmx_ipd_clk_count_s cn52xx;
274 struct cvmx_ipd_clk_count_s cn52xxp1;
275 struct cvmx_ipd_clk_count_s cn56xx;
276 struct cvmx_ipd_clk_count_s cn56xxp1;
277 struct cvmx_ipd_clk_count_s cn58xx;
278 struct cvmx_ipd_clk_count_s cn58xxp1;
279};
280
281union cvmx_ipd_ctl_status {
282 uint64_t u64;
283 struct cvmx_ipd_ctl_status_s {
284 uint64_t reserved_15_63:49;
285 uint64_t no_wptr:1;
286 uint64_t pq_apkt:1;
287 uint64_t pq_nabuf:1;
288 uint64_t ipd_full:1;
289 uint64_t pkt_off:1;
290 uint64_t len_m8:1;
291 uint64_t reset:1;
292 uint64_t addpkt:1;
293 uint64_t naddbuf:1;
294 uint64_t pkt_lend:1;
295 uint64_t wqe_lend:1;
296 uint64_t pbp_en:1;
297 uint64_t opc_mode:2;
298 uint64_t ipd_en:1;
299 } s;
300 struct cvmx_ipd_ctl_status_cn30xx {
301 uint64_t reserved_10_63:54;
302 uint64_t len_m8:1;
303 uint64_t reset:1;
304 uint64_t addpkt:1;
305 uint64_t naddbuf:1;
306 uint64_t pkt_lend:1;
307 uint64_t wqe_lend:1;
308 uint64_t pbp_en:1;
309 uint64_t opc_mode:2;
310 uint64_t ipd_en:1;
311 } cn30xx;
312 struct cvmx_ipd_ctl_status_cn30xx cn31xx;
313 struct cvmx_ipd_ctl_status_cn30xx cn38xx;
314 struct cvmx_ipd_ctl_status_cn38xxp2 {
315 uint64_t reserved_9_63:55;
316 uint64_t reset:1;
317 uint64_t addpkt:1;
318 uint64_t naddbuf:1;
319 uint64_t pkt_lend:1;
320 uint64_t wqe_lend:1;
321 uint64_t pbp_en:1;
322 uint64_t opc_mode:2;
323 uint64_t ipd_en:1;
324 } cn38xxp2;
325 struct cvmx_ipd_ctl_status_s cn50xx;
326 struct cvmx_ipd_ctl_status_s cn52xx;
327 struct cvmx_ipd_ctl_status_s cn52xxp1;
328 struct cvmx_ipd_ctl_status_s cn56xx;
329 struct cvmx_ipd_ctl_status_s cn56xxp1;
330 struct cvmx_ipd_ctl_status_cn58xx {
331 uint64_t reserved_12_63:52;
332 uint64_t ipd_full:1;
333 uint64_t pkt_off:1;
334 uint64_t len_m8:1;
335 uint64_t reset:1;
336 uint64_t addpkt:1;
337 uint64_t naddbuf:1;
338 uint64_t pkt_lend:1;
339 uint64_t wqe_lend:1;
340 uint64_t pbp_en:1;
341 uint64_t opc_mode:2;
342 uint64_t ipd_en:1;
343 } cn58xx;
344 struct cvmx_ipd_ctl_status_cn58xx cn58xxp1;
345};
346
347union cvmx_ipd_int_enb {
348 uint64_t u64;
349 struct cvmx_ipd_int_enb_s {
350 uint64_t reserved_12_63:52;
351 uint64_t pq_sub:1;
352 uint64_t pq_add:1;
353 uint64_t bc_ovr:1;
354 uint64_t d_coll:1;
355 uint64_t c_coll:1;
356 uint64_t cc_ovr:1;
357 uint64_t dc_ovr:1;
358 uint64_t bp_sub:1;
359 uint64_t prc_par3:1;
360 uint64_t prc_par2:1;
361 uint64_t prc_par1:1;
362 uint64_t prc_par0:1;
363 } s;
364 struct cvmx_ipd_int_enb_cn30xx {
365 uint64_t reserved_5_63:59;
366 uint64_t bp_sub:1;
367 uint64_t prc_par3:1;
368 uint64_t prc_par2:1;
369 uint64_t prc_par1:1;
370 uint64_t prc_par0:1;
371 } cn30xx;
372 struct cvmx_ipd_int_enb_cn30xx cn31xx;
373 struct cvmx_ipd_int_enb_cn38xx {
374 uint64_t reserved_10_63:54;
375 uint64_t bc_ovr:1;
376 uint64_t d_coll:1;
377 uint64_t c_coll:1;
378 uint64_t cc_ovr:1;
379 uint64_t dc_ovr:1;
380 uint64_t bp_sub:1;
381 uint64_t prc_par3:1;
382 uint64_t prc_par2:1;
383 uint64_t prc_par1:1;
384 uint64_t prc_par0:1;
385 } cn38xx;
386 struct cvmx_ipd_int_enb_cn30xx cn38xxp2;
387 struct cvmx_ipd_int_enb_cn38xx cn50xx;
388 struct cvmx_ipd_int_enb_s cn52xx;
389 struct cvmx_ipd_int_enb_s cn52xxp1;
390 struct cvmx_ipd_int_enb_s cn56xx;
391 struct cvmx_ipd_int_enb_s cn56xxp1;
392 struct cvmx_ipd_int_enb_cn38xx cn58xx;
393 struct cvmx_ipd_int_enb_cn38xx cn58xxp1;
394};
395
396union cvmx_ipd_int_sum {
397 uint64_t u64;
398 struct cvmx_ipd_int_sum_s {
399 uint64_t reserved_12_63:52;
400 uint64_t pq_sub:1;
401 uint64_t pq_add:1;
402 uint64_t bc_ovr:1;
403 uint64_t d_coll:1;
404 uint64_t c_coll:1;
405 uint64_t cc_ovr:1;
406 uint64_t dc_ovr:1;
407 uint64_t bp_sub:1;
408 uint64_t prc_par3:1;
409 uint64_t prc_par2:1;
410 uint64_t prc_par1:1;
411 uint64_t prc_par0:1;
412 } s;
413 struct cvmx_ipd_int_sum_cn30xx {
414 uint64_t reserved_5_63:59;
415 uint64_t bp_sub:1;
416 uint64_t prc_par3:1;
417 uint64_t prc_par2:1;
418 uint64_t prc_par1:1;
419 uint64_t prc_par0:1;
420 } cn30xx;
421 struct cvmx_ipd_int_sum_cn30xx cn31xx;
422 struct cvmx_ipd_int_sum_cn38xx {
423 uint64_t reserved_10_63:54;
424 uint64_t bc_ovr:1;
425 uint64_t d_coll:1;
426 uint64_t c_coll:1;
427 uint64_t cc_ovr:1;
428 uint64_t dc_ovr:1;
429 uint64_t bp_sub:1;
430 uint64_t prc_par3:1;
431 uint64_t prc_par2:1;
432 uint64_t prc_par1:1;
433 uint64_t prc_par0:1;
434 } cn38xx;
435 struct cvmx_ipd_int_sum_cn30xx cn38xxp2;
436 struct cvmx_ipd_int_sum_cn38xx cn50xx;
437 struct cvmx_ipd_int_sum_s cn52xx;
438 struct cvmx_ipd_int_sum_s cn52xxp1;
439 struct cvmx_ipd_int_sum_s cn56xx;
440 struct cvmx_ipd_int_sum_s cn56xxp1;
441 struct cvmx_ipd_int_sum_cn38xx cn58xx;
442 struct cvmx_ipd_int_sum_cn38xx cn58xxp1;
443};
444
445union cvmx_ipd_not_1st_mbuff_skip {
446 uint64_t u64;
447 struct cvmx_ipd_not_1st_mbuff_skip_s {
448 uint64_t reserved_6_63:58;
449 uint64_t skip_sz:6;
450 } s;
451 struct cvmx_ipd_not_1st_mbuff_skip_s cn30xx;
452 struct cvmx_ipd_not_1st_mbuff_skip_s cn31xx;
453 struct cvmx_ipd_not_1st_mbuff_skip_s cn38xx;
454 struct cvmx_ipd_not_1st_mbuff_skip_s cn38xxp2;
455 struct cvmx_ipd_not_1st_mbuff_skip_s cn50xx;
456 struct cvmx_ipd_not_1st_mbuff_skip_s cn52xx;
457 struct cvmx_ipd_not_1st_mbuff_skip_s cn52xxp1;
458 struct cvmx_ipd_not_1st_mbuff_skip_s cn56xx;
459 struct cvmx_ipd_not_1st_mbuff_skip_s cn56xxp1;
460 struct cvmx_ipd_not_1st_mbuff_skip_s cn58xx;
461 struct cvmx_ipd_not_1st_mbuff_skip_s cn58xxp1;
462};
463
464union cvmx_ipd_packet_mbuff_size {
465 uint64_t u64;
466 struct cvmx_ipd_packet_mbuff_size_s {
467 uint64_t reserved_12_63:52;
468 uint64_t mb_size:12;
469 } s;
470 struct cvmx_ipd_packet_mbuff_size_s cn30xx;
471 struct cvmx_ipd_packet_mbuff_size_s cn31xx;
472 struct cvmx_ipd_packet_mbuff_size_s cn38xx;
473 struct cvmx_ipd_packet_mbuff_size_s cn38xxp2;
474 struct cvmx_ipd_packet_mbuff_size_s cn50xx;
475 struct cvmx_ipd_packet_mbuff_size_s cn52xx;
476 struct cvmx_ipd_packet_mbuff_size_s cn52xxp1;
477 struct cvmx_ipd_packet_mbuff_size_s cn56xx;
478 struct cvmx_ipd_packet_mbuff_size_s cn56xxp1;
479 struct cvmx_ipd_packet_mbuff_size_s cn58xx;
480 struct cvmx_ipd_packet_mbuff_size_s cn58xxp1;
481};
482
483union cvmx_ipd_pkt_ptr_valid {
484 uint64_t u64;
485 struct cvmx_ipd_pkt_ptr_valid_s {
486 uint64_t reserved_29_63:35;
487 uint64_t ptr:29;
488 } s;
489 struct cvmx_ipd_pkt_ptr_valid_s cn30xx;
490 struct cvmx_ipd_pkt_ptr_valid_s cn31xx;
491 struct cvmx_ipd_pkt_ptr_valid_s cn38xx;
492 struct cvmx_ipd_pkt_ptr_valid_s cn50xx;
493 struct cvmx_ipd_pkt_ptr_valid_s cn52xx;
494 struct cvmx_ipd_pkt_ptr_valid_s cn52xxp1;
495 struct cvmx_ipd_pkt_ptr_valid_s cn56xx;
496 struct cvmx_ipd_pkt_ptr_valid_s cn56xxp1;
497 struct cvmx_ipd_pkt_ptr_valid_s cn58xx;
498 struct cvmx_ipd_pkt_ptr_valid_s cn58xxp1;
499};
500
501union cvmx_ipd_portx_bp_page_cnt {
502 uint64_t u64;
503 struct cvmx_ipd_portx_bp_page_cnt_s {
504 uint64_t reserved_18_63:46;
505 uint64_t bp_enb:1;
506 uint64_t page_cnt:17;
507 } s;
508 struct cvmx_ipd_portx_bp_page_cnt_s cn30xx;
509 struct cvmx_ipd_portx_bp_page_cnt_s cn31xx;
510 struct cvmx_ipd_portx_bp_page_cnt_s cn38xx;
511 struct cvmx_ipd_portx_bp_page_cnt_s cn38xxp2;
512 struct cvmx_ipd_portx_bp_page_cnt_s cn50xx;
513 struct cvmx_ipd_portx_bp_page_cnt_s cn52xx;
514 struct cvmx_ipd_portx_bp_page_cnt_s cn52xxp1;
515 struct cvmx_ipd_portx_bp_page_cnt_s cn56xx;
516 struct cvmx_ipd_portx_bp_page_cnt_s cn56xxp1;
517 struct cvmx_ipd_portx_bp_page_cnt_s cn58xx;
518 struct cvmx_ipd_portx_bp_page_cnt_s cn58xxp1;
519};
520
521union cvmx_ipd_portx_bp_page_cnt2 {
522 uint64_t u64;
523 struct cvmx_ipd_portx_bp_page_cnt2_s {
524 uint64_t reserved_18_63:46;
525 uint64_t bp_enb:1;
526 uint64_t page_cnt:17;
527 } s;
528 struct cvmx_ipd_portx_bp_page_cnt2_s cn52xx;
529 struct cvmx_ipd_portx_bp_page_cnt2_s cn52xxp1;
530 struct cvmx_ipd_portx_bp_page_cnt2_s cn56xx;
531 struct cvmx_ipd_portx_bp_page_cnt2_s cn56xxp1;
532};
533
534union cvmx_ipd_port_bp_counters2_pairx {
535 uint64_t u64;
536 struct cvmx_ipd_port_bp_counters2_pairx_s {
537 uint64_t reserved_25_63:39;
538 uint64_t cnt_val:25;
539 } s;
540 struct cvmx_ipd_port_bp_counters2_pairx_s cn52xx;
541 struct cvmx_ipd_port_bp_counters2_pairx_s cn52xxp1;
542 struct cvmx_ipd_port_bp_counters2_pairx_s cn56xx;
543 struct cvmx_ipd_port_bp_counters2_pairx_s cn56xxp1;
544};
545
546union cvmx_ipd_port_bp_counters_pairx {
547 uint64_t u64;
548 struct cvmx_ipd_port_bp_counters_pairx_s {
549 uint64_t reserved_25_63:39;
550 uint64_t cnt_val:25;
551 } s;
552 struct cvmx_ipd_port_bp_counters_pairx_s cn30xx;
553 struct cvmx_ipd_port_bp_counters_pairx_s cn31xx;
554 struct cvmx_ipd_port_bp_counters_pairx_s cn38xx;
555 struct cvmx_ipd_port_bp_counters_pairx_s cn38xxp2;
556 struct cvmx_ipd_port_bp_counters_pairx_s cn50xx;
557 struct cvmx_ipd_port_bp_counters_pairx_s cn52xx;
558 struct cvmx_ipd_port_bp_counters_pairx_s cn52xxp1;
559 struct cvmx_ipd_port_bp_counters_pairx_s cn56xx;
560 struct cvmx_ipd_port_bp_counters_pairx_s cn56xxp1;
561 struct cvmx_ipd_port_bp_counters_pairx_s cn58xx;
562 struct cvmx_ipd_port_bp_counters_pairx_s cn58xxp1;
563};
564
565union cvmx_ipd_port_qos_x_cnt {
566 uint64_t u64;
567 struct cvmx_ipd_port_qos_x_cnt_s {
568 uint64_t wmark:32;
569 uint64_t cnt:32;
570 } s;
571 struct cvmx_ipd_port_qos_x_cnt_s cn52xx;
572 struct cvmx_ipd_port_qos_x_cnt_s cn52xxp1;
573 struct cvmx_ipd_port_qos_x_cnt_s cn56xx;
574 struct cvmx_ipd_port_qos_x_cnt_s cn56xxp1;
575};
576
577union cvmx_ipd_port_qos_intx {
578 uint64_t u64;
579 struct cvmx_ipd_port_qos_intx_s {
580 uint64_t intr:64;
581 } s;
582 struct cvmx_ipd_port_qos_intx_s cn52xx;
583 struct cvmx_ipd_port_qos_intx_s cn52xxp1;
584 struct cvmx_ipd_port_qos_intx_s cn56xx;
585 struct cvmx_ipd_port_qos_intx_s cn56xxp1;
586};
587
588union cvmx_ipd_port_qos_int_enbx {
589 uint64_t u64;
590 struct cvmx_ipd_port_qos_int_enbx_s {
591 uint64_t enb:64;
592 } s;
593 struct cvmx_ipd_port_qos_int_enbx_s cn52xx;
594 struct cvmx_ipd_port_qos_int_enbx_s cn52xxp1;
595 struct cvmx_ipd_port_qos_int_enbx_s cn56xx;
596 struct cvmx_ipd_port_qos_int_enbx_s cn56xxp1;
597};
598
599union cvmx_ipd_prc_hold_ptr_fifo_ctl {
600 uint64_t u64;
601 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s {
602 uint64_t reserved_39_63:25;
603 uint64_t max_pkt:3;
604 uint64_t praddr:3;
605 uint64_t ptr:29;
606 uint64_t cena:1;
607 uint64_t raddr:3;
608 } s;
609 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn30xx;
610 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn31xx;
611 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn38xx;
612 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn50xx;
613 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn52xx;
614 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn52xxp1;
615 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn56xx;
616 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn56xxp1;
617 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn58xx;
618 struct cvmx_ipd_prc_hold_ptr_fifo_ctl_s cn58xxp1;
619};
620
621union cvmx_ipd_prc_port_ptr_fifo_ctl {
622 uint64_t u64;
623 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s {
624 uint64_t reserved_44_63:20;
625 uint64_t max_pkt:7;
626 uint64_t ptr:29;
627 uint64_t cena:1;
628 uint64_t raddr:7;
629 } s;
630 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn30xx;
631 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn31xx;
632 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn38xx;
633 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn50xx;
634 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn52xx;
635 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn52xxp1;
636 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn56xx;
637 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn56xxp1;
638 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn58xx;
639 struct cvmx_ipd_prc_port_ptr_fifo_ctl_s cn58xxp1;
640};
641
642union cvmx_ipd_ptr_count {
643 uint64_t u64;
644 struct cvmx_ipd_ptr_count_s {
645 uint64_t reserved_19_63:45;
646 uint64_t pktv_cnt:1;
647 uint64_t wqev_cnt:1;
648 uint64_t pfif_cnt:3;
649 uint64_t pkt_pcnt:7;
650 uint64_t wqe_pcnt:7;
651 } s;
652 struct cvmx_ipd_ptr_count_s cn30xx;
653 struct cvmx_ipd_ptr_count_s cn31xx;
654 struct cvmx_ipd_ptr_count_s cn38xx;
655 struct cvmx_ipd_ptr_count_s cn38xxp2;
656 struct cvmx_ipd_ptr_count_s cn50xx;
657 struct cvmx_ipd_ptr_count_s cn52xx;
658 struct cvmx_ipd_ptr_count_s cn52xxp1;
659 struct cvmx_ipd_ptr_count_s cn56xx;
660 struct cvmx_ipd_ptr_count_s cn56xxp1;
661 struct cvmx_ipd_ptr_count_s cn58xx;
662 struct cvmx_ipd_ptr_count_s cn58xxp1;
663};
664
665union cvmx_ipd_pwp_ptr_fifo_ctl {
666 uint64_t u64;
667 struct cvmx_ipd_pwp_ptr_fifo_ctl_s {
668 uint64_t reserved_61_63:3;
669 uint64_t max_cnts:7;
670 uint64_t wraddr:8;
671 uint64_t praddr:8;
672 uint64_t ptr:29;
673 uint64_t cena:1;
674 uint64_t raddr:8;
675 } s;
676 struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn30xx;
677 struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn31xx;
678 struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn38xx;
679 struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn50xx;
680 struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn52xx;
681 struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn52xxp1;
682 struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn56xx;
683 struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn56xxp1;
684 struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn58xx;
685 struct cvmx_ipd_pwp_ptr_fifo_ctl_s cn58xxp1;
686};
687
688union cvmx_ipd_qosx_red_marks {
689 uint64_t u64;
690 struct cvmx_ipd_qosx_red_marks_s {
691 uint64_t drop:32;
692 uint64_t pass:32;
693 } s;
694 struct cvmx_ipd_qosx_red_marks_s cn30xx;
695 struct cvmx_ipd_qosx_red_marks_s cn31xx;
696 struct cvmx_ipd_qosx_red_marks_s cn38xx;
697 struct cvmx_ipd_qosx_red_marks_s cn38xxp2;
698 struct cvmx_ipd_qosx_red_marks_s cn50xx;
699 struct cvmx_ipd_qosx_red_marks_s cn52xx;
700 struct cvmx_ipd_qosx_red_marks_s cn52xxp1;
701 struct cvmx_ipd_qosx_red_marks_s cn56xx;
702 struct cvmx_ipd_qosx_red_marks_s cn56xxp1;
703 struct cvmx_ipd_qosx_red_marks_s cn58xx;
704 struct cvmx_ipd_qosx_red_marks_s cn58xxp1;
705};
706
707union cvmx_ipd_que0_free_page_cnt {
708 uint64_t u64;
709 struct cvmx_ipd_que0_free_page_cnt_s {
710 uint64_t reserved_32_63:32;
711 uint64_t q0_pcnt:32;
712 } s;
713 struct cvmx_ipd_que0_free_page_cnt_s cn30xx;
714 struct cvmx_ipd_que0_free_page_cnt_s cn31xx;
715 struct cvmx_ipd_que0_free_page_cnt_s cn38xx;
716 struct cvmx_ipd_que0_free_page_cnt_s cn38xxp2;
717 struct cvmx_ipd_que0_free_page_cnt_s cn50xx;
718 struct cvmx_ipd_que0_free_page_cnt_s cn52xx;
719 struct cvmx_ipd_que0_free_page_cnt_s cn52xxp1;
720 struct cvmx_ipd_que0_free_page_cnt_s cn56xx;
721 struct cvmx_ipd_que0_free_page_cnt_s cn56xxp1;
722 struct cvmx_ipd_que0_free_page_cnt_s cn58xx;
723 struct cvmx_ipd_que0_free_page_cnt_s cn58xxp1;
724};
725
726union cvmx_ipd_red_port_enable {
727 uint64_t u64;
728 struct cvmx_ipd_red_port_enable_s {
729 uint64_t prb_dly:14;
730 uint64_t avg_dly:14;
731 uint64_t prt_enb:36;
732 } s;
733 struct cvmx_ipd_red_port_enable_s cn30xx;
734 struct cvmx_ipd_red_port_enable_s cn31xx;
735 struct cvmx_ipd_red_port_enable_s cn38xx;
736 struct cvmx_ipd_red_port_enable_s cn38xxp2;
737 struct cvmx_ipd_red_port_enable_s cn50xx;
738 struct cvmx_ipd_red_port_enable_s cn52xx;
739 struct cvmx_ipd_red_port_enable_s cn52xxp1;
740 struct cvmx_ipd_red_port_enable_s cn56xx;
741 struct cvmx_ipd_red_port_enable_s cn56xxp1;
742 struct cvmx_ipd_red_port_enable_s cn58xx;
743 struct cvmx_ipd_red_port_enable_s cn58xxp1;
744};
745
746union cvmx_ipd_red_port_enable2 {
747 uint64_t u64;
748 struct cvmx_ipd_red_port_enable2_s {
749 uint64_t reserved_4_63:60;
750 uint64_t prt_enb:4;
751 } s;
752 struct cvmx_ipd_red_port_enable2_s cn52xx;
753 struct cvmx_ipd_red_port_enable2_s cn52xxp1;
754 struct cvmx_ipd_red_port_enable2_s cn56xx;
755 struct cvmx_ipd_red_port_enable2_s cn56xxp1;
756};
757
758union cvmx_ipd_red_quex_param {
759 uint64_t u64;
760 struct cvmx_ipd_red_quex_param_s {
761 uint64_t reserved_49_63:15;
762 uint64_t use_pcnt:1;
763 uint64_t new_con:8;
764 uint64_t avg_con:8;
765 uint64_t prb_con:32;
766 } s;
767 struct cvmx_ipd_red_quex_param_s cn30xx;
768 struct cvmx_ipd_red_quex_param_s cn31xx;
769 struct cvmx_ipd_red_quex_param_s cn38xx;
770 struct cvmx_ipd_red_quex_param_s cn38xxp2;
771 struct cvmx_ipd_red_quex_param_s cn50xx;
772 struct cvmx_ipd_red_quex_param_s cn52xx;
773 struct cvmx_ipd_red_quex_param_s cn52xxp1;
774 struct cvmx_ipd_red_quex_param_s cn56xx;
775 struct cvmx_ipd_red_quex_param_s cn56xxp1;
776 struct cvmx_ipd_red_quex_param_s cn58xx;
777 struct cvmx_ipd_red_quex_param_s cn58xxp1;
778};
779
780union cvmx_ipd_sub_port_bp_page_cnt {
781 uint64_t u64;
782 struct cvmx_ipd_sub_port_bp_page_cnt_s {
783 uint64_t reserved_31_63:33;
784 uint64_t port:6;
785 uint64_t page_cnt:25;
786 } s;
787 struct cvmx_ipd_sub_port_bp_page_cnt_s cn30xx;
788 struct cvmx_ipd_sub_port_bp_page_cnt_s cn31xx;
789 struct cvmx_ipd_sub_port_bp_page_cnt_s cn38xx;
790 struct cvmx_ipd_sub_port_bp_page_cnt_s cn38xxp2;
791 struct cvmx_ipd_sub_port_bp_page_cnt_s cn50xx;
792 struct cvmx_ipd_sub_port_bp_page_cnt_s cn52xx;
793 struct cvmx_ipd_sub_port_bp_page_cnt_s cn52xxp1;
794 struct cvmx_ipd_sub_port_bp_page_cnt_s cn56xx;
795 struct cvmx_ipd_sub_port_bp_page_cnt_s cn56xxp1;
796 struct cvmx_ipd_sub_port_bp_page_cnt_s cn58xx;
797 struct cvmx_ipd_sub_port_bp_page_cnt_s cn58xxp1;
798};
799
800union cvmx_ipd_sub_port_fcs {
801 uint64_t u64;
802 struct cvmx_ipd_sub_port_fcs_s {
803 uint64_t reserved_40_63:24;
804 uint64_t port_bit2:4;
805 uint64_t reserved_32_35:4;
806 uint64_t port_bit:32;
807 } s;
808 struct cvmx_ipd_sub_port_fcs_cn30xx {
809 uint64_t reserved_3_63:61;
810 uint64_t port_bit:3;
811 } cn30xx;
812 struct cvmx_ipd_sub_port_fcs_cn30xx cn31xx;
813 struct cvmx_ipd_sub_port_fcs_cn38xx {
814 uint64_t reserved_32_63:32;
815 uint64_t port_bit:32;
816 } cn38xx;
817 struct cvmx_ipd_sub_port_fcs_cn38xx cn38xxp2;
818 struct cvmx_ipd_sub_port_fcs_cn30xx cn50xx;
819 struct cvmx_ipd_sub_port_fcs_s cn52xx;
820 struct cvmx_ipd_sub_port_fcs_s cn52xxp1;
821 struct cvmx_ipd_sub_port_fcs_s cn56xx;
822 struct cvmx_ipd_sub_port_fcs_s cn56xxp1;
823 struct cvmx_ipd_sub_port_fcs_cn38xx cn58xx;
824 struct cvmx_ipd_sub_port_fcs_cn38xx cn58xxp1;
825};
826
827union cvmx_ipd_sub_port_qos_cnt {
828 uint64_t u64;
829 struct cvmx_ipd_sub_port_qos_cnt_s {
830 uint64_t reserved_41_63:23;
831 uint64_t port_qos:9;
832 uint64_t cnt:32;
833 } s;
834 struct cvmx_ipd_sub_port_qos_cnt_s cn52xx;
835 struct cvmx_ipd_sub_port_qos_cnt_s cn52xxp1;
836 struct cvmx_ipd_sub_port_qos_cnt_s cn56xx;
837 struct cvmx_ipd_sub_port_qos_cnt_s cn56xxp1;
838};
839
840union cvmx_ipd_wqe_fpa_queue {
841 uint64_t u64;
842 struct cvmx_ipd_wqe_fpa_queue_s {
843 uint64_t reserved_3_63:61;
844 uint64_t wqe_pool:3;
845 } s;
846 struct cvmx_ipd_wqe_fpa_queue_s cn30xx;
847 struct cvmx_ipd_wqe_fpa_queue_s cn31xx;
848 struct cvmx_ipd_wqe_fpa_queue_s cn38xx;
849 struct cvmx_ipd_wqe_fpa_queue_s cn38xxp2;
850 struct cvmx_ipd_wqe_fpa_queue_s cn50xx;
851 struct cvmx_ipd_wqe_fpa_queue_s cn52xx;
852 struct cvmx_ipd_wqe_fpa_queue_s cn52xxp1;
853 struct cvmx_ipd_wqe_fpa_queue_s cn56xx;
854 struct cvmx_ipd_wqe_fpa_queue_s cn56xxp1;
855 struct cvmx_ipd_wqe_fpa_queue_s cn58xx;
856 struct cvmx_ipd_wqe_fpa_queue_s cn58xxp1;
857};
858
859union cvmx_ipd_wqe_ptr_valid {
860 uint64_t u64;
861 struct cvmx_ipd_wqe_ptr_valid_s {
862 uint64_t reserved_29_63:35;
863 uint64_t ptr:29;
864 } s;
865 struct cvmx_ipd_wqe_ptr_valid_s cn30xx;
866 struct cvmx_ipd_wqe_ptr_valid_s cn31xx;
867 struct cvmx_ipd_wqe_ptr_valid_s cn38xx;
868 struct cvmx_ipd_wqe_ptr_valid_s cn50xx;
869 struct cvmx_ipd_wqe_ptr_valid_s cn52xx;
870 struct cvmx_ipd_wqe_ptr_valid_s cn52xxp1;
871 struct cvmx_ipd_wqe_ptr_valid_s cn56xx;
872 struct cvmx_ipd_wqe_ptr_valid_s cn56xxp1;
873 struct cvmx_ipd_wqe_ptr_valid_s cn58xx;
874 struct cvmx_ipd_wqe_ptr_valid_s cn58xxp1;
875};
876
877#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-l2c-defs.h b/arch/mips/include/asm/octeon/cvmx-l2c-defs.h
new file mode 100644
index 000000000000..337583842b51
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-l2c-defs.h
@@ -0,0 +1,963 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_L2C_DEFS_H__
29#define __CVMX_L2C_DEFS_H__
30
31#define CVMX_L2C_BST0 \
32 CVMX_ADD_IO_SEG(0x00011800800007F8ull)
33#define CVMX_L2C_BST1 \
34 CVMX_ADD_IO_SEG(0x00011800800007F0ull)
35#define CVMX_L2C_BST2 \
36 CVMX_ADD_IO_SEG(0x00011800800007E8ull)
37#define CVMX_L2C_CFG \
38 CVMX_ADD_IO_SEG(0x0001180080000000ull)
39#define CVMX_L2C_DBG \
40 CVMX_ADD_IO_SEG(0x0001180080000030ull)
41#define CVMX_L2C_DUT \
42 CVMX_ADD_IO_SEG(0x0001180080000050ull)
43#define CVMX_L2C_GRPWRR0 \
44 CVMX_ADD_IO_SEG(0x00011800800000C8ull)
45#define CVMX_L2C_GRPWRR1 \
46 CVMX_ADD_IO_SEG(0x00011800800000D0ull)
47#define CVMX_L2C_INT_EN \
48 CVMX_ADD_IO_SEG(0x0001180080000100ull)
49#define CVMX_L2C_INT_STAT \
50 CVMX_ADD_IO_SEG(0x00011800800000F8ull)
51#define CVMX_L2C_LCKBASE \
52 CVMX_ADD_IO_SEG(0x0001180080000058ull)
53#define CVMX_L2C_LCKOFF \
54 CVMX_ADD_IO_SEG(0x0001180080000060ull)
55#define CVMX_L2C_LFB0 \
56 CVMX_ADD_IO_SEG(0x0001180080000038ull)
57#define CVMX_L2C_LFB1 \
58 CVMX_ADD_IO_SEG(0x0001180080000040ull)
59#define CVMX_L2C_LFB2 \
60 CVMX_ADD_IO_SEG(0x0001180080000048ull)
61#define CVMX_L2C_LFB3 \
62 CVMX_ADD_IO_SEG(0x00011800800000B8ull)
63#define CVMX_L2C_OOB \
64 CVMX_ADD_IO_SEG(0x00011800800000D8ull)
65#define CVMX_L2C_OOB1 \
66 CVMX_ADD_IO_SEG(0x00011800800000E0ull)
67#define CVMX_L2C_OOB2 \
68 CVMX_ADD_IO_SEG(0x00011800800000E8ull)
69#define CVMX_L2C_OOB3 \
70 CVMX_ADD_IO_SEG(0x00011800800000F0ull)
71#define CVMX_L2C_PFC0 \
72 CVMX_ADD_IO_SEG(0x0001180080000098ull)
73#define CVMX_L2C_PFC1 \
74 CVMX_ADD_IO_SEG(0x00011800800000A0ull)
75#define CVMX_L2C_PFC2 \
76 CVMX_ADD_IO_SEG(0x00011800800000A8ull)
77#define CVMX_L2C_PFC3 \
78 CVMX_ADD_IO_SEG(0x00011800800000B0ull)
79#define CVMX_L2C_PFCTL \
80 CVMX_ADD_IO_SEG(0x0001180080000090ull)
81#define CVMX_L2C_PFCX(offset) \
82 CVMX_ADD_IO_SEG(0x0001180080000098ull + (((offset) & 3) * 8))
83#define CVMX_L2C_PPGRP \
84 CVMX_ADD_IO_SEG(0x00011800800000C0ull)
85#define CVMX_L2C_SPAR0 \
86 CVMX_ADD_IO_SEG(0x0001180080000068ull)
87#define CVMX_L2C_SPAR1 \
88 CVMX_ADD_IO_SEG(0x0001180080000070ull)
89#define CVMX_L2C_SPAR2 \
90 CVMX_ADD_IO_SEG(0x0001180080000078ull)
91#define CVMX_L2C_SPAR3 \
92 CVMX_ADD_IO_SEG(0x0001180080000080ull)
93#define CVMX_L2C_SPAR4 \
94 CVMX_ADD_IO_SEG(0x0001180080000088ull)
95
96union cvmx_l2c_bst0 {
97 uint64_t u64;
98 struct cvmx_l2c_bst0_s {
99 uint64_t reserved_24_63:40;
100 uint64_t dtbnk:1;
101 uint64_t wlb_msk:4;
102 uint64_t dtcnt:13;
103 uint64_t dt:1;
104 uint64_t stin_msk:1;
105 uint64_t wlb_dat:4;
106 } s;
107 struct cvmx_l2c_bst0_cn30xx {
108 uint64_t reserved_23_63:41;
109 uint64_t wlb_msk:4;
110 uint64_t reserved_15_18:4;
111 uint64_t dtcnt:9;
112 uint64_t dt:1;
113 uint64_t reserved_4_4:1;
114 uint64_t wlb_dat:4;
115 } cn30xx;
116 struct cvmx_l2c_bst0_cn31xx {
117 uint64_t reserved_23_63:41;
118 uint64_t wlb_msk:4;
119 uint64_t reserved_16_18:3;
120 uint64_t dtcnt:10;
121 uint64_t dt:1;
122 uint64_t stin_msk:1;
123 uint64_t wlb_dat:4;
124 } cn31xx;
125 struct cvmx_l2c_bst0_cn38xx {
126 uint64_t reserved_19_63:45;
127 uint64_t dtcnt:13;
128 uint64_t dt:1;
129 uint64_t stin_msk:1;
130 uint64_t wlb_dat:4;
131 } cn38xx;
132 struct cvmx_l2c_bst0_cn38xx cn38xxp2;
133 struct cvmx_l2c_bst0_cn50xx {
134 uint64_t reserved_24_63:40;
135 uint64_t dtbnk:1;
136 uint64_t wlb_msk:4;
137 uint64_t reserved_16_18:3;
138 uint64_t dtcnt:10;
139 uint64_t dt:1;
140 uint64_t stin_msk:1;
141 uint64_t wlb_dat:4;
142 } cn50xx;
143 struct cvmx_l2c_bst0_cn50xx cn52xx;
144 struct cvmx_l2c_bst0_cn50xx cn52xxp1;
145 struct cvmx_l2c_bst0_s cn56xx;
146 struct cvmx_l2c_bst0_s cn56xxp1;
147 struct cvmx_l2c_bst0_s cn58xx;
148 struct cvmx_l2c_bst0_s cn58xxp1;
149};
150
151union cvmx_l2c_bst1 {
152 uint64_t u64;
153 struct cvmx_l2c_bst1_s {
154 uint64_t reserved_9_63:55;
155 uint64_t l2t:9;
156 } s;
157 struct cvmx_l2c_bst1_cn30xx {
158 uint64_t reserved_16_63:48;
159 uint64_t vwdf:4;
160 uint64_t lrf:2;
161 uint64_t vab_vwcf:1;
162 uint64_t reserved_5_8:4;
163 uint64_t l2t:5;
164 } cn30xx;
165 struct cvmx_l2c_bst1_cn30xx cn31xx;
166 struct cvmx_l2c_bst1_cn38xx {
167 uint64_t reserved_16_63:48;
168 uint64_t vwdf:4;
169 uint64_t lrf:2;
170 uint64_t vab_vwcf:1;
171 uint64_t l2t:9;
172 } cn38xx;
173 struct cvmx_l2c_bst1_cn38xx cn38xxp2;
174 struct cvmx_l2c_bst1_cn38xx cn50xx;
175 struct cvmx_l2c_bst1_cn52xx {
176 uint64_t reserved_19_63:45;
177 uint64_t plc2:1;
178 uint64_t plc1:1;
179 uint64_t plc0:1;
180 uint64_t vwdf:4;
181 uint64_t reserved_11_11:1;
182 uint64_t ilc:1;
183 uint64_t vab_vwcf:1;
184 uint64_t l2t:9;
185 } cn52xx;
186 struct cvmx_l2c_bst1_cn52xx cn52xxp1;
187 struct cvmx_l2c_bst1_cn56xx {
188 uint64_t reserved_24_63:40;
189 uint64_t plc2:1;
190 uint64_t plc1:1;
191 uint64_t plc0:1;
192 uint64_t ilc:1;
193 uint64_t vwdf1:4;
194 uint64_t vwdf0:4;
195 uint64_t vab_vwcf1:1;
196 uint64_t reserved_10_10:1;
197 uint64_t vab_vwcf0:1;
198 uint64_t l2t:9;
199 } cn56xx;
200 struct cvmx_l2c_bst1_cn56xx cn56xxp1;
201 struct cvmx_l2c_bst1_cn38xx cn58xx;
202 struct cvmx_l2c_bst1_cn38xx cn58xxp1;
203};
204
205union cvmx_l2c_bst2 {
206 uint64_t u64;
207 struct cvmx_l2c_bst2_s {
208 uint64_t reserved_16_63:48;
209 uint64_t mrb:4;
210 uint64_t reserved_4_11:8;
211 uint64_t ipcbst:1;
212 uint64_t picbst:1;
213 uint64_t xrdmsk:1;
214 uint64_t xrddat:1;
215 } s;
216 struct cvmx_l2c_bst2_cn30xx {
217 uint64_t reserved_16_63:48;
218 uint64_t mrb:4;
219 uint64_t rmdf:4;
220 uint64_t reserved_4_7:4;
221 uint64_t ipcbst:1;
222 uint64_t reserved_2_2:1;
223 uint64_t xrdmsk:1;
224 uint64_t xrddat:1;
225 } cn30xx;
226 struct cvmx_l2c_bst2_cn30xx cn31xx;
227 struct cvmx_l2c_bst2_cn38xx {
228 uint64_t reserved_16_63:48;
229 uint64_t mrb:4;
230 uint64_t rmdf:4;
231 uint64_t rhdf:4;
232 uint64_t ipcbst:1;
233 uint64_t picbst:1;
234 uint64_t xrdmsk:1;
235 uint64_t xrddat:1;
236 } cn38xx;
237 struct cvmx_l2c_bst2_cn38xx cn38xxp2;
238 struct cvmx_l2c_bst2_cn30xx cn50xx;
239 struct cvmx_l2c_bst2_cn30xx cn52xx;
240 struct cvmx_l2c_bst2_cn30xx cn52xxp1;
241 struct cvmx_l2c_bst2_cn56xx {
242 uint64_t reserved_16_63:48;
243 uint64_t mrb:4;
244 uint64_t rmdb:4;
245 uint64_t rhdb:4;
246 uint64_t ipcbst:1;
247 uint64_t picbst:1;
248 uint64_t xrdmsk:1;
249 uint64_t xrddat:1;
250 } cn56xx;
251 struct cvmx_l2c_bst2_cn56xx cn56xxp1;
252 struct cvmx_l2c_bst2_cn56xx cn58xx;
253 struct cvmx_l2c_bst2_cn56xx cn58xxp1;
254};
255
256union cvmx_l2c_cfg {
257 uint64_t u64;
258 struct cvmx_l2c_cfg_s {
259 uint64_t reserved_20_63:44;
260 uint64_t bstrun:1;
261 uint64_t lbist:1;
262 uint64_t xor_bank:1;
263 uint64_t dpres1:1;
264 uint64_t dpres0:1;
265 uint64_t dfill_dis:1;
266 uint64_t fpexp:4;
267 uint64_t fpempty:1;
268 uint64_t fpen:1;
269 uint64_t idxalias:1;
270 uint64_t mwf_crd:4;
271 uint64_t rsp_arb_mode:1;
272 uint64_t rfb_arb_mode:1;
273 uint64_t lrf_arb_mode:1;
274 } s;
275 struct cvmx_l2c_cfg_cn30xx {
276 uint64_t reserved_14_63:50;
277 uint64_t fpexp:4;
278 uint64_t fpempty:1;
279 uint64_t fpen:1;
280 uint64_t idxalias:1;
281 uint64_t mwf_crd:4;
282 uint64_t rsp_arb_mode:1;
283 uint64_t rfb_arb_mode:1;
284 uint64_t lrf_arb_mode:1;
285 } cn30xx;
286 struct cvmx_l2c_cfg_cn30xx cn31xx;
287 struct cvmx_l2c_cfg_cn30xx cn38xx;
288 struct cvmx_l2c_cfg_cn30xx cn38xxp2;
289 struct cvmx_l2c_cfg_cn50xx {
290 uint64_t reserved_20_63:44;
291 uint64_t bstrun:1;
292 uint64_t lbist:1;
293 uint64_t reserved_14_17:4;
294 uint64_t fpexp:4;
295 uint64_t fpempty:1;
296 uint64_t fpen:1;
297 uint64_t idxalias:1;
298 uint64_t mwf_crd:4;
299 uint64_t rsp_arb_mode:1;
300 uint64_t rfb_arb_mode:1;
301 uint64_t lrf_arb_mode:1;
302 } cn50xx;
303 struct cvmx_l2c_cfg_cn50xx cn52xx;
304 struct cvmx_l2c_cfg_cn50xx cn52xxp1;
305 struct cvmx_l2c_cfg_s cn56xx;
306 struct cvmx_l2c_cfg_s cn56xxp1;
307 struct cvmx_l2c_cfg_cn58xx {
308 uint64_t reserved_20_63:44;
309 uint64_t bstrun:1;
310 uint64_t lbist:1;
311 uint64_t reserved_15_17:3;
312 uint64_t dfill_dis:1;
313 uint64_t fpexp:4;
314 uint64_t fpempty:1;
315 uint64_t fpen:1;
316 uint64_t idxalias:1;
317 uint64_t mwf_crd:4;
318 uint64_t rsp_arb_mode:1;
319 uint64_t rfb_arb_mode:1;
320 uint64_t lrf_arb_mode:1;
321 } cn58xx;
322 struct cvmx_l2c_cfg_cn58xxp1 {
323 uint64_t reserved_15_63:49;
324 uint64_t dfill_dis:1;
325 uint64_t fpexp:4;
326 uint64_t fpempty:1;
327 uint64_t fpen:1;
328 uint64_t idxalias:1;
329 uint64_t mwf_crd:4;
330 uint64_t rsp_arb_mode:1;
331 uint64_t rfb_arb_mode:1;
332 uint64_t lrf_arb_mode:1;
333 } cn58xxp1;
334};
335
336union cvmx_l2c_dbg {
337 uint64_t u64;
338 struct cvmx_l2c_dbg_s {
339 uint64_t reserved_15_63:49;
340 uint64_t lfb_enum:4;
341 uint64_t lfb_dmp:1;
342 uint64_t ppnum:4;
343 uint64_t set:3;
344 uint64_t finv:1;
345 uint64_t l2d:1;
346 uint64_t l2t:1;
347 } s;
348 struct cvmx_l2c_dbg_cn30xx {
349 uint64_t reserved_13_63:51;
350 uint64_t lfb_enum:2;
351 uint64_t lfb_dmp:1;
352 uint64_t reserved_5_9:5;
353 uint64_t set:2;
354 uint64_t finv:1;
355 uint64_t l2d:1;
356 uint64_t l2t:1;
357 } cn30xx;
358 struct cvmx_l2c_dbg_cn31xx {
359 uint64_t reserved_14_63:50;
360 uint64_t lfb_enum:3;
361 uint64_t lfb_dmp:1;
362 uint64_t reserved_7_9:3;
363 uint64_t ppnum:1;
364 uint64_t reserved_5_5:1;
365 uint64_t set:2;
366 uint64_t finv:1;
367 uint64_t l2d:1;
368 uint64_t l2t:1;
369 } cn31xx;
370 struct cvmx_l2c_dbg_s cn38xx;
371 struct cvmx_l2c_dbg_s cn38xxp2;
372 struct cvmx_l2c_dbg_cn50xx {
373 uint64_t reserved_14_63:50;
374 uint64_t lfb_enum:3;
375 uint64_t lfb_dmp:1;
376 uint64_t reserved_7_9:3;
377 uint64_t ppnum:1;
378 uint64_t set:3;
379 uint64_t finv:1;
380 uint64_t l2d:1;
381 uint64_t l2t:1;
382 } cn50xx;
383 struct cvmx_l2c_dbg_cn52xx {
384 uint64_t reserved_14_63:50;
385 uint64_t lfb_enum:3;
386 uint64_t lfb_dmp:1;
387 uint64_t reserved_8_9:2;
388 uint64_t ppnum:2;
389 uint64_t set:3;
390 uint64_t finv:1;
391 uint64_t l2d:1;
392 uint64_t l2t:1;
393 } cn52xx;
394 struct cvmx_l2c_dbg_cn52xx cn52xxp1;
395 struct cvmx_l2c_dbg_s cn56xx;
396 struct cvmx_l2c_dbg_s cn56xxp1;
397 struct cvmx_l2c_dbg_s cn58xx;
398 struct cvmx_l2c_dbg_s cn58xxp1;
399};
400
401union cvmx_l2c_dut {
402 uint64_t u64;
403 struct cvmx_l2c_dut_s {
404 uint64_t reserved_32_63:32;
405 uint64_t dtena:1;
406 uint64_t reserved_30_30:1;
407 uint64_t dt_vld:1;
408 uint64_t dt_tag:29;
409 } s;
410 struct cvmx_l2c_dut_s cn30xx;
411 struct cvmx_l2c_dut_s cn31xx;
412 struct cvmx_l2c_dut_s cn38xx;
413 struct cvmx_l2c_dut_s cn38xxp2;
414 struct cvmx_l2c_dut_s cn50xx;
415 struct cvmx_l2c_dut_s cn52xx;
416 struct cvmx_l2c_dut_s cn52xxp1;
417 struct cvmx_l2c_dut_s cn56xx;
418 struct cvmx_l2c_dut_s cn56xxp1;
419 struct cvmx_l2c_dut_s cn58xx;
420 struct cvmx_l2c_dut_s cn58xxp1;
421};
422
423union cvmx_l2c_grpwrr0 {
424 uint64_t u64;
425 struct cvmx_l2c_grpwrr0_s {
426 uint64_t plc1rmsk:32;
427 uint64_t plc0rmsk:32;
428 } s;
429 struct cvmx_l2c_grpwrr0_s cn52xx;
430 struct cvmx_l2c_grpwrr0_s cn52xxp1;
431 struct cvmx_l2c_grpwrr0_s cn56xx;
432 struct cvmx_l2c_grpwrr0_s cn56xxp1;
433};
434
435union cvmx_l2c_grpwrr1 {
436 uint64_t u64;
437 struct cvmx_l2c_grpwrr1_s {
438 uint64_t ilcrmsk:32;
439 uint64_t plc2rmsk:32;
440 } s;
441 struct cvmx_l2c_grpwrr1_s cn52xx;
442 struct cvmx_l2c_grpwrr1_s cn52xxp1;
443 struct cvmx_l2c_grpwrr1_s cn56xx;
444 struct cvmx_l2c_grpwrr1_s cn56xxp1;
445};
446
447union cvmx_l2c_int_en {
448 uint64_t u64;
449 struct cvmx_l2c_int_en_s {
450 uint64_t reserved_9_63:55;
451 uint64_t lck2ena:1;
452 uint64_t lckena:1;
453 uint64_t l2ddeden:1;
454 uint64_t l2dsecen:1;
455 uint64_t l2tdeden:1;
456 uint64_t l2tsecen:1;
457 uint64_t oob3en:1;
458 uint64_t oob2en:1;
459 uint64_t oob1en:1;
460 } s;
461 struct cvmx_l2c_int_en_s cn52xx;
462 struct cvmx_l2c_int_en_s cn52xxp1;
463 struct cvmx_l2c_int_en_s cn56xx;
464 struct cvmx_l2c_int_en_s cn56xxp1;
465};
466
467union cvmx_l2c_int_stat {
468 uint64_t u64;
469 struct cvmx_l2c_int_stat_s {
470 uint64_t reserved_9_63:55;
471 uint64_t lck2:1;
472 uint64_t lck:1;
473 uint64_t l2dded:1;
474 uint64_t l2dsec:1;
475 uint64_t l2tded:1;
476 uint64_t l2tsec:1;
477 uint64_t oob3:1;
478 uint64_t oob2:1;
479 uint64_t oob1:1;
480 } s;
481 struct cvmx_l2c_int_stat_s cn52xx;
482 struct cvmx_l2c_int_stat_s cn52xxp1;
483 struct cvmx_l2c_int_stat_s cn56xx;
484 struct cvmx_l2c_int_stat_s cn56xxp1;
485};
486
487union cvmx_l2c_lckbase {
488 uint64_t u64;
489 struct cvmx_l2c_lckbase_s {
490 uint64_t reserved_31_63:33;
491 uint64_t lck_base:27;
492 uint64_t reserved_1_3:3;
493 uint64_t lck_ena:1;
494 } s;
495 struct cvmx_l2c_lckbase_s cn30xx;
496 struct cvmx_l2c_lckbase_s cn31xx;
497 struct cvmx_l2c_lckbase_s cn38xx;
498 struct cvmx_l2c_lckbase_s cn38xxp2;
499 struct cvmx_l2c_lckbase_s cn50xx;
500 struct cvmx_l2c_lckbase_s cn52xx;
501 struct cvmx_l2c_lckbase_s cn52xxp1;
502 struct cvmx_l2c_lckbase_s cn56xx;
503 struct cvmx_l2c_lckbase_s cn56xxp1;
504 struct cvmx_l2c_lckbase_s cn58xx;
505 struct cvmx_l2c_lckbase_s cn58xxp1;
506};
507
508union cvmx_l2c_lckoff {
509 uint64_t u64;
510 struct cvmx_l2c_lckoff_s {
511 uint64_t reserved_10_63:54;
512 uint64_t lck_offset:10;
513 } s;
514 struct cvmx_l2c_lckoff_s cn30xx;
515 struct cvmx_l2c_lckoff_s cn31xx;
516 struct cvmx_l2c_lckoff_s cn38xx;
517 struct cvmx_l2c_lckoff_s cn38xxp2;
518 struct cvmx_l2c_lckoff_s cn50xx;
519 struct cvmx_l2c_lckoff_s cn52xx;
520 struct cvmx_l2c_lckoff_s cn52xxp1;
521 struct cvmx_l2c_lckoff_s cn56xx;
522 struct cvmx_l2c_lckoff_s cn56xxp1;
523 struct cvmx_l2c_lckoff_s cn58xx;
524 struct cvmx_l2c_lckoff_s cn58xxp1;
525};
526
527union cvmx_l2c_lfb0 {
528 uint64_t u64;
529 struct cvmx_l2c_lfb0_s {
530 uint64_t reserved_32_63:32;
531 uint64_t stcpnd:1;
532 uint64_t stpnd:1;
533 uint64_t stinv:1;
534 uint64_t stcfl:1;
535 uint64_t vam:1;
536 uint64_t inxt:4;
537 uint64_t itl:1;
538 uint64_t ihd:1;
539 uint64_t set:3;
540 uint64_t vabnum:4;
541 uint64_t sid:9;
542 uint64_t cmd:4;
543 uint64_t vld:1;
544 } s;
545 struct cvmx_l2c_lfb0_cn30xx {
546 uint64_t reserved_32_63:32;
547 uint64_t stcpnd:1;
548 uint64_t stpnd:1;
549 uint64_t stinv:1;
550 uint64_t stcfl:1;
551 uint64_t vam:1;
552 uint64_t reserved_25_26:2;
553 uint64_t inxt:2;
554 uint64_t itl:1;
555 uint64_t ihd:1;
556 uint64_t reserved_20_20:1;
557 uint64_t set:2;
558 uint64_t reserved_16_17:2;
559 uint64_t vabnum:2;
560 uint64_t sid:9;
561 uint64_t cmd:4;
562 uint64_t vld:1;
563 } cn30xx;
564 struct cvmx_l2c_lfb0_cn31xx {
565 uint64_t reserved_32_63:32;
566 uint64_t stcpnd:1;
567 uint64_t stpnd:1;
568 uint64_t stinv:1;
569 uint64_t stcfl:1;
570 uint64_t vam:1;
571 uint64_t reserved_26_26:1;
572 uint64_t inxt:3;
573 uint64_t itl:1;
574 uint64_t ihd:1;
575 uint64_t reserved_20_20:1;
576 uint64_t set:2;
577 uint64_t reserved_17_17:1;
578 uint64_t vabnum:3;
579 uint64_t sid:9;
580 uint64_t cmd:4;
581 uint64_t vld:1;
582 } cn31xx;
583 struct cvmx_l2c_lfb0_s cn38xx;
584 struct cvmx_l2c_lfb0_s cn38xxp2;
585 struct cvmx_l2c_lfb0_cn50xx {
586 uint64_t reserved_32_63:32;
587 uint64_t stcpnd:1;
588 uint64_t stpnd:1;
589 uint64_t stinv:1;
590 uint64_t stcfl:1;
591 uint64_t vam:1;
592 uint64_t reserved_26_26:1;
593 uint64_t inxt:3;
594 uint64_t itl:1;
595 uint64_t ihd:1;
596 uint64_t set:3;
597 uint64_t reserved_17_17:1;
598 uint64_t vabnum:3;
599 uint64_t sid:9;
600 uint64_t cmd:4;
601 uint64_t vld:1;
602 } cn50xx;
603 struct cvmx_l2c_lfb0_cn50xx cn52xx;
604 struct cvmx_l2c_lfb0_cn50xx cn52xxp1;
605 struct cvmx_l2c_lfb0_s cn56xx;
606 struct cvmx_l2c_lfb0_s cn56xxp1;
607 struct cvmx_l2c_lfb0_s cn58xx;
608 struct cvmx_l2c_lfb0_s cn58xxp1;
609};
610
611union cvmx_l2c_lfb1 {
612 uint64_t u64;
613 struct cvmx_l2c_lfb1_s {
614 uint64_t reserved_19_63:45;
615 uint64_t dsgoing:1;
616 uint64_t bid:2;
617 uint64_t wtrsp:1;
618 uint64_t wtdw:1;
619 uint64_t wtdq:1;
620 uint64_t wtwhp:1;
621 uint64_t wtwhf:1;
622 uint64_t wtwrm:1;
623 uint64_t wtstm:1;
624 uint64_t wtrda:1;
625 uint64_t wtstdt:1;
626 uint64_t wtstrsp:1;
627 uint64_t wtstrsc:1;
628 uint64_t wtvtm:1;
629 uint64_t wtmfl:1;
630 uint64_t prbrty:1;
631 uint64_t wtprb:1;
632 uint64_t vld:1;
633 } s;
634 struct cvmx_l2c_lfb1_s cn30xx;
635 struct cvmx_l2c_lfb1_s cn31xx;
636 struct cvmx_l2c_lfb1_s cn38xx;
637 struct cvmx_l2c_lfb1_s cn38xxp2;
638 struct cvmx_l2c_lfb1_s cn50xx;
639 struct cvmx_l2c_lfb1_s cn52xx;
640 struct cvmx_l2c_lfb1_s cn52xxp1;
641 struct cvmx_l2c_lfb1_s cn56xx;
642 struct cvmx_l2c_lfb1_s cn56xxp1;
643 struct cvmx_l2c_lfb1_s cn58xx;
644 struct cvmx_l2c_lfb1_s cn58xxp1;
645};
646
647union cvmx_l2c_lfb2 {
648 uint64_t u64;
649 struct cvmx_l2c_lfb2_s {
650 uint64_t reserved_0_63:64;
651 } s;
652 struct cvmx_l2c_lfb2_cn30xx {
653 uint64_t reserved_27_63:37;
654 uint64_t lfb_tag:19;
655 uint64_t lfb_idx:8;
656 } cn30xx;
657 struct cvmx_l2c_lfb2_cn31xx {
658 uint64_t reserved_27_63:37;
659 uint64_t lfb_tag:17;
660 uint64_t lfb_idx:10;
661 } cn31xx;
662 struct cvmx_l2c_lfb2_cn31xx cn38xx;
663 struct cvmx_l2c_lfb2_cn31xx cn38xxp2;
664 struct cvmx_l2c_lfb2_cn50xx {
665 uint64_t reserved_27_63:37;
666 uint64_t lfb_tag:20;
667 uint64_t lfb_idx:7;
668 } cn50xx;
669 struct cvmx_l2c_lfb2_cn52xx {
670 uint64_t reserved_27_63:37;
671 uint64_t lfb_tag:18;
672 uint64_t lfb_idx:9;
673 } cn52xx;
674 struct cvmx_l2c_lfb2_cn52xx cn52xxp1;
675 struct cvmx_l2c_lfb2_cn56xx {
676 uint64_t reserved_27_63:37;
677 uint64_t lfb_tag:16;
678 uint64_t lfb_idx:11;
679 } cn56xx;
680 struct cvmx_l2c_lfb2_cn56xx cn56xxp1;
681 struct cvmx_l2c_lfb2_cn56xx cn58xx;
682 struct cvmx_l2c_lfb2_cn56xx cn58xxp1;
683};
684
685union cvmx_l2c_lfb3 {
686 uint64_t u64;
687 struct cvmx_l2c_lfb3_s {
688 uint64_t reserved_5_63:59;
689 uint64_t stpartdis:1;
690 uint64_t lfb_hwm:4;
691 } s;
692 struct cvmx_l2c_lfb3_cn30xx {
693 uint64_t reserved_5_63:59;
694 uint64_t stpartdis:1;
695 uint64_t reserved_2_3:2;
696 uint64_t lfb_hwm:2;
697 } cn30xx;
698 struct cvmx_l2c_lfb3_cn31xx {
699 uint64_t reserved_5_63:59;
700 uint64_t stpartdis:1;
701 uint64_t reserved_3_3:1;
702 uint64_t lfb_hwm:3;
703 } cn31xx;
704 struct cvmx_l2c_lfb3_s cn38xx;
705 struct cvmx_l2c_lfb3_s cn38xxp2;
706 struct cvmx_l2c_lfb3_cn31xx cn50xx;
707 struct cvmx_l2c_lfb3_cn31xx cn52xx;
708 struct cvmx_l2c_lfb3_cn31xx cn52xxp1;
709 struct cvmx_l2c_lfb3_s cn56xx;
710 struct cvmx_l2c_lfb3_s cn56xxp1;
711 struct cvmx_l2c_lfb3_s cn58xx;
712 struct cvmx_l2c_lfb3_s cn58xxp1;
713};
714
715union cvmx_l2c_oob {
716 uint64_t u64;
717 struct cvmx_l2c_oob_s {
718 uint64_t reserved_2_63:62;
719 uint64_t dwbena:1;
720 uint64_t stena:1;
721 } s;
722 struct cvmx_l2c_oob_s cn52xx;
723 struct cvmx_l2c_oob_s cn52xxp1;
724 struct cvmx_l2c_oob_s cn56xx;
725 struct cvmx_l2c_oob_s cn56xxp1;
726};
727
728union cvmx_l2c_oob1 {
729 uint64_t u64;
730 struct cvmx_l2c_oob1_s {
731 uint64_t fadr:27;
732 uint64_t fsrc:1;
733 uint64_t reserved_34_35:2;
734 uint64_t sadr:14;
735 uint64_t reserved_14_19:6;
736 uint64_t size:14;
737 } s;
738 struct cvmx_l2c_oob1_s cn52xx;
739 struct cvmx_l2c_oob1_s cn52xxp1;
740 struct cvmx_l2c_oob1_s cn56xx;
741 struct cvmx_l2c_oob1_s cn56xxp1;
742};
743
744union cvmx_l2c_oob2 {
745 uint64_t u64;
746 struct cvmx_l2c_oob2_s {
747 uint64_t fadr:27;
748 uint64_t fsrc:1;
749 uint64_t reserved_34_35:2;
750 uint64_t sadr:14;
751 uint64_t reserved_14_19:6;
752 uint64_t size:14;
753 } s;
754 struct cvmx_l2c_oob2_s cn52xx;
755 struct cvmx_l2c_oob2_s cn52xxp1;
756 struct cvmx_l2c_oob2_s cn56xx;
757 struct cvmx_l2c_oob2_s cn56xxp1;
758};
759
760union cvmx_l2c_oob3 {
761 uint64_t u64;
762 struct cvmx_l2c_oob3_s {
763 uint64_t fadr:27;
764 uint64_t fsrc:1;
765 uint64_t reserved_34_35:2;
766 uint64_t sadr:14;
767 uint64_t reserved_14_19:6;
768 uint64_t size:14;
769 } s;
770 struct cvmx_l2c_oob3_s cn52xx;
771 struct cvmx_l2c_oob3_s cn52xxp1;
772 struct cvmx_l2c_oob3_s cn56xx;
773 struct cvmx_l2c_oob3_s cn56xxp1;
774};
775
776union cvmx_l2c_pfcx {
777 uint64_t u64;
778 struct cvmx_l2c_pfcx_s {
779 uint64_t reserved_36_63:28;
780 uint64_t pfcnt0:36;
781 } s;
782 struct cvmx_l2c_pfcx_s cn30xx;
783 struct cvmx_l2c_pfcx_s cn31xx;
784 struct cvmx_l2c_pfcx_s cn38xx;
785 struct cvmx_l2c_pfcx_s cn38xxp2;
786 struct cvmx_l2c_pfcx_s cn50xx;
787 struct cvmx_l2c_pfcx_s cn52xx;
788 struct cvmx_l2c_pfcx_s cn52xxp1;
789 struct cvmx_l2c_pfcx_s cn56xx;
790 struct cvmx_l2c_pfcx_s cn56xxp1;
791 struct cvmx_l2c_pfcx_s cn58xx;
792 struct cvmx_l2c_pfcx_s cn58xxp1;
793};
794
795union cvmx_l2c_pfctl {
796 uint64_t u64;
797 struct cvmx_l2c_pfctl_s {
798 uint64_t reserved_36_63:28;
799 uint64_t cnt3rdclr:1;
800 uint64_t cnt2rdclr:1;
801 uint64_t cnt1rdclr:1;
802 uint64_t cnt0rdclr:1;
803 uint64_t cnt3ena:1;
804 uint64_t cnt3clr:1;
805 uint64_t cnt3sel:6;
806 uint64_t cnt2ena:1;
807 uint64_t cnt2clr:1;
808 uint64_t cnt2sel:6;
809 uint64_t cnt1ena:1;
810 uint64_t cnt1clr:1;
811 uint64_t cnt1sel:6;
812 uint64_t cnt0ena:1;
813 uint64_t cnt0clr:1;
814 uint64_t cnt0sel:6;
815 } s;
816 struct cvmx_l2c_pfctl_s cn30xx;
817 struct cvmx_l2c_pfctl_s cn31xx;
818 struct cvmx_l2c_pfctl_s cn38xx;
819 struct cvmx_l2c_pfctl_s cn38xxp2;
820 struct cvmx_l2c_pfctl_s cn50xx;
821 struct cvmx_l2c_pfctl_s cn52xx;
822 struct cvmx_l2c_pfctl_s cn52xxp1;
823 struct cvmx_l2c_pfctl_s cn56xx;
824 struct cvmx_l2c_pfctl_s cn56xxp1;
825 struct cvmx_l2c_pfctl_s cn58xx;
826 struct cvmx_l2c_pfctl_s cn58xxp1;
827};
828
829union cvmx_l2c_ppgrp {
830 uint64_t u64;
831 struct cvmx_l2c_ppgrp_s {
832 uint64_t reserved_24_63:40;
833 uint64_t pp11grp:2;
834 uint64_t pp10grp:2;
835 uint64_t pp9grp:2;
836 uint64_t pp8grp:2;
837 uint64_t pp7grp:2;
838 uint64_t pp6grp:2;
839 uint64_t pp5grp:2;
840 uint64_t pp4grp:2;
841 uint64_t pp3grp:2;
842 uint64_t pp2grp:2;
843 uint64_t pp1grp:2;
844 uint64_t pp0grp:2;
845 } s;
846 struct cvmx_l2c_ppgrp_cn52xx {
847 uint64_t reserved_8_63:56;
848 uint64_t pp3grp:2;
849 uint64_t pp2grp:2;
850 uint64_t pp1grp:2;
851 uint64_t pp0grp:2;
852 } cn52xx;
853 struct cvmx_l2c_ppgrp_cn52xx cn52xxp1;
854 struct cvmx_l2c_ppgrp_s cn56xx;
855 struct cvmx_l2c_ppgrp_s cn56xxp1;
856};
857
858union cvmx_l2c_spar0 {
859 uint64_t u64;
860 struct cvmx_l2c_spar0_s {
861 uint64_t reserved_32_63:32;
862 uint64_t umsk3:8;
863 uint64_t umsk2:8;
864 uint64_t umsk1:8;
865 uint64_t umsk0:8;
866 } s;
867 struct cvmx_l2c_spar0_cn30xx {
868 uint64_t reserved_4_63:60;
869 uint64_t umsk0:4;
870 } cn30xx;
871 struct cvmx_l2c_spar0_cn31xx {
872 uint64_t reserved_12_63:52;
873 uint64_t umsk1:4;
874 uint64_t reserved_4_7:4;
875 uint64_t umsk0:4;
876 } cn31xx;
877 struct cvmx_l2c_spar0_s cn38xx;
878 struct cvmx_l2c_spar0_s cn38xxp2;
879 struct cvmx_l2c_spar0_cn50xx {
880 uint64_t reserved_16_63:48;
881 uint64_t umsk1:8;
882 uint64_t umsk0:8;
883 } cn50xx;
884 struct cvmx_l2c_spar0_s cn52xx;
885 struct cvmx_l2c_spar0_s cn52xxp1;
886 struct cvmx_l2c_spar0_s cn56xx;
887 struct cvmx_l2c_spar0_s cn56xxp1;
888 struct cvmx_l2c_spar0_s cn58xx;
889 struct cvmx_l2c_spar0_s cn58xxp1;
890};
891
892union cvmx_l2c_spar1 {
893 uint64_t u64;
894 struct cvmx_l2c_spar1_s {
895 uint64_t reserved_32_63:32;
896 uint64_t umsk7:8;
897 uint64_t umsk6:8;
898 uint64_t umsk5:8;
899 uint64_t umsk4:8;
900 } s;
901 struct cvmx_l2c_spar1_s cn38xx;
902 struct cvmx_l2c_spar1_s cn38xxp2;
903 struct cvmx_l2c_spar1_s cn56xx;
904 struct cvmx_l2c_spar1_s cn56xxp1;
905 struct cvmx_l2c_spar1_s cn58xx;
906 struct cvmx_l2c_spar1_s cn58xxp1;
907};
908
909union cvmx_l2c_spar2 {
910 uint64_t u64;
911 struct cvmx_l2c_spar2_s {
912 uint64_t reserved_32_63:32;
913 uint64_t umsk11:8;
914 uint64_t umsk10:8;
915 uint64_t umsk9:8;
916 uint64_t umsk8:8;
917 } s;
918 struct cvmx_l2c_spar2_s cn38xx;
919 struct cvmx_l2c_spar2_s cn38xxp2;
920 struct cvmx_l2c_spar2_s cn56xx;
921 struct cvmx_l2c_spar2_s cn56xxp1;
922 struct cvmx_l2c_spar2_s cn58xx;
923 struct cvmx_l2c_spar2_s cn58xxp1;
924};
925
926union cvmx_l2c_spar3 {
927 uint64_t u64;
928 struct cvmx_l2c_spar3_s {
929 uint64_t reserved_32_63:32;
930 uint64_t umsk15:8;
931 uint64_t umsk14:8;
932 uint64_t umsk13:8;
933 uint64_t umsk12:8;
934 } s;
935 struct cvmx_l2c_spar3_s cn38xx;
936 struct cvmx_l2c_spar3_s cn38xxp2;
937 struct cvmx_l2c_spar3_s cn58xx;
938 struct cvmx_l2c_spar3_s cn58xxp1;
939};
940
941union cvmx_l2c_spar4 {
942 uint64_t u64;
943 struct cvmx_l2c_spar4_s {
944 uint64_t reserved_8_63:56;
945 uint64_t umskiob:8;
946 } s;
947 struct cvmx_l2c_spar4_cn30xx {
948 uint64_t reserved_4_63:60;
949 uint64_t umskiob:4;
950 } cn30xx;
951 struct cvmx_l2c_spar4_cn30xx cn31xx;
952 struct cvmx_l2c_spar4_s cn38xx;
953 struct cvmx_l2c_spar4_s cn38xxp2;
954 struct cvmx_l2c_spar4_s cn50xx;
955 struct cvmx_l2c_spar4_s cn52xx;
956 struct cvmx_l2c_spar4_s cn52xxp1;
957 struct cvmx_l2c_spar4_s cn56xx;
958 struct cvmx_l2c_spar4_s cn56xxp1;
959 struct cvmx_l2c_spar4_s cn58xx;
960 struct cvmx_l2c_spar4_s cn58xxp1;
961};
962
963#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-l2c.h b/arch/mips/include/asm/octeon/cvmx-l2c.h
new file mode 100644
index 000000000000..2a8c0902ea50
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-l2c.h
@@ -0,0 +1,325 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 *
30 * Interface to the Level 2 Cache (L2C) control, measurement, and debugging
31 * facilities.
32 */
33
34#ifndef __CVMX_L2C_H__
35#define __CVMX_L2C_H__
36
37/* Deprecated macro, use function */
38#define CVMX_L2_ASSOC cvmx_l2c_get_num_assoc()
39
40/* Deprecated macro, use function */
41#define CVMX_L2_SET_BITS cvmx_l2c_get_set_bits()
42
43/* Deprecated macro, use function */
44#define CVMX_L2_SETS cvmx_l2c_get_num_sets()
45
46#define CVMX_L2C_IDX_ADDR_SHIFT 7 /* based on 128 byte cache line size */
47#define CVMX_L2C_IDX_MASK (cvmx_l2c_get_num_sets() - 1)
48
49/* Defines for index aliasing computations */
50#define CVMX_L2C_TAG_ADDR_ALIAS_SHIFT \
51 (CVMX_L2C_IDX_ADDR_SHIFT + cvmx_l2c_get_set_bits())
52
53#define CVMX_L2C_ALIAS_MASK \
54 (CVMX_L2C_IDX_MASK << CVMX_L2C_TAG_ADDR_ALIAS_SHIFT)
55
56union cvmx_l2c_tag {
57 uint64_t u64;
58 struct {
59 uint64_t reserved:28;
60 uint64_t V:1; /* Line valid */
61 uint64_t D:1; /* Line dirty */
62 uint64_t L:1; /* Line locked */
63 uint64_t U:1; /* Use, LRU eviction */
64 uint64_t addr:32; /* Phys mem (not all bits valid) */
65 } s;
66};
67
68 /* L2C Performance Counter events. */
69enum cvmx_l2c_event {
70 CVMX_L2C_EVENT_CYCLES = 0,
71 CVMX_L2C_EVENT_INSTRUCTION_MISS = 1,
72 CVMX_L2C_EVENT_INSTRUCTION_HIT = 2,
73 CVMX_L2C_EVENT_DATA_MISS = 3,
74 CVMX_L2C_EVENT_DATA_HIT = 4,
75 CVMX_L2C_EVENT_MISS = 5,
76 CVMX_L2C_EVENT_HIT = 6,
77 CVMX_L2C_EVENT_VICTIM_HIT = 7,
78 CVMX_L2C_EVENT_INDEX_CONFLICT = 8,
79 CVMX_L2C_EVENT_TAG_PROBE = 9,
80 CVMX_L2C_EVENT_TAG_UPDATE = 10,
81 CVMX_L2C_EVENT_TAG_COMPLETE = 11,
82 CVMX_L2C_EVENT_TAG_DIRTY = 12,
83 CVMX_L2C_EVENT_DATA_STORE_NOP = 13,
84 CVMX_L2C_EVENT_DATA_STORE_READ = 14,
85 CVMX_L2C_EVENT_DATA_STORE_WRITE = 15,
86 CVMX_L2C_EVENT_FILL_DATA_VALID = 16,
87 CVMX_L2C_EVENT_WRITE_REQUEST = 17,
88 CVMX_L2C_EVENT_READ_REQUEST = 18,
89 CVMX_L2C_EVENT_WRITE_DATA_VALID = 19,
90 CVMX_L2C_EVENT_XMC_NOP = 20,
91 CVMX_L2C_EVENT_XMC_LDT = 21,
92 CVMX_L2C_EVENT_XMC_LDI = 22,
93 CVMX_L2C_EVENT_XMC_LDD = 23,
94 CVMX_L2C_EVENT_XMC_STF = 24,
95 CVMX_L2C_EVENT_XMC_STT = 25,
96 CVMX_L2C_EVENT_XMC_STP = 26,
97 CVMX_L2C_EVENT_XMC_STC = 27,
98 CVMX_L2C_EVENT_XMC_DWB = 28,
99 CVMX_L2C_EVENT_XMC_PL2 = 29,
100 CVMX_L2C_EVENT_XMC_PSL1 = 30,
101 CVMX_L2C_EVENT_XMC_IOBLD = 31,
102 CVMX_L2C_EVENT_XMC_IOBST = 32,
103 CVMX_L2C_EVENT_XMC_IOBDMA = 33,
104 CVMX_L2C_EVENT_XMC_IOBRSP = 34,
105 CVMX_L2C_EVENT_XMC_BUS_VALID = 35,
106 CVMX_L2C_EVENT_XMC_MEM_DATA = 36,
107 CVMX_L2C_EVENT_XMC_REFL_DATA = 37,
108 CVMX_L2C_EVENT_XMC_IOBRSP_DATA = 38,
109 CVMX_L2C_EVENT_RSC_NOP = 39,
110 CVMX_L2C_EVENT_RSC_STDN = 40,
111 CVMX_L2C_EVENT_RSC_FILL = 41,
112 CVMX_L2C_EVENT_RSC_REFL = 42,
113 CVMX_L2C_EVENT_RSC_STIN = 43,
114 CVMX_L2C_EVENT_RSC_SCIN = 44,
115 CVMX_L2C_EVENT_RSC_SCFL = 45,
116 CVMX_L2C_EVENT_RSC_SCDN = 46,
117 CVMX_L2C_EVENT_RSC_DATA_VALID = 47,
118 CVMX_L2C_EVENT_RSC_VALID_FILL = 48,
119 CVMX_L2C_EVENT_RSC_VALID_STRSP = 49,
120 CVMX_L2C_EVENT_RSC_VALID_REFL = 50,
121 CVMX_L2C_EVENT_LRF_REQ = 51,
122 CVMX_L2C_EVENT_DT_RD_ALLOC = 52,
123 CVMX_L2C_EVENT_DT_WR_INVAL = 53
124};
125
126/**
127 * Configure one of the four L2 Cache performance counters to capture event
128 * occurences.
129 *
130 * @counter: The counter to configure. Range 0..3.
131 * @event: The type of L2 Cache event occurrence to count.
132 * @clear_on_read: When asserted, any read of the performance counter
133 * clears the counter.
134 *
135 * The routine does not clear the counter.
136 */
137void cvmx_l2c_config_perf(uint32_t counter,
138 enum cvmx_l2c_event event, uint32_t clear_on_read);
139/**
140 * Read the given L2 Cache performance counter. The counter must be configured
141 * before reading, but this routine does not enforce this requirement.
142 *
143 * @counter: The counter to configure. Range 0..3.
144 *
145 * Returns The current counter value.
146 */
147uint64_t cvmx_l2c_read_perf(uint32_t counter);
148
149/**
150 * Return the L2 Cache way partitioning for a given core.
151 *
152 * @core: The core processor of interest.
153 *
154 * Returns The mask specifying the partitioning. 0 bits in mask indicates
155 * the cache 'ways' that a core can evict from.
156 * -1 on error
157 */
158int cvmx_l2c_get_core_way_partition(uint32_t core);
159
160/**
161 * Partitions the L2 cache for a core
162 *
163 * @core: The core that the partitioning applies to.
164 *
165 * @mask: The partitioning of the ways expressed as a binary mask. A 0
166 * bit allows the core to evict cache lines from a way, while a
167 * 1 bit blocks the core from evicting any lines from that
168 * way. There must be at least one allowed way (0 bit) in the
169 * mask.
170 *
171 * If any ways are blocked for all cores and the HW blocks, then those
172 * ways will never have any cache lines evicted from them. All cores
173 * and the hardware blocks are free to read from all ways regardless
174 * of the partitioning.
175 */
176int cvmx_l2c_set_core_way_partition(uint32_t core, uint32_t mask);
177
178/**
179 * Return the L2 Cache way partitioning for the hw blocks.
180 *
181 * Returns The mask specifying the reserved way. 0 bits in mask indicates
182 * the cache 'ways' that a core can evict from.
183 * -1 on error
184 */
185int cvmx_l2c_get_hw_way_partition(void);
186
187/**
188 * Partitions the L2 cache for the hardware blocks.
189 *
190 * @mask: The partitioning of the ways expressed as a binary mask. A 0
191 * bit allows the core to evict cache lines from a way, while a
192 * 1 bit blocks the core from evicting any lines from that
193 * way. There must be at least one allowed way (0 bit) in the
194 * mask.
195 *
196 * If any ways are blocked for all cores and the HW blocks, then those
197 * ways will never have any cache lines evicted from them. All cores
198 * and the hardware blocks are free to read from all ways regardless
199 * of the partitioning.
200 */
201int cvmx_l2c_set_hw_way_partition(uint32_t mask);
202
203/**
204 * Locks a line in the L2 cache at the specified physical address
205 *
206 * @addr: physical address of line to lock
207 *
208 * Returns 0 on success,
209 * 1 if line not locked.
210 */
211int cvmx_l2c_lock_line(uint64_t addr);
212
213/**
214 * Locks a specified memory region in the L2 cache.
215 *
216 * Note that if not all lines can be locked, that means that all
217 * but one of the ways (associations) available to the locking
218 * core are locked. Having only 1 association available for
219 * normal caching may have a significant adverse affect on performance.
220 * Care should be taken to ensure that enough of the L2 cache is left
221 * unlocked to allow for normal caching of DRAM.
222 *
223 * @start: Physical address of the start of the region to lock
224 * @len: Length (in bytes) of region to lock
225 *
226 * Returns Number of requested lines that where not locked.
227 * 0 on success (all locked)
228 */
229int cvmx_l2c_lock_mem_region(uint64_t start, uint64_t len);
230
231/**
232 * Unlock and flush a cache line from the L2 cache.
233 * IMPORTANT: Must only be run by one core at a time due to use
234 * of L2C debug features.
235 * Note that this function will flush a matching but unlocked cache line.
236 * (If address is not in L2, no lines are flushed.)
237 *
238 * @address: Physical address to unlock
239 *
240 * Returns 0: line not unlocked
241 * 1: line unlocked
242 */
243int cvmx_l2c_unlock_line(uint64_t address);
244
245/**
246 * Unlocks a region of memory that is locked in the L2 cache
247 *
248 * @start: start physical address
249 * @len: length (in bytes) to unlock
250 *
251 * Returns Number of locked lines that the call unlocked
252 */
253int cvmx_l2c_unlock_mem_region(uint64_t start, uint64_t len);
254
255/**
256 * Read the L2 controller tag for a given location in L2
257 *
258 * @association:
259 * Which association to read line from
260 * @index: Which way to read from.
261 *
262 * Returns l2c tag structure for line requested.
263 */
264union cvmx_l2c_tag cvmx_l2c_get_tag(uint32_t association, uint32_t index);
265
266/* Wrapper around deprecated old function name */
267static inline union cvmx_l2c_tag cvmx_get_l2c_tag(uint32_t association,
268 uint32_t index)
269{
270 return cvmx_l2c_get_tag(association, index);
271}
272
273/**
274 * Returns the cache index for a given physical address
275 *
276 * @addr: physical address
277 *
278 * Returns L2 cache index
279 */
280uint32_t cvmx_l2c_address_to_index(uint64_t addr);
281
282/**
283 * Flushes (and unlocks) the entire L2 cache.
284 * IMPORTANT: Must only be run by one core at a time due to use
285 * of L2C debug features.
286 */
287void cvmx_l2c_flush(void);
288
289/**
290 *
291 * Returns Returns the size of the L2 cache in bytes,
292 * -1 on error (unrecognized model)
293 */
294int cvmx_l2c_get_cache_size_bytes(void);
295
296/**
297 * Return the number of sets in the L2 Cache
298 *
299 * Returns
300 */
301int cvmx_l2c_get_num_sets(void);
302
303/**
304 * Return log base 2 of the number of sets in the L2 cache
305 * Returns
306 */
307int cvmx_l2c_get_set_bits(void);
308/**
309 * Return the number of associations in the L2 Cache
310 *
311 * Returns
312 */
313int cvmx_l2c_get_num_assoc(void);
314
315/**
316 * Flush a line from the L2 cache
317 * This should only be called from one core at a time, as this routine
318 * sets the core to the 'debug' core in order to flush the line.
319 *
320 * @assoc: Association (or way) to flush
321 * @index: Index to flush
322 */
323void cvmx_l2c_flush_line(uint32_t assoc, uint32_t index);
324
325#endif /* __CVMX_L2C_H__ */
diff --git a/arch/mips/include/asm/octeon/cvmx-l2d-defs.h b/arch/mips/include/asm/octeon/cvmx-l2d-defs.h
new file mode 100644
index 000000000000..d7102d455e1b
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-l2d-defs.h
@@ -0,0 +1,369 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_L2D_DEFS_H__
29#define __CVMX_L2D_DEFS_H__
30
31#define CVMX_L2D_BST0 \
32 CVMX_ADD_IO_SEG(0x0001180080000780ull)
33#define CVMX_L2D_BST1 \
34 CVMX_ADD_IO_SEG(0x0001180080000788ull)
35#define CVMX_L2D_BST2 \
36 CVMX_ADD_IO_SEG(0x0001180080000790ull)
37#define CVMX_L2D_BST3 \
38 CVMX_ADD_IO_SEG(0x0001180080000798ull)
39#define CVMX_L2D_ERR \
40 CVMX_ADD_IO_SEG(0x0001180080000010ull)
41#define CVMX_L2D_FADR \
42 CVMX_ADD_IO_SEG(0x0001180080000018ull)
43#define CVMX_L2D_FSYN0 \
44 CVMX_ADD_IO_SEG(0x0001180080000020ull)
45#define CVMX_L2D_FSYN1 \
46 CVMX_ADD_IO_SEG(0x0001180080000028ull)
47#define CVMX_L2D_FUS0 \
48 CVMX_ADD_IO_SEG(0x00011800800007A0ull)
49#define CVMX_L2D_FUS1 \
50 CVMX_ADD_IO_SEG(0x00011800800007A8ull)
51#define CVMX_L2D_FUS2 \
52 CVMX_ADD_IO_SEG(0x00011800800007B0ull)
53#define CVMX_L2D_FUS3 \
54 CVMX_ADD_IO_SEG(0x00011800800007B8ull)
55
56union cvmx_l2d_bst0 {
57 uint64_t u64;
58 struct cvmx_l2d_bst0_s {
59 uint64_t reserved_35_63:29;
60 uint64_t ftl:1;
61 uint64_t q0stat:34;
62 } s;
63 struct cvmx_l2d_bst0_s cn30xx;
64 struct cvmx_l2d_bst0_s cn31xx;
65 struct cvmx_l2d_bst0_s cn38xx;
66 struct cvmx_l2d_bst0_s cn38xxp2;
67 struct cvmx_l2d_bst0_s cn50xx;
68 struct cvmx_l2d_bst0_s cn52xx;
69 struct cvmx_l2d_bst0_s cn52xxp1;
70 struct cvmx_l2d_bst0_s cn56xx;
71 struct cvmx_l2d_bst0_s cn56xxp1;
72 struct cvmx_l2d_bst0_s cn58xx;
73 struct cvmx_l2d_bst0_s cn58xxp1;
74};
75
76union cvmx_l2d_bst1 {
77 uint64_t u64;
78 struct cvmx_l2d_bst1_s {
79 uint64_t reserved_34_63:30;
80 uint64_t q1stat:34;
81 } s;
82 struct cvmx_l2d_bst1_s cn30xx;
83 struct cvmx_l2d_bst1_s cn31xx;
84 struct cvmx_l2d_bst1_s cn38xx;
85 struct cvmx_l2d_bst1_s cn38xxp2;
86 struct cvmx_l2d_bst1_s cn50xx;
87 struct cvmx_l2d_bst1_s cn52xx;
88 struct cvmx_l2d_bst1_s cn52xxp1;
89 struct cvmx_l2d_bst1_s cn56xx;
90 struct cvmx_l2d_bst1_s cn56xxp1;
91 struct cvmx_l2d_bst1_s cn58xx;
92 struct cvmx_l2d_bst1_s cn58xxp1;
93};
94
95union cvmx_l2d_bst2 {
96 uint64_t u64;
97 struct cvmx_l2d_bst2_s {
98 uint64_t reserved_34_63:30;
99 uint64_t q2stat:34;
100 } s;
101 struct cvmx_l2d_bst2_s cn30xx;
102 struct cvmx_l2d_bst2_s cn31xx;
103 struct cvmx_l2d_bst2_s cn38xx;
104 struct cvmx_l2d_bst2_s cn38xxp2;
105 struct cvmx_l2d_bst2_s cn50xx;
106 struct cvmx_l2d_bst2_s cn52xx;
107 struct cvmx_l2d_bst2_s cn52xxp1;
108 struct cvmx_l2d_bst2_s cn56xx;
109 struct cvmx_l2d_bst2_s cn56xxp1;
110 struct cvmx_l2d_bst2_s cn58xx;
111 struct cvmx_l2d_bst2_s cn58xxp1;
112};
113
114union cvmx_l2d_bst3 {
115 uint64_t u64;
116 struct cvmx_l2d_bst3_s {
117 uint64_t reserved_34_63:30;
118 uint64_t q3stat:34;
119 } s;
120 struct cvmx_l2d_bst3_s cn30xx;
121 struct cvmx_l2d_bst3_s cn31xx;
122 struct cvmx_l2d_bst3_s cn38xx;
123 struct cvmx_l2d_bst3_s cn38xxp2;
124 struct cvmx_l2d_bst3_s cn50xx;
125 struct cvmx_l2d_bst3_s cn52xx;
126 struct cvmx_l2d_bst3_s cn52xxp1;
127 struct cvmx_l2d_bst3_s cn56xx;
128 struct cvmx_l2d_bst3_s cn56xxp1;
129 struct cvmx_l2d_bst3_s cn58xx;
130 struct cvmx_l2d_bst3_s cn58xxp1;
131};
132
133union cvmx_l2d_err {
134 uint64_t u64;
135 struct cvmx_l2d_err_s {
136 uint64_t reserved_6_63:58;
137 uint64_t bmhclsel:1;
138 uint64_t ded_err:1;
139 uint64_t sec_err:1;
140 uint64_t ded_intena:1;
141 uint64_t sec_intena:1;
142 uint64_t ecc_ena:1;
143 } s;
144 struct cvmx_l2d_err_s cn30xx;
145 struct cvmx_l2d_err_s cn31xx;
146 struct cvmx_l2d_err_s cn38xx;
147 struct cvmx_l2d_err_s cn38xxp2;
148 struct cvmx_l2d_err_s cn50xx;
149 struct cvmx_l2d_err_s cn52xx;
150 struct cvmx_l2d_err_s cn52xxp1;
151 struct cvmx_l2d_err_s cn56xx;
152 struct cvmx_l2d_err_s cn56xxp1;
153 struct cvmx_l2d_err_s cn58xx;
154 struct cvmx_l2d_err_s cn58xxp1;
155};
156
157union cvmx_l2d_fadr {
158 uint64_t u64;
159 struct cvmx_l2d_fadr_s {
160 uint64_t reserved_19_63:45;
161 uint64_t fadru:1;
162 uint64_t fowmsk:4;
163 uint64_t fset:3;
164 uint64_t fadr:11;
165 } s;
166 struct cvmx_l2d_fadr_cn30xx {
167 uint64_t reserved_18_63:46;
168 uint64_t fowmsk:4;
169 uint64_t reserved_13_13:1;
170 uint64_t fset:2;
171 uint64_t reserved_9_10:2;
172 uint64_t fadr:9;
173 } cn30xx;
174 struct cvmx_l2d_fadr_cn31xx {
175 uint64_t reserved_18_63:46;
176 uint64_t fowmsk:4;
177 uint64_t reserved_13_13:1;
178 uint64_t fset:2;
179 uint64_t reserved_10_10:1;
180 uint64_t fadr:10;
181 } cn31xx;
182 struct cvmx_l2d_fadr_cn38xx {
183 uint64_t reserved_18_63:46;
184 uint64_t fowmsk:4;
185 uint64_t fset:3;
186 uint64_t fadr:11;
187 } cn38xx;
188 struct cvmx_l2d_fadr_cn38xx cn38xxp2;
189 struct cvmx_l2d_fadr_cn50xx {
190 uint64_t reserved_18_63:46;
191 uint64_t fowmsk:4;
192 uint64_t fset:3;
193 uint64_t reserved_8_10:3;
194 uint64_t fadr:8;
195 } cn50xx;
196 struct cvmx_l2d_fadr_cn52xx {
197 uint64_t reserved_18_63:46;
198 uint64_t fowmsk:4;
199 uint64_t fset:3;
200 uint64_t reserved_10_10:1;
201 uint64_t fadr:10;
202 } cn52xx;
203 struct cvmx_l2d_fadr_cn52xx cn52xxp1;
204 struct cvmx_l2d_fadr_s cn56xx;
205 struct cvmx_l2d_fadr_s cn56xxp1;
206 struct cvmx_l2d_fadr_s cn58xx;
207 struct cvmx_l2d_fadr_s cn58xxp1;
208};
209
210union cvmx_l2d_fsyn0 {
211 uint64_t u64;
212 struct cvmx_l2d_fsyn0_s {
213 uint64_t reserved_20_63:44;
214 uint64_t fsyn_ow1:10;
215 uint64_t fsyn_ow0:10;
216 } s;
217 struct cvmx_l2d_fsyn0_s cn30xx;
218 struct cvmx_l2d_fsyn0_s cn31xx;
219 struct cvmx_l2d_fsyn0_s cn38xx;
220 struct cvmx_l2d_fsyn0_s cn38xxp2;
221 struct cvmx_l2d_fsyn0_s cn50xx;
222 struct cvmx_l2d_fsyn0_s cn52xx;
223 struct cvmx_l2d_fsyn0_s cn52xxp1;
224 struct cvmx_l2d_fsyn0_s cn56xx;
225 struct cvmx_l2d_fsyn0_s cn56xxp1;
226 struct cvmx_l2d_fsyn0_s cn58xx;
227 struct cvmx_l2d_fsyn0_s cn58xxp1;
228};
229
230union cvmx_l2d_fsyn1 {
231 uint64_t u64;
232 struct cvmx_l2d_fsyn1_s {
233 uint64_t reserved_20_63:44;
234 uint64_t fsyn_ow3:10;
235 uint64_t fsyn_ow2:10;
236 } s;
237 struct cvmx_l2d_fsyn1_s cn30xx;
238 struct cvmx_l2d_fsyn1_s cn31xx;
239 struct cvmx_l2d_fsyn1_s cn38xx;
240 struct cvmx_l2d_fsyn1_s cn38xxp2;
241 struct cvmx_l2d_fsyn1_s cn50xx;
242 struct cvmx_l2d_fsyn1_s cn52xx;
243 struct cvmx_l2d_fsyn1_s cn52xxp1;
244 struct cvmx_l2d_fsyn1_s cn56xx;
245 struct cvmx_l2d_fsyn1_s cn56xxp1;
246 struct cvmx_l2d_fsyn1_s cn58xx;
247 struct cvmx_l2d_fsyn1_s cn58xxp1;
248};
249
250union cvmx_l2d_fus0 {
251 uint64_t u64;
252 struct cvmx_l2d_fus0_s {
253 uint64_t reserved_34_63:30;
254 uint64_t q0fus:34;
255 } s;
256 struct cvmx_l2d_fus0_s cn30xx;
257 struct cvmx_l2d_fus0_s cn31xx;
258 struct cvmx_l2d_fus0_s cn38xx;
259 struct cvmx_l2d_fus0_s cn38xxp2;
260 struct cvmx_l2d_fus0_s cn50xx;
261 struct cvmx_l2d_fus0_s cn52xx;
262 struct cvmx_l2d_fus0_s cn52xxp1;
263 struct cvmx_l2d_fus0_s cn56xx;
264 struct cvmx_l2d_fus0_s cn56xxp1;
265 struct cvmx_l2d_fus0_s cn58xx;
266 struct cvmx_l2d_fus0_s cn58xxp1;
267};
268
269union cvmx_l2d_fus1 {
270 uint64_t u64;
271 struct cvmx_l2d_fus1_s {
272 uint64_t reserved_34_63:30;
273 uint64_t q1fus:34;
274 } s;
275 struct cvmx_l2d_fus1_s cn30xx;
276 struct cvmx_l2d_fus1_s cn31xx;
277 struct cvmx_l2d_fus1_s cn38xx;
278 struct cvmx_l2d_fus1_s cn38xxp2;
279 struct cvmx_l2d_fus1_s cn50xx;
280 struct cvmx_l2d_fus1_s cn52xx;
281 struct cvmx_l2d_fus1_s cn52xxp1;
282 struct cvmx_l2d_fus1_s cn56xx;
283 struct cvmx_l2d_fus1_s cn56xxp1;
284 struct cvmx_l2d_fus1_s cn58xx;
285 struct cvmx_l2d_fus1_s cn58xxp1;
286};
287
288union cvmx_l2d_fus2 {
289 uint64_t u64;
290 struct cvmx_l2d_fus2_s {
291 uint64_t reserved_34_63:30;
292 uint64_t q2fus:34;
293 } s;
294 struct cvmx_l2d_fus2_s cn30xx;
295 struct cvmx_l2d_fus2_s cn31xx;
296 struct cvmx_l2d_fus2_s cn38xx;
297 struct cvmx_l2d_fus2_s cn38xxp2;
298 struct cvmx_l2d_fus2_s cn50xx;
299 struct cvmx_l2d_fus2_s cn52xx;
300 struct cvmx_l2d_fus2_s cn52xxp1;
301 struct cvmx_l2d_fus2_s cn56xx;
302 struct cvmx_l2d_fus2_s cn56xxp1;
303 struct cvmx_l2d_fus2_s cn58xx;
304 struct cvmx_l2d_fus2_s cn58xxp1;
305};
306
307union cvmx_l2d_fus3 {
308 uint64_t u64;
309 struct cvmx_l2d_fus3_s {
310 uint64_t reserved_40_63:24;
311 uint64_t ema_ctl:3;
312 uint64_t reserved_34_36:3;
313 uint64_t q3fus:34;
314 } s;
315 struct cvmx_l2d_fus3_cn30xx {
316 uint64_t reserved_35_63:29;
317 uint64_t crip_64k:1;
318 uint64_t q3fus:34;
319 } cn30xx;
320 struct cvmx_l2d_fus3_cn31xx {
321 uint64_t reserved_35_63:29;
322 uint64_t crip_128k:1;
323 uint64_t q3fus:34;
324 } cn31xx;
325 struct cvmx_l2d_fus3_cn38xx {
326 uint64_t reserved_36_63:28;
327 uint64_t crip_256k:1;
328 uint64_t crip_512k:1;
329 uint64_t q3fus:34;
330 } cn38xx;
331 struct cvmx_l2d_fus3_cn38xx cn38xxp2;
332 struct cvmx_l2d_fus3_cn50xx {
333 uint64_t reserved_40_63:24;
334 uint64_t ema_ctl:3;
335 uint64_t reserved_36_36:1;
336 uint64_t crip_32k:1;
337 uint64_t crip_64k:1;
338 uint64_t q3fus:34;
339 } cn50xx;
340 struct cvmx_l2d_fus3_cn52xx {
341 uint64_t reserved_40_63:24;
342 uint64_t ema_ctl:3;
343 uint64_t reserved_36_36:1;
344 uint64_t crip_128k:1;
345 uint64_t crip_256k:1;
346 uint64_t q3fus:34;
347 } cn52xx;
348 struct cvmx_l2d_fus3_cn52xx cn52xxp1;
349 struct cvmx_l2d_fus3_cn56xx {
350 uint64_t reserved_40_63:24;
351 uint64_t ema_ctl:3;
352 uint64_t reserved_36_36:1;
353 uint64_t crip_512k:1;
354 uint64_t crip_1024k:1;
355 uint64_t q3fus:34;
356 } cn56xx;
357 struct cvmx_l2d_fus3_cn56xx cn56xxp1;
358 struct cvmx_l2d_fus3_cn58xx {
359 uint64_t reserved_39_63:25;
360 uint64_t ema_ctl:2;
361 uint64_t reserved_36_36:1;
362 uint64_t crip_512k:1;
363 uint64_t crip_1024k:1;
364 uint64_t q3fus:34;
365 } cn58xx;
366 struct cvmx_l2d_fus3_cn58xx cn58xxp1;
367};
368
369#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-l2t-defs.h b/arch/mips/include/asm/octeon/cvmx-l2t-defs.h
new file mode 100644
index 000000000000..2639a3f5ffc2
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-l2t-defs.h
@@ -0,0 +1,141 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_L2T_DEFS_H__
29#define __CVMX_L2T_DEFS_H__
30
31#define CVMX_L2T_ERR \
32 CVMX_ADD_IO_SEG(0x0001180080000008ull)
33
34union cvmx_l2t_err {
35 uint64_t u64;
36 struct cvmx_l2t_err_s {
37 uint64_t reserved_29_63:35;
38 uint64_t fadru:1;
39 uint64_t lck_intena2:1;
40 uint64_t lckerr2:1;
41 uint64_t lck_intena:1;
42 uint64_t lckerr:1;
43 uint64_t fset:3;
44 uint64_t fadr:10;
45 uint64_t fsyn:6;
46 uint64_t ded_err:1;
47 uint64_t sec_err:1;
48 uint64_t ded_intena:1;
49 uint64_t sec_intena:1;
50 uint64_t ecc_ena:1;
51 } s;
52 struct cvmx_l2t_err_cn30xx {
53 uint64_t reserved_28_63:36;
54 uint64_t lck_intena2:1;
55 uint64_t lckerr2:1;
56 uint64_t lck_intena:1;
57 uint64_t lckerr:1;
58 uint64_t reserved_23_23:1;
59 uint64_t fset:2;
60 uint64_t reserved_19_20:2;
61 uint64_t fadr:8;
62 uint64_t fsyn:6;
63 uint64_t ded_err:1;
64 uint64_t sec_err:1;
65 uint64_t ded_intena:1;
66 uint64_t sec_intena:1;
67 uint64_t ecc_ena:1;
68 } cn30xx;
69 struct cvmx_l2t_err_cn31xx {
70 uint64_t reserved_28_63:36;
71 uint64_t lck_intena2:1;
72 uint64_t lckerr2:1;
73 uint64_t lck_intena:1;
74 uint64_t lckerr:1;
75 uint64_t reserved_23_23:1;
76 uint64_t fset:2;
77 uint64_t reserved_20_20:1;
78 uint64_t fadr:9;
79 uint64_t fsyn:6;
80 uint64_t ded_err:1;
81 uint64_t sec_err:1;
82 uint64_t ded_intena:1;
83 uint64_t sec_intena:1;
84 uint64_t ecc_ena:1;
85 } cn31xx;
86 struct cvmx_l2t_err_cn38xx {
87 uint64_t reserved_28_63:36;
88 uint64_t lck_intena2:1;
89 uint64_t lckerr2:1;
90 uint64_t lck_intena:1;
91 uint64_t lckerr:1;
92 uint64_t fset:3;
93 uint64_t fadr:10;
94 uint64_t fsyn:6;
95 uint64_t ded_err:1;
96 uint64_t sec_err:1;
97 uint64_t ded_intena:1;
98 uint64_t sec_intena:1;
99 uint64_t ecc_ena:1;
100 } cn38xx;
101 struct cvmx_l2t_err_cn38xx cn38xxp2;
102 struct cvmx_l2t_err_cn50xx {
103 uint64_t reserved_28_63:36;
104 uint64_t lck_intena2:1;
105 uint64_t lckerr2:1;
106 uint64_t lck_intena:1;
107 uint64_t lckerr:1;
108 uint64_t fset:3;
109 uint64_t reserved_18_20:3;
110 uint64_t fadr:7;
111 uint64_t fsyn:6;
112 uint64_t ded_err:1;
113 uint64_t sec_err:1;
114 uint64_t ded_intena:1;
115 uint64_t sec_intena:1;
116 uint64_t ecc_ena:1;
117 } cn50xx;
118 struct cvmx_l2t_err_cn52xx {
119 uint64_t reserved_28_63:36;
120 uint64_t lck_intena2:1;
121 uint64_t lckerr2:1;
122 uint64_t lck_intena:1;
123 uint64_t lckerr:1;
124 uint64_t fset:3;
125 uint64_t reserved_20_20:1;
126 uint64_t fadr:9;
127 uint64_t fsyn:6;
128 uint64_t ded_err:1;
129 uint64_t sec_err:1;
130 uint64_t ded_intena:1;
131 uint64_t sec_intena:1;
132 uint64_t ecc_ena:1;
133 } cn52xx;
134 struct cvmx_l2t_err_cn52xx cn52xxp1;
135 struct cvmx_l2t_err_s cn56xx;
136 struct cvmx_l2t_err_s cn56xxp1;
137 struct cvmx_l2t_err_s cn58xx;
138 struct cvmx_l2t_err_s cn58xxp1;
139};
140
141#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-led-defs.h b/arch/mips/include/asm/octeon/cvmx-led-defs.h
new file mode 100644
index 000000000000..16f174a4dadf
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-led-defs.h
@@ -0,0 +1,240 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_LED_DEFS_H__
29#define __CVMX_LED_DEFS_H__
30
31#define CVMX_LED_BLINK \
32 CVMX_ADD_IO_SEG(0x0001180000001A48ull)
33#define CVMX_LED_CLK_PHASE \
34 CVMX_ADD_IO_SEG(0x0001180000001A08ull)
35#define CVMX_LED_CYLON \
36 CVMX_ADD_IO_SEG(0x0001180000001AF8ull)
37#define CVMX_LED_DBG \
38 CVMX_ADD_IO_SEG(0x0001180000001A18ull)
39#define CVMX_LED_EN \
40 CVMX_ADD_IO_SEG(0x0001180000001A00ull)
41#define CVMX_LED_POLARITY \
42 CVMX_ADD_IO_SEG(0x0001180000001A50ull)
43#define CVMX_LED_PRT \
44 CVMX_ADD_IO_SEG(0x0001180000001A10ull)
45#define CVMX_LED_PRT_FMT \
46 CVMX_ADD_IO_SEG(0x0001180000001A30ull)
47#define CVMX_LED_PRT_STATUSX(offset) \
48 CVMX_ADD_IO_SEG(0x0001180000001A80ull + (((offset) & 7) * 8))
49#define CVMX_LED_UDD_CNTX(offset) \
50 CVMX_ADD_IO_SEG(0x0001180000001A20ull + (((offset) & 1) * 8))
51#define CVMX_LED_UDD_DATX(offset) \
52 CVMX_ADD_IO_SEG(0x0001180000001A38ull + (((offset) & 1) * 8))
53#define CVMX_LED_UDD_DAT_CLRX(offset) \
54 CVMX_ADD_IO_SEG(0x0001180000001AC8ull + (((offset) & 1) * 16))
55#define CVMX_LED_UDD_DAT_SETX(offset) \
56 CVMX_ADD_IO_SEG(0x0001180000001AC0ull + (((offset) & 1) * 16))
57
58union cvmx_led_blink {
59 uint64_t u64;
60 struct cvmx_led_blink_s {
61 uint64_t reserved_8_63:56;
62 uint64_t rate:8;
63 } s;
64 struct cvmx_led_blink_s cn38xx;
65 struct cvmx_led_blink_s cn38xxp2;
66 struct cvmx_led_blink_s cn56xx;
67 struct cvmx_led_blink_s cn56xxp1;
68 struct cvmx_led_blink_s cn58xx;
69 struct cvmx_led_blink_s cn58xxp1;
70};
71
72union cvmx_led_clk_phase {
73 uint64_t u64;
74 struct cvmx_led_clk_phase_s {
75 uint64_t reserved_7_63:57;
76 uint64_t phase:7;
77 } s;
78 struct cvmx_led_clk_phase_s cn38xx;
79 struct cvmx_led_clk_phase_s cn38xxp2;
80 struct cvmx_led_clk_phase_s cn56xx;
81 struct cvmx_led_clk_phase_s cn56xxp1;
82 struct cvmx_led_clk_phase_s cn58xx;
83 struct cvmx_led_clk_phase_s cn58xxp1;
84};
85
86union cvmx_led_cylon {
87 uint64_t u64;
88 struct cvmx_led_cylon_s {
89 uint64_t reserved_16_63:48;
90 uint64_t rate:16;
91 } s;
92 struct cvmx_led_cylon_s cn38xx;
93 struct cvmx_led_cylon_s cn38xxp2;
94 struct cvmx_led_cylon_s cn56xx;
95 struct cvmx_led_cylon_s cn56xxp1;
96 struct cvmx_led_cylon_s cn58xx;
97 struct cvmx_led_cylon_s cn58xxp1;
98};
99
100union cvmx_led_dbg {
101 uint64_t u64;
102 struct cvmx_led_dbg_s {
103 uint64_t reserved_1_63:63;
104 uint64_t dbg_en:1;
105 } s;
106 struct cvmx_led_dbg_s cn38xx;
107 struct cvmx_led_dbg_s cn38xxp2;
108 struct cvmx_led_dbg_s cn56xx;
109 struct cvmx_led_dbg_s cn56xxp1;
110 struct cvmx_led_dbg_s cn58xx;
111 struct cvmx_led_dbg_s cn58xxp1;
112};
113
114union cvmx_led_en {
115 uint64_t u64;
116 struct cvmx_led_en_s {
117 uint64_t reserved_1_63:63;
118 uint64_t en:1;
119 } s;
120 struct cvmx_led_en_s cn38xx;
121 struct cvmx_led_en_s cn38xxp2;
122 struct cvmx_led_en_s cn56xx;
123 struct cvmx_led_en_s cn56xxp1;
124 struct cvmx_led_en_s cn58xx;
125 struct cvmx_led_en_s cn58xxp1;
126};
127
128union cvmx_led_polarity {
129 uint64_t u64;
130 struct cvmx_led_polarity_s {
131 uint64_t reserved_1_63:63;
132 uint64_t polarity:1;
133 } s;
134 struct cvmx_led_polarity_s cn38xx;
135 struct cvmx_led_polarity_s cn38xxp2;
136 struct cvmx_led_polarity_s cn56xx;
137 struct cvmx_led_polarity_s cn56xxp1;
138 struct cvmx_led_polarity_s cn58xx;
139 struct cvmx_led_polarity_s cn58xxp1;
140};
141
142union cvmx_led_prt {
143 uint64_t u64;
144 struct cvmx_led_prt_s {
145 uint64_t reserved_8_63:56;
146 uint64_t prt_en:8;
147 } s;
148 struct cvmx_led_prt_s cn38xx;
149 struct cvmx_led_prt_s cn38xxp2;
150 struct cvmx_led_prt_s cn56xx;
151 struct cvmx_led_prt_s cn56xxp1;
152 struct cvmx_led_prt_s cn58xx;
153 struct cvmx_led_prt_s cn58xxp1;
154};
155
156union cvmx_led_prt_fmt {
157 uint64_t u64;
158 struct cvmx_led_prt_fmt_s {
159 uint64_t reserved_4_63:60;
160 uint64_t format:4;
161 } s;
162 struct cvmx_led_prt_fmt_s cn38xx;
163 struct cvmx_led_prt_fmt_s cn38xxp2;
164 struct cvmx_led_prt_fmt_s cn56xx;
165 struct cvmx_led_prt_fmt_s cn56xxp1;
166 struct cvmx_led_prt_fmt_s cn58xx;
167 struct cvmx_led_prt_fmt_s cn58xxp1;
168};
169
170union cvmx_led_prt_statusx {
171 uint64_t u64;
172 struct cvmx_led_prt_statusx_s {
173 uint64_t reserved_6_63:58;
174 uint64_t status:6;
175 } s;
176 struct cvmx_led_prt_statusx_s cn38xx;
177 struct cvmx_led_prt_statusx_s cn38xxp2;
178 struct cvmx_led_prt_statusx_s cn56xx;
179 struct cvmx_led_prt_statusx_s cn56xxp1;
180 struct cvmx_led_prt_statusx_s cn58xx;
181 struct cvmx_led_prt_statusx_s cn58xxp1;
182};
183
184union cvmx_led_udd_cntx {
185 uint64_t u64;
186 struct cvmx_led_udd_cntx_s {
187 uint64_t reserved_6_63:58;
188 uint64_t cnt:6;
189 } s;
190 struct cvmx_led_udd_cntx_s cn38xx;
191 struct cvmx_led_udd_cntx_s cn38xxp2;
192 struct cvmx_led_udd_cntx_s cn56xx;
193 struct cvmx_led_udd_cntx_s cn56xxp1;
194 struct cvmx_led_udd_cntx_s cn58xx;
195 struct cvmx_led_udd_cntx_s cn58xxp1;
196};
197
198union cvmx_led_udd_datx {
199 uint64_t u64;
200 struct cvmx_led_udd_datx_s {
201 uint64_t reserved_32_63:32;
202 uint64_t dat:32;
203 } s;
204 struct cvmx_led_udd_datx_s cn38xx;
205 struct cvmx_led_udd_datx_s cn38xxp2;
206 struct cvmx_led_udd_datx_s cn56xx;
207 struct cvmx_led_udd_datx_s cn56xxp1;
208 struct cvmx_led_udd_datx_s cn58xx;
209 struct cvmx_led_udd_datx_s cn58xxp1;
210};
211
212union cvmx_led_udd_dat_clrx {
213 uint64_t u64;
214 struct cvmx_led_udd_dat_clrx_s {
215 uint64_t reserved_32_63:32;
216 uint64_t clr:32;
217 } s;
218 struct cvmx_led_udd_dat_clrx_s cn38xx;
219 struct cvmx_led_udd_dat_clrx_s cn38xxp2;
220 struct cvmx_led_udd_dat_clrx_s cn56xx;
221 struct cvmx_led_udd_dat_clrx_s cn56xxp1;
222 struct cvmx_led_udd_dat_clrx_s cn58xx;
223 struct cvmx_led_udd_dat_clrx_s cn58xxp1;
224};
225
226union cvmx_led_udd_dat_setx {
227 uint64_t u64;
228 struct cvmx_led_udd_dat_setx_s {
229 uint64_t reserved_32_63:32;
230 uint64_t set:32;
231 } s;
232 struct cvmx_led_udd_dat_setx_s cn38xx;
233 struct cvmx_led_udd_dat_setx_s cn38xxp2;
234 struct cvmx_led_udd_dat_setx_s cn56xx;
235 struct cvmx_led_udd_dat_setx_s cn56xxp1;
236 struct cvmx_led_udd_dat_setx_s cn58xx;
237 struct cvmx_led_udd_dat_setx_s cn58xxp1;
238};
239
240#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-mio-defs.h b/arch/mips/include/asm/octeon/cvmx-mio-defs.h
new file mode 100644
index 000000000000..6555f0530988
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-mio-defs.h
@@ -0,0 +1,2004 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_MIO_DEFS_H__
29#define __CVMX_MIO_DEFS_H__
30
31#define CVMX_MIO_BOOT_BIST_STAT \
32 CVMX_ADD_IO_SEG(0x00011800000000F8ull)
33#define CVMX_MIO_BOOT_COMP \
34 CVMX_ADD_IO_SEG(0x00011800000000B8ull)
35#define CVMX_MIO_BOOT_DMA_CFGX(offset) \
36 CVMX_ADD_IO_SEG(0x0001180000000100ull + (((offset) & 3) * 8))
37#define CVMX_MIO_BOOT_DMA_INTX(offset) \
38 CVMX_ADD_IO_SEG(0x0001180000000138ull + (((offset) & 3) * 8))
39#define CVMX_MIO_BOOT_DMA_INT_ENX(offset) \
40 CVMX_ADD_IO_SEG(0x0001180000000150ull + (((offset) & 3) * 8))
41#define CVMX_MIO_BOOT_DMA_TIMX(offset) \
42 CVMX_ADD_IO_SEG(0x0001180000000120ull + (((offset) & 3) * 8))
43#define CVMX_MIO_BOOT_ERR \
44 CVMX_ADD_IO_SEG(0x00011800000000A0ull)
45#define CVMX_MIO_BOOT_INT \
46 CVMX_ADD_IO_SEG(0x00011800000000A8ull)
47#define CVMX_MIO_BOOT_LOC_ADR \
48 CVMX_ADD_IO_SEG(0x0001180000000090ull)
49#define CVMX_MIO_BOOT_LOC_CFGX(offset) \
50 CVMX_ADD_IO_SEG(0x0001180000000080ull + (((offset) & 1) * 8))
51#define CVMX_MIO_BOOT_LOC_DAT \
52 CVMX_ADD_IO_SEG(0x0001180000000098ull)
53#define CVMX_MIO_BOOT_PIN_DEFS \
54 CVMX_ADD_IO_SEG(0x00011800000000C0ull)
55#define CVMX_MIO_BOOT_REG_CFGX(offset) \
56 CVMX_ADD_IO_SEG(0x0001180000000000ull + (((offset) & 7) * 8))
57#define CVMX_MIO_BOOT_REG_TIMX(offset) \
58 CVMX_ADD_IO_SEG(0x0001180000000040ull + (((offset) & 7) * 8))
59#define CVMX_MIO_BOOT_THR \
60 CVMX_ADD_IO_SEG(0x00011800000000B0ull)
61#define CVMX_MIO_FUS_BNK_DATX(offset) \
62 CVMX_ADD_IO_SEG(0x0001180000001520ull + (((offset) & 3) * 8))
63#define CVMX_MIO_FUS_DAT0 \
64 CVMX_ADD_IO_SEG(0x0001180000001400ull)
65#define CVMX_MIO_FUS_DAT1 \
66 CVMX_ADD_IO_SEG(0x0001180000001408ull)
67#define CVMX_MIO_FUS_DAT2 \
68 CVMX_ADD_IO_SEG(0x0001180000001410ull)
69#define CVMX_MIO_FUS_DAT3 \
70 CVMX_ADD_IO_SEG(0x0001180000001418ull)
71#define CVMX_MIO_FUS_EMA \
72 CVMX_ADD_IO_SEG(0x0001180000001550ull)
73#define CVMX_MIO_FUS_PDF \
74 CVMX_ADD_IO_SEG(0x0001180000001420ull)
75#define CVMX_MIO_FUS_PLL \
76 CVMX_ADD_IO_SEG(0x0001180000001580ull)
77#define CVMX_MIO_FUS_PROG \
78 CVMX_ADD_IO_SEG(0x0001180000001510ull)
79#define CVMX_MIO_FUS_PROG_TIMES \
80 CVMX_ADD_IO_SEG(0x0001180000001518ull)
81#define CVMX_MIO_FUS_RCMD \
82 CVMX_ADD_IO_SEG(0x0001180000001500ull)
83#define CVMX_MIO_FUS_SPR_REPAIR_RES \
84 CVMX_ADD_IO_SEG(0x0001180000001548ull)
85#define CVMX_MIO_FUS_SPR_REPAIR_SUM \
86 CVMX_ADD_IO_SEG(0x0001180000001540ull)
87#define CVMX_MIO_FUS_UNLOCK \
88 CVMX_ADD_IO_SEG(0x0001180000001578ull)
89#define CVMX_MIO_FUS_WADR \
90 CVMX_ADD_IO_SEG(0x0001180000001508ull)
91#define CVMX_MIO_NDF_DMA_CFG \
92 CVMX_ADD_IO_SEG(0x0001180000000168ull)
93#define CVMX_MIO_NDF_DMA_INT \
94 CVMX_ADD_IO_SEG(0x0001180000000170ull)
95#define CVMX_MIO_NDF_DMA_INT_EN \
96 CVMX_ADD_IO_SEG(0x0001180000000178ull)
97#define CVMX_MIO_PLL_CTL \
98 CVMX_ADD_IO_SEG(0x0001180000001448ull)
99#define CVMX_MIO_PLL_SETTING \
100 CVMX_ADD_IO_SEG(0x0001180000001440ull)
101#define CVMX_MIO_TWSX_INT(offset) \
102 CVMX_ADD_IO_SEG(0x0001180000001010ull + (((offset) & 1) * 512))
103#define CVMX_MIO_TWSX_SW_TWSI(offset) \
104 CVMX_ADD_IO_SEG(0x0001180000001000ull + (((offset) & 1) * 512))
105#define CVMX_MIO_TWSX_SW_TWSI_EXT(offset) \
106 CVMX_ADD_IO_SEG(0x0001180000001018ull + (((offset) & 1) * 512))
107#define CVMX_MIO_TWSX_TWSI_SW(offset) \
108 CVMX_ADD_IO_SEG(0x0001180000001008ull + (((offset) & 1) * 512))
109#define CVMX_MIO_UART2_DLH \
110 CVMX_ADD_IO_SEG(0x0001180000000488ull)
111#define CVMX_MIO_UART2_DLL \
112 CVMX_ADD_IO_SEG(0x0001180000000480ull)
113#define CVMX_MIO_UART2_FAR \
114 CVMX_ADD_IO_SEG(0x0001180000000520ull)
115#define CVMX_MIO_UART2_FCR \
116 CVMX_ADD_IO_SEG(0x0001180000000450ull)
117#define CVMX_MIO_UART2_HTX \
118 CVMX_ADD_IO_SEG(0x0001180000000708ull)
119#define CVMX_MIO_UART2_IER \
120 CVMX_ADD_IO_SEG(0x0001180000000408ull)
121#define CVMX_MIO_UART2_IIR \
122 CVMX_ADD_IO_SEG(0x0001180000000410ull)
123#define CVMX_MIO_UART2_LCR \
124 CVMX_ADD_IO_SEG(0x0001180000000418ull)
125#define CVMX_MIO_UART2_LSR \
126 CVMX_ADD_IO_SEG(0x0001180000000428ull)
127#define CVMX_MIO_UART2_MCR \
128 CVMX_ADD_IO_SEG(0x0001180000000420ull)
129#define CVMX_MIO_UART2_MSR \
130 CVMX_ADD_IO_SEG(0x0001180000000430ull)
131#define CVMX_MIO_UART2_RBR \
132 CVMX_ADD_IO_SEG(0x0001180000000400ull)
133#define CVMX_MIO_UART2_RFL \
134 CVMX_ADD_IO_SEG(0x0001180000000608ull)
135#define CVMX_MIO_UART2_RFW \
136 CVMX_ADD_IO_SEG(0x0001180000000530ull)
137#define CVMX_MIO_UART2_SBCR \
138 CVMX_ADD_IO_SEG(0x0001180000000620ull)
139#define CVMX_MIO_UART2_SCR \
140 CVMX_ADD_IO_SEG(0x0001180000000438ull)
141#define CVMX_MIO_UART2_SFE \
142 CVMX_ADD_IO_SEG(0x0001180000000630ull)
143#define CVMX_MIO_UART2_SRR \
144 CVMX_ADD_IO_SEG(0x0001180000000610ull)
145#define CVMX_MIO_UART2_SRT \
146 CVMX_ADD_IO_SEG(0x0001180000000638ull)
147#define CVMX_MIO_UART2_SRTS \
148 CVMX_ADD_IO_SEG(0x0001180000000618ull)
149#define CVMX_MIO_UART2_STT \
150 CVMX_ADD_IO_SEG(0x0001180000000700ull)
151#define CVMX_MIO_UART2_TFL \
152 CVMX_ADD_IO_SEG(0x0001180000000600ull)
153#define CVMX_MIO_UART2_TFR \
154 CVMX_ADD_IO_SEG(0x0001180000000528ull)
155#define CVMX_MIO_UART2_THR \
156 CVMX_ADD_IO_SEG(0x0001180000000440ull)
157#define CVMX_MIO_UART2_USR \
158 CVMX_ADD_IO_SEG(0x0001180000000538ull)
159#define CVMX_MIO_UARTX_DLH(offset) \
160 CVMX_ADD_IO_SEG(0x0001180000000888ull + (((offset) & 1) * 1024))
161#define CVMX_MIO_UARTX_DLL(offset) \
162 CVMX_ADD_IO_SEG(0x0001180000000880ull + (((offset) & 1) * 1024))
163#define CVMX_MIO_UARTX_FAR(offset) \
164 CVMX_ADD_IO_SEG(0x0001180000000920ull + (((offset) & 1) * 1024))
165#define CVMX_MIO_UARTX_FCR(offset) \
166 CVMX_ADD_IO_SEG(0x0001180000000850ull + (((offset) & 1) * 1024))
167#define CVMX_MIO_UARTX_HTX(offset) \
168 CVMX_ADD_IO_SEG(0x0001180000000B08ull + (((offset) & 1) * 1024))
169#define CVMX_MIO_UARTX_IER(offset) \
170 CVMX_ADD_IO_SEG(0x0001180000000808ull + (((offset) & 1) * 1024))
171#define CVMX_MIO_UARTX_IIR(offset) \
172 CVMX_ADD_IO_SEG(0x0001180000000810ull + (((offset) & 1) * 1024))
173#define CVMX_MIO_UARTX_LCR(offset) \
174 CVMX_ADD_IO_SEG(0x0001180000000818ull + (((offset) & 1) * 1024))
175#define CVMX_MIO_UARTX_LSR(offset) \
176 CVMX_ADD_IO_SEG(0x0001180000000828ull + (((offset) & 1) * 1024))
177#define CVMX_MIO_UARTX_MCR(offset) \
178 CVMX_ADD_IO_SEG(0x0001180000000820ull + (((offset) & 1) * 1024))
179#define CVMX_MIO_UARTX_MSR(offset) \
180 CVMX_ADD_IO_SEG(0x0001180000000830ull + (((offset) & 1) * 1024))
181#define CVMX_MIO_UARTX_RBR(offset) \
182 CVMX_ADD_IO_SEG(0x0001180000000800ull + (((offset) & 1) * 1024))
183#define CVMX_MIO_UARTX_RFL(offset) \
184 CVMX_ADD_IO_SEG(0x0001180000000A08ull + (((offset) & 1) * 1024))
185#define CVMX_MIO_UARTX_RFW(offset) \
186 CVMX_ADD_IO_SEG(0x0001180000000930ull + (((offset) & 1) * 1024))
187#define CVMX_MIO_UARTX_SBCR(offset) \
188 CVMX_ADD_IO_SEG(0x0001180000000A20ull + (((offset) & 1) * 1024))
189#define CVMX_MIO_UARTX_SCR(offset) \
190 CVMX_ADD_IO_SEG(0x0001180000000838ull + (((offset) & 1) * 1024))
191#define CVMX_MIO_UARTX_SFE(offset) \
192 CVMX_ADD_IO_SEG(0x0001180000000A30ull + (((offset) & 1) * 1024))
193#define CVMX_MIO_UARTX_SRR(offset) \
194 CVMX_ADD_IO_SEG(0x0001180000000A10ull + (((offset) & 1) * 1024))
195#define CVMX_MIO_UARTX_SRT(offset) \
196 CVMX_ADD_IO_SEG(0x0001180000000A38ull + (((offset) & 1) * 1024))
197#define CVMX_MIO_UARTX_SRTS(offset) \
198 CVMX_ADD_IO_SEG(0x0001180000000A18ull + (((offset) & 1) * 1024))
199#define CVMX_MIO_UARTX_STT(offset) \
200 CVMX_ADD_IO_SEG(0x0001180000000B00ull + (((offset) & 1) * 1024))
201#define CVMX_MIO_UARTX_TFL(offset) \
202 CVMX_ADD_IO_SEG(0x0001180000000A00ull + (((offset) & 1) * 1024))
203#define CVMX_MIO_UARTX_TFR(offset) \
204 CVMX_ADD_IO_SEG(0x0001180000000928ull + (((offset) & 1) * 1024))
205#define CVMX_MIO_UARTX_THR(offset) \
206 CVMX_ADD_IO_SEG(0x0001180000000840ull + (((offset) & 1) * 1024))
207#define CVMX_MIO_UARTX_USR(offset) \
208 CVMX_ADD_IO_SEG(0x0001180000000938ull + (((offset) & 1) * 1024))
209
210union cvmx_mio_boot_bist_stat {
211 uint64_t u64;
212 struct cvmx_mio_boot_bist_stat_s {
213 uint64_t reserved_2_63:62;
214 uint64_t loc:1;
215 uint64_t ncbi:1;
216 } s;
217 struct cvmx_mio_boot_bist_stat_cn30xx {
218 uint64_t reserved_4_63:60;
219 uint64_t ncbo_1:1;
220 uint64_t ncbo_0:1;
221 uint64_t loc:1;
222 uint64_t ncbi:1;
223 } cn30xx;
224 struct cvmx_mio_boot_bist_stat_cn30xx cn31xx;
225 struct cvmx_mio_boot_bist_stat_cn38xx {
226 uint64_t reserved_3_63:61;
227 uint64_t ncbo_0:1;
228 uint64_t loc:1;
229 uint64_t ncbi:1;
230 } cn38xx;
231 struct cvmx_mio_boot_bist_stat_cn38xx cn38xxp2;
232 struct cvmx_mio_boot_bist_stat_cn50xx {
233 uint64_t reserved_6_63:58;
234 uint64_t pcm_1:1;
235 uint64_t pcm_0:1;
236 uint64_t ncbo_1:1;
237 uint64_t ncbo_0:1;
238 uint64_t loc:1;
239 uint64_t ncbi:1;
240 } cn50xx;
241 struct cvmx_mio_boot_bist_stat_cn52xx {
242 uint64_t reserved_6_63:58;
243 uint64_t ndf:2;
244 uint64_t ncbo_0:1;
245 uint64_t dma:1;
246 uint64_t loc:1;
247 uint64_t ncbi:1;
248 } cn52xx;
249 struct cvmx_mio_boot_bist_stat_cn52xxp1 {
250 uint64_t reserved_4_63:60;
251 uint64_t ncbo_0:1;
252 uint64_t dma:1;
253 uint64_t loc:1;
254 uint64_t ncbi:1;
255 } cn52xxp1;
256 struct cvmx_mio_boot_bist_stat_cn52xxp1 cn56xx;
257 struct cvmx_mio_boot_bist_stat_cn52xxp1 cn56xxp1;
258 struct cvmx_mio_boot_bist_stat_cn38xx cn58xx;
259 struct cvmx_mio_boot_bist_stat_cn38xx cn58xxp1;
260};
261
262union cvmx_mio_boot_comp {
263 uint64_t u64;
264 struct cvmx_mio_boot_comp_s {
265 uint64_t reserved_10_63:54;
266 uint64_t pctl:5;
267 uint64_t nctl:5;
268 } s;
269 struct cvmx_mio_boot_comp_s cn50xx;
270 struct cvmx_mio_boot_comp_s cn52xx;
271 struct cvmx_mio_boot_comp_s cn52xxp1;
272 struct cvmx_mio_boot_comp_s cn56xx;
273 struct cvmx_mio_boot_comp_s cn56xxp1;
274};
275
276union cvmx_mio_boot_dma_cfgx {
277 uint64_t u64;
278 struct cvmx_mio_boot_dma_cfgx_s {
279 uint64_t en:1;
280 uint64_t rw:1;
281 uint64_t clr:1;
282 uint64_t reserved_60_60:1;
283 uint64_t swap32:1;
284 uint64_t swap16:1;
285 uint64_t swap8:1;
286 uint64_t endian:1;
287 uint64_t size:20;
288 uint64_t adr:36;
289 } s;
290 struct cvmx_mio_boot_dma_cfgx_s cn52xx;
291 struct cvmx_mio_boot_dma_cfgx_s cn52xxp1;
292 struct cvmx_mio_boot_dma_cfgx_s cn56xx;
293 struct cvmx_mio_boot_dma_cfgx_s cn56xxp1;
294};
295
296union cvmx_mio_boot_dma_intx {
297 uint64_t u64;
298 struct cvmx_mio_boot_dma_intx_s {
299 uint64_t reserved_2_63:62;
300 uint64_t dmarq:1;
301 uint64_t done:1;
302 } s;
303 struct cvmx_mio_boot_dma_intx_s cn52xx;
304 struct cvmx_mio_boot_dma_intx_s cn52xxp1;
305 struct cvmx_mio_boot_dma_intx_s cn56xx;
306 struct cvmx_mio_boot_dma_intx_s cn56xxp1;
307};
308
309union cvmx_mio_boot_dma_int_enx {
310 uint64_t u64;
311 struct cvmx_mio_boot_dma_int_enx_s {
312 uint64_t reserved_2_63:62;
313 uint64_t dmarq:1;
314 uint64_t done:1;
315 } s;
316 struct cvmx_mio_boot_dma_int_enx_s cn52xx;
317 struct cvmx_mio_boot_dma_int_enx_s cn52xxp1;
318 struct cvmx_mio_boot_dma_int_enx_s cn56xx;
319 struct cvmx_mio_boot_dma_int_enx_s cn56xxp1;
320};
321
322union cvmx_mio_boot_dma_timx {
323 uint64_t u64;
324 struct cvmx_mio_boot_dma_timx_s {
325 uint64_t dmack_pi:1;
326 uint64_t dmarq_pi:1;
327 uint64_t tim_mult:2;
328 uint64_t rd_dly:3;
329 uint64_t ddr:1;
330 uint64_t width:1;
331 uint64_t reserved_48_54:7;
332 uint64_t pause:6;
333 uint64_t dmack_h:6;
334 uint64_t we_n:6;
335 uint64_t we_a:6;
336 uint64_t oe_n:6;
337 uint64_t oe_a:6;
338 uint64_t dmack_s:6;
339 uint64_t dmarq:6;
340 } s;
341 struct cvmx_mio_boot_dma_timx_s cn52xx;
342 struct cvmx_mio_boot_dma_timx_s cn52xxp1;
343 struct cvmx_mio_boot_dma_timx_s cn56xx;
344 struct cvmx_mio_boot_dma_timx_s cn56xxp1;
345};
346
347union cvmx_mio_boot_err {
348 uint64_t u64;
349 struct cvmx_mio_boot_err_s {
350 uint64_t reserved_2_63:62;
351 uint64_t wait_err:1;
352 uint64_t adr_err:1;
353 } s;
354 struct cvmx_mio_boot_err_s cn30xx;
355 struct cvmx_mio_boot_err_s cn31xx;
356 struct cvmx_mio_boot_err_s cn38xx;
357 struct cvmx_mio_boot_err_s cn38xxp2;
358 struct cvmx_mio_boot_err_s cn50xx;
359 struct cvmx_mio_boot_err_s cn52xx;
360 struct cvmx_mio_boot_err_s cn52xxp1;
361 struct cvmx_mio_boot_err_s cn56xx;
362 struct cvmx_mio_boot_err_s cn56xxp1;
363 struct cvmx_mio_boot_err_s cn58xx;
364 struct cvmx_mio_boot_err_s cn58xxp1;
365};
366
367union cvmx_mio_boot_int {
368 uint64_t u64;
369 struct cvmx_mio_boot_int_s {
370 uint64_t reserved_2_63:62;
371 uint64_t wait_int:1;
372 uint64_t adr_int:1;
373 } s;
374 struct cvmx_mio_boot_int_s cn30xx;
375 struct cvmx_mio_boot_int_s cn31xx;
376 struct cvmx_mio_boot_int_s cn38xx;
377 struct cvmx_mio_boot_int_s cn38xxp2;
378 struct cvmx_mio_boot_int_s cn50xx;
379 struct cvmx_mio_boot_int_s cn52xx;
380 struct cvmx_mio_boot_int_s cn52xxp1;
381 struct cvmx_mio_boot_int_s cn56xx;
382 struct cvmx_mio_boot_int_s cn56xxp1;
383 struct cvmx_mio_boot_int_s cn58xx;
384 struct cvmx_mio_boot_int_s cn58xxp1;
385};
386
387union cvmx_mio_boot_loc_adr {
388 uint64_t u64;
389 struct cvmx_mio_boot_loc_adr_s {
390 uint64_t reserved_8_63:56;
391 uint64_t adr:5;
392 uint64_t reserved_0_2:3;
393 } s;
394 struct cvmx_mio_boot_loc_adr_s cn30xx;
395 struct cvmx_mio_boot_loc_adr_s cn31xx;
396 struct cvmx_mio_boot_loc_adr_s cn38xx;
397 struct cvmx_mio_boot_loc_adr_s cn38xxp2;
398 struct cvmx_mio_boot_loc_adr_s cn50xx;
399 struct cvmx_mio_boot_loc_adr_s cn52xx;
400 struct cvmx_mio_boot_loc_adr_s cn52xxp1;
401 struct cvmx_mio_boot_loc_adr_s cn56xx;
402 struct cvmx_mio_boot_loc_adr_s cn56xxp1;
403 struct cvmx_mio_boot_loc_adr_s cn58xx;
404 struct cvmx_mio_boot_loc_adr_s cn58xxp1;
405};
406
407union cvmx_mio_boot_loc_cfgx {
408 uint64_t u64;
409 struct cvmx_mio_boot_loc_cfgx_s {
410 uint64_t reserved_32_63:32;
411 uint64_t en:1;
412 uint64_t reserved_28_30:3;
413 uint64_t base:25;
414 uint64_t reserved_0_2:3;
415 } s;
416 struct cvmx_mio_boot_loc_cfgx_s cn30xx;
417 struct cvmx_mio_boot_loc_cfgx_s cn31xx;
418 struct cvmx_mio_boot_loc_cfgx_s cn38xx;
419 struct cvmx_mio_boot_loc_cfgx_s cn38xxp2;
420 struct cvmx_mio_boot_loc_cfgx_s cn50xx;
421 struct cvmx_mio_boot_loc_cfgx_s cn52xx;
422 struct cvmx_mio_boot_loc_cfgx_s cn52xxp1;
423 struct cvmx_mio_boot_loc_cfgx_s cn56xx;
424 struct cvmx_mio_boot_loc_cfgx_s cn56xxp1;
425 struct cvmx_mio_boot_loc_cfgx_s cn58xx;
426 struct cvmx_mio_boot_loc_cfgx_s cn58xxp1;
427};
428
429union cvmx_mio_boot_loc_dat {
430 uint64_t u64;
431 struct cvmx_mio_boot_loc_dat_s {
432 uint64_t data:64;
433 } s;
434 struct cvmx_mio_boot_loc_dat_s cn30xx;
435 struct cvmx_mio_boot_loc_dat_s cn31xx;
436 struct cvmx_mio_boot_loc_dat_s cn38xx;
437 struct cvmx_mio_boot_loc_dat_s cn38xxp2;
438 struct cvmx_mio_boot_loc_dat_s cn50xx;
439 struct cvmx_mio_boot_loc_dat_s cn52xx;
440 struct cvmx_mio_boot_loc_dat_s cn52xxp1;
441 struct cvmx_mio_boot_loc_dat_s cn56xx;
442 struct cvmx_mio_boot_loc_dat_s cn56xxp1;
443 struct cvmx_mio_boot_loc_dat_s cn58xx;
444 struct cvmx_mio_boot_loc_dat_s cn58xxp1;
445};
446
447union cvmx_mio_boot_pin_defs {
448 uint64_t u64;
449 struct cvmx_mio_boot_pin_defs_s {
450 uint64_t reserved_16_63:48;
451 uint64_t ale:1;
452 uint64_t width:1;
453 uint64_t dmack_p2:1;
454 uint64_t dmack_p1:1;
455 uint64_t dmack_p0:1;
456 uint64_t term:2;
457 uint64_t nand:1;
458 uint64_t reserved_0_7:8;
459 } s;
460 struct cvmx_mio_boot_pin_defs_cn52xx {
461 uint64_t reserved_16_63:48;
462 uint64_t ale:1;
463 uint64_t width:1;
464 uint64_t reserved_13_13:1;
465 uint64_t dmack_p1:1;
466 uint64_t dmack_p0:1;
467 uint64_t term:2;
468 uint64_t nand:1;
469 uint64_t reserved_0_7:8;
470 } cn52xx;
471 struct cvmx_mio_boot_pin_defs_cn56xx {
472 uint64_t reserved_16_63:48;
473 uint64_t ale:1;
474 uint64_t width:1;
475 uint64_t dmack_p2:1;
476 uint64_t dmack_p1:1;
477 uint64_t dmack_p0:1;
478 uint64_t term:2;
479 uint64_t reserved_0_8:9;
480 } cn56xx;
481};
482
483union cvmx_mio_boot_reg_cfgx {
484 uint64_t u64;
485 struct cvmx_mio_boot_reg_cfgx_s {
486 uint64_t reserved_44_63:20;
487 uint64_t dmack:2;
488 uint64_t tim_mult:2;
489 uint64_t rd_dly:3;
490 uint64_t sam:1;
491 uint64_t we_ext:2;
492 uint64_t oe_ext:2;
493 uint64_t en:1;
494 uint64_t orbit:1;
495 uint64_t ale:1;
496 uint64_t width:1;
497 uint64_t size:12;
498 uint64_t base:16;
499 } s;
500 struct cvmx_mio_boot_reg_cfgx_cn30xx {
501 uint64_t reserved_37_63:27;
502 uint64_t sam:1;
503 uint64_t we_ext:2;
504 uint64_t oe_ext:2;
505 uint64_t en:1;
506 uint64_t orbit:1;
507 uint64_t ale:1;
508 uint64_t width:1;
509 uint64_t size:12;
510 uint64_t base:16;
511 } cn30xx;
512 struct cvmx_mio_boot_reg_cfgx_cn30xx cn31xx;
513 struct cvmx_mio_boot_reg_cfgx_cn38xx {
514 uint64_t reserved_32_63:32;
515 uint64_t en:1;
516 uint64_t orbit:1;
517 uint64_t reserved_28_29:2;
518 uint64_t size:12;
519 uint64_t base:16;
520 } cn38xx;
521 struct cvmx_mio_boot_reg_cfgx_cn38xx cn38xxp2;
522 struct cvmx_mio_boot_reg_cfgx_cn50xx {
523 uint64_t reserved_42_63:22;
524 uint64_t tim_mult:2;
525 uint64_t rd_dly:3;
526 uint64_t sam:1;
527 uint64_t we_ext:2;
528 uint64_t oe_ext:2;
529 uint64_t en:1;
530 uint64_t orbit:1;
531 uint64_t ale:1;
532 uint64_t width:1;
533 uint64_t size:12;
534 uint64_t base:16;
535 } cn50xx;
536 struct cvmx_mio_boot_reg_cfgx_s cn52xx;
537 struct cvmx_mio_boot_reg_cfgx_s cn52xxp1;
538 struct cvmx_mio_boot_reg_cfgx_s cn56xx;
539 struct cvmx_mio_boot_reg_cfgx_s cn56xxp1;
540 struct cvmx_mio_boot_reg_cfgx_cn30xx cn58xx;
541 struct cvmx_mio_boot_reg_cfgx_cn30xx cn58xxp1;
542};
543
544union cvmx_mio_boot_reg_timx {
545 uint64_t u64;
546 struct cvmx_mio_boot_reg_timx_s {
547 uint64_t pagem:1;
548 uint64_t waitm:1;
549 uint64_t pages:2;
550 uint64_t ale:6;
551 uint64_t page:6;
552 uint64_t wait:6;
553 uint64_t pause:6;
554 uint64_t wr_hld:6;
555 uint64_t rd_hld:6;
556 uint64_t we:6;
557 uint64_t oe:6;
558 uint64_t ce:6;
559 uint64_t adr:6;
560 } s;
561 struct cvmx_mio_boot_reg_timx_s cn30xx;
562 struct cvmx_mio_boot_reg_timx_s cn31xx;
563 struct cvmx_mio_boot_reg_timx_cn38xx {
564 uint64_t pagem:1;
565 uint64_t waitm:1;
566 uint64_t pages:2;
567 uint64_t reserved_54_59:6;
568 uint64_t page:6;
569 uint64_t wait:6;
570 uint64_t pause:6;
571 uint64_t wr_hld:6;
572 uint64_t rd_hld:6;
573 uint64_t we:6;
574 uint64_t oe:6;
575 uint64_t ce:6;
576 uint64_t adr:6;
577 } cn38xx;
578 struct cvmx_mio_boot_reg_timx_cn38xx cn38xxp2;
579 struct cvmx_mio_boot_reg_timx_s cn50xx;
580 struct cvmx_mio_boot_reg_timx_s cn52xx;
581 struct cvmx_mio_boot_reg_timx_s cn52xxp1;
582 struct cvmx_mio_boot_reg_timx_s cn56xx;
583 struct cvmx_mio_boot_reg_timx_s cn56xxp1;
584 struct cvmx_mio_boot_reg_timx_s cn58xx;
585 struct cvmx_mio_boot_reg_timx_s cn58xxp1;
586};
587
588union cvmx_mio_boot_thr {
589 uint64_t u64;
590 struct cvmx_mio_boot_thr_s {
591 uint64_t reserved_22_63:42;
592 uint64_t dma_thr:6;
593 uint64_t reserved_14_15:2;
594 uint64_t fif_cnt:6;
595 uint64_t reserved_6_7:2;
596 uint64_t fif_thr:6;
597 } s;
598 struct cvmx_mio_boot_thr_cn30xx {
599 uint64_t reserved_14_63:50;
600 uint64_t fif_cnt:6;
601 uint64_t reserved_6_7:2;
602 uint64_t fif_thr:6;
603 } cn30xx;
604 struct cvmx_mio_boot_thr_cn30xx cn31xx;
605 struct cvmx_mio_boot_thr_cn30xx cn38xx;
606 struct cvmx_mio_boot_thr_cn30xx cn38xxp2;
607 struct cvmx_mio_boot_thr_cn30xx cn50xx;
608 struct cvmx_mio_boot_thr_s cn52xx;
609 struct cvmx_mio_boot_thr_s cn52xxp1;
610 struct cvmx_mio_boot_thr_s cn56xx;
611 struct cvmx_mio_boot_thr_s cn56xxp1;
612 struct cvmx_mio_boot_thr_cn30xx cn58xx;
613 struct cvmx_mio_boot_thr_cn30xx cn58xxp1;
614};
615
616union cvmx_mio_fus_bnk_datx {
617 uint64_t u64;
618 struct cvmx_mio_fus_bnk_datx_s {
619 uint64_t dat:64;
620 } s;
621 struct cvmx_mio_fus_bnk_datx_s cn50xx;
622 struct cvmx_mio_fus_bnk_datx_s cn52xx;
623 struct cvmx_mio_fus_bnk_datx_s cn52xxp1;
624 struct cvmx_mio_fus_bnk_datx_s cn56xx;
625 struct cvmx_mio_fus_bnk_datx_s cn56xxp1;
626 struct cvmx_mio_fus_bnk_datx_s cn58xx;
627 struct cvmx_mio_fus_bnk_datx_s cn58xxp1;
628};
629
630union cvmx_mio_fus_dat0 {
631 uint64_t u64;
632 struct cvmx_mio_fus_dat0_s {
633 uint64_t reserved_32_63:32;
634 uint64_t man_info:32;
635 } s;
636 struct cvmx_mio_fus_dat0_s cn30xx;
637 struct cvmx_mio_fus_dat0_s cn31xx;
638 struct cvmx_mio_fus_dat0_s cn38xx;
639 struct cvmx_mio_fus_dat0_s cn38xxp2;
640 struct cvmx_mio_fus_dat0_s cn50xx;
641 struct cvmx_mio_fus_dat0_s cn52xx;
642 struct cvmx_mio_fus_dat0_s cn52xxp1;
643 struct cvmx_mio_fus_dat0_s cn56xx;
644 struct cvmx_mio_fus_dat0_s cn56xxp1;
645 struct cvmx_mio_fus_dat0_s cn58xx;
646 struct cvmx_mio_fus_dat0_s cn58xxp1;
647};
648
649union cvmx_mio_fus_dat1 {
650 uint64_t u64;
651 struct cvmx_mio_fus_dat1_s {
652 uint64_t reserved_32_63:32;
653 uint64_t man_info:32;
654 } s;
655 struct cvmx_mio_fus_dat1_s cn30xx;
656 struct cvmx_mio_fus_dat1_s cn31xx;
657 struct cvmx_mio_fus_dat1_s cn38xx;
658 struct cvmx_mio_fus_dat1_s cn38xxp2;
659 struct cvmx_mio_fus_dat1_s cn50xx;
660 struct cvmx_mio_fus_dat1_s cn52xx;
661 struct cvmx_mio_fus_dat1_s cn52xxp1;
662 struct cvmx_mio_fus_dat1_s cn56xx;
663 struct cvmx_mio_fus_dat1_s cn56xxp1;
664 struct cvmx_mio_fus_dat1_s cn58xx;
665 struct cvmx_mio_fus_dat1_s cn58xxp1;
666};
667
668union cvmx_mio_fus_dat2 {
669 uint64_t u64;
670 struct cvmx_mio_fus_dat2_s {
671 uint64_t reserved_34_63:30;
672 uint64_t fus318:1;
673 uint64_t raid_en:1;
674 uint64_t reserved_30_31:2;
675 uint64_t nokasu:1;
676 uint64_t nodfa_cp2:1;
677 uint64_t nomul:1;
678 uint64_t nocrypto:1;
679 uint64_t rst_sht:1;
680 uint64_t bist_dis:1;
681 uint64_t chip_id:8;
682 uint64_t reserved_0_15:16;
683 } s;
684 struct cvmx_mio_fus_dat2_cn30xx {
685 uint64_t reserved_29_63:35;
686 uint64_t nodfa_cp2:1;
687 uint64_t nomul:1;
688 uint64_t nocrypto:1;
689 uint64_t rst_sht:1;
690 uint64_t bist_dis:1;
691 uint64_t chip_id:8;
692 uint64_t pll_off:4;
693 uint64_t reserved_1_11:11;
694 uint64_t pp_dis:1;
695 } cn30xx;
696 struct cvmx_mio_fus_dat2_cn31xx {
697 uint64_t reserved_29_63:35;
698 uint64_t nodfa_cp2:1;
699 uint64_t nomul:1;
700 uint64_t nocrypto:1;
701 uint64_t rst_sht:1;
702 uint64_t bist_dis:1;
703 uint64_t chip_id:8;
704 uint64_t pll_off:4;
705 uint64_t reserved_2_11:10;
706 uint64_t pp_dis:2;
707 } cn31xx;
708 struct cvmx_mio_fus_dat2_cn38xx {
709 uint64_t reserved_29_63:35;
710 uint64_t nodfa_cp2:1;
711 uint64_t nomul:1;
712 uint64_t nocrypto:1;
713 uint64_t rst_sht:1;
714 uint64_t bist_dis:1;
715 uint64_t chip_id:8;
716 uint64_t pp_dis:16;
717 } cn38xx;
718 struct cvmx_mio_fus_dat2_cn38xx cn38xxp2;
719 struct cvmx_mio_fus_dat2_cn50xx {
720 uint64_t reserved_34_63:30;
721 uint64_t fus318:1;
722 uint64_t raid_en:1;
723 uint64_t reserved_30_31:2;
724 uint64_t nokasu:1;
725 uint64_t nodfa_cp2:1;
726 uint64_t nomul:1;
727 uint64_t nocrypto:1;
728 uint64_t rst_sht:1;
729 uint64_t bist_dis:1;
730 uint64_t chip_id:8;
731 uint64_t reserved_2_15:14;
732 uint64_t pp_dis:2;
733 } cn50xx;
734 struct cvmx_mio_fus_dat2_cn52xx {
735 uint64_t reserved_34_63:30;
736 uint64_t fus318:1;
737 uint64_t raid_en:1;
738 uint64_t reserved_30_31:2;
739 uint64_t nokasu:1;
740 uint64_t nodfa_cp2:1;
741 uint64_t nomul:1;
742 uint64_t nocrypto:1;
743 uint64_t rst_sht:1;
744 uint64_t bist_dis:1;
745 uint64_t chip_id:8;
746 uint64_t reserved_4_15:12;
747 uint64_t pp_dis:4;
748 } cn52xx;
749 struct cvmx_mio_fus_dat2_cn52xx cn52xxp1;
750 struct cvmx_mio_fus_dat2_cn56xx {
751 uint64_t reserved_34_63:30;
752 uint64_t fus318:1;
753 uint64_t raid_en:1;
754 uint64_t reserved_30_31:2;
755 uint64_t nokasu:1;
756 uint64_t nodfa_cp2:1;
757 uint64_t nomul:1;
758 uint64_t nocrypto:1;
759 uint64_t rst_sht:1;
760 uint64_t bist_dis:1;
761 uint64_t chip_id:8;
762 uint64_t reserved_12_15:4;
763 uint64_t pp_dis:12;
764 } cn56xx;
765 struct cvmx_mio_fus_dat2_cn56xx cn56xxp1;
766 struct cvmx_mio_fus_dat2_cn58xx {
767 uint64_t reserved_30_63:34;
768 uint64_t nokasu:1;
769 uint64_t nodfa_cp2:1;
770 uint64_t nomul:1;
771 uint64_t nocrypto:1;
772 uint64_t rst_sht:1;
773 uint64_t bist_dis:1;
774 uint64_t chip_id:8;
775 uint64_t pp_dis:16;
776 } cn58xx;
777 struct cvmx_mio_fus_dat2_cn58xx cn58xxp1;
778};
779
780union cvmx_mio_fus_dat3 {
781 uint64_t u64;
782 struct cvmx_mio_fus_dat3_s {
783 uint64_t reserved_32_63:32;
784 uint64_t pll_div4:1;
785 uint64_t zip_crip:2;
786 uint64_t bar2_en:1;
787 uint64_t efus_lck:1;
788 uint64_t efus_ign:1;
789 uint64_t nozip:1;
790 uint64_t nodfa_dte:1;
791 uint64_t icache:24;
792 } s;
793 struct cvmx_mio_fus_dat3_cn30xx {
794 uint64_t reserved_32_63:32;
795 uint64_t pll_div4:1;
796 uint64_t reserved_29_30:2;
797 uint64_t bar2_en:1;
798 uint64_t efus_lck:1;
799 uint64_t efus_ign:1;
800 uint64_t nozip:1;
801 uint64_t nodfa_dte:1;
802 uint64_t icache:24;
803 } cn30xx;
804 struct cvmx_mio_fus_dat3_s cn31xx;
805 struct cvmx_mio_fus_dat3_cn38xx {
806 uint64_t reserved_31_63:33;
807 uint64_t zip_crip:2;
808 uint64_t bar2_en:1;
809 uint64_t efus_lck:1;
810 uint64_t efus_ign:1;
811 uint64_t nozip:1;
812 uint64_t nodfa_dte:1;
813 uint64_t icache:24;
814 } cn38xx;
815 struct cvmx_mio_fus_dat3_cn38xxp2 {
816 uint64_t reserved_29_63:35;
817 uint64_t bar2_en:1;
818 uint64_t efus_lck:1;
819 uint64_t efus_ign:1;
820 uint64_t nozip:1;
821 uint64_t nodfa_dte:1;
822 uint64_t icache:24;
823 } cn38xxp2;
824 struct cvmx_mio_fus_dat3_cn38xx cn50xx;
825 struct cvmx_mio_fus_dat3_cn38xx cn52xx;
826 struct cvmx_mio_fus_dat3_cn38xx cn52xxp1;
827 struct cvmx_mio_fus_dat3_cn38xx cn56xx;
828 struct cvmx_mio_fus_dat3_cn38xx cn56xxp1;
829 struct cvmx_mio_fus_dat3_cn38xx cn58xx;
830 struct cvmx_mio_fus_dat3_cn38xx cn58xxp1;
831};
832
833union cvmx_mio_fus_ema {
834 uint64_t u64;
835 struct cvmx_mio_fus_ema_s {
836 uint64_t reserved_7_63:57;
837 uint64_t eff_ema:3;
838 uint64_t reserved_3_3:1;
839 uint64_t ema:3;
840 } s;
841 struct cvmx_mio_fus_ema_s cn50xx;
842 struct cvmx_mio_fus_ema_s cn52xx;
843 struct cvmx_mio_fus_ema_s cn52xxp1;
844 struct cvmx_mio_fus_ema_s cn56xx;
845 struct cvmx_mio_fus_ema_s cn56xxp1;
846 struct cvmx_mio_fus_ema_cn58xx {
847 uint64_t reserved_2_63:62;
848 uint64_t ema:2;
849 } cn58xx;
850 struct cvmx_mio_fus_ema_cn58xx cn58xxp1;
851};
852
853union cvmx_mio_fus_pdf {
854 uint64_t u64;
855 struct cvmx_mio_fus_pdf_s {
856 uint64_t pdf:64;
857 } s;
858 struct cvmx_mio_fus_pdf_s cn50xx;
859 struct cvmx_mio_fus_pdf_s cn52xx;
860 struct cvmx_mio_fus_pdf_s cn52xxp1;
861 struct cvmx_mio_fus_pdf_s cn56xx;
862 struct cvmx_mio_fus_pdf_s cn56xxp1;
863 struct cvmx_mio_fus_pdf_s cn58xx;
864};
865
866union cvmx_mio_fus_pll {
867 uint64_t u64;
868 struct cvmx_mio_fus_pll_s {
869 uint64_t reserved_2_63:62;
870 uint64_t rfslip:1;
871 uint64_t fbslip:1;
872 } s;
873 struct cvmx_mio_fus_pll_s cn50xx;
874 struct cvmx_mio_fus_pll_s cn52xx;
875 struct cvmx_mio_fus_pll_s cn52xxp1;
876 struct cvmx_mio_fus_pll_s cn56xx;
877 struct cvmx_mio_fus_pll_s cn56xxp1;
878 struct cvmx_mio_fus_pll_s cn58xx;
879 struct cvmx_mio_fus_pll_s cn58xxp1;
880};
881
882union cvmx_mio_fus_prog {
883 uint64_t u64;
884 struct cvmx_mio_fus_prog_s {
885 uint64_t reserved_1_63:63;
886 uint64_t prog:1;
887 } s;
888 struct cvmx_mio_fus_prog_s cn30xx;
889 struct cvmx_mio_fus_prog_s cn31xx;
890 struct cvmx_mio_fus_prog_s cn38xx;
891 struct cvmx_mio_fus_prog_s cn38xxp2;
892 struct cvmx_mio_fus_prog_s cn50xx;
893 struct cvmx_mio_fus_prog_s cn52xx;
894 struct cvmx_mio_fus_prog_s cn52xxp1;
895 struct cvmx_mio_fus_prog_s cn56xx;
896 struct cvmx_mio_fus_prog_s cn56xxp1;
897 struct cvmx_mio_fus_prog_s cn58xx;
898 struct cvmx_mio_fus_prog_s cn58xxp1;
899};
900
901union cvmx_mio_fus_prog_times {
902 uint64_t u64;
903 struct cvmx_mio_fus_prog_times_s {
904 uint64_t reserved_33_63:31;
905 uint64_t prog_pin:1;
906 uint64_t out:8;
907 uint64_t sclk_lo:4;
908 uint64_t sclk_hi:12;
909 uint64_t setup:8;
910 } s;
911 struct cvmx_mio_fus_prog_times_s cn50xx;
912 struct cvmx_mio_fus_prog_times_s cn52xx;
913 struct cvmx_mio_fus_prog_times_s cn52xxp1;
914 struct cvmx_mio_fus_prog_times_s cn56xx;
915 struct cvmx_mio_fus_prog_times_s cn56xxp1;
916 struct cvmx_mio_fus_prog_times_s cn58xx;
917 struct cvmx_mio_fus_prog_times_s cn58xxp1;
918};
919
920union cvmx_mio_fus_rcmd {
921 uint64_t u64;
922 struct cvmx_mio_fus_rcmd_s {
923 uint64_t reserved_24_63:40;
924 uint64_t dat:8;
925 uint64_t reserved_13_15:3;
926 uint64_t pend:1;
927 uint64_t reserved_9_11:3;
928 uint64_t efuse:1;
929 uint64_t addr:8;
930 } s;
931 struct cvmx_mio_fus_rcmd_cn30xx {
932 uint64_t reserved_24_63:40;
933 uint64_t dat:8;
934 uint64_t reserved_13_15:3;
935 uint64_t pend:1;
936 uint64_t reserved_9_11:3;
937 uint64_t efuse:1;
938 uint64_t reserved_7_7:1;
939 uint64_t addr:7;
940 } cn30xx;
941 struct cvmx_mio_fus_rcmd_cn30xx cn31xx;
942 struct cvmx_mio_fus_rcmd_cn30xx cn38xx;
943 struct cvmx_mio_fus_rcmd_cn30xx cn38xxp2;
944 struct cvmx_mio_fus_rcmd_cn30xx cn50xx;
945 struct cvmx_mio_fus_rcmd_s cn52xx;
946 struct cvmx_mio_fus_rcmd_s cn52xxp1;
947 struct cvmx_mio_fus_rcmd_s cn56xx;
948 struct cvmx_mio_fus_rcmd_s cn56xxp1;
949 struct cvmx_mio_fus_rcmd_cn30xx cn58xx;
950 struct cvmx_mio_fus_rcmd_cn30xx cn58xxp1;
951};
952
953union cvmx_mio_fus_spr_repair_res {
954 uint64_t u64;
955 struct cvmx_mio_fus_spr_repair_res_s {
956 uint64_t reserved_42_63:22;
957 uint64_t repair2:14;
958 uint64_t repair1:14;
959 uint64_t repair0:14;
960 } s;
961 struct cvmx_mio_fus_spr_repair_res_s cn30xx;
962 struct cvmx_mio_fus_spr_repair_res_s cn31xx;
963 struct cvmx_mio_fus_spr_repair_res_s cn38xx;
964 struct cvmx_mio_fus_spr_repair_res_s cn50xx;
965 struct cvmx_mio_fus_spr_repair_res_s cn52xx;
966 struct cvmx_mio_fus_spr_repair_res_s cn52xxp1;
967 struct cvmx_mio_fus_spr_repair_res_s cn56xx;
968 struct cvmx_mio_fus_spr_repair_res_s cn56xxp1;
969 struct cvmx_mio_fus_spr_repair_res_s cn58xx;
970 struct cvmx_mio_fus_spr_repair_res_s cn58xxp1;
971};
972
973union cvmx_mio_fus_spr_repair_sum {
974 uint64_t u64;
975 struct cvmx_mio_fus_spr_repair_sum_s {
976 uint64_t reserved_1_63:63;
977 uint64_t too_many:1;
978 } s;
979 struct cvmx_mio_fus_spr_repair_sum_s cn30xx;
980 struct cvmx_mio_fus_spr_repair_sum_s cn31xx;
981 struct cvmx_mio_fus_spr_repair_sum_s cn38xx;
982 struct cvmx_mio_fus_spr_repair_sum_s cn50xx;
983 struct cvmx_mio_fus_spr_repair_sum_s cn52xx;
984 struct cvmx_mio_fus_spr_repair_sum_s cn52xxp1;
985 struct cvmx_mio_fus_spr_repair_sum_s cn56xx;
986 struct cvmx_mio_fus_spr_repair_sum_s cn56xxp1;
987 struct cvmx_mio_fus_spr_repair_sum_s cn58xx;
988 struct cvmx_mio_fus_spr_repair_sum_s cn58xxp1;
989};
990
991union cvmx_mio_fus_unlock {
992 uint64_t u64;
993 struct cvmx_mio_fus_unlock_s {
994 uint64_t reserved_24_63:40;
995 uint64_t key:24;
996 } s;
997 struct cvmx_mio_fus_unlock_s cn30xx;
998 struct cvmx_mio_fus_unlock_s cn31xx;
999};
1000
1001union cvmx_mio_fus_wadr {
1002 uint64_t u64;
1003 struct cvmx_mio_fus_wadr_s {
1004 uint64_t reserved_10_63:54;
1005 uint64_t addr:10;
1006 } s;
1007 struct cvmx_mio_fus_wadr_s cn30xx;
1008 struct cvmx_mio_fus_wadr_s cn31xx;
1009 struct cvmx_mio_fus_wadr_s cn38xx;
1010 struct cvmx_mio_fus_wadr_s cn38xxp2;
1011 struct cvmx_mio_fus_wadr_cn50xx {
1012 uint64_t reserved_2_63:62;
1013 uint64_t addr:2;
1014 } cn50xx;
1015 struct cvmx_mio_fus_wadr_cn52xx {
1016 uint64_t reserved_3_63:61;
1017 uint64_t addr:3;
1018 } cn52xx;
1019 struct cvmx_mio_fus_wadr_cn52xx cn52xxp1;
1020 struct cvmx_mio_fus_wadr_cn52xx cn56xx;
1021 struct cvmx_mio_fus_wadr_cn52xx cn56xxp1;
1022 struct cvmx_mio_fus_wadr_cn50xx cn58xx;
1023 struct cvmx_mio_fus_wadr_cn50xx cn58xxp1;
1024};
1025
1026union cvmx_mio_ndf_dma_cfg {
1027 uint64_t u64;
1028 struct cvmx_mio_ndf_dma_cfg_s {
1029 uint64_t en:1;
1030 uint64_t rw:1;
1031 uint64_t clr:1;
1032 uint64_t reserved_60_60:1;
1033 uint64_t swap32:1;
1034 uint64_t swap16:1;
1035 uint64_t swap8:1;
1036 uint64_t endian:1;
1037 uint64_t size:20;
1038 uint64_t adr:36;
1039 } s;
1040 struct cvmx_mio_ndf_dma_cfg_s cn52xx;
1041};
1042
1043union cvmx_mio_ndf_dma_int {
1044 uint64_t u64;
1045 struct cvmx_mio_ndf_dma_int_s {
1046 uint64_t reserved_1_63:63;
1047 uint64_t done:1;
1048 } s;
1049 struct cvmx_mio_ndf_dma_int_s cn52xx;
1050};
1051
1052union cvmx_mio_ndf_dma_int_en {
1053 uint64_t u64;
1054 struct cvmx_mio_ndf_dma_int_en_s {
1055 uint64_t reserved_1_63:63;
1056 uint64_t done:1;
1057 } s;
1058 struct cvmx_mio_ndf_dma_int_en_s cn52xx;
1059};
1060
1061union cvmx_mio_pll_ctl {
1062 uint64_t u64;
1063 struct cvmx_mio_pll_ctl_s {
1064 uint64_t reserved_5_63:59;
1065 uint64_t bw_ctl:5;
1066 } s;
1067 struct cvmx_mio_pll_ctl_s cn30xx;
1068 struct cvmx_mio_pll_ctl_s cn31xx;
1069};
1070
1071union cvmx_mio_pll_setting {
1072 uint64_t u64;
1073 struct cvmx_mio_pll_setting_s {
1074 uint64_t reserved_17_63:47;
1075 uint64_t setting:17;
1076 } s;
1077 struct cvmx_mio_pll_setting_s cn30xx;
1078 struct cvmx_mio_pll_setting_s cn31xx;
1079};
1080
1081union cvmx_mio_twsx_int {
1082 uint64_t u64;
1083 struct cvmx_mio_twsx_int_s {
1084 uint64_t reserved_12_63:52;
1085 uint64_t scl:1;
1086 uint64_t sda:1;
1087 uint64_t scl_ovr:1;
1088 uint64_t sda_ovr:1;
1089 uint64_t reserved_7_7:1;
1090 uint64_t core_en:1;
1091 uint64_t ts_en:1;
1092 uint64_t st_en:1;
1093 uint64_t reserved_3_3:1;
1094 uint64_t core_int:1;
1095 uint64_t ts_int:1;
1096 uint64_t st_int:1;
1097 } s;
1098 struct cvmx_mio_twsx_int_s cn30xx;
1099 struct cvmx_mio_twsx_int_s cn31xx;
1100 struct cvmx_mio_twsx_int_s cn38xx;
1101 struct cvmx_mio_twsx_int_cn38xxp2 {
1102 uint64_t reserved_7_63:57;
1103 uint64_t core_en:1;
1104 uint64_t ts_en:1;
1105 uint64_t st_en:1;
1106 uint64_t reserved_3_3:1;
1107 uint64_t core_int:1;
1108 uint64_t ts_int:1;
1109 uint64_t st_int:1;
1110 } cn38xxp2;
1111 struct cvmx_mio_twsx_int_s cn50xx;
1112 struct cvmx_mio_twsx_int_s cn52xx;
1113 struct cvmx_mio_twsx_int_s cn52xxp1;
1114 struct cvmx_mio_twsx_int_s cn56xx;
1115 struct cvmx_mio_twsx_int_s cn56xxp1;
1116 struct cvmx_mio_twsx_int_s cn58xx;
1117 struct cvmx_mio_twsx_int_s cn58xxp1;
1118};
1119
1120union cvmx_mio_twsx_sw_twsi {
1121 uint64_t u64;
1122 struct cvmx_mio_twsx_sw_twsi_s {
1123 uint64_t v:1;
1124 uint64_t slonly:1;
1125 uint64_t eia:1;
1126 uint64_t op:4;
1127 uint64_t r:1;
1128 uint64_t sovr:1;
1129 uint64_t size:3;
1130 uint64_t scr:2;
1131 uint64_t a:10;
1132 uint64_t ia:5;
1133 uint64_t eop_ia:3;
1134 uint64_t d:32;
1135 } s;
1136 struct cvmx_mio_twsx_sw_twsi_s cn30xx;
1137 struct cvmx_mio_twsx_sw_twsi_s cn31xx;
1138 struct cvmx_mio_twsx_sw_twsi_s cn38xx;
1139 struct cvmx_mio_twsx_sw_twsi_s cn38xxp2;
1140 struct cvmx_mio_twsx_sw_twsi_s cn50xx;
1141 struct cvmx_mio_twsx_sw_twsi_s cn52xx;
1142 struct cvmx_mio_twsx_sw_twsi_s cn52xxp1;
1143 struct cvmx_mio_twsx_sw_twsi_s cn56xx;
1144 struct cvmx_mio_twsx_sw_twsi_s cn56xxp1;
1145 struct cvmx_mio_twsx_sw_twsi_s cn58xx;
1146 struct cvmx_mio_twsx_sw_twsi_s cn58xxp1;
1147};
1148
1149union cvmx_mio_twsx_sw_twsi_ext {
1150 uint64_t u64;
1151 struct cvmx_mio_twsx_sw_twsi_ext_s {
1152 uint64_t reserved_40_63:24;
1153 uint64_t ia:8;
1154 uint64_t d:32;
1155 } s;
1156 struct cvmx_mio_twsx_sw_twsi_ext_s cn30xx;
1157 struct cvmx_mio_twsx_sw_twsi_ext_s cn31xx;
1158 struct cvmx_mio_twsx_sw_twsi_ext_s cn38xx;
1159 struct cvmx_mio_twsx_sw_twsi_ext_s cn38xxp2;
1160 struct cvmx_mio_twsx_sw_twsi_ext_s cn50xx;
1161 struct cvmx_mio_twsx_sw_twsi_ext_s cn52xx;
1162 struct cvmx_mio_twsx_sw_twsi_ext_s cn52xxp1;
1163 struct cvmx_mio_twsx_sw_twsi_ext_s cn56xx;
1164 struct cvmx_mio_twsx_sw_twsi_ext_s cn56xxp1;
1165 struct cvmx_mio_twsx_sw_twsi_ext_s cn58xx;
1166 struct cvmx_mio_twsx_sw_twsi_ext_s cn58xxp1;
1167};
1168
1169union cvmx_mio_twsx_twsi_sw {
1170 uint64_t u64;
1171 struct cvmx_mio_twsx_twsi_sw_s {
1172 uint64_t v:2;
1173 uint64_t reserved_32_61:30;
1174 uint64_t d:32;
1175 } s;
1176 struct cvmx_mio_twsx_twsi_sw_s cn30xx;
1177 struct cvmx_mio_twsx_twsi_sw_s cn31xx;
1178 struct cvmx_mio_twsx_twsi_sw_s cn38xx;
1179 struct cvmx_mio_twsx_twsi_sw_s cn38xxp2;
1180 struct cvmx_mio_twsx_twsi_sw_s cn50xx;
1181 struct cvmx_mio_twsx_twsi_sw_s cn52xx;
1182 struct cvmx_mio_twsx_twsi_sw_s cn52xxp1;
1183 struct cvmx_mio_twsx_twsi_sw_s cn56xx;
1184 struct cvmx_mio_twsx_twsi_sw_s cn56xxp1;
1185 struct cvmx_mio_twsx_twsi_sw_s cn58xx;
1186 struct cvmx_mio_twsx_twsi_sw_s cn58xxp1;
1187};
1188
1189union cvmx_mio_uartx_dlh {
1190 uint64_t u64;
1191 struct cvmx_mio_uartx_dlh_s {
1192 uint64_t reserved_8_63:56;
1193 uint64_t dlh:8;
1194 } s;
1195 struct cvmx_mio_uartx_dlh_s cn30xx;
1196 struct cvmx_mio_uartx_dlh_s cn31xx;
1197 struct cvmx_mio_uartx_dlh_s cn38xx;
1198 struct cvmx_mio_uartx_dlh_s cn38xxp2;
1199 struct cvmx_mio_uartx_dlh_s cn50xx;
1200 struct cvmx_mio_uartx_dlh_s cn52xx;
1201 struct cvmx_mio_uartx_dlh_s cn52xxp1;
1202 struct cvmx_mio_uartx_dlh_s cn56xx;
1203 struct cvmx_mio_uartx_dlh_s cn56xxp1;
1204 struct cvmx_mio_uartx_dlh_s cn58xx;
1205 struct cvmx_mio_uartx_dlh_s cn58xxp1;
1206};
1207
1208union cvmx_mio_uartx_dll {
1209 uint64_t u64;
1210 struct cvmx_mio_uartx_dll_s {
1211 uint64_t reserved_8_63:56;
1212 uint64_t dll:8;
1213 } s;
1214 struct cvmx_mio_uartx_dll_s cn30xx;
1215 struct cvmx_mio_uartx_dll_s cn31xx;
1216 struct cvmx_mio_uartx_dll_s cn38xx;
1217 struct cvmx_mio_uartx_dll_s cn38xxp2;
1218 struct cvmx_mio_uartx_dll_s cn50xx;
1219 struct cvmx_mio_uartx_dll_s cn52xx;
1220 struct cvmx_mio_uartx_dll_s cn52xxp1;
1221 struct cvmx_mio_uartx_dll_s cn56xx;
1222 struct cvmx_mio_uartx_dll_s cn56xxp1;
1223 struct cvmx_mio_uartx_dll_s cn58xx;
1224 struct cvmx_mio_uartx_dll_s cn58xxp1;
1225};
1226
1227union cvmx_mio_uartx_far {
1228 uint64_t u64;
1229 struct cvmx_mio_uartx_far_s {
1230 uint64_t reserved_1_63:63;
1231 uint64_t far:1;
1232 } s;
1233 struct cvmx_mio_uartx_far_s cn30xx;
1234 struct cvmx_mio_uartx_far_s cn31xx;
1235 struct cvmx_mio_uartx_far_s cn38xx;
1236 struct cvmx_mio_uartx_far_s cn38xxp2;
1237 struct cvmx_mio_uartx_far_s cn50xx;
1238 struct cvmx_mio_uartx_far_s cn52xx;
1239 struct cvmx_mio_uartx_far_s cn52xxp1;
1240 struct cvmx_mio_uartx_far_s cn56xx;
1241 struct cvmx_mio_uartx_far_s cn56xxp1;
1242 struct cvmx_mio_uartx_far_s cn58xx;
1243 struct cvmx_mio_uartx_far_s cn58xxp1;
1244};
1245
1246union cvmx_mio_uartx_fcr {
1247 uint64_t u64;
1248 struct cvmx_mio_uartx_fcr_s {
1249 uint64_t reserved_8_63:56;
1250 uint64_t rxtrig:2;
1251 uint64_t txtrig:2;
1252 uint64_t reserved_3_3:1;
1253 uint64_t txfr:1;
1254 uint64_t rxfr:1;
1255 uint64_t en:1;
1256 } s;
1257 struct cvmx_mio_uartx_fcr_s cn30xx;
1258 struct cvmx_mio_uartx_fcr_s cn31xx;
1259 struct cvmx_mio_uartx_fcr_s cn38xx;
1260 struct cvmx_mio_uartx_fcr_s cn38xxp2;
1261 struct cvmx_mio_uartx_fcr_s cn50xx;
1262 struct cvmx_mio_uartx_fcr_s cn52xx;
1263 struct cvmx_mio_uartx_fcr_s cn52xxp1;
1264 struct cvmx_mio_uartx_fcr_s cn56xx;
1265 struct cvmx_mio_uartx_fcr_s cn56xxp1;
1266 struct cvmx_mio_uartx_fcr_s cn58xx;
1267 struct cvmx_mio_uartx_fcr_s cn58xxp1;
1268};
1269
1270union cvmx_mio_uartx_htx {
1271 uint64_t u64;
1272 struct cvmx_mio_uartx_htx_s {
1273 uint64_t reserved_1_63:63;
1274 uint64_t htx:1;
1275 } s;
1276 struct cvmx_mio_uartx_htx_s cn30xx;
1277 struct cvmx_mio_uartx_htx_s cn31xx;
1278 struct cvmx_mio_uartx_htx_s cn38xx;
1279 struct cvmx_mio_uartx_htx_s cn38xxp2;
1280 struct cvmx_mio_uartx_htx_s cn50xx;
1281 struct cvmx_mio_uartx_htx_s cn52xx;
1282 struct cvmx_mio_uartx_htx_s cn52xxp1;
1283 struct cvmx_mio_uartx_htx_s cn56xx;
1284 struct cvmx_mio_uartx_htx_s cn56xxp1;
1285 struct cvmx_mio_uartx_htx_s cn58xx;
1286 struct cvmx_mio_uartx_htx_s cn58xxp1;
1287};
1288
1289union cvmx_mio_uartx_ier {
1290 uint64_t u64;
1291 struct cvmx_mio_uartx_ier_s {
1292 uint64_t reserved_8_63:56;
1293 uint64_t ptime:1;
1294 uint64_t reserved_4_6:3;
1295 uint64_t edssi:1;
1296 uint64_t elsi:1;
1297 uint64_t etbei:1;
1298 uint64_t erbfi:1;
1299 } s;
1300 struct cvmx_mio_uartx_ier_s cn30xx;
1301 struct cvmx_mio_uartx_ier_s cn31xx;
1302 struct cvmx_mio_uartx_ier_s cn38xx;
1303 struct cvmx_mio_uartx_ier_s cn38xxp2;
1304 struct cvmx_mio_uartx_ier_s cn50xx;
1305 struct cvmx_mio_uartx_ier_s cn52xx;
1306 struct cvmx_mio_uartx_ier_s cn52xxp1;
1307 struct cvmx_mio_uartx_ier_s cn56xx;
1308 struct cvmx_mio_uartx_ier_s cn56xxp1;
1309 struct cvmx_mio_uartx_ier_s cn58xx;
1310 struct cvmx_mio_uartx_ier_s cn58xxp1;
1311};
1312
1313union cvmx_mio_uartx_iir {
1314 uint64_t u64;
1315 struct cvmx_mio_uartx_iir_s {
1316 uint64_t reserved_8_63:56;
1317 uint64_t fen:2;
1318 uint64_t reserved_4_5:2;
1319 uint64_t iid:4;
1320 } s;
1321 struct cvmx_mio_uartx_iir_s cn30xx;
1322 struct cvmx_mio_uartx_iir_s cn31xx;
1323 struct cvmx_mio_uartx_iir_s cn38xx;
1324 struct cvmx_mio_uartx_iir_s cn38xxp2;
1325 struct cvmx_mio_uartx_iir_s cn50xx;
1326 struct cvmx_mio_uartx_iir_s cn52xx;
1327 struct cvmx_mio_uartx_iir_s cn52xxp1;
1328 struct cvmx_mio_uartx_iir_s cn56xx;
1329 struct cvmx_mio_uartx_iir_s cn56xxp1;
1330 struct cvmx_mio_uartx_iir_s cn58xx;
1331 struct cvmx_mio_uartx_iir_s cn58xxp1;
1332};
1333
1334union cvmx_mio_uartx_lcr {
1335 uint64_t u64;
1336 struct cvmx_mio_uartx_lcr_s {
1337 uint64_t reserved_8_63:56;
1338 uint64_t dlab:1;
1339 uint64_t brk:1;
1340 uint64_t reserved_5_5:1;
1341 uint64_t eps:1;
1342 uint64_t pen:1;
1343 uint64_t stop:1;
1344 uint64_t cls:2;
1345 } s;
1346 struct cvmx_mio_uartx_lcr_s cn30xx;
1347 struct cvmx_mio_uartx_lcr_s cn31xx;
1348 struct cvmx_mio_uartx_lcr_s cn38xx;
1349 struct cvmx_mio_uartx_lcr_s cn38xxp2;
1350 struct cvmx_mio_uartx_lcr_s cn50xx;
1351 struct cvmx_mio_uartx_lcr_s cn52xx;
1352 struct cvmx_mio_uartx_lcr_s cn52xxp1;
1353 struct cvmx_mio_uartx_lcr_s cn56xx;
1354 struct cvmx_mio_uartx_lcr_s cn56xxp1;
1355 struct cvmx_mio_uartx_lcr_s cn58xx;
1356 struct cvmx_mio_uartx_lcr_s cn58xxp1;
1357};
1358
1359union cvmx_mio_uartx_lsr {
1360 uint64_t u64;
1361 struct cvmx_mio_uartx_lsr_s {
1362 uint64_t reserved_8_63:56;
1363 uint64_t ferr:1;
1364 uint64_t temt:1;
1365 uint64_t thre:1;
1366 uint64_t bi:1;
1367 uint64_t fe:1;
1368 uint64_t pe:1;
1369 uint64_t oe:1;
1370 uint64_t dr:1;
1371 } s;
1372 struct cvmx_mio_uartx_lsr_s cn30xx;
1373 struct cvmx_mio_uartx_lsr_s cn31xx;
1374 struct cvmx_mio_uartx_lsr_s cn38xx;
1375 struct cvmx_mio_uartx_lsr_s cn38xxp2;
1376 struct cvmx_mio_uartx_lsr_s cn50xx;
1377 struct cvmx_mio_uartx_lsr_s cn52xx;
1378 struct cvmx_mio_uartx_lsr_s cn52xxp1;
1379 struct cvmx_mio_uartx_lsr_s cn56xx;
1380 struct cvmx_mio_uartx_lsr_s cn56xxp1;
1381 struct cvmx_mio_uartx_lsr_s cn58xx;
1382 struct cvmx_mio_uartx_lsr_s cn58xxp1;
1383};
1384
1385union cvmx_mio_uartx_mcr {
1386 uint64_t u64;
1387 struct cvmx_mio_uartx_mcr_s {
1388 uint64_t reserved_6_63:58;
1389 uint64_t afce:1;
1390 uint64_t loop:1;
1391 uint64_t out2:1;
1392 uint64_t out1:1;
1393 uint64_t rts:1;
1394 uint64_t dtr:1;
1395 } s;
1396 struct cvmx_mio_uartx_mcr_s cn30xx;
1397 struct cvmx_mio_uartx_mcr_s cn31xx;
1398 struct cvmx_mio_uartx_mcr_s cn38xx;
1399 struct cvmx_mio_uartx_mcr_s cn38xxp2;
1400 struct cvmx_mio_uartx_mcr_s cn50xx;
1401 struct cvmx_mio_uartx_mcr_s cn52xx;
1402 struct cvmx_mio_uartx_mcr_s cn52xxp1;
1403 struct cvmx_mio_uartx_mcr_s cn56xx;
1404 struct cvmx_mio_uartx_mcr_s cn56xxp1;
1405 struct cvmx_mio_uartx_mcr_s cn58xx;
1406 struct cvmx_mio_uartx_mcr_s cn58xxp1;
1407};
1408
1409union cvmx_mio_uartx_msr {
1410 uint64_t u64;
1411 struct cvmx_mio_uartx_msr_s {
1412 uint64_t reserved_8_63:56;
1413 uint64_t dcd:1;
1414 uint64_t ri:1;
1415 uint64_t dsr:1;
1416 uint64_t cts:1;
1417 uint64_t ddcd:1;
1418 uint64_t teri:1;
1419 uint64_t ddsr:1;
1420 uint64_t dcts:1;
1421 } s;
1422 struct cvmx_mio_uartx_msr_s cn30xx;
1423 struct cvmx_mio_uartx_msr_s cn31xx;
1424 struct cvmx_mio_uartx_msr_s cn38xx;
1425 struct cvmx_mio_uartx_msr_s cn38xxp2;
1426 struct cvmx_mio_uartx_msr_s cn50xx;
1427 struct cvmx_mio_uartx_msr_s cn52xx;
1428 struct cvmx_mio_uartx_msr_s cn52xxp1;
1429 struct cvmx_mio_uartx_msr_s cn56xx;
1430 struct cvmx_mio_uartx_msr_s cn56xxp1;
1431 struct cvmx_mio_uartx_msr_s cn58xx;
1432 struct cvmx_mio_uartx_msr_s cn58xxp1;
1433};
1434
1435union cvmx_mio_uartx_rbr {
1436 uint64_t u64;
1437 struct cvmx_mio_uartx_rbr_s {
1438 uint64_t reserved_8_63:56;
1439 uint64_t rbr:8;
1440 } s;
1441 struct cvmx_mio_uartx_rbr_s cn30xx;
1442 struct cvmx_mio_uartx_rbr_s cn31xx;
1443 struct cvmx_mio_uartx_rbr_s cn38xx;
1444 struct cvmx_mio_uartx_rbr_s cn38xxp2;
1445 struct cvmx_mio_uartx_rbr_s cn50xx;
1446 struct cvmx_mio_uartx_rbr_s cn52xx;
1447 struct cvmx_mio_uartx_rbr_s cn52xxp1;
1448 struct cvmx_mio_uartx_rbr_s cn56xx;
1449 struct cvmx_mio_uartx_rbr_s cn56xxp1;
1450 struct cvmx_mio_uartx_rbr_s cn58xx;
1451 struct cvmx_mio_uartx_rbr_s cn58xxp1;
1452};
1453
1454union cvmx_mio_uartx_rfl {
1455 uint64_t u64;
1456 struct cvmx_mio_uartx_rfl_s {
1457 uint64_t reserved_7_63:57;
1458 uint64_t rfl:7;
1459 } s;
1460 struct cvmx_mio_uartx_rfl_s cn30xx;
1461 struct cvmx_mio_uartx_rfl_s cn31xx;
1462 struct cvmx_mio_uartx_rfl_s cn38xx;
1463 struct cvmx_mio_uartx_rfl_s cn38xxp2;
1464 struct cvmx_mio_uartx_rfl_s cn50xx;
1465 struct cvmx_mio_uartx_rfl_s cn52xx;
1466 struct cvmx_mio_uartx_rfl_s cn52xxp1;
1467 struct cvmx_mio_uartx_rfl_s cn56xx;
1468 struct cvmx_mio_uartx_rfl_s cn56xxp1;
1469 struct cvmx_mio_uartx_rfl_s cn58xx;
1470 struct cvmx_mio_uartx_rfl_s cn58xxp1;
1471};
1472
1473union cvmx_mio_uartx_rfw {
1474 uint64_t u64;
1475 struct cvmx_mio_uartx_rfw_s {
1476 uint64_t reserved_10_63:54;
1477 uint64_t rffe:1;
1478 uint64_t rfpe:1;
1479 uint64_t rfwd:8;
1480 } s;
1481 struct cvmx_mio_uartx_rfw_s cn30xx;
1482 struct cvmx_mio_uartx_rfw_s cn31xx;
1483 struct cvmx_mio_uartx_rfw_s cn38xx;
1484 struct cvmx_mio_uartx_rfw_s cn38xxp2;
1485 struct cvmx_mio_uartx_rfw_s cn50xx;
1486 struct cvmx_mio_uartx_rfw_s cn52xx;
1487 struct cvmx_mio_uartx_rfw_s cn52xxp1;
1488 struct cvmx_mio_uartx_rfw_s cn56xx;
1489 struct cvmx_mio_uartx_rfw_s cn56xxp1;
1490 struct cvmx_mio_uartx_rfw_s cn58xx;
1491 struct cvmx_mio_uartx_rfw_s cn58xxp1;
1492};
1493
1494union cvmx_mio_uartx_sbcr {
1495 uint64_t u64;
1496 struct cvmx_mio_uartx_sbcr_s {
1497 uint64_t reserved_1_63:63;
1498 uint64_t sbcr:1;
1499 } s;
1500 struct cvmx_mio_uartx_sbcr_s cn30xx;
1501 struct cvmx_mio_uartx_sbcr_s cn31xx;
1502 struct cvmx_mio_uartx_sbcr_s cn38xx;
1503 struct cvmx_mio_uartx_sbcr_s cn38xxp2;
1504 struct cvmx_mio_uartx_sbcr_s cn50xx;
1505 struct cvmx_mio_uartx_sbcr_s cn52xx;
1506 struct cvmx_mio_uartx_sbcr_s cn52xxp1;
1507 struct cvmx_mio_uartx_sbcr_s cn56xx;
1508 struct cvmx_mio_uartx_sbcr_s cn56xxp1;
1509 struct cvmx_mio_uartx_sbcr_s cn58xx;
1510 struct cvmx_mio_uartx_sbcr_s cn58xxp1;
1511};
1512
1513union cvmx_mio_uartx_scr {
1514 uint64_t u64;
1515 struct cvmx_mio_uartx_scr_s {
1516 uint64_t reserved_8_63:56;
1517 uint64_t scr:8;
1518 } s;
1519 struct cvmx_mio_uartx_scr_s cn30xx;
1520 struct cvmx_mio_uartx_scr_s cn31xx;
1521 struct cvmx_mio_uartx_scr_s cn38xx;
1522 struct cvmx_mio_uartx_scr_s cn38xxp2;
1523 struct cvmx_mio_uartx_scr_s cn50xx;
1524 struct cvmx_mio_uartx_scr_s cn52xx;
1525 struct cvmx_mio_uartx_scr_s cn52xxp1;
1526 struct cvmx_mio_uartx_scr_s cn56xx;
1527 struct cvmx_mio_uartx_scr_s cn56xxp1;
1528 struct cvmx_mio_uartx_scr_s cn58xx;
1529 struct cvmx_mio_uartx_scr_s cn58xxp1;
1530};
1531
1532union cvmx_mio_uartx_sfe {
1533 uint64_t u64;
1534 struct cvmx_mio_uartx_sfe_s {
1535 uint64_t reserved_1_63:63;
1536 uint64_t sfe:1;
1537 } s;
1538 struct cvmx_mio_uartx_sfe_s cn30xx;
1539 struct cvmx_mio_uartx_sfe_s cn31xx;
1540 struct cvmx_mio_uartx_sfe_s cn38xx;
1541 struct cvmx_mio_uartx_sfe_s cn38xxp2;
1542 struct cvmx_mio_uartx_sfe_s cn50xx;
1543 struct cvmx_mio_uartx_sfe_s cn52xx;
1544 struct cvmx_mio_uartx_sfe_s cn52xxp1;
1545 struct cvmx_mio_uartx_sfe_s cn56xx;
1546 struct cvmx_mio_uartx_sfe_s cn56xxp1;
1547 struct cvmx_mio_uartx_sfe_s cn58xx;
1548 struct cvmx_mio_uartx_sfe_s cn58xxp1;
1549};
1550
1551union cvmx_mio_uartx_srr {
1552 uint64_t u64;
1553 struct cvmx_mio_uartx_srr_s {
1554 uint64_t reserved_3_63:61;
1555 uint64_t stfr:1;
1556 uint64_t srfr:1;
1557 uint64_t usr:1;
1558 } s;
1559 struct cvmx_mio_uartx_srr_s cn30xx;
1560 struct cvmx_mio_uartx_srr_s cn31xx;
1561 struct cvmx_mio_uartx_srr_s cn38xx;
1562 struct cvmx_mio_uartx_srr_s cn38xxp2;
1563 struct cvmx_mio_uartx_srr_s cn50xx;
1564 struct cvmx_mio_uartx_srr_s cn52xx;
1565 struct cvmx_mio_uartx_srr_s cn52xxp1;
1566 struct cvmx_mio_uartx_srr_s cn56xx;
1567 struct cvmx_mio_uartx_srr_s cn56xxp1;
1568 struct cvmx_mio_uartx_srr_s cn58xx;
1569 struct cvmx_mio_uartx_srr_s cn58xxp1;
1570};
1571
1572union cvmx_mio_uartx_srt {
1573 uint64_t u64;
1574 struct cvmx_mio_uartx_srt_s {
1575 uint64_t reserved_2_63:62;
1576 uint64_t srt:2;
1577 } s;
1578 struct cvmx_mio_uartx_srt_s cn30xx;
1579 struct cvmx_mio_uartx_srt_s cn31xx;
1580 struct cvmx_mio_uartx_srt_s cn38xx;
1581 struct cvmx_mio_uartx_srt_s cn38xxp2;
1582 struct cvmx_mio_uartx_srt_s cn50xx;
1583 struct cvmx_mio_uartx_srt_s cn52xx;
1584 struct cvmx_mio_uartx_srt_s cn52xxp1;
1585 struct cvmx_mio_uartx_srt_s cn56xx;
1586 struct cvmx_mio_uartx_srt_s cn56xxp1;
1587 struct cvmx_mio_uartx_srt_s cn58xx;
1588 struct cvmx_mio_uartx_srt_s cn58xxp1;
1589};
1590
1591union cvmx_mio_uartx_srts {
1592 uint64_t u64;
1593 struct cvmx_mio_uartx_srts_s {
1594 uint64_t reserved_1_63:63;
1595 uint64_t srts:1;
1596 } s;
1597 struct cvmx_mio_uartx_srts_s cn30xx;
1598 struct cvmx_mio_uartx_srts_s cn31xx;
1599 struct cvmx_mio_uartx_srts_s cn38xx;
1600 struct cvmx_mio_uartx_srts_s cn38xxp2;
1601 struct cvmx_mio_uartx_srts_s cn50xx;
1602 struct cvmx_mio_uartx_srts_s cn52xx;
1603 struct cvmx_mio_uartx_srts_s cn52xxp1;
1604 struct cvmx_mio_uartx_srts_s cn56xx;
1605 struct cvmx_mio_uartx_srts_s cn56xxp1;
1606 struct cvmx_mio_uartx_srts_s cn58xx;
1607 struct cvmx_mio_uartx_srts_s cn58xxp1;
1608};
1609
1610union cvmx_mio_uartx_stt {
1611 uint64_t u64;
1612 struct cvmx_mio_uartx_stt_s {
1613 uint64_t reserved_2_63:62;
1614 uint64_t stt:2;
1615 } s;
1616 struct cvmx_mio_uartx_stt_s cn30xx;
1617 struct cvmx_mio_uartx_stt_s cn31xx;
1618 struct cvmx_mio_uartx_stt_s cn38xx;
1619 struct cvmx_mio_uartx_stt_s cn38xxp2;
1620 struct cvmx_mio_uartx_stt_s cn50xx;
1621 struct cvmx_mio_uartx_stt_s cn52xx;
1622 struct cvmx_mio_uartx_stt_s cn52xxp1;
1623 struct cvmx_mio_uartx_stt_s cn56xx;
1624 struct cvmx_mio_uartx_stt_s cn56xxp1;
1625 struct cvmx_mio_uartx_stt_s cn58xx;
1626 struct cvmx_mio_uartx_stt_s cn58xxp1;
1627};
1628
1629union cvmx_mio_uartx_tfl {
1630 uint64_t u64;
1631 struct cvmx_mio_uartx_tfl_s {
1632 uint64_t reserved_7_63:57;
1633 uint64_t tfl:7;
1634 } s;
1635 struct cvmx_mio_uartx_tfl_s cn30xx;
1636 struct cvmx_mio_uartx_tfl_s cn31xx;
1637 struct cvmx_mio_uartx_tfl_s cn38xx;
1638 struct cvmx_mio_uartx_tfl_s cn38xxp2;
1639 struct cvmx_mio_uartx_tfl_s cn50xx;
1640 struct cvmx_mio_uartx_tfl_s cn52xx;
1641 struct cvmx_mio_uartx_tfl_s cn52xxp1;
1642 struct cvmx_mio_uartx_tfl_s cn56xx;
1643 struct cvmx_mio_uartx_tfl_s cn56xxp1;
1644 struct cvmx_mio_uartx_tfl_s cn58xx;
1645 struct cvmx_mio_uartx_tfl_s cn58xxp1;
1646};
1647
1648union cvmx_mio_uartx_tfr {
1649 uint64_t u64;
1650 struct cvmx_mio_uartx_tfr_s {
1651 uint64_t reserved_8_63:56;
1652 uint64_t tfr:8;
1653 } s;
1654 struct cvmx_mio_uartx_tfr_s cn30xx;
1655 struct cvmx_mio_uartx_tfr_s cn31xx;
1656 struct cvmx_mio_uartx_tfr_s cn38xx;
1657 struct cvmx_mio_uartx_tfr_s cn38xxp2;
1658 struct cvmx_mio_uartx_tfr_s cn50xx;
1659 struct cvmx_mio_uartx_tfr_s cn52xx;
1660 struct cvmx_mio_uartx_tfr_s cn52xxp1;
1661 struct cvmx_mio_uartx_tfr_s cn56xx;
1662 struct cvmx_mio_uartx_tfr_s cn56xxp1;
1663 struct cvmx_mio_uartx_tfr_s cn58xx;
1664 struct cvmx_mio_uartx_tfr_s cn58xxp1;
1665};
1666
1667union cvmx_mio_uartx_thr {
1668 uint64_t u64;
1669 struct cvmx_mio_uartx_thr_s {
1670 uint64_t reserved_8_63:56;
1671 uint64_t thr:8;
1672 } s;
1673 struct cvmx_mio_uartx_thr_s cn30xx;
1674 struct cvmx_mio_uartx_thr_s cn31xx;
1675 struct cvmx_mio_uartx_thr_s cn38xx;
1676 struct cvmx_mio_uartx_thr_s cn38xxp2;
1677 struct cvmx_mio_uartx_thr_s cn50xx;
1678 struct cvmx_mio_uartx_thr_s cn52xx;
1679 struct cvmx_mio_uartx_thr_s cn52xxp1;
1680 struct cvmx_mio_uartx_thr_s cn56xx;
1681 struct cvmx_mio_uartx_thr_s cn56xxp1;
1682 struct cvmx_mio_uartx_thr_s cn58xx;
1683 struct cvmx_mio_uartx_thr_s cn58xxp1;
1684};
1685
1686union cvmx_mio_uartx_usr {
1687 uint64_t u64;
1688 struct cvmx_mio_uartx_usr_s {
1689 uint64_t reserved_5_63:59;
1690 uint64_t rff:1;
1691 uint64_t rfne:1;
1692 uint64_t tfe:1;
1693 uint64_t tfnf:1;
1694 uint64_t busy:1;
1695 } s;
1696 struct cvmx_mio_uartx_usr_s cn30xx;
1697 struct cvmx_mio_uartx_usr_s cn31xx;
1698 struct cvmx_mio_uartx_usr_s cn38xx;
1699 struct cvmx_mio_uartx_usr_s cn38xxp2;
1700 struct cvmx_mio_uartx_usr_s cn50xx;
1701 struct cvmx_mio_uartx_usr_s cn52xx;
1702 struct cvmx_mio_uartx_usr_s cn52xxp1;
1703 struct cvmx_mio_uartx_usr_s cn56xx;
1704 struct cvmx_mio_uartx_usr_s cn56xxp1;
1705 struct cvmx_mio_uartx_usr_s cn58xx;
1706 struct cvmx_mio_uartx_usr_s cn58xxp1;
1707};
1708
1709union cvmx_mio_uart2_dlh {
1710 uint64_t u64;
1711 struct cvmx_mio_uart2_dlh_s {
1712 uint64_t reserved_8_63:56;
1713 uint64_t dlh:8;
1714 } s;
1715 struct cvmx_mio_uart2_dlh_s cn52xx;
1716 struct cvmx_mio_uart2_dlh_s cn52xxp1;
1717};
1718
1719union cvmx_mio_uart2_dll {
1720 uint64_t u64;
1721 struct cvmx_mio_uart2_dll_s {
1722 uint64_t reserved_8_63:56;
1723 uint64_t dll:8;
1724 } s;
1725 struct cvmx_mio_uart2_dll_s cn52xx;
1726 struct cvmx_mio_uart2_dll_s cn52xxp1;
1727};
1728
1729union cvmx_mio_uart2_far {
1730 uint64_t u64;
1731 struct cvmx_mio_uart2_far_s {
1732 uint64_t reserved_1_63:63;
1733 uint64_t far:1;
1734 } s;
1735 struct cvmx_mio_uart2_far_s cn52xx;
1736 struct cvmx_mio_uart2_far_s cn52xxp1;
1737};
1738
1739union cvmx_mio_uart2_fcr {
1740 uint64_t u64;
1741 struct cvmx_mio_uart2_fcr_s {
1742 uint64_t reserved_8_63:56;
1743 uint64_t rxtrig:2;
1744 uint64_t txtrig:2;
1745 uint64_t reserved_3_3:1;
1746 uint64_t txfr:1;
1747 uint64_t rxfr:1;
1748 uint64_t en:1;
1749 } s;
1750 struct cvmx_mio_uart2_fcr_s cn52xx;
1751 struct cvmx_mio_uart2_fcr_s cn52xxp1;
1752};
1753
1754union cvmx_mio_uart2_htx {
1755 uint64_t u64;
1756 struct cvmx_mio_uart2_htx_s {
1757 uint64_t reserved_1_63:63;
1758 uint64_t htx:1;
1759 } s;
1760 struct cvmx_mio_uart2_htx_s cn52xx;
1761 struct cvmx_mio_uart2_htx_s cn52xxp1;
1762};
1763
1764union cvmx_mio_uart2_ier {
1765 uint64_t u64;
1766 struct cvmx_mio_uart2_ier_s {
1767 uint64_t reserved_8_63:56;
1768 uint64_t ptime:1;
1769 uint64_t reserved_4_6:3;
1770 uint64_t edssi:1;
1771 uint64_t elsi:1;
1772 uint64_t etbei:1;
1773 uint64_t erbfi:1;
1774 } s;
1775 struct cvmx_mio_uart2_ier_s cn52xx;
1776 struct cvmx_mio_uart2_ier_s cn52xxp1;
1777};
1778
1779union cvmx_mio_uart2_iir {
1780 uint64_t u64;
1781 struct cvmx_mio_uart2_iir_s {
1782 uint64_t reserved_8_63:56;
1783 uint64_t fen:2;
1784 uint64_t reserved_4_5:2;
1785 uint64_t iid:4;
1786 } s;
1787 struct cvmx_mio_uart2_iir_s cn52xx;
1788 struct cvmx_mio_uart2_iir_s cn52xxp1;
1789};
1790
1791union cvmx_mio_uart2_lcr {
1792 uint64_t u64;
1793 struct cvmx_mio_uart2_lcr_s {
1794 uint64_t reserved_8_63:56;
1795 uint64_t dlab:1;
1796 uint64_t brk:1;
1797 uint64_t reserved_5_5:1;
1798 uint64_t eps:1;
1799 uint64_t pen:1;
1800 uint64_t stop:1;
1801 uint64_t cls:2;
1802 } s;
1803 struct cvmx_mio_uart2_lcr_s cn52xx;
1804 struct cvmx_mio_uart2_lcr_s cn52xxp1;
1805};
1806
1807union cvmx_mio_uart2_lsr {
1808 uint64_t u64;
1809 struct cvmx_mio_uart2_lsr_s {
1810 uint64_t reserved_8_63:56;
1811 uint64_t ferr:1;
1812 uint64_t temt:1;
1813 uint64_t thre:1;
1814 uint64_t bi:1;
1815 uint64_t fe:1;
1816 uint64_t pe:1;
1817 uint64_t oe:1;
1818 uint64_t dr:1;
1819 } s;
1820 struct cvmx_mio_uart2_lsr_s cn52xx;
1821 struct cvmx_mio_uart2_lsr_s cn52xxp1;
1822};
1823
1824union cvmx_mio_uart2_mcr {
1825 uint64_t u64;
1826 struct cvmx_mio_uart2_mcr_s {
1827 uint64_t reserved_6_63:58;
1828 uint64_t afce:1;
1829 uint64_t loop:1;
1830 uint64_t out2:1;
1831 uint64_t out1:1;
1832 uint64_t rts:1;
1833 uint64_t dtr:1;
1834 } s;
1835 struct cvmx_mio_uart2_mcr_s cn52xx;
1836 struct cvmx_mio_uart2_mcr_s cn52xxp1;
1837};
1838
1839union cvmx_mio_uart2_msr {
1840 uint64_t u64;
1841 struct cvmx_mio_uart2_msr_s {
1842 uint64_t reserved_8_63:56;
1843 uint64_t dcd:1;
1844 uint64_t ri:1;
1845 uint64_t dsr:1;
1846 uint64_t cts:1;
1847 uint64_t ddcd:1;
1848 uint64_t teri:1;
1849 uint64_t ddsr:1;
1850 uint64_t dcts:1;
1851 } s;
1852 struct cvmx_mio_uart2_msr_s cn52xx;
1853 struct cvmx_mio_uart2_msr_s cn52xxp1;
1854};
1855
1856union cvmx_mio_uart2_rbr {
1857 uint64_t u64;
1858 struct cvmx_mio_uart2_rbr_s {
1859 uint64_t reserved_8_63:56;
1860 uint64_t rbr:8;
1861 } s;
1862 struct cvmx_mio_uart2_rbr_s cn52xx;
1863 struct cvmx_mio_uart2_rbr_s cn52xxp1;
1864};
1865
1866union cvmx_mio_uart2_rfl {
1867 uint64_t u64;
1868 struct cvmx_mio_uart2_rfl_s {
1869 uint64_t reserved_7_63:57;
1870 uint64_t rfl:7;
1871 } s;
1872 struct cvmx_mio_uart2_rfl_s cn52xx;
1873 struct cvmx_mio_uart2_rfl_s cn52xxp1;
1874};
1875
1876union cvmx_mio_uart2_rfw {
1877 uint64_t u64;
1878 struct cvmx_mio_uart2_rfw_s {
1879 uint64_t reserved_10_63:54;
1880 uint64_t rffe:1;
1881 uint64_t rfpe:1;
1882 uint64_t rfwd:8;
1883 } s;
1884 struct cvmx_mio_uart2_rfw_s cn52xx;
1885 struct cvmx_mio_uart2_rfw_s cn52xxp1;
1886};
1887
1888union cvmx_mio_uart2_sbcr {
1889 uint64_t u64;
1890 struct cvmx_mio_uart2_sbcr_s {
1891 uint64_t reserved_1_63:63;
1892 uint64_t sbcr:1;
1893 } s;
1894 struct cvmx_mio_uart2_sbcr_s cn52xx;
1895 struct cvmx_mio_uart2_sbcr_s cn52xxp1;
1896};
1897
1898union cvmx_mio_uart2_scr {
1899 uint64_t u64;
1900 struct cvmx_mio_uart2_scr_s {
1901 uint64_t reserved_8_63:56;
1902 uint64_t scr:8;
1903 } s;
1904 struct cvmx_mio_uart2_scr_s cn52xx;
1905 struct cvmx_mio_uart2_scr_s cn52xxp1;
1906};
1907
1908union cvmx_mio_uart2_sfe {
1909 uint64_t u64;
1910 struct cvmx_mio_uart2_sfe_s {
1911 uint64_t reserved_1_63:63;
1912 uint64_t sfe:1;
1913 } s;
1914 struct cvmx_mio_uart2_sfe_s cn52xx;
1915 struct cvmx_mio_uart2_sfe_s cn52xxp1;
1916};
1917
1918union cvmx_mio_uart2_srr {
1919 uint64_t u64;
1920 struct cvmx_mio_uart2_srr_s {
1921 uint64_t reserved_3_63:61;
1922 uint64_t stfr:1;
1923 uint64_t srfr:1;
1924 uint64_t usr:1;
1925 } s;
1926 struct cvmx_mio_uart2_srr_s cn52xx;
1927 struct cvmx_mio_uart2_srr_s cn52xxp1;
1928};
1929
1930union cvmx_mio_uart2_srt {
1931 uint64_t u64;
1932 struct cvmx_mio_uart2_srt_s {
1933 uint64_t reserved_2_63:62;
1934 uint64_t srt:2;
1935 } s;
1936 struct cvmx_mio_uart2_srt_s cn52xx;
1937 struct cvmx_mio_uart2_srt_s cn52xxp1;
1938};
1939
1940union cvmx_mio_uart2_srts {
1941 uint64_t u64;
1942 struct cvmx_mio_uart2_srts_s {
1943 uint64_t reserved_1_63:63;
1944 uint64_t srts:1;
1945 } s;
1946 struct cvmx_mio_uart2_srts_s cn52xx;
1947 struct cvmx_mio_uart2_srts_s cn52xxp1;
1948};
1949
1950union cvmx_mio_uart2_stt {
1951 uint64_t u64;
1952 struct cvmx_mio_uart2_stt_s {
1953 uint64_t reserved_2_63:62;
1954 uint64_t stt:2;
1955 } s;
1956 struct cvmx_mio_uart2_stt_s cn52xx;
1957 struct cvmx_mio_uart2_stt_s cn52xxp1;
1958};
1959
1960union cvmx_mio_uart2_tfl {
1961 uint64_t u64;
1962 struct cvmx_mio_uart2_tfl_s {
1963 uint64_t reserved_7_63:57;
1964 uint64_t tfl:7;
1965 } s;
1966 struct cvmx_mio_uart2_tfl_s cn52xx;
1967 struct cvmx_mio_uart2_tfl_s cn52xxp1;
1968};
1969
1970union cvmx_mio_uart2_tfr {
1971 uint64_t u64;
1972 struct cvmx_mio_uart2_tfr_s {
1973 uint64_t reserved_8_63:56;
1974 uint64_t tfr:8;
1975 } s;
1976 struct cvmx_mio_uart2_tfr_s cn52xx;
1977 struct cvmx_mio_uart2_tfr_s cn52xxp1;
1978};
1979
1980union cvmx_mio_uart2_thr {
1981 uint64_t u64;
1982 struct cvmx_mio_uart2_thr_s {
1983 uint64_t reserved_8_63:56;
1984 uint64_t thr:8;
1985 } s;
1986 struct cvmx_mio_uart2_thr_s cn52xx;
1987 struct cvmx_mio_uart2_thr_s cn52xxp1;
1988};
1989
1990union cvmx_mio_uart2_usr {
1991 uint64_t u64;
1992 struct cvmx_mio_uart2_usr_s {
1993 uint64_t reserved_5_63:59;
1994 uint64_t rff:1;
1995 uint64_t rfne:1;
1996 uint64_t tfe:1;
1997 uint64_t tfnf:1;
1998 uint64_t busy:1;
1999 } s;
2000 struct cvmx_mio_uart2_usr_s cn52xx;
2001 struct cvmx_mio_uart2_usr_s cn52xxp1;
2002};
2003
2004#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-packet.h b/arch/mips/include/asm/octeon/cvmx-packet.h
new file mode 100644
index 000000000000..38aefa1bab9d
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-packet.h
@@ -0,0 +1,61 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 * Packet buffer defines.
30 */
31
32#ifndef __CVMX_PACKET_H__
33#define __CVMX_PACKET_H__
34
35/**
36 * This structure defines a buffer pointer on Octeon
37 */
38union cvmx_buf_ptr {
39 void *ptr;
40 uint64_t u64;
41 struct {
42 /* if set, invert the "free" pick of the overall
43 * packet. HW always sets this bit to 0 on inbound
44 * packet */
45 uint64_t i:1;
46
47 /* Indicates the amount to back up to get to the
48 * buffer start in cache lines. In most cases this is
49 * less than one complete cache line, so the value is
50 * zero */
51 uint64_t back:4;
52 /* The pool that the buffer came from / goes to */
53 uint64_t pool:3;
54 /* The size of the segment pointed to by addr (in bytes) */
55 uint64_t size:16;
56 /* Pointer to the first byte of the data, NOT buffer */
57 uint64_t addr:40;
58 } s;
59};
60
61#endif /* __CVMX_PACKET_H__ */
diff --git a/arch/mips/include/asm/octeon/cvmx-pow-defs.h b/arch/mips/include/asm/octeon/cvmx-pow-defs.h
new file mode 100644
index 000000000000..2d82e24be51c
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-pow-defs.h
@@ -0,0 +1,698 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_POW_DEFS_H__
29#define __CVMX_POW_DEFS_H__
30
31#define CVMX_POW_BIST_STAT \
32 CVMX_ADD_IO_SEG(0x00016700000003F8ull)
33#define CVMX_POW_DS_PC \
34 CVMX_ADD_IO_SEG(0x0001670000000398ull)
35#define CVMX_POW_ECC_ERR \
36 CVMX_ADD_IO_SEG(0x0001670000000218ull)
37#define CVMX_POW_INT_CTL \
38 CVMX_ADD_IO_SEG(0x0001670000000220ull)
39#define CVMX_POW_IQ_CNTX(offset) \
40 CVMX_ADD_IO_SEG(0x0001670000000340ull + (((offset) & 7) * 8))
41#define CVMX_POW_IQ_COM_CNT \
42 CVMX_ADD_IO_SEG(0x0001670000000388ull)
43#define CVMX_POW_IQ_INT \
44 CVMX_ADD_IO_SEG(0x0001670000000238ull)
45#define CVMX_POW_IQ_INT_EN \
46 CVMX_ADD_IO_SEG(0x0001670000000240ull)
47#define CVMX_POW_IQ_THRX(offset) \
48 CVMX_ADD_IO_SEG(0x00016700000003A0ull + (((offset) & 7) * 8))
49#define CVMX_POW_NOS_CNT \
50 CVMX_ADD_IO_SEG(0x0001670000000228ull)
51#define CVMX_POW_NW_TIM \
52 CVMX_ADD_IO_SEG(0x0001670000000210ull)
53#define CVMX_POW_PF_RST_MSK \
54 CVMX_ADD_IO_SEG(0x0001670000000230ull)
55#define CVMX_POW_PP_GRP_MSKX(offset) \
56 CVMX_ADD_IO_SEG(0x0001670000000000ull + (((offset) & 15) * 8))
57#define CVMX_POW_QOS_RNDX(offset) \
58 CVMX_ADD_IO_SEG(0x00016700000001C0ull + (((offset) & 7) * 8))
59#define CVMX_POW_QOS_THRX(offset) \
60 CVMX_ADD_IO_SEG(0x0001670000000180ull + (((offset) & 7) * 8))
61#define CVMX_POW_TS_PC \
62 CVMX_ADD_IO_SEG(0x0001670000000390ull)
63#define CVMX_POW_WA_COM_PC \
64 CVMX_ADD_IO_SEG(0x0001670000000380ull)
65#define CVMX_POW_WA_PCX(offset) \
66 CVMX_ADD_IO_SEG(0x0001670000000300ull + (((offset) & 7) * 8))
67#define CVMX_POW_WQ_INT \
68 CVMX_ADD_IO_SEG(0x0001670000000200ull)
69#define CVMX_POW_WQ_INT_CNTX(offset) \
70 CVMX_ADD_IO_SEG(0x0001670000000100ull + (((offset) & 15) * 8))
71#define CVMX_POW_WQ_INT_PC \
72 CVMX_ADD_IO_SEG(0x0001670000000208ull)
73#define CVMX_POW_WQ_INT_THRX(offset) \
74 CVMX_ADD_IO_SEG(0x0001670000000080ull + (((offset) & 15) * 8))
75#define CVMX_POW_WS_PCX(offset) \
76 CVMX_ADD_IO_SEG(0x0001670000000280ull + (((offset) & 15) * 8))
77
78union cvmx_pow_bist_stat {
79 uint64_t u64;
80 struct cvmx_pow_bist_stat_s {
81 uint64_t reserved_32_63:32;
82 uint64_t pp:16;
83 uint64_t reserved_0_15:16;
84 } s;
85 struct cvmx_pow_bist_stat_cn30xx {
86 uint64_t reserved_17_63:47;
87 uint64_t pp:1;
88 uint64_t reserved_9_15:7;
89 uint64_t cam:1;
90 uint64_t nbt1:1;
91 uint64_t nbt0:1;
92 uint64_t index:1;
93 uint64_t fidx:1;
94 uint64_t nbr1:1;
95 uint64_t nbr0:1;
96 uint64_t pend:1;
97 uint64_t adr:1;
98 } cn30xx;
99 struct cvmx_pow_bist_stat_cn31xx {
100 uint64_t reserved_18_63:46;
101 uint64_t pp:2;
102 uint64_t reserved_9_15:7;
103 uint64_t cam:1;
104 uint64_t nbt1:1;
105 uint64_t nbt0:1;
106 uint64_t index:1;
107 uint64_t fidx:1;
108 uint64_t nbr1:1;
109 uint64_t nbr0:1;
110 uint64_t pend:1;
111 uint64_t adr:1;
112 } cn31xx;
113 struct cvmx_pow_bist_stat_cn38xx {
114 uint64_t reserved_32_63:32;
115 uint64_t pp:16;
116 uint64_t reserved_10_15:6;
117 uint64_t cam:1;
118 uint64_t nbt:1;
119 uint64_t index:1;
120 uint64_t fidx:1;
121 uint64_t nbr1:1;
122 uint64_t nbr0:1;
123 uint64_t pend1:1;
124 uint64_t pend0:1;
125 uint64_t adr1:1;
126 uint64_t adr0:1;
127 } cn38xx;
128 struct cvmx_pow_bist_stat_cn38xx cn38xxp2;
129 struct cvmx_pow_bist_stat_cn31xx cn50xx;
130 struct cvmx_pow_bist_stat_cn52xx {
131 uint64_t reserved_20_63:44;
132 uint64_t pp:4;
133 uint64_t reserved_9_15:7;
134 uint64_t cam:1;
135 uint64_t nbt1:1;
136 uint64_t nbt0:1;
137 uint64_t index:1;
138 uint64_t fidx:1;
139 uint64_t nbr1:1;
140 uint64_t nbr0:1;
141 uint64_t pend:1;
142 uint64_t adr:1;
143 } cn52xx;
144 struct cvmx_pow_bist_stat_cn52xx cn52xxp1;
145 struct cvmx_pow_bist_stat_cn56xx {
146 uint64_t reserved_28_63:36;
147 uint64_t pp:12;
148 uint64_t reserved_10_15:6;
149 uint64_t cam:1;
150 uint64_t nbt:1;
151 uint64_t index:1;
152 uint64_t fidx:1;
153 uint64_t nbr1:1;
154 uint64_t nbr0:1;
155 uint64_t pend1:1;
156 uint64_t pend0:1;
157 uint64_t adr1:1;
158 uint64_t adr0:1;
159 } cn56xx;
160 struct cvmx_pow_bist_stat_cn56xx cn56xxp1;
161 struct cvmx_pow_bist_stat_cn38xx cn58xx;
162 struct cvmx_pow_bist_stat_cn38xx cn58xxp1;
163};
164
165union cvmx_pow_ds_pc {
166 uint64_t u64;
167 struct cvmx_pow_ds_pc_s {
168 uint64_t reserved_32_63:32;
169 uint64_t ds_pc:32;
170 } s;
171 struct cvmx_pow_ds_pc_s cn30xx;
172 struct cvmx_pow_ds_pc_s cn31xx;
173 struct cvmx_pow_ds_pc_s cn38xx;
174 struct cvmx_pow_ds_pc_s cn38xxp2;
175 struct cvmx_pow_ds_pc_s cn50xx;
176 struct cvmx_pow_ds_pc_s cn52xx;
177 struct cvmx_pow_ds_pc_s cn52xxp1;
178 struct cvmx_pow_ds_pc_s cn56xx;
179 struct cvmx_pow_ds_pc_s cn56xxp1;
180 struct cvmx_pow_ds_pc_s cn58xx;
181 struct cvmx_pow_ds_pc_s cn58xxp1;
182};
183
184union cvmx_pow_ecc_err {
185 uint64_t u64;
186 struct cvmx_pow_ecc_err_s {
187 uint64_t reserved_45_63:19;
188 uint64_t iop_ie:13;
189 uint64_t reserved_29_31:3;
190 uint64_t iop:13;
191 uint64_t reserved_14_15:2;
192 uint64_t rpe_ie:1;
193 uint64_t rpe:1;
194 uint64_t reserved_9_11:3;
195 uint64_t syn:5;
196 uint64_t dbe_ie:1;
197 uint64_t sbe_ie:1;
198 uint64_t dbe:1;
199 uint64_t sbe:1;
200 } s;
201 struct cvmx_pow_ecc_err_s cn30xx;
202 struct cvmx_pow_ecc_err_cn31xx {
203 uint64_t reserved_14_63:50;
204 uint64_t rpe_ie:1;
205 uint64_t rpe:1;
206 uint64_t reserved_9_11:3;
207 uint64_t syn:5;
208 uint64_t dbe_ie:1;
209 uint64_t sbe_ie:1;
210 uint64_t dbe:1;
211 uint64_t sbe:1;
212 } cn31xx;
213 struct cvmx_pow_ecc_err_s cn38xx;
214 struct cvmx_pow_ecc_err_cn31xx cn38xxp2;
215 struct cvmx_pow_ecc_err_s cn50xx;
216 struct cvmx_pow_ecc_err_s cn52xx;
217 struct cvmx_pow_ecc_err_s cn52xxp1;
218 struct cvmx_pow_ecc_err_s cn56xx;
219 struct cvmx_pow_ecc_err_s cn56xxp1;
220 struct cvmx_pow_ecc_err_s cn58xx;
221 struct cvmx_pow_ecc_err_s cn58xxp1;
222};
223
224union cvmx_pow_int_ctl {
225 uint64_t u64;
226 struct cvmx_pow_int_ctl_s {
227 uint64_t reserved_6_63:58;
228 uint64_t pfr_dis:1;
229 uint64_t nbr_thr:5;
230 } s;
231 struct cvmx_pow_int_ctl_s cn30xx;
232 struct cvmx_pow_int_ctl_s cn31xx;
233 struct cvmx_pow_int_ctl_s cn38xx;
234 struct cvmx_pow_int_ctl_s cn38xxp2;
235 struct cvmx_pow_int_ctl_s cn50xx;
236 struct cvmx_pow_int_ctl_s cn52xx;
237 struct cvmx_pow_int_ctl_s cn52xxp1;
238 struct cvmx_pow_int_ctl_s cn56xx;
239 struct cvmx_pow_int_ctl_s cn56xxp1;
240 struct cvmx_pow_int_ctl_s cn58xx;
241 struct cvmx_pow_int_ctl_s cn58xxp1;
242};
243
244union cvmx_pow_iq_cntx {
245 uint64_t u64;
246 struct cvmx_pow_iq_cntx_s {
247 uint64_t reserved_32_63:32;
248 uint64_t iq_cnt:32;
249 } s;
250 struct cvmx_pow_iq_cntx_s cn30xx;
251 struct cvmx_pow_iq_cntx_s cn31xx;
252 struct cvmx_pow_iq_cntx_s cn38xx;
253 struct cvmx_pow_iq_cntx_s cn38xxp2;
254 struct cvmx_pow_iq_cntx_s cn50xx;
255 struct cvmx_pow_iq_cntx_s cn52xx;
256 struct cvmx_pow_iq_cntx_s cn52xxp1;
257 struct cvmx_pow_iq_cntx_s cn56xx;
258 struct cvmx_pow_iq_cntx_s cn56xxp1;
259 struct cvmx_pow_iq_cntx_s cn58xx;
260 struct cvmx_pow_iq_cntx_s cn58xxp1;
261};
262
263union cvmx_pow_iq_com_cnt {
264 uint64_t u64;
265 struct cvmx_pow_iq_com_cnt_s {
266 uint64_t reserved_32_63:32;
267 uint64_t iq_cnt:32;
268 } s;
269 struct cvmx_pow_iq_com_cnt_s cn30xx;
270 struct cvmx_pow_iq_com_cnt_s cn31xx;
271 struct cvmx_pow_iq_com_cnt_s cn38xx;
272 struct cvmx_pow_iq_com_cnt_s cn38xxp2;
273 struct cvmx_pow_iq_com_cnt_s cn50xx;
274 struct cvmx_pow_iq_com_cnt_s cn52xx;
275 struct cvmx_pow_iq_com_cnt_s cn52xxp1;
276 struct cvmx_pow_iq_com_cnt_s cn56xx;
277 struct cvmx_pow_iq_com_cnt_s cn56xxp1;
278 struct cvmx_pow_iq_com_cnt_s cn58xx;
279 struct cvmx_pow_iq_com_cnt_s cn58xxp1;
280};
281
282union cvmx_pow_iq_int {
283 uint64_t u64;
284 struct cvmx_pow_iq_int_s {
285 uint64_t reserved_8_63:56;
286 uint64_t iq_int:8;
287 } s;
288 struct cvmx_pow_iq_int_s cn52xx;
289 struct cvmx_pow_iq_int_s cn52xxp1;
290 struct cvmx_pow_iq_int_s cn56xx;
291 struct cvmx_pow_iq_int_s cn56xxp1;
292};
293
294union cvmx_pow_iq_int_en {
295 uint64_t u64;
296 struct cvmx_pow_iq_int_en_s {
297 uint64_t reserved_8_63:56;
298 uint64_t int_en:8;
299 } s;
300 struct cvmx_pow_iq_int_en_s cn52xx;
301 struct cvmx_pow_iq_int_en_s cn52xxp1;
302 struct cvmx_pow_iq_int_en_s cn56xx;
303 struct cvmx_pow_iq_int_en_s cn56xxp1;
304};
305
306union cvmx_pow_iq_thrx {
307 uint64_t u64;
308 struct cvmx_pow_iq_thrx_s {
309 uint64_t reserved_32_63:32;
310 uint64_t iq_thr:32;
311 } s;
312 struct cvmx_pow_iq_thrx_s cn52xx;
313 struct cvmx_pow_iq_thrx_s cn52xxp1;
314 struct cvmx_pow_iq_thrx_s cn56xx;
315 struct cvmx_pow_iq_thrx_s cn56xxp1;
316};
317
318union cvmx_pow_nos_cnt {
319 uint64_t u64;
320 struct cvmx_pow_nos_cnt_s {
321 uint64_t reserved_12_63:52;
322 uint64_t nos_cnt:12;
323 } s;
324 struct cvmx_pow_nos_cnt_cn30xx {
325 uint64_t reserved_7_63:57;
326 uint64_t nos_cnt:7;
327 } cn30xx;
328 struct cvmx_pow_nos_cnt_cn31xx {
329 uint64_t reserved_9_63:55;
330 uint64_t nos_cnt:9;
331 } cn31xx;
332 struct cvmx_pow_nos_cnt_s cn38xx;
333 struct cvmx_pow_nos_cnt_s cn38xxp2;
334 struct cvmx_pow_nos_cnt_cn31xx cn50xx;
335 struct cvmx_pow_nos_cnt_cn52xx {
336 uint64_t reserved_10_63:54;
337 uint64_t nos_cnt:10;
338 } cn52xx;
339 struct cvmx_pow_nos_cnt_cn52xx cn52xxp1;
340 struct cvmx_pow_nos_cnt_s cn56xx;
341 struct cvmx_pow_nos_cnt_s cn56xxp1;
342 struct cvmx_pow_nos_cnt_s cn58xx;
343 struct cvmx_pow_nos_cnt_s cn58xxp1;
344};
345
346union cvmx_pow_nw_tim {
347 uint64_t u64;
348 struct cvmx_pow_nw_tim_s {
349 uint64_t reserved_10_63:54;
350 uint64_t nw_tim:10;
351 } s;
352 struct cvmx_pow_nw_tim_s cn30xx;
353 struct cvmx_pow_nw_tim_s cn31xx;
354 struct cvmx_pow_nw_tim_s cn38xx;
355 struct cvmx_pow_nw_tim_s cn38xxp2;
356 struct cvmx_pow_nw_tim_s cn50xx;
357 struct cvmx_pow_nw_tim_s cn52xx;
358 struct cvmx_pow_nw_tim_s cn52xxp1;
359 struct cvmx_pow_nw_tim_s cn56xx;
360 struct cvmx_pow_nw_tim_s cn56xxp1;
361 struct cvmx_pow_nw_tim_s cn58xx;
362 struct cvmx_pow_nw_tim_s cn58xxp1;
363};
364
365union cvmx_pow_pf_rst_msk {
366 uint64_t u64;
367 struct cvmx_pow_pf_rst_msk_s {
368 uint64_t reserved_8_63:56;
369 uint64_t rst_msk:8;
370 } s;
371 struct cvmx_pow_pf_rst_msk_s cn50xx;
372 struct cvmx_pow_pf_rst_msk_s cn52xx;
373 struct cvmx_pow_pf_rst_msk_s cn52xxp1;
374 struct cvmx_pow_pf_rst_msk_s cn56xx;
375 struct cvmx_pow_pf_rst_msk_s cn56xxp1;
376 struct cvmx_pow_pf_rst_msk_s cn58xx;
377 struct cvmx_pow_pf_rst_msk_s cn58xxp1;
378};
379
380union cvmx_pow_pp_grp_mskx {
381 uint64_t u64;
382 struct cvmx_pow_pp_grp_mskx_s {
383 uint64_t reserved_48_63:16;
384 uint64_t qos7_pri:4;
385 uint64_t qos6_pri:4;
386 uint64_t qos5_pri:4;
387 uint64_t qos4_pri:4;
388 uint64_t qos3_pri:4;
389 uint64_t qos2_pri:4;
390 uint64_t qos1_pri:4;
391 uint64_t qos0_pri:4;
392 uint64_t grp_msk:16;
393 } s;
394 struct cvmx_pow_pp_grp_mskx_cn30xx {
395 uint64_t reserved_16_63:48;
396 uint64_t grp_msk:16;
397 } cn30xx;
398 struct cvmx_pow_pp_grp_mskx_cn30xx cn31xx;
399 struct cvmx_pow_pp_grp_mskx_cn30xx cn38xx;
400 struct cvmx_pow_pp_grp_mskx_cn30xx cn38xxp2;
401 struct cvmx_pow_pp_grp_mskx_s cn50xx;
402 struct cvmx_pow_pp_grp_mskx_s cn52xx;
403 struct cvmx_pow_pp_grp_mskx_s cn52xxp1;
404 struct cvmx_pow_pp_grp_mskx_s cn56xx;
405 struct cvmx_pow_pp_grp_mskx_s cn56xxp1;
406 struct cvmx_pow_pp_grp_mskx_s cn58xx;
407 struct cvmx_pow_pp_grp_mskx_s cn58xxp1;
408};
409
410union cvmx_pow_qos_rndx {
411 uint64_t u64;
412 struct cvmx_pow_qos_rndx_s {
413 uint64_t reserved_32_63:32;
414 uint64_t rnd_p3:8;
415 uint64_t rnd_p2:8;
416 uint64_t rnd_p1:8;
417 uint64_t rnd:8;
418 } s;
419 struct cvmx_pow_qos_rndx_s cn30xx;
420 struct cvmx_pow_qos_rndx_s cn31xx;
421 struct cvmx_pow_qos_rndx_s cn38xx;
422 struct cvmx_pow_qos_rndx_s cn38xxp2;
423 struct cvmx_pow_qos_rndx_s cn50xx;
424 struct cvmx_pow_qos_rndx_s cn52xx;
425 struct cvmx_pow_qos_rndx_s cn52xxp1;
426 struct cvmx_pow_qos_rndx_s cn56xx;
427 struct cvmx_pow_qos_rndx_s cn56xxp1;
428 struct cvmx_pow_qos_rndx_s cn58xx;
429 struct cvmx_pow_qos_rndx_s cn58xxp1;
430};
431
432union cvmx_pow_qos_thrx {
433 uint64_t u64;
434 struct cvmx_pow_qos_thrx_s {
435 uint64_t reserved_60_63:4;
436 uint64_t des_cnt:12;
437 uint64_t buf_cnt:12;
438 uint64_t free_cnt:12;
439 uint64_t reserved_23_23:1;
440 uint64_t max_thr:11;
441 uint64_t reserved_11_11:1;
442 uint64_t min_thr:11;
443 } s;
444 struct cvmx_pow_qos_thrx_cn30xx {
445 uint64_t reserved_55_63:9;
446 uint64_t des_cnt:7;
447 uint64_t reserved_43_47:5;
448 uint64_t buf_cnt:7;
449 uint64_t reserved_31_35:5;
450 uint64_t free_cnt:7;
451 uint64_t reserved_18_23:6;
452 uint64_t max_thr:6;
453 uint64_t reserved_6_11:6;
454 uint64_t min_thr:6;
455 } cn30xx;
456 struct cvmx_pow_qos_thrx_cn31xx {
457 uint64_t reserved_57_63:7;
458 uint64_t des_cnt:9;
459 uint64_t reserved_45_47:3;
460 uint64_t buf_cnt:9;
461 uint64_t reserved_33_35:3;
462 uint64_t free_cnt:9;
463 uint64_t reserved_20_23:4;
464 uint64_t max_thr:8;
465 uint64_t reserved_8_11:4;
466 uint64_t min_thr:8;
467 } cn31xx;
468 struct cvmx_pow_qos_thrx_s cn38xx;
469 struct cvmx_pow_qos_thrx_s cn38xxp2;
470 struct cvmx_pow_qos_thrx_cn31xx cn50xx;
471 struct cvmx_pow_qos_thrx_cn52xx {
472 uint64_t reserved_58_63:6;
473 uint64_t des_cnt:10;
474 uint64_t reserved_46_47:2;
475 uint64_t buf_cnt:10;
476 uint64_t reserved_34_35:2;
477 uint64_t free_cnt:10;
478 uint64_t reserved_21_23:3;
479 uint64_t max_thr:9;
480 uint64_t reserved_9_11:3;
481 uint64_t min_thr:9;
482 } cn52xx;
483 struct cvmx_pow_qos_thrx_cn52xx cn52xxp1;
484 struct cvmx_pow_qos_thrx_s cn56xx;
485 struct cvmx_pow_qos_thrx_s cn56xxp1;
486 struct cvmx_pow_qos_thrx_s cn58xx;
487 struct cvmx_pow_qos_thrx_s cn58xxp1;
488};
489
490union cvmx_pow_ts_pc {
491 uint64_t u64;
492 struct cvmx_pow_ts_pc_s {
493 uint64_t reserved_32_63:32;
494 uint64_t ts_pc:32;
495 } s;
496 struct cvmx_pow_ts_pc_s cn30xx;
497 struct cvmx_pow_ts_pc_s cn31xx;
498 struct cvmx_pow_ts_pc_s cn38xx;
499 struct cvmx_pow_ts_pc_s cn38xxp2;
500 struct cvmx_pow_ts_pc_s cn50xx;
501 struct cvmx_pow_ts_pc_s cn52xx;
502 struct cvmx_pow_ts_pc_s cn52xxp1;
503 struct cvmx_pow_ts_pc_s cn56xx;
504 struct cvmx_pow_ts_pc_s cn56xxp1;
505 struct cvmx_pow_ts_pc_s cn58xx;
506 struct cvmx_pow_ts_pc_s cn58xxp1;
507};
508
509union cvmx_pow_wa_com_pc {
510 uint64_t u64;
511 struct cvmx_pow_wa_com_pc_s {
512 uint64_t reserved_32_63:32;
513 uint64_t wa_pc:32;
514 } s;
515 struct cvmx_pow_wa_com_pc_s cn30xx;
516 struct cvmx_pow_wa_com_pc_s cn31xx;
517 struct cvmx_pow_wa_com_pc_s cn38xx;
518 struct cvmx_pow_wa_com_pc_s cn38xxp2;
519 struct cvmx_pow_wa_com_pc_s cn50xx;
520 struct cvmx_pow_wa_com_pc_s cn52xx;
521 struct cvmx_pow_wa_com_pc_s cn52xxp1;
522 struct cvmx_pow_wa_com_pc_s cn56xx;
523 struct cvmx_pow_wa_com_pc_s cn56xxp1;
524 struct cvmx_pow_wa_com_pc_s cn58xx;
525 struct cvmx_pow_wa_com_pc_s cn58xxp1;
526};
527
528union cvmx_pow_wa_pcx {
529 uint64_t u64;
530 struct cvmx_pow_wa_pcx_s {
531 uint64_t reserved_32_63:32;
532 uint64_t wa_pc:32;
533 } s;
534 struct cvmx_pow_wa_pcx_s cn30xx;
535 struct cvmx_pow_wa_pcx_s cn31xx;
536 struct cvmx_pow_wa_pcx_s cn38xx;
537 struct cvmx_pow_wa_pcx_s cn38xxp2;
538 struct cvmx_pow_wa_pcx_s cn50xx;
539 struct cvmx_pow_wa_pcx_s cn52xx;
540 struct cvmx_pow_wa_pcx_s cn52xxp1;
541 struct cvmx_pow_wa_pcx_s cn56xx;
542 struct cvmx_pow_wa_pcx_s cn56xxp1;
543 struct cvmx_pow_wa_pcx_s cn58xx;
544 struct cvmx_pow_wa_pcx_s cn58xxp1;
545};
546
547union cvmx_pow_wq_int {
548 uint64_t u64;
549 struct cvmx_pow_wq_int_s {
550 uint64_t reserved_32_63:32;
551 uint64_t iq_dis:16;
552 uint64_t wq_int:16;
553 } s;
554 struct cvmx_pow_wq_int_s cn30xx;
555 struct cvmx_pow_wq_int_s cn31xx;
556 struct cvmx_pow_wq_int_s cn38xx;
557 struct cvmx_pow_wq_int_s cn38xxp2;
558 struct cvmx_pow_wq_int_s cn50xx;
559 struct cvmx_pow_wq_int_s cn52xx;
560 struct cvmx_pow_wq_int_s cn52xxp1;
561 struct cvmx_pow_wq_int_s cn56xx;
562 struct cvmx_pow_wq_int_s cn56xxp1;
563 struct cvmx_pow_wq_int_s cn58xx;
564 struct cvmx_pow_wq_int_s cn58xxp1;
565};
566
567union cvmx_pow_wq_int_cntx {
568 uint64_t u64;
569 struct cvmx_pow_wq_int_cntx_s {
570 uint64_t reserved_28_63:36;
571 uint64_t tc_cnt:4;
572 uint64_t ds_cnt:12;
573 uint64_t iq_cnt:12;
574 } s;
575 struct cvmx_pow_wq_int_cntx_cn30xx {
576 uint64_t reserved_28_63:36;
577 uint64_t tc_cnt:4;
578 uint64_t reserved_19_23:5;
579 uint64_t ds_cnt:7;
580 uint64_t reserved_7_11:5;
581 uint64_t iq_cnt:7;
582 } cn30xx;
583 struct cvmx_pow_wq_int_cntx_cn31xx {
584 uint64_t reserved_28_63:36;
585 uint64_t tc_cnt:4;
586 uint64_t reserved_21_23:3;
587 uint64_t ds_cnt:9;
588 uint64_t reserved_9_11:3;
589 uint64_t iq_cnt:9;
590 } cn31xx;
591 struct cvmx_pow_wq_int_cntx_s cn38xx;
592 struct cvmx_pow_wq_int_cntx_s cn38xxp2;
593 struct cvmx_pow_wq_int_cntx_cn31xx cn50xx;
594 struct cvmx_pow_wq_int_cntx_cn52xx {
595 uint64_t reserved_28_63:36;
596 uint64_t tc_cnt:4;
597 uint64_t reserved_22_23:2;
598 uint64_t ds_cnt:10;
599 uint64_t reserved_10_11:2;
600 uint64_t iq_cnt:10;
601 } cn52xx;
602 struct cvmx_pow_wq_int_cntx_cn52xx cn52xxp1;
603 struct cvmx_pow_wq_int_cntx_s cn56xx;
604 struct cvmx_pow_wq_int_cntx_s cn56xxp1;
605 struct cvmx_pow_wq_int_cntx_s cn58xx;
606 struct cvmx_pow_wq_int_cntx_s cn58xxp1;
607};
608
609union cvmx_pow_wq_int_pc {
610 uint64_t u64;
611 struct cvmx_pow_wq_int_pc_s {
612 uint64_t reserved_60_63:4;
613 uint64_t pc:28;
614 uint64_t reserved_28_31:4;
615 uint64_t pc_thr:20;
616 uint64_t reserved_0_7:8;
617 } s;
618 struct cvmx_pow_wq_int_pc_s cn30xx;
619 struct cvmx_pow_wq_int_pc_s cn31xx;
620 struct cvmx_pow_wq_int_pc_s cn38xx;
621 struct cvmx_pow_wq_int_pc_s cn38xxp2;
622 struct cvmx_pow_wq_int_pc_s cn50xx;
623 struct cvmx_pow_wq_int_pc_s cn52xx;
624 struct cvmx_pow_wq_int_pc_s cn52xxp1;
625 struct cvmx_pow_wq_int_pc_s cn56xx;
626 struct cvmx_pow_wq_int_pc_s cn56xxp1;
627 struct cvmx_pow_wq_int_pc_s cn58xx;
628 struct cvmx_pow_wq_int_pc_s cn58xxp1;
629};
630
631union cvmx_pow_wq_int_thrx {
632 uint64_t u64;
633 struct cvmx_pow_wq_int_thrx_s {
634 uint64_t reserved_29_63:35;
635 uint64_t tc_en:1;
636 uint64_t tc_thr:4;
637 uint64_t reserved_23_23:1;
638 uint64_t ds_thr:11;
639 uint64_t reserved_11_11:1;
640 uint64_t iq_thr:11;
641 } s;
642 struct cvmx_pow_wq_int_thrx_cn30xx {
643 uint64_t reserved_29_63:35;
644 uint64_t tc_en:1;
645 uint64_t tc_thr:4;
646 uint64_t reserved_18_23:6;
647 uint64_t ds_thr:6;
648 uint64_t reserved_6_11:6;
649 uint64_t iq_thr:6;
650 } cn30xx;
651 struct cvmx_pow_wq_int_thrx_cn31xx {
652 uint64_t reserved_29_63:35;
653 uint64_t tc_en:1;
654 uint64_t tc_thr:4;
655 uint64_t reserved_20_23:4;
656 uint64_t ds_thr:8;
657 uint64_t reserved_8_11:4;
658 uint64_t iq_thr:8;
659 } cn31xx;
660 struct cvmx_pow_wq_int_thrx_s cn38xx;
661 struct cvmx_pow_wq_int_thrx_s cn38xxp2;
662 struct cvmx_pow_wq_int_thrx_cn31xx cn50xx;
663 struct cvmx_pow_wq_int_thrx_cn52xx {
664 uint64_t reserved_29_63:35;
665 uint64_t tc_en:1;
666 uint64_t tc_thr:4;
667 uint64_t reserved_21_23:3;
668 uint64_t ds_thr:9;
669 uint64_t reserved_9_11:3;
670 uint64_t iq_thr:9;
671 } cn52xx;
672 struct cvmx_pow_wq_int_thrx_cn52xx cn52xxp1;
673 struct cvmx_pow_wq_int_thrx_s cn56xx;
674 struct cvmx_pow_wq_int_thrx_s cn56xxp1;
675 struct cvmx_pow_wq_int_thrx_s cn58xx;
676 struct cvmx_pow_wq_int_thrx_s cn58xxp1;
677};
678
679union cvmx_pow_ws_pcx {
680 uint64_t u64;
681 struct cvmx_pow_ws_pcx_s {
682 uint64_t reserved_32_63:32;
683 uint64_t ws_pc:32;
684 } s;
685 struct cvmx_pow_ws_pcx_s cn30xx;
686 struct cvmx_pow_ws_pcx_s cn31xx;
687 struct cvmx_pow_ws_pcx_s cn38xx;
688 struct cvmx_pow_ws_pcx_s cn38xxp2;
689 struct cvmx_pow_ws_pcx_s cn50xx;
690 struct cvmx_pow_ws_pcx_s cn52xx;
691 struct cvmx_pow_ws_pcx_s cn52xxp1;
692 struct cvmx_pow_ws_pcx_s cn56xx;
693 struct cvmx_pow_ws_pcx_s cn56xxp1;
694 struct cvmx_pow_ws_pcx_s cn58xx;
695 struct cvmx_pow_ws_pcx_s cn58xxp1;
696};
697
698#endif
diff --git a/arch/mips/include/asm/octeon/cvmx-spinlock.h b/arch/mips/include/asm/octeon/cvmx-spinlock.h
new file mode 100644
index 000000000000..2fbf0871df11
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-spinlock.h
@@ -0,0 +1,232 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/**
29 * Implementation of spinlocks for Octeon CVMX. Although similar in
30 * function to Linux kernel spinlocks, they are not compatible.
31 * Octeon CVMX spinlocks are only used to synchronize with the boot
32 * monitor and other non-Linux programs running in the system.
33 */
34
35#ifndef __CVMX_SPINLOCK_H__
36#define __CVMX_SPINLOCK_H__
37
38#include "cvmx-asm.h"
39
40/* Spinlocks for Octeon */
41
42/* define these to enable recursive spinlock debugging */
43/*#define CVMX_SPINLOCK_DEBUG */
44
45/**
46 * Spinlocks for Octeon CVMX
47 */
48typedef struct {
49 volatile uint32_t value;
50} cvmx_spinlock_t;
51
52/* note - macros not expanded in inline ASM, so values hardcoded */
53#define CVMX_SPINLOCK_UNLOCKED_VAL 0
54#define CVMX_SPINLOCK_LOCKED_VAL 1
55
56#define CVMX_SPINLOCK_UNLOCKED_INITIALIZER {CVMX_SPINLOCK_UNLOCKED_VAL}
57
58/**
59 * Initialize a spinlock
60 *
61 * @lock: Lock to initialize
62 */
63static inline void cvmx_spinlock_init(cvmx_spinlock_t *lock)
64{
65 lock->value = CVMX_SPINLOCK_UNLOCKED_VAL;
66}
67
68/**
69 * Return non-zero if the spinlock is currently locked
70 *
71 * @lock: Lock to check
72 * Returns Non-zero if locked
73 */
74static inline int cvmx_spinlock_locked(cvmx_spinlock_t *lock)
75{
76 return lock->value != CVMX_SPINLOCK_UNLOCKED_VAL;
77}
78
79/**
80 * Releases lock
81 *
82 * @lock: pointer to lock structure
83 */
84static inline void cvmx_spinlock_unlock(cvmx_spinlock_t *lock)
85{
86 CVMX_SYNCWS;
87 lock->value = 0;
88 CVMX_SYNCWS;
89}
90
91/**
92 * Attempts to take the lock, but does not spin if lock is not available.
93 * May take some time to acquire the lock even if it is available
94 * due to the ll/sc not succeeding.
95 *
96 * @lock: pointer to lock structure
97 *
98 * Returns 0: lock successfully taken
99 * 1: lock not taken, held by someone else
100 * These return values match the Linux semantics.
101 */
102
103static inline unsigned int cvmx_spinlock_trylock(cvmx_spinlock_t *lock)
104{
105 unsigned int tmp;
106
107 __asm__ __volatile__(".set noreorder \n"
108 "1: ll %[tmp], %[val] \n"
109 /* if lock held, fail immediately */
110 " bnez %[tmp], 2f \n"
111 " li %[tmp], 1 \n"
112 " sc %[tmp], %[val] \n"
113 " beqz %[tmp], 1b \n"
114 " li %[tmp], 0 \n"
115 "2: \n"
116 ".set reorder \n" :
117 [val] "+m"(lock->value), [tmp] "=&r"(tmp)
118 : : "memory");
119
120 return tmp != 0; /* normalize to 0 or 1 */
121}
122
123/**
124 * Gets lock, spins until lock is taken
125 *
126 * @lock: pointer to lock structure
127 */
128static inline void cvmx_spinlock_lock(cvmx_spinlock_t *lock)
129{
130 unsigned int tmp;
131
132 __asm__ __volatile__(".set noreorder \n"
133 "1: ll %[tmp], %[val] \n"
134 " bnez %[tmp], 1b \n"
135 " li %[tmp], 1 \n"
136 " sc %[tmp], %[val] \n"
137 " beqz %[tmp], 1b \n"
138 " nop \n"
139 ".set reorder \n" :
140 [val] "+m"(lock->value), [tmp] "=&r"(tmp)
141 : : "memory");
142
143}
144
145/** ********************************************************************
146 * Bit spinlocks
147 * These spinlocks use a single bit (bit 31) of a 32 bit word for locking.
148 * The rest of the bits in the word are left undisturbed. This enables more
149 * compact data structures as only 1 bit is consumed for the lock.
150 *
151 */
152
153/**
154 * Gets lock, spins until lock is taken
155 * Preserves the low 31 bits of the 32 bit
156 * word used for the lock.
157 *
158 *
159 * @word: word to lock bit 31 of
160 */
161static inline void cvmx_spinlock_bit_lock(uint32_t *word)
162{
163 unsigned int tmp;
164 unsigned int sav;
165
166 __asm__ __volatile__(".set noreorder \n"
167 ".set noat \n"
168 "1: ll %[tmp], %[val] \n"
169 " bbit1 %[tmp], 31, 1b \n"
170 " li $at, 1 \n"
171 " ins %[tmp], $at, 31, 1 \n"
172 " sc %[tmp], %[val] \n"
173 " beqz %[tmp], 1b \n"
174 " nop \n"
175 ".set at \n"
176 ".set reorder \n" :
177 [val] "+m"(*word), [tmp] "=&r"(tmp), [sav] "=&r"(sav)
178 : : "memory");
179
180}
181
182/**
183 * Attempts to get lock, returns immediately with success/failure
184 * Preserves the low 31 bits of the 32 bit
185 * word used for the lock.
186 *
187 *
188 * @word: word to lock bit 31 of
189 * Returns 0: lock successfully taken
190 * 1: lock not taken, held by someone else
191 * These return values match the Linux semantics.
192 */
193static inline unsigned int cvmx_spinlock_bit_trylock(uint32_t *word)
194{
195 unsigned int tmp;
196
197 __asm__ __volatile__(".set noreorder\n\t"
198 ".set noat\n"
199 "1: ll %[tmp], %[val] \n"
200 /* if lock held, fail immediately */
201 " bbit1 %[tmp], 31, 2f \n"
202 " li $at, 1 \n"
203 " ins %[tmp], $at, 31, 1 \n"
204 " sc %[tmp], %[val] \n"
205 " beqz %[tmp], 1b \n"
206 " li %[tmp], 0 \n"
207 "2: \n"
208 ".set at \n"
209 ".set reorder \n" :
210 [val] "+m"(*word), [tmp] "=&r"(tmp)
211 : : "memory");
212
213 return tmp != 0; /* normalize to 0 or 1 */
214}
215
216/**
217 * Releases bit lock
218 *
219 * Unconditionally clears bit 31 of the lock word. Note that this is
220 * done non-atomically, as this implementation assumes that the rest
221 * of the bits in the word are protected by the lock.
222 *
223 * @word: word to unlock bit 31 in
224 */
225static inline void cvmx_spinlock_bit_unlock(uint32_t *word)
226{
227 CVMX_SYNCWS;
228 *word &= ~(1UL << 31);
229 CVMX_SYNCWS;
230}
231
232#endif /* __CVMX_SPINLOCK_H__ */
diff --git a/arch/mips/include/asm/octeon/cvmx-sysinfo.h b/arch/mips/include/asm/octeon/cvmx-sysinfo.h
new file mode 100644
index 000000000000..61dd5741afe4
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx-sysinfo.h
@@ -0,0 +1,152 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 * This module provides system/board information obtained by the bootloader.
30 */
31
32#ifndef __CVMX_SYSINFO_H__
33#define __CVMX_SYSINFO_H__
34
35#define OCTEON_SERIAL_LEN 20
36/**
37 * Structure describing application specific information.
38 * __cvmx_app_init() populates this from the cvmx boot descriptor.
39 * This structure is private to simple executive applications, so
40 * no versioning is required.
41 *
42 * This structure must be provided with some fields set in order to
43 * use simple executive functions in other applications (Linux kernel,
44 * u-boot, etc.) The cvmx_sysinfo_minimal_initialize() function is
45 * provided to set the required values in these cases.
46 */
47struct cvmx_sysinfo {
48 /* System wide variables */
49 /* installed DRAM in system, in bytes */
50 uint64_t system_dram_size;
51
52 /* ptr to memory descriptor block */
53 void *phy_mem_desc_ptr;
54
55
56 /* Application image specific variables */
57 /* stack top address (virtual) */
58 uint64_t stack_top;
59 /* heap base address (virtual) */
60 uint64_t heap_base;
61 /* stack size in bytes */
62 uint32_t stack_size;
63 /* heap size in bytes */
64 uint32_t heap_size;
65 /* coremask defining cores running application */
66 uint32_t core_mask;
67 /* Deprecated, use cvmx_coremask_first_core() to select init core */
68 uint32_t init_core;
69
70 /* exception base address, as set by bootloader */
71 uint64_t exception_base_addr;
72
73 /* cpu clock speed in hz */
74 uint32_t cpu_clock_hz;
75
76 /* dram data rate in hz (data rate = 2 * clock rate */
77 uint32_t dram_data_rate_hz;
78
79
80 uint16_t board_type;
81 uint8_t board_rev_major;
82 uint8_t board_rev_minor;
83 uint8_t mac_addr_base[6];
84 uint8_t mac_addr_count;
85 char board_serial_number[OCTEON_SERIAL_LEN];
86 /*
87 * Several boards support compact flash on the Octeon boot
88 * bus. The CF memory spaces may be mapped to different
89 * addresses on different boards. These values will be 0 if
90 * CF is not present. Note that these addresses are physical
91 * addresses, and it is up to the application to use the
92 * proper addressing mode (XKPHYS, KSEG0, etc.)
93 */
94 uint64_t compact_flash_common_base_addr;
95 uint64_t compact_flash_attribute_base_addr;
96 /*
97 * Base address of the LED display (as on EBT3000 board) This
98 * will be 0 if LED display not present. Note that this
99 * address is a physical address, and it is up to the
100 * application to use the proper addressing mode (XKPHYS,
101 * KSEG0, etc.)
102 */
103 uint64_t led_display_base_addr;
104 /* DFA reference clock in hz (if applicable)*/
105 uint32_t dfa_ref_clock_hz;
106 /* configuration flags from bootloader */
107 uint32_t bootloader_config_flags;
108
109 /* Uart number used for console */
110 uint8_t console_uart_num;
111};
112
113/**
114 * This function returns the system/board information as obtained
115 * by the bootloader.
116 *
117 *
118 * Returns Pointer to the boot information structure
119 *
120 */
121
122extern struct cvmx_sysinfo *cvmx_sysinfo_get(void);
123
124/**
125 * This function is used in non-simple executive environments (such as
126 * Linux kernel, u-boot, etc.) to configure the minimal fields that
127 * are required to use simple executive files directly.
128 *
129 * Locking (if required) must be handled outside of this
130 * function
131 *
132 * @phy_mem_desc_ptr: Pointer to global physical memory descriptor
133 * (bootmem descriptor) @board_type: Octeon board
134 * type enumeration
135 *
136 * @board_rev_major:
137 * Board major revision
138 * @board_rev_minor:
139 * Board minor revision
140 * @cpu_clock_hz:
141 * CPU clock freqency in hertz
142 *
143 * Returns 0: Failure
144 * 1: success
145 */
146extern int cvmx_sysinfo_minimal_initialize(void *phy_mem_desc_ptr,
147 uint16_t board_type,
148 uint8_t board_rev_major,
149 uint8_t board_rev_minor,
150 uint32_t cpu_clock_hz);
151
152#endif /* __CVMX_SYSINFO_H__ */
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h
new file mode 100644
index 000000000000..03fddfa3e928
--- /dev/null
+++ b/arch/mips/include/asm/octeon/cvmx.h
@@ -0,0 +1,505 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28#ifndef __CVMX_H__
29#define __CVMX_H__
30
31#include <linux/kernel.h>
32#include <linux/string.h>
33
34#include "cvmx-asm.h"
35#include "cvmx-packet.h"
36#include "cvmx-sysinfo.h"
37
38#include "cvmx-ciu-defs.h"
39#include "cvmx-gpio-defs.h"
40#include "cvmx-iob-defs.h"
41#include "cvmx-ipd-defs.h"
42#include "cvmx-l2c-defs.h"
43#include "cvmx-l2d-defs.h"
44#include "cvmx-l2t-defs.h"
45#include "cvmx-led-defs.h"
46#include "cvmx-mio-defs.h"
47#include "cvmx-pow-defs.h"
48
49#include "cvmx-bootinfo.h"
50#include "cvmx-bootmem.h"
51#include "cvmx-l2c.h"
52
53#ifndef CVMX_ENABLE_DEBUG_PRINTS
54#define CVMX_ENABLE_DEBUG_PRINTS 1
55#endif
56
57#if CVMX_ENABLE_DEBUG_PRINTS
58#define cvmx_dprintf printk
59#else
60#define cvmx_dprintf(...) {}
61#endif
62
63#define CVMX_MAX_CORES (16)
64#define CVMX_CACHE_LINE_SIZE (128) /* In bytes */
65#define CVMX_CACHE_LINE_MASK (CVMX_CACHE_LINE_SIZE - 1) /* In bytes */
66#define CVMX_CACHE_LINE_ALIGNED __attribute__ ((aligned(CVMX_CACHE_LINE_SIZE)))
67#define CAST64(v) ((long long)(long)(v))
68#define CASTPTR(type, v) ((type *)(long)(v))
69
70/*
71 * Returns processor ID, different Linux and simple exec versions
72 * provided in the cvmx-app-init*.c files.
73 */
74static inline uint32_t cvmx_get_proc_id(void) __attribute__ ((pure));
75static inline uint32_t cvmx_get_proc_id(void)
76{
77 uint32_t id;
78 asm("mfc0 %0, $15,0" : "=r"(id));
79 return id;
80}
81
82/* turn the variable name into a string */
83#define CVMX_TMP_STR(x) CVMX_TMP_STR2(x)
84#define CVMX_TMP_STR2(x) #x
85
86/**
87 * Builds a bit mask given the required size in bits.
88 *
89 * @bits: Number of bits in the mask
90 * Returns The mask
91 */ static inline uint64_t cvmx_build_mask(uint64_t bits)
92{
93 return ~((~0x0ull) << bits);
94}
95
96/**
97 * Builds a memory address for I/O based on the Major and Sub DID.
98 *
99 * @major_did: 5 bit major did
100 * @sub_did: 3 bit sub did
101 * Returns I/O base address
102 */
103static inline uint64_t cvmx_build_io_address(uint64_t major_did,
104 uint64_t sub_did)
105{
106 return (0x1ull << 48) | (major_did << 43) | (sub_did << 40);
107}
108
109/**
110 * Perform mask and shift to place the supplied value into
111 * the supplied bit rage.
112 *
113 * Example: cvmx_build_bits(39,24,value)
114 * <pre>
115 * 6 5 4 3 3 2 1
116 * 3 5 7 9 1 3 5 7 0
117 * +-------+-------+-------+-------+-------+-------+-------+------+
118 * 000000000000000000000000___________value000000000000000000000000
119 * </pre>
120 *
121 * @high_bit: Highest bit value can occupy (inclusive) 0-63
122 * @low_bit: Lowest bit value can occupy inclusive 0-high_bit
123 * @value: Value to use
124 * Returns Value masked and shifted
125 */
126static inline uint64_t cvmx_build_bits(uint64_t high_bit,
127 uint64_t low_bit, uint64_t value)
128{
129 return (value & cvmx_build_mask(high_bit - low_bit + 1)) << low_bit;
130}
131
132enum cvmx_mips_space {
133 CVMX_MIPS_SPACE_XKSEG = 3LL,
134 CVMX_MIPS_SPACE_XKPHYS = 2LL,
135 CVMX_MIPS_SPACE_XSSEG = 1LL,
136 CVMX_MIPS_SPACE_XUSEG = 0LL
137};
138
139/* These macros for use when using 32 bit pointers. */
140#define CVMX_MIPS32_SPACE_KSEG0 1l
141#define CVMX_ADD_SEG32(segment, add) \
142 (((int32_t)segment << 31) | (int32_t)(add))
143
144#define CVMX_IO_SEG CVMX_MIPS_SPACE_XKPHYS
145
146/* These macros simplify the process of creating common IO addresses */
147#define CVMX_ADD_SEG(segment, add) \
148 ((((uint64_t)segment) << 62) | (add))
149#ifndef CVMX_ADD_IO_SEG
150#define CVMX_ADD_IO_SEG(add) CVMX_ADD_SEG(CVMX_IO_SEG, (add))
151#endif
152
153/**
154 * Convert a memory pointer (void*) into a hardware compatable
155 * memory address (uint64_t). Octeon hardware widgets don't
156 * understand logical addresses.
157 *
158 * @ptr: C style memory pointer
159 * Returns Hardware physical address
160 */
161static inline uint64_t cvmx_ptr_to_phys(void *ptr)
162{
163 if (sizeof(void *) == 8) {
164 /*
165 * We're running in 64 bit mode. Normally this means
166 * that we can use 40 bits of address space (the
167 * hardware limit). Unfortunately there is one case
168 * were we need to limit this to 30 bits, sign
169 * extended 32 bit. Although these are 64 bits wide,
170 * only 30 bits can be used.
171 */
172 if ((CAST64(ptr) >> 62) == 3)
173 return CAST64(ptr) & cvmx_build_mask(30);
174 else
175 return CAST64(ptr) & cvmx_build_mask(40);
176 } else {
177 return (long)(ptr) & 0x1fffffff;
178 }
179}
180
181/**
182 * Convert a hardware physical address (uint64_t) into a
183 * memory pointer (void *).
184 *
185 * @physical_address:
186 * Hardware physical address to memory
187 * Returns Pointer to memory
188 */
189static inline void *cvmx_phys_to_ptr(uint64_t physical_address)
190{
191 if (sizeof(void *) == 8) {
192 /* Just set the top bit, avoiding any TLB uglyness */
193 return CASTPTR(void,
194 CVMX_ADD_SEG(CVMX_MIPS_SPACE_XKPHYS,
195 physical_address));
196 } else {
197 return CASTPTR(void,
198 CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0,
199 physical_address));
200 }
201}
202
203/* The following #if controls the definition of the macro
204 CVMX_BUILD_WRITE64. This macro is used to build a store operation to
205 a full 64bit address. With a 64bit ABI, this can be done with a simple
206 pointer access. 32bit ABIs require more complicated assembly */
207
208/* We have a full 64bit ABI. Writing to a 64bit address can be done with
209 a simple volatile pointer */
210#define CVMX_BUILD_WRITE64(TYPE, ST) \
211static inline void cvmx_write64_##TYPE(uint64_t addr, TYPE##_t val) \
212{ \
213 *CASTPTR(volatile TYPE##_t, addr) = val; \
214}
215
216
217/* The following #if controls the definition of the macro
218 CVMX_BUILD_READ64. This macro is used to build a load operation from
219 a full 64bit address. With a 64bit ABI, this can be done with a simple
220 pointer access. 32bit ABIs require more complicated assembly */
221
222/* We have a full 64bit ABI. Writing to a 64bit address can be done with
223 a simple volatile pointer */
224#define CVMX_BUILD_READ64(TYPE, LT) \
225static inline TYPE##_t cvmx_read64_##TYPE(uint64_t addr) \
226{ \
227 return *CASTPTR(volatile TYPE##_t, addr); \
228}
229
230
231/* The following defines 8 functions for writing to a 64bit address. Each
232 takes two arguments, the address and the value to write.
233 cvmx_write64_int64 cvmx_write64_uint64
234 cvmx_write64_int32 cvmx_write64_uint32
235 cvmx_write64_int16 cvmx_write64_uint16
236 cvmx_write64_int8 cvmx_write64_uint8 */
237CVMX_BUILD_WRITE64(int64, "sd");
238CVMX_BUILD_WRITE64(int32, "sw");
239CVMX_BUILD_WRITE64(int16, "sh");
240CVMX_BUILD_WRITE64(int8, "sb");
241CVMX_BUILD_WRITE64(uint64, "sd");
242CVMX_BUILD_WRITE64(uint32, "sw");
243CVMX_BUILD_WRITE64(uint16, "sh");
244CVMX_BUILD_WRITE64(uint8, "sb");
245#define cvmx_write64 cvmx_write64_uint64
246
247/* The following defines 8 functions for reading from a 64bit address. Each
248 takes the address as the only argument
249 cvmx_read64_int64 cvmx_read64_uint64
250 cvmx_read64_int32 cvmx_read64_uint32
251 cvmx_read64_int16 cvmx_read64_uint16
252 cvmx_read64_int8 cvmx_read64_uint8 */
253CVMX_BUILD_READ64(int64, "ld");
254CVMX_BUILD_READ64(int32, "lw");
255CVMX_BUILD_READ64(int16, "lh");
256CVMX_BUILD_READ64(int8, "lb");
257CVMX_BUILD_READ64(uint64, "ld");
258CVMX_BUILD_READ64(uint32, "lw");
259CVMX_BUILD_READ64(uint16, "lhu");
260CVMX_BUILD_READ64(uint8, "lbu");
261#define cvmx_read64 cvmx_read64_uint64
262
263
264static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val)
265{
266 cvmx_write64(csr_addr, val);
267
268 /*
269 * Perform an immediate read after every write to an RSL
270 * register to force the write to complete. It doesn't matter
271 * what RSL read we do, so we choose CVMX_MIO_BOOT_BIST_STAT
272 * because it is fast and harmless.
273 */
274 if ((csr_addr >> 40) == (0x800118))
275 cvmx_read64(CVMX_MIO_BOOT_BIST_STAT);
276}
277
278static inline void cvmx_write_io(uint64_t io_addr, uint64_t val)
279{
280 cvmx_write64(io_addr, val);
281
282}
283
284static inline uint64_t cvmx_read_csr(uint64_t csr_addr)
285{
286 uint64_t val = cvmx_read64(csr_addr);
287 return val;
288}
289
290
291static inline void cvmx_send_single(uint64_t data)
292{
293 const uint64_t CVMX_IOBDMA_SENDSINGLE = 0xffffffffffffa200ull;
294 cvmx_write64(CVMX_IOBDMA_SENDSINGLE, data);
295}
296
297static inline void cvmx_read_csr_async(uint64_t scraddr, uint64_t csr_addr)
298{
299 union {
300 uint64_t u64;
301 struct {
302 uint64_t scraddr:8;
303 uint64_t len:8;
304 uint64_t addr:48;
305 } s;
306 } addr;
307 addr.u64 = csr_addr;
308 addr.s.scraddr = scraddr >> 3;
309 addr.s.len = 1;
310 cvmx_send_single(addr.u64);
311}
312
313/* Return true if Octeon is CN38XX pass 1 */
314static inline int cvmx_octeon_is_pass1(void)
315{
316#if OCTEON_IS_COMMON_BINARY()
317 return 0; /* Pass 1 isn't supported for common binaries */
318#else
319/* Now that we know we're built for a specific model, only check CN38XX */
320#if OCTEON_IS_MODEL(OCTEON_CN38XX)
321 return cvmx_get_proc_id() == OCTEON_CN38XX_PASS1;
322#else
323 return 0; /* Built for non CN38XX chip, we're not CN38XX pass1 */
324#endif
325#endif
326}
327
328static inline unsigned int cvmx_get_core_num(void)
329{
330 unsigned int core_num;
331 CVMX_RDHWRNV(core_num, 0);
332 return core_num;
333}
334
335/**
336 * Returns the number of bits set in the provided value.
337 * Simple wrapper for POP instruction.
338 *
339 * @val: 32 bit value to count set bits in
340 *
341 * Returns Number of bits set
342 */
343static inline uint32_t cvmx_pop(uint32_t val)
344{
345 uint32_t pop;
346 CVMX_POP(pop, val);
347 return pop;
348}
349
350/**
351 * Returns the number of bits set in the provided value.
352 * Simple wrapper for DPOP instruction.
353 *
354 * @val: 64 bit value to count set bits in
355 *
356 * Returns Number of bits set
357 */
358static inline int cvmx_dpop(uint64_t val)
359{
360 int pop;
361 CVMX_DPOP(pop, val);
362 return pop;
363}
364
365/**
366 * Provide current cycle counter as a return value
367 *
368 * Returns current cycle counter
369 */
370
371static inline uint64_t cvmx_get_cycle(void)
372{
373 uint64_t cycle;
374 CVMX_RDHWR(cycle, 31);
375 return cycle;
376}
377
378/**
379 * Reads a chip global cycle counter. This counts CPU cycles since
380 * chip reset. The counter is 64 bit.
381 * This register does not exist on CN38XX pass 1 silicion
382 *
383 * Returns Global chip cycle count since chip reset.
384 */
385static inline uint64_t cvmx_get_cycle_global(void)
386{
387 if (cvmx_octeon_is_pass1())
388 return 0;
389 else
390 return cvmx_read64(CVMX_IPD_CLK_COUNT);
391}
392
393/**
394 * This macro spins on a field waiting for it to reach a value. It
395 * is common in code to need to wait for a specific field in a CSR
396 * to match a specific value. Conceptually this macro expands to:
397 *
398 * 1) read csr at "address" with a csr typedef of "type"
399 * 2) Check if ("type".s."field" "op" "value")
400 * 3) If #2 isn't true loop to #1 unless too much time has passed.
401 */
402#define CVMX_WAIT_FOR_FIELD64(address, type, field, op, value, timeout_usec)\
403 ( \
404{ \
405 int result; \
406 do { \
407 uint64_t done = cvmx_get_cycle() + (uint64_t)timeout_usec * \
408 cvmx_sysinfo_get()->cpu_clock_hz / 1000000; \
409 type c; \
410 while (1) { \
411 c.u64 = cvmx_read_csr(address); \
412 if ((c.s.field) op(value)) { \
413 result = 0; \
414 break; \
415 } else if (cvmx_get_cycle() > done) { \
416 result = -1; \
417 break; \
418 } else \
419 cvmx_wait(100); \
420 } \
421 } while (0); \
422 result; \
423})
424
425/***************************************************************************/
426
427static inline void cvmx_reset_octeon(void)
428{
429 union cvmx_ciu_soft_rst ciu_soft_rst;
430 ciu_soft_rst.u64 = 0;
431 ciu_soft_rst.s.soft_rst = 1;
432 cvmx_write_csr(CVMX_CIU_SOFT_RST, ciu_soft_rst.u64);
433}
434
435/* Return the number of cores available in the chip */
436static inline uint32_t cvmx_octeon_num_cores(void)
437{
438 uint32_t ciu_fuse = (uint32_t) cvmx_read_csr(CVMX_CIU_FUSE) & 0xffff;
439 return cvmx_pop(ciu_fuse);
440}
441
442/**
443 * Read a byte of fuse data
444 * @byte_addr: address to read
445 *
446 * Returns fuse value: 0 or 1
447 */
448static uint8_t cvmx_fuse_read_byte(int byte_addr)
449{
450 union cvmx_mio_fus_rcmd read_cmd;
451
452 read_cmd.u64 = 0;
453 read_cmd.s.addr = byte_addr;
454 read_cmd.s.pend = 1;
455 cvmx_write_csr(CVMX_MIO_FUS_RCMD, read_cmd.u64);
456 while ((read_cmd.u64 = cvmx_read_csr(CVMX_MIO_FUS_RCMD))
457 && read_cmd.s.pend)
458 ;
459 return read_cmd.s.dat;
460}
461
462/**
463 * Read a single fuse bit
464 *
465 * @fuse: Fuse number (0-1024)
466 *
467 * Returns fuse value: 0 or 1
468 */
469static inline int cvmx_fuse_read(int fuse)
470{
471 return (cvmx_fuse_read_byte(fuse >> 3) >> (fuse & 0x7)) & 1;
472}
473
474static inline int cvmx_octeon_model_CN36XX(void)
475{
476 return OCTEON_IS_MODEL(OCTEON_CN38XX)
477 && !cvmx_octeon_is_pass1()
478 && cvmx_fuse_read(264);
479}
480
481static inline int cvmx_octeon_zip_present(void)
482{
483 return octeon_has_feature(OCTEON_FEATURE_ZIP);
484}
485
486static inline int cvmx_octeon_dfa_present(void)
487{
488 if (!OCTEON_IS_MODEL(OCTEON_CN38XX)
489 && !OCTEON_IS_MODEL(OCTEON_CN31XX)
490 && !OCTEON_IS_MODEL(OCTEON_CN58XX))
491 return 0;
492 else if (OCTEON_IS_MODEL(OCTEON_CN3020))
493 return 0;
494 else if (cvmx_octeon_is_pass1())
495 return 1;
496 else
497 return !cvmx_fuse_read(120);
498}
499
500static inline int cvmx_octeon_crypto_present(void)
501{
502 return octeon_has_feature(OCTEON_FEATURE_CRYPTO);
503}
504
505#endif /* __CVMX_H__ */
diff --git a/arch/mips/include/asm/octeon/octeon-feature.h b/arch/mips/include/asm/octeon/octeon-feature.h
new file mode 100644
index 000000000000..04fac684069c
--- /dev/null
+++ b/arch/mips/include/asm/octeon/octeon-feature.h
@@ -0,0 +1,119 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 * File defining checks for different Octeon features.
30 */
31
32#ifndef __OCTEON_FEATURE_H__
33#define __OCTEON_FEATURE_H__
34
35enum octeon_feature {
36 /*
37 * Octeon models in the CN5XXX family and higher support
38 * atomic add instructions to memory (saa/saad).
39 */
40 OCTEON_FEATURE_SAAD,
41 /* Does this Octeon support the ZIP offload engine? */
42 OCTEON_FEATURE_ZIP,
43 /* Does this Octeon support crypto acceleration using COP2? */
44 OCTEON_FEATURE_CRYPTO,
45 /* Does this Octeon support PCI express? */
46 OCTEON_FEATURE_PCIE,
47 /* Some Octeon models support internal memory for storing
48 * cryptographic keys */
49 OCTEON_FEATURE_KEY_MEMORY,
50 /* Octeon has a LED controller for banks of external LEDs */
51 OCTEON_FEATURE_LED_CONTROLLER,
52 /* Octeon has a trace buffer */
53 OCTEON_FEATURE_TRA,
54 /* Octeon has a management port */
55 OCTEON_FEATURE_MGMT_PORT,
56 /* Octeon has a raid unit */
57 OCTEON_FEATURE_RAID,
58 /* Octeon has a builtin USB */
59 OCTEON_FEATURE_USB,
60};
61
62static inline int cvmx_fuse_read(int fuse);
63
64/**
65 * Determine if the current Octeon supports a specific feature. These
66 * checks have been optimized to be fairly quick, but they should still
67 * be kept out of fast path code.
68 *
69 * @feature: Feature to check for. This should always be a constant so the
70 * compiler can remove the switch statement through optimization.
71 *
72 * Returns Non zero if the feature exists. Zero if the feature does not
73 * exist.
74 */
75static inline int octeon_has_feature(enum octeon_feature feature)
76{
77 switch (feature) {
78 case OCTEON_FEATURE_SAAD:
79 return !OCTEON_IS_MODEL(OCTEON_CN3XXX);
80
81 case OCTEON_FEATURE_ZIP:
82 if (OCTEON_IS_MODEL(OCTEON_CN30XX)
83 || OCTEON_IS_MODEL(OCTEON_CN50XX)
84 || OCTEON_IS_MODEL(OCTEON_CN52XX))
85 return 0;
86 else if (OCTEON_IS_MODEL(OCTEON_CN38XX_PASS1))
87 return 1;
88 else
89 return !cvmx_fuse_read(121);
90
91 case OCTEON_FEATURE_CRYPTO:
92 return !cvmx_fuse_read(90);
93
94 case OCTEON_FEATURE_PCIE:
95 return OCTEON_IS_MODEL(OCTEON_CN56XX)
96 || OCTEON_IS_MODEL(OCTEON_CN52XX);
97
98 case OCTEON_FEATURE_KEY_MEMORY:
99 case OCTEON_FEATURE_LED_CONTROLLER:
100 return OCTEON_IS_MODEL(OCTEON_CN38XX)
101 || OCTEON_IS_MODEL(OCTEON_CN58XX)
102 || OCTEON_IS_MODEL(OCTEON_CN56XX);
103 case OCTEON_FEATURE_TRA:
104 return !(OCTEON_IS_MODEL(OCTEON_CN30XX)
105 || OCTEON_IS_MODEL(OCTEON_CN50XX));
106 case OCTEON_FEATURE_MGMT_PORT:
107 return OCTEON_IS_MODEL(OCTEON_CN56XX)
108 || OCTEON_IS_MODEL(OCTEON_CN52XX);
109 case OCTEON_FEATURE_RAID:
110 return OCTEON_IS_MODEL(OCTEON_CN56XX)
111 || OCTEON_IS_MODEL(OCTEON_CN52XX);
112 case OCTEON_FEATURE_USB:
113 return !(OCTEON_IS_MODEL(OCTEON_CN38XX)
114 || OCTEON_IS_MODEL(OCTEON_CN58XX));
115 }
116 return 0;
117}
118
119#endif /* __OCTEON_FEATURE_H__ */
diff --git a/arch/mips/include/asm/octeon/octeon-model.h b/arch/mips/include/asm/octeon/octeon-model.h
new file mode 100644
index 000000000000..cf50336eca2e
--- /dev/null
+++ b/arch/mips/include/asm/octeon/octeon-model.h
@@ -0,0 +1,321 @@
1/***********************license start***************
2 * Author: Cavium Networks
3 *
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
6 *
7 * Copyright (c) 2003-2008 Cavium Networks
8 *
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
12 *
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
17 * details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
23 *
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 ***********************license end**************************************/
27
28/*
29 *
30 * File defining different Octeon model IDs and macros to
31 * compare them.
32 *
33 */
34
35#ifndef __OCTEON_MODEL_H__
36#define __OCTEON_MODEL_H__
37
38/* NOTE: These must match what is checked in common-config.mk */
39/* Defines to represent the different versions of Octeon. */
40
41/*
42 * IMPORTANT: When the default pass is updated for an Octeon Model,
43 * the corresponding change must also be made in the oct-sim script.
44 */
45
46/*
47 * The defines below should be used with the OCTEON_IS_MODEL() macro
48 * to determine what model of chip the software is running on. Models
49 * ending in 'XX' match multiple models (families), while specific
50 * models match only that model. If a pass (revision) is specified,
51 * then only that revision will be matched. Care should be taken when
52 * checking for both specific models and families that the specific
53 * models are checked for first. While these defines are similar to
54 * the processor ID, they are not intended to be used by anything
55 * other that the OCTEON_IS_MODEL framework, and the values are
56 * subject to change at anytime without notice.
57 *
58 * NOTE: only the OCTEON_IS_MODEL() macro/function and the OCTEON_CN*
59 * macros should be used outside of this file. All other macros are
60 * for internal use only, and may change without notice.
61 */
62
63/* Flag bits in top byte */
64/* Ignores revision in model checks */
65#define OM_IGNORE_REVISION 0x01000000
66/* Check submodels */
67#define OM_CHECK_SUBMODEL 0x02000000
68/* Match all models previous than the one specified */
69#define OM_MATCH_PREVIOUS_MODELS 0x04000000
70/* Ignores the minor revison on newer parts */
71#define OM_IGNORE_MINOR_REVISION 0x08000000
72#define OM_FLAG_MASK 0xff000000
73
74/*
75 * CN5XXX models with new revision encoding
76 */
77#define OCTEON_CN58XX_PASS1_0 0x000d0300
78#define OCTEON_CN58XX_PASS1_1 0x000d0301
79#define OCTEON_CN58XX_PASS1_2 0x000d0303
80#define OCTEON_CN58XX_PASS2_0 0x000d0308
81#define OCTEON_CN58XX_PASS2_1 0x000d0309
82#define OCTEON_CN58XX_PASS2_2 0x000d030a
83#define OCTEON_CN58XX_PASS2_3 0x000d030b
84
85#define OCTEON_CN58XX (OCTEON_CN58XX_PASS1_0 | OM_IGNORE_REVISION)
86#define OCTEON_CN58XX_PASS1_X (OCTEON_CN58XX_PASS1_0 \
87 | OM_IGNORE_MINOR_REVISION)
88#define OCTEON_CN58XX_PASS2_X (OCTEON_CN58XX_PASS2_0 \
89 | OM_IGNORE_MINOR_REVISION)
90#define OCTEON_CN58XX_PASS1 OCTEON_CN58XX_PASS1_X
91#define OCTEON_CN58XX_PASS2 OCTEON_CN58XX_PASS2_X
92
93#define OCTEON_CN56XX_PASS1_0 0x000d0400
94#define OCTEON_CN56XX_PASS1_1 0x000d0401
95#define OCTEON_CN56XX_PASS2_0 0x000d0408
96#define OCTEON_CN56XX_PASS2_1 0x000d0409
97
98#define OCTEON_CN56XX (OCTEON_CN56XX_PASS2_0 | OM_IGNORE_REVISION)
99#define OCTEON_CN56XX_PASS1_X (OCTEON_CN56XX_PASS1_0 \
100 | OM_IGNORE_MINOR_REVISION)
101#define OCTEON_CN56XX_PASS2_X (OCTEON_CN56XX_PASS2_0 \
102 | OM_IGNORE_MINOR_REVISION)
103#define OCTEON_CN56XX_PASS1 OCTEON_CN56XX_PASS1_X
104#define OCTEON_CN56XX_PASS2 OCTEON_CN56XX_PASS2_X
105
106#define OCTEON_CN57XX OCTEON_CN56XX
107#define OCTEON_CN57XX_PASS1 OCTEON_CN56XX_PASS1
108#define OCTEON_CN57XX_PASS2 OCTEON_CN56XX_PASS2
109
110#define OCTEON_CN55XX OCTEON_CN56XX
111#define OCTEON_CN55XX_PASS1 OCTEON_CN56XX_PASS1
112#define OCTEON_CN55XX_PASS2 OCTEON_CN56XX_PASS2
113
114#define OCTEON_CN54XX OCTEON_CN56XX
115#define OCTEON_CN54XX_PASS1 OCTEON_CN56XX_PASS1
116#define OCTEON_CN54XX_PASS2 OCTEON_CN56XX_PASS2
117
118#define OCTEON_CN50XX_PASS1_0 0x000d0600
119
120#define OCTEON_CN50XX (OCTEON_CN50XX_PASS1_0 | OM_IGNORE_REVISION)
121#define OCTEON_CN50XX_PASS1_X (OCTEON_CN50XX_PASS1_0 \
122 | OM_IGNORE_MINOR_REVISION)
123#define OCTEON_CN50XX_PASS1 OCTEON_CN50XX_PASS1_X
124
125/*
126 * NOTE: Octeon CN5000F model is not identifiable using the
127 * OCTEON_IS_MODEL() functions, but are treated as CN50XX.
128 */
129
130#define OCTEON_CN52XX_PASS1_0 0x000d0700
131#define OCTEON_CN52XX_PASS2_0 0x000d0708
132
133#define OCTEON_CN52XX (OCTEON_CN52XX_PASS2_0 | OM_IGNORE_REVISION)
134#define OCTEON_CN52XX_PASS1_X (OCTEON_CN52XX_PASS1_0 \
135 | OM_IGNORE_MINOR_REVISION)
136#define OCTEON_CN52XX_PASS2_X (OCTEON_CN52XX_PASS2_0 \
137 | OM_IGNORE_MINOR_REVISION)
138#define OCTEON_CN52XX_PASS1 OCTEON_CN52XX_PASS1_X
139#define OCTEON_CN52XX_PASS2 OCTEON_CN52XX_PASS2_X
140
141/*
142 * CN3XXX models with old revision enconding
143 */
144#define OCTEON_CN38XX_PASS1 0x000d0000
145#define OCTEON_CN38XX_PASS2 0x000d0001
146#define OCTEON_CN38XX_PASS3 0x000d0003
147#define OCTEON_CN38XX (OCTEON_CN38XX_PASS3 | OM_IGNORE_REVISION)
148
149#define OCTEON_CN36XX OCTEON_CN38XX
150#define OCTEON_CN36XX_PASS2 OCTEON_CN38XX_PASS2
151#define OCTEON_CN36XX_PASS3 OCTEON_CN38XX_PASS3
152
153/* The OCTEON_CN31XX matches CN31XX models and the CN3020 */
154#define OCTEON_CN31XX_PASS1 0x000d0100
155#define OCTEON_CN31XX_PASS1_1 0x000d0102
156#define OCTEON_CN31XX (OCTEON_CN31XX_PASS1 | OM_IGNORE_REVISION)
157
158/*
159 * This model is only used for internal checks, it is not a valid
160 * model for the OCTEON_MODEL environment variable. This matches the
161 * CN3010 and CN3005 but NOT the CN3020.
162 */
163#define OCTEON_CN30XX_PASS1 0x000d0200
164#define OCTEON_CN30XX_PASS1_1 0x000d0202
165#define OCTEON_CN30XX (OCTEON_CN30XX_PASS1 | OM_IGNORE_REVISION)
166
167#define OCTEON_CN3005_PASS1 (0x000d0210 | OM_CHECK_SUBMODEL)
168#define OCTEON_CN3005_PASS1_0 (0x000d0210 | OM_CHECK_SUBMODEL)
169#define OCTEON_CN3005_PASS1_1 (0x000d0212 | OM_CHECK_SUBMODEL)
170#define OCTEON_CN3005 (OCTEON_CN3005_PASS1 | OM_IGNORE_REVISION \
171 | OM_CHECK_SUBMODEL)
172
173#define OCTEON_CN3010_PASS1 (0x000d0200 | OM_CHECK_SUBMODEL)
174#define OCTEON_CN3010_PASS1_0 (0x000d0200 | OM_CHECK_SUBMODEL)
175#define OCTEON_CN3010_PASS1_1 (0x000d0202 | OM_CHECK_SUBMODEL)
176#define OCTEON_CN3010 (OCTEON_CN3010_PASS1 | OM_IGNORE_REVISION \
177 | OM_CHECK_SUBMODEL)
178
179#define OCTEON_CN3020_PASS1 (0x000d0110 | OM_CHECK_SUBMODEL)
180#define OCTEON_CN3020_PASS1_0 (0x000d0110 | OM_CHECK_SUBMODEL)
181#define OCTEON_CN3020_PASS1_1 (0x000d0112 | OM_CHECK_SUBMODEL)
182#define OCTEON_CN3020 (OCTEON_CN3020_PASS1 | OM_IGNORE_REVISION \
183 | OM_CHECK_SUBMODEL)
184
185
186
187/* This matches the complete family of CN3xxx CPUs, and not subsequent models */
188#define OCTEON_CN3XXX (OCTEON_CN58XX_PASS1_0 \
189 | OM_MATCH_PREVIOUS_MODELS \
190 | OM_IGNORE_REVISION)
191
192/* The revision byte (low byte) has two different encodings.
193 * CN3XXX:
194 *
195 * bits
196 * <7:5>: reserved (0)
197 * <4>: alternate package
198 * <3:0>: revision
199 *
200 * CN5XXX:
201 *
202 * bits
203 * <7>: reserved (0)
204 * <6>: alternate package
205 * <5:3>: major revision
206 * <2:0>: minor revision
207 *
208 */
209
210/* Masks used for the various types of model/family/revision matching */
211#define OCTEON_38XX_FAMILY_MASK 0x00ffff00
212#define OCTEON_38XX_FAMILY_REV_MASK 0x00ffff0f
213#define OCTEON_38XX_MODEL_MASK 0x00ffff10
214#define OCTEON_38XX_MODEL_REV_MASK (OCTEON_38XX_FAMILY_REV_MASK \
215 | OCTEON_38XX_MODEL_MASK)
216
217/* CN5XXX and later use different layout of bits in the revision ID field */
218#define OCTEON_58XX_FAMILY_MASK OCTEON_38XX_FAMILY_MASK
219#define OCTEON_58XX_FAMILY_REV_MASK 0x00ffff3f
220#define OCTEON_58XX_MODEL_MASK 0x00ffffc0
221#define OCTEON_58XX_MODEL_REV_MASK (OCTEON_58XX_FAMILY_REV_MASK \
222 | OCTEON_58XX_MODEL_MASK)
223#define OCTEON_58XX_MODEL_MINOR_REV_MASK (OCTEON_58XX_MODEL_REV_MASK \
224 & 0x00fffff8)
225
226#define __OCTEON_MATCH_MASK__(x, y, z) (((x) & (z)) == ((y) & (z)))
227
228/* NOTE: This is for internal (to this file) use only. */
229static inline int __OCTEON_IS_MODEL_COMPILE__(uint32_t arg_model,
230 uint32_t chip_model)
231{
232 uint32_t rev_and_sub = OM_IGNORE_REVISION | OM_CHECK_SUBMODEL;
233
234 if ((arg_model & OCTEON_38XX_FAMILY_MASK) < OCTEON_CN58XX_PASS1_0) {
235 if (((arg_model & OM_FLAG_MASK) == rev_and_sub) &&
236 __OCTEON_MATCH_MASK__(chip_model, arg_model,
237 OCTEON_38XX_MODEL_MASK))
238 return 1;
239 if (((arg_model & OM_FLAG_MASK) == 0) &&
240 __OCTEON_MATCH_MASK__(chip_model, arg_model,
241 OCTEON_38XX_FAMILY_REV_MASK))
242 return 1;
243 if (((arg_model & OM_FLAG_MASK) == OM_IGNORE_REVISION) &&
244 __OCTEON_MATCH_MASK__(chip_model, arg_model,
245 OCTEON_38XX_FAMILY_MASK))
246 return 1;
247 if (((arg_model & OM_FLAG_MASK) == OM_CHECK_SUBMODEL) &&
248 __OCTEON_MATCH_MASK__((chip_model), (arg_model),
249 OCTEON_38XX_MODEL_REV_MASK))
250 return 1;
251 if ((arg_model & OM_MATCH_PREVIOUS_MODELS) &&
252 ((chip_model & OCTEON_38XX_MODEL_MASK) <
253 (arg_model & OCTEON_38XX_MODEL_MASK)))
254 return 1;
255 } else {
256 if (((arg_model & OM_FLAG_MASK) == rev_and_sub) &&
257 __OCTEON_MATCH_MASK__((chip_model), (arg_model),
258 OCTEON_58XX_MODEL_MASK))
259 return 1;
260 if (((arg_model & OM_FLAG_MASK) == 0) &&
261 __OCTEON_MATCH_MASK__((chip_model), (arg_model),
262 OCTEON_58XX_FAMILY_REV_MASK))
263 return 1;
264 if (((arg_model & OM_FLAG_MASK) == OM_IGNORE_MINOR_REVISION) &&
265 __OCTEON_MATCH_MASK__((chip_model), (arg_model),
266 OCTEON_58XX_MODEL_MINOR_REV_MASK))
267 return 1;
268 if (((arg_model & OM_FLAG_MASK) == OM_IGNORE_REVISION) &&
269 __OCTEON_MATCH_MASK__((chip_model), (arg_model),
270 OCTEON_58XX_FAMILY_MASK))
271 return 1;
272 if (((arg_model & OM_FLAG_MASK) == OM_CHECK_SUBMODEL) &&
273 __OCTEON_MATCH_MASK__((chip_model), (arg_model),
274 OCTEON_58XX_MODEL_REV_MASK))
275 return 1;
276 if ((arg_model & OM_MATCH_PREVIOUS_MODELS) &&
277 ((chip_model & OCTEON_58XX_MODEL_MASK) <
278 (arg_model & OCTEON_58XX_MODEL_MASK)))
279 return 1;
280 }
281 return 0;
282}
283
284/* forward declarations */
285static inline uint32_t cvmx_get_proc_id(void) __attribute__ ((pure));
286static inline uint64_t cvmx_read_csr(uint64_t csr_addr);
287
288/* NOTE: This for internal use only!!!!! */
289static inline int __octeon_is_model_runtime__(uint32_t model)
290{
291 uint32_t cpuid = cvmx_get_proc_id();
292
293 /*
294 * Check for special case of mismarked 3005 samples. We only
295 * need to check if the sub model isn't being ignored.
296 */
297 if ((model & OM_CHECK_SUBMODEL) == OM_CHECK_SUBMODEL) {
298 if (cpuid == OCTEON_CN3010_PASS1 \
299 && (cvmx_read_csr(0x80011800800007B8ull) & (1ull << 34)))
300 cpuid |= 0x10;
301 }
302 return __OCTEON_IS_MODEL_COMPILE__(model, cpuid);
303}
304
305/*
306 * The OCTEON_IS_MODEL macro should be used for all Octeon model
307 * checking done in a program. This should be kept runtime if at all
308 * possible. Any compile time (#if OCTEON_IS_MODEL) usage must be
309 * condtionalized with OCTEON_IS_COMMON_BINARY() if runtime checking
310 * support is required.
311 */
312#define OCTEON_IS_MODEL(x) __octeon_is_model_runtime__(x)
313#define OCTEON_IS_COMMON_BINARY() 1
314#undef OCTEON_MODEL
315
316const char *octeon_model_get_string(uint32_t chip_id);
317const char *octeon_model_get_string_buffer(uint32_t chip_id, char *buffer);
318
319#include "octeon-feature.h"
320
321#endif /* __OCTEON_MODEL_H__ */
diff --git a/arch/mips/include/asm/octeon/octeon.h b/arch/mips/include/asm/octeon/octeon.h
new file mode 100644
index 000000000000..edc676084cda
--- /dev/null
+++ b/arch/mips/include/asm/octeon/octeon.h
@@ -0,0 +1,248 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2004-2008 Cavium Networks
7 */
8#ifndef __ASM_OCTEON_OCTEON_H
9#define __ASM_OCTEON_OCTEON_H
10
11#include "cvmx.h"
12
13extern uint64_t octeon_bootmem_alloc_range_phys(uint64_t size,
14 uint64_t alignment,
15 uint64_t min_addr,
16 uint64_t max_addr,
17 int do_locking);
18extern void *octeon_bootmem_alloc(uint64_t size, uint64_t alignment,
19 int do_locking);
20extern void *octeon_bootmem_alloc_range(uint64_t size, uint64_t alignment,
21 uint64_t min_addr, uint64_t max_addr,
22 int do_locking);
23extern void *octeon_bootmem_alloc_named(uint64_t size, uint64_t alignment,
24 char *name);
25extern void *octeon_bootmem_alloc_named_range(uint64_t size, uint64_t min_addr,
26 uint64_t max_addr, uint64_t align,
27 char *name);
28extern void *octeon_bootmem_alloc_named_address(uint64_t size, uint64_t address,
29 char *name);
30extern int octeon_bootmem_free_named(char *name);
31extern void octeon_bootmem_lock(void);
32extern void octeon_bootmem_unlock(void);
33
34extern int octeon_is_simulation(void);
35extern int octeon_is_pci_host(void);
36extern int octeon_usb_is_ref_clk(void);
37extern uint64_t octeon_get_clock_rate(void);
38extern const char *octeon_board_type_string(void);
39extern const char *octeon_get_pci_interrupts(void);
40extern int octeon_get_southbridge_interrupt(void);
41extern int octeon_get_boot_coremask(void);
42extern int octeon_get_boot_num_arguments(void);
43extern const char *octeon_get_boot_argument(int arg);
44extern void octeon_hal_setup_reserved32(void);
45extern void octeon_user_io_init(void);
46struct octeon_cop2_state;
47extern unsigned long octeon_crypto_enable(struct octeon_cop2_state *state);
48extern void octeon_crypto_disable(struct octeon_cop2_state *state,
49 unsigned long flags);
50
51extern void octeon_init_cvmcount(void);
52
53#define OCTEON_ARGV_MAX_ARGS 64
54#define OCTOEN_SERIAL_LEN 20
55
56struct octeon_boot_descriptor {
57 /* Start of block referenced by assembly code - do not change! */
58 uint32_t desc_version;
59 uint32_t desc_size;
60 uint64_t stack_top;
61 uint64_t heap_base;
62 uint64_t heap_end;
63 /* Only used by bootloader */
64 uint64_t entry_point;
65 uint64_t desc_vaddr;
66 /* End of This block referenced by assembly code - do not change! */
67 uint32_t exception_base_addr;
68 uint32_t stack_size;
69 uint32_t heap_size;
70 /* Argc count for application. */
71 uint32_t argc;
72 uint32_t argv[OCTEON_ARGV_MAX_ARGS];
73
74#define BOOT_FLAG_INIT_CORE (1 << 0)
75#define OCTEON_BL_FLAG_DEBUG (1 << 1)
76#define OCTEON_BL_FLAG_NO_MAGIC (1 << 2)
77 /* If set, use uart1 for console */
78#define OCTEON_BL_FLAG_CONSOLE_UART1 (1 << 3)
79 /* If set, use PCI console */
80#define OCTEON_BL_FLAG_CONSOLE_PCI (1 << 4)
81 /* Call exit on break on serial port */
82#define OCTEON_BL_FLAG_BREAK (1 << 5)
83
84 uint32_t flags;
85 uint32_t core_mask;
86 /* DRAM size in megabyes. */
87 uint32_t dram_size;
88 /* physical address of free memory descriptor block. */
89 uint32_t phy_mem_desc_addr;
90 /* used to pass flags from app to debugger. */
91 uint32_t debugger_flags_base_addr;
92 /* CPU clock speed, in hz. */
93 uint32_t eclock_hz;
94 /* DRAM clock speed, in hz. */
95 uint32_t dclock_hz;
96 /* SPI4 clock in hz. */
97 uint32_t spi_clock_hz;
98 uint16_t board_type;
99 uint8_t board_rev_major;
100 uint8_t board_rev_minor;
101 uint16_t chip_type;
102 uint8_t chip_rev_major;
103 uint8_t chip_rev_minor;
104 char board_serial_number[OCTOEN_SERIAL_LEN];
105 uint8_t mac_addr_base[6];
106 uint8_t mac_addr_count;
107 uint64_t cvmx_desc_vaddr;
108};
109
110union octeon_cvmemctl {
111 uint64_t u64;
112 struct {
113 /* RO 1 = BIST fail, 0 = BIST pass */
114 uint64_t tlbbist:1;
115 /* RO 1 = BIST fail, 0 = BIST pass */
116 uint64_t l1cbist:1;
117 /* RO 1 = BIST fail, 0 = BIST pass */
118 uint64_t l1dbist:1;
119 /* RO 1 = BIST fail, 0 = BIST pass */
120 uint64_t dcmbist:1;
121 /* RO 1 = BIST fail, 0 = BIST pass */
122 uint64_t ptgbist:1;
123 /* RO 1 = BIST fail, 0 = BIST pass */
124 uint64_t wbfbist:1;
125 /* Reserved */
126 uint64_t reserved:22;
127 /* R/W If set, marked write-buffer entries time out
128 * the same as as other entries; if clear, marked
129 * write-buffer entries use the maximum timeout. */
130 uint64_t dismarkwblongto:1;
131 /* R/W If set, a merged store does not clear the
132 * write-buffer entry timeout state. */
133 uint64_t dismrgclrwbto:1;
134 /* R/W Two bits that are the MSBs of the resultant
135 * CVMSEG LM word location for an IOBDMA. The other 8
136 * bits come from the SCRADDR field of the IOBDMA. */
137 uint64_t iobdmascrmsb:2;
138 /* R/W If set, SYNCWS and SYNCS only order marked
139 * stores; if clear, SYNCWS and SYNCS only order
140 * unmarked stores. SYNCWSMARKED has no effect when
141 * DISSYNCWS is set. */
142 uint64_t syncwsmarked:1;
143 /* R/W If set, SYNCWS acts as SYNCW and SYNCS acts as
144 * SYNC. */
145 uint64_t dissyncws:1;
146 /* R/W If set, no stall happens on write buffer
147 * full. */
148 uint64_t diswbfst:1;
149 /* R/W If set (and SX set), supervisor-level
150 * loads/stores can use XKPHYS addresses with
151 * VA<48>==0 */
152 uint64_t xkmemenas:1;
153 /* R/W If set (and UX set), user-level loads/stores
154 * can use XKPHYS addresses with VA<48>==0 */
155 uint64_t xkmemenau:1;
156 /* R/W If set (and SX set), supervisor-level
157 * loads/stores can use XKPHYS addresses with
158 * VA<48>==1 */
159 uint64_t xkioenas:1;
160 /* R/W If set (and UX set), user-level loads/stores
161 * can use XKPHYS addresses with VA<48>==1 */
162 uint64_t xkioenau:1;
163 /* R/W If set, all stores act as SYNCW (NOMERGE must
164 * be set when this is set) RW, reset to 0. */
165 uint64_t allsyncw:1;
166 /* R/W If set, no stores merge, and all stores reach
167 * the coherent bus in order. */
168 uint64_t nomerge:1;
169 /* R/W Selects the bit in the counter used for DID
170 * time-outs 0 = 231, 1 = 230, 2 = 229, 3 =
171 * 214. Actual time-out is between 1x and 2x this
172 * interval. For example, with DIDTTO=3, expiration
173 * interval is between 16K and 32K. */
174 uint64_t didtto:2;
175 /* R/W If set, the (mem) CSR clock never turns off. */
176 uint64_t csrckalwys:1;
177 /* R/W If set, mclk never turns off. */
178 uint64_t mclkalwys:1;
179 /* R/W Selects the bit in the counter used for write
180 * buffer flush time-outs (WBFLT+11) is the bit
181 * position in an internal counter used to determine
182 * expiration. The write buffer expires between 1x and
183 * 2x this interval. For example, with WBFLT = 0, a
184 * write buffer expires between 2K and 4K cycles after
185 * the write buffer entry is allocated. */
186 uint64_t wbfltime:3;
187 /* R/W If set, do not put Istream in the L2 cache. */
188 uint64_t istrnol2:1;
189 /* R/W The write buffer threshold. */
190 uint64_t wbthresh:4;
191 /* Reserved */
192 uint64_t reserved2:2;
193 /* R/W If set, CVMSEG is available for loads/stores in
194 * kernel/debug mode. */
195 uint64_t cvmsegenak:1;
196 /* R/W If set, CVMSEG is available for loads/stores in
197 * supervisor mode. */
198 uint64_t cvmsegenas:1;
199 /* R/W If set, CVMSEG is available for loads/stores in
200 * user mode. */
201 uint64_t cvmsegenau:1;
202 /* R/W Size of local memory in cache blocks, 54 (6912
203 * bytes) is max legal value. */
204 uint64_t lmemsz:6;
205 } s;
206};
207
208struct octeon_cf_data {
209 unsigned long base_region_bias;
210 unsigned int base_region; /* The chip select region used by CF */
211 int is16bit; /* 0 - 8bit, !0 - 16bit */
212 int dma_engine; /* -1 for no DMA */
213};
214
215extern void octeon_write_lcd(const char *s);
216extern void octeon_check_cpu_bist(void);
217extern int octeon_get_boot_debug_flag(void);
218extern int octeon_get_boot_uart(void);
219
220struct uart_port;
221extern unsigned int octeon_serial_in(struct uart_port *, int);
222extern void octeon_serial_out(struct uart_port *, int, int);
223
224/**
225 * Write a 32bit value to the Octeon NPI register space
226 *
227 * @address: Address to write to
228 * @val: Value to write
229 */
230static inline void octeon_npi_write32(uint64_t address, uint32_t val)
231{
232 cvmx_write64_uint32(address ^ 4, val);
233 cvmx_read64_uint32(address ^ 4);
234}
235
236
237/**
238 * Read a 32bit value from the Octeon NPI register space
239 *
240 * @address: Address to read
241 * Returns The result
242 */
243static inline uint32_t octeon_npi_read32(uint64_t address)
244{
245 return cvmx_read64_uint32(address ^ 4);
246}
247
248#endif /* __ASM_OCTEON_OCTEON_H */
diff --git a/arch/mips/include/asm/processor.h b/arch/mips/include/asm/processor.h
index 18ee58e39445..0f926aa0cb47 100644
--- a/arch/mips/include/asm/processor.h
+++ b/arch/mips/include/asm/processor.h
@@ -118,6 +118,60 @@ union mips_watch_reg_state {
118 struct mips3264_watch_reg_state mips3264; 118 struct mips3264_watch_reg_state mips3264;
119}; 119};
120 120
121#ifdef CONFIG_CPU_CAVIUM_OCTEON
122
123struct octeon_cop2_state {
124 /* DMFC2 rt, 0x0201 */
125 unsigned long cop2_crc_iv;
126 /* DMFC2 rt, 0x0202 (Set with DMTC2 rt, 0x1202) */
127 unsigned long cop2_crc_length;
128 /* DMFC2 rt, 0x0200 (set with DMTC2 rt, 0x4200) */
129 unsigned long cop2_crc_poly;
130 /* DMFC2 rt, 0x0402; DMFC2 rt, 0x040A */
131 unsigned long cop2_llm_dat[2];
132 /* DMFC2 rt, 0x0084 */
133 unsigned long cop2_3des_iv;
134 /* DMFC2 rt, 0x0080; DMFC2 rt, 0x0081; DMFC2 rt, 0x0082 */
135 unsigned long cop2_3des_key[3];
136 /* DMFC2 rt, 0x0088 (Set with DMTC2 rt, 0x0098) */
137 unsigned long cop2_3des_result;
138 /* DMFC2 rt, 0x0111 (FIXME: Read Pass1 Errata) */
139 unsigned long cop2_aes_inp0;
140 /* DMFC2 rt, 0x0102; DMFC2 rt, 0x0103 */
141 unsigned long cop2_aes_iv[2];
142 /* DMFC2 rt, 0x0104; DMFC2 rt, 0x0105; DMFC2 rt, 0x0106; DMFC2
143 * rt, 0x0107 */
144 unsigned long cop2_aes_key[4];
145 /* DMFC2 rt, 0x0110 */
146 unsigned long cop2_aes_keylen;
147 /* DMFC2 rt, 0x0100; DMFC2 rt, 0x0101 */
148 unsigned long cop2_aes_result[2];
149 /* DMFC2 rt, 0x0240; DMFC2 rt, 0x0241; DMFC2 rt, 0x0242; DMFC2
150 * rt, 0x0243; DMFC2 rt, 0x0244; DMFC2 rt, 0x0245; DMFC2 rt,
151 * 0x0246; DMFC2 rt, 0x0247; DMFC2 rt, 0x0248; DMFC2 rt,
152 * 0x0249; DMFC2 rt, 0x024A; DMFC2 rt, 0x024B; DMFC2 rt,
153 * 0x024C; DMFC2 rt, 0x024D; DMFC2 rt, 0x024E - Pass2 */
154 unsigned long cop2_hsh_datw[15];
155 /* DMFC2 rt, 0x0250; DMFC2 rt, 0x0251; DMFC2 rt, 0x0252; DMFC2
156 * rt, 0x0253; DMFC2 rt, 0x0254; DMFC2 rt, 0x0255; DMFC2 rt,
157 * 0x0256; DMFC2 rt, 0x0257 - Pass2 */
158 unsigned long cop2_hsh_ivw[8];
159 /* DMFC2 rt, 0x0258; DMFC2 rt, 0x0259 - Pass2 */
160 unsigned long cop2_gfm_mult[2];
161 /* DMFC2 rt, 0x025E - Pass2 */
162 unsigned long cop2_gfm_poly;
163 /* DMFC2 rt, 0x025A; DMFC2 rt, 0x025B - Pass2 */
164 unsigned long cop2_gfm_result[2];
165};
166#define INIT_OCTEON_COP2 {0,}
167
168struct octeon_cvmseg_state {
169 unsigned long cvmseg[CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE]
170 [cpu_dcache_line_size() / sizeof(unsigned long)];
171};
172
173#endif
174
121typedef struct { 175typedef struct {
122 unsigned long seg; 176 unsigned long seg;
123} mm_segment_t; 177} mm_segment_t;
@@ -160,6 +214,10 @@ struct thread_struct {
160 unsigned long trap_no; 214 unsigned long trap_no;
161 unsigned long irix_trampoline; /* Wheee... */ 215 unsigned long irix_trampoline; /* Wheee... */
162 unsigned long irix_oldctx; 216 unsigned long irix_oldctx;
217#ifdef CONFIG_CPU_CAVIUM_OCTEON
218 struct octeon_cop2_state cp2 __attribute__ ((__aligned__(128)));
219 struct octeon_cvmseg_state cvmseg __attribute__ ((__aligned__(128)));
220#endif
163 struct mips_abi *abi; 221 struct mips_abi *abi;
164}; 222};
165 223
@@ -171,6 +229,13 @@ struct thread_struct {
171#define FPAFF_INIT 229#define FPAFF_INIT
172#endif /* CONFIG_MIPS_MT_FPAFF */ 230#endif /* CONFIG_MIPS_MT_FPAFF */
173 231
232#ifdef CONFIG_CPU_CAVIUM_OCTEON
233#define OCTEON_INIT \
234 .cp2 = INIT_OCTEON_COP2,
235#else
236#define OCTEON_INIT
237#endif /* CONFIG_CPU_CAVIUM_OCTEON */
238
174#define INIT_THREAD { \ 239#define INIT_THREAD { \
175 /* \ 240 /* \
176 * Saved main processor registers \ 241 * Saved main processor registers \
@@ -221,6 +286,10 @@ struct thread_struct {
221 .trap_no = 0, \ 286 .trap_no = 0, \
222 .irix_trampoline = 0, \ 287 .irix_trampoline = 0, \
223 .irix_oldctx = 0, \ 288 .irix_oldctx = 0, \
289 /* \
290 * Cavium Octeon specifics (null if not Octeon) \
291 */ \
292 OCTEON_INIT \
224} 293}
225 294
226struct task_struct; 295struct task_struct;
diff --git a/arch/mips/include/asm/ptrace.h b/arch/mips/include/asm/ptrace.h
index c2c8bac43307..1f30d16d4669 100644
--- a/arch/mips/include/asm/ptrace.h
+++ b/arch/mips/include/asm/ptrace.h
@@ -48,6 +48,10 @@ struct pt_regs {
48#ifdef CONFIG_MIPS_MT_SMTC 48#ifdef CONFIG_MIPS_MT_SMTC
49 unsigned long cp0_tcstatus; 49 unsigned long cp0_tcstatus;
50#endif /* CONFIG_MIPS_MT_SMTC */ 50#endif /* CONFIG_MIPS_MT_SMTC */
51#ifdef CONFIG_CPU_CAVIUM_OCTEON
52 unsigned long long mpl[3]; /* MTM{0,1,2} */
53 unsigned long long mtp[3]; /* MTP{0,1,2} */
54#endif
51} __attribute__ ((aligned (8))); 55} __attribute__ ((aligned (8)));
52 56
53/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ 57/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
diff --git a/arch/mips/include/asm/smp.h b/arch/mips/include/asm/smp.h
index 0ff5b523ea77..40e5ef1d4d26 100644
--- a/arch/mips/include/asm/smp.h
+++ b/arch/mips/include/asm/smp.h
@@ -37,9 +37,9 @@ extern int __cpu_logical_map[NR_CPUS];
37 37
38#define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */ 38#define SMP_RESCHEDULE_YOURSELF 0x1 /* XXX braindead */
39#define SMP_CALL_FUNCTION 0x2 39#define SMP_CALL_FUNCTION 0x2
40/* Octeon - Tell another core to flush its icache */
41#define SMP_ICACHE_FLUSH 0x4
40 42
41extern cpumask_t phys_cpu_present_map;
42#define cpu_possible_map phys_cpu_present_map
43 43
44extern void asmlinkage smp_bootstrap(void); 44extern void asmlinkage smp_bootstrap(void);
45 45
diff --git a/arch/mips/include/asm/stackframe.h b/arch/mips/include/asm/stackframe.h
index 4c37c4e5f72e..db0fa7b5aeaf 100644
--- a/arch/mips/include/asm/stackframe.h
+++ b/arch/mips/include/asm/stackframe.h
@@ -194,6 +194,19 @@
194 LONG_S $31, PT_R31(sp) 194 LONG_S $31, PT_R31(sp)
195 ori $28, sp, _THREAD_MASK 195 ori $28, sp, _THREAD_MASK
196 xori $28, _THREAD_MASK 196 xori $28, _THREAD_MASK
197#ifdef CONFIG_CPU_CAVIUM_OCTEON
198 .set mips64
199 pref 0, 0($28) /* Prefetch the current pointer */
200 pref 0, PT_R31(sp) /* Prefetch the $31(ra) */
201 /* The Octeon multiplier state is affected by general multiply
202 instructions. It must be saved before and kernel code might
203 corrupt it */
204 jal octeon_mult_save
205 LONG_L v1, 0($28) /* Load the current pointer */
206 /* Restore $31(ra) that was changed by the jal */
207 LONG_L ra, PT_R31(sp)
208 pref 0, 0(v1) /* Prefetch the current thread */
209#endif
197 .set pop 210 .set pop
198 .endm 211 .endm
199 212
@@ -324,6 +337,10 @@
324 DVPE 5 # dvpe a1 337 DVPE 5 # dvpe a1
325 jal mips_ihb 338 jal mips_ihb
326#endif /* CONFIG_MIPS_MT_SMTC */ 339#endif /* CONFIG_MIPS_MT_SMTC */
340#ifdef CONFIG_CPU_CAVIUM_OCTEON
341 /* Restore the Octeon multiplier state */
342 jal octeon_mult_restore
343#endif
327 mfc0 a0, CP0_STATUS 344 mfc0 a0, CP0_STATUS
328 ori a0, STATMASK 345 ori a0, STATMASK
329 xori a0, STATMASK 346 xori a0, STATMASK
diff --git a/arch/mips/include/asm/swab.h b/arch/mips/include/asm/swab.h
new file mode 100644
index 000000000000..88f1f7d555cb
--- /dev/null
+++ b/arch/mips/include/asm/swab.h
@@ -0,0 +1,55 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1996, 99, 2003 by Ralf Baechle
7 */
8#ifndef _ASM_SWAB_H
9#define _ASM_SWAB_H
10
11#include <linux/compiler.h>
12#include <asm/types.h>
13
14#define __SWAB_64_THRU_32__
15
16#ifdef CONFIG_CPU_MIPSR2
17
18static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
19{
20 __asm__(
21 " wsbh %0, %1 \n"
22 : "=r" (x)
23 : "r" (x));
24
25 return x;
26}
27#define __arch_swab16 __arch_swab16
28
29static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
30{
31 __asm__(
32 " wsbh %0, %1 \n"
33 " rotr %0, %0, 16 \n"
34 : "=r" (x)
35 : "r" (x));
36
37 return x;
38}
39#define __arch_swab32 __arch_swab32
40
41#ifdef CONFIG_CPU_MIPS64_R2
42static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
43{
44 __asm__(
45 " dsbh %0, %1\n"
46 " dshd %0, %0"
47 : "=r" (x)
48 : "r" (x));
49
50 return x;
51}
52#define __arch_swab64 __arch_swab64
53#endif /* CONFIG_CPU_MIPS64_R2 */
54#endif /* CONFIG_CPU_MIPSR2 */
55#endif /* _ASM_SWAB_H */
diff --git a/arch/mips/include/asm/time.h b/arch/mips/include/asm/time.h
index 9601ea950542..38a30d2ee959 100644
--- a/arch/mips/include/asm/time.h
+++ b/arch/mips/include/asm/time.h
@@ -50,27 +50,35 @@ extern int (*perf_irq)(void);
50/* 50/*
51 * Initialize the calling CPU's compare interrupt as clockevent device 51 * Initialize the calling CPU's compare interrupt as clockevent device
52 */ 52 */
53#ifdef CONFIG_CEVT_R4K 53#ifdef CONFIG_CEVT_R4K_LIB
54extern int mips_clockevent_init(void);
55extern unsigned int __weak get_c0_compare_int(void); 54extern unsigned int __weak get_c0_compare_int(void);
56#else 55extern int r4k_clockevent_init(void);
56#endif
57
57static inline int mips_clockevent_init(void) 58static inline int mips_clockevent_init(void)
58{ 59{
60#ifdef CONFIG_CEVT_R4K
61 return r4k_clockevent_init();
62#else
59 return -ENXIO; 63 return -ENXIO;
60}
61#endif 64#endif
65}
62 66
63/* 67/*
64 * Initialize the count register as a clocksource 68 * Initialize the count register as a clocksource
65 */ 69 */
66#ifdef CONFIG_CSRC_R4K 70#ifdef CONFIG_CSRC_R4K_LIB
67extern int init_mips_clocksource(void); 71extern int init_r4k_clocksource(void);
68#else 72#endif
73
69static inline int init_mips_clocksource(void) 74static inline int init_mips_clocksource(void)
70{ 75{
76#ifdef CONFIG_CSRC_R4K
77 return init_r4k_clocksource();
78#else
71 return 0; 79 return 0;
72}
73#endif 80#endif
81}
74 82
75extern void clocksource_set_clock(struct clocksource *cs, unsigned int clock); 83extern void clocksource_set_clock(struct clocksource *cs, unsigned int clock);
76extern void clockevent_set_clock(struct clock_event_device *cd, 84extern void clockevent_set_clock(struct clock_event_device *cd,
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c
index d7f8a782aae4..03965cb1b252 100644
--- a/arch/mips/jazz/irq.c
+++ b/arch/mips/jazz/irq.c
@@ -146,7 +146,7 @@ void __init plat_time_init(void)
146 146
147 BUG_ON(HZ != 100); 147 BUG_ON(HZ != 100);
148 148
149 cd->cpumask = cpumask_of_cpu(cpu); 149 cd->cpumask = cpumask_of(cpu);
150 clockevents_register_device(cd); 150 clockevents_register_device(cd);
151 action->dev_id = cd; 151 action->dev_id = cd;
152 setup_irq(JAZZ_TIMER_IRQ, action); 152 setup_irq(JAZZ_TIMER_IRQ, action);
diff --git a/arch/mips/kernel/Makefile b/arch/mips/kernel/Makefile
index b1372c27f136..e96122159928 100644
--- a/arch/mips/kernel/Makefile
+++ b/arch/mips/kernel/Makefile
@@ -9,7 +9,7 @@ obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \
9 time.o topology.o traps.o unaligned.o watch.o 9 time.o topology.o traps.o unaligned.o watch.o
10 10
11obj-$(CONFIG_CEVT_BCM1480) += cevt-bcm1480.o 11obj-$(CONFIG_CEVT_BCM1480) += cevt-bcm1480.o
12obj-$(CONFIG_CEVT_R4K) += cevt-r4k.o 12obj-$(CONFIG_CEVT_R4K_LIB) += cevt-r4k.o
13obj-$(CONFIG_MIPS_MT_SMTC) += cevt-smtc.o 13obj-$(CONFIG_MIPS_MT_SMTC) += cevt-smtc.o
14obj-$(CONFIG_CEVT_DS1287) += cevt-ds1287.o 14obj-$(CONFIG_CEVT_DS1287) += cevt-ds1287.o
15obj-$(CONFIG_CEVT_GT641XX) += cevt-gt641xx.o 15obj-$(CONFIG_CEVT_GT641XX) += cevt-gt641xx.o
@@ -17,7 +17,7 @@ obj-$(CONFIG_CEVT_SB1250) += cevt-sb1250.o
17obj-$(CONFIG_CEVT_TXX9) += cevt-txx9.o 17obj-$(CONFIG_CEVT_TXX9) += cevt-txx9.o
18obj-$(CONFIG_CSRC_BCM1480) += csrc-bcm1480.o 18obj-$(CONFIG_CSRC_BCM1480) += csrc-bcm1480.o
19obj-$(CONFIG_CSRC_IOASIC) += csrc-ioasic.o 19obj-$(CONFIG_CSRC_IOASIC) += csrc-ioasic.o
20obj-$(CONFIG_CSRC_R4K) += csrc-r4k.o 20obj-$(CONFIG_CSRC_R4K_LIB) += csrc-r4k.o
21obj-$(CONFIG_CSRC_SB1250) += csrc-sb1250.o 21obj-$(CONFIG_CSRC_SB1250) += csrc-sb1250.o
22obj-$(CONFIG_SYNC_R4K) += sync-r4k.o 22obj-$(CONFIG_SYNC_R4K) += sync-r4k.o
23 23
@@ -43,6 +43,7 @@ obj-$(CONFIG_CPU_SB1) += r4k_fpu.o r4k_switch.o
43obj-$(CONFIG_CPU_TX39XX) += r2300_fpu.o r2300_switch.o 43obj-$(CONFIG_CPU_TX39XX) += r2300_fpu.o r2300_switch.o
44obj-$(CONFIG_CPU_TX49XX) += r4k_fpu.o r4k_switch.o 44obj-$(CONFIG_CPU_TX49XX) += r4k_fpu.o r4k_switch.o
45obj-$(CONFIG_CPU_VR41XX) += r4k_fpu.o r4k_switch.o 45obj-$(CONFIG_CPU_VR41XX) += r4k_fpu.o r4k_switch.o
46obj-$(CONFIG_CPU_CAVIUM_OCTEON) += octeon_switch.o
46 47
47obj-$(CONFIG_SMP) += smp.o 48obj-$(CONFIG_SMP) += smp.o
48obj-$(CONFIG_SMP_UP) += smp-up.o 49obj-$(CONFIG_SMP_UP) += smp-up.o
diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 72942226fcdd..c901c22d7ad0 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -64,6 +64,10 @@ void output_ptreg_defines(void)
64#ifdef CONFIG_MIPS_MT_SMTC 64#ifdef CONFIG_MIPS_MT_SMTC
65 OFFSET(PT_TCSTATUS, pt_regs, cp0_tcstatus); 65 OFFSET(PT_TCSTATUS, pt_regs, cp0_tcstatus);
66#endif /* CONFIG_MIPS_MT_SMTC */ 66#endif /* CONFIG_MIPS_MT_SMTC */
67#ifdef CONFIG_CPU_CAVIUM_OCTEON
68 OFFSET(PT_MPL, pt_regs, mpl);
69 OFFSET(PT_MTP, pt_regs, mtp);
70#endif /* CONFIG_CPU_CAVIUM_OCTEON */
67 DEFINE(PT_SIZE, sizeof(struct pt_regs)); 71 DEFINE(PT_SIZE, sizeof(struct pt_regs));
68 BLANK(); 72 BLANK();
69} 73}
@@ -295,3 +299,30 @@ void output_irq_cpustat_t_defines(void)
295 DEFINE(IC_IRQ_CPUSTAT_T, sizeof(irq_cpustat_t)); 299 DEFINE(IC_IRQ_CPUSTAT_T, sizeof(irq_cpustat_t));
296 BLANK(); 300 BLANK();
297} 301}
302
303#ifdef CONFIG_CPU_CAVIUM_OCTEON
304void output_octeon_cop2_state_defines(void)
305{
306 COMMENT("Octeon specific octeon_cop2_state offsets.");
307 OFFSET(OCTEON_CP2_CRC_IV, octeon_cop2_state, cop2_crc_iv);
308 OFFSET(OCTEON_CP2_CRC_LENGTH, octeon_cop2_state, cop2_crc_length);
309 OFFSET(OCTEON_CP2_CRC_POLY, octeon_cop2_state, cop2_crc_poly);
310 OFFSET(OCTEON_CP2_LLM_DAT, octeon_cop2_state, cop2_llm_dat);
311 OFFSET(OCTEON_CP2_3DES_IV, octeon_cop2_state, cop2_3des_iv);
312 OFFSET(OCTEON_CP2_3DES_KEY, octeon_cop2_state, cop2_3des_key);
313 OFFSET(OCTEON_CP2_3DES_RESULT, octeon_cop2_state, cop2_3des_result);
314 OFFSET(OCTEON_CP2_AES_INP0, octeon_cop2_state, cop2_aes_inp0);
315 OFFSET(OCTEON_CP2_AES_IV, octeon_cop2_state, cop2_aes_iv);
316 OFFSET(OCTEON_CP2_AES_KEY, octeon_cop2_state, cop2_aes_key);
317 OFFSET(OCTEON_CP2_AES_KEYLEN, octeon_cop2_state, cop2_aes_keylen);
318 OFFSET(OCTEON_CP2_AES_RESULT, octeon_cop2_state, cop2_aes_result);
319 OFFSET(OCTEON_CP2_GFM_MULT, octeon_cop2_state, cop2_gfm_mult);
320 OFFSET(OCTEON_CP2_GFM_POLY, octeon_cop2_state, cop2_gfm_poly);
321 OFFSET(OCTEON_CP2_GFM_RESULT, octeon_cop2_state, cop2_gfm_result);
322 OFFSET(OCTEON_CP2_HSH_DATW, octeon_cop2_state, cop2_hsh_datw);
323 OFFSET(OCTEON_CP2_HSH_IVW, octeon_cop2_state, cop2_hsh_ivw);
324 OFFSET(THREAD_CP2, task_struct, thread.cp2);
325 OFFSET(THREAD_CVMSEG, task_struct, thread.cvmseg.cvmseg);
326 BLANK();
327}
328#endif
diff --git a/arch/mips/kernel/branch.c b/arch/mips/kernel/branch.c
index 6b5df8bfab85..0176ed015c89 100644
--- a/arch/mips/kernel/branch.c
+++ b/arch/mips/kernel/branch.c
@@ -205,6 +205,39 @@ int __compute_return_epc(struct pt_regs *regs)
205 break; 205 break;
206 } 206 }
207 break; 207 break;
208#ifdef CONFIG_CPU_CAVIUM_OCTEON
209 case lwc2_op: /* This is bbit0 on Octeon */
210 if ((regs->regs[insn.i_format.rs] & (1ull<<insn.i_format.rt))
211 == 0)
212 epc = epc + 4 + (insn.i_format.simmediate << 2);
213 else
214 epc += 8;
215 regs->cp0_epc = epc;
216 break;
217 case ldc2_op: /* This is bbit032 on Octeon */
218 if ((regs->regs[insn.i_format.rs] &
219 (1ull<<(insn.i_format.rt+32))) == 0)
220 epc = epc + 4 + (insn.i_format.simmediate << 2);
221 else
222 epc += 8;
223 regs->cp0_epc = epc;
224 break;
225 case swc2_op: /* This is bbit1 on Octeon */
226 if (regs->regs[insn.i_format.rs] & (1ull<<insn.i_format.rt))
227 epc = epc + 4 + (insn.i_format.simmediate << 2);
228 else
229 epc += 8;
230 regs->cp0_epc = epc;
231 break;
232 case sdc2_op: /* This is bbit132 on Octeon */
233 if (regs->regs[insn.i_format.rs] &
234 (1ull<<(insn.i_format.rt+32)))
235 epc = epc + 4 + (insn.i_format.simmediate << 2);
236 else
237 epc += 8;
238 regs->cp0_epc = epc;
239 break;
240#endif
208 } 241 }
209 242
210 return 0; 243 return 0;
diff --git a/arch/mips/kernel/cevt-bcm1480.c b/arch/mips/kernel/cevt-bcm1480.c
index 0a57f86945f1..b820661678b0 100644
--- a/arch/mips/kernel/cevt-bcm1480.c
+++ b/arch/mips/kernel/cevt-bcm1480.c
@@ -126,7 +126,7 @@ void __cpuinit sb1480_clockevent_init(void)
126 cd->min_delta_ns = clockevent_delta2ns(2, cd); 126 cd->min_delta_ns = clockevent_delta2ns(2, cd);
127 cd->rating = 200; 127 cd->rating = 200;
128 cd->irq = irq; 128 cd->irq = irq;
129 cd->cpumask = cpumask_of_cpu(cpu); 129 cd->cpumask = cpumask_of(cpu);
130 cd->set_next_event = sibyte_next_event; 130 cd->set_next_event = sibyte_next_event;
131 cd->set_mode = sibyte_set_mode; 131 cd->set_mode = sibyte_set_mode;
132 clockevents_register_device(cd); 132 clockevents_register_device(cd);
@@ -148,6 +148,6 @@ void __cpuinit sb1480_clockevent_init(void)
148 action->name = name; 148 action->name = name;
149 action->dev_id = cd; 149 action->dev_id = cd;
150 150
151 irq_set_affinity(irq, cpumask_of_cpu(cpu)); 151 irq_set_affinity(irq, cpumask_of(cpu));
152 setup_irq(irq, action); 152 setup_irq(irq, action);
153} 153}
diff --git a/arch/mips/kernel/cevt-ds1287.c b/arch/mips/kernel/cevt-ds1287.c
index df4acb68bfb5..1ada45ea0700 100644
--- a/arch/mips/kernel/cevt-ds1287.c
+++ b/arch/mips/kernel/cevt-ds1287.c
@@ -88,7 +88,6 @@ static void ds1287_event_handler(struct clock_event_device *dev)
88static struct clock_event_device ds1287_clockevent = { 88static struct clock_event_device ds1287_clockevent = {
89 .name = "ds1287", 89 .name = "ds1287",
90 .features = CLOCK_EVT_FEAT_PERIODIC, 90 .features = CLOCK_EVT_FEAT_PERIODIC,
91 .cpumask = CPU_MASK_CPU0,
92 .set_next_event = ds1287_set_next_event, 91 .set_next_event = ds1287_set_next_event,
93 .set_mode = ds1287_set_mode, 92 .set_mode = ds1287_set_mode,
94 .event_handler = ds1287_event_handler, 93 .event_handler = ds1287_event_handler,
@@ -122,6 +121,7 @@ int __init ds1287_clockevent_init(int irq)
122 clockevent_set_clock(cd, 32768); 121 clockevent_set_clock(cd, 32768);
123 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); 122 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
124 cd->min_delta_ns = clockevent_delta2ns(0x300, cd); 123 cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
124 cd->cpumask = cpumask_of(0);
125 125
126 clockevents_register_device(&ds1287_clockevent); 126 clockevents_register_device(&ds1287_clockevent);
127 127
diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c
index 6e2f58520afb..e9b787feedcb 100644
--- a/arch/mips/kernel/cevt-gt641xx.c
+++ b/arch/mips/kernel/cevt-gt641xx.c
@@ -96,7 +96,6 @@ static void gt641xx_timer0_event_handler(struct clock_event_device *dev)
96static struct clock_event_device gt641xx_timer0_clockevent = { 96static struct clock_event_device gt641xx_timer0_clockevent = {
97 .name = "gt641xx-timer0", 97 .name = "gt641xx-timer0",
98 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 98 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
99 .cpumask = CPU_MASK_CPU0,
100 .irq = GT641XX_TIMER0_IRQ, 99 .irq = GT641XX_TIMER0_IRQ,
101 .set_next_event = gt641xx_timer0_set_next_event, 100 .set_next_event = gt641xx_timer0_set_next_event,
102 .set_mode = gt641xx_timer0_set_mode, 101 .set_mode = gt641xx_timer0_set_mode,
@@ -132,6 +131,7 @@ static int __init gt641xx_timer0_clockevent_init(void)
132 clockevent_set_clock(cd, gt641xx_base_clock); 131 clockevent_set_clock(cd, gt641xx_base_clock);
133 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); 132 cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd);
134 cd->min_delta_ns = clockevent_delta2ns(0x300, cd); 133 cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
134 cd->cpumask = cpumask_of(0);
135 135
136 clockevents_register_device(&gt641xx_timer0_clockevent); 136 clockevents_register_device(&gt641xx_timer0_clockevent);
137 137
diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index 4a4c59f2737a..0015e442572b 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -160,7 +160,7 @@ int c0_compare_int_usable(void)
160 160
161#ifndef CONFIG_MIPS_MT_SMTC 161#ifndef CONFIG_MIPS_MT_SMTC
162 162
163int __cpuinit mips_clockevent_init(void) 163int __cpuinit r4k_clockevent_init(void)
164{ 164{
165 uint64_t mips_freq = mips_hpt_frequency; 165 uint64_t mips_freq = mips_hpt_frequency;
166 unsigned int cpu = smp_processor_id(); 166 unsigned int cpu = smp_processor_id();
@@ -195,7 +195,7 @@ int __cpuinit mips_clockevent_init(void)
195 195
196 cd->rating = 300; 196 cd->rating = 300;
197 cd->irq = irq; 197 cd->irq = irq;
198 cd->cpumask = cpumask_of_cpu(cpu); 198 cd->cpumask = cpumask_of(cpu);
199 cd->set_next_event = mips_next_event; 199 cd->set_next_event = mips_next_event;
200 cd->set_mode = mips_set_clock_mode; 200 cd->set_mode = mips_set_clock_mode;
201 cd->event_handler = mips_event_handler; 201 cd->event_handler = mips_event_handler;
diff --git a/arch/mips/kernel/cevt-sb1250.c b/arch/mips/kernel/cevt-sb1250.c
index 63ac3ad462bc..a2eebaafda52 100644
--- a/arch/mips/kernel/cevt-sb1250.c
+++ b/arch/mips/kernel/cevt-sb1250.c
@@ -125,7 +125,7 @@ void __cpuinit sb1250_clockevent_init(void)
125 cd->min_delta_ns = clockevent_delta2ns(2, cd); 125 cd->min_delta_ns = clockevent_delta2ns(2, cd);
126 cd->rating = 200; 126 cd->rating = 200;
127 cd->irq = irq; 127 cd->irq = irq;
128 cd->cpumask = cpumask_of_cpu(cpu); 128 cd->cpumask = cpumask_of(cpu);
129 cd->set_next_event = sibyte_next_event; 129 cd->set_next_event = sibyte_next_event;
130 cd->set_mode = sibyte_set_mode; 130 cd->set_mode = sibyte_set_mode;
131 clockevents_register_device(cd); 131 clockevents_register_device(cd);
@@ -147,6 +147,6 @@ void __cpuinit sb1250_clockevent_init(void)
147 action->name = name; 147 action->name = name;
148 action->dev_id = cd; 148 action->dev_id = cd;
149 149
150 irq_set_affinity(irq, cpumask_of_cpu(cpu)); 150 irq_set_affinity(irq, cpumask_of(cpu));
151 setup_irq(irq, action); 151 setup_irq(irq, action);
152} 152}
diff --git a/arch/mips/kernel/cevt-smtc.c b/arch/mips/kernel/cevt-smtc.c
index 5162fe4b5952..6d45e24db5bf 100644
--- a/arch/mips/kernel/cevt-smtc.c
+++ b/arch/mips/kernel/cevt-smtc.c
@@ -292,7 +292,7 @@ int __cpuinit mips_clockevent_init(void)
292 292
293 cd->rating = 300; 293 cd->rating = 300;
294 cd->irq = irq; 294 cd->irq = irq;
295 cd->cpumask = cpumask_of_cpu(cpu); 295 cd->cpumask = cpumask_of(cpu);
296 cd->set_next_event = mips_next_event; 296 cd->set_next_event = mips_next_event;
297 cd->set_mode = mips_set_clock_mode; 297 cd->set_mode = mips_set_clock_mode;
298 cd->event_handler = mips_event_handler; 298 cd->event_handler = mips_event_handler;
diff --git a/arch/mips/kernel/cevt-txx9.c b/arch/mips/kernel/cevt-txx9.c
index b5fc4eb412d2..eccf7d6096bd 100644
--- a/arch/mips/kernel/cevt-txx9.c
+++ b/arch/mips/kernel/cevt-txx9.c
@@ -112,7 +112,6 @@ static struct clock_event_device txx9tmr_clock_event_device = {
112 .name = "TXx9", 112 .name = "TXx9",
113 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 113 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
114 .rating = 200, 114 .rating = 200,
115 .cpumask = CPU_MASK_CPU0,
116 .set_mode = txx9tmr_set_mode, 115 .set_mode = txx9tmr_set_mode,
117 .set_next_event = txx9tmr_set_next_event, 116 .set_next_event = txx9tmr_set_next_event,
118}; 117};
@@ -150,6 +149,7 @@ void __init txx9_clockevent_init(unsigned long baseaddr, int irq,
150 clockevent_delta2ns(0xffffffff >> (32 - TXX9_TIMER_BITS), cd); 149 clockevent_delta2ns(0xffffffff >> (32 - TXX9_TIMER_BITS), cd);
151 cd->min_delta_ns = clockevent_delta2ns(0xf, cd); 150 cd->min_delta_ns = clockevent_delta2ns(0xf, cd);
152 cd->irq = irq; 151 cd->irq = irq;
152 cd->cpumask = cpumask_of(0),
153 clockevents_register_device(cd); 153 clockevents_register_device(cd);
154 setup_irq(irq, &txx9tmr_irq); 154 setup_irq(irq, &txx9tmr_irq);
155 printk(KERN_INFO "TXx9: clockevent device at 0x%lx, irq %d\n", 155 printk(KERN_INFO "TXx9: clockevent device at 0x%lx, irq %d\n",
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index c9207b5fd923..a7162a4484cf 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -96,6 +96,9 @@ int allow_au1k_wait;
96 96
97static void au1k_wait(void) 97static void au1k_wait(void)
98{ 98{
99 if (!allow_au1k_wait)
100 return;
101
99 /* using the wait instruction makes CP0 counter unusable */ 102 /* using the wait instruction makes CP0 counter unusable */
100 __asm__(" .set mips3 \n" 103 __asm__(" .set mips3 \n"
101 " cache 0x14, 0(%0) \n" 104 " cache 0x14, 0(%0) \n"
@@ -154,6 +157,7 @@ void __init check_wait(void)
154 case CPU_25KF: 157 case CPU_25KF:
155 case CPU_PR4450: 158 case CPU_PR4450:
156 case CPU_BCM3302: 159 case CPU_BCM3302:
160 case CPU_CAVIUM_OCTEON:
157 cpu_wait = r4k_wait; 161 cpu_wait = r4k_wait;
158 break; 162 break;
159 163
@@ -185,8 +189,7 @@ void __init check_wait(void)
185 case CPU_AU1200: 189 case CPU_AU1200:
186 case CPU_AU1210: 190 case CPU_AU1210:
187 case CPU_AU1250: 191 case CPU_AU1250:
188 if (allow_au1k_wait) 192 cpu_wait = au1k_wait;
189 cpu_wait = au1k_wait;
190 break; 193 break;
191 case CPU_20KC: 194 case CPU_20KC:
192 /* 195 /*
@@ -875,6 +878,27 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu)
875 } 878 }
876} 879}
877 880
881static inline void cpu_probe_cavium(struct cpuinfo_mips *c, unsigned int cpu)
882{
883 decode_configs(c);
884 switch (c->processor_id & 0xff00) {
885 case PRID_IMP_CAVIUM_CN38XX:
886 case PRID_IMP_CAVIUM_CN31XX:
887 case PRID_IMP_CAVIUM_CN30XX:
888 case PRID_IMP_CAVIUM_CN58XX:
889 case PRID_IMP_CAVIUM_CN56XX:
890 case PRID_IMP_CAVIUM_CN50XX:
891 case PRID_IMP_CAVIUM_CN52XX:
892 c->cputype = CPU_CAVIUM_OCTEON;
893 __cpu_name[cpu] = "Cavium Octeon";
894 break;
895 default:
896 printk(KERN_INFO "Unknown Octeon chip!\n");
897 c->cputype = CPU_UNKNOWN;
898 break;
899 }
900}
901
878const char *__cpu_name[NR_CPUS]; 902const char *__cpu_name[NR_CPUS];
879 903
880__cpuinit void cpu_probe(void) 904__cpuinit void cpu_probe(void)
@@ -909,6 +933,9 @@ __cpuinit void cpu_probe(void)
909 case PRID_COMP_NXP: 933 case PRID_COMP_NXP:
910 cpu_probe_nxp(c, cpu); 934 cpu_probe_nxp(c, cpu);
911 break; 935 break;
936 case PRID_COMP_CAVIUM:
937 cpu_probe_cavium(c, cpu);
938 break;
912 } 939 }
913 940
914 BUG_ON(!__cpu_name[cpu]); 941 BUG_ON(!__cpu_name[cpu]);
diff --git a/arch/mips/kernel/csrc-r4k.c b/arch/mips/kernel/csrc-r4k.c
index 74fb74583b4e..f1a2893931ed 100644
--- a/arch/mips/kernel/csrc-r4k.c
+++ b/arch/mips/kernel/csrc-r4k.c
@@ -22,7 +22,7 @@ static struct clocksource clocksource_mips = {
22 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 22 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
23}; 23};
24 24
25int __init init_mips_clocksource(void) 25int __init init_r4k_clocksource(void)
26{ 26{
27 if (!cpu_has_counter || !mips_hpt_frequency) 27 if (!cpu_has_counter || !mips_hpt_frequency)
28 return -ENXIO; 28 return -ENXIO;
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
index 757d48f0d80f..fb6f73148df2 100644
--- a/arch/mips/kernel/genex.S
+++ b/arch/mips/kernel/genex.S
@@ -385,10 +385,14 @@ NESTED(nmi_handler, PT_SIZE, sp)
385 .endm 385 .endm
386 386
387 .macro __build_clear_fpe 387 .macro __build_clear_fpe
388 .set push
389 /* gas fails to assemble cfc1 for some archs (octeon).*/ \
390 .set mips1
388 cfc1 a1, fcr31 391 cfc1 a1, fcr31
389 li a2, ~(0x3f << 12) 392 li a2, ~(0x3f << 12)
390 and a2, a1 393 and a2, a1
391 ctc1 a2, fcr31 394 ctc1 a2, fcr31
395 .set pop
392 TRACE_IRQS_ON 396 TRACE_IRQS_ON
393 STI 397 STI
394 .endm 398 .endm
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c
index b6ac55162b9a..f4d187825f96 100644
--- a/arch/mips/kernel/i8253.c
+++ b/arch/mips/kernel/i8253.c
@@ -115,7 +115,7 @@ void __init setup_pit_timer(void)
115 * Start pit with the boot cpu mask and make it global after the 115 * Start pit with the boot cpu mask and make it global after the
116 * IO_APIC has been initialized. 116 * IO_APIC has been initialized.
117 */ 117 */
118 cd->cpumask = cpumask_of_cpu(cpu); 118 cd->cpumask = cpumask_of(cpu);
119 clockevent_set_clock(cd, CLOCK_TICK_RATE); 119 clockevent_set_clock(cd, CLOCK_TICK_RATE);
120 cd->max_delta_ns = clockevent_delta2ns(0x7FFF, cd); 120 cd->max_delta_ns = clockevent_delta2ns(0x7FFF, cd);
121 cd->min_delta_ns = clockevent_delta2ns(0xF, cd); 121 cd->min_delta_ns = clockevent_delta2ns(0xF, cd);
diff --git a/arch/mips/kernel/irq-gic.c b/arch/mips/kernel/irq-gic.c
index f0a4bb19e096..494a49a317e9 100644
--- a/arch/mips/kernel/irq-gic.c
+++ b/arch/mips/kernel/irq-gic.c
@@ -155,7 +155,7 @@ static void gic_unmask_irq(unsigned int irq)
155 155
156static DEFINE_SPINLOCK(gic_lock); 156static DEFINE_SPINLOCK(gic_lock);
157 157
158static void gic_set_affinity(unsigned int irq, cpumask_t cpumask) 158static void gic_set_affinity(unsigned int irq, const struct cpumask *cpumask)
159{ 159{
160 cpumask_t tmp = CPU_MASK_NONE; 160 cpumask_t tmp = CPU_MASK_NONE;
161 unsigned long flags; 161 unsigned long flags;
@@ -164,7 +164,7 @@ static void gic_set_affinity(unsigned int irq, cpumask_t cpumask)
164 pr_debug(KERN_DEBUG "%s called\n", __func__); 164 pr_debug(KERN_DEBUG "%s called\n", __func__);
165 irq -= _irqbase; 165 irq -= _irqbase;
166 166
167 cpus_and(tmp, cpumask, cpu_online_map); 167 cpumask_and(&tmp, cpumask, cpu_online_mask);
168 if (cpus_empty(tmp)) 168 if (cpus_empty(tmp))
169 return; 169 return;
170 170
@@ -187,7 +187,7 @@ static void gic_set_affinity(unsigned int irq, cpumask_t cpumask)
187 set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask); 187 set_bit(irq, pcpu_masks[first_cpu(tmp)].pcpu_mask);
188 188
189 } 189 }
190 irq_desc[irq].affinity = cpumask; 190 irq_desc[irq].affinity = *cpumask;
191 spin_unlock_irqrestore(&gic_lock, flags); 191 spin_unlock_irqrestore(&gic_lock, flags);
192 192
193} 193}
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c
index 4b4007b3083a..a0ff2b66e22b 100644
--- a/arch/mips/kernel/irq.c
+++ b/arch/mips/kernel/irq.c
@@ -111,6 +111,7 @@ int show_interrupts(struct seq_file *p, void *v)
111 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 111 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
112#endif 112#endif
113 seq_printf(p, " %14s", irq_desc[i].chip->name); 113 seq_printf(p, " %14s", irq_desc[i].chip->name);
114 seq_printf(p, "-%-8s", irq_desc[i].name);
114 seq_printf(p, " %s", action->name); 115 seq_printf(p, " %s", action->name);
115 116
116 for (action=action->next; action; action = action->next) 117 for (action=action->next; action; action = action->next)
diff --git a/arch/mips/kernel/octeon_switch.S b/arch/mips/kernel/octeon_switch.S
new file mode 100644
index 000000000000..d52389672b06
--- /dev/null
+++ b/arch/mips/kernel/octeon_switch.S
@@ -0,0 +1,506 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 1994, 1995, 1996, 1998, 1999, 2002, 2003 Ralf Baechle
7 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
8 * Copyright (C) 1994, 1995, 1996, by Andreas Busse
9 * Copyright (C) 1999 Silicon Graphics, Inc.
10 * Copyright (C) 2000 MIPS Technologies, Inc.
11 * written by Carsten Langgaard, carstenl@mips.com
12 */
13#include <asm/asm.h>
14#include <asm/cachectl.h>
15#include <asm/fpregdef.h>
16#include <asm/mipsregs.h>
17#include <asm/asm-offsets.h>
18#include <asm/page.h>
19#include <asm/pgtable-bits.h>
20#include <asm/regdef.h>
21#include <asm/stackframe.h>
22#include <asm/thread_info.h>
23
24#include <asm/asmmacro.h>
25
26/*
27 * Offset to the current process status flags, the first 32 bytes of the
28 * stack are not used.
29 */
30#define ST_OFF (_THREAD_SIZE - 32 - PT_SIZE + PT_STATUS)
31
32/*
33 * task_struct *resume(task_struct *prev, task_struct *next,
34 * struct thread_info *next_ti)
35 */
36 .align 7
37 LEAF(resume)
38 .set arch=octeon
39#ifndef CONFIG_CPU_HAS_LLSC
40 sw zero, ll_bit
41#endif
42 mfc0 t1, CP0_STATUS
43 LONG_S t1, THREAD_STATUS(a0)
44 cpu_save_nonscratch a0
45 LONG_S ra, THREAD_REG31(a0)
46
47 /* check if we need to save COP2 registers */
48 PTR_L t2, TASK_THREAD_INFO(a0)
49 LONG_L t0, ST_OFF(t2)
50 bbit0 t0, 30, 1f
51
52 /* Disable COP2 in the stored process state */
53 li t1, ST0_CU2
54 xor t0, t1
55 LONG_S t0, ST_OFF(t2)
56
57 /* Enable COP2 so we can save it */
58 mfc0 t0, CP0_STATUS
59 or t0, t1
60 mtc0 t0, CP0_STATUS
61
62 /* Save COP2 */
63 daddu a0, THREAD_CP2
64 jal octeon_cop2_save
65 dsubu a0, THREAD_CP2
66
67 /* Disable COP2 now that we are done */
68 mfc0 t0, CP0_STATUS
69 li t1, ST0_CU2
70 xor t0, t1
71 mtc0 t0, CP0_STATUS
72
731:
74#if CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0
75 /* Check if we need to store CVMSEG state */
76 mfc0 t0, $11,7 /* CvmMemCtl */
77 bbit0 t0, 6, 3f /* Is user access enabled? */
78
79 /* Store the CVMSEG state */
80 /* Extract the size of CVMSEG */
81 andi t0, 0x3f
82 /* Multiply * (cache line size/sizeof(long)/2) */
83 sll t0, 7-LONGLOG-1
84 li t1, -32768 /* Base address of CVMSEG */
85 LONG_ADDI t2, a0, THREAD_CVMSEG /* Where to store CVMSEG to */
86 synciobdma
872:
88 .set noreorder
89 LONG_L t8, 0(t1) /* Load from CVMSEG */
90 subu t0, 1 /* Decrement loop var */
91 LONG_L t9, LONGSIZE(t1)/* Load from CVMSEG */
92 LONG_ADDU t1, LONGSIZE*2 /* Increment loc in CVMSEG */
93 LONG_S t8, 0(t2) /* Store CVMSEG to thread storage */
94 LONG_ADDU t2, LONGSIZE*2 /* Increment loc in thread storage */
95 bnez t0, 2b /* Loop until we've copied it all */
96 LONG_S t9, -LONGSIZE(t2)/* Store CVMSEG to thread storage */
97 .set reorder
98
99 /* Disable access to CVMSEG */
100 mfc0 t0, $11,7 /* CvmMemCtl */
101 xori t0, t0, 0x40 /* Bit 6 is CVMSEG user enable */
102 mtc0 t0, $11,7 /* CvmMemCtl */
103#endif
1043:
105 /*
106 * The order of restoring the registers takes care of the race
107 * updating $28, $29 and kernelsp without disabling ints.
108 */
109 move $28, a2
110 cpu_restore_nonscratch a1
111
112#if (_THREAD_SIZE - 32) < 0x8000
113 PTR_ADDIU t0, $28, _THREAD_SIZE - 32
114#else
115 PTR_LI t0, _THREAD_SIZE - 32
116 PTR_ADDU t0, $28
117#endif
118 set_saved_sp t0, t1, t2
119
120 mfc0 t1, CP0_STATUS /* Do we really need this? */
121 li a3, 0xff01
122 and t1, a3
123 LONG_L a2, THREAD_STATUS(a1)
124 nor a3, $0, a3
125 and a2, a3
126 or a2, t1
127 mtc0 a2, CP0_STATUS
128 move v0, a0
129 jr ra
130 END(resume)
131
132/*
133 * void octeon_cop2_save(struct octeon_cop2_state *a0)
134 */
135 .align 7
136 LEAF(octeon_cop2_save)
137
138 dmfc0 t9, $9,7 /* CvmCtl register. */
139
140 /* Save the COP2 CRC state */
141 dmfc2 t0, 0x0201
142 dmfc2 t1, 0x0202
143 dmfc2 t2, 0x0200
144 sd t0, OCTEON_CP2_CRC_IV(a0)
145 sd t1, OCTEON_CP2_CRC_LENGTH(a0)
146 sd t2, OCTEON_CP2_CRC_POLY(a0)
147 /* Skip next instructions if CvmCtl[NODFA_CP2] set */
148 bbit1 t9, 28, 1f
149
150 /* Save the LLM state */
151 dmfc2 t0, 0x0402
152 dmfc2 t1, 0x040A
153 sd t0, OCTEON_CP2_LLM_DAT(a0)
154 sd t1, OCTEON_CP2_LLM_DAT+8(a0)
155
1561: bbit1 t9, 26, 3f /* done if CvmCtl[NOCRYPTO] set */
157
158 /* Save the COP2 crypto state */
159 /* this part is mostly common to both pass 1 and later revisions */
160 dmfc2 t0, 0x0084
161 dmfc2 t1, 0x0080
162 dmfc2 t2, 0x0081
163 dmfc2 t3, 0x0082
164 sd t0, OCTEON_CP2_3DES_IV(a0)
165 dmfc2 t0, 0x0088
166 sd t1, OCTEON_CP2_3DES_KEY(a0)
167 dmfc2 t1, 0x0111 /* only necessary for pass 1 */
168 sd t2, OCTEON_CP2_3DES_KEY+8(a0)
169 dmfc2 t2, 0x0102
170 sd t3, OCTEON_CP2_3DES_KEY+16(a0)
171 dmfc2 t3, 0x0103
172 sd t0, OCTEON_CP2_3DES_RESULT(a0)
173 dmfc2 t0, 0x0104
174 sd t1, OCTEON_CP2_AES_INP0(a0) /* only necessary for pass 1 */
175 dmfc2 t1, 0x0105
176 sd t2, OCTEON_CP2_AES_IV(a0)
177 dmfc2 t2, 0x0106
178 sd t3, OCTEON_CP2_AES_IV+8(a0)
179 dmfc2 t3, 0x0107
180 sd t0, OCTEON_CP2_AES_KEY(a0)
181 dmfc2 t0, 0x0110
182 sd t1, OCTEON_CP2_AES_KEY+8(a0)
183 dmfc2 t1, 0x0100
184 sd t2, OCTEON_CP2_AES_KEY+16(a0)
185 dmfc2 t2, 0x0101
186 sd t3, OCTEON_CP2_AES_KEY+24(a0)
187 mfc0 t3, $15,0 /* Get the processor ID register */
188 sd t0, OCTEON_CP2_AES_KEYLEN(a0)
189 li t0, 0x000d0000 /* This is the processor ID of Octeon Pass1 */
190 sd t1, OCTEON_CP2_AES_RESULT(a0)
191 sd t2, OCTEON_CP2_AES_RESULT+8(a0)
192 /* Skip to the Pass1 version of the remainder of the COP2 state */
193 beq t3, t0, 2f
194
195 /* the non-pass1 state when !CvmCtl[NOCRYPTO] */
196 dmfc2 t1, 0x0240
197 dmfc2 t2, 0x0241
198 dmfc2 t3, 0x0242
199 dmfc2 t0, 0x0243
200 sd t1, OCTEON_CP2_HSH_DATW(a0)
201 dmfc2 t1, 0x0244
202 sd t2, OCTEON_CP2_HSH_DATW+8(a0)
203 dmfc2 t2, 0x0245
204 sd t3, OCTEON_CP2_HSH_DATW+16(a0)
205 dmfc2 t3, 0x0246
206 sd t0, OCTEON_CP2_HSH_DATW+24(a0)
207 dmfc2 t0, 0x0247
208 sd t1, OCTEON_CP2_HSH_DATW+32(a0)
209 dmfc2 t1, 0x0248
210 sd t2, OCTEON_CP2_HSH_DATW+40(a0)
211 dmfc2 t2, 0x0249
212 sd t3, OCTEON_CP2_HSH_DATW+48(a0)
213 dmfc2 t3, 0x024A
214 sd t0, OCTEON_CP2_HSH_DATW+56(a0)
215 dmfc2 t0, 0x024B
216 sd t1, OCTEON_CP2_HSH_DATW+64(a0)
217 dmfc2 t1, 0x024C
218 sd t2, OCTEON_CP2_HSH_DATW+72(a0)
219 dmfc2 t2, 0x024D
220 sd t3, OCTEON_CP2_HSH_DATW+80(a0)
221 dmfc2 t3, 0x024E
222 sd t0, OCTEON_CP2_HSH_DATW+88(a0)
223 dmfc2 t0, 0x0250
224 sd t1, OCTEON_CP2_HSH_DATW+96(a0)
225 dmfc2 t1, 0x0251
226 sd t2, OCTEON_CP2_HSH_DATW+104(a0)
227 dmfc2 t2, 0x0252
228 sd t3, OCTEON_CP2_HSH_DATW+112(a0)
229 dmfc2 t3, 0x0253
230 sd t0, OCTEON_CP2_HSH_IVW(a0)
231 dmfc2 t0, 0x0254
232 sd t1, OCTEON_CP2_HSH_IVW+8(a0)
233 dmfc2 t1, 0x0255
234 sd t2, OCTEON_CP2_HSH_IVW+16(a0)
235 dmfc2 t2, 0x0256
236 sd t3, OCTEON_CP2_HSH_IVW+24(a0)
237 dmfc2 t3, 0x0257
238 sd t0, OCTEON_CP2_HSH_IVW+32(a0)
239 dmfc2 t0, 0x0258
240 sd t1, OCTEON_CP2_HSH_IVW+40(a0)
241 dmfc2 t1, 0x0259
242 sd t2, OCTEON_CP2_HSH_IVW+48(a0)
243 dmfc2 t2, 0x025E
244 sd t3, OCTEON_CP2_HSH_IVW+56(a0)
245 dmfc2 t3, 0x025A
246 sd t0, OCTEON_CP2_GFM_MULT(a0)
247 dmfc2 t0, 0x025B
248 sd t1, OCTEON_CP2_GFM_MULT+8(a0)
249 sd t2, OCTEON_CP2_GFM_POLY(a0)
250 sd t3, OCTEON_CP2_GFM_RESULT(a0)
251 sd t0, OCTEON_CP2_GFM_RESULT+8(a0)
252 jr ra
253
2542: /* pass 1 special stuff when !CvmCtl[NOCRYPTO] */
255 dmfc2 t3, 0x0040
256 dmfc2 t0, 0x0041
257 dmfc2 t1, 0x0042
258 dmfc2 t2, 0x0043
259 sd t3, OCTEON_CP2_HSH_DATW(a0)
260 dmfc2 t3, 0x0044
261 sd t0, OCTEON_CP2_HSH_DATW+8(a0)
262 dmfc2 t0, 0x0045
263 sd t1, OCTEON_CP2_HSH_DATW+16(a0)
264 dmfc2 t1, 0x0046
265 sd t2, OCTEON_CP2_HSH_DATW+24(a0)
266 dmfc2 t2, 0x0048
267 sd t3, OCTEON_CP2_HSH_DATW+32(a0)
268 dmfc2 t3, 0x0049
269 sd t0, OCTEON_CP2_HSH_DATW+40(a0)
270 dmfc2 t0, 0x004A
271 sd t1, OCTEON_CP2_HSH_DATW+48(a0)
272 sd t2, OCTEON_CP2_HSH_IVW(a0)
273 sd t3, OCTEON_CP2_HSH_IVW+8(a0)
274 sd t0, OCTEON_CP2_HSH_IVW+16(a0)
275
2763: /* pass 1 or CvmCtl[NOCRYPTO] set */
277 jr ra
278 END(octeon_cop2_save)
279
280/*
281 * void octeon_cop2_restore(struct octeon_cop2_state *a0)
282 */
283 .align 7
284 .set push
285 .set noreorder
286 LEAF(octeon_cop2_restore)
287 /* First cache line was prefetched before the call */
288 pref 4, 128(a0)
289 dmfc0 t9, $9,7 /* CvmCtl register. */
290
291 pref 4, 256(a0)
292 ld t0, OCTEON_CP2_CRC_IV(a0)
293 pref 4, 384(a0)
294 ld t1, OCTEON_CP2_CRC_LENGTH(a0)
295 ld t2, OCTEON_CP2_CRC_POLY(a0)
296
297 /* Restore the COP2 CRC state */
298 dmtc2 t0, 0x0201
299 dmtc2 t1, 0x1202
300 bbit1 t9, 28, 2f /* Skip LLM if CvmCtl[NODFA_CP2] is set */
301 dmtc2 t2, 0x4200
302
303 /* Restore the LLM state */
304 ld t0, OCTEON_CP2_LLM_DAT(a0)
305 ld t1, OCTEON_CP2_LLM_DAT+8(a0)
306 dmtc2 t0, 0x0402
307 dmtc2 t1, 0x040A
308
3092:
310 bbit1 t9, 26, done_restore /* done if CvmCtl[NOCRYPTO] set */
311 nop
312
313 /* Restore the COP2 crypto state common to pass 1 and pass 2 */
314 ld t0, OCTEON_CP2_3DES_IV(a0)
315 ld t1, OCTEON_CP2_3DES_KEY(a0)
316 ld t2, OCTEON_CP2_3DES_KEY+8(a0)
317 dmtc2 t0, 0x0084
318 ld t0, OCTEON_CP2_3DES_KEY+16(a0)
319 dmtc2 t1, 0x0080
320 ld t1, OCTEON_CP2_3DES_RESULT(a0)
321 dmtc2 t2, 0x0081
322 ld t2, OCTEON_CP2_AES_INP0(a0) /* only really needed for pass 1 */
323 dmtc2 t0, 0x0082
324 ld t0, OCTEON_CP2_AES_IV(a0)
325 dmtc2 t1, 0x0098
326 ld t1, OCTEON_CP2_AES_IV+8(a0)
327 dmtc2 t2, 0x010A /* only really needed for pass 1 */
328 ld t2, OCTEON_CP2_AES_KEY(a0)
329 dmtc2 t0, 0x0102
330 ld t0, OCTEON_CP2_AES_KEY+8(a0)
331 dmtc2 t1, 0x0103
332 ld t1, OCTEON_CP2_AES_KEY+16(a0)
333 dmtc2 t2, 0x0104
334 ld t2, OCTEON_CP2_AES_KEY+24(a0)
335 dmtc2 t0, 0x0105
336 ld t0, OCTEON_CP2_AES_KEYLEN(a0)
337 dmtc2 t1, 0x0106
338 ld t1, OCTEON_CP2_AES_RESULT(a0)
339 dmtc2 t2, 0x0107
340 ld t2, OCTEON_CP2_AES_RESULT+8(a0)
341 mfc0 t3, $15,0 /* Get the processor ID register */
342 dmtc2 t0, 0x0110
343 li t0, 0x000d0000 /* This is the processor ID of Octeon Pass1 */
344 dmtc2 t1, 0x0100
345 bne t0, t3, 3f /* Skip the next stuff for non-pass1 */
346 dmtc2 t2, 0x0101
347
348 /* this code is specific for pass 1 */
349 ld t0, OCTEON_CP2_HSH_DATW(a0)
350 ld t1, OCTEON_CP2_HSH_DATW+8(a0)
351 ld t2, OCTEON_CP2_HSH_DATW+16(a0)
352 dmtc2 t0, 0x0040
353 ld t0, OCTEON_CP2_HSH_DATW+24(a0)
354 dmtc2 t1, 0x0041
355 ld t1, OCTEON_CP2_HSH_DATW+32(a0)
356 dmtc2 t2, 0x0042
357 ld t2, OCTEON_CP2_HSH_DATW+40(a0)
358 dmtc2 t0, 0x0043
359 ld t0, OCTEON_CP2_HSH_DATW+48(a0)
360 dmtc2 t1, 0x0044
361 ld t1, OCTEON_CP2_HSH_IVW(a0)
362 dmtc2 t2, 0x0045
363 ld t2, OCTEON_CP2_HSH_IVW+8(a0)
364 dmtc2 t0, 0x0046
365 ld t0, OCTEON_CP2_HSH_IVW+16(a0)
366 dmtc2 t1, 0x0048
367 dmtc2 t2, 0x0049
368 b done_restore /* unconditional branch */
369 dmtc2 t0, 0x004A
370
3713: /* this is post-pass1 code */
372 ld t2, OCTEON_CP2_HSH_DATW(a0)
373 ld t0, OCTEON_CP2_HSH_DATW+8(a0)
374 ld t1, OCTEON_CP2_HSH_DATW+16(a0)
375 dmtc2 t2, 0x0240
376 ld t2, OCTEON_CP2_HSH_DATW+24(a0)
377 dmtc2 t0, 0x0241
378 ld t0, OCTEON_CP2_HSH_DATW+32(a0)
379 dmtc2 t1, 0x0242
380 ld t1, OCTEON_CP2_HSH_DATW+40(a0)
381 dmtc2 t2, 0x0243
382 ld t2, OCTEON_CP2_HSH_DATW+48(a0)
383 dmtc2 t0, 0x0244
384 ld t0, OCTEON_CP2_HSH_DATW+56(a0)
385 dmtc2 t1, 0x0245
386 ld t1, OCTEON_CP2_HSH_DATW+64(a0)
387 dmtc2 t2, 0x0246
388 ld t2, OCTEON_CP2_HSH_DATW+72(a0)
389 dmtc2 t0, 0x0247
390 ld t0, OCTEON_CP2_HSH_DATW+80(a0)
391 dmtc2 t1, 0x0248
392 ld t1, OCTEON_CP2_HSH_DATW+88(a0)
393 dmtc2 t2, 0x0249
394 ld t2, OCTEON_CP2_HSH_DATW+96(a0)
395 dmtc2 t0, 0x024A
396 ld t0, OCTEON_CP2_HSH_DATW+104(a0)
397 dmtc2 t1, 0x024B
398 ld t1, OCTEON_CP2_HSH_DATW+112(a0)
399 dmtc2 t2, 0x024C
400 ld t2, OCTEON_CP2_HSH_IVW(a0)
401 dmtc2 t0, 0x024D
402 ld t0, OCTEON_CP2_HSH_IVW+8(a0)
403 dmtc2 t1, 0x024E
404 ld t1, OCTEON_CP2_HSH_IVW+16(a0)
405 dmtc2 t2, 0x0250
406 ld t2, OCTEON_CP2_HSH_IVW+24(a0)
407 dmtc2 t0, 0x0251
408 ld t0, OCTEON_CP2_HSH_IVW+32(a0)
409 dmtc2 t1, 0x0252
410 ld t1, OCTEON_CP2_HSH_IVW+40(a0)
411 dmtc2 t2, 0x0253
412 ld t2, OCTEON_CP2_HSH_IVW+48(a0)
413 dmtc2 t0, 0x0254
414 ld t0, OCTEON_CP2_HSH_IVW+56(a0)
415 dmtc2 t1, 0x0255
416 ld t1, OCTEON_CP2_GFM_MULT(a0)
417 dmtc2 t2, 0x0256
418 ld t2, OCTEON_CP2_GFM_MULT+8(a0)
419 dmtc2 t0, 0x0257
420 ld t0, OCTEON_CP2_GFM_POLY(a0)
421 dmtc2 t1, 0x0258
422 ld t1, OCTEON_CP2_GFM_RESULT(a0)
423 dmtc2 t2, 0x0259
424 ld t2, OCTEON_CP2_GFM_RESULT+8(a0)
425 dmtc2 t0, 0x025E
426 dmtc2 t1, 0x025A
427 dmtc2 t2, 0x025B
428
429done_restore:
430 jr ra
431 nop
432 END(octeon_cop2_restore)
433 .set pop
434
435/*
436 * void octeon_mult_save()
437 * sp is assumed to point to a struct pt_regs
438 *
439 * NOTE: This is called in SAVE_SOME in stackframe.h. It can only
440 * safely modify k0 and k1.
441 */
442 .align 7
443 .set push
444 .set noreorder
445 LEAF(octeon_mult_save)
446 dmfc0 k0, $9,7 /* CvmCtl register. */
447 bbit1 k0, 27, 1f /* Skip CvmCtl[NOMUL] */
448 nop
449
450 /* Save the multiplier state */
451 v3mulu k0, $0, $0
452 v3mulu k1, $0, $0
453 sd k0, PT_MTP(sp) /* PT_MTP has P0 */
454 v3mulu k0, $0, $0
455 sd k1, PT_MTP+8(sp) /* PT_MTP+8 has P1 */
456 ori k1, $0, 1
457 v3mulu k1, k1, $0
458 sd k0, PT_MTP+16(sp) /* PT_MTP+16 has P2 */
459 v3mulu k0, $0, $0
460 sd k1, PT_MPL(sp) /* PT_MPL has MPL0 */
461 v3mulu k1, $0, $0
462 sd k0, PT_MPL+8(sp) /* PT_MPL+8 has MPL1 */
463 jr ra
464 sd k1, PT_MPL+16(sp) /* PT_MPL+16 has MPL2 */
465
4661: /* Resume here if CvmCtl[NOMUL] */
467 jr ra
468 END(octeon_mult_save)
469 .set pop
470
471/*
472 * void octeon_mult_restore()
473 * sp is assumed to point to a struct pt_regs
474 *
475 * NOTE: This is called in RESTORE_SOME in stackframe.h.
476 */
477 .align 7
478 .set push
479 .set noreorder
480 LEAF(octeon_mult_restore)
481 dmfc0 k1, $9,7 /* CvmCtl register. */
482 ld v0, PT_MPL(sp) /* MPL0 */
483 ld v1, PT_MPL+8(sp) /* MPL1 */
484 ld k0, PT_MPL+16(sp) /* MPL2 */
485 bbit1 k1, 27, 1f /* Skip CvmCtl[NOMUL] */
486 /* Normally falls through, so no time wasted here */
487 nop
488
489 /* Restore the multiplier state */
490 ld k1, PT_MTP+16(sp) /* P2 */
491 MTM0 v0 /* MPL0 */
492 ld v0, PT_MTP+8(sp) /* P1 */
493 MTM1 v1 /* MPL1 */
494 ld v1, PT_MTP(sp) /* P0 */
495 MTM2 k0 /* MPL2 */
496 MTP2 k1 /* P2 */
497 MTP1 v0 /* P1 */
498 jr ra
499 MTP0 v1 /* P0 */
500
5011: /* Resume here if CvmCtl[NOMUL] */
502 jr ra
503 nop
504 END(octeon_mult_restore)
505 .set pop
506
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c
index 1ca34104e593..c4f9ac17474a 100644
--- a/arch/mips/kernel/ptrace32.c
+++ b/arch/mips/kernel/ptrace32.c
@@ -49,19 +49,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
49 int ret; 49 int ret;
50 50
51 switch (request) { 51 switch (request) {
52 /* when I and D space are separate, these will need to be fixed. */
53 case PTRACE_PEEKTEXT: /* read word at location addr. */
54 case PTRACE_PEEKDATA: {
55 unsigned int tmp;
56 int copied;
57
58 copied = access_process_vm(child, addr, &tmp, sizeof(tmp), 0);
59 ret = -EIO;
60 if (copied != sizeof(tmp))
61 break;
62 ret = put_user(tmp, (unsigned int __user *) (unsigned long) data);
63 break;
64 }
65 52
66 /* 53 /*
67 * Read 4 bytes of the other process' storage 54 * Read 4 bytes of the other process' storage
@@ -208,16 +195,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
208 break; 195 break;
209 } 196 }
210 197
211 /* when I and D space are separate, this will have to be fixed. */
212 case PTRACE_POKETEXT: /* write the word at location addr. */
213 case PTRACE_POKEDATA:
214 ret = 0;
215 if (access_process_vm(child, addr, &data, sizeof(data), 1)
216 == sizeof(data))
217 break;
218 ret = -EIO;
219 break;
220
221 /* 198 /*
222 * Write 4 bytes into the other process' storage 199 * Write 4 bytes into the other process' storage
223 * data is the 4 bytes that the user wants written 200 * data is the 4 bytes that the user wants written
@@ -332,50 +309,11 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
332 ret = ptrace_setfpregs(child, (__u32 __user *) (__u64) data); 309 ret = ptrace_setfpregs(child, (__u32 __user *) (__u64) data);
333 break; 310 break;
334 311
335 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
336 case PTRACE_CONT: { /* restart after signal. */
337 ret = -EIO;
338 if (!valid_signal(data))
339 break;
340 if (request == PTRACE_SYSCALL) {
341 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
342 }
343 else {
344 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
345 }
346 child->exit_code = data;
347 wake_up_process(child);
348 ret = 0;
349 break;
350 }
351
352 /*
353 * make the child exit. Best I can do is send it a sigkill.
354 * perhaps it should be put in the status that it wants to
355 * exit.
356 */
357 case PTRACE_KILL:
358 ret = 0;
359 if (child->exit_state == EXIT_ZOMBIE) /* already dead */
360 break;
361 child->exit_code = SIGKILL;
362 wake_up_process(child);
363 break;
364
365 case PTRACE_GET_THREAD_AREA: 312 case PTRACE_GET_THREAD_AREA:
366 ret = put_user(task_thread_info(child)->tp_value, 313 ret = put_user(task_thread_info(child)->tp_value,
367 (unsigned int __user *) (unsigned long) data); 314 (unsigned int __user *) (unsigned long) data);
368 break; 315 break;
369 316
370 case PTRACE_DETACH: /* detach a process that was attached. */
371 ret = ptrace_detach(child, data);
372 break;
373
374 case PTRACE_GETEVENTMSG:
375 ret = put_user(child->ptrace_message,
376 (unsigned int __user *) (unsigned long) data);
377 break;
378
379 case PTRACE_GET_THREAD_AREA_3264: 317 case PTRACE_GET_THREAD_AREA_3264:
380 ret = put_user(task_thread_info(child)->tp_value, 318 ret = put_user(task_thread_info(child)->tp_value,
381 (unsigned long __user *) (unsigned long) data); 319 (unsigned long __user *) (unsigned long) data);
@@ -392,7 +330,7 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
392 break; 330 break;
393 331
394 default: 332 default:
395 ret = ptrace_request(child, request, addr, data); 333 ret = compat_ptrace_request(child, request, addr, data);
396 break; 334 break;
397 } 335 }
398out: 336out:
diff --git a/arch/mips/kernel/smp-cmp.c b/arch/mips/kernel/smp-cmp.c
index ca476c4f62a5..f27beca4b26d 100644
--- a/arch/mips/kernel/smp-cmp.c
+++ b/arch/mips/kernel/smp-cmp.c
@@ -51,10 +51,10 @@ static int __init allowcpus(char *str)
51 int len; 51 int len;
52 52
53 cpus_clear(cpu_allow_map); 53 cpus_clear(cpu_allow_map);
54 if (cpulist_parse(str, cpu_allow_map) == 0) { 54 if (cpulist_parse(str, &cpu_allow_map) == 0) {
55 cpu_set(0, cpu_allow_map); 55 cpu_set(0, cpu_allow_map);
56 cpus_and(cpu_possible_map, cpu_possible_map, cpu_allow_map); 56 cpus_and(cpu_possible_map, cpu_possible_map, cpu_allow_map);
57 len = cpulist_scnprintf(buf, sizeof(buf)-1, cpu_possible_map); 57 len = cpulist_scnprintf(buf, sizeof(buf)-1, &cpu_possible_map);
58 buf[len] = '\0'; 58 buf[len] = '\0';
59 pr_debug("Allowable CPUs: %s\n", buf); 59 pr_debug("Allowable CPUs: %s\n", buf);
60 return 1; 60 return 1;
@@ -226,7 +226,7 @@ void __init cmp_smp_setup(void)
226 226
227 for (i = 1; i < NR_CPUS; i++) { 227 for (i = 1; i < NR_CPUS; i++) {
228 if (amon_cpu_avail(i)) { 228 if (amon_cpu_avail(i)) {
229 cpu_set(i, phys_cpu_present_map); 229 cpu_set(i, cpu_possible_map);
230 __cpu_number_map[i] = ++ncpu; 230 __cpu_number_map[i] = ++ncpu;
231 __cpu_logical_map[ncpu] = i; 231 __cpu_logical_map[ncpu] = i;
232 } 232 }
diff --git a/arch/mips/kernel/smp-mt.c b/arch/mips/kernel/smp-mt.c
index 87a1816c1f45..6f7ee5ac46ee 100644
--- a/arch/mips/kernel/smp-mt.c
+++ b/arch/mips/kernel/smp-mt.c
@@ -70,7 +70,7 @@ static unsigned int __init smvp_vpe_init(unsigned int tc, unsigned int mvpconf0,
70 write_vpe_c0_vpeconf0(tmp); 70 write_vpe_c0_vpeconf0(tmp);
71 71
72 /* Record this as available CPU */ 72 /* Record this as available CPU */
73 cpu_set(tc, phys_cpu_present_map); 73 cpu_set(tc, cpu_possible_map);
74 __cpu_number_map[tc] = ++ncpu; 74 __cpu_number_map[tc] = ++ncpu;
75 __cpu_logical_map[ncpu] = tc; 75 __cpu_logical_map[ncpu] = tc;
76 } 76 }
diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
index 8bf88faf5afd..3da94704f816 100644
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -44,15 +44,10 @@
44#include <asm/mipsmtregs.h> 44#include <asm/mipsmtregs.h>
45#endif /* CONFIG_MIPS_MT_SMTC */ 45#endif /* CONFIG_MIPS_MT_SMTC */
46 46
47cpumask_t phys_cpu_present_map; /* Bitmask of available CPUs */
48volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */ 47volatile cpumask_t cpu_callin_map; /* Bitmask of started secondaries */
49cpumask_t cpu_online_map; /* Bitmask of currently online CPUs */
50int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ 48int __cpu_number_map[NR_CPUS]; /* Map physical to logical */
51int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ 49int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */
52 50
53EXPORT_SYMBOL(phys_cpu_present_map);
54EXPORT_SYMBOL(cpu_online_map);
55
56extern void cpu_idle(void); 51extern void cpu_idle(void);
57 52
58/* Number of TCs (or siblings in Intel speak) per CPU core */ 53/* Number of TCs (or siblings in Intel speak) per CPU core */
@@ -195,7 +190,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
195/* preload SMP state for boot cpu */ 190/* preload SMP state for boot cpu */
196void __devinit smp_prepare_boot_cpu(void) 191void __devinit smp_prepare_boot_cpu(void)
197{ 192{
198 cpu_set(0, phys_cpu_present_map); 193 cpu_set(0, cpu_possible_map);
199 cpu_set(0, cpu_online_map); 194 cpu_set(0, cpu_online_map);
200 cpu_set(0, cpu_callin_map); 195 cpu_set(0, cpu_callin_map);
201} 196}
diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c
index 897fb2b4751c..b6cca01ff82b 100644
--- a/arch/mips/kernel/smtc.c
+++ b/arch/mips/kernel/smtc.c
@@ -290,7 +290,7 @@ static void smtc_configure_tlb(void)
290 * possibly leave some TCs/VPEs as "slave" processors. 290 * possibly leave some TCs/VPEs as "slave" processors.
291 * 291 *
292 * Use c0_MVPConf0 to find out how many TCs are available, setting up 292 * Use c0_MVPConf0 to find out how many TCs are available, setting up
293 * phys_cpu_present_map and the logical/physical mappings. 293 * cpu_possible_map and the logical/physical mappings.
294 */ 294 */
295 295
296int __init smtc_build_cpu_map(int start_cpu_slot) 296int __init smtc_build_cpu_map(int start_cpu_slot)
@@ -304,7 +304,7 @@ int __init smtc_build_cpu_map(int start_cpu_slot)
304 */ 304 */
305 ntcs = ((read_c0_mvpconf0() & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1; 305 ntcs = ((read_c0_mvpconf0() & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1;
306 for (i=start_cpu_slot; i<NR_CPUS && i<ntcs; i++) { 306 for (i=start_cpu_slot; i<NR_CPUS && i<ntcs; i++) {
307 cpu_set(i, phys_cpu_present_map); 307 cpu_set(i, cpu_possible_map);
308 __cpu_number_map[i] = i; 308 __cpu_number_map[i] = i;
309 __cpu_logical_map[i] = i; 309 __cpu_logical_map[i] = i;
310 } 310 }
@@ -521,7 +521,7 @@ void smtc_prepare_cpus(int cpus)
521 * Pull any physically present but unused TCs out of circulation. 521 * Pull any physically present but unused TCs out of circulation.
522 */ 522 */
523 while (tc < (((val & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1)) { 523 while (tc < (((val & MVPCONF0_PTC) >> MVPCONF0_PTC_SHIFT) + 1)) {
524 cpu_clear(tc, phys_cpu_present_map); 524 cpu_clear(tc, cpu_possible_map);
525 cpu_clear(tc, cpu_present_map); 525 cpu_clear(tc, cpu_present_map);
526 tc++; 526 tc++;
527 } 527 }
diff --git a/arch/mips/kernel/stacktrace.c b/arch/mips/kernel/stacktrace.c
index 0632e2a849c0..58f5cd76c8c3 100644
--- a/arch/mips/kernel/stacktrace.c
+++ b/arch/mips/kernel/stacktrace.c
@@ -32,7 +32,8 @@ static void save_raw_context_stack(struct stack_trace *trace,
32 } 32 }
33} 33}
34 34
35static void save_context_stack(struct stack_trace *trace, struct pt_regs *regs) 35static void save_context_stack(struct stack_trace *trace,
36 struct task_struct *tsk, struct pt_regs *regs)
36{ 37{
37 unsigned long sp = regs->regs[29]; 38 unsigned long sp = regs->regs[29];
38#ifdef CONFIG_KALLSYMS 39#ifdef CONFIG_KALLSYMS
@@ -41,7 +42,7 @@ static void save_context_stack(struct stack_trace *trace, struct pt_regs *regs)
41 42
42 if (raw_show_trace || !__kernel_text_address(pc)) { 43 if (raw_show_trace || !__kernel_text_address(pc)) {
43 unsigned long stack_page = 44 unsigned long stack_page =
44 (unsigned long)task_stack_page(current); 45 (unsigned long)task_stack_page(tsk);
45 if (stack_page && sp >= stack_page && 46 if (stack_page && sp >= stack_page &&
46 sp <= stack_page + THREAD_SIZE - 32) 47 sp <= stack_page + THREAD_SIZE - 32)
47 save_raw_context_stack(trace, sp); 48 save_raw_context_stack(trace, sp);
@@ -54,7 +55,7 @@ static void save_context_stack(struct stack_trace *trace, struct pt_regs *regs)
54 trace->entries[trace->nr_entries++] = pc; 55 trace->entries[trace->nr_entries++] = pc;
55 if (trace->nr_entries >= trace->max_entries) 56 if (trace->nr_entries >= trace->max_entries)
56 break; 57 break;
57 pc = unwind_stack(current, &sp, pc, &ra); 58 pc = unwind_stack(tsk, &sp, pc, &ra);
58 } while (pc); 59 } while (pc);
59#else 60#else
60 save_raw_context_stack(trace, sp); 61 save_raw_context_stack(trace, sp);
@@ -66,12 +67,23 @@ static void save_context_stack(struct stack_trace *trace, struct pt_regs *regs)
66 */ 67 */
67void save_stack_trace(struct stack_trace *trace) 68void save_stack_trace(struct stack_trace *trace)
68{ 69{
70 save_stack_trace_tsk(current, trace);
71}
72EXPORT_SYMBOL_GPL(save_stack_trace);
73
74void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
75{
69 struct pt_regs dummyregs; 76 struct pt_regs dummyregs;
70 struct pt_regs *regs = &dummyregs; 77 struct pt_regs *regs = &dummyregs;
71 78
72 WARN_ON(trace->nr_entries || !trace->max_entries); 79 WARN_ON(trace->nr_entries || !trace->max_entries);
73 80
74 prepare_frametrace(regs); 81 if (tsk != current) {
75 save_context_stack(trace, regs); 82 regs->regs[29] = tsk->thread.reg29;
83 regs->regs[31] = 0;
84 regs->cp0_epc = tsk->thread.reg31;
85 } else
86 prepare_frametrace(regs);
87 save_context_stack(trace, tsk, regs);
76} 88}
77EXPORT_SYMBOL_GPL(save_stack_trace); 89EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 353056110f2b..f6083c6bfaa4 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -47,6 +47,7 @@
47#include <asm/mmu_context.h> 47#include <asm/mmu_context.h>
48#include <asm/types.h> 48#include <asm/types.h>
49#include <asm/stacktrace.h> 49#include <asm/stacktrace.h>
50#include <asm/irq.h>
50 51
51extern void check_wait(void); 52extern void check_wait(void);
52extern asmlinkage void r4k_wait(void); 53extern asmlinkage void r4k_wait(void);
@@ -78,6 +79,10 @@ extern asmlinkage void handle_reserved(void);
78extern int fpu_emulator_cop1Handler(struct pt_regs *xcp, 79extern int fpu_emulator_cop1Handler(struct pt_regs *xcp,
79 struct mips_fpu_struct *ctx, int has_fpu); 80 struct mips_fpu_struct *ctx, int has_fpu);
80 81
82#ifdef CONFIG_CPU_CAVIUM_OCTEON
83extern asmlinkage void octeon_cop2_restore(struct octeon_cop2_state *task);
84#endif
85
81void (*board_be_init)(void); 86void (*board_be_init)(void);
82int (*board_be_handler)(struct pt_regs *regs, int is_fixup); 87int (*board_be_handler)(struct pt_regs *regs, int is_fixup);
83void (*board_nmi_handler_setup)(void); 88void (*board_nmi_handler_setup)(void);
@@ -860,6 +865,7 @@ asmlinkage void do_cpu(struct pt_regs *regs)
860 unsigned int opcode; 865 unsigned int opcode;
861 unsigned int cpid; 866 unsigned int cpid;
862 int status; 867 int status;
868 unsigned long __maybe_unused flags;
863 869
864 die_if_kernel("do_cpu invoked from kernel context!", regs); 870 die_if_kernel("do_cpu invoked from kernel context!", regs);
865 871
@@ -915,6 +921,17 @@ asmlinkage void do_cpu(struct pt_regs *regs)
915 return; 921 return;
916 922
917 case 2: 923 case 2:
924#ifdef CONFIG_CPU_CAVIUM_OCTEON
925 prefetch(&current->thread.cp2);
926 local_irq_save(flags);
927 KSTK_STATUS(current) |= ST0_CU2;
928 status = read_c0_status();
929 write_c0_status(status | ST0_CU2);
930 octeon_cop2_restore(&(current->thread.cp2));
931 write_c0_status(status & ~ST0_CU2);
932 local_irq_restore(flags);
933 return;
934#endif
918 case 3: 935 case 3:
919 break; 936 break;
920 } 937 }
@@ -1488,6 +1505,10 @@ void __cpuinit per_cpu_trap_init(void)
1488 write_c0_hwrena(enable); 1505 write_c0_hwrena(enable);
1489 } 1506 }
1490 1507
1508#ifdef CONFIG_CPU_CAVIUM_OCTEON
1509 write_c0_hwrena(0xc000000f); /* Octeon has register 30 and 31 */
1510#endif
1511
1491#ifdef CONFIG_MIPS_MT_SMTC 1512#ifdef CONFIG_MIPS_MT_SMTC
1492 if (!secondaryTC) { 1513 if (!secondaryTC) {
1493#endif /* CONFIG_MIPS_MT_SMTC */ 1514#endif /* CONFIG_MIPS_MT_SMTC */
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
index 010b27e01f7b..3ca5f42e819d 100644
--- a/arch/mips/kernel/vpe.c
+++ b/arch/mips/kernel/vpe.c
@@ -1454,7 +1454,7 @@ static int __init vpe_module_init(void)
1454 device_initialize(&vpe_device); 1454 device_initialize(&vpe_device);
1455 vpe_device.class = &vpe_class, 1455 vpe_device.class = &vpe_class,
1456 vpe_device.parent = NULL, 1456 vpe_device.parent = NULL,
1457 strlcpy(vpe_device.bus_id, "vpe1", BUS_ID_SIZE); 1457 dev_set_name(&vpe_device, "vpe1");
1458 vpe_device.devt = MKDEV(major, minor); 1458 vpe_device.devt = MKDEV(major, minor);
1459 err = device_add(&vpe_device); 1459 err = device_add(&vpe_device);
1460 if (err) { 1460 if (err) {
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index dbcf6511b74e..c13c7ad2cdae 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -27,6 +27,7 @@ obj-$(CONFIG_CPU_SB1) += dump_tlb.o
27obj-$(CONFIG_CPU_TX39XX) += r3k_dump_tlb.o 27obj-$(CONFIG_CPU_TX39XX) += r3k_dump_tlb.o
28obj-$(CONFIG_CPU_TX49XX) += dump_tlb.o 28obj-$(CONFIG_CPU_TX49XX) += dump_tlb.o
29obj-$(CONFIG_CPU_VR41XX) += dump_tlb.o 29obj-$(CONFIG_CPU_VR41XX) += dump_tlb.o
30obj-$(CONFIG_CPU_CAVIUM_OCTEON) += dump_tlb.o
30 31
31# libgcc-style stuff needed in the kernel 32# libgcc-style stuff needed in the kernel
32obj-y += ashldi3.o ashrdi3.o cmpdi2.o lshrdi3.o ucmpdi2.o 33obj-y += ashldi3.o ashrdi3.o cmpdi2.o lshrdi3.o ucmpdi2.o
diff --git a/arch/mips/mm/Makefile b/arch/mips/mm/Makefile
index 95ba32b5b720..d7ec95522292 100644
--- a/arch/mips/mm/Makefile
+++ b/arch/mips/mm/Makefile
@@ -27,6 +27,7 @@ obj-$(CONFIG_CPU_SB1) += c-r4k.o cerr-sb1.o cex-sb1.o tlb-r4k.o
27obj-$(CONFIG_CPU_TX39XX) += c-tx39.o tlb-r3k.o 27obj-$(CONFIG_CPU_TX39XX) += c-tx39.o tlb-r3k.o
28obj-$(CONFIG_CPU_TX49XX) += c-r4k.o cex-gen.o tlb-r4k.o 28obj-$(CONFIG_CPU_TX49XX) += c-r4k.o cex-gen.o tlb-r4k.o
29obj-$(CONFIG_CPU_VR41XX) += c-r4k.o cex-gen.o tlb-r4k.o 29obj-$(CONFIG_CPU_VR41XX) += c-r4k.o cex-gen.o tlb-r4k.o
30obj-$(CONFIG_CPU_CAVIUM_OCTEON) += c-octeon.o cex-oct.o tlb-r4k.o
30 31
31obj-$(CONFIG_IP22_CPU_SCACHE) += sc-ip22.o 32obj-$(CONFIG_IP22_CPU_SCACHE) += sc-ip22.o
32obj-$(CONFIG_R5000_CPU_SCACHE) += sc-r5k.o 33obj-$(CONFIG_R5000_CPU_SCACHE) += sc-r5k.o
diff --git a/arch/mips/mm/c-octeon.c b/arch/mips/mm/c-octeon.c
new file mode 100644
index 000000000000..44d01a0a8490
--- /dev/null
+++ b/arch/mips/mm/c-octeon.c
@@ -0,0 +1,307 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005-2007 Cavium Networks
7 */
8#include <linux/init.h>
9#include <linux/kernel.h>
10#include <linux/sched.h>
11#include <linux/mm.h>
12#include <linux/bitops.h>
13#include <linux/cpu.h>
14#include <linux/io.h>
15
16#include <asm/bcache.h>
17#include <asm/bootinfo.h>
18#include <asm/cacheops.h>
19#include <asm/cpu-features.h>
20#include <asm/page.h>
21#include <asm/pgtable.h>
22#include <asm/r4kcache.h>
23#include <asm/system.h>
24#include <asm/mmu_context.h>
25#include <asm/war.h>
26
27#include <asm/octeon/octeon.h>
28
29unsigned long long cache_err_dcache[NR_CPUS];
30
31/**
32 * Octeon automatically flushes the dcache on tlb changes, so
33 * from Linux's viewpoint it acts much like a physically
34 * tagged cache. No flushing is needed
35 *
36 */
37static void octeon_flush_data_cache_page(unsigned long addr)
38{
39 /* Nothing to do */
40}
41
42static inline void octeon_local_flush_icache(void)
43{
44 asm volatile ("synci 0($0)");
45}
46
47/*
48 * Flush local I-cache for the specified range.
49 */
50static void local_octeon_flush_icache_range(unsigned long start,
51 unsigned long end)
52{
53 octeon_local_flush_icache();
54}
55
56/**
57 * Flush caches as necessary for all cores affected by a
58 * vma. If no vma is supplied, all cores are flushed.
59 *
60 * @vma: VMA to flush or NULL to flush all icaches.
61 */
62static void octeon_flush_icache_all_cores(struct vm_area_struct *vma)
63{
64 extern void octeon_send_ipi_single(int cpu, unsigned int action);
65#ifdef CONFIG_SMP
66 int cpu;
67 cpumask_t mask;
68#endif
69
70 mb();
71 octeon_local_flush_icache();
72#ifdef CONFIG_SMP
73 preempt_disable();
74 cpu = smp_processor_id();
75
76 /*
77 * If we have a vma structure, we only need to worry about
78 * cores it has been used on
79 */
80 if (vma)
81 mask = vma->vm_mm->cpu_vm_mask;
82 else
83 mask = cpu_online_map;
84 cpu_clear(cpu, mask);
85 for_each_cpu_mask(cpu, mask)
86 octeon_send_ipi_single(cpu, SMP_ICACHE_FLUSH);
87
88 preempt_enable();
89#endif
90}
91
92
93/**
94 * Called to flush the icache on all cores
95 */
96static void octeon_flush_icache_all(void)
97{
98 octeon_flush_icache_all_cores(NULL);
99}
100
101
102/**
103 * Called to flush all memory associated with a memory
104 * context.
105 *
106 * @mm: Memory context to flush
107 */
108static void octeon_flush_cache_mm(struct mm_struct *mm)
109{
110 /*
111 * According to the R4K version of this file, CPUs without
112 * dcache aliases don't need to do anything here
113 */
114}
115
116
117/**
118 * Flush a range of kernel addresses out of the icache
119 *
120 */
121static void octeon_flush_icache_range(unsigned long start, unsigned long end)
122{
123 octeon_flush_icache_all_cores(NULL);
124}
125
126
127/**
128 * Flush the icache for a trampoline. These are used for interrupt
129 * and exception hooking.
130 *
131 * @addr: Address to flush
132 */
133static void octeon_flush_cache_sigtramp(unsigned long addr)
134{
135 struct vm_area_struct *vma;
136
137 vma = find_vma(current->mm, addr);
138 octeon_flush_icache_all_cores(vma);
139}
140
141
142/**
143 * Flush a range out of a vma
144 *
145 * @vma: VMA to flush
146 * @start:
147 * @end:
148 */
149static void octeon_flush_cache_range(struct vm_area_struct *vma,
150 unsigned long start, unsigned long end)
151{
152 if (vma->vm_flags & VM_EXEC)
153 octeon_flush_icache_all_cores(vma);
154}
155
156
157/**
158 * Flush a specific page of a vma
159 *
160 * @vma: VMA to flush page for
161 * @page: Page to flush
162 * @pfn:
163 */
164static void octeon_flush_cache_page(struct vm_area_struct *vma,
165 unsigned long page, unsigned long pfn)
166{
167 if (vma->vm_flags & VM_EXEC)
168 octeon_flush_icache_all_cores(vma);
169}
170
171
172/**
173 * Probe Octeon's caches
174 *
175 */
176static void __devinit probe_octeon(void)
177{
178 unsigned long icache_size;
179 unsigned long dcache_size;
180 unsigned int config1;
181 struct cpuinfo_mips *c = &current_cpu_data;
182
183 switch (c->cputype) {
184 case CPU_CAVIUM_OCTEON:
185 config1 = read_c0_config1();
186 c->icache.linesz = 2 << ((config1 >> 19) & 7);
187 c->icache.sets = 64 << ((config1 >> 22) & 7);
188 c->icache.ways = 1 + ((config1 >> 16) & 7);
189 c->icache.flags |= MIPS_CACHE_VTAG;
190 icache_size =
191 c->icache.sets * c->icache.ways * c->icache.linesz;
192 c->icache.waybit = ffs(icache_size / c->icache.ways) - 1;
193 c->dcache.linesz = 128;
194 if (OCTEON_IS_MODEL(OCTEON_CN3XXX))
195 c->dcache.sets = 1; /* CN3XXX has one Dcache set */
196 else
197 c->dcache.sets = 2; /* CN5XXX has two Dcache sets */
198 c->dcache.ways = 64;
199 dcache_size =
200 c->dcache.sets * c->dcache.ways * c->dcache.linesz;
201 c->dcache.waybit = ffs(dcache_size / c->dcache.ways) - 1;
202 c->options |= MIPS_CPU_PREFETCH;
203 break;
204
205 default:
206 panic("Unsupported Cavium Networks CPU type\n");
207 break;
208 }
209
210 /* compute a couple of other cache variables */
211 c->icache.waysize = icache_size / c->icache.ways;
212 c->dcache.waysize = dcache_size / c->dcache.ways;
213
214 c->icache.sets = icache_size / (c->icache.linesz * c->icache.ways);
215 c->dcache.sets = dcache_size / (c->dcache.linesz * c->dcache.ways);
216
217 if (smp_processor_id() == 0) {
218 pr_notice("Primary instruction cache %ldkB, %s, %d way, "
219 "%d sets, linesize %d bytes.\n",
220 icache_size >> 10,
221 cpu_has_vtag_icache ?
222 "virtually tagged" : "physically tagged",
223 c->icache.ways, c->icache.sets, c->icache.linesz);
224
225 pr_notice("Primary data cache %ldkB, %d-way, %d sets, "
226 "linesize %d bytes.\n",
227 dcache_size >> 10, c->dcache.ways,
228 c->dcache.sets, c->dcache.linesz);
229 }
230}
231
232
233/**
234 * Setup the Octeon cache flush routines
235 *
236 */
237void __devinit octeon_cache_init(void)
238{
239 extern unsigned long ebase;
240 extern char except_vec2_octeon;
241
242 memcpy((void *)(ebase + 0x100), &except_vec2_octeon, 0x80);
243 octeon_flush_cache_sigtramp(ebase + 0x100);
244
245 probe_octeon();
246
247 shm_align_mask = PAGE_SIZE - 1;
248
249 flush_cache_all = octeon_flush_icache_all;
250 __flush_cache_all = octeon_flush_icache_all;
251 flush_cache_mm = octeon_flush_cache_mm;
252 flush_cache_page = octeon_flush_cache_page;
253 flush_cache_range = octeon_flush_cache_range;
254 flush_cache_sigtramp = octeon_flush_cache_sigtramp;
255 flush_icache_all = octeon_flush_icache_all;
256 flush_data_cache_page = octeon_flush_data_cache_page;
257 flush_icache_range = octeon_flush_icache_range;
258 local_flush_icache_range = local_octeon_flush_icache_range;
259
260 build_clear_page();
261 build_copy_page();
262}
263
264/**
265 * Handle a cache error exception
266 */
267
268static void cache_parity_error_octeon(int non_recoverable)
269{
270 unsigned long coreid = cvmx_get_core_num();
271 uint64_t icache_err = read_octeon_c0_icacheerr();
272
273 pr_err("Cache error exception:\n");
274 pr_err("cp0_errorepc == %lx\n", read_c0_errorepc());
275 if (icache_err & 1) {
276 pr_err("CacheErr (Icache) == %llx\n",
277 (unsigned long long)icache_err);
278 write_octeon_c0_icacheerr(0);
279 }
280 if (cache_err_dcache[coreid] & 1) {
281 pr_err("CacheErr (Dcache) == %llx\n",
282 (unsigned long long)cache_err_dcache[coreid]);
283 cache_err_dcache[coreid] = 0;
284 }
285
286 if (non_recoverable)
287 panic("Can't handle cache error: nested exception");
288}
289
290/**
291 * Called when the the exception is not recoverable
292 */
293
294asmlinkage void cache_parity_error_octeon_recoverable(void)
295{
296 cache_parity_error_octeon(0);
297}
298
299/**
300 * Called when the the exception is recoverable
301 */
302
303asmlinkage void cache_parity_error_octeon_non_recoverable(void)
304{
305 cache_parity_error_octeon(1);
306}
307
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 1eb7c71e3d6a..98ad0a82c29e 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -182,6 +182,12 @@ void __devinit cpu_cache_init(void)
182 tx39_cache_init(); 182 tx39_cache_init();
183 } 183 }
184 184
185 if (cpu_has_octeon_cache) {
186 extern void __weak octeon_cache_init(void);
187
188 octeon_cache_init();
189 }
190
185 setup_protection_map(); 191 setup_protection_map();
186} 192}
187 193
diff --git a/arch/mips/mm/cex-oct.S b/arch/mips/mm/cex-oct.S
new file mode 100644
index 000000000000..3db8553fcd34
--- /dev/null
+++ b/arch/mips/mm/cex-oct.S
@@ -0,0 +1,70 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2006 Cavium Networks
7 * Cache error handler
8 */
9
10#include <asm/asm.h>
11#include <asm/regdef.h>
12#include <asm/mipsregs.h>
13#include <asm/stackframe.h>
14
15/*
16 * Handle cache error. Indicate to the second level handler whether
17 * the exception is recoverable.
18 */
19 LEAF(except_vec2_octeon)
20
21 .set push
22 .set mips64r2
23 .set noreorder
24 .set noat
25
26
27 /* due to an errata we need to read the COP0 CacheErr (Dcache)
28 * before any cache/DRAM access */
29
30 rdhwr k0, $0 /* get core_id */
31 PTR_LA k1, cache_err_dcache
32 sll k0, k0, 3
33 PTR_ADDU k1, k0, k1 /* k1 = &cache_err_dcache[core_id] */
34
35 dmfc0 k0, CP0_CACHEERR, 1
36 sd k0, (k1)
37 dmtc0 $0, CP0_CACHEERR, 1
38
39 /* check whether this is a nested exception */
40 mfc0 k1, CP0_STATUS
41 andi k1, k1, ST0_EXL
42 beqz k1, 1f
43 nop
44 j cache_parity_error_octeon_non_recoverable
45 nop
46
47 /* exception is recoverable */
481: j handle_cache_err
49 nop
50
51 .set pop
52 END(except_vec2_octeon)
53
54 /* We need to jump to handle_cache_err so that the previous handler
55 * can fit within 0x80 bytes. We also move from 0xFFFFFFFFAXXXXXXX
56 * space (uncached) to the 0xFFFFFFFF8XXXXXXX space (cached). */
57 LEAF(handle_cache_err)
58 .set push
59 .set noreorder
60 .set noat
61
62 SAVE_ALL
63 KMODE
64 jal cache_parity_error_octeon_recoverable
65 nop
66 j ret_from_exception
67 nop
68
69 .set pop
70 END(handle_cache_err)
diff --git a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
index e6708b3ad343..546e6977d4ff 100644
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -111,7 +111,7 @@ EXPORT_SYMBOL(dma_alloc_coherent);
111void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr, 111void dma_free_noncoherent(struct device *dev, size_t size, void *vaddr,
112 dma_addr_t dma_handle) 112 dma_addr_t dma_handle)
113{ 113{
114 plat_unmap_dma_mem(dma_handle); 114 plat_unmap_dma_mem(dev, dma_handle);
115 free_pages((unsigned long) vaddr, get_order(size)); 115 free_pages((unsigned long) vaddr, get_order(size));
116} 116}
117 117
@@ -122,7 +122,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
122{ 122{
123 unsigned long addr = (unsigned long) vaddr; 123 unsigned long addr = (unsigned long) vaddr;
124 124
125 plat_unmap_dma_mem(dma_handle); 125 plat_unmap_dma_mem(dev, dma_handle);
126 126
127 if (!plat_device_is_coherent(dev)) 127 if (!plat_device_is_coherent(dev))
128 addr = CAC_ADDR(addr); 128 addr = CAC_ADDR(addr);
@@ -173,7 +173,7 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
173 __dma_sync(dma_addr_to_virt(dma_addr), size, 173 __dma_sync(dma_addr_to_virt(dma_addr), size,
174 direction); 174 direction);
175 175
176 plat_unmap_dma_mem(dma_addr); 176 plat_unmap_dma_mem(dev, dma_addr);
177} 177}
178 178
179EXPORT_SYMBOL(dma_unmap_single); 179EXPORT_SYMBOL(dma_unmap_single);
@@ -229,7 +229,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
229 dma_cache_wback_inv(addr, size); 229 dma_cache_wback_inv(addr, size);
230 } 230 }
231 231
232 plat_unmap_dma_mem(dma_address); 232 plat_unmap_dma_mem(dev, dma_address);
233} 233}
234 234
235EXPORT_SYMBOL(dma_unmap_page); 235EXPORT_SYMBOL(dma_unmap_page);
@@ -249,7 +249,7 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
249 if (addr) 249 if (addr)
250 __dma_sync(addr, sg->length, direction); 250 __dma_sync(addr, sg->length, direction);
251 } 251 }
252 plat_unmap_dma_mem(sg->dma_address); 252 plat_unmap_dma_mem(dev, sg->dma_address);
253 } 253 }
254} 254}
255 255
@@ -275,6 +275,7 @@ void dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
275{ 275{
276 BUG_ON(direction == DMA_NONE); 276 BUG_ON(direction == DMA_NONE);
277 277
278 plat_extra_sync_for_device(dev);
278 if (!plat_device_is_coherent(dev)) { 279 if (!plat_device_is_coherent(dev)) {
279 unsigned long addr; 280 unsigned long addr;
280 281
@@ -305,6 +306,7 @@ void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
305{ 306{
306 BUG_ON(direction == DMA_NONE); 307 BUG_ON(direction == DMA_NONE);
307 308
309 plat_extra_sync_for_device(dev);
308 if (!plat_device_is_coherent(dev)) { 310 if (!plat_device_is_coherent(dev)) {
309 unsigned long addr; 311 unsigned long addr;
310 312
@@ -351,22 +353,14 @@ EXPORT_SYMBOL(dma_sync_sg_for_device);
351 353
352int dma_mapping_error(struct device *dev, dma_addr_t dma_addr) 354int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
353{ 355{
354 return 0; 356 return plat_dma_mapping_error(dev, dma_addr);
355} 357}
356 358
357EXPORT_SYMBOL(dma_mapping_error); 359EXPORT_SYMBOL(dma_mapping_error);
358 360
359int dma_supported(struct device *dev, u64 mask) 361int dma_supported(struct device *dev, u64 mask)
360{ 362{
361 /* 363 return plat_dma_supported(dev, mask);
362 * we fall back to GFP_DMA when the mask isn't all 1s,
363 * so we can't guarantee allocations that must be
364 * within a tighter range than GFP_DMA..
365 */
366 if (mask < DMA_BIT_MASK(24))
367 return 0;
368
369 return 1;
370} 364}
371 365
372EXPORT_SYMBOL(dma_supported); 366EXPORT_SYMBOL(dma_supported);
@@ -383,6 +377,7 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
383{ 377{
384 BUG_ON(direction == DMA_NONE); 378 BUG_ON(direction == DMA_NONE);
385 379
380 plat_extra_sync_for_device(dev);
386 if (!plat_device_is_coherent(dev)) 381 if (!plat_device_is_coherent(dev))
387 __dma_sync((unsigned long)vaddr, size, direction); 382 __dma_sync((unsigned long)vaddr, size, direction);
388} 383}
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index 5ce2fa745626..9619f66e531e 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -478,7 +478,10 @@ void __cpuinit tlb_init(void)
478 probe_tlb(config); 478 probe_tlb(config);
479 write_c0_pagemask(PM_DEFAULT_MASK); 479 write_c0_pagemask(PM_DEFAULT_MASK);
480 write_c0_wired(0); 480 write_c0_wired(0);
481 write_c0_framemask(0); 481 if (current_cpu_type() == CPU_R10000 ||
482 current_cpu_type() == CPU_R12000 ||
483 current_cpu_type() == CPU_R14000)
484 write_c0_framemask(0);
482 temp_tlb_entry = current_cpu_data.tlbsize - 1; 485 temp_tlb_entry = current_cpu_data.tlbsize - 1;
483 486
484 /* From this point on the ARC firmware is dead. */ 487 /* From this point on the ARC firmware is dead. */
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 979cf9197282..42942038d0fd 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -317,6 +317,7 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
317 case CPU_BCM3302: 317 case CPU_BCM3302:
318 case CPU_BCM4710: 318 case CPU_BCM4710:
319 case CPU_LOONGSON2: 319 case CPU_LOONGSON2:
320 case CPU_CAVIUM_OCTEON:
320 if (m4kc_tlbp_war()) 321 if (m4kc_tlbp_war())
321 uasm_i_nop(p); 322 uasm_i_nop(p);
322 tlbw(p); 323 tlbw(p);
diff --git a/arch/mips/mti-malta/malta-smtc.c b/arch/mips/mti-malta/malta-smtc.c
index f84a46a8ae6e..aabd7274507b 100644
--- a/arch/mips/mti-malta/malta-smtc.c
+++ b/arch/mips/mti-malta/malta-smtc.c
@@ -114,9 +114,9 @@ struct plat_smp_ops msmtc_smp_ops = {
114 */ 114 */
115 115
116 116
117void plat_set_irq_affinity(unsigned int irq, cpumask_t affinity) 117void plat_set_irq_affinity(unsigned int irq, const struct cpumask *affinity)
118{ 118{
119 cpumask_t tmask = affinity; 119 cpumask_t tmask = *affinity;
120 int cpu = 0; 120 int cpu = 0;
121 void smtc_set_irq_affinity(unsigned int irq, cpumask_t aff); 121 void smtc_set_irq_affinity(unsigned int irq, cpumask_t aff);
122 122
@@ -139,7 +139,7 @@ void plat_set_irq_affinity(unsigned int irq, cpumask_t affinity)
139 * be made to forward to an offline "CPU". 139 * be made to forward to an offline "CPU".
140 */ 140 */
141 141
142 for_each_cpu_mask(cpu, affinity) { 142 for_each_cpu(cpu, affinity) {
143 if ((cpu_data[cpu].vpe_id != 0) || !cpu_online(cpu)) 143 if ((cpu_data[cpu].vpe_id != 0) || !cpu_online(cpu))
144 cpu_clear(cpu, tmask); 144 cpu_clear(cpu, tmask);
145 } 145 }
diff --git a/arch/mips/nxp/pnx8550/common/time.c b/arch/mips/nxp/pnx8550/common/time.c
index 62f495b57f93..cf293b279098 100644
--- a/arch/mips/nxp/pnx8550/common/time.c
+++ b/arch/mips/nxp/pnx8550/common/time.c
@@ -102,6 +102,7 @@ __init void plat_time_init(void)
102 unsigned int p; 102 unsigned int p;
103 unsigned int pow2p; 103 unsigned int pow2p;
104 104
105 pnx8xxx_clockevent.cpumask = cpu_none_mask;
105 clockevents_register_device(&pnx8xxx_clockevent); 106 clockevents_register_device(&pnx8xxx_clockevent);
106 clocksource_register(&pnx_clocksource); 107 clocksource_register(&pnx_clocksource);
107 108
diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
index f97ab1461012..dda6f2058665 100644
--- a/arch/mips/pci/pci-ip27.c
+++ b/arch/mips/pci/pci-ip27.c
@@ -146,12 +146,6 @@ int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
146 return 0; 146 return 0;
147} 147}
148 148
149/* Most MIPS systems have straight-forward swizzling needs. */
150static inline u8 bridge_swizzle(u8 pin, u8 slot)
151{
152 return (((pin - 1) + slot) % 4) + 1;
153}
154
155static inline struct pci_dev *bridge_root_dev(struct pci_dev *dev) 149static inline struct pci_dev *bridge_root_dev(struct pci_dev *dev)
156{ 150{
157 while (dev->bus->parent) { 151 while (dev->bus->parent) {
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index 62cae740e250..b0eb9e75c682 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -149,28 +149,6 @@ out:
149 "Skipping PCI bus scan due to resource conflict\n"); 149 "Skipping PCI bus scan due to resource conflict\n");
150} 150}
151 151
152/* Most MIPS systems have straight-forward swizzling needs. */
153
154static inline u8 bridge_swizzle(u8 pin, u8 slot)
155{
156 return (((pin - 1) + slot) % 4) + 1;
157}
158
159static u8 __init common_swizzle(struct pci_dev *dev, u8 *pinp)
160{
161 u8 pin = *pinp;
162
163 while (dev->bus->parent) {
164 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
165 /* Move up the chain of bridges. */
166 dev = dev->bus->self;
167 }
168 *pinp = pin;
169
170 /* The slot is the slot of the last bridge. */
171 return PCI_SLOT(dev->devfn);
172}
173
174static int __init pcibios_init(void) 152static int __init pcibios_init(void)
175{ 153{
176 struct pci_controller *hose; 154 struct pci_controller *hose;
@@ -179,7 +157,7 @@ static int __init pcibios_init(void)
179 for (hose = hose_head; hose; hose = hose->next) 157 for (hose = hose_head; hose; hose = hose->next)
180 pcibios_scanbus(hose); 158 pcibios_scanbus(hose);
181 159
182 pci_fixup_irqs(common_swizzle, pcibios_map_irq); 160 pci_fixup_irqs(pci_common_swizzle, pcibios_map_irq);
183 161
184 pci_initialized = 1; 162 pci_initialized = 1;
185 163
diff --git a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
index 97862f45496d..caf5e9a0acc7 100644
--- a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
+++ b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c
@@ -148,7 +148,7 @@ int read_eeprom(char *buffer, int eeprom_size, int size)
148 send_byte(W_HEADER); 148 send_byte(W_HEADER);
149 recv_ack(); 149 recv_ack();
150 150
151 /* EEPROM with size of more then 2K need two byte addressing */ 151 /* EEPROM with size of more than 2K need two byte addressing */
152 if (eeprom_size > 2048) { 152 if (eeprom_size > 2048) {
153 send_byte(0x00); 153 send_byte(0x00);
154 recv_ack(); 154 recv_ack();
diff --git a/arch/mips/pmc-sierra/yosemite/smp.c b/arch/mips/pmc-sierra/yosemite/smp.c
index 3a7df647ca77..f78c29b68d77 100644
--- a/arch/mips/pmc-sierra/yosemite/smp.c
+++ b/arch/mips/pmc-sierra/yosemite/smp.c
@@ -141,7 +141,7 @@ static void __cpuinit yos_boot_secondary(int cpu, struct task_struct *idle)
141} 141}
142 142
143/* 143/*
144 * Detect available CPUs, populate phys_cpu_present_map before smp_init 144 * Detect available CPUs, populate cpu_possible_map before smp_init
145 * 145 *
146 * We don't want to start the secondary CPU yet nor do we have a nice probing 146 * We don't want to start the secondary CPU yet nor do we have a nice probing
147 * feature in PMON so we just assume presence of the secondary core. 147 * feature in PMON so we just assume presence of the secondary core.
@@ -150,10 +150,10 @@ static void __init yos_smp_setup(void)
150{ 150{
151 int i; 151 int i;
152 152
153 cpus_clear(phys_cpu_present_map); 153 cpus_clear(cpu_possible_map);
154 154
155 for (i = 0; i < 2; i++) { 155 for (i = 0; i < 2; i++) {
156 cpu_set(i, phys_cpu_present_map); 156 cpu_set(i, cpu_possible_map);
157 __cpu_number_map[i] = i; 157 __cpu_number_map[i] = i;
158 __cpu_logical_map[i] = i; 158 __cpu_logical_map[i] = i;
159 } 159 }
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c
index ba5cdebeaf0d..5b47d6b65275 100644
--- a/arch/mips/sgi-ip27/ip27-smp.c
+++ b/arch/mips/sgi-ip27/ip27-smp.c
@@ -76,7 +76,7 @@ static int do_cpumask(cnodeid_t cnode, nasid_t nasid, int highest)
76 /* Only let it join in if it's marked enabled */ 76 /* Only let it join in if it's marked enabled */
77 if ((acpu->cpu_info.flags & KLINFO_ENABLE) && 77 if ((acpu->cpu_info.flags & KLINFO_ENABLE) &&
78 (tot_cpus_found != NR_CPUS)) { 78 (tot_cpus_found != NR_CPUS)) {
79 cpu_set(cpuid, phys_cpu_present_map); 79 cpu_set(cpuid, cpu_possible_map);
80 alloc_cpupda(cpuid, tot_cpus_found); 80 alloc_cpupda(cpuid, tot_cpus_found);
81 cpus_found++; 81 cpus_found++;
82 tot_cpus_found++; 82 tot_cpus_found++;
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 1327c2746fb7..f024057a35f8 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -134,7 +134,7 @@ void __cpuinit hub_rt_clock_event_init(void)
134 cd->min_delta_ns = clockevent_delta2ns(0x300, cd); 134 cd->min_delta_ns = clockevent_delta2ns(0x300, cd);
135 cd->rating = 200; 135 cd->rating = 200;
136 cd->irq = irq; 136 cd->irq = irq;
137 cd->cpumask = cpumask_of_cpu(cpu); 137 cd->cpumask = cpumask_of(cpu);
138 cd->set_next_event = rt_next_event; 138 cd->set_next_event = rt_next_event;
139 cd->set_mode = rt_set_mode; 139 cd->set_mode = rt_set_mode;
140 clockevents_register_device(cd); 140 clockevents_register_device(cd);
diff --git a/arch/mips/sibyte/bcm1480/irq.c b/arch/mips/sibyte/bcm1480/irq.c
index a35818ed4263..12b465d404df 100644
--- a/arch/mips/sibyte/bcm1480/irq.c
+++ b/arch/mips/sibyte/bcm1480/irq.c
@@ -50,7 +50,7 @@ static void enable_bcm1480_irq(unsigned int irq);
50static void disable_bcm1480_irq(unsigned int irq); 50static void disable_bcm1480_irq(unsigned int irq);
51static void ack_bcm1480_irq(unsigned int irq); 51static void ack_bcm1480_irq(unsigned int irq);
52#ifdef CONFIG_SMP 52#ifdef CONFIG_SMP
53static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask); 53static void bcm1480_set_affinity(unsigned int irq, const struct cpumask *mask);
54#endif 54#endif
55 55
56#ifdef CONFIG_PCI 56#ifdef CONFIG_PCI
@@ -109,7 +109,7 @@ void bcm1480_unmask_irq(int cpu, int irq)
109} 109}
110 110
111#ifdef CONFIG_SMP 111#ifdef CONFIG_SMP
112static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask) 112static void bcm1480_set_affinity(unsigned int irq, const struct cpumask *mask)
113{ 113{
114 int i = 0, old_cpu, cpu, int_on, k; 114 int i = 0, old_cpu, cpu, int_on, k;
115 u64 cur_ints; 115 u64 cur_ints;
@@ -117,11 +117,11 @@ static void bcm1480_set_affinity(unsigned int irq, cpumask_t mask)
117 unsigned long flags; 117 unsigned long flags;
118 unsigned int irq_dirty; 118 unsigned int irq_dirty;
119 119
120 if (cpus_weight(mask) != 1) { 120 if (cpumask_weight(mask) != 1) {
121 printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq); 121 printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq);
122 return; 122 return;
123 } 123 }
124 i = first_cpu(mask); 124 i = cpumask_first(mask);
125 125
126 /* Convert logical CPU to physical CPU */ 126 /* Convert logical CPU to physical CPU */
127 cpu = cpu_logical_map(i); 127 cpu = cpu_logical_map(i);
diff --git a/arch/mips/sibyte/bcm1480/smp.c b/arch/mips/sibyte/bcm1480/smp.c
index bd9eeb43ed0e..dddfda8e8294 100644
--- a/arch/mips/sibyte/bcm1480/smp.c
+++ b/arch/mips/sibyte/bcm1480/smp.c
@@ -136,7 +136,7 @@ static void __cpuinit bcm1480_boot_secondary(int cpu, struct task_struct *idle)
136 136
137/* 137/*
138 * Use CFE to find out how many CPUs are available, setting up 138 * Use CFE to find out how many CPUs are available, setting up
139 * phys_cpu_present_map and the logical/physical mappings. 139 * cpu_possible_map and the logical/physical mappings.
140 * XXXKW will the boot CPU ever not be physical 0? 140 * XXXKW will the boot CPU ever not be physical 0?
141 * 141 *
142 * Common setup before any secondaries are started 142 * Common setup before any secondaries are started
@@ -145,14 +145,14 @@ static void __init bcm1480_smp_setup(void)
145{ 145{
146 int i, num; 146 int i, num;
147 147
148 cpus_clear(phys_cpu_present_map); 148 cpus_clear(cpu_possible_map);
149 cpu_set(0, phys_cpu_present_map); 149 cpu_set(0, cpu_possible_map);
150 __cpu_number_map[0] = 0; 150 __cpu_number_map[0] = 0;
151 __cpu_logical_map[0] = 0; 151 __cpu_logical_map[0] = 0;
152 152
153 for (i = 1, num = 0; i < NR_CPUS; i++) { 153 for (i = 1, num = 0; i < NR_CPUS; i++) {
154 if (cfe_cpu_stop(i) == 0) { 154 if (cfe_cpu_stop(i) == 0) {
155 cpu_set(i, phys_cpu_present_map); 155 cpu_set(i, cpu_possible_map);
156 __cpu_number_map[i] = ++num; 156 __cpu_number_map[i] = ++num;
157 __cpu_logical_map[num] = i; 157 __cpu_logical_map[num] = i;
158 } 158 }
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c
index a5158483986e..808ac2959b8c 100644
--- a/arch/mips/sibyte/sb1250/irq.c
+++ b/arch/mips/sibyte/sb1250/irq.c
@@ -50,7 +50,7 @@ static void enable_sb1250_irq(unsigned int irq);
50static void disable_sb1250_irq(unsigned int irq); 50static void disable_sb1250_irq(unsigned int irq);
51static void ack_sb1250_irq(unsigned int irq); 51static void ack_sb1250_irq(unsigned int irq);
52#ifdef CONFIG_SMP 52#ifdef CONFIG_SMP
53static void sb1250_set_affinity(unsigned int irq, cpumask_t mask); 53static void sb1250_set_affinity(unsigned int irq, const struct cpumask *mask);
54#endif 54#endif
55 55
56#ifdef CONFIG_SIBYTE_HAS_LDT 56#ifdef CONFIG_SIBYTE_HAS_LDT
@@ -103,16 +103,16 @@ void sb1250_unmask_irq(int cpu, int irq)
103} 103}
104 104
105#ifdef CONFIG_SMP 105#ifdef CONFIG_SMP
106static void sb1250_set_affinity(unsigned int irq, cpumask_t mask) 106static void sb1250_set_affinity(unsigned int irq, const struct cpumask *mask)
107{ 107{
108 int i = 0, old_cpu, cpu, int_on; 108 int i = 0, old_cpu, cpu, int_on;
109 u64 cur_ints; 109 u64 cur_ints;
110 struct irq_desc *desc = irq_desc + irq; 110 struct irq_desc *desc = irq_desc + irq;
111 unsigned long flags; 111 unsigned long flags;
112 112
113 i = first_cpu(mask); 113 i = cpumask_first(mask);
114 114
115 if (cpus_weight(mask) > 1) { 115 if (cpumask_weight(mask) > 1) {
116 printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq); 116 printk("attempted to set irq affinity for irq %d to multiple CPUs\n", irq);
117 return; 117 return;
118 } 118 }
diff --git a/arch/mips/sibyte/sb1250/smp.c b/arch/mips/sibyte/sb1250/smp.c
index 0734b933e969..5950a288a7da 100644
--- a/arch/mips/sibyte/sb1250/smp.c
+++ b/arch/mips/sibyte/sb1250/smp.c
@@ -124,7 +124,7 @@ static void __cpuinit sb1250_boot_secondary(int cpu, struct task_struct *idle)
124 124
125/* 125/*
126 * Use CFE to find out how many CPUs are available, setting up 126 * Use CFE to find out how many CPUs are available, setting up
127 * phys_cpu_present_map and the logical/physical mappings. 127 * cpu_possible_map and the logical/physical mappings.
128 * XXXKW will the boot CPU ever not be physical 0? 128 * XXXKW will the boot CPU ever not be physical 0?
129 * 129 *
130 * Common setup before any secondaries are started 130 * Common setup before any secondaries are started
@@ -133,14 +133,14 @@ static void __init sb1250_smp_setup(void)
133{ 133{
134 int i, num; 134 int i, num;
135 135
136 cpus_clear(phys_cpu_present_map); 136 cpus_clear(cpu_possible_map);
137 cpu_set(0, phys_cpu_present_map); 137 cpu_set(0, cpu_possible_map);
138 __cpu_number_map[0] = 0; 138 __cpu_number_map[0] = 0;
139 __cpu_logical_map[0] = 0; 139 __cpu_logical_map[0] = 0;
140 140
141 for (i = 1, num = 0; i < NR_CPUS; i++) { 141 for (i = 1, num = 0; i < NR_CPUS; i++) {
142 if (cfe_cpu_stop(i) == 0) { 142 if (cfe_cpu_stop(i) == 0) {
143 cpu_set(i, phys_cpu_present_map); 143 cpu_set(i, cpu_possible_map);
144 __cpu_number_map[i] = ++num; 144 __cpu_number_map[i] = ++num;
145 __cpu_logical_map[num] = i; 145 __cpu_logical_map[num] = i;
146 } 146 }
diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c
index 796e3ce28720..69f5f88711cc 100644
--- a/arch/mips/sni/time.c
+++ b/arch/mips/sni/time.c
@@ -80,7 +80,7 @@ static void __init sni_a20r_timer_setup(void)
80 struct irqaction *action = &a20r_irqaction; 80 struct irqaction *action = &a20r_irqaction;
81 unsigned int cpu = smp_processor_id(); 81 unsigned int cpu = smp_processor_id();
82 82
83 cd->cpumask = cpumask_of_cpu(cpu); 83 cd->cpumask = cpumask_of(cpu);
84 clockevents_register_device(cd); 84 clockevents_register_device(cd);
85 action->dev_id = cd; 85 action->dev_id = cd;
86 setup_irq(SNI_A20R_IRQ_TIMER, &a20r_irqaction); 86 setup_irq(SNI_A20R_IRQ_TIMER, &a20r_irqaction);
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index 644a70b1b04e..aacf11d33723 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -11,6 +11,7 @@ config PARISC
11 select HAVE_OPROFILE 11 select HAVE_OPROFILE
12 select RTC_CLASS 12 select RTC_CLASS
13 select RTC_DRV_PARISC 13 select RTC_DRV_PARISC
14 select INIT_ALL_POSSIBLE
14 help 15 help
15 The PA-RISC microprocessor is designed by Hewlett-Packard and used 16 The PA-RISC microprocessor is designed by Hewlett-Packard and used
16 in many of their workstations & servers (HP9000 700 and 800 series, 17 in many of their workstations & servers (HP9000 700 and 800 series,
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 5ddad7bd60ac..0d428278356d 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -77,7 +77,7 @@ libs-y += arch/parisc/lib/ `$(CC) -print-libgcc-file-name`
77 77
78drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/ 78drivers-$(CONFIG_OPROFILE) += arch/parisc/oprofile/
79 79
80PALO := $(shell if which palo; then : ; \ 80PALO := $(shell if (which palo 2>&1); then : ; \
81 elif [ -x /sbin/palo ]; then echo /sbin/palo; \ 81 elif [ -x /sbin/palo ]; then echo /sbin/palo; \
82 fi) 82 fi)
83 83
diff --git a/arch/parisc/include/asm/Kbuild b/arch/parisc/include/asm/Kbuild
index f88b252e419c..2121d99f8364 100644
--- a/arch/parisc/include/asm/Kbuild
+++ b/arch/parisc/include/asm/Kbuild
@@ -1,3 +1,4 @@
1include include/asm-generic/Kbuild.asm 1include include/asm-generic/Kbuild.asm
2 2
3unifdef-y += pdc.h 3unifdef-y += pdc.h
4unifdef-y += swab.h
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h
index 57fcc4a5ebb4..edbfe25c5fc1 100644
--- a/arch/parisc/include/asm/atomic.h
+++ b/arch/parisc/include/asm/atomic.h
@@ -155,14 +155,11 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr,
155#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 155#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
156#endif 156#endif
157 157
158/* Note that we need not lock read accesses - aligned word writes/reads 158/*
159 * are atomic, so a reader never sees unconsistent values. 159 * Note that we need not lock read accesses - aligned word writes/reads
160 * 160 * are atomic, so a reader never sees inconsistent values.
161 * Cache-line alignment would conflict with, for example, linux/module.h
162 */ 161 */
163 162
164typedef struct { volatile int counter; } atomic_t;
165
166/* It's possible to reduce all atomic operations to either 163/* It's possible to reduce all atomic operations to either
167 * __atomic_add_return, atomic_set and atomic_read (the latter 164 * __atomic_add_return, atomic_set and atomic_read (the latter
168 * is there only for consistency). 165 * is there only for consistency).
@@ -260,8 +257,6 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
260 257
261#ifdef CONFIG_64BIT 258#ifdef CONFIG_64BIT
262 259
263typedef struct { volatile s64 counter; } atomic64_t;
264
265#define ATOMIC64_INIT(i) ((atomic64_t) { (i) }) 260#define ATOMIC64_INIT(i) ((atomic64_t) { (i) })
266 261
267static __inline__ int 262static __inline__ int
diff --git a/arch/parisc/include/asm/byteorder.h b/arch/parisc/include/asm/byteorder.h
index db148313de5d..da66029c4cb2 100644
--- a/arch/parisc/include/asm/byteorder.h
+++ b/arch/parisc/include/asm/byteorder.h
@@ -1,82 +1,7 @@
1#ifndef _PARISC_BYTEORDER_H 1#ifndef _PARISC_BYTEORDER_H
2#define _PARISC_BYTEORDER_H 2#define _PARISC_BYTEORDER_H
3 3
4#include <asm/types.h> 4#include <asm/swab.h>
5#include <linux/compiler.h>
6
7#ifdef __GNUC__
8
9static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x)
10{
11 __asm__("dep %0, 15, 8, %0\n\t" /* deposit 00ab -> 0bab */
12 "shd %%r0, %0, 8, %0" /* shift 000000ab -> 00ba */
13 : "=r" (x)
14 : "0" (x));
15 return x;
16}
17
18static __inline__ __attribute_const__ __u32 ___arch__swab24(__u32 x)
19{
20 __asm__("shd %0, %0, 8, %0\n\t" /* shift xabcxabc -> cxab */
21 "dep %0, 15, 8, %0\n\t" /* deposit cxab -> cbab */
22 "shd %%r0, %0, 8, %0" /* shift 0000cbab -> 0cba */
23 : "=r" (x)
24 : "0" (x));
25 return x;
26}
27
28static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
29{
30 unsigned int temp;
31 __asm__("shd %0, %0, 16, %1\n\t" /* shift abcdabcd -> cdab */
32 "dep %1, 15, 8, %1\n\t" /* deposit cdab -> cbab */
33 "shd %0, %1, 8, %0" /* shift abcdcbab -> dcba */
34 : "=r" (x), "=&r" (temp)
35 : "0" (x));
36 return x;
37}
38
39
40#if BITS_PER_LONG > 32
41/*
42** From "PA-RISC 2.0 Architecture", HP Professional Books.
43** See Appendix I page 8 , "Endian Byte Swapping".
44**
45** Pretty cool algorithm: (* == zero'd bits)
46** PERMH 01234567 -> 67452301 into %0
47** HSHL 67452301 -> 7*5*3*1* into %1
48** HSHR 67452301 -> *6*4*2*0 into %0
49** OR %0 | %1 -> 76543210 into %0 (all done!)
50*/
51static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x) {
52 __u64 temp;
53 __asm__("permh,3210 %0, %0\n\t"
54 "hshl %0, 8, %1\n\t"
55 "hshr,u %0, 8, %0\n\t"
56 "or %1, %0, %0"
57 : "=r" (x), "=&r" (temp)
58 : "0" (x));
59 return x;
60}
61#define __arch__swab64(x) ___arch__swab64(x)
62#define __BYTEORDER_HAS_U64__
63#elif !defined(__STRICT_ANSI__)
64static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 x)
65{
66 __u32 t1 = ___arch__swab32((__u32) x);
67 __u32 t2 = ___arch__swab32((__u32) (x >> 32));
68 return (((__u64) t1 << 32) | t2);
69}
70#define __arch__swab64(x) ___arch__swab64(x)
71#define __BYTEORDER_HAS_U64__
72#endif
73
74#define __arch__swab16(x) ___arch__swab16(x)
75#define __arch__swab24(x) ___arch__swab24(x)
76#define __arch__swab32(x) ___arch__swab32(x)
77
78#endif /* __GNUC__ */
79
80#include <linux/byteorder/big_endian.h> 5#include <linux/byteorder/big_endian.h>
81 6
82#endif /* _PARISC_BYTEORDER_H */ 7#endif /* _PARISC_BYTEORDER_H */
diff --git a/arch/parisc/include/asm/checksum.h b/arch/parisc/include/asm/checksum.h
index e9639ccc3fce..c84b2fcb18a9 100644
--- a/arch/parisc/include/asm/checksum.h
+++ b/arch/parisc/include/asm/checksum.h
@@ -182,7 +182,7 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
182#endif 182#endif
183 : "=r" (sum), "=r" (saddr), "=r" (daddr), "=r" (len) 183 : "=r" (sum), "=r" (saddr), "=r" (daddr), "=r" (len)
184 : "0" (sum), "1" (saddr), "2" (daddr), "3" (len), "r" (proto) 184 : "0" (sum), "1" (saddr), "2" (daddr), "3" (len), "r" (proto)
185 : "r19", "r20", "r21", "r22"); 185 : "r19", "r20", "r21", "r22", "memory");
186 return csum_fold(sum); 186 return csum_fold(sum);
187} 187}
188 188
diff --git a/arch/parisc/include/asm/io.h b/arch/parisc/include/asm/io.h
index 55ddb1842107..d3031d1f9d03 100644
--- a/arch/parisc/include/asm/io.h
+++ b/arch/parisc/include/asm/io.h
@@ -4,12 +4,6 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/pgtable.h> 5#include <asm/pgtable.h>
6 6
7extern unsigned long parisc_vmerge_boundary;
8extern unsigned long parisc_vmerge_max_size;
9
10#define BIO_VMERGE_BOUNDARY parisc_vmerge_boundary
11#define BIO_VMERGE_MAX_SIZE parisc_vmerge_max_size
12
13#define virt_to_phys(a) ((unsigned long)__pa(a)) 7#define virt_to_phys(a) ((unsigned long)__pa(a))
14#define phys_to_virt(a) __va(a) 8#define phys_to_virt(a) __va(a)
15#define virt_to_bus virt_to_phys 9#define virt_to_bus virt_to_phys
@@ -182,9 +176,9 @@ static inline void __raw_writeq(unsigned long long b, volatile void __iomem *add
182 176
183/* readb can never be const, so use __fswab instead of le*_to_cpu */ 177/* readb can never be const, so use __fswab instead of le*_to_cpu */
184#define readb(addr) __raw_readb(addr) 178#define readb(addr) __raw_readb(addr)
185#define readw(addr) __fswab16(__raw_readw(addr)) 179#define readw(addr) le16_to_cpu(__raw_readw(addr))
186#define readl(addr) __fswab32(__raw_readl(addr)) 180#define readl(addr) le32_to_cpu(__raw_readl(addr))
187#define readq(addr) __fswab64(__raw_readq(addr)) 181#define readq(addr) le64_to_cpu(__raw_readq(addr))
188#define writeb(b, addr) __raw_writeb(b, addr) 182#define writeb(b, addr) __raw_writeb(b, addr)
189#define writew(b, addr) __raw_writew(cpu_to_le16(b), addr) 183#define writew(b, addr) __raw_writew(cpu_to_le16(b), addr)
190#define writel(b, addr) __raw_writel(cpu_to_le32(b), addr) 184#define writel(b, addr) __raw_writel(cpu_to_le32(b), addr)
diff --git a/arch/parisc/include/asm/mmu_context.h b/arch/parisc/include/asm/mmu_context.h
index 85856c74ad1d..354b2aca990e 100644
--- a/arch/parisc/include/asm/mmu_context.h
+++ b/arch/parisc/include/asm/mmu_context.h
@@ -34,16 +34,21 @@ destroy_context(struct mm_struct *mm)
34 mm->context = 0; 34 mm->context = 0;
35} 35}
36 36
37static inline void load_context(mm_context_t context) 37static inline unsigned long __space_to_prot(mm_context_t context)
38{ 38{
39 mtsp(context, 3);
40#if SPACEID_SHIFT == 0 39#if SPACEID_SHIFT == 0
41 mtctl(context << 1,8); 40 return context << 1;
42#else 41#else
43 mtctl(context >> (SPACEID_SHIFT - 1),8); 42 return context >> (SPACEID_SHIFT - 1);
44#endif 43#endif
45} 44}
46 45
46static inline void load_context(mm_context_t context)
47{
48 mtsp(context, 3);
49 mtctl(__space_to_prot(context), 8);
50}
51
47static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk) 52static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
48{ 53{
49 54
diff --git a/arch/parisc/include/asm/module.h b/arch/parisc/include/asm/module.h
index c2cb49e934c1..1f4123427ea0 100644
--- a/arch/parisc/include/asm/module.h
+++ b/arch/parisc/include/asm/module.h
@@ -23,8 +23,10 @@ struct mod_arch_specific
23{ 23{
24 unsigned long got_offset, got_count, got_max; 24 unsigned long got_offset, got_count, got_max;
25 unsigned long fdesc_offset, fdesc_count, fdesc_max; 25 unsigned long fdesc_offset, fdesc_count, fdesc_max;
26 unsigned long stub_offset, stub_count, stub_max; 26 struct {
27 unsigned long init_stub_offset, init_stub_count, init_stub_max; 27 unsigned long stub_offset;
28 unsigned int stub_entries;
29 } *section;
28 int unwind_section; 30 int unwind_section;
29 struct unwind_table *unwind; 31 struct unwind_table *unwind;
30}; 32};
diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
index 3c9d34844c83..9d64df8754ba 100644
--- a/arch/parisc/include/asm/processor.h
+++ b/arch/parisc/include/asm/processor.h
@@ -17,6 +17,7 @@
17#include <asm/ptrace.h> 17#include <asm/ptrace.h>
18#include <asm/types.h> 18#include <asm/types.h>
19#include <asm/system.h> 19#include <asm/system.h>
20#include <asm/percpu.h>
20#endif /* __ASSEMBLY__ */ 21#endif /* __ASSEMBLY__ */
21 22
22#define KERNEL_STACK_SIZE (4*PAGE_SIZE) 23#define KERNEL_STACK_SIZE (4*PAGE_SIZE)
@@ -109,8 +110,7 @@ struct cpuinfo_parisc {
109}; 110};
110 111
111extern struct system_cpuinfo_parisc boot_cpu_data; 112extern struct system_cpuinfo_parisc boot_cpu_data;
112extern struct cpuinfo_parisc cpu_data[NR_CPUS]; 113DECLARE_PER_CPU(struct cpuinfo_parisc, cpu_data);
113#define current_cpu_data cpu_data[smp_processor_id()]
114 114
115#define CPU_HVERSION ((boot_cpu_data.hversion >> 4) & 0x0FFF) 115#define CPU_HVERSION ((boot_cpu_data.hversion >> 4) & 0x0FFF)
116 116
diff --git a/arch/parisc/include/asm/smp.h b/arch/parisc/include/asm/smp.h
index 409e698f4361..6ef4b7867b1b 100644
--- a/arch/parisc/include/asm/smp.h
+++ b/arch/parisc/include/asm/smp.h
@@ -16,8 +16,6 @@
16#include <linux/cpumask.h> 16#include <linux/cpumask.h>
17typedef unsigned long address_t; 17typedef unsigned long address_t;
18 18
19extern cpumask_t cpu_online_map;
20
21 19
22/* 20/*
23 * Private routines/data 21 * Private routines/data
diff --git a/arch/parisc/include/asm/swab.h b/arch/parisc/include/asm/swab.h
new file mode 100644
index 000000000000..3ff16c5a3358
--- /dev/null
+++ b/arch/parisc/include/asm/swab.h
@@ -0,0 +1,66 @@
1#ifndef _PARISC_SWAB_H
2#define _PARISC_SWAB_H
3
4#include <asm/types.h>
5#include <linux/compiler.h>
6
7#define __SWAB_64_THRU_32__
8
9static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
10{
11 __asm__("dep %0, 15, 8, %0\n\t" /* deposit 00ab -> 0bab */
12 "shd %%r0, %0, 8, %0" /* shift 000000ab -> 00ba */
13 : "=r" (x)
14 : "0" (x));
15 return x;
16}
17#define __arch_swab16 __arch_swab16
18
19static inline __attribute_const__ __u32 __arch_swab24(__u32 x)
20{
21 __asm__("shd %0, %0, 8, %0\n\t" /* shift xabcxabc -> cxab */
22 "dep %0, 15, 8, %0\n\t" /* deposit cxab -> cbab */
23 "shd %%r0, %0, 8, %0" /* shift 0000cbab -> 0cba */
24 : "=r" (x)
25 : "0" (x));
26 return x;
27}
28
29static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
30{
31 unsigned int temp;
32 __asm__("shd %0, %0, 16, %1\n\t" /* shift abcdabcd -> cdab */
33 "dep %1, 15, 8, %1\n\t" /* deposit cdab -> cbab */
34 "shd %0, %1, 8, %0" /* shift abcdcbab -> dcba */
35 : "=r" (x), "=&r" (temp)
36 : "0" (x));
37 return x;
38}
39#define __arch_swab32 __arch_swab32
40
41#if BITS_PER_LONG > 32
42/*
43** From "PA-RISC 2.0 Architecture", HP Professional Books.
44** See Appendix I page 8 , "Endian Byte Swapping".
45**
46** Pretty cool algorithm: (* == zero'd bits)
47** PERMH 01234567 -> 67452301 into %0
48** HSHL 67452301 -> 7*5*3*1* into %1
49** HSHR 67452301 -> *6*4*2*0 into %0
50** OR %0 | %1 -> 76543210 into %0 (all done!)
51*/
52static inline __attribute_const__ __u64 __arch_swab64(__u64 x)
53{
54 __u64 temp;
55 __asm__("permh,3210 %0, %0\n\t"
56 "hshl %0, 8, %1\n\t"
57 "hshr,u %0, 8, %0\n\t"
58 "or %1, %0, %0"
59 : "=r" (x), "=&r" (temp)
60 : "0" (x));
61 return x;
62}
63#define __arch_swab64 __arch_swab64
64#endif /* BITS_PER_LONG > 32 */
65
66#endif /* _PARISC_SWAB_H */
diff --git a/arch/parisc/include/asm/uaccess.h b/arch/parisc/include/asm/uaccess.h
index 4878b9501f24..1c6dbb6f6e56 100644
--- a/arch/parisc/include/asm/uaccess.h
+++ b/arch/parisc/include/asm/uaccess.h
@@ -241,4 +241,6 @@ unsigned long copy_in_user(void __user *dst, const void __user *src, unsigned lo
241#define __copy_to_user_inatomic __copy_to_user 241#define __copy_to_user_inatomic __copy_to_user
242#define __copy_from_user_inatomic __copy_from_user 242#define __copy_from_user_inatomic __copy_from_user
243 243
244int fixup_exception(struct pt_regs *regs);
245
244#endif /* __PARISC_UACCESS_H */ 246#endif /* __PARISC_UACCESS_H */
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index 884b7ce16a3b..994bcd980909 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -549,6 +549,38 @@ static int parisc_generic_match(struct device *dev, struct device_driver *drv)
549 return match_device(to_parisc_driver(drv), to_parisc_device(dev)); 549 return match_device(to_parisc_driver(drv), to_parisc_device(dev));
550} 550}
551 551
552static ssize_t make_modalias(struct device *dev, char *buf)
553{
554 const struct parisc_device *padev = to_parisc_device(dev);
555 const struct parisc_device_id *id = &padev->id;
556
557 return sprintf(buf, "parisc:t%02Xhv%04Xrev%02Xsv%08X\n",
558 (u8)id->hw_type, (u16)id->hversion, (u8)id->hversion_rev,
559 (u32)id->sversion);
560}
561
562static int parisc_uevent(struct device *dev, struct kobj_uevent_env *env)
563{
564 const struct parisc_device *padev;
565 char modalias[40];
566
567 if (!dev)
568 return -ENODEV;
569
570 padev = to_parisc_device(dev);
571 if (!padev)
572 return -ENODEV;
573
574 if (add_uevent_var(env, "PARISC_NAME=%s", padev->name))
575 return -ENOMEM;
576
577 make_modalias(dev, modalias);
578 if (add_uevent_var(env, "MODALIAS=%s", modalias))
579 return -ENOMEM;
580
581 return 0;
582}
583
552#define pa_dev_attr(name, field, format_string) \ 584#define pa_dev_attr(name, field, format_string) \
553static ssize_t name##_show(struct device *dev, struct device_attribute *attr, char *buf) \ 585static ssize_t name##_show(struct device *dev, struct device_attribute *attr, char *buf) \
554{ \ 586{ \
@@ -566,12 +598,7 @@ pa_dev_attr_id(sversion, "0x%05x\n");
566 598
567static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) 599static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
568{ 600{
569 struct parisc_device *padev = to_parisc_device(dev); 601 return make_modalias(dev, buf);
570 struct parisc_device_id *id = &padev->id;
571
572 return sprintf(buf, "parisc:t%02Xhv%04Xrev%02Xsv%08X\n",
573 (u8)id->hw_type, (u16)id->hversion, (u8)id->hversion_rev,
574 (u32)id->sversion);
575} 602}
576 603
577static struct device_attribute parisc_device_attrs[] = { 604static struct device_attribute parisc_device_attrs[] = {
@@ -587,6 +614,7 @@ static struct device_attribute parisc_device_attrs[] = {
587struct bus_type parisc_bus_type = { 614struct bus_type parisc_bus_type = {
588 .name = "parisc", 615 .name = "parisc",
589 .match = parisc_generic_match, 616 .match = parisc_generic_match,
617 .uevent = parisc_uevent,
590 .dev_attrs = parisc_device_attrs, 618 .dev_attrs = parisc_device_attrs,
591 .probe = parisc_driver_probe, 619 .probe = parisc_driver_probe,
592 .remove = parisc_driver_remove, 620 .remove = parisc_driver_remove,
diff --git a/arch/parisc/kernel/hpmc.S b/arch/parisc/kernel/hpmc.S
index 2cbf13b3ef11..5595a2f31181 100644
--- a/arch/parisc/kernel/hpmc.S
+++ b/arch/parisc/kernel/hpmc.S
@@ -80,6 +80,7 @@ END(hpmc_pim_data)
80 80
81 .import intr_save, code 81 .import intr_save, code
82ENTRY(os_hpmc) 82ENTRY(os_hpmc)
83.os_hpmc:
83 84
84 /* 85 /*
85 * registers modified: 86 * registers modified:
@@ -295,5 +296,10 @@ os_hpmc_6:
295 b . 296 b .
296 nop 297 nop
297ENDPROC(os_hpmc) 298ENDPROC(os_hpmc)
298ENTRY(os_hpmc_end) /* this label used to compute os_hpmc checksum */ 299.os_hpmc_end:
299 nop 300 nop
301.data
302.align 4
303 .export os_hpmc_size
304os_hpmc_size:
305 .word .os_hpmc_end-.os_hpmc
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 23ef950df008..ac2c822928c7 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -131,12 +131,12 @@ int cpu_check_affinity(unsigned int irq, cpumask_t *dest)
131 return 0; 131 return 0;
132} 132}
133 133
134static void cpu_set_affinity_irq(unsigned int irq, cpumask_t dest) 134static void cpu_set_affinity_irq(unsigned int irq, const struct cpumask *dest)
135{ 135{
136 if (cpu_check_affinity(irq, &dest)) 136 if (cpu_check_affinity(irq, dest))
137 return; 137 return;
138 138
139 irq_desc[irq].affinity = dest; 139 irq_desc[irq].affinity = *dest;
140} 140}
141#endif 141#endif
142 142
@@ -298,7 +298,7 @@ unsigned long txn_affinity_addr(unsigned int irq, int cpu)
298 irq_desc[irq].affinity = cpumask_of_cpu(cpu); 298 irq_desc[irq].affinity = cpumask_of_cpu(cpu);
299#endif 299#endif
300 300
301 return cpu_data[cpu].txn_addr; 301 return per_cpu(cpu_data, cpu).txn_addr;
302} 302}
303 303
304 304
@@ -309,8 +309,9 @@ unsigned long txn_alloc_addr(unsigned int virt_irq)
309 next_cpu++; /* assign to "next" CPU we want this bugger on */ 309 next_cpu++; /* assign to "next" CPU we want this bugger on */
310 310
311 /* validate entry */ 311 /* validate entry */
312 while ((next_cpu < NR_CPUS) && (!cpu_data[next_cpu].txn_addr || 312 while ((next_cpu < NR_CPUS) &&
313 !cpu_online(next_cpu))) 313 (!per_cpu(cpu_data, next_cpu).txn_addr ||
314 !cpu_online(next_cpu)))
314 next_cpu++; 315 next_cpu++;
315 316
316 if (next_cpu >= NR_CPUS) 317 if (next_cpu >= NR_CPUS)
@@ -359,7 +360,7 @@ void do_cpu_irq_mask(struct pt_regs *regs)
359 printk(KERN_DEBUG "redirecting irq %d from CPU %d to %d\n", 360 printk(KERN_DEBUG "redirecting irq %d from CPU %d to %d\n",
360 irq, smp_processor_id(), cpu); 361 irq, smp_processor_id(), cpu);
361 gsc_writel(irq + CPU_IRQ_BASE, 362 gsc_writel(irq + CPU_IRQ_BASE,
362 cpu_data[cpu].hpa); 363 per_cpu(cpu_data, cpu).hpa);
363 goto set_out; 364 goto set_out;
364 } 365 }
365#endif 366#endif
@@ -421,5 +422,5 @@ void __init init_IRQ(void)
421 422
422void ack_bad_irq(unsigned int irq) 423void ack_bad_irq(unsigned int irq)
423{ 424{
424 printk("unexpected IRQ %d\n", irq); 425 printk(KERN_WARNING "unexpected IRQ %d\n", irq);
425} 426}
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
index 44138c3e6ea7..9013243cecca 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -6,6 +6,7 @@
6 * 6 *
7 * Linux/PA-RISC Project (http://www.parisc-linux.org/) 7 * Linux/PA-RISC Project (http://www.parisc-linux.org/)
8 * Copyright (C) 2003 Randolph Chung <tausq at debian . org> 8 * Copyright (C) 2003 Randolph Chung <tausq at debian . org>
9 * Copyright (C) 2008 Helge Deller <deller@gmx.de>
9 * 10 *
10 * 11 *
11 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
@@ -24,6 +25,19 @@
24 * 25 *
25 * 26 *
26 * Notes: 27 * Notes:
28 * - PLT stub handling
29 * On 32bit (and sometimes 64bit) and with big kernel modules like xfs or
30 * ipv6 the relocation types R_PARISC_PCREL17F and R_PARISC_PCREL22F may
31 * fail to reach their PLT stub if we only create one big stub array for
32 * all sections at the beginning of the core or init section.
33 * Instead we now insert individual PLT stub entries directly in front of
34 * of the code sections where the stubs are actually called.
35 * This reduces the distance between the PCREL location and the stub entry
36 * so that the relocations can be fulfilled.
37 * While calculating the final layout of the kernel module in memory, the
38 * kernel module loader calls arch_mod_section_prepend() to request the
39 * to be reserved amount of memory in front of each individual section.
40 *
27 * - SEGREL32 handling 41 * - SEGREL32 handling
28 * We are not doing SEGREL32 handling correctly. According to the ABI, we 42 * We are not doing SEGREL32 handling correctly. According to the ABI, we
29 * should do a value offset, like this: 43 * should do a value offset, like this:
@@ -58,9 +72,13 @@
58#define DEBUGP(fmt...) 72#define DEBUGP(fmt...)
59#endif 73#endif
60 74
75#define RELOC_REACHABLE(val, bits) \
76 (( ( !((val) & (1<<((bits)-1))) && ((val)>>(bits)) != 0 ) || \
77 ( ((val) & (1<<((bits)-1))) && ((val)>>(bits)) != (((__typeof__(val))(~0))>>((bits)+2)))) ? \
78 0 : 1)
79
61#define CHECK_RELOC(val, bits) \ 80#define CHECK_RELOC(val, bits) \
62 if ( ( !((val) & (1<<((bits)-1))) && ((val)>>(bits)) != 0 ) || \ 81 if (!RELOC_REACHABLE(val, bits)) { \
63 ( ((val) & (1<<((bits)-1))) && ((val)>>(bits)) != (((__typeof__(val))(~0))>>((bits)+2)))) { \
64 printk(KERN_ERR "module %s relocation of symbol %s is out of range (0x%lx in %d bits)\n", \ 82 printk(KERN_ERR "module %s relocation of symbol %s is out of range (0x%lx in %d bits)\n", \
65 me->name, strtab + sym->st_name, (unsigned long)val, bits); \ 83 me->name, strtab + sym->st_name, (unsigned long)val, bits); \
66 return -ENOEXEC; \ 84 return -ENOEXEC; \
@@ -92,13 +110,6 @@ static inline int in_local(struct module *me, void *loc)
92 return in_init(me, loc) || in_core(me, loc); 110 return in_init(me, loc) || in_core(me, loc);
93} 111}
94 112
95static inline int in_local_section(struct module *me, void *loc, void *dot)
96{
97 return (in_init(me, loc) && in_init(me, dot)) ||
98 (in_core(me, loc) && in_core(me, dot));
99}
100
101
102#ifndef CONFIG_64BIT 113#ifndef CONFIG_64BIT
103struct got_entry { 114struct got_entry {
104 Elf32_Addr addr; 115 Elf32_Addr addr;
@@ -258,23 +269,42 @@ static inline unsigned long count_stubs(const Elf_Rela *rela, unsigned long n)
258/* Free memory returned from module_alloc */ 269/* Free memory returned from module_alloc */
259void module_free(struct module *mod, void *module_region) 270void module_free(struct module *mod, void *module_region)
260{ 271{
272 kfree(mod->arch.section);
273 mod->arch.section = NULL;
274
261 vfree(module_region); 275 vfree(module_region);
262 /* FIXME: If module_region == mod->init_region, trim exception 276 /* FIXME: If module_region == mod->init_region, trim exception
263 table entries. */ 277 table entries. */
264} 278}
265 279
280/* Additional bytes needed in front of individual sections */
281unsigned int arch_mod_section_prepend(struct module *mod,
282 unsigned int section)
283{
284 /* size needed for all stubs of this section (including
285 * one additional for correct alignment of the stubs) */
286 return (mod->arch.section[section].stub_entries + 1)
287 * sizeof(struct stub_entry);
288}
289
266#define CONST 290#define CONST
267int module_frob_arch_sections(CONST Elf_Ehdr *hdr, 291int module_frob_arch_sections(CONST Elf_Ehdr *hdr,
268 CONST Elf_Shdr *sechdrs, 292 CONST Elf_Shdr *sechdrs,
269 CONST char *secstrings, 293 CONST char *secstrings,
270 struct module *me) 294 struct module *me)
271{ 295{
272 unsigned long gots = 0, fdescs = 0, stubs = 0, init_stubs = 0; 296 unsigned long gots = 0, fdescs = 0, len;
273 unsigned int i; 297 unsigned int i;
274 298
299 len = hdr->e_shnum * sizeof(me->arch.section[0]);
300 me->arch.section = kzalloc(len, GFP_KERNEL);
301 if (!me->arch.section)
302 return -ENOMEM;
303
275 for (i = 1; i < hdr->e_shnum; i++) { 304 for (i = 1; i < hdr->e_shnum; i++) {
276 const Elf_Rela *rels = (void *)hdr + sechdrs[i].sh_offset; 305 const Elf_Rela *rels = (void *)sechdrs[i].sh_addr;
277 unsigned long nrels = sechdrs[i].sh_size / sizeof(*rels); 306 unsigned long nrels = sechdrs[i].sh_size / sizeof(*rels);
307 unsigned int count, s;
278 308
279 if (strncmp(secstrings + sechdrs[i].sh_name, 309 if (strncmp(secstrings + sechdrs[i].sh_name,
280 ".PARISC.unwind", 14) == 0) 310 ".PARISC.unwind", 14) == 0)
@@ -290,11 +320,23 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr,
290 */ 320 */
291 gots += count_gots(rels, nrels); 321 gots += count_gots(rels, nrels);
292 fdescs += count_fdescs(rels, nrels); 322 fdescs += count_fdescs(rels, nrels);
293 if(strncmp(secstrings + sechdrs[i].sh_name, 323
294 ".rela.init", 10) == 0) 324 /* XXX: By sorting the relocs and finding duplicate entries
295 init_stubs += count_stubs(rels, nrels); 325 * we could reduce the number of necessary stubs and save
296 else 326 * some memory. */
297 stubs += count_stubs(rels, nrels); 327 count = count_stubs(rels, nrels);
328 if (!count)
329 continue;
330
331 /* so we need relocation stubs. reserve necessary memory. */
332 /* sh_info gives the section for which we need to add stubs. */
333 s = sechdrs[i].sh_info;
334
335 /* each code section should only have one relocation section */
336 WARN_ON(me->arch.section[s].stub_entries);
337
338 /* store number of stubs we need for this section */
339 me->arch.section[s].stub_entries += count;
298 } 340 }
299 341
300 /* align things a bit */ 342 /* align things a bit */
@@ -306,18 +348,8 @@ int module_frob_arch_sections(CONST Elf_Ehdr *hdr,
306 me->arch.fdesc_offset = me->core_size; 348 me->arch.fdesc_offset = me->core_size;
307 me->core_size += fdescs * sizeof(Elf_Fdesc); 349 me->core_size += fdescs * sizeof(Elf_Fdesc);
308 350
309 me->core_size = ALIGN(me->core_size, 16);
310 me->arch.stub_offset = me->core_size;
311 me->core_size += stubs * sizeof(struct stub_entry);
312
313 me->init_size = ALIGN(me->init_size, 16);
314 me->arch.init_stub_offset = me->init_size;
315 me->init_size += init_stubs * sizeof(struct stub_entry);
316
317 me->arch.got_max = gots; 351 me->arch.got_max = gots;
318 me->arch.fdesc_max = fdescs; 352 me->arch.fdesc_max = fdescs;
319 me->arch.stub_max = stubs;
320 me->arch.init_stub_max = init_stubs;
321 353
322 return 0; 354 return 0;
323} 355}
@@ -380,23 +412,27 @@ enum elf_stub_type {
380}; 412};
381 413
382static Elf_Addr get_stub(struct module *me, unsigned long value, long addend, 414static Elf_Addr get_stub(struct module *me, unsigned long value, long addend,
383 enum elf_stub_type stub_type, int init_section) 415 enum elf_stub_type stub_type, Elf_Addr loc0, unsigned int targetsec)
384{ 416{
385 unsigned long i;
386 struct stub_entry *stub; 417 struct stub_entry *stub;
387 418
388 if(init_section) { 419 /* initialize stub_offset to point in front of the section */
389 i = me->arch.init_stub_count++; 420 if (!me->arch.section[targetsec].stub_offset) {
390 BUG_ON(me->arch.init_stub_count > me->arch.init_stub_max); 421 loc0 -= (me->arch.section[targetsec].stub_entries + 1) *
391 stub = me->module_init + me->arch.init_stub_offset + 422 sizeof(struct stub_entry);
392 i * sizeof(struct stub_entry); 423 /* get correct alignment for the stubs */
393 } else { 424 loc0 = ALIGN(loc0, sizeof(struct stub_entry));
394 i = me->arch.stub_count++; 425 me->arch.section[targetsec].stub_offset = loc0;
395 BUG_ON(me->arch.stub_count > me->arch.stub_max);
396 stub = me->module_core + me->arch.stub_offset +
397 i * sizeof(struct stub_entry);
398 } 426 }
399 427
428 /* get address of stub entry */
429 stub = (void *) me->arch.section[targetsec].stub_offset;
430 me->arch.section[targetsec].stub_offset += sizeof(struct stub_entry);
431
432 /* do not write outside available stub area */
433 BUG_ON(0 == me->arch.section[targetsec].stub_entries--);
434
435
400#ifndef CONFIG_64BIT 436#ifndef CONFIG_64BIT
401/* for 32-bit the stub looks like this: 437/* for 32-bit the stub looks like this:
402 * ldil L'XXX,%r1 438 * ldil L'XXX,%r1
@@ -489,15 +525,19 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
489 Elf32_Addr val; 525 Elf32_Addr val;
490 Elf32_Sword addend; 526 Elf32_Sword addend;
491 Elf32_Addr dot; 527 Elf32_Addr dot;
528 Elf_Addr loc0;
529 unsigned int targetsec = sechdrs[relsec].sh_info;
492 //unsigned long dp = (unsigned long)$global$; 530 //unsigned long dp = (unsigned long)$global$;
493 register unsigned long dp asm ("r27"); 531 register unsigned long dp asm ("r27");
494 532
495 DEBUGP("Applying relocate section %u to %u\n", relsec, 533 DEBUGP("Applying relocate section %u to %u\n", relsec,
496 sechdrs[relsec].sh_info); 534 targetsec);
497 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { 535 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
498 /* This is where to make the change */ 536 /* This is where to make the change */
499 loc = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr 537 loc = (void *)sechdrs[targetsec].sh_addr
500 + rel[i].r_offset; 538 + rel[i].r_offset;
539 /* This is the start of the target section */
540 loc0 = sechdrs[targetsec].sh_addr;
501 /* This is the symbol it is referring to */ 541 /* This is the symbol it is referring to */
502 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr 542 sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
503 + ELF32_R_SYM(rel[i].r_info); 543 + ELF32_R_SYM(rel[i].r_info);
@@ -569,19 +609,32 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
569 break; 609 break;
570 case R_PARISC_PCREL17F: 610 case R_PARISC_PCREL17F:
571 /* 17-bit PC relative address */ 611 /* 17-bit PC relative address */
572 val = get_stub(me, val, addend, ELF_STUB_GOT, in_init(me, loc)); 612 /* calculate direct call offset */
613 val += addend;
573 val = (val - dot - 8)/4; 614 val = (val - dot - 8)/4;
574 CHECK_RELOC(val, 17) 615 if (!RELOC_REACHABLE(val, 17)) {
616 /* direct distance too far, create
617 * stub entry instead */
618 val = get_stub(me, sym->st_value, addend,
619 ELF_STUB_DIRECT, loc0, targetsec);
620 val = (val - dot - 8)/4;
621 CHECK_RELOC(val, 17);
622 }
575 *loc = (*loc & ~0x1f1ffd) | reassemble_17(val); 623 *loc = (*loc & ~0x1f1ffd) | reassemble_17(val);
576 break; 624 break;
577 case R_PARISC_PCREL22F: 625 case R_PARISC_PCREL22F:
578 /* 22-bit PC relative address; only defined for pa20 */ 626 /* 22-bit PC relative address; only defined for pa20 */
579 val = get_stub(me, val, addend, ELF_STUB_GOT, in_init(me, loc)); 627 /* calculate direct call offset */
580 DEBUGP("STUB FOR %s loc %lx+%lx at %lx\n", 628 val += addend;
581 strtab + sym->st_name, (unsigned long)loc, addend,
582 val)
583 val = (val - dot - 8)/4; 629 val = (val - dot - 8)/4;
584 CHECK_RELOC(val, 22); 630 if (!RELOC_REACHABLE(val, 22)) {
631 /* direct distance too far, create
632 * stub entry instead */
633 val = get_stub(me, sym->st_value, addend,
634 ELF_STUB_DIRECT, loc0, targetsec);
635 val = (val - dot - 8)/4;
636 CHECK_RELOC(val, 22);
637 }
585 *loc = (*loc & ~0x3ff1ffd) | reassemble_22(val); 638 *loc = (*loc & ~0x3ff1ffd) | reassemble_22(val);
586 break; 639 break;
587 640
@@ -610,13 +663,17 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
610 Elf64_Addr val; 663 Elf64_Addr val;
611 Elf64_Sxword addend; 664 Elf64_Sxword addend;
612 Elf64_Addr dot; 665 Elf64_Addr dot;
666 Elf_Addr loc0;
667 unsigned int targetsec = sechdrs[relsec].sh_info;
613 668
614 DEBUGP("Applying relocate section %u to %u\n", relsec, 669 DEBUGP("Applying relocate section %u to %u\n", relsec,
615 sechdrs[relsec].sh_info); 670 targetsec);
616 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) { 671 for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
617 /* This is where to make the change */ 672 /* This is where to make the change */
618 loc = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr 673 loc = (void *)sechdrs[targetsec].sh_addr
619 + rel[i].r_offset; 674 + rel[i].r_offset;
675 /* This is the start of the target section */
676 loc0 = sechdrs[targetsec].sh_addr;
620 /* This is the symbol it is referring to */ 677 /* This is the symbol it is referring to */
621 sym = (Elf64_Sym *)sechdrs[symindex].sh_addr 678 sym = (Elf64_Sym *)sechdrs[symindex].sh_addr
622 + ELF64_R_SYM(rel[i].r_info); 679 + ELF64_R_SYM(rel[i].r_info);
@@ -672,42 +729,40 @@ int apply_relocate_add(Elf_Shdr *sechdrs,
672 DEBUGP("PCREL22F Symbol %s loc %p val %lx\n", 729 DEBUGP("PCREL22F Symbol %s loc %p val %lx\n",
673 strtab + sym->st_name, 730 strtab + sym->st_name,
674 loc, val); 731 loc, val);
732 val += addend;
675 /* can we reach it locally? */ 733 /* can we reach it locally? */
676 if(!in_local_section(me, (void *)val, (void *)dot)) { 734 if (in_local(me, (void *)val)) {
677 735 /* this is the case where the symbol is local
678 if (in_local(me, (void *)val)) 736 * to the module, but in a different section,
679 /* this is the case where the 737 * so stub the jump in case it's more than 22
680 * symbol is local to the 738 * bits away */
681 * module, but in a different 739 val = (val - dot - 8)/4;
682 * section, so stub the jump 740 if (!RELOC_REACHABLE(val, 22)) {
683 * in case it's more than 22 741 /* direct distance too far, create
684 * bits away */ 742 * stub entry instead */
685 val = get_stub(me, val, addend, ELF_STUB_DIRECT, 743 val = get_stub(me, sym->st_value,
686 in_init(me, loc)); 744 addend, ELF_STUB_DIRECT,
687 else if (strncmp(strtab + sym->st_name, "$$", 2) 745 loc0, targetsec);
746 } else {
747 /* Ok, we can reach it directly. */
748 val = sym->st_value;
749 val += addend;
750 }
751 } else {
752 val = sym->st_value;
753 if (strncmp(strtab + sym->st_name, "$$", 2)
688 == 0) 754 == 0)
689 val = get_stub(me, val, addend, ELF_STUB_MILLI, 755 val = get_stub(me, val, addend, ELF_STUB_MILLI,
690 in_init(me, loc)); 756 loc0, targetsec);
691 else 757 else
692 val = get_stub(me, val, addend, ELF_STUB_GOT, 758 val = get_stub(me, val, addend, ELF_STUB_GOT,
693 in_init(me, loc)); 759 loc0, targetsec);
694 } 760 }
695 DEBUGP("STUB FOR %s loc %lx, val %lx+%lx at %lx\n", 761 DEBUGP("STUB FOR %s loc %lx, val %lx+%lx at %lx\n",
696 strtab + sym->st_name, loc, sym->st_value, 762 strtab + sym->st_name, loc, sym->st_value,
697 addend, val); 763 addend, val);
698 /* FIXME: local symbols work as long as the
699 * core and init pieces aren't separated too
700 * far. If this is ever broken, you will trip
701 * the check below. The way to fix it would
702 * be to generate local stubs to go between init
703 * and core */
704 if((Elf64_Sxword)(val - dot - 8) > 0x800000 -1 ||
705 (Elf64_Sxword)(val - dot - 8) < -0x800000) {
706 printk(KERN_ERR "Module %s, symbol %s is out of range for PCREL22F relocation\n",
707 me->name, strtab + sym->st_name);
708 return -ENOEXEC;
709 }
710 val = (val - dot - 8)/4; 764 val = (val - dot - 8)/4;
765 CHECK_RELOC(val, 22);
711 *loc = (*loc & ~0x3ff1ffd) | reassemble_22(val); 766 *loc = (*loc & ~0x3ff1ffd) | reassemble_22(val);
712 break; 767 break;
713 case R_PARISC_DIR64: 768 case R_PARISC_DIR64:
@@ -794,12 +849,8 @@ int module_finalize(const Elf_Ehdr *hdr,
794 addr = (u32 *)entry->addr; 849 addr = (u32 *)entry->addr;
795 printk("INSNS: %x %x %x %x\n", 850 printk("INSNS: %x %x %x %x\n",
796 addr[0], addr[1], addr[2], addr[3]); 851 addr[0], addr[1], addr[2], addr[3]);
797 printk("stubs used %ld, stubs max %ld\n" 852 printk("got entries used %ld, gots max %ld\n"
798 "init_stubs used %ld, init stubs max %ld\n"
799 "got entries used %ld, gots max %ld\n"
800 "fdescs used %ld, fdescs max %ld\n", 853 "fdescs used %ld, fdescs max %ld\n",
801 me->arch.stub_count, me->arch.stub_max,
802 me->arch.init_stub_count, me->arch.init_stub_max,
803 me->arch.got_count, me->arch.got_max, 854 me->arch.got_count, me->arch.got_max,
804 me->arch.fdesc_count, me->arch.fdesc_max); 855 me->arch.fdesc_count, me->arch.fdesc_max);
805#endif 856#endif
@@ -829,7 +880,10 @@ int module_finalize(const Elf_Ehdr *hdr,
829 me->name, me->arch.got_count, MAX_GOTS); 880 me->name, me->arch.got_count, MAX_GOTS);
830 return -EINVAL; 881 return -EINVAL;
831 } 882 }
832 883
884 kfree(me->arch.section);
885 me->arch.section = NULL;
886
833 /* no symbol table */ 887 /* no symbol table */
834 if(symhdr == NULL) 888 if(symhdr == NULL)
835 return 0; 889 return 0;
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index ccb68090781e..1ff366cb9685 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -52,7 +52,7 @@
52#include <linux/tty.h> 52#include <linux/tty.h>
53#include <asm/pdc.h> /* for iodc_call() proto and friends */ 53#include <asm/pdc.h> /* for iodc_call() proto and friends */
54 54
55static spinlock_t pdc_console_lock = SPIN_LOCK_UNLOCKED; 55static DEFINE_SPINLOCK(pdc_console_lock);
56 56
57static void pdc_console_write(struct console *co, const char *s, unsigned count) 57static void pdc_console_write(struct console *co, const char *s, unsigned count)
58{ 58{
diff --git a/arch/parisc/kernel/perf.c b/arch/parisc/kernel/perf.c
index f696f57faa15..75099efb3bf3 100644
--- a/arch/parisc/kernel/perf.c
+++ b/arch/parisc/kernel/perf.c
@@ -541,9 +541,9 @@ static int __init perf_init(void)
541 spin_lock_init(&perf_lock); 541 spin_lock_init(&perf_lock);
542 542
543 /* TODO: this only lets us access the first cpu.. what to do for SMP? */ 543 /* TODO: this only lets us access the first cpu.. what to do for SMP? */
544 cpu_device = cpu_data[0].dev; 544 cpu_device = per_cpu(cpu_data, 0).dev;
545 printk("Performance monitoring counters enabled for %s\n", 545 printk("Performance monitoring counters enabled for %s\n",
546 cpu_data[0].dev->name); 546 per_cpu(cpu_data, 0).dev->name);
547 547
548 return 0; 548 return 0;
549} 549}
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index 370086fb8333..ecb609342feb 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -3,7 +3,7 @@
3 * Initial setup-routines for HP 9000 based hardware. 3 * Initial setup-routines for HP 9000 based hardware.
4 * 4 *
5 * Copyright (C) 1991, 1992, 1995 Linus Torvalds 5 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
6 * Modifications for PA-RISC (C) 1999 Helge Deller <deller@gmx.de> 6 * Modifications for PA-RISC (C) 1999-2008 Helge Deller <deller@gmx.de>
7 * Modifications copyright 1999 SuSE GmbH (Philipp Rumpf) 7 * Modifications copyright 1999 SuSE GmbH (Philipp Rumpf)
8 * Modifications copyright 2000 Martin K. Petersen <mkp@mkp.net> 8 * Modifications copyright 2000 Martin K. Petersen <mkp@mkp.net>
9 * Modifications copyright 2000 Philipp Rumpf <prumpf@tux.org> 9 * Modifications copyright 2000 Philipp Rumpf <prumpf@tux.org>
@@ -46,7 +46,7 @@
46struct system_cpuinfo_parisc boot_cpu_data __read_mostly; 46struct system_cpuinfo_parisc boot_cpu_data __read_mostly;
47EXPORT_SYMBOL(boot_cpu_data); 47EXPORT_SYMBOL(boot_cpu_data);
48 48
49struct cpuinfo_parisc cpu_data[NR_CPUS] __read_mostly; 49DEFINE_PER_CPU(struct cpuinfo_parisc, cpu_data);
50 50
51extern int update_cr16_clocksource(void); /* from time.c */ 51extern int update_cr16_clocksource(void); /* from time.c */
52 52
@@ -69,6 +69,23 @@ extern int update_cr16_clocksource(void); /* from time.c */
69*/ 69*/
70 70
71/** 71/**
72 * init_cpu_profiler - enable/setup per cpu profiling hooks.
73 * @cpunum: The processor instance.
74 *
75 * FIXME: doesn't do much yet...
76 */
77static void __cpuinit
78init_percpu_prof(unsigned long cpunum)
79{
80 struct cpuinfo_parisc *p;
81
82 p = &per_cpu(cpu_data, cpunum);
83 p->prof_counter = 1;
84 p->prof_multiplier = 1;
85}
86
87
88/**
72 * processor_probe - Determine if processor driver should claim this device. 89 * processor_probe - Determine if processor driver should claim this device.
73 * @dev: The device which has been found. 90 * @dev: The device which has been found.
74 * 91 *
@@ -147,7 +164,7 @@ static int __cpuinit processor_probe(struct parisc_device *dev)
147 } 164 }
148#endif 165#endif
149 166
150 p = &cpu_data[cpuid]; 167 p = &per_cpu(cpu_data, cpuid);
151 boot_cpu_data.cpu_count++; 168 boot_cpu_data.cpu_count++;
152 169
153 /* initialize counters - CPU 0 gets it_value set in time_init() */ 170 /* initialize counters - CPU 0 gets it_value set in time_init() */
@@ -162,12 +179,9 @@ static int __cpuinit processor_probe(struct parisc_device *dev)
162#ifdef CONFIG_SMP 179#ifdef CONFIG_SMP
163 /* 180 /*
164 ** FIXME: review if any other initialization is clobbered 181 ** FIXME: review if any other initialization is clobbered
165 ** for boot_cpu by the above memset(). 182 ** for boot_cpu by the above memset().
166 */ 183 */
167 184 init_percpu_prof(cpuid);
168 /* stolen from init_percpu_prof() */
169 cpu_data[cpuid].prof_counter = 1;
170 cpu_data[cpuid].prof_multiplier = 1;
171#endif 185#endif
172 186
173 /* 187 /*
@@ -261,19 +275,6 @@ void __init collect_boot_cpu_data(void)
261} 275}
262 276
263 277
264/**
265 * init_cpu_profiler - enable/setup per cpu profiling hooks.
266 * @cpunum: The processor instance.
267 *
268 * FIXME: doesn't do much yet...
269 */
270static inline void __init
271init_percpu_prof(int cpunum)
272{
273 cpu_data[cpunum].prof_counter = 1;
274 cpu_data[cpunum].prof_multiplier = 1;
275}
276
277 278
278/** 279/**
279 * init_per_cpu - Handle individual processor initializations. 280 * init_per_cpu - Handle individual processor initializations.
@@ -293,7 +294,7 @@ init_percpu_prof(int cpunum)
293 * 294 *
294 * o Enable CPU profiling hooks. 295 * o Enable CPU profiling hooks.
295 */ 296 */
296int __init init_per_cpu(int cpunum) 297int __cpuinit init_per_cpu(int cpunum)
297{ 298{
298 int ret; 299 int ret;
299 struct pdc_coproc_cfg coproc_cfg; 300 struct pdc_coproc_cfg coproc_cfg;
@@ -307,8 +308,8 @@ int __init init_per_cpu(int cpunum)
307 /* FWIW, FP rev/model is a more accurate way to determine 308 /* FWIW, FP rev/model is a more accurate way to determine
308 ** CPU type. CPU rev/model has some ambiguous cases. 309 ** CPU type. CPU rev/model has some ambiguous cases.
309 */ 310 */
310 cpu_data[cpunum].fp_rev = coproc_cfg.revision; 311 per_cpu(cpu_data, cpunum).fp_rev = coproc_cfg.revision;
311 cpu_data[cpunum].fp_model = coproc_cfg.model; 312 per_cpu(cpu_data, cpunum).fp_model = coproc_cfg.model;
312 313
313 printk(KERN_INFO "FP[%d] enabled: Rev %ld Model %ld\n", 314 printk(KERN_INFO "FP[%d] enabled: Rev %ld Model %ld\n",
314 cpunum, coproc_cfg.revision, coproc_cfg.model); 315 cpunum, coproc_cfg.revision, coproc_cfg.model);
@@ -344,16 +345,17 @@ int __init init_per_cpu(int cpunum)
344int 345int
345show_cpuinfo (struct seq_file *m, void *v) 346show_cpuinfo (struct seq_file *m, void *v)
346{ 347{
347 int n; 348 unsigned long cpu;
348 349
349 for(n=0; n<boot_cpu_data.cpu_count; n++) { 350 for_each_online_cpu(cpu) {
351 const struct cpuinfo_parisc *cpuinfo = &per_cpu(cpu_data, cpu);
350#ifdef CONFIG_SMP 352#ifdef CONFIG_SMP
351 if (0 == cpu_data[n].hpa) 353 if (0 == cpuinfo->hpa)
352 continue; 354 continue;
353#endif 355#endif
354 seq_printf(m, "processor\t: %d\n" 356 seq_printf(m, "processor\t: %lu\n"
355 "cpu family\t: PA-RISC %s\n", 357 "cpu family\t: PA-RISC %s\n",
356 n, boot_cpu_data.family_name); 358 cpu, boot_cpu_data.family_name);
357 359
358 seq_printf(m, "cpu\t\t: %s\n", boot_cpu_data.cpu_name ); 360 seq_printf(m, "cpu\t\t: %s\n", boot_cpu_data.cpu_name );
359 361
@@ -365,8 +367,8 @@ show_cpuinfo (struct seq_file *m, void *v)
365 seq_printf(m, "model\t\t: %s\n" 367 seq_printf(m, "model\t\t: %s\n"
366 "model name\t: %s\n", 368 "model name\t: %s\n",
367 boot_cpu_data.pdc.sys_model_name, 369 boot_cpu_data.pdc.sys_model_name,
368 cpu_data[n].dev ? 370 cpuinfo->dev ?
369 cpu_data[n].dev->name : "Unknown" ); 371 cpuinfo->dev->name : "Unknown");
370 372
371 seq_printf(m, "hversion\t: 0x%08x\n" 373 seq_printf(m, "hversion\t: 0x%08x\n"
372 "sversion\t: 0x%08x\n", 374 "sversion\t: 0x%08x\n",
@@ -377,8 +379,8 @@ show_cpuinfo (struct seq_file *m, void *v)
377 show_cache_info(m); 379 show_cache_info(m);
378 380
379 seq_printf(m, "bogomips\t: %lu.%02lu\n", 381 seq_printf(m, "bogomips\t: %lu.%02lu\n",
380 cpu_data[n].loops_per_jiffy / (500000 / HZ), 382 cpuinfo->loops_per_jiffy / (500000 / HZ),
381 (cpu_data[n].loops_per_jiffy / (5000 / HZ)) % 100); 383 (cpuinfo->loops_per_jiffy / (5000 / HZ)) % 100);
382 384
383 seq_printf(m, "software id\t: %ld\n\n", 385 seq_printf(m, "software id\t: %ld\n\n",
384 boot_cpu_data.pdc.model.sw_id); 386 boot_cpu_data.pdc.model.sw_id);
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index 7d27853ff8c8..82131ca8e05c 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -58,11 +58,6 @@ int parisc_bus_is_phys __read_mostly = 1; /* Assume no IOMMU is present */
58EXPORT_SYMBOL(parisc_bus_is_phys); 58EXPORT_SYMBOL(parisc_bus_is_phys);
59#endif 59#endif
60 60
61/* This sets the vmerge boundary and size, it's here because it has to
62 * be available on all platforms (zero means no-virtual merging) */
63unsigned long parisc_vmerge_boundary = 0;
64unsigned long parisc_vmerge_max_size = 0;
65
66void __init setup_cmdline(char **cmdline_p) 61void __init setup_cmdline(char **cmdline_p)
67{ 62{
68 extern unsigned int boot_args[]; 63 extern unsigned int boot_args[];
@@ -321,7 +316,7 @@ static int __init parisc_init(void)
321 316
322 processor_init(); 317 processor_init();
323 printk(KERN_INFO "CPU(s): %d x %s at %d.%06d MHz\n", 318 printk(KERN_INFO "CPU(s): %d x %s at %d.%06d MHz\n",
324 boot_cpu_data.cpu_count, 319 num_present_cpus(),
325 boot_cpu_data.cpu_name, 320 boot_cpu_data.cpu_name,
326 boot_cpu_data.cpu_hz / 1000000, 321 boot_cpu_data.cpu_hz / 1000000,
327 boot_cpu_data.cpu_hz % 1000000 ); 322 boot_cpu_data.cpu_hz % 1000000 );
@@ -387,8 +382,8 @@ void start_parisc(void)
387 if (ret >= 0 && coproc_cfg.ccr_functional) { 382 if (ret >= 0 && coproc_cfg.ccr_functional) {
388 mtctl(coproc_cfg.ccr_functional, 10); 383 mtctl(coproc_cfg.ccr_functional, 10);
389 384
390 cpu_data[cpunum].fp_rev = coproc_cfg.revision; 385 per_cpu(cpu_data, cpunum).fp_rev = coproc_cfg.revision;
391 cpu_data[cpunum].fp_model = coproc_cfg.model; 386 per_cpu(cpu_data, cpunum).fp_model = coproc_cfg.model;
392 387
393 asm volatile ("fstd %fr0,8(%sp)"); 388 asm volatile ("fstd %fr0,8(%sp)");
394 } else { 389 } else {
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index d47f3975c9c6..9995d7ed5819 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -56,31 +56,17 @@ static int smp_debug_lvl = 0;
56 if (lvl >= smp_debug_lvl) \ 56 if (lvl >= smp_debug_lvl) \
57 printk(printargs); 57 printk(printargs);
58#else 58#else
59#define smp_debug(lvl, ...) 59#define smp_debug(lvl, ...) do { } while(0)
60#endif /* DEBUG_SMP */ 60#endif /* DEBUG_SMP */
61 61
62DEFINE_SPINLOCK(smp_lock); 62DEFINE_SPINLOCK(smp_lock);
63 63
64volatile struct task_struct *smp_init_current_idle_task; 64volatile struct task_struct *smp_init_current_idle_task;
65 65
66static volatile int cpu_now_booting __read_mostly = 0; /* track which CPU is booting */ 66/* track which CPU is booting */
67static volatile int cpu_now_booting __cpuinitdata;
67 68
68static int parisc_max_cpus __read_mostly = 1; 69static int parisc_max_cpus __cpuinitdata = 1;
69
70/* online cpus are ones that we've managed to bring up completely
71 * possible cpus are all valid cpu
72 * present cpus are all detected cpu
73 *
74 * On startup we bring up the "possible" cpus. Since we discover
75 * CPUs later, we add them as hotplug, so the possible cpu mask is
76 * empty in the beginning.
77 */
78
79cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE; /* Bitmap of online CPUs */
80cpumask_t cpu_possible_map __read_mostly = CPU_MASK_ALL; /* Bitmap of Present CPUs */
81
82EXPORT_SYMBOL(cpu_online_map);
83EXPORT_SYMBOL(cpu_possible_map);
84 70
85DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED; 71DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED;
86 72
@@ -138,7 +124,7 @@ irqreturn_t
138ipi_interrupt(int irq, void *dev_id) 124ipi_interrupt(int irq, void *dev_id)
139{ 125{
140 int this_cpu = smp_processor_id(); 126 int this_cpu = smp_processor_id();
141 struct cpuinfo_parisc *p = &cpu_data[this_cpu]; 127 struct cpuinfo_parisc *p = &per_cpu(cpu_data, this_cpu);
142 unsigned long ops; 128 unsigned long ops;
143 unsigned long flags; 129 unsigned long flags;
144 130
@@ -217,13 +203,13 @@ ipi_interrupt(int irq, void *dev_id)
217static inline void 203static inline void
218ipi_send(int cpu, enum ipi_message_type op) 204ipi_send(int cpu, enum ipi_message_type op)
219{ 205{
220 struct cpuinfo_parisc *p = &cpu_data[cpu]; 206 struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpu);
221 spinlock_t *lock = &per_cpu(ipi_lock, cpu); 207 spinlock_t *lock = &per_cpu(ipi_lock, cpu);
222 unsigned long flags; 208 unsigned long flags;
223 209
224 spin_lock_irqsave(lock, flags); 210 spin_lock_irqsave(lock, flags);
225 p->pending_ipi |= 1 << op; 211 p->pending_ipi |= 1 << op;
226 gsc_writel(IPI_IRQ - CPU_IRQ_BASE, cpu_data[cpu].hpa); 212 gsc_writel(IPI_IRQ - CPU_IRQ_BASE, p->hpa);
227 spin_unlock_irqrestore(lock, flags); 213 spin_unlock_irqrestore(lock, flags);
228} 214}
229 215
@@ -239,10 +225,7 @@ send_IPI_mask(cpumask_t mask, enum ipi_message_type op)
239static inline void 225static inline void
240send_IPI_single(int dest_cpu, enum ipi_message_type op) 226send_IPI_single(int dest_cpu, enum ipi_message_type op)
241{ 227{
242 if (dest_cpu == NO_PROC_ID) { 228 BUG_ON(dest_cpu == NO_PROC_ID);
243 BUG();
244 return;
245 }
246 229
247 ipi_send(dest_cpu, op); 230 ipi_send(dest_cpu, op);
248} 231}
@@ -324,8 +307,7 @@ smp_cpu_init(int cpunum)
324 /* Initialise the idle task for this CPU */ 307 /* Initialise the idle task for this CPU */
325 atomic_inc(&init_mm.mm_count); 308 atomic_inc(&init_mm.mm_count);
326 current->active_mm = &init_mm; 309 current->active_mm = &init_mm;
327 if(current->mm) 310 BUG_ON(current->mm);
328 BUG();
329 enter_lazy_tlb(&init_mm, current); 311 enter_lazy_tlb(&init_mm, current);
330 312
331 init_IRQ(); /* make sure no IRQs are enabled or pending */ 313 init_IRQ(); /* make sure no IRQs are enabled or pending */
@@ -360,6 +342,7 @@ void __init smp_callin(void)
360 */ 342 */
361int __cpuinit smp_boot_one_cpu(int cpuid) 343int __cpuinit smp_boot_one_cpu(int cpuid)
362{ 344{
345 const struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpuid);
363 struct task_struct *idle; 346 struct task_struct *idle;
364 long timeout; 347 long timeout;
365 348
@@ -391,7 +374,7 @@ int __cpuinit smp_boot_one_cpu(int cpuid)
391 smp_init_current_idle_task = idle ; 374 smp_init_current_idle_task = idle ;
392 mb(); 375 mb();
393 376
394 printk("Releasing cpu %d now, hpa=%lx\n", cpuid, cpu_data[cpuid].hpa); 377 printk(KERN_INFO "Releasing cpu %d now, hpa=%lx\n", cpuid, p->hpa);
395 378
396 /* 379 /*
397 ** This gets PDC to release the CPU from a very tight loop. 380 ** This gets PDC to release the CPU from a very tight loop.
@@ -402,7 +385,7 @@ int __cpuinit smp_boot_one_cpu(int cpuid)
402 ** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the 385 ** EIR{0}). MEM_RENDEZ is valid only when it is nonzero and the
403 ** contents of memory are valid." 386 ** contents of memory are valid."
404 */ 387 */
405 gsc_writel(TIMER_IRQ - CPU_IRQ_BASE, cpu_data[cpuid].hpa); 388 gsc_writel(TIMER_IRQ - CPU_IRQ_BASE, p->hpa);
406 mb(); 389 mb();
407 390
408 /* 391 /*
@@ -434,12 +417,12 @@ alive:
434 return 0; 417 return 0;
435} 418}
436 419
437void __devinit smp_prepare_boot_cpu(void) 420void __init smp_prepare_boot_cpu(void)
438{ 421{
439 int bootstrap_processor=cpu_data[0].cpuid; /* CPU ID of BSP */ 422 int bootstrap_processor = per_cpu(cpu_data, 0).cpuid;
440 423
441 /* Setup BSP mappings */ 424 /* Setup BSP mappings */
442 printk("SMP: bootstrap CPU ID is %d\n",bootstrap_processor); 425 printk(KERN_INFO "SMP: bootstrap CPU ID is %d\n", bootstrap_processor);
443 426
444 cpu_set(bootstrap_processor, cpu_online_map); 427 cpu_set(bootstrap_processor, cpu_online_map);
445 cpu_set(bootstrap_processor, cpu_present_map); 428 cpu_set(bootstrap_processor, cpu_present_map);
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 4d09203bc693..9d46c43a4152 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -60,7 +60,7 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
60 unsigned long cycles_elapsed, ticks_elapsed; 60 unsigned long cycles_elapsed, ticks_elapsed;
61 unsigned long cycles_remainder; 61 unsigned long cycles_remainder;
62 unsigned int cpu = smp_processor_id(); 62 unsigned int cpu = smp_processor_id();
63 struct cpuinfo_parisc *cpuinfo = &cpu_data[cpu]; 63 struct cpuinfo_parisc *cpuinfo = &per_cpu(cpu_data, cpu);
64 64
65 /* gcc can optimize for "read-only" case with a local clocktick */ 65 /* gcc can optimize for "read-only" case with a local clocktick */
66 unsigned long cpt = clocktick; 66 unsigned long cpt = clocktick;
@@ -213,7 +213,7 @@ void __init start_cpu_itimer(void)
213 213
214 mtctl(next_tick, 16); /* kick off Interval Timer (CR16) */ 214 mtctl(next_tick, 16); /* kick off Interval Timer (CR16) */
215 215
216 cpu_data[cpu].it_value = next_tick; 216 per_cpu(cpu_data, cpu).it_value = next_tick;
217} 217}
218 218
219struct platform_device rtc_parisc_dev = { 219struct platform_device rtc_parisc_dev = {
diff --git a/arch/parisc/kernel/topology.c b/arch/parisc/kernel/topology.c
index d71cb018a21e..f5159381fdd6 100644
--- a/arch/parisc/kernel/topology.c
+++ b/arch/parisc/kernel/topology.c
@@ -22,14 +22,14 @@
22#include <linux/cpu.h> 22#include <linux/cpu.h>
23#include <linux/cache.h> 23#include <linux/cache.h>
24 24
25static struct cpu cpu_devices[NR_CPUS] __read_mostly; 25static DEFINE_PER_CPU(struct cpu, cpu_devices);
26 26
27static int __init topology_init(void) 27static int __init topology_init(void)
28{ 28{
29 int num; 29 int num;
30 30
31 for_each_present_cpu(num) { 31 for_each_present_cpu(num) {
32 register_cpu(&cpu_devices[num], num); 32 register_cpu(&per_cpu(cpu_devices, num), num);
33 } 33 }
34 return 0; 34 return 0;
35} 35}
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index 4c771cd580ec..ba658d2086f7 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -745,6 +745,10 @@ void handle_interruption(int code, struct pt_regs *regs)
745 /* Fall Through */ 745 /* Fall Through */
746 case 27: 746 case 27:
747 /* Data memory protection ID trap */ 747 /* Data memory protection ID trap */
748 if (code == 27 && !user_mode(regs) &&
749 fixup_exception(regs))
750 return;
751
748 die_if_kernel("Protection id trap", regs, code); 752 die_if_kernel("Protection id trap", regs, code);
749 si.si_code = SEGV_MAPERR; 753 si.si_code = SEGV_MAPERR;
750 si.si_signo = SIGSEGV; 754 si.si_signo = SIGSEGV;
@@ -821,8 +825,8 @@ void handle_interruption(int code, struct pt_regs *regs)
821 825
822int __init check_ivt(void *iva) 826int __init check_ivt(void *iva)
823{ 827{
828 extern u32 os_hpmc_size;
824 extern const u32 os_hpmc[]; 829 extern const u32 os_hpmc[];
825 extern const u32 os_hpmc_end[];
826 830
827 int i; 831 int i;
828 u32 check = 0; 832 u32 check = 0;
@@ -839,8 +843,7 @@ int __init check_ivt(void *iva)
839 *ivap++ = 0; 843 *ivap++ = 0;
840 844
841 /* Compute Checksum for HPMC handler */ 845 /* Compute Checksum for HPMC handler */
842 846 length = os_hpmc_size;
843 length = os_hpmc_end - os_hpmc;
844 ivap[7] = length; 847 ivap[7] = length;
845 848
846 hpmcp = (u32 *)os_hpmc; 849 hpmcp = (u32 *)os_hpmc;
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c
index 6773c582e457..69dad5a850a8 100644
--- a/arch/parisc/kernel/unwind.c
+++ b/arch/parisc/kernel/unwind.c
@@ -372,7 +372,7 @@ void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct
372 struct pt_regs *r = &t->thread.regs; 372 struct pt_regs *r = &t->thread.regs;
373 struct pt_regs *r2; 373 struct pt_regs *r2;
374 374
375 r2 = kmalloc(sizeof(struct pt_regs), GFP_KERNEL); 375 r2 = kmalloc(sizeof(struct pt_regs), GFP_ATOMIC);
376 if (!r2) 376 if (!r2)
377 return; 377 return;
378 *r2 = *r; 378 *r2 = *r;
diff --git a/arch/parisc/lib/iomap.c b/arch/parisc/lib/iomap.c
index 9abed07db7fc..5069e8b2ca71 100644
--- a/arch/parisc/lib/iomap.c
+++ b/arch/parisc/lib/iomap.c
@@ -261,7 +261,7 @@ static const struct iomap_ops iomem_ops = {
261 iomem_write32r, 261 iomem_write32r,
262}; 262};
263 263
264const struct iomap_ops *iomap_ops[8] = { 264static const struct iomap_ops *iomap_ops[8] = {
265 [0] = &ioport_ops, 265 [0] = &ioport_ops,
266 [7] = &iomem_ops 266 [7] = &iomem_ops
267}; 267};
diff --git a/arch/parisc/lib/memcpy.c b/arch/parisc/lib/memcpy.c
index 2d68431fc22e..bbda909c866e 100644
--- a/arch/parisc/lib/memcpy.c
+++ b/arch/parisc/lib/memcpy.c
@@ -275,7 +275,7 @@ handle_store_error:
275 275
276 276
277/* Returns 0 for success, otherwise, returns number of bytes not transferred. */ 277/* Returns 0 for success, otherwise, returns number of bytes not transferred. */
278unsigned long pa_memcpy(void *dstp, const void *srcp, unsigned long len) 278static unsigned long pa_memcpy(void *dstp, const void *srcp, unsigned long len)
279{ 279{
280 register unsigned long src, dst, t1, t2, t3; 280 register unsigned long src, dst, t1, t2, t3;
281 register unsigned char *pcs, *pcd; 281 register unsigned char *pcs, *pcd;
diff --git a/arch/parisc/mm/fault.c b/arch/parisc/mm/fault.c
index b2e3e9a8cece..92c7fa4ecc3f 100644
--- a/arch/parisc/mm/fault.c
+++ b/arch/parisc/mm/fault.c
@@ -139,13 +139,41 @@ parisc_acctyp(unsigned long code, unsigned int inst)
139 } 139 }
140#endif 140#endif
141 141
142int fixup_exception(struct pt_regs *regs)
143{
144 const struct exception_table_entry *fix;
145
146 fix = search_exception_tables(regs->iaoq[0]);
147 if (fix) {
148 struct exception_data *d;
149 d = &__get_cpu_var(exception_data);
150 d->fault_ip = regs->iaoq[0];
151 d->fault_space = regs->isr;
152 d->fault_addr = regs->ior;
153
154 regs->iaoq[0] = ((fix->fixup) & ~3);
155 /*
156 * NOTE: In some cases the faulting instruction
157 * may be in the delay slot of a branch. We
158 * don't want to take the branch, so we don't
159 * increment iaoq[1], instead we set it to be
160 * iaoq[0]+4, and clear the B bit in the PSW
161 */
162 regs->iaoq[1] = regs->iaoq[0] + 4;
163 regs->gr[0] &= ~PSW_B; /* IPSW in gr[0] */
164
165 return 1;
166 }
167
168 return 0;
169}
170
142void do_page_fault(struct pt_regs *regs, unsigned long code, 171void do_page_fault(struct pt_regs *regs, unsigned long code,
143 unsigned long address) 172 unsigned long address)
144{ 173{
145 struct vm_area_struct *vma, *prev_vma; 174 struct vm_area_struct *vma, *prev_vma;
146 struct task_struct *tsk = current; 175 struct task_struct *tsk = current;
147 struct mm_struct *mm = tsk->mm; 176 struct mm_struct *mm = tsk->mm;
148 const struct exception_table_entry *fix;
149 unsigned long acc_type; 177 unsigned long acc_type;
150 int fault; 178 int fault;
151 179
@@ -229,32 +257,8 @@ bad_area:
229 257
230no_context: 258no_context:
231 259
232 if (!user_mode(regs)) { 260 if (!user_mode(regs) && fixup_exception(regs)) {
233 fix = search_exception_tables(regs->iaoq[0]); 261 return;
234
235 if (fix) {
236 struct exception_data *d;
237
238 d = &__get_cpu_var(exception_data);
239 d->fault_ip = regs->iaoq[0];
240 d->fault_space = regs->isr;
241 d->fault_addr = regs->ior;
242
243 regs->iaoq[0] = ((fix->fixup) & ~3);
244
245 /*
246 * NOTE: In some cases the faulting instruction
247 * may be in the delay slot of a branch. We
248 * don't want to take the branch, so we don't
249 * increment iaoq[1], instead we set it to be
250 * iaoq[0]+4, and clear the B bit in the PSW
251 */
252
253 regs->iaoq[1] = regs->iaoq[0] + 4;
254 regs->gr[0] &= ~PSW_B; /* IPSW in gr[0] */
255
256 return;
257 }
258 } 262 }
259 263
260 parisc_terminate("Bad Address (null pointer deref?)", regs, code, address); 264 parisc_terminate("Bad Address (null pointer deref?)", regs, code, address);
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 79f25cef32df..84b861316ce7 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -108,6 +108,8 @@ config ARCH_NO_VIRT_TO_BUS
108config PPC 108config PPC
109 bool 109 bool
110 default y 110 default y
111 select HAVE_FTRACE_MCOUNT_RECORD
112 select HAVE_DYNAMIC_FTRACE
111 select HAVE_FUNCTION_TRACER 113 select HAVE_FUNCTION_TRACER
112 select ARCH_WANT_OPTIONAL_GPIOLIB 114 select ARCH_WANT_OPTIONAL_GPIOLIB
113 select HAVE_IDE 115 select HAVE_IDE
@@ -326,7 +328,8 @@ config KEXEC
326 328
327config CRASH_DUMP 329config CRASH_DUMP
328 bool "Build a kdump crash kernel" 330 bool "Build a kdump crash kernel"
329 depends on (PPC64 && RELOCATABLE) || 6xx 331 depends on PPC64 || 6xx
332 select RELOCATABLE if PPC64
330 help 333 help
331 Build a kernel suitable for use as a kdump capture kernel. 334 Build a kernel suitable for use as a kdump capture kernel.
332 The same kernel binary can be used as production kernel and dump 335 The same kernel binary can be used as production kernel and dump
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index f32829937aad..e84df338ea29 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -208,7 +208,7 @@ image-$(CONFIG_DEFAULT_UIMAGE) += uImage
208# 208#
209# Theses are default targets to build images which embed device tree blobs. 209# Theses are default targets to build images which embed device tree blobs.
210# They are only required on boards which do not have FDT support in firmware. 210# They are only required on boards which do not have FDT support in firmware.
211# Boards with newish u-boot firmare can use the uImage target above 211# Boards with newish u-boot firmware can use the uImage target above
212# 212#
213 213
214# Board ports in arch/powerpc/platform/40x/Kconfig 214# Board ports in arch/powerpc/platform/40x/Kconfig
@@ -356,7 +356,7 @@ $(obj)/zImage.initrd: $(addprefix $(obj)/, $(initrd-y))
356 @rm -f $@; ln $< $@ 356 @rm -f $@; ln $< $@
357 357
358install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y)) 358install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
359 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $< 359 sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^
360 360
361# anything not in $(targets) 361# anything not in $(targets)
362clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \ 362clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
diff --git a/arch/powerpc/boot/dts/gef_sbc610.dts b/arch/powerpc/boot/dts/gef_sbc610.dts
index 9708b3423bbd..e78c355c7bac 100644
--- a/arch/powerpc/boot/dts/gef_sbc610.dts
+++ b/arch/powerpc/boot/dts/gef_sbc610.dts
@@ -88,6 +88,21 @@
88 compatible = "gef,fpga-regs"; 88 compatible = "gef,fpga-regs";
89 reg = <0x4 0x0 0x40>; 89 reg = <0x4 0x0 0x40>;
90 }; 90 };
91
92 wdt@4,2000 {
93 compatible = "gef,fpga-wdt";
94 reg = <0x4 0x2000 0x8>;
95 interrupts = <0x1a 0x4>;
96 interrupt-parent = <&gef_pic>;
97 };
98 /* Second watchdog available, driver currently supports one.
99 wdt@4,2010 {
100 compatible = "gef,fpga-wdt";
101 reg = <0x4 0x2010 0x8>;
102 interrupts = <0x1b 0x4>;
103 interrupt-parent = <&gef_pic>;
104 };
105 */
91 gef_pic: pic@4,4000 { 106 gef_pic: pic@4,4000 {
92 #interrupt-cells = <1>; 107 #interrupt-cells = <1>;
93 interrupt-controller; 108 interrupt-controller;
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index 14534d04e4db..6e34f170fa62 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -69,8 +69,18 @@
69 }; 69 };
70 70
71 bcsr@1,0 { 71 bcsr@1,0 {
72 #address-cells = <1>;
73 #size-cells = <1>;
72 compatible = "fsl,mpc8360mds-bcsr"; 74 compatible = "fsl,mpc8360mds-bcsr";
73 reg = <1 0 0x8000>; 75 reg = <1 0 0x8000>;
76 ranges = <0 1 0 0x8000>;
77
78 bcsr13: gpio-controller@d {
79 #gpio-cells = <2>;
80 compatible = "fsl,mpc8360mds-bcsr-gpio";
81 reg = <0xd 1>;
82 gpio-controller;
83 };
74 }; 84 };
75 }; 85 };
76 86
@@ -195,10 +205,21 @@
195 }; 205 };
196 206
197 par_io@1400 { 207 par_io@1400 {
208 #address-cells = <1>;
209 #size-cells = <1>;
198 reg = <0x1400 0x100>; 210 reg = <0x1400 0x100>;
211 ranges = <0 0x1400 0x100>;
199 device_type = "par_io"; 212 device_type = "par_io";
200 num-ports = <7>; 213 num-ports = <7>;
201 214
215 qe_pio_b: gpio-controller@18 {
216 #gpio-cells = <2>;
217 compatible = "fsl,mpc8360-qe-pario-bank",
218 "fsl,mpc8323-qe-pario-bank";
219 reg = <0x18 0x18>;
220 gpio-controller;
221 };
222
202 pio1: ucc_pin@01 { 223 pio1: ucc_pin@01 {
203 pio-map = < 224 pio-map = <
204 /* port pin dir open_drain assignment has_irq */ 225 /* port pin dir open_drain assignment has_irq */
@@ -282,6 +303,15 @@
282 }; 303 };
283 }; 304 };
284 305
306 timer@440 {
307 compatible = "fsl,mpc8360-qe-gtm",
308 "fsl,qe-gtm", "fsl,gtm";
309 reg = <0x440 0x40>;
310 clock-frequency = <132000000>;
311 interrupts = <12 13 14 15>;
312 interrupt-parent = <&qeic>;
313 };
314
285 spi@4c0 { 315 spi@4c0 {
286 cell-index = <0>; 316 cell-index = <0>;
287 compatible = "fsl,spi"; 317 compatible = "fsl,spi";
@@ -301,11 +331,20 @@
301 }; 331 };
302 332
303 usb@6c0 { 333 usb@6c0 {
304 compatible = "qe_udc"; 334 compatible = "fsl,mpc8360-qe-usb",
335 "fsl,mpc8323-qe-usb";
305 reg = <0x6c0 0x40 0x8b00 0x100>; 336 reg = <0x6c0 0x40 0x8b00 0x100>;
306 interrupts = <11>; 337 interrupts = <11>;
307 interrupt-parent = <&qeic>; 338 interrupt-parent = <&qeic>;
308 mode = "slave"; 339 fsl,fullspeed-clock = "clk21";
340 fsl,lowspeed-clock = "brg9";
341 gpios = <&qe_pio_b 2 0 /* USBOE */
342 &qe_pio_b 3 0 /* USBTP */
343 &qe_pio_b 8 0 /* USBTN */
344 &qe_pio_b 9 0 /* USBRP */
345 &qe_pio_b 11 0 /* USBRN */
346 &bcsr13 5 0 /* SPEED */
347 &bcsr13 4 1>; /* POWER */
309 }; 348 };
310 349
311 enet0: ucc@2000 { 350 enet0: ucc@2000 {
diff --git a/arch/powerpc/boot/dts/mpc836x_rdk.dts b/arch/powerpc/boot/dts/mpc836x_rdk.dts
index decadf3d9e98..37b789510d68 100644
--- a/arch/powerpc/boot/dts/mpc836x_rdk.dts
+++ b/arch/powerpc/boot/dts/mpc836x_rdk.dts
@@ -218,8 +218,23 @@
218 reg = <0x440 0x40>; 218 reg = <0x440 0x40>;
219 interrupts = <12 13 14 15>; 219 interrupts = <12 13 14 15>;
220 interrupt-parent = <&qeic>; 220 interrupt-parent = <&qeic>;
221 /* filled by u-boot */ 221 clock-frequency = <166666666>;
222 clock-frequency = <0>; 222 };
223
224 usb@6c0 {
225 compatible = "fsl,mpc8360-qe-usb",
226 "fsl,mpc8323-qe-usb";
227 reg = <0x6c0 0x40 0x8b00 0x100>;
228 interrupts = <11>;
229 interrupt-parent = <&qeic>;
230 fsl,fullspeed-clock = "clk21";
231 gpios = <&qe_pio_b 2 0 /* USBOE */
232 &qe_pio_b 3 0 /* USBTP */
233 &qe_pio_b 8 0 /* USBTN */
234 &qe_pio_b 9 0 /* USBRP */
235 &qe_pio_b 11 0 /* USBRN */
236 &qe_pio_e 20 0 /* SPEED */
237 &qe_pio_e 21 1 /* POWER */>;
223 }; 238 };
224 239
225 spi@4c0 { 240 spi@4c0 {
diff --git a/arch/powerpc/boot/dts/mpc8641_hpcn.dts b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
index 35d5e248ccd7..4481532cbe77 100644
--- a/arch/powerpc/boot/dts/mpc8641_hpcn.dts
+++ b/arch/powerpc/boot/dts/mpc8641_hpcn.dts
@@ -26,7 +26,13 @@
26 serial1 = &serial1; 26 serial1 = &serial1;
27 pci0 = &pci0; 27 pci0 = &pci0;
28 pci1 = &pci1; 28 pci1 = &pci1;
29 rapidio0 = &rapidio0; 29/*
30 * Only one of Rapid IO or PCI can be present due to HW limitations and
31 * due to the fact that the 2 now share address space in the new memory
32 * map. The most likely case is that we have PCI, so comment out the
33 * rapidio node. Leave it here for reference.
34 */
35 /* rapidio0 = &rapidio0; */
30 }; 36 };
31 37
32 cpus { 38 cpus {
@@ -62,18 +68,17 @@
62 reg = <0x00000000 0x40000000>; // 1G at 0x0 68 reg = <0x00000000 0x40000000>; // 1G at 0x0
63 }; 69 };
64 70
65 localbus@f8005000 { 71 localbus@ffe05000 {
66 #address-cells = <2>; 72 #address-cells = <2>;
67 #size-cells = <1>; 73 #size-cells = <1>;
68 compatible = "fsl,mpc8641-localbus", "simple-bus"; 74 compatible = "fsl,mpc8641-localbus", "simple-bus";
69 reg = <0xf8005000 0x1000>; 75 reg = <0xffe05000 0x1000>;
70 interrupts = <19 2>; 76 interrupts = <19 2>;
71 interrupt-parent = <&mpic>; 77 interrupt-parent = <&mpic>;
72 78
73 ranges = <0 0 0xff800000 0x00800000 79 ranges = <0 0 0xef800000 0x00800000
74 1 0 0xfe000000 0x01000000 80 2 0 0xffdf8000 0x00008000
75 2 0 0xf8200000 0x00100000 81 3 0 0xffdf0000 0x00008000>;
76 3 0 0xf8100000 0x00100000>;
77 82
78 flash@0,0 { 83 flash@0,0 {
79 compatible = "cfi-flash"; 84 compatible = "cfi-flash";
@@ -103,13 +108,13 @@
103 }; 108 };
104 }; 109 };
105 110
106 soc8641@f8000000 { 111 soc8641@ffe00000 {
107 #address-cells = <1>; 112 #address-cells = <1>;
108 #size-cells = <1>; 113 #size-cells = <1>;
109 device_type = "soc"; 114 device_type = "soc";
110 compatible = "simple-bus"; 115 compatible = "simple-bus";
111 ranges = <0x00000000 0xf8000000 0x00100000>; 116 ranges = <0x00000000 0xffe00000 0x00100000>;
112 reg = <0xf8000000 0x00001000>; // CCSRBAR 117 reg = <0xffe00000 0x00001000>; // CCSRBAR
113 bus-frequency = <0>; 118 bus-frequency = <0>;
114 119
115 i2c@3000 { 120 i2c@3000 {
@@ -340,17 +345,17 @@
340 }; 345 };
341 }; 346 };
342 347
343 pci0: pcie@f8008000 { 348 pci0: pcie@ffe08000 {
344 cell-index = <0>; 349 cell-index = <0>;
345 compatible = "fsl,mpc8641-pcie"; 350 compatible = "fsl,mpc8641-pcie";
346 device_type = "pci"; 351 device_type = "pci";
347 #interrupt-cells = <1>; 352 #interrupt-cells = <1>;
348 #size-cells = <2>; 353 #size-cells = <2>;
349 #address-cells = <3>; 354 #address-cells = <3>;
350 reg = <0xf8008000 0x1000>; 355 reg = <0xffe08000 0x1000>;
351 bus-range = <0x0 0xff>; 356 bus-range = <0x0 0xff>;
352 ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x20000000 357 ranges = <0x02000000 0x0 0x80000000 0x80000000 0x0 0x20000000
353 0x01000000 0x0 0x00000000 0xe2000000 0x0 0x00100000>; 358 0x01000000 0x0 0x00000000 0xffc00000 0x0 0x00010000>;
354 clock-frequency = <33333333>; 359 clock-frequency = <33333333>;
355 interrupt-parent = <&mpic>; 360 interrupt-parent = <&mpic>;
356 interrupts = <24 2>; 361 interrupts = <24 2>;
@@ -481,7 +486,7 @@
481 486
482 0x01000000 0x0 0x00000000 487 0x01000000 0x0 0x00000000
483 0x01000000 0x0 0x00000000 488 0x01000000 0x0 0x00000000
484 0x0 0x00100000>; 489 0x0 0x00010000>;
485 uli1575@0 { 490 uli1575@0 {
486 reg = <0 0 0 0 0>; 491 reg = <0 0 0 0 0>;
487 #size-cells = <2>; 492 #size-cells = <2>;
@@ -491,7 +496,7 @@
491 0x0 0x20000000 496 0x0 0x20000000
492 0x01000000 0x0 0x00000000 497 0x01000000 0x0 0x00000000
493 0x01000000 0x0 0x00000000 498 0x01000000 0x0 0x00000000
494 0x0 0x00100000>; 499 0x0 0x00010000>;
495 isa@1e { 500 isa@1e {
496 device_type = "isa"; 501 device_type = "isa";
497 #interrupt-cells = <2>; 502 #interrupt-cells = <2>;
@@ -549,17 +554,17 @@
549 554
550 }; 555 };
551 556
552 pci1: pcie@f8009000 { 557 pci1: pcie@ffe09000 {
553 cell-index = <1>; 558 cell-index = <1>;
554 compatible = "fsl,mpc8641-pcie"; 559 compatible = "fsl,mpc8641-pcie";
555 device_type = "pci"; 560 device_type = "pci";
556 #interrupt-cells = <1>; 561 #interrupt-cells = <1>;
557 #size-cells = <2>; 562 #size-cells = <2>;
558 #address-cells = <3>; 563 #address-cells = <3>;
559 reg = <0xf8009000 0x1000>; 564 reg = <0xffe09000 0x1000>;
560 bus-range = <0 0xff>; 565 bus-range = <0 0xff>;
561 ranges = <0x02000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000 566 ranges = <0x02000000 0x0 0xa0000000 0xa0000000 0x0 0x20000000
562 0x01000000 0x0 0x00000000 0xe3000000 0x0 0x00100000>; 567 0x01000000 0x0 0x00000000 0xffc10000 0x0 0x00010000>;
563 clock-frequency = <33333333>; 568 clock-frequency = <33333333>;
564 interrupt-parent = <&mpic>; 569 interrupt-parent = <&mpic>;
565 interrupts = <25 2>; 570 interrupts = <25 2>;
@@ -582,18 +587,21 @@
582 587
583 0x01000000 0x0 0x00000000 588 0x01000000 0x0 0x00000000
584 0x01000000 0x0 0x00000000 589 0x01000000 0x0 0x00000000
585 0x0 0x00100000>; 590 0x0 0x00010000>;
586 }; 591 };
587 }; 592 };
588 rapidio0: rapidio@f80c0000 { 593/*
594 rapidio0: rapidio@ffec0000 {
589 #address-cells = <2>; 595 #address-cells = <2>;
590 #size-cells = <2>; 596 #size-cells = <2>;
591 compatible = "fsl,rapidio-delta"; 597 compatible = "fsl,rapidio-delta";
592 reg = <0xf80c0000 0x20000>; 598 reg = <0xffec0000 0x20000>;
593 ranges = <0 0 0xc0000000 0 0x20000000>; 599 ranges = <0 0 0x80000000 0 0x20000000>;
594 interrupt-parent = <&mpic>; 600 interrupt-parent = <&mpic>;
595 /* err_irq bell_outb_irq bell_inb_irq 601 // err_irq bell_outb_irq bell_inb_irq
596 msg1_tx_irq msg1_rx_irq msg2_tx_irq msg2_rx_irq */ 602 // msg1_tx_irq msg1_rx_irq msg2_tx_irq msg2_rx_irq
597 interrupts = <48 2 49 2 50 2 53 2 54 2 55 2 56 2>; 603 interrupts = <48 2 49 2 50 2 53 2 54 2 55 2 56 2>;
598 }; 604 };
605*/
606
599}; 607};
diff --git a/arch/powerpc/boot/dts/sequoia.dts b/arch/powerpc/boot/dts/sequoia.dts
index 3b295e8df53f..43cc68bd3192 100644
--- a/arch/powerpc/boot/dts/sequoia.dts
+++ b/arch/powerpc/boot/dts/sequoia.dts
@@ -134,7 +134,7 @@
134 }; 134 };
135 135
136 USB1: usb@e0000400 { 136 USB1: usb@e0000400 {
137 compatible = "ohci-be"; 137 compatible = "ibm,usb-ohci-440epx", "ohci-be";
138 reg = <0x00000000 0xe0000400 0x00000060>; 138 reg = <0x00000000 0xe0000400 0x00000060>;
139 interrupt-parent = <&UIC0>; 139 interrupt-parent = <&UIC0>;
140 interrupts = <0x15 0x8>; 140 interrupts = <0x15 0x8>;
diff --git a/arch/powerpc/boot/install.sh b/arch/powerpc/boot/install.sh
index b002bfd56786..51b2387bdba0 100644
--- a/arch/powerpc/boot/install.sh
+++ b/arch/powerpc/boot/install.sh
@@ -15,7 +15,7 @@
15# $2 - kernel image file 15# $2 - kernel image file
16# $3 - kernel map file 16# $3 - kernel map file
17# $4 - default install path (blank if root directory) 17# $4 - default install path (blank if root directory)
18# $5 - kernel boot file, the zImage 18# $5 and more - kernel boot files; zImage*, uImage, cuImage.*, etc.
19# 19#
20 20
21# User may have a custom install script 21# User may have a custom install script
@@ -38,3 +38,15 @@ fi
38 38
39cat $2 > $4/$image_name 39cat $2 > $4/$image_name
40cp $3 $4/System.map 40cp $3 $4/System.map
41
42# Copy all the bootable image files
43path=$4
44shift 4
45while [ $# -ne 0 ]; do
46 image_name=`basename $1`
47 if [ -f $path/$image_name ]; then
48 mv $path/$image_name $path/$image_name.old
49 fi
50 cat $1 > $path/$image_name
51 shift
52done;
diff --git a/arch/powerpc/configs/85xx/mpc8572_ds_defconfig b/arch/powerpc/configs/85xx/mpc8572_ds_defconfig
index 635588319e0d..32aeb79216f7 100644
--- a/arch/powerpc/configs/85xx/mpc8572_ds_defconfig
+++ b/arch/powerpc/configs/85xx/mpc8572_ds_defconfig
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc3 3# Linux kernel version: 2.6.28-rc8
4# Sat Nov 8 12:40:13 2008 4# Tue Dec 30 11:17:46 2008
5# 5#
6# CONFIG_PPC64 is not set 6# CONFIG_PPC64 is not set
7 7
@@ -21,7 +21,10 @@ CONFIG_FSL_BOOKE=y
21CONFIG_FSL_EMB_PERFMON=y 21CONFIG_FSL_EMB_PERFMON=y
22# CONFIG_PHYS_64BIT is not set 22# CONFIG_PHYS_64BIT is not set
23CONFIG_SPE=y 23CONFIG_SPE=y
24CONFIG_PPC_MMU_NOHASH=y
24# CONFIG_PPC_MM_SLICES is not set 25# CONFIG_PPC_MM_SLICES is not set
26CONFIG_SMP=y
27CONFIG_NR_CPUS=2
25CONFIG_PPC32=y 28CONFIG_PPC32=y
26CONFIG_WORD_SIZE=32 29CONFIG_WORD_SIZE=32
27# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set 30# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
@@ -50,7 +53,7 @@ CONFIG_ARCH_MAY_HAVE_PC_FDC=y
50CONFIG_PPC_OF=y 53CONFIG_PPC_OF=y
51CONFIG_OF=y 54CONFIG_OF=y
52CONFIG_PPC_UDBG_16550=y 55CONFIG_PPC_UDBG_16550=y
53# CONFIG_GENERIC_TBSYNC is not set 56CONFIG_GENERIC_TBSYNC=y
54CONFIG_AUDIT_ARCH=y 57CONFIG_AUDIT_ARCH=y
55CONFIG_GENERIC_BUG=y 58CONFIG_GENERIC_BUG=y
56CONFIG_DEFAULT_UIMAGE=y 59CONFIG_DEFAULT_UIMAGE=y
@@ -62,7 +65,7 @@ CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
62# General setup 65# General setup
63# 66#
64CONFIG_EXPERIMENTAL=y 67CONFIG_EXPERIMENTAL=y
65CONFIG_BROKEN_ON_SMP=y 68CONFIG_LOCK_KERNEL=y
66CONFIG_INIT_ENV_ARG_LIMIT=32 69CONFIG_INIT_ENV_ARG_LIMIT=32
67CONFIG_LOCALVERSION="" 70CONFIG_LOCALVERSION=""
68CONFIG_LOCALVERSION_AUTO=y 71CONFIG_LOCALVERSION_AUTO=y
@@ -126,6 +129,7 @@ CONFIG_HAVE_IOREMAP_PROT=y
126CONFIG_HAVE_KPROBES=y 129CONFIG_HAVE_KPROBES=y
127CONFIG_HAVE_KRETPROBES=y 130CONFIG_HAVE_KRETPROBES=y
128CONFIG_HAVE_ARCH_TRACEHOOK=y 131CONFIG_HAVE_ARCH_TRACEHOOK=y
132CONFIG_USE_GENERIC_SMP_HELPERS=y
129# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set 133# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
130CONFIG_SLABINFO=y 134CONFIG_SLABINFO=y
131CONFIG_RT_MUTEXES=y 135CONFIG_RT_MUTEXES=y
@@ -138,6 +142,7 @@ CONFIG_MODULE_FORCE_UNLOAD=y
138CONFIG_MODVERSIONS=y 142CONFIG_MODVERSIONS=y
139# CONFIG_MODULE_SRCVERSION_ALL is not set 143# CONFIG_MODULE_SRCVERSION_ALL is not set
140CONFIG_KMOD=y 144CONFIG_KMOD=y
145CONFIG_STOP_MACHINE=y
141CONFIG_BLOCK=y 146CONFIG_BLOCK=y
142CONFIG_LBD=y 147CONFIG_LBD=y
143# CONFIG_BLK_DEV_IO_TRACE is not set 148# CONFIG_BLK_DEV_IO_TRACE is not set
@@ -197,6 +202,7 @@ CONFIG_PPC_I8259=y
197# CONFIG_CPM2 is not set 202# CONFIG_CPM2 is not set
198CONFIG_FSL_ULI1575=y 203CONFIG_FSL_ULI1575=y
199# CONFIG_MPC8xxx_GPIO is not set 204# CONFIG_MPC8xxx_GPIO is not set
205# CONFIG_SIMPLE_GPIO is not set
200 206
201# 207#
202# Kernel options 208# Kernel options
@@ -224,6 +230,7 @@ CONFIG_MATH_EMULATION=y
224CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y 230CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y
225CONFIG_ARCH_HAS_WALK_MEMORY=y 231CONFIG_ARCH_HAS_WALK_MEMORY=y
226CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y 232CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y
233# CONFIG_IRQ_ALL_CPUS is not set
227CONFIG_ARCH_FLATMEM_ENABLE=y 234CONFIG_ARCH_FLATMEM_ENABLE=y
228CONFIG_ARCH_POPULATES_NODE_MAP=y 235CONFIG_ARCH_POPULATES_NODE_MAP=y
229CONFIG_SELECT_MEMORY_MODEL=y 236CONFIG_SELECT_MEMORY_MODEL=y
@@ -241,6 +248,9 @@ CONFIG_ZONE_DMA_FLAG=1
241CONFIG_BOUNCE=y 248CONFIG_BOUNCE=y
242CONFIG_VIRT_TO_BUS=y 249CONFIG_VIRT_TO_BUS=y
243CONFIG_UNEVICTABLE_LRU=y 250CONFIG_UNEVICTABLE_LRU=y
251CONFIG_PPC_4K_PAGES=y
252# CONFIG_PPC_16K_PAGES is not set
253# CONFIG_PPC_64K_PAGES is not set
244CONFIG_FORCE_MAX_ZONEORDER=11 254CONFIG_FORCE_MAX_ZONEORDER=11
245CONFIG_PROC_DEVICETREE=y 255CONFIG_PROC_DEVICETREE=y
246# CONFIG_CMDLINE_BOOL is not set 256# CONFIG_CMDLINE_BOOL is not set
@@ -443,8 +453,10 @@ CONFIG_MISC_DEVICES=y
443# CONFIG_EEPROM_93CX6 is not set 453# CONFIG_EEPROM_93CX6 is not set
444# CONFIG_SGI_IOC4 is not set 454# CONFIG_SGI_IOC4 is not set
445# CONFIG_TIFM_CORE is not set 455# CONFIG_TIFM_CORE is not set
456# CONFIG_ICS932S401 is not set
446# CONFIG_ENCLOSURE_SERVICES is not set 457# CONFIG_ENCLOSURE_SERVICES is not set
447# CONFIG_HP_ILO is not set 458# CONFIG_HP_ILO is not set
459# CONFIG_C2PORT is not set
448CONFIG_HAVE_IDE=y 460CONFIG_HAVE_IDE=y
449# CONFIG_IDE is not set 461# CONFIG_IDE is not set
450 462
@@ -784,6 +796,7 @@ CONFIG_SERIAL_CORE_CONSOLE=y
784CONFIG_UNIX98_PTYS=y 796CONFIG_UNIX98_PTYS=y
785CONFIG_LEGACY_PTYS=y 797CONFIG_LEGACY_PTYS=y
786CONFIG_LEGACY_PTY_COUNT=256 798CONFIG_LEGACY_PTY_COUNT=256
799# CONFIG_HVC_UDBG is not set
787# CONFIG_IPMI_HANDLER is not set 800# CONFIG_IPMI_HANDLER is not set
788CONFIG_HW_RANDOM=y 801CONFIG_HW_RANDOM=y
789CONFIG_NVRAM=y 802CONFIG_NVRAM=y
@@ -869,11 +882,11 @@ CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
869# CONFIG_THERMAL is not set 882# CONFIG_THERMAL is not set
870# CONFIG_THERMAL_HWMON is not set 883# CONFIG_THERMAL_HWMON is not set
871# CONFIG_WATCHDOG is not set 884# CONFIG_WATCHDOG is not set
885CONFIG_SSB_POSSIBLE=y
872 886
873# 887#
874# Sonics Silicon Backplane 888# Sonics Silicon Backplane
875# 889#
876CONFIG_SSB_POSSIBLE=y
877# CONFIG_SSB is not set 890# CONFIG_SSB is not set
878 891
879# 892#
@@ -886,14 +899,7 @@ CONFIG_SSB_POSSIBLE=y
886# CONFIG_PMIC_DA903X is not set 899# CONFIG_PMIC_DA903X is not set
887# CONFIG_MFD_WM8400 is not set 900# CONFIG_MFD_WM8400 is not set
888# CONFIG_MFD_WM8350_I2C is not set 901# CONFIG_MFD_WM8350_I2C is not set
889
890#
891# Voltage and Current regulators
892#
893# CONFIG_REGULATOR is not set 902# CONFIG_REGULATOR is not set
894# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
895# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
896# CONFIG_REGULATOR_BQ24022 is not set
897 903
898# 904#
899# Multimedia devices 905# Multimedia devices
@@ -1252,11 +1258,11 @@ CONFIG_USB_OHCI_LITTLE_ENDIAN=y
1252# CONFIG_USB_TMC is not set 1258# CONFIG_USB_TMC is not set
1253 1259
1254# 1260#
1255# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1261# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1256# 1262#
1257 1263
1258# 1264#
1259# may also be needed; see USB_STORAGE Help for more information 1265# see USB_STORAGE Help for more information
1260# 1266#
1261CONFIG_USB_STORAGE=y 1267CONFIG_USB_STORAGE=y
1262# CONFIG_USB_STORAGE_DEBUG is not set 1268# CONFIG_USB_STORAGE_DEBUG is not set
@@ -1348,6 +1354,7 @@ CONFIG_RTC_INTF_DEV=y
1348# CONFIG_RTC_DRV_M41T80 is not set 1354# CONFIG_RTC_DRV_M41T80 is not set
1349# CONFIG_RTC_DRV_S35390A is not set 1355# CONFIG_RTC_DRV_S35390A is not set
1350# CONFIG_RTC_DRV_FM3130 is not set 1356# CONFIG_RTC_DRV_FM3130 is not set
1357# CONFIG_RTC_DRV_RX8581 is not set
1351 1358
1352# 1359#
1353# SPI RTC drivers 1360# SPI RTC drivers
@@ -1624,6 +1631,7 @@ CONFIG_HAVE_FUNCTION_TRACER=y
1624# CONFIG_SAMPLES is not set 1631# CONFIG_SAMPLES is not set
1625CONFIG_HAVE_ARCH_KGDB=y 1632CONFIG_HAVE_ARCH_KGDB=y
1626# CONFIG_KGDB is not set 1633# CONFIG_KGDB is not set
1634CONFIG_PRINT_STACK_DEPTH=64
1627# CONFIG_DEBUG_STACKOVERFLOW is not set 1635# CONFIG_DEBUG_STACKOVERFLOW is not set
1628# CONFIG_DEBUG_STACK_USAGE is not set 1636# CONFIG_DEBUG_STACK_USAGE is not set
1629# CONFIG_DEBUG_PAGEALLOC is not set 1637# CONFIG_DEBUG_PAGEALLOC is not set
@@ -1649,11 +1657,16 @@ CONFIG_CRYPTO=y
1649# 1657#
1650# CONFIG_CRYPTO_FIPS is not set 1658# CONFIG_CRYPTO_FIPS is not set
1651CONFIG_CRYPTO_ALGAPI=y 1659CONFIG_CRYPTO_ALGAPI=y
1660CONFIG_CRYPTO_ALGAPI2=y
1652CONFIG_CRYPTO_AEAD=y 1661CONFIG_CRYPTO_AEAD=y
1662CONFIG_CRYPTO_AEAD2=y
1653CONFIG_CRYPTO_BLKCIPHER=y 1663CONFIG_CRYPTO_BLKCIPHER=y
1664CONFIG_CRYPTO_BLKCIPHER2=y
1654CONFIG_CRYPTO_HASH=y 1665CONFIG_CRYPTO_HASH=y
1655CONFIG_CRYPTO_RNG=y 1666CONFIG_CRYPTO_HASH2=y
1667CONFIG_CRYPTO_RNG2=y
1656CONFIG_CRYPTO_MANAGER=y 1668CONFIG_CRYPTO_MANAGER=y
1669CONFIG_CRYPTO_MANAGER2=y
1657# CONFIG_CRYPTO_GF128MUL is not set 1670# CONFIG_CRYPTO_GF128MUL is not set
1658# CONFIG_CRYPTO_NULL is not set 1671# CONFIG_CRYPTO_NULL is not set
1659# CONFIG_CRYPTO_CRYPTD is not set 1672# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/powerpc/configs/86xx/gef_sbc610_defconfig b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
index cd1ffa449327..391874c7b436 100644
--- a/arch/powerpc/configs/86xx/gef_sbc610_defconfig
+++ b/arch/powerpc/configs/86xx/gef_sbc610_defconfig
@@ -1164,6 +1164,7 @@ CONFIG_WATCHDOG=y
1164# CONFIG_SOFT_WATCHDOG is not set 1164# CONFIG_SOFT_WATCHDOG is not set
1165# CONFIG_ALIM7101_WDT is not set 1165# CONFIG_ALIM7101_WDT is not set
1166# CONFIG_8xxx_WDT is not set 1166# CONFIG_8xxx_WDT is not set
1167CONFIG_GEF_WDT=y
1167 1168
1168# 1169#
1169# PCI-based Watchdog Cards 1170# PCI-based Watchdog Cards
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index 5ab7d7fe198c..9268602de5d0 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -35,3 +35,4 @@ unifdef-y += spu_info.h
35unifdef-y += termios.h 35unifdef-y += termios.h
36unifdef-y += types.h 36unifdef-y += types.h
37unifdef-y += unistd.h 37unifdef-y += unistd.h
38unifdef-y += swab.h
diff --git a/arch/powerpc/include/asm/atomic.h b/arch/powerpc/include/asm/atomic.h
index 499be5bdd6fa..b401950f5259 100644
--- a/arch/powerpc/include/asm/atomic.h
+++ b/arch/powerpc/include/asm/atomic.h
@@ -5,7 +5,7 @@
5 * PowerPC atomic operations 5 * PowerPC atomic operations
6 */ 6 */
7 7
8typedef struct { int counter; } atomic_t; 8#include <linux/types.h>
9 9
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11#include <linux/compiler.h> 11#include <linux/compiler.h>
@@ -251,8 +251,6 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
251 251
252#ifdef __powerpc64__ 252#ifdef __powerpc64__
253 253
254typedef struct { long counter; } atomic64_t;
255
256#define ATOMIC64_INIT(i) { (i) } 254#define ATOMIC64_INIT(i) { (i) }
257 255
258static __inline__ long atomic64_read(const atomic64_t *v) 256static __inline__ long atomic64_read(const atomic64_t *v)
diff --git a/arch/powerpc/include/asm/byteorder.h b/arch/powerpc/include/asm/byteorder.h
index d5de325472e9..5cca27a41532 100644
--- a/arch/powerpc/include/asm/byteorder.h
+++ b/arch/powerpc/include/asm/byteorder.h
@@ -8,86 +8,7 @@
8 * 2 of the License, or (at your option) any later version. 8 * 2 of the License, or (at your option) any later version.
9 */ 9 */
10 10
11#include <asm/types.h> 11#include <asm/swab.h>
12#include <linux/compiler.h> 12#include <linux/byteorder/big_endian.h>
13
14#define __BIG_ENDIAN
15
16#ifdef __GNUC__
17#ifdef __KERNEL__
18
19static __inline__ __u16 ld_le16(const volatile __u16 *addr)
20{
21 __u16 val;
22
23 __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
24 return val;
25}
26#define __arch_swab16p ld_le16
27
28static __inline__ void st_le16(volatile __u16 *addr, const __u16 val)
29{
30 __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
31}
32
33static inline void __arch_swab16s(__u16 *addr)
34{
35 st_le16(addr, *addr);
36}
37#define __arch_swab16s __arch_swab16s
38
39static __inline__ __u32 ld_le32(const volatile __u32 *addr)
40{
41 __u32 val;
42
43 __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
44 return val;
45}
46#define __arch_swab32p ld_le32
47
48static __inline__ void st_le32(volatile __u32 *addr, const __u32 val)
49{
50 __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
51}
52
53static inline void __arch_swab32s(__u32 *addr)
54{
55 st_le32(addr, *addr);
56}
57#define __arch_swab32s __arch_swab32s
58
59static inline __attribute_const__ __u16 __arch_swab16(__u16 value)
60{
61 __u16 result;
62
63 __asm__("rlwimi %0,%1,8,16,23"
64 : "=r" (result)
65 : "r" (value), "0" (value >> 8));
66 return result;
67}
68#define __arch_swab16 __arch_swab16
69
70static inline __attribute_const__ __u32 __arch_swab32(__u32 value)
71{
72 __u32 result;
73
74 __asm__("rlwimi %0,%1,24,16,23\n\t"
75 "rlwimi %0,%1,8,8,15\n\t"
76 "rlwimi %0,%1,24,0,7"
77 : "=r" (result)
78 : "r" (value), "0" (value >> 24));
79 return result;
80}
81#define __arch_swab32 __arch_swab32
82
83#endif /* __KERNEL__ */
84
85#ifndef __powerpc64__
86#define __SWAB_64_THRU_32__
87#endif /* __powerpc64__ */
88
89#endif /* __GNUC__ */
90
91#include <linux/byteorder.h>
92 13
93#endif /* _ASM_POWERPC_BYTEORDER_H */ 14#endif /* _ASM_POWERPC_BYTEORDER_H */
diff --git a/arch/powerpc/include/asm/cell-pmu.h b/arch/powerpc/include/asm/cell-pmu.h
index 8066eede3a0c..b4b7338ad79e 100644
--- a/arch/powerpc/include/asm/cell-pmu.h
+++ b/arch/powerpc/include/asm/cell-pmu.h
@@ -37,9 +37,11 @@
37#define CBE_PM_STOP_AT_MAX 0x40000000 37#define CBE_PM_STOP_AT_MAX 0x40000000
38#define CBE_PM_TRACE_MODE_GET(pm_control) (((pm_control) >> 28) & 0x3) 38#define CBE_PM_TRACE_MODE_GET(pm_control) (((pm_control) >> 28) & 0x3)
39#define CBE_PM_TRACE_MODE_SET(mode) (((mode) & 0x3) << 28) 39#define CBE_PM_TRACE_MODE_SET(mode) (((mode) & 0x3) << 28)
40#define CBE_PM_TRACE_BUF_OVFLW(bit) (((bit) & 0x1) << 17)
40#define CBE_PM_COUNT_MODE_SET(count) (((count) & 0x3) << 18) 41#define CBE_PM_COUNT_MODE_SET(count) (((count) & 0x3) << 18)
41#define CBE_PM_FREEZE_ALL_CTRS 0x00100000 42#define CBE_PM_FREEZE_ALL_CTRS 0x00100000
42#define CBE_PM_ENABLE_EXT_TRACE 0x00008000 43#define CBE_PM_ENABLE_EXT_TRACE 0x00008000
44#define CBE_PM_SPU_ADDR_TRACE_SET(msk) (((msk) & 0x3) << 9)
43 45
44/* Macros for the trace_address register. */ 46/* Macros for the trace_address register. */
45#define CBE_PM_TRACE_BUF_FULL 0x00000800 47#define CBE_PM_TRACE_BUF_FULL 0x00000800
diff --git a/arch/powerpc/include/asm/disassemble.h b/arch/powerpc/include/asm/disassemble.h
new file mode 100644
index 000000000000..9b198d1b3b2b
--- /dev/null
+++ b/arch/powerpc/include/asm/disassemble.h
@@ -0,0 +1,80 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14 *
15 * Copyright IBM Corp. 2008
16 *
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
18 */
19
20#ifndef __ASM_PPC_DISASSEMBLE_H__
21#define __ASM_PPC_DISASSEMBLE_H__
22
23#include <linux/types.h>
24
25static inline unsigned int get_op(u32 inst)
26{
27 return inst >> 26;
28}
29
30static inline unsigned int get_xop(u32 inst)
31{
32 return (inst >> 1) & 0x3ff;
33}
34
35static inline unsigned int get_sprn(u32 inst)
36{
37 return ((inst >> 16) & 0x1f) | ((inst >> 6) & 0x3e0);
38}
39
40static inline unsigned int get_dcrn(u32 inst)
41{
42 return ((inst >> 16) & 0x1f) | ((inst >> 6) & 0x3e0);
43}
44
45static inline unsigned int get_rt(u32 inst)
46{
47 return (inst >> 21) & 0x1f;
48}
49
50static inline unsigned int get_rs(u32 inst)
51{
52 return (inst >> 21) & 0x1f;
53}
54
55static inline unsigned int get_ra(u32 inst)
56{
57 return (inst >> 16) & 0x1f;
58}
59
60static inline unsigned int get_rb(u32 inst)
61{
62 return (inst >> 11) & 0x1f;
63}
64
65static inline unsigned int get_rc(u32 inst)
66{
67 return inst & 0x1;
68}
69
70static inline unsigned int get_ws(u32 inst)
71{
72 return (inst >> 11) & 0x1f;
73}
74
75static inline unsigned int get_d(u32 inst)
76{
77 return inst & 0xffff;
78}
79
80#endif /* __ASM_PPC_DISASSEMBLE_H__ */
diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h
index 26f0d0ab27a5..b1dafb6a9743 100644
--- a/arch/powerpc/include/asm/hugetlb.h
+++ b/arch/powerpc/include/asm/hugetlb.h
@@ -18,6 +18,12 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
18 pte_t *ptep); 18 pte_t *ptep);
19 19
20/* 20/*
21 * The version of vma_mmu_pagesize() in arch/powerpc/mm/hugetlbpage.c needs
22 * to override the version in mm/hugetlb.c
23 */
24#define vma_mmu_pagesize vma_mmu_pagesize
25
26/*
21 * If the arch doesn't supply something else, assume that hugepage 27 * If the arch doesn't supply something else, assume that hugepage
22 * size aligned regions are ok without further preparation. 28 * size aligned regions are ok without further preparation.
23 */ 29 */
diff --git a/arch/powerpc/include/asm/ioctls.h b/arch/powerpc/include/asm/ioctls.h
index 279a6229584b..1842186d872c 100644
--- a/arch/powerpc/include/asm/ioctls.h
+++ b/arch/powerpc/include/asm/ioctls.h
@@ -89,6 +89,8 @@
89#define TIOCSBRK 0x5427 /* BSD compatibility */ 89#define TIOCSBRK 0x5427 /* BSD compatibility */
90#define TIOCCBRK 0x5428 /* BSD compatibility */ 90#define TIOCCBRK 0x5428 /* BSD compatibility */
91#define TIOCGSID 0x5429 /* Return the session ID of FD */ 91#define TIOCGSID 0x5429 /* Return the session ID of FD */
92#define TIOCGRS485 0x542e
93#define TIOCSRS485 0x542f
92#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ 94#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
93#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ 95#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
94 96
diff --git a/arch/powerpc/include/asm/kexec.h b/arch/powerpc/include/asm/kexec.h
index 6dbffc981702..7e06b43720d3 100644
--- a/arch/powerpc/include/asm/kexec.h
+++ b/arch/powerpc/include/asm/kexec.h
@@ -48,63 +48,8 @@ static inline void crash_setup_regs(struct pt_regs *newregs,
48{ 48{
49 if (oldregs) 49 if (oldregs)
50 memcpy(newregs, oldregs, sizeof(*newregs)); 50 memcpy(newregs, oldregs, sizeof(*newregs));
51#ifdef __powerpc64__
52 else {
53 /* FIXME Merge this with xmon_save_regs ?? */
54 unsigned long tmp1, tmp2;
55 __asm__ __volatile__ (
56 "std 0,0(%2)\n"
57 "std 1,8(%2)\n"
58 "std 2,16(%2)\n"
59 "std 3,24(%2)\n"
60 "std 4,32(%2)\n"
61 "std 5,40(%2)\n"
62 "std 6,48(%2)\n"
63 "std 7,56(%2)\n"
64 "std 8,64(%2)\n"
65 "std 9,72(%2)\n"
66 "std 10,80(%2)\n"
67 "std 11,88(%2)\n"
68 "std 12,96(%2)\n"
69 "std 13,104(%2)\n"
70 "std 14,112(%2)\n"
71 "std 15,120(%2)\n"
72 "std 16,128(%2)\n"
73 "std 17,136(%2)\n"
74 "std 18,144(%2)\n"
75 "std 19,152(%2)\n"
76 "std 20,160(%2)\n"
77 "std 21,168(%2)\n"
78 "std 22,176(%2)\n"
79 "std 23,184(%2)\n"
80 "std 24,192(%2)\n"
81 "std 25,200(%2)\n"
82 "std 26,208(%2)\n"
83 "std 27,216(%2)\n"
84 "std 28,224(%2)\n"
85 "std 29,232(%2)\n"
86 "std 30,240(%2)\n"
87 "std 31,248(%2)\n"
88 "mfmsr %0\n"
89 "std %0, 264(%2)\n"
90 "mfctr %0\n"
91 "std %0, 280(%2)\n"
92 "mflr %0\n"
93 "std %0, 288(%2)\n"
94 "bl 1f\n"
95 "1: mflr %1\n"
96 "std %1, 256(%2)\n"
97 "mtlr %0\n"
98 "mfxer %0\n"
99 "std %0, 296(%2)\n"
100 : "=&r" (tmp1), "=&r" (tmp2)
101 : "b" (newregs)
102 : "memory");
103 }
104#else
105 else 51 else
106 ppc_save_regs(newregs); 52 ppc_save_regs(newregs);
107#endif /* __powerpc64__ */
108} 53}
109 54
110extern void kexec_smp_wait(void); /* get and clear naca physid, wait for 55extern void kexec_smp_wait(void); /* get and clear naca physid, wait for
diff --git a/arch/powerpc/include/asm/kvm_44x.h b/arch/powerpc/include/asm/kvm_44x.h
new file mode 100644
index 000000000000..f49031b632ca
--- /dev/null
+++ b/arch/powerpc/include/asm/kvm_44x.h
@@ -0,0 +1,61 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14 *
15 * Copyright IBM Corp. 2008
16 *
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
18 */
19
20#ifndef __ASM_44X_H__
21#define __ASM_44X_H__
22
23#include <linux/kvm_host.h>
24
25#define PPC44x_TLB_SIZE 64
26
27/* If the guest is expecting it, this can be as large as we like; we'd just
28 * need to find some way of advertising it. */
29#define KVM44x_GUEST_TLB_SIZE 64
30
31struct kvmppc_44x_shadow_ref {
32 struct page *page;
33 u16 gtlb_index;
34 u8 writeable;
35 u8 tid;
36};
37
38struct kvmppc_vcpu_44x {
39 /* Unmodified copy of the guest's TLB. */
40 struct kvmppc_44x_tlbe guest_tlb[KVM44x_GUEST_TLB_SIZE];
41
42 /* References to guest pages in the hardware TLB. */
43 struct kvmppc_44x_shadow_ref shadow_refs[PPC44x_TLB_SIZE];
44
45 /* State of the shadow TLB at guest context switch time. */
46 struct kvmppc_44x_tlbe shadow_tlb[PPC44x_TLB_SIZE];
47 u8 shadow_tlb_mod[PPC44x_TLB_SIZE];
48
49 struct kvm_vcpu vcpu;
50};
51
52static inline struct kvmppc_vcpu_44x *to_44x(struct kvm_vcpu *vcpu)
53{
54 return container_of(vcpu, struct kvmppc_vcpu_44x, vcpu);
55}
56
57void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 new_pid);
58void kvmppc_44x_tlb_put(struct kvm_vcpu *vcpu);
59void kvmppc_44x_tlb_load(struct kvm_vcpu *vcpu);
60
61#endif /* __ASM_44X_H__ */
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h
index 34b52b7180cd..c1e436fe7738 100644
--- a/arch/powerpc/include/asm/kvm_host.h
+++ b/arch/powerpc/include/asm/kvm_host.h
@@ -64,27 +64,58 @@ struct kvm_vcpu_stat {
64 u32 halt_wakeup; 64 u32 halt_wakeup;
65}; 65};
66 66
67struct tlbe { 67struct kvmppc_44x_tlbe {
68 u32 tid; /* Only the low 8 bits are used. */ 68 u32 tid; /* Only the low 8 bits are used. */
69 u32 word0; 69 u32 word0;
70 u32 word1; 70 u32 word1;
71 u32 word2; 71 u32 word2;
72}; 72};
73 73
74struct kvm_arch { 74enum kvm_exit_types {
75 MMIO_EXITS,
76 DCR_EXITS,
77 SIGNAL_EXITS,
78 ITLB_REAL_MISS_EXITS,
79 ITLB_VIRT_MISS_EXITS,
80 DTLB_REAL_MISS_EXITS,
81 DTLB_VIRT_MISS_EXITS,
82 SYSCALL_EXITS,
83 ISI_EXITS,
84 DSI_EXITS,
85 EMULATED_INST_EXITS,
86 EMULATED_MTMSRWE_EXITS,
87 EMULATED_WRTEE_EXITS,
88 EMULATED_MTSPR_EXITS,
89 EMULATED_MFSPR_EXITS,
90 EMULATED_MTMSR_EXITS,
91 EMULATED_MFMSR_EXITS,
92 EMULATED_TLBSX_EXITS,
93 EMULATED_TLBWE_EXITS,
94 EMULATED_RFI_EXITS,
95 DEC_EXITS,
96 EXT_INTR_EXITS,
97 HALT_WAKEUP,
98 USR_PR_INST,
99 FP_UNAVAIL,
100 DEBUG_EXITS,
101 TIMEINGUEST,
102 __NUMBER_OF_KVM_EXIT_TYPES
75}; 103};
76 104
77struct kvm_vcpu_arch { 105/* allow access to big endian 32bit upper/lower parts and 64bit var */
78 /* Unmodified copy of the guest's TLB. */ 106struct kvmppc_exit_timing {
79 struct tlbe guest_tlb[PPC44x_TLB_SIZE]; 107 union {
80 /* TLB that's actually used when the guest is running. */ 108 u64 tv64;
81 struct tlbe shadow_tlb[PPC44x_TLB_SIZE]; 109 struct {
82 /* Pages which are referenced in the shadow TLB. */ 110 u32 tbu, tbl;
83 struct page *shadow_pages[PPC44x_TLB_SIZE]; 111 } tv32;
112 };
113};
84 114
85 /* Track which TLB entries we've modified in the current exit. */ 115struct kvm_arch {
86 u8 shadow_tlb_mod[PPC44x_TLB_SIZE]; 116};
87 117
118struct kvm_vcpu_arch {
88 u32 host_stack; 119 u32 host_stack;
89 u32 host_pid; 120 u32 host_pid;
90 u32 host_dbcr0; 121 u32 host_dbcr0;
@@ -94,32 +125,32 @@ struct kvm_vcpu_arch {
94 u32 host_msr; 125 u32 host_msr;
95 126
96 u64 fpr[32]; 127 u64 fpr[32];
97 u32 gpr[32]; 128 ulong gpr[32];
98 129
99 u32 pc; 130 ulong pc;
100 u32 cr; 131 u32 cr;
101 u32 ctr; 132 ulong ctr;
102 u32 lr; 133 ulong lr;
103 u32 xer; 134 ulong xer;
104 135
105 u32 msr; 136 ulong msr;
106 u32 mmucr; 137 u32 mmucr;
107 u32 sprg0; 138 ulong sprg0;
108 u32 sprg1; 139 ulong sprg1;
109 u32 sprg2; 140 ulong sprg2;
110 u32 sprg3; 141 ulong sprg3;
111 u32 sprg4; 142 ulong sprg4;
112 u32 sprg5; 143 ulong sprg5;
113 u32 sprg6; 144 ulong sprg6;
114 u32 sprg7; 145 ulong sprg7;
115 u32 srr0; 146 ulong srr0;
116 u32 srr1; 147 ulong srr1;
117 u32 csrr0; 148 ulong csrr0;
118 u32 csrr1; 149 ulong csrr1;
119 u32 dsrr0; 150 ulong dsrr0;
120 u32 dsrr1; 151 ulong dsrr1;
121 u32 dear; 152 ulong dear;
122 u32 esr; 153 ulong esr;
123 u32 dec; 154 u32 dec;
124 u32 decar; 155 u32 decar;
125 u32 tbl; 156 u32 tbl;
@@ -127,7 +158,7 @@ struct kvm_vcpu_arch {
127 u32 tcr; 158 u32 tcr;
128 u32 tsr; 159 u32 tsr;
129 u32 ivor[16]; 160 u32 ivor[16];
130 u32 ivpr; 161 ulong ivpr;
131 u32 pir; 162 u32 pir;
132 163
133 u32 shadow_pid; 164 u32 shadow_pid;
@@ -140,9 +171,22 @@ struct kvm_vcpu_arch {
140 u32 dbcr0; 171 u32 dbcr0;
141 u32 dbcr1; 172 u32 dbcr1;
142 173
174#ifdef CONFIG_KVM_EXIT_TIMING
175 struct kvmppc_exit_timing timing_exit;
176 struct kvmppc_exit_timing timing_last_enter;
177 u32 last_exit_type;
178 u32 timing_count_type[__NUMBER_OF_KVM_EXIT_TYPES];
179 u64 timing_sum_duration[__NUMBER_OF_KVM_EXIT_TYPES];
180 u64 timing_sum_quad_duration[__NUMBER_OF_KVM_EXIT_TYPES];
181 u64 timing_min_duration[__NUMBER_OF_KVM_EXIT_TYPES];
182 u64 timing_max_duration[__NUMBER_OF_KVM_EXIT_TYPES];
183 u64 timing_last_exit;
184 struct dentry *debugfs_exit_timing;
185#endif
186
143 u32 last_inst; 187 u32 last_inst;
144 u32 fault_dear; 188 ulong fault_dear;
145 u32 fault_esr; 189 ulong fault_esr;
146 gpa_t paddr_accessed; 190 gpa_t paddr_accessed;
147 191
148 u8 io_gpr; /* GPR used as IO source/target */ 192 u8 io_gpr; /* GPR used as IO source/target */
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index bb62ad876de3..36d2a50a8487 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -29,11 +29,6 @@
29#include <linux/kvm_types.h> 29#include <linux/kvm_types.h>
30#include <linux/kvm_host.h> 30#include <linux/kvm_host.h>
31 31
32struct kvm_tlb {
33 struct tlbe guest_tlb[PPC44x_TLB_SIZE];
34 struct tlbe shadow_tlb[PPC44x_TLB_SIZE];
35};
36
37enum emulation_result { 32enum emulation_result {
38 EMULATE_DONE, /* no further processing */ 33 EMULATE_DONE, /* no further processing */
39 EMULATE_DO_MMIO, /* kvm_run filled with MMIO request */ 34 EMULATE_DO_MMIO, /* kvm_run filled with MMIO request */
@@ -41,9 +36,6 @@ enum emulation_result {
41 EMULATE_FAIL, /* can't emulate this instruction */ 36 EMULATE_FAIL, /* can't emulate this instruction */
42}; 37};
43 38
44extern const unsigned char exception_priority[];
45extern const unsigned char priority_exception[];
46
47extern int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu); 39extern int __kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu);
48extern char kvmppc_handlers_start[]; 40extern char kvmppc_handlers_start[];
49extern unsigned long kvmppc_handler_len; 41extern unsigned long kvmppc_handler_len;
@@ -58,51 +50,44 @@ extern int kvmppc_handle_store(struct kvm_run *run, struct kvm_vcpu *vcpu,
58extern int kvmppc_emulate_instruction(struct kvm_run *run, 50extern int kvmppc_emulate_instruction(struct kvm_run *run,
59 struct kvm_vcpu *vcpu); 51 struct kvm_vcpu *vcpu);
60extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu); 52extern int kvmppc_emulate_mmio(struct kvm_run *run, struct kvm_vcpu *vcpu);
53extern void kvmppc_emulate_dec(struct kvm_vcpu *vcpu);
61 54
62extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, 55extern void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr,
63 u64 asid, u32 flags); 56 u64 asid, u32 flags, u32 max_bytes,
64extern void kvmppc_mmu_invalidate(struct kvm_vcpu *vcpu, gva_t eaddr, 57 unsigned int gtlb_idx);
65 gva_t eend, u32 asid);
66extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode); 58extern void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode);
67extern void kvmppc_mmu_switch_pid(struct kvm_vcpu *vcpu, u32 pid); 59extern void kvmppc_mmu_switch_pid(struct kvm_vcpu *vcpu, u32 pid);
68 60
69/* XXX Book E specific */ 61/* Core-specific hooks */
70extern void kvmppc_tlbe_set_modified(struct kvm_vcpu *vcpu, unsigned int i); 62
71 63extern struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm,
72extern void kvmppc_check_and_deliver_interrupts(struct kvm_vcpu *vcpu); 64 unsigned int id);
73 65extern void kvmppc_core_vcpu_free(struct kvm_vcpu *vcpu);
74static inline void kvmppc_queue_exception(struct kvm_vcpu *vcpu, int exception) 66extern int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu);
75{ 67extern int kvmppc_core_check_processor_compat(void);
76 unsigned int priority = exception_priority[exception]; 68extern int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu,
77 set_bit(priority, &vcpu->arch.pending_exceptions); 69 struct kvm_translation *tr);
78} 70
79 71extern void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
80static inline void kvmppc_clear_exception(struct kvm_vcpu *vcpu, int exception) 72extern void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu);
81{ 73
82 unsigned int priority = exception_priority[exception]; 74extern void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu);
83 clear_bit(priority, &vcpu->arch.pending_exceptions); 75extern void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu);
84} 76
85 77extern void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu);
86/* Helper function for "full" MSR writes. No need to call this if only EE is 78extern int kvmppc_core_pending_dec(struct kvm_vcpu *vcpu);
87 * changing. */ 79extern void kvmppc_core_queue_program(struct kvm_vcpu *vcpu);
88static inline void kvmppc_set_msr(struct kvm_vcpu *vcpu, u32 new_msr) 80extern void kvmppc_core_queue_dec(struct kvm_vcpu *vcpu);
89{ 81extern void kvmppc_core_queue_external(struct kvm_vcpu *vcpu,
90 if ((new_msr & MSR_PR) != (vcpu->arch.msr & MSR_PR)) 82 struct kvm_interrupt *irq);
91 kvmppc_mmu_priv_switch(vcpu, new_msr & MSR_PR); 83
92 84extern int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
93 vcpu->arch.msr = new_msr; 85 unsigned int op, int *advance);
94 86extern int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs);
95 if (vcpu->arch.msr & MSR_WE) 87extern int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt);
96 kvm_vcpu_block(vcpu); 88
97} 89extern int kvmppc_booke_init(void);
98 90extern void kvmppc_booke_exit(void);
99static inline void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 new_pid)
100{
101 if (vcpu->arch.pid != new_pid) {
102 vcpu->arch.pid = new_pid;
103 vcpu->arch.swap_pid = 1;
104 }
105}
106 91
107extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu); 92extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu);
108 93
diff --git a/arch/powerpc/include/asm/mmu-44x.h b/arch/powerpc/include/asm/mmu-44x.h
index 8a97cfb08b7e..27cc6fdcd3b7 100644
--- a/arch/powerpc/include/asm/mmu-44x.h
+++ b/arch/powerpc/include/asm/mmu-44x.h
@@ -56,6 +56,7 @@
56#ifndef __ASSEMBLY__ 56#ifndef __ASSEMBLY__
57 57
58extern unsigned int tlb_44x_hwater; 58extern unsigned int tlb_44x_hwater;
59extern unsigned int tlb_44x_index;
59 60
60typedef struct { 61typedef struct {
61 unsigned int id; 62 unsigned int id;
diff --git a/arch/powerpc/include/asm/oprofile_impl.h b/arch/powerpc/include/asm/oprofile_impl.h
index 95035c602ba6..639dc96077ab 100644
--- a/arch/powerpc/include/asm/oprofile_impl.h
+++ b/arch/powerpc/include/asm/oprofile_impl.h
@@ -32,6 +32,12 @@ struct op_system_config {
32 unsigned long mmcr0; 32 unsigned long mmcr0;
33 unsigned long mmcr1; 33 unsigned long mmcr1;
34 unsigned long mmcra; 34 unsigned long mmcra;
35#ifdef CONFIG_OPROFILE_CELL
36 /* Register for oprofile user tool to check cell kernel profiling
37 * suport.
38 */
39 unsigned long cell_support;
40#endif
35#endif 41#endif
36 unsigned long enable_kernel; 42 unsigned long enable_kernel;
37 unsigned long enable_user; 43 unsigned long enable_user;
diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h
index cff30c0ef1ff..eead5c67197a 100644
--- a/arch/powerpc/include/asm/ps3.h
+++ b/arch/powerpc/include/asm/ps3.h
@@ -320,6 +320,7 @@ enum ps3_match_id {
320 320
321enum ps3_match_sub_id { 321enum ps3_match_sub_id {
322 PS3_MATCH_SUB_ID_GPU_FB = 1, 322 PS3_MATCH_SUB_ID_GPU_FB = 1,
323 PS3_MATCH_SUB_ID_GPU_RAMDISK = 2,
323}; 324};
324 325
325#define PS3_MODULE_ALIAS_EHCI "ps3:1:0" 326#define PS3_MODULE_ALIAS_EHCI "ps3:1:0"
@@ -332,6 +333,7 @@ enum ps3_match_sub_id {
332#define PS3_MODULE_ALIAS_STOR_FLASH "ps3:8:0" 333#define PS3_MODULE_ALIAS_STOR_FLASH "ps3:8:0"
333#define PS3_MODULE_ALIAS_SOUND "ps3:9:0" 334#define PS3_MODULE_ALIAS_SOUND "ps3:9:0"
334#define PS3_MODULE_ALIAS_GPU_FB "ps3:10:1" 335#define PS3_MODULE_ALIAS_GPU_FB "ps3:10:1"
336#define PS3_MODULE_ALIAS_GPU_RAMDISK "ps3:10:2"
335#define PS3_MODULE_ALIAS_LPM "ps3:11:0" 337#define PS3_MODULE_ALIAS_LPM "ps3:11:0"
336 338
337enum ps3_system_bus_device_type { 339enum ps3_system_bus_device_type {
diff --git a/arch/powerpc/include/asm/qe.h b/arch/powerpc/include/asm/qe.h
index edee15d269ea..a0a15311d0d8 100644
--- a/arch/powerpc/include/asm/qe.h
+++ b/arch/powerpc/include/asm/qe.h
@@ -17,6 +17,8 @@
17#ifdef __KERNEL__ 17#ifdef __KERNEL__
18 18
19#include <linux/spinlock.h> 19#include <linux/spinlock.h>
20#include <linux/errno.h>
21#include <linux/err.h>
20#include <asm/cpm.h> 22#include <asm/cpm.h>
21#include <asm/immap_qe.h> 23#include <asm/immap_qe.h>
22 24
@@ -84,7 +86,11 @@ static inline bool qe_clock_is_brg(enum qe_clock clk)
84extern spinlock_t cmxgcr_lock; 86extern spinlock_t cmxgcr_lock;
85 87
86/* Export QE common operations */ 88/* Export QE common operations */
89#ifdef CONFIG_QUICC_ENGINE
87extern void __init qe_reset(void); 90extern void __init qe_reset(void);
91#else
92static inline void qe_reset(void) {}
93#endif
88 94
89/* QE PIO */ 95/* QE PIO */
90#define QE_PIO_PINS 32 96#define QE_PIO_PINS 32
@@ -101,16 +107,43 @@ struct qe_pio_regs {
101#endif 107#endif
102}; 108};
103 109
104extern int par_io_init(struct device_node *np);
105extern int par_io_of_config(struct device_node *np);
106#define QE_PIO_DIR_IN 2 110#define QE_PIO_DIR_IN 2
107#define QE_PIO_DIR_OUT 1 111#define QE_PIO_DIR_OUT 1
108extern void __par_io_config_pin(struct qe_pio_regs __iomem *par_io, u8 pin, 112extern void __par_io_config_pin(struct qe_pio_regs __iomem *par_io, u8 pin,
109 int dir, int open_drain, int assignment, 113 int dir, int open_drain, int assignment,
110 int has_irq); 114 int has_irq);
115#ifdef CONFIG_QUICC_ENGINE
116extern int par_io_init(struct device_node *np);
117extern int par_io_of_config(struct device_node *np);
111extern int par_io_config_pin(u8 port, u8 pin, int dir, int open_drain, 118extern int par_io_config_pin(u8 port, u8 pin, int dir, int open_drain,
112 int assignment, int has_irq); 119 int assignment, int has_irq);
113extern int par_io_data_set(u8 port, u8 pin, u8 val); 120extern int par_io_data_set(u8 port, u8 pin, u8 val);
121#else
122static inline int par_io_init(struct device_node *np) { return -ENOSYS; }
123static inline int par_io_of_config(struct device_node *np) { return -ENOSYS; }
124static inline int par_io_config_pin(u8 port, u8 pin, int dir, int open_drain,
125 int assignment, int has_irq) { return -ENOSYS; }
126static inline int par_io_data_set(u8 port, u8 pin, u8 val) { return -ENOSYS; }
127#endif /* CONFIG_QUICC_ENGINE */
128
129/*
130 * Pin multiplexing functions.
131 */
132struct qe_pin;
133#ifdef CONFIG_QE_GPIO
134extern struct qe_pin *qe_pin_request(struct device_node *np, int index);
135extern void qe_pin_free(struct qe_pin *qe_pin);
136extern void qe_pin_set_gpio(struct qe_pin *qe_pin);
137extern void qe_pin_set_dedicated(struct qe_pin *pin);
138#else
139static inline struct qe_pin *qe_pin_request(struct device_node *np, int index)
140{
141 return ERR_PTR(-ENOSYS);
142}
143static inline void qe_pin_free(struct qe_pin *qe_pin) {}
144static inline void qe_pin_set_gpio(struct qe_pin *qe_pin) {}
145static inline void qe_pin_set_dedicated(struct qe_pin *pin) {}
146#endif /* CONFIG_QE_GPIO */
114 147
115/* QE internal API */ 148/* QE internal API */
116int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input); 149int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
diff --git a/arch/powerpc/include/asm/qe_ic.h b/arch/powerpc/include/asm/qe_ic.h
index 56a7745ca343..cf519663a791 100644
--- a/arch/powerpc/include/asm/qe_ic.h
+++ b/arch/powerpc/include/asm/qe_ic.h
@@ -17,6 +17,9 @@
17 17
18#include <linux/irq.h> 18#include <linux/irq.h>
19 19
20struct device_node;
21struct qe_ic;
22
20#define NUM_OF_QE_IC_GROUPS 6 23#define NUM_OF_QE_IC_GROUPS 6
21 24
22/* Flags when we init the QE IC */ 25/* Flags when we init the QE IC */
@@ -54,17 +57,27 @@ enum qe_ic_grp_id {
54 QE_IC_GRP_RISCB /* QE interrupt controller RISC group B */ 57 QE_IC_GRP_RISCB /* QE interrupt controller RISC group B */
55}; 58};
56 59
60#ifdef CONFIG_QUICC_ENGINE
57void qe_ic_init(struct device_node *node, unsigned int flags, 61void qe_ic_init(struct device_node *node, unsigned int flags,
58 void (*low_handler)(unsigned int irq, struct irq_desc *desc), 62 void (*low_handler)(unsigned int irq, struct irq_desc *desc),
59 void (*high_handler)(unsigned int irq, struct irq_desc *desc)); 63 void (*high_handler)(unsigned int irq, struct irq_desc *desc));
64unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic);
65unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic);
66#else
67static inline void qe_ic_init(struct device_node *node, unsigned int flags,
68 void (*low_handler)(unsigned int irq, struct irq_desc *desc),
69 void (*high_handler)(unsigned int irq, struct irq_desc *desc))
70{}
71static inline unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic)
72{ return 0; }
73static inline unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic)
74{ return 0; }
75#endif /* CONFIG_QUICC_ENGINE */
76
60void qe_ic_set_highest_priority(unsigned int virq, int high); 77void qe_ic_set_highest_priority(unsigned int virq, int high);
61int qe_ic_set_priority(unsigned int virq, unsigned int priority); 78int qe_ic_set_priority(unsigned int virq, unsigned int priority);
62int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high); 79int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high);
63 80
64struct qe_ic;
65unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic);
66unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic);
67
68static inline void qe_ic_cascade_low_ipic(unsigned int irq, 81static inline void qe_ic_cascade_low_ipic(unsigned int irq,
69 struct irq_desc *desc) 82 struct irq_desc *desc)
70{ 83{
diff --git a/arch/powerpc/include/asm/spu.h b/arch/powerpc/include/asm/spu.h
index 8b2eb044270a..0ab8d869e3d6 100644
--- a/arch/powerpc/include/asm/spu.h
+++ b/arch/powerpc/include/asm/spu.h
@@ -128,7 +128,7 @@ struct spu {
128 int number; 128 int number;
129 unsigned int irqs[3]; 129 unsigned int irqs[3];
130 u32 node; 130 u32 node;
131 u64 flags; 131 unsigned long flags;
132 u64 class_0_pending; 132 u64 class_0_pending;
133 u64 class_0_dar; 133 u64 class_0_dar;
134 u64 class_1_dar; 134 u64 class_1_dar;
diff --git a/arch/powerpc/include/asm/swab.h b/arch/powerpc/include/asm/swab.h
new file mode 100644
index 000000000000..ef824ae4b79c
--- /dev/null
+++ b/arch/powerpc/include/asm/swab.h
@@ -0,0 +1,90 @@
1#ifndef _ASM_POWERPC_SWAB_H
2#define _ASM_POWERPC_SWAB_H
3
4/*
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version
8 * 2 of the License, or (at your option) any later version.
9 */
10
11#include <asm/types.h>
12#include <linux/compiler.h>
13
14#ifdef __GNUC__
15
16#ifndef __powerpc64__
17#define __SWAB_64_THRU_32__
18#endif /* __powerpc64__ */
19
20#ifdef __KERNEL__
21
22static __inline__ __u16 ld_le16(const volatile __u16 *addr)
23{
24 __u16 val;
25
26 __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
27 return val;
28}
29#define __arch_swab16p ld_le16
30
31static __inline__ void st_le16(volatile __u16 *addr, const __u16 val)
32{
33 __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
34}
35
36static inline void __arch_swab16s(__u16 *addr)
37{
38 st_le16(addr, *addr);
39}
40#define __arch_swab16s __arch_swab16s
41
42static __inline__ __u32 ld_le32(const volatile __u32 *addr)
43{
44 __u32 val;
45
46 __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (addr), "m" (*addr));
47 return val;
48}
49#define __arch_swab32p ld_le32
50
51static __inline__ void st_le32(volatile __u32 *addr, const __u32 val)
52{
53 __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*addr) : "r" (val), "r" (addr));
54}
55
56static inline void __arch_swab32s(__u32 *addr)
57{
58 st_le32(addr, *addr);
59}
60#define __arch_swab32s __arch_swab32s
61
62static inline __attribute_const__ __u16 __arch_swab16(__u16 value)
63{
64 __u16 result;
65
66 __asm__("rlwimi %0,%1,8,16,23"
67 : "=r" (result)
68 : "r" (value), "0" (value >> 8));
69 return result;
70}
71#define __arch_swab16 __arch_swab16
72
73static inline __attribute_const__ __u32 __arch_swab32(__u32 value)
74{
75 __u32 result;
76
77 __asm__("rlwimi %0,%1,24,16,23\n\t"
78 "rlwimi %0,%1,8,8,15\n\t"
79 "rlwimi %0,%1,24,0,7"
80 : "=r" (result)
81 : "r" (value), "0" (value >> 24));
82 return result;
83}
84#define __arch_swab32 __arch_swab32
85
86#endif /* __KERNEL__ */
87
88#endif /* __GNUC__ */
89
90#endif /* _ASM_POWERPC_SWAB_H */
diff --git a/arch/powerpc/include/asm/topology.h b/arch/powerpc/include/asm/topology.h
index c32da6f97999..375258559ae6 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -22,11 +22,11 @@ static inline cpumask_t node_to_cpumask(int node)
22 return numa_cpumask_lookup_table[node]; 22 return numa_cpumask_lookup_table[node];
23} 23}
24 24
25#define cpumask_of_node(node) (&numa_cpumask_lookup_table[node])
26
25static inline int node_to_first_cpu(int node) 27static inline int node_to_first_cpu(int node)
26{ 28{
27 cpumask_t tmp; 29 return cpumask_first(cpumask_of_node(node));
28 tmp = node_to_cpumask(node);
29 return first_cpu(tmp);
30} 30}
31 31
32int of_node_to_nid(struct device_node *device); 32int of_node_to_nid(struct device_node *device);
@@ -46,9 +46,12 @@ static inline int pcibus_to_node(struct pci_bus *bus)
46 node_to_cpumask(pcibus_to_node(bus)) \ 46 node_to_cpumask(pcibus_to_node(bus)) \
47 ) 47 )
48 48
49#define cpumask_of_pcibus(bus) (pcibus_to_node(bus) == -1 ? \
50 cpu_all_mask : \
51 cpumask_of_node(pcibus_to_node(bus)))
52
49/* sched_domains SD_NODE_INIT for PPC64 machines */ 53/* sched_domains SD_NODE_INIT for PPC64 machines */
50#define SD_NODE_INIT (struct sched_domain) { \ 54#define SD_NODE_INIT (struct sched_domain) { \
51 .span = CPU_MASK_NONE, \
52 .parent = NULL, \ 55 .parent = NULL, \
53 .child = NULL, \ 56 .child = NULL, \
54 .groups = NULL, \ 57 .groups = NULL, \
@@ -109,6 +112,8 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
109 112
110#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) 113#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
111#define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu)) 114#define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu))
115#define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
116#define topology_core_cpumask(cpu) (&per_cpu(cpu_core_map, cpu))
112#define topology_core_id(cpu) (cpu_to_core_id(cpu)) 117#define topology_core_id(cpu) (cpu_to_core_id(cpu))
113#endif 118#endif
114#endif 119#endif
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 1308a86e9070..8d1a419df35d 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -29,7 +29,7 @@ endif
29obj-y := cputable.o ptrace.o syscalls.o \ 29obj-y := cputable.o ptrace.o syscalls.o \
30 irq.o align.o signal_32.o pmc.o vdso.o \ 30 irq.o align.o signal_32.o pmc.o vdso.o \
31 init_task.o process.o systbl.o idle.o \ 31 init_task.o process.o systbl.o idle.o \
32 signal.o sysfs.o 32 signal.o sysfs.o cacheinfo.o
33obj-y += vdso32/ 33obj-y += vdso32/
34obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \ 34obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \
35 signal_64.o ptrace32.o \ 35 signal_64.o ptrace32.o \
diff --git a/arch/powerpc/kernel/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 661d07d2146b..9937fe44555f 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -23,9 +23,6 @@
23#include <linux/mm.h> 23#include <linux/mm.h>
24#include <linux/suspend.h> 24#include <linux/suspend.h>
25#include <linux/hrtimer.h> 25#include <linux/hrtimer.h>
26#ifdef CONFIG_KVM
27#include <linux/kvm_host.h>
28#endif
29#ifdef CONFIG_PPC64 26#ifdef CONFIG_PPC64
30#include <linux/time.h> 27#include <linux/time.h>
31#include <linux/hardirq.h> 28#include <linux/hardirq.h>
@@ -51,6 +48,9 @@
51#ifdef CONFIG_PPC_ISERIES 48#ifdef CONFIG_PPC_ISERIES
52#include <asm/iseries/alpaca.h> 49#include <asm/iseries/alpaca.h>
53#endif 50#endif
51#ifdef CONFIG_KVM
52#include <asm/kvm_44x.h>
53#endif
54 54
55#if defined(CONFIG_BOOKE) || defined(CONFIG_40x) 55#if defined(CONFIG_BOOKE) || defined(CONFIG_40x)
56#include "head_booke.h" 56#include "head_booke.h"
@@ -357,12 +357,10 @@ int main(void)
357 DEFINE(PTE_SIZE, sizeof(pte_t)); 357 DEFINE(PTE_SIZE, sizeof(pte_t));
358 358
359#ifdef CONFIG_KVM 359#ifdef CONFIG_KVM
360 DEFINE(TLBE_BYTES, sizeof(struct tlbe)); 360 DEFINE(TLBE_BYTES, sizeof(struct kvmppc_44x_tlbe));
361 361
362 DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, arch.host_stack)); 362 DEFINE(VCPU_HOST_STACK, offsetof(struct kvm_vcpu, arch.host_stack));
363 DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid)); 363 DEFINE(VCPU_HOST_PID, offsetof(struct kvm_vcpu, arch.host_pid));
364 DEFINE(VCPU_SHADOW_TLB, offsetof(struct kvm_vcpu, arch.shadow_tlb));
365 DEFINE(VCPU_SHADOW_MOD, offsetof(struct kvm_vcpu, arch.shadow_tlb_mod));
366 DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr)); 364 DEFINE(VCPU_GPRS, offsetof(struct kvm_vcpu, arch.gpr));
367 DEFINE(VCPU_LR, offsetof(struct kvm_vcpu, arch.lr)); 365 DEFINE(VCPU_LR, offsetof(struct kvm_vcpu, arch.lr));
368 DEFINE(VCPU_CR, offsetof(struct kvm_vcpu, arch.cr)); 366 DEFINE(VCPU_CR, offsetof(struct kvm_vcpu, arch.cr));
@@ -385,5 +383,16 @@ int main(void)
385 DEFINE(PTE_T_LOG2, PTE_T_LOG2); 383 DEFINE(PTE_T_LOG2, PTE_T_LOG2);
386#endif 384#endif
387 385
386#ifdef CONFIG_KVM_EXIT_TIMING
387 DEFINE(VCPU_TIMING_EXIT_TBU, offsetof(struct kvm_vcpu,
388 arch.timing_exit.tv32.tbu));
389 DEFINE(VCPU_TIMING_EXIT_TBL, offsetof(struct kvm_vcpu,
390 arch.timing_exit.tv32.tbl));
391 DEFINE(VCPU_TIMING_LAST_ENTER_TBU, offsetof(struct kvm_vcpu,
392 arch.timing_last_enter.tv32.tbu));
393 DEFINE(VCPU_TIMING_LAST_ENTER_TBL, offsetof(struct kvm_vcpu,
394 arch.timing_last_enter.tv32.tbl));
395#endif
396
388 return 0; 397 return 0;
389} 398}
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
new file mode 100644
index 000000000000..b33f0417a4bf
--- /dev/null
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -0,0 +1,837 @@
1/*
2 * Processor cache information made available to userspace via sysfs;
3 * intended to be compatible with x86 intel_cacheinfo implementation.
4 *
5 * Copyright 2008 IBM Corporation
6 * Author: Nathan Lynch
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License version
10 * 2 as published by the Free Software Foundation.
11 */
12
13#include <linux/cpu.h>
14#include <linux/cpumask.h>
15#include <linux/init.h>
16#include <linux/kernel.h>
17#include <linux/kobject.h>
18#include <linux/list.h>
19#include <linux/notifier.h>
20#include <linux/of.h>
21#include <linux/percpu.h>
22#include <asm/prom.h>
23
24#include "cacheinfo.h"
25
26/* per-cpu object for tracking:
27 * - a "cache" kobject for the top-level directory
28 * - a list of "index" objects representing the cpu's local cache hierarchy
29 */
30struct cache_dir {
31 struct kobject *kobj; /* bare (not embedded) kobject for cache
32 * directory */
33 struct cache_index_dir *index; /* list of index objects */
34};
35
36/* "index" object: each cpu's cache directory has an index
37 * subdirectory corresponding to a cache object associated with the
38 * cpu. This object's lifetime is managed via the embedded kobject.
39 */
40struct cache_index_dir {
41 struct kobject kobj;
42 struct cache_index_dir *next; /* next index in parent directory */
43 struct cache *cache;
44};
45
46/* Template for determining which OF properties to query for a given
47 * cache type */
48struct cache_type_info {
49 const char *name;
50 const char *size_prop;
51
52 /* Allow for both [di]-cache-line-size and
53 * [di]-cache-block-size properties. According to the PowerPC
54 * Processor binding, -line-size should be provided if it
55 * differs from the cache block size (that which is operated
56 * on by cache instructions), so we look for -line-size first.
57 * See cache_get_line_size(). */
58
59 const char *line_size_props[2];
60 const char *nr_sets_prop;
61};
62
63/* These are used to index the cache_type_info array. */
64#define CACHE_TYPE_UNIFIED 0
65#define CACHE_TYPE_INSTRUCTION 1
66#define CACHE_TYPE_DATA 2
67
68static const struct cache_type_info cache_type_info[] = {
69 {
70 /* PowerPC Processor binding says the [di]-cache-*
71 * must be equal on unified caches, so just use
72 * d-cache properties. */
73 .name = "Unified",
74 .size_prop = "d-cache-size",
75 .line_size_props = { "d-cache-line-size",
76 "d-cache-block-size", },
77 .nr_sets_prop = "d-cache-sets",
78 },
79 {
80 .name = "Instruction",
81 .size_prop = "i-cache-size",
82 .line_size_props = { "i-cache-line-size",
83 "i-cache-block-size", },
84 .nr_sets_prop = "i-cache-sets",
85 },
86 {
87 .name = "Data",
88 .size_prop = "d-cache-size",
89 .line_size_props = { "d-cache-line-size",
90 "d-cache-block-size", },
91 .nr_sets_prop = "d-cache-sets",
92 },
93};
94
95/* Cache object: each instance of this corresponds to a distinct cache
96 * in the system. There are separate objects for Harvard caches: one
97 * each for instruction and data, and each refers to the same OF node.
98 * The refcount of the OF node is elevated for the lifetime of the
99 * cache object. A cache object is released when its shared_cpu_map
100 * is cleared (see cache_cpu_clear).
101 *
102 * A cache object is on two lists: an unsorted global list
103 * (cache_list) of cache objects; and a singly-linked list
104 * representing the local cache hierarchy, which is ordered by level
105 * (e.g. L1d -> L1i -> L2 -> L3).
106 */
107struct cache {
108 struct device_node *ofnode; /* OF node for this cache, may be cpu */
109 struct cpumask shared_cpu_map; /* online CPUs using this cache */
110 int type; /* split cache disambiguation */
111 int level; /* level not explicit in device tree */
112 struct list_head list; /* global list of cache objects */
113 struct cache *next_local; /* next cache of >= level */
114};
115
116static DEFINE_PER_CPU(struct cache_dir *, cache_dir);
117
118/* traversal/modification of this list occurs only at cpu hotplug time;
119 * access is serialized by cpu hotplug locking
120 */
121static LIST_HEAD(cache_list);
122
123static struct cache_index_dir *kobj_to_cache_index_dir(struct kobject *k)
124{
125 return container_of(k, struct cache_index_dir, kobj);
126}
127
128static const char *cache_type_string(const struct cache *cache)
129{
130 return cache_type_info[cache->type].name;
131}
132
133static void __cpuinit cache_init(struct cache *cache, int type, int level, struct device_node *ofnode)
134{
135 cache->type = type;
136 cache->level = level;
137 cache->ofnode = of_node_get(ofnode);
138 INIT_LIST_HEAD(&cache->list);
139 list_add(&cache->list, &cache_list);
140}
141
142static struct cache *__cpuinit new_cache(int type, int level, struct device_node *ofnode)
143{
144 struct cache *cache;
145
146 cache = kzalloc(sizeof(*cache), GFP_KERNEL);
147 if (cache)
148 cache_init(cache, type, level, ofnode);
149
150 return cache;
151}
152
153static void release_cache_debugcheck(struct cache *cache)
154{
155 struct cache *iter;
156
157 list_for_each_entry(iter, &cache_list, list)
158 WARN_ONCE(iter->next_local == cache,
159 "cache for %s(%s) refers to cache for %s(%s)\n",
160 iter->ofnode->full_name,
161 cache_type_string(iter),
162 cache->ofnode->full_name,
163 cache_type_string(cache));
164}
165
166static void release_cache(struct cache *cache)
167{
168 if (!cache)
169 return;
170
171 pr_debug("freeing L%d %s cache for %s\n", cache->level,
172 cache_type_string(cache), cache->ofnode->full_name);
173
174 release_cache_debugcheck(cache);
175 list_del(&cache->list);
176 of_node_put(cache->ofnode);
177 kfree(cache);
178}
179
180static void cache_cpu_set(struct cache *cache, int cpu)
181{
182 struct cache *next = cache;
183
184 while (next) {
185 WARN_ONCE(cpumask_test_cpu(cpu, &next->shared_cpu_map),
186 "CPU %i already accounted in %s(%s)\n",
187 cpu, next->ofnode->full_name,
188 cache_type_string(next));
189 cpumask_set_cpu(cpu, &next->shared_cpu_map);
190 next = next->next_local;
191 }
192}
193
194static int cache_size(const struct cache *cache, unsigned int *ret)
195{
196 const char *propname;
197 const u32 *cache_size;
198
199 propname = cache_type_info[cache->type].size_prop;
200
201 cache_size = of_get_property(cache->ofnode, propname, NULL);
202 if (!cache_size)
203 return -ENODEV;
204
205 *ret = *cache_size;
206 return 0;
207}
208
209static int cache_size_kb(const struct cache *cache, unsigned int *ret)
210{
211 unsigned int size;
212
213 if (cache_size(cache, &size))
214 return -ENODEV;
215
216 *ret = size / 1024;
217 return 0;
218}
219
220/* not cache_line_size() because that's a macro in include/linux/cache.h */
221static int cache_get_line_size(const struct cache *cache, unsigned int *ret)
222{
223 const u32 *line_size;
224 int i, lim;
225
226 lim = ARRAY_SIZE(cache_type_info[cache->type].line_size_props);
227
228 for (i = 0; i < lim; i++) {
229 const char *propname;
230
231 propname = cache_type_info[cache->type].line_size_props[i];
232 line_size = of_get_property(cache->ofnode, propname, NULL);
233 if (line_size)
234 break;
235 }
236
237 if (!line_size)
238 return -ENODEV;
239
240 *ret = *line_size;
241 return 0;
242}
243
244static int cache_nr_sets(const struct cache *cache, unsigned int *ret)
245{
246 const char *propname;
247 const u32 *nr_sets;
248
249 propname = cache_type_info[cache->type].nr_sets_prop;
250
251 nr_sets = of_get_property(cache->ofnode, propname, NULL);
252 if (!nr_sets)
253 return -ENODEV;
254
255 *ret = *nr_sets;
256 return 0;
257}
258
259static int cache_associativity(const struct cache *cache, unsigned int *ret)
260{
261 unsigned int line_size;
262 unsigned int nr_sets;
263 unsigned int size;
264
265 if (cache_nr_sets(cache, &nr_sets))
266 goto err;
267
268 /* If the cache is fully associative, there is no need to
269 * check the other properties.
270 */
271 if (nr_sets == 1) {
272 *ret = 0;
273 return 0;
274 }
275
276 if (cache_get_line_size(cache, &line_size))
277 goto err;
278 if (cache_size(cache, &size))
279 goto err;
280
281 if (!(nr_sets > 0 && size > 0 && line_size > 0))
282 goto err;
283
284 *ret = (size / nr_sets) / line_size;
285 return 0;
286err:
287 return -ENODEV;
288}
289
290/* helper for dealing with split caches */
291static struct cache *cache_find_first_sibling(struct cache *cache)
292{
293 struct cache *iter;
294
295 if (cache->type == CACHE_TYPE_UNIFIED)
296 return cache;
297
298 list_for_each_entry(iter, &cache_list, list)
299 if (iter->ofnode == cache->ofnode && iter->next_local == cache)
300 return iter;
301
302 return cache;
303}
304
305/* return the first cache on a local list matching node */
306static struct cache *cache_lookup_by_node(const struct device_node *node)
307{
308 struct cache *cache = NULL;
309 struct cache *iter;
310
311 list_for_each_entry(iter, &cache_list, list) {
312 if (iter->ofnode != node)
313 continue;
314 cache = cache_find_first_sibling(iter);
315 break;
316 }
317
318 return cache;
319}
320
321static bool cache_node_is_unified(const struct device_node *np)
322{
323 return of_get_property(np, "cache-unified", NULL);
324}
325
326static struct cache *__cpuinit cache_do_one_devnode_unified(struct device_node *node, int level)
327{
328 struct cache *cache;
329
330 pr_debug("creating L%d ucache for %s\n", level, node->full_name);
331
332 cache = new_cache(CACHE_TYPE_UNIFIED, level, node);
333
334 return cache;
335}
336
337static struct cache *__cpuinit cache_do_one_devnode_split(struct device_node *node, int level)
338{
339 struct cache *dcache, *icache;
340
341 pr_debug("creating L%d dcache and icache for %s\n", level,
342 node->full_name);
343
344 dcache = new_cache(CACHE_TYPE_DATA, level, node);
345 icache = new_cache(CACHE_TYPE_INSTRUCTION, level, node);
346
347 if (!dcache || !icache)
348 goto err;
349
350 dcache->next_local = icache;
351
352 return dcache;
353err:
354 release_cache(dcache);
355 release_cache(icache);
356 return NULL;
357}
358
359static struct cache *__cpuinit cache_do_one_devnode(struct device_node *node, int level)
360{
361 struct cache *cache;
362
363 if (cache_node_is_unified(node))
364 cache = cache_do_one_devnode_unified(node, level);
365 else
366 cache = cache_do_one_devnode_split(node, level);
367
368 return cache;
369}
370
371static struct cache *__cpuinit cache_lookup_or_instantiate(struct device_node *node, int level)
372{
373 struct cache *cache;
374
375 cache = cache_lookup_by_node(node);
376
377 WARN_ONCE(cache && cache->level != level,
378 "cache level mismatch on lookup (got %d, expected %d)\n",
379 cache->level, level);
380
381 if (!cache)
382 cache = cache_do_one_devnode(node, level);
383
384 return cache;
385}
386
387static void __cpuinit link_cache_lists(struct cache *smaller, struct cache *bigger)
388{
389 while (smaller->next_local) {
390 if (smaller->next_local == bigger)
391 return; /* already linked */
392 smaller = smaller->next_local;
393 }
394
395 smaller->next_local = bigger;
396}
397
398static void __cpuinit do_subsidiary_caches_debugcheck(struct cache *cache)
399{
400 WARN_ON_ONCE(cache->level != 1);
401 WARN_ON_ONCE(strcmp(cache->ofnode->type, "cpu"));
402}
403
404static void __cpuinit do_subsidiary_caches(struct cache *cache)
405{
406 struct device_node *subcache_node;
407 int level = cache->level;
408
409 do_subsidiary_caches_debugcheck(cache);
410
411 while ((subcache_node = of_find_next_cache_node(cache->ofnode))) {
412 struct cache *subcache;
413
414 level++;
415 subcache = cache_lookup_or_instantiate(subcache_node, level);
416 of_node_put(subcache_node);
417 if (!subcache)
418 break;
419
420 link_cache_lists(cache, subcache);
421 cache = subcache;
422 }
423}
424
425static struct cache *__cpuinit cache_chain_instantiate(unsigned int cpu_id)
426{
427 struct device_node *cpu_node;
428 struct cache *cpu_cache = NULL;
429
430 pr_debug("creating cache object(s) for CPU %i\n", cpu_id);
431
432 cpu_node = of_get_cpu_node(cpu_id, NULL);
433 WARN_ONCE(!cpu_node, "no OF node found for CPU %i\n", cpu_id);
434 if (!cpu_node)
435 goto out;
436
437 cpu_cache = cache_lookup_or_instantiate(cpu_node, 1);
438 if (!cpu_cache)
439 goto out;
440
441 do_subsidiary_caches(cpu_cache);
442
443 cache_cpu_set(cpu_cache, cpu_id);
444out:
445 of_node_put(cpu_node);
446
447 return cpu_cache;
448}
449
450static struct cache_dir *__cpuinit cacheinfo_create_cache_dir(unsigned int cpu_id)
451{
452 struct cache_dir *cache_dir;
453 struct sys_device *sysdev;
454 struct kobject *kobj = NULL;
455
456 sysdev = get_cpu_sysdev(cpu_id);
457 WARN_ONCE(!sysdev, "no sysdev for CPU %i\n", cpu_id);
458 if (!sysdev)
459 goto err;
460
461 kobj = kobject_create_and_add("cache", &sysdev->kobj);
462 if (!kobj)
463 goto err;
464
465 cache_dir = kzalloc(sizeof(*cache_dir), GFP_KERNEL);
466 if (!cache_dir)
467 goto err;
468
469 cache_dir->kobj = kobj;
470
471 WARN_ON_ONCE(per_cpu(cache_dir, cpu_id) != NULL);
472
473 per_cpu(cache_dir, cpu_id) = cache_dir;
474
475 return cache_dir;
476err:
477 kobject_put(kobj);
478 return NULL;
479}
480
481static void cache_index_release(struct kobject *kobj)
482{
483 struct cache_index_dir *index;
484
485 index = kobj_to_cache_index_dir(kobj);
486
487 pr_debug("freeing index directory for L%d %s cache\n",
488 index->cache->level, cache_type_string(index->cache));
489
490 kfree(index);
491}
492
493static ssize_t cache_index_show(struct kobject *k, struct attribute *attr, char *buf)
494{
495 struct kobj_attribute *kobj_attr;
496
497 kobj_attr = container_of(attr, struct kobj_attribute, attr);
498
499 return kobj_attr->show(k, kobj_attr, buf);
500}
501
502static struct cache *index_kobj_to_cache(struct kobject *k)
503{
504 struct cache_index_dir *index;
505
506 index = kobj_to_cache_index_dir(k);
507
508 return index->cache;
509}
510
511static ssize_t size_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
512{
513 unsigned int size_kb;
514 struct cache *cache;
515
516 cache = index_kobj_to_cache(k);
517
518 if (cache_size_kb(cache, &size_kb))
519 return -ENODEV;
520
521 return sprintf(buf, "%uK\n", size_kb);
522}
523
524static struct kobj_attribute cache_size_attr =
525 __ATTR(size, 0444, size_show, NULL);
526
527
528static ssize_t line_size_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
529{
530 unsigned int line_size;
531 struct cache *cache;
532
533 cache = index_kobj_to_cache(k);
534
535 if (cache_get_line_size(cache, &line_size))
536 return -ENODEV;
537
538 return sprintf(buf, "%u\n", line_size);
539}
540
541static struct kobj_attribute cache_line_size_attr =
542 __ATTR(coherency_line_size, 0444, line_size_show, NULL);
543
544static ssize_t nr_sets_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
545{
546 unsigned int nr_sets;
547 struct cache *cache;
548
549 cache = index_kobj_to_cache(k);
550
551 if (cache_nr_sets(cache, &nr_sets))
552 return -ENODEV;
553
554 return sprintf(buf, "%u\n", nr_sets);
555}
556
557static struct kobj_attribute cache_nr_sets_attr =
558 __ATTR(number_of_sets, 0444, nr_sets_show, NULL);
559
560static ssize_t associativity_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
561{
562 unsigned int associativity;
563 struct cache *cache;
564
565 cache = index_kobj_to_cache(k);
566
567 if (cache_associativity(cache, &associativity))
568 return -ENODEV;
569
570 return sprintf(buf, "%u\n", associativity);
571}
572
573static struct kobj_attribute cache_assoc_attr =
574 __ATTR(ways_of_associativity, 0444, associativity_show, NULL);
575
576static ssize_t type_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
577{
578 struct cache *cache;
579
580 cache = index_kobj_to_cache(k);
581
582 return sprintf(buf, "%s\n", cache_type_string(cache));
583}
584
585static struct kobj_attribute cache_type_attr =
586 __ATTR(type, 0444, type_show, NULL);
587
588static ssize_t level_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
589{
590 struct cache_index_dir *index;
591 struct cache *cache;
592
593 index = kobj_to_cache_index_dir(k);
594 cache = index->cache;
595
596 return sprintf(buf, "%d\n", cache->level);
597}
598
599static struct kobj_attribute cache_level_attr =
600 __ATTR(level, 0444, level_show, NULL);
601
602static ssize_t shared_cpu_map_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
603{
604 struct cache_index_dir *index;
605 struct cache *cache;
606 int len;
607 int n = 0;
608
609 index = kobj_to_cache_index_dir(k);
610 cache = index->cache;
611 len = PAGE_SIZE - 2;
612
613 if (len > 1) {
614 n = cpumask_scnprintf(buf, len, &cache->shared_cpu_map);
615 buf[n++] = '\n';
616 buf[n] = '\0';
617 }
618 return n;
619}
620
621static struct kobj_attribute cache_shared_cpu_map_attr =
622 __ATTR(shared_cpu_map, 0444, shared_cpu_map_show, NULL);
623
624/* Attributes which should always be created -- the kobject/sysfs core
625 * does this automatically via kobj_type->default_attrs. This is the
626 * minimum data required to uniquely identify a cache.
627 */
628static struct attribute *cache_index_default_attrs[] = {
629 &cache_type_attr.attr,
630 &cache_level_attr.attr,
631 &cache_shared_cpu_map_attr.attr,
632 NULL,
633};
634
635/* Attributes which should be created if the cache device node has the
636 * right properties -- see cacheinfo_create_index_opt_attrs
637 */
638static struct kobj_attribute *cache_index_opt_attrs[] = {
639 &cache_size_attr,
640 &cache_line_size_attr,
641 &cache_nr_sets_attr,
642 &cache_assoc_attr,
643};
644
645static struct sysfs_ops cache_index_ops = {
646 .show = cache_index_show,
647};
648
649static struct kobj_type cache_index_type = {
650 .release = cache_index_release,
651 .sysfs_ops = &cache_index_ops,
652 .default_attrs = cache_index_default_attrs,
653};
654
655static void __cpuinit cacheinfo_create_index_opt_attrs(struct cache_index_dir *dir)
656{
657 const char *cache_name;
658 const char *cache_type;
659 struct cache *cache;
660 char *buf;
661 int i;
662
663 buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
664 if (!buf)
665 return;
666
667 cache = dir->cache;
668 cache_name = cache->ofnode->full_name;
669 cache_type = cache_type_string(cache);
670
671 /* We don't want to create an attribute that can't provide a
672 * meaningful value. Check the return value of each optional
673 * attribute's ->show method before registering the
674 * attribute.
675 */
676 for (i = 0; i < ARRAY_SIZE(cache_index_opt_attrs); i++) {
677 struct kobj_attribute *attr;
678 ssize_t rc;
679
680 attr = cache_index_opt_attrs[i];
681
682 rc = attr->show(&dir->kobj, attr, buf);
683 if (rc <= 0) {
684 pr_debug("not creating %s attribute for "
685 "%s(%s) (rc = %zd)\n",
686 attr->attr.name, cache_name,
687 cache_type, rc);
688 continue;
689 }
690 if (sysfs_create_file(&dir->kobj, &attr->attr))
691 pr_debug("could not create %s attribute for %s(%s)\n",
692 attr->attr.name, cache_name, cache_type);
693 }
694
695 kfree(buf);
696}
697
698static void __cpuinit cacheinfo_create_index_dir(struct cache *cache, int index, struct cache_dir *cache_dir)
699{
700 struct cache_index_dir *index_dir;
701 int rc;
702
703 index_dir = kzalloc(sizeof(*index_dir), GFP_KERNEL);
704 if (!index_dir)
705 goto err;
706
707 index_dir->cache = cache;
708
709 rc = kobject_init_and_add(&index_dir->kobj, &cache_index_type,
710 cache_dir->kobj, "index%d", index);
711 if (rc)
712 goto err;
713
714 index_dir->next = cache_dir->index;
715 cache_dir->index = index_dir;
716
717 cacheinfo_create_index_opt_attrs(index_dir);
718
719 return;
720err:
721 kfree(index_dir);
722}
723
724static void __cpuinit cacheinfo_sysfs_populate(unsigned int cpu_id, struct cache *cache_list)
725{
726 struct cache_dir *cache_dir;
727 struct cache *cache;
728 int index = 0;
729
730 cache_dir = cacheinfo_create_cache_dir(cpu_id);
731 if (!cache_dir)
732 return;
733
734 cache = cache_list;
735 while (cache) {
736 cacheinfo_create_index_dir(cache, index, cache_dir);
737 index++;
738 cache = cache->next_local;
739 }
740}
741
742void __cpuinit cacheinfo_cpu_online(unsigned int cpu_id)
743{
744 struct cache *cache;
745
746 cache = cache_chain_instantiate(cpu_id);
747 if (!cache)
748 return;
749
750 cacheinfo_sysfs_populate(cpu_id, cache);
751}
752
753#ifdef CONFIG_HOTPLUG_CPU /* functions needed for cpu offline */
754
755static struct cache *cache_lookup_by_cpu(unsigned int cpu_id)
756{
757 struct device_node *cpu_node;
758 struct cache *cache;
759
760 cpu_node = of_get_cpu_node(cpu_id, NULL);
761 WARN_ONCE(!cpu_node, "no OF node found for CPU %i\n", cpu_id);
762 if (!cpu_node)
763 return NULL;
764
765 cache = cache_lookup_by_node(cpu_node);
766 of_node_put(cpu_node);
767
768 return cache;
769}
770
771static void remove_index_dirs(struct cache_dir *cache_dir)
772{
773 struct cache_index_dir *index;
774
775 index = cache_dir->index;
776
777 while (index) {
778 struct cache_index_dir *next;
779
780 next = index->next;
781 kobject_put(&index->kobj);
782 index = next;
783 }
784}
785
786static void remove_cache_dir(struct cache_dir *cache_dir)
787{
788 remove_index_dirs(cache_dir);
789
790 kobject_put(cache_dir->kobj);
791
792 kfree(cache_dir);
793}
794
795static void cache_cpu_clear(struct cache *cache, int cpu)
796{
797 while (cache) {
798 struct cache *next = cache->next_local;
799
800 WARN_ONCE(!cpumask_test_cpu(cpu, &cache->shared_cpu_map),
801 "CPU %i not accounted in %s(%s)\n",
802 cpu, cache->ofnode->full_name,
803 cache_type_string(cache));
804
805 cpumask_clear_cpu(cpu, &cache->shared_cpu_map);
806
807 /* Release the cache object if all the cpus using it
808 * are offline */
809 if (cpumask_empty(&cache->shared_cpu_map))
810 release_cache(cache);
811
812 cache = next;
813 }
814}
815
816void cacheinfo_cpu_offline(unsigned int cpu_id)
817{
818 struct cache_dir *cache_dir;
819 struct cache *cache;
820
821 /* Prevent userspace from seeing inconsistent state - remove
822 * the sysfs hierarchy first */
823 cache_dir = per_cpu(cache_dir, cpu_id);
824
825 /* careful, sysfs population may have failed */
826 if (cache_dir)
827 remove_cache_dir(cache_dir);
828
829 per_cpu(cache_dir, cpu_id) = NULL;
830
831 /* clear the CPU's bit in its cache chain, possibly freeing
832 * cache objects */
833 cache = cache_lookup_by_cpu(cpu_id);
834 if (cache)
835 cache_cpu_clear(cache, cpu_id);
836}
837#endif /* CONFIG_HOTPLUG_CPU */
diff --git a/arch/powerpc/kernel/cacheinfo.h b/arch/powerpc/kernel/cacheinfo.h
new file mode 100644
index 000000000000..a7b74d36acd7
--- /dev/null
+++ b/arch/powerpc/kernel/cacheinfo.h
@@ -0,0 +1,8 @@
1#ifndef _PPC_CACHEINFO_H
2#define _PPC_CACHEINFO_H
3
4/* These are just hooks for sysfs.c to use. */
5extern void cacheinfo_cpu_online(unsigned int cpu_id);
6extern void cacheinfo_cpu_offline(unsigned int cpu_id);
7
8#endif /* _PPC_CACHEINFO_H */
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index ac222d0ab12e..23b8b5e36f98 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -237,7 +237,7 @@ void fixup_irqs(cpumask_t map)
237 mask = map; 237 mask = map;
238 } 238 }
239 if (irq_desc[irq].chip->set_affinity) 239 if (irq_desc[irq].chip->set_affinity)
240 irq_desc[irq].chip->set_affinity(irq, mask); 240 irq_desc[irq].chip->set_affinity(irq, &mask);
241 else if (irq_desc[irq].action && !(warned++)) 241 else if (irq_desc[irq].action && !(warned++))
242 printk("Cannot set affinity for irq %i\n", irq); 242 printk("Cannot set affinity for irq %i\n", irq);
243 } 243 }
diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c
index de79915452c8..c9329786073b 100644
--- a/arch/powerpc/kernel/kprobes.c
+++ b/arch/powerpc/kernel/kprobes.c
@@ -96,9 +96,10 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
96 96
97void __kprobes arch_remove_kprobe(struct kprobe *p) 97void __kprobes arch_remove_kprobe(struct kprobe *p)
98{ 98{
99 mutex_lock(&kprobe_mutex); 99 if (p->ainsn.insn) {
100 free_insn_slot(p->ainsn.insn, 0); 100 free_insn_slot(p->ainsn.insn, 0);
101 mutex_unlock(&kprobe_mutex); 101 p->ainsn.insn = NULL;
102 }
102} 103}
103 104
104static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 105static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
@@ -316,7 +317,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
316 /* 317 /*
317 * It is possible to have multiple instances associated with a given 318 * It is possible to have multiple instances associated with a given
318 * task either because an multiple functions in the call path 319 * task either because an multiple functions in the call path
319 * have a return probe installed on them, and/or more then one return 320 * have a return probe installed on them, and/or more than one return
320 * return probe was registered for a target function. 321 * return probe was registered for a target function.
321 * 322 *
322 * We can handle this because: 323 * We can handle this because:
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 2538030954d8..da5a3855a0c4 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -16,7 +16,7 @@
16 * 2 of the License, or (at your option) any later version. 16 * 2 of the License, or (at your option) any later version.
17 */ 17 */
18 18
19#undef DEBUG 19#define DEBUG
20 20
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/pci.h> 22#include <linux/pci.h>
@@ -1356,6 +1356,63 @@ static void __init pcibios_allocate_resources(int pass)
1356 } 1356 }
1357} 1357}
1358 1358
1359static void __init pcibios_reserve_legacy_regions(struct pci_bus *bus)
1360{
1361 struct pci_controller *hose = pci_bus_to_host(bus);
1362 resource_size_t offset;
1363 struct resource *res, *pres;
1364 int i;
1365
1366 pr_debug("Reserving legacy ranges for domain %04x\n", pci_domain_nr(bus));
1367
1368 /* Check for IO */
1369 if (!(hose->io_resource.flags & IORESOURCE_IO))
1370 goto no_io;
1371 offset = (unsigned long)hose->io_base_virt - _IO_BASE;
1372 res = kzalloc(sizeof(struct resource), GFP_KERNEL);
1373 BUG_ON(res == NULL);
1374 res->name = "Legacy IO";
1375 res->flags = IORESOURCE_IO;
1376 res->start = offset;
1377 res->end = (offset + 0xfff) & 0xfffffffful;
1378 pr_debug("Candidate legacy IO: %pR\n", res);
1379 if (request_resource(&hose->io_resource, res)) {
1380 printk(KERN_DEBUG
1381 "PCI %04x:%02x Cannot reserve Legacy IO %pR\n",
1382 pci_domain_nr(bus), bus->number, res);
1383 kfree(res);
1384 }
1385
1386 no_io:
1387 /* Check for memory */
1388 offset = hose->pci_mem_offset;
1389 pr_debug("hose mem offset: %016llx\n", (unsigned long long)offset);
1390 for (i = 0; i < 3; i++) {
1391 pres = &hose->mem_resources[i];
1392 if (!(pres->flags & IORESOURCE_MEM))
1393 continue;
1394 pr_debug("hose mem res: %pR\n", pres);
1395 if ((pres->start - offset) <= 0xa0000 &&
1396 (pres->end - offset) >= 0xbffff)
1397 break;
1398 }
1399 if (i >= 3)
1400 return;
1401 res = kzalloc(sizeof(struct resource), GFP_KERNEL);
1402 BUG_ON(res == NULL);
1403 res->name = "Legacy VGA memory";
1404 res->flags = IORESOURCE_MEM;
1405 res->start = 0xa0000 + offset;
1406 res->end = 0xbffff + offset;
1407 pr_debug("Candidate VGA memory: %pR\n", res);
1408 if (request_resource(pres, res)) {
1409 printk(KERN_DEBUG
1410 "PCI %04x:%02x Cannot reserve VGA memory %pR\n",
1411 pci_domain_nr(bus), bus->number, res);
1412 kfree(res);
1413 }
1414}
1415
1359void __init pcibios_resource_survey(void) 1416void __init pcibios_resource_survey(void)
1360{ 1417{
1361 struct pci_bus *b; 1418 struct pci_bus *b;
@@ -1371,6 +1428,18 @@ void __init pcibios_resource_survey(void)
1371 pcibios_allocate_resources(1); 1428 pcibios_allocate_resources(1);
1372 } 1429 }
1373 1430
1431 /* Before we start assigning unassigned resource, we try to reserve
1432 * the low IO area and the VGA memory area if they intersect the
1433 * bus available resources to avoid allocating things on top of them
1434 */
1435 if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
1436 list_for_each_entry(b, &pci_root_buses, node)
1437 pcibios_reserve_legacy_regions(b);
1438 }
1439
1440 /* Now, if the platform didn't decide to blindly trust the firmware,
1441 * we proceed to assigning things that were left unassigned
1442 */
1374 if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) { 1443 if (!(ppc_pci_flags & PPC_PCI_PROBE_ONLY)) {
1375 pr_debug("PCI: Assigning unassigned resouces...\n"); 1444 pr_debug("PCI: Assigning unassigned resouces...\n");
1376 pci_assign_unassigned_resources(); 1445 pci_assign_unassigned_resources();
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 39fadc6e1492..586962f65c2a 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -560,9 +560,14 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
560 * G5 machines... So when something asks for bus 0 io base 560 * G5 machines... So when something asks for bus 0 io base
561 * (bus 0 is HT root), we return the AGP one instead. 561 * (bus 0 is HT root), we return the AGP one instead.
562 */ 562 */
563 if (machine_is_compatible("MacRISC4")) 563 if (in_bus == 0 && machine_is_compatible("MacRISC4")) {
564 if (in_bus == 0) 564 struct device_node *agp;
565
566 agp = of_find_compatible_node(NULL, NULL, "u3-agp");
567 if (agp)
565 in_bus = 0xf0; 568 in_bus = 0xf0;
569 of_node_put(agp);
570 }
566 571
567 /* That syscall isn't quite compatible with PCI domains, but it's 572 /* That syscall isn't quite compatible with PCI domains, but it's
568 * used on pre-domains setup. We return the first match 573 * used on pre-domains setup. We return the first match
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index dcec1325d340..c8b27bb4dbde 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -165,6 +165,7 @@ EXPORT_SYMBOL(timer_interrupt);
165EXPORT_SYMBOL(irq_desc); 165EXPORT_SYMBOL(irq_desc);
166EXPORT_SYMBOL(tb_ticks_per_jiffy); 166EXPORT_SYMBOL(tb_ticks_per_jiffy);
167EXPORT_SYMBOL(cacheable_memcpy); 167EXPORT_SYMBOL(cacheable_memcpy);
168EXPORT_SYMBOL(cacheable_memzero);
168#endif 169#endif
169 170
170#ifdef CONFIG_PPC32 171#ifdef CONFIG_PPC32
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 51b201ddf9a1..fb7049c054c0 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -33,6 +33,7 @@
33#include <linux/mqueue.h> 33#include <linux/mqueue.h>
34#include <linux/hardirq.h> 34#include <linux/hardirq.h>
35#include <linux/utsname.h> 35#include <linux/utsname.h>
36#include <linux/kernel_stat.h>
36 37
37#include <asm/pgtable.h> 38#include <asm/pgtable.h>
38#include <asm/uaccess.h> 39#include <asm/uaccess.h>
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 6f73c739f1e2..c09cffafb6ee 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -824,11 +824,11 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
824#endif 824#endif
825 825
826#ifdef CONFIG_KEXEC 826#ifdef CONFIG_KEXEC
827 lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL); 827 lprop = of_get_flat_dt_prop(node, "linux,crashkernel-base", NULL);
828 if (lprop) 828 if (lprop)
829 crashk_res.start = *lprop; 829 crashk_res.start = *lprop;
830 830
831 lprop = (u64*)of_get_flat_dt_prop(node, "linux,crashkernel-size", NULL); 831 lprop = of_get_flat_dt_prop(node, "linux,crashkernel-size", NULL);
832 if (lprop) 832 if (lprop)
833 crashk_res.end = crashk_res.start + *lprop - 1; 833 crashk_res.end = crashk_res.start + *lprop - 1;
834#endif 834#endif
@@ -893,12 +893,12 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
893 u64 base, size, lmb_size; 893 u64 base, size, lmb_size;
894 unsigned int is_kexec_kdump = 0, rngs; 894 unsigned int is_kexec_kdump = 0, rngs;
895 895
896 ls = (cell_t *)of_get_flat_dt_prop(node, "ibm,lmb-size", &l); 896 ls = of_get_flat_dt_prop(node, "ibm,lmb-size", &l);
897 if (ls == NULL || l < dt_root_size_cells * sizeof(cell_t)) 897 if (ls == NULL || l < dt_root_size_cells * sizeof(cell_t))
898 return 0; 898 return 0;
899 lmb_size = dt_mem_next_cell(dt_root_size_cells, &ls); 899 lmb_size = dt_mem_next_cell(dt_root_size_cells, &ls);
900 900
901 dm = (cell_t *)of_get_flat_dt_prop(node, "ibm,dynamic-memory", &l); 901 dm = of_get_flat_dt_prop(node, "ibm,dynamic-memory", &l);
902 if (dm == NULL || l < sizeof(cell_t)) 902 if (dm == NULL || l < sizeof(cell_t))
903 return 0; 903 return 0;
904 904
@@ -907,7 +907,7 @@ static int __init early_init_dt_scan_drconf_memory(unsigned long node)
907 return 0; 907 return 0;
908 908
909 /* check if this is a kexec/kdump kernel. */ 909 /* check if this is a kexec/kdump kernel. */
910 usm = (cell_t *)of_get_flat_dt_prop(node, "linux,drconf-usable-memory", 910 usm = of_get_flat_dt_prop(node, "linux,drconf-usable-memory",
911 &l); 911 &l);
912 if (usm != NULL) 912 if (usm != NULL)
913 is_kexec_kdump = 1; 913 is_kexec_kdump = 1;
@@ -981,9 +981,9 @@ static int __init early_init_dt_scan_memory(unsigned long node,
981 } else if (strcmp(type, "memory") != 0) 981 } else if (strcmp(type, "memory") != 0)
982 return 0; 982 return 0;
983 983
984 reg = (cell_t *)of_get_flat_dt_prop(node, "linux,usable-memory", &l); 984 reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
985 if (reg == NULL) 985 if (reg == NULL)
986 reg = (cell_t *)of_get_flat_dt_prop(node, "reg", &l); 986 reg = of_get_flat_dt_prop(node, "reg", &l);
987 if (reg == NULL) 987 if (reg == NULL)
988 return 0; 988 return 0;
989 989
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 2445945d3761..7f1b33d5e30d 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -1210,7 +1210,7 @@ static void __init prom_initialize_tce_table(void)
1210 /* Initialize the table to have a one-to-one mapping 1210 /* Initialize the table to have a one-to-one mapping
1211 * over the allocated size. 1211 * over the allocated size.
1212 */ 1212 */
1213 tce_entryp = (unsigned long *)base; 1213 tce_entryp = (u64 *)base;
1214 for (i = 0; i < (minsize >> 3) ;tce_entryp++, i++) { 1214 for (i = 0; i < (minsize >> 3) ;tce_entryp++, i++) {
1215 tce_entry = (i << PAGE_SHIFT); 1215 tce_entry = (i << PAGE_SHIFT);
1216 tce_entry |= 0x3; 1216 tce_entry |= 0x3;
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 8c1335566089..8f0856f312da 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -232,11 +232,6 @@ int of_pci_address_to_resource(struct device_node *dev, int bar,
232} 232}
233EXPORT_SYMBOL_GPL(of_pci_address_to_resource); 233EXPORT_SYMBOL_GPL(of_pci_address_to_resource);
234 234
235static u8 of_irq_pci_swizzle(u8 slot, u8 pin)
236{
237 return (((pin - 1) + slot) % 4) + 1;
238}
239
240int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) 235int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
241{ 236{
242 struct device_node *dn, *ppnode; 237 struct device_node *dn, *ppnode;
@@ -306,7 +301,7 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
306 /* We can only get here if we hit a P2P bridge with no node, 301 /* We can only get here if we hit a P2P bridge with no node,
307 * let's do standard swizzling and try again 302 * let's do standard swizzling and try again
308 */ 303 */
309 lspec = of_irq_pci_swizzle(PCI_SLOT(pdev->devfn), lspec); 304 lspec = pci_swizzle_interrupt_pin(pdev, lspec);
310 pdev = ppdev; 305 pdev = ppdev;
311 } 306 }
312 307
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 8ac3f721d235..65484b2200b3 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -59,13 +59,9 @@
59 59
60struct thread_info *secondary_ti; 60struct thread_info *secondary_ti;
61 61
62cpumask_t cpu_possible_map = CPU_MASK_NONE;
63cpumask_t cpu_online_map = CPU_MASK_NONE;
64DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; 62DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE;
65DEFINE_PER_CPU(cpumask_t, cpu_core_map) = CPU_MASK_NONE; 63DEFINE_PER_CPU(cpumask_t, cpu_core_map) = CPU_MASK_NONE;
66 64
67EXPORT_SYMBOL(cpu_online_map);
68EXPORT_SYMBOL(cpu_possible_map);
69EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); 65EXPORT_PER_CPU_SYMBOL(cpu_sibling_map);
70EXPORT_PER_CPU_SYMBOL(cpu_core_map); 66EXPORT_PER_CPU_SYMBOL(cpu_core_map);
71 67
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 0c64f10087b9..4a2ee08af6a7 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -18,6 +18,8 @@
18#include <asm/machdep.h> 18#include <asm/machdep.h>
19#include <asm/smp.h> 19#include <asm/smp.h>
20 20
21#include "cacheinfo.h"
22
21#ifdef CONFIG_PPC64 23#ifdef CONFIG_PPC64
22#include <asm/paca.h> 24#include <asm/paca.h>
23#include <asm/lppaca.h> 25#include <asm/lppaca.h>
@@ -25,8 +27,6 @@
25 27
26static DEFINE_PER_CPU(struct cpu, cpu_devices); 28static DEFINE_PER_CPU(struct cpu, cpu_devices);
27 29
28static DEFINE_PER_CPU(struct kobject *, cache_toplevel);
29
30/* 30/*
31 * SMT snooze delay stuff, 64-bit only for now 31 * SMT snooze delay stuff, 64-bit only for now
32 */ 32 */
@@ -343,283 +343,6 @@ static struct sysdev_attribute pa6t_attrs[] = {
343#endif /* HAS_PPC_PMC_PA6T */ 343#endif /* HAS_PPC_PMC_PA6T */
344#endif /* HAS_PPC_PMC_CLASSIC */ 344#endif /* HAS_PPC_PMC_CLASSIC */
345 345
346struct cache_desc {
347 struct kobject kobj;
348 struct cache_desc *next;
349 const char *type; /* Instruction, Data, or Unified */
350 u32 size; /* total cache size in KB */
351 u32 line_size; /* in bytes */
352 u32 nr_sets; /* number of sets */
353 u32 level; /* e.g. 1, 2, 3... */
354 u32 associativity; /* e.g. 8-way... 0 is fully associative */
355};
356
357DEFINE_PER_CPU(struct cache_desc *, cache_desc);
358
359static struct cache_desc *kobj_to_cache_desc(struct kobject *k)
360{
361 return container_of(k, struct cache_desc, kobj);
362}
363
364static void cache_desc_release(struct kobject *k)
365{
366 struct cache_desc *desc = kobj_to_cache_desc(k);
367
368 pr_debug("%s: releasing %s\n", __func__, kobject_name(k));
369
370 if (desc->next)
371 kobject_put(&desc->next->kobj);
372
373 kfree(kobj_to_cache_desc(k));
374}
375
376static ssize_t cache_desc_show(struct kobject *k, struct attribute *attr, char *buf)
377{
378 struct kobj_attribute *kobj_attr;
379
380 kobj_attr = container_of(attr, struct kobj_attribute, attr);
381
382 return kobj_attr->show(k, kobj_attr, buf);
383}
384
385static struct sysfs_ops cache_desc_sysfs_ops = {
386 .show = cache_desc_show,
387};
388
389static struct kobj_type cache_desc_type = {
390 .release = cache_desc_release,
391 .sysfs_ops = &cache_desc_sysfs_ops,
392};
393
394static ssize_t cache_size_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
395{
396 struct cache_desc *cache = kobj_to_cache_desc(k);
397
398 return sprintf(buf, "%uK\n", cache->size);
399}
400
401static struct kobj_attribute cache_size_attr =
402 __ATTR(size, 0444, cache_size_show, NULL);
403
404static ssize_t cache_line_size_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
405{
406 struct cache_desc *cache = kobj_to_cache_desc(k);
407
408 return sprintf(buf, "%u\n", cache->line_size);
409}
410
411static struct kobj_attribute cache_line_size_attr =
412 __ATTR(coherency_line_size, 0444, cache_line_size_show, NULL);
413
414static ssize_t cache_nr_sets_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
415{
416 struct cache_desc *cache = kobj_to_cache_desc(k);
417
418 return sprintf(buf, "%u\n", cache->nr_sets);
419}
420
421static struct kobj_attribute cache_nr_sets_attr =
422 __ATTR(number_of_sets, 0444, cache_nr_sets_show, NULL);
423
424static ssize_t cache_type_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
425{
426 struct cache_desc *cache = kobj_to_cache_desc(k);
427
428 return sprintf(buf, "%s\n", cache->type);
429}
430
431static struct kobj_attribute cache_type_attr =
432 __ATTR(type, 0444, cache_type_show, NULL);
433
434static ssize_t cache_level_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
435{
436 struct cache_desc *cache = kobj_to_cache_desc(k);
437
438 return sprintf(buf, "%u\n", cache->level);
439}
440
441static struct kobj_attribute cache_level_attr =
442 __ATTR(level, 0444, cache_level_show, NULL);
443
444static ssize_t cache_assoc_show(struct kobject *k, struct kobj_attribute *attr, char *buf)
445{
446 struct cache_desc *cache = kobj_to_cache_desc(k);
447
448 return sprintf(buf, "%u\n", cache->associativity);
449}
450
451static struct kobj_attribute cache_assoc_attr =
452 __ATTR(ways_of_associativity, 0444, cache_assoc_show, NULL);
453
454struct cache_desc_info {
455 const char *type;
456 const char *size_prop;
457 const char *line_size_prop;
458 const char *nr_sets_prop;
459};
460
461/* PowerPC Processor binding says the [di]-cache-* must be equal on
462 * unified caches, so just use d-cache properties. */
463static struct cache_desc_info ucache_info = {
464 .type = "Unified",
465 .size_prop = "d-cache-size",
466 .line_size_prop = "d-cache-line-size",
467 .nr_sets_prop = "d-cache-sets",
468};
469
470static struct cache_desc_info dcache_info = {
471 .type = "Data",
472 .size_prop = "d-cache-size",
473 .line_size_prop = "d-cache-line-size",
474 .nr_sets_prop = "d-cache-sets",
475};
476
477static struct cache_desc_info icache_info = {
478 .type = "Instruction",
479 .size_prop = "i-cache-size",
480 .line_size_prop = "i-cache-line-size",
481 .nr_sets_prop = "i-cache-sets",
482};
483
484static struct cache_desc * __cpuinit create_cache_desc(struct device_node *np, struct kobject *parent, int index, int level, struct cache_desc_info *info)
485{
486 const u32 *cache_line_size;
487 struct cache_desc *new;
488 const u32 *cache_size;
489 const u32 *nr_sets;
490 int rc;
491
492 new = kzalloc(sizeof(*new), GFP_KERNEL);
493 if (!new)
494 return NULL;
495
496 rc = kobject_init_and_add(&new->kobj, &cache_desc_type, parent,
497 "index%d", index);
498 if (rc)
499 goto err;
500
501 /* type */
502 new->type = info->type;
503 rc = sysfs_create_file(&new->kobj, &cache_type_attr.attr);
504 WARN_ON(rc);
505
506 /* level */
507 new->level = level;
508 rc = sysfs_create_file(&new->kobj, &cache_level_attr.attr);
509 WARN_ON(rc);
510
511 /* size */
512 cache_size = of_get_property(np, info->size_prop, NULL);
513 if (cache_size) {
514 new->size = *cache_size / 1024;
515 rc = sysfs_create_file(&new->kobj,
516 &cache_size_attr.attr);
517 WARN_ON(rc);
518 }
519
520 /* coherency_line_size */
521 cache_line_size = of_get_property(np, info->line_size_prop, NULL);
522 if (cache_line_size) {
523 new->line_size = *cache_line_size;
524 rc = sysfs_create_file(&new->kobj,
525 &cache_line_size_attr.attr);
526 WARN_ON(rc);
527 }
528
529 /* number_of_sets */
530 nr_sets = of_get_property(np, info->nr_sets_prop, NULL);
531 if (nr_sets) {
532 new->nr_sets = *nr_sets;
533 rc = sysfs_create_file(&new->kobj,
534 &cache_nr_sets_attr.attr);
535 WARN_ON(rc);
536 }
537
538 /* ways_of_associativity */
539 if (new->nr_sets == 1) {
540 /* fully associative */
541 new->associativity = 0;
542 goto create_assoc;
543 }
544
545 if (new->nr_sets && new->size && new->line_size) {
546 /* If we have values for all of these we can derive
547 * the associativity. */
548 new->associativity =
549 ((new->size * 1024) / new->nr_sets) / new->line_size;
550create_assoc:
551 rc = sysfs_create_file(&new->kobj,
552 &cache_assoc_attr.attr);
553 WARN_ON(rc);
554 }
555
556 return new;
557err:
558 kfree(new);
559 return NULL;
560}
561
562static bool cache_is_unified(struct device_node *np)
563{
564 return of_get_property(np, "cache-unified", NULL);
565}
566
567static struct cache_desc * __cpuinit create_cache_index_info(struct device_node *np, struct kobject *parent, int index, int level)
568{
569 struct device_node *next_cache;
570 struct cache_desc *new, **end;
571
572 pr_debug("%s(node = %s, index = %d)\n", __func__, np->full_name, index);
573
574 if (cache_is_unified(np)) {
575 new = create_cache_desc(np, parent, index, level,
576 &ucache_info);
577 } else {
578 new = create_cache_desc(np, parent, index, level,
579 &dcache_info);
580 if (new) {
581 index++;
582 new->next = create_cache_desc(np, parent, index, level,
583 &icache_info);
584 }
585 }
586 if (!new)
587 return NULL;
588
589 end = &new->next;
590 while (*end)
591 end = &(*end)->next;
592
593 next_cache = of_find_next_cache_node(np);
594 if (!next_cache)
595 goto out;
596
597 *end = create_cache_index_info(next_cache, parent, ++index, ++level);
598
599 of_node_put(next_cache);
600out:
601 return new;
602}
603
604static void __cpuinit create_cache_info(struct sys_device *sysdev)
605{
606 struct kobject *cache_toplevel;
607 struct device_node *np = NULL;
608 int cpu = sysdev->id;
609
610 cache_toplevel = kobject_create_and_add("cache", &sysdev->kobj);
611 if (!cache_toplevel)
612 return;
613 per_cpu(cache_toplevel, cpu) = cache_toplevel;
614 np = of_get_cpu_node(cpu, NULL);
615 if (np != NULL) {
616 per_cpu(cache_desc, cpu) =
617 create_cache_index_info(np, cache_toplevel, 0, 1);
618 of_node_put(np);
619 }
620 return;
621}
622
623static void __cpuinit register_cpu_online(unsigned int cpu) 346static void __cpuinit register_cpu_online(unsigned int cpu)
624{ 347{
625 struct cpu *c = &per_cpu(cpu_devices, cpu); 348 struct cpu *c = &per_cpu(cpu_devices, cpu);
@@ -684,25 +407,10 @@ static void __cpuinit register_cpu_online(unsigned int cpu)
684 sysdev_create_file(s, &attr_dscr); 407 sysdev_create_file(s, &attr_dscr);
685#endif /* CONFIG_PPC64 */ 408#endif /* CONFIG_PPC64 */
686 409
687 create_cache_info(s); 410 cacheinfo_cpu_online(cpu);
688} 411}
689 412
690#ifdef CONFIG_HOTPLUG_CPU 413#ifdef CONFIG_HOTPLUG_CPU
691static void remove_cache_info(struct sys_device *sysdev)
692{
693 struct kobject *cache_toplevel;
694 struct cache_desc *cache_desc;
695 int cpu = sysdev->id;
696
697 cache_desc = per_cpu(cache_desc, cpu);
698 if (cache_desc != NULL)
699 kobject_put(&cache_desc->kobj);
700
701 cache_toplevel = per_cpu(cache_toplevel, cpu);
702 if (cache_toplevel != NULL)
703 kobject_put(cache_toplevel);
704}
705
706static void unregister_cpu_online(unsigned int cpu) 414static void unregister_cpu_online(unsigned int cpu)
707{ 415{
708 struct cpu *c = &per_cpu(cpu_devices, cpu); 416 struct cpu *c = &per_cpu(cpu_devices, cpu);
@@ -769,7 +477,7 @@ static void unregister_cpu_online(unsigned int cpu)
769 sysdev_remove_file(s, &attr_dscr); 477 sysdev_remove_file(s, &attr_dscr);
770#endif /* CONFIG_PPC64 */ 478#endif /* CONFIG_PPC64 */
771 479
772 remove_cache_info(s); 480 cacheinfo_cpu_offline(cpu);
773} 481}
774#endif /* CONFIG_HOTPLUG_CPU */ 482#endif /* CONFIG_HOTPLUG_CPU */
775 483
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index e1f3a5140429..c9564031a2a9 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -256,8 +256,10 @@ void account_system_vtime(struct task_struct *tsk)
256 delta += sys_time; 256 delta += sys_time;
257 get_paca()->system_time = 0; 257 get_paca()->system_time = 0;
258 } 258 }
259 account_system_time(tsk, 0, delta); 259 if (in_irq() || idle_task(smp_processor_id()) != tsk)
260 account_system_time_scaled(tsk, deltascaled); 260 account_system_time(tsk, 0, delta, deltascaled);
261 else
262 account_idle_time(delta);
261 per_cpu(cputime_last_delta, smp_processor_id()) = delta; 263 per_cpu(cputime_last_delta, smp_processor_id()) = delta;
262 per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled; 264 per_cpu(cputime_scaled_last_delta, smp_processor_id()) = deltascaled;
263 local_irq_restore(flags); 265 local_irq_restore(flags);
@@ -275,10 +277,8 @@ void account_process_tick(struct task_struct *tsk, int user_tick)
275 277
276 utime = get_paca()->user_time; 278 utime = get_paca()->user_time;
277 get_paca()->user_time = 0; 279 get_paca()->user_time = 0;
278 account_user_time(tsk, utime);
279
280 utimescaled = cputime_to_scaled(utime); 280 utimescaled = cputime_to_scaled(utime);
281 account_user_time_scaled(tsk, utimescaled); 281 account_user_time(tsk, utime, utimescaled);
282} 282}
283 283
284/* 284/*
@@ -338,8 +338,12 @@ void calculate_steal_time(void)
338 tb = mftb(); 338 tb = mftb();
339 purr = mfspr(SPRN_PURR); 339 purr = mfspr(SPRN_PURR);
340 stolen = (tb - pme->tb) - (purr - pme->purr); 340 stolen = (tb - pme->tb) - (purr - pme->purr);
341 if (stolen > 0) 341 if (stolen > 0) {
342 account_steal_time(current, stolen); 342 if (idle_task(smp_processor_id()) != current)
343 account_steal_time(stolen);
344 else
345 account_idle_time(stolen);
346 }
343 pme->tb = tb; 347 pme->tb = tb;
344 pme->purr = purr; 348 pme->purr = purr;
345} 349}
@@ -844,7 +848,7 @@ static void register_decrementer_clockevent(int cpu)
844 struct clock_event_device *dec = &per_cpu(decrementers, cpu).event; 848 struct clock_event_device *dec = &per_cpu(decrementers, cpu).event;
845 849
846 *dec = decrementer_clockevent; 850 *dec = decrementer_clockevent;
847 dec->cpumask = cpumask_of_cpu(cpu); 851 dec->cpumask = cpumask_of(cpu);
848 852
849 printk(KERN_DEBUG "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n", 853 printk(KERN_DEBUG "clockevent: %s mult[%lx] shift[%d] cpu[%d]\n",
850 dec->name, dec->mult, dec->shift, cpu); 854 dec->name, dec->mult, dec->shift, cpu);
diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c
new file mode 100644
index 000000000000..a66bec57265a
--- /dev/null
+++ b/arch/powerpc/kvm/44x.c
@@ -0,0 +1,228 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14 *
15 * Copyright IBM Corp. 2008
16 *
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
18 */
19
20#include <linux/kvm_host.h>
21#include <linux/err.h>
22
23#include <asm/reg.h>
24#include <asm/cputable.h>
25#include <asm/tlbflush.h>
26#include <asm/kvm_44x.h>
27#include <asm/kvm_ppc.h>
28
29#include "44x_tlb.h"
30
31/* Note: clearing MSR[DE] just means that the debug interrupt will not be
32 * delivered *immediately*. Instead, it simply sets the appropriate DBSR bits.
33 * If those DBSR bits are still set when MSR[DE] is re-enabled, the interrupt
34 * will be delivered as an "imprecise debug event" (which is indicated by
35 * DBSR[IDE].
36 */
37static void kvm44x_disable_debug_interrupts(void)
38{
39 mtmsr(mfmsr() & ~MSR_DE);
40}
41
42void kvmppc_core_load_host_debugstate(struct kvm_vcpu *vcpu)
43{
44 kvm44x_disable_debug_interrupts();
45
46 mtspr(SPRN_IAC1, vcpu->arch.host_iac[0]);
47 mtspr(SPRN_IAC2, vcpu->arch.host_iac[1]);
48 mtspr(SPRN_IAC3, vcpu->arch.host_iac[2]);
49 mtspr(SPRN_IAC4, vcpu->arch.host_iac[3]);
50 mtspr(SPRN_DBCR1, vcpu->arch.host_dbcr1);
51 mtspr(SPRN_DBCR2, vcpu->arch.host_dbcr2);
52 mtspr(SPRN_DBCR0, vcpu->arch.host_dbcr0);
53 mtmsr(vcpu->arch.host_msr);
54}
55
56void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu)
57{
58 struct kvm_guest_debug *dbg = &vcpu->guest_debug;
59 u32 dbcr0 = 0;
60
61 vcpu->arch.host_msr = mfmsr();
62 kvm44x_disable_debug_interrupts();
63
64 /* Save host debug register state. */
65 vcpu->arch.host_iac[0] = mfspr(SPRN_IAC1);
66 vcpu->arch.host_iac[1] = mfspr(SPRN_IAC2);
67 vcpu->arch.host_iac[2] = mfspr(SPRN_IAC3);
68 vcpu->arch.host_iac[3] = mfspr(SPRN_IAC4);
69 vcpu->arch.host_dbcr0 = mfspr(SPRN_DBCR0);
70 vcpu->arch.host_dbcr1 = mfspr(SPRN_DBCR1);
71 vcpu->arch.host_dbcr2 = mfspr(SPRN_DBCR2);
72
73 /* set registers up for guest */
74
75 if (dbg->bp[0]) {
76 mtspr(SPRN_IAC1, dbg->bp[0]);
77 dbcr0 |= DBCR0_IAC1 | DBCR0_IDM;
78 }
79 if (dbg->bp[1]) {
80 mtspr(SPRN_IAC2, dbg->bp[1]);
81 dbcr0 |= DBCR0_IAC2 | DBCR0_IDM;
82 }
83 if (dbg->bp[2]) {
84 mtspr(SPRN_IAC3, dbg->bp[2]);
85 dbcr0 |= DBCR0_IAC3 | DBCR0_IDM;
86 }
87 if (dbg->bp[3]) {
88 mtspr(SPRN_IAC4, dbg->bp[3]);
89 dbcr0 |= DBCR0_IAC4 | DBCR0_IDM;
90 }
91
92 mtspr(SPRN_DBCR0, dbcr0);
93 mtspr(SPRN_DBCR1, 0);
94 mtspr(SPRN_DBCR2, 0);
95}
96
97void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
98{
99 kvmppc_44x_tlb_load(vcpu);
100}
101
102void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu)
103{
104 kvmppc_44x_tlb_put(vcpu);
105}
106
107int kvmppc_core_check_processor_compat(void)
108{
109 int r;
110
111 if (strcmp(cur_cpu_spec->platform, "ppc440") == 0)
112 r = 0;
113 else
114 r = -ENOTSUPP;
115
116 return r;
117}
118
119int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
120{
121 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
122 struct kvmppc_44x_tlbe *tlbe = &vcpu_44x->guest_tlb[0];
123 int i;
124
125 tlbe->tid = 0;
126 tlbe->word0 = PPC44x_TLB_16M | PPC44x_TLB_VALID;
127 tlbe->word1 = 0;
128 tlbe->word2 = PPC44x_TLB_SX | PPC44x_TLB_SW | PPC44x_TLB_SR;
129
130 tlbe++;
131 tlbe->tid = 0;
132 tlbe->word0 = 0xef600000 | PPC44x_TLB_4K | PPC44x_TLB_VALID;
133 tlbe->word1 = 0xef600000;
134 tlbe->word2 = PPC44x_TLB_SX | PPC44x_TLB_SW | PPC44x_TLB_SR
135 | PPC44x_TLB_I | PPC44x_TLB_G;
136
137 /* Since the guest can directly access the timebase, it must know the
138 * real timebase frequency. Accordingly, it must see the state of
139 * CCR1[TCS]. */
140 vcpu->arch.ccr1 = mfspr(SPRN_CCR1);
141
142 for (i = 0; i < ARRAY_SIZE(vcpu_44x->shadow_refs); i++)
143 vcpu_44x->shadow_refs[i].gtlb_index = -1;
144
145 return 0;
146}
147
148/* 'linear_address' is actually an encoding of AS|PID|EADDR . */
149int kvmppc_core_vcpu_translate(struct kvm_vcpu *vcpu,
150 struct kvm_translation *tr)
151{
152 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
153 struct kvmppc_44x_tlbe *gtlbe;
154 int index;
155 gva_t eaddr;
156 u8 pid;
157 u8 as;
158
159 eaddr = tr->linear_address;
160 pid = (tr->linear_address >> 32) & 0xff;
161 as = (tr->linear_address >> 40) & 0x1;
162
163 index = kvmppc_44x_tlb_index(vcpu, eaddr, pid, as);
164 if (index == -1) {
165 tr->valid = 0;
166 return 0;
167 }
168
169 gtlbe = &vcpu_44x->guest_tlb[index];
170
171 tr->physical_address = tlb_xlate(gtlbe, eaddr);
172 /* XXX what does "writeable" and "usermode" even mean? */
173 tr->valid = 1;
174
175 return 0;
176}
177
178struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id)
179{
180 struct kvmppc_vcpu_44x *vcpu_44x;
181 struct kvm_vcpu *vcpu;
182 int err;
183
184 vcpu_44x = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);
185 if (!vcpu_44x) {
186 err = -ENOMEM;
187 goto out;
188 }
189
190 vcpu = &vcpu_44x->vcpu;
191 err = kvm_vcpu_init(vcpu, kvm, id);
192 if (err)
193 goto free_vcpu;
194
195 return vcpu;
196
197free_vcpu:
198 kmem_cache_free(kvm_vcpu_cache, vcpu_44x);
199out:
200 return ERR_PTR(err);
201}
202
203void kvmppc_core_vcpu_free(struct kvm_vcpu *vcpu)
204{
205 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
206
207 kvm_vcpu_uninit(vcpu);
208 kmem_cache_free(kvm_vcpu_cache, vcpu_44x);
209}
210
211static int kvmppc_44x_init(void)
212{
213 int r;
214
215 r = kvmppc_booke_init();
216 if (r)
217 return r;
218
219 return kvm_init(NULL, sizeof(struct kvmppc_vcpu_44x), THIS_MODULE);
220}
221
222static void kvmppc_44x_exit(void)
223{
224 kvmppc_booke_exit();
225}
226
227module_init(kvmppc_44x_init);
228module_exit(kvmppc_44x_exit);
diff --git a/arch/powerpc/kvm/44x_emulate.c b/arch/powerpc/kvm/44x_emulate.c
new file mode 100644
index 000000000000..82489a743a6f
--- /dev/null
+++ b/arch/powerpc/kvm/44x_emulate.c
@@ -0,0 +1,371 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14 *
15 * Copyright IBM Corp. 2008
16 *
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
18 */
19
20#include <asm/kvm_ppc.h>
21#include <asm/dcr.h>
22#include <asm/dcr-regs.h>
23#include <asm/disassemble.h>
24#include <asm/kvm_44x.h>
25#include "timing.h"
26
27#include "booke.h"
28#include "44x_tlb.h"
29
30#define OP_RFI 19
31
32#define XOP_RFI 50
33#define XOP_MFMSR 83
34#define XOP_WRTEE 131
35#define XOP_MTMSR 146
36#define XOP_WRTEEI 163
37#define XOP_MFDCR 323
38#define XOP_MTDCR 451
39#define XOP_TLBSX 914
40#define XOP_ICCCI 966
41#define XOP_TLBWE 978
42
43static void kvmppc_emul_rfi(struct kvm_vcpu *vcpu)
44{
45 vcpu->arch.pc = vcpu->arch.srr0;
46 kvmppc_set_msr(vcpu, vcpu->arch.srr1);
47}
48
49int kvmppc_core_emulate_op(struct kvm_run *run, struct kvm_vcpu *vcpu,
50 unsigned int inst, int *advance)
51{
52 int emulated = EMULATE_DONE;
53 int dcrn;
54 int ra;
55 int rb;
56 int rc;
57 int rs;
58 int rt;
59 int ws;
60
61 switch (get_op(inst)) {
62 case OP_RFI:
63 switch (get_xop(inst)) {
64 case XOP_RFI:
65 kvmppc_emul_rfi(vcpu);
66 kvmppc_set_exit_type(vcpu, EMULATED_RFI_EXITS);
67 *advance = 0;
68 break;
69
70 default:
71 emulated = EMULATE_FAIL;
72 break;
73 }
74 break;
75
76 case 31:
77 switch (get_xop(inst)) {
78
79 case XOP_MFMSR:
80 rt = get_rt(inst);
81 vcpu->arch.gpr[rt] = vcpu->arch.msr;
82 kvmppc_set_exit_type(vcpu, EMULATED_MFMSR_EXITS);
83 break;
84
85 case XOP_MTMSR:
86 rs = get_rs(inst);
87 kvmppc_set_exit_type(vcpu, EMULATED_MTMSR_EXITS);
88 kvmppc_set_msr(vcpu, vcpu->arch.gpr[rs]);
89 break;
90
91 case XOP_WRTEE:
92 rs = get_rs(inst);
93 vcpu->arch.msr = (vcpu->arch.msr & ~MSR_EE)
94 | (vcpu->arch.gpr[rs] & MSR_EE);
95 kvmppc_set_exit_type(vcpu, EMULATED_WRTEE_EXITS);
96 break;
97
98 case XOP_WRTEEI:
99 vcpu->arch.msr = (vcpu->arch.msr & ~MSR_EE)
100 | (inst & MSR_EE);
101 kvmppc_set_exit_type(vcpu, EMULATED_WRTEE_EXITS);
102 break;
103
104 case XOP_MFDCR:
105 dcrn = get_dcrn(inst);
106 rt = get_rt(inst);
107
108 /* The guest may access CPR0 registers to determine the timebase
109 * frequency, and it must know the real host frequency because it
110 * can directly access the timebase registers.
111 *
112 * It would be possible to emulate those accesses in userspace,
113 * but userspace can really only figure out the end frequency.
114 * We could decompose that into the factors that compute it, but
115 * that's tricky math, and it's easier to just report the real
116 * CPR0 values.
117 */
118 switch (dcrn) {
119 case DCRN_CPR0_CONFIG_ADDR:
120 vcpu->arch.gpr[rt] = vcpu->arch.cpr0_cfgaddr;
121 break;
122 case DCRN_CPR0_CONFIG_DATA:
123 local_irq_disable();
124 mtdcr(DCRN_CPR0_CONFIG_ADDR,
125 vcpu->arch.cpr0_cfgaddr);
126 vcpu->arch.gpr[rt] = mfdcr(DCRN_CPR0_CONFIG_DATA);
127 local_irq_enable();
128 break;
129 default:
130 run->dcr.dcrn = dcrn;
131 run->dcr.data = 0;
132 run->dcr.is_write = 0;
133 vcpu->arch.io_gpr = rt;
134 vcpu->arch.dcr_needed = 1;
135 kvmppc_account_exit(vcpu, DCR_EXITS);
136 emulated = EMULATE_DO_DCR;
137 }
138
139 break;
140
141 case XOP_MTDCR:
142 dcrn = get_dcrn(inst);
143 rs = get_rs(inst);
144
145 /* emulate some access in kernel */
146 switch (dcrn) {
147 case DCRN_CPR0_CONFIG_ADDR:
148 vcpu->arch.cpr0_cfgaddr = vcpu->arch.gpr[rs];
149 break;
150 default:
151 run->dcr.dcrn = dcrn;
152 run->dcr.data = vcpu->arch.gpr[rs];
153 run->dcr.is_write = 1;
154 vcpu->arch.dcr_needed = 1;
155 kvmppc_account_exit(vcpu, DCR_EXITS);
156 emulated = EMULATE_DO_DCR;
157 }
158
159 break;
160
161 case XOP_TLBWE:
162 ra = get_ra(inst);
163 rs = get_rs(inst);
164 ws = get_ws(inst);
165 emulated = kvmppc_44x_emul_tlbwe(vcpu, ra, rs, ws);
166 break;
167
168 case XOP_TLBSX:
169 rt = get_rt(inst);
170 ra = get_ra(inst);
171 rb = get_rb(inst);
172 rc = get_rc(inst);
173 emulated = kvmppc_44x_emul_tlbsx(vcpu, rt, ra, rb, rc);
174 break;
175
176 case XOP_ICCCI:
177 break;
178
179 default:
180 emulated = EMULATE_FAIL;
181 }
182
183 break;
184
185 default:
186 emulated = EMULATE_FAIL;
187 }
188
189 return emulated;
190}
191
192int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
193{
194 switch (sprn) {
195 case SPRN_MMUCR:
196 vcpu->arch.mmucr = vcpu->arch.gpr[rs]; break;
197 case SPRN_PID:
198 kvmppc_set_pid(vcpu, vcpu->arch.gpr[rs]); break;
199 case SPRN_CCR0:
200 vcpu->arch.ccr0 = vcpu->arch.gpr[rs]; break;
201 case SPRN_CCR1:
202 vcpu->arch.ccr1 = vcpu->arch.gpr[rs]; break;
203 case SPRN_DEAR:
204 vcpu->arch.dear = vcpu->arch.gpr[rs]; break;
205 case SPRN_ESR:
206 vcpu->arch.esr = vcpu->arch.gpr[rs]; break;
207 case SPRN_DBCR0:
208 vcpu->arch.dbcr0 = vcpu->arch.gpr[rs]; break;
209 case SPRN_DBCR1:
210 vcpu->arch.dbcr1 = vcpu->arch.gpr[rs]; break;
211 case SPRN_TSR:
212 vcpu->arch.tsr &= ~vcpu->arch.gpr[rs]; break;
213 case SPRN_TCR:
214 vcpu->arch.tcr = vcpu->arch.gpr[rs];
215 kvmppc_emulate_dec(vcpu);
216 break;
217
218 /* Note: SPRG4-7 are user-readable. These values are
219 * loaded into the real SPRGs when resuming the
220 * guest. */
221 case SPRN_SPRG4:
222 vcpu->arch.sprg4 = vcpu->arch.gpr[rs]; break;
223 case SPRN_SPRG5:
224 vcpu->arch.sprg5 = vcpu->arch.gpr[rs]; break;
225 case SPRN_SPRG6:
226 vcpu->arch.sprg6 = vcpu->arch.gpr[rs]; break;
227 case SPRN_SPRG7:
228 vcpu->arch.sprg7 = vcpu->arch.gpr[rs]; break;
229
230 case SPRN_IVPR:
231 vcpu->arch.ivpr = vcpu->arch.gpr[rs];
232 break;
233 case SPRN_IVOR0:
234 vcpu->arch.ivor[BOOKE_IRQPRIO_CRITICAL] = vcpu->arch.gpr[rs];
235 break;
236 case SPRN_IVOR1:
237 vcpu->arch.ivor[BOOKE_IRQPRIO_MACHINE_CHECK] = vcpu->arch.gpr[rs];
238 break;
239 case SPRN_IVOR2:
240 vcpu->arch.ivor[BOOKE_IRQPRIO_DATA_STORAGE] = vcpu->arch.gpr[rs];
241 break;
242 case SPRN_IVOR3:
243 vcpu->arch.ivor[BOOKE_IRQPRIO_INST_STORAGE] = vcpu->arch.gpr[rs];
244 break;
245 case SPRN_IVOR4:
246 vcpu->arch.ivor[BOOKE_IRQPRIO_EXTERNAL] = vcpu->arch.gpr[rs];
247 break;
248 case SPRN_IVOR5:
249 vcpu->arch.ivor[BOOKE_IRQPRIO_ALIGNMENT] = vcpu->arch.gpr[rs];
250 break;
251 case SPRN_IVOR6:
252 vcpu->arch.ivor[BOOKE_IRQPRIO_PROGRAM] = vcpu->arch.gpr[rs];
253 break;
254 case SPRN_IVOR7:
255 vcpu->arch.ivor[BOOKE_IRQPRIO_FP_UNAVAIL] = vcpu->arch.gpr[rs];
256 break;
257 case SPRN_IVOR8:
258 vcpu->arch.ivor[BOOKE_IRQPRIO_SYSCALL] = vcpu->arch.gpr[rs];
259 break;
260 case SPRN_IVOR9:
261 vcpu->arch.ivor[BOOKE_IRQPRIO_AP_UNAVAIL] = vcpu->arch.gpr[rs];
262 break;
263 case SPRN_IVOR10:
264 vcpu->arch.ivor[BOOKE_IRQPRIO_DECREMENTER] = vcpu->arch.gpr[rs];
265 break;
266 case SPRN_IVOR11:
267 vcpu->arch.ivor[BOOKE_IRQPRIO_FIT] = vcpu->arch.gpr[rs];
268 break;
269 case SPRN_IVOR12:
270 vcpu->arch.ivor[BOOKE_IRQPRIO_WATCHDOG] = vcpu->arch.gpr[rs];
271 break;
272 case SPRN_IVOR13:
273 vcpu->arch.ivor[BOOKE_IRQPRIO_DTLB_MISS] = vcpu->arch.gpr[rs];
274 break;
275 case SPRN_IVOR14:
276 vcpu->arch.ivor[BOOKE_IRQPRIO_ITLB_MISS] = vcpu->arch.gpr[rs];
277 break;
278 case SPRN_IVOR15:
279 vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG] = vcpu->arch.gpr[rs];
280 break;
281
282 default:
283 return EMULATE_FAIL;
284 }
285
286 kvmppc_set_exit_type(vcpu, EMULATED_MTSPR_EXITS);
287 return EMULATE_DONE;
288}
289
290int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
291{
292 switch (sprn) {
293 /* 440 */
294 case SPRN_MMUCR:
295 vcpu->arch.gpr[rt] = vcpu->arch.mmucr; break;
296 case SPRN_CCR0:
297 vcpu->arch.gpr[rt] = vcpu->arch.ccr0; break;
298 case SPRN_CCR1:
299 vcpu->arch.gpr[rt] = vcpu->arch.ccr1; break;
300
301 /* Book E */
302 case SPRN_PID:
303 vcpu->arch.gpr[rt] = vcpu->arch.pid; break;
304 case SPRN_IVPR:
305 vcpu->arch.gpr[rt] = vcpu->arch.ivpr; break;
306 case SPRN_DEAR:
307 vcpu->arch.gpr[rt] = vcpu->arch.dear; break;
308 case SPRN_ESR:
309 vcpu->arch.gpr[rt] = vcpu->arch.esr; break;
310 case SPRN_DBCR0:
311 vcpu->arch.gpr[rt] = vcpu->arch.dbcr0; break;
312 case SPRN_DBCR1:
313 vcpu->arch.gpr[rt] = vcpu->arch.dbcr1; break;
314
315 case SPRN_IVOR0:
316 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_CRITICAL];
317 break;
318 case SPRN_IVOR1:
319 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_MACHINE_CHECK];
320 break;
321 case SPRN_IVOR2:
322 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DATA_STORAGE];
323 break;
324 case SPRN_IVOR3:
325 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_INST_STORAGE];
326 break;
327 case SPRN_IVOR4:
328 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_EXTERNAL];
329 break;
330 case SPRN_IVOR5:
331 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_ALIGNMENT];
332 break;
333 case SPRN_IVOR6:
334 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_PROGRAM];
335 break;
336 case SPRN_IVOR7:
337 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_FP_UNAVAIL];
338 break;
339 case SPRN_IVOR8:
340 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_SYSCALL];
341 break;
342 case SPRN_IVOR9:
343 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_AP_UNAVAIL];
344 break;
345 case SPRN_IVOR10:
346 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DECREMENTER];
347 break;
348 case SPRN_IVOR11:
349 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_FIT];
350 break;
351 case SPRN_IVOR12:
352 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_WATCHDOG];
353 break;
354 case SPRN_IVOR13:
355 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DTLB_MISS];
356 break;
357 case SPRN_IVOR14:
358 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_ITLB_MISS];
359 break;
360 case SPRN_IVOR15:
361 vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_DEBUG];
362 break;
363
364 default:
365 return EMULATE_FAIL;
366 }
367
368 kvmppc_set_exit_type(vcpu, EMULATED_MFSPR_EXITS);
369 return EMULATE_DONE;
370}
371
diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c
index ad72c6f9811f..9a34b8edb9e2 100644
--- a/arch/powerpc/kvm/44x_tlb.c
+++ b/arch/powerpc/kvm/44x_tlb.c
@@ -22,20 +22,103 @@
22#include <linux/kvm.h> 22#include <linux/kvm.h>
23#include <linux/kvm_host.h> 23#include <linux/kvm_host.h>
24#include <linux/highmem.h> 24#include <linux/highmem.h>
25
26#include <asm/tlbflush.h>
25#include <asm/mmu-44x.h> 27#include <asm/mmu-44x.h>
26#include <asm/kvm_ppc.h> 28#include <asm/kvm_ppc.h>
29#include <asm/kvm_44x.h>
30#include "timing.h"
27 31
28#include "44x_tlb.h" 32#include "44x_tlb.h"
29 33
34#ifndef PPC44x_TLBE_SIZE
35#define PPC44x_TLBE_SIZE PPC44x_TLB_4K
36#endif
37
38#define PAGE_SIZE_4K (1<<12)
39#define PAGE_MASK_4K (~(PAGE_SIZE_4K - 1))
40
41#define PPC44x_TLB_UATTR_MASK \
42 (PPC44x_TLB_U0|PPC44x_TLB_U1|PPC44x_TLB_U2|PPC44x_TLB_U3)
30#define PPC44x_TLB_USER_PERM_MASK (PPC44x_TLB_UX|PPC44x_TLB_UR|PPC44x_TLB_UW) 43#define PPC44x_TLB_USER_PERM_MASK (PPC44x_TLB_UX|PPC44x_TLB_UR|PPC44x_TLB_UW)
31#define PPC44x_TLB_SUPER_PERM_MASK (PPC44x_TLB_SX|PPC44x_TLB_SR|PPC44x_TLB_SW) 44#define PPC44x_TLB_SUPER_PERM_MASK (PPC44x_TLB_SX|PPC44x_TLB_SR|PPC44x_TLB_SW)
32 45
33static unsigned int kvmppc_tlb_44x_pos; 46#ifdef DEBUG
47void kvmppc_dump_tlbs(struct kvm_vcpu *vcpu)
48{
49 struct kvmppc_44x_tlbe *tlbe;
50 int i;
51
52 printk("vcpu %d TLB dump:\n", vcpu->vcpu_id);
53 printk("| %2s | %3s | %8s | %8s | %8s |\n",
54 "nr", "tid", "word0", "word1", "word2");
55
56 for (i = 0; i < ARRAY_SIZE(vcpu_44x->guest_tlb); i++) {
57 tlbe = &vcpu_44x->guest_tlb[i];
58 if (tlbe->word0 & PPC44x_TLB_VALID)
59 printk(" G%2d | %02X | %08X | %08X | %08X |\n",
60 i, tlbe->tid, tlbe->word0, tlbe->word1,
61 tlbe->word2);
62 }
63}
64#endif
65
66static inline void kvmppc_44x_tlbie(unsigned int index)
67{
68 /* 0 <= index < 64, so the V bit is clear and we can use the index as
69 * word0. */
70 asm volatile(
71 "tlbwe %[index], %[index], 0\n"
72 :
73 : [index] "r"(index)
74 );
75}
76
77static inline void kvmppc_44x_tlbre(unsigned int index,
78 struct kvmppc_44x_tlbe *tlbe)
79{
80 asm volatile(
81 "tlbre %[word0], %[index], 0\n"
82 "mfspr %[tid], %[sprn_mmucr]\n"
83 "andi. %[tid], %[tid], 0xff\n"
84 "tlbre %[word1], %[index], 1\n"
85 "tlbre %[word2], %[index], 2\n"
86 : [word0] "=r"(tlbe->word0),
87 [word1] "=r"(tlbe->word1),
88 [word2] "=r"(tlbe->word2),
89 [tid] "=r"(tlbe->tid)
90 : [index] "r"(index),
91 [sprn_mmucr] "i"(SPRN_MMUCR)
92 : "cc"
93 );
94}
95
96static inline void kvmppc_44x_tlbwe(unsigned int index,
97 struct kvmppc_44x_tlbe *stlbe)
98{
99 unsigned long tmp;
100
101 asm volatile(
102 "mfspr %[tmp], %[sprn_mmucr]\n"
103 "rlwimi %[tmp], %[tid], 0, 0xff\n"
104 "mtspr %[sprn_mmucr], %[tmp]\n"
105 "tlbwe %[word0], %[index], 0\n"
106 "tlbwe %[word1], %[index], 1\n"
107 "tlbwe %[word2], %[index], 2\n"
108 : [tmp] "=&r"(tmp)
109 : [word0] "r"(stlbe->word0),
110 [word1] "r"(stlbe->word1),
111 [word2] "r"(stlbe->word2),
112 [tid] "r"(stlbe->tid),
113 [index] "r"(index),
114 [sprn_mmucr] "i"(SPRN_MMUCR)
115 );
116}
34 117
35static u32 kvmppc_44x_tlb_shadow_attrib(u32 attrib, int usermode) 118static u32 kvmppc_44x_tlb_shadow_attrib(u32 attrib, int usermode)
36{ 119{
37 /* Mask off reserved bits. */ 120 /* We only care about the guest's permission and user bits. */
38 attrib &= PPC44x_TLB_PERM_MASK|PPC44x_TLB_ATTR_MASK; 121 attrib &= PPC44x_TLB_PERM_MASK|PPC44x_TLB_UATTR_MASK;
39 122
40 if (!usermode) { 123 if (!usermode) {
41 /* Guest is in supervisor mode, so we need to translate guest 124 /* Guest is in supervisor mode, so we need to translate guest
@@ -47,18 +130,60 @@ static u32 kvmppc_44x_tlb_shadow_attrib(u32 attrib, int usermode)
47 /* Make sure host can always access this memory. */ 130 /* Make sure host can always access this memory. */
48 attrib |= PPC44x_TLB_SX|PPC44x_TLB_SR|PPC44x_TLB_SW; 131 attrib |= PPC44x_TLB_SX|PPC44x_TLB_SR|PPC44x_TLB_SW;
49 132
133 /* WIMGE = 0b00100 */
134 attrib |= PPC44x_TLB_M;
135
50 return attrib; 136 return attrib;
51} 137}
52 138
139/* Load shadow TLB back into hardware. */
140void kvmppc_44x_tlb_load(struct kvm_vcpu *vcpu)
141{
142 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
143 int i;
144
145 for (i = 0; i <= tlb_44x_hwater; i++) {
146 struct kvmppc_44x_tlbe *stlbe = &vcpu_44x->shadow_tlb[i];
147
148 if (get_tlb_v(stlbe) && get_tlb_ts(stlbe))
149 kvmppc_44x_tlbwe(i, stlbe);
150 }
151}
152
153static void kvmppc_44x_tlbe_set_modified(struct kvmppc_vcpu_44x *vcpu_44x,
154 unsigned int i)
155{
156 vcpu_44x->shadow_tlb_mod[i] = 1;
157}
158
159/* Save hardware TLB to the vcpu, and invalidate all guest mappings. */
160void kvmppc_44x_tlb_put(struct kvm_vcpu *vcpu)
161{
162 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
163 int i;
164
165 for (i = 0; i <= tlb_44x_hwater; i++) {
166 struct kvmppc_44x_tlbe *stlbe = &vcpu_44x->shadow_tlb[i];
167
168 if (vcpu_44x->shadow_tlb_mod[i])
169 kvmppc_44x_tlbre(i, stlbe);
170
171 if (get_tlb_v(stlbe) && get_tlb_ts(stlbe))
172 kvmppc_44x_tlbie(i);
173 }
174}
175
176
53/* Search the guest TLB for a matching entry. */ 177/* Search the guest TLB for a matching entry. */
54int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, unsigned int pid, 178int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, unsigned int pid,
55 unsigned int as) 179 unsigned int as)
56{ 180{
181 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
57 int i; 182 int i;
58 183
59 /* XXX Replace loop with fancy data structures. */ 184 /* XXX Replace loop with fancy data structures. */
60 for (i = 0; i < PPC44x_TLB_SIZE; i++) { 185 for (i = 0; i < ARRAY_SIZE(vcpu_44x->guest_tlb); i++) {
61 struct tlbe *tlbe = &vcpu->arch.guest_tlb[i]; 186 struct kvmppc_44x_tlbe *tlbe = &vcpu_44x->guest_tlb[i];
62 unsigned int tid; 187 unsigned int tid;
63 188
64 if (eaddr < get_tlb_eaddr(tlbe)) 189 if (eaddr < get_tlb_eaddr(tlbe))
@@ -83,78 +208,89 @@ int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, unsigned int pid,
83 return -1; 208 return -1;
84} 209}
85 210
86struct tlbe *kvmppc_44x_itlb_search(struct kvm_vcpu *vcpu, gva_t eaddr) 211int kvmppc_44x_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr)
87{ 212{
88 unsigned int as = !!(vcpu->arch.msr & MSR_IS); 213 unsigned int as = !!(vcpu->arch.msr & MSR_IS);
89 unsigned int index;
90 214
91 index = kvmppc_44x_tlb_index(vcpu, eaddr, vcpu->arch.pid, as); 215 return kvmppc_44x_tlb_index(vcpu, eaddr, vcpu->arch.pid, as);
92 if (index == -1)
93 return NULL;
94 return &vcpu->arch.guest_tlb[index];
95} 216}
96 217
97struct tlbe *kvmppc_44x_dtlb_search(struct kvm_vcpu *vcpu, gva_t eaddr) 218int kvmppc_44x_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr)
98{ 219{
99 unsigned int as = !!(vcpu->arch.msr & MSR_DS); 220 unsigned int as = !!(vcpu->arch.msr & MSR_DS);
100 unsigned int index;
101 221
102 index = kvmppc_44x_tlb_index(vcpu, eaddr, vcpu->arch.pid, as); 222 return kvmppc_44x_tlb_index(vcpu, eaddr, vcpu->arch.pid, as);
103 if (index == -1)
104 return NULL;
105 return &vcpu->arch.guest_tlb[index];
106} 223}
107 224
108static int kvmppc_44x_tlbe_is_writable(struct tlbe *tlbe) 225static void kvmppc_44x_shadow_release(struct kvmppc_vcpu_44x *vcpu_44x,
226 unsigned int stlb_index)
109{ 227{
110 return tlbe->word2 & (PPC44x_TLB_SW|PPC44x_TLB_UW); 228 struct kvmppc_44x_shadow_ref *ref = &vcpu_44x->shadow_refs[stlb_index];
111}
112 229
113static void kvmppc_44x_shadow_release(struct kvm_vcpu *vcpu, 230 if (!ref->page)
114 unsigned int index) 231 return;
115{
116 struct tlbe *stlbe = &vcpu->arch.shadow_tlb[index];
117 struct page *page = vcpu->arch.shadow_pages[index];
118 232
119 if (get_tlb_v(stlbe)) { 233 /* Discard from the TLB. */
120 if (kvmppc_44x_tlbe_is_writable(stlbe)) 234 /* Note: we could actually invalidate a host mapping, if the host overwrote
121 kvm_release_page_dirty(page); 235 * this TLB entry since we inserted a guest mapping. */
122 else 236 kvmppc_44x_tlbie(stlb_index);
123 kvm_release_page_clean(page); 237
124 } 238 /* Now release the page. */
239 if (ref->writeable)
240 kvm_release_page_dirty(ref->page);
241 else
242 kvm_release_page_clean(ref->page);
243
244 ref->page = NULL;
245
246 /* XXX set tlb_44x_index to stlb_index? */
247
248 KVMTRACE_1D(STLB_INVAL, &vcpu_44x->vcpu, stlb_index, handler);
125} 249}
126 250
127void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu) 251void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu)
128{ 252{
253 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
129 int i; 254 int i;
130 255
131 for (i = 0; i <= tlb_44x_hwater; i++) 256 for (i = 0; i <= tlb_44x_hwater; i++)
132 kvmppc_44x_shadow_release(vcpu, i); 257 kvmppc_44x_shadow_release(vcpu_44x, i);
133}
134
135void kvmppc_tlbe_set_modified(struct kvm_vcpu *vcpu, unsigned int i)
136{
137 vcpu->arch.shadow_tlb_mod[i] = 1;
138} 258}
139 259
140/* Caller must ensure that the specified guest TLB entry is safe to insert into 260/**
141 * the shadow TLB. */ 261 * kvmppc_mmu_map -- create a host mapping for guest memory
142void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, u64 asid, 262 *
143 u32 flags) 263 * If the guest wanted a larger page than the host supports, only the first
264 * host page is mapped here and the rest are demand faulted.
265 *
266 * If the guest wanted a smaller page than the host page size, we map only the
267 * guest-size page (i.e. not a full host page mapping).
268 *
269 * Caller must ensure that the specified guest TLB entry is safe to insert into
270 * the shadow TLB.
271 */
272void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gpa_t gpaddr, u64 asid,
273 u32 flags, u32 max_bytes, unsigned int gtlb_index)
144{ 274{
275 struct kvmppc_44x_tlbe stlbe;
276 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
277 struct kvmppc_44x_shadow_ref *ref;
145 struct page *new_page; 278 struct page *new_page;
146 struct tlbe *stlbe;
147 hpa_t hpaddr; 279 hpa_t hpaddr;
280 gfn_t gfn;
148 unsigned int victim; 281 unsigned int victim;
149 282
150 /* Future optimization: don't overwrite the TLB entry containing the 283 /* Select TLB entry to clobber. Indirectly guard against races with the TLB
151 * current PC (or stack?). */ 284 * miss handler by disabling interrupts. */
152 victim = kvmppc_tlb_44x_pos++; 285 local_irq_disable();
153 if (kvmppc_tlb_44x_pos > tlb_44x_hwater) 286 victim = ++tlb_44x_index;
154 kvmppc_tlb_44x_pos = 0; 287 if (victim > tlb_44x_hwater)
155 stlbe = &vcpu->arch.shadow_tlb[victim]; 288 victim = 0;
289 tlb_44x_index = victim;
290 local_irq_enable();
156 291
157 /* Get reference to new page. */ 292 /* Get reference to new page. */
293 gfn = gpaddr >> PAGE_SHIFT;
158 new_page = gfn_to_page(vcpu->kvm, gfn); 294 new_page = gfn_to_page(vcpu->kvm, gfn);
159 if (is_error_page(new_page)) { 295 if (is_error_page(new_page)) {
160 printk(KERN_ERR "Couldn't get guest page for gfn %lx!\n", gfn); 296 printk(KERN_ERR "Couldn't get guest page for gfn %lx!\n", gfn);
@@ -163,10 +299,8 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, u64 asid,
163 } 299 }
164 hpaddr = page_to_phys(new_page); 300 hpaddr = page_to_phys(new_page);
165 301
166 /* Drop reference to old page. */ 302 /* Invalidate any previous shadow mappings. */
167 kvmppc_44x_shadow_release(vcpu, victim); 303 kvmppc_44x_shadow_release(vcpu_44x, victim);
168
169 vcpu->arch.shadow_pages[victim] = new_page;
170 304
171 /* XXX Make sure (va, size) doesn't overlap any other 305 /* XXX Make sure (va, size) doesn't overlap any other
172 * entries. 440x6 user manual says the result would be 306 * entries. 440x6 user manual says the result would be
@@ -174,78 +308,193 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, u64 asid,
174 308
175 /* XXX what about AS? */ 309 /* XXX what about AS? */
176 310
177 stlbe->tid = !(asid & 0xff);
178
179 /* Force TS=1 for all guest mappings. */ 311 /* Force TS=1 for all guest mappings. */
180 /* For now we hardcode 4KB mappings, but it will be important to 312 stlbe.word0 = PPC44x_TLB_VALID | PPC44x_TLB_TS;
181 * use host large pages in the future. */ 313
182 stlbe->word0 = (gvaddr & PAGE_MASK) | PPC44x_TLB_VALID | PPC44x_TLB_TS 314 if (max_bytes >= PAGE_SIZE) {
183 | PPC44x_TLB_4K; 315 /* Guest mapping is larger than or equal to host page size. We can use
184 stlbe->word1 = (hpaddr & 0xfffffc00) | ((hpaddr >> 32) & 0xf); 316 * a "native" host mapping. */
185 stlbe->word2 = kvmppc_44x_tlb_shadow_attrib(flags, 317 stlbe.word0 |= (gvaddr & PAGE_MASK) | PPC44x_TLBE_SIZE;
186 vcpu->arch.msr & MSR_PR); 318 } else {
187 kvmppc_tlbe_set_modified(vcpu, victim); 319 /* Guest mapping is smaller than host page size. We must restrict the
320 * size of the mapping to be at most the smaller of the two, but for
321 * simplicity we fall back to a 4K mapping (this is probably what the
322 * guest is using anyways). */
323 stlbe.word0 |= (gvaddr & PAGE_MASK_4K) | PPC44x_TLB_4K;
324
325 /* 'hpaddr' is a host page, which is larger than the mapping we're
326 * inserting here. To compensate, we must add the in-page offset to the
327 * sub-page. */
328 hpaddr |= gpaddr & (PAGE_MASK ^ PAGE_MASK_4K);
329 }
188 330
189 KVMTRACE_5D(STLB_WRITE, vcpu, victim, 331 stlbe.word1 = (hpaddr & 0xfffffc00) | ((hpaddr >> 32) & 0xf);
190 stlbe->tid, stlbe->word0, stlbe->word1, stlbe->word2, 332 stlbe.word2 = kvmppc_44x_tlb_shadow_attrib(flags,
191 handler); 333 vcpu->arch.msr & MSR_PR);
334 stlbe.tid = !(asid & 0xff);
335
336 /* Keep track of the reference so we can properly release it later. */
337 ref = &vcpu_44x->shadow_refs[victim];
338 ref->page = new_page;
339 ref->gtlb_index = gtlb_index;
340 ref->writeable = !!(stlbe.word2 & PPC44x_TLB_UW);
341 ref->tid = stlbe.tid;
342
343 /* Insert shadow mapping into hardware TLB. */
344 kvmppc_44x_tlbe_set_modified(vcpu_44x, victim);
345 kvmppc_44x_tlbwe(victim, &stlbe);
346 KVMTRACE_5D(STLB_WRITE, vcpu, victim, stlbe.tid, stlbe.word0, stlbe.word1,
347 stlbe.word2, handler);
192} 348}
193 349
194void kvmppc_mmu_invalidate(struct kvm_vcpu *vcpu, gva_t eaddr, 350/* For a particular guest TLB entry, invalidate the corresponding host TLB
195 gva_t eend, u32 asid) 351 * mappings and release the host pages. */
352static void kvmppc_44x_invalidate(struct kvm_vcpu *vcpu,
353 unsigned int gtlb_index)
196{ 354{
197 unsigned int pid = !(asid & 0xff); 355 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
198 int i; 356 int i;
199 357
200 /* XXX Replace loop with fancy data structures. */ 358 for (i = 0; i < ARRAY_SIZE(vcpu_44x->shadow_refs); i++) {
201 for (i = 0; i <= tlb_44x_hwater; i++) { 359 struct kvmppc_44x_shadow_ref *ref = &vcpu_44x->shadow_refs[i];
202 struct tlbe *stlbe = &vcpu->arch.shadow_tlb[i]; 360 if (ref->gtlb_index == gtlb_index)
203 unsigned int tid; 361 kvmppc_44x_shadow_release(vcpu_44x, i);
362 }
363}
204 364
205 if (!get_tlb_v(stlbe)) 365void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode)
206 continue; 366{
367 vcpu->arch.shadow_pid = !usermode;
368}
207 369
208 if (eend < get_tlb_eaddr(stlbe)) 370void kvmppc_set_pid(struct kvm_vcpu *vcpu, u32 new_pid)
209 continue; 371{
372 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
373 int i;
210 374
211 if (eaddr > get_tlb_end(stlbe)) 375 if (unlikely(vcpu->arch.pid == new_pid))
212 continue; 376 return;
213 377
214 tid = get_tlb_tid(stlbe); 378 vcpu->arch.pid = new_pid;
215 if (tid && (tid != pid))
216 continue;
217 379
218 kvmppc_44x_shadow_release(vcpu, i); 380 /* Guest userspace runs with TID=0 mappings and PID=0, to make sure it
219 stlbe->word0 = 0; 381 * can't access guest kernel mappings (TID=1). When we switch to a new
220 kvmppc_tlbe_set_modified(vcpu, i); 382 * guest PID, which will also use host PID=0, we must discard the old guest
221 KVMTRACE_5D(STLB_INVAL, vcpu, i, 383 * userspace mappings. */
222 stlbe->tid, stlbe->word0, stlbe->word1, 384 for (i = 0; i < ARRAY_SIZE(vcpu_44x->shadow_refs); i++) {
223 stlbe->word2, handler); 385 struct kvmppc_44x_shadow_ref *ref = &vcpu_44x->shadow_refs[i];
386
387 if (ref->tid == 0)
388 kvmppc_44x_shadow_release(vcpu_44x, i);
224 } 389 }
225} 390}
226 391
227/* Invalidate all mappings on the privilege switch after PID has been changed. 392static int tlbe_is_host_safe(const struct kvm_vcpu *vcpu,
228 * The guest always runs with PID=1, so we must clear the entire TLB when 393 const struct kvmppc_44x_tlbe *tlbe)
229 * switching address spaces. */
230void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode)
231{ 394{
232 int i; 395 gpa_t gpa;
233 396
234 if (vcpu->arch.swap_pid) { 397 if (!get_tlb_v(tlbe))
235 /* XXX Replace loop with fancy data structures. */ 398 return 0;
236 for (i = 0; i <= tlb_44x_hwater; i++) { 399
237 struct tlbe *stlbe = &vcpu->arch.shadow_tlb[i]; 400 /* Does it match current guest AS? */
238 401 /* XXX what about IS != DS? */
239 /* Future optimization: clear only userspace mappings. */ 402 if (get_tlb_ts(tlbe) != !!(vcpu->arch.msr & MSR_IS))
240 kvmppc_44x_shadow_release(vcpu, i); 403 return 0;
241 stlbe->word0 = 0; 404
242 kvmppc_tlbe_set_modified(vcpu, i); 405 gpa = get_tlb_raddr(tlbe);
243 KVMTRACE_5D(STLB_INVAL, vcpu, i, 406 if (!gfn_to_memslot(vcpu->kvm, gpa >> PAGE_SHIFT))
244 stlbe->tid, stlbe->word0, stlbe->word1, 407 /* Mapping is not for RAM. */
245 stlbe->word2, handler); 408 return 0;
246 } 409
247 vcpu->arch.swap_pid = 0; 410 return 1;
411}
412
413int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws)
414{
415 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
416 struct kvmppc_44x_tlbe *tlbe;
417 unsigned int gtlb_index;
418
419 gtlb_index = vcpu->arch.gpr[ra];
420 if (gtlb_index > KVM44x_GUEST_TLB_SIZE) {
421 printk("%s: index %d\n", __func__, gtlb_index);
422 kvmppc_dump_vcpu(vcpu);
423 return EMULATE_FAIL;
248 } 424 }
249 425
250 vcpu->arch.shadow_pid = !usermode; 426 tlbe = &vcpu_44x->guest_tlb[gtlb_index];
427
428 /* Invalidate shadow mappings for the about-to-be-clobbered TLB entry. */
429 if (tlbe->word0 & PPC44x_TLB_VALID)
430 kvmppc_44x_invalidate(vcpu, gtlb_index);
431
432 switch (ws) {
433 case PPC44x_TLB_PAGEID:
434 tlbe->tid = get_mmucr_stid(vcpu);
435 tlbe->word0 = vcpu->arch.gpr[rs];
436 break;
437
438 case PPC44x_TLB_XLAT:
439 tlbe->word1 = vcpu->arch.gpr[rs];
440 break;
441
442 case PPC44x_TLB_ATTRIB:
443 tlbe->word2 = vcpu->arch.gpr[rs];
444 break;
445
446 default:
447 return EMULATE_FAIL;
448 }
449
450 if (tlbe_is_host_safe(vcpu, tlbe)) {
451 u64 asid;
452 gva_t eaddr;
453 gpa_t gpaddr;
454 u32 flags;
455 u32 bytes;
456
457 eaddr = get_tlb_eaddr(tlbe);
458 gpaddr = get_tlb_raddr(tlbe);
459
460 /* Use the advertised page size to mask effective and real addrs. */
461 bytes = get_tlb_bytes(tlbe);
462 eaddr &= ~(bytes - 1);
463 gpaddr &= ~(bytes - 1);
464
465 asid = (tlbe->word0 & PPC44x_TLB_TS) | tlbe->tid;
466 flags = tlbe->word2 & 0xffff;
467
468 kvmppc_mmu_map(vcpu, eaddr, gpaddr, asid, flags, bytes, gtlb_index);
469 }
470
471 KVMTRACE_5D(GTLB_WRITE, vcpu, gtlb_index, tlbe->tid, tlbe->word0,
472 tlbe->word1, tlbe->word2, handler);
473
474 kvmppc_set_exit_type(vcpu, EMULATED_TLBWE_EXITS);
475 return EMULATE_DONE;
476}
477
478int kvmppc_44x_emul_tlbsx(struct kvm_vcpu *vcpu, u8 rt, u8 ra, u8 rb, u8 rc)
479{
480 u32 ea;
481 int gtlb_index;
482 unsigned int as = get_mmucr_sts(vcpu);
483 unsigned int pid = get_mmucr_stid(vcpu);
484
485 ea = vcpu->arch.gpr[rb];
486 if (ra)
487 ea += vcpu->arch.gpr[ra];
488
489 gtlb_index = kvmppc_44x_tlb_index(vcpu, ea, pid, as);
490 if (rc) {
491 if (gtlb_index < 0)
492 vcpu->arch.cr &= ~0x20000000;
493 else
494 vcpu->arch.cr |= 0x20000000;
495 }
496 vcpu->arch.gpr[rt] = gtlb_index;
497
498 kvmppc_set_exit_type(vcpu, EMULATED_TLBSX_EXITS);
499 return EMULATE_DONE;
251} 500}
diff --git a/arch/powerpc/kvm/44x_tlb.h b/arch/powerpc/kvm/44x_tlb.h
index 2ccd46b6f6b7..772191f29e62 100644
--- a/arch/powerpc/kvm/44x_tlb.h
+++ b/arch/powerpc/kvm/44x_tlb.h
@@ -25,48 +25,52 @@
25 25
26extern int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr, 26extern int kvmppc_44x_tlb_index(struct kvm_vcpu *vcpu, gva_t eaddr,
27 unsigned int pid, unsigned int as); 27 unsigned int pid, unsigned int as);
28extern struct tlbe *kvmppc_44x_dtlb_search(struct kvm_vcpu *vcpu, gva_t eaddr); 28extern int kvmppc_44x_dtlb_index(struct kvm_vcpu *vcpu, gva_t eaddr);
29extern struct tlbe *kvmppc_44x_itlb_search(struct kvm_vcpu *vcpu, gva_t eaddr); 29extern int kvmppc_44x_itlb_index(struct kvm_vcpu *vcpu, gva_t eaddr);
30
31extern int kvmppc_44x_emul_tlbsx(struct kvm_vcpu *vcpu, u8 rt, u8 ra, u8 rb,
32 u8 rc);
33extern int kvmppc_44x_emul_tlbwe(struct kvm_vcpu *vcpu, u8 ra, u8 rs, u8 ws);
30 34
31/* TLB helper functions */ 35/* TLB helper functions */
32static inline unsigned int get_tlb_size(const struct tlbe *tlbe) 36static inline unsigned int get_tlb_size(const struct kvmppc_44x_tlbe *tlbe)
33{ 37{
34 return (tlbe->word0 >> 4) & 0xf; 38 return (tlbe->word0 >> 4) & 0xf;
35} 39}
36 40
37static inline gva_t get_tlb_eaddr(const struct tlbe *tlbe) 41static inline gva_t get_tlb_eaddr(const struct kvmppc_44x_tlbe *tlbe)
38{ 42{
39 return tlbe->word0 & 0xfffffc00; 43 return tlbe->word0 & 0xfffffc00;
40} 44}
41 45
42static inline gva_t get_tlb_bytes(const struct tlbe *tlbe) 46static inline gva_t get_tlb_bytes(const struct kvmppc_44x_tlbe *tlbe)
43{ 47{
44 unsigned int pgsize = get_tlb_size(tlbe); 48 unsigned int pgsize = get_tlb_size(tlbe);
45 return 1 << 10 << (pgsize << 1); 49 return 1 << 10 << (pgsize << 1);
46} 50}
47 51
48static inline gva_t get_tlb_end(const struct tlbe *tlbe) 52static inline gva_t get_tlb_end(const struct kvmppc_44x_tlbe *tlbe)
49{ 53{
50 return get_tlb_eaddr(tlbe) + get_tlb_bytes(tlbe) - 1; 54 return get_tlb_eaddr(tlbe) + get_tlb_bytes(tlbe) - 1;
51} 55}
52 56
53static inline u64 get_tlb_raddr(const struct tlbe *tlbe) 57static inline u64 get_tlb_raddr(const struct kvmppc_44x_tlbe *tlbe)
54{ 58{
55 u64 word1 = tlbe->word1; 59 u64 word1 = tlbe->word1;
56 return ((word1 & 0xf) << 32) | (word1 & 0xfffffc00); 60 return ((word1 & 0xf) << 32) | (word1 & 0xfffffc00);
57} 61}
58 62
59static inline unsigned int get_tlb_tid(const struct tlbe *tlbe) 63static inline unsigned int get_tlb_tid(const struct kvmppc_44x_tlbe *tlbe)
60{ 64{
61 return tlbe->tid & 0xff; 65 return tlbe->tid & 0xff;
62} 66}
63 67
64static inline unsigned int get_tlb_ts(const struct tlbe *tlbe) 68static inline unsigned int get_tlb_ts(const struct kvmppc_44x_tlbe *tlbe)
65{ 69{
66 return (tlbe->word0 >> 8) & 0x1; 70 return (tlbe->word0 >> 8) & 0x1;
67} 71}
68 72
69static inline unsigned int get_tlb_v(const struct tlbe *tlbe) 73static inline unsigned int get_tlb_v(const struct kvmppc_44x_tlbe *tlbe)
70{ 74{
71 return (tlbe->word0 >> 9) & 0x1; 75 return (tlbe->word0 >> 9) & 0x1;
72} 76}
@@ -81,7 +85,7 @@ static inline unsigned int get_mmucr_sts(const struct kvm_vcpu *vcpu)
81 return (vcpu->arch.mmucr >> 16) & 0x1; 85 return (vcpu->arch.mmucr >> 16) & 0x1;
82} 86}
83 87
84static inline gpa_t tlb_xlate(struct tlbe *tlbe, gva_t eaddr) 88static inline gpa_t tlb_xlate(struct kvmppc_44x_tlbe *tlbe, gva_t eaddr)
85{ 89{
86 unsigned int pgmask = get_tlb_bytes(tlbe) - 1; 90 unsigned int pgmask = get_tlb_bytes(tlbe) - 1;
87 91
diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig
index 53aaa66b25e5..6dbdc4817d80 100644
--- a/arch/powerpc/kvm/Kconfig
+++ b/arch/powerpc/kvm/Kconfig
@@ -15,27 +15,33 @@ menuconfig VIRTUALIZATION
15if VIRTUALIZATION 15if VIRTUALIZATION
16 16
17config KVM 17config KVM
18 bool "Kernel-based Virtual Machine (KVM) support" 18 bool
19 depends on 44x && EXPERIMENTAL
20 select PREEMPT_NOTIFIERS 19 select PREEMPT_NOTIFIERS
21 select ANON_INODES 20 select ANON_INODES
22 # We can only run on Book E hosts so far 21
23 select KVM_BOOKE_HOST 22config KVM_440
23 bool "KVM support for PowerPC 440 processors"
24 depends on EXPERIMENTAL && 44x
25 select KVM
24 ---help--- 26 ---help---
25 Support hosting virtualized guest machines. You will also 27 Support running unmodified 440 guest kernels in virtual machines on
26 need to select one or more of the processor modules below. 28 440 host processors.
27 29
28 This module provides access to the hardware capabilities through 30 This module provides access to the hardware capabilities through
29 a character device node named /dev/kvm. 31 a character device node named /dev/kvm.
30 32
31 If unsure, say N. 33 If unsure, say N.
32 34
33config KVM_BOOKE_HOST 35config KVM_EXIT_TIMING
34 bool "KVM host support for Book E PowerPC processors" 36 bool "Detailed exit timing"
35 depends on KVM && 44x 37 depends on KVM
36 ---help--- 38 ---help---
37 Provides host support for KVM on Book E PowerPC processors. Currently 39 Calculate elapsed time for every exit/enter cycle. A per-vcpu
38 this works on 440 processors only. 40 report is available in debugfs kvm/vm#_vcpu#_timing.
41 The overhead is relatively small, however it is not recommended for
42 production environments.
43
44 If unsure, say N.
39 45
40config KVM_TRACE 46config KVM_TRACE
41 bool "KVM trace support" 47 bool "KVM trace support"
diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
index 2a5d4397ac4b..df7ba59e6d53 100644
--- a/arch/powerpc/kvm/Makefile
+++ b/arch/powerpc/kvm/Makefile
@@ -8,10 +8,16 @@ common-objs-y = $(addprefix ../../../virt/kvm/, kvm_main.o coalesced_mmio.o)
8 8
9common-objs-$(CONFIG_KVM_TRACE) += $(addprefix ../../../virt/kvm/, kvm_trace.o) 9common-objs-$(CONFIG_KVM_TRACE) += $(addprefix ../../../virt/kvm/, kvm_trace.o)
10 10
11kvm-objs := $(common-objs-y) powerpc.o emulate.o booke_guest.o 11kvm-objs := $(common-objs-y) powerpc.o emulate.o
12obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o
12obj-$(CONFIG_KVM) += kvm.o 13obj-$(CONFIG_KVM) += kvm.o
13 14
14AFLAGS_booke_interrupts.o := -I$(obj) 15AFLAGS_booke_interrupts.o := -I$(obj)
15 16
16kvm-booke-host-objs := booke_host.o booke_interrupts.o 44x_tlb.o 17kvm-440-objs := \
17obj-$(CONFIG_KVM_BOOKE_HOST) += kvm-booke-host.o 18 booke.o \
19 booke_interrupts.o \
20 44x.o \
21 44x_tlb.o \
22 44x_emulate.o
23obj-$(CONFIG_KVM_440) += kvm-440.o
diff --git a/arch/powerpc/kvm/booke_guest.c b/arch/powerpc/kvm/booke.c
index 7b2591e26bae..35485dd6927e 100644
--- a/arch/powerpc/kvm/booke_guest.c
+++ b/arch/powerpc/kvm/booke.c
@@ -24,21 +24,26 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/vmalloc.h> 25#include <linux/vmalloc.h>
26#include <linux/fs.h> 26#include <linux/fs.h>
27
27#include <asm/cputable.h> 28#include <asm/cputable.h>
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29#include <asm/kvm_ppc.h> 30#include <asm/kvm_ppc.h>
31#include "timing.h"
32#include <asm/cacheflush.h>
33#include <asm/kvm_44x.h>
30 34
35#include "booke.h"
31#include "44x_tlb.h" 36#include "44x_tlb.h"
32 37
38unsigned long kvmppc_booke_handlers;
39
33#define VM_STAT(x) offsetof(struct kvm, stat.x), KVM_STAT_VM 40#define VM_STAT(x) offsetof(struct kvm, stat.x), KVM_STAT_VM
34#define VCPU_STAT(x) offsetof(struct kvm_vcpu, stat.x), KVM_STAT_VCPU 41#define VCPU_STAT(x) offsetof(struct kvm_vcpu, stat.x), KVM_STAT_VCPU
35 42
36struct kvm_stats_debugfs_item debugfs_entries[] = { 43struct kvm_stats_debugfs_item debugfs_entries[] = {
37 { "exits", VCPU_STAT(sum_exits) },
38 { "mmio", VCPU_STAT(mmio_exits) }, 44 { "mmio", VCPU_STAT(mmio_exits) },
39 { "dcr", VCPU_STAT(dcr_exits) }, 45 { "dcr", VCPU_STAT(dcr_exits) },
40 { "sig", VCPU_STAT(signal_exits) }, 46 { "sig", VCPU_STAT(signal_exits) },
41 { "light", VCPU_STAT(light_exits) },
42 { "itlb_r", VCPU_STAT(itlb_real_miss_exits) }, 47 { "itlb_r", VCPU_STAT(itlb_real_miss_exits) },
43 { "itlb_v", VCPU_STAT(itlb_virt_miss_exits) }, 48 { "itlb_v", VCPU_STAT(itlb_virt_miss_exits) },
44 { "dtlb_r", VCPU_STAT(dtlb_real_miss_exits) }, 49 { "dtlb_r", VCPU_STAT(dtlb_real_miss_exits) },
@@ -53,103 +58,19 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
53 { NULL } 58 { NULL }
54}; 59};
55 60
56static const u32 interrupt_msr_mask[16] = {
57 [BOOKE_INTERRUPT_CRITICAL] = MSR_ME,
58 [BOOKE_INTERRUPT_MACHINE_CHECK] = 0,
59 [BOOKE_INTERRUPT_DATA_STORAGE] = MSR_CE|MSR_ME|MSR_DE,
60 [BOOKE_INTERRUPT_INST_STORAGE] = MSR_CE|MSR_ME|MSR_DE,
61 [BOOKE_INTERRUPT_EXTERNAL] = MSR_CE|MSR_ME|MSR_DE,
62 [BOOKE_INTERRUPT_ALIGNMENT] = MSR_CE|MSR_ME|MSR_DE,
63 [BOOKE_INTERRUPT_PROGRAM] = MSR_CE|MSR_ME|MSR_DE,
64 [BOOKE_INTERRUPT_FP_UNAVAIL] = MSR_CE|MSR_ME|MSR_DE,
65 [BOOKE_INTERRUPT_SYSCALL] = MSR_CE|MSR_ME|MSR_DE,
66 [BOOKE_INTERRUPT_AP_UNAVAIL] = MSR_CE|MSR_ME|MSR_DE,
67 [BOOKE_INTERRUPT_DECREMENTER] = MSR_CE|MSR_ME|MSR_DE,
68 [BOOKE_INTERRUPT_FIT] = MSR_CE|MSR_ME|MSR_DE,
69 [BOOKE_INTERRUPT_WATCHDOG] = MSR_ME,
70 [BOOKE_INTERRUPT_DTLB_MISS] = MSR_CE|MSR_ME|MSR_DE,
71 [BOOKE_INTERRUPT_ITLB_MISS] = MSR_CE|MSR_ME|MSR_DE,
72 [BOOKE_INTERRUPT_DEBUG] = MSR_ME,
73};
74
75const unsigned char exception_priority[] = {
76 [BOOKE_INTERRUPT_DATA_STORAGE] = 0,
77 [BOOKE_INTERRUPT_INST_STORAGE] = 1,
78 [BOOKE_INTERRUPT_ALIGNMENT] = 2,
79 [BOOKE_INTERRUPT_PROGRAM] = 3,
80 [BOOKE_INTERRUPT_FP_UNAVAIL] = 4,
81 [BOOKE_INTERRUPT_SYSCALL] = 5,
82 [BOOKE_INTERRUPT_AP_UNAVAIL] = 6,
83 [BOOKE_INTERRUPT_DTLB_MISS] = 7,
84 [BOOKE_INTERRUPT_ITLB_MISS] = 8,
85 [BOOKE_INTERRUPT_MACHINE_CHECK] = 9,
86 [BOOKE_INTERRUPT_DEBUG] = 10,
87 [BOOKE_INTERRUPT_CRITICAL] = 11,
88 [BOOKE_INTERRUPT_WATCHDOG] = 12,
89 [BOOKE_INTERRUPT_EXTERNAL] = 13,
90 [BOOKE_INTERRUPT_FIT] = 14,
91 [BOOKE_INTERRUPT_DECREMENTER] = 15,
92};
93
94const unsigned char priority_exception[] = {
95 BOOKE_INTERRUPT_DATA_STORAGE,
96 BOOKE_INTERRUPT_INST_STORAGE,
97 BOOKE_INTERRUPT_ALIGNMENT,
98 BOOKE_INTERRUPT_PROGRAM,
99 BOOKE_INTERRUPT_FP_UNAVAIL,
100 BOOKE_INTERRUPT_SYSCALL,
101 BOOKE_INTERRUPT_AP_UNAVAIL,
102 BOOKE_INTERRUPT_DTLB_MISS,
103 BOOKE_INTERRUPT_ITLB_MISS,
104 BOOKE_INTERRUPT_MACHINE_CHECK,
105 BOOKE_INTERRUPT_DEBUG,
106 BOOKE_INTERRUPT_CRITICAL,
107 BOOKE_INTERRUPT_WATCHDOG,
108 BOOKE_INTERRUPT_EXTERNAL,
109 BOOKE_INTERRUPT_FIT,
110 BOOKE_INTERRUPT_DECREMENTER,
111};
112
113
114void kvmppc_dump_tlbs(struct kvm_vcpu *vcpu)
115{
116 struct tlbe *tlbe;
117 int i;
118
119 printk("vcpu %d TLB dump:\n", vcpu->vcpu_id);
120 printk("| %2s | %3s | %8s | %8s | %8s |\n",
121 "nr", "tid", "word0", "word1", "word2");
122
123 for (i = 0; i < PPC44x_TLB_SIZE; i++) {
124 tlbe = &vcpu->arch.guest_tlb[i];
125 if (tlbe->word0 & PPC44x_TLB_VALID)
126 printk(" G%2d | %02X | %08X | %08X | %08X |\n",
127 i, tlbe->tid, tlbe->word0, tlbe->word1,
128 tlbe->word2);
129 }
130
131 for (i = 0; i < PPC44x_TLB_SIZE; i++) {
132 tlbe = &vcpu->arch.shadow_tlb[i];
133 if (tlbe->word0 & PPC44x_TLB_VALID)
134 printk(" S%2d | %02X | %08X | %08X | %08X |\n",
135 i, tlbe->tid, tlbe->word0, tlbe->word1,
136 tlbe->word2);
137 }
138}
139
140/* TODO: use vcpu_printf() */ 61/* TODO: use vcpu_printf() */
141void kvmppc_dump_vcpu(struct kvm_vcpu *vcpu) 62void kvmppc_dump_vcpu(struct kvm_vcpu *vcpu)
142{ 63{
143 int i; 64 int i;
144 65
145 printk("pc: %08x msr: %08x\n", vcpu->arch.pc, vcpu->arch.msr); 66 printk("pc: %08lx msr: %08lx\n", vcpu->arch.pc, vcpu->arch.msr);
146 printk("lr: %08x ctr: %08x\n", vcpu->arch.lr, vcpu->arch.ctr); 67 printk("lr: %08lx ctr: %08lx\n", vcpu->arch.lr, vcpu->arch.ctr);
147 printk("srr0: %08x srr1: %08x\n", vcpu->arch.srr0, vcpu->arch.srr1); 68 printk("srr0: %08lx srr1: %08lx\n", vcpu->arch.srr0, vcpu->arch.srr1);
148 69
149 printk("exceptions: %08lx\n", vcpu->arch.pending_exceptions); 70 printk("exceptions: %08lx\n", vcpu->arch.pending_exceptions);
150 71
151 for (i = 0; i < 32; i += 4) { 72 for (i = 0; i < 32; i += 4) {
152 printk("gpr%02d: %08x %08x %08x %08x\n", i, 73 printk("gpr%02d: %08lx %08lx %08lx %08lx\n", i,
153 vcpu->arch.gpr[i], 74 vcpu->arch.gpr[i],
154 vcpu->arch.gpr[i+1], 75 vcpu->arch.gpr[i+1],
155 vcpu->arch.gpr[i+2], 76 vcpu->arch.gpr[i+2],
@@ -157,69 +78,96 @@ void kvmppc_dump_vcpu(struct kvm_vcpu *vcpu)
157 } 78 }
158} 79}
159 80
160/* Check if we are ready to deliver the interrupt */ 81static void kvmppc_booke_queue_irqprio(struct kvm_vcpu *vcpu,
161static int kvmppc_can_deliver_interrupt(struct kvm_vcpu *vcpu, int interrupt) 82 unsigned int priority)
162{ 83{
163 int r; 84 set_bit(priority, &vcpu->arch.pending_exceptions);
85}
164 86
165 switch (interrupt) { 87void kvmppc_core_queue_program(struct kvm_vcpu *vcpu)
166 case BOOKE_INTERRUPT_CRITICAL: 88{
167 r = vcpu->arch.msr & MSR_CE; 89 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_PROGRAM);
168 break; 90}
169 case BOOKE_INTERRUPT_MACHINE_CHECK: 91
170 r = vcpu->arch.msr & MSR_ME; 92void kvmppc_core_queue_dec(struct kvm_vcpu *vcpu)
171 break; 93{
172 case BOOKE_INTERRUPT_EXTERNAL: 94 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DECREMENTER);
173 r = vcpu->arch.msr & MSR_EE; 95}
96
97int kvmppc_core_pending_dec(struct kvm_vcpu *vcpu)
98{
99 return test_bit(BOOKE_IRQPRIO_DECREMENTER, &vcpu->arch.pending_exceptions);
100}
101
102void kvmppc_core_queue_external(struct kvm_vcpu *vcpu,
103 struct kvm_interrupt *irq)
104{
105 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_EXTERNAL);
106}
107
108/* Deliver the interrupt of the corresponding priority, if possible. */
109static int kvmppc_booke_irqprio_deliver(struct kvm_vcpu *vcpu,
110 unsigned int priority)
111{
112 int allowed = 0;
113 ulong msr_mask;
114
115 switch (priority) {
116 case BOOKE_IRQPRIO_PROGRAM:
117 case BOOKE_IRQPRIO_DTLB_MISS:
118 case BOOKE_IRQPRIO_ITLB_MISS:
119 case BOOKE_IRQPRIO_SYSCALL:
120 case BOOKE_IRQPRIO_DATA_STORAGE:
121 case BOOKE_IRQPRIO_INST_STORAGE:
122 case BOOKE_IRQPRIO_FP_UNAVAIL:
123 case BOOKE_IRQPRIO_AP_UNAVAIL:
124 case BOOKE_IRQPRIO_ALIGNMENT:
125 allowed = 1;
126 msr_mask = MSR_CE|MSR_ME|MSR_DE;
174 break; 127 break;
175 case BOOKE_INTERRUPT_DECREMENTER: 128 case BOOKE_IRQPRIO_CRITICAL:
176 r = vcpu->arch.msr & MSR_EE; 129 case BOOKE_IRQPRIO_WATCHDOG:
130 allowed = vcpu->arch.msr & MSR_CE;
131 msr_mask = MSR_ME;
177 break; 132 break;
178 case BOOKE_INTERRUPT_FIT: 133 case BOOKE_IRQPRIO_MACHINE_CHECK:
179 r = vcpu->arch.msr & MSR_EE; 134 allowed = vcpu->arch.msr & MSR_ME;
135 msr_mask = 0;
180 break; 136 break;
181 case BOOKE_INTERRUPT_WATCHDOG: 137 case BOOKE_IRQPRIO_EXTERNAL:
182 r = vcpu->arch.msr & MSR_CE; 138 case BOOKE_IRQPRIO_DECREMENTER:
139 case BOOKE_IRQPRIO_FIT:
140 allowed = vcpu->arch.msr & MSR_EE;
141 msr_mask = MSR_CE|MSR_ME|MSR_DE;
183 break; 142 break;
184 case BOOKE_INTERRUPT_DEBUG: 143 case BOOKE_IRQPRIO_DEBUG:
185 r = vcpu->arch.msr & MSR_DE; 144 allowed = vcpu->arch.msr & MSR_DE;
145 msr_mask = MSR_ME;
186 break; 146 break;
187 default:
188 r = 1;
189 } 147 }
190 148
191 return r; 149 if (allowed) {
192} 150 vcpu->arch.srr0 = vcpu->arch.pc;
151 vcpu->arch.srr1 = vcpu->arch.msr;
152 vcpu->arch.pc = vcpu->arch.ivpr | vcpu->arch.ivor[priority];
153 kvmppc_set_msr(vcpu, vcpu->arch.msr & msr_mask);
193 154
194static void kvmppc_deliver_interrupt(struct kvm_vcpu *vcpu, int interrupt) 155 clear_bit(priority, &vcpu->arch.pending_exceptions);
195{
196 switch (interrupt) {
197 case BOOKE_INTERRUPT_DECREMENTER:
198 vcpu->arch.tsr |= TSR_DIS;
199 break;
200 } 156 }
201 157
202 vcpu->arch.srr0 = vcpu->arch.pc; 158 return allowed;
203 vcpu->arch.srr1 = vcpu->arch.msr;
204 vcpu->arch.pc = vcpu->arch.ivpr | vcpu->arch.ivor[interrupt];
205 kvmppc_set_msr(vcpu, vcpu->arch.msr & interrupt_msr_mask[interrupt]);
206} 159}
207 160
208/* Check pending exceptions and deliver one, if possible. */ 161/* Check pending exceptions and deliver one, if possible. */
209void kvmppc_check_and_deliver_interrupts(struct kvm_vcpu *vcpu) 162void kvmppc_core_deliver_interrupts(struct kvm_vcpu *vcpu)
210{ 163{
211 unsigned long *pending = &vcpu->arch.pending_exceptions; 164 unsigned long *pending = &vcpu->arch.pending_exceptions;
212 unsigned int exception;
213 unsigned int priority; 165 unsigned int priority;
214 166
215 priority = find_first_bit(pending, BITS_PER_BYTE * sizeof(*pending)); 167 priority = __ffs(*pending);
216 while (priority <= BOOKE_MAX_INTERRUPT) { 168 while (priority <= BOOKE_MAX_INTERRUPT) {
217 exception = priority_exception[priority]; 169 if (kvmppc_booke_irqprio_deliver(vcpu, priority))
218 if (kvmppc_can_deliver_interrupt(vcpu, exception)) {
219 kvmppc_clear_exception(vcpu, exception);
220 kvmppc_deliver_interrupt(vcpu, exception);
221 break; 170 break;
222 }
223 171
224 priority = find_next_bit(pending, 172 priority = find_next_bit(pending,
225 BITS_PER_BYTE * sizeof(*pending), 173 BITS_PER_BYTE * sizeof(*pending),
@@ -238,6 +186,9 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
238 enum emulation_result er; 186 enum emulation_result er;
239 int r = RESUME_HOST; 187 int r = RESUME_HOST;
240 188
189 /* update before a new last_exit_type is rewritten */
190 kvmppc_update_timing_stats(vcpu);
191
241 local_irq_enable(); 192 local_irq_enable();
242 193
243 run->exit_reason = KVM_EXIT_UNKNOWN; 194 run->exit_reason = KVM_EXIT_UNKNOWN;
@@ -251,21 +202,19 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
251 break; 202 break;
252 203
253 case BOOKE_INTERRUPT_EXTERNAL: 204 case BOOKE_INTERRUPT_EXTERNAL:
205 kvmppc_account_exit(vcpu, EXT_INTR_EXITS);
206 if (need_resched())
207 cond_resched();
208 r = RESUME_GUEST;
209 break;
210
254 case BOOKE_INTERRUPT_DECREMENTER: 211 case BOOKE_INTERRUPT_DECREMENTER:
255 /* Since we switched IVPR back to the host's value, the host 212 /* Since we switched IVPR back to the host's value, the host
256 * handled this interrupt the moment we enabled interrupts. 213 * handled this interrupt the moment we enabled interrupts.
257 * Now we just offer it a chance to reschedule the guest. */ 214 * Now we just offer it a chance to reschedule the guest. */
258 215 kvmppc_account_exit(vcpu, DEC_EXITS);
259 /* XXX At this point the TLB still holds our shadow TLB, so if
260 * we do reschedule the host will fault over it. Perhaps we
261 * should politely restore the host's entries to minimize
262 * misses before ceding control. */
263 if (need_resched()) 216 if (need_resched())
264 cond_resched(); 217 cond_resched();
265 if (exit_nr == BOOKE_INTERRUPT_DECREMENTER)
266 vcpu->stat.dec_exits++;
267 else
268 vcpu->stat.ext_intr_exits++;
269 r = RESUME_GUEST; 218 r = RESUME_GUEST;
270 break; 219 break;
271 220
@@ -274,17 +223,19 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
274 /* Program traps generated by user-level software must be handled 223 /* Program traps generated by user-level software must be handled
275 * by the guest kernel. */ 224 * by the guest kernel. */
276 vcpu->arch.esr = vcpu->arch.fault_esr; 225 vcpu->arch.esr = vcpu->arch.fault_esr;
277 kvmppc_queue_exception(vcpu, BOOKE_INTERRUPT_PROGRAM); 226 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_PROGRAM);
278 r = RESUME_GUEST; 227 r = RESUME_GUEST;
228 kvmppc_account_exit(vcpu, USR_PR_INST);
279 break; 229 break;
280 } 230 }
281 231
282 er = kvmppc_emulate_instruction(run, vcpu); 232 er = kvmppc_emulate_instruction(run, vcpu);
283 switch (er) { 233 switch (er) {
284 case EMULATE_DONE: 234 case EMULATE_DONE:
235 /* don't overwrite subtypes, just account kvm_stats */
236 kvmppc_account_exit_stat(vcpu, EMULATED_INST_EXITS);
285 /* Future optimization: only reload non-volatiles if 237 /* Future optimization: only reload non-volatiles if
286 * they were actually modified by emulation. */ 238 * they were actually modified by emulation. */
287 vcpu->stat.emulated_inst_exits++;
288 r = RESUME_GUEST_NV; 239 r = RESUME_GUEST_NV;
289 break; 240 break;
290 case EMULATE_DO_DCR: 241 case EMULATE_DO_DCR:
@@ -293,7 +244,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
293 break; 244 break;
294 case EMULATE_FAIL: 245 case EMULATE_FAIL:
295 /* XXX Deliver Program interrupt to guest. */ 246 /* XXX Deliver Program interrupt to guest. */
296 printk(KERN_CRIT "%s: emulation at %x failed (%08x)\n", 247 printk(KERN_CRIT "%s: emulation at %lx failed (%08x)\n",
297 __func__, vcpu->arch.pc, vcpu->arch.last_inst); 248 __func__, vcpu->arch.pc, vcpu->arch.last_inst);
298 /* For debugging, encode the failing instruction and 249 /* For debugging, encode the failing instruction and
299 * report it to userspace. */ 250 * report it to userspace. */
@@ -307,48 +258,53 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
307 break; 258 break;
308 259
309 case BOOKE_INTERRUPT_FP_UNAVAIL: 260 case BOOKE_INTERRUPT_FP_UNAVAIL:
310 kvmppc_queue_exception(vcpu, exit_nr); 261 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_FP_UNAVAIL);
262 kvmppc_account_exit(vcpu, FP_UNAVAIL);
311 r = RESUME_GUEST; 263 r = RESUME_GUEST;
312 break; 264 break;
313 265
314 case BOOKE_INTERRUPT_DATA_STORAGE: 266 case BOOKE_INTERRUPT_DATA_STORAGE:
315 vcpu->arch.dear = vcpu->arch.fault_dear; 267 vcpu->arch.dear = vcpu->arch.fault_dear;
316 vcpu->arch.esr = vcpu->arch.fault_esr; 268 vcpu->arch.esr = vcpu->arch.fault_esr;
317 kvmppc_queue_exception(vcpu, exit_nr); 269 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DATA_STORAGE);
318 vcpu->stat.dsi_exits++; 270 kvmppc_account_exit(vcpu, DSI_EXITS);
319 r = RESUME_GUEST; 271 r = RESUME_GUEST;
320 break; 272 break;
321 273
322 case BOOKE_INTERRUPT_INST_STORAGE: 274 case BOOKE_INTERRUPT_INST_STORAGE:
323 vcpu->arch.esr = vcpu->arch.fault_esr; 275 vcpu->arch.esr = vcpu->arch.fault_esr;
324 kvmppc_queue_exception(vcpu, exit_nr); 276 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_INST_STORAGE);
325 vcpu->stat.isi_exits++; 277 kvmppc_account_exit(vcpu, ISI_EXITS);
326 r = RESUME_GUEST; 278 r = RESUME_GUEST;
327 break; 279 break;
328 280
329 case BOOKE_INTERRUPT_SYSCALL: 281 case BOOKE_INTERRUPT_SYSCALL:
330 kvmppc_queue_exception(vcpu, exit_nr); 282 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_SYSCALL);
331 vcpu->stat.syscall_exits++; 283 kvmppc_account_exit(vcpu, SYSCALL_EXITS);
332 r = RESUME_GUEST; 284 r = RESUME_GUEST;
333 break; 285 break;
334 286
287 /* XXX move to a 440-specific file. */
335 case BOOKE_INTERRUPT_DTLB_MISS: { 288 case BOOKE_INTERRUPT_DTLB_MISS: {
336 struct tlbe *gtlbe; 289 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
290 struct kvmppc_44x_tlbe *gtlbe;
337 unsigned long eaddr = vcpu->arch.fault_dear; 291 unsigned long eaddr = vcpu->arch.fault_dear;
292 int gtlb_index;
338 gfn_t gfn; 293 gfn_t gfn;
339 294
340 /* Check the guest TLB. */ 295 /* Check the guest TLB. */
341 gtlbe = kvmppc_44x_dtlb_search(vcpu, eaddr); 296 gtlb_index = kvmppc_44x_dtlb_index(vcpu, eaddr);
342 if (!gtlbe) { 297 if (gtlb_index < 0) {
343 /* The guest didn't have a mapping for it. */ 298 /* The guest didn't have a mapping for it. */
344 kvmppc_queue_exception(vcpu, exit_nr); 299 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DTLB_MISS);
345 vcpu->arch.dear = vcpu->arch.fault_dear; 300 vcpu->arch.dear = vcpu->arch.fault_dear;
346 vcpu->arch.esr = vcpu->arch.fault_esr; 301 vcpu->arch.esr = vcpu->arch.fault_esr;
347 vcpu->stat.dtlb_real_miss_exits++; 302 kvmppc_account_exit(vcpu, DTLB_REAL_MISS_EXITS);
348 r = RESUME_GUEST; 303 r = RESUME_GUEST;
349 break; 304 break;
350 } 305 }
351 306
307 gtlbe = &vcpu_44x->guest_tlb[gtlb_index];
352 vcpu->arch.paddr_accessed = tlb_xlate(gtlbe, eaddr); 308 vcpu->arch.paddr_accessed = tlb_xlate(gtlbe, eaddr);
353 gfn = vcpu->arch.paddr_accessed >> PAGE_SHIFT; 309 gfn = vcpu->arch.paddr_accessed >> PAGE_SHIFT;
354 310
@@ -359,38 +315,45 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
359 * b) the guest used a large mapping which we're faking 315 * b) the guest used a large mapping which we're faking
360 * Either way, we need to satisfy the fault without 316 * Either way, we need to satisfy the fault without
361 * invoking the guest. */ 317 * invoking the guest. */
362 kvmppc_mmu_map(vcpu, eaddr, gfn, gtlbe->tid, 318 kvmppc_mmu_map(vcpu, eaddr, vcpu->arch.paddr_accessed, gtlbe->tid,
363 gtlbe->word2); 319 gtlbe->word2, get_tlb_bytes(gtlbe), gtlb_index);
364 vcpu->stat.dtlb_virt_miss_exits++; 320 kvmppc_account_exit(vcpu, DTLB_VIRT_MISS_EXITS);
365 r = RESUME_GUEST; 321 r = RESUME_GUEST;
366 } else { 322 } else {
367 /* Guest has mapped and accessed a page which is not 323 /* Guest has mapped and accessed a page which is not
368 * actually RAM. */ 324 * actually RAM. */
369 r = kvmppc_emulate_mmio(run, vcpu); 325 r = kvmppc_emulate_mmio(run, vcpu);
326 kvmppc_account_exit(vcpu, MMIO_EXITS);
370 } 327 }
371 328
372 break; 329 break;
373 } 330 }
374 331
332 /* XXX move to a 440-specific file. */
375 case BOOKE_INTERRUPT_ITLB_MISS: { 333 case BOOKE_INTERRUPT_ITLB_MISS: {
376 struct tlbe *gtlbe; 334 struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
335 struct kvmppc_44x_tlbe *gtlbe;
377 unsigned long eaddr = vcpu->arch.pc; 336 unsigned long eaddr = vcpu->arch.pc;
337 gpa_t gpaddr;
378 gfn_t gfn; 338 gfn_t gfn;
339 int gtlb_index;
379 340
380 r = RESUME_GUEST; 341 r = RESUME_GUEST;
381 342
382 /* Check the guest TLB. */ 343 /* Check the guest TLB. */
383 gtlbe = kvmppc_44x_itlb_search(vcpu, eaddr); 344 gtlb_index = kvmppc_44x_itlb_index(vcpu, eaddr);
384 if (!gtlbe) { 345 if (gtlb_index < 0) {
385 /* The guest didn't have a mapping for it. */ 346 /* The guest didn't have a mapping for it. */
386 kvmppc_queue_exception(vcpu, exit_nr); 347 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_ITLB_MISS);
387 vcpu->stat.itlb_real_miss_exits++; 348 kvmppc_account_exit(vcpu, ITLB_REAL_MISS_EXITS);
388 break; 349 break;
389 } 350 }
390 351
391 vcpu->stat.itlb_virt_miss_exits++; 352 kvmppc_account_exit(vcpu, ITLB_VIRT_MISS_EXITS);
392 353
393 gfn = tlb_xlate(gtlbe, eaddr) >> PAGE_SHIFT; 354 gtlbe = &vcpu_44x->guest_tlb[gtlb_index];
355 gpaddr = tlb_xlate(gtlbe, eaddr);
356 gfn = gpaddr >> PAGE_SHIFT;
394 357
395 if (kvm_is_visible_gfn(vcpu->kvm, gfn)) { 358 if (kvm_is_visible_gfn(vcpu->kvm, gfn)) {
396 /* The guest TLB had a mapping, but the shadow TLB 359 /* The guest TLB had a mapping, but the shadow TLB
@@ -399,12 +362,11 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
399 * b) the guest used a large mapping which we're faking 362 * b) the guest used a large mapping which we're faking
400 * Either way, we need to satisfy the fault without 363 * Either way, we need to satisfy the fault without
401 * invoking the guest. */ 364 * invoking the guest. */
402 kvmppc_mmu_map(vcpu, eaddr, gfn, gtlbe->tid, 365 kvmppc_mmu_map(vcpu, eaddr, gpaddr, gtlbe->tid,
403 gtlbe->word2); 366 gtlbe->word2, get_tlb_bytes(gtlbe), gtlb_index);
404 } else { 367 } else {
405 /* Guest mapped and leaped at non-RAM! */ 368 /* Guest mapped and leaped at non-RAM! */
406 kvmppc_queue_exception(vcpu, 369 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_MACHINE_CHECK);
407 BOOKE_INTERRUPT_MACHINE_CHECK);
408 } 370 }
409 371
410 break; 372 break;
@@ -421,6 +383,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
421 mtspr(SPRN_DBSR, dbsr); 383 mtspr(SPRN_DBSR, dbsr);
422 384
423 run->exit_reason = KVM_EXIT_DEBUG; 385 run->exit_reason = KVM_EXIT_DEBUG;
386 kvmppc_account_exit(vcpu, DEBUG_EXITS);
424 r = RESUME_HOST; 387 r = RESUME_HOST;
425 break; 388 break;
426 } 389 }
@@ -432,10 +395,8 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
432 395
433 local_irq_disable(); 396 local_irq_disable();
434 397
435 kvmppc_check_and_deliver_interrupts(vcpu); 398 kvmppc_core_deliver_interrupts(vcpu);
436 399
437 /* Do some exit accounting. */
438 vcpu->stat.sum_exits++;
439 if (!(r & RESUME_HOST)) { 400 if (!(r & RESUME_HOST)) {
440 /* To avoid clobbering exit_reason, only check for signals if 401 /* To avoid clobbering exit_reason, only check for signals if
441 * we aren't already exiting to userspace for some other 402 * we aren't already exiting to userspace for some other
@@ -443,22 +404,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
443 if (signal_pending(current)) { 404 if (signal_pending(current)) {
444 run->exit_reason = KVM_EXIT_INTR; 405 run->exit_reason = KVM_EXIT_INTR;
445 r = (-EINTR << 2) | RESUME_HOST | (r & RESUME_FLAG_NV); 406 r = (-EINTR << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
446 407 kvmppc_account_exit(vcpu, SIGNAL_EXITS);
447 vcpu->stat.signal_exits++;
448 } else {
449 vcpu->stat.light_exits++;
450 }
451 } else {
452 switch (run->exit_reason) {
453 case KVM_EXIT_MMIO:
454 vcpu->stat.mmio_exits++;
455 break;
456 case KVM_EXIT_DCR:
457 vcpu->stat.dcr_exits++;
458 break;
459 case KVM_EXIT_INTR:
460 vcpu->stat.signal_exits++;
461 break;
462 } 408 }
463 } 409 }
464 410
@@ -468,20 +414,6 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
468/* Initial guest state: 16MB mapping 0 -> 0, PC = 0, MSR = 0, R1 = 16MB */ 414/* Initial guest state: 16MB mapping 0 -> 0, PC = 0, MSR = 0, R1 = 16MB */
469int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) 415int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
470{ 416{
471 struct tlbe *tlbe = &vcpu->arch.guest_tlb[0];
472
473 tlbe->tid = 0;
474 tlbe->word0 = PPC44x_TLB_16M | PPC44x_TLB_VALID;
475 tlbe->word1 = 0;
476 tlbe->word2 = PPC44x_TLB_SX | PPC44x_TLB_SW | PPC44x_TLB_SR;
477
478 tlbe++;
479 tlbe->tid = 0;
480 tlbe->word0 = 0xef600000 | PPC44x_TLB_4K | PPC44x_TLB_VALID;
481 tlbe->word1 = 0xef600000;
482 tlbe->word2 = PPC44x_TLB_SX | PPC44x_TLB_SW | PPC44x_TLB_SR
483 | PPC44x_TLB_I | PPC44x_TLB_G;
484
485 vcpu->arch.pc = 0; 417 vcpu->arch.pc = 0;
486 vcpu->arch.msr = 0; 418 vcpu->arch.msr = 0;
487 vcpu->arch.gpr[1] = (16<<20) - 8; /* -8 for the callee-save LR slot */ 419 vcpu->arch.gpr[1] = (16<<20) - 8; /* -8 for the callee-save LR slot */
@@ -492,12 +424,9 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
492 * before it's programmed its own IVPR. */ 424 * before it's programmed its own IVPR. */
493 vcpu->arch.ivpr = 0x55550000; 425 vcpu->arch.ivpr = 0x55550000;
494 426
495 /* Since the guest can directly access the timebase, it must know the 427 kvmppc_init_timing_stats(vcpu);
496 * real timebase frequency. Accordingly, it must see the state of
497 * CCR1[TCS]. */
498 vcpu->arch.ccr1 = mfspr(SPRN_CCR1);
499 428
500 return 0; 429 return kvmppc_core_vcpu_setup(vcpu);
501} 430}
502 431
503int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) 432int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
@@ -536,7 +465,7 @@ int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
536 vcpu->arch.ctr = regs->ctr; 465 vcpu->arch.ctr = regs->ctr;
537 vcpu->arch.lr = regs->lr; 466 vcpu->arch.lr = regs->lr;
538 vcpu->arch.xer = regs->xer; 467 vcpu->arch.xer = regs->xer;
539 vcpu->arch.msr = regs->msr; 468 kvmppc_set_msr(vcpu, regs->msr);
540 vcpu->arch.srr0 = regs->srr0; 469 vcpu->arch.srr0 = regs->srr0;
541 vcpu->arch.srr1 = regs->srr1; 470 vcpu->arch.srr1 = regs->srr1;
542 vcpu->arch.sprg0 = regs->sprg0; 471 vcpu->arch.sprg0 = regs->sprg0;
@@ -575,31 +504,62 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
575 return -ENOTSUPP; 504 return -ENOTSUPP;
576} 505}
577 506
578/* 'linear_address' is actually an encoding of AS|PID|EADDR . */
579int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu, 507int kvm_arch_vcpu_ioctl_translate(struct kvm_vcpu *vcpu,
580 struct kvm_translation *tr) 508 struct kvm_translation *tr)
581{ 509{
582 struct tlbe *gtlbe; 510 return kvmppc_core_vcpu_translate(vcpu, tr);
583 int index; 511}
584 gva_t eaddr;
585 u8 pid;
586 u8 as;
587
588 eaddr = tr->linear_address;
589 pid = (tr->linear_address >> 32) & 0xff;
590 as = (tr->linear_address >> 40) & 0x1;
591
592 index = kvmppc_44x_tlb_index(vcpu, eaddr, pid, as);
593 if (index == -1) {
594 tr->valid = 0;
595 return 0;
596 }
597 512
598 gtlbe = &vcpu->arch.guest_tlb[index]; 513int kvmppc_booke_init(void)
514{
515 unsigned long ivor[16];
516 unsigned long max_ivor = 0;
517 int i;
599 518
600 tr->physical_address = tlb_xlate(gtlbe, eaddr); 519 /* We install our own exception handlers by hijacking IVPR. IVPR must
601 /* XXX what does "writeable" and "usermode" even mean? */ 520 * be 16-bit aligned, so we need a 64KB allocation. */
602 tr->valid = 1; 521 kvmppc_booke_handlers = __get_free_pages(GFP_KERNEL | __GFP_ZERO,
522 VCPU_SIZE_ORDER);
523 if (!kvmppc_booke_handlers)
524 return -ENOMEM;
525
526 /* XXX make sure our handlers are smaller than Linux's */
527
528 /* Copy our interrupt handlers to match host IVORs. That way we don't
529 * have to swap the IVORs on every guest/host transition. */
530 ivor[0] = mfspr(SPRN_IVOR0);
531 ivor[1] = mfspr(SPRN_IVOR1);
532 ivor[2] = mfspr(SPRN_IVOR2);
533 ivor[3] = mfspr(SPRN_IVOR3);
534 ivor[4] = mfspr(SPRN_IVOR4);
535 ivor[5] = mfspr(SPRN_IVOR5);
536 ivor[6] = mfspr(SPRN_IVOR6);
537 ivor[7] = mfspr(SPRN_IVOR7);
538 ivor[8] = mfspr(SPRN_IVOR8);
539 ivor[9] = mfspr(SPRN_IVOR9);
540 ivor[10] = mfspr(SPRN_IVOR10);
541 ivor[11] = mfspr(SPRN_IVOR11);
542 ivor[12] = mfspr(SPRN_IVOR12);
543 ivor[13] = mfspr(SPRN_IVOR13);
544 ivor[14] = mfspr(SPRN_IVOR14);
545 ivor[15] = mfspr(SPRN_IVOR15);
546
547 for (i = 0; i < 16; i++) {
548 if (ivor[i] > max_ivor)
549 max_ivor = ivor[i];
550
551 memcpy((void *)kvmppc_booke_handlers + ivor[i],
552 kvmppc_handlers_start + i * kvmppc_handler_len,
553 kvmppc_handler_len);
554 }
555 flush_icache_range(kvmppc_booke_handlers,
556 kvmppc_booke_handlers + max_ivor + kvmppc_handler_len);
603 557
604 return 0; 558 return 0;
605} 559}
560
561void __exit kvmppc_booke_exit(void)
562{
563 free_pages(kvmppc_booke_handlers, VCPU_SIZE_ORDER);
564 kvm_exit();
565}
diff --git a/arch/powerpc/kvm/booke.h b/arch/powerpc/kvm/booke.h
new file mode 100644
index 000000000000..cf7c94ca24bf
--- /dev/null
+++ b/arch/powerpc/kvm/booke.h
@@ -0,0 +1,60 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14 *
15 * Copyright IBM Corp. 2008
16 *
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
18 */
19
20#ifndef __KVM_BOOKE_H__
21#define __KVM_BOOKE_H__
22
23#include <linux/types.h>
24#include <linux/kvm_host.h>
25#include "timing.h"
26
27/* interrupt priortity ordering */
28#define BOOKE_IRQPRIO_DATA_STORAGE 0
29#define BOOKE_IRQPRIO_INST_STORAGE 1
30#define BOOKE_IRQPRIO_ALIGNMENT 2
31#define BOOKE_IRQPRIO_PROGRAM 3
32#define BOOKE_IRQPRIO_FP_UNAVAIL 4
33#define BOOKE_IRQPRIO_SYSCALL 5
34#define BOOKE_IRQPRIO_AP_UNAVAIL 6
35#define BOOKE_IRQPRIO_DTLB_MISS 7
36#define BOOKE_IRQPRIO_ITLB_MISS 8
37#define BOOKE_IRQPRIO_MACHINE_CHECK 9
38#define BOOKE_IRQPRIO_DEBUG 10
39#define BOOKE_IRQPRIO_CRITICAL 11
40#define BOOKE_IRQPRIO_WATCHDOG 12
41#define BOOKE_IRQPRIO_EXTERNAL 13
42#define BOOKE_IRQPRIO_FIT 14
43#define BOOKE_IRQPRIO_DECREMENTER 15
44
45/* Helper function for "full" MSR writes. No need to call this if only EE is
46 * changing. */
47static inline void kvmppc_set_msr(struct kvm_vcpu *vcpu, u32 new_msr)
48{
49 if ((new_msr & MSR_PR) != (vcpu->arch.msr & MSR_PR))
50 kvmppc_mmu_priv_switch(vcpu, new_msr & MSR_PR);
51
52 vcpu->arch.msr = new_msr;
53
54 if (vcpu->arch.msr & MSR_WE) {
55 kvm_vcpu_block(vcpu);
56 kvmppc_set_exit_type(vcpu, EMULATED_MTMSRWE_EXITS);
57 };
58}
59
60#endif /* __KVM_BOOKE_H__ */
diff --git a/arch/powerpc/kvm/booke_host.c b/arch/powerpc/kvm/booke_host.c
deleted file mode 100644
index b480341bc31e..000000000000
--- a/arch/powerpc/kvm/booke_host.c
+++ /dev/null
@@ -1,83 +0,0 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14 *
15 * Copyright IBM Corp. 2008
16 *
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
18 */
19
20#include <linux/errno.h>
21#include <linux/kvm_host.h>
22#include <linux/module.h>
23#include <asm/cacheflush.h>
24#include <asm/kvm_ppc.h>
25
26unsigned long kvmppc_booke_handlers;
27
28static int kvmppc_booke_init(void)
29{
30 unsigned long ivor[16];
31 unsigned long max_ivor = 0;
32 int i;
33
34 /* We install our own exception handlers by hijacking IVPR. IVPR must
35 * be 16-bit aligned, so we need a 64KB allocation. */
36 kvmppc_booke_handlers = __get_free_pages(GFP_KERNEL | __GFP_ZERO,
37 VCPU_SIZE_ORDER);
38 if (!kvmppc_booke_handlers)
39 return -ENOMEM;
40
41 /* XXX make sure our handlers are smaller than Linux's */
42
43 /* Copy our interrupt handlers to match host IVORs. That way we don't
44 * have to swap the IVORs on every guest/host transition. */
45 ivor[0] = mfspr(SPRN_IVOR0);
46 ivor[1] = mfspr(SPRN_IVOR1);
47 ivor[2] = mfspr(SPRN_IVOR2);
48 ivor[3] = mfspr(SPRN_IVOR3);
49 ivor[4] = mfspr(SPRN_IVOR4);
50 ivor[5] = mfspr(SPRN_IVOR5);
51 ivor[6] = mfspr(SPRN_IVOR6);
52 ivor[7] = mfspr(SPRN_IVOR7);
53 ivor[8] = mfspr(SPRN_IVOR8);
54 ivor[9] = mfspr(SPRN_IVOR9);
55 ivor[10] = mfspr(SPRN_IVOR10);
56 ivor[11] = mfspr(SPRN_IVOR11);
57 ivor[12] = mfspr(SPRN_IVOR12);
58 ivor[13] = mfspr(SPRN_IVOR13);
59 ivor[14] = mfspr(SPRN_IVOR14);
60 ivor[15] = mfspr(SPRN_IVOR15);
61
62 for (i = 0; i < 16; i++) {
63 if (ivor[i] > max_ivor)
64 max_ivor = ivor[i];
65
66 memcpy((void *)kvmppc_booke_handlers + ivor[i],
67 kvmppc_handlers_start + i * kvmppc_handler_len,
68 kvmppc_handler_len);
69 }
70 flush_icache_range(kvmppc_booke_handlers,
71 kvmppc_booke_handlers + max_ivor + kvmppc_handler_len);
72
73 return kvm_init(NULL, sizeof(struct kvm_vcpu), THIS_MODULE);
74}
75
76static void __exit kvmppc_booke_exit(void)
77{
78 free_pages(kvmppc_booke_handlers, VCPU_SIZE_ORDER);
79 kvm_exit();
80}
81
82module_init(kvmppc_booke_init)
83module_exit(kvmppc_booke_exit)
diff --git a/arch/powerpc/kvm/booke_interrupts.S b/arch/powerpc/kvm/booke_interrupts.S
index 95e165baf85f..084ebcd7dd83 100644
--- a/arch/powerpc/kvm/booke_interrupts.S
+++ b/arch/powerpc/kvm/booke_interrupts.S
@@ -107,6 +107,18 @@ _GLOBAL(kvmppc_resume_host)
107 li r6, 1 107 li r6, 1
108 slw r6, r6, r5 108 slw r6, r6, r5
109 109
110#ifdef CONFIG_KVM_EXIT_TIMING
111 /* save exit time */
1121:
113 mfspr r7, SPRN_TBRU
114 mfspr r8, SPRN_TBRL
115 mfspr r9, SPRN_TBRU
116 cmpw r9, r7
117 bne 1b
118 stw r8, VCPU_TIMING_EXIT_TBL(r4)
119 stw r9, VCPU_TIMING_EXIT_TBU(r4)
120#endif
121
110 /* Save the faulting instruction and all GPRs for emulation. */ 122 /* Save the faulting instruction and all GPRs for emulation. */
111 andi. r7, r6, NEED_INST_MASK 123 andi. r7, r6, NEED_INST_MASK
112 beq ..skip_inst_copy 124 beq ..skip_inst_copy
@@ -335,54 +347,6 @@ lightweight_exit:
335 lwz r3, VCPU_SHADOW_PID(r4) 347 lwz r3, VCPU_SHADOW_PID(r4)
336 mtspr SPRN_PID, r3 348 mtspr SPRN_PID, r3
337 349
338 /* Prevent all asynchronous TLB updates. */
339 mfmsr r5
340 lis r6, (MSR_EE|MSR_CE|MSR_ME|MSR_DE)@h
341 ori r6, r6, (MSR_EE|MSR_CE|MSR_ME|MSR_DE)@l
342 andc r6, r5, r6
343 mtmsr r6
344
345 /* Load the guest mappings, leaving the host's "pinned" kernel mappings
346 * in place. */
347 mfspr r10, SPRN_MMUCR /* Save host MMUCR. */
348 li r5, PPC44x_TLB_SIZE
349 lis r5, tlb_44x_hwater@ha
350 lwz r5, tlb_44x_hwater@l(r5)
351 mtctr r5
352 addi r9, r4, VCPU_SHADOW_TLB
353 addi r5, r4, VCPU_SHADOW_MOD
354 li r3, 0
3551:
356 lbzx r7, r3, r5
357 cmpwi r7, 0
358 beq 3f
359
360 /* Load guest entry. */
361 mulli r11, r3, TLBE_BYTES
362 add r11, r11, r9
363 lwz r7, 0(r11)
364 mtspr SPRN_MMUCR, r7
365 lwz r7, 4(r11)
366 tlbwe r7, r3, PPC44x_TLB_PAGEID
367 lwz r7, 8(r11)
368 tlbwe r7, r3, PPC44x_TLB_XLAT
369 lwz r7, 12(r11)
370 tlbwe r7, r3, PPC44x_TLB_ATTRIB
3713:
372 addi r3, r3, 1 /* Increment index. */
373 bdnz 1b
374
375 mtspr SPRN_MMUCR, r10 /* Restore host MMUCR. */
376
377 /* Clear bitmap of modified TLB entries */
378 li r5, PPC44x_TLB_SIZE>>2
379 mtctr r5
380 addi r5, r4, VCPU_SHADOW_MOD - 4
381 li r6, 0
3821:
383 stwu r6, 4(r5)
384 bdnz 1b
385
386 iccci 0, 0 /* XXX hack */ 350 iccci 0, 0 /* XXX hack */
387 351
388 /* Load some guest volatiles. */ 352 /* Load some guest volatiles. */
@@ -423,6 +387,18 @@ lightweight_exit:
423 lwz r3, VCPU_SPRG7(r4) 387 lwz r3, VCPU_SPRG7(r4)
424 mtspr SPRN_SPRG7, r3 388 mtspr SPRN_SPRG7, r3
425 389
390#ifdef CONFIG_KVM_EXIT_TIMING
391 /* save enter time */
3921:
393 mfspr r6, SPRN_TBRU
394 mfspr r7, SPRN_TBRL
395 mfspr r8, SPRN_TBRU
396 cmpw r8, r6
397 bne 1b
398 stw r7, VCPU_TIMING_LAST_ENTER_TBL(r4)
399 stw r8, VCPU_TIMING_LAST_ENTER_TBU(r4)
400#endif
401
426 /* Finish loading guest volatiles and jump to guest. */ 402 /* Finish loading guest volatiles and jump to guest. */
427 lwz r3, VCPU_CTR(r4) 403 lwz r3, VCPU_CTR(r4)
428 mtctr r3 404 mtctr r3
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index 0fce4fbdc20d..d1d38daa93fb 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -23,161 +23,14 @@
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/kvm_host.h> 24#include <linux/kvm_host.h>
25 25
26#include <asm/dcr.h> 26#include <asm/reg.h>
27#include <asm/dcr-regs.h>
28#include <asm/time.h> 27#include <asm/time.h>
29#include <asm/byteorder.h> 28#include <asm/byteorder.h>
30#include <asm/kvm_ppc.h> 29#include <asm/kvm_ppc.h>
30#include <asm/disassemble.h>
31#include "timing.h"
31 32
32#include "44x_tlb.h" 33void kvmppc_emulate_dec(struct kvm_vcpu *vcpu)
33
34/* Instruction decoding */
35static inline unsigned int get_op(u32 inst)
36{
37 return inst >> 26;
38}
39
40static inline unsigned int get_xop(u32 inst)
41{
42 return (inst >> 1) & 0x3ff;
43}
44
45static inline unsigned int get_sprn(u32 inst)
46{
47 return ((inst >> 16) & 0x1f) | ((inst >> 6) & 0x3e0);
48}
49
50static inline unsigned int get_dcrn(u32 inst)
51{
52 return ((inst >> 16) & 0x1f) | ((inst >> 6) & 0x3e0);
53}
54
55static inline unsigned int get_rt(u32 inst)
56{
57 return (inst >> 21) & 0x1f;
58}
59
60static inline unsigned int get_rs(u32 inst)
61{
62 return (inst >> 21) & 0x1f;
63}
64
65static inline unsigned int get_ra(u32 inst)
66{
67 return (inst >> 16) & 0x1f;
68}
69
70static inline unsigned int get_rb(u32 inst)
71{
72 return (inst >> 11) & 0x1f;
73}
74
75static inline unsigned int get_rc(u32 inst)
76{
77 return inst & 0x1;
78}
79
80static inline unsigned int get_ws(u32 inst)
81{
82 return (inst >> 11) & 0x1f;
83}
84
85static inline unsigned int get_d(u32 inst)
86{
87 return inst & 0xffff;
88}
89
90static int tlbe_is_host_safe(const struct kvm_vcpu *vcpu,
91 const struct tlbe *tlbe)
92{
93 gpa_t gpa;
94
95 if (!get_tlb_v(tlbe))
96 return 0;
97
98 /* Does it match current guest AS? */
99 /* XXX what about IS != DS? */
100 if (get_tlb_ts(tlbe) != !!(vcpu->arch.msr & MSR_IS))
101 return 0;
102
103 gpa = get_tlb_raddr(tlbe);
104 if (!gfn_to_memslot(vcpu->kvm, gpa >> PAGE_SHIFT))
105 /* Mapping is not for RAM. */
106 return 0;
107
108 return 1;
109}
110
111static int kvmppc_emul_tlbwe(struct kvm_vcpu *vcpu, u32 inst)
112{
113 u64 eaddr;
114 u64 raddr;
115 u64 asid;
116 u32 flags;
117 struct tlbe *tlbe;
118 unsigned int ra;
119 unsigned int rs;
120 unsigned int ws;
121 unsigned int index;
122
123 ra = get_ra(inst);
124 rs = get_rs(inst);
125 ws = get_ws(inst);
126
127 index = vcpu->arch.gpr[ra];
128 if (index > PPC44x_TLB_SIZE) {
129 printk("%s: index %d\n", __func__, index);
130 kvmppc_dump_vcpu(vcpu);
131 return EMULATE_FAIL;
132 }
133
134 tlbe = &vcpu->arch.guest_tlb[index];
135
136 /* Invalidate shadow mappings for the about-to-be-clobbered TLBE. */
137 if (tlbe->word0 & PPC44x_TLB_VALID) {
138 eaddr = get_tlb_eaddr(tlbe);
139 asid = (tlbe->word0 & PPC44x_TLB_TS) | tlbe->tid;
140 kvmppc_mmu_invalidate(vcpu, eaddr, get_tlb_end(tlbe), asid);
141 }
142
143 switch (ws) {
144 case PPC44x_TLB_PAGEID:
145 tlbe->tid = vcpu->arch.mmucr & 0xff;
146 tlbe->word0 = vcpu->arch.gpr[rs];
147 break;
148
149 case PPC44x_TLB_XLAT:
150 tlbe->word1 = vcpu->arch.gpr[rs];
151 break;
152
153 case PPC44x_TLB_ATTRIB:
154 tlbe->word2 = vcpu->arch.gpr[rs];
155 break;
156
157 default:
158 return EMULATE_FAIL;
159 }
160
161 if (tlbe_is_host_safe(vcpu, tlbe)) {
162 eaddr = get_tlb_eaddr(tlbe);
163 raddr = get_tlb_raddr(tlbe);
164 asid = (tlbe->word0 & PPC44x_TLB_TS) | tlbe->tid;
165 flags = tlbe->word2 & 0xffff;
166
167 /* Create a 4KB mapping on the host. If the guest wanted a
168 * large page, only the first 4KB is mapped here and the rest
169 * are mapped on the fly. */
170 kvmppc_mmu_map(vcpu, eaddr, raddr >> PAGE_SHIFT, asid, flags);
171 }
172
173 KVMTRACE_5D(GTLB_WRITE, vcpu, index,
174 tlbe->tid, tlbe->word0, tlbe->word1, tlbe->word2,
175 handler);
176
177 return EMULATE_DONE;
178}
179
180static void kvmppc_emulate_dec(struct kvm_vcpu *vcpu)
181{ 34{
182 if (vcpu->arch.tcr & TCR_DIE) { 35 if (vcpu->arch.tcr & TCR_DIE) {
183 /* The decrementer ticks at the same rate as the timebase, so 36 /* The decrementer ticks at the same rate as the timebase, so
@@ -193,12 +46,6 @@ static void kvmppc_emulate_dec(struct kvm_vcpu *vcpu)
193 } 46 }
194} 47}
195 48
196static void kvmppc_emul_rfi(struct kvm_vcpu *vcpu)
197{
198 vcpu->arch.pc = vcpu->arch.srr0;
199 kvmppc_set_msr(vcpu, vcpu->arch.srr1);
200}
201
202/* XXX to do: 49/* XXX to do:
203 * lhax 50 * lhax
204 * lhaux 51 * lhaux
@@ -213,40 +60,30 @@ static void kvmppc_emul_rfi(struct kvm_vcpu *vcpu)
213 * 60 *
214 * XXX is_bigendian should depend on MMU mapping or MSR[LE] 61 * XXX is_bigendian should depend on MMU mapping or MSR[LE]
215 */ 62 */
63/* XXX Should probably auto-generate instruction decoding for a particular core
64 * from opcode tables in the future. */
216int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu) 65int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
217{ 66{
218 u32 inst = vcpu->arch.last_inst; 67 u32 inst = vcpu->arch.last_inst;
219 u32 ea; 68 u32 ea;
220 int ra; 69 int ra;
221 int rb; 70 int rb;
222 int rc;
223 int rs; 71 int rs;
224 int rt; 72 int rt;
225 int sprn; 73 int sprn;
226 int dcrn;
227 enum emulation_result emulated = EMULATE_DONE; 74 enum emulation_result emulated = EMULATE_DONE;
228 int advance = 1; 75 int advance = 1;
229 76
77 /* this default type might be overwritten by subcategories */
78 kvmppc_set_exit_type(vcpu, EMULATED_INST_EXITS);
79
230 switch (get_op(inst)) { 80 switch (get_op(inst)) {
231 case 3: /* trap */ 81 case 3: /* trap */
232 printk("trap!\n"); 82 vcpu->arch.esr |= ESR_PTR;
233 kvmppc_queue_exception(vcpu, BOOKE_INTERRUPT_PROGRAM); 83 kvmppc_core_queue_program(vcpu);
234 advance = 0; 84 advance = 0;
235 break; 85 break;
236 86
237 case 19:
238 switch (get_xop(inst)) {
239 case 50: /* rfi */
240 kvmppc_emul_rfi(vcpu);
241 advance = 0;
242 break;
243
244 default:
245 emulated = EMULATE_FAIL;
246 break;
247 }
248 break;
249
250 case 31: 87 case 31:
251 switch (get_xop(inst)) { 88 switch (get_xop(inst)) {
252 89
@@ -255,27 +92,11 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
255 emulated = kvmppc_handle_load(run, vcpu, rt, 4, 1); 92 emulated = kvmppc_handle_load(run, vcpu, rt, 4, 1);
256 break; 93 break;
257 94
258 case 83: /* mfmsr */
259 rt = get_rt(inst);
260 vcpu->arch.gpr[rt] = vcpu->arch.msr;
261 break;
262
263 case 87: /* lbzx */ 95 case 87: /* lbzx */
264 rt = get_rt(inst); 96 rt = get_rt(inst);
265 emulated = kvmppc_handle_load(run, vcpu, rt, 1, 1); 97 emulated = kvmppc_handle_load(run, vcpu, rt, 1, 1);
266 break; 98 break;
267 99
268 case 131: /* wrtee */
269 rs = get_rs(inst);
270 vcpu->arch.msr = (vcpu->arch.msr & ~MSR_EE)
271 | (vcpu->arch.gpr[rs] & MSR_EE);
272 break;
273
274 case 146: /* mtmsr */
275 rs = get_rs(inst);
276 kvmppc_set_msr(vcpu, vcpu->arch.gpr[rs]);
277 break;
278
279 case 151: /* stwx */ 100 case 151: /* stwx */
280 rs = get_rs(inst); 101 rs = get_rs(inst);
281 emulated = kvmppc_handle_store(run, vcpu, 102 emulated = kvmppc_handle_store(run, vcpu,
@@ -283,11 +104,6 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
283 4, 1); 104 4, 1);
284 break; 105 break;
285 106
286 case 163: /* wrteei */
287 vcpu->arch.msr = (vcpu->arch.msr & ~MSR_EE)
288 | (inst & MSR_EE);
289 break;
290
291 case 215: /* stbx */ 107 case 215: /* stbx */
292 rs = get_rs(inst); 108 rs = get_rs(inst);
293 emulated = kvmppc_handle_store(run, vcpu, 109 emulated = kvmppc_handle_store(run, vcpu,
@@ -328,42 +144,6 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
328 vcpu->arch.gpr[ra] = ea; 144 vcpu->arch.gpr[ra] = ea;
329 break; 145 break;
330 146
331 case 323: /* mfdcr */
332 dcrn = get_dcrn(inst);
333 rt = get_rt(inst);
334
335 /* The guest may access CPR0 registers to determine the timebase
336 * frequency, and it must know the real host frequency because it
337 * can directly access the timebase registers.
338 *
339 * It would be possible to emulate those accesses in userspace,
340 * but userspace can really only figure out the end frequency.
341 * We could decompose that into the factors that compute it, but
342 * that's tricky math, and it's easier to just report the real
343 * CPR0 values.
344 */
345 switch (dcrn) {
346 case DCRN_CPR0_CONFIG_ADDR:
347 vcpu->arch.gpr[rt] = vcpu->arch.cpr0_cfgaddr;
348 break;
349 case DCRN_CPR0_CONFIG_DATA:
350 local_irq_disable();
351 mtdcr(DCRN_CPR0_CONFIG_ADDR,
352 vcpu->arch.cpr0_cfgaddr);
353 vcpu->arch.gpr[rt] = mfdcr(DCRN_CPR0_CONFIG_DATA);
354 local_irq_enable();
355 break;
356 default:
357 run->dcr.dcrn = dcrn;
358 run->dcr.data = 0;
359 run->dcr.is_write = 0;
360 vcpu->arch.io_gpr = rt;
361 vcpu->arch.dcr_needed = 1;
362 emulated = EMULATE_DO_DCR;
363 }
364
365 break;
366
367 case 339: /* mfspr */ 147 case 339: /* mfspr */
368 sprn = get_sprn(inst); 148 sprn = get_sprn(inst);
369 rt = get_rt(inst); 149 rt = get_rt(inst);
@@ -373,26 +153,8 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
373 vcpu->arch.gpr[rt] = vcpu->arch.srr0; break; 153 vcpu->arch.gpr[rt] = vcpu->arch.srr0; break;
374 case SPRN_SRR1: 154 case SPRN_SRR1:
375 vcpu->arch.gpr[rt] = vcpu->arch.srr1; break; 155 vcpu->arch.gpr[rt] = vcpu->arch.srr1; break;
376 case SPRN_MMUCR:
377 vcpu->arch.gpr[rt] = vcpu->arch.mmucr; break;
378 case SPRN_PID:
379 vcpu->arch.gpr[rt] = vcpu->arch.pid; break;
380 case SPRN_IVPR:
381 vcpu->arch.gpr[rt] = vcpu->arch.ivpr; break;
382 case SPRN_CCR0:
383 vcpu->arch.gpr[rt] = vcpu->arch.ccr0; break;
384 case SPRN_CCR1:
385 vcpu->arch.gpr[rt] = vcpu->arch.ccr1; break;
386 case SPRN_PVR: 156 case SPRN_PVR:
387 vcpu->arch.gpr[rt] = vcpu->arch.pvr; break; 157 vcpu->arch.gpr[rt] = vcpu->arch.pvr; break;
388 case SPRN_DEAR:
389 vcpu->arch.gpr[rt] = vcpu->arch.dear; break;
390 case SPRN_ESR:
391 vcpu->arch.gpr[rt] = vcpu->arch.esr; break;
392 case SPRN_DBCR0:
393 vcpu->arch.gpr[rt] = vcpu->arch.dbcr0; break;
394 case SPRN_DBCR1:
395 vcpu->arch.gpr[rt] = vcpu->arch.dbcr1; break;
396 158
397 /* Note: mftb and TBRL/TBWL are user-accessible, so 159 /* Note: mftb and TBRL/TBWL are user-accessible, so
398 * the guest can always access the real TB anyways. 160 * the guest can always access the real TB anyways.
@@ -413,42 +175,12 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
413 /* Note: SPRG4-7 are user-readable, so we don't get 175 /* Note: SPRG4-7 are user-readable, so we don't get
414 * a trap. */ 176 * a trap. */
415 177
416 case SPRN_IVOR0:
417 vcpu->arch.gpr[rt] = vcpu->arch.ivor[0]; break;
418 case SPRN_IVOR1:
419 vcpu->arch.gpr[rt] = vcpu->arch.ivor[1]; break;
420 case SPRN_IVOR2:
421 vcpu->arch.gpr[rt] = vcpu->arch.ivor[2]; break;
422 case SPRN_IVOR3:
423 vcpu->arch.gpr[rt] = vcpu->arch.ivor[3]; break;
424 case SPRN_IVOR4:
425 vcpu->arch.gpr[rt] = vcpu->arch.ivor[4]; break;
426 case SPRN_IVOR5:
427 vcpu->arch.gpr[rt] = vcpu->arch.ivor[5]; break;
428 case SPRN_IVOR6:
429 vcpu->arch.gpr[rt] = vcpu->arch.ivor[6]; break;
430 case SPRN_IVOR7:
431 vcpu->arch.gpr[rt] = vcpu->arch.ivor[7]; break;
432 case SPRN_IVOR8:
433 vcpu->arch.gpr[rt] = vcpu->arch.ivor[8]; break;
434 case SPRN_IVOR9:
435 vcpu->arch.gpr[rt] = vcpu->arch.ivor[9]; break;
436 case SPRN_IVOR10:
437 vcpu->arch.gpr[rt] = vcpu->arch.ivor[10]; break;
438 case SPRN_IVOR11:
439 vcpu->arch.gpr[rt] = vcpu->arch.ivor[11]; break;
440 case SPRN_IVOR12:
441 vcpu->arch.gpr[rt] = vcpu->arch.ivor[12]; break;
442 case SPRN_IVOR13:
443 vcpu->arch.gpr[rt] = vcpu->arch.ivor[13]; break;
444 case SPRN_IVOR14:
445 vcpu->arch.gpr[rt] = vcpu->arch.ivor[14]; break;
446 case SPRN_IVOR15:
447 vcpu->arch.gpr[rt] = vcpu->arch.ivor[15]; break;
448
449 default: 178 default:
450 printk("mfspr: unknown spr %x\n", sprn); 179 emulated = kvmppc_core_emulate_mfspr(vcpu, sprn, rt);
451 vcpu->arch.gpr[rt] = 0; 180 if (emulated == EMULATE_FAIL) {
181 printk("mfspr: unknown spr %x\n", sprn);
182 vcpu->arch.gpr[rt] = 0;
183 }
452 break; 184 break;
453 } 185 }
454 break; 186 break;
@@ -478,25 +210,6 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
478 vcpu->arch.gpr[ra] = ea; 210 vcpu->arch.gpr[ra] = ea;
479 break; 211 break;
480 212
481 case 451: /* mtdcr */
482 dcrn = get_dcrn(inst);
483 rs = get_rs(inst);
484
485 /* emulate some access in kernel */
486 switch (dcrn) {
487 case DCRN_CPR0_CONFIG_ADDR:
488 vcpu->arch.cpr0_cfgaddr = vcpu->arch.gpr[rs];
489 break;
490 default:
491 run->dcr.dcrn = dcrn;
492 run->dcr.data = vcpu->arch.gpr[rs];
493 run->dcr.is_write = 1;
494 vcpu->arch.dcr_needed = 1;
495 emulated = EMULATE_DO_DCR;
496 }
497
498 break;
499
500 case 467: /* mtspr */ 213 case 467: /* mtspr */
501 sprn = get_sprn(inst); 214 sprn = get_sprn(inst);
502 rs = get_rs(inst); 215 rs = get_rs(inst);
@@ -505,22 +218,6 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
505 vcpu->arch.srr0 = vcpu->arch.gpr[rs]; break; 218 vcpu->arch.srr0 = vcpu->arch.gpr[rs]; break;
506 case SPRN_SRR1: 219 case SPRN_SRR1:
507 vcpu->arch.srr1 = vcpu->arch.gpr[rs]; break; 220 vcpu->arch.srr1 = vcpu->arch.gpr[rs]; break;
508 case SPRN_MMUCR:
509 vcpu->arch.mmucr = vcpu->arch.gpr[rs]; break;
510 case SPRN_PID:
511 kvmppc_set_pid(vcpu, vcpu->arch.gpr[rs]); break;
512 case SPRN_CCR0:
513 vcpu->arch.ccr0 = vcpu->arch.gpr[rs]; break;
514 case SPRN_CCR1:
515 vcpu->arch.ccr1 = vcpu->arch.gpr[rs]; break;
516 case SPRN_DEAR:
517 vcpu->arch.dear = vcpu->arch.gpr[rs]; break;
518 case SPRN_ESR:
519 vcpu->arch.esr = vcpu->arch.gpr[rs]; break;
520 case SPRN_DBCR0:
521 vcpu->arch.dbcr0 = vcpu->arch.gpr[rs]; break;
522 case SPRN_DBCR1:
523 vcpu->arch.dbcr1 = vcpu->arch.gpr[rs]; break;
524 221
525 /* XXX We need to context-switch the timebase for 222 /* XXX We need to context-switch the timebase for
526 * watchdog and FIT. */ 223 * watchdog and FIT. */
@@ -532,14 +229,6 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
532 kvmppc_emulate_dec(vcpu); 229 kvmppc_emulate_dec(vcpu);
533 break; 230 break;
534 231
535 case SPRN_TSR:
536 vcpu->arch.tsr &= ~vcpu->arch.gpr[rs]; break;
537
538 case SPRN_TCR:
539 vcpu->arch.tcr = vcpu->arch.gpr[rs];
540 kvmppc_emulate_dec(vcpu);
541 break;
542
543 case SPRN_SPRG0: 232 case SPRN_SPRG0:
544 vcpu->arch.sprg0 = vcpu->arch.gpr[rs]; break; 233 vcpu->arch.sprg0 = vcpu->arch.gpr[rs]; break;
545 case SPRN_SPRG1: 234 case SPRN_SPRG1:
@@ -549,56 +238,10 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
549 case SPRN_SPRG3: 238 case SPRN_SPRG3:
550 vcpu->arch.sprg3 = vcpu->arch.gpr[rs]; break; 239 vcpu->arch.sprg3 = vcpu->arch.gpr[rs]; break;
551 240
552 /* Note: SPRG4-7 are user-readable. These values are
553 * loaded into the real SPRGs when resuming the
554 * guest. */
555 case SPRN_SPRG4:
556 vcpu->arch.sprg4 = vcpu->arch.gpr[rs]; break;
557 case SPRN_SPRG5:
558 vcpu->arch.sprg5 = vcpu->arch.gpr[rs]; break;
559 case SPRN_SPRG6:
560 vcpu->arch.sprg6 = vcpu->arch.gpr[rs]; break;
561 case SPRN_SPRG7:
562 vcpu->arch.sprg7 = vcpu->arch.gpr[rs]; break;
563
564 case SPRN_IVPR:
565 vcpu->arch.ivpr = vcpu->arch.gpr[rs]; break;
566 case SPRN_IVOR0:
567 vcpu->arch.ivor[0] = vcpu->arch.gpr[rs]; break;
568 case SPRN_IVOR1:
569 vcpu->arch.ivor[1] = vcpu->arch.gpr[rs]; break;
570 case SPRN_IVOR2:
571 vcpu->arch.ivor[2] = vcpu->arch.gpr[rs]; break;
572 case SPRN_IVOR3:
573 vcpu->arch.ivor[3] = vcpu->arch.gpr[rs]; break;
574 case SPRN_IVOR4:
575 vcpu->arch.ivor[4] = vcpu->arch.gpr[rs]; break;
576 case SPRN_IVOR5:
577 vcpu->arch.ivor[5] = vcpu->arch.gpr[rs]; break;
578 case SPRN_IVOR6:
579 vcpu->arch.ivor[6] = vcpu->arch.gpr[rs]; break;
580 case SPRN_IVOR7:
581 vcpu->arch.ivor[7] = vcpu->arch.gpr[rs]; break;
582 case SPRN_IVOR8:
583 vcpu->arch.ivor[8] = vcpu->arch.gpr[rs]; break;
584 case SPRN_IVOR9:
585 vcpu->arch.ivor[9] = vcpu->arch.gpr[rs]; break;
586 case SPRN_IVOR10:
587 vcpu->arch.ivor[10] = vcpu->arch.gpr[rs]; break;
588 case SPRN_IVOR11:
589 vcpu->arch.ivor[11] = vcpu->arch.gpr[rs]; break;
590 case SPRN_IVOR12:
591 vcpu->arch.ivor[12] = vcpu->arch.gpr[rs]; break;
592 case SPRN_IVOR13:
593 vcpu->arch.ivor[13] = vcpu->arch.gpr[rs]; break;
594 case SPRN_IVOR14:
595 vcpu->arch.ivor[14] = vcpu->arch.gpr[rs]; break;
596 case SPRN_IVOR15:
597 vcpu->arch.ivor[15] = vcpu->arch.gpr[rs]; break;
598
599 default: 241 default:
600 printk("mtspr: unknown spr %x\n", sprn); 242 emulated = kvmppc_core_emulate_mtspr(vcpu, sprn, rs);
601 emulated = EMULATE_FAIL; 243 if (emulated == EMULATE_FAIL)
244 printk("mtspr: unknown spr %x\n", sprn);
602 break; 245 break;
603 } 246 }
604 break; 247 break;
@@ -629,36 +272,6 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
629 4, 0); 272 4, 0);
630 break; 273 break;
631 274
632 case 978: /* tlbwe */
633 emulated = kvmppc_emul_tlbwe(vcpu, inst);
634 break;
635
636 case 914: { /* tlbsx */
637 int index;
638 unsigned int as = get_mmucr_sts(vcpu);
639 unsigned int pid = get_mmucr_stid(vcpu);
640
641 rt = get_rt(inst);
642 ra = get_ra(inst);
643 rb = get_rb(inst);
644 rc = get_rc(inst);
645
646 ea = vcpu->arch.gpr[rb];
647 if (ra)
648 ea += vcpu->arch.gpr[ra];
649
650 index = kvmppc_44x_tlb_index(vcpu, ea, pid, as);
651 if (rc) {
652 if (index < 0)
653 vcpu->arch.cr &= ~0x20000000;
654 else
655 vcpu->arch.cr |= 0x20000000;
656 }
657 vcpu->arch.gpr[rt] = index;
658
659 }
660 break;
661
662 case 790: /* lhbrx */ 275 case 790: /* lhbrx */
663 rt = get_rt(inst); 276 rt = get_rt(inst);
664 emulated = kvmppc_handle_load(run, vcpu, rt, 2, 0); 277 emulated = kvmppc_handle_load(run, vcpu, rt, 2, 0);
@@ -674,14 +287,9 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
674 2, 0); 287 2, 0);
675 break; 288 break;
676 289
677 case 966: /* iccci */
678 break;
679
680 default: 290 default:
681 printk("unknown: op %d xop %d\n", get_op(inst), 291 /* Attempt core-specific emulation below. */
682 get_xop(inst));
683 emulated = EMULATE_FAIL; 292 emulated = EMULATE_FAIL;
684 break;
685 } 293 }
686 break; 294 break;
687 295
@@ -764,12 +372,19 @@ int kvmppc_emulate_instruction(struct kvm_run *run, struct kvm_vcpu *vcpu)
764 break; 372 break;
765 373
766 default: 374 default:
767 printk("unknown op %d\n", get_op(inst));
768 emulated = EMULATE_FAIL; 375 emulated = EMULATE_FAIL;
769 break;
770 } 376 }
771 377
772 KVMTRACE_3D(PPC_INSTR, vcpu, inst, vcpu->arch.pc, emulated, entryexit); 378 if (emulated == EMULATE_FAIL) {
379 emulated = kvmppc_core_emulate_op(run, vcpu, inst, &advance);
380 if (emulated == EMULATE_FAIL) {
381 advance = 0;
382 printk(KERN_ERR "Couldn't emulate instruction 0x%08x "
383 "(op %d xop %d)\n", inst, get_op(inst), get_xop(inst));
384 }
385 }
386
387 KVMTRACE_3D(PPC_INSTR, vcpu, inst, (int)vcpu->arch.pc, emulated, entryexit);
773 388
774 if (advance) 389 if (advance)
775 vcpu->arch.pc += 4; /* Advance past emulated instruction. */ 390 vcpu->arch.pc += 4; /* Advance past emulated instruction. */
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 8bef0efcdfe1..2822c8ccfaaf 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -28,9 +28,9 @@
28#include <asm/uaccess.h> 28#include <asm/uaccess.h>
29#include <asm/kvm_ppc.h> 29#include <asm/kvm_ppc.h>
30#include <asm/tlbflush.h> 30#include <asm/tlbflush.h>
31#include "timing.h"
31#include "../mm/mmu_decl.h" 32#include "../mm/mmu_decl.h"
32 33
33
34gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn) 34gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn)
35{ 35{
36 return gfn; 36 return gfn;
@@ -99,14 +99,7 @@ void kvm_arch_hardware_unsetup(void)
99 99
100void kvm_arch_check_processor_compat(void *rtn) 100void kvm_arch_check_processor_compat(void *rtn)
101{ 101{
102 int r; 102 *(int *)rtn = kvmppc_core_check_processor_compat();
103
104 if (strcmp(cur_cpu_spec->platform, "ppc440") == 0)
105 r = 0;
106 else
107 r = -ENOTSUPP;
108
109 *(int *)rtn = r;
110} 103}
111 104
112struct kvm *kvm_arch_create_vm(void) 105struct kvm *kvm_arch_create_vm(void)
@@ -144,9 +137,6 @@ int kvm_dev_ioctl_check_extension(long ext)
144 int r; 137 int r;
145 138
146 switch (ext) { 139 switch (ext) {
147 case KVM_CAP_USER_MEMORY:
148 r = 1;
149 break;
150 case KVM_CAP_COALESCED_MMIO: 140 case KVM_CAP_COALESCED_MMIO:
151 r = KVM_COALESCED_MMIO_PAGE_OFFSET; 141 r = KVM_COALESCED_MMIO_PAGE_OFFSET;
152 break; 142 break;
@@ -179,30 +169,15 @@ void kvm_arch_flush_shadow(struct kvm *kvm)
179struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id) 169struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id)
180{ 170{
181 struct kvm_vcpu *vcpu; 171 struct kvm_vcpu *vcpu;
182 int err; 172 vcpu = kvmppc_core_vcpu_create(kvm, id);
183 173 kvmppc_create_vcpu_debugfs(vcpu, id);
184 vcpu = kmem_cache_zalloc(kvm_vcpu_cache, GFP_KERNEL);
185 if (!vcpu) {
186 err = -ENOMEM;
187 goto out;
188 }
189
190 err = kvm_vcpu_init(vcpu, kvm, id);
191 if (err)
192 goto free_vcpu;
193
194 return vcpu; 174 return vcpu;
195
196free_vcpu:
197 kmem_cache_free(kvm_vcpu_cache, vcpu);
198out:
199 return ERR_PTR(err);
200} 175}
201 176
202void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu) 177void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
203{ 178{
204 kvm_vcpu_uninit(vcpu); 179 kvmppc_remove_vcpu_debugfs(vcpu);
205 kmem_cache_free(kvm_vcpu_cache, vcpu); 180 kvmppc_core_vcpu_free(vcpu);
206} 181}
207 182
208void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu) 183void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
@@ -212,16 +187,14 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
212 187
213int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu) 188int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu)
214{ 189{
215 unsigned int priority = exception_priority[BOOKE_INTERRUPT_DECREMENTER]; 190 return kvmppc_core_pending_dec(vcpu);
216
217 return test_bit(priority, &vcpu->arch.pending_exceptions);
218} 191}
219 192
220static void kvmppc_decrementer_func(unsigned long data) 193static void kvmppc_decrementer_func(unsigned long data)
221{ 194{
222 struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data; 195 struct kvm_vcpu *vcpu = (struct kvm_vcpu *)data;
223 196
224 kvmppc_queue_exception(vcpu, BOOKE_INTERRUPT_DECREMENTER); 197 kvmppc_core_queue_dec(vcpu);
225 198
226 if (waitqueue_active(&vcpu->wq)) { 199 if (waitqueue_active(&vcpu->wq)) {
227 wake_up_interruptible(&vcpu->wq); 200 wake_up_interruptible(&vcpu->wq);
@@ -242,96 +215,25 @@ void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
242 kvmppc_core_destroy_mmu(vcpu); 215 kvmppc_core_destroy_mmu(vcpu);
243} 216}
244 217
245/* Note: clearing MSR[DE] just means that the debug interrupt will not be
246 * delivered *immediately*. Instead, it simply sets the appropriate DBSR bits.
247 * If those DBSR bits are still set when MSR[DE] is re-enabled, the interrupt
248 * will be delivered as an "imprecise debug event" (which is indicated by
249 * DBSR[IDE].
250 */
251static void kvmppc_disable_debug_interrupts(void)
252{
253 mtmsr(mfmsr() & ~MSR_DE);
254}
255
256static void kvmppc_restore_host_debug_state(struct kvm_vcpu *vcpu)
257{
258 kvmppc_disable_debug_interrupts();
259
260 mtspr(SPRN_IAC1, vcpu->arch.host_iac[0]);
261 mtspr(SPRN_IAC2, vcpu->arch.host_iac[1]);
262 mtspr(SPRN_IAC3, vcpu->arch.host_iac[2]);
263 mtspr(SPRN_IAC4, vcpu->arch.host_iac[3]);
264 mtspr(SPRN_DBCR1, vcpu->arch.host_dbcr1);
265 mtspr(SPRN_DBCR2, vcpu->arch.host_dbcr2);
266 mtspr(SPRN_DBCR0, vcpu->arch.host_dbcr0);
267 mtmsr(vcpu->arch.host_msr);
268}
269
270static void kvmppc_load_guest_debug_registers(struct kvm_vcpu *vcpu)
271{
272 struct kvm_guest_debug *dbg = &vcpu->guest_debug;
273 u32 dbcr0 = 0;
274
275 vcpu->arch.host_msr = mfmsr();
276 kvmppc_disable_debug_interrupts();
277
278 /* Save host debug register state. */
279 vcpu->arch.host_iac[0] = mfspr(SPRN_IAC1);
280 vcpu->arch.host_iac[1] = mfspr(SPRN_IAC2);
281 vcpu->arch.host_iac[2] = mfspr(SPRN_IAC3);
282 vcpu->arch.host_iac[3] = mfspr(SPRN_IAC4);
283 vcpu->arch.host_dbcr0 = mfspr(SPRN_DBCR0);
284 vcpu->arch.host_dbcr1 = mfspr(SPRN_DBCR1);
285 vcpu->arch.host_dbcr2 = mfspr(SPRN_DBCR2);
286
287 /* set registers up for guest */
288
289 if (dbg->bp[0]) {
290 mtspr(SPRN_IAC1, dbg->bp[0]);
291 dbcr0 |= DBCR0_IAC1 | DBCR0_IDM;
292 }
293 if (dbg->bp[1]) {
294 mtspr(SPRN_IAC2, dbg->bp[1]);
295 dbcr0 |= DBCR0_IAC2 | DBCR0_IDM;
296 }
297 if (dbg->bp[2]) {
298 mtspr(SPRN_IAC3, dbg->bp[2]);
299 dbcr0 |= DBCR0_IAC3 | DBCR0_IDM;
300 }
301 if (dbg->bp[3]) {
302 mtspr(SPRN_IAC4, dbg->bp[3]);
303 dbcr0 |= DBCR0_IAC4 | DBCR0_IDM;
304 }
305
306 mtspr(SPRN_DBCR0, dbcr0);
307 mtspr(SPRN_DBCR1, 0);
308 mtspr(SPRN_DBCR2, 0);
309}
310
311void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) 218void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
312{ 219{
313 int i;
314
315 if (vcpu->guest_debug.enabled) 220 if (vcpu->guest_debug.enabled)
316 kvmppc_load_guest_debug_registers(vcpu); 221 kvmppc_core_load_guest_debugstate(vcpu);
317 222
318 /* Mark every guest entry in the shadow TLB entry modified, so that they 223 kvmppc_core_vcpu_load(vcpu, cpu);
319 * will all be reloaded on the next vcpu run (instead of being
320 * demand-faulted). */
321 for (i = 0; i <= tlb_44x_hwater; i++)
322 kvmppc_tlbe_set_modified(vcpu, i);
323} 224}
324 225
325void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) 226void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu)
326{ 227{
327 if (vcpu->guest_debug.enabled) 228 if (vcpu->guest_debug.enabled)
328 kvmppc_restore_host_debug_state(vcpu); 229 kvmppc_core_load_host_debugstate(vcpu);
329 230
330 /* Don't leave guest TLB entries resident when being de-scheduled. */ 231 /* Don't leave guest TLB entries resident when being de-scheduled. */
331 /* XXX It would be nice to differentiate between heavyweight exit and 232 /* XXX It would be nice to differentiate between heavyweight exit and
332 * sched_out here, since we could avoid the TLB flush for heavyweight 233 * sched_out here, since we could avoid the TLB flush for heavyweight
333 * exits. */ 234 * exits. */
334 _tlbil_all(); 235 _tlbil_all();
236 kvmppc_core_vcpu_put(vcpu);
335} 237}
336 238
337int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu, 239int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu,
@@ -355,14 +257,14 @@ int kvm_arch_vcpu_ioctl_debug_guest(struct kvm_vcpu *vcpu,
355static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu, 257static void kvmppc_complete_dcr_load(struct kvm_vcpu *vcpu,
356 struct kvm_run *run) 258 struct kvm_run *run)
357{ 259{
358 u32 *gpr = &vcpu->arch.gpr[vcpu->arch.io_gpr]; 260 ulong *gpr = &vcpu->arch.gpr[vcpu->arch.io_gpr];
359 *gpr = run->dcr.data; 261 *gpr = run->dcr.data;
360} 262}
361 263
362static void kvmppc_complete_mmio_load(struct kvm_vcpu *vcpu, 264static void kvmppc_complete_mmio_load(struct kvm_vcpu *vcpu,
363 struct kvm_run *run) 265 struct kvm_run *run)
364{ 266{
365 u32 *gpr = &vcpu->arch.gpr[vcpu->arch.io_gpr]; 267 ulong *gpr = &vcpu->arch.gpr[vcpu->arch.io_gpr];
366 268
367 if (run->mmio.len > sizeof(*gpr)) { 269 if (run->mmio.len > sizeof(*gpr)) {
368 printk(KERN_ERR "bad MMIO length: %d\n", run->mmio.len); 270 printk(KERN_ERR "bad MMIO length: %d\n", run->mmio.len);
@@ -460,7 +362,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
460 vcpu->arch.dcr_needed = 0; 362 vcpu->arch.dcr_needed = 0;
461 } 363 }
462 364
463 kvmppc_check_and_deliver_interrupts(vcpu); 365 kvmppc_core_deliver_interrupts(vcpu);
464 366
465 local_irq_disable(); 367 local_irq_disable();
466 kvm_guest_enter(); 368 kvm_guest_enter();
@@ -478,7 +380,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *run)
478 380
479int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_interrupt *irq) 381int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, struct kvm_interrupt *irq)
480{ 382{
481 kvmppc_queue_exception(vcpu, BOOKE_INTERRUPT_EXTERNAL); 383 kvmppc_core_queue_external(vcpu, irq);
482 384
483 if (waitqueue_active(&vcpu->wq)) { 385 if (waitqueue_active(&vcpu->wq)) {
484 wake_up_interruptible(&vcpu->wq); 386 wake_up_interruptible(&vcpu->wq);
diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c
new file mode 100644
index 000000000000..47ee603f558e
--- /dev/null
+++ b/arch/powerpc/kvm/timing.c
@@ -0,0 +1,239 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14 *
15 * Copyright IBM Corp. 2008
16 *
17 * Authors: Hollis Blanchard <hollisb@us.ibm.com>
18 * Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
19 */
20
21#include <linux/kvm_host.h>
22#include <linux/fs.h>
23#include <linux/seq_file.h>
24#include <linux/debugfs.h>
25#include <linux/uaccess.h>
26
27#include <asm/time.h>
28#include <asm-generic/div64.h>
29
30#include "timing.h"
31
32void kvmppc_init_timing_stats(struct kvm_vcpu *vcpu)
33{
34 int i;
35
36 /* pause guest execution to avoid concurrent updates */
37 local_irq_disable();
38 mutex_lock(&vcpu->mutex);
39
40 vcpu->arch.last_exit_type = 0xDEAD;
41 for (i = 0; i < __NUMBER_OF_KVM_EXIT_TYPES; i++) {
42 vcpu->arch.timing_count_type[i] = 0;
43 vcpu->arch.timing_max_duration[i] = 0;
44 vcpu->arch.timing_min_duration[i] = 0xFFFFFFFF;
45 vcpu->arch.timing_sum_duration[i] = 0;
46 vcpu->arch.timing_sum_quad_duration[i] = 0;
47 }
48 vcpu->arch.timing_last_exit = 0;
49 vcpu->arch.timing_exit.tv64 = 0;
50 vcpu->arch.timing_last_enter.tv64 = 0;
51
52 mutex_unlock(&vcpu->mutex);
53 local_irq_enable();
54}
55
56static void add_exit_timing(struct kvm_vcpu *vcpu, u64 duration, int type)
57{
58 u64 old;
59
60 do_div(duration, tb_ticks_per_usec);
61 if (unlikely(duration > 0xFFFFFFFF)) {
62 printk(KERN_ERR"%s - duration too big -> overflow"
63 " duration %lld type %d exit #%d\n",
64 __func__, duration, type,
65 vcpu->arch.timing_count_type[type]);
66 return;
67 }
68
69 vcpu->arch.timing_count_type[type]++;
70
71 /* sum */
72 old = vcpu->arch.timing_sum_duration[type];
73 vcpu->arch.timing_sum_duration[type] += duration;
74 if (unlikely(old > vcpu->arch.timing_sum_duration[type])) {
75 printk(KERN_ERR"%s - wrap adding sum of durations"
76 " old %lld new %lld type %d exit # of type %d\n",
77 __func__, old, vcpu->arch.timing_sum_duration[type],
78 type, vcpu->arch.timing_count_type[type]);
79 }
80
81 /* square sum */
82 old = vcpu->arch.timing_sum_quad_duration[type];
83 vcpu->arch.timing_sum_quad_duration[type] += (duration*duration);
84 if (unlikely(old > vcpu->arch.timing_sum_quad_duration[type])) {
85 printk(KERN_ERR"%s - wrap adding sum of squared durations"
86 " old %lld new %lld type %d exit # of type %d\n",
87 __func__, old,
88 vcpu->arch.timing_sum_quad_duration[type],
89 type, vcpu->arch.timing_count_type[type]);
90 }
91
92 /* set min/max */
93 if (unlikely(duration < vcpu->arch.timing_min_duration[type]))
94 vcpu->arch.timing_min_duration[type] = duration;
95 if (unlikely(duration > vcpu->arch.timing_max_duration[type]))
96 vcpu->arch.timing_max_duration[type] = duration;
97}
98
99void kvmppc_update_timing_stats(struct kvm_vcpu *vcpu)
100{
101 u64 exit = vcpu->arch.timing_last_exit;
102 u64 enter = vcpu->arch.timing_last_enter.tv64;
103
104 /* save exit time, used next exit when the reenter time is known */
105 vcpu->arch.timing_last_exit = vcpu->arch.timing_exit.tv64;
106
107 if (unlikely(vcpu->arch.last_exit_type == 0xDEAD || exit == 0))
108 return; /* skip incomplete cycle (e.g. after reset) */
109
110 /* update statistics for average and standard deviation */
111 add_exit_timing(vcpu, (enter - exit), vcpu->arch.last_exit_type);
112 /* enter -> timing_last_exit is time spent in guest - log this too */
113 add_exit_timing(vcpu, (vcpu->arch.timing_last_exit - enter),
114 TIMEINGUEST);
115}
116
117static const char *kvm_exit_names[__NUMBER_OF_KVM_EXIT_TYPES] = {
118 [MMIO_EXITS] = "MMIO",
119 [DCR_EXITS] = "DCR",
120 [SIGNAL_EXITS] = "SIGNAL",
121 [ITLB_REAL_MISS_EXITS] = "ITLBREAL",
122 [ITLB_VIRT_MISS_EXITS] = "ITLBVIRT",
123 [DTLB_REAL_MISS_EXITS] = "DTLBREAL",
124 [DTLB_VIRT_MISS_EXITS] = "DTLBVIRT",
125 [SYSCALL_EXITS] = "SYSCALL",
126 [ISI_EXITS] = "ISI",
127 [DSI_EXITS] = "DSI",
128 [EMULATED_INST_EXITS] = "EMULINST",
129 [EMULATED_MTMSRWE_EXITS] = "EMUL_WAIT",
130 [EMULATED_WRTEE_EXITS] = "EMUL_WRTEE",
131 [EMULATED_MTSPR_EXITS] = "EMUL_MTSPR",
132 [EMULATED_MFSPR_EXITS] = "EMUL_MFSPR",
133 [EMULATED_MTMSR_EXITS] = "EMUL_MTMSR",
134 [EMULATED_MFMSR_EXITS] = "EMUL_MFMSR",
135 [EMULATED_TLBSX_EXITS] = "EMUL_TLBSX",
136 [EMULATED_TLBWE_EXITS] = "EMUL_TLBWE",
137 [EMULATED_RFI_EXITS] = "EMUL_RFI",
138 [DEC_EXITS] = "DEC",
139 [EXT_INTR_EXITS] = "EXTINT",
140 [HALT_WAKEUP] = "HALT",
141 [USR_PR_INST] = "USR_PR_INST",
142 [FP_UNAVAIL] = "FP_UNAVAIL",
143 [DEBUG_EXITS] = "DEBUG",
144 [TIMEINGUEST] = "TIMEINGUEST"
145};
146
147static int kvmppc_exit_timing_show(struct seq_file *m, void *private)
148{
149 struct kvm_vcpu *vcpu = m->private;
150 int i;
151
152 seq_printf(m, "%s", "type count min max sum sum_squared\n");
153
154 for (i = 0; i < __NUMBER_OF_KVM_EXIT_TYPES; i++) {
155 seq_printf(m, "%12s %10d %10lld %10lld %20lld %20lld\n",
156 kvm_exit_names[i],
157 vcpu->arch.timing_count_type[i],
158 vcpu->arch.timing_min_duration[i],
159 vcpu->arch.timing_max_duration[i],
160 vcpu->arch.timing_sum_duration[i],
161 vcpu->arch.timing_sum_quad_duration[i]);
162 }
163 return 0;
164}
165
166/* Write 'c' to clear the timing statistics. */
167static ssize_t kvmppc_exit_timing_write(struct file *file,
168 const char __user *user_buf,
169 size_t count, loff_t *ppos)
170{
171 int err = -EINVAL;
172 char c;
173
174 if (count > 1) {
175 goto done;
176 }
177
178 if (get_user(c, user_buf)) {
179 err = -EFAULT;
180 goto done;
181 }
182
183 if (c == 'c') {
184 struct seq_file *seqf = (struct seq_file *)file->private_data;
185 struct kvm_vcpu *vcpu = seqf->private;
186 /* Write does not affect our buffers previously generated with
187 * show. seq_file is locked here to prevent races of init with
188 * a show call */
189 mutex_lock(&seqf->lock);
190 kvmppc_init_timing_stats(vcpu);
191 mutex_unlock(&seqf->lock);
192 err = count;
193 }
194
195done:
196 return err;
197}
198
199static int kvmppc_exit_timing_open(struct inode *inode, struct file *file)
200{
201 return single_open(file, kvmppc_exit_timing_show, inode->i_private);
202}
203
204static struct file_operations kvmppc_exit_timing_fops = {
205 .owner = THIS_MODULE,
206 .open = kvmppc_exit_timing_open,
207 .read = seq_read,
208 .write = kvmppc_exit_timing_write,
209 .llseek = seq_lseek,
210 .release = single_release,
211};
212
213void kvmppc_create_vcpu_debugfs(struct kvm_vcpu *vcpu, unsigned int id)
214{
215 static char dbg_fname[50];
216 struct dentry *debugfs_file;
217
218 snprintf(dbg_fname, sizeof(dbg_fname), "vm%u_vcpu%u_timing",
219 current->pid, id);
220 debugfs_file = debugfs_create_file(dbg_fname, 0666,
221 kvm_debugfs_dir, vcpu,
222 &kvmppc_exit_timing_fops);
223
224 if (!debugfs_file) {
225 printk(KERN_ERR"%s: error creating debugfs file %s\n",
226 __func__, dbg_fname);
227 return;
228 }
229
230 vcpu->arch.debugfs_exit_timing = debugfs_file;
231}
232
233void kvmppc_remove_vcpu_debugfs(struct kvm_vcpu *vcpu)
234{
235 if (vcpu->arch.debugfs_exit_timing) {
236 debugfs_remove(vcpu->arch.debugfs_exit_timing);
237 vcpu->arch.debugfs_exit_timing = NULL;
238 }
239}
diff --git a/arch/powerpc/kvm/timing.h b/arch/powerpc/kvm/timing.h
new file mode 100644
index 000000000000..bb13b1f3cd5a
--- /dev/null
+++ b/arch/powerpc/kvm/timing.h
@@ -0,0 +1,102 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * You should have received a copy of the GNU General Public License
12 * along with this program; if not, write to the Free Software
13 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14 *
15 * Copyright IBM Corp. 2008
16 *
17 * Authors: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
18 */
19
20#ifndef __POWERPC_KVM_EXITTIMING_H__
21#define __POWERPC_KVM_EXITTIMING_H__
22
23#include <linux/kvm_host.h>
24#include <asm/kvm_host.h>
25
26#ifdef CONFIG_KVM_EXIT_TIMING
27void kvmppc_init_timing_stats(struct kvm_vcpu *vcpu);
28void kvmppc_update_timing_stats(struct kvm_vcpu *vcpu);
29void kvmppc_create_vcpu_debugfs(struct kvm_vcpu *vcpu, unsigned int id);
30void kvmppc_remove_vcpu_debugfs(struct kvm_vcpu *vcpu);
31
32static inline void kvmppc_set_exit_type(struct kvm_vcpu *vcpu, int type)
33{
34 vcpu->arch.last_exit_type = type;
35}
36
37#else
38/* if exit timing is not configured there is no need to build the c file */
39static inline void kvmppc_init_timing_stats(struct kvm_vcpu *vcpu) {}
40static inline void kvmppc_update_timing_stats(struct kvm_vcpu *vcpu) {}
41static inline void kvmppc_create_vcpu_debugfs(struct kvm_vcpu *vcpu,
42 unsigned int id) {}
43static inline void kvmppc_remove_vcpu_debugfs(struct kvm_vcpu *vcpu) {}
44static inline void kvmppc_set_exit_type(struct kvm_vcpu *vcpu, int type) {}
45#endif /* CONFIG_KVM_EXIT_TIMING */
46
47/* account the exit in kvm_stats */
48static inline void kvmppc_account_exit_stat(struct kvm_vcpu *vcpu, int type)
49{
50 /* type has to be known at build time for optimization */
51 BUILD_BUG_ON(__builtin_constant_p(type));
52 switch (type) {
53 case EXT_INTR_EXITS:
54 vcpu->stat.ext_intr_exits++;
55 break;
56 case DEC_EXITS:
57 vcpu->stat.dec_exits++;
58 break;
59 case EMULATED_INST_EXITS:
60 vcpu->stat.emulated_inst_exits++;
61 break;
62 case DCR_EXITS:
63 vcpu->stat.dcr_exits++;
64 break;
65 case DSI_EXITS:
66 vcpu->stat.dsi_exits++;
67 break;
68 case ISI_EXITS:
69 vcpu->stat.isi_exits++;
70 break;
71 case SYSCALL_EXITS:
72 vcpu->stat.syscall_exits++;
73 break;
74 case DTLB_REAL_MISS_EXITS:
75 vcpu->stat.dtlb_real_miss_exits++;
76 break;
77 case DTLB_VIRT_MISS_EXITS:
78 vcpu->stat.dtlb_virt_miss_exits++;
79 break;
80 case MMIO_EXITS:
81 vcpu->stat.mmio_exits++;
82 break;
83 case ITLB_REAL_MISS_EXITS:
84 vcpu->stat.itlb_real_miss_exits++;
85 break;
86 case ITLB_VIRT_MISS_EXITS:
87 vcpu->stat.itlb_virt_miss_exits++;
88 break;
89 case SIGNAL_EXITS:
90 vcpu->stat.signal_exits++;
91 break;
92 }
93}
94
95/* wrapper to set exit time and account for it in kvm_stats */
96static inline void kvmppc_account_exit(struct kvm_vcpu *vcpu, int type)
97{
98 kvmppc_set_exit_type(vcpu, type);
99 kvmppc_account_exit_stat(vcpu, type);
100}
101
102#endif /* __POWERPC_KVM_EXITTIMING_H__ */
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 201c7a5486cb..9920d6a7cf29 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -512,6 +512,13 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
512 return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1, 0); 512 return slice_get_unmapped_area(addr, len, flags, mmu_psize, 1, 0);
513} 513}
514 514
515unsigned long vma_mmu_pagesize(struct vm_area_struct *vma)
516{
517 unsigned int psize = get_slice_psize(vma->vm_mm, vma->vm_start);
518
519 return 1UL << mmu_psize_to_shift(psize);
520}
521
515/* 522/*
516 * Called by asm hashtable.S for doing lazy icache flush 523 * Called by asm hashtable.S for doing lazy icache flush
517 */ 524 */
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 53b06ebb3f2f..f00f09a77f12 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -132,7 +132,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
132 /* this should work for most non-highmem platforms */ 132 /* this should work for most non-highmem platforms */
133 zone = pgdata->node_zones; 133 zone = pgdata->node_zones;
134 134
135 return __add_pages(zone, start_pfn, nr_pages); 135 return __add_pages(nid, zone, start_pfn, nr_pages);
136} 136}
137#endif /* CONFIG_MEMORY_HOTPLUG */ 137#endif /* CONFIG_MEMORY_HOTPLUG */
138 138
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h
index 4314b39b6faf..ad123bced404 100644
--- a/arch/powerpc/mm/mmu_decl.h
+++ b/arch/powerpc/mm/mmu_decl.h
@@ -30,11 +30,11 @@
30#if defined(CONFIG_40x) || defined(CONFIG_8xx) 30#if defined(CONFIG_40x) || defined(CONFIG_8xx)
31static inline void _tlbil_all(void) 31static inline void _tlbil_all(void)
32{ 32{
33 asm volatile ("sync; tlbia; isync" : : : "memory") 33 asm volatile ("sync; tlbia; isync" : : : "memory");
34} 34}
35static inline void _tlbil_pid(unsigned int pid) 35static inline void _tlbil_pid(unsigned int pid)
36{ 36{
37 asm volatile ("sync; tlbia; isync" : : : "memory") 37 asm volatile ("sync; tlbia; isync" : : : "memory");
38} 38}
39#else /* CONFIG_40x || CONFIG_8xx */ 39#else /* CONFIG_40x || CONFIG_8xx */
40extern void _tlbil_all(void); 40extern void _tlbil_all(void);
@@ -47,7 +47,7 @@ extern void _tlbil_pid(unsigned int pid);
47#ifdef CONFIG_8xx 47#ifdef CONFIG_8xx
48static inline void _tlbil_va(unsigned long address, unsigned int pid) 48static inline void _tlbil_va(unsigned long address, unsigned int pid)
49{ 49{
50 asm volatile ("tlbie %0; sync" : : "r" (address) : "memory") 50 asm volatile ("tlbie %0; sync" : : "r" (address) : "memory");
51} 51}
52#else /* CONFIG_8xx */ 52#else /* CONFIG_8xx */
53extern void _tlbil_va(unsigned long address, unsigned int pid); 53extern void _tlbil_va(unsigned long address, unsigned int pid);
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index cf81049e1e51..7393bd76d698 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -822,42 +822,50 @@ static void __init dump_numa_memory_topology(void)
822 * required. nid is the preferred node and end is the physical address of 822 * required. nid is the preferred node and end is the physical address of
823 * the highest address in the node. 823 * the highest address in the node.
824 * 824 *
825 * Returns the physical address of the memory. 825 * Returns the virtual address of the memory.
826 */ 826 */
827static void __init *careful_allocation(int nid, unsigned long size, 827static void __init *careful_zallocation(int nid, unsigned long size,
828 unsigned long align, 828 unsigned long align,
829 unsigned long end_pfn) 829 unsigned long end_pfn)
830{ 830{
831 void *ret;
831 int new_nid; 832 int new_nid;
832 unsigned long ret = __lmb_alloc_base(size, align, end_pfn << PAGE_SHIFT); 833 unsigned long ret_paddr;
834
835 ret_paddr = __lmb_alloc_base(size, align, end_pfn << PAGE_SHIFT);
833 836
834 /* retry over all memory */ 837 /* retry over all memory */
835 if (!ret) 838 if (!ret_paddr)
836 ret = __lmb_alloc_base(size, align, lmb_end_of_DRAM()); 839 ret_paddr = __lmb_alloc_base(size, align, lmb_end_of_DRAM());
837 840
838 if (!ret) 841 if (!ret_paddr)
839 panic("numa.c: cannot allocate %lu bytes on node %d", 842 panic("numa.c: cannot allocate %lu bytes for node %d",
840 size, nid); 843 size, nid);
841 844
845 ret = __va(ret_paddr);
846
842 /* 847 /*
843 * If the memory came from a previously allocated node, we must 848 * We initialize the nodes in numeric order: 0, 1, 2...
844 * retry with the bootmem allocator. 849 * and hand over control from the LMB allocator to the
850 * bootmem allocator. If this function is called for
851 * node 5, then we know that all nodes <5 are using the
852 * bootmem allocator instead of the LMB allocator.
853 *
854 * So, check the nid from which this allocation came
855 * and double check to see if we need to use bootmem
856 * instead of the LMB. We don't free the LMB memory
857 * since it would be useless.
845 */ 858 */
846 new_nid = early_pfn_to_nid(ret >> PAGE_SHIFT); 859 new_nid = early_pfn_to_nid(ret_paddr >> PAGE_SHIFT);
847 if (new_nid < nid) { 860 if (new_nid < nid) {
848 ret = (unsigned long)__alloc_bootmem_node(NODE_DATA(new_nid), 861 ret = __alloc_bootmem_node(NODE_DATA(new_nid),
849 size, align, 0); 862 size, align, 0);
850 863
851 if (!ret) 864 dbg("alloc_bootmem %p %lx\n", ret, size);
852 panic("numa.c: cannot allocate %lu bytes on node %d",
853 size, new_nid);
854
855 ret = __pa(ret);
856
857 dbg("alloc_bootmem %lx %lx\n", ret, size);
858 } 865 }
859 866
860 return (void *)ret; 867 memset(ret, 0, size);
868 return ret;
861} 869}
862 870
863static struct notifier_block __cpuinitdata ppc64_numa_nb = { 871static struct notifier_block __cpuinitdata ppc64_numa_nb = {
@@ -952,7 +960,7 @@ void __init do_init_bootmem(void)
952 960
953 for_each_online_node(nid) { 961 for_each_online_node(nid) {
954 unsigned long start_pfn, end_pfn; 962 unsigned long start_pfn, end_pfn;
955 unsigned long bootmem_paddr; 963 void *bootmem_vaddr;
956 unsigned long bootmap_pages; 964 unsigned long bootmap_pages;
957 965
958 get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); 966 get_pfn_range_for_nid(nid, &start_pfn, &end_pfn);
@@ -964,11 +972,9 @@ void __init do_init_bootmem(void)
964 * previous nodes' bootmem to be initialized and have 972 * previous nodes' bootmem to be initialized and have
965 * all reserved areas marked. 973 * all reserved areas marked.
966 */ 974 */
967 NODE_DATA(nid) = careful_allocation(nid, 975 NODE_DATA(nid) = careful_zallocation(nid,
968 sizeof(struct pglist_data), 976 sizeof(struct pglist_data),
969 SMP_CACHE_BYTES, end_pfn); 977 SMP_CACHE_BYTES, end_pfn);
970 NODE_DATA(nid) = __va(NODE_DATA(nid));
971 memset(NODE_DATA(nid), 0, sizeof(struct pglist_data));
972 978
973 dbg("node %d\n", nid); 979 dbg("node %d\n", nid);
974 dbg("NODE_DATA() = %p\n", NODE_DATA(nid)); 980 dbg("NODE_DATA() = %p\n", NODE_DATA(nid));
@@ -984,20 +990,20 @@ void __init do_init_bootmem(void)
984 dbg("end_paddr = %lx\n", end_pfn << PAGE_SHIFT); 990 dbg("end_paddr = %lx\n", end_pfn << PAGE_SHIFT);
985 991
986 bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn); 992 bootmap_pages = bootmem_bootmap_pages(end_pfn - start_pfn);
987 bootmem_paddr = (unsigned long)careful_allocation(nid, 993 bootmem_vaddr = careful_zallocation(nid,
988 bootmap_pages << PAGE_SHIFT, 994 bootmap_pages << PAGE_SHIFT,
989 PAGE_SIZE, end_pfn); 995 PAGE_SIZE, end_pfn);
990 memset(__va(bootmem_paddr), 0, bootmap_pages << PAGE_SHIFT);
991 996
992 dbg("bootmap_paddr = %lx\n", bootmem_paddr); 997 dbg("bootmap_vaddr = %p\n", bootmem_vaddr);
993 998
994 init_bootmem_node(NODE_DATA(nid), bootmem_paddr >> PAGE_SHIFT, 999 init_bootmem_node(NODE_DATA(nid),
1000 __pa(bootmem_vaddr) >> PAGE_SHIFT,
995 start_pfn, end_pfn); 1001 start_pfn, end_pfn);
996 1002
997 free_bootmem_with_active_regions(nid, end_pfn); 1003 free_bootmem_with_active_regions(nid, end_pfn);
998 /* 1004 /*
999 * Be very careful about moving this around. Future 1005 * Be very careful about moving this around. Future
1000 * calls to careful_allocation() depend on this getting 1006 * calls to careful_zallocation() depend on this getting
1001 * done correctly. 1007 * done correctly.
1002 */ 1008 */
1003 mark_reserved_regions_for_nid(nid); 1009 mark_reserved_regions_for_nid(nid);
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
index 38ff35f2142a..22972cd83cc9 100644
--- a/arch/powerpc/mm/pgtable_32.c
+++ b/arch/powerpc/mm/pgtable_32.c
@@ -266,7 +266,8 @@ int map_page(unsigned long va, phys_addr_t pa, int flags)
266 /* The PTE should never be already set nor present in the 266 /* The PTE should never be already set nor present in the
267 * hash table 267 * hash table
268 */ 268 */
269 BUG_ON(pte_val(*pg) & (_PAGE_PRESENT | _PAGE_HASHPTE)); 269 BUG_ON((pte_val(*pg) & (_PAGE_PRESENT | _PAGE_HASHPTE)) &&
270 flags);
270 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT, 271 set_pte_at(&init_mm, va, pg, pfn_pte(pa >> PAGE_SHIFT,
271 __pgprot(flags))); 272 __pgprot(flags)));
272 } 273 }
diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index 803a64c02b06..39ac22b13c73 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -189,8 +189,9 @@ void flush_tlb_kernel_range(unsigned long start, unsigned long end)
189 smp_call_function(do_flush_tlb_mm_ipi, NULL, 1); 189 smp_call_function(do_flush_tlb_mm_ipi, NULL, 1);
190 _tlbil_pid(0); 190 _tlbil_pid(0);
191 preempt_enable(); 191 preempt_enable();
192#endif 192#else
193 _tlbil_pid(0); 193 _tlbil_pid(0);
194#endif
194} 195}
195EXPORT_SYMBOL(flush_tlb_kernel_range); 196EXPORT_SYMBOL(flush_tlb_kernel_range);
196 197
diff --git a/arch/powerpc/oprofile/cell/pr_util.h b/arch/powerpc/oprofile/cell/pr_util.h
index 628009c01958..964b93974d89 100644
--- a/arch/powerpc/oprofile/cell/pr_util.h
+++ b/arch/powerpc/oprofile/cell/pr_util.h
@@ -30,6 +30,10 @@
30extern struct delayed_work spu_work; 30extern struct delayed_work spu_work;
31extern int spu_prof_running; 31extern int spu_prof_running;
32 32
33#define TRACE_ARRAY_SIZE 1024
34
35extern spinlock_t oprof_spu_smpl_arry_lck;
36
33struct spu_overlay_info { /* map of sections within an SPU overlay */ 37struct spu_overlay_info { /* map of sections within an SPU overlay */
34 unsigned int vma; /* SPU virtual memory address from elf */ 38 unsigned int vma; /* SPU virtual memory address from elf */
35 unsigned int size; /* size of section from elf */ 39 unsigned int size; /* size of section from elf */
@@ -79,7 +83,7 @@ struct spu_buffer {
79 * the vma-to-fileoffset map. 83 * the vma-to-fileoffset map.
80 */ 84 */
81struct vma_to_fileoffset_map *create_vma_map(const struct spu *spu, 85struct vma_to_fileoffset_map *create_vma_map(const struct spu *spu,
82 u64 objectid); 86 unsigned long objectid);
83unsigned int vma_map_lookup(struct vma_to_fileoffset_map *map, 87unsigned int vma_map_lookup(struct vma_to_fileoffset_map *map,
84 unsigned int vma, const struct spu *aSpu, 88 unsigned int vma, const struct spu *aSpu,
85 int *grd_val); 89 int *grd_val);
@@ -89,10 +93,11 @@ void vma_map_free(struct vma_to_fileoffset_map *map);
89 * Entry point for SPU profiling. 93 * Entry point for SPU profiling.
90 * cycles_reset is the SPU_CYCLES count value specified by the user. 94 * cycles_reset is the SPU_CYCLES count value specified by the user.
91 */ 95 */
92int start_spu_profiling(unsigned int cycles_reset); 96int start_spu_profiling_cycles(unsigned int cycles_reset);
93 97void start_spu_profiling_events(void);
94void stop_spu_profiling(void);
95 98
99void stop_spu_profiling_cycles(void);
100void stop_spu_profiling_events(void);
96 101
97/* add the necessary profiling hooks */ 102/* add the necessary profiling hooks */
98int spu_sync_start(void); 103int spu_sync_start(void);
diff --git a/arch/powerpc/oprofile/cell/spu_profiler.c b/arch/powerpc/oprofile/cell/spu_profiler.c
index dd499c3e9da7..9305ddaac512 100644
--- a/arch/powerpc/oprofile/cell/spu_profiler.c
+++ b/arch/powerpc/oprofile/cell/spu_profiler.c
@@ -18,11 +18,21 @@
18#include <asm/cell-pmu.h> 18#include <asm/cell-pmu.h>
19#include "pr_util.h" 19#include "pr_util.h"
20 20
21#define TRACE_ARRAY_SIZE 1024
22#define SCALE_SHIFT 14 21#define SCALE_SHIFT 14
23 22
24static u32 *samples; 23static u32 *samples;
25 24
25/* spu_prof_running is a flag used to indicate if spu profiling is enabled
26 * or not. It is set by the routines start_spu_profiling_cycles() and
27 * start_spu_profiling_events(). The flag is cleared by the routines
28 * stop_spu_profiling_cycles() and stop_spu_profiling_events(). These
29 * routines are called via global_start() and global_stop() which are called in
30 * op_powerpc_start() and op_powerpc_stop(). These routines are called once
31 * per system as a result of the user starting/stopping oprofile. Hence, only
32 * one CPU per user at a time will be changing the value of spu_prof_running.
33 * In general, OProfile does not protect against multiple users trying to run
34 * OProfile at a time.
35 */
26int spu_prof_running; 36int spu_prof_running;
27static unsigned int profiling_interval; 37static unsigned int profiling_interval;
28 38
@@ -31,8 +41,8 @@ static unsigned int profiling_interval;
31 41
32#define SPU_PC_MASK 0xFFFF 42#define SPU_PC_MASK 0xFFFF
33 43
34static DEFINE_SPINLOCK(sample_array_lock); 44DEFINE_SPINLOCK(oprof_spu_smpl_arry_lck);
35unsigned long sample_array_lock_flags; 45unsigned long oprof_spu_smpl_arry_lck_flags;
36 46
37void set_spu_profiling_frequency(unsigned int freq_khz, unsigned int cycles_reset) 47void set_spu_profiling_frequency(unsigned int freq_khz, unsigned int cycles_reset)
38{ 48{
@@ -49,7 +59,7 @@ void set_spu_profiling_frequency(unsigned int freq_khz, unsigned int cycles_rese
49 * of precision. This is close enough for the purpose at hand. 59 * of precision. This is close enough for the purpose at hand.
50 * 60 *
51 * The value of the timeout should be small enough that the hw 61 * The value of the timeout should be small enough that the hw
52 * trace buffer will not get more then about 1/3 full for the 62 * trace buffer will not get more than about 1/3 full for the
53 * maximum user specified (the LFSR value) hw sampling frequency. 63 * maximum user specified (the LFSR value) hw sampling frequency.
54 * This is to ensure the trace buffer will never fill even if the 64 * This is to ensure the trace buffer will never fill even if the
55 * kernel thread scheduling varies under a heavy system load. 65 * kernel thread scheduling varies under a heavy system load.
@@ -145,13 +155,13 @@ static enum hrtimer_restart profile_spus(struct hrtimer *timer)
145 * sample array must be loaded and then processed for a given 155 * sample array must be loaded and then processed for a given
146 * cpu. The sample array is not per cpu. 156 * cpu. The sample array is not per cpu.
147 */ 157 */
148 spin_lock_irqsave(&sample_array_lock, 158 spin_lock_irqsave(&oprof_spu_smpl_arry_lck,
149 sample_array_lock_flags); 159 oprof_spu_smpl_arry_lck_flags);
150 num_samples = cell_spu_pc_collection(cpu); 160 num_samples = cell_spu_pc_collection(cpu);
151 161
152 if (num_samples == 0) { 162 if (num_samples == 0) {
153 spin_unlock_irqrestore(&sample_array_lock, 163 spin_unlock_irqrestore(&oprof_spu_smpl_arry_lck,
154 sample_array_lock_flags); 164 oprof_spu_smpl_arry_lck_flags);
155 continue; 165 continue;
156 } 166 }
157 167
@@ -162,8 +172,8 @@ static enum hrtimer_restart profile_spus(struct hrtimer *timer)
162 num_samples); 172 num_samples);
163 } 173 }
164 174
165 spin_unlock_irqrestore(&sample_array_lock, 175 spin_unlock_irqrestore(&oprof_spu_smpl_arry_lck,
166 sample_array_lock_flags); 176 oprof_spu_smpl_arry_lck_flags);
167 177
168 } 178 }
169 smp_wmb(); /* insure spu event buffer updates are written */ 179 smp_wmb(); /* insure spu event buffer updates are written */
@@ -182,13 +192,13 @@ static enum hrtimer_restart profile_spus(struct hrtimer *timer)
182 192
183static struct hrtimer timer; 193static struct hrtimer timer;
184/* 194/*
185 * Entry point for SPU profiling. 195 * Entry point for SPU cycle profiling.
186 * NOTE: SPU profiling is done system-wide, not per-CPU. 196 * NOTE: SPU profiling is done system-wide, not per-CPU.
187 * 197 *
188 * cycles_reset is the count value specified by the user when 198 * cycles_reset is the count value specified by the user when
189 * setting up OProfile to count SPU_CYCLES. 199 * setting up OProfile to count SPU_CYCLES.
190 */ 200 */
191int start_spu_profiling(unsigned int cycles_reset) 201int start_spu_profiling_cycles(unsigned int cycles_reset)
192{ 202{
193 ktime_t kt; 203 ktime_t kt;
194 204
@@ -212,10 +222,30 @@ int start_spu_profiling(unsigned int cycles_reset)
212 return 0; 222 return 0;
213} 223}
214 224
215void stop_spu_profiling(void) 225/*
226 * Entry point for SPU event profiling.
227 * NOTE: SPU profiling is done system-wide, not per-CPU.
228 *
229 * cycles_reset is the count value specified by the user when
230 * setting up OProfile to count SPU_CYCLES.
231 */
232void start_spu_profiling_events(void)
233{
234 spu_prof_running = 1;
235 schedule_delayed_work(&spu_work, DEFAULT_TIMER_EXPIRE);
236
237 return;
238}
239
240void stop_spu_profiling_cycles(void)
216{ 241{
217 spu_prof_running = 0; 242 spu_prof_running = 0;
218 hrtimer_cancel(&timer); 243 hrtimer_cancel(&timer);
219 kfree(samples); 244 kfree(samples);
220 pr_debug("SPU_PROF: stop_spu_profiling issued\n"); 245 pr_debug("SPU_PROF: stop_spu_profiling_cycles issued\n");
246}
247
248void stop_spu_profiling_events(void)
249{
250 spu_prof_running = 0;
221} 251}
diff --git a/arch/powerpc/oprofile/common.c b/arch/powerpc/oprofile/common.c
index 17807acb05d9..21f16edf6c8d 100644
--- a/arch/powerpc/oprofile/common.c
+++ b/arch/powerpc/oprofile/common.c
@@ -132,6 +132,28 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
132 oprofilefs_create_ulong(sb, root, "mmcr0", &sys.mmcr0); 132 oprofilefs_create_ulong(sb, root, "mmcr0", &sys.mmcr0);
133 oprofilefs_create_ulong(sb, root, "mmcr1", &sys.mmcr1); 133 oprofilefs_create_ulong(sb, root, "mmcr1", &sys.mmcr1);
134 oprofilefs_create_ulong(sb, root, "mmcra", &sys.mmcra); 134 oprofilefs_create_ulong(sb, root, "mmcra", &sys.mmcra);
135#ifdef CONFIG_OPROFILE_CELL
136 /* create a file the user tool can check to see what level of profiling
137 * support exits with this kernel. Initialize bit mask to indicate
138 * what support the kernel has:
139 * bit 0 - Supports SPU event profiling in addition to PPU
140 * event and cycles; and SPU cycle profiling
141 * bits 1-31 - Currently unused.
142 *
143 * If the file does not exist, then the kernel only supports SPU
144 * cycle profiling, PPU event and cycle profiling.
145 */
146 oprofilefs_create_ulong(sb, root, "cell_support", &sys.cell_support);
147 sys.cell_support = 0x1; /* Note, the user OProfile tool must check
148 * that this bit is set before attempting to
149 * user SPU event profiling. Older kernels
150 * will not have this file, hence the user
151 * tool is not allowed to do SPU event
152 * profiling on older kernels. Older kernels
153 * will accept SPU events but collected data
154 * is garbage.
155 */
156#endif
135#endif 157#endif
136 158
137 for (i = 0; i < model->num_counters; ++i) { 159 for (i = 0; i < model->num_counters; ++i) {
diff --git a/arch/powerpc/oprofile/op_model_cell.c b/arch/powerpc/oprofile/op_model_cell.c
index 25a4ec2514a3..ae06c6236d9c 100644
--- a/arch/powerpc/oprofile/op_model_cell.c
+++ b/arch/powerpc/oprofile/op_model_cell.c
@@ -40,14 +40,15 @@
40#include "../platforms/cell/interrupt.h" 40#include "../platforms/cell/interrupt.h"
41#include "cell/pr_util.h" 41#include "cell/pr_util.h"
42 42
43static void cell_global_stop_spu(void); 43#define PPU_PROFILING 0
44#define SPU_PROFILING_CYCLES 1
45#define SPU_PROFILING_EVENTS 2
44 46
45/* 47#define SPU_EVENT_NUM_START 4100
46 * spu_cycle_reset is the number of cycles between samples. 48#define SPU_EVENT_NUM_STOP 4399
47 * This variable is used for SPU profiling and should ONLY be set 49#define SPU_PROFILE_EVENT_ADDR 4363 /* spu, address trace, decimal */
48 * at the beginning of cell_reg_setup; otherwise, it's read-only. 50#define SPU_PROFILE_EVENT_ADDR_MASK_A 0x146 /* sub unit set to zero */
49 */ 51#define SPU_PROFILE_EVENT_ADDR_MASK_B 0x186 /* sub unit set to zero */
50static unsigned int spu_cycle_reset;
51 52
52#define NUM_SPUS_PER_NODE 8 53#define NUM_SPUS_PER_NODE 8
53#define SPU_CYCLES_EVENT_NUM 2 /* event number for SPU_CYCLES */ 54#define SPU_CYCLES_EVENT_NUM 2 /* event number for SPU_CYCLES */
@@ -66,6 +67,21 @@ static unsigned int spu_cycle_reset;
66 67
67#define MAX_SPU_COUNT 0xFFFFFF /* maximum 24 bit LFSR value */ 68#define MAX_SPU_COUNT 0xFFFFFF /* maximum 24 bit LFSR value */
68 69
70/* Minumum HW interval timer setting to send value to trace buffer is 10 cycle.
71 * To configure counter to send value every N cycles set counter to
72 * 2^32 - 1 - N.
73 */
74#define NUM_INTERVAL_CYC 0xFFFFFFFF - 10
75
76/*
77 * spu_cycle_reset is the number of cycles between samples.
78 * This variable is used for SPU profiling and should ONLY be set
79 * at the beginning of cell_reg_setup; otherwise, it's read-only.
80 */
81static unsigned int spu_cycle_reset;
82static unsigned int profiling_mode;
83static int spu_evnt_phys_spu_indx;
84
69struct pmc_cntrl_data { 85struct pmc_cntrl_data {
70 unsigned long vcntr; 86 unsigned long vcntr;
71 unsigned long evnts; 87 unsigned long evnts;
@@ -105,6 +121,8 @@ struct pm_cntrl {
105 u16 trace_mode; 121 u16 trace_mode;
106 u16 freeze; 122 u16 freeze;
107 u16 count_mode; 123 u16 count_mode;
124 u16 spu_addr_trace;
125 u8 trace_buf_ovflw;
108}; 126};
109 127
110static struct { 128static struct {
@@ -122,7 +140,7 @@ static struct {
122#define GET_INPUT_CONTROL(x) ((x & 0x00000004) >> 2) 140#define GET_INPUT_CONTROL(x) ((x & 0x00000004) >> 2)
123 141
124static DEFINE_PER_CPU(unsigned long[NR_PHYS_CTRS], pmc_values); 142static DEFINE_PER_CPU(unsigned long[NR_PHYS_CTRS], pmc_values);
125 143static unsigned long spu_pm_cnt[MAX_NUMNODES * NUM_SPUS_PER_NODE];
126static struct pmc_cntrl_data pmc_cntrl[NUM_THREADS][NR_PHYS_CTRS]; 144static struct pmc_cntrl_data pmc_cntrl[NUM_THREADS][NR_PHYS_CTRS];
127 145
128/* 146/*
@@ -152,6 +170,7 @@ static u32 hdw_thread;
152 170
153static u32 virt_cntr_inter_mask; 171static u32 virt_cntr_inter_mask;
154static struct timer_list timer_virt_cntr; 172static struct timer_list timer_virt_cntr;
173static struct timer_list timer_spu_event_swap;
155 174
156/* 175/*
157 * pm_signal needs to be global since it is initialized in 176 * pm_signal needs to be global since it is initialized in
@@ -165,7 +184,7 @@ static int spu_rtas_token; /* token for SPU cycle profiling */
165static u32 reset_value[NR_PHYS_CTRS]; 184static u32 reset_value[NR_PHYS_CTRS];
166static int num_counters; 185static int num_counters;
167static int oprofile_running; 186static int oprofile_running;
168static DEFINE_SPINLOCK(virt_cntr_lock); 187static DEFINE_SPINLOCK(cntr_lock);
169 188
170static u32 ctr_enabled; 189static u32 ctr_enabled;
171 190
@@ -336,13 +355,13 @@ static void set_pm_event(u32 ctr, int event, u32 unit_mask)
336 for (i = 0; i < NUM_DEBUG_BUS_WORDS; i++) { 355 for (i = 0; i < NUM_DEBUG_BUS_WORDS; i++) {
337 if (bus_word & (1 << i)) { 356 if (bus_word & (1 << i)) {
338 pm_regs.debug_bus_control |= 357 pm_regs.debug_bus_control |=
339 (bus_type << (30 - (2 * i))); 358 (bus_type << (30 - (2 * i)));
340 359
341 for (j = 0; j < NUM_INPUT_BUS_WORDS; j++) { 360 for (j = 0; j < NUM_INPUT_BUS_WORDS; j++) {
342 if (input_bus[j] == 0xff) { 361 if (input_bus[j] == 0xff) {
343 input_bus[j] = i; 362 input_bus[j] = i;
344 pm_regs.group_control |= 363 pm_regs.group_control |=
345 (i << (30 - (2 * j))); 364 (i << (30 - (2 * j)));
346 365
347 break; 366 break;
348 } 367 }
@@ -367,12 +386,16 @@ static void write_pm_cntrl(int cpu)
367 if (pm_regs.pm_cntrl.stop_at_max == 1) 386 if (pm_regs.pm_cntrl.stop_at_max == 1)
368 val |= CBE_PM_STOP_AT_MAX; 387 val |= CBE_PM_STOP_AT_MAX;
369 388
370 if (pm_regs.pm_cntrl.trace_mode == 1) 389 if (pm_regs.pm_cntrl.trace_mode != 0)
371 val |= CBE_PM_TRACE_MODE_SET(pm_regs.pm_cntrl.trace_mode); 390 val |= CBE_PM_TRACE_MODE_SET(pm_regs.pm_cntrl.trace_mode);
372 391
392 if (pm_regs.pm_cntrl.trace_buf_ovflw == 1)
393 val |= CBE_PM_TRACE_BUF_OVFLW(pm_regs.pm_cntrl.trace_buf_ovflw);
373 if (pm_regs.pm_cntrl.freeze == 1) 394 if (pm_regs.pm_cntrl.freeze == 1)
374 val |= CBE_PM_FREEZE_ALL_CTRS; 395 val |= CBE_PM_FREEZE_ALL_CTRS;
375 396
397 val |= CBE_PM_SPU_ADDR_TRACE_SET(pm_regs.pm_cntrl.spu_addr_trace);
398
376 /* 399 /*
377 * Routine set_count_mode must be called previously to set 400 * Routine set_count_mode must be called previously to set
378 * the count mode based on the user selection of user and kernel. 401 * the count mode based on the user selection of user and kernel.
@@ -441,7 +464,7 @@ static void cell_virtual_cntr(unsigned long data)
441 * not both playing with the counters on the same node. 464 * not both playing with the counters on the same node.
442 */ 465 */
443 466
444 spin_lock_irqsave(&virt_cntr_lock, flags); 467 spin_lock_irqsave(&cntr_lock, flags);
445 468
446 prev_hdw_thread = hdw_thread; 469 prev_hdw_thread = hdw_thread;
447 470
@@ -480,7 +503,7 @@ static void cell_virtual_cntr(unsigned long data)
480 cbe_disable_pm_interrupts(cpu); 503 cbe_disable_pm_interrupts(cpu);
481 for (i = 0; i < num_counters; i++) { 504 for (i = 0; i < num_counters; i++) {
482 per_cpu(pmc_values, cpu + prev_hdw_thread)[i] 505 per_cpu(pmc_values, cpu + prev_hdw_thread)[i]
483 = cbe_read_ctr(cpu, i); 506 = cbe_read_ctr(cpu, i);
484 507
485 if (per_cpu(pmc_values, cpu + next_hdw_thread)[i] 508 if (per_cpu(pmc_values, cpu + next_hdw_thread)[i]
486 == 0xFFFFFFFF) 509 == 0xFFFFFFFF)
@@ -527,7 +550,7 @@ static void cell_virtual_cntr(unsigned long data)
527 cbe_enable_pm(cpu); 550 cbe_enable_pm(cpu);
528 } 551 }
529 552
530 spin_unlock_irqrestore(&virt_cntr_lock, flags); 553 spin_unlock_irqrestore(&cntr_lock, flags);
531 554
532 mod_timer(&timer_virt_cntr, jiffies + HZ / 10); 555 mod_timer(&timer_virt_cntr, jiffies + HZ / 10);
533} 556}
@@ -541,38 +564,146 @@ static void start_virt_cntrs(void)
541 add_timer(&timer_virt_cntr); 564 add_timer(&timer_virt_cntr);
542} 565}
543 566
544/* This function is called once for all cpus combined */ 567static int cell_reg_setup_spu_cycles(struct op_counter_config *ctr,
545static int cell_reg_setup(struct op_counter_config *ctr,
546 struct op_system_config *sys, int num_ctrs) 568 struct op_system_config *sys, int num_ctrs)
547{ 569{
548 int i, j, cpu; 570 spu_cycle_reset = ctr[0].count;
549 spu_cycle_reset = 0;
550 571
551 if (ctr[0].event == SPU_CYCLES_EVENT_NUM) { 572 /*
552 spu_cycle_reset = ctr[0].count; 573 * Each node will need to make the rtas call to start
574 * and stop SPU profiling. Get the token once and store it.
575 */
576 spu_rtas_token = rtas_token("ibm,cbe-spu-perftools");
577
578 if (unlikely(spu_rtas_token == RTAS_UNKNOWN_SERVICE)) {
579 printk(KERN_ERR
580 "%s: rtas token ibm,cbe-spu-perftools unknown\n",
581 __func__);
582 return -EIO;
583 }
584 return 0;
585}
586
587/* Unfortunately, the hardware will only support event profiling
588 * on one SPU per node at a time. Therefore, we must time slice
589 * the profiling across all SPUs in the node. Note, we do this
590 * in parallel for each node. The following routine is called
591 * periodically based on kernel timer to switch which SPU is
592 * being monitored in a round robbin fashion.
593 */
594static void spu_evnt_swap(unsigned long data)
595{
596 int node;
597 int cur_phys_spu, nxt_phys_spu, cur_spu_evnt_phys_spu_indx;
598 unsigned long flags;
599 int cpu;
600 int ret;
601 u32 interrupt_mask;
602
603
604 /* enable interrupts on cntr 0 */
605 interrupt_mask = CBE_PM_CTR_OVERFLOW_INTR(0);
606
607 hdw_thread = 0;
608
609 /* Make sure spu event interrupt handler and spu event swap
610 * don't access the counters simultaneously.
611 */
612 spin_lock_irqsave(&cntr_lock, flags);
613
614 cur_spu_evnt_phys_spu_indx = spu_evnt_phys_spu_indx;
615
616 if (++(spu_evnt_phys_spu_indx) == NUM_SPUS_PER_NODE)
617 spu_evnt_phys_spu_indx = 0;
618
619 pm_signal[0].sub_unit = spu_evnt_phys_spu_indx;
620 pm_signal[1].sub_unit = spu_evnt_phys_spu_indx;
621 pm_signal[2].sub_unit = spu_evnt_phys_spu_indx;
622
623 /* switch the SPU being profiled on each node */
624 for_each_online_cpu(cpu) {
625 if (cbe_get_hw_thread_id(cpu))
626 continue;
627
628 node = cbe_cpu_to_node(cpu);
629 cur_phys_spu = (node * NUM_SPUS_PER_NODE)
630 + cur_spu_evnt_phys_spu_indx;
631 nxt_phys_spu = (node * NUM_SPUS_PER_NODE)
632 + spu_evnt_phys_spu_indx;
553 633
554 /* 634 /*
555 * Each node will need to make the rtas call to start 635 * stop counters, save counter values, restore counts
556 * and stop SPU profiling. Get the token once and store it. 636 * for previous physical SPU
557 */ 637 */
558 spu_rtas_token = rtas_token("ibm,cbe-spu-perftools"); 638 cbe_disable_pm(cpu);
639 cbe_disable_pm_interrupts(cpu);
559 640
560 if (unlikely(spu_rtas_token == RTAS_UNKNOWN_SERVICE)) { 641 spu_pm_cnt[cur_phys_spu]
561 printk(KERN_ERR 642 = cbe_read_ctr(cpu, 0);
562 "%s: rtas token ibm,cbe-spu-perftools unknown\n", 643
563 __func__); 644 /* restore previous count for the next spu to sample */
564 return -EIO; 645 /* NOTE, hardware issue, counter will not start if the
565 } 646 * counter value is at max (0xFFFFFFFF).
647 */
648 if (spu_pm_cnt[nxt_phys_spu] >= 0xFFFFFFFF)
649 cbe_write_ctr(cpu, 0, 0xFFFFFFF0);
650 else
651 cbe_write_ctr(cpu, 0, spu_pm_cnt[nxt_phys_spu]);
652
653 pm_rtas_reset_signals(cbe_cpu_to_node(cpu));
654
655 /* setup the debug bus measure the one event and
656 * the two events to route the next SPU's PC on
657 * the debug bus
658 */
659 ret = pm_rtas_activate_signals(cbe_cpu_to_node(cpu), 3);
660 if (ret)
661 printk(KERN_ERR "%s: pm_rtas_activate_signals failed, "
662 "SPU event swap\n", __func__);
663
664 /* clear the trace buffer, don't want to take PC for
665 * previous SPU*/
666 cbe_write_pm(cpu, trace_address, 0);
667
668 enable_ctr(cpu, 0, pm_regs.pm07_cntrl);
669
670 /* Enable interrupts on the CPU thread that is starting */
671 cbe_enable_pm_interrupts(cpu, hdw_thread,
672 interrupt_mask);
673 cbe_enable_pm(cpu);
566 } 674 }
567 675
568 pm_rtas_token = rtas_token("ibm,cbe-perftools"); 676 spin_unlock_irqrestore(&cntr_lock, flags);
569 677
678 /* swap approximately every 0.1 seconds */
679 mod_timer(&timer_spu_event_swap, jiffies + HZ / 25);
680}
681
682static void start_spu_event_swap(void)
683{
684 init_timer(&timer_spu_event_swap);
685 timer_spu_event_swap.function = spu_evnt_swap;
686 timer_spu_event_swap.data = 0UL;
687 timer_spu_event_swap.expires = jiffies + HZ / 25;
688 add_timer(&timer_spu_event_swap);
689}
690
691static int cell_reg_setup_spu_events(struct op_counter_config *ctr,
692 struct op_system_config *sys, int num_ctrs)
693{
694 int i;
695
696 /* routine is called once for all nodes */
697
698 spu_evnt_phys_spu_indx = 0;
570 /* 699 /*
571 * For all events excetp PPU CYCLEs, each node will need to make 700 * For all events except PPU CYCLEs, each node will need to make
572 * the rtas cbe-perftools call to setup and reset the debug bus. 701 * the rtas cbe-perftools call to setup and reset the debug bus.
573 * Make the token lookup call once and store it in the global 702 * Make the token lookup call once and store it in the global
574 * variable pm_rtas_token. 703 * variable pm_rtas_token.
575 */ 704 */
705 pm_rtas_token = rtas_token("ibm,cbe-perftools");
706
576 if (unlikely(pm_rtas_token == RTAS_UNKNOWN_SERVICE)) { 707 if (unlikely(pm_rtas_token == RTAS_UNKNOWN_SERVICE)) {
577 printk(KERN_ERR 708 printk(KERN_ERR
578 "%s: rtas token ibm,cbe-perftools unknown\n", 709 "%s: rtas token ibm,cbe-perftools unknown\n",
@@ -580,6 +711,58 @@ static int cell_reg_setup(struct op_counter_config *ctr,
580 return -EIO; 711 return -EIO;
581 } 712 }
582 713
714 /* setup the pm_control register settings,
715 * settings will be written per node by the
716 * cell_cpu_setup() function.
717 */
718 pm_regs.pm_cntrl.trace_buf_ovflw = 1;
719
720 /* Use the occurrence trace mode to have SPU PC saved
721 * to the trace buffer. Occurrence data in trace buffer
722 * is not used. Bit 2 must be set to store SPU addresses.
723 */
724 pm_regs.pm_cntrl.trace_mode = 2;
725
726 pm_regs.pm_cntrl.spu_addr_trace = 0x1; /* using debug bus
727 event 2 & 3 */
728
729 /* setup the debug bus event array with the SPU PC routing events.
730 * Note, pm_signal[0] will be filled in by set_pm_event() call below.
731 */
732 pm_signal[1].signal_group = SPU_PROFILE_EVENT_ADDR / 100;
733 pm_signal[1].bus_word = GET_BUS_WORD(SPU_PROFILE_EVENT_ADDR_MASK_A);
734 pm_signal[1].bit = SPU_PROFILE_EVENT_ADDR % 100;
735 pm_signal[1].sub_unit = spu_evnt_phys_spu_indx;
736
737 pm_signal[2].signal_group = SPU_PROFILE_EVENT_ADDR / 100;
738 pm_signal[2].bus_word = GET_BUS_WORD(SPU_PROFILE_EVENT_ADDR_MASK_B);
739 pm_signal[2].bit = SPU_PROFILE_EVENT_ADDR % 100;
740 pm_signal[2].sub_unit = spu_evnt_phys_spu_indx;
741
742 /* Set the user selected spu event to profile on,
743 * note, only one SPU profiling event is supported
744 */
745 num_counters = 1; /* Only support one SPU event at a time */
746 set_pm_event(0, ctr[0].event, ctr[0].unit_mask);
747
748 reset_value[0] = 0xFFFFFFFF - ctr[0].count;
749
750 /* global, used by cell_cpu_setup */
751 ctr_enabled |= 1;
752
753 /* Initialize the count for each SPU to the reset value */
754 for (i=0; i < MAX_NUMNODES * NUM_SPUS_PER_NODE; i++)
755 spu_pm_cnt[i] = reset_value[0];
756
757 return 0;
758}
759
760static int cell_reg_setup_ppu(struct op_counter_config *ctr,
761 struct op_system_config *sys, int num_ctrs)
762{
763 /* routine is called once for all nodes */
764 int i, j, cpu;
765
583 num_counters = num_ctrs; 766 num_counters = num_ctrs;
584 767
585 if (unlikely(num_ctrs > NR_PHYS_CTRS)) { 768 if (unlikely(num_ctrs > NR_PHYS_CTRS)) {
@@ -589,14 +772,6 @@ static int cell_reg_setup(struct op_counter_config *ctr,
589 __func__); 772 __func__);
590 return -EIO; 773 return -EIO;
591 } 774 }
592 pm_regs.group_control = 0;
593 pm_regs.debug_bus_control = 0;
594
595 /* setup the pm_control register */
596 memset(&pm_regs.pm_cntrl, 0, sizeof(struct pm_cntrl));
597 pm_regs.pm_cntrl.stop_at_max = 1;
598 pm_regs.pm_cntrl.trace_mode = 0;
599 pm_regs.pm_cntrl.freeze = 1;
600 775
601 set_count_mode(sys->enable_kernel, sys->enable_user); 776 set_count_mode(sys->enable_kernel, sys->enable_user);
602 777
@@ -665,6 +840,63 @@ static int cell_reg_setup(struct op_counter_config *ctr,
665} 840}
666 841
667 842
843/* This function is called once for all cpus combined */
844static int cell_reg_setup(struct op_counter_config *ctr,
845 struct op_system_config *sys, int num_ctrs)
846{
847 int ret=0;
848 spu_cycle_reset = 0;
849
850 /* initialize the spu_arr_trace value, will be reset if
851 * doing spu event profiling.
852 */
853 pm_regs.group_control = 0;
854 pm_regs.debug_bus_control = 0;
855 pm_regs.pm_cntrl.stop_at_max = 1;
856 pm_regs.pm_cntrl.trace_mode = 0;
857 pm_regs.pm_cntrl.freeze = 1;
858 pm_regs.pm_cntrl.trace_buf_ovflw = 0;
859 pm_regs.pm_cntrl.spu_addr_trace = 0;
860
861 /*
862 * For all events except PPU CYCLEs, each node will need to make
863 * the rtas cbe-perftools call to setup and reset the debug bus.
864 * Make the token lookup call once and store it in the global
865 * variable pm_rtas_token.
866 */
867 pm_rtas_token = rtas_token("ibm,cbe-perftools");
868
869 if (unlikely(pm_rtas_token == RTAS_UNKNOWN_SERVICE)) {
870 printk(KERN_ERR
871 "%s: rtas token ibm,cbe-perftools unknown\n",
872 __func__);
873 return -EIO;
874 }
875
876 if (ctr[0].event == SPU_CYCLES_EVENT_NUM) {
877 profiling_mode = SPU_PROFILING_CYCLES;
878 ret = cell_reg_setup_spu_cycles(ctr, sys, num_ctrs);
879 } else if ((ctr[0].event >= SPU_EVENT_NUM_START) &&
880 (ctr[0].event <= SPU_EVENT_NUM_STOP)) {
881 profiling_mode = SPU_PROFILING_EVENTS;
882 spu_cycle_reset = ctr[0].count;
883
884 /* for SPU event profiling, need to setup the
885 * pm_signal array with the events to route the
886 * SPU PC before making the FW call. Note, only
887 * one SPU event for profiling can be specified
888 * at a time.
889 */
890 cell_reg_setup_spu_events(ctr, sys, num_ctrs);
891 } else {
892 profiling_mode = PPU_PROFILING;
893 ret = cell_reg_setup_ppu(ctr, sys, num_ctrs);
894 }
895
896 return ret;
897}
898
899
668 900
669/* This function is called once for each cpu */ 901/* This function is called once for each cpu */
670static int cell_cpu_setup(struct op_counter_config *cntr) 902static int cell_cpu_setup(struct op_counter_config *cntr)
@@ -672,8 +904,13 @@ static int cell_cpu_setup(struct op_counter_config *cntr)
672 u32 cpu = smp_processor_id(); 904 u32 cpu = smp_processor_id();
673 u32 num_enabled = 0; 905 u32 num_enabled = 0;
674 int i; 906 int i;
907 int ret;
675 908
676 if (spu_cycle_reset) 909 /* Cycle based SPU profiling does not use the performance
910 * counters. The trace array is configured to collect
911 * the data.
912 */
913 if (profiling_mode == SPU_PROFILING_CYCLES)
677 return 0; 914 return 0;
678 915
679 /* There is one performance monitor per processor chip (i.e. node), 916 /* There is one performance monitor per processor chip (i.e. node),
@@ -686,7 +923,6 @@ static int cell_cpu_setup(struct op_counter_config *cntr)
686 cbe_disable_pm(cpu); 923 cbe_disable_pm(cpu);
687 cbe_disable_pm_interrupts(cpu); 924 cbe_disable_pm_interrupts(cpu);
688 925
689 cbe_write_pm(cpu, pm_interval, 0);
690 cbe_write_pm(cpu, pm_start_stop, 0); 926 cbe_write_pm(cpu, pm_start_stop, 0);
691 cbe_write_pm(cpu, group_control, pm_regs.group_control); 927 cbe_write_pm(cpu, group_control, pm_regs.group_control);
692 cbe_write_pm(cpu, debug_bus_control, pm_regs.debug_bus_control); 928 cbe_write_pm(cpu, debug_bus_control, pm_regs.debug_bus_control);
@@ -703,7 +939,20 @@ static int cell_cpu_setup(struct op_counter_config *cntr)
703 * The pm_rtas_activate_signals will return -EIO if the FW 939 * The pm_rtas_activate_signals will return -EIO if the FW
704 * call failed. 940 * call failed.
705 */ 941 */
706 return pm_rtas_activate_signals(cbe_cpu_to_node(cpu), num_enabled); 942 if (profiling_mode == SPU_PROFILING_EVENTS) {
943 /* For SPU event profiling also need to setup the
944 * pm interval timer
945 */
946 ret = pm_rtas_activate_signals(cbe_cpu_to_node(cpu),
947 num_enabled+2);
948 /* store PC from debug bus to Trace buffer as often
949 * as possible (every 10 cycles)
950 */
951 cbe_write_pm(cpu, pm_interval, NUM_INTERVAL_CYC);
952 return ret;
953 } else
954 return pm_rtas_activate_signals(cbe_cpu_to_node(cpu),
955 num_enabled);
707} 956}
708 957
709#define ENTRIES 303 958#define ENTRIES 303
@@ -885,7 +1134,122 @@ static struct notifier_block cpu_freq_notifier_block = {
885}; 1134};
886#endif 1135#endif
887 1136
888static int cell_global_start_spu(struct op_counter_config *ctr) 1137/*
1138 * Note the generic OProfile stop calls do not support returning
1139 * an error on stop. Hence, will not return an error if the FW
1140 * calls fail on stop. Failure to reset the debug bus is not an issue.
1141 * Failure to disable the SPU profiling is not an issue. The FW calls
1142 * to enable the performance counters and debug bus will work even if
1143 * the hardware was not cleanly reset.
1144 */
1145static void cell_global_stop_spu_cycles(void)
1146{
1147 int subfunc, rtn_value;
1148 unsigned int lfsr_value;
1149 int cpu;
1150
1151 oprofile_running = 0;
1152 smp_wmb();
1153
1154#ifdef CONFIG_CPU_FREQ
1155 cpufreq_unregister_notifier(&cpu_freq_notifier_block,
1156 CPUFREQ_TRANSITION_NOTIFIER);
1157#endif
1158
1159 for_each_online_cpu(cpu) {
1160 if (cbe_get_hw_thread_id(cpu))
1161 continue;
1162
1163 subfunc = 3; /*
1164 * 2 - activate SPU tracing,
1165 * 3 - deactivate
1166 */
1167 lfsr_value = 0x8f100000;
1168
1169 rtn_value = rtas_call(spu_rtas_token, 3, 1, NULL,
1170 subfunc, cbe_cpu_to_node(cpu),
1171 lfsr_value);
1172
1173 if (unlikely(rtn_value != 0)) {
1174 printk(KERN_ERR
1175 "%s: rtas call ibm,cbe-spu-perftools " \
1176 "failed, return = %d\n",
1177 __func__, rtn_value);
1178 }
1179
1180 /* Deactivate the signals */
1181 pm_rtas_reset_signals(cbe_cpu_to_node(cpu));
1182 }
1183
1184 stop_spu_profiling_cycles();
1185}
1186
1187static void cell_global_stop_spu_events(void)
1188{
1189 int cpu;
1190 oprofile_running = 0;
1191
1192 stop_spu_profiling_events();
1193 smp_wmb();
1194
1195 for_each_online_cpu(cpu) {
1196 if (cbe_get_hw_thread_id(cpu))
1197 continue;
1198
1199 cbe_sync_irq(cbe_cpu_to_node(cpu));
1200 /* Stop the counters */
1201 cbe_disable_pm(cpu);
1202 cbe_write_pm07_control(cpu, 0, 0);
1203
1204 /* Deactivate the signals */
1205 pm_rtas_reset_signals(cbe_cpu_to_node(cpu));
1206
1207 /* Deactivate interrupts */
1208 cbe_disable_pm_interrupts(cpu);
1209 }
1210 del_timer_sync(&timer_spu_event_swap);
1211}
1212
1213static void cell_global_stop_ppu(void)
1214{
1215 int cpu;
1216
1217 /*
1218 * This routine will be called once for the system.
1219 * There is one performance monitor per node, so we
1220 * only need to perform this function once per node.
1221 */
1222 del_timer_sync(&timer_virt_cntr);
1223 oprofile_running = 0;
1224 smp_wmb();
1225
1226 for_each_online_cpu(cpu) {
1227 if (cbe_get_hw_thread_id(cpu))
1228 continue;
1229
1230 cbe_sync_irq(cbe_cpu_to_node(cpu));
1231 /* Stop the counters */
1232 cbe_disable_pm(cpu);
1233
1234 /* Deactivate the signals */
1235 pm_rtas_reset_signals(cbe_cpu_to_node(cpu));
1236
1237 /* Deactivate interrupts */
1238 cbe_disable_pm_interrupts(cpu);
1239 }
1240}
1241
1242static void cell_global_stop(void)
1243{
1244 if (profiling_mode == PPU_PROFILING)
1245 cell_global_stop_ppu();
1246 else if (profiling_mode == SPU_PROFILING_EVENTS)
1247 cell_global_stop_spu_events();
1248 else
1249 cell_global_stop_spu_cycles();
1250}
1251
1252static int cell_global_start_spu_cycles(struct op_counter_config *ctr)
889{ 1253{
890 int subfunc; 1254 int subfunc;
891 unsigned int lfsr_value; 1255 unsigned int lfsr_value;
@@ -951,18 +1315,18 @@ static int cell_global_start_spu(struct op_counter_config *ctr)
951 1315
952 /* start profiling */ 1316 /* start profiling */
953 ret = rtas_call(spu_rtas_token, 3, 1, NULL, subfunc, 1317 ret = rtas_call(spu_rtas_token, 3, 1, NULL, subfunc,
954 cbe_cpu_to_node(cpu), lfsr_value); 1318 cbe_cpu_to_node(cpu), lfsr_value);
955 1319
956 if (unlikely(ret != 0)) { 1320 if (unlikely(ret != 0)) {
957 printk(KERN_ERR 1321 printk(KERN_ERR
958 "%s: rtas call ibm,cbe-spu-perftools failed, return = %d\n", 1322 "%s: rtas call ibm,cbe-spu-perftools failed, " \
959 __func__, ret); 1323 "return = %d\n", __func__, ret);
960 rtas_error = -EIO; 1324 rtas_error = -EIO;
961 goto out; 1325 goto out;
962 } 1326 }
963 } 1327 }
964 1328
965 rtas_error = start_spu_profiling(spu_cycle_reset); 1329 rtas_error = start_spu_profiling_cycles(spu_cycle_reset);
966 if (rtas_error) 1330 if (rtas_error)
967 goto out_stop; 1331 goto out_stop;
968 1332
@@ -970,11 +1334,74 @@ static int cell_global_start_spu(struct op_counter_config *ctr)
970 return 0; 1334 return 0;
971 1335
972out_stop: 1336out_stop:
973 cell_global_stop_spu(); /* clean up the PMU/debug bus */ 1337 cell_global_stop_spu_cycles(); /* clean up the PMU/debug bus */
974out: 1338out:
975 return rtas_error; 1339 return rtas_error;
976} 1340}
977 1341
1342static int cell_global_start_spu_events(struct op_counter_config *ctr)
1343{
1344 int cpu;
1345 u32 interrupt_mask = 0;
1346 int rtn = 0;
1347
1348 hdw_thread = 0;
1349
1350 /* spu event profiling, uses the performance counters to generate
1351 * an interrupt. The hardware is setup to store the SPU program
1352 * counter into the trace array. The occurrence mode is used to
1353 * enable storing data to the trace buffer. The bits are set
1354 * to send/store the SPU address in the trace buffer. The debug
1355 * bus must be setup to route the SPU program counter onto the
1356 * debug bus. The occurrence data in the trace buffer is not used.
1357 */
1358
1359 /* This routine gets called once for the system.
1360 * There is one performance monitor per node, so we
1361 * only need to perform this function once per node.
1362 */
1363
1364 for_each_online_cpu(cpu) {
1365 if (cbe_get_hw_thread_id(cpu))
1366 continue;
1367
1368 /*
1369 * Setup SPU event-based profiling.
1370 * Set perf_mon_control bit 0 to a zero before
1371 * enabling spu collection hardware.
1372 *
1373 * Only support one SPU event on one SPU per node.
1374 */
1375 if (ctr_enabled & 1) {
1376 cbe_write_ctr(cpu, 0, reset_value[0]);
1377 enable_ctr(cpu, 0, pm_regs.pm07_cntrl);
1378 interrupt_mask |=
1379 CBE_PM_CTR_OVERFLOW_INTR(0);
1380 } else {
1381 /* Disable counter */
1382 cbe_write_pm07_control(cpu, 0, 0);
1383 }
1384
1385 cbe_get_and_clear_pm_interrupts(cpu);
1386 cbe_enable_pm_interrupts(cpu, hdw_thread, interrupt_mask);
1387 cbe_enable_pm(cpu);
1388
1389 /* clear the trace buffer */
1390 cbe_write_pm(cpu, trace_address, 0);
1391 }
1392
1393 /* Start the timer to time slice collecting the event profile
1394 * on each of the SPUs. Note, can collect profile on one SPU
1395 * per node at a time.
1396 */
1397 start_spu_event_swap();
1398 start_spu_profiling_events();
1399 oprofile_running = 1;
1400 smp_wmb();
1401
1402 return rtn;
1403}
1404
978static int cell_global_start_ppu(struct op_counter_config *ctr) 1405static int cell_global_start_ppu(struct op_counter_config *ctr)
979{ 1406{
980 u32 cpu, i; 1407 u32 cpu, i;
@@ -994,8 +1421,7 @@ static int cell_global_start_ppu(struct op_counter_config *ctr)
994 if (ctr_enabled & (1 << i)) { 1421 if (ctr_enabled & (1 << i)) {
995 cbe_write_ctr(cpu, i, reset_value[i]); 1422 cbe_write_ctr(cpu, i, reset_value[i]);
996 enable_ctr(cpu, i, pm_regs.pm07_cntrl); 1423 enable_ctr(cpu, i, pm_regs.pm07_cntrl);
997 interrupt_mask |= 1424 interrupt_mask |= CBE_PM_CTR_OVERFLOW_INTR(i);
998 CBE_PM_CTR_OVERFLOW_INTR(i);
999 } else { 1425 } else {
1000 /* Disable counter */ 1426 /* Disable counter */
1001 cbe_write_pm07_control(cpu, i, 0); 1427 cbe_write_pm07_control(cpu, i, 0);
@@ -1024,99 +1450,162 @@ static int cell_global_start_ppu(struct op_counter_config *ctr)
1024 1450
1025static int cell_global_start(struct op_counter_config *ctr) 1451static int cell_global_start(struct op_counter_config *ctr)
1026{ 1452{
1027 if (spu_cycle_reset) 1453 if (profiling_mode == SPU_PROFILING_CYCLES)
1028 return cell_global_start_spu(ctr); 1454 return cell_global_start_spu_cycles(ctr);
1455 else if (profiling_mode == SPU_PROFILING_EVENTS)
1456 return cell_global_start_spu_events(ctr);
1029 else 1457 else
1030 return cell_global_start_ppu(ctr); 1458 return cell_global_start_ppu(ctr);
1031} 1459}
1032 1460
1033/* 1461
1034 * Note the generic OProfile stop calls do not support returning 1462/* The SPU interrupt handler
1035 * an error on stop. Hence, will not return an error if the FW 1463 *
1036 * calls fail on stop. Failure to reset the debug bus is not an issue. 1464 * SPU event profiling works as follows:
1037 * Failure to disable the SPU profiling is not an issue. The FW calls 1465 * The pm_signal[0] holds the one SPU event to be measured. It is routed on
1038 * to enable the performance counters and debug bus will work even if 1466 * the debug bus using word 0 or 1. The value of pm_signal[1] and
1039 * the hardware was not cleanly reset. 1467 * pm_signal[2] contain the necessary events to route the SPU program
1468 * counter for the selected SPU onto the debug bus using words 2 and 3.
1469 * The pm_interval register is setup to write the SPU PC value into the
1470 * trace buffer at the maximum rate possible. The trace buffer is configured
1471 * to store the PCs, wrapping when it is full. The performance counter is
1472 * intialized to the max hardware count minus the number of events, N, between
1473 * samples. Once the N events have occured, a HW counter overflow occurs
1474 * causing the generation of a HW counter interrupt which also stops the
1475 * writing of the SPU PC values to the trace buffer. Hence the last PC
1476 * written to the trace buffer is the SPU PC that we want. Unfortunately,
1477 * we have to read from the beginning of the trace buffer to get to the
1478 * last value written. We just hope the PPU has nothing better to do then
1479 * service this interrupt. The PC for the specific SPU being profiled is
1480 * extracted from the trace buffer processed and stored. The trace buffer
1481 * is cleared, interrupts are cleared, the counter is reset to max - N.
1482 * A kernel timer is used to periodically call the routine spu_evnt_swap()
1483 * to switch to the next physical SPU in the node to profile in round robbin
1484 * order. This way data is collected for all SPUs on the node. It does mean
1485 * that we need to use a relatively small value of N to ensure enough samples
1486 * on each SPU are collected each SPU is being profiled 1/8 of the time.
1487 * It may also be necessary to use a longer sample collection period.
1040 */ 1488 */
1041static void cell_global_stop_spu(void) 1489static void cell_handle_interrupt_spu(struct pt_regs *regs,
1490 struct op_counter_config *ctr)
1042{ 1491{
1043 int subfunc, rtn_value; 1492 u32 cpu, cpu_tmp;
1044 unsigned int lfsr_value; 1493 u64 trace_entry;
1045 int cpu; 1494 u32 interrupt_mask;
1495 u64 trace_buffer[2];
1496 u64 last_trace_buffer;
1497 u32 sample;
1498 u32 trace_addr;
1499 unsigned long sample_array_lock_flags;
1500 int spu_num;
1501 unsigned long flags;
1046 1502
1047 oprofile_running = 0; 1503 /* Make sure spu event interrupt handler and spu event swap
1504 * don't access the counters simultaneously.
1505 */
1506 cpu = smp_processor_id();
1507 spin_lock_irqsave(&cntr_lock, flags);
1048 1508
1049#ifdef CONFIG_CPU_FREQ 1509 cpu_tmp = cpu;
1050 cpufreq_unregister_notifier(&cpu_freq_notifier_block, 1510 cbe_disable_pm(cpu);
1051 CPUFREQ_TRANSITION_NOTIFIER);
1052#endif
1053 1511
1054 for_each_online_cpu(cpu) { 1512 interrupt_mask = cbe_get_and_clear_pm_interrupts(cpu);
1055 if (cbe_get_hw_thread_id(cpu))
1056 continue;
1057 1513
1058 subfunc = 3; /* 1514 sample = 0xABCDEF;
1059 * 2 - activate SPU tracing, 1515 trace_entry = 0xfedcba;
1060 * 3 - deactivate 1516 last_trace_buffer = 0xdeadbeaf;
1061 */
1062 lfsr_value = 0x8f100000;
1063 1517
1064 rtn_value = rtas_call(spu_rtas_token, 3, 1, NULL, 1518 if ((oprofile_running == 1) && (interrupt_mask != 0)) {
1065 subfunc, cbe_cpu_to_node(cpu), 1519 /* disable writes to trace buff */
1066 lfsr_value); 1520 cbe_write_pm(cpu, pm_interval, 0);
1067 1521
1068 if (unlikely(rtn_value != 0)) { 1522 /* only have one perf cntr being used, cntr 0 */
1069 printk(KERN_ERR 1523 if ((interrupt_mask & CBE_PM_CTR_OVERFLOW_INTR(0))
1070 "%s: rtas call ibm,cbe-spu-perftools failed, return = %d\n", 1524 && ctr[0].enabled)
1071 __func__, rtn_value); 1525 /* The SPU PC values will be read
1526 * from the trace buffer, reset counter
1527 */
1528
1529 cbe_write_ctr(cpu, 0, reset_value[0]);
1530
1531 trace_addr = cbe_read_pm(cpu, trace_address);
1532
1533 while (!(trace_addr & CBE_PM_TRACE_BUF_EMPTY)) {
1534 /* There is data in the trace buffer to process
1535 * Read the buffer until you get to the last
1536 * entry. This is the value we want.
1537 */
1538
1539 cbe_read_trace_buffer(cpu, trace_buffer);
1540 trace_addr = cbe_read_pm(cpu, trace_address);
1072 } 1541 }
1073 1542
1074 /* Deactivate the signals */ 1543 /* SPU Address 16 bit count format for 128 bit
1075 pm_rtas_reset_signals(cbe_cpu_to_node(cpu)); 1544 * HW trace buffer is used for the SPU PC storage
1076 } 1545 * HDR bits 0:15
1546 * SPU Addr 0 bits 16:31
1547 * SPU Addr 1 bits 32:47
1548 * unused bits 48:127
1549 *
1550 * HDR: bit4 = 1 SPU Address 0 valid
1551 * HDR: bit5 = 1 SPU Address 1 valid
1552 * - unfortunately, the valid bits don't seem to work
1553 *
1554 * Note trace_buffer[0] holds bits 0:63 of the HW
1555 * trace buffer, trace_buffer[1] holds bits 64:127
1556 */
1077 1557
1078 stop_spu_profiling(); 1558 trace_entry = trace_buffer[0]
1079} 1559 & 0x00000000FFFF0000;
1080 1560
1081static void cell_global_stop_ppu(void) 1561 /* only top 16 of the 18 bit SPU PC address
1082{ 1562 * is stored in trace buffer, hence shift right
1083 int cpu; 1563 * by 16 -2 bits */
1564 sample = trace_entry >> 14;
1565 last_trace_buffer = trace_buffer[0];
1084 1566
1085 /* 1567 spu_num = spu_evnt_phys_spu_indx
1086 * This routine will be called once for the system. 1568 + (cbe_cpu_to_node(cpu) * NUM_SPUS_PER_NODE);
1087 * There is one performance monitor per node, so we
1088 * only need to perform this function once per node.
1089 */
1090 del_timer_sync(&timer_virt_cntr);
1091 oprofile_running = 0;
1092 smp_wmb();
1093 1569
1094 for_each_online_cpu(cpu) { 1570 /* make sure only one process at a time is calling
1095 if (cbe_get_hw_thread_id(cpu)) 1571 * spu_sync_buffer()
1096 continue; 1572 */
1573 spin_lock_irqsave(&oprof_spu_smpl_arry_lck,
1574 sample_array_lock_flags);
1575 spu_sync_buffer(spu_num, &sample, 1);
1576 spin_unlock_irqrestore(&oprof_spu_smpl_arry_lck,
1577 sample_array_lock_flags);
1097 1578
1098 cbe_sync_irq(cbe_cpu_to_node(cpu)); 1579 smp_wmb(); /* insure spu event buffer updates are written
1099 /* Stop the counters */ 1580 * don't want events intermingled... */
1100 cbe_disable_pm(cpu);
1101 1581
1102 /* Deactivate the signals */ 1582 /* The counters were frozen by the interrupt.
1103 pm_rtas_reset_signals(cbe_cpu_to_node(cpu)); 1583 * Reenable the interrupt and restart the counters.
1584 */
1585 cbe_write_pm(cpu, pm_interval, NUM_INTERVAL_CYC);
1586 cbe_enable_pm_interrupts(cpu, hdw_thread,
1587 virt_cntr_inter_mask);
1104 1588
1105 /* Deactivate interrupts */ 1589 /* clear the trace buffer, re-enable writes to trace buff */
1106 cbe_disable_pm_interrupts(cpu); 1590 cbe_write_pm(cpu, trace_address, 0);
1107 } 1591 cbe_write_pm(cpu, pm_interval, NUM_INTERVAL_CYC);
1108}
1109 1592
1110static void cell_global_stop(void) 1593 /* The writes to the various performance counters only writes
1111{ 1594 * to a latch. The new values (interrupt setting bits, reset
1112 if (spu_cycle_reset) 1595 * counter value etc.) are not copied to the actual registers
1113 cell_global_stop_spu(); 1596 * until the performance monitor is enabled. In order to get
1114 else 1597 * this to work as desired, the permormance monitor needs to
1115 cell_global_stop_ppu(); 1598 * be disabled while writing to the latches. This is a
1599 * HW design issue.
1600 */
1601 write_pm_cntrl(cpu);
1602 cbe_enable_pm(cpu);
1603 }
1604 spin_unlock_irqrestore(&cntr_lock, flags);
1116} 1605}
1117 1606
1118static void cell_handle_interrupt(struct pt_regs *regs, 1607static void cell_handle_interrupt_ppu(struct pt_regs *regs,
1119 struct op_counter_config *ctr) 1608 struct op_counter_config *ctr)
1120{ 1609{
1121 u32 cpu; 1610 u32 cpu;
1122 u64 pc; 1611 u64 pc;
@@ -1132,7 +1621,7 @@ static void cell_handle_interrupt(struct pt_regs *regs,
1132 * routine are not running at the same time. See the 1621 * routine are not running at the same time. See the
1133 * cell_virtual_cntr() routine for additional comments. 1622 * cell_virtual_cntr() routine for additional comments.
1134 */ 1623 */
1135 spin_lock_irqsave(&virt_cntr_lock, flags); 1624 spin_lock_irqsave(&cntr_lock, flags);
1136 1625
1137 /* 1626 /*
1138 * Need to disable and reenable the performance counters 1627 * Need to disable and reenable the performance counters
@@ -1185,7 +1674,16 @@ static void cell_handle_interrupt(struct pt_regs *regs,
1185 */ 1674 */
1186 cbe_enable_pm(cpu); 1675 cbe_enable_pm(cpu);
1187 } 1676 }
1188 spin_unlock_irqrestore(&virt_cntr_lock, flags); 1677 spin_unlock_irqrestore(&cntr_lock, flags);
1678}
1679
1680static void cell_handle_interrupt(struct pt_regs *regs,
1681 struct op_counter_config *ctr)
1682{
1683 if (profiling_mode == PPU_PROFILING)
1684 cell_handle_interrupt_ppu(regs, ctr);
1685 else
1686 cell_handle_interrupt_spu(regs, ctr);
1189} 1687}
1190 1688
1191/* 1689/*
@@ -1195,7 +1693,8 @@ static void cell_handle_interrupt(struct pt_regs *regs,
1195 */ 1693 */
1196static int cell_sync_start(void) 1694static int cell_sync_start(void)
1197{ 1695{
1198 if (spu_cycle_reset) 1696 if ((profiling_mode == SPU_PROFILING_CYCLES) ||
1697 (profiling_mode == SPU_PROFILING_EVENTS))
1199 return spu_sync_start(); 1698 return spu_sync_start();
1200 else 1699 else
1201 return DO_GENERIC_SYNC; 1700 return DO_GENERIC_SYNC;
@@ -1203,7 +1702,8 @@ static int cell_sync_start(void)
1203 1702
1204static int cell_sync_stop(void) 1703static int cell_sync_stop(void)
1205{ 1704{
1206 if (spu_cycle_reset) 1705 if ((profiling_mode == SPU_PROFILING_CYCLES) ||
1706 (profiling_mode == SPU_PROFILING_EVENTS))
1207 return spu_sync_stop(); 1707 return spu_sync_stop();
1208 else 1708 else
1209 return 1; 1709 return 1;
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index ae7c34f37e1c..98367a0255f3 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -42,7 +42,7 @@ static struct of_device_id mpc52xx_bus_ids[] __initdata = {
42 * from interrupt context while node mapping (which calls ioremap()) 42 * from interrupt context while node mapping (which calls ioremap())
43 * cannot be used at such point. 43 * cannot be used at such point.
44 */ 44 */
45static spinlock_t mpc52xx_lock = SPIN_LOCK_UNLOCKED; 45static DEFINE_SPINLOCK(mpc52xx_lock);
46static struct mpc52xx_gpt __iomem *mpc52xx_wdt; 46static struct mpc52xx_gpt __iomem *mpc52xx_wdt;
47static struct mpc52xx_cdm __iomem *mpc52xx_cdm; 47static struct mpc52xx_cdm __iomem *mpc52xx_cdm;
48 48
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index a428f8d1ac80..5177bdd2c62a 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -42,7 +42,7 @@ static void __init mpc831x_rdb_setup_arch(void)
42 mpc831x_usb_cfg(); 42 mpc831x_usb_cfg();
43} 43}
44 44
45void __init mpc831x_rdb_init_IRQ(void) 45static void __init mpc831x_rdb_init_IRQ(void)
46{ 46{
47 struct device_node *np; 47 struct device_node *np;
48 48
diff --git a/arch/powerpc/platforms/83xx/mpc832x_mds.c b/arch/powerpc/platforms/83xx/mpc832x_mds.c
index ec43477caa63..ec0b401bc9cf 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_mds.c
@@ -49,8 +49,6 @@
49#define DBG(fmt...) 49#define DBG(fmt...)
50#endif 50#endif
51 51
52static u8 *bcsr_regs = NULL;
53
54/* ************************************************************************ 52/* ************************************************************************
55 * 53 *
56 * Setup the architecture 54 * Setup the architecture
@@ -59,13 +57,14 @@ static u8 *bcsr_regs = NULL;
59static void __init mpc832x_sys_setup_arch(void) 57static void __init mpc832x_sys_setup_arch(void)
60{ 58{
61 struct device_node *np; 59 struct device_node *np;
60 u8 __iomem *bcsr_regs = NULL;
62 61
63 if (ppc_md.progress) 62 if (ppc_md.progress)
64 ppc_md.progress("mpc832x_sys_setup_arch()", 0); 63 ppc_md.progress("mpc832x_sys_setup_arch()", 0);
65 64
66 /* Map BCSR area */ 65 /* Map BCSR area */
67 np = of_find_node_by_name(NULL, "bcsr"); 66 np = of_find_node_by_name(NULL, "bcsr");
68 if (np != 0) { 67 if (np) {
69 struct resource res; 68 struct resource res;
70 69
71 of_address_to_resource(np, 0, &res); 70 of_address_to_resource(np, 0, &res);
@@ -93,9 +92,9 @@ static void __init mpc832x_sys_setup_arch(void)
93 != NULL){ 92 != NULL){
94 /* Reset the Ethernet PHYs */ 93 /* Reset the Ethernet PHYs */
95#define BCSR8_FETH_RST 0x50 94#define BCSR8_FETH_RST 0x50
96 bcsr_regs[8] &= ~BCSR8_FETH_RST; 95 clrbits8(&bcsr_regs[8], BCSR8_FETH_RST);
97 udelay(1000); 96 udelay(1000);
98 bcsr_regs[8] |= BCSR8_FETH_RST; 97 setbits8(&bcsr_regs[8], BCSR8_FETH_RST);
99 iounmap(bcsr_regs); 98 iounmap(bcsr_regs);
100 of_node_put(np); 99 of_node_put(np);
101 } 100 }
diff --git a/arch/powerpc/platforms/83xx/mpc832x_rdb.c b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
index 0300268ce5b8..2a1295f19832 100644
--- a/arch/powerpc/platforms/83xx/mpc832x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc832x_rdb.c
@@ -38,6 +38,7 @@
38#define DBG(fmt...) 38#define DBG(fmt...)
39#endif 39#endif
40 40
41#ifdef CONFIG_QUICC_ENGINE
41static void mpc83xx_spi_activate_cs(u8 cs, u8 polarity) 42static void mpc83xx_spi_activate_cs(u8 cs, u8 polarity)
42{ 43{
43 pr_debug("%s %d %d\n", __func__, cs, polarity); 44 pr_debug("%s %d %d\n", __func__, cs, polarity);
@@ -77,8 +78,8 @@ static int __init mpc832x_spi_init(void)
77 mpc83xx_spi_activate_cs, 78 mpc83xx_spi_activate_cs,
78 mpc83xx_spi_deactivate_cs); 79 mpc83xx_spi_deactivate_cs);
79} 80}
80
81machine_device_initcall(mpc832x_rdb, mpc832x_spi_init); 81machine_device_initcall(mpc832x_rdb, mpc832x_spi_init);
82#endif /* CONFIG_QUICC_ENGINE */
82 83
83/* ************************************************************************ 84/* ************************************************************************
84 * 85 *
@@ -130,7 +131,7 @@ static int __init mpc832x_declare_of_platform_devices(void)
130} 131}
131machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices); 132machine_device_initcall(mpc832x_rdb, mpc832x_declare_of_platform_devices);
132 133
133void __init mpc832x_rdb_init_IRQ(void) 134static void __init mpc832x_rdb_init_IRQ(void)
134{ 135{
135 136
136 struct device_node *np; 137 struct device_node *np;
diff --git a/arch/powerpc/platforms/83xx/mpc836x_mds.c b/arch/powerpc/platforms/83xx/mpc836x_mds.c
index 9d46e5bdd101..09e9d6fb7411 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_mds.c
@@ -18,6 +18,7 @@
18 18
19#include <linux/stddef.h> 19#include <linux/stddef.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/compiler.h>
21#include <linux/init.h> 22#include <linux/init.h>
22#include <linux/errno.h> 23#include <linux/errno.h>
23#include <linux/reboot.h> 24#include <linux/reboot.h>
@@ -43,6 +44,7 @@
43#include <asm/udbg.h> 44#include <asm/udbg.h>
44#include <sysdev/fsl_soc.h> 45#include <sysdev/fsl_soc.h>
45#include <sysdev/fsl_pci.h> 46#include <sysdev/fsl_pci.h>
47#include <sysdev/simple_gpio.h>
46#include <asm/qe.h> 48#include <asm/qe.h>
47#include <asm/qe_ic.h> 49#include <asm/qe_ic.h>
48 50
@@ -55,8 +57,6 @@
55#define DBG(fmt...) 57#define DBG(fmt...)
56#endif 58#endif
57 59
58static u8 *bcsr_regs = NULL;
59
60/* ************************************************************************ 60/* ************************************************************************
61 * 61 *
62 * Setup the architecture 62 * Setup the architecture
@@ -65,13 +65,14 @@ static u8 *bcsr_regs = NULL;
65static void __init mpc836x_mds_setup_arch(void) 65static void __init mpc836x_mds_setup_arch(void)
66{ 66{
67 struct device_node *np; 67 struct device_node *np;
68 u8 __iomem *bcsr_regs = NULL;
68 69
69 if (ppc_md.progress) 70 if (ppc_md.progress)
70 ppc_md.progress("mpc836x_mds_setup_arch()", 0); 71 ppc_md.progress("mpc836x_mds_setup_arch()", 0);
71 72
72 /* Map BCSR area */ 73 /* Map BCSR area */
73 np = of_find_node_by_name(NULL, "bcsr"); 74 np = of_find_node_by_name(NULL, "bcsr");
74 if (np != 0) { 75 if (np) {
75 struct resource res; 76 struct resource res;
76 77
77 of_address_to_resource(np, 0, &res); 78 of_address_to_resource(np, 0, &res);
@@ -93,6 +94,16 @@ static void __init mpc836x_mds_setup_arch(void)
93 94
94 for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;) 95 for (np = NULL; (np = of_find_node_by_name(np, "ucc")) != NULL;)
95 par_io_of_config(np); 96 par_io_of_config(np);
97#ifdef CONFIG_QE_USB
98 /* Must fixup Par IO before QE GPIO chips are registered. */
99 par_io_config_pin(1, 2, 1, 0, 3, 0); /* USBOE */
100 par_io_config_pin(1, 3, 1, 0, 3, 0); /* USBTP */
101 par_io_config_pin(1, 8, 1, 0, 1, 0); /* USBTN */
102 par_io_config_pin(1, 10, 2, 0, 3, 0); /* USBRXD */
103 par_io_config_pin(1, 9, 2, 1, 3, 0); /* USBRP */
104 par_io_config_pin(1, 11, 2, 1, 3, 0); /* USBRN */
105 par_io_config_pin(2, 20, 2, 0, 1, 0); /* CLK21 */
106#endif /* CONFIG_QE_USB */
96 } 107 }
97 108
98 if ((np = of_find_compatible_node(NULL, "network", "ucc_geth")) 109 if ((np = of_find_compatible_node(NULL, "network", "ucc_geth"))
@@ -151,6 +162,70 @@ static int __init mpc836x_declare_of_platform_devices(void)
151} 162}
152machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices); 163machine_device_initcall(mpc836x_mds, mpc836x_declare_of_platform_devices);
153 164
165#ifdef CONFIG_QE_USB
166static int __init mpc836x_usb_cfg(void)
167{
168 u8 __iomem *bcsr;
169 struct device_node *np;
170 const char *mode;
171 int ret = 0;
172
173 np = of_find_compatible_node(NULL, NULL, "fsl,mpc8360mds-bcsr");
174 if (!np)
175 return -ENODEV;
176
177 bcsr = of_iomap(np, 0);
178 of_node_put(np);
179 if (!bcsr)
180 return -ENOMEM;
181
182 np = of_find_compatible_node(NULL, NULL, "fsl,mpc8323-qe-usb");
183 if (!np) {
184 ret = -ENODEV;
185 goto err;
186 }
187
188#define BCSR8_TSEC1M_MASK (0x3 << 6)
189#define BCSR8_TSEC1M_RGMII (0x0 << 6)
190#define BCSR8_TSEC2M_MASK (0x3 << 4)
191#define BCSR8_TSEC2M_RGMII (0x0 << 4)
192 /*
193 * Default is GMII (2), but we should set it to RGMII (0) if we use
194 * USB (Eth PHY is in RGMII mode anyway).
195 */
196 clrsetbits_8(&bcsr[8], BCSR8_TSEC1M_MASK | BCSR8_TSEC2M_MASK,
197 BCSR8_TSEC1M_RGMII | BCSR8_TSEC2M_RGMII);
198
199#define BCSR13_USBMASK 0x0f
200#define BCSR13_nUSBEN 0x08 /* 1 - Disable, 0 - Enable */
201#define BCSR13_USBSPEED 0x04 /* 1 - Full, 0 - Low */
202#define BCSR13_USBMODE 0x02 /* 1 - Host, 0 - Function */
203#define BCSR13_nUSBVCC 0x01 /* 1 - gets VBUS, 0 - supplies VBUS */
204
205 clrsetbits_8(&bcsr[13], BCSR13_USBMASK, BCSR13_USBSPEED);
206
207 mode = of_get_property(np, "mode", NULL);
208 if (mode && !strcmp(mode, "peripheral")) {
209 setbits8(&bcsr[13], BCSR13_nUSBVCC);
210 qe_usb_clock_set(QE_CLK21, 48000000);
211 } else {
212 setbits8(&bcsr[13], BCSR13_USBMODE);
213 /*
214 * The BCSR GPIOs are used to control power and
215 * speed of the USB transceiver. This is needed for
216 * the USB Host only.
217 */
218 simple_gpiochip_init("fsl,mpc8360mds-bcsr-gpio");
219 }
220
221 of_node_put(np);
222err:
223 iounmap(bcsr);
224 return ret;
225}
226machine_arch_initcall(mpc836x_mds, mpc836x_usb_cfg);
227#endif /* CONFIG_QE_USB */
228
154static void __init mpc836x_mds_init_IRQ(void) 229static void __init mpc836x_mds_init_IRQ(void)
155{ 230{
156 struct device_node *np; 231 struct device_node *np;
diff --git a/arch/powerpc/platforms/83xx/mpc836x_rdk.c b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
index a5273bb28e1b..b0090aac9642 100644
--- a/arch/powerpc/platforms/83xx/mpc836x_rdk.c
+++ b/arch/powerpc/platforms/83xx/mpc836x_rdk.c
@@ -51,8 +51,9 @@ static void __init mpc836x_rdk_setup_arch(void)
51 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci") 51 for_each_compatible_node(np, "pci", "fsl,mpc8349-pci")
52 mpc83xx_add_bridge(np); 52 mpc83xx_add_bridge(np);
53#endif 53#endif
54 54#ifdef CONFIG_QUICC_ENGINE
55 qe_reset(); 55 qe_reset();
56#endif
56} 57}
57 58
58static void __init mpc836x_rdk_init_IRQ(void) 59static void __init mpc836x_rdk_init_IRQ(void)
@@ -71,13 +72,14 @@ static void __init mpc836x_rdk_init_IRQ(void)
71 */ 72 */
72 ipic_set_default_priority(); 73 ipic_set_default_priority();
73 of_node_put(np); 74 of_node_put(np);
74 75#ifdef CONFIG_QUICC_ENGINE
75 np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic"); 76 np = of_find_compatible_node(NULL, NULL, "fsl,qe-ic");
76 if (!np) 77 if (!np)
77 return; 78 return;
78 79
79 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic); 80 qe_ic_init(np, 0, qe_ic_cascade_low_ipic, qe_ic_cascade_high_ipic);
80 of_node_put(np); 81 of_node_put(np);
82#endif
81} 83}
82 84
83/* 85/*
diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
index 8bb13c807142..530ef990ca7c 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
@@ -26,7 +26,6 @@
26#define BCSR12_USB_SER_MASK 0x8a 26#define BCSR12_USB_SER_MASK 0x8a
27#define BCSR12_USB_SER_PIN 0x80 27#define BCSR12_USB_SER_PIN 0x80
28#define BCSR12_USB_SER_DEVICE 0x02 28#define BCSR12_USB_SER_DEVICE 0x02
29extern int mpc837x_usb_cfg(void);
30 29
31static int mpc837xmds_usb_cfg(void) 30static int mpc837xmds_usb_cfg(void)
32{ 31{
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index da030afa2e2c..1d096545322b 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -21,8 +21,6 @@
21 21
22#include "mpc83xx.h" 22#include "mpc83xx.h"
23 23
24extern int mpc837x_usb_cfg(void);
25
26/* ************************************************************************ 24/* ************************************************************************
27 * 25 *
28 * Setup the architecture 26 * Setup the architecture
diff --git a/arch/powerpc/platforms/83xx/mpc83xx.h b/arch/powerpc/platforms/83xx/mpc83xx.h
index 2a7cbabb410a..83cfe51526ec 100644
--- a/arch/powerpc/platforms/83xx/mpc83xx.h
+++ b/arch/powerpc/platforms/83xx/mpc83xx.h
@@ -61,6 +61,7 @@
61 61
62extern void mpc83xx_restart(char *cmd); 62extern void mpc83xx_restart(char *cmd);
63extern long mpc83xx_time_init(void); 63extern long mpc83xx_time_init(void);
64extern int mpc837x_usb_cfg(void);
64extern int mpc834x_usb_cfg(void); 65extern int mpc834x_usb_cfg(void);
65extern int mpc831x_usb_cfg(void); 66extern int mpc831x_usb_cfg(void);
66 67
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index a8301c8ad537..7326d904202c 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -148,6 +148,9 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
148/* 148/*
149 * Setup the architecture 149 * Setup the architecture
150 */ 150 */
151#ifdef CONFIG_SMP
152extern void __init mpc85xx_smp_init(void);
153#endif
151static void __init mpc85xx_ds_setup_arch(void) 154static void __init mpc85xx_ds_setup_arch(void)
152{ 155{
153#ifdef CONFIG_PCI 156#ifdef CONFIG_PCI
@@ -173,6 +176,10 @@ static void __init mpc85xx_ds_setup_arch(void)
173 ppc_md.pci_exclude_device = mpc85xx_exclude_device; 176 ppc_md.pci_exclude_device = mpc85xx_exclude_device;
174#endif 177#endif
175 178
179#ifdef CONFIG_SMP
180 mpc85xx_smp_init();
181#endif
182
176 printk("MPC85xx DS board from Freescale Semiconductor\n"); 183 printk("MPC85xx DS board from Freescale Semiconductor\n");
177} 184}
178 185
diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp.c
index d652c713f496..79a0df17078b 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -58,6 +58,7 @@ smp_85xx_kick_cpu(int nr)
58 58
59 if (cpu_rel_addr == NULL) { 59 if (cpu_rel_addr == NULL) {
60 printk(KERN_ERR "No cpu-release-addr for cpu %d\n", nr); 60 printk(KERN_ERR "No cpu-release-addr for cpu %d\n", nr);
61 local_irq_restore(flags);
61 return; 62 return;
62 } 63 }
63 64
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 47e956c871fe..47fe2bea9865 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -312,4 +312,15 @@ config MPC8xxx_GPIO
312 Say Y here if you're going to use hardware that connects to the 312 Say Y here if you're going to use hardware that connects to the
313 MPC831x/834x/837x/8572/8610 GPIOs. 313 MPC831x/834x/837x/8572/8610 GPIOs.
314 314
315config SIMPLE_GPIO
316 bool "Support for simple, memory-mapped GPIO controllers"
317 depends on PPC
318 select GENERIC_GPIO
319 select ARCH_REQUIRE_GPIOLIB
320 help
321 Say Y here to support simple, memory-mapped GPIO controllers.
322 These are usually BCSRs used to control board's switches, LEDs,
323 chip-selects, Ethernet/USB PHY's power and various other small
324 on-board peripherals.
325
315endmenu 326endmenu
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 3d0c776f888d..e868b5c50723 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -231,7 +231,7 @@ config VIRT_CPU_ACCOUNTING
231 If in doubt, say Y here. 231 If in doubt, say Y here.
232 232
233config SMP 233config SMP
234 depends on PPC_STD_MMU 234 depends on PPC_STD_MMU || FSL_BOOKE
235 bool "Symmetric multi-processing support" 235 bool "Symmetric multi-processing support"
236 ---help--- 236 ---help---
237 This enables support for systems with more than one CPU. If you have 237 This enables support for systems with more than one CPU. If you have
diff --git a/arch/powerpc/platforms/cell/beat_htab.c b/arch/powerpc/platforms/cell/beat_htab.c
index 2e67bd840e01..35b1ec492715 100644
--- a/arch/powerpc/platforms/cell/beat_htab.c
+++ b/arch/powerpc/platforms/cell/beat_htab.c
@@ -44,8 +44,8 @@ static DEFINE_SPINLOCK(beat_htab_lock);
44 44
45static inline unsigned int beat_read_mask(unsigned hpte_group) 45static inline unsigned int beat_read_mask(unsigned hpte_group)
46{ 46{
47 unsigned long hpte_v[5];
48 unsigned long rmask = 0; 47 unsigned long rmask = 0;
48 u64 hpte_v[5];
49 49
50 beat_read_htab_entries(0, hpte_group + 0, hpte_v); 50 beat_read_htab_entries(0, hpte_group + 0, hpte_v);
51 if (!(hpte_v[0] & HPTE_V_BOLTED)) 51 if (!(hpte_v[0] & HPTE_V_BOLTED))
@@ -93,8 +93,7 @@ static long beat_lpar_hpte_insert(unsigned long hpte_group,
93 int psize, int ssize) 93 int psize, int ssize)
94{ 94{
95 unsigned long lpar_rc; 95 unsigned long lpar_rc;
96 unsigned long slot; 96 u64 hpte_v, hpte_r, slot;
97 unsigned long hpte_v, hpte_r;
98 97
99 /* same as iseries */ 98 /* same as iseries */
100 if (vflags & HPTE_V_SECONDARY) 99 if (vflags & HPTE_V_SECONDARY)
@@ -153,8 +152,9 @@ static long beat_lpar_hpte_remove(unsigned long hpte_group)
153 152
154static unsigned long beat_lpar_hpte_getword0(unsigned long slot) 153static unsigned long beat_lpar_hpte_getword0(unsigned long slot)
155{ 154{
156 unsigned long dword0, dword[5]; 155 unsigned long dword0;
157 unsigned long lpar_rc; 156 unsigned long lpar_rc;
157 u64 dword[5];
158 158
159 lpar_rc = beat_read_htab_entries(0, slot & ~3UL, dword); 159 lpar_rc = beat_read_htab_entries(0, slot & ~3UL, dword);
160 160
@@ -170,7 +170,7 @@ static void beat_lpar_hptab_clear(void)
170 unsigned long size_bytes = 1UL << ppc64_pft_size; 170 unsigned long size_bytes = 1UL << ppc64_pft_size;
171 unsigned long hpte_count = size_bytes >> 4; 171 unsigned long hpte_count = size_bytes >> 4;
172 int i; 172 int i;
173 unsigned long dummy0, dummy1; 173 u64 dummy0, dummy1;
174 174
175 /* TODO: Use bulk call */ 175 /* TODO: Use bulk call */
176 for (i = 0; i < hpte_count; i++) 176 for (i = 0; i < hpte_count; i++)
@@ -189,7 +189,8 @@ static long beat_lpar_hpte_updatepp(unsigned long slot,
189 int psize, int ssize, int local) 189 int psize, int ssize, int local)
190{ 190{
191 unsigned long lpar_rc; 191 unsigned long lpar_rc;
192 unsigned long dummy0, dummy1, want_v; 192 u64 dummy0, dummy1;
193 unsigned long want_v;
193 194
194 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M); 195 want_v = hpte_encode_v(va, psize, MMU_SEGSIZE_256M);
195 196
@@ -255,7 +256,8 @@ static void beat_lpar_hpte_updateboltedpp(unsigned long newpp,
255 unsigned long ea, 256 unsigned long ea,
256 int psize, int ssize) 257 int psize, int ssize)
257{ 258{
258 unsigned long lpar_rc, slot, vsid, va, dummy0, dummy1; 259 unsigned long lpar_rc, slot, vsid, va;
260 u64 dummy0, dummy1;
259 261
260 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M); 262 vsid = get_kernel_vsid(ea, MMU_SEGSIZE_256M);
261 va = (vsid << 28) | (ea & 0x0fffffff); 263 va = (vsid << 28) | (ea & 0x0fffffff);
@@ -276,7 +278,7 @@ static void beat_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
276{ 278{
277 unsigned long want_v; 279 unsigned long want_v;
278 unsigned long lpar_rc; 280 unsigned long lpar_rc;
279 unsigned long dummy1, dummy2; 281 u64 dummy1, dummy2;
280 unsigned long flags; 282 unsigned long flags;
281 283
282 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n", 284 DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
@@ -315,8 +317,7 @@ static long beat_lpar_hpte_insert_v3(unsigned long hpte_group,
315 int psize, int ssize) 317 int psize, int ssize)
316{ 318{
317 unsigned long lpar_rc; 319 unsigned long lpar_rc;
318 unsigned long slot; 320 u64 hpte_v, hpte_r, slot;
319 unsigned long hpte_v, hpte_r;
320 321
321 /* same as iseries */ 322 /* same as iseries */
322 if (vflags & HPTE_V_SECONDARY) 323 if (vflags & HPTE_V_SECONDARY)
diff --git a/arch/powerpc/platforms/cell/beat_udbg.c b/arch/powerpc/platforms/cell/beat_udbg.c
index 6b418f6b6175..350735bc8888 100644
--- a/arch/powerpc/platforms/cell/beat_udbg.c
+++ b/arch/powerpc/platforms/cell/beat_udbg.c
@@ -40,8 +40,8 @@ static void udbg_putc_beat(char c)
40} 40}
41 41
42/* Buffered chars getc */ 42/* Buffered chars getc */
43static long inbuflen; 43static u64 inbuflen;
44static long inbuf[2]; /* must be 2 longs */ 44static u64 inbuf[2]; /* must be 2 u64s */
45 45
46static int udbg_getc_poll_beat(void) 46static int udbg_getc_poll_beat(void)
47{ 47{
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq.c b/arch/powerpc/platforms/cell/cbe_cpufreq.c
index ec7c8f45a215..e6506cd0ff94 100644
--- a/arch/powerpc/platforms/cell/cbe_cpufreq.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq.c
@@ -118,7 +118,7 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy)
118 policy->cur = cbe_freqs[cur_pmode].frequency; 118 policy->cur = cbe_freqs[cur_pmode].frequency;
119 119
120#ifdef CONFIG_SMP 120#ifdef CONFIG_SMP
121 policy->cpus = per_cpu(cpu_sibling_map, policy->cpu); 121 cpumask_copy(policy->cpus, &per_cpu(cpu_sibling_map, policy->cpu));
122#endif 122#endif
123 123
124 cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu); 124 cpufreq_frequency_table_get_attr(cbe_freqs, policy->cpu);
diff --git a/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c b/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
index 70fa7aef5edd..20472e487b6f 100644
--- a/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
+++ b/arch/powerpc/platforms/cell/cbe_cpufreq_pervasive.c
@@ -54,7 +54,7 @@ int cbe_cpufreq_set_pmode(int cpu, unsigned int pmode)
54{ 54{
55 struct cbe_pmd_regs __iomem *pmd_regs; 55 struct cbe_pmd_regs __iomem *pmd_regs;
56 struct cbe_mic_tm_regs __iomem *mic_tm_regs; 56 struct cbe_mic_tm_regs __iomem *mic_tm_regs;
57 u64 flags; 57 unsigned long flags;
58 u64 value; 58 u64 value;
59#ifdef DEBUG 59#ifdef DEBUG
60 long time; 60 long time;
diff --git a/arch/powerpc/platforms/cell/cpufreq_spudemand.c b/arch/powerpc/platforms/cell/cpufreq_spudemand.c
index a3c6c01bd6db..968c1c0b4d5b 100644
--- a/arch/powerpc/platforms/cell/cpufreq_spudemand.c
+++ b/arch/powerpc/platforms/cell/cpufreq_spudemand.c
@@ -110,7 +110,7 @@ static int spu_gov_govern(struct cpufreq_policy *policy, unsigned int event)
110 } 110 }
111 111
112 /* initialize spu_gov_info for all affected cpus */ 112 /* initialize spu_gov_info for all affected cpus */
113 for_each_cpu_mask(i, policy->cpus) { 113 for_each_cpu(i, policy->cpus) {
114 affected_info = &per_cpu(spu_gov_info, i); 114 affected_info = &per_cpu(spu_gov_info, i);
115 affected_info->policy = policy; 115 affected_info->policy = policy;
116 } 116 }
@@ -127,7 +127,7 @@ static int spu_gov_govern(struct cpufreq_policy *policy, unsigned int event)
127 spu_gov_cancel_work(info); 127 spu_gov_cancel_work(info);
128 128
129 /* clean spu_gov_info for all affected cpus */ 129 /* clean spu_gov_info for all affected cpus */
130 for_each_cpu_mask (i, policy->cpus) { 130 for_each_cpu (i, policy->cpus) {
131 info = &per_cpu(spu_gov_info, i); 131 info = &per_cpu(spu_gov_info, i);
132 info->policy = NULL; 132 info->policy = NULL;
133 } 133 }
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 2d5bb22d6c09..28c04dab2633 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -148,7 +148,7 @@ static unsigned int iic_get_irq(void)
148 148
149 iic = &__get_cpu_var(iic); 149 iic = &__get_cpu_var(iic);
150 *(unsigned long *) &pending = 150 *(unsigned long *) &pending =
151 in_be64((unsigned long __iomem *) &iic->regs->pending_destr); 151 in_be64((u64 __iomem *) &iic->regs->pending_destr);
152 if (!(pending.flags & CBE_IIC_IRQ_VALID)) 152 if (!(pending.flags & CBE_IIC_IRQ_VALID))
153 return NO_IRQ; 153 return NO_IRQ;
154 virq = irq_linear_revmap(iic_host, iic_pending_to_hwnum(pending)); 154 virq = irq_linear_revmap(iic_host, iic_pending_to_hwnum(pending));
diff --git a/arch/powerpc/platforms/cell/io-workarounds.c b/arch/powerpc/platforms/cell/io-workarounds.c
index b5f84e8f0899..059cad6c3f69 100644
--- a/arch/powerpc/platforms/cell/io-workarounds.c
+++ b/arch/powerpc/platforms/cell/io-workarounds.c
@@ -130,14 +130,14 @@ static const struct ppc_pci_io __devinitconst iowa_pci_io = {
130 130
131}; 131};
132 132
133static void __iomem *iowa_ioremap(unsigned long addr, unsigned long size, 133static void __iomem *iowa_ioremap(phys_addr_t addr, unsigned long size,
134 unsigned long flags) 134 unsigned long flags)
135{ 135{
136 struct iowa_bus *bus; 136 struct iowa_bus *bus;
137 void __iomem *res = __ioremap(addr, size, flags); 137 void __iomem *res = __ioremap(addr, size, flags);
138 int busno; 138 int busno;
139 139
140 bus = iowa_pci_find(0, addr); 140 bus = iowa_pci_find(0, (unsigned long)addr);
141 if (bus != NULL) { 141 if (bus != NULL) {
142 busno = bus - iowa_busses; 142 busno = bus - iowa_busses;
143 PCI_SET_ADDR_TOKEN(res, busno + 1); 143 PCI_SET_ADDR_TOKEN(res, busno + 1);
diff --git a/arch/powerpc/platforms/cell/iommu.c b/arch/powerpc/platforms/cell/iommu.c
index 86db4dd170a0..88d94b59a7cb 100644
--- a/arch/powerpc/platforms/cell/iommu.c
+++ b/arch/powerpc/platforms/cell/iommu.c
@@ -150,8 +150,8 @@ static int cbe_nr_iommus;
150static void invalidate_tce_cache(struct cbe_iommu *iommu, unsigned long *pte, 150static void invalidate_tce_cache(struct cbe_iommu *iommu, unsigned long *pte,
151 long n_ptes) 151 long n_ptes)
152{ 152{
153 unsigned long __iomem *reg; 153 u64 __iomem *reg;
154 unsigned long val; 154 u64 val;
155 long n; 155 long n;
156 156
157 reg = iommu->xlate_regs + IOC_IOPT_CacheInvd; 157 reg = iommu->xlate_regs + IOC_IOPT_CacheInvd;
diff --git a/arch/powerpc/platforms/cell/spu_priv1_mmio.c b/arch/powerpc/platforms/cell/spu_priv1_mmio.c
index 906a0a2a9fe1..1410443731eb 100644
--- a/arch/powerpc/platforms/cell/spu_priv1_mmio.c
+++ b/arch/powerpc/platforms/cell/spu_priv1_mmio.c
@@ -80,10 +80,10 @@ static void cpu_affinity_set(struct spu *spu, int cpu)
80 u64 route; 80 u64 route;
81 81
82 if (nr_cpus_node(spu->node)) { 82 if (nr_cpus_node(spu->node)) {
83 cpumask_t spumask = node_to_cpumask(spu->node); 83 const struct cpumask *spumask = cpumask_of_node(spu->node),
84 cpumask_t cpumask = node_to_cpumask(cpu_to_node(cpu)); 84 *cpumask = cpumask_of_node(cpu_to_node(cpu));
85 85
86 if (!cpus_intersects(spumask, cpumask)) 86 if (!cpumask_intersects(spumask, cpumask))
87 return; 87 return;
88 } 88 }
89 89
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 6296bfd9cb0b..e309ef70a531 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -97,7 +97,6 @@ spufs_new_inode(struct super_block *sb, int mode)
97 inode->i_mode = mode; 97 inode->i_mode = mode;
98 inode->i_uid = current_fsuid(); 98 inode->i_uid = current_fsuid();
99 inode->i_gid = current_fsgid(); 99 inode->i_gid = current_fsgid();
100 inode->i_blocks = 0;
101 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; 100 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
102out: 101out:
103 return inode; 102 return inode;
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index 2ad914c47493..6a0ad196aeb3 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -166,9 +166,9 @@ void spu_update_sched_info(struct spu_context *ctx)
166static int __node_allowed(struct spu_context *ctx, int node) 166static int __node_allowed(struct spu_context *ctx, int node)
167{ 167{
168 if (nr_cpus_node(node)) { 168 if (nr_cpus_node(node)) {
169 cpumask_t mask = node_to_cpumask(node); 169 const struct cpumask *mask = cpumask_of_node(node);
170 170
171 if (cpus_intersects(mask, ctx->cpus_allowed)) 171 if (cpumask_intersects(mask, &ctx->cpus_allowed))
172 return 1; 172 return 1;
173 } 173 }
174 174
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h
index 15c62d3ca129..3bf908e2873a 100644
--- a/arch/powerpc/platforms/cell/spufs/spufs.h
+++ b/arch/powerpc/platforms/cell/spufs/spufs.h
@@ -314,7 +314,7 @@ extern char *isolated_loader;
314 * we need to call spu_release(ctx) before sleeping, and 314 * we need to call spu_release(ctx) before sleeping, and
315 * then spu_acquire(ctx) when awoken. 315 * then spu_acquire(ctx) when awoken.
316 * 316 *
317 * Returns with state_mutex re-acquired when successfull or 317 * Returns with state_mutex re-acquired when successful or
318 * with -ERESTARTSYS and the state_mutex dropped when interrupted. 318 * with -ERESTARTSYS and the state_mutex dropped when interrupted.
319 */ 319 */
320 320
diff --git a/arch/powerpc/platforms/iseries/Kconfig b/arch/powerpc/platforms/iseries/Kconfig
index ed3753d8c109..7ddd0a2c8027 100644
--- a/arch/powerpc/platforms/iseries/Kconfig
+++ b/arch/powerpc/platforms/iseries/Kconfig
@@ -10,18 +10,21 @@ menu "iSeries device drivers"
10config VIODASD 10config VIODASD
11 tristate "iSeries Virtual I/O disk support" 11 tristate "iSeries Virtual I/O disk support"
12 depends on BLOCK 12 depends on BLOCK
13 select VIOPATH
13 help 14 help
14 If you are running on an iSeries system and you want to use 15 If you are running on an iSeries system and you want to use
15 virtual disks created and managed by OS/400, say Y. 16 virtual disks created and managed by OS/400, say Y.
16 17
17config VIOCD 18config VIOCD
18 tristate "iSeries Virtual I/O CD support" 19 tristate "iSeries Virtual I/O CD support"
20 select VIOPATH
19 help 21 help
20 If you are running Linux on an IBM iSeries system and you want to 22 If you are running Linux on an IBM iSeries system and you want to
21 read a CD drive owned by OS/400, say Y here. 23 read a CD drive owned by OS/400, say Y here.
22 24
23config VIOTAPE 25config VIOTAPE
24 tristate "iSeries Virtual Tape Support" 26 tristate "iSeries Virtual Tape Support"
27 select VIOPATH
25 help 28 help
26 If you are running Linux on an iSeries system and you want Linux 29 If you are running Linux on an iSeries system and you want Linux
27 to read and/or write a tape drive owned by OS/400, say Y here. 30 to read and/or write a tape drive owned by OS/400, say Y here.
@@ -30,5 +33,3 @@ endmenu
30 33
31config VIOPATH 34config VIOPATH
32 bool 35 bool
33 depends on VIODASD || VIOCD || VIOTAPE || ISERIES_VETH
34 default y
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 70b688c1aefb..24519b96d6ad 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -23,6 +23,7 @@
23#include <linux/string.h> 23#include <linux/string.h>
24#include <linux/seq_file.h> 24#include <linux/seq_file.h>
25#include <linux/kdev_t.h> 25#include <linux/kdev_t.h>
26#include <linux/kexec.h>
26#include <linux/major.h> 27#include <linux/major.h>
27#include <linux/root_dev.h> 28#include <linux/root_dev.h>
28#include <linux/kernel.h> 29#include <linux/kernel.h>
@@ -638,6 +639,13 @@ static int __init iseries_probe(void)
638 return 1; 639 return 1;
639} 640}
640 641
642#ifdef CONFIG_KEXEC
643static int iseries_kexec_prepare(struct kimage *image)
644{
645 return -ENOSYS;
646}
647#endif
648
641define_machine(iseries) { 649define_machine(iseries) {
642 .name = "iSeries", 650 .name = "iSeries",
643 .setup_arch = iSeries_setup_arch, 651 .setup_arch = iSeries_setup_arch,
@@ -658,6 +666,9 @@ define_machine(iseries) {
658 .probe = iseries_probe, 666 .probe = iseries_probe,
659 .ioremap = iseries_ioremap, 667 .ioremap = iseries_ioremap,
660 .iounmap = iseries_iounmap, 668 .iounmap = iseries_iounmap,
669#ifdef CONFIG_KEXEC
670 .machine_kexec_prepare = iseries_kexec_prepare,
671#endif
661 /* XXX Implement enable_pmcs for iSeries */ 672 /* XXX Implement enable_pmcs for iSeries */
662}; 673};
663 674
diff --git a/arch/powerpc/platforms/pasemi/cpufreq.c b/arch/powerpc/platforms/pasemi/cpufreq.c
index 58556b028a4c..be2527a516ea 100644
--- a/arch/powerpc/platforms/pasemi/cpufreq.c
+++ b/arch/powerpc/platforms/pasemi/cpufreq.c
@@ -112,7 +112,7 @@ static int get_gizmo_latency(void)
112 112
113static void set_astate(int cpu, unsigned int astate) 113static void set_astate(int cpu, unsigned int astate)
114{ 114{
115 u64 flags; 115 unsigned long flags;
116 116
117 /* Return if called before init has run */ 117 /* Return if called before init has run */
118 if (unlikely(!sdcasr_mapbase)) 118 if (unlikely(!sdcasr_mapbase))
@@ -213,7 +213,7 @@ static int pas_cpufreq_cpu_init(struct cpufreq_policy *policy)
213 pr_debug("current astate is at %d\n",cur_astate); 213 pr_debug("current astate is at %d\n",cur_astate);
214 214
215 policy->cur = pas_freqs[cur_astate].frequency; 215 policy->cur = pas_freqs[cur_astate].frequency;
216 policy->cpus = cpu_online_map; 216 cpumask_copy(policy->cpus, &cpu_online_map);
217 217
218 ppc_proc_freq = policy->cur * 1000ul; 218 ppc_proc_freq = policy->cur * 1000ul;
219 219
diff --git a/arch/powerpc/platforms/pasemi/dma_lib.c b/arch/powerpc/platforms/pasemi/dma_lib.c
index 217af321b0ca..a6152d922243 100644
--- a/arch/powerpc/platforms/pasemi/dma_lib.c
+++ b/arch/powerpc/platforms/pasemi/dma_lib.c
@@ -509,7 +509,7 @@ fallback:
509 */ 509 */
510int pasemi_dma_init(void) 510int pasemi_dma_init(void)
511{ 511{
512 static spinlock_t init_lock = SPIN_LOCK_UNLOCKED; 512 static DEFINE_SPINLOCK(init_lock);
513 struct pci_dev *iob_pdev; 513 struct pci_dev *iob_pdev;
514 struct pci_dev *pdev; 514 struct pci_dev *pdev;
515 struct resource res; 515 struct resource res;
diff --git a/arch/powerpc/platforms/powermac/cpufreq_64.c b/arch/powerpc/platforms/powermac/cpufreq_64.c
index 4dfb4bc242b5..beb38333b6d2 100644
--- a/arch/powerpc/platforms/powermac/cpufreq_64.c
+++ b/arch/powerpc/platforms/powermac/cpufreq_64.c
@@ -362,7 +362,7 @@ static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy)
362 /* secondary CPUs are tied to the primary one by the 362 /* secondary CPUs are tied to the primary one by the
363 * cpufreq core if in the secondary policy we tell it that 363 * cpufreq core if in the secondary policy we tell it that
364 * it actually must be one policy together with all others. */ 364 * it actually must be one policy together with all others. */
365 policy->cpus = cpu_online_map; 365 cpumask_copy(policy->cpus, &cpu_online_map);
366 cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu); 366 cpufreq_frequency_table_get_attr(g5_cpu_freqs, policy->cpu);
367 367
368 return cpufreq_frequency_table_cpuinfo(policy, 368 return cpufreq_frequency_table_cpuinfo(policy,
diff --git a/arch/powerpc/platforms/powermac/pci.c b/arch/powerpc/platforms/powermac/pci.c
index 54b7b76ed4f0..04cdd32624d4 100644
--- a/arch/powerpc/platforms/powermac/pci.c
+++ b/arch/powerpc/platforms/powermac/pci.c
@@ -661,6 +661,7 @@ static void __init init_second_ohare(void)
661 pci_find_hose_for_OF_device(np); 661 pci_find_hose_for_OF_device(np);
662 if (!hose) { 662 if (!hose) {
663 printk(KERN_ERR "Can't find PCI hose for OHare2 !\n"); 663 printk(KERN_ERR "Can't find PCI hose for OHare2 !\n");
664 of_node_put(np);
664 return; 665 return;
665 } 666 }
666 early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd); 667 early_read_config_word(hose, bus, devfn, PCI_COMMAND, &cmd);
@@ -669,6 +670,7 @@ static void __init init_second_ohare(void)
669 early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd); 670 early_write_config_word(hose, bus, devfn, PCI_COMMAND, cmd);
670 } 671 }
671 has_second_ohare = 1; 672 has_second_ohare = 1;
673 of_node_put(np);
672} 674}
673 675
674/* 676/*
diff --git a/arch/powerpc/platforms/powermac/time.c b/arch/powerpc/platforms/powermac/time.c
index 59eb840d8ce2..1810e4226e56 100644
--- a/arch/powerpc/platforms/powermac/time.c
+++ b/arch/powerpc/platforms/powermac/time.c
@@ -265,12 +265,15 @@ int __init via_calibrate_decr(void)
265 struct resource rsrc; 265 struct resource rsrc;
266 266
267 vias = of_find_node_by_name(NULL, "via-cuda"); 267 vias = of_find_node_by_name(NULL, "via-cuda");
268 if (vias == 0) 268 if (vias == NULL)
269 vias = of_find_node_by_name(NULL, "via-pmu"); 269 vias = of_find_node_by_name(NULL, "via-pmu");
270 if (vias == 0) 270 if (vias == NULL)
271 vias = of_find_node_by_name(NULL, "via"); 271 vias = of_find_node_by_name(NULL, "via");
272 if (vias == 0 || of_address_to_resource(vias, 0, &rsrc)) 272 if (vias == NULL || of_address_to_resource(vias, 0, &rsrc)) {
273 of_node_put(vias);
273 return 0; 274 return 0;
275 }
276 of_node_put(vias);
274 via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1); 277 via = ioremap(rsrc.start, rsrc.end - rsrc.start + 1);
275 if (via == NULL) { 278 if (via == NULL) {
276 printk(KERN_ERR "Failed to map VIA for timer calibration !\n"); 279 printk(KERN_ERR "Failed to map VIA for timer calibration !\n");
@@ -297,7 +300,7 @@ int __init via_calibrate_decr(void)
297 ppc_tb_freq = (dstart - dend) * 100 / 6; 300 ppc_tb_freq = (dstart - dend) * 100 / 6;
298 301
299 iounmap(via); 302 iounmap(via);
300 303
301 return 1; 304 return 1;
302} 305}
303#endif 306#endif
diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c
index dbc124e05646..ca71a12b764c 100644
--- a/arch/powerpc/platforms/ps3/device-init.c
+++ b/arch/powerpc/platforms/ps3/device-init.c
@@ -518,6 +518,41 @@ fail_device_register:
518 return result; 518 return result;
519} 519}
520 520
521static int __init ps3_register_ramdisk_device(void)
522{
523 int result;
524 struct layout {
525 struct ps3_system_bus_device dev;
526 } *p;
527
528 pr_debug(" -> %s:%d\n", __func__, __LINE__);
529
530 p = kzalloc(sizeof(struct layout), GFP_KERNEL);
531
532 if (!p)
533 return -ENOMEM;
534
535 p->dev.match_id = PS3_MATCH_ID_GPU;
536 p->dev.match_sub_id = PS3_MATCH_SUB_ID_GPU_RAMDISK;
537 p->dev.dev_type = PS3_DEVICE_TYPE_IOC0;
538
539 result = ps3_system_bus_device_register(&p->dev);
540
541 if (result) {
542 pr_debug("%s:%d ps3_system_bus_device_register failed\n",
543 __func__, __LINE__);
544 goto fail_device_register;
545 }
546
547 pr_debug(" <- %s:%d\n", __func__, __LINE__);
548 return 0;
549
550fail_device_register:
551 kfree(p);
552 pr_debug(" <- %s:%d failed\n", __func__, __LINE__);
553 return result;
554}
555
521/** 556/**
522 * ps3_setup_dynamic_device - Setup a dynamic device from the repository 557 * ps3_setup_dynamic_device - Setup a dynamic device from the repository
523 */ 558 */
@@ -946,6 +981,8 @@ static int __init ps3_register_devices(void)
946 981
947 ps3_register_lpm_devices(); 982 ps3_register_lpm_devices();
948 983
984 ps3_register_ramdisk_device();
985
949 pr_debug(" <- %s:%d\n", __func__, __LINE__); 986 pr_debug(" <- %s:%d\n", __func__, __LINE__);
950 return 0; 987 return 0;
951} 988}
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index f7a69021b7bf..84e058f1e1cc 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -332,7 +332,7 @@ static void xics_eoi_lpar(unsigned int virq)
332 lpar_xirr_info_set((0xff << 24) | irq); 332 lpar_xirr_info_set((0xff << 24) | irq);
333} 333}
334 334
335static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) 335static void xics_set_affinity(unsigned int virq, const struct cpumask *cpumask)
336{ 336{
337 unsigned int irq; 337 unsigned int irq;
338 int status; 338 int status;
@@ -870,7 +870,7 @@ void xics_migrate_irqs_away(void)
870 870
871 /* Reset affinity to all cpus */ 871 /* Reset affinity to all cpus */
872 irq_desc[virq].affinity = CPU_MASK_ALL; 872 irq_desc[virq].affinity = CPU_MASK_ALL;
873 desc->chip->set_affinity(virq, CPU_MASK_ALL); 873 desc->chip->set_affinity(virq, cpu_all_mask);
874unlock: 874unlock:
875 spin_unlock_irqrestore(&desc->lock, flags); 875 spin_unlock_irqrestore(&desc->lock, flags);
876 } 876 }
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index 5afce115ab1f..b33b28a6fe12 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_FSL_PCI) += fsl_pci.o $(fsl-msi-obj-y)
17obj-$(CONFIG_FSL_LBC) += fsl_lbc.o 17obj-$(CONFIG_FSL_LBC) += fsl_lbc.o
18obj-$(CONFIG_FSL_GTM) += fsl_gtm.o 18obj-$(CONFIG_FSL_GTM) += fsl_gtm.o
19obj-$(CONFIG_MPC8xxx_GPIO) += mpc8xxx_gpio.o 19obj-$(CONFIG_MPC8xxx_GPIO) += mpc8xxx_gpio.o
20obj-$(CONFIG_SIMPLE_GPIO) += simple_gpio.o
20obj-$(CONFIG_RAPIDIO) += fsl_rio.o 21obj-$(CONFIG_RAPIDIO) += fsl_rio.o
21obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o 22obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o
22obj-$(CONFIG_QUICC_ENGINE) += qe_lib/ 23obj-$(CONFIG_QUICC_ENGINE) += qe_lib/
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index d5f9ae0f1b75..f611d0369cc8 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -29,7 +29,8 @@
29 29
30#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx) 30#if defined(CONFIG_PPC_85xx) || defined(CONFIG_PPC_86xx)
31/* atmu setup for fsl pci/pcie controller */ 31/* atmu setup for fsl pci/pcie controller */
32void __init setup_pci_atmu(struct pci_controller *hose, struct resource *rsrc) 32static void __init setup_pci_atmu(struct pci_controller *hose,
33 struct resource *rsrc)
33{ 34{
34 struct ccsr_pci __iomem *pci; 35 struct ccsr_pci __iomem *pci;
35 int i; 36 int i;
@@ -86,7 +87,7 @@ void __init setup_pci_atmu(struct pci_controller *hose, struct resource *rsrc)
86 out_be32(&pci->piw[2].piwar, PIWAR_2G); 87 out_be32(&pci->piw[2].piwar, PIWAR_2G);
87} 88}
88 89
89void __init setup_pci_cmd(struct pci_controller *hose) 90static void __init setup_pci_cmd(struct pci_controller *hose)
90{ 91{
91 u16 cmd; 92 u16 cmd;
92 int cap_x; 93 int cap_x;
@@ -130,7 +131,7 @@ static void __init quirk_fsl_pcie_header(struct pci_dev *dev)
130 return ; 131 return ;
131} 132}
132 133
133int __init fsl_pcie_check_link(struct pci_controller *hose) 134static int __init fsl_pcie_check_link(struct pci_controller *hose)
134{ 135{
135 u32 val; 136 u32 val;
136 early_read_config_dword(hose, 0, 0, PCIE_LTSSM, &val); 137 early_read_config_dword(hose, 0, 0, PCIE_LTSSM, &val);
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h
index 60f7f227327c..9c744e4285a0 100644
--- a/arch/powerpc/sysdev/fsl_soc.h
+++ b/arch/powerpc/sysdev/fsl_soc.h
@@ -5,8 +5,13 @@
5#include <asm/mmu.h> 5#include <asm/mmu.h>
6 6
7extern phys_addr_t get_immrbase(void); 7extern phys_addr_t get_immrbase(void);
8#if defined(CONFIG_CPM2) || defined(CONFIG_QUICC_ENGINE) || defined(CONFIG_8xx)
8extern u32 get_brgfreq(void); 9extern u32 get_brgfreq(void);
9extern u32 get_baudrate(void); 10extern u32 get_baudrate(void);
11#else
12static inline u32 get_brgfreq(void) { return -1; }
13static inline u32 get_baudrate(void) { return -1; }
14#endif
10extern u32 fsl_get_sys_freq(void); 15extern u32 fsl_get_sys_freq(void);
11 16
12struct spi_board_info; 17struct spi_board_info;
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index c82babb70074..3e0d89dcdba2 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -806,7 +806,7 @@ static void mpic_end_ipi(unsigned int irq)
806 806
807#endif /* CONFIG_SMP */ 807#endif /* CONFIG_SMP */
808 808
809void mpic_set_affinity(unsigned int irq, cpumask_t cpumask) 809void mpic_set_affinity(unsigned int irq, const struct cpumask *cpumask)
810{ 810{
811 struct mpic *mpic = mpic_from_irq(irq); 811 struct mpic *mpic = mpic_from_irq(irq);
812 unsigned int src = mpic_irq_to_hw(irq); 812 unsigned int src = mpic_irq_to_hw(irq);
@@ -818,7 +818,7 @@ void mpic_set_affinity(unsigned int irq, cpumask_t cpumask)
818 } else { 818 } else {
819 cpumask_t tmp; 819 cpumask_t tmp;
820 820
821 cpus_and(tmp, cpumask, cpu_online_map); 821 cpumask_and(&tmp, cpumask, cpu_online_mask);
822 822
823 mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION), 823 mpic_irq_write(src, MPIC_INFO(IRQ_DESTINATION),
824 mpic_physmask(cpus_addr(tmp)[0])); 824 mpic_physmask(cpus_addr(tmp)[0]));
diff --git a/arch/powerpc/sysdev/mpic.h b/arch/powerpc/sysdev/mpic.h
index 6209c62a426d..3cef2af10f42 100644
--- a/arch/powerpc/sysdev/mpic.h
+++ b/arch/powerpc/sysdev/mpic.h
@@ -36,6 +36,6 @@ static inline int mpic_pasemi_msi_init(struct mpic *mpic)
36 36
37extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type); 37extern int mpic_set_irq_type(unsigned int virq, unsigned int flow_type);
38extern void mpic_set_vector(unsigned int virq, unsigned int vector); 38extern void mpic_set_vector(unsigned int virq, unsigned int vector);
39extern void mpic_set_affinity(unsigned int irq, cpumask_t cpumask); 39extern void mpic_set_affinity(unsigned int irq, const struct cpumask *cpumask);
40 40
41#endif /* _POWERPC_SYSDEV_MPIC_H */ 41#endif /* _POWERPC_SYSDEV_MPIC_H */
diff --git a/arch/powerpc/sysdev/qe_lib/Kconfig b/arch/powerpc/sysdev/qe_lib/Kconfig
index 76ffbc48d4b9..41ac3dfac98e 100644
--- a/arch/powerpc/sysdev/qe_lib/Kconfig
+++ b/arch/powerpc/sysdev/qe_lib/Kconfig
@@ -22,5 +22,6 @@ config UCC
22 22
23config QE_USB 23config QE_USB
24 bool 24 bool
25 default y if USB_GADGET_FSL_QE
25 help 26 help
26 QE USB Host Controller support 27 QE USB Controller support
diff --git a/arch/powerpc/sysdev/qe_lib/gpio.c b/arch/powerpc/sysdev/qe_lib/gpio.c
index 8e5a0bc36d0b..3485288dce31 100644
--- a/arch/powerpc/sysdev/qe_lib/gpio.c
+++ b/arch/powerpc/sysdev/qe_lib/gpio.c
@@ -14,6 +14,7 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/err.h>
17#include <linux/io.h> 18#include <linux/io.h>
18#include <linux/of.h> 19#include <linux/of.h>
19#include <linux/of_gpio.h> 20#include <linux/of_gpio.h>
@@ -24,8 +25,14 @@ struct qe_gpio_chip {
24 struct of_mm_gpio_chip mm_gc; 25 struct of_mm_gpio_chip mm_gc;
25 spinlock_t lock; 26 spinlock_t lock;
26 27
28 unsigned long pin_flags[QE_PIO_PINS];
29#define QE_PIN_REQUESTED 0
30
27 /* shadowed data register to clear/set bits safely */ 31 /* shadowed data register to clear/set bits safely */
28 u32 cpdata; 32 u32 cpdata;
33
34 /* saved_regs used to restore dedicated functions */
35 struct qe_pio_regs saved_regs;
29}; 36};
30 37
31static inline struct qe_gpio_chip * 38static inline struct qe_gpio_chip *
@@ -40,6 +47,12 @@ static void qe_gpio_save_regs(struct of_mm_gpio_chip *mm_gc)
40 struct qe_pio_regs __iomem *regs = mm_gc->regs; 47 struct qe_pio_regs __iomem *regs = mm_gc->regs;
41 48
42 qe_gc->cpdata = in_be32(&regs->cpdata); 49 qe_gc->cpdata = in_be32(&regs->cpdata);
50 qe_gc->saved_regs.cpdata = qe_gc->cpdata;
51 qe_gc->saved_regs.cpdir1 = in_be32(&regs->cpdir1);
52 qe_gc->saved_regs.cpdir2 = in_be32(&regs->cpdir2);
53 qe_gc->saved_regs.cppar1 = in_be32(&regs->cppar1);
54 qe_gc->saved_regs.cppar2 = in_be32(&regs->cppar2);
55 qe_gc->saved_regs.cpodr = in_be32(&regs->cpodr);
43} 56}
44 57
45static int qe_gpio_get(struct gpio_chip *gc, unsigned int gpio) 58static int qe_gpio_get(struct gpio_chip *gc, unsigned int gpio)
@@ -103,6 +116,188 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
103 return 0; 116 return 0;
104} 117}
105 118
119struct qe_pin {
120 /*
121 * The qe_gpio_chip name is unfortunate, we should change that to
122 * something like qe_pio_controller. Someday.
123 */
124 struct qe_gpio_chip *controller;
125 int num;
126};
127
128/**
129 * qe_pin_request - Request a QE pin
130 * @np: device node to get a pin from
131 * @index: index of a pin in the device tree
132 * Context: non-atomic
133 *
134 * This function return qe_pin so that you could use it with the rest of
135 * the QE Pin Multiplexing API.
136 */
137struct qe_pin *qe_pin_request(struct device_node *np, int index)
138{
139 struct qe_pin *qe_pin;
140 struct device_node *gc;
141 struct of_gpio_chip *of_gc = NULL;
142 struct of_mm_gpio_chip *mm_gc;
143 struct qe_gpio_chip *qe_gc;
144 int err;
145 int size;
146 const void *gpio_spec;
147 const u32 *gpio_cells;
148 unsigned long flags;
149
150 qe_pin = kzalloc(sizeof(*qe_pin), GFP_KERNEL);
151 if (!qe_pin) {
152 pr_debug("%s: can't allocate memory\n", __func__);
153 return ERR_PTR(-ENOMEM);
154 }
155
156 err = of_parse_phandles_with_args(np, "gpios", "#gpio-cells", index,
157 &gc, &gpio_spec);
158 if (err) {
159 pr_debug("%s: can't parse gpios property\n", __func__);
160 goto err0;
161 }
162
163 if (!of_device_is_compatible(gc, "fsl,mpc8323-qe-pario-bank")) {
164 pr_debug("%s: tried to get a non-qe pin\n", __func__);
165 err = -EINVAL;
166 goto err1;
167 }
168
169 of_gc = gc->data;
170 if (!of_gc) {
171 pr_debug("%s: gpio controller %s isn't registered\n",
172 np->full_name, gc->full_name);
173 err = -ENODEV;
174 goto err1;
175 }
176
177 gpio_cells = of_get_property(gc, "#gpio-cells", &size);
178 if (!gpio_cells || size != sizeof(*gpio_cells) ||
179 *gpio_cells != of_gc->gpio_cells) {
180 pr_debug("%s: wrong #gpio-cells for %s\n",
181 np->full_name, gc->full_name);
182 err = -EINVAL;
183 goto err1;
184 }
185
186 err = of_gc->xlate(of_gc, np, gpio_spec, NULL);
187 if (err < 0)
188 goto err1;
189
190 mm_gc = to_of_mm_gpio_chip(&of_gc->gc);
191 qe_gc = to_qe_gpio_chip(mm_gc);
192
193 spin_lock_irqsave(&qe_gc->lock, flags);
194
195 if (test_and_set_bit(QE_PIN_REQUESTED, &qe_gc->pin_flags[err]) == 0) {
196 qe_pin->controller = qe_gc;
197 qe_pin->num = err;
198 err = 0;
199 } else {
200 err = -EBUSY;
201 }
202
203 spin_unlock_irqrestore(&qe_gc->lock, flags);
204
205 if (!err)
206 return qe_pin;
207err1:
208 of_node_put(gc);
209err0:
210 kfree(qe_pin);
211 pr_debug("%s failed with status %d\n", __func__, err);
212 return ERR_PTR(err);
213}
214EXPORT_SYMBOL(qe_pin_request);
215
216/**
217 * qe_pin_free - Free a pin
218 * @qe_pin: pointer to the qe_pin structure
219 * Context: any
220 *
221 * This function frees the qe_pin structure and makes a pin available
222 * for further qe_pin_request() calls.
223 */
224void qe_pin_free(struct qe_pin *qe_pin)
225{
226 struct qe_gpio_chip *qe_gc = qe_pin->controller;
227 unsigned long flags;
228 const int pin = qe_pin->num;
229
230 spin_lock_irqsave(&qe_gc->lock, flags);
231 test_and_clear_bit(QE_PIN_REQUESTED, &qe_gc->pin_flags[pin]);
232 spin_unlock_irqrestore(&qe_gc->lock, flags);
233
234 kfree(qe_pin);
235}
236EXPORT_SYMBOL(qe_pin_free);
237
238/**
239 * qe_pin_set_dedicated - Revert a pin to a dedicated peripheral function mode
240 * @qe_pin: pointer to the qe_pin structure
241 * Context: any
242 *
243 * This function resets a pin to a dedicated peripheral function that
244 * has been set up by the firmware.
245 */
246void qe_pin_set_dedicated(struct qe_pin *qe_pin)
247{
248 struct qe_gpio_chip *qe_gc = qe_pin->controller;
249 struct qe_pio_regs __iomem *regs = qe_gc->mm_gc.regs;
250 struct qe_pio_regs *sregs = &qe_gc->saved_regs;
251 int pin = qe_pin->num;
252 u32 mask1 = 1 << (QE_PIO_PINS - (pin + 1));
253 u32 mask2 = 0x3 << (QE_PIO_PINS - (pin % (QE_PIO_PINS / 2) + 1) * 2);
254 bool second_reg = pin > (QE_PIO_PINS / 2) - 1;
255 unsigned long flags;
256
257 spin_lock_irqsave(&qe_gc->lock, flags);
258
259 if (second_reg) {
260 clrsetbits_be32(&regs->cpdir2, mask2, sregs->cpdir2 & mask2);
261 clrsetbits_be32(&regs->cppar2, mask2, sregs->cppar2 & mask2);
262 } else {
263 clrsetbits_be32(&regs->cpdir1, mask2, sregs->cpdir1 & mask2);
264 clrsetbits_be32(&regs->cppar1, mask2, sregs->cppar1 & mask2);
265 }
266
267 if (sregs->cpdata & mask1)
268 qe_gc->cpdata |= mask1;
269 else
270 qe_gc->cpdata &= ~mask1;
271
272 out_be32(&regs->cpdata, qe_gc->cpdata);
273 clrsetbits_be32(&regs->cpodr, mask1, sregs->cpodr & mask1);
274
275 spin_unlock_irqrestore(&qe_gc->lock, flags);
276}
277EXPORT_SYMBOL(qe_pin_set_dedicated);
278
279/**
280 * qe_pin_set_gpio - Set a pin to the GPIO mode
281 * @qe_pin: pointer to the qe_pin structure
282 * Context: any
283 *
284 * This function sets a pin to the GPIO mode.
285 */
286void qe_pin_set_gpio(struct qe_pin *qe_pin)
287{
288 struct qe_gpio_chip *qe_gc = qe_pin->controller;
289 struct qe_pio_regs __iomem *regs = qe_gc->mm_gc.regs;
290 unsigned long flags;
291
292 spin_lock_irqsave(&qe_gc->lock, flags);
293
294 /* Let's make it input by default, GPIO API is able to change that. */
295 __par_io_config_pin(regs, qe_pin->num, QE_PIO_DIR_IN, 0, 0, 0);
296
297 spin_unlock_irqrestore(&qe_gc->lock, flags);
298}
299EXPORT_SYMBOL(qe_pin_set_gpio);
300
106static int __init qe_add_gpiochips(void) 301static int __init qe_add_gpiochips(void)
107{ 302{
108 struct device_node *np; 303 struct device_node *np;
diff --git a/arch/powerpc/sysdev/simple_gpio.c b/arch/powerpc/sysdev/simple_gpio.c
new file mode 100644
index 000000000000..43c4569e24b7
--- /dev/null
+++ b/arch/powerpc/sysdev/simple_gpio.c
@@ -0,0 +1,155 @@
1/*
2 * Simple Memory-Mapped GPIOs
3 *
4 * Copyright (c) MontaVista Software, Inc. 2008.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
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/init.h>
15#include <linux/kernel.h>
16#include <linux/module.h>
17#include <linux/spinlock.h>
18#include <linux/types.h>
19#include <linux/ioport.h>
20#include <linux/io.h>
21#include <linux/of.h>
22#include <linux/of_gpio.h>
23#include <linux/gpio.h>
24#include <asm/prom.h>
25#include "simple_gpio.h"
26
27struct u8_gpio_chip {
28 struct of_mm_gpio_chip mm_gc;
29 spinlock_t lock;
30
31 /* shadowed data register to clear/set bits safely */
32 u8 data;
33};
34
35static struct u8_gpio_chip *to_u8_gpio_chip(struct of_mm_gpio_chip *mm_gc)
36{
37 return container_of(mm_gc, struct u8_gpio_chip, mm_gc);
38}
39
40static u8 u8_pin2mask(unsigned int pin)
41{
42 return 1 << (8 - 1 - pin);
43}
44
45static int u8_gpio_get(struct gpio_chip *gc, unsigned int gpio)
46{
47 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
48
49 return in_8(mm_gc->regs) & u8_pin2mask(gpio);
50}
51
52static void u8_gpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
53{
54 struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
55 struct u8_gpio_chip *u8_gc = to_u8_gpio_chip(mm_gc);
56 unsigned long flags;
57
58 spin_lock_irqsave(&u8_gc->lock, flags);
59
60 if (val)
61 u8_gc->data |= u8_pin2mask(gpio);
62 else
63 u8_gc->data &= ~u8_pin2mask(gpio);
64
65 out_8(mm_gc->regs, u8_gc->data);
66
67 spin_unlock_irqrestore(&u8_gc->lock, flags);
68}
69
70static int u8_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
71{
72 return 0;
73}
74
75static int u8_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
76{
77 u8_gpio_set(gc, gpio, val);
78 return 0;
79}
80
81static void u8_gpio_save_regs(struct of_mm_gpio_chip *mm_gc)
82{
83 struct u8_gpio_chip *u8_gc = to_u8_gpio_chip(mm_gc);
84
85 u8_gc->data = in_8(mm_gc->regs);
86}
87
88static int __init u8_simple_gpiochip_add(struct device_node *np)
89{
90 int ret;
91 struct u8_gpio_chip *u8_gc;
92 struct of_mm_gpio_chip *mm_gc;
93 struct of_gpio_chip *of_gc;
94 struct gpio_chip *gc;
95
96 u8_gc = kzalloc(sizeof(*u8_gc), GFP_KERNEL);
97 if (!u8_gc)
98 return -ENOMEM;
99
100 spin_lock_init(&u8_gc->lock);
101
102 mm_gc = &u8_gc->mm_gc;
103 of_gc = &mm_gc->of_gc;
104 gc = &of_gc->gc;
105
106 mm_gc->save_regs = u8_gpio_save_regs;
107 of_gc->gpio_cells = 2;
108 gc->ngpio = 8;
109 gc->direction_input = u8_gpio_dir_in;
110 gc->direction_output = u8_gpio_dir_out;
111 gc->get = u8_gpio_get;
112 gc->set = u8_gpio_set;
113
114 ret = of_mm_gpiochip_add(np, mm_gc);
115 if (ret)
116 goto err;
117 return 0;
118err:
119 kfree(u8_gc);
120 return ret;
121}
122
123void __init simple_gpiochip_init(const char *compatible)
124{
125 struct device_node *np;
126
127 for_each_compatible_node(np, NULL, compatible) {
128 int ret;
129 struct resource r;
130
131 ret = of_address_to_resource(np, 0, &r);
132 if (ret)
133 goto err;
134
135 switch (resource_size(&r)) {
136 case 1:
137 ret = u8_simple_gpiochip_add(np);
138 if (ret)
139 goto err;
140 break;
141 default:
142 /*
143 * Whenever you need support for GPIO bank width > 1,
144 * please just turn u8_ code into huge macros, and
145 * construct needed uX_ code with it.
146 */
147 ret = -ENOSYS;
148 goto err;
149 }
150 continue;
151err:
152 pr_err("%s: registration failed, status %d\n",
153 np->full_name, ret);
154 }
155}
diff --git a/arch/powerpc/sysdev/simple_gpio.h b/arch/powerpc/sysdev/simple_gpio.h
new file mode 100644
index 000000000000..3a7b0c513c76
--- /dev/null
+++ b/arch/powerpc/sysdev/simple_gpio.h
@@ -0,0 +1,12 @@
1#ifndef __SYSDEV_SIMPLE_GPIO_H
2#define __SYSDEV_SIMPLE_GPIO_H
3
4#include <linux/errno.h>
5
6#ifdef CONFIG_SIMPLE_GPIO
7extern void simple_gpiochip_init(const char *compatible);
8#else
9static inline void simple_gpiochip_init(const char *compatible) {}
10#endif /* CONFIG_SIMPLE_GPIO */
11
12#endif /* __SYSDEV_SIMPLE_GPIO_H */
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 8152fefc97b9..a94a3c3ae932 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -83,6 +83,7 @@ config S390
83 select HAVE_KRETPROBES 83 select HAVE_KRETPROBES
84 select HAVE_KVM if 64BIT 84 select HAVE_KVM if 64BIT
85 select HAVE_ARCH_TRACEHOOK 85 select HAVE_ARCH_TRACEHOOK
86 select INIT_ALL_POSSIBLE
86 87
87source "init/Kconfig" 88source "init/Kconfig"
88 89
@@ -298,7 +299,7 @@ config WARN_STACK
298 This option enables the compiler options -mwarn-framesize and 299 This option enables the compiler options -mwarn-framesize and
299 -mwarn-dynamicstack. If the compiler supports these options it 300 -mwarn-dynamicstack. If the compiler supports these options it
300 will generate warnings for function which either use alloca or 301 will generate warnings for function which either use alloca or
301 create a stack frame bigger then CONFIG_WARN_STACK_SIZE. 302 create a stack frame bigger than CONFIG_WARN_STACK_SIZE.
302 303
303 Say N if you are unsure. 304 Say N if you are unsure.
304 305
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 9d4f8e6c0800..5a805df216bb 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -106,7 +106,6 @@ static struct inode *hypfs_make_inode(struct super_block *sb, int mode)
106 ret->i_mode = mode; 106 ret->i_mode = mode;
107 ret->i_uid = hypfs_info->uid; 107 ret->i_uid = hypfs_info->uid;
108 ret->i_gid = hypfs_info->gid; 108 ret->i_gid = hypfs_info->gid;
109 ret->i_blocks = 0;
110 ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; 109 ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME;
111 if (mode & S_IFDIR) 110 if (mode & S_IFDIR)
112 ret->i_nlink = 2; 111 ret->i_nlink = 2;
diff --git a/arch/s390/include/asm/Kbuild b/arch/s390/include/asm/Kbuild
index 63a23415fba6..f2af4167bd5f 100644
--- a/arch/s390/include/asm/Kbuild
+++ b/arch/s390/include/asm/Kbuild
@@ -13,3 +13,4 @@ unifdef-y += cmb.h
13unifdef-y += debug.h 13unifdef-y += debug.h
14unifdef-y += chpid.h 14unifdef-y += chpid.h
15unifdef-y += schid.h 15unifdef-y += schid.h
16unifdef-y += swab.h
diff --git a/arch/s390/include/asm/atomic.h b/arch/s390/include/asm/atomic.h
index 2d184655bc5d..de432f2de2d2 100644
--- a/arch/s390/include/asm/atomic.h
+++ b/arch/s390/include/asm/atomic.h
@@ -2,6 +2,7 @@
2#define __ARCH_S390_ATOMIC__ 2#define __ARCH_S390_ATOMIC__
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/types.h>
5 6
6/* 7/*
7 * include/asm-s390/atomic.h 8 * include/asm-s390/atomic.h
@@ -23,9 +24,6 @@
23 * S390 uses 'Compare And Swap' for atomicity in SMP enviroment 24 * S390 uses 'Compare And Swap' for atomicity in SMP enviroment
24 */ 25 */
25 26
26typedef struct {
27 int counter;
28} __attribute__ ((aligned (4))) atomic_t;
29#define ATOMIC_INIT(i) { (i) } 27#define ATOMIC_INIT(i) { (i) }
30 28
31#ifdef __KERNEL__ 29#ifdef __KERNEL__
@@ -149,9 +147,6 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
149#undef __CS_LOOP 147#undef __CS_LOOP
150 148
151#ifdef __s390x__ 149#ifdef __s390x__
152typedef struct {
153 long long counter;
154} __attribute__ ((aligned (8))) atomic64_t;
155#define ATOMIC64_INIT(i) { (i) } 150#define ATOMIC64_INIT(i) { (i) }
156 151
157#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) 152#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2)
diff --git a/arch/s390/include/asm/byteorder.h b/arch/s390/include/asm/byteorder.h
index 8bcf277c8468..b95a2b2933fb 100644
--- a/arch/s390/include/asm/byteorder.h
+++ b/arch/s390/include/asm/byteorder.h
@@ -1,95 +1,7 @@
1#ifndef _S390_BYTEORDER_H 1#ifndef _S390_BYTEORDER_H
2#define _S390_BYTEORDER_H 2#define _S390_BYTEORDER_H
3 3
4/* 4#include <asm/swab.h>
5 * include/asm-s390/byteorder.h 5#include <linux/byteorder/big_endian.h>
6 *
7 * S390 version
8 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
9 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
10 */
11
12#include <asm/types.h>
13
14#define __BIG_ENDIAN
15
16#ifndef __s390x__
17# define __SWAB_64_THRU_32__
18#endif
19
20#ifdef __s390x__
21static inline __u64 __arch_swab64p(const __u64 *x)
22{
23 __u64 result;
24
25 asm volatile("lrvg %0,%1" : "=d" (result) : "m" (*x));
26 return result;
27}
28#define __arch_swab64p __arch_swab64p
29
30static inline __u64 __arch_swab64(__u64 x)
31{
32 __u64 result;
33
34 asm volatile("lrvgr %0,%1" : "=d" (result) : "d" (x));
35 return result;
36}
37#define __arch_swab64 __arch_swab64
38
39static inline void __arch_swab64s(__u64 *x)
40{
41 *x = __arch_swab64p(x);
42}
43#define __arch_swab64s __arch_swab64s
44#endif /* __s390x__ */
45
46static inline __u32 __arch_swab32p(const __u32 *x)
47{
48 __u32 result;
49
50 asm volatile(
51#ifndef __s390x__
52 " icm %0,8,3(%1)\n"
53 " icm %0,4,2(%1)\n"
54 " icm %0,2,1(%1)\n"
55 " ic %0,0(%1)"
56 : "=&d" (result) : "a" (x), "m" (*x) : "cc");
57#else /* __s390x__ */
58 " lrv %0,%1"
59 : "=d" (result) : "m" (*x));
60#endif /* __s390x__ */
61 return result;
62}
63#define __arch_swab32p __arch_swab32p
64
65#ifdef __s390x__
66static inline __u32 __arch_swab32(__u32 x)
67{
68 __u32 result;
69
70 asm volatile("lrvr %0,%1" : "=d" (result) : "d" (x));
71 return result;
72}
73#define __arch_swab32 __arch_swab32
74#endif /* __s390x__ */
75
76static inline __u16 __arch_swab16p(const __u16 *x)
77{
78 __u16 result;
79
80 asm volatile(
81#ifndef __s390x__
82 " icm %0,2,1(%1)\n"
83 " ic %0,0(%1)\n"
84 : "=&d" (result) : "a" (x), "m" (*x) : "cc");
85#else /* __s390x__ */
86 " lrvh %0,%1"
87 : "=d" (result) : "m" (*x));
88#endif /* __s390x__ */
89 return result;
90}
91#define __arch_swab16p __arch_swab16p
92
93#include <linux/byteorder.h>
94 6
95#endif /* _S390_BYTEORDER_H */ 7#endif /* _S390_BYTEORDER_H */
diff --git a/arch/s390/include/asm/chpid.h b/arch/s390/include/asm/chpid.h
index dfe3c7f3439a..fc71d8a6709b 100644
--- a/arch/s390/include/asm/chpid.h
+++ b/arch/s390/include/asm/chpid.h
@@ -9,7 +9,7 @@
9#define _ASM_S390_CHPID_H _ASM_S390_CHPID_H 9#define _ASM_S390_CHPID_H _ASM_S390_CHPID_H
10 10
11#include <linux/string.h> 11#include <linux/string.h>
12#include <asm/types.h> 12#include <linux/types.h>
13 13
14#define __MAX_CHPID 255 14#define __MAX_CHPID 255
15 15
diff --git a/arch/s390/include/asm/chsc.h b/arch/s390/include/asm/chsc.h
index d38d0cf62d4b..807997f7414b 100644
--- a/arch/s390/include/asm/chsc.h
+++ b/arch/s390/include/asm/chsc.h
@@ -8,6 +8,7 @@
8#ifndef _ASM_CHSC_H 8#ifndef _ASM_CHSC_H
9#define _ASM_CHSC_H 9#define _ASM_CHSC_H
10 10
11#include <linux/types.h>
11#include <asm/chpid.h> 12#include <asm/chpid.h>
12#include <asm/schid.h> 13#include <asm/schid.h>
13 14
diff --git a/arch/s390/include/asm/cmb.h b/arch/s390/include/asm/cmb.h
index 50196857d27a..39ae03294794 100644
--- a/arch/s390/include/asm/cmb.h
+++ b/arch/s390/include/asm/cmb.h
@@ -1,5 +1,8 @@
1#ifndef S390_CMB_H 1#ifndef S390_CMB_H
2#define S390_CMB_H 2#define S390_CMB_H
3
4#include <linux/types.h>
5
3/** 6/**
4 * struct cmbdata - channel measurement block data for user space 7 * struct cmbdata - channel measurement block data for user space
5 * @size: size of the stored data 8 * @size: size of the stored data
diff --git a/arch/s390/include/asm/cpu.h b/arch/s390/include/asm/cpu.h
index e5a6a9ba3adf..d60a2eefb17b 100644
--- a/arch/s390/include/asm/cpu.h
+++ b/arch/s390/include/asm/cpu.h
@@ -14,7 +14,6 @@
14 14
15struct s390_idle_data { 15struct s390_idle_data {
16 spinlock_t lock; 16 spinlock_t lock;
17 unsigned int in_idle;
18 unsigned long long idle_count; 17 unsigned long long idle_count;
19 unsigned long long idle_enter; 18 unsigned long long idle_enter;
20 unsigned long long idle_time; 19 unsigned long long idle_time;
@@ -22,12 +21,12 @@ struct s390_idle_data {
22 21
23DECLARE_PER_CPU(struct s390_idle_data, s390_idle); 22DECLARE_PER_CPU(struct s390_idle_data, s390_idle);
24 23
25void s390_idle_leave(void); 24void vtime_start_cpu(void);
26 25
27static inline void s390_idle_check(void) 26static inline void s390_idle_check(void)
28{ 27{
29 if ((&__get_cpu_var(s390_idle))->in_idle) 28 if ((&__get_cpu_var(s390_idle))->idle_enter != 0ULL)
30 s390_idle_leave(); 29 vtime_start_cpu();
31} 30}
32 31
33#endif /* _ASM_S390_CPU_H_ */ 32#endif /* _ASM_S390_CPU_H_ */
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h
index 133ce054fc89..521726430afa 100644
--- a/arch/s390/include/asm/cputime.h
+++ b/arch/s390/include/asm/cputime.h
@@ -11,7 +11,7 @@
11 11
12#include <asm/div64.h> 12#include <asm/div64.h>
13 13
14/* We want to use micro-second resolution. */ 14/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */
15 15
16typedef unsigned long long cputime_t; 16typedef unsigned long long cputime_t;
17typedef unsigned long long cputime64_t; 17typedef unsigned long long cputime64_t;
@@ -53,9 +53,9 @@ __div(unsigned long long n, unsigned int base)
53#define cputime_ge(__a, __b) ((__a) >= (__b)) 53#define cputime_ge(__a, __b) ((__a) >= (__b))
54#define cputime_lt(__a, __b) ((__a) < (__b)) 54#define cputime_lt(__a, __b) ((__a) < (__b))
55#define cputime_le(__a, __b) ((__a) <= (__b)) 55#define cputime_le(__a, __b) ((__a) <= (__b))
56#define cputime_to_jiffies(__ct) (__div((__ct), 1000000 / HZ)) 56#define cputime_to_jiffies(__ct) (__div((__ct), 4096000000ULL / HZ))
57#define cputime_to_scaled(__ct) (__ct) 57#define cputime_to_scaled(__ct) (__ct)
58#define jiffies_to_cputime(__hz) ((cputime_t)(__hz) * (1000000 / HZ)) 58#define jiffies_to_cputime(__hz) ((cputime_t)(__hz) * (4096000000ULL / HZ))
59 59
60#define cputime64_zero (0ULL) 60#define cputime64_zero (0ULL)
61#define cputime64_add(__a, __b) ((__a) + (__b)) 61#define cputime64_add(__a, __b) ((__a) + (__b))
@@ -64,7 +64,7 @@ __div(unsigned long long n, unsigned int base)
64static inline u64 64static inline u64
65cputime64_to_jiffies64(cputime64_t cputime) 65cputime64_to_jiffies64(cputime64_t cputime)
66{ 66{
67 do_div(cputime, 1000000 / HZ); 67 do_div(cputime, 4096000000ULL / HZ);
68 return cputime; 68 return cputime;
69} 69}
70 70
@@ -74,13 +74,13 @@ cputime64_to_jiffies64(cputime64_t cputime)
74static inline unsigned int 74static inline unsigned int
75cputime_to_msecs(const cputime_t cputime) 75cputime_to_msecs(const cputime_t cputime)
76{ 76{
77 return __div(cputime, 1000); 77 return __div(cputime, 4096000);
78} 78}
79 79
80static inline cputime_t 80static inline cputime_t
81msecs_to_cputime(const unsigned int m) 81msecs_to_cputime(const unsigned int m)
82{ 82{
83 return (cputime_t) m * 1000; 83 return (cputime_t) m * 4096000;
84} 84}
85 85
86/* 86/*
@@ -89,13 +89,13 @@ msecs_to_cputime(const unsigned int m)
89static inline unsigned int 89static inline unsigned int
90cputime_to_secs(const cputime_t cputime) 90cputime_to_secs(const cputime_t cputime)
91{ 91{
92 return __div(cputime, 1000000); 92 return __div(cputime, 2048000000) >> 1;
93} 93}
94 94
95static inline cputime_t 95static inline cputime_t
96secs_to_cputime(const unsigned int s) 96secs_to_cputime(const unsigned int s)
97{ 97{
98 return (cputime_t) s * 1000000; 98 return (cputime_t) s * 4096000000ULL;
99} 99}
100 100
101/* 101/*
@@ -104,7 +104,7 @@ secs_to_cputime(const unsigned int s)
104static inline cputime_t 104static inline cputime_t
105timespec_to_cputime(const struct timespec *value) 105timespec_to_cputime(const struct timespec *value)
106{ 106{
107 return value->tv_nsec / 1000 + (u64) value->tv_sec * 1000000; 107 return value->tv_nsec * 4096 / 1000 + (u64) value->tv_sec * 4096000000ULL;
108} 108}
109 109
110static inline void 110static inline void
@@ -114,12 +114,12 @@ cputime_to_timespec(const cputime_t cputime, struct timespec *value)
114 register_pair rp; 114 register_pair rp;
115 115
116 rp.pair = cputime >> 1; 116 rp.pair = cputime >> 1;
117 asm ("dr %0,%1" : "+d" (rp) : "d" (1000000 >> 1)); 117 asm ("dr %0,%1" : "+d" (rp) : "d" (2048000000UL));
118 value->tv_nsec = rp.subreg.even * 1000; 118 value->tv_nsec = rp.subreg.even * 1000 / 4096;
119 value->tv_sec = rp.subreg.odd; 119 value->tv_sec = rp.subreg.odd;
120#else 120#else
121 value->tv_nsec = (cputime % 1000000) * 1000; 121 value->tv_nsec = (cputime % 4096000000ULL) * 1000 / 4096;
122 value->tv_sec = cputime / 1000000; 122 value->tv_sec = cputime / 4096000000ULL;
123#endif 123#endif
124} 124}
125 125
@@ -131,7 +131,7 @@ cputime_to_timespec(const cputime_t cputime, struct timespec *value)
131static inline cputime_t 131static inline cputime_t
132timeval_to_cputime(const struct timeval *value) 132timeval_to_cputime(const struct timeval *value)
133{ 133{
134 return value->tv_usec + (u64) value->tv_sec * 1000000; 134 return value->tv_usec * 4096 + (u64) value->tv_sec * 4096000000ULL;
135} 135}
136 136
137static inline void 137static inline void
@@ -141,12 +141,12 @@ cputime_to_timeval(const cputime_t cputime, struct timeval *value)
141 register_pair rp; 141 register_pair rp;
142 142
143 rp.pair = cputime >> 1; 143 rp.pair = cputime >> 1;
144 asm ("dr %0,%1" : "+d" (rp) : "d" (1000000 >> 1)); 144 asm ("dr %0,%1" : "+d" (rp) : "d" (2048000000UL));
145 value->tv_usec = rp.subreg.even; 145 value->tv_usec = rp.subreg.even / 4096;
146 value->tv_sec = rp.subreg.odd; 146 value->tv_sec = rp.subreg.odd;
147#else 147#else
148 value->tv_usec = cputime % 1000000; 148 value->tv_usec = cputime % 4096000000ULL;
149 value->tv_sec = cputime / 1000000; 149 value->tv_sec = cputime / 4096000000ULL;
150#endif 150#endif
151} 151}
152 152
@@ -156,13 +156,13 @@ cputime_to_timeval(const cputime_t cputime, struct timeval *value)
156static inline clock_t 156static inline clock_t
157cputime_to_clock_t(cputime_t cputime) 157cputime_to_clock_t(cputime_t cputime)
158{ 158{
159 return __div(cputime, 1000000 / USER_HZ); 159 return __div(cputime, 4096000000ULL / USER_HZ);
160} 160}
161 161
162static inline cputime_t 162static inline cputime_t
163clock_t_to_cputime(unsigned long x) 163clock_t_to_cputime(unsigned long x)
164{ 164{
165 return (cputime_t) x * (1000000 / USER_HZ); 165 return (cputime_t) x * (4096000000ULL / USER_HZ);
166} 166}
167 167
168/* 168/*
@@ -171,7 +171,7 @@ clock_t_to_cputime(unsigned long x)
171static inline clock_t 171static inline clock_t
172cputime64_to_clock_t(cputime64_t cputime) 172cputime64_to_clock_t(cputime64_t cputime)
173{ 173{
174 return __div(cputime, 1000000 / USER_HZ); 174 return __div(cputime, 4096000000ULL / USER_HZ);
175} 175}
176 176
177#endif /* _S390_CPUTIME_H */ 177#endif /* _S390_CPUTIME_H */
diff --git a/arch/s390/include/asm/dasd.h b/arch/s390/include/asm/dasd.h
index 55b2b80cdf6e..e2db6f16d9c8 100644
--- a/arch/s390/include/asm/dasd.h
+++ b/arch/s390/include/asm/dasd.h
@@ -14,6 +14,7 @@
14 14
15#ifndef DASD_H 15#ifndef DASD_H
16#define DASD_H 16#define DASD_H
17#include <linux/types.h>
17#include <linux/ioctl.h> 18#include <linux/ioctl.h>
18 19
19#define DASD_IOCTL_LETTER 'D' 20#define DASD_IOCTL_LETTER 'D'
@@ -78,6 +79,7 @@ typedef struct dasd_information2_t {
78#define DASD_FEATURE_USEDIAG 0x02 79#define DASD_FEATURE_USEDIAG 0x02
79#define DASD_FEATURE_INITIAL_ONLINE 0x04 80#define DASD_FEATURE_INITIAL_ONLINE 0x04
80#define DASD_FEATURE_ERPLOG 0x08 81#define DASD_FEATURE_ERPLOG 0x08
82#define DASD_FEATURE_FAILFAST 0x10
81 83
82#define DASD_PARTN_BITS 2 84#define DASD_PARTN_BITS 2
83 85
diff --git a/arch/s390/include/asm/kvm.h b/arch/s390/include/asm/kvm.h
index d74002f95794..e1f54654e3ae 100644
--- a/arch/s390/include/asm/kvm.h
+++ b/arch/s390/include/asm/kvm.h
@@ -13,7 +13,7 @@
13 * Author(s): Carsten Otte <cotte@de.ibm.com> 13 * Author(s): Carsten Otte <cotte@de.ibm.com>
14 * Christian Borntraeger <borntraeger@de.ibm.com> 14 * Christian Borntraeger <borntraeger@de.ibm.com>
15 */ 15 */
16#include <asm/types.h> 16#include <linux/types.h>
17 17
18/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */ 18/* for KVM_GET_IRQCHIP and KVM_SET_IRQCHIP */
19struct kvm_pic_state { 19struct kvm_pic_state {
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h
index 0bc51d52a899..ffdef5fe8587 100644
--- a/arch/s390/include/asm/lowcore.h
+++ b/arch/s390/include/asm/lowcore.h
@@ -67,11 +67,11 @@
67#define __LC_SYNC_ENTER_TIMER 0x248 67#define __LC_SYNC_ENTER_TIMER 0x248
68#define __LC_ASYNC_ENTER_TIMER 0x250 68#define __LC_ASYNC_ENTER_TIMER 0x250
69#define __LC_EXIT_TIMER 0x258 69#define __LC_EXIT_TIMER 0x258
70#define __LC_LAST_UPDATE_TIMER 0x260 70#define __LC_USER_TIMER 0x260
71#define __LC_USER_TIMER 0x268 71#define __LC_SYSTEM_TIMER 0x268
72#define __LC_SYSTEM_TIMER 0x270 72#define __LC_STEAL_TIMER 0x270
73#define __LC_LAST_UPDATE_CLOCK 0x278 73#define __LC_LAST_UPDATE_TIMER 0x278
74#define __LC_STEAL_CLOCK 0x280 74#define __LC_LAST_UPDATE_CLOCK 0x280
75#define __LC_RETURN_MCCK_PSW 0x288 75#define __LC_RETURN_MCCK_PSW 0x288
76#define __LC_KERNEL_STACK 0xC40 76#define __LC_KERNEL_STACK 0xC40
77#define __LC_THREAD_INFO 0xC44 77#define __LC_THREAD_INFO 0xC44
@@ -89,11 +89,11 @@
89#define __LC_SYNC_ENTER_TIMER 0x250 89#define __LC_SYNC_ENTER_TIMER 0x250
90#define __LC_ASYNC_ENTER_TIMER 0x258 90#define __LC_ASYNC_ENTER_TIMER 0x258
91#define __LC_EXIT_TIMER 0x260 91#define __LC_EXIT_TIMER 0x260
92#define __LC_LAST_UPDATE_TIMER 0x268 92#define __LC_USER_TIMER 0x268
93#define __LC_USER_TIMER 0x270 93#define __LC_SYSTEM_TIMER 0x270
94#define __LC_SYSTEM_TIMER 0x278 94#define __LC_STEAL_TIMER 0x278
95#define __LC_LAST_UPDATE_CLOCK 0x280 95#define __LC_LAST_UPDATE_TIMER 0x280
96#define __LC_STEAL_CLOCK 0x288 96#define __LC_LAST_UPDATE_CLOCK 0x288
97#define __LC_RETURN_MCCK_PSW 0x290 97#define __LC_RETURN_MCCK_PSW 0x290
98#define __LC_KERNEL_STACK 0xD40 98#define __LC_KERNEL_STACK 0xD40
99#define __LC_THREAD_INFO 0xD48 99#define __LC_THREAD_INFO 0xD48
@@ -106,8 +106,10 @@
106#define __LC_IPLDEV 0xDB8 106#define __LC_IPLDEV 0xDB8
107#define __LC_CURRENT 0xDD8 107#define __LC_CURRENT 0xDD8
108#define __LC_INT_CLOCK 0xDE8 108#define __LC_INT_CLOCK 0xDE8
109#define __LC_VDSO_PER_CPU 0xE38
109#endif /* __s390x__ */ 110#endif /* __s390x__ */
110 111
112#define __LC_PASTE 0xE40
111 113
112#define __LC_PANIC_MAGIC 0xE00 114#define __LC_PANIC_MAGIC 0xE00
113#ifndef __s390x__ 115#ifndef __s390x__
@@ -252,11 +254,11 @@ struct _lowcore
252 __u64 sync_enter_timer; /* 0x248 */ 254 __u64 sync_enter_timer; /* 0x248 */
253 __u64 async_enter_timer; /* 0x250 */ 255 __u64 async_enter_timer; /* 0x250 */
254 __u64 exit_timer; /* 0x258 */ 256 __u64 exit_timer; /* 0x258 */
255 __u64 last_update_timer; /* 0x260 */ 257 __u64 user_timer; /* 0x260 */
256 __u64 user_timer; /* 0x268 */ 258 __u64 system_timer; /* 0x268 */
257 __u64 system_timer; /* 0x270 */ 259 __u64 steal_timer; /* 0x270 */
258 __u64 last_update_clock; /* 0x278 */ 260 __u64 last_update_timer; /* 0x278 */
259 __u64 steal_clock; /* 0x280 */ 261 __u64 last_update_clock; /* 0x280 */
260 psw_t return_mcck_psw; /* 0x288 */ 262 psw_t return_mcck_psw; /* 0x288 */
261 __u8 pad8[0xc00-0x290]; /* 0x290 */ 263 __u8 pad8[0xc00-0x290]; /* 0x290 */
262 264
@@ -343,11 +345,11 @@ struct _lowcore
343 __u64 sync_enter_timer; /* 0x250 */ 345 __u64 sync_enter_timer; /* 0x250 */
344 __u64 async_enter_timer; /* 0x258 */ 346 __u64 async_enter_timer; /* 0x258 */
345 __u64 exit_timer; /* 0x260 */ 347 __u64 exit_timer; /* 0x260 */
346 __u64 last_update_timer; /* 0x268 */ 348 __u64 user_timer; /* 0x268 */
347 __u64 user_timer; /* 0x270 */ 349 __u64 system_timer; /* 0x270 */
348 __u64 system_timer; /* 0x278 */ 350 __u64 steal_timer; /* 0x278 */
349 __u64 last_update_clock; /* 0x280 */ 351 __u64 last_update_timer; /* 0x280 */
350 __u64 steal_clock; /* 0x288 */ 352 __u64 last_update_clock; /* 0x288 */
351 psw_t return_mcck_psw; /* 0x290 */ 353 psw_t return_mcck_psw; /* 0x290 */
352 __u8 pad8[0xc00-0x2a0]; /* 0x2a0 */ 354 __u8 pad8[0xc00-0x2a0]; /* 0x2a0 */
353 /* System info area */ 355 /* System info area */
@@ -381,7 +383,12 @@ struct _lowcore
381 /* whether the kernel died with panic() or not */ 383 /* whether the kernel died with panic() or not */
382 __u32 panic_magic; /* 0xe00 */ 384 __u32 panic_magic; /* 0xe00 */
383 385
384 __u8 pad13[0x11b8-0xe04]; /* 0xe04 */ 386 /* Per cpu primary space access list */
387 __u8 pad_0xe04[0xe3c-0xe04]; /* 0xe04 */
388 __u32 vdso_per_cpu_data; /* 0xe3c */
389 __u32 paste[16]; /* 0xe40 */
390
391 __u8 pad13[0x11b8-0xe80]; /* 0xe80 */
385 392
386 /* 64 bit extparam used for pfault, diag 250 etc */ 393 /* 64 bit extparam used for pfault, diag 250 etc */
387 __u64 ext_params2; /* 0x11B8 */ 394 __u64 ext_params2; /* 0x11B8 */
diff --git a/arch/s390/include/asm/posix_types.h b/arch/s390/include/asm/posix_types.h
index 397d93fba3a7..8cc113f92523 100644
--- a/arch/s390/include/asm/posix_types.h
+++ b/arch/s390/include/asm/posix_types.h
@@ -68,11 +68,7 @@ typedef unsigned short __kernel_old_dev_t;
68#endif /* __s390x__ */ 68#endif /* __s390x__ */
69 69
70typedef struct { 70typedef struct {
71#if defined(__KERNEL__) || defined(__USE_ALL)
72 int val[2]; 71 int val[2];
73#else /* !defined(__KERNEL__) && !defined(__USE_ALL)*/
74 int __val[2];
75#endif /* !defined(__KERNEL__) && !defined(__USE_ALL)*/
76} __kernel_fsid_t; 72} __kernel_fsid_t;
77 73
78 74
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h
index 5396f9f12263..8920025c3c02 100644
--- a/arch/s390/include/asm/ptrace.h
+++ b/arch/s390/include/asm/ptrace.h
@@ -272,12 +272,15 @@ typedef struct
272#define PSW_ASC_SECONDARY 0x0000800000000000UL 272#define PSW_ASC_SECONDARY 0x0000800000000000UL
273#define PSW_ASC_HOME 0x0000C00000000000UL 273#define PSW_ASC_HOME 0x0000C00000000000UL
274 274
275extern long psw_user32_bits;
276
277#endif /* __s390x__ */ 275#endif /* __s390x__ */
278 276
277#ifdef __KERNEL__
279extern long psw_kernel_bits; 278extern long psw_kernel_bits;
280extern long psw_user_bits; 279extern long psw_user_bits;
280#ifdef CONFIG_64BIT
281extern long psw_user32_bits;
282#endif
283#endif
281 284
282/* This macro merges a NEW PSW mask specified by the user into 285/* This macro merges a NEW PSW mask specified by the user into
283 the currently active PSW mask CURRENT, modifying only those 286 the currently active PSW mask CURRENT, modifying only those
diff --git a/arch/s390/include/asm/qeth.h b/arch/s390/include/asm/qeth.h
index 930d378ef75a..06cbd1e8c943 100644
--- a/arch/s390/include/asm/qeth.h
+++ b/arch/s390/include/asm/qeth.h
@@ -10,6 +10,7 @@
10 */ 10 */
11#ifndef __ASM_S390_QETH_IOCTL_H__ 11#ifndef __ASM_S390_QETH_IOCTL_H__
12#define __ASM_S390_QETH_IOCTL_H__ 12#define __ASM_S390_QETH_IOCTL_H__
13#include <linux/types.h>
13#include <linux/ioctl.h> 14#include <linux/ioctl.h>
14 15
15#define SIOC_QETH_ARP_SET_NO_ENTRIES (SIOCDEVPRIVATE) 16#define SIOC_QETH_ARP_SET_NO_ENTRIES (SIOCDEVPRIVATE)
diff --git a/arch/s390/include/asm/s390_rdev.h b/arch/s390/include/asm/s390_rdev.h
deleted file mode 100644
index 6fa20442a48c..000000000000
--- a/arch/s390/include/asm/s390_rdev.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/*
2 * include/asm-s390/ccwdev.h
3 *
4 * Copyright (C) 2002,2005 IBM Deutschland Entwicklung GmbH, IBM Corporation
5 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
6 * Carsten Otte <cotte@de.ibm.com>
7 *
8 * Interface for s390 root device
9 */
10
11#ifndef _S390_RDEV_H_
12#define _S390_RDEV_H_
13extern struct device *s390_root_dev_register(const char *);
14extern void s390_root_dev_unregister(struct device *);
15#endif /* _S390_RDEV_H_ */
diff --git a/arch/s390/include/asm/schid.h b/arch/s390/include/asm/schid.h
index 825503cf3dc2..3e4d401b4e45 100644
--- a/arch/s390/include/asm/schid.h
+++ b/arch/s390/include/asm/schid.h
@@ -1,6 +1,8 @@
1#ifndef ASM_SCHID_H 1#ifndef ASM_SCHID_H
2#define ASM_SCHID_H 2#define ASM_SCHID_H
3 3
4#include <linux/types.h>
5
4struct subchannel_id { 6struct subchannel_id {
5 __u32 cssid : 8; 7 __u32 cssid : 8;
6 __u32 : 4; 8 __u32 : 4;
diff --git a/arch/s390/include/asm/swab.h b/arch/s390/include/asm/swab.h
new file mode 100644
index 000000000000..eb18dc1f327b
--- /dev/null
+++ b/arch/s390/include/asm/swab.h
@@ -0,0 +1,91 @@
1#ifndef _S390_SWAB_H
2#define _S390_SWAB_H
3
4/*
5 * include/asm-s390/swab.h
6 *
7 * S390 version
8 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
9 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
10 */
11
12#include <linux/types.h>
13
14#ifndef __s390x__
15# define __SWAB_64_THRU_32__
16#endif
17
18#ifdef __s390x__
19static inline __u64 __arch_swab64p(const __u64 *x)
20{
21 __u64 result;
22
23 asm volatile("lrvg %0,%1" : "=d" (result) : "m" (*x));
24 return result;
25}
26#define __arch_swab64p __arch_swab64p
27
28static inline __u64 __arch_swab64(__u64 x)
29{
30 __u64 result;
31
32 asm volatile("lrvgr %0,%1" : "=d" (result) : "d" (x));
33 return result;
34}
35#define __arch_swab64 __arch_swab64
36
37static inline void __arch_swab64s(__u64 *x)
38{
39 *x = __arch_swab64p(x);
40}
41#define __arch_swab64s __arch_swab64s
42#endif /* __s390x__ */
43
44static inline __u32 __arch_swab32p(const __u32 *x)
45{
46 __u32 result;
47
48 asm volatile(
49#ifndef __s390x__
50 " icm %0,8,3(%1)\n"
51 " icm %0,4,2(%1)\n"
52 " icm %0,2,1(%1)\n"
53 " ic %0,0(%1)"
54 : "=&d" (result) : "a" (x), "m" (*x) : "cc");
55#else /* __s390x__ */
56 " lrv %0,%1"
57 : "=d" (result) : "m" (*x));
58#endif /* __s390x__ */
59 return result;
60}
61#define __arch_swab32p __arch_swab32p
62
63#ifdef __s390x__
64static inline __u32 __arch_swab32(__u32 x)
65{
66 __u32 result;
67
68 asm volatile("lrvr %0,%1" : "=d" (result) : "d" (x));
69 return result;
70}
71#define __arch_swab32 __arch_swab32
72#endif /* __s390x__ */
73
74static inline __u16 __arch_swab16p(const __u16 *x)
75{
76 __u16 result;
77
78 asm volatile(
79#ifndef __s390x__
80 " icm %0,2,1(%1)\n"
81 " ic %0,0(%1)\n"
82 : "=&d" (result) : "a" (x), "m" (*x) : "cc");
83#else /* __s390x__ */
84 " lrvh %0,%1"
85 : "=d" (result) : "m" (*x));
86#endif /* __s390x__ */
87 return result;
88}
89#define __arch_swab16p __arch_swab16p
90
91#endif /* _S390_SWAB_H */
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h
index 024ef42ed6d7..3a8b26eb1f2e 100644
--- a/arch/s390/include/asm/system.h
+++ b/arch/s390/include/asm/system.h
@@ -99,7 +99,7 @@ static inline void restore_access_regs(unsigned int *acrs)
99 prev = __switch_to(prev,next); \ 99 prev = __switch_to(prev,next); \
100} while (0) 100} while (0)
101 101
102extern void account_vtime(struct task_struct *); 102extern void account_vtime(struct task_struct *, struct task_struct *);
103extern void account_tick_vtime(struct task_struct *); 103extern void account_tick_vtime(struct task_struct *);
104extern void account_system_vtime(struct task_struct *); 104extern void account_system_vtime(struct task_struct *);
105 105
@@ -121,7 +121,7 @@ static inline void cmma_init(void) { }
121 121
122#define finish_arch_switch(prev) do { \ 122#define finish_arch_switch(prev) do { \
123 set_fs(current->thread.mm_segment); \ 123 set_fs(current->thread.mm_segment); \
124 account_vtime(prev); \ 124 account_vtime(prev, current); \
125} while (0) 125} while (0)
126 126
127#define nop() asm volatile("nop") 127#define nop() asm volatile("nop")
diff --git a/arch/s390/include/asm/thread_info.h b/arch/s390/include/asm/thread_info.h
index c1eaf9604da7..c544aa524535 100644
--- a/arch/s390/include/asm/thread_info.h
+++ b/arch/s390/include/asm/thread_info.h
@@ -47,6 +47,8 @@ struct thread_info {
47 unsigned int cpu; /* current CPU */ 47 unsigned int cpu; /* current CPU */
48 int preempt_count; /* 0 => preemptable, <0 => BUG */ 48 int preempt_count; /* 0 => preemptable, <0 => BUG */
49 struct restart_block restart_block; 49 struct restart_block restart_block;
50 __u64 user_timer;
51 __u64 system_timer;
50}; 52};
51 53
52/* 54/*
diff --git a/arch/s390/include/asm/timer.h b/arch/s390/include/asm/timer.h
index 61705d60f995..e4bcab739c19 100644
--- a/arch/s390/include/asm/timer.h
+++ b/arch/s390/include/asm/timer.h
@@ -23,20 +23,18 @@ struct vtimer_list {
23 __u64 expires; 23 __u64 expires;
24 __u64 interval; 24 __u64 interval;
25 25
26 spinlock_t lock;
27 unsigned long magic;
28
29 void (*function)(unsigned long); 26 void (*function)(unsigned long);
30 unsigned long data; 27 unsigned long data;
31}; 28};
32 29
33/* the offset value will wrap after ca. 71 years */ 30/* the vtimer value will wrap after ca. 71 years */
34struct vtimer_queue { 31struct vtimer_queue {
35 struct list_head list; 32 struct list_head list;
36 spinlock_t lock; 33 spinlock_t lock;
37 __u64 to_expire; /* current event expire time */ 34 __u64 timer; /* last programmed timer */
38 __u64 offset; /* list offset to zero */ 35 __u64 elapsed; /* elapsed time of timer expire values */
39 __u64 idle; /* temp var for idle */ 36 __u64 idle; /* temp var for idle */
37 int do_spt; /* =1: reprogram cpu timer in idle */
40}; 38};
41 39
42extern void init_virt_timer(struct vtimer_list *timer); 40extern void init_virt_timer(struct vtimer_list *timer);
@@ -48,8 +46,8 @@ extern int del_virt_timer(struct vtimer_list *timer);
48extern void init_cpu_vtimer(void); 46extern void init_cpu_vtimer(void);
49extern void vtime_init(void); 47extern void vtime_init(void);
50 48
51extern void vtime_start_cpu_timer(void); 49extern void vtime_stop_cpu(void);
52extern void vtime_stop_cpu_timer(void); 50extern void vtime_start_leave(void);
53 51
54#endif /* __KERNEL__ */ 52#endif /* __KERNEL__ */
55 53
diff --git a/arch/s390/include/asm/topology.h b/arch/s390/include/asm/topology.h
index d96c91643458..c93eb50e1d09 100644
--- a/arch/s390/include/asm/topology.h
+++ b/arch/s390/include/asm/topology.h
@@ -6,10 +6,12 @@
6#define mc_capable() (1) 6#define mc_capable() (1)
7 7
8cpumask_t cpu_coregroup_map(unsigned int cpu); 8cpumask_t cpu_coregroup_map(unsigned int cpu);
9const struct cpumask *cpu_coregroup_mask(unsigned int cpu);
9 10
10extern cpumask_t cpu_core_map[NR_CPUS]; 11extern cpumask_t cpu_core_map[NR_CPUS];
11 12
12#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 13#define topology_core_siblings(cpu) (cpu_core_map[cpu])
14#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
13 15
14int topology_set_cpu_management(int fc); 16int topology_set_cpu_management(int fc);
15void topology_schedule_update(void); 17void topology_schedule_update(void);
diff --git a/arch/s390/include/asm/types.h b/arch/s390/include/asm/types.h
index 41c547656130..3dc3fc228812 100644
--- a/arch/s390/include/asm/types.h
+++ b/arch/s390/include/asm/types.h
@@ -9,11 +9,7 @@
9#ifndef _S390_TYPES_H 9#ifndef _S390_TYPES_H
10#define _S390_TYPES_H 10#define _S390_TYPES_H
11 11
12#ifndef __s390x__ 12#include <asm-generic/int-ll64.h>
13# include <asm-generic/int-ll64.h>
14#else
15# include <asm-generic/int-l64.h>
16#endif
17 13
18#ifndef __ASSEMBLY__ 14#ifndef __ASSEMBLY__
19 15
diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h
index a44f4fe16a35..7bdd7c8ebc91 100644
--- a/arch/s390/include/asm/vdso.h
+++ b/arch/s390/include/asm/vdso.h
@@ -12,9 +12,9 @@
12#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
13 13
14/* 14/*
15 * Note about this structure: 15 * Note about the vdso_data and vdso_per_cpu_data structures:
16 * 16 *
17 * NEVER USE THIS IN USERSPACE CODE DIRECTLY. The layout of this 17 * NEVER USE THEM IN USERSPACE CODE DIRECTLY. The layout of the
18 * structure is supposed to be known only to the function in the vdso 18 * structure is supposed to be known only to the function in the vdso
19 * itself and may change without notice. 19 * itself and may change without notice.
20 */ 20 */
@@ -28,10 +28,21 @@ struct vdso_data {
28 __u64 wtom_clock_nsec; /* 0x28 */ 28 __u64 wtom_clock_nsec; /* 0x28 */
29 __u32 tz_minuteswest; /* Minutes west of Greenwich 0x30 */ 29 __u32 tz_minuteswest; /* Minutes west of Greenwich 0x30 */
30 __u32 tz_dsttime; /* Type of dst correction 0x34 */ 30 __u32 tz_dsttime; /* Type of dst correction 0x34 */
31 __u32 ectg_available;
32};
33
34struct vdso_per_cpu_data {
35 __u64 ectg_timer_base;
36 __u64 ectg_user_time;
31}; 37};
32 38
33extern struct vdso_data *vdso_data; 39extern struct vdso_data *vdso_data;
34 40
41#ifdef CONFIG_64BIT
42int vdso_alloc_per_cpu(int cpu, struct _lowcore *lowcore);
43void vdso_free_per_cpu(int cpu, struct _lowcore *lowcore);
44#endif
45
35#endif /* __ASSEMBLY__ */ 46#endif /* __ASSEMBLY__ */
36 47
37#endif /* __KERNEL__ */ 48#endif /* __KERNEL__ */
diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index e641f60bac99..67a60016babb 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -48,6 +48,11 @@ int main(void)
48 DEFINE(__VDSO_WTOM_SEC, offsetof(struct vdso_data, wtom_clock_sec)); 48 DEFINE(__VDSO_WTOM_SEC, offsetof(struct vdso_data, wtom_clock_sec));
49 DEFINE(__VDSO_WTOM_NSEC, offsetof(struct vdso_data, wtom_clock_nsec)); 49 DEFINE(__VDSO_WTOM_NSEC, offsetof(struct vdso_data, wtom_clock_nsec));
50 DEFINE(__VDSO_TIMEZONE, offsetof(struct vdso_data, tz_minuteswest)); 50 DEFINE(__VDSO_TIMEZONE, offsetof(struct vdso_data, tz_minuteswest));
51 DEFINE(__VDSO_ECTG_OK, offsetof(struct vdso_data, ectg_available));
52 DEFINE(__VDSO_ECTG_BASE,
53 offsetof(struct vdso_per_cpu_data, ectg_timer_base));
54 DEFINE(__VDSO_ECTG_USER,
55 offsetof(struct vdso_per_cpu_data, ectg_user_time));
51 /* constants used by the vdso */ 56 /* constants used by the vdso */
52 DEFINE(CLOCK_REALTIME, CLOCK_REALTIME); 57 DEFINE(CLOCK_REALTIME, CLOCK_REALTIME);
53 DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC); 58 DEFINE(CLOCK_MONOTONIC, CLOCK_MONOTONIC);
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index 55de521aef77..1268aa2991bf 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -583,8 +583,8 @@ kernel_per:
583 583
584 .globl io_int_handler 584 .globl io_int_handler
585io_int_handler: 585io_int_handler:
586 stpt __LC_ASYNC_ENTER_TIMER
587 stck __LC_INT_CLOCK 586 stck __LC_INT_CLOCK
587 stpt __LC_ASYNC_ENTER_TIMER
588 SAVE_ALL_BASE __LC_SAVE_AREA+16 588 SAVE_ALL_BASE __LC_SAVE_AREA+16
589 SAVE_ALL_ASYNC __LC_IO_OLD_PSW,__LC_SAVE_AREA+16 589 SAVE_ALL_ASYNC __LC_IO_OLD_PSW,__LC_SAVE_AREA+16
590 CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+16 590 CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+16
@@ -723,8 +723,8 @@ io_notify_resume:
723 723
724 .globl ext_int_handler 724 .globl ext_int_handler
725ext_int_handler: 725ext_int_handler:
726 stpt __LC_ASYNC_ENTER_TIMER
727 stck __LC_INT_CLOCK 726 stck __LC_INT_CLOCK
727 stpt __LC_ASYNC_ENTER_TIMER
728 SAVE_ALL_BASE __LC_SAVE_AREA+16 728 SAVE_ALL_BASE __LC_SAVE_AREA+16
729 SAVE_ALL_ASYNC __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16 729 SAVE_ALL_ASYNC __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16
730 CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16 730 CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16
@@ -750,6 +750,7 @@ __critical_end:
750 750
751 .globl mcck_int_handler 751 .globl mcck_int_handler
752mcck_int_handler: 752mcck_int_handler:
753 stck __LC_INT_CLOCK
753 spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer 754 spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer
754 lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs 755 lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs
755 SAVE_ALL_BASE __LC_SAVE_AREA+32 756 SAVE_ALL_BASE __LC_SAVE_AREA+32
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h
index 6b1896345eda..a65afc91e8aa 100644
--- a/arch/s390/kernel/entry.h
+++ b/arch/s390/kernel/entry.h
@@ -54,7 +54,5 @@ long sys_sigreturn(void);
54long sys_rt_sigreturn(void); 54long sys_rt_sigreturn(void);
55long sys32_sigreturn(void); 55long sys32_sigreturn(void);
56long sys32_rt_sigreturn(void); 56long sys32_rt_sigreturn(void);
57long old_select(struct sel_arg_struct __user *arg);
58long sys_ptrace(long request, long pid, long addr, long data);
59 57
60#endif /* _ENTRY_H */ 58#endif /* _ENTRY_H */
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 16bb4fd1a403..c6fbde13971a 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -177,8 +177,11 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \
177 .if !\sync 177 .if !\sync
178 ni \psworg+1,0xfd # clear wait state bit 178 ni \psworg+1,0xfd # clear wait state bit
179 .endif 179 .endif
180 lmg %r0,%r15,SP_R0(%r15) # load gprs 0-15 of user 180 lg %r14,__LC_VDSO_PER_CPU
181 lmg %r0,%r13,SP_R0(%r15) # load gprs 0-13 of user
181 stpt __LC_EXIT_TIMER 182 stpt __LC_EXIT_TIMER
183 mvc __VDSO_ECTG_BASE(16,%r14),__LC_EXIT_TIMER
184 lmg %r14,%r15,SP_R14(%r15) # load grps 14-15 of user
182 lpswe \psworg # back to caller 185 lpswe \psworg # back to caller
183 .endm 186 .endm
184 187
@@ -559,8 +562,8 @@ kernel_per:
559 */ 562 */
560 .globl io_int_handler 563 .globl io_int_handler
561io_int_handler: 564io_int_handler:
562 stpt __LC_ASYNC_ENTER_TIMER
563 stck __LC_INT_CLOCK 565 stck __LC_INT_CLOCK
566 stpt __LC_ASYNC_ENTER_TIMER
564 SAVE_ALL_BASE __LC_SAVE_AREA+32 567 SAVE_ALL_BASE __LC_SAVE_AREA+32
565 SAVE_ALL_ASYNC __LC_IO_OLD_PSW,__LC_SAVE_AREA+32 568 SAVE_ALL_ASYNC __LC_IO_OLD_PSW,__LC_SAVE_AREA+32
566 CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+32 569 CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+32
@@ -721,8 +724,8 @@ io_notify_resume:
721 */ 724 */
722 .globl ext_int_handler 725 .globl ext_int_handler
723ext_int_handler: 726ext_int_handler:
724 stpt __LC_ASYNC_ENTER_TIMER
725 stck __LC_INT_CLOCK 727 stck __LC_INT_CLOCK
728 stpt __LC_ASYNC_ENTER_TIMER
726 SAVE_ALL_BASE __LC_SAVE_AREA+32 729 SAVE_ALL_BASE __LC_SAVE_AREA+32
727 SAVE_ALL_ASYNC __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32 730 SAVE_ALL_ASYNC __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32
728 CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32 731 CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32
@@ -746,6 +749,7 @@ __critical_end:
746 */ 749 */
747 .globl mcck_int_handler 750 .globl mcck_int_handler
748mcck_int_handler: 751mcck_int_handler:
752 stck __LC_INT_CLOCK
749 la %r1,4095 # revalidate r1 753 la %r1,4095 # revalidate r1
750 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer 754 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer
751 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs 755 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs
@@ -979,23 +983,23 @@ cleanup_sysc_return:
979 983
980cleanup_sysc_leave: 984cleanup_sysc_leave:
981 clc 8(8,%r12),BASED(cleanup_sysc_leave_insn) 985 clc 8(8,%r12),BASED(cleanup_sysc_leave_insn)
982 je 2f 986 je 3f
983 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
984 clc 8(8,%r12),BASED(cleanup_sysc_leave_insn+8) 987 clc 8(8,%r12),BASED(cleanup_sysc_leave_insn+8)
985 je 2f 988 jhe 0f
986 mvc __LC_RETURN_PSW(16),SP_PSW(%r15) 989 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
9900: mvc __LC_RETURN_PSW(16),SP_PSW(%r15)
987 cghi %r12,__LC_MCK_OLD_PSW 991 cghi %r12,__LC_MCK_OLD_PSW
988 jne 0f 992 jne 1f
989 mvc __LC_SAVE_AREA+64(32),SP_R12(%r15) 993 mvc __LC_SAVE_AREA+64(32),SP_R12(%r15)
990 j 1f 994 j 2f
9910: mvc __LC_SAVE_AREA+32(32),SP_R12(%r15) 9951: mvc __LC_SAVE_AREA+32(32),SP_R12(%r15)
9921: lmg %r0,%r11,SP_R0(%r15) 9962: lmg %r0,%r11,SP_R0(%r15)
993 lg %r15,SP_R15(%r15) 997 lg %r15,SP_R15(%r15)
9942: la %r12,__LC_RETURN_PSW 9983: la %r12,__LC_RETURN_PSW
995 br %r14 999 br %r14
996cleanup_sysc_leave_insn: 1000cleanup_sysc_leave_insn:
997 .quad sysc_done - 4 1001 .quad sysc_done - 4
998 .quad sysc_done - 8 1002 .quad sysc_done - 16
999 1003
1000cleanup_io_return: 1004cleanup_io_return:
1001 mvc __LC_RETURN_PSW(8),0(%r12) 1005 mvc __LC_RETURN_PSW(8),0(%r12)
@@ -1005,23 +1009,23 @@ cleanup_io_return:
1005 1009
1006cleanup_io_leave: 1010cleanup_io_leave:
1007 clc 8(8,%r12),BASED(cleanup_io_leave_insn) 1011 clc 8(8,%r12),BASED(cleanup_io_leave_insn)
1008 je 2f 1012 je 3f
1009 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
1010 clc 8(8,%r12),BASED(cleanup_io_leave_insn+8) 1013 clc 8(8,%r12),BASED(cleanup_io_leave_insn+8)
1011 je 2f 1014 jhe 0f
1012 mvc __LC_RETURN_PSW(16),SP_PSW(%r15) 1015 mvc __LC_EXIT_TIMER(8),__LC_ASYNC_ENTER_TIMER
10160: mvc __LC_RETURN_PSW(16),SP_PSW(%r15)
1013 cghi %r12,__LC_MCK_OLD_PSW 1017 cghi %r12,__LC_MCK_OLD_PSW
1014 jne 0f 1018 jne 1f
1015 mvc __LC_SAVE_AREA+64(32),SP_R12(%r15) 1019 mvc __LC_SAVE_AREA+64(32),SP_R12(%r15)
1016 j 1f 1020 j 2f
10170: mvc __LC_SAVE_AREA+32(32),SP_R12(%r15) 10211: mvc __LC_SAVE_AREA+32(32),SP_R12(%r15)
10181: lmg %r0,%r11,SP_R0(%r15) 10222: lmg %r0,%r11,SP_R0(%r15)
1019 lg %r15,SP_R15(%r15) 1023 lg %r15,SP_R15(%r15)
10202: la %r12,__LC_RETURN_PSW 10243: la %r12,__LC_RETURN_PSW
1021 br %r14 1025 br %r14
1022cleanup_io_leave_insn: 1026cleanup_io_leave_insn:
1023 .quad io_done - 4 1027 .quad io_done - 4
1024 .quad io_done - 8 1028 .quad io_done - 16
1025 1029
1026/* 1030/*
1027 * Integer constants 1031 * Integer constants
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index 3ccd36b24b8f..f9f70aa15244 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -87,6 +87,8 @@ startup_continue:
87 lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area 87 lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
88 # move IPL device to lowcore 88 # move IPL device to lowcore
89 mvc __LC_IPLDEV(4),IPL_DEVICE+4-PARMAREA(%r12) 89 mvc __LC_IPLDEV(4),IPL_DEVICE+4-PARMAREA(%r12)
90 lghi %r0,__LC_PASTE
91 stg %r0,__LC_VDSO_PER_CPU
90# 92#
91# Setup stack 93# Setup stack
92# 94#
diff --git a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
index 569079ec4ff0..a01cf0284db2 100644
--- a/arch/s390/kernel/kprobes.c
+++ b/arch/s390/kernel/kprobes.c
@@ -218,9 +218,10 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
218 218
219void __kprobes arch_remove_kprobe(struct kprobe *p) 219void __kprobes arch_remove_kprobe(struct kprobe *p)
220{ 220{
221 mutex_lock(&kprobe_mutex); 221 if (p->ainsn.insn) {
222 free_insn_slot(p->ainsn.insn, 0); 222 free_insn_slot(p->ainsn.insn, 0);
223 mutex_unlock(&kprobe_mutex); 223 p->ainsn.insn = NULL;
224 }
224} 225}
225 226
226static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs) 227static void __kprobes prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
@@ -381,7 +382,7 @@ static int __kprobes trampoline_probe_handler(struct kprobe *p,
381 /* 382 /*
382 * It is possible to have multiple instances associated with a given 383 * It is possible to have multiple instances associated with a given
383 * task either because an multiple functions in the call path 384 * task either because an multiple functions in the call path
384 * have a return probe installed on them, and/or more then one return 385 * have a return probe installed on them, and/or more than one return
385 * return probe was registered for a target function. 386 * return probe was registered for a target function.
386 * 387 *
387 * We can handle this because: 388 * We can handle this because:
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 04f8c67a6101..b6110bdf8dc2 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -38,6 +38,7 @@
38#include <linux/utsname.h> 38#include <linux/utsname.h>
39#include <linux/tick.h> 39#include <linux/tick.h>
40#include <linux/elfcore.h> 40#include <linux/elfcore.h>
41#include <linux/kernel_stat.h>
41#include <asm/uaccess.h> 42#include <asm/uaccess.h>
42#include <asm/pgtable.h> 43#include <asm/pgtable.h>
43#include <asm/system.h> 44#include <asm/system.h>
@@ -45,7 +46,6 @@
45#include <asm/processor.h> 46#include <asm/processor.h>
46#include <asm/irq.h> 47#include <asm/irq.h>
47#include <asm/timer.h> 48#include <asm/timer.h>
48#include <asm/cpu.h>
49#include "entry.h" 49#include "entry.h"
50 50
51asmlinkage void ret_from_fork(void) asm ("ret_from_fork"); 51asmlinkage void ret_from_fork(void) asm ("ret_from_fork");
@@ -75,36 +75,6 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
75 return sf->gprs[8]; 75 return sf->gprs[8];
76} 76}
77 77
78DEFINE_PER_CPU(struct s390_idle_data, s390_idle) = {
79 .lock = __SPIN_LOCK_UNLOCKED(s390_idle.lock)
80};
81
82static int s390_idle_enter(void)
83{
84 struct s390_idle_data *idle;
85
86 idle = &__get_cpu_var(s390_idle);
87 spin_lock(&idle->lock);
88 idle->idle_count++;
89 idle->in_idle = 1;
90 idle->idle_enter = get_clock();
91 spin_unlock(&idle->lock);
92 vtime_stop_cpu_timer();
93 return NOTIFY_OK;
94}
95
96void s390_idle_leave(void)
97{
98 struct s390_idle_data *idle;
99
100 vtime_start_cpu_timer();
101 idle = &__get_cpu_var(s390_idle);
102 spin_lock(&idle->lock);
103 idle->idle_time += get_clock() - idle->idle_enter;
104 idle->in_idle = 0;
105 spin_unlock(&idle->lock);
106}
107
108extern void s390_handle_mcck(void); 78extern void s390_handle_mcck(void);
109/* 79/*
110 * The idle loop on a S390... 80 * The idle loop on a S390...
@@ -117,10 +87,6 @@ static void default_idle(void)
117 local_irq_enable(); 87 local_irq_enable();
118 return; 88 return;
119 } 89 }
120 if (s390_idle_enter() == NOTIFY_BAD) {
121 local_irq_enable();
122 return;
123 }
124#ifdef CONFIG_HOTPLUG_CPU 90#ifdef CONFIG_HOTPLUG_CPU
125 if (cpu_is_offline(smp_processor_id())) { 91 if (cpu_is_offline(smp_processor_id())) {
126 preempt_enable_no_resched(); 92 preempt_enable_no_resched();
@@ -130,7 +96,6 @@ static void default_idle(void)
130 local_mcck_disable(); 96 local_mcck_disable();
131 if (test_thread_flag(TIF_MCCK_PENDING)) { 97 if (test_thread_flag(TIF_MCCK_PENDING)) {
132 local_mcck_enable(); 98 local_mcck_enable();
133 s390_idle_leave();
134 local_irq_enable(); 99 local_irq_enable();
135 s390_handle_mcck(); 100 s390_handle_mcck();
136 return; 101 return;
@@ -138,9 +103,9 @@ static void default_idle(void)
138 trace_hardirqs_on(); 103 trace_hardirqs_on();
139 /* Don't trace preempt off for idle. */ 104 /* Don't trace preempt off for idle. */
140 stop_critical_timings(); 105 stop_critical_timings();
141 /* Wait for external, I/O or machine check interrupt. */ 106 /* Stop virtual timer and halt the cpu. */
142 __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT | 107 vtime_stop_cpu();
143 PSW_MASK_IO | PSW_MASK_EXT); 108 /* Reenable preemption tracer. */
144 start_critical_timings(); 109 start_critical_timings();
145} 110}
146 111
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c
index e019b419efc6..a0d2d55d7fb3 100644
--- a/arch/s390/kernel/s390_ext.c
+++ b/arch/s390/kernel/s390_ext.c
@@ -119,8 +119,8 @@ void do_extint(struct pt_regs *regs, unsigned short code)
119 struct pt_regs *old_regs; 119 struct pt_regs *old_regs;
120 120
121 old_regs = set_irq_regs(regs); 121 old_regs = set_irq_regs(regs);
122 irq_enter();
123 s390_idle_check(); 122 s390_idle_check();
123 irq_enter();
124 if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator) 124 if (S390_lowcore.int_clock >= S390_lowcore.clock_comparator)
125 /* Serve timer interrupts first. */ 125 /* Serve timer interrupts first. */
126 clock_comparator_work(); 126 clock_comparator_work();
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index b7a1efd5522c..d825f4950e4e 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -427,6 +427,8 @@ setup_lowcore(void)
427 /* enable extended save area */ 427 /* enable extended save area */
428 __ctl_set_bit(14, 29); 428 __ctl_set_bit(14, 29);
429 } 429 }
430#else
431 lc->vdso_per_cpu_data = (unsigned long) &lc->paste[0];
430#endif 432#endif
431 set_prefix((u32)(unsigned long) lc); 433 set_prefix((u32)(unsigned long) lc);
432} 434}
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 6fc78541dc57..2d337cbb9329 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -47,6 +47,7 @@
47#include <asm/lowcore.h> 47#include <asm/lowcore.h>
48#include <asm/sclp.h> 48#include <asm/sclp.h>
49#include <asm/cpu.h> 49#include <asm/cpu.h>
50#include <asm/vdso.h>
50#include "entry.h" 51#include "entry.h"
51 52
52/* 53/*
@@ -55,12 +56,6 @@
55struct _lowcore *lowcore_ptr[NR_CPUS]; 56struct _lowcore *lowcore_ptr[NR_CPUS];
56EXPORT_SYMBOL(lowcore_ptr); 57EXPORT_SYMBOL(lowcore_ptr);
57 58
58cpumask_t cpu_online_map = CPU_MASK_NONE;
59EXPORT_SYMBOL(cpu_online_map);
60
61cpumask_t cpu_possible_map = CPU_MASK_ALL;
62EXPORT_SYMBOL(cpu_possible_map);
63
64static struct task_struct *current_set[NR_CPUS]; 59static struct task_struct *current_set[NR_CPUS];
65 60
66static u8 smp_cpu_type; 61static u8 smp_cpu_type;
@@ -506,6 +501,9 @@ static int __cpuinit smp_alloc_lowcore(int cpu)
506 goto out; 501 goto out;
507 lowcore->extended_save_area_addr = (u32) save_area; 502 lowcore->extended_save_area_addr = (u32) save_area;
508 } 503 }
504#else
505 if (vdso_alloc_per_cpu(cpu, lowcore))
506 goto out;
509#endif 507#endif
510 lowcore_ptr[cpu] = lowcore; 508 lowcore_ptr[cpu] = lowcore;
511 return 0; 509 return 0;
@@ -528,6 +526,8 @@ static void smp_free_lowcore(int cpu)
528#ifndef CONFIG_64BIT 526#ifndef CONFIG_64BIT
529 if (MACHINE_HAS_IEEE) 527 if (MACHINE_HAS_IEEE)
530 free_page((unsigned long) lowcore->extended_save_area_addr); 528 free_page((unsigned long) lowcore->extended_save_area_addr);
529#else
530 vdso_free_per_cpu(cpu, lowcore);
531#endif 531#endif
532 free_page(lowcore->panic_stack - PAGE_SIZE); 532 free_page(lowcore->panic_stack - PAGE_SIZE);
533 free_pages(lowcore->async_stack - ASYNC_SIZE, ASYNC_ORDER); 533 free_pages(lowcore->async_stack - ASYNC_SIZE, ASYNC_ORDER);
@@ -670,6 +670,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
670 lowcore = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, lc_order); 670 lowcore = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, lc_order);
671 panic_stack = __get_free_page(GFP_KERNEL); 671 panic_stack = __get_free_page(GFP_KERNEL);
672 async_stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER); 672 async_stack = __get_free_pages(GFP_KERNEL, ASYNC_ORDER);
673 BUG_ON(!lowcore || !panic_stack || !async_stack);
673#ifndef CONFIG_64BIT 674#ifndef CONFIG_64BIT
674 if (MACHINE_HAS_IEEE) 675 if (MACHINE_HAS_IEEE)
675 save_area = get_zeroed_page(GFP_KERNEL); 676 save_area = get_zeroed_page(GFP_KERNEL);
@@ -683,6 +684,9 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
683#ifndef CONFIG_64BIT 684#ifndef CONFIG_64BIT
684 if (MACHINE_HAS_IEEE) 685 if (MACHINE_HAS_IEEE)
685 lowcore->extended_save_area_addr = (u32) save_area; 686 lowcore->extended_save_area_addr = (u32) save_area;
687#else
688 if (vdso_alloc_per_cpu(smp_processor_id(), lowcore))
689 BUG();
686#endif 690#endif
687 set_prefix((u32)(unsigned long) lowcore); 691 set_prefix((u32)(unsigned long) lowcore);
688 local_mcck_enable(); 692 local_mcck_enable();
@@ -851,9 +855,11 @@ static ssize_t show_idle_count(struct sys_device *dev,
851 unsigned long long idle_count; 855 unsigned long long idle_count;
852 856
853 idle = &per_cpu(s390_idle, dev->id); 857 idle = &per_cpu(s390_idle, dev->id);
854 spin_lock_irq(&idle->lock); 858 spin_lock(&idle->lock);
855 idle_count = idle->idle_count; 859 idle_count = idle->idle_count;
856 spin_unlock_irq(&idle->lock); 860 if (idle->idle_enter)
861 idle_count++;
862 spin_unlock(&idle->lock);
857 return sprintf(buf, "%llu\n", idle_count); 863 return sprintf(buf, "%llu\n", idle_count);
858} 864}
859static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL); 865static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL);
@@ -862,18 +868,17 @@ static ssize_t show_idle_time(struct sys_device *dev,
862 struct sysdev_attribute *attr, char *buf) 868 struct sysdev_attribute *attr, char *buf)
863{ 869{
864 struct s390_idle_data *idle; 870 struct s390_idle_data *idle;
865 unsigned long long new_time; 871 unsigned long long now, idle_time, idle_enter;
866 872
867 idle = &per_cpu(s390_idle, dev->id); 873 idle = &per_cpu(s390_idle, dev->id);
868 spin_lock_irq(&idle->lock); 874 spin_lock(&idle->lock);
869 if (idle->in_idle) { 875 now = get_clock();
870 new_time = get_clock(); 876 idle_time = idle->idle_time;
871 idle->idle_time += new_time - idle->idle_enter; 877 idle_enter = idle->idle_enter;
872 idle->idle_enter = new_time; 878 if (idle_enter != 0ULL && idle_enter < now)
873 } 879 idle_time += now - idle_enter;
874 new_time = idle->idle_time; 880 spin_unlock(&idle->lock);
875 spin_unlock_irq(&idle->lock); 881 return sprintf(buf, "%llu\n", idle_time >> 12);
876 return sprintf(buf, "%llu\n", new_time >> 12);
877} 882}
878static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL); 883static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL);
879 884
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c
index 4fe952e557ac..c34be4568b80 100644
--- a/arch/s390/kernel/sys_s390.c
+++ b/arch/s390/kernel/sys_s390.c
@@ -103,25 +103,6 @@ out:
103 return error; 103 return error;
104} 104}
105 105
106#ifndef CONFIG_64BIT
107struct sel_arg_struct {
108 unsigned long n;
109 fd_set __user *inp, *outp, *exp;
110 struct timeval __user *tvp;
111};
112
113asmlinkage long old_select(struct sel_arg_struct __user *arg)
114{
115 struct sel_arg_struct a;
116
117 if (copy_from_user(&a, arg, sizeof(a)))
118 return -EFAULT;
119 /* sys_select() does the appropriate kernel locking */
120 return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
121
122}
123#endif /* CONFIG_64BIT */
124
125/* 106/*
126 * sys_ipc() is the de-multiplexer for the SysV IPC calls.. 107 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
127 * 108 *
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 5be981a36c3e..d649600df5b9 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -160,7 +160,7 @@ void init_cpu_timer(void)
160 cd->min_delta_ns = 1; 160 cd->min_delta_ns = 1;
161 cd->max_delta_ns = LONG_MAX; 161 cd->max_delta_ns = LONG_MAX;
162 cd->rating = 400; 162 cd->rating = 400;
163 cd->cpumask = cpumask_of_cpu(cpu); 163 cd->cpumask = cpumask_of(cpu);
164 cd->set_next_event = s390_next_event; 164 cd->set_next_event = s390_next_event;
165 cd->set_mode = s390_set_mode; 165 cd->set_mode = s390_set_mode;
166 166
diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 90e9ba11eba1..cc362c9ea8f1 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -97,6 +97,11 @@ cpumask_t cpu_coregroup_map(unsigned int cpu)
97 return mask; 97 return mask;
98} 98}
99 99
100const struct cpumask *cpu_coregroup_mask(unsigned int cpu)
101{
102 return &cpu_core_map[cpu];
103}
104
100static void add_cpus_to_core(struct tl_cpu *tl_cpu, struct core_info *core) 105static void add_cpus_to_core(struct tl_cpu *tl_cpu, struct core_info *core)
101{ 106{
102 unsigned int cpu; 107 unsigned int cpu;
diff --git a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
index 10a6ccef4412..690e17819686 100644
--- a/arch/s390/kernel/vdso.c
+++ b/arch/s390/kernel/vdso.c
@@ -31,9 +31,6 @@
31#include <asm/sections.h> 31#include <asm/sections.h>
32#include <asm/vdso.h> 32#include <asm/vdso.h>
33 33
34/* Max supported size for symbol names */
35#define MAX_SYMNAME 64
36
37#if defined(CONFIG_32BIT) || defined(CONFIG_COMPAT) 34#if defined(CONFIG_32BIT) || defined(CONFIG_COMPAT)
38extern char vdso32_start, vdso32_end; 35extern char vdso32_start, vdso32_end;
39static void *vdso32_kbase = &vdso32_start; 36static void *vdso32_kbase = &vdso32_start;
@@ -71,6 +68,119 @@ static union {
71struct vdso_data *vdso_data = &vdso_data_store.data; 68struct vdso_data *vdso_data = &vdso_data_store.data;
72 69
73/* 70/*
71 * Setup vdso data page.
72 */
73static void vdso_init_data(struct vdso_data *vd)
74{
75 unsigned int facility_list;
76
77 facility_list = stfl();
78 vd->ectg_available = switch_amode && (facility_list & 1);
79}
80
81#ifdef CONFIG_64BIT
82/*
83 * Setup per cpu vdso data page.
84 */
85static void vdso_init_per_cpu_data(int cpu, struct vdso_per_cpu_data *vpcd)
86{
87}
88
89/*
90 * Allocate/free per cpu vdso data.
91 */
92#ifdef CONFIG_64BIT
93#define SEGMENT_ORDER 2
94#else
95#define SEGMENT_ORDER 1
96#endif
97
98int vdso_alloc_per_cpu(int cpu, struct _lowcore *lowcore)
99{
100 unsigned long segment_table, page_table, page_frame;
101 u32 *psal, *aste;
102 int i;
103
104 lowcore->vdso_per_cpu_data = __LC_PASTE;
105
106 if (!switch_amode || !vdso_enabled)
107 return 0;
108
109 segment_table = __get_free_pages(GFP_KERNEL, SEGMENT_ORDER);
110 page_table = get_zeroed_page(GFP_KERNEL | GFP_DMA);
111 page_frame = get_zeroed_page(GFP_KERNEL);
112 if (!segment_table || !page_table || !page_frame)
113 goto out;
114
115 clear_table((unsigned long *) segment_table, _SEGMENT_ENTRY_EMPTY,
116 PAGE_SIZE << SEGMENT_ORDER);
117 clear_table((unsigned long *) page_table, _PAGE_TYPE_EMPTY,
118 256*sizeof(unsigned long));
119
120 *(unsigned long *) segment_table = _SEGMENT_ENTRY + page_table;
121 *(unsigned long *) page_table = _PAGE_RO + page_frame;
122
123 psal = (u32 *) (page_table + 256*sizeof(unsigned long));
124 aste = psal + 32;
125
126 for (i = 4; i < 32; i += 4)
127 psal[i] = 0x80000000;
128
129 lowcore->paste[4] = (u32)(addr_t) psal;
130 psal[0] = 0x20000000;
131 psal[2] = (u32)(addr_t) aste;
132 *(unsigned long *) (aste + 2) = segment_table +
133 _ASCE_TABLE_LENGTH + _ASCE_USER_BITS + _ASCE_TYPE_SEGMENT;
134 aste[4] = (u32)(addr_t) psal;
135 lowcore->vdso_per_cpu_data = page_frame;
136
137 vdso_init_per_cpu_data(cpu, (struct vdso_per_cpu_data *) page_frame);
138 return 0;
139
140out:
141 free_page(page_frame);
142 free_page(page_table);
143 free_pages(segment_table, SEGMENT_ORDER);
144 return -ENOMEM;
145}
146
147#ifdef CONFIG_HOTPLUG_CPU
148void vdso_free_per_cpu(int cpu, struct _lowcore *lowcore)
149{
150 unsigned long segment_table, page_table, page_frame;
151 u32 *psal, *aste;
152
153 if (!switch_amode || !vdso_enabled)
154 return;
155
156 psal = (u32 *)(addr_t) lowcore->paste[4];
157 aste = (u32 *)(addr_t) psal[2];
158 segment_table = *(unsigned long *)(aste + 2) & PAGE_MASK;
159 page_table = *(unsigned long *) segment_table;
160 page_frame = *(unsigned long *) page_table;
161
162 free_page(page_frame);
163 free_page(page_table);
164 free_pages(segment_table, SEGMENT_ORDER);
165}
166#endif /* CONFIG_HOTPLUG_CPU */
167
168static void __vdso_init_cr5(void *dummy)
169{
170 unsigned long cr5;
171
172 cr5 = offsetof(struct _lowcore, paste);
173 __ctl_load(cr5, 5, 5);
174}
175
176static void vdso_init_cr5(void)
177{
178 if (switch_amode && vdso_enabled)
179 on_each_cpu(__vdso_init_cr5, NULL, 1);
180}
181#endif /* CONFIG_64BIT */
182
183/*
74 * This is called from binfmt_elf, we create the special vma for the 184 * This is called from binfmt_elf, we create the special vma for the
75 * vDSO and insert it into the mm struct tree 185 * vDSO and insert it into the mm struct tree
76 */ 186 */
@@ -172,6 +282,9 @@ static int __init vdso_init(void)
172{ 282{
173 int i; 283 int i;
174 284
285 if (!vdso_enabled)
286 return 0;
287 vdso_init_data(vdso_data);
175#if defined(CONFIG_32BIT) || defined(CONFIG_COMPAT) 288#if defined(CONFIG_32BIT) || defined(CONFIG_COMPAT)
176 /* Calculate the size of the 32 bit vDSO */ 289 /* Calculate the size of the 32 bit vDSO */
177 vdso32_pages = ((&vdso32_end - &vdso32_start 290 vdso32_pages = ((&vdso32_end - &vdso32_start
@@ -208,6 +321,11 @@ static int __init vdso_init(void)
208 } 321 }
209 vdso64_pagelist[vdso64_pages - 1] = virt_to_page(vdso_data); 322 vdso64_pagelist[vdso64_pages - 1] = virt_to_page(vdso_data);
210 vdso64_pagelist[vdso64_pages] = NULL; 323 vdso64_pagelist[vdso64_pages] = NULL;
324#ifndef CONFIG_SMP
325 if (vdso_alloc_per_cpu(0, &S390_lowcore))
326 BUG();
327#endif
328 vdso_init_cr5();
211#endif /* CONFIG_64BIT */ 329#endif /* CONFIG_64BIT */
212 330
213 get_page(virt_to_page(vdso_data)); 331 get_page(virt_to_page(vdso_data));
diff --git a/arch/s390/kernel/vdso32/gettimeofday.S b/arch/s390/kernel/vdso32/gettimeofday.S
index c32f29c3d70c..ad8acfc949fb 100644
--- a/arch/s390/kernel/vdso32/gettimeofday.S
+++ b/arch/s390/kernel/vdso32/gettimeofday.S
@@ -13,10 +13,6 @@
13#include <asm/asm-offsets.h> 13#include <asm/asm-offsets.h>
14#include <asm/unistd.h> 14#include <asm/unistd.h>
15 15
16#include <asm/vdso.h>
17#include <asm/asm-offsets.h>
18#include <asm/unistd.h>
19
20 .text 16 .text
21 .align 4 17 .align 4
22 .globl __kernel_gettimeofday 18 .globl __kernel_gettimeofday
diff --git a/arch/s390/kernel/vdso64/clock_getres.S b/arch/s390/kernel/vdso64/clock_getres.S
index 488e31a3c0e7..9ce8caafdb4e 100644
--- a/arch/s390/kernel/vdso64/clock_getres.S
+++ b/arch/s390/kernel/vdso64/clock_getres.S
@@ -22,7 +22,12 @@ __kernel_clock_getres:
22 cghi %r2,CLOCK_REALTIME 22 cghi %r2,CLOCK_REALTIME
23 je 0f 23 je 0f
24 cghi %r2,CLOCK_MONOTONIC 24 cghi %r2,CLOCK_MONOTONIC
25 je 0f
26 cghi %r2,-2 /* CLOCK_THREAD_CPUTIME_ID for this thread */
25 jne 2f 27 jne 2f
28 larl %r5,_vdso_data
29 icm %r0,15,__LC_ECTG_OK(%r5)
30 jz 2f
260: ltgr %r3,%r3 310: ltgr %r3,%r3
27 jz 1f /* res == NULL */ 32 jz 1f /* res == NULL */
28 larl %r1,3f 33 larl %r1,3f
diff --git a/arch/s390/kernel/vdso64/clock_gettime.S b/arch/s390/kernel/vdso64/clock_gettime.S
index 738a410b7eb2..79dbfee831ec 100644
--- a/arch/s390/kernel/vdso64/clock_gettime.S
+++ b/arch/s390/kernel/vdso64/clock_gettime.S
@@ -22,8 +22,10 @@ __kernel_clock_gettime:
22 larl %r5,_vdso_data 22 larl %r5,_vdso_data
23 cghi %r2,CLOCK_REALTIME 23 cghi %r2,CLOCK_REALTIME
24 je 4f 24 je 4f
25 cghi %r2,-2 /* CLOCK_THREAD_CPUTIME_ID for this thread */
26 je 9f
25 cghi %r2,CLOCK_MONOTONIC 27 cghi %r2,CLOCK_MONOTONIC
26 jne 9f 28 jne 12f
27 29
28 /* CLOCK_MONOTONIC */ 30 /* CLOCK_MONOTONIC */
29 ltgr %r3,%r3 31 ltgr %r3,%r3
@@ -42,7 +44,7 @@ __kernel_clock_gettime:
42 alg %r0,__VDSO_WTOM_SEC(%r5) 44 alg %r0,__VDSO_WTOM_SEC(%r5)
43 clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ 45 clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */
44 jne 0b 46 jne 0b
45 larl %r5,10f 47 larl %r5,13f
461: clg %r1,0(%r5) 481: clg %r1,0(%r5)
47 jl 2f 49 jl 2f
48 slg %r1,0(%r5) 50 slg %r1,0(%r5)
@@ -68,7 +70,7 @@ __kernel_clock_gettime:
68 lg %r0,__VDSO_XTIME_SEC(%r5) 70 lg %r0,__VDSO_XTIME_SEC(%r5)
69 clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */ 71 clg %r4,__VDSO_UPD_COUNT(%r5) /* check update counter */
70 jne 5b 72 jne 5b
71 larl %r5,10f 73 larl %r5,13f
726: clg %r1,0(%r5) 746: clg %r1,0(%r5)
73 jl 7f 75 jl 7f
74 slg %r1,0(%r5) 76 slg %r1,0(%r5)
@@ -79,11 +81,38 @@ __kernel_clock_gettime:
798: lghi %r2,0 818: lghi %r2,0
80 br %r14 82 br %r14
81 83
84 /* CLOCK_THREAD_CPUTIME_ID for this thread */
859: icm %r0,15,__VDSO_ECTG_OK(%r5)
86 jz 12f
87 ear %r2,%a4
88 llilh %r4,0x0100
89 sar %a4,%r4
90 lghi %r4,0
91 sacf 512 /* Magic ectg instruction */
92 .insn ssf,0xc80100000000,__VDSO_ECTG_BASE(4),__VDSO_ECTG_USER(4),4
93 sacf 0
94 sar %a4,%r2
95 algr %r1,%r0 /* r1 = cputime as TOD value */
96 mghi %r1,1000 /* convert to nanoseconds */
97 srlg %r1,%r1,12 /* r1 = cputime in nanosec */
98 lgr %r4,%r1
99 larl %r5,13f
100 srlg %r1,%r1,9 /* divide by 1000000000 */
101 mlg %r0,8(%r5)
102 srlg %r0,%r0,11 /* r0 = tv_sec */
103 stg %r0,0(%r3)
104 msg %r0,0(%r5) /* calculate tv_nsec */
105 slgr %r4,%r0 /* r4 = tv_nsec */
106 stg %r4,8(%r3)
107 lghi %r2,0
108 br %r14
109
82 /* Fallback to system call */ 110 /* Fallback to system call */
839: lghi %r1,__NR_clock_gettime 11112: lghi %r1,__NR_clock_gettime
84 svc 0 112 svc 0
85 br %r14 113 br %r14
86 114
8710: .quad 1000000000 11513: .quad 1000000000
11614: .quad 19342813113834067
88 .cfi_endproc 117 .cfi_endproc
89 .size __kernel_clock_gettime,.-__kernel_clock_gettime 118 .size __kernel_clock_gettime,.-__kernel_clock_gettime
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index 75a6e62ea973..2fb36e462194 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -23,19 +23,43 @@
23#include <asm/s390_ext.h> 23#include <asm/s390_ext.h>
24#include <asm/timer.h> 24#include <asm/timer.h>
25#include <asm/irq_regs.h> 25#include <asm/irq_regs.h>
26#include <asm/cpu.h>
26 27
27static ext_int_info_t ext_int_info_timer; 28static ext_int_info_t ext_int_info_timer;
29
28static DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer); 30static DEFINE_PER_CPU(struct vtimer_queue, virt_cpu_timer);
29 31
32DEFINE_PER_CPU(struct s390_idle_data, s390_idle) = {
33 .lock = __SPIN_LOCK_UNLOCKED(s390_idle.lock)
34};
35
36static inline __u64 get_vtimer(void)
37{
38 __u64 timer;
39
40 asm volatile("STPT %0" : "=m" (timer));
41 return timer;
42}
43
44static inline void set_vtimer(__u64 expires)
45{
46 __u64 timer;
47
48 asm volatile (" STPT %0\n" /* Store current cpu timer value */
49 " SPT %1" /* Set new value immediatly afterwards */
50 : "=m" (timer) : "m" (expires) );
51 S390_lowcore.system_timer += S390_lowcore.last_update_timer - timer;
52 S390_lowcore.last_update_timer = expires;
53}
54
30/* 55/*
31 * Update process times based on virtual cpu times stored by entry.S 56 * Update process times based on virtual cpu times stored by entry.S
32 * to the lowcore fields user_timer, system_timer & steal_clock. 57 * to the lowcore fields user_timer, system_timer & steal_clock.
33 */ 58 */
34void account_process_tick(struct task_struct *tsk, int user_tick) 59static void do_account_vtime(struct task_struct *tsk, int hardirq_offset)
35{ 60{
36 cputime_t cputime; 61 struct thread_info *ti = task_thread_info(tsk);
37 __u64 timer, clock; 62 __u64 timer, clock, user, system, steal;
38 int rcu_user_flag;
39 63
40 timer = S390_lowcore.last_update_timer; 64 timer = S390_lowcore.last_update_timer;
41 clock = S390_lowcore.last_update_clock; 65 clock = S390_lowcore.last_update_clock;
@@ -44,50 +68,41 @@ void account_process_tick(struct task_struct *tsk, int user_tick)
44 : "=m" (S390_lowcore.last_update_timer), 68 : "=m" (S390_lowcore.last_update_timer),
45 "=m" (S390_lowcore.last_update_clock) ); 69 "=m" (S390_lowcore.last_update_clock) );
46 S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer; 70 S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer;
47 S390_lowcore.steal_clock += S390_lowcore.last_update_clock - clock; 71 S390_lowcore.steal_timer += S390_lowcore.last_update_clock - clock;
48 72
49 cputime = S390_lowcore.user_timer >> 12; 73 user = S390_lowcore.user_timer - ti->user_timer;
50 rcu_user_flag = cputime != 0; 74 S390_lowcore.steal_timer -= user;
51 S390_lowcore.user_timer -= cputime << 12; 75 ti->user_timer = S390_lowcore.user_timer;
52 S390_lowcore.steal_clock -= cputime << 12; 76 account_user_time(tsk, user, user);
53 account_user_time(tsk, cputime); 77
54 78 system = S390_lowcore.system_timer - ti->system_timer;
55 cputime = S390_lowcore.system_timer >> 12; 79 S390_lowcore.steal_timer -= system;
56 S390_lowcore.system_timer -= cputime << 12; 80 ti->system_timer = S390_lowcore.system_timer;
57 S390_lowcore.steal_clock -= cputime << 12; 81 account_system_time(tsk, hardirq_offset, system, system);
58 account_system_time(tsk, HARDIRQ_OFFSET, cputime); 82
59 83 steal = S390_lowcore.steal_timer;
60 cputime = S390_lowcore.steal_clock; 84 if ((s64) steal > 0) {
61 if ((__s64) cputime > 0) { 85 S390_lowcore.steal_timer = 0;
62 cputime >>= 12; 86 account_steal_time(steal);
63 S390_lowcore.steal_clock -= cputime << 12;
64 account_steal_time(tsk, cputime);
65 } 87 }
66} 88}
67 89
68/* 90void account_vtime(struct task_struct *prev, struct task_struct *next)
69 * Update process times based on virtual cpu times stored by entry.S
70 * to the lowcore fields user_timer, system_timer & steal_clock.
71 */
72void account_vtime(struct task_struct *tsk)
73{ 91{
74 cputime_t cputime; 92 struct thread_info *ti;
75 __u64 timer; 93
76 94 do_account_vtime(prev, 0);
77 timer = S390_lowcore.last_update_timer; 95 ti = task_thread_info(prev);
78 asm volatile (" STPT %0" /* Store current cpu timer value */ 96 ti->user_timer = S390_lowcore.user_timer;
79 : "=m" (S390_lowcore.last_update_timer) ); 97 ti->system_timer = S390_lowcore.system_timer;
80 S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer; 98 ti = task_thread_info(next);
81 99 S390_lowcore.user_timer = ti->user_timer;
82 cputime = S390_lowcore.user_timer >> 12; 100 S390_lowcore.system_timer = ti->system_timer;
83 S390_lowcore.user_timer -= cputime << 12; 101}
84 S390_lowcore.steal_clock -= cputime << 12;
85 account_user_time(tsk, cputime);
86 102
87 cputime = S390_lowcore.system_timer >> 12; 103void account_process_tick(struct task_struct *tsk, int user_tick)
88 S390_lowcore.system_timer -= cputime << 12; 104{
89 S390_lowcore.steal_clock -= cputime << 12; 105 do_account_vtime(tsk, HARDIRQ_OFFSET);
90 account_system_time(tsk, 0, cputime);
91} 106}
92 107
93/* 108/*
@@ -96,80 +111,131 @@ void account_vtime(struct task_struct *tsk)
96 */ 111 */
97void account_system_vtime(struct task_struct *tsk) 112void account_system_vtime(struct task_struct *tsk)
98{ 113{
99 cputime_t cputime; 114 struct thread_info *ti = task_thread_info(tsk);
100 __u64 timer; 115 __u64 timer, system;
101 116
102 timer = S390_lowcore.last_update_timer; 117 timer = S390_lowcore.last_update_timer;
103 asm volatile (" STPT %0" /* Store current cpu timer value */ 118 S390_lowcore.last_update_timer = get_vtimer();
104 : "=m" (S390_lowcore.last_update_timer) );
105 S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer; 119 S390_lowcore.system_timer += timer - S390_lowcore.last_update_timer;
106 120
107 cputime = S390_lowcore.system_timer >> 12; 121 system = S390_lowcore.system_timer - ti->system_timer;
108 S390_lowcore.system_timer -= cputime << 12; 122 S390_lowcore.steal_timer -= system;
109 S390_lowcore.steal_clock -= cputime << 12; 123 ti->system_timer = S390_lowcore.system_timer;
110 account_system_time(tsk, 0, cputime); 124 account_system_time(tsk, 0, system, system);
111} 125}
112EXPORT_SYMBOL_GPL(account_system_vtime); 126EXPORT_SYMBOL_GPL(account_system_vtime);
113 127
114static inline void set_vtimer(__u64 expires) 128void vtime_start_cpu(void)
115{
116 __u64 timer;
117
118 asm volatile (" STPT %0\n" /* Store current cpu timer value */
119 " SPT %1" /* Set new value immediatly afterwards */
120 : "=m" (timer) : "m" (expires) );
121 S390_lowcore.system_timer += S390_lowcore.last_update_timer - timer;
122 S390_lowcore.last_update_timer = expires;
123
124 /* store expire time for this CPU timer */
125 __get_cpu_var(virt_cpu_timer).to_expire = expires;
126}
127
128void vtime_start_cpu_timer(void)
129{ 129{
130 struct vtimer_queue *vt_list; 130 struct s390_idle_data *idle = &__get_cpu_var(s390_idle);
131 131 struct vtimer_queue *vq = &__get_cpu_var(virt_cpu_timer);
132 vt_list = &__get_cpu_var(virt_cpu_timer); 132 __u64 idle_time, expires;
133 133
134 /* CPU timer interrupt is pending, don't reprogramm it */ 134 /* Account time spent with enabled wait psw loaded as idle time. */
135 if (vt_list->idle & 1LL<<63) 135 idle_time = S390_lowcore.int_clock - idle->idle_enter;
136 return; 136 account_idle_time(idle_time);
137 S390_lowcore.last_update_clock = S390_lowcore.int_clock;
138
139 /* Account system time spent going idle. */
140 S390_lowcore.system_timer += S390_lowcore.last_update_timer - vq->idle;
141 S390_lowcore.last_update_timer = S390_lowcore.async_enter_timer;
142
143 /* Restart vtime CPU timer */
144 if (vq->do_spt) {
145 /* Program old expire value but first save progress. */
146 expires = vq->idle - S390_lowcore.async_enter_timer;
147 expires += get_vtimer();
148 set_vtimer(expires);
149 } else {
150 /* Don't account the CPU timer delta while the cpu was idle. */
151 vq->elapsed -= vq->idle - S390_lowcore.async_enter_timer;
152 }
137 153
138 if (!list_empty(&vt_list->list)) 154 spin_lock(&idle->lock);
139 set_vtimer(vt_list->idle); 155 idle->idle_time += idle_time;
156 idle->idle_enter = 0ULL;
157 idle->idle_count++;
158 spin_unlock(&idle->lock);
140} 159}
141 160
142void vtime_stop_cpu_timer(void) 161void vtime_stop_cpu(void)
143{ 162{
144 struct vtimer_queue *vt_list; 163 struct s390_idle_data *idle = &__get_cpu_var(s390_idle);
145 164 struct vtimer_queue *vq = &__get_cpu_var(virt_cpu_timer);
146 vt_list = &__get_cpu_var(virt_cpu_timer); 165 psw_t psw;
147 166
148 /* nothing to do */ 167 /* Wait for external, I/O or machine check interrupt. */
149 if (list_empty(&vt_list->list)) { 168 psw.mask = psw_kernel_bits | PSW_MASK_WAIT | PSW_MASK_IO | PSW_MASK_EXT;
150 vt_list->idle = VTIMER_MAX_SLICE; 169
151 goto fire; 170 /* Check if the CPU timer needs to be reprogrammed. */
171 if (vq->do_spt) {
172 __u64 vmax = VTIMER_MAX_SLICE;
173 /*
174 * The inline assembly is equivalent to
175 * vq->idle = get_cpu_timer();
176 * set_cpu_timer(VTIMER_MAX_SLICE);
177 * idle->idle_enter = get_clock();
178 * __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT |
179 * PSW_MASK_IO | PSW_MASK_EXT);
180 * The difference is that the inline assembly makes sure that
181 * the last three instruction are stpt, stck and lpsw in that
182 * order. This is done to increase the precision.
183 */
184 asm volatile(
185#ifndef CONFIG_64BIT
186 " basr 1,0\n"
187 "0: ahi 1,1f-0b\n"
188 " st 1,4(%2)\n"
189#else /* CONFIG_64BIT */
190 " larl 1,1f\n"
191 " stg 1,8(%2)\n"
192#endif /* CONFIG_64BIT */
193 " stpt 0(%4)\n"
194 " spt 0(%5)\n"
195 " stck 0(%3)\n"
196#ifndef CONFIG_64BIT
197 " lpsw 0(%2)\n"
198#else /* CONFIG_64BIT */
199 " lpswe 0(%2)\n"
200#endif /* CONFIG_64BIT */
201 "1:"
202 : "=m" (idle->idle_enter), "=m" (vq->idle)
203 : "a" (&psw), "a" (&idle->idle_enter),
204 "a" (&vq->idle), "a" (&vmax), "m" (vmax), "m" (psw)
205 : "memory", "cc", "1");
206 } else {
207 /*
208 * The inline assembly is equivalent to
209 * vq->idle = get_cpu_timer();
210 * idle->idle_enter = get_clock();
211 * __load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT |
212 * PSW_MASK_IO | PSW_MASK_EXT);
213 * The difference is that the inline assembly makes sure that
214 * the last three instruction are stpt, stck and lpsw in that
215 * order. This is done to increase the precision.
216 */
217 asm volatile(
218#ifndef CONFIG_64BIT
219 " basr 1,0\n"
220 "0: ahi 1,1f-0b\n"
221 " st 1,4(%2)\n"
222#else /* CONFIG_64BIT */
223 " larl 1,1f\n"
224 " stg 1,8(%2)\n"
225#endif /* CONFIG_64BIT */
226 " stpt 0(%4)\n"
227 " stck 0(%3)\n"
228#ifndef CONFIG_64BIT
229 " lpsw 0(%2)\n"
230#else /* CONFIG_64BIT */
231 " lpswe 0(%2)\n"
232#endif /* CONFIG_64BIT */
233 "1:"
234 : "=m" (idle->idle_enter), "=m" (vq->idle)
235 : "a" (&psw), "a" (&idle->idle_enter),
236 "a" (&vq->idle), "m" (psw)
237 : "memory", "cc", "1");
152 } 238 }
153
154 /* store the actual expire value */
155 asm volatile ("STPT %0" : "=m" (vt_list->idle));
156
157 /*
158 * If the CPU timer is negative we don't reprogramm
159 * it because we will get instantly an interrupt.
160 */
161 if (vt_list->idle & 1LL<<63)
162 return;
163
164 vt_list->offset += vt_list->to_expire - vt_list->idle;
165
166 /*
167 * We cannot halt the CPU timer, we just write a value that
168 * nearly never expires (only after 71 years) and re-write
169 * the stored expire value if we continue the timer
170 */
171 fire:
172 set_vtimer(VTIMER_MAX_SLICE);
173} 239}
174 240
175/* 241/*
@@ -195,30 +261,23 @@ static void list_add_sorted(struct vtimer_list *timer, struct list_head *head)
195 */ 261 */
196static void do_callbacks(struct list_head *cb_list) 262static void do_callbacks(struct list_head *cb_list)
197{ 263{
198 struct vtimer_queue *vt_list; 264 struct vtimer_queue *vq;
199 struct vtimer_list *event, *tmp; 265 struct vtimer_list *event, *tmp;
200 void (*fn)(unsigned long);
201 unsigned long data;
202 266
203 if (list_empty(cb_list)) 267 if (list_empty(cb_list))
204 return; 268 return;
205 269
206 vt_list = &__get_cpu_var(virt_cpu_timer); 270 vq = &__get_cpu_var(virt_cpu_timer);
207 271
208 list_for_each_entry_safe(event, tmp, cb_list, entry) { 272 list_for_each_entry_safe(event, tmp, cb_list, entry) {
209 fn = event->function; 273 list_del_init(&event->entry);
210 data = event->data; 274 (event->function)(event->data);
211 fn(data); 275 if (event->interval) {
212 276 /* Recharge interval timer */
213 if (!event->interval) 277 event->expires = event->interval + vq->elapsed;
214 /* delete one shot timer */ 278 spin_lock(&vq->lock);
215 list_del_init(&event->entry); 279 list_add_sorted(event, &vq->list);
216 else { 280 spin_unlock(&vq->lock);
217 /* move interval timer back to list */
218 spin_lock(&vt_list->lock);
219 list_del_init(&event->entry);
220 list_add_sorted(event, &vt_list->list);
221 spin_unlock(&vt_list->lock);
222 } 281 }
223 } 282 }
224} 283}
@@ -228,64 +287,57 @@ static void do_callbacks(struct list_head *cb_list)
228 */ 287 */
229static void do_cpu_timer_interrupt(__u16 error_code) 288static void do_cpu_timer_interrupt(__u16 error_code)
230{ 289{
231 __u64 next, delta; 290 struct vtimer_queue *vq;
232 struct vtimer_queue *vt_list;
233 struct vtimer_list *event, *tmp; 291 struct vtimer_list *event, *tmp;
234 struct list_head *ptr; 292 struct list_head cb_list; /* the callback queue */
235 /* the callback queue */ 293 __u64 elapsed, next;
236 struct list_head cb_list;
237 294
238 INIT_LIST_HEAD(&cb_list); 295 INIT_LIST_HEAD(&cb_list);
239 vt_list = &__get_cpu_var(virt_cpu_timer); 296 vq = &__get_cpu_var(virt_cpu_timer);
240 297
241 /* walk timer list, fire all expired events */ 298 /* walk timer list, fire all expired events */
242 spin_lock(&vt_list->lock); 299 spin_lock(&vq->lock);
243 300
244 if (vt_list->to_expire < VTIMER_MAX_SLICE) 301 elapsed = vq->elapsed + (vq->timer - S390_lowcore.async_enter_timer);
245 vt_list->offset += vt_list->to_expire; 302 BUG_ON((s64) elapsed < 0);
246 303 vq->elapsed = 0;
247 list_for_each_entry_safe(event, tmp, &vt_list->list, entry) { 304 list_for_each_entry_safe(event, tmp, &vq->list, entry) {
248 if (event->expires > vt_list->offset) 305 if (event->expires < elapsed)
249 /* found first unexpired event, leave */ 306 /* move expired timer to the callback queue */
250 break; 307 list_move_tail(&event->entry, &cb_list);
251 308 else
252 /* re-charge interval timer, we have to add the offset */ 309 event->expires -= elapsed;
253 if (event->interval)
254 event->expires = event->interval + vt_list->offset;
255
256 /* move expired timer to the callback queue */
257 list_move_tail(&event->entry, &cb_list);
258 } 310 }
259 spin_unlock(&vt_list->lock); 311 spin_unlock(&vq->lock);
312
313 vq->do_spt = list_empty(&cb_list);
260 do_callbacks(&cb_list); 314 do_callbacks(&cb_list);
261 315
262 /* next event is first in list */ 316 /* next event is first in list */
263 spin_lock(&vt_list->lock); 317 next = VTIMER_MAX_SLICE;
264 if (!list_empty(&vt_list->list)) { 318 spin_lock(&vq->lock);
265 ptr = vt_list->list.next; 319 if (!list_empty(&vq->list)) {
266 event = list_entry(ptr, struct vtimer_list, entry); 320 event = list_first_entry(&vq->list, struct vtimer_list, entry);
267 next = event->expires - vt_list->offset; 321 next = event->expires;
268 322 } else
269 /* add the expired time from this interrupt handler 323 vq->do_spt = 0;
270 * and the callback functions 324 spin_unlock(&vq->lock);
271 */ 325 /*
272 asm volatile ("STPT %0" : "=m" (delta)); 326 * To improve precision add the time spent by the
273 delta = 0xffffffffffffffffLL - delta + 1; 327 * interrupt handler to the elapsed time.
274 vt_list->offset += delta; 328 * Note: CPU timer counts down and we got an interrupt,
275 next -= delta; 329 * the current content is negative
276 } else { 330 */
277 vt_list->offset = 0; 331 elapsed = S390_lowcore.async_enter_timer - get_vtimer();
278 next = VTIMER_MAX_SLICE; 332 set_vtimer(next - elapsed);
279 } 333 vq->timer = next - elapsed;
280 spin_unlock(&vt_list->lock); 334 vq->elapsed = elapsed;
281 set_vtimer(next);
282} 335}
283 336
284void init_virt_timer(struct vtimer_list *timer) 337void init_virt_timer(struct vtimer_list *timer)
285{ 338{
286 timer->function = NULL; 339 timer->function = NULL;
287 INIT_LIST_HEAD(&timer->entry); 340 INIT_LIST_HEAD(&timer->entry);
288 spin_lock_init(&timer->lock);
289} 341}
290EXPORT_SYMBOL(init_virt_timer); 342EXPORT_SYMBOL(init_virt_timer);
291 343
@@ -299,44 +351,40 @@ static inline int vtimer_pending(struct vtimer_list *timer)
299 */ 351 */
300static void internal_add_vtimer(struct vtimer_list *timer) 352static void internal_add_vtimer(struct vtimer_list *timer)
301{ 353{
354 struct vtimer_queue *vq;
302 unsigned long flags; 355 unsigned long flags;
303 __u64 done; 356 __u64 left, expires;
304 struct vtimer_list *event;
305 struct vtimer_queue *vt_list;
306 357
307 vt_list = &per_cpu(virt_cpu_timer, timer->cpu); 358 vq = &per_cpu(virt_cpu_timer, timer->cpu);
308 spin_lock_irqsave(&vt_list->lock, flags); 359 spin_lock_irqsave(&vq->lock, flags);
309 360
310 BUG_ON(timer->cpu != smp_processor_id()); 361 BUG_ON(timer->cpu != smp_processor_id());
311 362
312 /* if list is empty we only have to set the timer */ 363 if (list_empty(&vq->list)) {
313 if (list_empty(&vt_list->list)) { 364 /* First timer on this cpu, just program it. */
314 /* reset the offset, this may happen if the last timer was 365 list_add(&timer->entry, &vq->list);
315 * just deleted by mod_virt_timer and the interrupt 366 set_vtimer(timer->expires);
316 * didn't happen until here 367 vq->timer = timer->expires;
317 */ 368 vq->elapsed = 0;
318 vt_list->offset = 0; 369 } else {
319 goto fire; 370 /* Check progress of old timers. */
371 expires = timer->expires;
372 left = get_vtimer();
373 if (likely((s64) expires < (s64) left)) {
374 /* The new timer expires before the current timer. */
375 set_vtimer(expires);
376 vq->elapsed += vq->timer - left;
377 vq->timer = expires;
378 } else {
379 vq->elapsed += vq->timer - left;
380 vq->timer = left;
381 }
382 /* Insert new timer into per cpu list. */
383 timer->expires += vq->elapsed;
384 list_add_sorted(timer, &vq->list);
320 } 385 }
321 386
322 /* save progress */ 387 spin_unlock_irqrestore(&vq->lock, flags);
323 asm volatile ("STPT %0" : "=m" (done));
324
325 /* calculate completed work */
326 done = vt_list->to_expire - done + vt_list->offset;
327 vt_list->offset = 0;
328
329 list_for_each_entry(event, &vt_list->list, entry)
330 event->expires -= done;
331
332 fire:
333 list_add_sorted(timer, &vt_list->list);
334
335 /* get first element, which is the next vtimer slice */
336 event = list_entry(vt_list->list.next, struct vtimer_list, entry);
337
338 set_vtimer(event->expires);
339 spin_unlock_irqrestore(&vt_list->lock, flags);
340 /* release CPU acquired in prepare_vtimer or mod_virt_timer() */ 388 /* release CPU acquired in prepare_vtimer or mod_virt_timer() */
341 put_cpu(); 389 put_cpu();
342} 390}
@@ -381,14 +429,15 @@ EXPORT_SYMBOL(add_virt_timer_periodic);
381 * If we change a pending timer the function must be called on the CPU 429 * If we change a pending timer the function must be called on the CPU
382 * where the timer is running on, e.g. by smp_call_function_single() 430 * where the timer is running on, e.g. by smp_call_function_single()
383 * 431 *
384 * The original mod_timer adds the timer if it is not pending. For compatibility 432 * The original mod_timer adds the timer if it is not pending. For
385 * we do the same. The timer will be added on the current CPU as a oneshot timer. 433 * compatibility we do the same. The timer will be added on the current
434 * CPU as a oneshot timer.
386 * 435 *
387 * returns whether it has modified a pending timer (1) or not (0) 436 * returns whether it has modified a pending timer (1) or not (0)
388 */ 437 */
389int mod_virt_timer(struct vtimer_list *timer, __u64 expires) 438int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
390{ 439{
391 struct vtimer_queue *vt_list; 440 struct vtimer_queue *vq;
392 unsigned long flags; 441 unsigned long flags;
393 int cpu; 442 int cpu;
394 443
@@ -404,17 +453,17 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
404 return 1; 453 return 1;
405 454
406 cpu = get_cpu(); 455 cpu = get_cpu();
407 vt_list = &per_cpu(virt_cpu_timer, cpu); 456 vq = &per_cpu(virt_cpu_timer, cpu);
408 457
409 /* check if we run on the right CPU */ 458 /* check if we run on the right CPU */
410 BUG_ON(timer->cpu != cpu); 459 BUG_ON(timer->cpu != cpu);
411 460
412 /* disable interrupts before test if timer is pending */ 461 /* disable interrupts before test if timer is pending */
413 spin_lock_irqsave(&vt_list->lock, flags); 462 spin_lock_irqsave(&vq->lock, flags);
414 463
415 /* if timer isn't pending add it on the current CPU */ 464 /* if timer isn't pending add it on the current CPU */
416 if (!vtimer_pending(timer)) { 465 if (!vtimer_pending(timer)) {
417 spin_unlock_irqrestore(&vt_list->lock, flags); 466 spin_unlock_irqrestore(&vq->lock, flags);
418 /* we do not activate an interval timer with mod_virt_timer */ 467 /* we do not activate an interval timer with mod_virt_timer */
419 timer->interval = 0; 468 timer->interval = 0;
420 timer->expires = expires; 469 timer->expires = expires;
@@ -431,7 +480,7 @@ int mod_virt_timer(struct vtimer_list *timer, __u64 expires)
431 timer->interval = expires; 480 timer->interval = expires;
432 481
433 /* the timer can't expire anymore so we can release the lock */ 482 /* the timer can't expire anymore so we can release the lock */
434 spin_unlock_irqrestore(&vt_list->lock, flags); 483 spin_unlock_irqrestore(&vq->lock, flags);
435 internal_add_vtimer(timer); 484 internal_add_vtimer(timer);
436 return 1; 485 return 1;
437} 486}
@@ -445,25 +494,19 @@ EXPORT_SYMBOL(mod_virt_timer);
445int del_virt_timer(struct vtimer_list *timer) 494int del_virt_timer(struct vtimer_list *timer)
446{ 495{
447 unsigned long flags; 496 unsigned long flags;
448 struct vtimer_queue *vt_list; 497 struct vtimer_queue *vq;
449 498
450 /* check if timer is pending */ 499 /* check if timer is pending */
451 if (!vtimer_pending(timer)) 500 if (!vtimer_pending(timer))
452 return 0; 501 return 0;
453 502
454 vt_list = &per_cpu(virt_cpu_timer, timer->cpu); 503 vq = &per_cpu(virt_cpu_timer, timer->cpu);
455 spin_lock_irqsave(&vt_list->lock, flags); 504 spin_lock_irqsave(&vq->lock, flags);
456 505
457 /* we don't interrupt a running timer, just let it expire! */ 506 /* we don't interrupt a running timer, just let it expire! */
458 list_del_init(&timer->entry); 507 list_del_init(&timer->entry);
459 508
460 /* last timer removed */ 509 spin_unlock_irqrestore(&vq->lock, flags);
461 if (list_empty(&vt_list->list)) {
462 vt_list->to_expire = 0;
463 vt_list->offset = 0;
464 }
465
466 spin_unlock_irqrestore(&vt_list->lock, flags);
467 return 1; 510 return 1;
468} 511}
469EXPORT_SYMBOL(del_virt_timer); 512EXPORT_SYMBOL(del_virt_timer);
@@ -473,24 +516,19 @@ EXPORT_SYMBOL(del_virt_timer);
473 */ 516 */
474void init_cpu_vtimer(void) 517void init_cpu_vtimer(void)
475{ 518{
476 struct vtimer_queue *vt_list; 519 struct vtimer_queue *vq;
477 520
478 /* kick the virtual timer */ 521 /* kick the virtual timer */
479 S390_lowcore.exit_timer = VTIMER_MAX_SLICE;
480 S390_lowcore.last_update_timer = VTIMER_MAX_SLICE;
481 asm volatile ("SPT %0" : : "m" (S390_lowcore.last_update_timer));
482 asm volatile ("STCK %0" : "=m" (S390_lowcore.last_update_clock)); 522 asm volatile ("STCK %0" : "=m" (S390_lowcore.last_update_clock));
523 asm volatile ("STPT %0" : "=m" (S390_lowcore.last_update_timer));
524
525 /* initialize per cpu vtimer structure */
526 vq = &__get_cpu_var(virt_cpu_timer);
527 INIT_LIST_HEAD(&vq->list);
528 spin_lock_init(&vq->lock);
483 529
484 /* enable cpu timer interrupts */ 530 /* enable cpu timer interrupts */
485 __ctl_set_bit(0,10); 531 __ctl_set_bit(0,10);
486
487 vt_list = &__get_cpu_var(virt_cpu_timer);
488 INIT_LIST_HEAD(&vt_list->list);
489 spin_lock_init(&vt_list->lock);
490 vt_list->to_expire = 0;
491 vt_list->offset = 0;
492 vt_list->idle = 0;
493
494} 532}
495 533
496void __init vtime_init(void) 534void __init vtime_init(void)
diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
index a0775e1f08df..8300309698fa 100644
--- a/arch/s390/kvm/diag.c
+++ b/arch/s390/kvm/diag.c
@@ -47,7 +47,7 @@ static int __diag_ipl_functions(struct kvm_vcpu *vcpu)
47 vcpu->run->s390_reset_flags |= KVM_S390_RESET_IPL; 47 vcpu->run->s390_reset_flags |= KVM_S390_RESET_IPL;
48 vcpu->run->s390_reset_flags |= KVM_S390_RESET_CPU_INIT; 48 vcpu->run->s390_reset_flags |= KVM_S390_RESET_CPU_INIT;
49 vcpu->run->exit_reason = KVM_EXIT_S390_RESET; 49 vcpu->run->exit_reason = KVM_EXIT_S390_RESET;
50 VCPU_EVENT(vcpu, 3, "requesting userspace resets %lx", 50 VCPU_EVENT(vcpu, 3, "requesting userspace resets %llx",
51 vcpu->run->s390_reset_flags); 51 vcpu->run->s390_reset_flags);
52 return -EREMOTE; 52 return -EREMOTE;
53} 53}
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c
index 2960702b4824..f4fe28a2521a 100644
--- a/arch/s390/kvm/interrupt.c
+++ b/arch/s390/kvm/interrupt.c
@@ -160,7 +160,7 @@ static void __do_deliver_interrupt(struct kvm_vcpu *vcpu,
160 break; 160 break;
161 161
162 case KVM_S390_INT_VIRTIO: 162 case KVM_S390_INT_VIRTIO:
163 VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%lx", 163 VCPU_EVENT(vcpu, 4, "interrupt: virtio parm:%x,parm64:%llx",
164 inti->ext.ext_params, inti->ext.ext_params2); 164 inti->ext.ext_params, inti->ext.ext_params2);
165 vcpu->stat.deliver_virtio_interrupt++; 165 vcpu->stat.deliver_virtio_interrupt++;
166 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2603); 166 rc = put_guest_u16(vcpu, __LC_EXT_INT_CODE, 0x2603);
@@ -360,7 +360,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu)
360 vcpu->arch.ckc_timer.expires = jiffies + sltime; 360 vcpu->arch.ckc_timer.expires = jiffies + sltime;
361 361
362 add_timer(&vcpu->arch.ckc_timer); 362 add_timer(&vcpu->arch.ckc_timer);
363 VCPU_EVENT(vcpu, 5, "enabled wait timer:%lx jiffies", sltime); 363 VCPU_EVENT(vcpu, 5, "enabled wait timer:%llx jiffies", sltime);
364no_timer: 364no_timer:
365 spin_lock_bh(&vcpu->arch.local_int.float_int->lock); 365 spin_lock_bh(&vcpu->arch.local_int.float_int->lock);
366 spin_lock_bh(&vcpu->arch.local_int.lock); 366 spin_lock_bh(&vcpu->arch.local_int.lock);
@@ -491,7 +491,7 @@ int kvm_s390_inject_vm(struct kvm *kvm,
491 491
492 switch (s390int->type) { 492 switch (s390int->type) {
493 case KVM_S390_INT_VIRTIO: 493 case KVM_S390_INT_VIRTIO:
494 VM_EVENT(kvm, 5, "inject: virtio parm:%x,parm64:%lx", 494 VM_EVENT(kvm, 5, "inject: virtio parm:%x,parm64:%llx",
495 s390int->parm, s390int->parm64); 495 s390int->parm, s390int->parm64);
496 inti->type = s390int->type; 496 inti->type = s390int->type;
497 inti->ext.ext_params = s390int->parm; 497 inti->ext.ext_params = s390int->parm;
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 8b00eb2ddf57..be8497186b96 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -113,8 +113,6 @@ long kvm_arch_dev_ioctl(struct file *filp,
113int kvm_dev_ioctl_check_extension(long ext) 113int kvm_dev_ioctl_check_extension(long ext)
114{ 114{
115 switch (ext) { 115 switch (ext) {
116 case KVM_CAP_USER_MEMORY:
117 return 1;
118 default: 116 default:
119 return 0; 117 return 0;
120 } 118 }
@@ -185,8 +183,6 @@ struct kvm *kvm_arch_create_vm(void)
185 debug_register_view(kvm->arch.dbf, &debug_sprintf_view); 183 debug_register_view(kvm->arch.dbf, &debug_sprintf_view);
186 VM_EVENT(kvm, 3, "%s", "vm created"); 184 VM_EVENT(kvm, 3, "%s", "vm created");
187 185
188 try_module_get(THIS_MODULE);
189
190 return kvm; 186 return kvm;
191out_nodbf: 187out_nodbf:
192 free_page((unsigned long)(kvm->arch.sca)); 188 free_page((unsigned long)(kvm->arch.sca));
@@ -196,13 +192,33 @@ out_nokvm:
196 return ERR_PTR(rc); 192 return ERR_PTR(rc);
197} 193}
198 194
195void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
196{
197 VCPU_EVENT(vcpu, 3, "%s", "free cpu");
198 free_page((unsigned long)(vcpu->arch.sie_block));
199 kvm_vcpu_uninit(vcpu);
200 kfree(vcpu);
201}
202
203static void kvm_free_vcpus(struct kvm *kvm)
204{
205 unsigned int i;
206
207 for (i = 0; i < KVM_MAX_VCPUS; ++i) {
208 if (kvm->vcpus[i]) {
209 kvm_arch_vcpu_destroy(kvm->vcpus[i]);
210 kvm->vcpus[i] = NULL;
211 }
212 }
213}
214
199void kvm_arch_destroy_vm(struct kvm *kvm) 215void kvm_arch_destroy_vm(struct kvm *kvm)
200{ 216{
201 debug_unregister(kvm->arch.dbf); 217 kvm_free_vcpus(kvm);
202 kvm_free_physmem(kvm); 218 kvm_free_physmem(kvm);
203 free_page((unsigned long)(kvm->arch.sca)); 219 free_page((unsigned long)(kvm->arch.sca));
220 debug_unregister(kvm->arch.dbf);
204 kfree(kvm); 221 kfree(kvm);
205 module_put(THIS_MODULE);
206} 222}
207 223
208/* Section: vcpu related */ 224/* Section: vcpu related */
@@ -213,8 +229,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
213 229
214void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu) 230void kvm_arch_vcpu_uninit(struct kvm_vcpu *vcpu)
215{ 231{
216 /* kvm common code refers to this, but does'nt call it */ 232 /* Nothing todo */
217 BUG();
218} 233}
219 234
220void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) 235void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
@@ -308,8 +323,6 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm,
308 VM_EVENT(kvm, 3, "create cpu %d at %p, sie block at %p", id, vcpu, 323 VM_EVENT(kvm, 3, "create cpu %d at %p, sie block at %p", id, vcpu,
309 vcpu->arch.sie_block); 324 vcpu->arch.sie_block);
310 325
311 try_module_get(THIS_MODULE);
312
313 return vcpu; 326 return vcpu;
314out_free_cpu: 327out_free_cpu:
315 kfree(vcpu); 328 kfree(vcpu);
@@ -317,14 +330,6 @@ out_nomem:
317 return ERR_PTR(rc); 330 return ERR_PTR(rc);
318} 331}
319 332
320void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
321{
322 VCPU_EVENT(vcpu, 3, "%s", "destroy cpu");
323 free_page((unsigned long)(vcpu->arch.sie_block));
324 kfree(vcpu);
325 module_put(THIS_MODULE);
326}
327
328int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) 333int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
329{ 334{
330 /* kvm common code refers to this, but never calls it */ 335 /* kvm common code refers to this, but never calls it */
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index cce40ff2913b..3605df45dd41 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -118,7 +118,7 @@ static int handle_store_cpu_address(struct kvm_vcpu *vcpu)
118 goto out; 118 goto out;
119 } 119 }
120 120
121 VCPU_EVENT(vcpu, 5, "storing cpu address to %lx", useraddr); 121 VCPU_EVENT(vcpu, 5, "storing cpu address to %llx", useraddr);
122out: 122out:
123 return 0; 123 return 0;
124} 124}
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 158b0d6d7046..f0258ca3b17e 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -183,7 +183,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
183 rc = vmem_add_mapping(start, size); 183 rc = vmem_add_mapping(start, size);
184 if (rc) 184 if (rc)
185 return rc; 185 return rc;
186 rc = __add_pages(zone, PFN_DOWN(start), PFN_DOWN(size)); 186 rc = __add_pages(nid, zone, PFN_DOWN(start), PFN_DOWN(size));
187 if (rc) 187 if (rc)
188 vmem_remove_mapping(start, size); 188 vmem_remove_mapping(start, size);
189 return rc; 189 return rc;
diff --git a/arch/sh/drivers/pci/ops-cayman.c b/arch/sh/drivers/pci/ops-cayman.c
index 5ccf9ea3a9de..38ef76207af6 100644
--- a/arch/sh/drivers/pci/ops-cayman.c
+++ b/arch/sh/drivers/pci/ops-cayman.c
@@ -5,11 +5,6 @@
5#include <cpu/irq.h> 5#include <cpu/irq.h>
6#include "pci-sh5.h" 6#include "pci-sh5.h"
7 7
8static inline u8 bridge_swizzle(u8 pin, u8 slot)
9{
10 return (((pin - 1) + slot) % 4) + 1;
11}
12
13int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin) 8int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)
14{ 9{
15 int result = -1; 10 int result = -1;
@@ -42,7 +37,7 @@ int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)
42 while (dev->bus->number > 0) { 37 while (dev->bus->number > 0) {
43 38
44 slot = path[i].slot = PCI_SLOT(dev->devfn); 39 slot = path[i].slot = PCI_SLOT(dev->devfn);
45 pin = path[i].pin = bridge_swizzle(pin, slot); 40 pin = path[i].pin = pci_swizzle_interrupt_pin(dev, pin);
46 dev = dev->bus->self; 41 dev = dev->bus->self;
47 i++; 42 i++;
48 if (i > 3) panic("PCI path to root bus too long!\n"); 43 if (i > 3) panic("PCI path to root bus too long!\n");
@@ -56,7 +51,7 @@ int __init pcibios_map_platform_irq(struct pci_dev *dev, u8 slot, u8 pin)
56 if ((slot < 3) || (i == 0)) { 51 if ((slot < 3) || (i == 0)) {
57 /* Bus 0 (incl. PCI-PCI bridge itself) : perform the final 52 /* Bus 0 (incl. PCI-PCI bridge itself) : perform the final
58 swizzle now. */ 53 swizzle now. */
59 result = IRQ_INTA + bridge_swizzle(pin, slot) - 1; 54 result = IRQ_INTA + pci_swizzle_interrupt_pin(dev, pin) - 1;
60 } else { 55 } else {
61 i--; 56 i--;
62 slot = path[i].slot; 57 slot = path[i].slot;
diff --git a/arch/sh/drivers/pci/pci.c b/arch/sh/drivers/pci/pci.c
index d3839e609aac..e36c7b870861 100644
--- a/arch/sh/drivers/pci/pci.c
+++ b/arch/sh/drivers/pci/pci.c
@@ -21,26 +21,6 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <asm/io.h> 22#include <asm/io.h>
23 23
24static inline u8 bridge_swizzle(u8 pin, u8 slot)
25{
26 return (((pin - 1) + slot) % 4) + 1;
27}
28
29static u8 __init simple_swizzle(struct pci_dev *dev, u8 *pinp)
30{
31 u8 pin = *pinp;
32
33 while (dev->bus->parent) {
34 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
35 /* Move up the chain of bridges. */
36 dev = dev->bus->self;
37 }
38 *pinp = pin;
39
40 /* The slot is the slot of the last bridge. */
41 return PCI_SLOT(dev->devfn);
42}
43
44static int __init pcibios_init(void) 24static int __init pcibios_init(void)
45{ 25{
46 struct pci_channel *p; 26 struct pci_channel *p;
@@ -61,7 +41,7 @@ static int __init pcibios_init(void)
61 busno = bus->subordinate + 1; 41 busno = bus->subordinate + 1;
62 } 42 }
63 43
64 pci_fixup_irqs(simple_swizzle, pcibios_map_platform_irq); 44 pci_fixup_irqs(pci_common_swizzle, pcibios_map_platform_irq);
65 45
66 return 0; 46 return 0;
67} 47}
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild
index 43910cdf78a5..f1a2a0d1c79c 100644
--- a/arch/sh/include/asm/Kbuild
+++ b/arch/sh/include/asm/Kbuild
@@ -6,3 +6,4 @@ unifdef-y += unistd_32.h
6unifdef-y += unistd_64.h 6unifdef-y += unistd_64.h
7unifdef-y += posix_types_32.h 7unifdef-y += posix_types_32.h
8unifdef-y += posix_types_64.h 8unifdef-y += posix_types_64.h
9unifdef-y += swab.h
diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h
index c043ef003028..6327ffbb1992 100644
--- a/arch/sh/include/asm/atomic.h
+++ b/arch/sh/include/asm/atomic.h
@@ -7,16 +7,15 @@
7 * 7 *
8 */ 8 */
9 9
10typedef struct { volatile int counter; } atomic_t; 10#include <linux/compiler.h>
11#include <linux/types.h>
12#include <asm/system.h>
11 13
12#define ATOMIC_INIT(i) ( (atomic_t) { (i) } ) 14#define ATOMIC_INIT(i) ( (atomic_t) { (i) } )
13 15
14#define atomic_read(v) ((v)->counter) 16#define atomic_read(v) ((v)->counter)
15#define atomic_set(v,i) ((v)->counter = (i)) 17#define atomic_set(v,i) ((v)->counter = (i))
16 18
17#include <linux/compiler.h>
18#include <asm/system.h>
19
20#if defined(CONFIG_GUSA_RB) 19#if defined(CONFIG_GUSA_RB)
21#include <asm/atomic-grb.h> 20#include <asm/atomic-grb.h>
22#elif defined(CONFIG_CPU_SH4A) 21#elif defined(CONFIG_CPU_SH4A)
diff --git a/arch/sh/include/asm/byteorder.h b/arch/sh/include/asm/byteorder.h
index f5fa0653ebc6..e95c41a5c8cc 100644
--- a/arch/sh/include/asm/byteorder.h
+++ b/arch/sh/include/asm/byteorder.h
@@ -1,68 +1,12 @@
1#ifndef __ASM_SH_BYTEORDER_H 1#ifndef __ASM_SH_BYTEORDER_H
2#define __ASM_SH_BYTEORDER_H 2#define __ASM_SH_BYTEORDER_H
3 3
4/* 4#include <asm/swab.h>
5 * Copyright (C) 1999 Niibe Yutaka
6 * Copyright (C) 2000, 2001 Paolo Alberelli
7 */
8#include <linux/compiler.h>
9#include <linux/types.h>
10 5
11#ifdef __LITTLE_ENDIAN__ 6#ifdef __LITTLE_ENDIAN__
12# define __LITTLE_ENDIAN 7#include <linux/byteorder/little_endian.h>
13#else 8#else
14# define __BIG_ENDIAN 9#include <linux/byteorder/big_endian.h>
15#endif 10#endif
16 11
17#define __SWAB_64_THRU_32__
18
19static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
20{
21 __asm__(
22#ifdef __SH5__
23 "byterev %0, %0\n\t"
24 "shari %0, 32, %0"
25#else
26 "swap.b %0, %0\n\t"
27 "swap.w %0, %0\n\t"
28 "swap.b %0, %0"
29#endif
30 : "=r" (x)
31 : "0" (x));
32
33 return x;
34}
35#define __arch_swab32 __arch_swab32
36
37static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
38{
39 __asm__(
40#ifdef __SH5__
41 "byterev %0, %0\n\t"
42 "shari %0, 32, %0"
43#else
44 "swap.b %0, %0"
45#endif
46 : "=r" (x)
47 : "0" (x));
48
49 return x;
50}
51#define __arch_swab16 __arch_swab16
52
53static inline __u64 __arch_swab64(__u64 val)
54{
55 union {
56 struct { __u32 a,b; } s;
57 __u64 u;
58 } v, w;
59 v.u = val;
60 w.s.b = __arch_swab32(v.s.a);
61 w.s.a = __arch_swab32(v.s.b);
62 return w.u;
63}
64#define __arch_swab64 __arch_swab64
65
66#include <linux/byteorder.h>
67
68#endif /* __ASM_SH_BYTEORDER_H */ 12#endif /* __ASM_SH_BYTEORDER_H */
diff --git a/arch/sh/include/asm/mmu.h b/arch/sh/include/asm/mmu.h
index fdcb93bc6d11..6c43625bb1a5 100644
--- a/arch/sh/include/asm/mmu.h
+++ b/arch/sh/include/asm/mmu.h
@@ -9,7 +9,6 @@ typedef struct {
9 mm_context_id_t id; 9 mm_context_id_t id;
10 void *vdso; 10 void *vdso;
11#else 11#else
12 struct vm_list_struct *vmlist;
13 unsigned long end_brk; 12 unsigned long end_brk;
14#endif 13#endif
15#ifdef CONFIG_BINFMT_ELF_FDPIC 14#ifdef CONFIG_BINFMT_ELF_FDPIC
diff --git a/arch/sh/include/asm/smp.h b/arch/sh/include/asm/smp.h
index 85b660c17eb0..c24e9c6a1736 100644
--- a/arch/sh/include/asm/smp.h
+++ b/arch/sh/include/asm/smp.h
@@ -31,7 +31,7 @@ enum {
31}; 31};
32 32
33void smp_message_recv(unsigned int msg); 33void smp_message_recv(unsigned int msg);
34void smp_timer_broadcast(cpumask_t mask); 34void smp_timer_broadcast(const struct cpumask *mask);
35 35
36void local_timer_interrupt(void); 36void local_timer_interrupt(void);
37void local_timer_setup(unsigned int cpu); 37void local_timer_setup(unsigned int cpu);
diff --git a/arch/sh/include/asm/swab.h b/arch/sh/include/asm/swab.h
new file mode 100644
index 000000000000..e69315935107
--- /dev/null
+++ b/arch/sh/include/asm/swab.h
@@ -0,0 +1,60 @@
1#ifndef __ASM_SH_SWAB_H
2#define __ASM_SH_SWAB_H
3
4/*
5 * Copyright (C) 1999 Niibe Yutaka
6 * Copyright (C) 2000, 2001 Paolo Alberelli
7 */
8#include <linux/compiler.h>
9#include <linux/types.h>
10
11#define __SWAB_64_THRU_32__
12
13static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
14{
15 __asm__(
16#ifdef __SH5__
17 "byterev %0, %0\n\t"
18 "shari %0, 32, %0"
19#else
20 "swap.b %0, %0\n\t"
21 "swap.w %0, %0\n\t"
22 "swap.b %0, %0"
23#endif
24 : "=r" (x)
25 : "0" (x));
26
27 return x;
28}
29#define __arch_swab32 __arch_swab32
30
31static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
32{
33 __asm__(
34#ifdef __SH5__
35 "byterev %0, %0\n\t"
36 "shari %0, 32, %0"
37#else
38 "swap.b %0, %0"
39#endif
40 : "=r" (x)
41 : "0" (x));
42
43 return x;
44}
45#define __arch_swab16 __arch_swab16
46
47static inline __u64 __arch_swab64(__u64 val)
48{
49 union {
50 struct { __u32 a,b; } s;
51 __u64 u;
52 } v, w;
53 v.u = val;
54 w.s.b = __arch_swab32(v.s.a);
55 w.s.a = __arch_swab32(v.s.b);
56 return w.u;
57}
58#define __arch_swab64 __arch_swab64
59
60#endif /* __ASM_SH_SWAB_H */
diff --git a/arch/sh/include/asm/topology.h b/arch/sh/include/asm/topology.h
index 95f0085e098a..066f0fba590e 100644
--- a/arch/sh/include/asm/topology.h
+++ b/arch/sh/include/asm/topology.h
@@ -5,7 +5,6 @@
5 5
6/* sched_domains SD_NODE_INIT for sh machines */ 6/* sched_domains SD_NODE_INIT for sh machines */
7#define SD_NODE_INIT (struct sched_domain) { \ 7#define SD_NODE_INIT (struct sched_domain) { \
8 .span = CPU_MASK_NONE, \
9 .parent = NULL, \ 8 .parent = NULL, \
10 .child = NULL, \ 9 .child = NULL, \
11 .groups = NULL, \ 10 .groups = NULL, \
@@ -33,6 +32,7 @@
33#define parent_node(node) ((void)(node),0) 32#define parent_node(node) ((void)(node),0)
34 33
35#define node_to_cpumask(node) ((void)node, cpu_online_map) 34#define node_to_cpumask(node) ((void)node, cpu_online_map)
35#define cpumask_of_node(node) ((void)node, cpu_online_mask)
36#define node_to_first_cpu(node) ((void)(node),0) 36#define node_to_first_cpu(node) ((void)(node),0)
37 37
38#define pcibus_to_node(bus) ((void)(bus), -1) 38#define pcibus_to_node(bus) ((void)(bus), -1)
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 3c5ad1660bbc..8f4027412614 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -31,12 +31,6 @@
31int __cpu_number_map[NR_CPUS]; /* Map physical to logical */ 31int __cpu_number_map[NR_CPUS]; /* Map physical to logical */
32int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */ 32int __cpu_logical_map[NR_CPUS]; /* Map logical to physical */
33 33
34cpumask_t cpu_possible_map;
35EXPORT_SYMBOL(cpu_possible_map);
36
37cpumask_t cpu_online_map;
38EXPORT_SYMBOL(cpu_online_map);
39
40static inline void __init smp_store_cpu_info(unsigned int cpu) 34static inline void __init smp_store_cpu_info(unsigned int cpu)
41{ 35{
42 struct sh_cpuinfo *c = cpu_data + cpu; 36 struct sh_cpuinfo *c = cpu_data + cpu;
@@ -190,11 +184,11 @@ void arch_send_call_function_single_ipi(int cpu)
190 plat_send_ipi(cpu, SMP_MSG_FUNCTION_SINGLE); 184 plat_send_ipi(cpu, SMP_MSG_FUNCTION_SINGLE);
191} 185}
192 186
193void smp_timer_broadcast(cpumask_t mask) 187void smp_timer_broadcast(const struct cpumask *mask)
194{ 188{
195 int cpu; 189 int cpu;
196 190
197 for_each_cpu_mask(cpu, mask) 191 for_each_cpu(cpu, mask)
198 plat_send_ipi(cpu, SMP_MSG_TIMER); 192 plat_send_ipi(cpu, SMP_MSG_TIMER);
199} 193}
200 194
diff --git a/arch/sh/kernel/timers/timer-broadcast.c b/arch/sh/kernel/timers/timer-broadcast.c
index c2317635230f..96e8eaea1e62 100644
--- a/arch/sh/kernel/timers/timer-broadcast.c
+++ b/arch/sh/kernel/timers/timer-broadcast.c
@@ -51,7 +51,7 @@ void __cpuinit local_timer_setup(unsigned int cpu)
51 clk->mult = 1; 51 clk->mult = 1;
52 clk->set_mode = dummy_timer_set_mode; 52 clk->set_mode = dummy_timer_set_mode;
53 clk->broadcast = smp_timer_broadcast; 53 clk->broadcast = smp_timer_broadcast;
54 clk->cpumask = cpumask_of_cpu(cpu); 54 clk->cpumask = cpumask_of(cpu);
55 55
56 clockevents_register_device(clk); 56 clockevents_register_device(clk);
57} 57}
diff --git a/arch/sh/kernel/timers/timer-tmu.c b/arch/sh/kernel/timers/timer-tmu.c
index 3c61ddd4d43e..0db3f9510336 100644
--- a/arch/sh/kernel/timers/timer-tmu.c
+++ b/arch/sh/kernel/timers/timer-tmu.c
@@ -263,7 +263,7 @@ static int tmu_timer_init(void)
263 tmu0_clockevent.min_delta_ns = 263 tmu0_clockevent.min_delta_ns =
264 clockevent_delta2ns(1, &tmu0_clockevent); 264 clockevent_delta2ns(1, &tmu0_clockevent);
265 265
266 tmu0_clockevent.cpumask = cpumask_of_cpu(0); 266 tmu0_clockevent.cpumask = cpumask_of(0);
267 267
268 clockevents_register_device(&tmu0_clockevent); 268 clockevents_register_device(&tmu0_clockevent);
269 269
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c
index 88807a2aacc3..c0aa3d83ec0e 100644
--- a/arch/sh/kernel/traps_32.c
+++ b/arch/sh/kernel/traps_32.c
@@ -13,6 +13,7 @@
13 */ 13 */
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/ptrace.h> 15#include <linux/ptrace.h>
16#include <linux/hardirq.h>
16#include <linux/init.h> 17#include <linux/init.h>
17#include <linux/spinlock.h> 18#include <linux/spinlock.h>
18#include <linux/module.h> 19#include <linux/module.h>
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 6cbef8caeb56..3edf297c829b 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -311,7 +311,8 @@ int arch_add_memory(int nid, u64 start, u64 size)
311 pgdat = NODE_DATA(nid); 311 pgdat = NODE_DATA(nid);
312 312
313 /* We only have ZONE_NORMAL, so this is easy.. */ 313 /* We only have ZONE_NORMAL, so this is easy.. */
314 ret = __add_pages(pgdat->node_zones + ZONE_NORMAL, start_pfn, nr_pages); 314 ret = __add_pages(nid, pgdat->node_zones + ZONE_NORMAL,
315 start_pfn, nr_pages);
315 if (unlikely(ret)) 316 if (unlikely(ret))
316 printk("%s: Failed, __add_pages() == %d\n", __func__, ret); 317 printk("%s: Failed, __add_pages() == %d\n", __func__, ret);
317 318
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 0a94d9c9cde1..de58c02633b4 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -4,6 +4,17 @@
4 4
5mainmenu "Linux/SPARC Kernel Configuration" 5mainmenu "Linux/SPARC Kernel Configuration"
6 6
7config 64BIT
8 bool "64-bit kernel" if ARCH = "sparc"
9 default ARCH = "sparc64"
10 help
11 SPARC is a family of RISC microprocessors designed and marketed by
12 Sun Microsystems, incorporated. They are very widely found in Sun
13 workstations and clones.
14
15 Say yes to build a 64-bit kernel - formerly known as sparc64
16 Say no to build a 32-bit kernel - formerly known as sparc
17
7config SPARC 18config SPARC
8 bool 19 bool
9 default y 20 default y
@@ -15,22 +26,11 @@ config SPARC
15 select RTC_CLASS 26 select RTC_CLASS
16 select RTC_DRV_M48T59 27 select RTC_DRV_M48T59
17 28
18# Identify this as a Sparc32 build
19config SPARC32 29config SPARC32
20 bool 30 def_bool !64BIT
21 default y if ARCH = "sparc"
22 help
23 SPARC is a family of RISC microprocessors designed and marketed by
24 Sun Microsystems, incorporated. They are very widely found in Sun
25 workstations and clones. This port covers the original 32-bit SPARC;
26 it is old and stable and usually considered one of the "big three"
27 along with the Intel and Alpha ports. The UltraLinux project
28 maintains both the SPARC32 and SPARC64 ports; its web page is
29 available at <http://www.ultralinux.org/>.
30 31
31config SPARC64 32config SPARC64
32 bool 33 def_bool 64BIT
33 default y if ARCH = "sparc64"
34 select ARCH_SUPPORTS_MSI 34 select ARCH_SUPPORTS_MSI
35 select HAVE_FUNCTION_TRACER 35 select HAVE_FUNCTION_TRACER
36 select HAVE_KRETPROBES 36 select HAVE_KRETPROBES
@@ -53,9 +53,6 @@ config BITS
53 default 32 if SPARC32 53 default 32 if SPARC32
54 default 64 if SPARC64 54 default 64 if SPARC64
55 55
56config 64BIT
57 def_bool y if SPARC64
58
59config GENERIC_TIME 56config GENERIC_TIME
60 bool 57 bool
61 default y if SPARC64 58 default y if SPARC64
@@ -188,14 +185,6 @@ config ARCH_MAY_HAVE_PC_FDC
188 bool 185 bool
189 default y 186 default y
190 187
191config ARCH_HAS_ILOG2_U32
192 bool
193 default n
194
195config ARCH_HAS_ILOG2_U64
196 bool
197 default n
198
199config EMULATED_CMPXCHG 188config EMULATED_CMPXCHG
200 bool 189 bool
201 default y if SPARC32 190 default y if SPARC32
@@ -442,26 +431,6 @@ config SERIAL_CONSOLE
442endmenu 431endmenu
443 432
444menu "Bus options (PCI etc.)" 433menu "Bus options (PCI etc.)"
445config ISA
446 bool
447 help
448 ISA is found on Espresso only and is not supported currently.
449
450config ISAPNP
451 bool
452 help
453 ISAPNP is not supported
454
455config EISA
456 bool
457 help
458 EISA is not supported.
459
460config MCA
461 bool
462 help
463 MCA is not supported.
464
465config SBUS 434config SBUS
466 bool 435 bool
467 default y 436 default y
diff --git a/arch/sparc/configs/sparc32_defconfig b/arch/sparc/configs/sparc32_defconfig
index 2e3a149ea0e7..09ab46e4c59d 100644
--- a/arch/sparc/configs/sparc32_defconfig
+++ b/arch/sparc/configs/sparc32_defconfig
@@ -1,15 +1,21 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.25 3# Linux kernel version: 2.6.28
4# Tue Apr 29 01:28:58 2008 4# Thu Jan 8 16:45:44 2009
5# 5#
6# CONFIG_64BIT is not set
7CONFIG_SPARC=y
8CONFIG_SPARC32=y
9# CONFIG_SPARC64 is not set
10CONFIG_ARCH_DEFCONFIG="arch/sparc/configs/sparc32_defconfig"
11CONFIG_BITS=32
12CONFIG_AUDIT_ARCH=y
6CONFIG_MMU=y 13CONFIG_MMU=y
7CONFIG_HIGHMEM=y 14CONFIG_HIGHMEM=y
8CONFIG_ZONE_DMA=y 15CONFIG_ZONE_DMA=y
9CONFIG_GENERIC_ISA_DMA=y 16CONFIG_GENERIC_ISA_DMA=y
10CONFIG_ARCH_NO_VIRT_TO_BUS=y 17CONFIG_ARCH_NO_VIRT_TO_BUS=y
11CONFIG_OF=y 18CONFIG_OF=y
12CONFIG_HZ=100
13CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
14 20
15# 21#
@@ -66,31 +72,30 @@ CONFIG_SIGNALFD=y
66CONFIG_TIMERFD=y 72CONFIG_TIMERFD=y
67CONFIG_EVENTFD=y 73CONFIG_EVENTFD=y
68CONFIG_SHMEM=y 74CONFIG_SHMEM=y
75CONFIG_AIO=y
69CONFIG_VM_EVENT_COUNTERS=y 76CONFIG_VM_EVENT_COUNTERS=y
77CONFIG_PCI_QUIRKS=y
70CONFIG_SLAB=y 78CONFIG_SLAB=y
71# CONFIG_SLUB is not set 79# CONFIG_SLUB is not set
72# CONFIG_SLOB is not set 80# CONFIG_SLOB is not set
73# CONFIG_PROFILING is not set 81# CONFIG_PROFILING is not set
74# CONFIG_MARKERS is not set
75CONFIG_HAVE_OPROFILE=y 82CONFIG_HAVE_OPROFILE=y
76# CONFIG_HAVE_KPROBES is not set 83CONFIG_HAVE_ARCH_TRACEHOOK=y
77# CONFIG_HAVE_KRETPROBES is not set 84# CONFIG_HAVE_GENERIC_DMA_COHERENT is not set
78CONFIG_PROC_PAGE_MONITOR=y
79CONFIG_SLABINFO=y 85CONFIG_SLABINFO=y
80CONFIG_RT_MUTEXES=y 86CONFIG_RT_MUTEXES=y
81# CONFIG_TINY_SHMEM is not set
82CONFIG_BASE_SMALL=0 87CONFIG_BASE_SMALL=0
83CONFIG_MODULES=y 88CONFIG_MODULES=y
89# CONFIG_MODULE_FORCE_LOAD is not set
84CONFIG_MODULE_UNLOAD=y 90CONFIG_MODULE_UNLOAD=y
85# CONFIG_MODULE_FORCE_UNLOAD is not set 91# CONFIG_MODULE_FORCE_UNLOAD is not set
86# CONFIG_MODVERSIONS is not set 92# CONFIG_MODVERSIONS is not set
87# CONFIG_MODULE_SRCVERSION_ALL is not set 93# CONFIG_MODULE_SRCVERSION_ALL is not set
88CONFIG_KMOD=y
89CONFIG_BLOCK=y 94CONFIG_BLOCK=y
90# CONFIG_LBD is not set 95# CONFIG_LBD is not set
91# CONFIG_BLK_DEV_IO_TRACE is not set 96# CONFIG_BLK_DEV_IO_TRACE is not set
92# CONFIG_LSF is not set
93# CONFIG_BLK_DEV_BSG is not set 97# CONFIG_BLK_DEV_BSG is not set
98# CONFIG_BLK_DEV_INTEGRITY is not set
94 99
95# 100#
96# IO Schedulers 101# IO Schedulers
@@ -105,59 +110,73 @@ CONFIG_DEFAULT_CFQ=y
105# CONFIG_DEFAULT_NOOP is not set 110# CONFIG_DEFAULT_NOOP is not set
106CONFIG_DEFAULT_IOSCHED="cfq" 111CONFIG_DEFAULT_IOSCHED="cfq"
107CONFIG_CLASSIC_RCU=y 112CONFIG_CLASSIC_RCU=y
113# CONFIG_TREE_RCU is not set
114# CONFIG_PREEMPT_RCU is not set
115# CONFIG_TREE_RCU_TRACE is not set
116# CONFIG_PREEMPT_RCU_TRACE is not set
117# CONFIG_FREEZER is not set
108 118
109# 119#
110# General machine setup 120# Processor type and features
111# 121#
112# CONFIG_SMP is not set 122# CONFIG_SMP is not set
113CONFIG_SPARC=y 123# CONFIG_HZ_100 is not set
114CONFIG_SPARC32=y 124CONFIG_HZ_250=y
115CONFIG_SBUS=y 125# CONFIG_HZ_300 is not set
116CONFIG_SBUSCHAR=y 126# CONFIG_HZ_1000 is not set
117CONFIG_SERIAL_CONSOLE=y 127CONFIG_HZ=250
118CONFIG_SUN_AUXIO=y 128# CONFIG_SCHED_HRTICK is not set
119CONFIG_SUN_IO=y
120CONFIG_RWSEM_GENERIC_SPINLOCK=y 129CONFIG_RWSEM_GENERIC_SPINLOCK=y
121CONFIG_GENERIC_FIND_NEXT_BIT=y 130CONFIG_GENERIC_FIND_NEXT_BIT=y
122CONFIG_GENERIC_HWEIGHT=y 131CONFIG_GENERIC_HWEIGHT=y
123CONFIG_GENERIC_CALIBRATE_DELAY=y 132CONFIG_GENERIC_CALIBRATE_DELAY=y
124CONFIG_ARCH_MAY_HAVE_PC_FDC=y 133CONFIG_ARCH_MAY_HAVE_PC_FDC=y
125# CONFIG_ARCH_HAS_ILOG2_U32 is not set
126# CONFIG_ARCH_HAS_ILOG2_U64 is not set
127CONFIG_EMULATED_CMPXCHG=y 134CONFIG_EMULATED_CMPXCHG=y
128CONFIG_SUN_PM=y
129# CONFIG_SUN4 is not set
130CONFIG_PCI=y
131CONFIG_PCI_SYSCALL=y
132# CONFIG_ARCH_SUPPORTS_MSI is not set
133CONFIG_PCI_LEGACY=y
134# CONFIG_PCI_DEBUG is not set
135# CONFIG_NO_DMA is not set
136CONFIG_SUN_OPENPROMFS=m
137# CONFIG_SPARC_LED is not set
138CONFIG_BINFMT_ELF=y
139CONFIG_BINFMT_MISC=m
140CONFIG_SELECT_MEMORY_MODEL=y 135CONFIG_SELECT_MEMORY_MODEL=y
141CONFIG_FLATMEM_MANUAL=y 136CONFIG_FLATMEM_MANUAL=y
142# CONFIG_DISCONTIGMEM_MANUAL is not set 137# CONFIG_DISCONTIGMEM_MANUAL is not set
143# CONFIG_SPARSEMEM_MANUAL is not set 138# CONFIG_SPARSEMEM_MANUAL is not set
144CONFIG_FLATMEM=y 139CONFIG_FLATMEM=y
145CONFIG_FLAT_NODE_MEM_MAP=y 140CONFIG_FLAT_NODE_MEM_MAP=y
146# CONFIG_SPARSEMEM_STATIC is not set 141CONFIG_PAGEFLAGS_EXTENDED=y
147# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
148CONFIG_SPLIT_PTLOCK_CPUS=4 142CONFIG_SPLIT_PTLOCK_CPUS=4
149# CONFIG_RESOURCES_64BIT is not set 143# CONFIG_PHYS_ADDR_T_64BIT is not set
150CONFIG_ZONE_DMA_FLAG=1 144CONFIG_ZONE_DMA_FLAG=1
151CONFIG_BOUNCE=y 145CONFIG_BOUNCE=y
146CONFIG_UNEVICTABLE_LRU=y
147CONFIG_SUN_PM=y
148# CONFIG_SPARC_LED is not set
149CONFIG_SERIAL_CONSOLE=y
152 150
153# 151#
154# Networking 152# Bus options (PCI etc.)
155# 153#
154CONFIG_SBUS=y
155CONFIG_SBUSCHAR=y
156CONFIG_PCI=y
157CONFIG_PCI_SYSCALL=y
158# CONFIG_ARCH_SUPPORTS_MSI is not set
159CONFIG_PCI_LEGACY=y
160# CONFIG_PCI_DEBUG is not set
161# CONFIG_PCI_STUB is not set
162# CONFIG_PCCARD is not set
163CONFIG_SUN_OPENPROMFS=m
164CONFIG_SPARC32_PCI=y
165
166#
167# Executable file formats
168#
169CONFIG_BINFMT_ELF=y
170# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
171# CONFIG_HAVE_AOUT is not set
172CONFIG_BINFMT_MISC=m
156CONFIG_NET=y 173CONFIG_NET=y
157 174
158# 175#
159# Networking options 176# Networking options
160# 177#
178# CONFIG_NET_NS is not set
179CONFIG_COMPAT_NET_DEV_OPS=y
161CONFIG_PACKET=y 180CONFIG_PACKET=y
162# CONFIG_PACKET_MMAP is not set 181# CONFIG_PACKET_MMAP is not set
163CONFIG_UNIX=y 182CONFIG_UNIX=y
@@ -166,6 +185,7 @@ CONFIG_XFRM_USER=m
166# CONFIG_XFRM_SUB_POLICY is not set 185# CONFIG_XFRM_SUB_POLICY is not set
167# CONFIG_XFRM_MIGRATE is not set 186# CONFIG_XFRM_MIGRATE is not set
168# CONFIG_XFRM_STATISTICS is not set 187# CONFIG_XFRM_STATISTICS is not set
188CONFIG_XFRM_IPCOMP=y
169CONFIG_NET_KEY=m 189CONFIG_NET_KEY=m
170# CONFIG_NET_KEY_MIGRATE is not set 190# CONFIG_NET_KEY_MIGRATE is not set
171CONFIG_INET=y 191CONFIG_INET=y
@@ -221,6 +241,7 @@ CONFIG_IPV6_TUNNEL=m
221# CONFIG_TIPC is not set 241# CONFIG_TIPC is not set
222# CONFIG_ATM is not set 242# CONFIG_ATM is not set
223# CONFIG_BRIDGE is not set 243# CONFIG_BRIDGE is not set
244# CONFIG_NET_DSA is not set
224# CONFIG_VLAN_8021Q is not set 245# CONFIG_VLAN_8021Q is not set
225# CONFIG_DECNET is not set 246# CONFIG_DECNET is not set
226# CONFIG_LLC2 is not set 247# CONFIG_LLC2 is not set
@@ -231,6 +252,7 @@ CONFIG_IPV6_TUNNEL=m
231# CONFIG_ECONET is not set 252# CONFIG_ECONET is not set
232# CONFIG_WAN_ROUTER is not set 253# CONFIG_WAN_ROUTER is not set
233# CONFIG_NET_SCHED is not set 254# CONFIG_NET_SCHED is not set
255# CONFIG_DCB is not set
234 256
235# 257#
236# Network testing 258# Network testing
@@ -241,14 +263,14 @@ CONFIG_NET_PKTGEN=m
241# CONFIG_IRDA is not set 263# CONFIG_IRDA is not set
242# CONFIG_BT is not set 264# CONFIG_BT is not set
243# CONFIG_AF_RXRPC is not set 265# CONFIG_AF_RXRPC is not set
244 266# CONFIG_PHONET is not set
245# 267CONFIG_WIRELESS=y
246# Wireless
247#
248# CONFIG_CFG80211 is not set 268# CONFIG_CFG80211 is not set
269CONFIG_WIRELESS_OLD_REGULATORY=y
249# CONFIG_WIRELESS_EXT is not set 270# CONFIG_WIRELESS_EXT is not set
271# CONFIG_LIB80211 is not set
250# CONFIG_MAC80211 is not set 272# CONFIG_MAC80211 is not set
251# CONFIG_IEEE80211 is not set 273# CONFIG_WIMAX is not set
252# CONFIG_RFKILL is not set 274# CONFIG_RFKILL is not set
253# CONFIG_NET_9P is not set 275# CONFIG_NET_9P is not set
254 276
@@ -262,7 +284,9 @@ CONFIG_NET_PKTGEN=m
262CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 284CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
263CONFIG_STANDALONE=y 285CONFIG_STANDALONE=y
264CONFIG_PREVENT_FIRMWARE_BUILD=y 286CONFIG_PREVENT_FIRMWARE_BUILD=y
265# CONFIG_FW_LOADER is not set 287CONFIG_FW_LOADER=y
288CONFIG_FIRMWARE_IN_KERNEL=y
289CONFIG_EXTRA_FIRMWARE=""
266# CONFIG_DEBUG_DRIVER is not set 290# CONFIG_DEBUG_DRIVER is not set
267# CONFIG_DEBUG_DEVRES is not set 291# CONFIG_DEBUG_DEVRES is not set
268# CONFIG_SYS_HYPERVISOR is not set 292# CONFIG_SYS_HYPERVISOR is not set
@@ -286,12 +310,15 @@ CONFIG_BLK_DEV_RAM_SIZE=4096
286# CONFIG_BLK_DEV_XIP is not set 310# CONFIG_BLK_DEV_XIP is not set
287# CONFIG_CDROM_PKTCDVD is not set 311# CONFIG_CDROM_PKTCDVD is not set
288# CONFIG_ATA_OVER_ETH is not set 312# CONFIG_ATA_OVER_ETH is not set
313# CONFIG_BLK_DEV_HD is not set
289CONFIG_MISC_DEVICES=y 314CONFIG_MISC_DEVICES=y
290# CONFIG_PHANTOM is not set 315# CONFIG_PHANTOM is not set
291# CONFIG_EEPROM_93CX6 is not set 316# CONFIG_EEPROM_93CX6 is not set
292# CONFIG_SGI_IOC4 is not set 317# CONFIG_SGI_IOC4 is not set
293# CONFIG_TIFM_CORE is not set 318# CONFIG_TIFM_CORE is not set
294# CONFIG_ENCLOSURE_SERVICES is not set 319# CONFIG_ENCLOSURE_SERVICES is not set
320# CONFIG_HP_ILO is not set
321# CONFIG_C2PORT is not set
295CONFIG_HAVE_IDE=y 322CONFIG_HAVE_IDE=y
296# CONFIG_IDE is not set 323# CONFIG_IDE is not set
297 324
@@ -335,6 +362,7 @@ CONFIG_SCSI_SPI_ATTRS=y
335# CONFIG_SCSI_SRP_ATTRS is not set 362# CONFIG_SCSI_SRP_ATTRS is not set
336CONFIG_SCSI_LOWLEVEL=y 363CONFIG_SCSI_LOWLEVEL=y
337# CONFIG_ISCSI_TCP is not set 364# CONFIG_ISCSI_TCP is not set
365# CONFIG_SCSI_CXGB3_ISCSI is not set
338# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 366# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
339# CONFIG_SCSI_3W_9XXX is not set 367# CONFIG_SCSI_3W_9XXX is not set
340# CONFIG_SCSI_ACARD is not set 368# CONFIG_SCSI_ACARD is not set
@@ -348,6 +376,8 @@ CONFIG_SCSI_LOWLEVEL=y
348# CONFIG_MEGARAID_LEGACY is not set 376# CONFIG_MEGARAID_LEGACY is not set
349# CONFIG_MEGARAID_SAS is not set 377# CONFIG_MEGARAID_SAS is not set
350# CONFIG_SCSI_HPTIOP is not set 378# CONFIG_SCSI_HPTIOP is not set
379# CONFIG_LIBFC is not set
380# CONFIG_FCOE is not set
351# CONFIG_SCSI_DMX3191D is not set 381# CONFIG_SCSI_DMX3191D is not set
352# CONFIG_SCSI_FUTURE_DOMAIN is not set 382# CONFIG_SCSI_FUTURE_DOMAIN is not set
353# CONFIG_SCSI_IPS is not set 383# CONFIG_SCSI_IPS is not set
@@ -367,6 +397,7 @@ CONFIG_SCSI_QLOGICPTI=m
367# CONFIG_SCSI_DEBUG is not set 397# CONFIG_SCSI_DEBUG is not set
368CONFIG_SCSI_SUNESP=y 398CONFIG_SCSI_SUNESP=y
369# CONFIG_SCSI_SRP is not set 399# CONFIG_SCSI_SRP is not set
400# CONFIG_SCSI_DH is not set
370# CONFIG_ATA is not set 401# CONFIG_ATA is not set
371# CONFIG_MD is not set 402# CONFIG_MD is not set
372# CONFIG_FUSION is not set 403# CONFIG_FUSION is not set
@@ -374,11 +405,14 @@ CONFIG_SCSI_SUNESP=y
374# 405#
375# IEEE 1394 (FireWire) support 406# IEEE 1394 (FireWire) support
376# 407#
408
409#
410# Enable only one of the two stacks, unless you know what you are doing
411#
377# CONFIG_FIREWIRE is not set 412# CONFIG_FIREWIRE is not set
378# CONFIG_IEEE1394 is not set 413# CONFIG_IEEE1394 is not set
379# CONFIG_I2O is not set 414# CONFIG_I2O is not set
380CONFIG_NETDEVICES=y 415CONFIG_NETDEVICES=y
381# CONFIG_NETDEVICES_MULTIQUEUE is not set
382CONFIG_DUMMY=m 416CONFIG_DUMMY=m
383# CONFIG_BONDING is not set 417# CONFIG_BONDING is not set
384# CONFIG_MACVLAN is not set 418# CONFIG_MACVLAN is not set
@@ -402,14 +436,16 @@ CONFIG_SUNQE=m
402# CONFIG_IBM_NEW_EMAC_RGMII is not set 436# CONFIG_IBM_NEW_EMAC_RGMII is not set
403# CONFIG_IBM_NEW_EMAC_TAH is not set 437# CONFIG_IBM_NEW_EMAC_TAH is not set
404# CONFIG_IBM_NEW_EMAC_EMAC4 is not set 438# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
439# CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL is not set
440# CONFIG_IBM_NEW_EMAC_MAL_CLR_ICINTSTAT is not set
441# CONFIG_IBM_NEW_EMAC_MAL_COMMON_ERR is not set
405# CONFIG_NET_PCI is not set 442# CONFIG_NET_PCI is not set
406# CONFIG_B44 is not set 443# CONFIG_B44 is not set
444# CONFIG_ATL2 is not set
407CONFIG_NETDEV_1000=y 445CONFIG_NETDEV_1000=y
408# CONFIG_ACENIC is not set 446# CONFIG_ACENIC is not set
409# CONFIG_DL2K is not set 447# CONFIG_DL2K is not set
410# CONFIG_E1000 is not set 448# CONFIG_E1000 is not set
411# CONFIG_E1000E is not set
412# CONFIG_E1000E_ENABLED is not set
413# CONFIG_IP1000 is not set 449# CONFIG_IP1000 is not set
414# CONFIG_IGB is not set 450# CONFIG_IGB is not set
415# CONFIG_MYRI_SBUS is not set 451# CONFIG_MYRI_SBUS is not set
@@ -425,18 +461,25 @@ CONFIG_NETDEV_1000=y
425# CONFIG_BNX2 is not set 461# CONFIG_BNX2 is not set
426# CONFIG_QLA3XXX is not set 462# CONFIG_QLA3XXX is not set
427# CONFIG_ATL1 is not set 463# CONFIG_ATL1 is not set
464# CONFIG_ATL1E is not set
465# CONFIG_JME is not set
428CONFIG_NETDEV_10000=y 466CONFIG_NETDEV_10000=y
429# CONFIG_CHELSIO_T1 is not set 467# CONFIG_CHELSIO_T1 is not set
468CONFIG_CHELSIO_T3_DEPENDS=y
430# CONFIG_CHELSIO_T3 is not set 469# CONFIG_CHELSIO_T3 is not set
470# CONFIG_ENIC is not set
431# CONFIG_IXGBE is not set 471# CONFIG_IXGBE is not set
432# CONFIG_IXGB is not set 472# CONFIG_IXGB is not set
433# CONFIG_S2IO is not set 473# CONFIG_S2IO is not set
434# CONFIG_MYRI10GE is not set 474# CONFIG_MYRI10GE is not set
435# CONFIG_NETXEN_NIC is not set 475# CONFIG_NETXEN_NIC is not set
436# CONFIG_NIU is not set 476# CONFIG_NIU is not set
477# CONFIG_MLX4_EN is not set
437# CONFIG_MLX4_CORE is not set 478# CONFIG_MLX4_CORE is not set
438# CONFIG_TEHUTI is not set 479# CONFIG_TEHUTI is not set
439# CONFIG_BNX2X is not set 480# CONFIG_BNX2X is not set
481# CONFIG_QLGE is not set
482# CONFIG_SFC is not set
440# CONFIG_TR is not set 483# CONFIG_TR is not set
441 484
442# 485#
@@ -445,6 +488,10 @@ CONFIG_NETDEV_10000=y
445# CONFIG_WLAN_PRE80211 is not set 488# CONFIG_WLAN_PRE80211 is not set
446# CONFIG_WLAN_80211 is not set 489# CONFIG_WLAN_80211 is not set
447# CONFIG_IWLWIFI_LEDS is not set 490# CONFIG_IWLWIFI_LEDS is not set
491
492#
493# Enable WiMAX (Networking options) to see the WiMAX drivers
494#
448# CONFIG_WAN is not set 495# CONFIG_WAN is not set
449# CONFIG_FDDI is not set 496# CONFIG_FDDI is not set
450# CONFIG_HIPPI is not set 497# CONFIG_HIPPI is not set
@@ -492,9 +539,11 @@ CONFIG_MOUSE_PS2_LOGIPS2PP=y
492CONFIG_MOUSE_PS2_SYNAPTICS=y 539CONFIG_MOUSE_PS2_SYNAPTICS=y
493CONFIG_MOUSE_PS2_LIFEBOOK=y 540CONFIG_MOUSE_PS2_LIFEBOOK=y
494CONFIG_MOUSE_PS2_TRACKPOINT=y 541CONFIG_MOUSE_PS2_TRACKPOINT=y
542# CONFIG_MOUSE_PS2_ELANTECH is not set
495# CONFIG_MOUSE_PS2_TOUCHKIT is not set 543# CONFIG_MOUSE_PS2_TOUCHKIT is not set
496CONFIG_MOUSE_SERIAL=m 544CONFIG_MOUSE_SERIAL=m
497# CONFIG_MOUSE_APPLETOUCH is not set 545# CONFIG_MOUSE_APPLETOUCH is not set
546# CONFIG_MOUSE_BCM5974 is not set
498# CONFIG_MOUSE_VSXXXAA is not set 547# CONFIG_MOUSE_VSXXXAA is not set
499# CONFIG_INPUT_JOYSTICK is not set 548# CONFIG_INPUT_JOYSTICK is not set
500# CONFIG_INPUT_TABLET is not set 549# CONFIG_INPUT_TABLET is not set
@@ -516,15 +565,18 @@ CONFIG_SERIO_LIBPS2=m
516# Character devices 565# Character devices
517# 566#
518CONFIG_VT=y 567CONFIG_VT=y
568CONFIG_CONSOLE_TRANSLATIONS=y
519CONFIG_VT_CONSOLE=y 569CONFIG_VT_CONSOLE=y
520CONFIG_HW_CONSOLE=y 570CONFIG_HW_CONSOLE=y
521# CONFIG_VT_HW_CONSOLE_BINDING is not set 571# CONFIG_VT_HW_CONSOLE_BINDING is not set
572CONFIG_DEVKMEM=y
522# CONFIG_SERIAL_NONSTANDARD is not set 573# CONFIG_SERIAL_NONSTANDARD is not set
523# CONFIG_NOZOMI is not set 574# CONFIG_NOZOMI is not set
524 575
525# 576#
526# Serial drivers 577# Serial drivers
527# 578#
579# CONFIG_SERIAL_8250 is not set
528 580
529# 581#
530# Non-8250 serial port support 582# Non-8250 serial port support
@@ -540,23 +592,20 @@ CONFIG_SERIAL_CORE_CONSOLE=y
540CONFIG_CONSOLE_POLL=y 592CONFIG_CONSOLE_POLL=y
541# CONFIG_SERIAL_JSM is not set 593# CONFIG_SERIAL_JSM is not set
542CONFIG_UNIX98_PTYS=y 594CONFIG_UNIX98_PTYS=y
595# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
543CONFIG_LEGACY_PTYS=y 596CONFIG_LEGACY_PTYS=y
544CONFIG_LEGACY_PTY_COUNT=256 597CONFIG_LEGACY_PTY_COUNT=256
545# CONFIG_IPMI_HANDLER is not set 598# CONFIG_IPMI_HANDLER is not set
546CONFIG_HW_RANDOM=m 599CONFIG_HW_RANDOM=m
547CONFIG_JS_RTC=m
548# CONFIG_R3964 is not set 600# CONFIG_R3964 is not set
549# CONFIG_APPLICOM is not set 601# CONFIG_APPLICOM is not set
550# CONFIG_RAW_DRIVER is not set 602# CONFIG_RAW_DRIVER is not set
551# CONFIG_TCG_TPM is not set 603# CONFIG_TCG_TPM is not set
552CONFIG_DEVPORT=y 604CONFIG_DEVPORT=y
553# CONFIG_I2C is not set 605# CONFIG_I2C is not set
554
555#
556# SPI support
557#
558# CONFIG_SPI is not set 606# CONFIG_SPI is not set
559# CONFIG_SPI_MASTER is not set 607CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y
608# CONFIG_GPIOLIB is not set
560# CONFIG_W1 is not set 609# CONFIG_W1 is not set
561# CONFIG_POWER_SUPPLY is not set 610# CONFIG_POWER_SUPPLY is not set
562CONFIG_HWMON=y 611CONFIG_HWMON=y
@@ -577,25 +626,38 @@ CONFIG_HWMON=y
577# CONFIG_SENSORS_W83627EHF is not set 626# CONFIG_SENSORS_W83627EHF is not set
578# CONFIG_HWMON_DEBUG_CHIP is not set 627# CONFIG_HWMON_DEBUG_CHIP is not set
579# CONFIG_THERMAL is not set 628# CONFIG_THERMAL is not set
629# CONFIG_THERMAL_HWMON is not set
580# CONFIG_WATCHDOG is not set 630# CONFIG_WATCHDOG is not set
631CONFIG_SSB_POSSIBLE=y
581 632
582# 633#
583# Sonics Silicon Backplane 634# Sonics Silicon Backplane
584# 635#
585CONFIG_SSB_POSSIBLE=y
586# CONFIG_SSB is not set 636# CONFIG_SSB is not set
587 637
588# 638#
589# Multifunction device drivers 639# Multifunction device drivers
590# 640#
641# CONFIG_MFD_CORE is not set
591# CONFIG_MFD_SM501 is not set 642# CONFIG_MFD_SM501 is not set
592# CONFIG_HTC_PASIC3 is not set 643# CONFIG_HTC_PASIC3 is not set
644# CONFIG_MFD_TMIO is not set
645# CONFIG_REGULATOR is not set
593 646
594# 647#
595# Multimedia devices 648# Multimedia devices
596# 649#
650
651#
652# Multimedia core support
653#
597# CONFIG_VIDEO_DEV is not set 654# CONFIG_VIDEO_DEV is not set
598# CONFIG_DVB_CORE is not set 655# CONFIG_DVB_CORE is not set
656# CONFIG_VIDEO_MEDIA is not set
657
658#
659# Multimedia drivers
660#
599# CONFIG_DAB is not set 661# CONFIG_DAB is not set
600 662
601# 663#
@@ -616,15 +678,17 @@ CONFIG_SSB_POSSIBLE=y
616# 678#
617# CONFIG_PROM_CONSOLE is not set 679# CONFIG_PROM_CONSOLE is not set
618CONFIG_DUMMY_CONSOLE=y 680CONFIG_DUMMY_CONSOLE=y
619
620#
621# Sound
622#
623# CONFIG_SOUND is not set 681# CONFIG_SOUND is not set
624CONFIG_HID_SUPPORT=y 682CONFIG_HID_SUPPORT=y
625CONFIG_HID=y 683CONFIG_HID=y
626# CONFIG_HID_DEBUG is not set 684# CONFIG_HID_DEBUG is not set
627# CONFIG_HIDRAW is not set 685# CONFIG_HIDRAW is not set
686# CONFIG_HID_PID is not set
687
688#
689# Special HID drivers
690#
691CONFIG_HID_COMPAT=y
628CONFIG_USB_SUPPORT=y 692CONFIG_USB_SUPPORT=y
629CONFIG_USB_ARCH_HAS_HCD=y 693CONFIG_USB_ARCH_HAS_HCD=y
630CONFIG_USB_ARCH_HAS_OHCI=y 694CONFIG_USB_ARCH_HAS_OHCI=y
@@ -632,32 +696,71 @@ CONFIG_USB_ARCH_HAS_EHCI=y
632# CONFIG_USB is not set 696# CONFIG_USB is not set
633 697
634# 698#
635# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 699# Enable Host or Gadget support to see Inventra options
700#
701
702#
703# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
636# 704#
637# CONFIG_USB_GADGET is not set 705# CONFIG_USB_GADGET is not set
706
707#
708# OTG and related infrastructure
709#
710# CONFIG_UWB is not set
638# CONFIG_MMC is not set 711# CONFIG_MMC is not set
639# CONFIG_MEMSTICK is not set 712# CONFIG_MEMSTICK is not set
640# CONFIG_NEW_LEDS is not set 713# CONFIG_NEW_LEDS is not set
714# CONFIG_ACCESSIBILITY is not set
641# CONFIG_INFINIBAND is not set 715# CONFIG_INFINIBAND is not set
642# CONFIG_RTC_CLASS is not set 716CONFIG_RTC_LIB=y
717CONFIG_RTC_CLASS=y
718CONFIG_RTC_HCTOSYS=y
719CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
720# CONFIG_RTC_DEBUG is not set
721
722#
723# RTC interfaces
724#
725CONFIG_RTC_INTF_SYSFS=y
726CONFIG_RTC_INTF_PROC=y
727CONFIG_RTC_INTF_DEV=y
728# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
729# CONFIG_RTC_DRV_TEST is not set
730
731#
732# SPI RTC drivers
733#
734
735#
736# Platform RTC drivers
737#
738# CONFIG_RTC_DRV_DS1286 is not set
739# CONFIG_RTC_DRV_DS1511 is not set
740# CONFIG_RTC_DRV_DS1553 is not set
741# CONFIG_RTC_DRV_DS1742 is not set
742# CONFIG_RTC_DRV_STK17TA8 is not set
743# CONFIG_RTC_DRV_M48T86 is not set
744# CONFIG_RTC_DRV_M48T35 is not set
745CONFIG_RTC_DRV_M48T59=y
746# CONFIG_RTC_DRV_BQ4802 is not set
747# CONFIG_RTC_DRV_V3020 is not set
748
749#
750# on-CPU RTC drivers
751#
752# CONFIG_DMADEVICES is not set
643# CONFIG_UIO is not set 753# CONFIG_UIO is not set
754# CONFIG_STAGING is not set
644 755
645# 756#
646# Misc Linux/SPARC drivers 757# Misc Linux/SPARC drivers
647# 758#
648CONFIG_SUN_OPENPROMIO=m 759CONFIG_SUN_OPENPROMIO=m
649CONFIG_SUN_MOSTEK_RTC=m
650# CONFIG_SUN_BPP is not set
651# CONFIG_SUN_VIDEOPIX is not set
652# CONFIG_TADPOLE_TS102_UCTRL is not set 760# CONFIG_TADPOLE_TS102_UCTRL is not set
653# CONFIG_SUN_JSFLASH is not set 761# CONFIG_SUN_JSFLASH is not set
654 762
655# 763#
656# Unix98 PTY support
657#
658CONFIG_UNIX98_PTY_COUNT=256
659
660#
661# File systems 764# File systems
662# 765#
663CONFIG_EXT2_FS=y 766CONFIG_EXT2_FS=y
@@ -666,11 +769,12 @@ CONFIG_EXT2_FS_POSIX_ACL=y
666CONFIG_EXT2_FS_SECURITY=y 769CONFIG_EXT2_FS_SECURITY=y
667# CONFIG_EXT2_FS_XIP is not set 770# CONFIG_EXT2_FS_XIP is not set
668# CONFIG_EXT3_FS is not set 771# CONFIG_EXT3_FS is not set
669# CONFIG_EXT4DEV_FS is not set 772# CONFIG_EXT4_FS is not set
670CONFIG_FS_MBCACHE=y 773CONFIG_FS_MBCACHE=y
671# CONFIG_REISERFS_FS is not set 774# CONFIG_REISERFS_FS is not set
672# CONFIG_JFS_FS is not set 775# CONFIG_JFS_FS is not set
673CONFIG_FS_POSIX_ACL=y 776CONFIG_FS_POSIX_ACL=y
777CONFIG_FILE_LOCKING=y
674# CONFIG_XFS_FS is not set 778# CONFIG_XFS_FS is not set
675# CONFIG_OCFS2_FS is not set 779# CONFIG_OCFS2_FS is not set
676CONFIG_DNOTIFY=y 780CONFIG_DNOTIFY=y
@@ -702,14 +806,12 @@ CONFIG_ISO9660_FS=m
702CONFIG_PROC_FS=y 806CONFIG_PROC_FS=y
703CONFIG_PROC_KCORE=y 807CONFIG_PROC_KCORE=y
704CONFIG_PROC_SYSCTL=y 808CONFIG_PROC_SYSCTL=y
809CONFIG_PROC_PAGE_MONITOR=y
705CONFIG_SYSFS=y 810CONFIG_SYSFS=y
706# CONFIG_TMPFS is not set 811# CONFIG_TMPFS is not set
707# CONFIG_HUGETLB_PAGE is not set 812# CONFIG_HUGETLB_PAGE is not set
708# CONFIG_CONFIGFS_FS is not set 813# CONFIG_CONFIGFS_FS is not set
709 814CONFIG_MISC_FILESYSTEMS=y
710#
711# Miscellaneous filesystems
712#
713# CONFIG_ADFS_FS is not set 815# CONFIG_ADFS_FS is not set
714# CONFIG_AFFS_FS is not set 816# CONFIG_AFFS_FS is not set
715# CONFIG_HFS_FS is not set 817# CONFIG_HFS_FS is not set
@@ -720,6 +822,7 @@ CONFIG_SYSFS=y
720# CONFIG_CRAMFS is not set 822# CONFIG_CRAMFS is not set
721# CONFIG_VXFS_FS is not set 823# CONFIG_VXFS_FS is not set
722# CONFIG_MINIX_FS is not set 824# CONFIG_MINIX_FS is not set
825# CONFIG_OMFS_FS is not set
723# CONFIG_HPFS_FS is not set 826# CONFIG_HPFS_FS is not set
724# CONFIG_QNX4FS_FS is not set 827# CONFIG_QNX4FS_FS is not set
725CONFIG_ROMFS_FS=m 828CONFIG_ROMFS_FS=m
@@ -729,13 +832,13 @@ CONFIG_NETWORK_FILESYSTEMS=y
729CONFIG_NFS_FS=y 832CONFIG_NFS_FS=y
730# CONFIG_NFS_V3 is not set 833# CONFIG_NFS_V3 is not set
731# CONFIG_NFS_V4 is not set 834# CONFIG_NFS_V4 is not set
732# CONFIG_NFSD is not set
733CONFIG_ROOT_NFS=y 835CONFIG_ROOT_NFS=y
836# CONFIG_NFSD is not set
734CONFIG_LOCKD=y 837CONFIG_LOCKD=y
735CONFIG_NFS_COMMON=y 838CONFIG_NFS_COMMON=y
736CONFIG_SUNRPC=y 839CONFIG_SUNRPC=y
737CONFIG_SUNRPC_GSS=m 840CONFIG_SUNRPC_GSS=m
738# CONFIG_SUNRPC_BIND34 is not set 841# CONFIG_SUNRPC_REGISTER_V4 is not set
739CONFIG_RPCSEC_GSS_KRB5=m 842CONFIG_RPCSEC_GSS_KRB5=m
740# CONFIG_RPCSEC_GSS_SPKM3 is not set 843# CONFIG_RPCSEC_GSS_SPKM3 is not set
741# CONFIG_SMB_FS is not set 844# CONFIG_SMB_FS is not set
@@ -806,9 +909,12 @@ CONFIG_MAGIC_SYSRQ=y
806# CONFIG_HEADERS_CHECK is not set 909# CONFIG_HEADERS_CHECK is not set
807CONFIG_DEBUG_KERNEL=y 910CONFIG_DEBUG_KERNEL=y
808CONFIG_DETECT_SOFTLOCKUP=y 911CONFIG_DETECT_SOFTLOCKUP=y
912# CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC is not set
913CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0
809# CONFIG_SCHED_DEBUG is not set 914# CONFIG_SCHED_DEBUG is not set
810# CONFIG_SCHEDSTATS is not set 915# CONFIG_SCHEDSTATS is not set
811# CONFIG_TIMER_STATS is not set 916# CONFIG_TIMER_STATS is not set
917# CONFIG_DEBUG_OBJECTS is not set
812# CONFIG_DEBUG_SLAB is not set 918# CONFIG_DEBUG_SLAB is not set
813# CONFIG_DEBUG_RT_MUTEXES is not set 919# CONFIG_DEBUG_RT_MUTEXES is not set
814# CONFIG_RT_MUTEX_TESTER is not set 920# CONFIG_RT_MUTEX_TESTER is not set
@@ -822,37 +928,59 @@ CONFIG_DEBUG_BUGVERBOSE=y
822# CONFIG_DEBUG_INFO is not set 928# CONFIG_DEBUG_INFO is not set
823# CONFIG_DEBUG_VM is not set 929# CONFIG_DEBUG_VM is not set
824# CONFIG_DEBUG_WRITECOUNT is not set 930# CONFIG_DEBUG_WRITECOUNT is not set
931CONFIG_DEBUG_MEMORY_INIT=y
825# CONFIG_DEBUG_LIST is not set 932# CONFIG_DEBUG_LIST is not set
826# CONFIG_DEBUG_SG is not set 933# CONFIG_DEBUG_SG is not set
827CONFIG_FRAME_POINTER=y 934# CONFIG_DEBUG_NOTIFIERS is not set
828# CONFIG_BOOT_PRINTK_DELAY is not set 935# CONFIG_BOOT_PRINTK_DELAY is not set
829# CONFIG_RCU_TORTURE_TEST is not set 936# CONFIG_RCU_TORTURE_TEST is not set
937# CONFIG_RCU_CPU_STALL_DETECTOR is not set
830# CONFIG_BACKTRACE_SELF_TEST is not set 938# CONFIG_BACKTRACE_SELF_TEST is not set
939# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
831# CONFIG_FAULT_INJECTION is not set 940# CONFIG_FAULT_INJECTION is not set
941# CONFIG_SYSCTL_SYSCALL_CHECK is not set
942
943#
944# Tracers
945#
946# CONFIG_SCHED_TRACER is not set
947# CONFIG_CONTEXT_SWITCH_TRACER is not set
948# CONFIG_BOOT_TRACER is not set
949# CONFIG_TRACE_BRANCH_PROFILING is not set
950# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
832# CONFIG_SAMPLES is not set 951# CONFIG_SAMPLES is not set
833CONFIG_KGDB=y
834CONFIG_HAVE_ARCH_KGDB=y 952CONFIG_HAVE_ARCH_KGDB=y
953CONFIG_KGDB=y
835CONFIG_KGDB_SERIAL_CONSOLE=y 954CONFIG_KGDB_SERIAL_CONSOLE=y
836CONFIG_KGDB_TESTS=y 955CONFIG_KGDB_TESTS=y
837# CONFIG_KGDB_TESTS_ON_BOOT is not set 956# CONFIG_KGDB_TESTS_ON_BOOT is not set
838# CONFIG_DEBUG_STACK_USAGE is not set 957# CONFIG_DEBUG_STACK_USAGE is not set
958# CONFIG_STACK_DEBUG is not set
839 959
840# 960#
841# Security options 961# Security options
842# 962#
843# CONFIG_KEYS is not set 963# CONFIG_KEYS is not set
844# CONFIG_SECURITY is not set 964# CONFIG_SECURITY is not set
965# CONFIG_SECURITYFS is not set
845# CONFIG_SECURITY_FILE_CAPABILITIES is not set 966# CONFIG_SECURITY_FILE_CAPABILITIES is not set
846CONFIG_CRYPTO=y 967CONFIG_CRYPTO=y
847 968
848# 969#
849# Crypto core or helper 970# Crypto core or helper
850# 971#
972# CONFIG_CRYPTO_FIPS is not set
851CONFIG_CRYPTO_ALGAPI=y 973CONFIG_CRYPTO_ALGAPI=y
974CONFIG_CRYPTO_ALGAPI2=y
852CONFIG_CRYPTO_AEAD=y 975CONFIG_CRYPTO_AEAD=y
976CONFIG_CRYPTO_AEAD2=y
853CONFIG_CRYPTO_BLKCIPHER=y 977CONFIG_CRYPTO_BLKCIPHER=y
978CONFIG_CRYPTO_BLKCIPHER2=y
854CONFIG_CRYPTO_HASH=y 979CONFIG_CRYPTO_HASH=y
980CONFIG_CRYPTO_HASH2=y
981CONFIG_CRYPTO_RNG2=y
855CONFIG_CRYPTO_MANAGER=y 982CONFIG_CRYPTO_MANAGER=y
983CONFIG_CRYPTO_MANAGER2=y
856# CONFIG_CRYPTO_GF128MUL is not set 984# CONFIG_CRYPTO_GF128MUL is not set
857CONFIG_CRYPTO_NULL=m 985CONFIG_CRYPTO_NULL=m
858# CONFIG_CRYPTO_CRYPTD is not set 986# CONFIG_CRYPTO_CRYPTD is not set
@@ -890,6 +1018,10 @@ CONFIG_CRYPTO_CRC32C=m
890CONFIG_CRYPTO_MD4=y 1018CONFIG_CRYPTO_MD4=y
891CONFIG_CRYPTO_MD5=y 1019CONFIG_CRYPTO_MD5=y
892CONFIG_CRYPTO_MICHAEL_MIC=m 1020CONFIG_CRYPTO_MICHAEL_MIC=m
1021# CONFIG_CRYPTO_RMD128 is not set
1022# CONFIG_CRYPTO_RMD160 is not set
1023# CONFIG_CRYPTO_RMD256 is not set
1024# CONFIG_CRYPTO_RMD320 is not set
893CONFIG_CRYPTO_SHA1=y 1025CONFIG_CRYPTO_SHA1=y
894CONFIG_CRYPTO_SHA256=m 1026CONFIG_CRYPTO_SHA256=m
895CONFIG_CRYPTO_SHA512=m 1027CONFIG_CRYPTO_SHA512=m
@@ -921,15 +1053,21 @@ CONFIG_CRYPTO_TWOFISH_COMMON=m
921# 1053#
922CONFIG_CRYPTO_DEFLATE=y 1054CONFIG_CRYPTO_DEFLATE=y
923# CONFIG_CRYPTO_LZO is not set 1055# CONFIG_CRYPTO_LZO is not set
1056
1057#
1058# Random Number Generation
1059#
1060# CONFIG_CRYPTO_ANSI_CPRNG is not set
924# CONFIG_CRYPTO_HW is not set 1061# CONFIG_CRYPTO_HW is not set
925 1062
926# 1063#
927# Library routines 1064# Library routines
928# 1065#
929CONFIG_BITREVERSE=y 1066CONFIG_BITREVERSE=y
930# CONFIG_GENERIC_FIND_FIRST_BIT is not set 1067CONFIG_GENERIC_FIND_LAST_BIT=y
931# CONFIG_CRC_CCITT is not set 1068# CONFIG_CRC_CCITT is not set
932# CONFIG_CRC16 is not set 1069# CONFIG_CRC16 is not set
1070# CONFIG_CRC_T10DIF is not set
933# CONFIG_CRC_ITU_T is not set 1071# CONFIG_CRC_ITU_T is not set
934CONFIG_CRC32=y 1072CONFIG_CRC32=y
935# CONFIG_CRC7 is not set 1073# CONFIG_CRC7 is not set
diff --git a/arch/sparc/configs/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig
index 05d19a3e590f..cde19ae78f5a 100644
--- a/arch/sparc/configs/sparc64_defconfig
+++ b/arch/sparc/configs/sparc64_defconfig
@@ -1,27 +1,27 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.28-rc4 3# Linux kernel version: 2.6.28
4# Mon Nov 10 12:35:09 2008 4# Fri Jan 2 18:14:26 2009
5# 5#
6CONFIG_SPARC=y 6CONFIG_SPARC=y
7CONFIG_SPARC64=y 7CONFIG_SPARC64=y
8CONFIG_ARCH_DEFCONFIG="arch/sparc/configs/sparc64_defconfig"
9CONFIG_BITS=64
10CONFIG_64BIT=y
8CONFIG_GENERIC_TIME=y 11CONFIG_GENERIC_TIME=y
9CONFIG_GENERIC_CMOS_UPDATE=y 12CONFIG_GENERIC_CMOS_UPDATE=y
10CONFIG_GENERIC_CLOCKEVENTS=y 13CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_64BIT=y
12CONFIG_MMU=y
13CONFIG_IOMMU_HELPER=y 14CONFIG_IOMMU_HELPER=y
14CONFIG_QUICKLIST=y 15CONFIG_QUICKLIST=y
15CONFIG_STACKTRACE_SUPPORT=y 16CONFIG_STACKTRACE_SUPPORT=y
16CONFIG_LOCKDEP_SUPPORT=y 17CONFIG_LOCKDEP_SUPPORT=y
17CONFIG_ARCH_MAY_HAVE_PC_FDC=y 18CONFIG_HAVE_LATENCYTOP_SUPPORT=y
18# CONFIG_ARCH_HAS_ILOG2_U32 is not set
19# CONFIG_ARCH_HAS_ILOG2_U64 is not set
20CONFIG_AUDIT_ARCH=y 19CONFIG_AUDIT_ARCH=y
21CONFIG_HAVE_SETUP_PER_CPU_AREA=y 20CONFIG_HAVE_SETUP_PER_CPU_AREA=y
21CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
22CONFIG_MMU=y
22CONFIG_ARCH_NO_VIRT_TO_BUS=y 23CONFIG_ARCH_NO_VIRT_TO_BUS=y
23CONFIG_OF=y 24CONFIG_OF=y
24CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
25CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 25CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
26 26
27# 27#
@@ -86,6 +86,7 @@ CONFIG_SLUB_DEBUG=y
86CONFIG_SLUB=y 86CONFIG_SLUB=y
87# CONFIG_SLOB is not set 87# CONFIG_SLOB is not set
88CONFIG_PROFILING=y 88CONFIG_PROFILING=y
89CONFIG_TRACEPOINTS=y
89# CONFIG_MARKERS is not set 90# CONFIG_MARKERS is not set
90CONFIG_OPROFILE=m 91CONFIG_OPROFILE=m
91CONFIG_HAVE_OPROFILE=y 92CONFIG_HAVE_OPROFILE=y
@@ -127,34 +128,40 @@ CONFIG_DEFAULT_AS=y
127# CONFIG_DEFAULT_NOOP is not set 128# CONFIG_DEFAULT_NOOP is not set
128CONFIG_DEFAULT_IOSCHED="anticipatory" 129CONFIG_DEFAULT_IOSCHED="anticipatory"
129CONFIG_CLASSIC_RCU=y 130CONFIG_CLASSIC_RCU=y
131# CONFIG_TREE_RCU is not set
132# CONFIG_PREEMPT_RCU is not set
133# CONFIG_TREE_RCU_TRACE is not set
134# CONFIG_PREEMPT_RCU_TRACE is not set
130# CONFIG_FREEZER is not set 135# CONFIG_FREEZER is not set
131 136
132# 137#
133# Processor type and features 138# Processor type and features
134# 139#
135CONFIG_SPARC64_PAGE_SIZE_8KB=y 140CONFIG_SMP=y
136# CONFIG_SPARC64_PAGE_SIZE_64KB is not set 141CONFIG_NR_CPUS=64
137CONFIG_SECCOMP=y
138CONFIG_HZ_100=y 142CONFIG_HZ_100=y
139# CONFIG_HZ_250 is not set 143# CONFIG_HZ_250 is not set
140# CONFIG_HZ_300 is not set 144# CONFIG_HZ_300 is not set
141# CONFIG_HZ_1000 is not set 145# CONFIG_HZ_1000 is not set
142CONFIG_HZ=100 146CONFIG_HZ=100
143CONFIG_SCHED_HRTICK=y 147CONFIG_SCHED_HRTICK=y
148CONFIG_RWSEM_XCHGADD_ALGORITHM=y
149CONFIG_GENERIC_FIND_NEXT_BIT=y
150CONFIG_GENERIC_HWEIGHT=y
151CONFIG_GENERIC_CALIBRATE_DELAY=y
152CONFIG_ARCH_MAY_HAVE_PC_FDC=y
153CONFIG_SPARC64_SMP=y
154CONFIG_SPARC64_PAGE_SIZE_8KB=y
155# CONFIG_SPARC64_PAGE_SIZE_64KB is not set
156CONFIG_SECCOMP=y
144CONFIG_HOTPLUG_CPU=y 157CONFIG_HOTPLUG_CPU=y
145CONFIG_GENERIC_HARDIRQS=y 158CONFIG_GENERIC_HARDIRQS=y
146CONFIG_TICK_ONESHOT=y 159CONFIG_TICK_ONESHOT=y
147CONFIG_NO_HZ=y 160CONFIG_NO_HZ=y
148CONFIG_HIGH_RES_TIMERS=y 161CONFIG_HIGH_RES_TIMERS=y
149CONFIG_GENERIC_CLOCKEVENTS_BUILD=y 162CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
150CONFIG_SMP=y
151CONFIG_NR_CPUS=64
152# CONFIG_CPU_FREQ is not set 163# CONFIG_CPU_FREQ is not set
153CONFIG_US3_MC=y 164CONFIG_US3_MC=y
154CONFIG_RWSEM_XCHGADD_ALGORITHM=y
155CONFIG_GENERIC_FIND_NEXT_BIT=y
156CONFIG_GENERIC_HWEIGHT=y
157CONFIG_GENERIC_CALIBRATE_DELAY=y
158CONFIG_HUGETLB_PAGE_SIZE_4MB=y 165CONFIG_HUGETLB_PAGE_SIZE_4MB=y
159# CONFIG_HUGETLB_PAGE_SIZE_512K is not set 166# CONFIG_HUGETLB_PAGE_SIZE_512K is not set
160# CONFIG_HUGETLB_PAGE_SIZE_64K is not set 167# CONFIG_HUGETLB_PAGE_SIZE_64K is not set
@@ -183,10 +190,18 @@ CONFIG_PHYS_ADDR_T_64BIT=y
183CONFIG_ZONE_DMA_FLAG=0 190CONFIG_ZONE_DMA_FLAG=0
184CONFIG_NR_QUICK=1 191CONFIG_NR_QUICK=1
185CONFIG_UNEVICTABLE_LRU=y 192CONFIG_UNEVICTABLE_LRU=y
193CONFIG_SCHED_SMT=y
194CONFIG_SCHED_MC=y
195# CONFIG_PREEMPT_NONE is not set
196CONFIG_PREEMPT_VOLUNTARY=y
197# CONFIG_PREEMPT is not set
198# CONFIG_CMDLINE_BOOL is not set
199
200#
201# Bus options (PCI etc.)
202#
186CONFIG_SBUS=y 203CONFIG_SBUS=y
187CONFIG_SBUSCHAR=y 204CONFIG_SBUSCHAR=y
188CONFIG_SUN_AUXIO=y
189CONFIG_SUN_IO=y
190CONFIG_SUN_LDOMS=y 205CONFIG_SUN_LDOMS=y
191CONFIG_PCI=y 206CONFIG_PCI=y
192CONFIG_PCI_DOMAINS=y 207CONFIG_PCI_DOMAINS=y
@@ -195,7 +210,9 @@ CONFIG_ARCH_SUPPORTS_MSI=y
195CONFIG_PCI_MSI=y 210CONFIG_PCI_MSI=y
196# CONFIG_PCI_LEGACY is not set 211# CONFIG_PCI_LEGACY is not set
197# CONFIG_PCI_DEBUG is not set 212# CONFIG_PCI_DEBUG is not set
213# CONFIG_PCCARD is not set
198CONFIG_SUN_OPENPROMFS=m 214CONFIG_SUN_OPENPROMFS=m
215CONFIG_SPARC64_PCI=y
199 216
200# 217#
201# Executable file formats 218# Executable file formats
@@ -207,17 +224,13 @@ CONFIG_COMPAT_BINFMT_ELF=y
207CONFIG_BINFMT_MISC=m 224CONFIG_BINFMT_MISC=m
208CONFIG_COMPAT=y 225CONFIG_COMPAT=y
209CONFIG_SYSVIPC_COMPAT=y 226CONFIG_SYSVIPC_COMPAT=y
210CONFIG_SCHED_SMT=y
211CONFIG_SCHED_MC=y
212# CONFIG_PREEMPT_NONE is not set
213CONFIG_PREEMPT_VOLUNTARY=y
214# CONFIG_PREEMPT is not set
215# CONFIG_CMDLINE_BOOL is not set
216CONFIG_NET=y 227CONFIG_NET=y
217 228
218# 229#
219# Networking options 230# Networking options
220# 231#
232# CONFIG_NET_NS is not set
233CONFIG_COMPAT_NET_DEV_OPS=y
221CONFIG_PACKET=y 234CONFIG_PACKET=y
222CONFIG_PACKET_MMAP=y 235CONFIG_PACKET_MMAP=y
223CONFIG_UNIX=y 236CONFIG_UNIX=y
@@ -314,6 +327,7 @@ CONFIG_VLAN_8021Q=m
314# CONFIG_ECONET is not set 327# CONFIG_ECONET is not set
315# CONFIG_WAN_ROUTER is not set 328# CONFIG_WAN_ROUTER is not set
316# CONFIG_NET_SCHED is not set 329# CONFIG_NET_SCHED is not set
330# CONFIG_DCB is not set
317 331
318# 332#
319# Network testing 333# Network testing
@@ -330,8 +344,8 @@ CONFIG_WIRELESS=y
330# CONFIG_CFG80211 is not set 344# CONFIG_CFG80211 is not set
331CONFIG_WIRELESS_OLD_REGULATORY=y 345CONFIG_WIRELESS_OLD_REGULATORY=y
332# CONFIG_WIRELESS_EXT is not set 346# CONFIG_WIRELESS_EXT is not set
347# CONFIG_LIB80211 is not set
333# CONFIG_MAC80211 is not set 348# CONFIG_MAC80211 is not set
334# CONFIG_IEEE80211 is not set
335# CONFIG_RFKILL is not set 349# CONFIG_RFKILL is not set
336# CONFIG_NET_9P is not set 350# CONFIG_NET_9P is not set
337 351
@@ -378,8 +392,10 @@ CONFIG_MISC_DEVICES=y
378# CONFIG_EEPROM_93CX6 is not set 392# CONFIG_EEPROM_93CX6 is not set
379# CONFIG_SGI_IOC4 is not set 393# CONFIG_SGI_IOC4 is not set
380# CONFIG_TIFM_CORE is not set 394# CONFIG_TIFM_CORE is not set
395# CONFIG_ICS932S401 is not set
381# CONFIG_ENCLOSURE_SERVICES is not set 396# CONFIG_ENCLOSURE_SERVICES is not set
382# CONFIG_HP_ILO is not set 397# CONFIG_HP_ILO is not set
398# CONFIG_C2PORT is not set
383CONFIG_HAVE_IDE=y 399CONFIG_HAVE_IDE=y
384CONFIG_IDE=y 400CONFIG_IDE=y
385 401
@@ -387,6 +403,7 @@ CONFIG_IDE=y
387# Please see Documentation/ide/ide.txt for help/info on IDE drives 403# Please see Documentation/ide/ide.txt for help/info on IDE drives
388# 404#
389CONFIG_IDE_TIMINGS=y 405CONFIG_IDE_TIMINGS=y
406CONFIG_IDE_ATAPI=y
390# CONFIG_BLK_DEV_IDE_SATA is not set 407# CONFIG_BLK_DEV_IDE_SATA is not set
391CONFIG_IDE_GD=y 408CONFIG_IDE_GD=y
392CONFIG_IDE_GD_ATA=y 409CONFIG_IDE_GD_ATA=y
@@ -394,7 +411,6 @@ CONFIG_IDE_GD_ATA=y
394CONFIG_BLK_DEV_IDECD=y 411CONFIG_BLK_DEV_IDECD=y
395CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y 412CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y
396# CONFIG_BLK_DEV_IDETAPE is not set 413# CONFIG_BLK_DEV_IDETAPE is not set
397# CONFIG_BLK_DEV_IDESCSI is not set
398# CONFIG_IDE_TASK_IOCTL is not set 414# CONFIG_IDE_TASK_IOCTL is not set
399CONFIG_IDE_PROC_FS=y 415CONFIG_IDE_PROC_FS=y
400 416
@@ -477,6 +493,7 @@ CONFIG_SCSI_FC_ATTRS=y
477# CONFIG_SCSI_SRP_ATTRS is not set 493# CONFIG_SCSI_SRP_ATTRS is not set
478CONFIG_SCSI_LOWLEVEL=y 494CONFIG_SCSI_LOWLEVEL=y
479# CONFIG_ISCSI_TCP is not set 495# CONFIG_ISCSI_TCP is not set
496# CONFIG_SCSI_CXGB3_ISCSI is not set
480# CONFIG_BLK_DEV_3W_XXXX_RAID is not set 497# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
481# CONFIG_SCSI_3W_9XXX is not set 498# CONFIG_SCSI_3W_9XXX is not set
482# CONFIG_SCSI_ACARD is not set 499# CONFIG_SCSI_ACARD is not set
@@ -490,6 +507,8 @@ CONFIG_SCSI_LOWLEVEL=y
490# CONFIG_MEGARAID_LEGACY is not set 507# CONFIG_MEGARAID_LEGACY is not set
491# CONFIG_MEGARAID_SAS is not set 508# CONFIG_MEGARAID_SAS is not set
492# CONFIG_SCSI_HPTIOP is not set 509# CONFIG_SCSI_HPTIOP is not set
510# CONFIG_LIBFC is not set
511# CONFIG_FCOE is not set
493# CONFIG_SCSI_DMX3191D is not set 512# CONFIG_SCSI_DMX3191D is not set
494# CONFIG_SCSI_FUTURE_DOMAIN is not set 513# CONFIG_SCSI_FUTURE_DOMAIN is not set
495# CONFIG_SCSI_IPS is not set 514# CONFIG_SCSI_IPS is not set
@@ -564,6 +583,9 @@ CONFIG_PHYLIB=m
564# CONFIG_BROADCOM_PHY is not set 583# CONFIG_BROADCOM_PHY is not set
565# CONFIG_ICPLUS_PHY is not set 584# CONFIG_ICPLUS_PHY is not set
566# CONFIG_REALTEK_PHY is not set 585# CONFIG_REALTEK_PHY is not set
586# CONFIG_NATIONAL_PHY is not set
587# CONFIG_STE10XP is not set
588# CONFIG_LSI_ET1011C_PHY is not set
567# CONFIG_MDIO_BITBANG is not set 589# CONFIG_MDIO_BITBANG is not set
568CONFIG_NET_ETHERNET=y 590CONFIG_NET_ETHERNET=y
569CONFIG_MII=m 591CONFIG_MII=m
@@ -590,7 +612,6 @@ CONFIG_NET_PCI=y
590# CONFIG_ADAPTEC_STARFIRE is not set 612# CONFIG_ADAPTEC_STARFIRE is not set
591# CONFIG_B44 is not set 613# CONFIG_B44 is not set
592# CONFIG_FORCEDETH is not set 614# CONFIG_FORCEDETH is not set
593# CONFIG_EEPRO100 is not set
594# CONFIG_E100 is not set 615# CONFIG_E100 is not set
595# CONFIG_FEALNX is not set 616# CONFIG_FEALNX is not set
596# CONFIG_NATSEMI is not set 617# CONFIG_NATSEMI is not set
@@ -600,6 +621,7 @@ CONFIG_NET_PCI=y
600# CONFIG_R6040 is not set 621# CONFIG_R6040 is not set
601# CONFIG_SIS900 is not set 622# CONFIG_SIS900 is not set
602# CONFIG_EPIC100 is not set 623# CONFIG_EPIC100 is not set
624# CONFIG_SMSC9420 is not set
603# CONFIG_SUNDANCE is not set 625# CONFIG_SUNDANCE is not set
604# CONFIG_TLAN is not set 626# CONFIG_TLAN is not set
605# CONFIG_VIA_RHINE is not set 627# CONFIG_VIA_RHINE is not set
@@ -629,6 +651,7 @@ CONFIG_BNX2=m
629# CONFIG_JME is not set 651# CONFIG_JME is not set
630CONFIG_NETDEV_10000=y 652CONFIG_NETDEV_10000=y
631# CONFIG_CHELSIO_T1 is not set 653# CONFIG_CHELSIO_T1 is not set
654CONFIG_CHELSIO_T3_DEPENDS=y
632# CONFIG_CHELSIO_T3 is not set 655# CONFIG_CHELSIO_T3 is not set
633# CONFIG_ENIC is not set 656# CONFIG_ENIC is not set
634# CONFIG_IXGBE is not set 657# CONFIG_IXGBE is not set
@@ -778,6 +801,7 @@ CONFIG_SERIAL_CORE=y
778CONFIG_SERIAL_CORE_CONSOLE=y 801CONFIG_SERIAL_CORE_CONSOLE=y
779# CONFIG_SERIAL_JSM is not set 802# CONFIG_SERIAL_JSM is not set
780CONFIG_UNIX98_PTYS=y 803CONFIG_UNIX98_PTYS=y
804# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
781# CONFIG_LEGACY_PTYS is not set 805# CONFIG_LEGACY_PTYS is not set
782# CONFIG_IPMI_HANDLER is not set 806# CONFIG_IPMI_HANDLER is not set
783CONFIG_HW_RANDOM=m 807CONFIG_HW_RANDOM=m
@@ -870,6 +894,7 @@ CONFIG_HWMON=y
870# CONFIG_SENSORS_ADM1029 is not set 894# CONFIG_SENSORS_ADM1029 is not set
871# CONFIG_SENSORS_ADM1031 is not set 895# CONFIG_SENSORS_ADM1031 is not set
872# CONFIG_SENSORS_ADM9240 is not set 896# CONFIG_SENSORS_ADM9240 is not set
897# CONFIG_SENSORS_ADT7462 is not set
873# CONFIG_SENSORS_ADT7470 is not set 898# CONFIG_SENSORS_ADT7470 is not set
874# CONFIG_SENSORS_ADT7473 is not set 899# CONFIG_SENSORS_ADT7473 is not set
875# CONFIG_SENSORS_ATXP1 is not set 900# CONFIG_SENSORS_ATXP1 is not set
@@ -919,11 +944,11 @@ CONFIG_HWMON=y
919# CONFIG_THERMAL is not set 944# CONFIG_THERMAL is not set
920# CONFIG_THERMAL_HWMON is not set 945# CONFIG_THERMAL_HWMON is not set
921# CONFIG_WATCHDOG is not set 946# CONFIG_WATCHDOG is not set
947CONFIG_SSB_POSSIBLE=y
922 948
923# 949#
924# Sonics Silicon Backplane 950# Sonics Silicon Backplane
925# 951#
926CONFIG_SSB_POSSIBLE=y
927# CONFIG_SSB is not set 952# CONFIG_SSB is not set
928 953
929# 954#
@@ -1071,6 +1096,7 @@ CONFIG_SND_MIXER_OSS=m
1071CONFIG_SND_PCM_OSS=m 1096CONFIG_SND_PCM_OSS=m
1072CONFIG_SND_PCM_OSS_PLUGINS=y 1097CONFIG_SND_PCM_OSS_PLUGINS=y
1073CONFIG_SND_SEQUENCER_OSS=y 1098CONFIG_SND_SEQUENCER_OSS=y
1099# CONFIG_SND_HRTIMER is not set
1074# CONFIG_SND_DYNAMIC_MINORS is not set 1100# CONFIG_SND_DYNAMIC_MINORS is not set
1075CONFIG_SND_SUPPORT_OLD_API=y 1101CONFIG_SND_SUPPORT_OLD_API=y
1076CONFIG_SND_VERBOSE_PROCFS=y 1102CONFIG_SND_VERBOSE_PROCFS=y
@@ -1242,11 +1268,11 @@ CONFIG_USB_UHCI_HCD=m
1242# CONFIG_USB_TMC is not set 1268# CONFIG_USB_TMC is not set
1243 1269
1244# 1270#
1245# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' 1271# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may also be needed;
1246# 1272#
1247 1273
1248# 1274#
1249# may also be needed; see USB_STORAGE Help for more information 1275# see USB_STORAGE Help for more information
1250# 1276#
1251CONFIG_USB_STORAGE=m 1277CONFIG_USB_STORAGE=m
1252# CONFIG_USB_STORAGE_DEBUG is not set 1278# CONFIG_USB_STORAGE_DEBUG is not set
@@ -1337,6 +1363,7 @@ CONFIG_RTC_INTF_DEV=y
1337# CONFIG_RTC_DRV_M41T80 is not set 1363# CONFIG_RTC_DRV_M41T80 is not set
1338# CONFIG_RTC_DRV_S35390A is not set 1364# CONFIG_RTC_DRV_S35390A is not set
1339# CONFIG_RTC_DRV_FM3130 is not set 1365# CONFIG_RTC_DRV_FM3130 is not set
1366# CONFIG_RTC_DRV_RX8581 is not set
1340 1367
1341# 1368#
1342# SPI RTC drivers 1369# SPI RTC drivers
@@ -1365,7 +1392,6 @@ CONFIG_RTC_DRV_STARFIRE=y
1365# CONFIG_DMADEVICES is not set 1392# CONFIG_DMADEVICES is not set
1366# CONFIG_UIO is not set 1393# CONFIG_UIO is not set
1367# CONFIG_STAGING is not set 1394# CONFIG_STAGING is not set
1368CONFIG_STAGING_EXCLUDE_BUILD=y
1369 1395
1370# 1396#
1371# Misc Linux/SPARC drivers 1397# Misc Linux/SPARC drivers
@@ -1544,6 +1570,7 @@ CONFIG_SCHEDSTATS=y
1544# CONFIG_LOCK_STAT is not set 1570# CONFIG_LOCK_STAT is not set
1545# CONFIG_DEBUG_SPINLOCK_SLEEP is not set 1571# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1546# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set 1572# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1573CONFIG_STACKTRACE=y
1547# CONFIG_DEBUG_KOBJECT is not set 1574# CONFIG_DEBUG_KOBJECT is not set
1548CONFIG_DEBUG_BUGVERBOSE=y 1575CONFIG_DEBUG_BUGVERBOSE=y
1549# CONFIG_DEBUG_INFO is not set 1576# CONFIG_DEBUG_INFO is not set
@@ -1552,6 +1579,7 @@ CONFIG_DEBUG_BUGVERBOSE=y
1552CONFIG_DEBUG_MEMORY_INIT=y 1579CONFIG_DEBUG_MEMORY_INIT=y
1553# CONFIG_DEBUG_LIST is not set 1580# CONFIG_DEBUG_LIST is not set
1554# CONFIG_DEBUG_SG is not set 1581# CONFIG_DEBUG_SG is not set
1582# CONFIG_DEBUG_NOTIFIERS is not set
1555# CONFIG_BOOT_PRINTK_DELAY is not set 1583# CONFIG_BOOT_PRINTK_DELAY is not set
1556# CONFIG_RCU_TORTURE_TEST is not set 1584# CONFIG_RCU_TORTURE_TEST is not set
1557# CONFIG_RCU_CPU_STALL_DETECTOR is not set 1585# CONFIG_RCU_CPU_STALL_DETECTOR is not set
@@ -1560,8 +1588,12 @@ CONFIG_DEBUG_MEMORY_INIT=y
1560# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set 1588# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
1561# CONFIG_LKDTM is not set 1589# CONFIG_LKDTM is not set
1562# CONFIG_FAULT_INJECTION is not set 1590# CONFIG_FAULT_INJECTION is not set
1591# CONFIG_LATENCYTOP is not set
1563CONFIG_SYSCTL_SYSCALL_CHECK=y 1592CONFIG_SYSCTL_SYSCALL_CHECK=y
1593CONFIG_NOP_TRACER=y
1564CONFIG_HAVE_FUNCTION_TRACER=y 1594CONFIG_HAVE_FUNCTION_TRACER=y
1595CONFIG_RING_BUFFER=y
1596CONFIG_TRACING=y
1565 1597
1566# 1598#
1567# Tracers 1599# Tracers
@@ -1571,7 +1603,9 @@ CONFIG_HAVE_FUNCTION_TRACER=y
1571# CONFIG_SCHED_TRACER is not set 1603# CONFIG_SCHED_TRACER is not set
1572# CONFIG_CONTEXT_SWITCH_TRACER is not set 1604# CONFIG_CONTEXT_SWITCH_TRACER is not set
1573# CONFIG_BOOT_TRACER is not set 1605# CONFIG_BOOT_TRACER is not set
1606# CONFIG_TRACE_BRANCH_PROFILING is not set
1574# CONFIG_STACK_TRACER is not set 1607# CONFIG_STACK_TRACER is not set
1608# CONFIG_FTRACE_STARTUP_TEST is not set
1575# CONFIG_DYNAMIC_PRINTK_DEBUG is not set 1609# CONFIG_DYNAMIC_PRINTK_DEBUG is not set
1576# CONFIG_SAMPLES is not set 1610# CONFIG_SAMPLES is not set
1577CONFIG_HAVE_ARCH_KGDB=y 1611CONFIG_HAVE_ARCH_KGDB=y
@@ -1600,11 +1634,16 @@ CONFIG_CRYPTO=y
1600# 1634#
1601# CONFIG_CRYPTO_FIPS is not set 1635# CONFIG_CRYPTO_FIPS is not set
1602CONFIG_CRYPTO_ALGAPI=y 1636CONFIG_CRYPTO_ALGAPI=y
1637CONFIG_CRYPTO_ALGAPI2=y
1603CONFIG_CRYPTO_AEAD=y 1638CONFIG_CRYPTO_AEAD=y
1639CONFIG_CRYPTO_AEAD2=y
1604CONFIG_CRYPTO_BLKCIPHER=y 1640CONFIG_CRYPTO_BLKCIPHER=y
1641CONFIG_CRYPTO_BLKCIPHER2=y
1605CONFIG_CRYPTO_HASH=y 1642CONFIG_CRYPTO_HASH=y
1606CONFIG_CRYPTO_RNG=y 1643CONFIG_CRYPTO_HASH2=y
1644CONFIG_CRYPTO_RNG2=y
1607CONFIG_CRYPTO_MANAGER=y 1645CONFIG_CRYPTO_MANAGER=y
1646CONFIG_CRYPTO_MANAGER2=y
1608CONFIG_CRYPTO_GF128MUL=m 1647CONFIG_CRYPTO_GF128MUL=m
1609CONFIG_CRYPTO_NULL=m 1648CONFIG_CRYPTO_NULL=m
1610# CONFIG_CRYPTO_CRYPTD is not set 1649# CONFIG_CRYPTO_CRYPTD is not set
diff --git a/arch/sparc/include/asm/Kbuild b/arch/sparc/include/asm/Kbuild
index 89c260aab45c..95e38a43dff0 100644
--- a/arch/sparc/include/asm/Kbuild
+++ b/arch/sparc/include/asm/Kbuild
@@ -1,21 +1,6 @@
1# User exported sparc header files 1# User exported sparc header files
2include include/asm-generic/Kbuild.asm 2include include/asm-generic/Kbuild.asm
3 3
4header-y += ipcbuf_32.h
5header-y += ipcbuf_64.h
6header-y += posix_types_32.h
7header-y += posix_types_64.h
8header-y += ptrace_32.h
9header-y += ptrace_64.h
10header-y += sigcontext_32.h
11header-y += sigcontext_64.h
12header-y += siginfo_32.h
13header-y += siginfo_64.h
14header-y += signal_32.h
15header-y += signal_64.h
16header-y += stat_32.h
17header-y += stat_64.h
18
19header-y += apc.h 4header-y += apc.h
20header-y += asi.h 5header-y += asi.h
21header-y += display7seg.h 6header-y += display7seg.h
@@ -23,17 +8,13 @@ header-y += envctrl.h
23header-y += fbio.h 8header-y += fbio.h
24header-y += jsflash.h 9header-y += jsflash.h
25header-y += openprom.h 10header-y += openprom.h
26header-y += openprom_32.h
27header-y += openprom_64.h
28header-y += openpromio.h 11header-y += openpromio.h
29header-y += perfctr.h 12header-y += perfctr.h
30header-y += psrcompat.h 13header-y += psrcompat.h
31header-y += psr.h 14header-y += psr.h
32header-y += pstate.h 15header-y += pstate.h
33header-y += reg.h
34header-y += reg_32.h
35header-y += reg_64.h
36header-y += traps.h 16header-y += traps.h
37header-y += uctx.h 17header-y += uctx.h
38header-y += utrap.h 18header-y += utrap.h
39header-y += watchdog.h 19header-y += watchdog.h
20header-y += swab.h
diff --git a/arch/sparc/include/asm/atomic_32.h b/arch/sparc/include/asm/atomic_32.h
index 5c944b5a8040..ce465975a6a5 100644
--- a/arch/sparc/include/asm/atomic_32.h
+++ b/arch/sparc/include/asm/atomic_32.h
@@ -13,8 +13,6 @@
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15 15
16typedef struct { volatile int counter; } atomic_t;
17
18#ifdef __KERNEL__ 16#ifdef __KERNEL__
19 17
20#define ATOMIC_INIT(i) { (i) } 18#define ATOMIC_INIT(i) { (i) }
diff --git a/arch/sparc/include/asm/atomic_64.h b/arch/sparc/include/asm/atomic_64.h
index 5982c5ae7f07..a0a706492696 100644
--- a/arch/sparc/include/asm/atomic_64.h
+++ b/arch/sparc/include/asm/atomic_64.h
@@ -10,9 +10,6 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <asm/system.h> 11#include <asm/system.h>
12 12
13typedef struct { volatile int counter; } atomic_t;
14typedef struct { volatile __s64 counter; } atomic64_t;
15
16#define ATOMIC_INIT(i) { (i) } 13#define ATOMIC_INIT(i) { (i) }
17#define ATOMIC64_INIT(i) { (i) } 14#define ATOMIC64_INIT(i) { (i) }
18 15
diff --git a/arch/sparc/include/asm/byteorder.h b/arch/sparc/include/asm/byteorder.h
index 5a70f137f1f7..48a047cd6fa9 100644
--- a/arch/sparc/include/asm/byteorder.h
+++ b/arch/sparc/include/asm/byteorder.h
@@ -1,51 +1,7 @@
1#ifndef _SPARC_BYTEORDER_H 1#ifndef _SPARC_BYTEORDER_H
2#define _SPARC_BYTEORDER_H 2#define _SPARC_BYTEORDER_H
3 3
4#include <asm/types.h> 4#include <asm/swab.h>
5#include <asm/asi.h> 5#include <linux/byteorder/big_endian.h>
6
7#define __BIG_ENDIAN
8
9#ifdef CONFIG_SPARC32
10#define __SWAB_64_THRU_32__
11#endif
12
13#ifdef CONFIG_SPARC64
14static inline __u16 __arch_swab16p(const __u16 *addr)
15{
16 __u16 ret;
17
18 __asm__ __volatile__ ("lduha [%1] %2, %0"
19 : "=r" (ret)
20 : "r" (addr), "i" (ASI_PL));
21 return ret;
22}
23#define __arch_swab16p __arch_swab16p
24
25static inline __u32 __arch_swab32p(const __u32 *addr)
26{
27 __u32 ret;
28
29 __asm__ __volatile__ ("lduwa [%1] %2, %0"
30 : "=r" (ret)
31 : "r" (addr), "i" (ASI_PL));
32 return ret;
33}
34#define __arch_swab32p __arch_swab32p
35
36static inline __u64 __arch_swab64p(const __u64 *addr)
37{
38 __u64 ret;
39
40 __asm__ __volatile__ ("ldxa [%1] %2, %0"
41 : "=r" (ret)
42 : "r" (addr), "i" (ASI_PL));
43 return ret;
44}
45#define __arch_swab64p __arch_swab64p
46
47#endif /* CONFIG_SPARC64 */
48
49#include <linux/byteorder.h>
50 6
51#endif /* _SPARC_BYTEORDER_H */ 7#endif /* _SPARC_BYTEORDER_H */
diff --git a/arch/sparc/include/asm/ipcbuf.h b/arch/sparc/include/asm/ipcbuf.h
index 17d6ef7b23a4..66013b4fe10d 100644
--- a/arch/sparc/include/asm/ipcbuf.h
+++ b/arch/sparc/include/asm/ipcbuf.h
@@ -1,8 +1,32 @@
1#ifndef ___ASM_SPARC_IPCBUF_H 1#ifndef __SPARC_IPCBUF_H
2#define ___ASM_SPARC_IPCBUF_H 2#define __SPARC_IPCBUF_H
3#if defined(__sparc__) && defined(__arch64__) 3
4#include <asm/ipcbuf_64.h> 4/*
5#else 5 * The ipc64_perm structure for sparc/sparc64 architecture.
6#include <asm/ipcbuf_32.h> 6 * Note extra padding because this structure is passed back and forth
7#endif 7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit seq
11 * - on sparc for 32 bit mode (it is 32 bit on sparc64)
12 * - 2 miscellaneous 64-bit values
13 */
14
15struct ipc64_perm
16{
17 __kernel_key_t key;
18 __kernel_uid_t uid;
19 __kernel_gid_t gid;
20 __kernel_uid_t cuid;
21 __kernel_gid_t cgid;
22#ifndef __arch64__
23 unsigned short __pad0;
8#endif 24#endif
25 __kernel_mode_t mode;
26 unsigned short __pad1;
27 unsigned short seq;
28 unsigned long long __unused1;
29 unsigned long long __unused2;
30};
31
32#endif /* __SPARC_IPCBUF_H */
diff --git a/arch/sparc/include/asm/ipcbuf_32.h b/arch/sparc/include/asm/ipcbuf_32.h
deleted file mode 100644
index 6387209518f2..000000000000
--- a/arch/sparc/include/asm/ipcbuf_32.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef _SPARC_IPCBUF_H
2#define _SPARC_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for sparc architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit mode
11 * - 32-bit seq
12 * - 2 miscellaneous 64-bit values (so that this structure matches
13 * sparc64 ipc64_perm)
14 */
15
16struct ipc64_perm
17{
18 __kernel_key_t key;
19 __kernel_uid32_t uid;
20 __kernel_gid32_t gid;
21 __kernel_uid32_t cuid;
22 __kernel_gid32_t cgid;
23 unsigned short __pad1;
24 __kernel_mode_t mode;
25 unsigned short __pad2;
26 unsigned short seq;
27 unsigned long long __unused1;
28 unsigned long long __unused2;
29};
30
31#endif /* _SPARC_IPCBUF_H */
diff --git a/arch/sparc/include/asm/ipcbuf_64.h b/arch/sparc/include/asm/ipcbuf_64.h
deleted file mode 100644
index a44b855b98db..000000000000
--- a/arch/sparc/include/asm/ipcbuf_64.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef _SPARC64_IPCBUF_H
2#define _SPARC64_IPCBUF_H
3
4/*
5 * The ipc64_perm structure for sparc64 architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 32-bit seq
11 * - 2 miscellaneous 64-bit values
12 */
13
14struct ipc64_perm
15{
16 __kernel_key_t key;
17 __kernel_uid_t uid;
18 __kernel_gid_t gid;
19 __kernel_uid_t cuid;
20 __kernel_gid_t cgid;
21 __kernel_mode_t mode;
22 unsigned short __pad1;
23 unsigned short seq;
24 unsigned long __unused1;
25 unsigned long __unused2;
26};
27
28#endif /* _SPARC64_IPCBUF_H */
diff --git a/arch/sparc/include/asm/jsflash.h b/arch/sparc/include/asm/jsflash.h
index 3457f29bd73b..0717d9e39d2d 100644
--- a/arch/sparc/include/asm/jsflash.h
+++ b/arch/sparc/include/asm/jsflash.h
@@ -8,7 +8,7 @@
8#define _SPARC_JSFLASH_H 8#define _SPARC_JSFLASH_H
9 9
10#ifndef _SPARC_TYPES_H 10#ifndef _SPARC_TYPES_H
11#include <asm/types.h> 11#include <linux/types.h>
12#endif 12#endif
13 13
14/* 14/*
diff --git a/arch/sparc/include/asm/openprom.h b/arch/sparc/include/asm/openprom.h
index aaeae905ed3f..963e1a45c35f 100644
--- a/arch/sparc/include/asm/openprom.h
+++ b/arch/sparc/include/asm/openprom.h
@@ -1,8 +1,277 @@
1#ifndef ___ASM_SPARC_OPENPROM_H 1#ifndef __SPARC_OPENPROM_H
2#define ___ASM_SPARC_OPENPROM_H 2#define __SPARC_OPENPROM_H
3
4/* openprom.h: Prom structures and defines for access to the OPENBOOT
5 * prom routines and data areas.
6 *
7 * Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
8 */
9
10/* Empirical constants... */
11#define LINUX_OPPROM_MAGIC 0x10010407
12
13#ifndef __ASSEMBLY__
14/* V0 prom device operations. */
15struct linux_dev_v0_funcs {
16 int (*v0_devopen)(char *device_str);
17 int (*v0_devclose)(int dev_desc);
18 int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
19 int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
20 int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf);
21 int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf);
22 int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
23 int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
24 int (*v0_seekdev)(int dev_desc, long logical_offst, int from);
25};
26
27/* V2 and later prom device operations. */
28struct linux_dev_v2_funcs {
29 int (*v2_inst2pkg)(int d); /* Convert ihandle to phandle */
30 char * (*v2_dumb_mem_alloc)(char *va, unsigned sz);
31 void (*v2_dumb_mem_free)(char *va, unsigned sz);
32
33 /* To map devices into virtual I/O space. */
34 char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz);
35 void (*v2_dumb_munmap)(char *virta, unsigned size);
36
37 int (*v2_dev_open)(char *devpath);
38 void (*v2_dev_close)(int d);
39 int (*v2_dev_read)(int d, char *buf, int nbytes);
40 int (*v2_dev_write)(int d, char *buf, int nbytes);
41 int (*v2_dev_seek)(int d, int hi, int lo);
42
43 /* Never issued (multistage load support) */
44 void (*v2_wheee2)(void);
45 void (*v2_wheee3)(void);
46};
47
48struct linux_mlist_v0 {
49 struct linux_mlist_v0 *theres_more;
50 unsigned int start_adr;
51 unsigned num_bytes;
52};
53
54struct linux_mem_v0 {
55 struct linux_mlist_v0 **v0_totphys;
56 struct linux_mlist_v0 **v0_prommap;
57 struct linux_mlist_v0 **v0_available; /* What we can use */
58};
59
60/* Arguments sent to the kernel from the boot prompt. */
61struct linux_arguments_v0 {
62 char *argv[8];
63 char args[100];
64 char boot_dev[2];
65 int boot_dev_ctrl;
66 int boot_dev_unit;
67 int dev_partition;
68 char *kernel_file_name;
69 void *aieee1; /* XXX */
70};
71
72/* V2 and up boot things. */
73struct linux_bootargs_v2 {
74 char **bootpath;
75 char **bootargs;
76 int *fd_stdin;
77 int *fd_stdout;
78};
79
80/* The top level PROM vector. */
81struct linux_romvec {
82 /* Version numbers. */
83 unsigned int pv_magic_cookie;
84 unsigned int pv_romvers;
85 unsigned int pv_plugin_revision;
86 unsigned int pv_printrev;
87
88 /* Version 0 memory descriptors. */
89 struct linux_mem_v0 pv_v0mem;
90
91 /* Node operations. */
92 struct linux_nodeops *pv_nodeops;
93
94 char **pv_bootstr;
95 struct linux_dev_v0_funcs pv_v0devops;
96
97 char *pv_stdin;
98 char *pv_stdout;
99#define PROMDEV_KBD 0 /* input from keyboard */
100#define PROMDEV_SCREEN 0 /* output to screen */
101#define PROMDEV_TTYA 1 /* in/out to ttya */
102#define PROMDEV_TTYB 2 /* in/out to ttyb */
103
104 /* Blocking getchar/putchar. NOT REENTRANT! (grr) */
105 int (*pv_getchar)(void);
106 void (*pv_putchar)(int ch);
107
108 /* Non-blocking variants. */
109 int (*pv_nbgetchar)(void);
110 int (*pv_nbputchar)(int ch);
111
112 void (*pv_putstr)(char *str, int len);
113
114 /* Miscellany. */
115 void (*pv_reboot)(char *bootstr);
116 void (*pv_printf)(__const__ char *fmt, ...);
117 void (*pv_abort)(void);
118 __volatile__ int *pv_ticks;
119 void (*pv_halt)(void);
120 void (**pv_synchook)(void);
121
122 /* Evaluate a forth string, not different proto for V0 and V2->up. */
123 union {
124 void (*v0_eval)(int len, char *str);
125 void (*v2_eval)(char *str);
126 } pv_fortheval;
127
128 struct linux_arguments_v0 **pv_v0bootargs;
129
130 /* Get ether address. */
131 unsigned int (*pv_enaddr)(int d, char *enaddr);
132
133 struct linux_bootargs_v2 pv_v2bootargs;
134 struct linux_dev_v2_funcs pv_v2devops;
135
136 int filler[15];
137
138 /* This one is sun4c/sun4 only. */
139 void (*pv_setctxt)(int ctxt, char *va, int pmeg);
140
141 /* Prom version 3 Multiprocessor routines. This stuff is crazy.
142 * No joke. Calling these when there is only one cpu probably
143 * crashes the machine, have to test this. :-)
144 */
145
146 /* v3_cpustart() will start the cpu 'whichcpu' in mmu-context
147 * 'thiscontext' executing at address 'prog_counter'
148 */
149 int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr,
150 int thiscontext, char *prog_counter);
151
152 /* v3_cpustop() will cause cpu 'whichcpu' to stop executing
153 * until a resume cpu call is made.
154 */
155 int (*v3_cpustop)(unsigned int whichcpu);
156
157 /* v3_cpuidle() will idle cpu 'whichcpu' until a stop or
158 * resume cpu call is made.
159 */
160 int (*v3_cpuidle)(unsigned int whichcpu);
161
162 /* v3_cpuresume() will resume processor 'whichcpu' executing
163 * starting with whatever 'pc' and 'npc' were left at the
164 * last 'idle' or 'stop' call.
165 */
166 int (*v3_cpuresume)(unsigned int whichcpu);
167};
168
169/* Routines for traversing the prom device tree. */
170struct linux_nodeops {
171 int (*no_nextnode)(int node);
172 int (*no_child)(int node);
173 int (*no_proplen)(int node, const char *name);
174 int (*no_getprop)(int node, const char *name, char *val);
175 int (*no_setprop)(int node, const char *name, char *val, int len);
176 char * (*no_nextprop)(int node, char *name);
177};
178
179/* More fun PROM structures for device probing. */
3#if defined(__sparc__) && defined(__arch64__) 180#if defined(__sparc__) && defined(__arch64__)
4#include <asm/openprom_64.h> 181#define PROMREG_MAX 24
182#define PROMVADDR_MAX 16
183#define PROMINTR_MAX 32
5#else 184#else
6#include <asm/openprom_32.h> 185#define PROMREG_MAX 16
186#define PROMVADDR_MAX 16
187#define PROMINTR_MAX 15
7#endif 188#endif
189
190struct linux_prom_registers {
191 unsigned int which_io; /* hi part of physical address */
192 unsigned int phys_addr; /* The physical address of this register */
193 unsigned int reg_size; /* How many bytes does this register take up? */
194};
195
196struct linux_prom64_registers {
197 unsigned long phys_addr;
198 unsigned long reg_size;
199};
200
201struct linux_prom_irqs {
202 int pri; /* IRQ priority */
203 int vector; /* This is foobar, what does it do? */
204};
205
206/* Element of the "ranges" vector */
207struct linux_prom_ranges {
208 unsigned int ot_child_space;
209 unsigned int ot_child_base; /* Bus feels this */
210 unsigned int ot_parent_space;
211 unsigned int ot_parent_base; /* CPU looks from here */
212 unsigned int or_size;
213};
214
215/*
216 * Ranges and reg properties are a bit different for PCI.
217 */
218#if defined(__sparc__) && defined(__arch64__)
219struct linux_prom_pci_registers {
220 unsigned int phys_hi;
221 unsigned int phys_mid;
222 unsigned int phys_lo;
223
224 unsigned int size_hi;
225 unsigned int size_lo;
226};
227#else
228struct linux_prom_pci_registers {
229 /*
230 * We don't know what information this field contain.
231 * We guess, PCI device function is in bits 15:8
232 * So, ...
233 */
234 unsigned int which_io; /* Let it be which_io */
235
236 unsigned int phys_hi;
237 unsigned int phys_lo;
238
239 unsigned int size_hi;
240 unsigned int size_lo;
241};
242
8#endif 243#endif
244
245struct linux_prom_pci_ranges {
246 unsigned int child_phys_hi; /* Only certain bits are encoded here. */
247 unsigned int child_phys_mid;
248 unsigned int child_phys_lo;
249
250 unsigned int parent_phys_hi;
251 unsigned int parent_phys_lo;
252
253 unsigned int size_hi;
254 unsigned int size_lo;
255};
256
257struct linux_prom_pci_intmap {
258 unsigned int phys_hi;
259 unsigned int phys_mid;
260 unsigned int phys_lo;
261
262 unsigned int interrupt;
263
264 int cnode;
265 unsigned int cinterrupt;
266};
267
268struct linux_prom_pci_intmask {
269 unsigned int phys_hi;
270 unsigned int phys_mid;
271 unsigned int phys_lo;
272 unsigned int interrupt;
273};
274
275#endif /* !(__ASSEMBLY__) */
276
277#endif /* !(__SPARC_OPENPROM_H) */
diff --git a/arch/sparc/include/asm/openprom_32.h b/arch/sparc/include/asm/openprom_32.h
deleted file mode 100644
index 875da3552d80..000000000000
--- a/arch/sparc/include/asm/openprom_32.h
+++ /dev/null
@@ -1,255 +0,0 @@
1#ifndef __SPARC_OPENPROM_H
2#define __SPARC_OPENPROM_H
3
4/* openprom.h: Prom structures and defines for access to the OPENBOOT
5 * prom routines and data areas.
6 *
7 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
8 */
9
10/* Empirical constants... */
11#define LINUX_OPPROM_MAGIC 0x10010407
12
13#ifndef __ASSEMBLY__
14/* V0 prom device operations. */
15struct linux_dev_v0_funcs {
16 int (*v0_devopen)(char *device_str);
17 int (*v0_devclose)(int dev_desc);
18 int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
19 int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
20 int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf);
21 int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf);
22 int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
23 int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
24 int (*v0_seekdev)(int dev_desc, long logical_offst, int from);
25};
26
27/* V2 and later prom device operations. */
28struct linux_dev_v2_funcs {
29 int (*v2_inst2pkg)(int d); /* Convert ihandle to phandle */
30 char * (*v2_dumb_mem_alloc)(char *va, unsigned sz);
31 void (*v2_dumb_mem_free)(char *va, unsigned sz);
32
33 /* To map devices into virtual I/O space. */
34 char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz);
35 void (*v2_dumb_munmap)(char *virta, unsigned size);
36
37 int (*v2_dev_open)(char *devpath);
38 void (*v2_dev_close)(int d);
39 int (*v2_dev_read)(int d, char *buf, int nbytes);
40 int (*v2_dev_write)(int d, char *buf, int nbytes);
41 int (*v2_dev_seek)(int d, int hi, int lo);
42
43 /* Never issued (multistage load support) */
44 void (*v2_wheee2)(void);
45 void (*v2_wheee3)(void);
46};
47
48struct linux_mlist_v0 {
49 struct linux_mlist_v0 *theres_more;
50 char *start_adr;
51 unsigned num_bytes;
52};
53
54struct linux_mem_v0 {
55 struct linux_mlist_v0 **v0_totphys;
56 struct linux_mlist_v0 **v0_prommap;
57 struct linux_mlist_v0 **v0_available; /* What we can use */
58};
59
60/* Arguments sent to the kernel from the boot prompt. */
61struct linux_arguments_v0 {
62 char *argv[8];
63 char args[100];
64 char boot_dev[2];
65 int boot_dev_ctrl;
66 int boot_dev_unit;
67 int dev_partition;
68 char *kernel_file_name;
69 void *aieee1; /* XXX */
70};
71
72/* V2 and up boot things. */
73struct linux_bootargs_v2 {
74 char **bootpath;
75 char **bootargs;
76 int *fd_stdin;
77 int *fd_stdout;
78};
79
80/* The top level PROM vector. */
81struct linux_romvec {
82 /* Version numbers. */
83 unsigned int pv_magic_cookie;
84 unsigned int pv_romvers;
85 unsigned int pv_plugin_revision;
86 unsigned int pv_printrev;
87
88 /* Version 0 memory descriptors. */
89 struct linux_mem_v0 pv_v0mem;
90
91 /* Node operations. */
92 struct linux_nodeops *pv_nodeops;
93
94 char **pv_bootstr;
95 struct linux_dev_v0_funcs pv_v0devops;
96
97 char *pv_stdin;
98 char *pv_stdout;
99#define PROMDEV_KBD 0 /* input from keyboard */
100#define PROMDEV_SCREEN 0 /* output to screen */
101#define PROMDEV_TTYA 1 /* in/out to ttya */
102#define PROMDEV_TTYB 2 /* in/out to ttyb */
103
104 /* Blocking getchar/putchar. NOT REENTRANT! (grr) */
105 int (*pv_getchar)(void);
106 void (*pv_putchar)(int ch);
107
108 /* Non-blocking variants. */
109 int (*pv_nbgetchar)(void);
110 int (*pv_nbputchar)(int ch);
111
112 void (*pv_putstr)(char *str, int len);
113
114 /* Miscellany. */
115 void (*pv_reboot)(char *bootstr);
116 void (*pv_printf)(__const__ char *fmt, ...);
117 void (*pv_abort)(void);
118 __volatile__ int *pv_ticks;
119 void (*pv_halt)(void);
120 void (**pv_synchook)(void);
121
122 /* Evaluate a forth string, not different proto for V0 and V2->up. */
123 union {
124 void (*v0_eval)(int len, char *str);
125 void (*v2_eval)(char *str);
126 } pv_fortheval;
127
128 struct linux_arguments_v0 **pv_v0bootargs;
129
130 /* Get ether address. */
131 unsigned int (*pv_enaddr)(int d, char *enaddr);
132
133 struct linux_bootargs_v2 pv_v2bootargs;
134 struct linux_dev_v2_funcs pv_v2devops;
135
136 int filler[15];
137
138 /* This one is sun4c/sun4 only. */
139 void (*pv_setctxt)(int ctxt, char *va, int pmeg);
140
141 /* Prom version 3 Multiprocessor routines. This stuff is crazy.
142 * No joke. Calling these when there is only one cpu probably
143 * crashes the machine, have to test this. :-)
144 */
145
146 /* v3_cpustart() will start the cpu 'whichcpu' in mmu-context
147 * 'thiscontext' executing at address 'prog_counter'
148 */
149 int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr,
150 int thiscontext, char *prog_counter);
151
152 /* v3_cpustop() will cause cpu 'whichcpu' to stop executing
153 * until a resume cpu call is made.
154 */
155 int (*v3_cpustop)(unsigned int whichcpu);
156
157 /* v3_cpuidle() will idle cpu 'whichcpu' until a stop or
158 * resume cpu call is made.
159 */
160 int (*v3_cpuidle)(unsigned int whichcpu);
161
162 /* v3_cpuresume() will resume processor 'whichcpu' executing
163 * starting with whatever 'pc' and 'npc' were left at the
164 * last 'idle' or 'stop' call.
165 */
166 int (*v3_cpuresume)(unsigned int whichcpu);
167};
168
169/* Routines for traversing the prom device tree. */
170struct linux_nodeops {
171 int (*no_nextnode)(int node);
172 int (*no_child)(int node);
173 int (*no_proplen)(int node, const char *name);
174 int (*no_getprop)(int node, const char *name, char *val);
175 int (*no_setprop)(int node, const char *name, char *val, int len);
176 char * (*no_nextprop)(int node, char *name);
177};
178
179/* More fun PROM structures for device probing. */
180#define PROMREG_MAX 16
181#define PROMVADDR_MAX 16
182#define PROMINTR_MAX 15
183
184struct linux_prom_registers {
185 unsigned int which_io; /* is this in OBIO space? */
186 unsigned int phys_addr; /* The physical address of this register */
187 unsigned int reg_size; /* How many bytes does this register take up? */
188};
189
190struct linux_prom_irqs {
191 int pri; /* IRQ priority */
192 int vector; /* This is foobar, what does it do? */
193};
194
195/* Element of the "ranges" vector */
196struct linux_prom_ranges {
197 unsigned int ot_child_space;
198 unsigned int ot_child_base; /* Bus feels this */
199 unsigned int ot_parent_space;
200 unsigned int ot_parent_base; /* CPU looks from here */
201 unsigned int or_size;
202};
203
204/* Ranges and reg properties are a bit different for PCI. */
205struct linux_prom_pci_registers {
206 /*
207 * We don't know what information this field contain.
208 * We guess, PCI device function is in bits 15:8
209 * So, ...
210 */
211 unsigned int which_io; /* Let it be which_io */
212
213 unsigned int phys_hi;
214 unsigned int phys_lo;
215
216 unsigned int size_hi;
217 unsigned int size_lo;
218};
219
220struct linux_prom_pci_ranges {
221 unsigned int child_phys_hi; /* Only certain bits are encoded here. */
222 unsigned int child_phys_mid;
223 unsigned int child_phys_lo;
224
225 unsigned int parent_phys_hi;
226 unsigned int parent_phys_lo;
227
228 unsigned int size_hi;
229 unsigned int size_lo;
230};
231
232struct linux_prom_pci_assigned_addresses {
233 unsigned int which_io;
234
235 unsigned int phys_hi;
236 unsigned int phys_lo;
237
238 unsigned int size_hi;
239 unsigned int size_lo;
240};
241
242struct linux_prom_ebus_ranges {
243 unsigned int child_phys_hi;
244 unsigned int child_phys_lo;
245
246 unsigned int parent_phys_hi;
247 unsigned int parent_phys_mid;
248 unsigned int parent_phys_lo;
249
250 unsigned int size;
251};
252
253#endif /* !(__ASSEMBLY__) */
254
255#endif /* !(__SPARC_OPENPROM_H) */
diff --git a/arch/sparc/include/asm/openprom_64.h b/arch/sparc/include/asm/openprom_64.h
deleted file mode 100644
index b69e4a8c9170..000000000000
--- a/arch/sparc/include/asm/openprom_64.h
+++ /dev/null
@@ -1,280 +0,0 @@
1#ifndef __SPARC64_OPENPROM_H
2#define __SPARC64_OPENPROM_H
3
4/* openprom.h: Prom structures and defines for access to the OPENBOOT
5 * prom routines and data areas.
6 *
7 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
8 */
9
10#ifndef __ASSEMBLY__
11/* V0 prom device operations. */
12struct linux_dev_v0_funcs {
13 int (*v0_devopen)(char *device_str);
14 int (*v0_devclose)(int dev_desc);
15 int (*v0_rdblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
16 int (*v0_wrblkdev)(int dev_desc, int num_blks, int blk_st, char *buf);
17 int (*v0_wrnetdev)(int dev_desc, int num_bytes, char *buf);
18 int (*v0_rdnetdev)(int dev_desc, int num_bytes, char *buf);
19 int (*v0_rdchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
20 int (*v0_wrchardev)(int dev_desc, int num_bytes, int dummy, char *buf);
21 int (*v0_seekdev)(int dev_desc, long logical_offst, int from);
22};
23
24/* V2 and later prom device operations. */
25struct linux_dev_v2_funcs {
26 int (*v2_inst2pkg)(int d); /* Convert ihandle to phandle */
27 char * (*v2_dumb_mem_alloc)(char *va, unsigned sz);
28 void (*v2_dumb_mem_free)(char *va, unsigned sz);
29
30 /* To map devices into virtual I/O space. */
31 char * (*v2_dumb_mmap)(char *virta, int which_io, unsigned paddr, unsigned sz);
32 void (*v2_dumb_munmap)(char *virta, unsigned size);
33
34 int (*v2_dev_open)(char *devpath);
35 void (*v2_dev_close)(int d);
36 int (*v2_dev_read)(int d, char *buf, int nbytes);
37 int (*v2_dev_write)(int d, char *buf, int nbytes);
38 int (*v2_dev_seek)(int d, int hi, int lo);
39
40 /* Never issued (multistage load support) */
41 void (*v2_wheee2)(void);
42 void (*v2_wheee3)(void);
43};
44
45struct linux_mlist_v0 {
46 struct linux_mlist_v0 *theres_more;
47 unsigned start_adr;
48 unsigned num_bytes;
49};
50
51struct linux_mem_v0 {
52 struct linux_mlist_v0 **v0_totphys;
53 struct linux_mlist_v0 **v0_prommap;
54 struct linux_mlist_v0 **v0_available; /* What we can use */
55};
56
57/* Arguments sent to the kernel from the boot prompt. */
58struct linux_arguments_v0 {
59 char *argv[8];
60 char args[100];
61 char boot_dev[2];
62 int boot_dev_ctrl;
63 int boot_dev_unit;
64 int dev_partition;
65 char *kernel_file_name;
66 void *aieee1; /* XXX */
67};
68
69/* V2 and up boot things. */
70struct linux_bootargs_v2 {
71 char **bootpath;
72 char **bootargs;
73 int *fd_stdin;
74 int *fd_stdout;
75};
76
77/* The top level PROM vector. */
78struct linux_romvec {
79 /* Version numbers. */
80 unsigned int pv_magic_cookie;
81 unsigned int pv_romvers;
82 unsigned int pv_plugin_revision;
83 unsigned int pv_printrev;
84
85 /* Version 0 memory descriptors. */
86 struct linux_mem_v0 pv_v0mem;
87
88 /* Node operations. */
89 struct linux_nodeops *pv_nodeops;
90
91 char **pv_bootstr;
92 struct linux_dev_v0_funcs pv_v0devops;
93
94 char *pv_stdin;
95 char *pv_stdout;
96#define PROMDEV_KBD 0 /* input from keyboard */
97#define PROMDEV_SCREEN 0 /* output to screen */
98#define PROMDEV_TTYA 1 /* in/out to ttya */
99#define PROMDEV_TTYB 2 /* in/out to ttyb */
100
101 /* Blocking getchar/putchar. NOT REENTRANT! (grr) */
102 int (*pv_getchar)(void);
103 void (*pv_putchar)(int ch);
104
105 /* Non-blocking variants. */
106 int (*pv_nbgetchar)(void);
107 int (*pv_nbputchar)(int ch);
108
109 void (*pv_putstr)(char *str, int len);
110
111 /* Miscellany. */
112 void (*pv_reboot)(char *bootstr);
113 void (*pv_printf)(__const__ char *fmt, ...);
114 void (*pv_abort)(void);
115 __volatile__ int *pv_ticks;
116 void (*pv_halt)(void);
117 void (**pv_synchook)(void);
118
119 /* Evaluate a forth string, not different proto for V0 and V2->up. */
120 union {
121 void (*v0_eval)(int len, char *str);
122 void (*v2_eval)(char *str);
123 } pv_fortheval;
124
125 struct linux_arguments_v0 **pv_v0bootargs;
126
127 /* Get ether address. */
128 unsigned int (*pv_enaddr)(int d, char *enaddr);
129
130 struct linux_bootargs_v2 pv_v2bootargs;
131 struct linux_dev_v2_funcs pv_v2devops;
132
133 int filler[15];
134
135 /* This one is sun4c/sun4 only. */
136 void (*pv_setctxt)(int ctxt, char *va, int pmeg);
137
138 /* Prom version 3 Multiprocessor routines. This stuff is crazy.
139 * No joke. Calling these when there is only one cpu probably
140 * crashes the machine, have to test this. :-)
141 */
142
143 /* v3_cpustart() will start the cpu 'whichcpu' in mmu-context
144 * 'thiscontext' executing at address 'prog_counter'
145 */
146 int (*v3_cpustart)(unsigned int whichcpu, int ctxtbl_ptr,
147 int thiscontext, char *prog_counter);
148
149 /* v3_cpustop() will cause cpu 'whichcpu' to stop executing
150 * until a resume cpu call is made.
151 */
152 int (*v3_cpustop)(unsigned int whichcpu);
153
154 /* v3_cpuidle() will idle cpu 'whichcpu' until a stop or
155 * resume cpu call is made.
156 */
157 int (*v3_cpuidle)(unsigned int whichcpu);
158
159 /* v3_cpuresume() will resume processor 'whichcpu' executing
160 * starting with whatever 'pc' and 'npc' were left at the
161 * last 'idle' or 'stop' call.
162 */
163 int (*v3_cpuresume)(unsigned int whichcpu);
164};
165
166/* Routines for traversing the prom device tree. */
167struct linux_nodeops {
168 int (*no_nextnode)(int node);
169 int (*no_child)(int node);
170 int (*no_proplen)(int node, char *name);
171 int (*no_getprop)(int node, char *name, char *val);
172 int (*no_setprop)(int node, char *name, char *val, int len);
173 char * (*no_nextprop)(int node, char *name);
174};
175
176/* More fun PROM structures for device probing. */
177#define PROMREG_MAX 24
178#define PROMVADDR_MAX 16
179#define PROMINTR_MAX 32
180
181struct linux_prom_registers {
182 unsigned which_io; /* hi part of physical address */
183 unsigned phys_addr; /* The physical address of this register */
184 int reg_size; /* How many bytes does this register take up? */
185};
186
187struct linux_prom64_registers {
188 unsigned long phys_addr;
189 unsigned long reg_size;
190};
191
192struct linux_prom_irqs {
193 int pri; /* IRQ priority */
194 int vector; /* This is foobar, what does it do? */
195};
196
197/* Element of the "ranges" vector */
198struct linux_prom_ranges {
199 unsigned int ot_child_space;
200 unsigned int ot_child_base; /* Bus feels this */
201 unsigned int ot_parent_space;
202 unsigned int ot_parent_base; /* CPU looks from here */
203 unsigned int or_size;
204};
205
206struct linux_prom64_ranges {
207 unsigned long ot_child_base; /* Bus feels this */
208 unsigned long ot_parent_base; /* CPU looks from here */
209 unsigned long or_size;
210};
211
212/* Ranges and reg properties are a bit different for PCI. */
213struct linux_prom_pci_registers {
214 unsigned int phys_hi;
215 unsigned int phys_mid;
216 unsigned int phys_lo;
217
218 unsigned int size_hi;
219 unsigned int size_lo;
220};
221
222struct linux_prom_pci_ranges {
223 unsigned int child_phys_hi; /* Only certain bits are encoded here. */
224 unsigned int child_phys_mid;
225 unsigned int child_phys_lo;
226
227 unsigned int parent_phys_hi;
228 unsigned int parent_phys_lo;
229
230 unsigned int size_hi;
231 unsigned int size_lo;
232};
233
234struct linux_prom_pci_intmap {
235 unsigned int phys_hi;
236 unsigned int phys_mid;
237 unsigned int phys_lo;
238
239 unsigned int interrupt;
240
241 int cnode;
242 unsigned int cinterrupt;
243};
244
245struct linux_prom_pci_intmask {
246 unsigned int phys_hi;
247 unsigned int phys_mid;
248 unsigned int phys_lo;
249 unsigned int interrupt;
250};
251
252struct linux_prom_ebus_ranges {
253 unsigned int child_phys_hi;
254 unsigned int child_phys_lo;
255
256 unsigned int parent_phys_hi;
257 unsigned int parent_phys_mid;
258 unsigned int parent_phys_lo;
259
260 unsigned int size;
261};
262
263struct linux_prom_ebus_intmap {
264 unsigned int phys_hi;
265 unsigned int phys_lo;
266
267 unsigned int interrupt;
268
269 int cnode;
270 unsigned int cinterrupt;
271};
272
273struct linux_prom_ebus_intmask {
274 unsigned int phys_hi;
275 unsigned int phys_lo;
276 unsigned int interrupt;
277};
278#endif /* !(__ASSEMBLY__) */
279
280#endif /* !(__SPARC64_OPENPROM_H) */
diff --git a/arch/sparc/include/asm/oplib_32.h b/arch/sparc/include/asm/oplib_32.h
index 73d45521db04..33e31ce6b31f 100644
--- a/arch/sparc/include/asm/oplib_32.h
+++ b/arch/sparc/include/asm/oplib_32.h
@@ -177,17 +177,6 @@ extern void prom_putsegment(int context, unsigned long virt_addr,
177 177
178/* PROM device tree traversal functions... */ 178/* PROM device tree traversal functions... */
179 179
180#ifdef PROMLIB_INTERNAL
181
182/* Internal version of prom_getchild. */
183extern int __prom_getchild(int parent_node);
184
185/* Internal version of prom_getsibling. */
186extern int __prom_getsibling(int node);
187
188#endif
189
190
191/* Get the child node of the given node, or zero if no child exists. */ 180/* Get the child node of the given node, or zero if no child exists. */
192extern int prom_getchild(int parent_node); 181extern int prom_getchild(int parent_node);
193 182
diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h
index 6d2c2ca98039..a5db0317b5fb 100644
--- a/arch/sparc/include/asm/oplib_64.h
+++ b/arch/sparc/include/asm/oplib_64.h
@@ -218,16 +218,6 @@ extern void prom_unmap(unsigned long size, unsigned long vaddr);
218 218
219/* PROM device tree traversal functions... */ 219/* PROM device tree traversal functions... */
220 220
221#ifdef PROMLIB_INTERNAL
222
223/* Internal version of prom_getchild. */
224extern int __prom_getchild(int parent_node);
225
226/* Internal version of prom_getsibling. */
227extern int __prom_getsibling(int node);
228
229#endif
230
231/* Get the child node of the given node, or zero if no child exists. */ 221/* Get the child node of the given node, or zero if no child exists. */
232extern int prom_getchild(int parent_node); 222extern int prom_getchild(int parent_node);
233 223
diff --git a/arch/sparc/include/asm/posix_types.h b/arch/sparc/include/asm/posix_types.h
index 03a0e091a884..98d6ebb922fb 100644
--- a/arch/sparc/include/asm/posix_types.h
+++ b/arch/sparc/include/asm/posix_types.h
@@ -1,8 +1,155 @@
1#ifndef ___ASM_SPARC_POSIX_TYPES_H 1/*
2#define ___ASM_SPARC_POSIX_TYPES_H 2 * This file is generally used by user-level software, so you need to
3 * be a little careful about namespace pollution etc. Also, we cannot
4 * assume GCC is being used.
5 */
6
7#ifndef __SPARC_POSIX_TYPES_H
8#define __SPARC_POSIX_TYPES_H
9
3#if defined(__sparc__) && defined(__arch64__) 10#if defined(__sparc__) && defined(__arch64__)
4#include <asm/posix_types_64.h> 11/* sparc 64 bit */
12typedef unsigned long __kernel_size_t;
13typedef long __kernel_ssize_t;
14typedef long __kernel_ptrdiff_t;
15typedef long __kernel_time_t;
16typedef long __kernel_clock_t;
17typedef int __kernel_pid_t;
18typedef int __kernel_ipc_pid_t;
19typedef unsigned int __kernel_uid_t;
20typedef unsigned int __kernel_gid_t;
21typedef unsigned long __kernel_ino_t;
22typedef unsigned int __kernel_mode_t;
23typedef unsigned short __kernel_umode_t;
24typedef unsigned int __kernel_nlink_t;
25typedef int __kernel_daddr_t;
26typedef long __kernel_off_t;
27typedef char * __kernel_caddr_t;
28typedef unsigned short __kernel_uid16_t;
29typedef unsigned short __kernel_gid16_t;
30typedef int __kernel_clockid_t;
31typedef int __kernel_timer_t;
32
33typedef unsigned short __kernel_old_uid_t;
34typedef unsigned short __kernel_old_gid_t;
35typedef __kernel_uid_t __kernel_uid32_t;
36typedef __kernel_gid_t __kernel_gid32_t;
37
38typedef unsigned int __kernel_old_dev_t;
39
40/* Note this piece of asymmetry from the v9 ABI. */
41typedef int __kernel_suseconds_t;
42
5#else 43#else
6#include <asm/posix_types_32.h> 44/* sparc 32 bit */
7#endif 45
46typedef unsigned int __kernel_size_t;
47typedef int __kernel_ssize_t;
48typedef long int __kernel_ptrdiff_t;
49typedef long __kernel_time_t;
50typedef long __kernel_suseconds_t;
51typedef long __kernel_clock_t;
52typedef int __kernel_pid_t;
53typedef unsigned short __kernel_ipc_pid_t;
54typedef unsigned short __kernel_uid_t;
55typedef unsigned short __kernel_gid_t;
56typedef unsigned long __kernel_ino_t;
57typedef unsigned short __kernel_mode_t;
58typedef unsigned short __kernel_umode_t;
59typedef short __kernel_nlink_t;
60typedef long __kernel_daddr_t;
61typedef long __kernel_off_t;
62typedef char * __kernel_caddr_t;
63typedef unsigned short __kernel_uid16_t;
64typedef unsigned short __kernel_gid16_t;
65typedef unsigned int __kernel_uid32_t;
66typedef unsigned int __kernel_gid32_t;
67typedef unsigned short __kernel_old_uid_t;
68typedef unsigned short __kernel_old_gid_t;
69typedef unsigned short __kernel_old_dev_t;
70typedef int __kernel_clockid_t;
71typedef int __kernel_timer_t;
72
73#endif /* defined(__sparc__) && defined(__arch64__) */
74
75#ifdef __GNUC__
76typedef long long __kernel_loff_t;
8#endif 77#endif
78
79typedef struct {
80 int val[2];
81} __kernel_fsid_t;
82
83#ifdef __KERNEL__
84
85#undef __FD_SET
86static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
87{
88 unsigned long _tmp = fd / __NFDBITS;
89 unsigned long _rem = fd % __NFDBITS;
90 fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
91}
92
93#undef __FD_CLR
94static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
95{
96 unsigned long _tmp = fd / __NFDBITS;
97 unsigned long _rem = fd % __NFDBITS;
98 fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
99}
100
101#undef __FD_ISSET
102static inline int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
103{
104 unsigned long _tmp = fd / __NFDBITS;
105 unsigned long _rem = fd % __NFDBITS;
106 return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
107}
108
109/*
110 * This will unroll the loop for the normal constant cases (8 or 32 longs,
111 * for 256 and 1024-bit fd_sets respectively)
112 */
113#undef __FD_ZERO
114static inline void __FD_ZERO(__kernel_fd_set *p)
115{
116 unsigned long *tmp = p->fds_bits;
117 int i;
118
119 if (__builtin_constant_p(__FDSET_LONGS)) {
120 switch (__FDSET_LONGS) {
121 case 32:
122 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
123 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
124 tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
125 tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
126 tmp[16] = 0; tmp[17] = 0; tmp[18] = 0; tmp[19] = 0;
127 tmp[20] = 0; tmp[21] = 0; tmp[22] = 0; tmp[23] = 0;
128 tmp[24] = 0; tmp[25] = 0; tmp[26] = 0; tmp[27] = 0;
129 tmp[28] = 0; tmp[29] = 0; tmp[30] = 0; tmp[31] = 0;
130 return;
131 case 16:
132 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
133 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
134 tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
135 tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
136 return;
137 case 8:
138 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
139 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
140 return;
141 case 4:
142 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
143 return;
144 }
145 }
146 i = __FDSET_LONGS;
147 while (i) {
148 i--;
149 *tmp = 0;
150 tmp++;
151 }
152}
153
154#endif /* __KERNEL__ */
155#endif /* __SPARC_POSIX_TYPES_H */
diff --git a/arch/sparc/include/asm/posix_types_32.h b/arch/sparc/include/asm/posix_types_32.h
deleted file mode 100644
index 6bb6eb1ca0f2..000000000000
--- a/arch/sparc/include/asm/posix_types_32.h
+++ /dev/null
@@ -1,118 +0,0 @@
1#ifndef __ARCH_SPARC_POSIX_TYPES_H
2#define __ARCH_SPARC_POSIX_TYPES_H
3
4/*
5 * This file is generally used by user-level software, so you need to
6 * be a little careful about namespace pollution etc. Also, we cannot
7 * assume GCC is being used.
8 */
9
10typedef unsigned int __kernel_size_t;
11typedef int __kernel_ssize_t;
12typedef long int __kernel_ptrdiff_t;
13typedef long __kernel_time_t;
14typedef long __kernel_suseconds_t;
15typedef long __kernel_clock_t;
16typedef int __kernel_pid_t;
17typedef unsigned short __kernel_ipc_pid_t;
18typedef unsigned short __kernel_uid_t;
19typedef unsigned short __kernel_gid_t;
20typedef unsigned long __kernel_ino_t;
21typedef unsigned short __kernel_mode_t;
22typedef unsigned short __kernel_umode_t;
23typedef short __kernel_nlink_t;
24typedef long __kernel_daddr_t;
25typedef long __kernel_off_t;
26typedef char * __kernel_caddr_t;
27typedef unsigned short __kernel_uid16_t;
28typedef unsigned short __kernel_gid16_t;
29typedef unsigned int __kernel_uid32_t;
30typedef unsigned int __kernel_gid32_t;
31typedef unsigned short __kernel_old_uid_t;
32typedef unsigned short __kernel_old_gid_t;
33typedef unsigned short __kernel_old_dev_t;
34typedef int __kernel_clockid_t;
35typedef int __kernel_timer_t;
36
37#ifdef __GNUC__
38typedef long long __kernel_loff_t;
39#endif
40
41typedef struct {
42 int val[2];
43} __kernel_fsid_t;
44
45#if defined(__KERNEL__)
46
47#undef __FD_SET
48static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
49{
50 unsigned long _tmp = fd / __NFDBITS;
51 unsigned long _rem = fd % __NFDBITS;
52 fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
53}
54
55#undef __FD_CLR
56static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
57{
58 unsigned long _tmp = fd / __NFDBITS;
59 unsigned long _rem = fd % __NFDBITS;
60 fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
61}
62
63#undef __FD_ISSET
64static inline int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
65{
66 unsigned long _tmp = fd / __NFDBITS;
67 unsigned long _rem = fd % __NFDBITS;
68 return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
69}
70
71/*
72 * This will unroll the loop for the normal constant cases (8 or 32 longs,
73 * for 256 and 1024-bit fd_sets respectively)
74 */
75#undef __FD_ZERO
76static inline void __FD_ZERO(__kernel_fd_set *p)
77{
78 unsigned long *tmp = p->fds_bits;
79 int i;
80
81 if (__builtin_constant_p(__FDSET_LONGS)) {
82 switch (__FDSET_LONGS) {
83 case 32:
84 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
85 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
86 tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
87 tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
88 tmp[16] = 0; tmp[17] = 0; tmp[18] = 0; tmp[19] = 0;
89 tmp[20] = 0; tmp[21] = 0; tmp[22] = 0; tmp[23] = 0;
90 tmp[24] = 0; tmp[25] = 0; tmp[26] = 0; tmp[27] = 0;
91 tmp[28] = 0; tmp[29] = 0; tmp[30] = 0; tmp[31] = 0;
92 return;
93 case 16:
94 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
95 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
96 tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
97 tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
98 return;
99 case 8:
100 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
101 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
102 return;
103 case 4:
104 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
105 return;
106 }
107 }
108 i = __FDSET_LONGS;
109 while (i) {
110 i--;
111 *tmp = 0;
112 tmp++;
113 }
114}
115
116#endif /* defined(__KERNEL__) */
117
118#endif /* !(__ARCH_SPARC_POSIX_TYPES_H) */
diff --git a/arch/sparc/include/asm/posix_types_64.h b/arch/sparc/include/asm/posix_types_64.h
deleted file mode 100644
index ba8f93295763..000000000000
--- a/arch/sparc/include/asm/posix_types_64.h
+++ /dev/null
@@ -1,122 +0,0 @@
1#ifndef __ARCH_SPARC64_POSIX_TYPES_H
2#define __ARCH_SPARC64_POSIX_TYPES_H
3
4/*
5 * This file is generally used by user-level software, so you need to
6 * be a little careful about namespace pollution etc. Also, we cannot
7 * assume GCC is being used.
8 */
9
10typedef unsigned long __kernel_size_t;
11typedef long __kernel_ssize_t;
12typedef long __kernel_ptrdiff_t;
13typedef long __kernel_time_t;
14typedef long __kernel_clock_t;
15typedef int __kernel_pid_t;
16typedef int __kernel_ipc_pid_t;
17typedef unsigned int __kernel_uid_t;
18typedef unsigned int __kernel_gid_t;
19typedef unsigned long __kernel_ino_t;
20typedef unsigned int __kernel_mode_t;
21typedef unsigned short __kernel_umode_t;
22typedef unsigned int __kernel_nlink_t;
23typedef int __kernel_daddr_t;
24typedef long __kernel_off_t;
25typedef char * __kernel_caddr_t;
26typedef unsigned short __kernel_uid16_t;
27typedef unsigned short __kernel_gid16_t;
28typedef int __kernel_clockid_t;
29typedef int __kernel_timer_t;
30
31typedef unsigned short __kernel_old_uid_t;
32typedef unsigned short __kernel_old_gid_t;
33typedef __kernel_uid_t __kernel_uid32_t;
34typedef __kernel_gid_t __kernel_gid32_t;
35
36typedef unsigned int __kernel_old_dev_t;
37
38/* Note this piece of asymmetry from the v9 ABI. */
39typedef int __kernel_suseconds_t;
40
41#ifdef __GNUC__
42typedef long long __kernel_loff_t;
43#endif
44
45typedef struct {
46 int val[2];
47} __kernel_fsid_t;
48
49#if defined(__KERNEL__)
50
51#undef __FD_SET
52static inline void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
53{
54 unsigned long _tmp = fd / __NFDBITS;
55 unsigned long _rem = fd % __NFDBITS;
56 fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
57}
58
59#undef __FD_CLR
60static inline void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
61{
62 unsigned long _tmp = fd / __NFDBITS;
63 unsigned long _rem = fd % __NFDBITS;
64 fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
65}
66
67#undef __FD_ISSET
68static inline int __FD_ISSET(unsigned long fd, __const__ __kernel_fd_set *p)
69{
70 unsigned long _tmp = fd / __NFDBITS;
71 unsigned long _rem = fd % __NFDBITS;
72 return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
73}
74
75/*
76 * This will unroll the loop for the normal constant cases (8 or 32 longs,
77 * for 256 and 1024-bit fd_sets respectively)
78 */
79#undef __FD_ZERO
80static inline void __FD_ZERO(__kernel_fd_set *p)
81{
82 unsigned long *tmp = p->fds_bits;
83 int i;
84
85 if (__builtin_constant_p(__FDSET_LONGS)) {
86 switch (__FDSET_LONGS) {
87 case 32:
88 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
89 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
90 tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
91 tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
92 tmp[16] = 0; tmp[17] = 0; tmp[18] = 0; tmp[19] = 0;
93 tmp[20] = 0; tmp[21] = 0; tmp[22] = 0; tmp[23] = 0;
94 tmp[24] = 0; tmp[25] = 0; tmp[26] = 0; tmp[27] = 0;
95 tmp[28] = 0; tmp[29] = 0; tmp[30] = 0; tmp[31] = 0;
96 return;
97 case 16:
98 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
99 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
100 tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0;
101 tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0;
102 return;
103 case 8:
104 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
105 tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0;
106 return;
107 case 4:
108 tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0;
109 return;
110 }
111 }
112 i = __FDSET_LONGS;
113 while (i) {
114 i--;
115 *tmp = 0;
116 tmp++;
117 }
118}
119
120#endif /* defined(__KERNEL__) */
121
122#endif /* !(__ARCH_SPARC64_POSIX_TYPES_H) */
diff --git a/arch/sparc/include/asm/processor_32.h b/arch/sparc/include/asm/processor_32.h
index 2ae67a2e7f3a..09521c6a5edb 100644
--- a/arch/sparc/include/asm/processor_32.h
+++ b/arch/sparc/include/asm/processor_32.h
@@ -99,7 +99,7 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc,
99 "st\t%%g0, [%0 + %3 + 0x3c]" 99 "st\t%%g0, [%0 + %3 + 0x3c]"
100 : /* no outputs */ 100 : /* no outputs */
101 : "r" (regs), 101 : "r" (regs),
102 "r" (sp - sizeof(struct reg_window)), 102 "r" (sp - sizeof(struct reg_window32)),
103 "r" (zero), 103 "r" (zero),
104 "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0])) 104 "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))
105 : "memory"); 105 : "memory");
diff --git a/arch/sparc/include/asm/ptrace.h b/arch/sparc/include/asm/ptrace.h
index 6dcbe2eed2e2..30b0b797dc0c 100644
--- a/arch/sparc/include/asm/ptrace.h
+++ b/arch/sparc/include/asm/ptrace.h
@@ -1,8 +1,448 @@
1#ifndef ___ASM_SPARC_PTRACE_H 1#ifndef __SPARC_PTRACE_H
2#define ___ASM_SPARC_PTRACE_H 2#define __SPARC_PTRACE_H
3
3#if defined(__sparc__) && defined(__arch64__) 4#if defined(__sparc__) && defined(__arch64__)
4#include <asm/ptrace_64.h> 5/* 64 bit sparc */
6#include <asm/pstate.h>
7
8/* This struct defines the way the registers are stored on the
9 * stack during a system call and basically all traps.
10 */
11
12/* This magic value must have the low 9 bits clear,
13 * as that is where we encode the %tt value, see below.
14 */
15#define PT_REGS_MAGIC 0x57ac6c00
16
17#ifndef __ASSEMBLY__
18
19#include <linux/types.h>
20
21struct pt_regs {
22 unsigned long u_regs[16]; /* globals and ins */
23 unsigned long tstate;
24 unsigned long tpc;
25 unsigned long tnpc;
26 unsigned int y;
27
28 /* We encode a magic number, PT_REGS_MAGIC, along
29 * with the %tt (trap type) register value at trap
30 * entry time. The magic number allows us to identify
31 * accurately a trap stack frame in the stack
32 * unwinder, and the %tt value allows us to test
33 * things like "in a system call" etc. for an arbitray
34 * process.
35 *
36 * The PT_REGS_MAGIC is choosen such that it can be
37 * loaded completely using just a sethi instruction.
38 */
39 unsigned int magic;
40};
41
42struct pt_regs32 {
43 unsigned int psr;
44 unsigned int pc;
45 unsigned int npc;
46 unsigned int y;
47 unsigned int u_regs[16]; /* globals and ins */
48};
49
50/* A V9 register window */
51struct reg_window {
52 unsigned long locals[8];
53 unsigned long ins[8];
54};
55
56/* A 32-bit register window. */
57struct reg_window32 {
58 unsigned int locals[8];
59 unsigned int ins[8];
60};
61
62/* A V9 Sparc stack frame */
63struct sparc_stackf {
64 unsigned long locals[8];
65 unsigned long ins[6];
66 struct sparc_stackf *fp;
67 unsigned long callers_pc;
68 char *structptr;
69 unsigned long xargs[6];
70 unsigned long xxargs[1];
71};
72
73/* A 32-bit Sparc stack frame */
74struct sparc_stackf32 {
75 unsigned int locals[8];
76 unsigned int ins[6];
77 unsigned int fp;
78 unsigned int callers_pc;
79 unsigned int structptr;
80 unsigned int xargs[6];
81 unsigned int xxargs[1];
82};
83
84struct sparc_trapf {
85 unsigned long locals[8];
86 unsigned long ins[8];
87 unsigned long _unused;
88 struct pt_regs *regs;
89};
90#endif /* (!__ASSEMBLY__) */
5#else 91#else
6#include <asm/ptrace_32.h> 92/* 32 bit sparc */
93
94#include <asm/psr.h>
95
96/* This struct defines the way the registers are stored on the
97 * stack during a system call and basically all traps.
98 */
99#ifndef __ASSEMBLY__
100
101struct pt_regs {
102 unsigned long psr;
103 unsigned long pc;
104 unsigned long npc;
105 unsigned long y;
106 unsigned long u_regs[16]; /* globals and ins */
107};
108
109/* A 32-bit register window. */
110struct reg_window32 {
111 unsigned long locals[8];
112 unsigned long ins[8];
113};
114
115/* A Sparc stack frame */
116struct sparc_stackf {
117 unsigned long locals[8];
118 unsigned long ins[6];
119 struct sparc_stackf *fp;
120 unsigned long callers_pc;
121 char *structptr;
122 unsigned long xargs[6];
123 unsigned long xxargs[1];
124};
125#endif /* (!__ASSEMBLY__) */
126
127#endif /* (defined(__sparc__) && defined(__arch64__))*/
128
129#ifndef __ASSEMBLY__
130
131#define TRACEREG_SZ sizeof(struct pt_regs)
132#define STACKFRAME_SZ sizeof(struct sparc_stackf)
133
134#define TRACEREG32_SZ sizeof(struct pt_regs32)
135#define STACKFRAME32_SZ sizeof(struct sparc_stackf32)
136
137#endif /* (!__ASSEMBLY__) */
138
139#define UREG_G0 0
140#define UREG_G1 1
141#define UREG_G2 2
142#define UREG_G3 3
143#define UREG_G4 4
144#define UREG_G5 5
145#define UREG_G6 6
146#define UREG_G7 7
147#define UREG_I0 8
148#define UREG_I1 9
149#define UREG_I2 10
150#define UREG_I3 11
151#define UREG_I4 12
152#define UREG_I5 13
153#define UREG_I6 14
154#define UREG_I7 15
155#define UREG_FP UREG_I6
156#define UREG_RETPC UREG_I7
157
158#if defined(__sparc__) && defined(__arch64__)
159/* 64 bit sparc */
160
161#ifndef __ASSEMBLY__
162
163#ifdef __KERNEL__
164
165#include <linux/threads.h>
166#include <asm/system.h>
167
168static inline int pt_regs_trap_type(struct pt_regs *regs)
169{
170 return regs->magic & 0x1ff;
171}
172
173static inline bool pt_regs_is_syscall(struct pt_regs *regs)
174{
175 return (regs->tstate & TSTATE_SYSCALL);
176}
177
178static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
179{
180 return (regs->tstate &= ~TSTATE_SYSCALL);
181}
182
183#define arch_ptrace_stop_needed(exit_code, info) \
184({ flush_user_windows(); \
185 get_thread_wsaved() != 0; \
186})
187
188#define arch_ptrace_stop(exit_code, info) \
189 synchronize_user_stack()
190
191struct global_reg_snapshot {
192 unsigned long tstate;
193 unsigned long tpc;
194 unsigned long tnpc;
195 unsigned long o7;
196 unsigned long i7;
197 unsigned long rpc;
198 struct thread_info *thread;
199 unsigned long pad1;
200};
201extern struct global_reg_snapshot global_reg_snapshot[NR_CPUS];
202
203#define force_successful_syscall_return() \
204do { current_thread_info()->syscall_noerror = 1; \
205} while (0)
206#define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV))
207#define instruction_pointer(regs) ((regs)->tpc)
208#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
209#define regs_return_value(regs) ((regs)->u_regs[UREG_I0])
210#ifdef CONFIG_SMP
211extern unsigned long profile_pc(struct pt_regs *);
212#else
213#define profile_pc(regs) instruction_pointer(regs)
7#endif 214#endif
215extern void show_regs(struct pt_regs *);
216#endif /* (__KERNEL__) */
217
218#else /* __ASSEMBLY__ */
219/* For assembly code. */
220#define TRACEREG_SZ 0xa0
221#define STACKFRAME_SZ 0xc0
222
223#define TRACEREG32_SZ 0x50
224#define STACKFRAME32_SZ 0x60
225#endif /* __ASSEMBLY__ */
226
227#else /* (defined(__sparc__) && defined(__arch64__)) */
228
229/* 32 bit sparc */
230
231#ifndef __ASSEMBLY__
232
233#ifdef __KERNEL__
234
235#include <asm/system.h>
236
237static inline bool pt_regs_is_syscall(struct pt_regs *regs)
238{
239 return (regs->psr & PSR_SYSCALL);
240}
241
242static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
243{
244 return (regs->psr &= ~PSR_SYSCALL);
245}
246
247#define arch_ptrace_stop_needed(exit_code, info) \
248({ flush_user_windows(); \
249 current_thread_info()->w_saved != 0; \
250})
251
252#define arch_ptrace_stop(exit_code, info) \
253 synchronize_user_stack()
254
255#define user_mode(regs) (!((regs)->psr & PSR_PS))
256#define instruction_pointer(regs) ((regs)->pc)
257#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
258unsigned long profile_pc(struct pt_regs *);
259extern void show_regs(struct pt_regs *);
260#endif /* (__KERNEL__) */
261
262#else /* (!__ASSEMBLY__) */
263/* For assembly code. */
264#define TRACEREG_SZ 0x50
265#define STACKFRAME_SZ 0x60
266#endif /* (!__ASSEMBLY__) */
267
268#endif /* (defined(__sparc__) && defined(__arch64__)) */
269
270#ifdef __KERNEL__
271#define STACK_BIAS 2047
8#endif 272#endif
273
274/* These are for pt_regs. */
275#define PT_V9_G0 0x00
276#define PT_V9_G1 0x08
277#define PT_V9_G2 0x10
278#define PT_V9_G3 0x18
279#define PT_V9_G4 0x20
280#define PT_V9_G5 0x28
281#define PT_V9_G6 0x30
282#define PT_V9_G7 0x38
283#define PT_V9_I0 0x40
284#define PT_V9_I1 0x48
285#define PT_V9_I2 0x50
286#define PT_V9_I3 0x58
287#define PT_V9_I4 0x60
288#define PT_V9_I5 0x68
289#define PT_V9_I6 0x70
290#define PT_V9_FP PT_V9_I6
291#define PT_V9_I7 0x78
292#define PT_V9_TSTATE 0x80
293#define PT_V9_TPC 0x88
294#define PT_V9_TNPC 0x90
295#define PT_V9_Y 0x98
296#define PT_V9_MAGIC 0x9c
297#define PT_TSTATE PT_V9_TSTATE
298#define PT_TPC PT_V9_TPC
299#define PT_TNPC PT_V9_TNPC
300
301/* These for pt_regs32. */
302#define PT_PSR 0x0
303#define PT_PC 0x4
304#define PT_NPC 0x8
305#define PT_Y 0xc
306#define PT_G0 0x10
307#define PT_WIM PT_G0
308#define PT_G1 0x14
309#define PT_G2 0x18
310#define PT_G3 0x1c
311#define PT_G4 0x20
312#define PT_G5 0x24
313#define PT_G6 0x28
314#define PT_G7 0x2c
315#define PT_I0 0x30
316#define PT_I1 0x34
317#define PT_I2 0x38
318#define PT_I3 0x3c
319#define PT_I4 0x40
320#define PT_I5 0x44
321#define PT_I6 0x48
322#define PT_FP PT_I6
323#define PT_I7 0x4c
324
325/* Reg_window offsets */
326#define RW_V9_L0 0x00
327#define RW_V9_L1 0x08
328#define RW_V9_L2 0x10
329#define RW_V9_L3 0x18
330#define RW_V9_L4 0x20
331#define RW_V9_L5 0x28
332#define RW_V9_L6 0x30
333#define RW_V9_L7 0x38
334#define RW_V9_I0 0x40
335#define RW_V9_I1 0x48
336#define RW_V9_I2 0x50
337#define RW_V9_I3 0x58
338#define RW_V9_I4 0x60
339#define RW_V9_I5 0x68
340#define RW_V9_I6 0x70
341#define RW_V9_I7 0x78
342
343#define RW_L0 0x00
344#define RW_L1 0x04
345#define RW_L2 0x08
346#define RW_L3 0x0c
347#define RW_L4 0x10
348#define RW_L5 0x14
349#define RW_L6 0x18
350#define RW_L7 0x1c
351#define RW_I0 0x20
352#define RW_I1 0x24
353#define RW_I2 0x28
354#define RW_I3 0x2c
355#define RW_I4 0x30
356#define RW_I5 0x34
357#define RW_I6 0x38
358#define RW_I7 0x3c
359
360/* Stack_frame offsets */
361#define SF_V9_L0 0x00
362#define SF_V9_L1 0x08
363#define SF_V9_L2 0x10
364#define SF_V9_L3 0x18
365#define SF_V9_L4 0x20
366#define SF_V9_L5 0x28
367#define SF_V9_L6 0x30
368#define SF_V9_L7 0x38
369#define SF_V9_I0 0x40
370#define SF_V9_I1 0x48
371#define SF_V9_I2 0x50
372#define SF_V9_I3 0x58
373#define SF_V9_I4 0x60
374#define SF_V9_I5 0x68
375#define SF_V9_FP 0x70
376#define SF_V9_PC 0x78
377#define SF_V9_RETP 0x80
378#define SF_V9_XARG0 0x88
379#define SF_V9_XARG1 0x90
380#define SF_V9_XARG2 0x98
381#define SF_V9_XARG3 0xa0
382#define SF_V9_XARG4 0xa8
383#define SF_V9_XARG5 0xb0
384#define SF_V9_XXARG 0xb8
385
386#define SF_L0 0x00
387#define SF_L1 0x04
388#define SF_L2 0x08
389#define SF_L3 0x0c
390#define SF_L4 0x10
391#define SF_L5 0x14
392#define SF_L6 0x18
393#define SF_L7 0x1c
394#define SF_I0 0x20
395#define SF_I1 0x24
396#define SF_I2 0x28
397#define SF_I3 0x2c
398#define SF_I4 0x30
399#define SF_I5 0x34
400#define SF_FP 0x38
401#define SF_PC 0x3c
402#define SF_RETP 0x40
403#define SF_XARG0 0x44
404#define SF_XARG1 0x48
405#define SF_XARG2 0x4c
406#define SF_XARG3 0x50
407#define SF_XARG4 0x54
408#define SF_XARG5 0x58
409#define SF_XXARG 0x5c
410
411#ifdef __KERNEL__
412
413/* global_reg_snapshot offsets */
414#define GR_SNAP_TSTATE 0x00
415#define GR_SNAP_TPC 0x08
416#define GR_SNAP_TNPC 0x10
417#define GR_SNAP_O7 0x18
418#define GR_SNAP_I7 0x20
419#define GR_SNAP_RPC 0x28
420#define GR_SNAP_THREAD 0x30
421#define GR_SNAP_PAD1 0x38
422
423#endif /* __KERNEL__ */
424
425/* Stuff for the ptrace system call */
426#define PTRACE_SPARC_DETACH 11
427#define PTRACE_GETREGS 12
428#define PTRACE_SETREGS 13
429#define PTRACE_GETFPREGS 14
430#define PTRACE_SETFPREGS 15
431#define PTRACE_READDATA 16
432#define PTRACE_WRITEDATA 17
433#define PTRACE_READTEXT 18
434#define PTRACE_WRITETEXT 19
435#define PTRACE_GETFPAREGS 20
436#define PTRACE_SETFPAREGS 21
437
438/* There are for debugging 64-bit processes, either from a 32 or 64 bit
439 * parent. Thus their complements are for debugging 32-bit processes only.
440 */
441
442#define PTRACE_GETREGS64 22
443#define PTRACE_SETREGS64 23
444/* PTRACE_SYSCALL is 24 */
445#define PTRACE_GETFPREGS64 25
446#define PTRACE_SETFPREGS64 26
447
448#endif /* !(__SPARC_PTRACE_H) */
diff --git a/arch/sparc/include/asm/ptrace_32.h b/arch/sparc/include/asm/ptrace_32.h
deleted file mode 100644
index 4cef450167dd..000000000000
--- a/arch/sparc/include/asm/ptrace_32.h
+++ /dev/null
@@ -1,186 +0,0 @@
1#ifndef _SPARC_PTRACE_H
2#define _SPARC_PTRACE_H
3
4#include <asm/psr.h>
5
6/* This struct defines the way the registers are stored on the
7 * stack during a system call and basically all traps.
8 */
9
10#ifndef __ASSEMBLY__
11
12#include <linux/types.h>
13
14struct pt_regs {
15 unsigned long psr;
16 unsigned long pc;
17 unsigned long npc;
18 unsigned long y;
19 unsigned long u_regs[16]; /* globals and ins */
20};
21
22#define UREG_G0 0
23#define UREG_G1 1
24#define UREG_G2 2
25#define UREG_G3 3
26#define UREG_G4 4
27#define UREG_G5 5
28#define UREG_G6 6
29#define UREG_G7 7
30#define UREG_I0 8
31#define UREG_I1 9
32#define UREG_I2 10
33#define UREG_I3 11
34#define UREG_I4 12
35#define UREG_I5 13
36#define UREG_I6 14
37#define UREG_I7 15
38#define UREG_WIM UREG_G0
39#define UREG_FADDR UREG_G0
40#define UREG_FP UREG_I6
41#define UREG_RETPC UREG_I7
42
43/* A register window */
44struct reg_window {
45 unsigned long locals[8];
46 unsigned long ins[8];
47};
48
49/* A Sparc stack frame */
50struct sparc_stackf {
51 unsigned long locals[8];
52 unsigned long ins[6];
53 struct sparc_stackf *fp;
54 unsigned long callers_pc;
55 char *structptr;
56 unsigned long xargs[6];
57 unsigned long xxargs[1];
58};
59
60#define TRACEREG_SZ sizeof(struct pt_regs)
61#define STACKFRAME_SZ sizeof(struct sparc_stackf)
62
63#ifdef __KERNEL__
64
65#include <asm/system.h>
66
67static inline bool pt_regs_is_syscall(struct pt_regs *regs)
68{
69 return (regs->psr & PSR_SYSCALL);
70}
71
72static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
73{
74 return (regs->psr &= ~PSR_SYSCALL);
75}
76
77#define arch_ptrace_stop_needed(exit_code, info) \
78({ flush_user_windows(); \
79 current_thread_info()->w_saved != 0; \
80})
81
82#define arch_ptrace_stop(exit_code, info) \
83 synchronize_user_stack()
84
85#define user_mode(regs) (!((regs)->psr & PSR_PS))
86#define instruction_pointer(regs) ((regs)->pc)
87#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
88unsigned long profile_pc(struct pt_regs *);
89extern void show_regs(struct pt_regs *);
90#endif
91
92#else /* __ASSEMBLY__ */
93/* For assembly code. */
94#define TRACEREG_SZ 0x50
95#define STACKFRAME_SZ 0x60
96#endif
97
98/*
99 * The asm-offsets.h is a generated file, so we cannot include it.
100 * It may be OK for glibc headers, but it's utterly pointless for C code.
101 * The assembly code using those offsets has to include it explicitly.
102 */
103/* #include <asm/asm-offsets.h> */
104
105/* These are for pt_regs. */
106#define PT_PSR 0x0
107#define PT_PC 0x4
108#define PT_NPC 0x8
109#define PT_Y 0xc
110#define PT_G0 0x10
111#define PT_WIM PT_G0
112#define PT_G1 0x14
113#define PT_G2 0x18
114#define PT_G3 0x1c
115#define PT_G4 0x20
116#define PT_G5 0x24
117#define PT_G6 0x28
118#define PT_G7 0x2c
119#define PT_I0 0x30
120#define PT_I1 0x34
121#define PT_I2 0x38
122#define PT_I3 0x3c
123#define PT_I4 0x40
124#define PT_I5 0x44
125#define PT_I6 0x48
126#define PT_FP PT_I6
127#define PT_I7 0x4c
128
129/* Reg_window offsets */
130#define RW_L0 0x00
131#define RW_L1 0x04
132#define RW_L2 0x08
133#define RW_L3 0x0c
134#define RW_L4 0x10
135#define RW_L5 0x14
136#define RW_L6 0x18
137#define RW_L7 0x1c
138#define RW_I0 0x20
139#define RW_I1 0x24
140#define RW_I2 0x28
141#define RW_I3 0x2c
142#define RW_I4 0x30
143#define RW_I5 0x34
144#define RW_I6 0x38
145#define RW_I7 0x3c
146
147/* Stack_frame offsets */
148#define SF_L0 0x00
149#define SF_L1 0x04
150#define SF_L2 0x08
151#define SF_L3 0x0c
152#define SF_L4 0x10
153#define SF_L5 0x14
154#define SF_L6 0x18
155#define SF_L7 0x1c
156#define SF_I0 0x20
157#define SF_I1 0x24
158#define SF_I2 0x28
159#define SF_I3 0x2c
160#define SF_I4 0x30
161#define SF_I5 0x34
162#define SF_FP 0x38
163#define SF_PC 0x3c
164#define SF_RETP 0x40
165#define SF_XARG0 0x44
166#define SF_XARG1 0x48
167#define SF_XARG2 0x4c
168#define SF_XARG3 0x50
169#define SF_XARG4 0x54
170#define SF_XARG5 0x58
171#define SF_XXARG 0x5c
172
173/* Stuff for the ptrace system call */
174#define PTRACE_SPARC_DETACH 11
175#define PTRACE_GETREGS 12
176#define PTRACE_SETREGS 13
177#define PTRACE_GETFPREGS 14
178#define PTRACE_SETFPREGS 15
179#define PTRACE_READDATA 16
180#define PTRACE_WRITEDATA 17
181#define PTRACE_READTEXT 18
182#define PTRACE_WRITETEXT 19
183#define PTRACE_GETFPAREGS 20
184#define PTRACE_SETFPAREGS 21
185
186#endif /* !(_SPARC_PTRACE_H) */
diff --git a/arch/sparc/include/asm/ptrace_64.h b/arch/sparc/include/asm/ptrace_64.h
deleted file mode 100644
index cd6fbfc20435..000000000000
--- a/arch/sparc/include/asm/ptrace_64.h
+++ /dev/null
@@ -1,356 +0,0 @@
1#ifndef _SPARC64_PTRACE_H
2#define _SPARC64_PTRACE_H
3
4#include <asm/pstate.h>
5
6/* This struct defines the way the registers are stored on the
7 * stack during a system call and basically all traps.
8 */
9
10/* This magic value must have the low 9 bits clear,
11 * as that is where we encode the %tt value, see below.
12 */
13#define PT_REGS_MAGIC 0x57ac6c00
14
15#ifndef __ASSEMBLY__
16
17#include <linux/types.h>
18
19struct pt_regs {
20 unsigned long u_regs[16]; /* globals and ins */
21 unsigned long tstate;
22 unsigned long tpc;
23 unsigned long tnpc;
24 unsigned int y;
25
26 /* We encode a magic number, PT_REGS_MAGIC, along
27 * with the %tt (trap type) register value at trap
28 * entry time. The magic number allows us to identify
29 * accurately a trap stack frame in the stack
30 * unwinder, and the %tt value allows us to test
31 * things like "in a system call" etc. for an arbitray
32 * process.
33 *
34 * The PT_REGS_MAGIC is choosen such that it can be
35 * loaded completely using just a sethi instruction.
36 */
37 unsigned int magic;
38};
39
40struct pt_regs32 {
41 unsigned int psr;
42 unsigned int pc;
43 unsigned int npc;
44 unsigned int y;
45 unsigned int u_regs[16]; /* globals and ins */
46};
47
48#define UREG_G0 0
49#define UREG_G1 1
50#define UREG_G2 2
51#define UREG_G3 3
52#define UREG_G4 4
53#define UREG_G5 5
54#define UREG_G6 6
55#define UREG_G7 7
56#define UREG_I0 8
57#define UREG_I1 9
58#define UREG_I2 10
59#define UREG_I3 11
60#define UREG_I4 12
61#define UREG_I5 13
62#define UREG_I6 14
63#define UREG_I7 15
64#define UREG_FP UREG_I6
65#define UREG_RETPC UREG_I7
66
67/* A V9 register window */
68struct reg_window {
69 unsigned long locals[8];
70 unsigned long ins[8];
71};
72
73/* A 32-bit register window. */
74struct reg_window32 {
75 unsigned int locals[8];
76 unsigned int ins[8];
77};
78
79/* A V9 Sparc stack frame */
80struct sparc_stackf {
81 unsigned long locals[8];
82 unsigned long ins[6];
83 struct sparc_stackf *fp;
84 unsigned long callers_pc;
85 char *structptr;
86 unsigned long xargs[6];
87 unsigned long xxargs[1];
88};
89
90/* A 32-bit Sparc stack frame */
91struct sparc_stackf32 {
92 unsigned int locals[8];
93 unsigned int ins[6];
94 unsigned int fp;
95 unsigned int callers_pc;
96 unsigned int structptr;
97 unsigned int xargs[6];
98 unsigned int xxargs[1];
99};
100
101struct sparc_trapf {
102 unsigned long locals[8];
103 unsigned long ins[8];
104 unsigned long _unused;
105 struct pt_regs *regs;
106};
107
108#define TRACEREG_SZ sizeof(struct pt_regs)
109#define STACKFRAME_SZ sizeof(struct sparc_stackf)
110
111#define TRACEREG32_SZ sizeof(struct pt_regs32)
112#define STACKFRAME32_SZ sizeof(struct sparc_stackf32)
113
114#ifdef __KERNEL__
115
116#include <linux/threads.h>
117#include <asm/system.h>
118
119static inline int pt_regs_trap_type(struct pt_regs *regs)
120{
121 return regs->magic & 0x1ff;
122}
123
124static inline bool pt_regs_is_syscall(struct pt_regs *regs)
125{
126 return (regs->tstate & TSTATE_SYSCALL);
127}
128
129static inline bool pt_regs_clear_syscall(struct pt_regs *regs)
130{
131 return (regs->tstate &= ~TSTATE_SYSCALL);
132}
133
134#define arch_ptrace_stop_needed(exit_code, info) \
135({ flush_user_windows(); \
136 get_thread_wsaved() != 0; \
137})
138
139#define arch_ptrace_stop(exit_code, info) \
140 synchronize_user_stack()
141
142struct global_reg_snapshot {
143 unsigned long tstate;
144 unsigned long tpc;
145 unsigned long tnpc;
146 unsigned long o7;
147 unsigned long i7;
148 unsigned long rpc;
149 struct thread_info *thread;
150 unsigned long pad1;
151};
152extern struct global_reg_snapshot global_reg_snapshot[NR_CPUS];
153
154#define force_successful_syscall_return() \
155do { current_thread_info()->syscall_noerror = 1; \
156} while (0)
157#define user_mode(regs) (!((regs)->tstate & TSTATE_PRIV))
158#define instruction_pointer(regs) ((regs)->tpc)
159#define user_stack_pointer(regs) ((regs)->u_regs[UREG_FP])
160#define regs_return_value(regs) ((regs)->u_regs[UREG_I0])
161#ifdef CONFIG_SMP
162extern unsigned long profile_pc(struct pt_regs *);
163#else
164#define profile_pc(regs) instruction_pointer(regs)
165#endif
166extern void show_regs(struct pt_regs *);
167#endif
168
169#else /* __ASSEMBLY__ */
170/* For assembly code. */
171#define TRACEREG_SZ 0xa0
172#define STACKFRAME_SZ 0xc0
173
174#define TRACEREG32_SZ 0x50
175#define STACKFRAME32_SZ 0x60
176#endif
177
178#ifdef __KERNEL__
179#define STACK_BIAS 2047
180#endif
181
182/* These are for pt_regs. */
183#define PT_V9_G0 0x00
184#define PT_V9_G1 0x08
185#define PT_V9_G2 0x10
186#define PT_V9_G3 0x18
187#define PT_V9_G4 0x20
188#define PT_V9_G5 0x28
189#define PT_V9_G6 0x30
190#define PT_V9_G7 0x38
191#define PT_V9_I0 0x40
192#define PT_V9_I1 0x48
193#define PT_V9_I2 0x50
194#define PT_V9_I3 0x58
195#define PT_V9_I4 0x60
196#define PT_V9_I5 0x68
197#define PT_V9_I6 0x70
198#define PT_V9_FP PT_V9_I6
199#define PT_V9_I7 0x78
200#define PT_V9_TSTATE 0x80
201#define PT_V9_TPC 0x88
202#define PT_V9_TNPC 0x90
203#define PT_V9_Y 0x98
204#define PT_V9_MAGIC 0x9c
205#define PT_TSTATE PT_V9_TSTATE
206#define PT_TPC PT_V9_TPC
207#define PT_TNPC PT_V9_TNPC
208
209/* These for pt_regs32. */
210#define PT_PSR 0x0
211#define PT_PC 0x4
212#define PT_NPC 0x8
213#define PT_Y 0xc
214#define PT_G0 0x10
215#define PT_WIM PT_G0
216#define PT_G1 0x14
217#define PT_G2 0x18
218#define PT_G3 0x1c
219#define PT_G4 0x20
220#define PT_G5 0x24
221#define PT_G6 0x28
222#define PT_G7 0x2c
223#define PT_I0 0x30
224#define PT_I1 0x34
225#define PT_I2 0x38
226#define PT_I3 0x3c
227#define PT_I4 0x40
228#define PT_I5 0x44
229#define PT_I6 0x48
230#define PT_FP PT_I6
231#define PT_I7 0x4c
232
233/* Reg_window offsets */
234#define RW_V9_L0 0x00
235#define RW_V9_L1 0x08
236#define RW_V9_L2 0x10
237#define RW_V9_L3 0x18
238#define RW_V9_L4 0x20
239#define RW_V9_L5 0x28
240#define RW_V9_L6 0x30
241#define RW_V9_L7 0x38
242#define RW_V9_I0 0x40
243#define RW_V9_I1 0x48
244#define RW_V9_I2 0x50
245#define RW_V9_I3 0x58
246#define RW_V9_I4 0x60
247#define RW_V9_I5 0x68
248#define RW_V9_I6 0x70
249#define RW_V9_I7 0x78
250
251#define RW_L0 0x00
252#define RW_L1 0x04
253#define RW_L2 0x08
254#define RW_L3 0x0c
255#define RW_L4 0x10
256#define RW_L5 0x14
257#define RW_L6 0x18
258#define RW_L7 0x1c
259#define RW_I0 0x20
260#define RW_I1 0x24
261#define RW_I2 0x28
262#define RW_I3 0x2c
263#define RW_I4 0x30
264#define RW_I5 0x34
265#define RW_I6 0x38
266#define RW_I7 0x3c
267
268/* Stack_frame offsets */
269#define SF_V9_L0 0x00
270#define SF_V9_L1 0x08
271#define SF_V9_L2 0x10
272#define SF_V9_L3 0x18
273#define SF_V9_L4 0x20
274#define SF_V9_L5 0x28
275#define SF_V9_L6 0x30
276#define SF_V9_L7 0x38
277#define SF_V9_I0 0x40
278#define SF_V9_I1 0x48
279#define SF_V9_I2 0x50
280#define SF_V9_I3 0x58
281#define SF_V9_I4 0x60
282#define SF_V9_I5 0x68
283#define SF_V9_FP 0x70
284#define SF_V9_PC 0x78
285#define SF_V9_RETP 0x80
286#define SF_V9_XARG0 0x88
287#define SF_V9_XARG1 0x90
288#define SF_V9_XARG2 0x98
289#define SF_V9_XARG3 0xa0
290#define SF_V9_XARG4 0xa8
291#define SF_V9_XARG5 0xb0
292#define SF_V9_XXARG 0xb8
293
294#define SF_L0 0x00
295#define SF_L1 0x04
296#define SF_L2 0x08
297#define SF_L3 0x0c
298#define SF_L4 0x10
299#define SF_L5 0x14
300#define SF_L6 0x18
301#define SF_L7 0x1c
302#define SF_I0 0x20
303#define SF_I1 0x24
304#define SF_I2 0x28
305#define SF_I3 0x2c
306#define SF_I4 0x30
307#define SF_I5 0x34
308#define SF_FP 0x38
309#define SF_PC 0x3c
310#define SF_RETP 0x40
311#define SF_XARG0 0x44
312#define SF_XARG1 0x48
313#define SF_XARG2 0x4c
314#define SF_XARG3 0x50
315#define SF_XARG4 0x54
316#define SF_XARG5 0x58
317#define SF_XXARG 0x5c
318
319#ifdef __KERNEL__
320
321/* global_reg_snapshot offsets */
322#define GR_SNAP_TSTATE 0x00
323#define GR_SNAP_TPC 0x08
324#define GR_SNAP_TNPC 0x10
325#define GR_SNAP_O7 0x18
326#define GR_SNAP_I7 0x20
327#define GR_SNAP_RPC 0x28
328#define GR_SNAP_THREAD 0x30
329#define GR_SNAP_PAD1 0x38
330
331#endif /* __KERNEL__ */
332
333/* Stuff for the ptrace system call */
334#define PTRACE_SPARC_DETACH 11
335#define PTRACE_GETREGS 12
336#define PTRACE_SETREGS 13
337#define PTRACE_GETFPREGS 14
338#define PTRACE_SETFPREGS 15
339#define PTRACE_READDATA 16
340#define PTRACE_WRITEDATA 17
341#define PTRACE_READTEXT 18
342#define PTRACE_WRITETEXT 19
343#define PTRACE_GETFPAREGS 20
344#define PTRACE_SETFPAREGS 21
345
346/* There are for debugging 64-bit processes, either from a 32 or 64 bit
347 * parent. Thus their complements are for debugging 32-bit processes only.
348 */
349
350#define PTRACE_GETREGS64 22
351#define PTRACE_SETREGS64 23
352/* PTRACE_SYSCALL is 24 */
353#define PTRACE_GETFPREGS64 25
354#define PTRACE_SETFPREGS64 26
355
356#endif /* !(_SPARC64_PTRACE_H) */
diff --git a/arch/sparc/include/asm/reg.h b/arch/sparc/include/asm/reg.h
deleted file mode 100644
index 0c16e19cae4d..000000000000
--- a/arch/sparc/include/asm/reg.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef ___ASM_SPARC_REG_H
2#define ___ASM_SPARC_REG_H
3#if defined(__sparc__) && defined(__arch64__)
4#include <asm/reg_64.h>
5#else
6#include <asm/reg_32.h>
7#endif
8#endif
diff --git a/arch/sparc/include/asm/reg_32.h b/arch/sparc/include/asm/reg_32.h
deleted file mode 100644
index 1efb056fb3d1..000000000000
--- a/arch/sparc/include/asm/reg_32.h
+++ /dev/null
@@ -1,79 +0,0 @@
1/*
2 * linux/include/asm/reg.h
3 * Layout of the registers as expected by gdb on the Sparc
4 * we should replace the user.h definitions with those in
5 * this file, we don't even use the other
6 * -miguel
7 *
8 * The names of the structures, constants and aliases in this file
9 * have the same names as the sunos ones, some programs rely on these
10 * names (gdb for example).
11 *
12 */
13
14#ifndef __SPARC_REG_H
15#define __SPARC_REG_H
16
17struct regs {
18 int r_psr;
19#define r_ps r_psr
20 int r_pc;
21 int r_npc;
22 int r_y;
23 int r_g1;
24 int r_g2;
25 int r_g3;
26 int r_g4;
27 int r_g5;
28 int r_g6;
29 int r_g7;
30 int r_o0;
31 int r_o1;
32 int r_o2;
33 int r_o3;
34 int r_o4;
35 int r_o5;
36 int r_o6;
37 int r_o7;
38};
39
40struct fpq {
41 unsigned long *addr;
42 unsigned long instr;
43};
44
45struct fq {
46 union {
47 double whole;
48 struct fpq fpq;
49 } FQu;
50};
51
52#define FPU_REGS_TYPE unsigned int
53#define FPU_FSR_TYPE unsigned
54
55struct fp_status {
56 union {
57 FPU_REGS_TYPE Fpu_regs[32];
58 double Fpu_dregs[16];
59 } fpu_fr;
60 FPU_FSR_TYPE Fpu_fsr;
61 unsigned Fpu_flags;
62 unsigned Fpu_extra;
63 unsigned Fpu_qcnt;
64 struct fq Fpu_q[16];
65};
66
67#define fpu_regs f_fpstatus.fpu_fr.Fpu_regs
68#define fpu_dregs f_fpstatus.fpu_fr.Fpu_dregs
69#define fpu_fsr f_fpstatus.Fpu_fsr
70#define fpu_flags f_fpstatus.Fpu_flags
71#define fpu_extra f_fpstatus.Fpu_extra
72#define fpu_q f_fpstatus.Fpu_q
73#define fpu_qcnt f_fpstatus.Fpu_qcnt
74
75struct fpu {
76 struct fp_status f_fpstatus;
77};
78
79#endif /* __SPARC_REG_H */
diff --git a/arch/sparc/include/asm/reg_64.h b/arch/sparc/include/asm/reg_64.h
deleted file mode 100644
index 6f277d7c7d88..000000000000
--- a/arch/sparc/include/asm/reg_64.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * linux/asm/reg.h
3 * Layout of the registers as expected by gdb on the Sparc
4 * we should replace the user.h definitions with those in
5 * this file, we don't even use the other
6 * -miguel
7 *
8 * The names of the structures, constants and aliases in this file
9 * have the same names as the sunos ones, some programs rely on these
10 * names (gdb for example).
11 *
12 */
13
14#ifndef __SPARC64_REG_H
15#define __SPARC64_REG_H
16
17struct regs {
18 unsigned long r_g1;
19 unsigned long r_g2;
20 unsigned long r_g3;
21 unsigned long r_g4;
22 unsigned long r_g5;
23 unsigned long r_g6;
24 unsigned long r_g7;
25 unsigned long r_o0;
26 unsigned long r_o1;
27 unsigned long r_o2;
28 unsigned long r_o3;
29 unsigned long r_o4;
30 unsigned long r_o5;
31 unsigned long r_o6;
32 unsigned long r_o7;
33 unsigned long __pad;
34 unsigned long r_tstate;
35 unsigned long r_tpc;
36 unsigned long r_tnpc;
37 unsigned int r_y;
38 unsigned int r_fprs;
39};
40
41#define FPU_REGS_TYPE unsigned int
42#define FPU_FSR_TYPE unsigned long
43
44struct fp_status {
45 unsigned long fpu_fr[32];
46 unsigned long Fpu_fsr;
47};
48
49struct fpu {
50 struct fp_status f_fpstatus;
51};
52
53#define fpu_regs f_fpstatus.fpu_fr
54#define fpu_fsr f_fpstatus.Fpu_fsr
55
56#endif /* __SPARC64_REG_H */
diff --git a/arch/sparc/include/asm/sigcontext.h b/arch/sparc/include/asm/sigcontext.h
index e92de7e286b5..a1607d180354 100644
--- a/arch/sparc/include/asm/sigcontext.h
+++ b/arch/sparc/include/asm/sigcontext.h
@@ -1,8 +1,96 @@
1#ifndef ___ASM_SPARC_SIGCONTEXT_H 1#ifndef __SPARC_SIGCONTEXT_H
2#define ___ASM_SPARC_SIGCONTEXT_H 2#define __SPARC_SIGCONTEXT_H
3#if defined(__sparc__) && defined(__arch64__) 3
4#include <asm/sigcontext_64.h> 4#ifdef __KERNEL__
5#include <asm/ptrace.h>
6
7#ifndef __ASSEMBLY__
8
9#define __SUNOS_MAXWIN 31
10
11/* This is what SunOS does, so shall I unless we use new 32bit signals or rt signals. */
12struct sigcontext32 {
13 int sigc_onstack; /* state to restore */
14 int sigc_mask; /* sigmask to restore */
15 int sigc_sp; /* stack pointer */
16 int sigc_pc; /* program counter */
17 int sigc_npc; /* next program counter */
18 int sigc_psr; /* for condition codes etc */
19 int sigc_g1; /* User uses these two registers */
20 int sigc_o0; /* within the trampoline code. */
21
22 /* Now comes information regarding the users window set
23 * at the time of the signal.
24 */
25 int sigc_oswins; /* outstanding windows */
26
27 /* stack ptrs for each regwin buf */
28 unsigned sigc_spbuf[__SUNOS_MAXWIN];
29
30 /* Windows to restore after signal */
31 struct reg_window32 sigc_wbuf[__SUNOS_MAXWIN];
32};
33
34
35/* This is what we use for 32bit new non-rt signals. */
36
37typedef struct {
38 struct {
39 unsigned int psr;
40 unsigned int pc;
41 unsigned int npc;
42 unsigned int y;
43 unsigned int u_regs[16]; /* globals and ins */
44 } si_regs;
45 int si_mask;
46} __siginfo32_t;
47
48#ifdef CONFIG_SPARC64
49typedef struct {
50 unsigned int si_float_regs [64];
51 unsigned long si_fsr;
52 unsigned long si_gsr;
53 unsigned long si_fprs;
54} __siginfo_fpu_t;
55
56/* This is what SunOS doesn't, so we have to write this alone
57 and do it properly. */
58struct sigcontext {
59 /* The size of this array has to match SI_MAX_SIZE from siginfo.h */
60 char sigc_info[128];
61 struct {
62 unsigned long u_regs[16]; /* globals and ins */
63 unsigned long tstate;
64 unsigned long tpc;
65 unsigned long tnpc;
66 unsigned int y;
67 unsigned int fprs;
68 } sigc_regs;
69 __siginfo_fpu_t * sigc_fpu_save;
70 struct {
71 void * ss_sp;
72 int ss_flags;
73 unsigned long ss_size;
74 } sigc_stack;
75 unsigned long sigc_mask;
76};
77
5#else 78#else
6#include <asm/sigcontext_32.h> 79
7#endif 80typedef struct {
8#endif 81 unsigned long si_float_regs [32];
82 unsigned long si_fsr;
83 unsigned long si_fpqdepth;
84 struct {
85 unsigned long *insn_addr;
86 unsigned long insn;
87 } si_fpqueue [16];
88} __siginfo_fpu_t;
89#endif /* (CONFIG_SPARC64) */
90
91
92#endif /* !(__ASSEMBLY__) */
93
94#endif /* (__KERNEL__) */
95
96#endif /* !(__SPARC_SIGCONTEXT_H) */
diff --git a/arch/sparc/include/asm/sigcontext_32.h b/arch/sparc/include/asm/sigcontext_32.h
deleted file mode 100644
index c5fb60dcbd75..000000000000
--- a/arch/sparc/include/asm/sigcontext_32.h
+++ /dev/null
@@ -1,62 +0,0 @@
1#ifndef __SPARC_SIGCONTEXT_H
2#define __SPARC_SIGCONTEXT_H
3
4#ifdef __KERNEL__
5#include <asm/ptrace.h>
6
7#ifndef __ASSEMBLY__
8
9#define __SUNOS_MAXWIN 31
10
11/* This is what SunOS does, so shall I. */
12struct sigcontext {
13 int sigc_onstack; /* state to restore */
14 int sigc_mask; /* sigmask to restore */
15 int sigc_sp; /* stack pointer */
16 int sigc_pc; /* program counter */
17 int sigc_npc; /* next program counter */
18 int sigc_psr; /* for condition codes etc */
19 int sigc_g1; /* User uses these two registers */
20 int sigc_o0; /* within the trampoline code. */
21
22 /* Now comes information regarding the users window set
23 * at the time of the signal.
24 */
25 int sigc_oswins; /* outstanding windows */
26
27 /* stack ptrs for each regwin buf */
28 char *sigc_spbuf[__SUNOS_MAXWIN];
29
30 /* Windows to restore after signal */
31 struct {
32 unsigned long locals[8];
33 unsigned long ins[8];
34 } sigc_wbuf[__SUNOS_MAXWIN];
35};
36
37typedef struct {
38 struct {
39 unsigned long psr;
40 unsigned long pc;
41 unsigned long npc;
42 unsigned long y;
43 unsigned long u_regs[16]; /* globals and ins */
44 } si_regs;
45 int si_mask;
46} __siginfo_t;
47
48typedef struct {
49 unsigned long si_float_regs [32];
50 unsigned long si_fsr;
51 unsigned long si_fpqdepth;
52 struct {
53 unsigned long *insn_addr;
54 unsigned long insn;
55 } si_fpqueue [16];
56} __siginfo_fpu_t;
57
58#endif /* !(__ASSEMBLY__) */
59
60#endif /* (__KERNEL__) */
61
62#endif /* !(__SPARC_SIGCONTEXT_H) */
diff --git a/arch/sparc/include/asm/sigcontext_64.h b/arch/sparc/include/asm/sigcontext_64.h
deleted file mode 100644
index 1c868d680cfc..000000000000
--- a/arch/sparc/include/asm/sigcontext_64.h
+++ /dev/null
@@ -1,87 +0,0 @@
1#ifndef __SPARC64_SIGCONTEXT_H
2#define __SPARC64_SIGCONTEXT_H
3
4#ifdef __KERNEL__
5#include <asm/ptrace.h>
6#endif
7
8#ifndef __ASSEMBLY__
9
10#ifdef __KERNEL__
11
12#define __SUNOS_MAXWIN 31
13
14/* This is what SunOS does, so shall I unless we use new 32bit signals or rt signals. */
15struct sigcontext32 {
16 int sigc_onstack; /* state to restore */
17 int sigc_mask; /* sigmask to restore */
18 int sigc_sp; /* stack pointer */
19 int sigc_pc; /* program counter */
20 int sigc_npc; /* next program counter */
21 int sigc_psr; /* for condition codes etc */
22 int sigc_g1; /* User uses these two registers */
23 int sigc_o0; /* within the trampoline code. */
24
25 /* Now comes information regarding the users window set
26 * at the time of the signal.
27 */
28 int sigc_oswins; /* outstanding windows */
29
30 /* stack ptrs for each regwin buf */
31 unsigned sigc_spbuf[__SUNOS_MAXWIN];
32
33 /* Windows to restore after signal */
34 struct reg_window32 sigc_wbuf[__SUNOS_MAXWIN];
35};
36
37#endif
38
39#ifdef __KERNEL__
40
41/* This is what we use for 32bit new non-rt signals. */
42
43typedef struct {
44 struct {
45 unsigned int psr;
46 unsigned int pc;
47 unsigned int npc;
48 unsigned int y;
49 unsigned int u_regs[16]; /* globals and ins */
50 } si_regs;
51 int si_mask;
52} __siginfo32_t;
53
54#endif
55
56typedef struct {
57 unsigned int si_float_regs [64];
58 unsigned long si_fsr;
59 unsigned long si_gsr;
60 unsigned long si_fprs;
61} __siginfo_fpu_t;
62
63/* This is what SunOS doesn't, so we have to write this alone
64 and do it properly. */
65struct sigcontext {
66 /* The size of this array has to match SI_MAX_SIZE from siginfo.h */
67 char sigc_info[128];
68 struct {
69 unsigned long u_regs[16]; /* globals and ins */
70 unsigned long tstate;
71 unsigned long tpc;
72 unsigned long tnpc;
73 unsigned int y;
74 unsigned int fprs;
75 } sigc_regs;
76 __siginfo_fpu_t * sigc_fpu_save;
77 struct {
78 void * ss_sp;
79 int ss_flags;
80 unsigned long ss_size;
81 } sigc_stack;
82 unsigned long sigc_mask;
83};
84
85#endif /* !(__ASSEMBLY__) */
86
87#endif /* !(__SPARC64_SIGCONTEXT_H) */
diff --git a/arch/sparc/include/asm/siginfo.h b/arch/sparc/include/asm/siginfo.h
index bd81f8d7f5ce..988e5d8ed11a 100644
--- a/arch/sparc/include/asm/siginfo.h
+++ b/arch/sparc/include/asm/siginfo.h
@@ -1,8 +1,37 @@
1#ifndef ___ASM_SPARC_SIGINFO_H 1#ifndef __SPARC_SIGINFO_H
2#define ___ASM_SPARC_SIGINFO_H 2#define __SPARC_SIGINFO_H
3
3#if defined(__sparc__) && defined(__arch64__) 4#if defined(__sparc__) && defined(__arch64__)
4#include <asm/siginfo_64.h> 5
5#else 6#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
6#include <asm/siginfo_32.h> 7#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
7#endif 8#define __ARCH_SI_BAND_T int
8#endif 9
10#endif /* defined(__sparc__) && defined(__arch64__) */
11
12
13#define __ARCH_SI_TRAPNO
14
15#include <asm-generic/siginfo.h>
16
17#ifdef __KERNEL__
18
19#include <linux/compat.h>
20
21#ifdef CONFIG_COMPAT
22
23struct compat_siginfo;
24
25#endif /* CONFIG_COMPAT */
26
27#endif /* __KERNEL__ */
28
29#define SI_NOINFO 32767 /* no information in siginfo_t */
30
31/*
32 * SIGEMT si_codes
33 */
34#define EMT_TAGOVF (__SI_FAULT|1) /* tag overflow */
35#define NSIGEMT 1
36
37#endif /* !(__SPARC_SIGINFO_H) */
diff --git a/arch/sparc/include/asm/siginfo_32.h b/arch/sparc/include/asm/siginfo_32.h
deleted file mode 100644
index 3c71af135c52..000000000000
--- a/arch/sparc/include/asm/siginfo_32.h
+++ /dev/null
@@ -1,17 +0,0 @@
1#ifndef _SPARC_SIGINFO_H
2#define _SPARC_SIGINFO_H
3
4#define __ARCH_SI_UID_T unsigned int
5#define __ARCH_SI_TRAPNO
6
7#include <asm-generic/siginfo.h>
8
9#define SI_NOINFO 32767 /* no information in siginfo_t */
10
11/*
12 * SIGEMT si_codes
13 */
14#define EMT_TAGOVF (__SI_FAULT|1) /* tag overflow */
15#define NSIGEMT 1
16
17#endif /* !(_SPARC_SIGINFO_H) */
diff --git a/arch/sparc/include/asm/siginfo_64.h b/arch/sparc/include/asm/siginfo_64.h
deleted file mode 100644
index c96e6c30f8b0..000000000000
--- a/arch/sparc/include/asm/siginfo_64.h
+++ /dev/null
@@ -1,32 +0,0 @@
1#ifndef _SPARC64_SIGINFO_H
2#define _SPARC64_SIGINFO_H
3
4#define SI_PAD_SIZE32 ((SI_MAX_SIZE/sizeof(int)) - 3)
5
6#define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
7#define __ARCH_SI_TRAPNO
8#define __ARCH_SI_BAND_T int
9
10#include <asm-generic/siginfo.h>
11
12#ifdef __KERNEL__
13
14#include <linux/compat.h>
15
16#ifdef CONFIG_COMPAT
17
18struct compat_siginfo;
19
20#endif /* CONFIG_COMPAT */
21
22#endif /* __KERNEL__ */
23
24#define SI_NOINFO 32767 /* no information in siginfo_t */
25
26/*
27 * SIGEMT si_codes
28 */
29#define EMT_TAGOVF (__SI_FAULT|1) /* tag overflow */
30#define NSIGEMT 1
31
32#endif
diff --git a/arch/sparc/include/asm/signal.h b/arch/sparc/include/asm/signal.h
index 27ab05dc203e..cba45206b7f2 100644
--- a/arch/sparc/include/asm/signal.h
+++ b/arch/sparc/include/asm/signal.h
@@ -1,8 +1,214 @@
1#ifndef ___ASM_SPARC_SIGNAL_H 1#ifndef __SPARC_SIGNAL_H
2#define ___ASM_SPARC_SIGNAL_H 2#define __SPARC_SIGNAL_H
3#if defined(__sparc__) && defined(__arch64__) 3
4#include <asm/signal_64.h> 4#include <asm/sigcontext.h>
5#include <linux/compiler.h>
6
7#ifdef __KERNEL__
8#ifndef __ASSEMBLY__
9#include <linux/personality.h>
10#include <linux/types.h>
11#endif
12#endif
13
14/* On the Sparc the signal handlers get passed a 'sub-signal' code
15 * for certain signal types, which we document here.
16 */
17#define SIGHUP 1
18#define SIGINT 2
19#define SIGQUIT 3
20#define SIGILL 4
21#define SUBSIG_STACK 0
22#define SUBSIG_ILLINST 2
23#define SUBSIG_PRIVINST 3
24#define SUBSIG_BADTRAP(t) (0x80 + (t))
25
26#define SIGTRAP 5
27#define SIGABRT 6
28#define SIGIOT 6
29
30#define SIGEMT 7
31#define SUBSIG_TAG 10
32
33#define SIGFPE 8
34#define SUBSIG_FPDISABLED 0x400
35#define SUBSIG_FPERROR 0x404
36#define SUBSIG_FPINTOVFL 0x001
37#define SUBSIG_FPSTSIG 0x002
38#define SUBSIG_IDIVZERO 0x014
39#define SUBSIG_FPINEXACT 0x0c4
40#define SUBSIG_FPDIVZERO 0x0c8
41#define SUBSIG_FPUNFLOW 0x0cc
42#define SUBSIG_FPOPERROR 0x0d0
43#define SUBSIG_FPOVFLOW 0x0d4
44
45#define SIGKILL 9
46#define SIGBUS 10
47#define SUBSIG_BUSTIMEOUT 1
48#define SUBSIG_ALIGNMENT 2
49#define SUBSIG_MISCERROR 5
50
51#define SIGSEGV 11
52#define SUBSIG_NOMAPPING 3
53#define SUBSIG_PROTECTION 4
54#define SUBSIG_SEGERROR 5
55
56#define SIGSYS 12
57
58#define SIGPIPE 13
59#define SIGALRM 14
60#define SIGTERM 15
61#define SIGURG 16
62
63/* SunOS values which deviate from the Linux/i386 ones */
64#define SIGSTOP 17
65#define SIGTSTP 18
66#define SIGCONT 19
67#define SIGCHLD 20
68#define SIGTTIN 21
69#define SIGTTOU 22
70#define SIGIO 23
71#define SIGPOLL SIGIO /* SysV name for SIGIO */
72#define SIGXCPU 24
73#define SIGXFSZ 25
74#define SIGVTALRM 26
75#define SIGPROF 27
76#define SIGWINCH 28
77#define SIGLOST 29
78#define SIGPWR SIGLOST
79#define SIGUSR1 30
80#define SIGUSR2 31
81
82/* Most things should be clean enough to redefine this at will, if care
83 is taken to make libc match. */
84
85#define __OLD_NSIG 32
86#define __NEW_NSIG 64
87#ifdef __arch64__
88#define _NSIG_BPW 64
89#else
90#define _NSIG_BPW 32
91#endif
92#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
93
94#define SIGRTMIN 32
95#define SIGRTMAX __NEW_NSIG
96
97#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
98#define _NSIG __NEW_NSIG
99#define __new_sigset_t sigset_t
100#define __new_sigaction sigaction
101#define __new_sigaction32 sigaction32
102#define __old_sigset_t old_sigset_t
103#define __old_sigaction old_sigaction
104#define __old_sigaction32 old_sigaction32
5#else 105#else
6#include <asm/signal_32.h> 106#define _NSIG __OLD_NSIG
107#define NSIG _NSIG
108#define __old_sigset_t sigset_t
109#define __old_sigaction sigaction
110#define __old_sigaction32 sigaction32
7#endif 111#endif
112
113#ifndef __ASSEMBLY__
114
115typedef unsigned long __old_sigset_t; /* at least 32 bits */
116
117typedef struct {
118 unsigned long sig[_NSIG_WORDS];
119} __new_sigset_t;
120
121/* A SunOS sigstack */
122struct sigstack {
123 /* XXX 32-bit pointers pinhead XXX */
124 char *the_stack;
125 int cur_status;
126};
127
128/* Sigvec flags */
129#define _SV_SSTACK 1u /* This signal handler should use sig-stack */
130#define _SV_INTR 2u /* Sig return should not restart system call */
131#define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
132#define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
133
134/*
135 * sa_flags values: SA_STACK is not currently supported, but will allow the
136 * usage of signal stacks by using the (now obsolete) sa_restorer field in
137 * the sigaction structure as a stack pointer. This is now possible due to
138 * the changes in signal handling. LBT 010493.
139 * SA_RESTART flag to get restarting signals (which were the default long ago)
140 */
141#define SA_NOCLDSTOP _SV_IGNCHILD
142#define SA_STACK _SV_SSTACK
143#define SA_ONSTACK _SV_SSTACK
144#define SA_RESTART _SV_INTR
145#define SA_ONESHOT _SV_RESET
146#define SA_NOMASK 0x20u
147#define SA_NOCLDWAIT 0x100u
148#define SA_SIGINFO 0x200u
149
150
151#define SIG_BLOCK 0x01 /* for blocking signals */
152#define SIG_UNBLOCK 0x02 /* for unblocking signals */
153#define SIG_SETMASK 0x04 /* for setting the signal mask */
154
155/*
156 * sigaltstack controls
157 */
158#define SS_ONSTACK 1
159#define SS_DISABLE 2
160
161#define MINSIGSTKSZ 4096
162#define SIGSTKSZ 16384
163
164#ifdef __KERNEL__
165/*
166 * DJHR
167 * SA_STATIC_ALLOC is used for the sparc32 system to indicate that this
168 * interrupt handler's irq structure should be statically allocated
169 * by the request_irq routine.
170 * The alternative is that arch/sparc/kernel/irq.c has carnal knowledge
171 * of interrupt usage and that sucks. Also without a flag like this
172 * it may be possible for the free_irq routine to attempt to free
173 * statically allocated data.. which is NOT GOOD.
174 *
175 */
176#define SA_STATIC_ALLOC 0x8000
8#endif 177#endif
178
179#include <asm-generic/signal.h>
180
181struct __new_sigaction {
182 __sighandler_t sa_handler;
183 unsigned long sa_flags;
184 __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
185 __new_sigset_t sa_mask;
186};
187
188struct __old_sigaction {
189 __sighandler_t sa_handler;
190 __old_sigset_t sa_mask;
191 unsigned long sa_flags;
192 void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
193};
194
195typedef struct sigaltstack {
196 void __user *ss_sp;
197 int ss_flags;
198 size_t ss_size;
199} stack_t;
200
201#ifdef __KERNEL__
202
203struct k_sigaction {
204 struct __new_sigaction sa;
205 void __user *ka_restorer;
206};
207
208#define ptrace_signal_deliver(regs, cookie) do { } while (0)
209
210#endif /* !(__KERNEL__) */
211
212#endif /* !(__ASSEMBLY__) */
213
214#endif /* !(__SPARC_SIGNAL_H) */
diff --git a/arch/sparc/include/asm/signal_32.h b/arch/sparc/include/asm/signal_32.h
deleted file mode 100644
index 96a60ab03ca1..000000000000
--- a/arch/sparc/include/asm/signal_32.h
+++ /dev/null
@@ -1,207 +0,0 @@
1#ifndef _ASMSPARC_SIGNAL_H
2#define _ASMSPARC_SIGNAL_H
3
4#include <asm/sigcontext.h>
5#include <linux/compiler.h>
6
7#ifdef __KERNEL__
8#ifndef __ASSEMBLY__
9#include <linux/personality.h>
10#include <linux/types.h>
11#endif
12#endif
13
14/* On the Sparc the signal handlers get passed a 'sub-signal' code
15 * for certain signal types, which we document here.
16 */
17#define SIGHUP 1
18#define SIGINT 2
19#define SIGQUIT 3
20#define SIGILL 4
21#define SUBSIG_STACK 0
22#define SUBSIG_ILLINST 2
23#define SUBSIG_PRIVINST 3
24#define SUBSIG_BADTRAP(t) (0x80 + (t))
25
26#define SIGTRAP 5
27#define SIGABRT 6
28#define SIGIOT 6
29
30#define SIGEMT 7
31#define SUBSIG_TAG 10
32
33#define SIGFPE 8
34#define SUBSIG_FPDISABLED 0x400
35#define SUBSIG_FPERROR 0x404
36#define SUBSIG_FPINTOVFL 0x001
37#define SUBSIG_FPSTSIG 0x002
38#define SUBSIG_IDIVZERO 0x014
39#define SUBSIG_FPINEXACT 0x0c4
40#define SUBSIG_FPDIVZERO 0x0c8
41#define SUBSIG_FPUNFLOW 0x0cc
42#define SUBSIG_FPOPERROR 0x0d0
43#define SUBSIG_FPOVFLOW 0x0d4
44
45#define SIGKILL 9
46#define SIGBUS 10
47#define SUBSIG_BUSTIMEOUT 1
48#define SUBSIG_ALIGNMENT 2
49#define SUBSIG_MISCERROR 5
50
51#define SIGSEGV 11
52#define SUBSIG_NOMAPPING 3
53#define SUBSIG_PROTECTION 4
54#define SUBSIG_SEGERROR 5
55
56#define SIGSYS 12
57
58#define SIGPIPE 13
59#define SIGALRM 14
60#define SIGTERM 15
61#define SIGURG 16
62
63/* SunOS values which deviate from the Linux/i386 ones */
64#define SIGSTOP 17
65#define SIGTSTP 18
66#define SIGCONT 19
67#define SIGCHLD 20
68#define SIGTTIN 21
69#define SIGTTOU 22
70#define SIGIO 23
71#define SIGPOLL SIGIO /* SysV name for SIGIO */
72#define SIGXCPU 24
73#define SIGXFSZ 25
74#define SIGVTALRM 26
75#define SIGPROF 27
76#define SIGWINCH 28
77#define SIGLOST 29
78#define SIGPWR SIGLOST
79#define SIGUSR1 30
80#define SIGUSR2 31
81
82/* Most things should be clean enough to redefine this at will, if care
83 * is taken to make libc match.
84 */
85
86#define __OLD_NSIG 32
87#define __NEW_NSIG 64
88#define _NSIG_BPW 32
89#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
90
91#define SIGRTMIN 32
92#define SIGRTMAX __NEW_NSIG
93
94#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
95#define _NSIG __NEW_NSIG
96#define __new_sigset_t sigset_t
97#define __new_sigaction sigaction
98#define __old_sigset_t old_sigset_t
99#define __old_sigaction old_sigaction
100#else
101#define _NSIG __OLD_NSIG
102#define __old_sigset_t sigset_t
103#define __old_sigaction sigaction
104#endif
105
106#ifndef __ASSEMBLY__
107
108typedef unsigned long __old_sigset_t;
109
110typedef struct {
111 unsigned long sig[_NSIG_WORDS];
112} __new_sigset_t;
113
114
115#ifdef __KERNEL__
116/* A SunOS sigstack */
117struct sigstack {
118 char *the_stack;
119 int cur_status;
120};
121#endif
122
123/* Sigvec flags */
124#define _SV_SSTACK 1u /* This signal handler should use sig-stack */
125#define _SV_INTR 2u /* Sig return should not restart system call */
126#define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
127#define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
128
129/*
130 * sa_flags values: SA_STACK is not currently supported, but will allow the
131 * usage of signal stacks by using the (now obsolete) sa_restorer field in
132 * the sigaction structure as a stack pointer. This is now possible due to
133 * the changes in signal handling. LBT 010493.
134 * SA_RESTART flag to get restarting signals (which were the default long ago)
135 */
136#define SA_NOCLDSTOP _SV_IGNCHILD
137#define SA_STACK _SV_SSTACK
138#define SA_ONSTACK _SV_SSTACK
139#define SA_RESTART _SV_INTR
140#define SA_ONESHOT _SV_RESET
141#define SA_NOMASK 0x20u
142#define SA_NOCLDWAIT 0x100u
143#define SA_SIGINFO 0x200u
144
145#define SIG_BLOCK 0x01 /* for blocking signals */
146#define SIG_UNBLOCK 0x02 /* for unblocking signals */
147#define SIG_SETMASK 0x04 /* for setting the signal mask */
148
149/*
150 * sigaltstack controls
151 */
152#define SS_ONSTACK 1
153#define SS_DISABLE 2
154
155#define MINSIGSTKSZ 4096
156#define SIGSTKSZ 16384
157
158#ifdef __KERNEL__
159/*
160 * DJHR
161 * SA_STATIC_ALLOC is used for the SPARC system to indicate that this
162 * interrupt handler's irq structure should be statically allocated
163 * by the request_irq routine.
164 * The alternative is that arch/sparc/kernel/irq.c has carnal knowledge
165 * of interrupt usage and that sucks. Also without a flag like this
166 * it may be possible for the free_irq routine to attempt to free
167 * statically allocated data.. which is NOT GOOD.
168 *
169 */
170#define SA_STATIC_ALLOC 0x8000
171#endif
172
173#include <asm-generic/signal.h>
174
175#ifdef __KERNEL__
176struct __new_sigaction {
177 __sighandler_t sa_handler;
178 unsigned long sa_flags;
179 void (*sa_restorer)(void); /* Not used by Linux/SPARC */
180 __new_sigset_t sa_mask;
181};
182
183struct k_sigaction {
184 struct __new_sigaction sa;
185 void __user *ka_restorer;
186};
187
188struct __old_sigaction {
189 __sighandler_t sa_handler;
190 __old_sigset_t sa_mask;
191 unsigned long sa_flags;
192 void (*sa_restorer) (void); /* not used by Linux/SPARC */
193};
194
195typedef struct sigaltstack {
196 void __user *ss_sp;
197 int ss_flags;
198 size_t ss_size;
199} stack_t;
200
201#define ptrace_signal_deliver(regs, cookie) do { } while (0)
202
203#endif /* !(__KERNEL__) */
204
205#endif /* !(__ASSEMBLY__) */
206
207#endif /* !(_ASMSPARC_SIGNAL_H) */
diff --git a/arch/sparc/include/asm/signal_64.h b/arch/sparc/include/asm/signal_64.h
deleted file mode 100644
index ab1509a101c5..000000000000
--- a/arch/sparc/include/asm/signal_64.h
+++ /dev/null
@@ -1,194 +0,0 @@
1#ifndef _ASMSPARC64_SIGNAL_H
2#define _ASMSPARC64_SIGNAL_H
3
4#include <asm/sigcontext.h>
5
6#ifdef __KERNEL__
7#ifndef __ASSEMBLY__
8#include <linux/personality.h>
9#include <linux/types.h>
10#endif
11#endif
12
13/* On the Sparc the signal handlers get passed a 'sub-signal' code
14 * for certain signal types, which we document here.
15 */
16#define SIGHUP 1
17#define SIGINT 2
18#define SIGQUIT 3
19#define SIGILL 4
20#define SUBSIG_STACK 0
21#define SUBSIG_ILLINST 2
22#define SUBSIG_PRIVINST 3
23#define SUBSIG_BADTRAP(t) (0x80 + (t))
24
25#define SIGTRAP 5
26#define SIGABRT 6
27#define SIGIOT 6
28
29#define SIGEMT 7
30#define SUBSIG_TAG 10
31
32#define SIGFPE 8
33#define SUBSIG_FPDISABLED 0x400
34#define SUBSIG_FPERROR 0x404
35#define SUBSIG_FPINTOVFL 0x001
36#define SUBSIG_FPSTSIG 0x002
37#define SUBSIG_IDIVZERO 0x014
38#define SUBSIG_FPINEXACT 0x0c4
39#define SUBSIG_FPDIVZERO 0x0c8
40#define SUBSIG_FPUNFLOW 0x0cc
41#define SUBSIG_FPOPERROR 0x0d0
42#define SUBSIG_FPOVFLOW 0x0d4
43
44#define SIGKILL 9
45#define SIGBUS 10
46#define SUBSIG_BUSTIMEOUT 1
47#define SUBSIG_ALIGNMENT 2
48#define SUBSIG_MISCERROR 5
49
50#define SIGSEGV 11
51#define SUBSIG_NOMAPPING 3
52#define SUBSIG_PROTECTION 4
53#define SUBSIG_SEGERROR 5
54
55#define SIGSYS 12
56
57#define SIGPIPE 13
58#define SIGALRM 14
59#define SIGTERM 15
60#define SIGURG 16
61
62/* SunOS values which deviate from the Linux/i386 ones */
63#define SIGSTOP 17
64#define SIGTSTP 18
65#define SIGCONT 19
66#define SIGCHLD 20
67#define SIGTTIN 21
68#define SIGTTOU 22
69#define SIGIO 23
70#define SIGPOLL SIGIO /* SysV name for SIGIO */
71#define SIGXCPU 24
72#define SIGXFSZ 25
73#define SIGVTALRM 26
74#define SIGPROF 27
75#define SIGWINCH 28
76#define SIGLOST 29
77#define SIGPWR SIGLOST
78#define SIGUSR1 30
79#define SIGUSR2 31
80
81/* Most things should be clean enough to redefine this at will, if care
82 is taken to make libc match. */
83
84#define __OLD_NSIG 32
85#define __NEW_NSIG 64
86#define _NSIG_BPW 64
87#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
88
89#define SIGRTMIN 32
90#define SIGRTMAX __NEW_NSIG
91
92#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
93#define _NSIG __NEW_NSIG
94#define __new_sigset_t sigset_t
95#define __new_sigaction sigaction
96#define __new_sigaction32 sigaction32
97#define __old_sigset_t old_sigset_t
98#define __old_sigaction old_sigaction
99#define __old_sigaction32 old_sigaction32
100#else
101#define _NSIG __OLD_NSIG
102#define NSIG _NSIG
103#define __old_sigset_t sigset_t
104#define __old_sigaction sigaction
105#define __old_sigaction32 sigaction32
106#endif
107
108#ifndef __ASSEMBLY__
109
110typedef unsigned long __old_sigset_t; /* at least 32 bits */
111
112typedef struct {
113 unsigned long sig[_NSIG_WORDS];
114} __new_sigset_t;
115
116/* A SunOS sigstack */
117struct sigstack {
118 /* XXX 32-bit pointers pinhead XXX */
119 char *the_stack;
120 int cur_status;
121};
122
123/* Sigvec flags */
124#define _SV_SSTACK 1u /* This signal handler should use sig-stack */
125#define _SV_INTR 2u /* Sig return should not restart system call */
126#define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
127#define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
128
129/*
130 * sa_flags values: SA_STACK is not currently supported, but will allow the
131 * usage of signal stacks by using the (now obsolete) sa_restorer field in
132 * the sigaction structure as a stack pointer. This is now possible due to
133 * the changes in signal handling. LBT 010493.
134 * SA_RESTART flag to get restarting signals (which were the default long ago)
135 */
136#define SA_NOCLDSTOP _SV_IGNCHILD
137#define SA_STACK _SV_SSTACK
138#define SA_ONSTACK _SV_SSTACK
139#define SA_RESTART _SV_INTR
140#define SA_ONESHOT _SV_RESET
141#define SA_NOMASK 0x20u
142#define SA_NOCLDWAIT 0x100u
143#define SA_SIGINFO 0x200u
144
145
146#define SIG_BLOCK 0x01 /* for blocking signals */
147#define SIG_UNBLOCK 0x02 /* for unblocking signals */
148#define SIG_SETMASK 0x04 /* for setting the signal mask */
149
150/*
151 * sigaltstack controls
152 */
153#define SS_ONSTACK 1
154#define SS_DISABLE 2
155
156#define MINSIGSTKSZ 4096
157#define SIGSTKSZ 16384
158
159#include <asm-generic/signal.h>
160
161struct __new_sigaction {
162 __sighandler_t sa_handler;
163 unsigned long sa_flags;
164 __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
165 __new_sigset_t sa_mask;
166};
167
168struct __old_sigaction {
169 __sighandler_t sa_handler;
170 __old_sigset_t sa_mask;
171 unsigned long sa_flags;
172 void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
173};
174
175typedef struct sigaltstack {
176 void __user *ss_sp;
177 int ss_flags;
178 size_t ss_size;
179} stack_t;
180
181#ifdef __KERNEL__
182
183struct k_sigaction {
184 struct __new_sigaction sa;
185 void __user *ka_restorer;
186};
187
188#define ptrace_signal_deliver(regs, cookie) do { } while (0)
189
190#endif /* !(__KERNEL__) */
191
192#endif /* !(__ASSEMBLY__) */
193
194#endif /* !(_ASMSPARC64_SIGNAL_H) */
diff --git a/arch/sparc/include/asm/smp_32.h b/arch/sparc/include/asm/smp_32.h
index a8180e546a48..58101dc70493 100644
--- a/arch/sparc/include/asm/smp_32.h
+++ b/arch/sparc/include/asm/smp_32.h
@@ -29,8 +29,6 @@
29 */ 29 */
30 30
31extern unsigned char boot_cpu_id; 31extern unsigned char boot_cpu_id;
32extern cpumask_t phys_cpu_present_map;
33#define cpu_possible_map phys_cpu_present_map
34 32
35typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long, 33typedef void (*smpfunc_t)(unsigned long, unsigned long, unsigned long,
36 unsigned long, unsigned long); 34 unsigned long, unsigned long);
@@ -172,7 +170,4 @@ void smp_setup_cpu_possible_map(void);
172#define smp_setup_cpu_possible_map() do { } while (0) 170#define smp_setup_cpu_possible_map() do { } while (0)
173 171
174#endif /* !(SMP) */ 172#endif /* !(SMP) */
175
176#define NO_PROC_ID 0xFF
177
178#endif /* !(_SPARC_SMP_H) */ 173#endif /* !(_SPARC_SMP_H) */
diff --git a/arch/sparc/include/asm/stat.h b/arch/sparc/include/asm/stat.h
index d8153013df72..55db5eca08e2 100644
--- a/arch/sparc/include/asm/stat.h
+++ b/arch/sparc/include/asm/stat.h
@@ -1,8 +1,107 @@
1#ifndef ___ASM_SPARC_STAT_H 1#ifndef __SPARC_STAT_H
2#define ___ASM_SPARC_STAT_H 2#define __SPARC_STAT_H
3
4#include <linux/types.h>
5
3#if defined(__sparc__) && defined(__arch64__) 6#if defined(__sparc__) && defined(__arch64__)
4#include <asm/stat_64.h> 7/* 64 bit sparc */
8struct stat {
9 unsigned st_dev;
10 ino_t st_ino;
11 mode_t st_mode;
12 short st_nlink;
13 uid_t st_uid;
14 gid_t st_gid;
15 unsigned st_rdev;
16 off_t st_size;
17 time_t st_atime;
18 time_t st_mtime;
19 time_t st_ctime;
20 off_t st_blksize;
21 off_t st_blocks;
22 unsigned long __unused4[2];
23};
24
25struct stat64 {
26 unsigned long st_dev;
27 unsigned long st_ino;
28 unsigned long st_nlink;
29
30 unsigned int st_mode;
31 unsigned int st_uid;
32 unsigned int st_gid;
33 unsigned int __pad0;
34
35 unsigned long st_rdev;
36 long st_size;
37 long st_blksize;
38 long st_blocks;
39
40 unsigned long st_atime;
41 unsigned long st_atime_nsec;
42 unsigned long st_mtime;
43 unsigned long st_mtime_nsec;
44 unsigned long st_ctime;
45 unsigned long st_ctime_nsec;
46 long __unused[3];
47};
48
5#else 49#else
6#include <asm/stat_32.h> 50/* 32 bit sparc */
7#endif 51struct stat {
8#endif 52 unsigned short st_dev;
53 ino_t st_ino;
54 mode_t st_mode;
55 short st_nlink;
56 uid_t st_uid;
57 gid_t st_gid;
58 unsigned short st_rdev;
59 off_t st_size;
60 time_t st_atime;
61 unsigned long st_atime_nsec;
62 time_t st_mtime;
63 unsigned long st_mtime_nsec;
64 time_t st_ctime;
65 unsigned long st_ctime_nsec;
66 off_t st_blksize;
67 off_t st_blocks;
68 unsigned long __unused4[2];
69};
70
71#define STAT_HAVE_NSEC 1
72
73struct stat64 {
74 unsigned long long st_dev;
75
76 unsigned long long st_ino;
77
78 unsigned int st_mode;
79 unsigned int st_nlink;
80
81 unsigned int st_uid;
82 unsigned int st_gid;
83
84 unsigned long long st_rdev;
85
86 unsigned char __pad3[8];
87
88 long long st_size;
89 unsigned int st_blksize;
90
91 unsigned char __pad4[8];
92 unsigned int st_blocks;
93
94 unsigned int st_atime;
95 unsigned int st_atime_nsec;
96
97 unsigned int st_mtime;
98 unsigned int st_mtime_nsec;
99
100 unsigned int st_ctime;
101 unsigned int st_ctime_nsec;
102
103 unsigned int __unused4;
104 unsigned int __unused5;
105};
106#endif /* defined(__sparc__) && defined(__arch64__) */
107#endif /* __SPARC_STAT_H */
diff --git a/arch/sparc/include/asm/stat_32.h b/arch/sparc/include/asm/stat_32.h
deleted file mode 100644
index 2299e1d5d94c..000000000000
--- a/arch/sparc/include/asm/stat_32.h
+++ /dev/null
@@ -1,76 +0,0 @@
1#ifndef _SPARC_STAT_H
2#define _SPARC_STAT_H
3
4#include <linux/types.h>
5
6struct __old_kernel_stat {
7 unsigned short st_dev;
8 unsigned short st_ino;
9 unsigned short st_mode;
10 unsigned short st_nlink;
11 unsigned short st_uid;
12 unsigned short st_gid;
13 unsigned short st_rdev;
14 unsigned long st_size;
15 unsigned long st_atime;
16 unsigned long st_mtime;
17 unsigned long st_ctime;
18};
19
20struct stat {
21 unsigned short st_dev;
22 unsigned long st_ino;
23 unsigned short st_mode;
24 short st_nlink;
25 unsigned short st_uid;
26 unsigned short st_gid;
27 unsigned short st_rdev;
28 long st_size;
29 long st_atime;
30 unsigned long st_atime_nsec;
31 long st_mtime;
32 unsigned long st_mtime_nsec;
33 long st_ctime;
34 unsigned long st_ctime_nsec;
35 long st_blksize;
36 long st_blocks;
37 unsigned long __unused4[2];
38};
39
40#define STAT_HAVE_NSEC 1
41
42struct stat64 {
43 unsigned long long st_dev;
44
45 unsigned long long st_ino;
46
47 unsigned int st_mode;
48 unsigned int st_nlink;
49
50 unsigned int st_uid;
51 unsigned int st_gid;
52
53 unsigned long long st_rdev;
54
55 unsigned char __pad3[8];
56
57 long long st_size;
58 unsigned int st_blksize;
59
60 unsigned char __pad4[8];
61 unsigned int st_blocks;
62
63 unsigned int st_atime;
64 unsigned int st_atime_nsec;
65
66 unsigned int st_mtime;
67 unsigned int st_mtime_nsec;
68
69 unsigned int st_ctime;
70 unsigned int st_ctime_nsec;
71
72 unsigned int __unused4;
73 unsigned int __unused5;
74};
75
76#endif
diff --git a/arch/sparc/include/asm/stat_64.h b/arch/sparc/include/asm/stat_64.h
deleted file mode 100644
index 9650fdea847f..000000000000
--- a/arch/sparc/include/asm/stat_64.h
+++ /dev/null
@@ -1,47 +0,0 @@
1#ifndef _SPARC64_STAT_H
2#define _SPARC64_STAT_H
3
4#include <linux/types.h>
5
6struct stat {
7 unsigned st_dev;
8 ino_t st_ino;
9 mode_t st_mode;
10 short st_nlink;
11 uid_t st_uid;
12 gid_t st_gid;
13 unsigned st_rdev;
14 off_t st_size;
15 time_t st_atime;
16 time_t st_mtime;
17 time_t st_ctime;
18 off_t st_blksize;
19 off_t st_blocks;
20 unsigned long __unused4[2];
21};
22
23struct stat64 {
24 unsigned long st_dev;
25 unsigned long st_ino;
26 unsigned long st_nlink;
27
28 unsigned int st_mode;
29 unsigned int st_uid;
30 unsigned int st_gid;
31 unsigned int __pad0;
32
33 unsigned long st_rdev;
34 long st_size;
35 long st_blksize;
36 long st_blocks;
37
38 unsigned long st_atime;
39 unsigned long st_atime_nsec;
40 unsigned long st_mtime;
41 unsigned long st_mtime_nsec;
42 unsigned long st_ctime;
43 unsigned long st_ctime_nsec;
44 long __unused[3];
45};
46
47#endif
diff --git a/arch/sparc/include/asm/swab.h b/arch/sparc/include/asm/swab.h
new file mode 100644
index 000000000000..a34ad079487e
--- /dev/null
+++ b/arch/sparc/include/asm/swab.h
@@ -0,0 +1,45 @@
1#ifndef _SPARC_SWAB_H
2#define _SPARC_SWAB_H
3
4#include <linux/types.h>
5#include <asm/asi.h>
6
7#if defined(__sparc__) && defined(__arch64__)
8static inline __u16 __arch_swab16p(const __u16 *addr)
9{
10 __u16 ret;
11
12 __asm__ __volatile__ ("lduha [%1] %2, %0"
13 : "=r" (ret)
14 : "r" (addr), "i" (ASI_PL));
15 return ret;
16}
17#define __arch_swab16p __arch_swab16p
18
19static inline __u32 __arch_swab32p(const __u32 *addr)
20{
21 __u32 ret;
22
23 __asm__ __volatile__ ("lduwa [%1] %2, %0"
24 : "=r" (ret)
25 : "r" (addr), "i" (ASI_PL));
26 return ret;
27}
28#define __arch_swab32p __arch_swab32p
29
30static inline __u64 __arch_swab64p(const __u64 *addr)
31{
32 __u64 ret;
33
34 __asm__ __volatile__ ("ldxa [%1] %2, %0"
35 : "=r" (ret)
36 : "r" (addr), "i" (ASI_PL));
37 return ret;
38}
39#define __arch_swab64p __arch_swab64p
40
41#else
42#define __SWAB_64_THRU_32__
43#endif /* defined(__sparc__) && defined(__arch64__) */
44
45#endif /* _SPARC_SWAB_H */
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
index 80fe547c3f45..0f7b0e5fb1c7 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -45,7 +45,7 @@ struct thread_info {
45 /* A place to store user windows and stack pointers 45 /* A place to store user windows and stack pointers
46 * when the stack needs inspection. 46 * when the stack needs inspection.
47 */ 47 */
48 struct reg_window reg_window[NSWINS]; /* align for ldd! */ 48 struct reg_window32 reg_window[NSWINS]; /* align for ldd! */
49 unsigned long rwbuf_stkptrs[NSWINS]; 49 unsigned long rwbuf_stkptrs[NSWINS];
50 unsigned long w_saved; 50 unsigned long w_saved;
51 51
diff --git a/arch/sparc/include/asm/timer_64.h b/arch/sparc/include/asm/timer_64.h
index 5b779fd1f788..ef3c3682debf 100644
--- a/arch/sparc/include/asm/timer_64.h
+++ b/arch/sparc/include/asm/timer_64.h
@@ -10,7 +10,7 @@
10#include <linux/init.h> 10#include <linux/init.h>
11 11
12struct sparc64_tick_ops { 12struct sparc64_tick_ops {
13 unsigned long (*get_tick)(void); 13 unsigned long long (*get_tick)(void);
14 int (*add_compare)(unsigned long); 14 int (*add_compare)(unsigned long);
15 unsigned long softint_mask; 15 unsigned long softint_mask;
16 void (*disable_irq)(void); 16 void (*disable_irq)(void);
diff --git a/arch/sparc/include/asm/topology_64.h b/arch/sparc/include/asm/topology_64.h
index 001c04027c82..5bc0b8fd6374 100644
--- a/arch/sparc/include/asm/topology_64.h
+++ b/arch/sparc/include/asm/topology_64.h
@@ -16,8 +16,12 @@ static inline cpumask_t node_to_cpumask(int node)
16{ 16{
17 return numa_cpumask_lookup_table[node]; 17 return numa_cpumask_lookup_table[node];
18} 18}
19#define cpumask_of_node(node) (&numa_cpumask_lookup_table[node])
19 20
20/* Returns a pointer to the cpumask of CPUs on Node 'node'. */ 21/*
22 * Returns a pointer to the cpumask of CPUs on Node 'node'.
23 * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)"
24 */
21#define node_to_cpumask_ptr(v, node) \ 25#define node_to_cpumask_ptr(v, node) \
22 cpumask_t *v = &(numa_cpumask_lookup_table[node]) 26 cpumask_t *v = &(numa_cpumask_lookup_table[node])
23 27
@@ -26,9 +30,7 @@ static inline cpumask_t node_to_cpumask(int node)
26 30
27static inline int node_to_first_cpu(int node) 31static inline int node_to_first_cpu(int node)
28{ 32{
29 cpumask_t tmp; 33 return cpumask_first(cpumask_of_node(node));
30 tmp = node_to_cpumask(node);
31 return first_cpu(tmp);
32} 34}
33 35
34struct pci_bus; 36struct pci_bus;
@@ -45,6 +47,10 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
45 (pcibus_to_node(bus) == -1 ? \ 47 (pcibus_to_node(bus) == -1 ? \
46 CPU_MASK_ALL : \ 48 CPU_MASK_ALL : \
47 node_to_cpumask(pcibus_to_node(bus))) 49 node_to_cpumask(pcibus_to_node(bus)))
50#define cpumask_of_pcibus(bus) \
51 (pcibus_to_node(bus) == -1 ? \
52 CPU_MASK_ALL_PTR : \
53 cpumask_of_node(pcibus_to_node(bus)))
48 54
49#define SD_NODE_INIT (struct sched_domain) { \ 55#define SD_NODE_INIT (struct sched_domain) { \
50 .min_interval = 8, \ 56 .min_interval = 8, \
@@ -77,10 +83,13 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
77#define topology_core_id(cpu) (cpu_data(cpu).core_id) 83#define topology_core_id(cpu) (cpu_data(cpu).core_id)
78#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 84#define topology_core_siblings(cpu) (cpu_core_map[cpu])
79#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) 85#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
86#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
87#define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
80#define mc_capable() (sparc64_multi_core) 88#define mc_capable() (sparc64_multi_core)
81#define smt_capable() (sparc64_multi_core) 89#define smt_capable() (sparc64_multi_core)
82#endif /* CONFIG_SMP */ 90#endif /* CONFIG_SMP */
83 91
84#define cpu_coregroup_map(cpu) (cpu_core_map[cpu]) 92#define cpu_coregroup_map(cpu) (cpu_core_map[cpu])
93#define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu])
85 94
86#endif /* _ASM_SPARC64_TOPOLOGY_H */ 95#endif /* _ASM_SPARC64_TOPOLOGY_H */
diff --git a/arch/sparc/include/asm/traps.h b/arch/sparc/include/asm/traps.h
index bebdbf8f43a8..3aa62dde343f 100644
--- a/arch/sparc/include/asm/traps.h
+++ b/arch/sparc/include/asm/traps.h
@@ -10,7 +10,7 @@
10#define NUM_SPARC_TRAPS 255 10#define NUM_SPARC_TRAPS 255
11 11
12#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
13 13#ifdef __KERNEL__
14/* This is for V8 compliant Sparc CPUS */ 14/* This is for V8 compliant Sparc CPUS */
15struct tt_entry { 15struct tt_entry {
16 unsigned long inst_one; 16 unsigned long inst_one;
@@ -22,14 +22,7 @@ struct tt_entry {
22/* We set this to _start in system setup. */ 22/* We set this to _start in system setup. */
23extern struct tt_entry *sparc_ttable; 23extern struct tt_entry *sparc_ttable;
24 24
25static inline unsigned long get_tbr(void) 25#endif /* (__KERNEL__) */
26{
27 unsigned long tbr;
28
29 __asm__ __volatile__("rd %%tbr, %0\n\t" : "=r" (tbr));
30 return tbr;
31}
32
33#endif /* !(__ASSEMBLY__) */ 26#endif /* !(__ASSEMBLY__) */
34 27
35/* For patching the trap table at boot time, we need to know how to 28/* For patching the trap table at boot time, we need to know how to
diff --git a/arch/sparc/include/asm/types.h b/arch/sparc/include/asm/types.h
index 8c28fde5eaa2..2237118825d0 100644
--- a/arch/sparc/include/asm/types.h
+++ b/arch/sparc/include/asm/types.h
@@ -11,7 +11,7 @@
11#if defined(__sparc__) && defined(__arch64__) 11#if defined(__sparc__) && defined(__arch64__)
12 12
13/*** SPARC 64 bit ***/ 13/*** SPARC 64 bit ***/
14#include <asm-generic/int-l64.h> 14#include <asm-generic/int-ll64.h>
15 15
16#ifndef __ASSEMBLY__ 16#ifndef __ASSEMBLY__
17 17
diff --git a/arch/sparc/kernel/auxio_32.c b/arch/sparc/kernel/auxio_32.c
index 09c857215a52..45c41232fc4c 100644
--- a/arch/sparc/kernel/auxio_32.c
+++ b/arch/sparc/kernel/auxio_32.c
@@ -76,6 +76,7 @@ unsigned char get_auxio(void)
76 return sbus_readb(auxio_register); 76 return sbus_readb(auxio_register);
77 return 0; 77 return 0;
78} 78}
79EXPORT_SYMBOL(get_auxio);
79 80
80void set_auxio(unsigned char bits_on, unsigned char bits_off) 81void set_auxio(unsigned char bits_on, unsigned char bits_off)
81{ 82{
@@ -102,7 +103,7 @@ void set_auxio(unsigned char bits_on, unsigned char bits_off)
102 }; 103 };
103 spin_unlock_irqrestore(&auxio_lock, flags); 104 spin_unlock_irqrestore(&auxio_lock, flags);
104} 105}
105 106EXPORT_SYMBOL(set_auxio);
106 107
107/* sun4m power control register (AUXIO2) */ 108/* sun4m power control register (AUXIO2) */
108 109
diff --git a/arch/sparc/kernel/auxio_64.c b/arch/sparc/kernel/auxio_64.c
index 8b67347d4221..9f52db2d441c 100644
--- a/arch/sparc/kernel/auxio_64.c
+++ b/arch/sparc/kernel/auxio_64.c
@@ -72,6 +72,7 @@ void auxio_set_led(int on)
72 bit = (ebus ? AUXIO_PCIO_LED : AUXIO_AUX1_LED); 72 bit = (ebus ? AUXIO_PCIO_LED : AUXIO_AUX1_LED);
73 __auxio_set_bit(bit, on, ebus); 73 __auxio_set_bit(bit, on, ebus);
74} 74}
75EXPORT_SYMBOL(auxio_set_led);
75 76
76static void __auxio_sbus_set_lte(int on) 77static void __auxio_sbus_set_lte(int on)
77{ 78{
@@ -90,6 +91,7 @@ void auxio_set_lte(int on)
90 break; 91 break;
91 } 92 }
92} 93}
94EXPORT_SYMBOL(auxio_set_lte);
93 95
94static struct of_device_id __initdata auxio_match[] = { 96static struct of_device_id __initdata auxio_match[] = {
95 { 97 {
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
index 6c2da2420f76..f0b825505da5 100644
--- a/arch/sparc/kernel/cpu.c
+++ b/arch/sparc/kernel/cpu.c
@@ -5,6 +5,7 @@
5 */ 5 */
6 6
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8#include <linux/module.h>
8#include <linux/init.h> 9#include <linux/init.h>
9#include <linux/smp.h> 10#include <linux/smp.h>
10#include <linux/threads.h> 11#include <linux/threads.h>
@@ -20,6 +21,7 @@
20#include "kernel.h" 21#include "kernel.h"
21 22
22DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; 23DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };
24EXPORT_PER_CPU_SYMBOL(__cpu_data);
23 25
24struct cpu_info { 26struct cpu_info {
25 int psr_vers; 27 int psr_vers;
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c
index f52e0534d91d..57c39843fb2a 100644
--- a/arch/sparc/kernel/ds.c
+++ b/arch/sparc/kernel/ds.c
@@ -286,7 +286,7 @@ static void md_update_data(struct ds_info *dp,
286 286
287 rp = (struct ds_md_update_req *) (dpkt + 1); 287 rp = (struct ds_md_update_req *) (dpkt + 1);
288 288
289 printk(KERN_INFO "ds-%lu: Machine description update.\n", dp->id); 289 printk(KERN_INFO "ds-%llu: Machine description update.\n", dp->id);
290 290
291 mdesc_update(); 291 mdesc_update();
292 292
@@ -325,7 +325,7 @@ static void domain_shutdown_data(struct ds_info *dp,
325 325
326 rp = (struct ds_shutdown_req *) (dpkt + 1); 326 rp = (struct ds_shutdown_req *) (dpkt + 1);
327 327
328 printk(KERN_ALERT "ds-%lu: Shutdown request from " 328 printk(KERN_ALERT "ds-%llu: Shutdown request from "
329 "LDOM manager received.\n", dp->id); 329 "LDOM manager received.\n", dp->id);
330 330
331 memset(&pkt, 0, sizeof(pkt)); 331 memset(&pkt, 0, sizeof(pkt));
@@ -365,7 +365,7 @@ static void domain_panic_data(struct ds_info *dp,
365 365
366 rp = (struct ds_panic_req *) (dpkt + 1); 366 rp = (struct ds_panic_req *) (dpkt + 1);
367 367
368 printk(KERN_ALERT "ds-%lu: Panic request from " 368 printk(KERN_ALERT "ds-%llu: Panic request from "
369 "LDOM manager received.\n", dp->id); 369 "LDOM manager received.\n", dp->id);
370 370
371 memset(&pkt, 0, sizeof(pkt)); 371 memset(&pkt, 0, sizeof(pkt));
@@ -549,7 +549,7 @@ static int __cpuinit dr_cpu_configure(struct ds_info *dp,
549 for_each_cpu_mask(cpu, *mask) { 549 for_each_cpu_mask(cpu, *mask) {
550 int err; 550 int err;
551 551
552 printk(KERN_INFO "ds-%lu: Starting cpu %d...\n", 552 printk(KERN_INFO "ds-%llu: Starting cpu %d...\n",
553 dp->id, cpu); 553 dp->id, cpu);
554 err = cpu_up(cpu); 554 err = cpu_up(cpu);
555 if (err) { 555 if (err) {
@@ -565,7 +565,7 @@ static int __cpuinit dr_cpu_configure(struct ds_info *dp,
565 res = DR_CPU_RES_CPU_NOT_RESPONDING; 565 res = DR_CPU_RES_CPU_NOT_RESPONDING;
566 } 566 }
567 567
568 printk(KERN_INFO "ds-%lu: CPU startup failed err=%d\n", 568 printk(KERN_INFO "ds-%llu: CPU startup failed err=%d\n",
569 dp->id, err); 569 dp->id, err);
570 dr_cpu_mark(resp, cpu, ncpus, res, stat); 570 dr_cpu_mark(resp, cpu, ncpus, res, stat);
571 } 571 }
@@ -605,7 +605,7 @@ static int dr_cpu_unconfigure(struct ds_info *dp,
605 for_each_cpu_mask(cpu, *mask) { 605 for_each_cpu_mask(cpu, *mask) {
606 int err; 606 int err;
607 607
608 printk(KERN_INFO "ds-%lu: Shutting down cpu %d...\n", 608 printk(KERN_INFO "ds-%llu: Shutting down cpu %d...\n",
609 dp->id, cpu); 609 dp->id, cpu);
610 err = cpu_down(cpu); 610 err = cpu_down(cpu);
611 if (err) 611 if (err)
@@ -684,7 +684,7 @@ static void ds_pri_data(struct ds_info *dp,
684 684
685 rp = (struct ds_pri_msg *) (dpkt + 1); 685 rp = (struct ds_pri_msg *) (dpkt + 1);
686 686
687 printk(KERN_INFO "ds-%lu: PRI REQ [%lx:%lx], len=%d\n", 687 printk(KERN_INFO "ds-%llu: PRI REQ [%llx:%llx], len=%d\n",
688 dp->id, rp->req_num, rp->type, len); 688 dp->id, rp->req_num, rp->type, len);
689} 689}
690 690
@@ -816,7 +816,7 @@ void ldom_set_var(const char *var, const char *value)
816 816
817 if (ds_var_doorbell == 0 || 817 if (ds_var_doorbell == 0 ||
818 ds_var_response != DS_VAR_SUCCESS) 818 ds_var_response != DS_VAR_SUCCESS)
819 printk(KERN_ERR "ds-%lu: var-config [%s:%s] " 819 printk(KERN_ERR "ds-%llu: var-config [%s:%s] "
820 "failed, response(%d).\n", 820 "failed, response(%d).\n",
821 dp->id, var, value, 821 dp->id, var, value,
822 ds_var_response); 822 ds_var_response);
@@ -850,7 +850,7 @@ void ldom_power_off(void)
850 850
851static void ds_conn_reset(struct ds_info *dp) 851static void ds_conn_reset(struct ds_info *dp)
852{ 852{
853 printk(KERN_ERR "ds-%lu: ds_conn_reset() from %p\n", 853 printk(KERN_ERR "ds-%llu: ds_conn_reset() from %p\n",
854 dp->id, __builtin_return_address(0)); 854 dp->id, __builtin_return_address(0));
855} 855}
856 856
@@ -912,11 +912,11 @@ static int ds_handshake(struct ds_info *dp, struct ds_msg_tag *pkt)
912 struct ds_cap_state *cp = find_cap(dp, ap->handle); 912 struct ds_cap_state *cp = find_cap(dp, ap->handle);
913 913
914 if (!cp) { 914 if (!cp) {
915 printk(KERN_ERR "ds-%lu: REG ACK for unknown " 915 printk(KERN_ERR "ds-%llu: REG ACK for unknown "
916 "handle %lx\n", dp->id, ap->handle); 916 "handle %llx\n", dp->id, ap->handle);
917 return 0; 917 return 0;
918 } 918 }
919 printk(KERN_INFO "ds-%lu: Registered %s service.\n", 919 printk(KERN_INFO "ds-%llu: Registered %s service.\n",
920 dp->id, cp->service_id); 920 dp->id, cp->service_id);
921 cp->state = CAP_STATE_REGISTERED; 921 cp->state = CAP_STATE_REGISTERED;
922 } else if (pkt->type == DS_REG_NACK) { 922 } else if (pkt->type == DS_REG_NACK) {
@@ -924,8 +924,8 @@ static int ds_handshake(struct ds_info *dp, struct ds_msg_tag *pkt)
924 struct ds_cap_state *cp = find_cap(dp, np->handle); 924 struct ds_cap_state *cp = find_cap(dp, np->handle);
925 925
926 if (!cp) { 926 if (!cp) {
927 printk(KERN_ERR "ds-%lu: REG NACK for " 927 printk(KERN_ERR "ds-%llu: REG NACK for "
928 "unknown handle %lx\n", 928 "unknown handle %llx\n",
929 dp->id, np->handle); 929 dp->id, np->handle);
930 return 0; 930 return 0;
931 } 931 }
@@ -982,8 +982,8 @@ static void process_ds_work(void)
982 int req_len = qp->req_len; 982 int req_len = qp->req_len;
983 983
984 if (!cp) { 984 if (!cp) {
985 printk(KERN_ERR "ds-%lu: Data for unknown " 985 printk(KERN_ERR "ds-%llu: Data for unknown "
986 "handle %lu\n", 986 "handle %llu\n",
987 dp->id, dpkt->handle); 987 dp->id, dpkt->handle);
988 988
989 spin_lock_irqsave(&ds_lock, flags); 989 spin_lock_irqsave(&ds_lock, flags);
@@ -1085,7 +1085,7 @@ static void ds_event(void *arg, int event)
1085 } 1085 }
1086 1086
1087 if (event != LDC_EVENT_DATA_READY) { 1087 if (event != LDC_EVENT_DATA_READY) {
1088 printk(KERN_WARNING "ds-%lu: Unexpected LDC event %d\n", 1088 printk(KERN_WARNING "ds-%llu: Unexpected LDC event %d\n",
1089 dp->id, event); 1089 dp->id, event);
1090 spin_unlock_irqrestore(&ds_lock, flags); 1090 spin_unlock_irqrestore(&ds_lock, flags);
1091 return; 1091 return;
diff --git a/arch/sparc/kernel/idprom.c b/arch/sparc/kernel/idprom.c
index c16135e0c151..57922f69c3f7 100644
--- a/arch/sparc/kernel/idprom.c
+++ b/arch/sparc/kernel/idprom.c
@@ -8,11 +8,14 @@
8#include <linux/kernel.h> 8#include <linux/kernel.h>
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/module.h>
11 12
12#include <asm/oplib.h> 13#include <asm/oplib.h>
13#include <asm/idprom.h> 14#include <asm/idprom.h>
14 15
15struct idprom *idprom; 16struct idprom *idprom;
17EXPORT_SYMBOL(idprom);
18
16static struct idprom idprom_buffer; 19static struct idprom idprom_buffer;
17 20
18#ifdef CONFIG_SPARC32 21#ifdef CONFIG_SPARC32
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c
index 1cc1995531e2..d8900e1d5aad 100644
--- a/arch/sparc/kernel/iommu.c
+++ b/arch/sparc/kernel/iommu.c
@@ -434,7 +434,7 @@ static void strbuf_flush(struct strbuf *strbuf, struct iommu *iommu,
434 val = iommu_read(matchreg); 434 val = iommu_read(matchreg);
435 if (unlikely(val)) { 435 if (unlikely(val)) {
436 printk(KERN_WARNING "strbuf_flush: ctx flush " 436 printk(KERN_WARNING "strbuf_flush: ctx flush "
437 "timeout matchreg[%lx] ctx[%lx]\n", 437 "timeout matchreg[%llx] ctx[%lx]\n",
438 val, ctx); 438 val, ctx);
439 goto do_page_flush; 439 goto do_page_flush;
440 } 440 }
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 7ce14f05eb48..87ea0d03d975 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -120,6 +120,7 @@ void __iomem *ioremap(unsigned long offset, unsigned long size)
120 sprintf(name, "phys_%08x", (u32)offset); 120 sprintf(name, "phys_%08x", (u32)offset);
121 return _sparc_alloc_io(0, offset, size, name); 121 return _sparc_alloc_io(0, offset, size, name);
122} 122}
123EXPORT_SYMBOL(ioremap);
123 124
124/* 125/*
125 * Comlimentary to ioremap(). 126 * Comlimentary to ioremap().
@@ -141,6 +142,7 @@ void iounmap(volatile void __iomem *virtual)
141 kfree(res); 142 kfree(res);
142 } 143 }
143} 144}
145EXPORT_SYMBOL(iounmap);
144 146
145void __iomem *of_ioremap(struct resource *res, unsigned long offset, 147void __iomem *of_ioremap(struct resource *res, unsigned long offset,
146 unsigned long size, char *name) 148 unsigned long size, char *name)
@@ -237,6 +239,7 @@ void sbus_set_sbus64(struct device *dev, int x)
237{ 239{
238 printk("sbus_set_sbus64: unsupported\n"); 240 printk("sbus_set_sbus64: unsupported\n");
239} 241}
242EXPORT_SYMBOL(sbus_set_sbus64);
240 243
241/* 244/*
242 * Allocate a chunk of memory suitable for DMA. 245 * Allocate a chunk of memory suitable for DMA.
@@ -436,6 +439,7 @@ void *pci_alloc_consistent(struct pci_dev *pdev, size_t len, dma_addr_t *pba)
436 *pba = virt_to_phys(va); /* equals virt_to_bus (R.I.P.) for us. */ 439 *pba = virt_to_phys(va); /* equals virt_to_bus (R.I.P.) for us. */
437 return (void *) res->start; 440 return (void *) res->start;
438} 441}
442EXPORT_SYMBOL(pci_alloc_consistent);
439 443
440/* Free and unmap a consistent DMA buffer. 444/* Free and unmap a consistent DMA buffer.
441 * cpu_addr is what was returned from pci_alloc_consistent, 445 * cpu_addr is what was returned from pci_alloc_consistent,
@@ -477,6 +481,7 @@ void pci_free_consistent(struct pci_dev *pdev, size_t n, void *p, dma_addr_t ba)
477 481
478 free_pages(pgp, get_order(n)); 482 free_pages(pgp, get_order(n));
479} 483}
484EXPORT_SYMBOL(pci_free_consistent);
480 485
481/* Map a single buffer of the indicated size for DMA in streaming mode. 486/* Map a single buffer of the indicated size for DMA in streaming mode.
482 * The 32-bit bus address to use is returned. 487 * The 32-bit bus address to use is returned.
@@ -491,6 +496,7 @@ dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size,
491 /* IIep is write-through, not flushing. */ 496 /* IIep is write-through, not flushing. */
492 return virt_to_phys(ptr); 497 return virt_to_phys(ptr);
493} 498}
499EXPORT_SYMBOL(pci_map_single);
494 500
495/* Unmap a single streaming mode DMA translation. The dma_addr and size 501/* Unmap a single streaming mode DMA translation. The dma_addr and size
496 * must match what was provided for in a previous pci_map_single call. All 502 * must match what was provided for in a previous pci_map_single call. All
@@ -508,6 +514,7 @@ void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t ba, size_t size,
508 (size + PAGE_SIZE-1) & PAGE_MASK); 514 (size + PAGE_SIZE-1) & PAGE_MASK);
509 } 515 }
510} 516}
517EXPORT_SYMBOL(pci_unmap_single);
511 518
512/* 519/*
513 * Same as pci_map_single, but with pages. 520 * Same as pci_map_single, but with pages.
@@ -519,6 +526,7 @@ dma_addr_t pci_map_page(struct pci_dev *hwdev, struct page *page,
519 /* IIep is write-through, not flushing. */ 526 /* IIep is write-through, not flushing. */
520 return page_to_phys(page) + offset; 527 return page_to_phys(page) + offset;
521} 528}
529EXPORT_SYMBOL(pci_map_page);
522 530
523void pci_unmap_page(struct pci_dev *hwdev, 531void pci_unmap_page(struct pci_dev *hwdev,
524 dma_addr_t dma_address, size_t size, int direction) 532 dma_addr_t dma_address, size_t size, int direction)
@@ -526,6 +534,7 @@ void pci_unmap_page(struct pci_dev *hwdev,
526 BUG_ON(direction == PCI_DMA_NONE); 534 BUG_ON(direction == PCI_DMA_NONE);
527 /* mmu_inval_dma_area XXX */ 535 /* mmu_inval_dma_area XXX */
528} 536}
537EXPORT_SYMBOL(pci_unmap_page);
529 538
530/* Map a set of buffers described by scatterlist in streaming 539/* Map a set of buffers described by scatterlist in streaming
531 * mode for DMA. This is the scather-gather version of the 540 * mode for DMA. This is the scather-gather version of the
@@ -557,6 +566,7 @@ int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sgl, int nents,
557 } 566 }
558 return nents; 567 return nents;
559} 568}
569EXPORT_SYMBOL(pci_map_sg);
560 570
561/* Unmap a set of streaming mode DMA translations. 571/* Unmap a set of streaming mode DMA translations.
562 * Again, cpu read rules concerning calls here are the same as for 572 * Again, cpu read rules concerning calls here are the same as for
@@ -578,6 +588,7 @@ void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sgl, int nents,
578 } 588 }
579 } 589 }
580} 590}
591EXPORT_SYMBOL(pci_unmap_sg);
581 592
582/* Make physical memory consistent for a single 593/* Make physical memory consistent for a single
583 * streaming mode DMA translation before or after a transfer. 594 * streaming mode DMA translation before or after a transfer.
@@ -597,6 +608,7 @@ void pci_dma_sync_single_for_cpu(struct pci_dev *hwdev, dma_addr_t ba, size_t si
597 (size + PAGE_SIZE-1) & PAGE_MASK); 608 (size + PAGE_SIZE-1) & PAGE_MASK);
598 } 609 }
599} 610}
611EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
600 612
601void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction) 613void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t size, int direction)
602{ 614{
@@ -606,6 +618,7 @@ void pci_dma_sync_single_for_device(struct pci_dev *hwdev, dma_addr_t ba, size_t
606 (size + PAGE_SIZE-1) & PAGE_MASK); 618 (size + PAGE_SIZE-1) & PAGE_MASK);
607 } 619 }
608} 620}
621EXPORT_SYMBOL(pci_dma_sync_single_for_device);
609 622
610/* Make physical memory consistent for a set of streaming 623/* Make physical memory consistent for a set of streaming
611 * mode DMA translations after a transfer. 624 * mode DMA translations after a transfer.
@@ -628,6 +641,7 @@ void pci_dma_sync_sg_for_cpu(struct pci_dev *hwdev, struct scatterlist *sgl, int
628 } 641 }
629 } 642 }
630} 643}
644EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
631 645
632void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sgl, int nents, int direction) 646void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sgl, int nents, int direction)
633{ 647{
@@ -644,6 +658,7 @@ void pci_dma_sync_sg_for_device(struct pci_dev *hwdev, struct scatterlist *sgl,
644 } 658 }
645 } 659 }
646} 660}
661EXPORT_SYMBOL(pci_dma_sync_sg_for_device);
647#endif /* CONFIG_PCI */ 662#endif /* CONFIG_PCI */
648 663
649#ifdef CONFIG_PROC_FS 664#ifdef CONFIG_PROC_FS
diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c
index f3488c45d57a..44dd5ee64339 100644
--- a/arch/sparc/kernel/irq_32.c
+++ b/arch/sparc/kernel/irq_32.c
@@ -294,6 +294,7 @@ void synchronize_irq(unsigned int irq)
294 while (sparc_irq[cpu_irq].flags & SPARC_IRQ_INPROGRESS) 294 while (sparc_irq[cpu_irq].flags & SPARC_IRQ_INPROGRESS)
295 cpu_relax(); 295 cpu_relax();
296} 296}
297EXPORT_SYMBOL(synchronize_irq);
297#endif /* SMP */ 298#endif /* SMP */
298 299
299void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs) 300void unexpected_irq(int irq, void *dev_id, struct pt_regs * regs)
@@ -669,7 +670,9 @@ void __init init_IRQ(void)
669 btfixup(); 670 btfixup();
670} 671}
671 672
673#ifdef CONFIG_PROC_FS
672void init_irq_proc(void) 674void init_irq_proc(void)
673{ 675{
674 /* For now, nothing... */ 676 /* For now, nothing... */
675} 677}
678#endif /* CONFIG_PROC_FS */
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index a3ea2bcb95de..cab8e0286871 100644
--- a/arch/sparc/kernel/irq_64.c
+++ b/arch/sparc/kernel/irq_64.c
@@ -312,7 +312,8 @@ static void sun4u_irq_enable(unsigned int virt_irq)
312 } 312 }
313} 313}
314 314
315static void sun4u_set_affinity(unsigned int virt_irq, cpumask_t mask) 315static void sun4u_set_affinity(unsigned int virt_irq,
316 const struct cpumask *mask)
316{ 317{
317 sun4u_irq_enable(virt_irq); 318 sun4u_irq_enable(virt_irq);
318} 319}
@@ -362,7 +363,8 @@ static void sun4v_irq_enable(unsigned int virt_irq)
362 ino, err); 363 ino, err);
363} 364}
364 365
365static void sun4v_set_affinity(unsigned int virt_irq, cpumask_t mask) 366static void sun4v_set_affinity(unsigned int virt_irq,
367 const struct cpumask *mask)
366{ 368{
367 unsigned int ino = virt_irq_table[virt_irq].dev_ino; 369 unsigned int ino = virt_irq_table[virt_irq].dev_ino;
368 unsigned long cpuid = irq_choose_cpu(virt_irq); 370 unsigned long cpuid = irq_choose_cpu(virt_irq);
@@ -429,7 +431,8 @@ static void sun4v_virq_enable(unsigned int virt_irq)
429 dev_handle, dev_ino, err); 431 dev_handle, dev_ino, err);
430} 432}
431 433
432static void sun4v_virt_set_affinity(unsigned int virt_irq, cpumask_t mask) 434static void sun4v_virt_set_affinity(unsigned int virt_irq,
435 const struct cpumask *mask)
433{ 436{
434 unsigned long cpuid, dev_handle, dev_ino; 437 unsigned long cpuid, dev_handle, dev_ino;
435 int err; 438 int err;
@@ -851,7 +854,7 @@ void fixup_irqs(void)
851 !(irq_desc[irq].status & IRQ_PER_CPU)) { 854 !(irq_desc[irq].status & IRQ_PER_CPU)) {
852 if (irq_desc[irq].chip->set_affinity) 855 if (irq_desc[irq].chip->set_affinity)
853 irq_desc[irq].chip->set_affinity(irq, 856 irq_desc[irq].chip->set_affinity(irq,
854 irq_desc[irq].affinity); 857 &irq_desc[irq].affinity);
855 } 858 }
856 spin_unlock_irqrestore(&irq_desc[irq].lock, flags); 859 spin_unlock_irqrestore(&irq_desc[irq].lock, flags);
857 } 860 }
diff --git a/arch/sparc/kernel/kgdb_32.c b/arch/sparc/kernel/kgdb_32.c
index 757805ce02ee..04df4edc0073 100644
--- a/arch/sparc/kernel/kgdb_32.c
+++ b/arch/sparc/kernel/kgdb_32.c
@@ -14,14 +14,14 @@ extern unsigned long trapbase;
14 14
15void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) 15void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
16{ 16{
17 struct reg_window *win; 17 struct reg_window32 *win;
18 int i; 18 int i;
19 19
20 gdb_regs[GDB_G0] = 0; 20 gdb_regs[GDB_G0] = 0;
21 for (i = 0; i < 15; i++) 21 for (i = 0; i < 15; i++)
22 gdb_regs[GDB_G1 + i] = regs->u_regs[UREG_G1 + i]; 22 gdb_regs[GDB_G1 + i] = regs->u_regs[UREG_G1 + i];
23 23
24 win = (struct reg_window *) regs->u_regs[UREG_FP]; 24 win = (struct reg_window32 *) regs->u_regs[UREG_FP];
25 for (i = 0; i < 8; i++) 25 for (i = 0; i < 8; i++)
26 gdb_regs[GDB_L0 + i] = win->locals[i]; 26 gdb_regs[GDB_L0 + i] = win->locals[i];
27 for (i = 0; i < 8; i++) 27 for (i = 0; i < 8; i++)
@@ -43,7 +43,7 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs)
43void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) 43void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
44{ 44{
45 struct thread_info *t = task_thread_info(p); 45 struct thread_info *t = task_thread_info(p);
46 struct reg_window *win; 46 struct reg_window32 *win;
47 int i; 47 int i;
48 48
49 for (i = GDB_G0; i < GDB_G6; i++) 49 for (i = GDB_G0; i < GDB_G6; i++)
@@ -55,7 +55,7 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
55 gdb_regs[GDB_SP] = t->ksp; 55 gdb_regs[GDB_SP] = t->ksp;
56 gdb_regs[GDB_O7] = 0; 56 gdb_regs[GDB_O7] = 0;
57 57
58 win = (struct reg_window *) t->ksp; 58 win = (struct reg_window32 *) t->ksp;
59 for (i = 0; i < 8; i++) 59 for (i = 0; i < 8; i++)
60 gdb_regs[GDB_L0 + i] = win->locals[i]; 60 gdb_regs[GDB_L0 + i] = win->locals[i];
61 for (i = 0; i < 8; i++) 61 for (i = 0; i < 8; i++)
@@ -77,7 +77,7 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
77 77
78void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs) 78void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs)
79{ 79{
80 struct reg_window *win; 80 struct reg_window32 *win;
81 int i; 81 int i;
82 82
83 for (i = 0; i < 15; i++) 83 for (i = 0; i < 15; i++)
@@ -96,7 +96,7 @@ void gdb_regs_to_pt_regs(unsigned long *gdb_regs, struct pt_regs *regs)
96 regs->npc = gdb_regs[GDB_NPC]; 96 regs->npc = gdb_regs[GDB_NPC];
97 regs->y = gdb_regs[GDB_Y]; 97 regs->y = gdb_regs[GDB_Y];
98 98
99 win = (struct reg_window *) regs->u_regs[UREG_FP]; 99 win = (struct reg_window32 *) regs->u_regs[UREG_FP];
100 for (i = 0; i < 8; i++) 100 for (i = 0; i < 8; i++)
101 win->locals[i] = gdb_regs[GDB_L0 + i]; 101 win->locals[i] = gdb_regs[GDB_L0 + i];
102 for (i = 0; i < 8; i++) 102 for (i = 0; i < 8; i++)
diff --git a/arch/sparc/kernel/kprobes.c b/arch/sparc/kernel/kprobes.c
index 201a6e547e4a..3bc6527c95af 100644
--- a/arch/sparc/kernel/kprobes.c
+++ b/arch/sparc/kernel/kprobes.c
@@ -517,7 +517,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
517 /* 517 /*
518 * It is possible to have multiple instances associated with a given 518 * It is possible to have multiple instances associated with a given
519 * task either because an multiple functions in the call path 519 * task either because an multiple functions in the call path
520 * have a return probe installed on them, and/or more then one return 520 * have a return probe installed on them, and/or more than one return
521 * return probe was registered for a target function. 521 * return probe was registered for a target function.
522 * 522 *
523 * We can handle this because: 523 * We can handle this because:
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c
index d68982330f66..6ce5d2598a09 100644
--- a/arch/sparc/kernel/ldc.c
+++ b/arch/sparc/kernel/ldc.c
@@ -625,22 +625,23 @@ static int process_ver_ack(struct ldc_channel *lp, struct ldc_version *vp)
625static int process_ver_nack(struct ldc_channel *lp, struct ldc_version *vp) 625static int process_ver_nack(struct ldc_channel *lp, struct ldc_version *vp)
626{ 626{
627 struct ldc_version *vap; 627 struct ldc_version *vap;
628 struct ldc_packet *p;
629 unsigned long new_tail;
628 630
629 if ((vp->major == 0 && vp->minor == 0) || 631 if (vp->major == 0 && vp->minor == 0)
630 !(vap = find_by_major(vp->major))) { 632 return ldc_abort(lp);
633
634 vap = find_by_major(vp->major);
635 if (!vap)
631 return ldc_abort(lp); 636 return ldc_abort(lp);
632 } else {
633 struct ldc_packet *p;
634 unsigned long new_tail;
635 637
636 p = handshake_compose_ctrl(lp, LDC_INFO, LDC_VERS, 638 p = handshake_compose_ctrl(lp, LDC_INFO, LDC_VERS,
637 vap, sizeof(*vap), 639 vap, sizeof(*vap),
638 &new_tail); 640 &new_tail);
639 if (p) 641 if (!p)
640 return send_tx_packet(lp, p, new_tail); 642 return ldc_abort(lp);
641 else 643
642 return ldc_abort(lp); 644 return send_tx_packet(lp, p, new_tail);
643 }
644} 645}
645 646
646static int process_version(struct ldc_channel *lp, 647static int process_version(struct ldc_channel *lp,
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c
index 3c539a6d7c18..3f79f0c23a08 100644
--- a/arch/sparc/kernel/mdesc.c
+++ b/arch/sparc/kernel/mdesc.c
@@ -536,24 +536,24 @@ static void __init report_platform_properties(void)
536 536
537 v = mdesc_get_property(hp, pn, "hostid", NULL); 537 v = mdesc_get_property(hp, pn, "hostid", NULL);
538 if (v) 538 if (v)
539 printk("PLATFORM: hostid [%08lx]\n", *v); 539 printk("PLATFORM: hostid [%08llx]\n", *v);
540 v = mdesc_get_property(hp, pn, "serial#", NULL); 540 v = mdesc_get_property(hp, pn, "serial#", NULL);
541 if (v) 541 if (v)
542 printk("PLATFORM: serial# [%08lx]\n", *v); 542 printk("PLATFORM: serial# [%08llx]\n", *v);
543 v = mdesc_get_property(hp, pn, "stick-frequency", NULL); 543 v = mdesc_get_property(hp, pn, "stick-frequency", NULL);
544 printk("PLATFORM: stick-frequency [%08lx]\n", *v); 544 printk("PLATFORM: stick-frequency [%08llx]\n", *v);
545 v = mdesc_get_property(hp, pn, "mac-address", NULL); 545 v = mdesc_get_property(hp, pn, "mac-address", NULL);
546 if (v) 546 if (v)
547 printk("PLATFORM: mac-address [%lx]\n", *v); 547 printk("PLATFORM: mac-address [%llx]\n", *v);
548 v = mdesc_get_property(hp, pn, "watchdog-resolution", NULL); 548 v = mdesc_get_property(hp, pn, "watchdog-resolution", NULL);
549 if (v) 549 if (v)
550 printk("PLATFORM: watchdog-resolution [%lu ms]\n", *v); 550 printk("PLATFORM: watchdog-resolution [%llu ms]\n", *v);
551 v = mdesc_get_property(hp, pn, "watchdog-max-timeout", NULL); 551 v = mdesc_get_property(hp, pn, "watchdog-max-timeout", NULL);
552 if (v) 552 if (v)
553 printk("PLATFORM: watchdog-max-timeout [%lu ms]\n", *v); 553 printk("PLATFORM: watchdog-max-timeout [%llu ms]\n", *v);
554 v = mdesc_get_property(hp, pn, "max-cpus", NULL); 554 v = mdesc_get_property(hp, pn, "max-cpus", NULL);
555 if (v) 555 if (v)
556 printk("PLATFORM: max-cpus [%lu]\n", *v); 556 printk("PLATFORM: max-cpus [%llu]\n", *v);
557 557
558#ifdef CONFIG_SMP 558#ifdef CONFIG_SMP
559 { 559 {
diff --git a/arch/sparc/kernel/muldiv.c b/arch/sparc/kernel/muldiv.c
index ba960c02bb55..6ce1021d487c 100644
--- a/arch/sparc/kernel/muldiv.c
+++ b/arch/sparc/kernel/muldiv.c
@@ -60,7 +60,7 @@ static inline void maybe_flush_windows(unsigned int rs1, unsigned int rs2,
60} 60}
61 61
62#define fetch_reg(reg, regs) ({ \ 62#define fetch_reg(reg, regs) ({ \
63 struct reg_window __user *win; \ 63 struct reg_window32 __user *win; \
64 register unsigned long ret; \ 64 register unsigned long ret; \
65 \ 65 \
66 if (!(reg)) ret = 0; \ 66 if (!(reg)) ret = 0; \
@@ -68,7 +68,7 @@ static inline void maybe_flush_windows(unsigned int rs1, unsigned int rs2,
68 ret = regs->u_regs[(reg)]; \ 68 ret = regs->u_regs[(reg)]; \
69 } else { \ 69 } else { \
70 /* Ho hum, the slightly complicated case. */ \ 70 /* Ho hum, the slightly complicated case. */ \
71 win = (struct reg_window __user *)regs->u_regs[UREG_FP];\ 71 win = (struct reg_window32 __user *)regs->u_regs[UREG_FP];\
72 if (get_user (ret, &win->locals[(reg) - 16])) return -1;\ 72 if (get_user (ret, &win->locals[(reg) - 16])) return -1;\
73 } \ 73 } \
74 ret; \ 74 ret; \
@@ -77,7 +77,7 @@ static inline void maybe_flush_windows(unsigned int rs1, unsigned int rs2,
77static inline int 77static inline int
78store_reg(unsigned int result, unsigned int reg, struct pt_regs *regs) 78store_reg(unsigned int result, unsigned int reg, struct pt_regs *regs)
79{ 79{
80 struct reg_window __user *win; 80 struct reg_window32 __user *win;
81 81
82 if (!reg) 82 if (!reg)
83 return 0; 83 return 0;
@@ -86,7 +86,7 @@ store_reg(unsigned int result, unsigned int reg, struct pt_regs *regs)
86 return 0; 86 return 0;
87 } else { 87 } else {
88 /* need to use put_user() in this case: */ 88 /* need to use put_user() in this case: */
89 win = (struct reg_window __user *) regs->u_regs[UREG_FP]; 89 win = (struct reg_window32 __user *) regs->u_regs[UREG_FP];
90 return (put_user(result, &win->locals[reg - 16])); 90 return (put_user(result, &win->locals[reg - 16]));
91 } 91 }
92} 92}
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 46e231f7c5ce..b4a12c9aa5f8 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -554,7 +554,7 @@ static void __init build_device_resources(struct of_device *op,
554 memset(r, 0, sizeof(*r)); 554 memset(r, 0, sizeof(*r));
555 555
556 if (of_resource_verbose) 556 if (of_resource_verbose)
557 printk("%s reg[%d] -> %lx\n", 557 printk("%s reg[%d] -> %llx\n",
558 op->node->full_name, index, 558 op->node->full_name, index,
559 result); 559 result);
560 560
@@ -778,9 +778,9 @@ static unsigned int __init build_one_device_irq(struct of_device *op,
778out: 778out:
779 nid = of_node_to_nid(dp); 779 nid = of_node_to_nid(dp);
780 if (nid != -1) { 780 if (nid != -1) {
781 cpumask_t numa_mask = node_to_cpumask(nid); 781 cpumask_t numa_mask = *cpumask_of_node(nid);
782 782
783 irq_set_affinity(irq, numa_mask); 783 irq_set_affinity(irq, &numa_mask);
784 } 784 }
785 785
786 return irq; 786 return irq;
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index bdb7c0a6d83d..4638fba799e4 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -223,7 +223,7 @@ static void pci_parse_of_addrs(struct of_device *op,
223 continue; 223 continue;
224 i = addrs[0] & 0xff; 224 i = addrs[0] & 0xff;
225 if (ofpci_verbose) 225 if (ofpci_verbose)
226 printk(" start: %lx, end: %lx, i: %x\n", 226 printk(" start: %llx, end: %llx, i: %x\n",
227 op_res->start, op_res->end, i); 227 op_res->start, op_res->end, i);
228 228
229 if (PCI_BASE_ADDRESS_0 <= i && i <= PCI_BASE_ADDRESS_5) { 229 if (PCI_BASE_ADDRESS_0 <= i && i <= PCI_BASE_ADDRESS_5) {
@@ -1077,6 +1077,7 @@ int pci_dma_supported(struct pci_dev *pdev, u64 device_mask)
1077 1077
1078 return (device_mask & dma_addr_mask) == dma_addr_mask; 1078 return (device_mask & dma_addr_mask) == dma_addr_mask;
1079} 1079}
1080EXPORT_SYMBOL(pci_dma_supported);
1080 1081
1081void pci_resource_to_user(const struct pci_dev *pdev, int bar, 1082void pci_resource_to_user(const struct pci_dev *pdev, int bar,
1082 const struct resource *rp, resource_size_t *start, 1083 const struct resource *rp, resource_size_t *start,
diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c
index 23b88082d0b2..64e6edf17b9d 100644
--- a/arch/sparc/kernel/pci_common.c
+++ b/arch/sparc/kernel/pci_common.c
@@ -457,7 +457,7 @@ void pci_determine_mem_io_space(struct pci_pbm_info *pbm)
457 prom_halt(); 457 prom_halt();
458 } 458 }
459 459
460 printk("%s: PCI IO[%lx] MEM[%lx]\n", 460 printk("%s: PCI IO[%llx] MEM[%llx]\n",
461 pbm->name, 461 pbm->name,
462 pbm->io_space.start, 462 pbm->io_space.start,
463 pbm->mem_space.start); 463 pbm->mem_space.start);
diff --git a/arch/sparc/kernel/pci_msi.c b/arch/sparc/kernel/pci_msi.c
index 2e680f34f727..f1be37a7b123 100644
--- a/arch/sparc/kernel/pci_msi.c
+++ b/arch/sparc/kernel/pci_msi.c
@@ -286,9 +286,9 @@ static int bringup_one_msi_queue(struct pci_pbm_info *pbm,
286 286
287 nid = pbm->numa_node; 287 nid = pbm->numa_node;
288 if (nid != -1) { 288 if (nid != -1) {
289 cpumask_t numa_mask = node_to_cpumask(nid); 289 cpumask_t numa_mask = *cpumask_of_node(nid);
290 290
291 irq_set_affinity(irq, numa_mask); 291 irq_set_affinity(irq, &numa_mask);
292 } 292 }
293 err = request_irq(irq, sparc64_msiq_interrupt, 0, 293 err = request_irq(irq, sparc64_msiq_interrupt, 0,
294 "MSIQ", 294 "MSIQ",
@@ -426,8 +426,8 @@ void sparc64_pbm_msi_init(struct pci_pbm_info *pbm,
426 pbm->name, 426 pbm->name,
427 pbm->msi_first, pbm->msi_num, pbm->msi_data_mask, 427 pbm->msi_first, pbm->msi_num, pbm->msi_data_mask,
428 pbm->msix_data_width); 428 pbm->msix_data_width);
429 printk(KERN_INFO "%s: MSI addr32[0x%lx:0x%x] " 429 printk(KERN_INFO "%s: MSI addr32[0x%llx:0x%x] "
430 "addr64[0x%lx:0x%x]\n", 430 "addr64[0x%llx:0x%x]\n",
431 pbm->name, 431 pbm->name,
432 pbm->msi32_start, pbm->msi32_len, 432 pbm->msi32_start, pbm->msi32_len,
433 pbm->msi64_start, pbm->msi64_len); 433 pbm->msi64_start, pbm->msi64_len);
diff --git a/arch/sparc/kernel/pci_psycho.c b/arch/sparc/kernel/pci_psycho.c
index dfb3ec892987..3b34344082ef 100644
--- a/arch/sparc/kernel/pci_psycho.c
+++ b/arch/sparc/kernel/pci_psycho.c
@@ -307,10 +307,7 @@ static void psycho_register_error_handlers(struct pci_pbm_info *pbm)
307 307
308 /* We really mean to ignore the return result here. Two 308 /* We really mean to ignore the return result here. Two
309 * PCI controller share the same interrupt numbers and 309 * PCI controller share the same interrupt numbers and
310 * drive the same front-end hardware. Whichever of the 310 * drive the same front-end hardware.
311 * two get in here first will register the IRQ handler
312 * the second will just error out since we do not pass in
313 * IRQF_SHARED.
314 */ 311 */
315 err = request_irq(op->irqs[1], psycho_ue_intr, IRQF_SHARED, 312 err = request_irq(op->irqs[1], psycho_ue_intr, IRQF_SHARED,
316 "PSYCHO_UE", pbm); 313 "PSYCHO_UE", pbm);
diff --git a/arch/sparc/kernel/pci_schizo.c b/arch/sparc/kernel/pci_schizo.c
index 45d9dba1ba11..2b5cdde77af7 100644
--- a/arch/sparc/kernel/pci_schizo.c
+++ b/arch/sparc/kernel/pci_schizo.c
@@ -794,7 +794,7 @@ static irqreturn_t schizo_safarierr_intr(int irq, void *dev_id)
794 pbm->controller_regs + SCHIZO_SAFARI_ERRLOG); 794 pbm->controller_regs + SCHIZO_SAFARI_ERRLOG);
795 795
796 if (!(errlog & BUS_ERROR_UNMAP)) { 796 if (!(errlog & BUS_ERROR_UNMAP)) {
797 printk("%s: Unexpected Safari/JBUS error interrupt, errlog[%016lx]\n", 797 printk("%s: Unexpected Safari/JBUS error interrupt, errlog[%016llx]\n",
798 pbm->name, errlog); 798 pbm->name, errlog);
799 799
800 return IRQ_HANDLED; 800 return IRQ_HANDLED;
diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c
index 34a1fded3941..0ef0ab3d4763 100644
--- a/arch/sparc/kernel/pci_sun4v.c
+++ b/arch/sparc/kernel/pci_sun4v.c
@@ -73,7 +73,7 @@ static long iommu_batch_flush(struct iommu_batch *p)
73 if (unlikely(num < 0)) { 73 if (unlikely(num < 0)) {
74 if (printk_ratelimit()) 74 if (printk_ratelimit())
75 printk("iommu_batch_flush: IOMMU map of " 75 printk("iommu_batch_flush: IOMMU map of "
76 "[%08lx:%08lx:%lx:%lx:%lx] failed with " 76 "[%08lx:%08llx:%lx:%lx:%lx] failed with "
77 "status %ld\n", 77 "status %ld\n",
78 devhandle, HV_PCI_TSBID(0, entry), 78 devhandle, HV_PCI_TSBID(0, entry),
79 npages, prot, __pa(pglist), num); 79 npages, prot, __pa(pglist), num);
diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c
index 75ed98be3edf..85e7037429b9 100644
--- a/arch/sparc/kernel/pcic.c
+++ b/arch/sparc/kernel/pcic.c
@@ -956,6 +956,7 @@ void outsb(unsigned long addr, const void *src, unsigned long count)
956 /* addr += 1; */ 956 /* addr += 1; */
957 } 957 }
958} 958}
959EXPORT_SYMBOL(outsb);
959 960
960void outsw(unsigned long addr, const void *src, unsigned long count) 961void outsw(unsigned long addr, const void *src, unsigned long count)
961{ 962{
@@ -966,6 +967,7 @@ void outsw(unsigned long addr, const void *src, unsigned long count)
966 /* addr += 2; */ 967 /* addr += 2; */
967 } 968 }
968} 969}
970EXPORT_SYMBOL(outsw);
969 971
970void outsl(unsigned long addr, const void *src, unsigned long count) 972void outsl(unsigned long addr, const void *src, unsigned long count)
971{ 973{
@@ -976,6 +978,7 @@ void outsl(unsigned long addr, const void *src, unsigned long count)
976 /* addr += 4; */ 978 /* addr += 4; */
977 } 979 }
978} 980}
981EXPORT_SYMBOL(outsl);
979 982
980void insb(unsigned long addr, void *dst, unsigned long count) 983void insb(unsigned long addr, void *dst, unsigned long count)
981{ 984{
@@ -986,6 +989,7 @@ void insb(unsigned long addr, void *dst, unsigned long count)
986 /* addr += 1; */ 989 /* addr += 1; */
987 } 990 }
988} 991}
992EXPORT_SYMBOL(insb);
989 993
990void insw(unsigned long addr, void *dst, unsigned long count) 994void insw(unsigned long addr, void *dst, unsigned long count)
991{ 995{
@@ -996,6 +1000,7 @@ void insw(unsigned long addr, void *dst, unsigned long count)
996 /* addr += 2; */ 1000 /* addr += 2; */
997 } 1001 }
998} 1002}
1003EXPORT_SYMBOL(insw);
999 1004
1000void insl(unsigned long addr, void *dst, unsigned long count) 1005void insl(unsigned long addr, void *dst, unsigned long count)
1001{ 1006{
@@ -1009,5 +1014,6 @@ void insl(unsigned long addr, void *dst, unsigned long count)
1009 /* addr += 4; */ 1014 /* addr += 4; */
1010 } 1015 }
1011} 1016}
1017EXPORT_SYMBOL(insl);
1012 1018
1013subsys_initcall(pcic_init); 1019subsys_initcall(pcic_init);
diff --git a/arch/sparc/kernel/power.c b/arch/sparc/kernel/power.c
index 076cad7f9757..ae88f06a7ec4 100644
--- a/arch/sparc/kernel/power.c
+++ b/arch/sparc/kernel/power.c
@@ -40,7 +40,7 @@ static int __devinit power_probe(struct of_device *op, const struct of_device_id
40 40
41 power_reg = of_ioremap(res, 0, 0x4, "power"); 41 power_reg = of_ioremap(res, 0, 0x4, "power");
42 42
43 printk(KERN_INFO "%s: Control reg at %lx\n", 43 printk(KERN_INFO "%s: Control reg at %llx\n",
44 op->node->name, res->start); 44 op->node->name, res->start);
45 45
46 if (has_button_interrupt(irq, op->node)) { 46 if (has_button_interrupt(irq, op->node)) {
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
index 69d9315f4a93..f4bee35a1b46 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -44,6 +44,7 @@
44 * Set in pm platform drivers (apc.c and pmc.c) 44 * Set in pm platform drivers (apc.c and pmc.c)
45 */ 45 */
46void (*pm_idle)(void); 46void (*pm_idle)(void);
47EXPORT_SYMBOL(pm_idle);
47 48
48/* 49/*
49 * Power-off handler instantiation for pm.h compliance 50 * Power-off handler instantiation for pm.h compliance
@@ -180,13 +181,13 @@ static DEFINE_SPINLOCK(sparc_backtrace_lock);
180 181
181void __show_backtrace(unsigned long fp) 182void __show_backtrace(unsigned long fp)
182{ 183{
183 struct reg_window *rw; 184 struct reg_window32 *rw;
184 unsigned long flags; 185 unsigned long flags;
185 int cpu = smp_processor_id(); 186 int cpu = smp_processor_id();
186 187
187 spin_lock_irqsave(&sparc_backtrace_lock, flags); 188 spin_lock_irqsave(&sparc_backtrace_lock, flags);
188 189
189 rw = (struct reg_window *)fp; 190 rw = (struct reg_window32 *)fp;
190 while(rw && (((unsigned long) rw) >= PAGE_OFFSET) && 191 while(rw && (((unsigned long) rw) >= PAGE_OFFSET) &&
191 !(((unsigned long) rw) & 0x7)) { 192 !(((unsigned long) rw) & 0x7)) {
192 printk("CPU[%d]: ARGS[%08lx,%08lx,%08lx,%08lx,%08lx,%08lx] " 193 printk("CPU[%d]: ARGS[%08lx,%08lx,%08lx,%08lx,%08lx,%08lx] "
@@ -196,7 +197,7 @@ void __show_backtrace(unsigned long fp)
196 rw->ins[6], 197 rw->ins[6],
197 rw->ins[7]); 198 rw->ins[7]);
198 printk("%pS\n", (void *) rw->ins[7]); 199 printk("%pS\n", (void *) rw->ins[7]);
199 rw = (struct reg_window *) rw->ins[6]; 200 rw = (struct reg_window32 *) rw->ins[6];
200 } 201 }
201 spin_unlock_irqrestore(&sparc_backtrace_lock, flags); 202 spin_unlock_irqrestore(&sparc_backtrace_lock, flags);
202} 203}
@@ -258,7 +259,7 @@ void show_stackframe(struct sparc_stackf *sf)
258 259
259void show_regs(struct pt_regs *r) 260void show_regs(struct pt_regs *r)
260{ 261{
261 struct reg_window *rw = (struct reg_window *) r->u_regs[14]; 262 struct reg_window32 *rw = (struct reg_window32 *) r->u_regs[14];
262 263
263 printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n", 264 printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n",
264 r->psr, r->pc, r->npc, r->y, print_tainted()); 265 r->psr, r->pc, r->npc, r->y, print_tainted());
@@ -287,7 +288,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
287{ 288{
288 unsigned long pc, fp; 289 unsigned long pc, fp;
289 unsigned long task_base; 290 unsigned long task_base;
290 struct reg_window *rw; 291 struct reg_window32 *rw;
291 int count = 0; 292 int count = 0;
292 293
293 if (tsk != NULL) 294 if (tsk != NULL)
@@ -301,7 +302,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
301 if (fp < (task_base + sizeof(struct thread_info)) || 302 if (fp < (task_base + sizeof(struct thread_info)) ||
302 fp >= (task_base + (PAGE_SIZE << 1))) 303 fp >= (task_base + (PAGE_SIZE << 1)))
303 break; 304 break;
304 rw = (struct reg_window *) fp; 305 rw = (struct reg_window32 *) fp;
305 pc = rw->ins[7]; 306 pc = rw->ins[7];
306 printk("[%08lx : ", pc); 307 printk("[%08lx : ", pc);
307 printk("%pS ] ", (void *) pc); 308 printk("%pS ] ", (void *) pc);
@@ -673,13 +674,14 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
673 "g1", "g2", "g3", "o0", "o1", "memory", "cc"); 674 "g1", "g2", "g3", "o0", "o1", "memory", "cc");
674 return retval; 675 return retval;
675} 676}
677EXPORT_SYMBOL(kernel_thread);
676 678
677unsigned long get_wchan(struct task_struct *task) 679unsigned long get_wchan(struct task_struct *task)
678{ 680{
679 unsigned long pc, fp, bias = 0; 681 unsigned long pc, fp, bias = 0;
680 unsigned long task_base = (unsigned long) task; 682 unsigned long task_base = (unsigned long) task;
681 unsigned long ret = 0; 683 unsigned long ret = 0;
682 struct reg_window *rw; 684 struct reg_window32 *rw;
683 int count = 0; 685 int count = 0;
684 686
685 if (!task || task == current || 687 if (!task || task == current ||
@@ -692,7 +694,7 @@ unsigned long get_wchan(struct task_struct *task)
692 if (fp < (task_base + sizeof(struct thread_info)) || 694 if (fp < (task_base + sizeof(struct thread_info)) ||
693 fp >= (task_base + (2 * PAGE_SIZE))) 695 fp >= (task_base + (2 * PAGE_SIZE)))
694 break; 696 break;
695 rw = (struct reg_window *) fp; 697 rw = (struct reg_window32 *) fp;
696 pc = rw->ins[7]; 698 pc = rw->ins[7];
697 if (!in_sched_functions(pc)) { 699 if (!in_sched_functions(pc)) {
698 ret = pc; 700 ret = pc;
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
index d5e2acef9877..cc8b5604442c 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -678,6 +678,7 @@ pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
678 "g1", "g2", "g3", "o0", "o1", "memory", "cc"); 678 "g1", "g2", "g3", "o0", "o1", "memory", "cc");
679 return retval; 679 return retval;
680} 680}
681EXPORT_SYMBOL(kernel_thread);
681 682
682typedef struct { 683typedef struct {
683 union { 684 union {
@@ -743,6 +744,7 @@ int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs)
743 } 744 }
744 return 1; 745 return 1;
745} 746}
747EXPORT_SYMBOL(dump_fpu);
746 748
747/* 749/*
748 * sparc_execve() executes a new program after the asm stub has set 750 * sparc_execve() executes a new program after the asm stub has set
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
index 4e9af593db49..ff7b591c8946 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
@@ -155,20 +155,12 @@ static struct property * __init build_one_prop(phandle node, char *prev,
155 p->value = prom_early_alloc(special_len); 155 p->value = prom_early_alloc(special_len);
156 memcpy(p->value, special_val, special_len); 156 memcpy(p->value, special_val, special_len);
157 } else { 157 } else {
158#ifdef CONFIG_SPARC32
159 if (prev == NULL) {
160 name = prom_firstprop(node, NULL);
161 } else {
162 name = prom_nextprop(node, prev, NULL);
163 }
164#else
165 if (prev == NULL) { 158 if (prev == NULL) {
166 prom_firstprop(node, p->name); 159 name = prom_firstprop(node, p->name);
167 } else { 160 } else {
168 prom_nextprop(node, prev, p->name); 161 name = prom_nextprop(node, prev, p->name);
169 } 162 }
170 name = p->name; 163
171#endif
172 if (strlen(name) == 0) { 164 if (strlen(name) == 0) {
173 tmp = p; 165 tmp = p;
174 return NULL; 166 return NULL;
diff --git a/arch/sparc/kernel/prom_irqtrans.c b/arch/sparc/kernel/prom_irqtrans.c
index 96958c4dce8e..5702ad4710cb 100644
--- a/arch/sparc/kernel/prom_irqtrans.c
+++ b/arch/sparc/kernel/prom_irqtrans.c
@@ -346,7 +346,7 @@ static void tomatillo_wsync_handler(unsigned int ino, void *_arg1, void *_arg2)
346 break; 346 break;
347 } 347 }
348 if (limit <= 0) { 348 if (limit <= 0) {
349 printk("tomatillo_wsync_handler: DMA won't sync [%lx:%lx]\n", 349 printk("tomatillo_wsync_handler: DMA won't sync [%llx:%llx]\n",
350 val, mask); 350 val, mask);
351 } 351 }
352 352
diff --git a/arch/sparc/kernel/psycho_common.c b/arch/sparc/kernel/psycho_common.c
index 790996428c14..8f1478475421 100644
--- a/arch/sparc/kernel/psycho_common.c
+++ b/arch/sparc/kernel/psycho_common.c
@@ -11,19 +11,19 @@
11#include "iommu_common.h" 11#include "iommu_common.h"
12#include "psycho_common.h" 12#include "psycho_common.h"
13 13
14#define PSYCHO_STRBUF_CTRL_DENAB 0x0000000000000002UL 14#define PSYCHO_STRBUF_CTRL_DENAB 0x0000000000000002ULL
15#define PSYCHO_STCERR_WRITE 0x0000000000000002UL 15#define PSYCHO_STCERR_WRITE 0x0000000000000002ULL
16#define PSYCHO_STCERR_READ 0x0000000000000001UL 16#define PSYCHO_STCERR_READ 0x0000000000000001ULL
17#define PSYCHO_STCTAG_PPN 0x0fffffff00000000UL 17#define PSYCHO_STCTAG_PPN 0x0fffffff00000000ULL
18#define PSYCHO_STCTAG_VPN 0x00000000ffffe000UL 18#define PSYCHO_STCTAG_VPN 0x00000000ffffe000ULL
19#define PSYCHO_STCTAG_VALID 0x0000000000000002UL 19#define PSYCHO_STCTAG_VALID 0x0000000000000002ULL
20#define PSYCHO_STCTAG_WRITE 0x0000000000000001UL 20#define PSYCHO_STCTAG_WRITE 0x0000000000000001ULL
21#define PSYCHO_STCLINE_LINDX 0x0000000001e00000UL 21#define PSYCHO_STCLINE_LINDX 0x0000000001e00000ULL
22#define PSYCHO_STCLINE_SPTR 0x00000000001f8000UL 22#define PSYCHO_STCLINE_SPTR 0x00000000001f8000ULL
23#define PSYCHO_STCLINE_LADDR 0x0000000000007f00UL 23#define PSYCHO_STCLINE_LADDR 0x0000000000007f00ULL
24#define PSYCHO_STCLINE_EPTR 0x00000000000000fcUL 24#define PSYCHO_STCLINE_EPTR 0x00000000000000fcULL
25#define PSYCHO_STCLINE_VALID 0x0000000000000002UL 25#define PSYCHO_STCLINE_VALID 0x0000000000000002ULL
26#define PSYCHO_STCLINE_FOFN 0x0000000000000001UL 26#define PSYCHO_STCLINE_FOFN 0x0000000000000001ULL
27 27
28static DEFINE_SPINLOCK(stc_buf_lock); 28static DEFINE_SPINLOCK(stc_buf_lock);
29static unsigned long stc_error_buf[128]; 29static unsigned long stc_error_buf[128];
@@ -94,7 +94,7 @@ static void psycho_check_stc_error(struct pci_pbm_info *pbm)
94 if (saw_error != 0) { 94 if (saw_error != 0) {
95 u64 tagval = stc_tag_buf[i]; 95 u64 tagval = stc_tag_buf[i];
96 u64 lineval = stc_line_buf[i]; 96 u64 lineval = stc_line_buf[i];
97 printk(KERN_ERR "%s: STC_TAG(%d)[PA(%016lx)VA(%08lx)" 97 printk(KERN_ERR "%s: STC_TAG(%d)[PA(%016llx)VA(%08llx)"
98 "V(%d)W(%d)]\n", 98 "V(%d)W(%d)]\n",
99 pbm->name, 99 pbm->name,
100 i, 100 i,
@@ -102,8 +102,8 @@ static void psycho_check_stc_error(struct pci_pbm_info *pbm)
102 (tagval & PSYCHO_STCTAG_VPN), 102 (tagval & PSYCHO_STCTAG_VPN),
103 ((tagval & PSYCHO_STCTAG_VALID) ? 1 : 0), 103 ((tagval & PSYCHO_STCTAG_VALID) ? 1 : 0),
104 ((tagval & PSYCHO_STCTAG_WRITE) ? 1 : 0)); 104 ((tagval & PSYCHO_STCTAG_WRITE) ? 1 : 0));
105 printk(KERN_ERR "%s: STC_LINE(%d)[LIDX(%lx)SP(%lx)" 105 printk(KERN_ERR "%s: STC_LINE(%d)[LIDX(%llx)SP(%llx)"
106 "LADDR(%lx)EP(%lx)V(%d)FOFN(%d)]\n", 106 "LADDR(%llx)EP(%llx)V(%d)FOFN(%d)]\n",
107 pbm->name, 107 pbm->name,
108 i, 108 i,
109 ((lineval & PSYCHO_STCLINE_LINDX) >> 21UL), 109 ((lineval & PSYCHO_STCLINE_LINDX) >> 21UL),
@@ -144,10 +144,10 @@ static void psycho_record_iommu_tags_and_data(struct pci_pbm_info *pbm,
144#define PSYCHO_IOMMU_TAG_WRITE (0x1UL << 21UL) 144#define PSYCHO_IOMMU_TAG_WRITE (0x1UL << 21UL)
145#define PSYCHO_IOMMU_TAG_STREAM (0x1UL << 20UL) 145#define PSYCHO_IOMMU_TAG_STREAM (0x1UL << 20UL)
146#define PSYCHO_IOMMU_TAG_SIZE (0x1UL << 19UL) 146#define PSYCHO_IOMMU_TAG_SIZE (0x1UL << 19UL)
147#define PSYCHO_IOMMU_TAG_VPAGE 0x7ffffUL 147#define PSYCHO_IOMMU_TAG_VPAGE 0x7ffffULL
148#define PSYCHO_IOMMU_DATA_VALID (1UL << 30UL) 148#define PSYCHO_IOMMU_DATA_VALID (1UL << 30UL)
149#define PSYCHO_IOMMU_DATA_CACHE (1UL << 28UL) 149#define PSYCHO_IOMMU_DATA_CACHE (1UL << 28UL)
150#define PSYCHO_IOMMU_DATA_PPAGE 0xfffffffUL 150#define PSYCHO_IOMMU_DATA_PPAGE 0xfffffffULL
151 151
152static void psycho_dump_iommu_tags_and_data(struct pci_pbm_info *pbm, 152static void psycho_dump_iommu_tags_and_data(struct pci_pbm_info *pbm,
153 u64 *tag, u64 *data) 153 u64 *tag, u64 *data)
@@ -179,18 +179,18 @@ static void psycho_dump_iommu_tags_and_data(struct pci_pbm_info *pbm,
179 } 179 }
180 180
181 printk(KERN_ERR "%s: IOMMU TAG(%d)[error(%s) wr(%d) " 181 printk(KERN_ERR "%s: IOMMU TAG(%d)[error(%s) wr(%d) "
182 "str(%d) sz(%dK) vpg(%08lx)]\n", 182 "str(%d) sz(%dK) vpg(%08llx)]\n",
183 pbm->name, i, type_str, 183 pbm->name, i, type_str,
184 ((tag_val & PSYCHO_IOMMU_TAG_WRITE) ? 1 : 0), 184 ((tag_val & PSYCHO_IOMMU_TAG_WRITE) ? 1 : 0),
185 ((tag_val & PSYCHO_IOMMU_TAG_STREAM) ? 1 : 0), 185 ((tag_val & PSYCHO_IOMMU_TAG_STREAM) ? 1 : 0),
186 ((tag_val & PSYCHO_IOMMU_TAG_SIZE) ? 64 : 8), 186 ((tag_val & PSYCHO_IOMMU_TAG_SIZE) ? 64 : 8),
187 (tag_val & PSYCHO_IOMMU_TAG_VPAGE) << IOMMU_PAGE_SHIFT); 187 (tag_val & PSYCHO_IOMMU_TAG_VPAGE) << IOMMU_PAGE_SHIFT);
188 printk(KERN_ERR "%s: IOMMU DATA(%d)[valid(%d) cache(%d) " 188 printk(KERN_ERR "%s: IOMMU DATA(%d)[valid(%d) cache(%d) "
189 "ppg(%016lx)]\n", 189 "ppg(%016llx)]\n",
190 pbm->name, i, 190 pbm->name, i,
191 ((data_val & PSYCHO_IOMMU_DATA_VALID) ? 1 : 0), 191 ((data_val & PSYCHO_IOMMU_DATA_VALID) ? 1 : 0),
192 ((data_val & PSYCHO_IOMMU_DATA_CACHE) ? 1 : 0), 192 ((data_val & PSYCHO_IOMMU_DATA_CACHE) ? 1 : 0),
193 (data_val & PSYCHO_IOMMU_DATA_PPAGE)<<IOMMU_PAGE_SHIFT); 193 (data_val & PSYCHO_IOMMU_DATA_PPAGE) << IOMMU_PAGE_SHIFT);
194 } 194 }
195} 195}
196 196
@@ -285,20 +285,20 @@ static irqreturn_t psycho_pcierr_intr_other(struct pci_pbm_info *pbm)
285 return ret; 285 return ret;
286} 286}
287 287
288#define PSYCHO_PCIAFSR_PMA 0x8000000000000000UL 288#define PSYCHO_PCIAFSR_PMA 0x8000000000000000ULL
289#define PSYCHO_PCIAFSR_PTA 0x4000000000000000UL 289#define PSYCHO_PCIAFSR_PTA 0x4000000000000000ULL
290#define PSYCHO_PCIAFSR_PRTRY 0x2000000000000000UL 290#define PSYCHO_PCIAFSR_PRTRY 0x2000000000000000ULL
291#define PSYCHO_PCIAFSR_PPERR 0x1000000000000000UL 291#define PSYCHO_PCIAFSR_PPERR 0x1000000000000000ULL
292#define PSYCHO_PCIAFSR_SMA 0x0800000000000000UL 292#define PSYCHO_PCIAFSR_SMA 0x0800000000000000ULL
293#define PSYCHO_PCIAFSR_STA 0x0400000000000000UL 293#define PSYCHO_PCIAFSR_STA 0x0400000000000000ULL
294#define PSYCHO_PCIAFSR_SRTRY 0x0200000000000000UL 294#define PSYCHO_PCIAFSR_SRTRY 0x0200000000000000ULL
295#define PSYCHO_PCIAFSR_SPERR 0x0100000000000000UL 295#define PSYCHO_PCIAFSR_SPERR 0x0100000000000000ULL
296#define PSYCHO_PCIAFSR_RESV1 0x00ff000000000000UL 296#define PSYCHO_PCIAFSR_RESV1 0x00ff000000000000ULL
297#define PSYCHO_PCIAFSR_BMSK 0x0000ffff00000000UL 297#define PSYCHO_PCIAFSR_BMSK 0x0000ffff00000000ULL
298#define PSYCHO_PCIAFSR_BLK 0x0000000080000000UL 298#define PSYCHO_PCIAFSR_BLK 0x0000000080000000ULL
299#define PSYCHO_PCIAFSR_RESV2 0x0000000040000000UL 299#define PSYCHO_PCIAFSR_RESV2 0x0000000040000000ULL
300#define PSYCHO_PCIAFSR_MID 0x000000003e000000UL 300#define PSYCHO_PCIAFSR_MID 0x000000003e000000ULL
301#define PSYCHO_PCIAFSR_RESV3 0x0000000001ffffffUL 301#define PSYCHO_PCIAFSR_RESV3 0x0000000001ffffffULL
302 302
303irqreturn_t psycho_pcierr_intr(int irq, void *dev_id) 303irqreturn_t psycho_pcierr_intr(int irq, void *dev_id)
304{ 304{
@@ -326,12 +326,12 @@ irqreturn_t psycho_pcierr_intr(int irq, void *dev_id)
326 "Excessive Retries" : 326 "Excessive Retries" :
327 ((error_bits & PSYCHO_PCIAFSR_PPERR) ? 327 ((error_bits & PSYCHO_PCIAFSR_PPERR) ?
328 "Parity Error" : "???")))))); 328 "Parity Error" : "???"))))));
329 printk(KERN_ERR "%s: bytemask[%04lx] UPA_MID[%02lx] was_block(%d)\n", 329 printk(KERN_ERR "%s: bytemask[%04llx] UPA_MID[%02llx] was_block(%d)\n",
330 pbm->name, 330 pbm->name,
331 (afsr & PSYCHO_PCIAFSR_BMSK) >> 32UL, 331 (afsr & PSYCHO_PCIAFSR_BMSK) >> 32UL,
332 (afsr & PSYCHO_PCIAFSR_MID) >> 25UL, 332 (afsr & PSYCHO_PCIAFSR_MID) >> 25UL,
333 (afsr & PSYCHO_PCIAFSR_BLK) ? 1 : 0); 333 (afsr & PSYCHO_PCIAFSR_BLK) ? 1 : 0);
334 printk(KERN_ERR "%s: PCI AFAR [%016lx]\n", pbm->name, afar); 334 printk(KERN_ERR "%s: PCI AFAR [%016llx]\n", pbm->name, afar);
335 printk(KERN_ERR "%s: PCI Secondary errors [", pbm->name); 335 printk(KERN_ERR "%s: PCI Secondary errors [", pbm->name);
336 reported = 0; 336 reported = 0;
337 if (afsr & PSYCHO_PCIAFSR_SMA) { 337 if (afsr & PSYCHO_PCIAFSR_SMA) {
diff --git a/arch/sparc/kernel/sbus.c b/arch/sparc/kernel/sbus.c
index 2ead310066d1..406e0872504e 100644
--- a/arch/sparc/kernel/sbus.c
+++ b/arch/sparc/kernel/sbus.c
@@ -117,6 +117,7 @@ void sbus_set_sbus64(struct device *dev, int bursts)
117 val |= (1UL << 4UL); 117 val |= (1UL << 4UL);
118 upa_writeq(val, cfg_reg); 118 upa_writeq(val, cfg_reg);
119} 119}
120EXPORT_SYMBOL(sbus_set_sbus64);
120 121
121/* INO number to IMAP register offset for SYSIO external IRQ's. 122/* INO number to IMAP register offset for SYSIO external IRQ's.
122 * This should conform to both Sunfire/Wildfire server and Fusion 123 * This should conform to both Sunfire/Wildfire server and Fusion
diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c
index c96c65d1b58b..998cadb4e7f2 100644
--- a/arch/sparc/kernel/setup_32.c
+++ b/arch/sparc/kernel/setup_32.c
@@ -199,7 +199,9 @@ extern unsigned short ram_flags;
199extern int root_mountflags; 199extern int root_mountflags;
200 200
201char reboot_command[COMMAND_LINE_SIZE]; 201char reboot_command[COMMAND_LINE_SIZE];
202
202enum sparc_cpu sparc_cpu_model; 203enum sparc_cpu sparc_cpu_model;
204EXPORT_SYMBOL(sparc_cpu_model);
203 205
204struct tt_entry *sparc_ttable; 206struct tt_entry *sparc_ttable;
205 207
@@ -391,6 +393,7 @@ void sun_do_break(void)
391 393
392 prom_cmdline(); 394 prom_cmdline();
393} 395}
396EXPORT_SYMBOL(sun_do_break);
394 397
395int stop_a_enabled = 1; 398int stop_a_enabled = 1;
396 399
diff --git a/arch/sparc/kernel/setup_64.c b/arch/sparc/kernel/setup_64.c
index 555db7452ebe..49d061f4ae9d 100644
--- a/arch/sparc/kernel/setup_64.c
+++ b/arch/sparc/kernel/setup_64.c
@@ -58,6 +58,7 @@
58 * operations in asm/ns87303.h 58 * operations in asm/ns87303.h
59 */ 59 */
60DEFINE_SPINLOCK(ns87303_lock); 60DEFINE_SPINLOCK(ns87303_lock);
61EXPORT_SYMBOL(ns87303_lock);
61 62
62struct screen_info screen_info = { 63struct screen_info screen_info = {
63 0, 0, /* orig-x, orig-y */ 64 0, 0, /* orig-x, orig-y */
@@ -425,5 +426,7 @@ void sun_do_break(void)
425 426
426 prom_cmdline(); 427 prom_cmdline();
427} 428}
429EXPORT_SYMBOL(sun_do_break);
428 430
429int stop_a_enabled = 1; 431int stop_a_enabled = 1;
432EXPORT_SYMBOL(stop_a_enabled);
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c
index c94f91c8b6e0..181d069a2d44 100644
--- a/arch/sparc/kernel/signal_32.c
+++ b/arch/sparc/kernel/signal_32.c
@@ -34,7 +34,7 @@ extern void fpload(unsigned long *fpregs, unsigned long *fsr);
34 34
35struct signal_frame { 35struct signal_frame {
36 struct sparc_stackf ss; 36 struct sparc_stackf ss;
37 __siginfo_t info; 37 __siginfo32_t info;
38 __siginfo_fpu_t __user *fpu_save; 38 __siginfo_fpu_t __user *fpu_save;
39 unsigned long insns[2] __attribute__ ((aligned (8))); 39 unsigned long insns[2] __attribute__ ((aligned (8)));
40 unsigned int extramask[_NSIG_WORDS - 1]; 40 unsigned int extramask[_NSIG_WORDS - 1];
@@ -351,7 +351,7 @@ static void setup_frame(struct k_sigaction *ka, struct pt_regs *regs,
351 err |= __copy_to_user(sf->extramask, &oldset->sig[1], 351 err |= __copy_to_user(sf->extramask, &oldset->sig[1],
352 (_NSIG_WORDS - 1) * sizeof(unsigned int)); 352 (_NSIG_WORDS - 1) * sizeof(unsigned int));
353 err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP], 353 err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP],
354 sizeof(struct reg_window)); 354 sizeof(struct reg_window32));
355 if (err) 355 if (err)
356 goto sigsegv; 356 goto sigsegv;
357 357
@@ -433,7 +433,7 @@ static void setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
433 err |= __put_user(current->sas_ss_size, &sf->stack.ss_size); 433 err |= __put_user(current->sas_ss_size, &sf->stack.ss_size);
434 434
435 err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP], 435 err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP],
436 sizeof(struct reg_window)); 436 sizeof(struct reg_window32));
437 437
438 err |= copy_siginfo_to_user(&sf->info, info); 438 err |= copy_siginfo_to_user(&sf->info, info);
439 439
diff --git a/arch/sparc/kernel/smp_32.c b/arch/sparc/kernel/smp_32.c
index e396c1f17a92..1e5ac4e282e1 100644
--- a/arch/sparc/kernel/smp_32.c
+++ b/arch/sparc/kernel/smp_32.c
@@ -39,8 +39,6 @@ volatile unsigned long cpu_callin_map[NR_CPUS] __cpuinitdata = {0,};
39unsigned char boot_cpu_id = 0; 39unsigned char boot_cpu_id = 0;
40unsigned char boot_cpu_id4 = 0; /* boot_cpu_id << 2 */ 40unsigned char boot_cpu_id4 = 0; /* boot_cpu_id << 2 */
41 41
42cpumask_t cpu_online_map = CPU_MASK_NONE;
43cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
44cpumask_t smp_commenced_mask = CPU_MASK_NONE; 42cpumask_t smp_commenced_mask = CPU_MASK_NONE;
45 43
46/* The only guaranteed locking primitive available on all Sparc 44/* The only guaranteed locking primitive available on all Sparc
@@ -334,7 +332,7 @@ void __init smp_setup_cpu_possible_map(void)
334 instance = 0; 332 instance = 0;
335 while (!cpu_find_by_instance(instance, NULL, &mid)) { 333 while (!cpu_find_by_instance(instance, NULL, &mid)) {
336 if (mid < NR_CPUS) { 334 if (mid < NR_CPUS) {
337 cpu_set(mid, phys_cpu_present_map); 335 cpu_set(mid, cpu_possible_map);
338 cpu_set(mid, cpu_present_map); 336 cpu_set(mid, cpu_present_map);
339 } 337 }
340 instance++; 338 instance++;
@@ -354,7 +352,7 @@ void __init smp_prepare_boot_cpu(void)
354 352
355 current_thread_info()->cpu = cpuid; 353 current_thread_info()->cpu = cpuid;
356 cpu_set(cpuid, cpu_online_map); 354 cpu_set(cpuid, cpu_online_map);
357 cpu_set(cpuid, phys_cpu_present_map); 355 cpu_set(cpuid, cpu_possible_map);
358} 356}
359 357
360int __cpuinit __cpu_up(unsigned int cpu) 358int __cpuinit __cpu_up(unsigned int cpu)
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index bfe99d82d458..6cd1a5b65067 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -49,14 +49,10 @@
49 49
50int sparc64_multi_core __read_mostly; 50int sparc64_multi_core __read_mostly;
51 51
52cpumask_t cpu_possible_map __read_mostly = CPU_MASK_NONE;
53cpumask_t cpu_online_map __read_mostly = CPU_MASK_NONE;
54DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE; 52DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE;
55cpumask_t cpu_core_map[NR_CPUS] __read_mostly = 53cpumask_t cpu_core_map[NR_CPUS] __read_mostly =
56 { [0 ... NR_CPUS-1] = CPU_MASK_NONE }; 54 { [0 ... NR_CPUS-1] = CPU_MASK_NONE };
57 55
58EXPORT_SYMBOL(cpu_possible_map);
59EXPORT_SYMBOL(cpu_online_map);
60EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); 56EXPORT_PER_CPU_SYMBOL(cpu_sibling_map);
61EXPORT_SYMBOL(cpu_core_map); 57EXPORT_SYMBOL(cpu_core_map);
62 58
@@ -453,7 +449,7 @@ again:
453 __asm__ __volatile__("wrpr %0, 0x0, %%pstate" 449 __asm__ __volatile__("wrpr %0, 0x0, %%pstate"
454 : : "r" (pstate)); 450 : : "r" (pstate));
455 if (stuck == 0) { 451 if (stuck == 0) {
456 printk("CPU[%d]: mondo stuckage result[%016lx]\n", 452 printk("CPU[%d]: mondo stuckage result[%016llx]\n",
457 smp_processor_id(), result); 453 smp_processor_id(), result);
458 } else { 454 } else {
459 udelay(2); 455 udelay(2);
@@ -588,7 +584,7 @@ retry:
588 /* Busy bits will not clear, continue instead 584 /* Busy bits will not clear, continue instead
589 * of freezing up on this cpu. 585 * of freezing up on this cpu.
590 */ 586 */
591 printk("CPU[%d]: mondo stuckage result[%016lx]\n", 587 printk("CPU[%d]: mondo stuckage result[%016llx]\n",
592 smp_processor_id(), dispatch_stat); 588 smp_processor_id(), dispatch_stat);
593 } else { 589 } else {
594 int i, this_busy_nack = 0; 590 int i, this_busy_nack = 0;
diff --git a/arch/sparc/kernel/sparc_ksyms_32.c b/arch/sparc/kernel/sparc_ksyms_32.c
index a4d45fc29b21..baeab8720237 100644
--- a/arch/sparc/kernel/sparc_ksyms_32.c
+++ b/arch/sparc/kernel/sparc_ksyms_32.c
@@ -5,49 +5,14 @@
5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) 5 * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
6 */ 6 */
7 7
8/* Tell string.h we don't want memcpy etc. as cpp defines */
9#define EXPORT_SYMTAB_STROPS
10#define PROMLIB_INTERNAL
11
12#include <linux/module.h> 8#include <linux/module.h>
13#include <linux/init.h> 9#include <linux/init.h>
14#include <linux/smp.h>
15#include <linux/types.h>
16#include <linux/string.h>
17#include <linux/sched.h>
18#include <linux/interrupt.h>
19#include <linux/in6.h>
20#include <linux/spinlock.h>
21#include <linux/mm.h>
22#include <linux/syscalls.h>
23#ifdef CONFIG_PCI
24#include <linux/pci.h>
25#endif
26#include <linux/pm.h>
27#ifdef CONFIG_HIGHMEM
28#include <linux/highmem.h>
29#endif
30 10
31#include <asm/oplib.h>
32#include <asm/delay.h>
33#include <asm/system.h>
34#include <asm/auxio.h>
35#include <asm/pgtable.h> 11#include <asm/pgtable.h>
36#include <asm/io.h>
37#include <asm/irq.h>
38#include <asm/idprom.h>
39#include <asm/head.h>
40#include <asm/smp.h>
41#include <asm/ptrace.h>
42#include <asm/uaccess.h> 12#include <asm/uaccess.h>
43#include <asm/checksum.h> 13#include <asm/delay.h>
44#ifdef CONFIG_SBUS 14#include <asm/head.h>
45#include <asm/dma.h> 15#include <asm/dma.h>
46#endif
47#include <asm/io-unit.h>
48#include <asm/bug.h>
49
50extern spinlock_t rtc_lock;
51 16
52struct poll { 17struct poll {
53 int fd; 18 int fd;
@@ -55,76 +20,15 @@ struct poll {
55 short revents; 20 short revents;
56}; 21};
57 22
58extern void (*__copy_1page)(void *, const void *); 23/* from entry.S */
59extern void __memmove(void *, const void *, __kernel_size_t);
60extern void (*bzero_1page)(void *);
61extern void *__bzero(void *, size_t);
62extern void *__memscan_zero(void *, size_t);
63extern void *__memscan_generic(void *, int, size_t);
64extern int __strncmp(const char *, const char *, __kernel_size_t);
65
66extern int __ashrdi3(int, int);
67extern int __ashldi3(int, int);
68extern int __lshrdi3(int, int);
69extern int __muldi3(int, int);
70extern int __divdi3(int, int);
71
72/* Private functions with odd calling conventions. */
73extern void ___atomic24_add(void);
74extern void ___atomic24_sub(void);
75extern void ___rw_read_enter(void);
76extern void ___rw_read_try(void);
77extern void ___rw_read_exit(void);
78extern void ___rw_write_enter(void);
79
80/* Alias functions whose names begin with "." and export the aliases.
81 * The module references will be fixed up by module_frob_arch_sections.
82 */
83extern int _Div(int, int);
84extern int _Mul(int, int);
85extern int _Rem(int, int);
86extern unsigned _Udiv(unsigned, unsigned);
87extern unsigned _Umul(unsigned, unsigned);
88extern unsigned _Urem(unsigned, unsigned);
89
90/* used by various drivers */
91EXPORT_SYMBOL(sparc_cpu_model);
92EXPORT_SYMBOL(kernel_thread);
93#ifdef CONFIG_SMP
94// XXX find what uses (or used) these. AV: see asm/spinlock.h
95EXPORT_SYMBOL(___rw_read_enter);
96EXPORT_SYMBOL(___rw_read_try);
97EXPORT_SYMBOL(___rw_read_exit);
98EXPORT_SYMBOL(___rw_write_enter);
99#endif
100
101EXPORT_SYMBOL(sparc_valid_addr_bitmap);
102EXPORT_SYMBOL(phys_base);
103EXPORT_SYMBOL(pfn_base);
104
105/* Atomic operations. */
106EXPORT_SYMBOL(___atomic24_add);
107EXPORT_SYMBOL(___atomic24_sub);
108
109/* Per-CPU information table */
110EXPORT_PER_CPU_SYMBOL(__cpu_data);
111
112#ifdef CONFIG_SMP
113/* IRQ implementation. */
114EXPORT_SYMBOL(synchronize_irq);
115
116/* CPU online map and active count. */
117EXPORT_SYMBOL(cpu_online_map);
118EXPORT_SYMBOL(phys_cpu_present_map);
119#endif
120
121EXPORT_SYMBOL(__udelay); 24EXPORT_SYMBOL(__udelay);
122EXPORT_SYMBOL(__ndelay); 25EXPORT_SYMBOL(__ndelay);
123EXPORT_SYMBOL(rtc_lock);
124EXPORT_SYMBOL(set_auxio);
125EXPORT_SYMBOL(get_auxio);
126EXPORT_SYMBOL(io_remap_pfn_range);
127 26
27/* from head_32.S */
28EXPORT_SYMBOL(__ret_efault);
29EXPORT_SYMBOL(empty_zero_page);
30
31/* Defined using magic */
128#ifndef CONFIG_SMP 32#ifndef CONFIG_SMP
129EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32)); 33EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32));
130#else 34#else
@@ -136,122 +40,7 @@ EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl));
136EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one)); 40EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_one));
137EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl)); 41EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_sgl));
138EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one)); 42EXPORT_SYMBOL(BTFIXUP_CALL(mmu_release_scsi_one));
139
140EXPORT_SYMBOL(BTFIXUP_CALL(pgprot_noncached)); 43EXPORT_SYMBOL(BTFIXUP_CALL(pgprot_noncached));
141 44
142#ifdef CONFIG_SBUS 45/* Exporting a symbol from /init/main.c */
143EXPORT_SYMBOL(sbus_set_sbus64);
144#endif
145#ifdef CONFIG_PCI
146EXPORT_SYMBOL(insb);
147EXPORT_SYMBOL(outsb);
148EXPORT_SYMBOL(insw);
149EXPORT_SYMBOL(outsw);
150EXPORT_SYMBOL(insl);
151EXPORT_SYMBOL(outsl);
152EXPORT_SYMBOL(pci_alloc_consistent);
153EXPORT_SYMBOL(pci_free_consistent);
154EXPORT_SYMBOL(pci_map_single);
155EXPORT_SYMBOL(pci_unmap_single);
156EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
157EXPORT_SYMBOL(pci_dma_sync_single_for_device);
158EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
159EXPORT_SYMBOL(pci_dma_sync_sg_for_device);
160EXPORT_SYMBOL(pci_map_sg);
161EXPORT_SYMBOL(pci_unmap_sg);
162EXPORT_SYMBOL(pci_map_page);
163EXPORT_SYMBOL(pci_unmap_page);
164/* Actually, ioremap/iounmap are not PCI specific. But it is ok for drivers. */
165EXPORT_SYMBOL(ioremap);
166EXPORT_SYMBOL(iounmap);
167#endif
168
169/* in arch/sparc/mm/highmem.c */
170#ifdef CONFIG_HIGHMEM
171EXPORT_SYMBOL(kmap_atomic);
172EXPORT_SYMBOL(kunmap_atomic);
173#endif
174
175/* prom symbols */
176EXPORT_SYMBOL(idprom);
177EXPORT_SYMBOL(prom_root_node);
178EXPORT_SYMBOL(prom_getchild);
179EXPORT_SYMBOL(prom_getsibling);
180EXPORT_SYMBOL(prom_searchsiblings);
181EXPORT_SYMBOL(prom_firstprop);
182EXPORT_SYMBOL(prom_nextprop);
183EXPORT_SYMBOL(prom_getproplen);
184EXPORT_SYMBOL(prom_getproperty);
185EXPORT_SYMBOL(prom_node_has_property);
186EXPORT_SYMBOL(prom_setprop);
187EXPORT_SYMBOL(saved_command_line); 46EXPORT_SYMBOL(saved_command_line);
188EXPORT_SYMBOL(prom_apply_obio_ranges);
189EXPORT_SYMBOL(prom_feval);
190EXPORT_SYMBOL(prom_getbool);
191EXPORT_SYMBOL(prom_getstring);
192EXPORT_SYMBOL(prom_getint);
193EXPORT_SYMBOL(prom_getintdefault);
194EXPORT_SYMBOL(prom_finddevice);
195EXPORT_SYMBOL(romvec);
196EXPORT_SYMBOL(__prom_getchild);
197EXPORT_SYMBOL(__prom_getsibling);
198
199/* sparc library symbols */
200EXPORT_SYMBOL(memscan);
201EXPORT_SYMBOL(strlen);
202EXPORT_SYMBOL(strncmp);
203EXPORT_SYMBOL(page_kernel);
204
205/* Special internal versions of library functions. */
206EXPORT_SYMBOL(__copy_1page);
207EXPORT_SYMBOL(__memcpy);
208EXPORT_SYMBOL(__memset);
209EXPORT_SYMBOL(bzero_1page);
210EXPORT_SYMBOL(__bzero);
211EXPORT_SYMBOL(__memscan_zero);
212EXPORT_SYMBOL(__memscan_generic);
213EXPORT_SYMBOL(__strncmp);
214EXPORT_SYMBOL(__memmove);
215
216/* Moving data to/from userspace. */
217EXPORT_SYMBOL(__copy_user);
218EXPORT_SYMBOL(__strncpy_from_user);
219EXPORT_SYMBOL(__strnlen_user);
220
221/* Networking helper routines. */
222EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
223EXPORT_SYMBOL(csum_partial);
224
225/* Cache flushing. */
226EXPORT_SYMBOL(sparc_flush_page_to_ram);
227
228/* For when serial stuff is built as modules. */
229EXPORT_SYMBOL(sun_do_break);
230
231EXPORT_SYMBOL(__ret_efault);
232
233EXPORT_SYMBOL(memcmp);
234EXPORT_SYMBOL(memcpy);
235EXPORT_SYMBOL(memset);
236EXPORT_SYMBOL(memmove);
237EXPORT_SYMBOL(__ashrdi3);
238EXPORT_SYMBOL(__ashldi3);
239EXPORT_SYMBOL(__lshrdi3);
240EXPORT_SYMBOL(__muldi3);
241EXPORT_SYMBOL(__divdi3);
242
243EXPORT_SYMBOL(_Rem);
244EXPORT_SYMBOL(_Urem);
245EXPORT_SYMBOL(_Mul);
246EXPORT_SYMBOL(_Umul);
247EXPORT_SYMBOL(_Div);
248EXPORT_SYMBOL(_Udiv);
249
250#ifdef CONFIG_DEBUG_BUGVERBOSE
251EXPORT_SYMBOL(do_BUG);
252#endif
253
254/* Sun Power Management Idle Handler */
255EXPORT_SYMBOL(pm_idle);
256
257EXPORT_SYMBOL(empty_zero_page);
diff --git a/arch/sparc/kernel/sparc_ksyms_64.c b/arch/sparc/kernel/sparc_ksyms_64.c
index 0133211ab634..da8f804feb49 100644
--- a/arch/sparc/kernel/sparc_ksyms_64.c
+++ b/arch/sparc/kernel/sparc_ksyms_64.c
@@ -5,50 +5,16 @@
5 * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz) 5 * Copyright (C) 1999 Jakub Jelinek (jj@ultra.linux.cz)
6 */ 6 */
7 7
8/* Tell string.h we don't want memcpy etc. as cpp defines */
9#define EXPORT_SYMTAB_STROPS
10#define PROMLIB_INTERNAL
11
12#include <linux/module.h> 8#include <linux/module.h>
13#include <linux/types.h>
14#include <linux/string.h>
15#include <linux/sched.h>
16#include <linux/in6.h>
17#include <linux/pci.h> 9#include <linux/pci.h>
18#include <linux/interrupt.h>
19#include <linux/fs_struct.h>
20#include <linux/fs.h>
21#include <linux/mm.h>
22#include <linux/socket.h>
23#include <linux/syscalls.h>
24#include <linux/percpu.h>
25#include <linux/init.h> 10#include <linux/init.h>
26#include <linux/rwsem.h>
27#include <net/compat.h>
28 11
29#include <asm/oplib.h> 12#include <asm/spinlock.h>
30#include <asm/system.h> 13#include <asm/system.h>
31#include <asm/auxio.h>
32#include <asm/pgtable.h>
33#include <asm/io.h>
34#include <asm/irq.h>
35#include <asm/idprom.h>
36#include <asm/elf.h>
37#include <asm/head.h>
38#include <asm/smp.h>
39#include <asm/ptrace.h>
40#include <asm/uaccess.h>
41#include <asm/checksum.h>
42#include <asm/fpumacro.h>
43#include <asm/pgalloc.h>
44#include <asm/cacheflush.h>
45#ifdef CONFIG_SBUS
46#include <asm/dma.h>
47#endif
48#include <asm/ns87303.h>
49#include <asm/timer.h>
50#include <asm/cpudata.h> 14#include <asm/cpudata.h>
51#include <asm/ftrace.h> 15#include <asm/uaccess.h>
16#include <asm/spitfire.h>
17#include <asm/oplib.h>
52#include <asm/hypervisor.h> 18#include <asm/hypervisor.h>
53 19
54struct poll { 20struct poll {
@@ -57,42 +23,6 @@ struct poll {
57 short revents; 23 short revents;
58}; 24};
59 25
60extern void die_if_kernel(char *str, struct pt_regs *regs);
61extern pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
62extern void *__bzero(void *, size_t);
63extern void *__memscan_zero(void *, size_t);
64extern void *__memscan_generic(void *, int, size_t);
65extern __kernel_size_t strlen(const char *);
66extern void sys_sigsuspend(void);
67extern int compat_sys_ioctl(unsigned int fd, unsigned int cmd, u32 arg);
68extern int (*handle_mathemu)(struct pt_regs *, struct fpustate *);
69extern long sparc32_open(const char __user * filename, int flags, int mode);
70extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
71 unsigned long pfn, unsigned long size, pgprot_t prot);
72
73extern int __ashrdi3(int, int);
74
75extern int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs);
76
77extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
78extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *,
79 unsigned long *);
80extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
81 unsigned long *, unsigned long *);
82extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
83 unsigned long *, unsigned long *, unsigned long *);
84
85extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
86extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
87 unsigned long *);
88extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
89 unsigned long *, unsigned long *);
90extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
91 unsigned long *, unsigned long *, unsigned long *);
92
93/* Per-CPU information table */
94EXPORT_PER_CPU_SYMBOL(__cpu_data);
95
96/* used by various drivers */ 26/* used by various drivers */
97#ifdef CONFIG_SMP 27#ifdef CONFIG_SMP
98/* Out of line rw-locking implementation. */ 28/* Out of line rw-locking implementation. */
@@ -103,68 +33,24 @@ EXPORT_SYMBOL(__write_unlock);
103EXPORT_SYMBOL(__write_trylock); 33EXPORT_SYMBOL(__write_trylock);
104#endif /* CONFIG_SMP */ 34#endif /* CONFIG_SMP */
105 35
106#ifdef CONFIG_MCOUNT 36/* from helpers.S */
107EXPORT_SYMBOL(_mcount);
108#endif
109
110EXPORT_SYMBOL(sparc64_get_clock_tick);
111
112/* RW semaphores */
113EXPORT_SYMBOL(__down_read);
114EXPORT_SYMBOL(__down_read_trylock);
115EXPORT_SYMBOL(__down_write);
116EXPORT_SYMBOL(__down_write_trylock);
117EXPORT_SYMBOL(__up_read);
118EXPORT_SYMBOL(__up_write);
119EXPORT_SYMBOL(__downgrade_write);
120
121/* Atomic counter implementation. */
122EXPORT_SYMBOL(atomic_add);
123EXPORT_SYMBOL(atomic_add_ret);
124EXPORT_SYMBOL(atomic_sub);
125EXPORT_SYMBOL(atomic_sub_ret);
126EXPORT_SYMBOL(atomic64_add);
127EXPORT_SYMBOL(atomic64_add_ret);
128EXPORT_SYMBOL(atomic64_sub);
129EXPORT_SYMBOL(atomic64_sub_ret);
130
131/* Atomic bit operations. */
132EXPORT_SYMBOL(test_and_set_bit);
133EXPORT_SYMBOL(test_and_clear_bit);
134EXPORT_SYMBOL(test_and_change_bit);
135EXPORT_SYMBOL(set_bit);
136EXPORT_SYMBOL(clear_bit);
137EXPORT_SYMBOL(change_bit);
138
139EXPORT_SYMBOL(__flushw_user); 37EXPORT_SYMBOL(__flushw_user);
38EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
140 39
40/* from head_64.S */
41EXPORT_SYMBOL(__ret_efault);
141EXPORT_SYMBOL(tlb_type); 42EXPORT_SYMBOL(tlb_type);
142EXPORT_SYMBOL(sun4v_chip_type); 43EXPORT_SYMBOL(sun4v_chip_type);
143EXPORT_SYMBOL(get_fb_unmapped_area); 44EXPORT_SYMBOL(prom_root_node);
144EXPORT_SYMBOL(flush_icache_range);
145
146EXPORT_SYMBOL(flush_dcache_page);
147#ifdef DCACHE_ALIASING_POSSIBLE
148EXPORT_SYMBOL(__flush_dcache_range);
149#endif
150 45
46/* from hvcalls.S */
151EXPORT_SYMBOL(sun4v_niagara_getperf); 47EXPORT_SYMBOL(sun4v_niagara_getperf);
152EXPORT_SYMBOL(sun4v_niagara_setperf); 48EXPORT_SYMBOL(sun4v_niagara_setperf);
153EXPORT_SYMBOL(sun4v_niagara2_getperf); 49EXPORT_SYMBOL(sun4v_niagara2_getperf);
154EXPORT_SYMBOL(sun4v_niagara2_setperf); 50EXPORT_SYMBOL(sun4v_niagara2_setperf);
155 51
156EXPORT_SYMBOL(auxio_set_led);
157EXPORT_SYMBOL(auxio_set_lte);
158#ifdef CONFIG_SBUS
159EXPORT_SYMBOL(sbus_set_sbus64);
160#endif
161EXPORT_SYMBOL(outsb);
162EXPORT_SYMBOL(outsw);
163EXPORT_SYMBOL(outsl);
164EXPORT_SYMBOL(insb);
165EXPORT_SYMBOL(insw);
166EXPORT_SYMBOL(insl);
167#ifdef CONFIG_PCI 52#ifdef CONFIG_PCI
53/* inline functions in asm/pci_64.h */
168EXPORT_SYMBOL(pci_alloc_consistent); 54EXPORT_SYMBOL(pci_alloc_consistent);
169EXPORT_SYMBOL(pci_free_consistent); 55EXPORT_SYMBOL(pci_free_consistent);
170EXPORT_SYMBOL(pci_map_single); 56EXPORT_SYMBOL(pci_map_single);
@@ -173,112 +59,7 @@ EXPORT_SYMBOL(pci_map_sg);
173EXPORT_SYMBOL(pci_unmap_sg); 59EXPORT_SYMBOL(pci_unmap_sg);
174EXPORT_SYMBOL(pci_dma_sync_single_for_cpu); 60EXPORT_SYMBOL(pci_dma_sync_single_for_cpu);
175EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu); 61EXPORT_SYMBOL(pci_dma_sync_sg_for_cpu);
176EXPORT_SYMBOL(pci_dma_supported);
177#endif 62#endif
178 63
179/* I/O device mmaping on Sparc64. */ 64/* Exporting a symbol from /init/main.c */
180EXPORT_SYMBOL(io_remap_pfn_range);
181
182EXPORT_SYMBOL(dump_fpu);
183
184/* math-emu wants this */
185EXPORT_SYMBOL(die_if_kernel);
186
187/* Kernel thread creation. */
188EXPORT_SYMBOL(kernel_thread);
189
190/* prom symbols */
191EXPORT_SYMBOL(idprom);
192EXPORT_SYMBOL(prom_root_node);
193EXPORT_SYMBOL(prom_getchild);
194EXPORT_SYMBOL(prom_getsibling);
195EXPORT_SYMBOL(prom_searchsiblings);
196EXPORT_SYMBOL(prom_firstprop);
197EXPORT_SYMBOL(prom_nextprop);
198EXPORT_SYMBOL(prom_getproplen);
199EXPORT_SYMBOL(prom_getproperty);
200EXPORT_SYMBOL(prom_node_has_property);
201EXPORT_SYMBOL(prom_setprop);
202EXPORT_SYMBOL(saved_command_line); 65EXPORT_SYMBOL(saved_command_line);
203EXPORT_SYMBOL(prom_finddevice);
204EXPORT_SYMBOL(prom_feval);
205EXPORT_SYMBOL(prom_getbool);
206EXPORT_SYMBOL(prom_getstring);
207EXPORT_SYMBOL(prom_getint);
208EXPORT_SYMBOL(prom_getintdefault);
209EXPORT_SYMBOL(__prom_getchild);
210EXPORT_SYMBOL(__prom_getsibling);
211
212/* sparc library symbols */
213EXPORT_SYMBOL(strlen);
214EXPORT_SYMBOL(__strlen_user);
215EXPORT_SYMBOL(__strnlen_user);
216
217/* Special internal versions of library functions. */
218EXPORT_SYMBOL(_clear_page);
219EXPORT_SYMBOL(clear_user_page);
220EXPORT_SYMBOL(copy_user_page);
221EXPORT_SYMBOL(__bzero);
222EXPORT_SYMBOL(__memscan_zero);
223EXPORT_SYMBOL(__memscan_generic);
224EXPORT_SYMBOL(__memset);
225
226EXPORT_SYMBOL(csum_partial);
227EXPORT_SYMBOL(csum_partial_copy_nocheck);
228EXPORT_SYMBOL(__csum_partial_copy_from_user);
229EXPORT_SYMBOL(__csum_partial_copy_to_user);
230EXPORT_SYMBOL(ip_fast_csum);
231
232/* Moving data to/from/in userspace. */
233EXPORT_SYMBOL(___copy_to_user);
234EXPORT_SYMBOL(___copy_from_user);
235EXPORT_SYMBOL(___copy_in_user);
236EXPORT_SYMBOL(copy_to_user_fixup);
237EXPORT_SYMBOL(copy_from_user_fixup);
238EXPORT_SYMBOL(copy_in_user_fixup);
239EXPORT_SYMBOL(__strncpy_from_user);
240EXPORT_SYMBOL(__clear_user);
241
242/* Various address conversion macros use this. */
243EXPORT_SYMBOL(sparc64_valid_addr_bitmap);
244
245/* No version information on this, heavily used in inline asm,
246 * and will always be 'void __ret_efault(void)'.
247 */
248EXPORT_SYMBOL(__ret_efault);
249
250/* No version information on these, as gcc produces such symbols. */
251EXPORT_SYMBOL(memcmp);
252EXPORT_SYMBOL(memcpy);
253EXPORT_SYMBOL(memset);
254EXPORT_SYMBOL(memmove);
255EXPORT_SYMBOL(strncmp);
256
257void VISenter(void);
258/* RAID code needs this */
259EXPORT_SYMBOL(VISenter);
260
261/* for input/keybdev */
262EXPORT_SYMBOL(sun_do_break);
263EXPORT_SYMBOL(stop_a_enabled);
264
265#ifdef CONFIG_DEBUG_BUGVERBOSE
266EXPORT_SYMBOL(do_BUG);
267#endif
268
269/* for ns8703 */
270EXPORT_SYMBOL(ns87303_lock);
271
272EXPORT_SYMBOL(tick_ops);
273
274EXPORT_SYMBOL(xor_vis_2);
275EXPORT_SYMBOL(xor_vis_3);
276EXPORT_SYMBOL(xor_vis_4);
277EXPORT_SYMBOL(xor_vis_5);
278
279EXPORT_SYMBOL(xor_niagara_2);
280EXPORT_SYMBOL(xor_niagara_3);
281EXPORT_SYMBOL(xor_niagara_4);
282EXPORT_SYMBOL(xor_niagara_5);
283
284EXPORT_SYMBOL_GPL(real_hard_smp_processor_id);
diff --git a/arch/sparc/kernel/sun4d_smp.c b/arch/sparc/kernel/sun4d_smp.c
index 16ab0cb731c5..50afaed99c8a 100644
--- a/arch/sparc/kernel/sun4d_smp.c
+++ b/arch/sparc/kernel/sun4d_smp.c
@@ -60,7 +60,7 @@ extern int __smp4d_processor_id(void);
60#define SMP_PRINTK(x) 60#define SMP_PRINTK(x)
61#endif 61#endif
62 62
63static inline unsigned long swap(volatile unsigned long *ptr, unsigned long val) 63static inline unsigned long sun4d_swap(volatile unsigned long *ptr, unsigned long val)
64{ 64{
65 __asm__ __volatile__("swap [%1], %0\n\t" : 65 __asm__ __volatile__("swap [%1], %0\n\t" :
66 "=&r" (val), "=&r" (ptr) : 66 "=&r" (val), "=&r" (ptr) :
@@ -115,7 +115,7 @@ void __cpuinit smp4d_callin(void)
115 local_flush_tlb_all(); 115 local_flush_tlb_all();
116 116
117 /* Allow master to continue. */ 117 /* Allow master to continue. */
118 swap((unsigned long *)&cpu_callin_map[cpuid], 1); 118 sun4d_swap((unsigned long *)&cpu_callin_map[cpuid], 1);
119 local_flush_cache_all(); 119 local_flush_cache_all();
120 local_flush_tlb_all(); 120 local_flush_tlb_all();
121 121
diff --git a/arch/sparc/kernel/sun4m_smp.c b/arch/sparc/kernel/sun4m_smp.c
index 4f8d60586b07..8040376c4890 100644
--- a/arch/sparc/kernel/sun4m_smp.c
+++ b/arch/sparc/kernel/sun4m_smp.c
@@ -54,7 +54,8 @@ extern int __smp4m_processor_id(void);
54#define SMP_PRINTK(x) 54#define SMP_PRINTK(x)
55#endif 55#endif
56 56
57static inline unsigned long swap(volatile unsigned long *ptr, unsigned long val) 57static inline unsigned long
58swap_ulong(volatile unsigned long *ptr, unsigned long val)
58{ 59{
59 __asm__ __volatile__("swap [%1], %0\n\t" : 60 __asm__ __volatile__("swap [%1], %0\n\t" :
60 "=&r" (val), "=&r" (ptr) : 61 "=&r" (val), "=&r" (ptr) :
@@ -90,7 +91,7 @@ void __cpuinit smp4m_callin(void)
90 * to call the scheduler code. 91 * to call the scheduler code.
91 */ 92 */
92 /* Allow master to continue. */ 93 /* Allow master to continue. */
93 swap(&cpu_callin_map[cpuid], 1); 94 swap_ulong(&cpu_callin_map[cpuid], 1);
94 95
95 /* XXX: What's up with all the flushes? */ 96 /* XXX: What's up with all the flushes? */
96 local_flush_cache_all(); 97 local_flush_cache_all();
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 39749e32dc7e..09058fc39e73 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -23,6 +23,7 @@
23#include <linux/ipc.h> 23#include <linux/ipc.h>
24#include <linux/personality.h> 24#include <linux/personality.h>
25#include <linux/random.h> 25#include <linux/random.h>
26#include <linux/module.h>
26 27
27#include <asm/uaccess.h> 28#include <asm/uaccess.h>
28#include <asm/utrap.h> 29#include <asm/utrap.h>
@@ -354,6 +355,7 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, u
354 355
355 return addr; 356 return addr;
356} 357}
358EXPORT_SYMBOL(get_fb_unmapped_area);
357 359
358/* Essentially the same as PowerPC... */ 360/* Essentially the same as PowerPC... */
359void arch_pick_mmap_layout(struct mm_struct *mm) 361void arch_pick_mmap_layout(struct mm_struct *mm)
diff --git a/arch/sparc/kernel/time_32.c b/arch/sparc/kernel/time_32.c
index 00f7383c7657..614ac7b4a9dd 100644
--- a/arch/sparc/kernel/time_32.c
+++ b/arch/sparc/kernel/time_32.c
@@ -48,6 +48,8 @@
48#include "irq.h" 48#include "irq.h"
49 49
50DEFINE_SPINLOCK(rtc_lock); 50DEFINE_SPINLOCK(rtc_lock);
51EXPORT_SYMBOL(rtc_lock);
52
51static int set_rtc_mmss(unsigned long); 53static int set_rtc_mmss(unsigned long);
52static int sbus_do_settimeofday(struct timespec *tv); 54static int sbus_do_settimeofday(struct timespec *tv);
53 55
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 141da3759091..2db3c2229b95 100644
--- a/arch/sparc/kernel/time_64.c
+++ b/arch/sparc/kernel/time_64.c
@@ -106,7 +106,7 @@ static void tick_init_tick(void)
106 tick_disable_irq(); 106 tick_disable_irq();
107} 107}
108 108
109static unsigned long tick_get_tick(void) 109static unsigned long long tick_get_tick(void)
110{ 110{
111 unsigned long ret; 111 unsigned long ret;
112 112
@@ -176,6 +176,7 @@ static struct sparc64_tick_ops tick_operations __read_mostly = {
176}; 176};
177 177
178struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations; 178struct sparc64_tick_ops *tick_ops __read_mostly = &tick_operations;
179EXPORT_SYMBOL(tick_ops);
179 180
180static void stick_disable_irq(void) 181static void stick_disable_irq(void)
181{ 182{
@@ -208,7 +209,7 @@ static void stick_init_tick(void)
208 stick_disable_irq(); 209 stick_disable_irq();
209} 210}
210 211
211static unsigned long stick_get_tick(void) 212static unsigned long long stick_get_tick(void)
212{ 213{
213 unsigned long ret; 214 unsigned long ret;
214 215
@@ -352,7 +353,7 @@ static void hbtick_init_tick(void)
352 hbtick_disable_irq(); 353 hbtick_disable_irq();
353} 354}
354 355
355static unsigned long hbtick_get_tick(void) 356static unsigned long long hbtick_get_tick(void)
356{ 357{
357 return __hbird_read_stick() & ~TICK_PRIV_BIT; 358 return __hbird_read_stick() & ~TICK_PRIV_BIT;
358} 359}
@@ -422,7 +423,7 @@ static int __devinit rtc_probe(struct of_device *op, const struct of_device_id *
422{ 423{
423 struct resource *r; 424 struct resource *r;
424 425
425 printk(KERN_INFO "%s: RTC regs at 0x%lx\n", 426 printk(KERN_INFO "%s: RTC regs at 0x%llx\n",
426 op->node->full_name, op->resource[0].start); 427 op->node->full_name, op->resource[0].start);
427 428
428 /* The CMOS RTC driver only accepts IORESOURCE_IO, so cons 429 /* The CMOS RTC driver only accepts IORESOURCE_IO, so cons
@@ -478,7 +479,7 @@ static struct platform_device rtc_bq4802_device = {
478static int __devinit bq4802_probe(struct of_device *op, const struct of_device_id *match) 479static int __devinit bq4802_probe(struct of_device *op, const struct of_device_id *match)
479{ 480{
480 481
481 printk(KERN_INFO "%s: BQ4802 regs at 0x%lx\n", 482 printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
482 op->node->full_name, op->resource[0].start); 483 op->node->full_name, op->resource[0].start);
483 484
484 rtc_bq4802_device.resource = &op->resource[0]; 485 rtc_bq4802_device.resource = &op->resource[0];
@@ -542,7 +543,7 @@ static int __devinit mostek_probe(struct of_device *op, const struct of_device_i
542 strcmp(dp->parent->parent->name, "central") != 0) 543 strcmp(dp->parent->parent->name, "central") != 0)
543 return -ENODEV; 544 return -ENODEV;
544 545
545 printk(KERN_INFO "%s: Mostek regs at 0x%lx\n", 546 printk(KERN_INFO "%s: Mostek regs at 0x%llx\n",
546 dp->full_name, op->resource[0].start); 547 dp->full_name, op->resource[0].start);
547 548
548 m48t59_rtc.resource = &op->resource[0]; 549 m48t59_rtc.resource = &op->resource[0];
@@ -639,6 +640,7 @@ unsigned long sparc64_get_clock_tick(unsigned int cpu)
639 return ft->clock_tick_ref; 640 return ft->clock_tick_ref;
640 return cpu_data(cpu).clock_tick; 641 return cpu_data(cpu).clock_tick;
641} 642}
643EXPORT_SYMBOL(sparc64_get_clock_tick);
642 644
643#ifdef CONFIG_CPU_FREQ 645#ifdef CONFIG_CPU_FREQ
644 646
@@ -763,7 +765,7 @@ void __devinit setup_sparc64_timer(void)
763 sevt = &__get_cpu_var(sparc64_events); 765 sevt = &__get_cpu_var(sparc64_events);
764 766
765 memcpy(sevt, &sparc64_clockevent, sizeof(*sevt)); 767 memcpy(sevt, &sparc64_clockevent, sizeof(*sevt));
766 sevt->cpumask = cpumask_of_cpu(smp_processor_id()); 768 sevt->cpumask = cpumask_of(smp_processor_id());
767 769
768 clockevents_register_device(sevt); 770 clockevents_register_device(sevt);
769} 771}
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 716f3946c494..358283341b47 100644
--- a/arch/sparc/kernel/traps_32.c
+++ b/arch/sparc/kernel/traps_32.c
@@ -67,7 +67,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
67 __RESTORE; __RESTORE; __RESTORE; __RESTORE; 67 __RESTORE; __RESTORE; __RESTORE; __RESTORE;
68 68
69 { 69 {
70 struct reg_window *rw = (struct reg_window *)regs->u_regs[UREG_FP]; 70 struct reg_window32 *rw = (struct reg_window32 *)regs->u_regs[UREG_FP];
71 71
72 /* Stop the back trace when we hit userland or we 72 /* Stop the back trace when we hit userland or we
73 * find some badly aligned kernel stack. Set an upper 73 * find some badly aligned kernel stack. Set an upper
@@ -79,7 +79,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
79 !(((unsigned long) rw) & 0x7)) { 79 !(((unsigned long) rw) & 0x7)) {
80 printk("Caller[%08lx]: %pS\n", rw->ins[7], 80 printk("Caller[%08lx]: %pS\n", rw->ins[7],
81 (void *) rw->ins[7]); 81 (void *) rw->ins[7]);
82 rw = (struct reg_window *)rw->ins[6]; 82 rw = (struct reg_window32 *)rw->ins[6];
83 } 83 }
84 } 84 }
85 printk("Instruction DUMP:"); 85 printk("Instruction DUMP:");
@@ -424,6 +424,7 @@ void do_BUG(const char *file, int line)
424 // bust_spinlocks(1); XXX Not in our original BUG() 424 // bust_spinlocks(1); XXX Not in our original BUG()
425 printk("kernel BUG at %s:%d!\n", file, line); 425 printk("kernel BUG at %s:%d!\n", file, line);
426} 426}
427EXPORT_SYMBOL(do_BUG);
427#endif 428#endif
428 429
429/* Since we have our mappings set up, on multiprocessors we can spin them 430/* Since we have our mappings set up, on multiprocessors we can spin them
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index 4638af2f55a0..c2d153d46586 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -128,6 +128,7 @@ void do_BUG(const char *file, int line)
128 bust_spinlocks(1); 128 bust_spinlocks(1);
129 printk("kernel BUG at %s:%d!\n", file, line); 129 printk("kernel BUG at %s:%d!\n", file, line);
130} 130}
131EXPORT_SYMBOL(do_BUG);
131#endif 132#endif
132 133
133static DEFINE_SPINLOCK(dimm_handler_lock); 134static DEFINE_SPINLOCK(dimm_handler_lock);
@@ -1168,20 +1169,20 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in
1168 } 1169 }
1169 1170
1170 /* Now dump the cache snapshots. */ 1171 /* Now dump the cache snapshots. */
1171 printk("%s" "ERROR(%d): D-cache idx[%x] tag[%016lx] utag[%016lx] stag[%016lx]\n", 1172 printk("%s" "ERROR(%d): D-cache idx[%x] tag[%016llx] utag[%016llx] stag[%016llx]\n",
1172 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1173 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1173 (int) info->dcache_index, 1174 (int) info->dcache_index,
1174 info->dcache_tag, 1175 info->dcache_tag,
1175 info->dcache_utag, 1176 info->dcache_utag,
1176 info->dcache_stag); 1177 info->dcache_stag);
1177 printk("%s" "ERROR(%d): D-cache data0[%016lx] data1[%016lx] data2[%016lx] data3[%016lx]\n", 1178 printk("%s" "ERROR(%d): D-cache data0[%016llx] data1[%016llx] data2[%016llx] data3[%016llx]\n",
1178 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1179 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1179 info->dcache_data[0], 1180 info->dcache_data[0],
1180 info->dcache_data[1], 1181 info->dcache_data[1],
1181 info->dcache_data[2], 1182 info->dcache_data[2],
1182 info->dcache_data[3]); 1183 info->dcache_data[3]);
1183 printk("%s" "ERROR(%d): I-cache idx[%x] tag[%016lx] utag[%016lx] stag[%016lx] " 1184 printk("%s" "ERROR(%d): I-cache idx[%x] tag[%016llx] utag[%016llx] stag[%016llx] "
1184 "u[%016lx] l[%016lx]\n", 1185 "u[%016llx] l[%016llx]\n",
1185 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1186 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1186 (int) info->icache_index, 1187 (int) info->icache_index,
1187 info->icache_tag, 1188 info->icache_tag,
@@ -1189,22 +1190,22 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in
1189 info->icache_stag, 1190 info->icache_stag,
1190 info->icache_upper, 1191 info->icache_upper,
1191 info->icache_lower); 1192 info->icache_lower);
1192 printk("%s" "ERROR(%d): I-cache INSN0[%016lx] INSN1[%016lx] INSN2[%016lx] INSN3[%016lx]\n", 1193 printk("%s" "ERROR(%d): I-cache INSN0[%016llx] INSN1[%016llx] INSN2[%016llx] INSN3[%016llx]\n",
1193 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1194 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1194 info->icache_data[0], 1195 info->icache_data[0],
1195 info->icache_data[1], 1196 info->icache_data[1],
1196 info->icache_data[2], 1197 info->icache_data[2],
1197 info->icache_data[3]); 1198 info->icache_data[3]);
1198 printk("%s" "ERROR(%d): I-cache INSN4[%016lx] INSN5[%016lx] INSN6[%016lx] INSN7[%016lx]\n", 1199 printk("%s" "ERROR(%d): I-cache INSN4[%016llx] INSN5[%016llx] INSN6[%016llx] INSN7[%016llx]\n",
1199 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1200 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1200 info->icache_data[4], 1201 info->icache_data[4],
1201 info->icache_data[5], 1202 info->icache_data[5],
1202 info->icache_data[6], 1203 info->icache_data[6],
1203 info->icache_data[7]); 1204 info->icache_data[7]);
1204 printk("%s" "ERROR(%d): E-cache idx[%x] tag[%016lx]\n", 1205 printk("%s" "ERROR(%d): E-cache idx[%x] tag[%016llx]\n",
1205 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1206 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1206 (int) info->ecache_index, info->ecache_tag); 1207 (int) info->ecache_index, info->ecache_tag);
1207 printk("%s" "ERROR(%d): E-cache data0[%016lx] data1[%016lx] data2[%016lx] data3[%016lx]\n", 1208 printk("%s" "ERROR(%d): E-cache data0[%016llx] data1[%016llx] data2[%016llx] data3[%016llx]\n",
1208 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1209 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1209 info->ecache_data[0], 1210 info->ecache_data[0],
1210 info->ecache_data[1], 1211 info->ecache_data[1],
@@ -1794,7 +1795,7 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
1794 int cnt; 1795 int cnt;
1795 1796
1796 printk("%s: Reporting on cpu %d\n", pfx, cpu); 1797 printk("%s: Reporting on cpu %d\n", pfx, cpu);
1797 printk("%s: err_handle[%lx] err_stick[%lx] err_type[%08x:%s]\n", 1798 printk("%s: err_handle[%llx] err_stick[%llx] err_type[%08x:%s]\n",
1798 pfx, 1799 pfx,
1799 ent->err_handle, ent->err_stick, 1800 ent->err_handle, ent->err_stick,
1800 ent->err_type, 1801 ent->err_type,
@@ -1818,7 +1819,7 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
1818 "privileged" : ""), 1819 "privileged" : ""),
1819 ((ent->err_attrs & SUN4V_ERR_ATTRS_RES_QUEUE_FULL) ? 1820 ((ent->err_attrs & SUN4V_ERR_ATTRS_RES_QUEUE_FULL) ?
1820 "queue-full" : "")); 1821 "queue-full" : ""));
1821 printk("%s: err_raddr[%016lx] err_size[%u] err_cpu[%u]\n", 1822 printk("%s: err_raddr[%016llx] err_size[%u] err_cpu[%u]\n",
1822 pfx, 1823 pfx,
1823 ent->err_raddr, ent->err_size, ent->err_cpu); 1824 ent->err_raddr, ent->err_size, ent->err_cpu);
1824 1825
@@ -2261,6 +2262,7 @@ void die_if_kernel(char *str, struct pt_regs *regs)
2261 do_exit(SIGKILL); 2262 do_exit(SIGKILL);
2262 do_exit(SIGSEGV); 2263 do_exit(SIGSEGV);
2263} 2264}
2265EXPORT_SYMBOL(die_if_kernel);
2264 2266
2265#define VIS_OPCODE_MASK ((0x3 << 30) | (0x3f << 19)) 2267#define VIS_OPCODE_MASK ((0x3 << 30) | (0x3f << 19))
2266#define VIS_OPCODE_VAL ((0x2 << 30) | (0x36 << 19)) 2268#define VIS_OPCODE_VAL ((0x2 << 30) | (0x36 << 19))
diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c
index c2a28c5ad650..6b1e6cde6fff 100644
--- a/arch/sparc/kernel/unaligned_32.c
+++ b/arch/sparc/kernel/unaligned_32.c
@@ -97,26 +97,26 @@ static inline int sign_extend_imm13(int imm)
97 97
98static inline unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs) 98static inline unsigned long fetch_reg(unsigned int reg, struct pt_regs *regs)
99{ 99{
100 struct reg_window *win; 100 struct reg_window32 *win;
101 101
102 if(reg < 16) 102 if(reg < 16)
103 return (!reg ? 0 : regs->u_regs[reg]); 103 return (!reg ? 0 : regs->u_regs[reg]);
104 104
105 /* Ho hum, the slightly complicated case. */ 105 /* Ho hum, the slightly complicated case. */
106 win = (struct reg_window *) regs->u_regs[UREG_FP]; 106 win = (struct reg_window32 *) regs->u_regs[UREG_FP];
107 return win->locals[reg - 16]; /* yes, I know what this does... */ 107 return win->locals[reg - 16]; /* yes, I know what this does... */
108} 108}
109 109
110static inline unsigned long safe_fetch_reg(unsigned int reg, struct pt_regs *regs) 110static inline unsigned long safe_fetch_reg(unsigned int reg, struct pt_regs *regs)
111{ 111{
112 struct reg_window __user *win; 112 struct reg_window32 __user *win;
113 unsigned long ret; 113 unsigned long ret;
114 114
115 if (reg < 16) 115 if (reg < 16)
116 return (!reg ? 0 : regs->u_regs[reg]); 116 return (!reg ? 0 : regs->u_regs[reg]);
117 117
118 /* Ho hum, the slightly complicated case. */ 118 /* Ho hum, the slightly complicated case. */
119 win = (struct reg_window __user *) regs->u_regs[UREG_FP]; 119 win = (struct reg_window32 __user *) regs->u_regs[UREG_FP];
120 120
121 if ((unsigned long)win & 3) 121 if ((unsigned long)win & 3)
122 return -1; 122 return -1;
@@ -129,11 +129,11 @@ static inline unsigned long safe_fetch_reg(unsigned int reg, struct pt_regs *reg
129 129
130static inline unsigned long *fetch_reg_addr(unsigned int reg, struct pt_regs *regs) 130static inline unsigned long *fetch_reg_addr(unsigned int reg, struct pt_regs *regs)
131{ 131{
132 struct reg_window *win; 132 struct reg_window32 *win;
133 133
134 if(reg < 16) 134 if(reg < 16)
135 return &regs->u_regs[reg]; 135 return &regs->u_regs[reg];
136 win = (struct reg_window *) regs->u_regs[UREG_FP]; 136 win = (struct reg_window32 *) regs->u_regs[UREG_FP];
137 return &win->locals[reg - 16]; 137 return &win->locals[reg - 16];
138} 138}
139 139
diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c
index 203ddfad9f27..379209982a07 100644
--- a/arch/sparc/kernel/unaligned_64.c
+++ b/arch/sparc/kernel/unaligned_64.c
@@ -589,7 +589,6 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
589 unsigned long pc = regs->tpc; 589 unsigned long pc = regs->tpc;
590 unsigned long tstate = regs->tstate; 590 unsigned long tstate = regs->tstate;
591 u32 insn; 591 u32 insn;
592 u32 first, second;
593 u64 value; 592 u64 value;
594 u8 freg; 593 u8 freg;
595 int flag; 594 int flag;
@@ -601,15 +600,20 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
601 pc = (u32)pc; 600 pc = (u32)pc;
602 if (get_user(insn, (u32 __user *) pc) != -EFAULT) { 601 if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
603 int asi = decode_asi(insn, regs); 602 int asi = decode_asi(insn, regs);
603 u32 first, second;
604 int err;
605
604 if ((asi > ASI_SNFL) || 606 if ((asi > ASI_SNFL) ||
605 (asi < ASI_P)) 607 (asi < ASI_P))
606 goto daex; 608 goto daex;
607 if (get_user(first, (u32 __user *)sfar) || 609 first = second = 0;
608 get_user(second, (u32 __user *)(sfar + 4))) { 610 err = get_user(first, (u32 __user *)sfar);
609 if (asi & 0x2) /* NF */ { 611 if (!err)
610 first = 0; second = 0; 612 err = get_user(second, (u32 __user *)(sfar + 4));
611 } else 613 if (err) {
614 if (!(asi & 0x2))
612 goto daex; 615 goto daex;
616 first = second = 0;
613 } 617 }
614 save_and_clear_fpu(); 618 save_and_clear_fpu();
615 freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20); 619 freg = ((insn >> 25) & 0x1e) | ((insn >> 20) & 0x20);
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index 92b1f8ec01de..753d128ed158 100644
--- a/arch/sparc/kernel/vio.c
+++ b/arch/sparc/kernel/vio.c
@@ -263,10 +263,10 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
263 dev_set_name(&vdev->dev, "%s", bus_id_name); 263 dev_set_name(&vdev->dev, "%s", bus_id_name);
264 vdev->dev_no = ~(u64)0; 264 vdev->dev_no = ~(u64)0;
265 } else if (!cfg_handle) { 265 } else if (!cfg_handle) {
266 dev_set_name(&vdev->dev, "%s-%lu", bus_id_name, *id); 266 dev_set_name(&vdev->dev, "%s-%llu", bus_id_name, *id);
267 vdev->dev_no = *id; 267 vdev->dev_no = *id;
268 } else { 268 } else {
269 dev_set_name(&vdev->dev, "%s-%lu-%lu", bus_id_name, 269 dev_set_name(&vdev->dev, "%s-%llu-%llu", bus_id_name,
270 *cfg_handle, *id); 270 *cfg_handle, *id);
271 vdev->dev_no = *cfg_handle; 271 vdev->dev_no = *cfg_handle;
272 } 272 }
diff --git a/arch/sparc/kernel/viohs.c b/arch/sparc/kernel/viohs.c
index 708fa1705fbe..aa6ac70d4fd5 100644
--- a/arch/sparc/kernel/viohs.c
+++ b/arch/sparc/kernel/viohs.c
@@ -337,8 +337,10 @@ static int process_ver_nack(struct vio_driver_state *vio,
337 viodbg(HS, "GOT VERSION NACK maj[%u] min[%u] devclass[%u]\n", 337 viodbg(HS, "GOT VERSION NACK maj[%u] min[%u] devclass[%u]\n",
338 pkt->major, pkt->minor, pkt->dev_class); 338 pkt->major, pkt->minor, pkt->dev_class);
339 339
340 if ((pkt->major == 0 && pkt->minor == 0) || 340 if (pkt->major == 0 && pkt->minor == 0)
341 !(nver = find_by_major(vio, pkt->major))) 341 return handshake_failure(vio);
342 nver = find_by_major(vio, pkt->major);
343 if (!nver)
342 return handshake_failure(vio); 344 return handshake_failure(vio);
343 345
344 if (send_version(vio, nver->major, nver->minor) < 0) 346 if (send_version(vio, nver->major, nver->minor) < 0)
diff --git a/arch/sparc/kernel/windows.c b/arch/sparc/kernel/windows.c
index 9cc93eaa4abf..f24d298bda29 100644
--- a/arch/sparc/kernel/windows.c
+++ b/arch/sparc/kernel/windows.c
@@ -42,7 +42,7 @@ static inline void shift_window_buffer(int first_win, int last_win, struct threa
42 42
43 for(i = first_win; i < last_win; i++) { 43 for(i = first_win; i < last_win; i++) {
44 tp->rwbuf_stkptrs[i] = tp->rwbuf_stkptrs[i+1]; 44 tp->rwbuf_stkptrs[i] = tp->rwbuf_stkptrs[i+1];
45 memcpy(&tp->reg_window[i], &tp->reg_window[i+1], sizeof(struct reg_window)); 45 memcpy(&tp->reg_window[i], &tp->reg_window[i+1], sizeof(struct reg_window32));
46 } 46 }
47} 47}
48 48
@@ -70,7 +70,7 @@ void synchronize_user_stack(void)
70 70
71 /* Ok, let it rip. */ 71 /* Ok, let it rip. */
72 if (copy_to_user((char __user *) sp, &tp->reg_window[window], 72 if (copy_to_user((char __user *) sp, &tp->reg_window[window],
73 sizeof(struct reg_window))) 73 sizeof(struct reg_window32)))
74 continue; 74 continue;
75 75
76 shift_window_buffer(window, tp->w_saved - 1, tp); 76 shift_window_buffer(window, tp->w_saved - 1, tp);
@@ -119,7 +119,7 @@ void try_to_clear_window_buffer(struct pt_regs *regs, int who)
119 119
120 if ((sp & 7) || 120 if ((sp & 7) ||
121 copy_to_user((char __user *) sp, &tp->reg_window[window], 121 copy_to_user((char __user *) sp, &tp->reg_window[window],
122 sizeof(struct reg_window))) 122 sizeof(struct reg_window32)))
123 do_exit(SIGILL); 123 do_exit(SIGILL);
124 } 124 }
125 tp->w_saved = 0; 125 tp->w_saved = 0;
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index 375016e19144..273fc85269fc 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
@@ -42,3 +42,4 @@ lib-$(CONFIG_SPARC64) += mcount.o ipcsum.o xor.o
42 42
43obj-y += iomap.o 43obj-y += iomap.o
44obj-$(CONFIG_SPARC32) += atomic32.o 44obj-$(CONFIG_SPARC32) += atomic32.o
45obj-y += ksyms.o
diff --git a/arch/sparc/lib/PeeCeeI.c b/arch/sparc/lib/PeeCeeI.c
index 46053e6ddd7b..6529f8657597 100644
--- a/arch/sparc/lib/PeeCeeI.c
+++ b/arch/sparc/lib/PeeCeeI.c
@@ -4,6 +4,8 @@
4 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) 4 * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
5 */ 5 */
6 6
7#include <linux/module.h>
8
7#include <asm/io.h> 9#include <asm/io.h>
8#include <asm/byteorder.h> 10#include <asm/byteorder.h>
9 11
@@ -15,6 +17,7 @@ void outsb(unsigned long __addr, const void *src, unsigned long count)
15 while (count--) 17 while (count--)
16 outb(*p++, addr); 18 outb(*p++, addr);
17} 19}
20EXPORT_SYMBOL(outsb);
18 21
19void outsw(unsigned long __addr, const void *src, unsigned long count) 22void outsw(unsigned long __addr, const void *src, unsigned long count)
20{ 23{
@@ -25,6 +28,7 @@ void outsw(unsigned long __addr, const void *src, unsigned long count)
25 src += sizeof(u16); 28 src += sizeof(u16);
26 } 29 }
27} 30}
31EXPORT_SYMBOL(outsw);
28 32
29void outsl(unsigned long __addr, const void *src, unsigned long count) 33void outsl(unsigned long __addr, const void *src, unsigned long count)
30{ 34{
@@ -78,6 +82,7 @@ void outsl(unsigned long __addr, const void *src, unsigned long count)
78 break; 82 break;
79 } 83 }
80} 84}
85EXPORT_SYMBOL(outsl);
81 86
82void insb(unsigned long __addr, void *dst, unsigned long count) 87void insb(unsigned long __addr, void *dst, unsigned long count)
83{ 88{
@@ -105,6 +110,7 @@ void insb(unsigned long __addr, void *dst, unsigned long count)
105 *pb++ = inb(addr); 110 *pb++ = inb(addr);
106 } 111 }
107} 112}
113EXPORT_SYMBOL(insb);
108 114
109void insw(unsigned long __addr, void *dst, unsigned long count) 115void insw(unsigned long __addr, void *dst, unsigned long count)
110{ 116{
@@ -132,6 +138,7 @@ void insw(unsigned long __addr, void *dst, unsigned long count)
132 *ps = le16_to_cpu(inw(addr)); 138 *ps = le16_to_cpu(inw(addr));
133 } 139 }
134} 140}
141EXPORT_SYMBOL(insw);
135 142
136void insl(unsigned long __addr, void *dst, unsigned long count) 143void insl(unsigned long __addr, void *dst, unsigned long count)
137{ 144{
@@ -200,4 +207,5 @@ void insl(unsigned long __addr, void *dst, unsigned long count)
200 } 207 }
201 } 208 }
202} 209}
210EXPORT_SYMBOL(insl);
203 211
diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c
new file mode 100644
index 000000000000..704b12668388
--- /dev/null
+++ b/arch/sparc/lib/ksyms.c
@@ -0,0 +1,196 @@
1/*
2 * Export of symbols defined in assembler
3 */
4
5/* Tell string.h we don't want memcpy etc. as cpp defines */
6#define EXPORT_SYMTAB_STROPS
7
8#include <linux/module.h>
9#include <linux/string.h>
10#include <linux/types.h>
11
12#include <asm/checksum.h>
13#include <asm/uaccess.h>
14#include <asm/ftrace.h>
15
16/* string functions */
17EXPORT_SYMBOL(strlen);
18EXPORT_SYMBOL(__strlen_user);
19EXPORT_SYMBOL(__strnlen_user);
20EXPORT_SYMBOL(strncmp);
21
22/* mem* functions */
23extern void *__memscan_zero(void *, size_t);
24extern void *__memscan_generic(void *, int, size_t);
25extern void *__bzero(void *, size_t);
26
27EXPORT_SYMBOL(memscan);
28EXPORT_SYMBOL(__memscan_zero);
29EXPORT_SYMBOL(__memscan_generic);
30EXPORT_SYMBOL(memcmp);
31EXPORT_SYMBOL(memcpy);
32EXPORT_SYMBOL(memset);
33EXPORT_SYMBOL(__memset);
34EXPORT_SYMBOL(memmove);
35EXPORT_SYMBOL(__bzero);
36
37/* Moving data to/from/in userspace. */
38EXPORT_SYMBOL(__strncpy_from_user);
39
40/* Networking helper routines. */
41EXPORT_SYMBOL(csum_partial);
42
43#ifdef CONFIG_MCOUNT
44EXPORT_SYMBOL(_mcount);
45#endif
46
47/*
48 * sparc
49 */
50#ifdef CONFIG_SPARC32
51extern int __ashrdi3(int, int);
52extern int __ashldi3(int, int);
53extern int __lshrdi3(int, int);
54extern int __muldi3(int, int);
55extern int __divdi3(int, int);
56
57extern void (*__copy_1page)(void *, const void *);
58extern void (*bzero_1page)(void *);
59
60extern int __strncmp(const char *, const char *, __kernel_size_t);
61
62extern void ___rw_read_enter(void);
63extern void ___rw_read_try(void);
64extern void ___rw_read_exit(void);
65extern void ___rw_write_enter(void);
66extern void ___atomic24_add(void);
67extern void ___atomic24_sub(void);
68
69/* Alias functions whose names begin with "." and export the aliases.
70 * The module references will be fixed up by module_frob_arch_sections.
71 */
72extern int _Div(int, int);
73extern int _Mul(int, int);
74extern int _Rem(int, int);
75extern unsigned _Udiv(unsigned, unsigned);
76extern unsigned _Umul(unsigned, unsigned);
77extern unsigned _Urem(unsigned, unsigned);
78
79/* Networking helper routines. */
80EXPORT_SYMBOL(__csum_partial_copy_sparc_generic);
81
82/* Special internal versions of library functions. */
83EXPORT_SYMBOL(__copy_1page);
84EXPORT_SYMBOL(__memcpy);
85EXPORT_SYMBOL(__memmove);
86EXPORT_SYMBOL(bzero_1page);
87
88/* string functions */
89EXPORT_SYMBOL(__strncmp);
90
91/* Moving data to/from/in userspace. */
92EXPORT_SYMBOL(__copy_user);
93
94/* Used by asm/spinlock.h */
95#ifdef CONFIG_SMP
96EXPORT_SYMBOL(___rw_read_enter);
97EXPORT_SYMBOL(___rw_read_try);
98EXPORT_SYMBOL(___rw_read_exit);
99EXPORT_SYMBOL(___rw_write_enter);
100#endif
101
102/* Atomic operations. */
103EXPORT_SYMBOL(___atomic24_add);
104EXPORT_SYMBOL(___atomic24_sub);
105
106EXPORT_SYMBOL(__ashrdi3);
107EXPORT_SYMBOL(__ashldi3);
108EXPORT_SYMBOL(__lshrdi3);
109EXPORT_SYMBOL(__muldi3);
110EXPORT_SYMBOL(__divdi3);
111
112EXPORT_SYMBOL(_Rem);
113EXPORT_SYMBOL(_Urem);
114EXPORT_SYMBOL(_Mul);
115EXPORT_SYMBOL(_Umul);
116EXPORT_SYMBOL(_Div);
117EXPORT_SYMBOL(_Udiv);
118#endif
119
120/*
121 * sparc64
122 */
123#ifdef CONFIG_SPARC64
124/* Networking helper routines. */
125EXPORT_SYMBOL(csum_partial_copy_nocheck);
126EXPORT_SYMBOL(__csum_partial_copy_from_user);
127EXPORT_SYMBOL(__csum_partial_copy_to_user);
128EXPORT_SYMBOL(ip_fast_csum);
129
130/* Moving data to/from/in userspace. */
131EXPORT_SYMBOL(___copy_to_user);
132EXPORT_SYMBOL(___copy_from_user);
133EXPORT_SYMBOL(___copy_in_user);
134EXPORT_SYMBOL(__clear_user);
135
136/* RW semaphores */
137EXPORT_SYMBOL(__down_read);
138EXPORT_SYMBOL(__down_read_trylock);
139EXPORT_SYMBOL(__down_write);
140EXPORT_SYMBOL(__down_write_trylock);
141EXPORT_SYMBOL(__up_read);
142EXPORT_SYMBOL(__up_write);
143EXPORT_SYMBOL(__downgrade_write);
144
145/* Atomic counter implementation. */
146EXPORT_SYMBOL(atomic_add);
147EXPORT_SYMBOL(atomic_add_ret);
148EXPORT_SYMBOL(atomic_sub);
149EXPORT_SYMBOL(atomic_sub_ret);
150EXPORT_SYMBOL(atomic64_add);
151EXPORT_SYMBOL(atomic64_add_ret);
152EXPORT_SYMBOL(atomic64_sub);
153EXPORT_SYMBOL(atomic64_sub_ret);
154
155/* Atomic bit operations. */
156EXPORT_SYMBOL(test_and_set_bit);
157EXPORT_SYMBOL(test_and_clear_bit);
158EXPORT_SYMBOL(test_and_change_bit);
159EXPORT_SYMBOL(set_bit);
160EXPORT_SYMBOL(clear_bit);
161EXPORT_SYMBOL(change_bit);
162
163/* Special internal versions of library functions. */
164EXPORT_SYMBOL(_clear_page);
165EXPORT_SYMBOL(clear_user_page);
166EXPORT_SYMBOL(copy_user_page);
167
168/* RAID code needs this */
169void VISenter(void);
170EXPORT_SYMBOL(VISenter);
171
172extern void xor_vis_2(unsigned long, unsigned long *, unsigned long *);
173extern void xor_vis_3(unsigned long, unsigned long *, unsigned long *,
174 unsigned long *);
175extern void xor_vis_4(unsigned long, unsigned long *, unsigned long *,
176 unsigned long *, unsigned long *);
177extern void xor_vis_5(unsigned long, unsigned long *, unsigned long *,
178 unsigned long *, unsigned long *, unsigned long *);
179EXPORT_SYMBOL(xor_vis_2);
180EXPORT_SYMBOL(xor_vis_3);
181EXPORT_SYMBOL(xor_vis_4);
182EXPORT_SYMBOL(xor_vis_5);
183
184extern void xor_niagara_2(unsigned long, unsigned long *, unsigned long *);
185extern void xor_niagara_3(unsigned long, unsigned long *, unsigned long *,
186 unsigned long *);
187extern void xor_niagara_4(unsigned long, unsigned long *, unsigned long *,
188 unsigned long *, unsigned long *);
189extern void xor_niagara_5(unsigned long, unsigned long *, unsigned long *,
190 unsigned long *, unsigned long *, unsigned long *);
191
192EXPORT_SYMBOL(xor_niagara_2);
193EXPORT_SYMBOL(xor_niagara_3);
194EXPORT_SYMBOL(xor_niagara_4);
195EXPORT_SYMBOL(xor_niagara_5);
196#endif
diff --git a/arch/sparc/lib/user_fixup.c b/arch/sparc/lib/user_fixup.c
index 05a361b0a1a4..ac96ae236709 100644
--- a/arch/sparc/lib/user_fixup.c
+++ b/arch/sparc/lib/user_fixup.c
@@ -7,6 +7,8 @@
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8#include <linux/string.h> 8#include <linux/string.h>
9#include <linux/errno.h> 9#include <linux/errno.h>
10#include <linux/module.h>
11
10#include <asm/uaccess.h> 12#include <asm/uaccess.h>
11 13
12/* Calculating the exact fault address when using 14/* Calculating the exact fault address when using
@@ -40,6 +42,7 @@ unsigned long copy_from_user_fixup(void *to, const void __user *from, unsigned l
40 42
41 return size; 43 return size;
42} 44}
45EXPORT_SYMBOL(copy_from_user_fixup);
43 46
44unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned long size) 47unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned long size)
45{ 48{
@@ -47,6 +50,7 @@ unsigned long copy_to_user_fixup(void __user *to, const void *from, unsigned lon
47 50
48 return compute_size((unsigned long) to, size, &offset); 51 return compute_size((unsigned long) to, size, &offset);
49} 52}
53EXPORT_SYMBOL(copy_to_user_fixup);
50 54
51unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned long size) 55unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned long size)
52{ 56{
@@ -64,3 +68,4 @@ unsigned long copy_in_user_fixup(void __user *to, void __user *from, unsigned lo
64 68
65 return size; 69 return size;
66} 70}
71EXPORT_SYMBOL(copy_in_user_fixup);
diff --git a/arch/sparc/mm/fault_32.c b/arch/sparc/mm/fault_32.c
index a507e1174662..12e447fc8542 100644
--- a/arch/sparc/mm/fault_32.c
+++ b/arch/sparc/mm/fault_32.c
@@ -283,7 +283,8 @@ bad_area_nosemaphore:
283 /* Is this in ex_table? */ 283 /* Is this in ex_table? */
284no_context: 284no_context:
285 g2 = regs->u_regs[UREG_G2]; 285 g2 = regs->u_regs[UREG_G2];
286 if (!from_user && (fixup = search_extables_range(regs->pc, &g2))) { 286 if (!from_user) {
287 fixup = search_extables_range(regs->pc, &g2);
287 if (fixup > 10) { /* Values below are reserved for other things */ 288 if (fixup > 10) { /* Values below are reserved for other things */
288 extern const unsigned __memset_start[]; 289 extern const unsigned __memset_start[];
289 extern const unsigned __memset_end[]; 290 extern const unsigned __memset_end[];
diff --git a/arch/sparc/mm/generic_32.c b/arch/sparc/mm/generic_32.c
index a289261da9fd..5edcac184eaf 100644
--- a/arch/sparc/mm/generic_32.c
+++ b/arch/sparc/mm/generic_32.c
@@ -95,3 +95,4 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
95 flush_tlb_range(vma, beg, end); 95 flush_tlb_range(vma, beg, end);
96 return error; 96 return error;
97} 97}
98EXPORT_SYMBOL(io_remap_pfn_range);
diff --git a/arch/sparc/mm/generic_64.c b/arch/sparc/mm/generic_64.c
index f362c2037013..04f2bf4cd571 100644
--- a/arch/sparc/mm/generic_64.c
+++ b/arch/sparc/mm/generic_64.c
@@ -161,3 +161,4 @@ int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
161 flush_tlb_range(vma, beg, end); 161 flush_tlb_range(vma, beg, end);
162 return error; 162 return error;
163} 163}
164EXPORT_SYMBOL(io_remap_pfn_range);
diff --git a/arch/sparc/mm/highmem.c b/arch/sparc/mm/highmem.c
index 01fc6c254292..752d0c9fb544 100644
--- a/arch/sparc/mm/highmem.c
+++ b/arch/sparc/mm/highmem.c
@@ -62,6 +62,7 @@ void *kmap_atomic(struct page *page, enum km_type type)
62 62
63 return (void*) vaddr; 63 return (void*) vaddr;
64} 64}
65EXPORT_SYMBOL(kmap_atomic);
65 66
66void kunmap_atomic(void *kvaddr, enum km_type type) 67void kunmap_atomic(void *kvaddr, enum km_type type)
67{ 68{
@@ -98,6 +99,7 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
98 99
99 pagefault_enable(); 100 pagefault_enable();
100} 101}
102EXPORT_SYMBOL(kunmap_atomic);
101 103
102/* We may be fed a pagetable here by ptep_to_xxx and others. */ 104/* We may be fed a pagetable here by ptep_to_xxx and others. */
103struct page *kmap_atomic_to_page(void *ptr) 105struct page *kmap_atomic_to_page(void *ptr)
diff --git a/arch/sparc/mm/init_32.c b/arch/sparc/mm/init_32.c
index fec926021f49..cbb282dab5a7 100644
--- a/arch/sparc/mm/init_32.c
+++ b/arch/sparc/mm/init_32.c
@@ -38,11 +38,16 @@
38DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 38DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
39 39
40unsigned long *sparc_valid_addr_bitmap; 40unsigned long *sparc_valid_addr_bitmap;
41EXPORT_SYMBOL(sparc_valid_addr_bitmap);
41 42
42unsigned long phys_base; 43unsigned long phys_base;
44EXPORT_SYMBOL(phys_base);
45
43unsigned long pfn_base; 46unsigned long pfn_base;
47EXPORT_SYMBOL(pfn_base);
44 48
45unsigned long page_kernel; 49unsigned long page_kernel;
50EXPORT_SYMBOL(page_kernel);
46 51
47struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1]; 52struct sparc_phys_banks sp_banks[SPARC_PHYS_BANKS+1];
48unsigned long sparc_unmapped_base; 53unsigned long sparc_unmapped_base;
@@ -522,3 +527,4 @@ void sparc_flush_page_to_ram(struct page *page)
522 if (vaddr) 527 if (vaddr)
523 __flush_page_to_ram(vaddr); 528 __flush_page_to_ram(vaddr);
524} 529}
530EXPORT_SYMBOL(sparc_flush_page_to_ram);
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 6ea73da29312..00373ce2d8fb 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -146,6 +146,7 @@ static void __init read_obp_memory(const char *property,
146} 146}
147 147
148unsigned long *sparc64_valid_addr_bitmap __read_mostly; 148unsigned long *sparc64_valid_addr_bitmap __read_mostly;
149EXPORT_SYMBOL(sparc64_valid_addr_bitmap);
149 150
150/* Kernel physical address base and size in bytes. */ 151/* Kernel physical address base and size in bytes. */
151unsigned long kern_base __read_mostly; 152unsigned long kern_base __read_mostly;
@@ -258,21 +259,16 @@ static inline void tsb_insert(struct tsb *ent, unsigned long tag, unsigned long
258unsigned long _PAGE_ALL_SZ_BITS __read_mostly; 259unsigned long _PAGE_ALL_SZ_BITS __read_mostly;
259unsigned long _PAGE_SZBITS __read_mostly; 260unsigned long _PAGE_SZBITS __read_mostly;
260 261
261void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 262static void flush_dcache(unsigned long pfn)
262{ 263{
263 struct mm_struct *mm; 264 struct page *page;
264 struct tsb *tsb;
265 unsigned long tag, flags;
266 unsigned long tsb_index, tsb_hash_shift;
267 265
268 if (tlb_type != hypervisor) { 266 page = pfn_to_page(pfn);
269 unsigned long pfn = pte_pfn(pte); 267 if (page && page_mapping(page)) {
270 unsigned long pg_flags; 268 unsigned long pg_flags;
271 struct page *page;
272 269
273 if (pfn_valid(pfn) && 270 pg_flags = page->flags;
274 (page = pfn_to_page(pfn), page_mapping(page)) && 271 if (pg_flags & (1UL << PG_dcache_dirty)) {
275 ((pg_flags = page->flags) & (1UL << PG_dcache_dirty))) {
276 int cpu = ((pg_flags >> PG_dcache_cpu_shift) & 272 int cpu = ((pg_flags >> PG_dcache_cpu_shift) &
277 PG_dcache_cpu_mask); 273 PG_dcache_cpu_mask);
278 int this_cpu = get_cpu(); 274 int this_cpu = get_cpu();
@@ -290,6 +286,21 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p
290 put_cpu(); 286 put_cpu();
291 } 287 }
292 } 288 }
289}
290
291void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
292{
293 struct mm_struct *mm;
294 struct tsb *tsb;
295 unsigned long tag, flags;
296 unsigned long tsb_index, tsb_hash_shift;
297
298 if (tlb_type != hypervisor) {
299 unsigned long pfn = pte_pfn(pte);
300
301 if (pfn_valid(pfn))
302 flush_dcache(pfn);
303 }
293 304
294 mm = vma->vm_mm; 305 mm = vma->vm_mm;
295 306
@@ -359,6 +370,7 @@ void flush_dcache_page(struct page *page)
359out: 370out:
360 put_cpu(); 371 put_cpu();
361} 372}
373EXPORT_SYMBOL(flush_dcache_page);
362 374
363void __kprobes flush_icache_range(unsigned long start, unsigned long end) 375void __kprobes flush_icache_range(unsigned long start, unsigned long end)
364{ 376{
@@ -386,6 +398,7 @@ void __kprobes flush_icache_range(unsigned long start, unsigned long end)
386 } 398 }
387 } 399 }
388} 400}
401EXPORT_SYMBOL(flush_icache_range);
389 402
390void mmu_info(struct seq_file *m) 403void mmu_info(struct seq_file *m)
391{ 404{
@@ -589,6 +602,7 @@ void __flush_dcache_range(unsigned long start, unsigned long end)
589 "i" (ASI_DCACHE_INVALIDATE)); 602 "i" (ASI_DCACHE_INVALIDATE));
590 } 603 }
591} 604}
605EXPORT_SYMBOL(__flush_dcache_range);
592 606
593/* get_new_mmu_context() uses "cache + 1". */ 607/* get_new_mmu_context() uses "cache + 1". */
594DEFINE_SPINLOCK(ctx_alloc_lock); 608DEFINE_SPINLOCK(ctx_alloc_lock);
@@ -769,8 +783,8 @@ static int find_node(unsigned long addr)
769 return -1; 783 return -1;
770} 784}
771 785
772static unsigned long nid_range(unsigned long start, unsigned long end, 786static unsigned long long nid_range(unsigned long long start,
773 int *nid) 787 unsigned long long end, int *nid)
774{ 788{
775 *nid = find_node(start); 789 *nid = find_node(start);
776 start += PAGE_SIZE; 790 start += PAGE_SIZE;
@@ -788,8 +802,8 @@ static unsigned long nid_range(unsigned long start, unsigned long end,
788 return start; 802 return start;
789} 803}
790#else 804#else
791static unsigned long nid_range(unsigned long start, unsigned long end, 805static unsigned long long nid_range(unsigned long long start,
792 int *nid) 806 unsigned long long end, int *nid)
793{ 807{
794 *nid = 0; 808 *nid = 0;
795 return end; 809 return end;
@@ -1016,8 +1030,8 @@ static int __init grab_mlgroups(struct mdesc_handle *md)
1016 val = mdesc_get_property(md, node, "address-mask", NULL); 1030 val = mdesc_get_property(md, node, "address-mask", NULL);
1017 m->mask = *val; 1031 m->mask = *val;
1018 1032
1019 numadbg("MLGROUP[%d]: node[%lx] latency[%lx] " 1033 numadbg("MLGROUP[%d]: node[%llx] latency[%llx] "
1020 "match[%lx] mask[%lx]\n", 1034 "match[%llx] mask[%llx]\n",
1021 count - 1, m->node, m->latency, m->match, m->mask); 1035 count - 1, m->node, m->latency, m->match, m->mask);
1022 } 1036 }
1023 1037
@@ -1056,7 +1070,7 @@ static int __init grab_mblocks(struct mdesc_handle *md)
1056 "address-congruence-offset", NULL); 1070 "address-congruence-offset", NULL);
1057 m->offset = *val; 1071 m->offset = *val;
1058 1072
1059 numadbg("MBLOCK[%d]: base[%lx] size[%lx] offset[%lx]\n", 1073 numadbg("MBLOCK[%d]: base[%llx] size[%llx] offset[%llx]\n",
1060 count - 1, m->base, m->size, m->offset); 1074 count - 1, m->base, m->size, m->offset);
1061 } 1075 }
1062 1076
@@ -1127,7 +1141,7 @@ static int __init numa_attach_mlgroup(struct mdesc_handle *md, u64 grp,
1127 n->mask = candidate->mask; 1141 n->mask = candidate->mask;
1128 n->val = candidate->match; 1142 n->val = candidate->match;
1129 1143
1130 numadbg("NUMA NODE[%d]: mask[%lx] val[%lx] (latency[%lx])\n", 1144 numadbg("NUMA NODE[%d]: mask[%lx] val[%lx] (latency[%llx])\n",
1131 index, n->mask, n->val, candidate->latency); 1145 index, n->mask, n->val, candidate->latency);
1132 1146
1133 return 0; 1147 return 0;
diff --git a/arch/sparc/prom/init_32.c b/arch/sparc/prom/init_32.c
index 873217c6d823..6193c33ed4d4 100644
--- a/arch/sparc/prom/init_32.c
+++ b/arch/sparc/prom/init_32.c
@@ -8,16 +8,20 @@
8 8
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/init.h> 10#include <linux/init.h>
11#include <linux/module.h>
11 12
12#include <asm/openprom.h> 13#include <asm/openprom.h>
13#include <asm/oplib.h> 14#include <asm/oplib.h>
14 15
15struct linux_romvec *romvec; 16struct linux_romvec *romvec;
17EXPORT_SYMBOL(romvec);
18
16enum prom_major_version prom_vers; 19enum prom_major_version prom_vers;
17unsigned int prom_rev, prom_prev; 20unsigned int prom_rev, prom_prev;
18 21
19/* The root node of the prom device tree. */ 22/* The root node of the prom device tree. */
20int prom_root_node; 23int prom_root_node;
24EXPORT_SYMBOL(prom_root_node);
21 25
22/* Pointer to the device tree operations structure. */ 26/* Pointer to the device tree operations structure. */
23struct linux_nodeops *prom_nodeops; 27struct linux_nodeops *prom_nodeops;
diff --git a/arch/sparc/prom/misc_32.c b/arch/sparc/prom/misc_32.c
index cf6c3f6d36c3..4d61c540bb3d 100644
--- a/arch/sparc/prom/misc_32.c
+++ b/arch/sparc/prom/misc_32.c
@@ -8,6 +8,8 @@
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/kernel.h> 9#include <linux/kernel.h>
10#include <linux/sched.h> 10#include <linux/sched.h>
11#include <linux/module.h>
12
11#include <asm/openprom.h> 13#include <asm/openprom.h>
12#include <asm/oplib.h> 14#include <asm/oplib.h>
13#include <asm/auxio.h> 15#include <asm/auxio.h>
@@ -44,6 +46,7 @@ prom_feval(char *fstring)
44 restore_current(); 46 restore_current();
45 spin_unlock_irqrestore(&prom_lock, flags); 47 spin_unlock_irqrestore(&prom_lock, flags);
46} 48}
49EXPORT_SYMBOL(prom_feval);
47 50
48/* Drop into the prom, with the chance to continue with the 'go' 51/* Drop into the prom, with the chance to continue with the 'go'
49 * prom command. 52 * prom command.
diff --git a/arch/sparc/prom/misc_64.c b/arch/sparc/prom/misc_64.c
index 9b0c0760901e..eedffb4fec2d 100644
--- a/arch/sparc/prom/misc_64.c
+++ b/arch/sparc/prom/misc_64.c
@@ -11,6 +11,8 @@
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/delay.h> 13#include <linux/delay.h>
14#include <linux/module.h>
15
14#include <asm/openprom.h> 16#include <asm/openprom.h>
15#include <asm/oplib.h> 17#include <asm/oplib.h>
16#include <asm/system.h> 18#include <asm/system.h>
@@ -54,6 +56,7 @@ void prom_feval(const char *fstring)
54 p1275_cmd("interpret", P1275_ARG(0, P1275_ARG_IN_STRING) | 56 p1275_cmd("interpret", P1275_ARG(0, P1275_ARG_IN_STRING) |
55 P1275_INOUT(1, 1), fstring); 57 P1275_INOUT(1, 1), fstring);
56} 58}
59EXPORT_SYMBOL(prom_feval);
57 60
58#ifdef CONFIG_SMP 61#ifdef CONFIG_SMP
59extern void smp_capture(void); 62extern void smp_capture(void);
diff --git a/arch/sparc/prom/ranges.c b/arch/sparc/prom/ranges.c
index 64579a376419..cd5790853ff6 100644
--- a/arch/sparc/prom/ranges.c
+++ b/arch/sparc/prom/ranges.c
@@ -6,6 +6,8 @@
6 */ 6 */
7 7
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/module.h>
10
9#include <asm/openprom.h> 11#include <asm/openprom.h>
10#include <asm/oplib.h> 12#include <asm/oplib.h>
11#include <asm/types.h> 13#include <asm/types.h>
@@ -62,6 +64,7 @@ prom_apply_obio_ranges(struct linux_prom_registers *regs, int nregs)
62 if(num_obio_ranges) 64 if(num_obio_ranges)
63 prom_adjust_regs(regs, nregs, promlib_obio_ranges, num_obio_ranges); 65 prom_adjust_regs(regs, nregs, promlib_obio_ranges, num_obio_ranges);
64} 66}
67EXPORT_SYMBOL(prom_apply_obio_ranges);
65 68
66void __init prom_ranges_init(void) 69void __init prom_ranges_init(void)
67{ 70{
diff --git a/arch/sparc/prom/tree_32.c b/arch/sparc/prom/tree_32.c
index 6d8187357331..646d244b1fdb 100644
--- a/arch/sparc/prom/tree_32.c
+++ b/arch/sparc/prom/tree_32.c
@@ -5,13 +5,12 @@
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
6 */ 6 */
7 7
8#define PROMLIB_INTERNAL
9
10#include <linux/string.h> 8#include <linux/string.h>
11#include <linux/types.h> 9#include <linux/types.h>
12#include <linux/kernel.h> 10#include <linux/kernel.h>
13#include <linux/sched.h> 11#include <linux/sched.h>
14#include <linux/ctype.h> 12#include <linux/ctype.h>
13#include <linux/module.h>
15 14
16#include <asm/openprom.h> 15#include <asm/openprom.h>
17#include <asm/oplib.h> 16#include <asm/oplib.h>
@@ -50,6 +49,7 @@ int prom_getchild(int node)
50 49
51 return cnode; 50 return cnode;
52} 51}
52EXPORT_SYMBOL(prom_getchild);
53 53
54/* Internal version of prom_getsibling that does not alter return values. */ 54/* Internal version of prom_getsibling that does not alter return values. */
55int __prom_getsibling(int node) 55int __prom_getsibling(int node)
@@ -81,6 +81,7 @@ int prom_getsibling(int node)
81 81
82 return sibnode; 82 return sibnode;
83} 83}
84EXPORT_SYMBOL(prom_getsibling);
84 85
85/* Return the length in bytes of property 'prop' at node 'node'. 86/* Return the length in bytes of property 'prop' at node 'node'.
86 * Return -1 on error. 87 * Return -1 on error.
@@ -99,6 +100,7 @@ int prom_getproplen(int node, const char *prop)
99 spin_unlock_irqrestore(&prom_lock, flags); 100 spin_unlock_irqrestore(&prom_lock, flags);
100 return ret; 101 return ret;
101} 102}
103EXPORT_SYMBOL(prom_getproplen);
102 104
103/* Acquire a property 'prop' at node 'node' and place it in 105/* Acquire a property 'prop' at node 'node' and place it in
104 * 'buffer' which has a size of 'bufsize'. If the acquisition 106 * 'buffer' which has a size of 'bufsize'. If the acquisition
@@ -119,6 +121,7 @@ int prom_getproperty(int node, const char *prop, char *buffer, int bufsize)
119 spin_unlock_irqrestore(&prom_lock, flags); 121 spin_unlock_irqrestore(&prom_lock, flags);
120 return ret; 122 return ret;
121} 123}
124EXPORT_SYMBOL(prom_getproperty);
122 125
123/* Acquire an integer property and return its value. Returns -1 126/* Acquire an integer property and return its value. Returns -1
124 * on failure. 127 * on failure.
@@ -132,6 +135,7 @@ int prom_getint(int node, char *prop)
132 135
133 return -1; 136 return -1;
134} 137}
138EXPORT_SYMBOL(prom_getint);
135 139
136/* Acquire an integer property, upon error return the passed default 140/* Acquire an integer property, upon error return the passed default
137 * integer. 141 * integer.
@@ -145,6 +149,7 @@ int prom_getintdefault(int node, char *property, int deflt)
145 149
146 return retval; 150 return retval;
147} 151}
152EXPORT_SYMBOL(prom_getintdefault);
148 153
149/* Acquire a boolean property, 1=TRUE 0=FALSE. */ 154/* Acquire a boolean property, 1=TRUE 0=FALSE. */
150int prom_getbool(int node, char *prop) 155int prom_getbool(int node, char *prop)
@@ -155,6 +160,7 @@ int prom_getbool(int node, char *prop)
155 if(retval == -1) return 0; 160 if(retval == -1) return 0;
156 return 1; 161 return 1;
157} 162}
163EXPORT_SYMBOL(prom_getbool);
158 164
159/* Acquire a property whose value is a string, returns a null 165/* Acquire a property whose value is a string, returns a null
160 * string on error. The char pointer is the user supplied string 166 * string on error. The char pointer is the user supplied string
@@ -169,6 +175,7 @@ void prom_getstring(int node, char *prop, char *user_buf, int ubuf_size)
169 user_buf[0] = 0; 175 user_buf[0] = 0;
170 return; 176 return;
171} 177}
178EXPORT_SYMBOL(prom_getstring);
172 179
173 180
174/* Does the device at node 'node' have name 'name'? 181/* Does the device at node 'node' have name 'name'?
@@ -204,6 +211,7 @@ int prom_searchsiblings(int node_start, char *nodename)
204 211
205 return 0; 212 return 0;
206} 213}
214EXPORT_SYMBOL(prom_searchsiblings);
207 215
208/* Interal version of nextprop that does not alter return values. */ 216/* Interal version of nextprop that does not alter return values. */
209char * __prom_nextprop(int node, char * oprop) 217char * __prom_nextprop(int node, char * oprop)
@@ -228,6 +236,7 @@ char * prom_firstprop(int node, char *bufer)
228 236
229 return __prom_nextprop(node, ""); 237 return __prom_nextprop(node, "");
230} 238}
239EXPORT_SYMBOL(prom_firstprop);
231 240
232/* Return the property type string after property type 'oprop' 241/* Return the property type string after property type 'oprop'
233 * at node 'node' . Returns empty string if no more 242 * at node 'node' . Returns empty string if no more
@@ -240,6 +249,7 @@ char * prom_nextprop(int node, char *oprop, char *buffer)
240 249
241 return __prom_nextprop(node, oprop); 250 return __prom_nextprop(node, oprop);
242} 251}
252EXPORT_SYMBOL(prom_nextprop);
243 253
244int prom_finddevice(char *name) 254int prom_finddevice(char *name)
245{ 255{
@@ -287,6 +297,7 @@ int prom_finddevice(char *name)
287 } 297 }
288 return node; 298 return node;
289} 299}
300EXPORT_SYMBOL(prom_finddevice);
290 301
291int prom_node_has_property(int node, char *prop) 302int prom_node_has_property(int node, char *prop)
292{ 303{
@@ -299,6 +310,7 @@ int prom_node_has_property(int node, char *prop)
299 } while (*current_property); 310 } while (*current_property);
300 return 0; 311 return 0;
301} 312}
313EXPORT_SYMBOL(prom_node_has_property);
302 314
303/* Set property 'pname' at node 'node' to value 'value' which has a length 315/* Set property 'pname' at node 'node' to value 'value' which has a length
304 * of 'size' bytes. Return the number of bytes the prom accepted. 316 * of 'size' bytes. Return the number of bytes the prom accepted.
@@ -316,6 +328,7 @@ int prom_setprop(int node, const char *pname, char *value, int size)
316 spin_unlock_irqrestore(&prom_lock, flags); 328 spin_unlock_irqrestore(&prom_lock, flags);
317 return ret; 329 return ret;
318} 330}
331EXPORT_SYMBOL(prom_setprop);
319 332
320int prom_inst2pkg(int inst) 333int prom_inst2pkg(int inst)
321{ 334{
diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c
index 281aea44790b..8ea73ddc61dc 100644
--- a/arch/sparc/prom/tree_64.c
+++ b/arch/sparc/prom/tree_64.c
@@ -10,6 +10,7 @@
10#include <linux/types.h> 10#include <linux/types.h>
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/sched.h> 12#include <linux/sched.h>
13#include <linux/module.h>
13 14
14#include <asm/openprom.h> 15#include <asm/openprom.h>
15#include <asm/oplib.h> 16#include <asm/oplib.h>
@@ -32,6 +33,7 @@ inline int prom_getchild(int node)
32 if(cnode == -1) return 0; 33 if(cnode == -1) return 0;
33 return (int)cnode; 34 return (int)cnode;
34} 35}
36EXPORT_SYMBOL(prom_getchild);
35 37
36inline int prom_getparent(int node) 38inline int prom_getparent(int node)
37{ 39{
@@ -63,6 +65,7 @@ inline int prom_getsibling(int node)
63 65
64 return sibnode; 66 return sibnode;
65} 67}
68EXPORT_SYMBOL(prom_getsibling);
66 69
67/* Return the length in bytes of property 'prop' at node 'node'. 70/* Return the length in bytes of property 'prop' at node 'node'.
68 * Return -1 on error. 71 * Return -1 on error.
@@ -75,6 +78,7 @@ inline int prom_getproplen(int node, const char *prop)
75 P1275_INOUT(2, 1), 78 P1275_INOUT(2, 1),
76 node, prop); 79 node, prop);
77} 80}
81EXPORT_SYMBOL(prom_getproplen);
78 82
79/* Acquire a property 'prop' at node 'node' and place it in 83/* Acquire a property 'prop' at node 'node' and place it in
80 * 'buffer' which has a size of 'bufsize'. If the acquisition 84 * 'buffer' which has a size of 'bufsize'. If the acquisition
@@ -97,6 +101,7 @@ inline int prom_getproperty(int node, const char *prop,
97 node, prop, buffer, P1275_SIZE(plen)); 101 node, prop, buffer, P1275_SIZE(plen));
98 } 102 }
99} 103}
104EXPORT_SYMBOL(prom_getproperty);
100 105
101/* Acquire an integer property and return its value. Returns -1 106/* Acquire an integer property and return its value. Returns -1
102 * on failure. 107 * on failure.
@@ -110,6 +115,7 @@ inline int prom_getint(int node, const char *prop)
110 115
111 return -1; 116 return -1;
112} 117}
118EXPORT_SYMBOL(prom_getint);
113 119
114/* Acquire an integer property, upon error return the passed default 120/* Acquire an integer property, upon error return the passed default
115 * integer. 121 * integer.
@@ -124,6 +130,7 @@ int prom_getintdefault(int node, const char *property, int deflt)
124 130
125 return retval; 131 return retval;
126} 132}
133EXPORT_SYMBOL(prom_getintdefault);
127 134
128/* Acquire a boolean property, 1=TRUE 0=FALSE. */ 135/* Acquire a boolean property, 1=TRUE 0=FALSE. */
129int prom_getbool(int node, const char *prop) 136int prom_getbool(int node, const char *prop)
@@ -134,6 +141,7 @@ int prom_getbool(int node, const char *prop)
134 if(retval == -1) return 0; 141 if(retval == -1) return 0;
135 return 1; 142 return 1;
136} 143}
144EXPORT_SYMBOL(prom_getbool);
137 145
138/* Acquire a property whose value is a string, returns a null 146/* Acquire a property whose value is a string, returns a null
139 * string on error. The char pointer is the user supplied string 147 * string on error. The char pointer is the user supplied string
@@ -148,7 +156,7 @@ void prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size)
148 user_buf[0] = 0; 156 user_buf[0] = 0;
149 return; 157 return;
150} 158}
151 159EXPORT_SYMBOL(prom_getstring);
152 160
153/* Does the device at node 'node' have name 'name'? 161/* Does the device at node 'node' have name 'name'?
154 * YES = 1 NO = 0 162 * YES = 1 NO = 0
@@ -181,6 +189,7 @@ int prom_searchsiblings(int node_start, const char *nodename)
181 189
182 return 0; 190 return 0;
183} 191}
192EXPORT_SYMBOL(prom_searchsiblings);
184 193
185/* Return the first property type for node 'node'. 194/* Return the first property type for node 'node'.
186 * buffer should be at least 32B in length 195 * buffer should be at least 32B in length
@@ -194,6 +203,7 @@ inline char *prom_firstprop(int node, char *buffer)
194 node, (char *) 0x0, buffer); 203 node, (char *) 0x0, buffer);
195 return buffer; 204 return buffer;
196} 205}
206EXPORT_SYMBOL(prom_firstprop);
197 207
198/* Return the property type string after property type 'oprop' 208/* Return the property type string after property type 'oprop'
199 * at node 'node' . Returns NULL string if no more 209 * at node 'node' . Returns NULL string if no more
@@ -217,6 +227,7 @@ inline char *prom_nextprop(int node, const char *oprop, char *buffer)
217 node, oprop, buffer); 227 node, oprop, buffer);
218 return buffer; 228 return buffer;
219} 229}
230EXPORT_SYMBOL(prom_nextprop);
220 231
221int 232int
222prom_finddevice(const char *name) 233prom_finddevice(const char *name)
@@ -228,6 +239,7 @@ prom_finddevice(const char *name)
228 P1275_INOUT(1, 1), 239 P1275_INOUT(1, 1),
229 name); 240 name);
230} 241}
242EXPORT_SYMBOL(prom_finddevice);
231 243
232int prom_node_has_property(int node, const char *prop) 244int prom_node_has_property(int node, const char *prop)
233{ 245{
@@ -241,7 +253,8 @@ int prom_node_has_property(int node, const char *prop)
241 } while (*buf); 253 } while (*buf);
242 return 0; 254 return 0;
243} 255}
244 256EXPORT_SYMBOL(prom_node_has_property);
257
245/* Set property 'pname' at node 'node' to value 'value' which has a length 258/* Set property 'pname' at node 'node' to value 'value' which has a length
246 * of 'size' bytes. Return the number of bytes the prom accepted. 259 * of 'size' bytes. Return the number of bytes the prom accepted.
247 */ 260 */
@@ -264,6 +277,7 @@ prom_setprop(int node, const char *pname, char *value, int size)
264 P1275_INOUT(4, 1), 277 P1275_INOUT(4, 1),
265 node, pname, value, P1275_SIZE(size)); 278 node, pname, value, P1275_SIZE(size));
266} 279}
280EXPORT_SYMBOL(prom_setprop);
267 281
268inline int prom_inst2pkg(int inst) 282inline int prom_inst2pkg(int inst)
269{ 283{
diff --git a/arch/um/Makefile b/arch/um/Makefile
index d944c343acdb..0728def32234 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -22,10 +22,11 @@ MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas
22 22
23include $(srctree)/$(ARCH_DIR)/Makefile-skas 23include $(srctree)/$(ARCH_DIR)/Makefile-skas
24 24
25ARCH_INCLUDE := -I$(srctree)/$(ARCH_DIR)/include/shared 25SHARED_HEADERS := $(ARCH_DIR)/include/shared
26ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS)
26ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared 27ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared
27ifneq ($(KBUILD_SRC),) 28ifneq ($(KBUILD_SRC),)
28ARCH_INCLUDE += -I$(ARCH_DIR)/include/shared # for two generated files 29ARCH_INCLUDE += -I$(SHARED_HEADERS)
29endif 30endif
30KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH) 31KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)
31 32
@@ -85,8 +86,8 @@ endef
85 86
86KBUILD_KCONFIG := arch/um/Kconfig.$(HEADER_ARCH) 87KBUILD_KCONFIG := arch/um/Kconfig.$(HEADER_ARCH)
87 88
88archprepare: $(ARCH_DIR)/include/shared/user_constants.h 89archprepare: $(SHARED_HEADERS)/user_constants.h
89prepare: $(ARCH_DIR)/include/shared/kern_constants.h 90archprepare: $(SHARED_HEADERS)/kern_constants.h
90 91
91LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static 92LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
92LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib 93LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
@@ -119,17 +120,13 @@ endef
119# When cleaning we don't include .config, so we don't include 120# When cleaning we don't include .config, so we don't include
120# TT or skas makefiles and don't clean skas_ptregs.h. 121# TT or skas makefiles and don't clean skas_ptregs.h.
121CLEAN_FILES += linux x.i gmon.out \ 122CLEAN_FILES += linux x.i gmon.out \
122 $(ARCH_DIR)/include/shared/user_constants.h \ 123 $(SHARED_HEADERS)/user_constants.h \
123 $(ARCH_DIR)/include/shared/kern_constants.h 124 $(SHARED_HEADERS)/kern_constants.h
124 125
125archclean: 126archclean:
126 @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ 127 @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
127 -o -name '*.gcov' \) -type f -print | xargs rm -f 128 -o -name '*.gcov' \) -type f -print | xargs rm -f
128 129
129$(objtree)/$(ARCH_DIR)/include/shared:
130 @echo ' MKDIR $@'
131 $(Q)mkdir -p $@
132
133# Generated files 130# Generated files
134 131
135$(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE 132$(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE
@@ -148,11 +145,11 @@ define filechk_gen-asm-offsets
148 echo ""; ) 145 echo ""; )
149endef 146endef
150 147
151$(ARCH_DIR)/include/shared/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s 148$(SHARED_HEADERS)/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s
152 $(call filechk,gen-asm-offsets) 149 $(call filechk,gen-asm-offsets)
153 150
154$(ARCH_DIR)/include/shared/kern_constants.h: $(objtree)/$(ARCH_DIR)/include/shared 151$(SHARED_HEADERS)/kern_constants.h:
155 @echo ' SYMLINK $@' 152 $(Q)mkdir -p $(dir $@)
156 $(Q)ln -sf ../../../../include/asm/asm-offsets.h $@ 153 $(Q)echo '#include "../../../../include/asm/asm-offsets.h"' >$@
157 154
158export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH 155export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH
diff --git a/arch/um/include/asm/system.h b/arch/um/include/asm/system.h
index ae5f94d6317d..753346e2cdfd 100644
--- a/arch/um/include/asm/system.h
+++ b/arch/um/include/asm/system.h
@@ -11,21 +11,21 @@ extern int get_signals(void);
11extern void block_signals(void); 11extern void block_signals(void);
12extern void unblock_signals(void); 12extern void unblock_signals(void);
13 13
14#define raw_local_save_flags(flags) do { typecheck(unsigned long, flags); \ 14#define local_save_flags(flags) do { typecheck(unsigned long, flags); \
15 (flags) = get_signals(); } while(0) 15 (flags) = get_signals(); } while(0)
16#define raw_local_irq_restore(flags) do { typecheck(unsigned long, flags); \ 16#define local_irq_restore(flags) do { typecheck(unsigned long, flags); \
17 set_signals(flags); } while(0) 17 set_signals(flags); } while(0)
18 18
19#define raw_local_irq_save(flags) do { raw_local_save_flags(flags); \ 19#define local_irq_save(flags) do { local_save_flags(flags); \
20 raw_local_irq_disable(); } while(0) 20 local_irq_disable(); } while(0)
21 21
22#define raw_local_irq_enable() unblock_signals() 22#define local_irq_enable() unblock_signals()
23#define raw_local_irq_disable() block_signals() 23#define local_irq_disable() block_signals()
24 24
25#define irqs_disabled() \ 25#define irqs_disabled() \
26({ \ 26({ \
27 unsigned long flags; \ 27 unsigned long flags; \
28 raw_local_save_flags(flags); \ 28 local_save_flags(flags); \
29 (flags == 0); \ 29 (flags == 0); \
30}) 30})
31 31
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c
index 045772142844..98351c78bc81 100644
--- a/arch/um/kernel/smp.c
+++ b/arch/um/kernel/smp.c
@@ -25,13 +25,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
25#include "irq_user.h" 25#include "irq_user.h"
26#include "os.h" 26#include "os.h"
27 27
28/* CPU online map, set by smp_boot_cpus */
29cpumask_t cpu_online_map = CPU_MASK_NONE;
30cpumask_t cpu_possible_map = CPU_MASK_NONE;
31
32EXPORT_SYMBOL(cpu_online_map);
33EXPORT_SYMBOL(cpu_possible_map);
34
35/* Per CPU bogomips and other parameters 28/* Per CPU bogomips and other parameters
36 * The only piece used here is the ipi pipe, which is set before SMP is 29 * The only piece used here is the ipi pipe, which is set before SMP is
37 * started and never changed. 30 * started and never changed.
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index 47f04f4a3464..b13a87a3ec95 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -50,7 +50,7 @@ static int itimer_next_event(unsigned long delta,
50static struct clock_event_device itimer_clockevent = { 50static struct clock_event_device itimer_clockevent = {
51 .name = "itimer", 51 .name = "itimer",
52 .rating = 250, 52 .rating = 250,
53 .cpumask = CPU_MASK_ALL, 53 .cpumask = cpu_all_mask,
54 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 54 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
55 .set_mode = itimer_set_mode, 55 .set_mode = itimer_set_mode,
56 .set_next_event = itimer_next_event, 56 .set_next_event = itimer_next_event,
diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c
index 44e490419495..7384d8accfe7 100644
--- a/arch/um/kernel/trap.c
+++ b/arch/um/kernel/trap.c
@@ -64,11 +64,10 @@ good_area:
64 64
65 do { 65 do {
66 int fault; 66 int fault;
67survive: 67
68 fault = handle_mm_fault(mm, vma, address, is_write); 68 fault = handle_mm_fault(mm, vma, address, is_write);
69 if (unlikely(fault & VM_FAULT_ERROR)) { 69 if (unlikely(fault & VM_FAULT_ERROR)) {
70 if (fault & VM_FAULT_OOM) { 70 if (fault & VM_FAULT_OOM) {
71 err = -ENOMEM;
72 goto out_of_memory; 71 goto out_of_memory;
73 } else if (fault & VM_FAULT_SIGBUS) { 72 } else if (fault & VM_FAULT_SIGBUS) {
74 err = -EACCES; 73 err = -EACCES;
@@ -104,18 +103,14 @@ out:
104out_nosemaphore: 103out_nosemaphore:
105 return err; 104 return err;
106 105
107/*
108 * We ran out of memory, or some other thing happened to us that made
109 * us unable to handle the page fault gracefully.
110 */
111out_of_memory: 106out_of_memory:
112 if (is_global_init(current)) { 107 /*
113 up_read(&mm->mmap_sem); 108 * We ran out of memory, call the OOM killer, and return the userspace
114 yield(); 109 * (which will retry the fault, or kill us if we got oom-killed).
115 down_read(&mm->mmap_sem); 110 */
116 goto survive; 111 up_read(&mm->mmap_sem);
117 } 112 pagefault_out_of_memory();
118 goto out; 113 return 0;
119} 114}
120 115
121static void bad_segv(struct faultinfo fi, unsigned long ip) 116static void bad_segv(struct faultinfo fi, unsigned long ip)
@@ -214,9 +209,6 @@ unsigned long segv(struct faultinfo fi, unsigned long ip, int is_user,
214 si.si_addr = (void __user *)address; 209 si.si_addr = (void __user *)address;
215 current->thread.arch.faultinfo = fi; 210 current->thread.arch.faultinfo = fi;
216 force_sig_info(SIGBUS, &si, current); 211 force_sig_info(SIGBUS, &si, current);
217 } else if (err == -ENOMEM) {
218 printk(KERN_INFO "VM: killing process %s\n", current->comm);
219 do_exit(SIGKILL);
220 } else { 212 } else {
221 BUG_ON(err != -EFAULT); 213 BUG_ON(err != -EFAULT);
222 si.si_signo = SIGSEGV; 214 si.si_signo = SIGSEGV;
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 0f44add3e0b7..73f7fe8fd4d1 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -27,6 +27,7 @@ config X86
27 select HAVE_IOREMAP_PROT 27 select HAVE_IOREMAP_PROT
28 select HAVE_KPROBES 28 select HAVE_KPROBES
29 select ARCH_WANT_OPTIONAL_GPIOLIB 29 select ARCH_WANT_OPTIONAL_GPIOLIB
30 select ARCH_WANT_FRAME_POINTERS
30 select HAVE_KRETPROBES 31 select HAVE_KRETPROBES
31 select HAVE_FTRACE_MCOUNT_RECORD 32 select HAVE_FTRACE_MCOUNT_RECORD
32 select HAVE_DYNAMIC_FTRACE 33 select HAVE_DYNAMIC_FTRACE
@@ -586,6 +587,16 @@ config AMD_IOMMU
586 your BIOS for an option to enable it or if you have an IVRS ACPI 587 your BIOS for an option to enable it or if you have an IVRS ACPI
587 table. 588 table.
588 589
590config AMD_IOMMU_STATS
591 bool "Export AMD IOMMU statistics to debugfs"
592 depends on AMD_IOMMU
593 select DEBUG_FS
594 help
595 This option enables code in the AMD IOMMU driver to collect various
596 statistics about whats happening in the driver and exports that
597 information to userspace via debugfs.
598 If unsure, say N.
599
589# need this always selected by IOMMU for the VIA workaround 600# need this always selected by IOMMU for the VIA workaround
590config SWIOTLB 601config SWIOTLB
591 def_bool y if X86_64 602 def_bool y if X86_64
@@ -599,21 +610,25 @@ config SWIOTLB
599config IOMMU_HELPER 610config IOMMU_HELPER
600 def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU) 611 def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU)
601 612
613config IOMMU_API
614 def_bool (AMD_IOMMU || DMAR)
615
602config MAXSMP 616config MAXSMP
603 bool "Configure Maximum number of SMP Processors and NUMA Nodes" 617 bool "Configure Maximum number of SMP Processors and NUMA Nodes"
604 depends on X86_64 && SMP && BROKEN 618 depends on X86_64 && SMP && DEBUG_KERNEL && EXPERIMENTAL
619 select CPUMASK_OFFSTACK
605 default n 620 default n
606 help 621 help
607 Configure maximum number of CPUS and NUMA Nodes for this architecture. 622 Configure maximum number of CPUS and NUMA Nodes for this architecture.
608 If unsure, say N. 623 If unsure, say N.
609 624
610config NR_CPUS 625config NR_CPUS
611 int "Maximum number of CPUs (2-512)" if !MAXSMP 626 int "Maximum number of CPUs" if SMP && !MAXSMP
612 range 2 512 627 range 2 512 if SMP && !MAXSMP
613 depends on SMP 628 default "1" if !SMP
614 default "4096" if MAXSMP 629 default "4096" if MAXSMP
615 default "32" if X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000 630 default "32" if SMP && (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000)
616 default "8" 631 default "8" if SMP
617 help 632 help
618 This allows you to specify the maximum number of CPUs which this 633 This allows you to specify the maximum number of CPUs which this
619 kernel will support. The maximum supported value is 512 and the 634 kernel will support. The maximum supported value is 512 and the
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 85a78575956c..8078955845ae 100644
--- a/arch/x86/Kconfig.cpu
+++ b/arch/x86/Kconfig.cpu
@@ -408,7 +408,7 @@ config X86_MINIMUM_CPU_FAMILY
408 408
409config X86_DEBUGCTLMSR 409config X86_DEBUGCTLMSR
410 def_bool y 410 def_bool y
411 depends on !(MK6 || MWINCHIPC6 || MWINCHIP3D || MCYRIXIII || M586MMX || M586TSC || M586 || M486 || M386) 411 depends on !(MK6 || MWINCHIPC6 || MWINCHIP3D || MCYRIXIII || M586MMX || M586TSC || M586 || M486 || M386) && !UML
412 412
413menuconfig PROCESSOR_SELECT 413menuconfig PROCESSOR_SELECT
414 bool "Supported processor vendors" if EMBEDDED 414 bool "Supported processor vendors" if EMBEDDED
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index b195f85526e3..9dabd00e9805 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -24,15 +24,14 @@
24#include <asm/ucontext.h> 24#include <asm/ucontext.h>
25#include <asm/uaccess.h> 25#include <asm/uaccess.h>
26#include <asm/i387.h> 26#include <asm/i387.h>
27#include <asm/ia32.h>
28#include <asm/ptrace.h> 27#include <asm/ptrace.h>
29#include <asm/ia32_unistd.h> 28#include <asm/ia32_unistd.h>
30#include <asm/user32.h> 29#include <asm/user32.h>
31#include <asm/sigcontext32.h> 30#include <asm/sigcontext32.h>
32#include <asm/proto.h> 31#include <asm/proto.h>
33#include <asm/vdso.h> 32#include <asm/vdso.h>
34
35#include <asm/sigframe.h> 33#include <asm/sigframe.h>
34#include <asm/sys_ia32.h>
36 35
37#define DEBUG_SIG 0 36#define DEBUG_SIG 0
38 37
diff --git a/arch/x86/ia32/ipc32.c b/arch/x86/ia32/ipc32.c
index d21991ce606c..29cdcd02ead3 100644
--- a/arch/x86/ia32/ipc32.c
+++ b/arch/x86/ia32/ipc32.c
@@ -8,6 +8,7 @@
8#include <linux/shm.h> 8#include <linux/shm.h>
9#include <linux/ipc.h> 9#include <linux/ipc.h>
10#include <linux/compat.h> 10#include <linux/compat.h>
11#include <asm/sys_ia32.h>
11 12
12asmlinkage long sys32_ipc(u32 call, int first, int second, int third, 13asmlinkage long sys32_ipc(u32 call, int first, int second, int third,
13 compat_uptr_t ptr, u32 fifth) 14 compat_uptr_t ptr, u32 fifth)
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index 2e09dcd3c0a6..6c0d7f6231af 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -44,8 +44,8 @@
44#include <asm/types.h> 44#include <asm/types.h>
45#include <asm/uaccess.h> 45#include <asm/uaccess.h>
46#include <asm/atomic.h> 46#include <asm/atomic.h>
47#include <asm/ia32.h>
48#include <asm/vgtod.h> 47#include <asm/vgtod.h>
48#include <asm/sys_ia32.h>
49 49
50#define AA(__x) ((unsigned long)(__x)) 50#define AA(__x) ((unsigned long)(__x))
51 51
diff --git a/arch/x86/include/asm/Kbuild b/arch/x86/include/asm/Kbuild
index 4a8e80cdcfa5..a9f8a814a1f7 100644
--- a/arch/x86/include/asm/Kbuild
+++ b/arch/x86/include/asm/Kbuild
@@ -22,3 +22,4 @@ unifdef-y += unistd_32.h
22unifdef-y += unistd_64.h 22unifdef-y += unistd_64.h
23unifdef-y += vm86.h 23unifdef-y += vm86.h
24unifdef-y += vsyscall.h 24unifdef-y += vsyscall.h
25unifdef-y += swab.h
diff --git a/arch/x86/include/asm/amd_iommu_types.h b/arch/x86/include/asm/amd_iommu_types.h
index ac302a2fa339..95c8cd9d22b5 100644
--- a/arch/x86/include/asm/amd_iommu_types.h
+++ b/arch/x86/include/asm/amd_iommu_types.h
@@ -190,16 +190,23 @@
190/* FIXME: move this macro to <linux/pci.h> */ 190/* FIXME: move this macro to <linux/pci.h> */
191#define PCI_BUS(x) (((x) >> 8) & 0xff) 191#define PCI_BUS(x) (((x) >> 8) & 0xff)
192 192
193/* Protection domain flags */
194#define PD_DMA_OPS_MASK (1UL << 0) /* domain used for dma_ops */
195#define PD_DEFAULT_MASK (1UL << 1) /* domain is a default dma_ops
196 domain for an IOMMU */
197
193/* 198/*
194 * This structure contains generic data for IOMMU protection domains 199 * This structure contains generic data for IOMMU protection domains
195 * independent of their use. 200 * independent of their use.
196 */ 201 */
197struct protection_domain { 202struct protection_domain {
198 spinlock_t lock; /* mostly used to lock the page table*/ 203 spinlock_t lock; /* mostly used to lock the page table*/
199 u16 id; /* the domain id written to the device table */ 204 u16 id; /* the domain id written to the device table */
200 int mode; /* paging mode (0-6 levels) */ 205 int mode; /* paging mode (0-6 levels) */
201 u64 *pt_root; /* page table root pointer */ 206 u64 *pt_root; /* page table root pointer */
202 void *priv; /* private data */ 207 unsigned long flags; /* flags to find out type of domain */
208 unsigned dev_cnt; /* devices assigned to this domain */
209 void *priv; /* private data */
203}; 210};
204 211
205/* 212/*
@@ -295,7 +302,7 @@ struct amd_iommu {
295 bool int_enabled; 302 bool int_enabled;
296 303
297 /* if one, we need to send a completion wait command */ 304 /* if one, we need to send a completion wait command */
298 int need_sync; 305 bool need_sync;
299 306
300 /* default dma_ops domain for that IOMMU */ 307 /* default dma_ops domain for that IOMMU */
301 struct dma_ops_domain *default_dom; 308 struct dma_ops_domain *default_dom;
@@ -374,7 +381,7 @@ extern struct protection_domain **amd_iommu_pd_table;
374extern unsigned long *amd_iommu_pd_alloc_bitmap; 381extern unsigned long *amd_iommu_pd_alloc_bitmap;
375 382
376/* will be 1 if device isolation is enabled */ 383/* will be 1 if device isolation is enabled */
377extern int amd_iommu_isolate; 384extern bool amd_iommu_isolate;
378 385
379/* 386/*
380 * If true, the addresses will be flushed on unmap time, not when 387 * If true, the addresses will be flushed on unmap time, not when
@@ -382,18 +389,6 @@ extern int amd_iommu_isolate;
382 */ 389 */
383extern bool amd_iommu_unmap_flush; 390extern bool amd_iommu_unmap_flush;
384 391
385/* takes a PCI device id and prints it out in a readable form */
386static inline void print_devid(u16 devid, int nl)
387{
388 int bus = devid >> 8;
389 int dev = devid >> 3 & 0x1f;
390 int fn = devid & 0x07;
391
392 printk("%02x:%02x.%x", bus, dev, fn);
393 if (nl)
394 printk("\n");
395}
396
397/* takes bus and device/function and returns the device id 392/* takes bus and device/function and returns the device id
398 * FIXME: should that be in generic PCI code? */ 393 * FIXME: should that be in generic PCI code? */
399static inline u16 calc_devid(u8 bus, u8 devfn) 394static inline u16 calc_devid(u8 bus, u8 devfn)
@@ -401,4 +396,32 @@ static inline u16 calc_devid(u8 bus, u8 devfn)
401 return (((u16)bus) << 8) | devfn; 396 return (((u16)bus) << 8) | devfn;
402} 397}
403 398
399#ifdef CONFIG_AMD_IOMMU_STATS
400
401struct __iommu_counter {
402 char *name;
403 struct dentry *dent;
404 u64 value;
405};
406
407#define DECLARE_STATS_COUNTER(nm) \
408 static struct __iommu_counter nm = { \
409 .name = #nm, \
410 }
411
412#define INC_STATS_COUNTER(name) name.value += 1
413#define ADD_STATS_COUNTER(name, x) name.value += (x)
414#define SUB_STATS_COUNTER(name, x) name.value -= (x)
415
416#else /* CONFIG_AMD_IOMMU_STATS */
417
418#define DECLARE_STATS_COUNTER(name)
419#define INC_STATS_COUNTER(name)
420#define ADD_STATS_COUNTER(name, x)
421#define SUB_STATS_COUNTER(name, x)
422
423static inline void amd_iommu_stats_init(void) { }
424
425#endif /* CONFIG_AMD_IOMMU_STATS */
426
404#endif /* _ASM_X86_AMD_IOMMU_TYPES_H */ 427#endif /* _ASM_X86_AMD_IOMMU_TYPES_H */
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 25caa0738af5..ab1d51a8855e 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -54,7 +54,6 @@ extern int disable_apic;
54extern int is_vsmp_box(void); 54extern int is_vsmp_box(void);
55extern void xapic_wait_icr_idle(void); 55extern void xapic_wait_icr_idle(void);
56extern u32 safe_xapic_wait_icr_idle(void); 56extern u32 safe_xapic_wait_icr_idle(void);
57extern u64 xapic_icr_read(void);
58extern void xapic_icr_write(u32, u32); 57extern void xapic_icr_write(u32, u32);
59extern int setup_profiling_timer(unsigned int); 58extern int setup_profiling_timer(unsigned int);
60 59
@@ -93,7 +92,7 @@ static inline u32 native_apic_msr_read(u32 reg)
93} 92}
94 93
95#ifndef CONFIG_X86_32 94#ifndef CONFIG_X86_32
96extern int x2apic, x2apic_preenabled; 95extern int x2apic;
97extern void check_x2apic(void); 96extern void check_x2apic(void);
98extern void enable_x2apic(void); 97extern void enable_x2apic(void);
99extern void enable_IR_x2apic(void); 98extern void enable_IR_x2apic(void);
diff --git a/arch/x86/include/asm/atomic_32.h b/arch/x86/include/asm/atomic_32.h
index ad5b9f6ecddf..85b46fba4229 100644
--- a/arch/x86/include/asm/atomic_32.h
+++ b/arch/x86/include/asm/atomic_32.h
@@ -2,6 +2,7 @@
2#define _ASM_X86_ATOMIC_32_H 2#define _ASM_X86_ATOMIC_32_H
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5#include <linux/types.h>
5#include <asm/processor.h> 6#include <asm/processor.h>
6#include <asm/cmpxchg.h> 7#include <asm/cmpxchg.h>
7 8
@@ -10,15 +11,6 @@
10 * resource counting etc.. 11 * resource counting etc..
11 */ 12 */
12 13
13/*
14 * Make sure gcc doesn't try to be clever and move things around
15 * on us. We need to use _exactly_ the address the user gave us,
16 * not some alias that contains the same information.
17 */
18typedef struct {
19 int counter;
20} atomic_t;
21
22#define ATOMIC_INIT(i) { (i) } 14#define ATOMIC_INIT(i) { (i) }
23 15
24/** 16/**
diff --git a/arch/x86/include/asm/atomic_64.h b/arch/x86/include/asm/atomic_64.h
index 279d2a731f3f..8c21731984da 100644
--- a/arch/x86/include/asm/atomic_64.h
+++ b/arch/x86/include/asm/atomic_64.h
@@ -1,25 +1,15 @@
1#ifndef _ASM_X86_ATOMIC_64_H 1#ifndef _ASM_X86_ATOMIC_64_H
2#define _ASM_X86_ATOMIC_64_H 2#define _ASM_X86_ATOMIC_64_H
3 3
4#include <linux/types.h>
4#include <asm/alternative.h> 5#include <asm/alternative.h>
5#include <asm/cmpxchg.h> 6#include <asm/cmpxchg.h>
6 7
7/* atomic_t should be 32 bit signed type */
8
9/* 8/*
10 * Atomic operations that C can't guarantee us. Useful for 9 * Atomic operations that C can't guarantee us. Useful for
11 * resource counting etc.. 10 * resource counting etc..
12 */ 11 */
13 12
14/*
15 * Make sure gcc doesn't try to be clever and move things around
16 * on us. We need to use _exactly_ the address the user gave us,
17 * not some alias that contains the same information.
18 */
19typedef struct {
20 int counter;
21} atomic_t;
22
23#define ATOMIC_INIT(i) { (i) } 13#define ATOMIC_INIT(i) { (i) }
24 14
25/** 15/**
@@ -191,11 +181,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
191#define atomic_inc_return(v) (atomic_add_return(1, v)) 181#define atomic_inc_return(v) (atomic_add_return(1, v))
192#define atomic_dec_return(v) (atomic_sub_return(1, v)) 182#define atomic_dec_return(v) (atomic_sub_return(1, v))
193 183
194/* An 64bit atomic type */ 184/* The 64-bit atomic type */
195
196typedef struct {
197 long counter;
198} atomic64_t;
199 185
200#define ATOMIC64_INIT(i) { (i) } 186#define ATOMIC64_INIT(i) { (i) }
201 187
diff --git a/arch/x86/include/asm/bigsmp/apic.h b/arch/x86/include/asm/bigsmp/apic.h
index ce547f24a1cd..d8dd9f537911 100644
--- a/arch/x86/include/asm/bigsmp/apic.h
+++ b/arch/x86/include/asm/bigsmp/apic.h
@@ -9,12 +9,12 @@ static inline int apic_id_registered(void)
9 return (1); 9 return (1);
10} 10}
11 11
12static inline cpumask_t target_cpus(void) 12static inline const cpumask_t *target_cpus(void)
13{ 13{
14#ifdef CONFIG_SMP 14#ifdef CONFIG_SMP
15 return cpu_online_map; 15 return &cpu_online_map;
16#else 16#else
17 return cpumask_of_cpu(0); 17 return &cpumask_of_cpu(0);
18#endif 18#endif
19} 19}
20 20
@@ -79,7 +79,7 @@ static inline int apicid_to_node(int logical_apicid)
79 79
80static inline int cpu_present_to_apicid(int mps_cpu) 80static inline int cpu_present_to_apicid(int mps_cpu)
81{ 81{
82 if (mps_cpu < NR_CPUS) 82 if (mps_cpu < nr_cpu_ids)
83 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu); 83 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
84 84
85 return BAD_APICID; 85 return BAD_APICID;
@@ -94,7 +94,7 @@ extern u8 cpu_2_logical_apicid[];
94/* Mapping from cpu number to logical apicid */ 94/* Mapping from cpu number to logical apicid */
95static inline int cpu_to_logical_apicid(int cpu) 95static inline int cpu_to_logical_apicid(int cpu)
96{ 96{
97 if (cpu >= NR_CPUS) 97 if (cpu >= nr_cpu_ids)
98 return BAD_APICID; 98 return BAD_APICID;
99 return cpu_physical_id(cpu); 99 return cpu_physical_id(cpu);
100} 100}
@@ -119,16 +119,34 @@ static inline int check_phys_apicid_present(int boot_cpu_physical_apicid)
119} 119}
120 120
121/* As we are using single CPU as destination, pick only one CPU here */ 121/* As we are using single CPU as destination, pick only one CPU here */
122static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) 122static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
123{ 123{
124 int cpu; 124 int cpu;
125 int apicid; 125 int apicid;
126 126
127 cpu = first_cpu(cpumask); 127 cpu = first_cpu(*cpumask);
128 apicid = cpu_to_logical_apicid(cpu); 128 apicid = cpu_to_logical_apicid(cpu);
129 return apicid; 129 return apicid;
130} 130}
131 131
132static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
133 const struct cpumask *andmask)
134{
135 int cpu;
136
137 /*
138 * We're using fixed IRQ delivery, can only return one phys APIC ID.
139 * May as well be the first.
140 */
141 for_each_cpu_and(cpu, cpumask, andmask)
142 if (cpumask_test_cpu(cpu, cpu_online_mask))
143 break;
144 if (cpu < nr_cpu_ids)
145 return cpu_to_logical_apicid(cpu);
146
147 return BAD_APICID;
148}
149
132static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) 150static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
133{ 151{
134 return cpuid_apic >> index_msb; 152 return cpuid_apic >> index_msb;
diff --git a/arch/x86/include/asm/bigsmp/ipi.h b/arch/x86/include/asm/bigsmp/ipi.h
index 9404c535b7ec..27fcd01b3ae6 100644
--- a/arch/x86/include/asm/bigsmp/ipi.h
+++ b/arch/x86/include/asm/bigsmp/ipi.h
@@ -1,25 +1,22 @@
1#ifndef __ASM_MACH_IPI_H 1#ifndef __ASM_MACH_IPI_H
2#define __ASM_MACH_IPI_H 2#define __ASM_MACH_IPI_H
3 3
4void send_IPI_mask_sequence(cpumask_t mask, int vector); 4void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
5void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
5 6
6static inline void send_IPI_mask(cpumask_t mask, int vector) 7static inline void send_IPI_mask(const struct cpumask *mask, int vector)
7{ 8{
8 send_IPI_mask_sequence(mask, vector); 9 send_IPI_mask_sequence(mask, vector);
9} 10}
10 11
11static inline void send_IPI_allbutself(int vector) 12static inline void send_IPI_allbutself(int vector)
12{ 13{
13 cpumask_t mask = cpu_online_map; 14 send_IPI_mask_allbutself(cpu_online_mask, vector);
14 cpu_clear(smp_processor_id(), mask);
15
16 if (!cpus_empty(mask))
17 send_IPI_mask(mask, vector);
18} 15}
19 16
20static inline void send_IPI_all(int vector) 17static inline void send_IPI_all(int vector)
21{ 18{
22 send_IPI_mask(cpu_online_map, vector); 19 send_IPI_mask(cpu_online_mask, vector);
23} 20}
24 21
25#endif /* __ASM_MACH_IPI_H */ 22#endif /* __ASM_MACH_IPI_H */
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 9fa9dcdf344b..e02a359d2aa5 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -300,7 +300,7 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
300 return oldbit; 300 return oldbit;
301} 301}
302 302
303static inline int constant_test_bit(int nr, const volatile unsigned long *addr) 303static inline int constant_test_bit(unsigned int nr, const volatile unsigned long *addr)
304{ 304{
305 return ((1UL << (nr % BITS_PER_LONG)) & 305 return ((1UL << (nr % BITS_PER_LONG)) &
306 (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0; 306 (((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0;
diff --git a/arch/x86/include/asm/byteorder.h b/arch/x86/include/asm/byteorder.h
index f110ad417df3..7c49917e3d9d 100644
--- a/arch/x86/include/asm/byteorder.h
+++ b/arch/x86/include/asm/byteorder.h
@@ -1,65 +1,7 @@
1#ifndef _ASM_X86_BYTEORDER_H 1#ifndef _ASM_X86_BYTEORDER_H
2#define _ASM_X86_BYTEORDER_H 2#define _ASM_X86_BYTEORDER_H
3 3
4#include <asm/types.h> 4#include <asm/swab.h>
5#include <linux/compiler.h> 5#include <linux/byteorder/little_endian.h>
6
7#define __LITTLE_ENDIAN
8
9static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
10{
11#ifdef __i386__
12# ifdef CONFIG_X86_BSWAP
13 asm("bswap %0" : "=r" (val) : "0" (val));
14# else
15 asm("xchgb %b0,%h0\n\t" /* swap lower bytes */
16 "rorl $16,%0\n\t" /* swap words */
17 "xchgb %b0,%h0" /* swap higher bytes */
18 : "=q" (val)
19 : "0" (val));
20# endif
21
22#else /* __i386__ */
23 asm("bswapl %0"
24 : "=r" (val)
25 : "0" (val));
26#endif
27 return val;
28}
29#define __arch_swab32 __arch_swab32
30
31static inline __attribute_const__ __u64 __arch_swab64(__u64 val)
32{
33#ifdef __i386__
34 union {
35 struct {
36 __u32 a;
37 __u32 b;
38 } s;
39 __u64 u;
40 } v;
41 v.u = val;
42# ifdef CONFIG_X86_BSWAP
43 asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
44 : "=r" (v.s.a), "=r" (v.s.b)
45 : "0" (v.s.a), "1" (v.s.b));
46# else
47 v.s.a = __arch_swab32(v.s.a);
48 v.s.b = __arch_swab32(v.s.b);
49 asm("xchgl %0,%1"
50 : "=r" (v.s.a), "=r" (v.s.b)
51 : "0" (v.s.a), "1" (v.s.b));
52# endif
53 return v.u;
54#else /* __i386__ */
55 asm("bswapq %0"
56 : "=r" (val)
57 : "0" (val));
58 return val;
59#endif
60}
61#define __arch_swab64 __arch_swab64
62
63#include <linux/byteorder.h>
64 6
65#endif /* _ASM_X86_BYTEORDER_H */ 7#endif /* _ASM_X86_BYTEORDER_H */
diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
index e6b82b17b072..dc27705f5443 100644
--- a/arch/x86/include/asm/desc.h
+++ b/arch/x86/include/asm/desc.h
@@ -320,16 +320,14 @@ static inline void set_intr_gate(unsigned int n, void *addr)
320 _set_gate(n, GATE_INTERRUPT, addr, 0, 0, __KERNEL_CS); 320 _set_gate(n, GATE_INTERRUPT, addr, 0, 0, __KERNEL_CS);
321} 321}
322 322
323#define SYS_VECTOR_FREE 0
324#define SYS_VECTOR_ALLOCED 1
325
326extern int first_system_vector; 323extern int first_system_vector;
327extern char system_vectors[]; 324/* used_vectors is BITMAP for irq is not managed by percpu vector_irq */
325extern unsigned long used_vectors[];
328 326
329static inline void alloc_system_vector(int vector) 327static inline void alloc_system_vector(int vector)
330{ 328{
331 if (system_vectors[vector] == SYS_VECTOR_FREE) { 329 if (!test_bit(vector, used_vectors)) {
332 system_vectors[vector] = SYS_VECTOR_ALLOCED; 330 set_bit(vector, used_vectors);
333 if (first_system_vector > vector) 331 if (first_system_vector > vector)
334 first_system_vector = vector; 332 first_system_vector = vector;
335 } else 333 } else
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
index a2e545c91c35..ca5ffb2856b6 100644
--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -90,6 +90,7 @@ extern void __iomem *efi_ioremap(unsigned long addr, unsigned long size);
90 90
91#endif /* CONFIG_X86_32 */ 91#endif /* CONFIG_X86_32 */
92 92
93extern int add_efi_memmap;
93extern void efi_reserve_early(void); 94extern void efi_reserve_early(void);
94extern void efi_call_phys_prelog(void); 95extern void efi_call_phys_prelog(void);
95extern void efi_call_phys_epilog(void); 96extern void efi_call_phys_epilog(void);
diff --git a/arch/x86/include/asm/es7000/apic.h b/arch/x86/include/asm/es7000/apic.h
index e24ef876915f..c58b9cc74465 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_ES7000_APIC_H 1#ifndef __ASM_ES7000_APIC_H
2#define __ASM_ES7000_APIC_H 2#define __ASM_ES7000_APIC_H
3 3
4#include <linux/gfp.h>
5
4#define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu) 6#define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu)
5#define esr_disable (1) 7#define esr_disable (1)
6 8
@@ -9,14 +11,14 @@ static inline int apic_id_registered(void)
9 return (1); 11 return (1);
10} 12}
11 13
12static inline cpumask_t target_cpus_cluster(void) 14static inline const cpumask_t *target_cpus_cluster(void)
13{ 15{
14 return CPU_MASK_ALL; 16 return &CPU_MASK_ALL;
15} 17}
16 18
17static inline cpumask_t target_cpus(void) 19static inline const cpumask_t *target_cpus(void)
18{ 20{
19 return cpumask_of_cpu(smp_processor_id()); 21 return &cpumask_of_cpu(smp_processor_id());
20} 22}
21 23
22#define APIC_DFR_VALUE_CLUSTER (APIC_DFR_CLUSTER) 24#define APIC_DFR_VALUE_CLUSTER (APIC_DFR_CLUSTER)
@@ -80,9 +82,10 @@ extern int apic_version [MAX_APICS];
80static inline void setup_apic_routing(void) 82static inline void setup_apic_routing(void)
81{ 83{
82 int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id()); 84 int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id());
83 printk("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n", 85 printk("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n",
84 (apic_version[apic] == 0x14) ? 86 (apic_version[apic] == 0x14) ?
85 "Physical Cluster" : "Logical Cluster", nr_ioapics, cpus_addr(target_cpus())[0]); 87 "Physical Cluster" : "Logical Cluster",
88 nr_ioapics, cpus_addr(*target_cpus())[0]);
86} 89}
87 90
88static inline int multi_timer_check(int apic, int irq) 91static inline int multi_timer_check(int apic, int irq)
@@ -100,7 +103,7 @@ static inline int cpu_present_to_apicid(int mps_cpu)
100{ 103{
101 if (!mps_cpu) 104 if (!mps_cpu)
102 return boot_cpu_physical_apicid; 105 return boot_cpu_physical_apicid;
103 else if (mps_cpu < NR_CPUS) 106 else if (mps_cpu < nr_cpu_ids)
104 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu); 107 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
105 else 108 else
106 return BAD_APICID; 109 return BAD_APICID;
@@ -120,9 +123,9 @@ extern u8 cpu_2_logical_apicid[];
120static inline int cpu_to_logical_apicid(int cpu) 123static inline int cpu_to_logical_apicid(int cpu)
121{ 124{
122#ifdef CONFIG_SMP 125#ifdef CONFIG_SMP
123 if (cpu >= NR_CPUS) 126 if (cpu >= nr_cpu_ids)
124 return BAD_APICID; 127 return BAD_APICID;
125 return (int)cpu_2_logical_apicid[cpu]; 128 return (int)cpu_2_logical_apicid[cpu];
126#else 129#else
127 return logical_smp_processor_id(); 130 return logical_smp_processor_id();
128#endif 131#endif
@@ -146,25 +149,26 @@ static inline int check_phys_apicid_present(int cpu_physical_apicid)
146 return (1); 149 return (1);
147} 150}
148 151
149static inline unsigned int cpu_mask_to_apicid_cluster(cpumask_t cpumask) 152static inline unsigned int
153cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
150{ 154{
151 int num_bits_set; 155 int num_bits_set;
152 int cpus_found = 0; 156 int cpus_found = 0;
153 int cpu; 157 int cpu;
154 int apicid; 158 int apicid;
155 159
156 num_bits_set = cpus_weight(cpumask); 160 num_bits_set = cpumask_weight(cpumask);
157 /* Return id to all */ 161 /* Return id to all */
158 if (num_bits_set == NR_CPUS) 162 if (num_bits_set == nr_cpu_ids)
159 return 0xFF; 163 return 0xFF;
160 /* 164 /*
161 * The cpus in the mask must all be on the apic cluster. If are not 165 * The cpus in the mask must all be on the apic cluster. If are not
162 * on the same apicid cluster return default value of TARGET_CPUS. 166 * on the same apicid cluster return default value of TARGET_CPUS.
163 */ 167 */
164 cpu = first_cpu(cpumask); 168 cpu = cpumask_first(cpumask);
165 apicid = cpu_to_logical_apicid(cpu); 169 apicid = cpu_to_logical_apicid(cpu);
166 while (cpus_found < num_bits_set) { 170 while (cpus_found < num_bits_set) {
167 if (cpu_isset(cpu, cpumask)) { 171 if (cpumask_test_cpu(cpu, cpumask)) {
168 int new_apicid = cpu_to_logical_apicid(cpu); 172 int new_apicid = cpu_to_logical_apicid(cpu);
169 if (apicid_cluster(apicid) != 173 if (apicid_cluster(apicid) !=
170 apicid_cluster(new_apicid)){ 174 apicid_cluster(new_apicid)){
@@ -179,25 +183,25 @@ static inline unsigned int cpu_mask_to_apicid_cluster(cpumask_t cpumask)
179 return apicid; 183 return apicid;
180} 184}
181 185
182static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) 186static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
183{ 187{
184 int num_bits_set; 188 int num_bits_set;
185 int cpus_found = 0; 189 int cpus_found = 0;
186 int cpu; 190 int cpu;
187 int apicid; 191 int apicid;
188 192
189 num_bits_set = cpus_weight(cpumask); 193 num_bits_set = cpus_weight(*cpumask);
190 /* Return id to all */ 194 /* Return id to all */
191 if (num_bits_set == NR_CPUS) 195 if (num_bits_set == nr_cpu_ids)
192 return cpu_to_logical_apicid(0); 196 return cpu_to_logical_apicid(0);
193 /* 197 /*
194 * The cpus in the mask must all be on the apic cluster. If are not 198 * The cpus in the mask must all be on the apic cluster. If are not
195 * on the same apicid cluster return default value of TARGET_CPUS. 199 * on the same apicid cluster return default value of TARGET_CPUS.
196 */ 200 */
197 cpu = first_cpu(cpumask); 201 cpu = first_cpu(*cpumask);
198 apicid = cpu_to_logical_apicid(cpu); 202 apicid = cpu_to_logical_apicid(cpu);
199 while (cpus_found < num_bits_set) { 203 while (cpus_found < num_bits_set) {
200 if (cpu_isset(cpu, cpumask)) { 204 if (cpu_isset(cpu, *cpumask)) {
201 int new_apicid = cpu_to_logical_apicid(cpu); 205 int new_apicid = cpu_to_logical_apicid(cpu);
202 if (apicid_cluster(apicid) != 206 if (apicid_cluster(apicid) !=
203 apicid_cluster(new_apicid)){ 207 apicid_cluster(new_apicid)){
@@ -212,6 +216,24 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
212 return apicid; 216 return apicid;
213} 217}
214 218
219
220static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
221 const struct cpumask *andmask)
222{
223 int apicid = cpu_to_logical_apicid(0);
224 cpumask_var_t cpumask;
225
226 if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
227 return apicid;
228
229 cpumask_and(cpumask, inmask, andmask);
230 cpumask_and(cpumask, cpumask, cpu_online_mask);
231 apicid = cpu_mask_to_apicid(cpumask);
232
233 free_cpumask_var(cpumask);
234 return apicid;
235}
236
215static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) 237static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
216{ 238{
217 return cpuid_apic >> index_msb; 239 return cpuid_apic >> index_msb;
diff --git a/arch/x86/include/asm/es7000/ipi.h b/arch/x86/include/asm/es7000/ipi.h
index 632a955fcc0a..7e8ed24d4b8a 100644
--- a/arch/x86/include/asm/es7000/ipi.h
+++ b/arch/x86/include/asm/es7000/ipi.h
@@ -1,24 +1,22 @@
1#ifndef __ASM_ES7000_IPI_H 1#ifndef __ASM_ES7000_IPI_H
2#define __ASM_ES7000_IPI_H 2#define __ASM_ES7000_IPI_H
3 3
4void send_IPI_mask_sequence(cpumask_t mask, int vector); 4void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
5void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
5 6
6static inline void send_IPI_mask(cpumask_t mask, int vector) 7static inline void send_IPI_mask(const struct cpumask *mask, int vector)
7{ 8{
8 send_IPI_mask_sequence(mask, vector); 9 send_IPI_mask_sequence(mask, vector);
9} 10}
10 11
11static inline void send_IPI_allbutself(int vector) 12static inline void send_IPI_allbutself(int vector)
12{ 13{
13 cpumask_t mask = cpu_online_map; 14 send_IPI_mask_allbutself(cpu_online_mask, vector);
14 cpu_clear(smp_processor_id(), mask);
15 if (!cpus_empty(mask))
16 send_IPI_mask(mask, vector);
17} 15}
18 16
19static inline void send_IPI_all(int vector) 17static inline void send_IPI_all(int vector)
20{ 18{
21 send_IPI_mask(cpu_online_map, vector); 19 send_IPI_mask(cpu_online_mask, vector);
22} 20}
23 21
24#endif /* __ASM_ES7000_IPI_H */ 22#endif /* __ASM_ES7000_IPI_H */
diff --git a/arch/x86/include/asm/es7000/mpparse.h b/arch/x86/include/asm/es7000/mpparse.h
index ed5a3caae141..c1629b090ec2 100644
--- a/arch/x86/include/asm/es7000/mpparse.h
+++ b/arch/x86/include/asm/es7000/mpparse.h
@@ -10,8 +10,7 @@ extern void setup_unisys(void);
10 10
11#ifndef CONFIG_X86_GENERICARCH 11#ifndef CONFIG_X86_GENERICARCH
12extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id); 12extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id);
13extern int mps_oem_check(struct mp_config_table *mpc, char *oem, 13extern int mps_oem_check(struct mpc_table *mpc, char *oem, char *productid);
14 char *productid);
15#endif 14#endif
16 15
17#ifdef CONFIG_ACPI 16#ifdef CONFIG_ACPI
diff --git a/arch/x86/include/asm/genapic_32.h b/arch/x86/include/asm/genapic_32.h
index 0ac17d33a8c7..2c05b737ee22 100644
--- a/arch/x86/include/asm/genapic_32.h
+++ b/arch/x86/include/asm/genapic_32.h
@@ -15,16 +15,16 @@
15 * Copyright 2003 Andi Kleen, SuSE Labs. 15 * Copyright 2003 Andi Kleen, SuSE Labs.
16 */ 16 */
17 17
18struct mpc_config_bus; 18struct mpc_bus;
19struct mp_config_table; 19struct mpc_table;
20struct mpc_config_processor; 20struct mpc_cpu;
21 21
22struct genapic { 22struct genapic {
23 char *name; 23 char *name;
24 int (*probe)(void); 24 int (*probe)(void);
25 25
26 int (*apic_id_registered)(void); 26 int (*apic_id_registered)(void);
27 cpumask_t (*target_cpus)(void); 27 const struct cpumask *(*target_cpus)(void);
28 int int_delivery_mode; 28 int int_delivery_mode;
29 int int_dest_mode; 29 int int_dest_mode;
30 int ESR_DISABLE; 30 int ESR_DISABLE;
@@ -51,18 +51,22 @@ struct genapic {
51 /* When one of the next two hooks returns 1 the genapic 51 /* When one of the next two hooks returns 1 the genapic
52 is switched to this. Essentially they are additional probe 52 is switched to this. Essentially they are additional probe
53 functions. */ 53 functions. */
54 int (*mps_oem_check)(struct mp_config_table *mpc, char *oem, 54 int (*mps_oem_check)(struct mpc_table *mpc, char *oem,
55 char *productid); 55 char *productid);
56 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id); 56 int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id);
57 57
58 unsigned (*get_apic_id)(unsigned long x); 58 unsigned (*get_apic_id)(unsigned long x);
59 unsigned long apic_id_mask; 59 unsigned long apic_id_mask;
60 unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask); 60 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
61 cpumask_t (*vector_allocation_domain)(int cpu); 61 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
62 const struct cpumask *andmask);
63 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
62 64
63#ifdef CONFIG_SMP 65#ifdef CONFIG_SMP
64 /* ipi */ 66 /* ipi */
65 void (*send_IPI_mask)(cpumask_t mask, int vector); 67 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
68 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
69 int vector);
66 void (*send_IPI_allbutself)(int vector); 70 void (*send_IPI_allbutself)(int vector);
67 void (*send_IPI_all)(int vector); 71 void (*send_IPI_all)(int vector);
68#endif 72#endif
@@ -114,6 +118,7 @@ struct genapic {
114 APICFUNC(get_apic_id) \ 118 APICFUNC(get_apic_id) \
115 .apic_id_mask = APIC_ID_MASK, \ 119 .apic_id_mask = APIC_ID_MASK, \
116 APICFUNC(cpu_mask_to_apicid) \ 120 APICFUNC(cpu_mask_to_apicid) \
121 APICFUNC(cpu_mask_to_apicid_and) \
117 APICFUNC(vector_allocation_domain) \ 122 APICFUNC(vector_allocation_domain) \
118 APICFUNC(acpi_madt_oem_check) \ 123 APICFUNC(acpi_madt_oem_check) \
119 IPIFUNC(send_IPI_mask) \ 124 IPIFUNC(send_IPI_mask) \
diff --git a/arch/x86/include/asm/genapic_64.h b/arch/x86/include/asm/genapic_64.h
index 2cae011668b7..adf32fb56aa6 100644
--- a/arch/x86/include/asm/genapic_64.h
+++ b/arch/x86/include/asm/genapic_64.h
@@ -1,6 +1,8 @@
1#ifndef _ASM_X86_GENAPIC_64_H 1#ifndef _ASM_X86_GENAPIC_64_H
2#define _ASM_X86_GENAPIC_64_H 2#define _ASM_X86_GENAPIC_64_H
3 3
4#include <linux/cpumask.h>
5
4/* 6/*
5 * Copyright 2004 James Cleverdon, IBM. 7 * Copyright 2004 James Cleverdon, IBM.
6 * Subject to the GNU Public License, v.2 8 * Subject to the GNU Public License, v.2
@@ -18,16 +20,20 @@ struct genapic {
18 u32 int_delivery_mode; 20 u32 int_delivery_mode;
19 u32 int_dest_mode; 21 u32 int_dest_mode;
20 int (*apic_id_registered)(void); 22 int (*apic_id_registered)(void);
21 cpumask_t (*target_cpus)(void); 23 const struct cpumask *(*target_cpus)(void);
22 cpumask_t (*vector_allocation_domain)(int cpu); 24 void (*vector_allocation_domain)(int cpu, struct cpumask *retmask);
23 void (*init_apic_ldr)(void); 25 void (*init_apic_ldr)(void);
24 /* ipi */ 26 /* ipi */
25 void (*send_IPI_mask)(cpumask_t mask, int vector); 27 void (*send_IPI_mask)(const struct cpumask *mask, int vector);
28 void (*send_IPI_mask_allbutself)(const struct cpumask *mask,
29 int vector);
26 void (*send_IPI_allbutself)(int vector); 30 void (*send_IPI_allbutself)(int vector);
27 void (*send_IPI_all)(int vector); 31 void (*send_IPI_all)(int vector);
28 void (*send_IPI_self)(int vector); 32 void (*send_IPI_self)(int vector);
29 /* */ 33 /* */
30 unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask); 34 unsigned int (*cpu_mask_to_apicid)(const struct cpumask *cpumask);
35 unsigned int (*cpu_mask_to_apicid_and)(const struct cpumask *cpumask,
36 const struct cpumask *andmask);
31 unsigned int (*phys_pkg_id)(int index_msb); 37 unsigned int (*phys_pkg_id)(int index_msb);
32 unsigned int (*get_apic_id)(unsigned long x); 38 unsigned int (*get_apic_id)(unsigned long x);
33 unsigned long (*set_apic_id)(unsigned int id); 39 unsigned long (*set_apic_id)(unsigned int id);
diff --git a/arch/x86/include/asm/ipi.h b/arch/x86/include/asm/ipi.h
index f89dffb28aa9..c745a306f7d3 100644
--- a/arch/x86/include/asm/ipi.h
+++ b/arch/x86/include/asm/ipi.h
@@ -117,7 +117,8 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector,
117 native_apic_mem_write(APIC_ICR, cfg); 117 native_apic_mem_write(APIC_ICR, cfg);
118} 118}
119 119
120static inline void send_IPI_mask_sequence(cpumask_t mask, int vector) 120static inline void send_IPI_mask_sequence(const struct cpumask *mask,
121 int vector)
121{ 122{
122 unsigned long flags; 123 unsigned long flags;
123 unsigned long query_cpu; 124 unsigned long query_cpu;
@@ -128,11 +129,29 @@ static inline void send_IPI_mask_sequence(cpumask_t mask, int vector)
128 * - mbligh 129 * - mbligh
129 */ 130 */
130 local_irq_save(flags); 131 local_irq_save(flags);
131 for_each_cpu_mask_nr(query_cpu, mask) { 132 for_each_cpu(query_cpu, mask) {
132 __send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, query_cpu), 133 __send_IPI_dest_field(per_cpu(x86_cpu_to_apicid, query_cpu),
133 vector, APIC_DEST_PHYSICAL); 134 vector, APIC_DEST_PHYSICAL);
134 } 135 }
135 local_irq_restore(flags); 136 local_irq_restore(flags);
136} 137}
137 138
139static inline void send_IPI_mask_allbutself(const struct cpumask *mask,
140 int vector)
141{
142 unsigned long flags;
143 unsigned int query_cpu;
144 unsigned int this_cpu = smp_processor_id();
145
146 /* See Hack comment above */
147
148 local_irq_save(flags);
149 for_each_cpu(query_cpu, mask)
150 if (query_cpu != this_cpu)
151 __send_IPI_dest_field(
152 per_cpu(x86_cpu_to_apicid, query_cpu),
153 vector, APIC_DEST_PHYSICAL);
154 local_irq_restore(flags);
155}
156
138#endif /* _ASM_X86_IPI_H */ 157#endif /* _ASM_X86_IPI_H */
diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index 28e409fc73f3..592688ed04d3 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -33,7 +33,7 @@ static inline int irq_canonicalize(int irq)
33 33
34#ifdef CONFIG_HOTPLUG_CPU 34#ifdef CONFIG_HOTPLUG_CPU
35#include <linux/cpumask.h> 35#include <linux/cpumask.h>
36extern void fixup_irqs(cpumask_t map); 36extern void fixup_irqs(void);
37#endif 37#endif
38 38
39extern unsigned int do_IRQ(struct pt_regs *regs); 39extern unsigned int do_IRQ(struct pt_regs *regs);
@@ -42,5 +42,6 @@ extern void native_init_IRQ(void);
42 42
43/* Interrupt vector management */ 43/* Interrupt vector management */
44extern DECLARE_BITMAP(used_vectors, NR_VECTORS); 44extern DECLARE_BITMAP(used_vectors, NR_VECTORS);
45extern int vector_used_by_percpu_irq(unsigned int vector);
45 46
46#endif /* _ASM_X86_IRQ_H */ 47#endif /* _ASM_X86_IRQ_H */
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index 8346be87cfa1..730843d1d2fb 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -21,6 +21,7 @@
21 21
22#include <asm/pvclock-abi.h> 22#include <asm/pvclock-abi.h>
23#include <asm/desc.h> 23#include <asm/desc.h>
24#include <asm/mtrr.h>
24 25
25#define KVM_MAX_VCPUS 16 26#define KVM_MAX_VCPUS 16
26#define KVM_MEMORY_SLOTS 32 27#define KVM_MEMORY_SLOTS 32
@@ -86,6 +87,7 @@
86#define KVM_MIN_FREE_MMU_PAGES 5 87#define KVM_MIN_FREE_MMU_PAGES 5
87#define KVM_REFILL_PAGES 25 88#define KVM_REFILL_PAGES 25
88#define KVM_MAX_CPUID_ENTRIES 40 89#define KVM_MAX_CPUID_ENTRIES 40
90#define KVM_NR_FIXED_MTRR_REGION 88
89#define KVM_NR_VAR_MTRR 8 91#define KVM_NR_VAR_MTRR 8
90 92
91extern spinlock_t kvm_lock; 93extern spinlock_t kvm_lock;
@@ -180,6 +182,8 @@ struct kvm_mmu_page {
180 struct list_head link; 182 struct list_head link;
181 struct hlist_node hash_link; 183 struct hlist_node hash_link;
182 184
185 struct list_head oos_link;
186
183 /* 187 /*
184 * The following two entries are used to key the shadow page in the 188 * The following two entries are used to key the shadow page in the
185 * hash table. 189 * hash table.
@@ -190,13 +194,16 @@ struct kvm_mmu_page {
190 u64 *spt; 194 u64 *spt;
191 /* hold the gfn of each spte inside spt */ 195 /* hold the gfn of each spte inside spt */
192 gfn_t *gfns; 196 gfn_t *gfns;
193 unsigned long slot_bitmap; /* One bit set per slot which has memory 197 /*
194 * in this shadow page. 198 * One bit set per slot which has memory
195 */ 199 * in this shadow page.
200 */
201 DECLARE_BITMAP(slot_bitmap, KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS);
196 int multimapped; /* More than one parent_pte? */ 202 int multimapped; /* More than one parent_pte? */
197 int root_count; /* Currently serving as active root */ 203 int root_count; /* Currently serving as active root */
198 bool unsync; 204 bool unsync;
199 bool unsync_children; 205 bool global;
206 unsigned int unsync_children;
200 union { 207 union {
201 u64 *parent_pte; /* !multimapped */ 208 u64 *parent_pte; /* !multimapped */
202 struct hlist_head parent_ptes; /* multimapped, kvm_pte_chain */ 209 struct hlist_head parent_ptes; /* multimapped, kvm_pte_chain */
@@ -327,8 +334,10 @@ struct kvm_vcpu_arch {
327 334
328 bool nmi_pending; 335 bool nmi_pending;
329 bool nmi_injected; 336 bool nmi_injected;
337 bool nmi_window_open;
330 338
331 u64 mtrr[0x100]; 339 struct mtrr_state_type mtrr_state;
340 u32 pat;
332}; 341};
333 342
334struct kvm_mem_alias { 343struct kvm_mem_alias {
@@ -350,11 +359,13 @@ struct kvm_arch{
350 */ 359 */
351 struct list_head active_mmu_pages; 360 struct list_head active_mmu_pages;
352 struct list_head assigned_dev_head; 361 struct list_head assigned_dev_head;
353 struct dmar_domain *intel_iommu_domain; 362 struct list_head oos_global_pages;
363 struct iommu_domain *iommu_domain;
354 struct kvm_pic *vpic; 364 struct kvm_pic *vpic;
355 struct kvm_ioapic *vioapic; 365 struct kvm_ioapic *vioapic;
356 struct kvm_pit *vpit; 366 struct kvm_pit *vpit;
357 struct hlist_head irq_ack_notifier_list; 367 struct hlist_head irq_ack_notifier_list;
368 int vapics_in_nmi_mode;
358 369
359 int round_robin_prev_vcpu; 370 int round_robin_prev_vcpu;
360 unsigned int tss_addr; 371 unsigned int tss_addr;
@@ -378,6 +389,7 @@ struct kvm_vm_stat {
378 u32 mmu_recycled; 389 u32 mmu_recycled;
379 u32 mmu_cache_miss; 390 u32 mmu_cache_miss;
380 u32 mmu_unsync; 391 u32 mmu_unsync;
392 u32 mmu_unsync_global;
381 u32 remote_tlb_flush; 393 u32 remote_tlb_flush;
382 u32 lpages; 394 u32 lpages;
383}; 395};
@@ -397,6 +409,7 @@ struct kvm_vcpu_stat {
397 u32 halt_exits; 409 u32 halt_exits;
398 u32 halt_wakeup; 410 u32 halt_wakeup;
399 u32 request_irq_exits; 411 u32 request_irq_exits;
412 u32 request_nmi_exits;
400 u32 irq_exits; 413 u32 irq_exits;
401 u32 host_state_reload; 414 u32 host_state_reload;
402 u32 efer_reload; 415 u32 efer_reload;
@@ -405,6 +418,7 @@ struct kvm_vcpu_stat {
405 u32 insn_emulation_fail; 418 u32 insn_emulation_fail;
406 u32 hypercalls; 419 u32 hypercalls;
407 u32 irq_injections; 420 u32 irq_injections;
421 u32 nmi_injections;
408}; 422};
409 423
410struct descriptor_table { 424struct descriptor_table {
@@ -477,6 +491,7 @@ struct kvm_x86_ops {
477 491
478 int (*set_tss_addr)(struct kvm *kvm, unsigned int addr); 492 int (*set_tss_addr)(struct kvm *kvm, unsigned int addr);
479 int (*get_tdp_level)(void); 493 int (*get_tdp_level)(void);
494 int (*get_mt_mask_shift)(void);
480}; 495};
481 496
482extern struct kvm_x86_ops *kvm_x86_ops; 497extern struct kvm_x86_ops *kvm_x86_ops;
@@ -490,7 +505,7 @@ int kvm_mmu_setup(struct kvm_vcpu *vcpu);
490void kvm_mmu_set_nonpresent_ptes(u64 trap_pte, u64 notrap_pte); 505void kvm_mmu_set_nonpresent_ptes(u64 trap_pte, u64 notrap_pte);
491void kvm_mmu_set_base_ptes(u64 base_pte); 506void kvm_mmu_set_base_ptes(u64 base_pte);
492void kvm_mmu_set_mask_ptes(u64 user_mask, u64 accessed_mask, 507void kvm_mmu_set_mask_ptes(u64 user_mask, u64 accessed_mask,
493 u64 dirty_mask, u64 nx_mask, u64 x_mask); 508 u64 dirty_mask, u64 nx_mask, u64 x_mask, u64 mt_mask);
494 509
495int kvm_mmu_reset_context(struct kvm_vcpu *vcpu); 510int kvm_mmu_reset_context(struct kvm_vcpu *vcpu);
496void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot); 511void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot);
@@ -587,12 +602,14 @@ unsigned long segment_base(u16 selector);
587 602
588void kvm_mmu_flush_tlb(struct kvm_vcpu *vcpu); 603void kvm_mmu_flush_tlb(struct kvm_vcpu *vcpu);
589void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, 604void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
590 const u8 *new, int bytes); 605 const u8 *new, int bytes,
606 bool guest_initiated);
591int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva); 607int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva);
592void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu); 608void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu);
593int kvm_mmu_load(struct kvm_vcpu *vcpu); 609int kvm_mmu_load(struct kvm_vcpu *vcpu);
594void kvm_mmu_unload(struct kvm_vcpu *vcpu); 610void kvm_mmu_unload(struct kvm_vcpu *vcpu);
595void kvm_mmu_sync_roots(struct kvm_vcpu *vcpu); 611void kvm_mmu_sync_roots(struct kvm_vcpu *vcpu);
612void kvm_mmu_sync_global(struct kvm_vcpu *vcpu);
596 613
597int kvm_emulate_hypercall(struct kvm_vcpu *vcpu); 614int kvm_emulate_hypercall(struct kvm_vcpu *vcpu);
598 615
@@ -607,6 +624,8 @@ void kvm_disable_tdp(void);
607int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); 624int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3);
608int complete_pio(struct kvm_vcpu *vcpu); 625int complete_pio(struct kvm_vcpu *vcpu);
609 626
627struct kvm_memory_slot *gfn_to_memslot_unaliased(struct kvm *kvm, gfn_t gfn);
628
610static inline struct kvm_mmu_page *page_header(hpa_t shadow_page) 629static inline struct kvm_mmu_page *page_header(hpa_t shadow_page)
611{ 630{
612 struct page *page = pfn_to_page(shadow_page >> PAGE_SHIFT); 631 struct page *page = pfn_to_page(shadow_page >> PAGE_SHIFT);
@@ -702,18 +721,6 @@ static inline void kvm_inject_gp(struct kvm_vcpu *vcpu, u32 error_code)
702 kvm_queue_exception_e(vcpu, GP_VECTOR, error_code); 721 kvm_queue_exception_e(vcpu, GP_VECTOR, error_code);
703} 722}
704 723
705#define ASM_VMX_VMCLEAR_RAX ".byte 0x66, 0x0f, 0xc7, 0x30"
706#define ASM_VMX_VMLAUNCH ".byte 0x0f, 0x01, 0xc2"
707#define ASM_VMX_VMRESUME ".byte 0x0f, 0x01, 0xc3"
708#define ASM_VMX_VMPTRLD_RAX ".byte 0x0f, 0xc7, 0x30"
709#define ASM_VMX_VMREAD_RDX_RAX ".byte 0x0f, 0x78, 0xd0"
710#define ASM_VMX_VMWRITE_RAX_RDX ".byte 0x0f, 0x79, 0xd0"
711#define ASM_VMX_VMWRITE_RSP_RDX ".byte 0x0f, 0x79, 0xd4"
712#define ASM_VMX_VMXOFF ".byte 0x0f, 0x01, 0xc4"
713#define ASM_VMX_VMXON_RAX ".byte 0xf3, 0x0f, 0xc7, 0x30"
714#define ASM_VMX_INVEPT ".byte 0x66, 0x0f, 0x38, 0x80, 0x08"
715#define ASM_VMX_INVVPID ".byte 0x66, 0x0f, 0x38, 0x81, 0x08"
716
717#define MSR_IA32_TIME_STAMP_COUNTER 0x010 724#define MSR_IA32_TIME_STAMP_COUNTER 0x010
718 725
719#define TSS_IOPB_BASE_OFFSET 0x66 726#define TSS_IOPB_BASE_OFFSET 0x66
diff --git a/arch/x86/include/asm/kvm_x86_emulate.h b/arch/x86/include/asm/kvm_x86_emulate.h
index 25179a29f208..6a159732881a 100644
--- a/arch/x86/include/asm/kvm_x86_emulate.h
+++ b/arch/x86/include/asm/kvm_x86_emulate.h
@@ -123,6 +123,7 @@ struct decode_cache {
123 u8 ad_bytes; 123 u8 ad_bytes;
124 u8 rex_prefix; 124 u8 rex_prefix;
125 struct operand src; 125 struct operand src;
126 struct operand src2;
126 struct operand dst; 127 struct operand dst;
127 bool has_seg_override; 128 bool has_seg_override;
128 u8 seg_override; 129 u8 seg_override;
@@ -146,22 +147,18 @@ struct x86_emulate_ctxt {
146 /* Register state before/after emulation. */ 147 /* Register state before/after emulation. */
147 struct kvm_vcpu *vcpu; 148 struct kvm_vcpu *vcpu;
148 149
149 /* Linear faulting address (if emulating a page-faulting instruction) */
150 unsigned long eflags; 150 unsigned long eflags;
151
152 /* Emulated execution mode, represented by an X86EMUL_MODE value. */ 151 /* Emulated execution mode, represented by an X86EMUL_MODE value. */
153 int mode; 152 int mode;
154
155 u32 cs_base; 153 u32 cs_base;
156 154
157 /* decode cache */ 155 /* decode cache */
158
159 struct decode_cache decode; 156 struct decode_cache decode;
160}; 157};
161 158
162/* Repeat String Operation Prefix */ 159/* Repeat String Operation Prefix */
163#define REPE_PREFIX 1 160#define REPE_PREFIX 1
164#define REPNE_PREFIX 2 161#define REPNE_PREFIX 2
165 162
166/* Execution mode, passed to the emulator. */ 163/* Execution mode, passed to the emulator. */
167#define X86EMUL_MODE_REAL 0 /* Real mode. */ 164#define X86EMUL_MODE_REAL 0 /* Real mode. */
@@ -170,7 +167,7 @@ struct x86_emulate_ctxt {
170#define X86EMUL_MODE_PROT64 8 /* 64-bit (long) mode. */ 167#define X86EMUL_MODE_PROT64 8 /* 64-bit (long) mode. */
171 168
172/* Host execution mode. */ 169/* Host execution mode. */
173#if defined(__i386__) 170#if defined(CONFIG_X86_32)
174#define X86EMUL_MODE_HOST X86EMUL_MODE_PROT32 171#define X86EMUL_MODE_HOST X86EMUL_MODE_PROT32
175#elif defined(CONFIG_X86_64) 172#elif defined(CONFIG_X86_64)
176#define X86EMUL_MODE_HOST X86EMUL_MODE_PROT64 173#define X86EMUL_MODE_HOST X86EMUL_MODE_PROT64
diff --git a/arch/x86/include/asm/lguest.h b/arch/x86/include/asm/lguest.h
index d28a507cef39..1caf57628b9c 100644
--- a/arch/x86/include/asm/lguest.h
+++ b/arch/x86/include/asm/lguest.h
@@ -15,7 +15,7 @@
15#define SHARED_SWITCHER_PAGES \ 15#define SHARED_SWITCHER_PAGES \
16 DIV_ROUND_UP(end_switcher_text - start_switcher_text, PAGE_SIZE) 16 DIV_ROUND_UP(end_switcher_text - start_switcher_text, PAGE_SIZE)
17/* Pages for switcher itself, then two pages per cpu */ 17/* Pages for switcher itself, then two pages per cpu */
18#define TOTAL_SWITCHER_PAGES (SHARED_SWITCHER_PAGES + 2 * NR_CPUS) 18#define TOTAL_SWITCHER_PAGES (SHARED_SWITCHER_PAGES + 2 * nr_cpu_ids)
19 19
20/* We map at -4M for ease of mapping into the guest (one PTE page). */ 20/* We map at -4M for ease of mapping into the guest (one PTE page). */
21#define SWITCHER_ADDR 0xFFC00000 21#define SWITCHER_ADDR 0xFFC00000
diff --git a/arch/x86/include/asm/mach-default/mach_apic.h b/arch/x86/include/asm/mach-default/mach_apic.h
index 6cb3a467e067..cc09cbbee27e 100644
--- a/arch/x86/include/asm/mach-default/mach_apic.h
+++ b/arch/x86/include/asm/mach-default/mach_apic.h
@@ -8,12 +8,12 @@
8 8
9#define APIC_DFR_VALUE (APIC_DFR_FLAT) 9#define APIC_DFR_VALUE (APIC_DFR_FLAT)
10 10
11static inline cpumask_t target_cpus(void) 11static inline const struct cpumask *target_cpus(void)
12{ 12{
13#ifdef CONFIG_SMP 13#ifdef CONFIG_SMP
14 return cpu_online_map; 14 return cpu_online_mask;
15#else 15#else
16 return cpumask_of_cpu(0); 16 return cpumask_of(0);
17#endif 17#endif
18} 18}
19 19
@@ -28,6 +28,7 @@ static inline cpumask_t target_cpus(void)
28#define apic_id_registered (genapic->apic_id_registered) 28#define apic_id_registered (genapic->apic_id_registered)
29#define init_apic_ldr (genapic->init_apic_ldr) 29#define init_apic_ldr (genapic->init_apic_ldr)
30#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid) 30#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
31#define cpu_mask_to_apicid_and (genapic->cpu_mask_to_apicid_and)
31#define phys_pkg_id (genapic->phys_pkg_id) 32#define phys_pkg_id (genapic->phys_pkg_id)
32#define vector_allocation_domain (genapic->vector_allocation_domain) 33#define vector_allocation_domain (genapic->vector_allocation_domain)
33#define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID))) 34#define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID)))
@@ -61,9 +62,19 @@ static inline int apic_id_registered(void)
61 return physid_isset(read_apic_id(), phys_cpu_present_map); 62 return physid_isset(read_apic_id(), phys_cpu_present_map);
62} 63}
63 64
64static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) 65static inline unsigned int cpu_mask_to_apicid(const struct cpumask *cpumask)
65{ 66{
66 return cpus_addr(cpumask)[0]; 67 return cpumask_bits(cpumask)[0];
68}
69
70static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
71 const struct cpumask *andmask)
72{
73 unsigned long mask1 = cpumask_bits(cpumask)[0];
74 unsigned long mask2 = cpumask_bits(andmask)[0];
75 unsigned long mask3 = cpumask_bits(cpu_online_mask)[0];
76
77 return (unsigned int)(mask1 & mask2 & mask3);
67} 78}
68 79
69static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) 80static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
@@ -88,7 +99,7 @@ static inline int apicid_to_node(int logical_apicid)
88#endif 99#endif
89} 100}
90 101
91static inline cpumask_t vector_allocation_domain(int cpu) 102static inline void vector_allocation_domain(int cpu, struct cpumask *retmask)
92{ 103{
93 /* Careful. Some cpus do not strictly honor the set of cpus 104 /* Careful. Some cpus do not strictly honor the set of cpus
94 * specified in the interrupt destination when using lowest 105 * specified in the interrupt destination when using lowest
@@ -98,8 +109,7 @@ static inline cpumask_t vector_allocation_domain(int cpu)
98 * deliver interrupts to the wrong hyperthread when only one 109 * deliver interrupts to the wrong hyperthread when only one
99 * hyperthread was specified in the interrupt desitination. 110 * hyperthread was specified in the interrupt desitination.
100 */ 111 */
101 cpumask_t domain = { { [0] = APIC_ALL_CPUS, } }; 112 *retmask = (cpumask_t) { { [0] = APIC_ALL_CPUS } };
102 return domain;
103} 113}
104#endif 114#endif
105 115
@@ -131,7 +141,7 @@ static inline int cpu_to_logical_apicid(int cpu)
131 141
132static inline int cpu_present_to_apicid(int mps_cpu) 142static inline int cpu_present_to_apicid(int mps_cpu)
133{ 143{
134 if (mps_cpu < NR_CPUS && cpu_present(mps_cpu)) 144 if (mps_cpu < nr_cpu_ids && cpu_present(mps_cpu))
135 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); 145 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
136 else 146 else
137 return BAD_APICID; 147 return BAD_APICID;
diff --git a/arch/x86/include/asm/mach-default/mach_ipi.h b/arch/x86/include/asm/mach-default/mach_ipi.h
index fabca01ebacf..191312d155da 100644
--- a/arch/x86/include/asm/mach-default/mach_ipi.h
+++ b/arch/x86/include/asm/mach-default/mach_ipi.h
@@ -4,7 +4,8 @@
4/* Avoid include hell */ 4/* Avoid include hell */
5#define NMI_VECTOR 0x02 5#define NMI_VECTOR 0x02
6 6
7void send_IPI_mask_bitmask(cpumask_t mask, int vector); 7void send_IPI_mask_bitmask(const struct cpumask *mask, int vector);
8void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
8void __send_IPI_shortcut(unsigned int shortcut, int vector); 9void __send_IPI_shortcut(unsigned int shortcut, int vector);
9 10
10extern int no_broadcast; 11extern int no_broadcast;
@@ -12,28 +13,27 @@ extern int no_broadcast;
12#ifdef CONFIG_X86_64 13#ifdef CONFIG_X86_64
13#include <asm/genapic.h> 14#include <asm/genapic.h>
14#define send_IPI_mask (genapic->send_IPI_mask) 15#define send_IPI_mask (genapic->send_IPI_mask)
16#define send_IPI_mask_allbutself (genapic->send_IPI_mask_allbutself)
15#else 17#else
16static inline void send_IPI_mask(cpumask_t mask, int vector) 18static inline void send_IPI_mask(const struct cpumask *mask, int vector)
17{ 19{
18 send_IPI_mask_bitmask(mask, vector); 20 send_IPI_mask_bitmask(mask, vector);
19} 21}
22void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
20#endif 23#endif
21 24
22static inline void __local_send_IPI_allbutself(int vector) 25static inline void __local_send_IPI_allbutself(int vector)
23{ 26{
24 if (no_broadcast || vector == NMI_VECTOR) { 27 if (no_broadcast || vector == NMI_VECTOR)
25 cpumask_t mask = cpu_online_map; 28 send_IPI_mask_allbutself(cpu_online_mask, vector);
26 29 else
27 cpu_clear(smp_processor_id(), mask);
28 send_IPI_mask(mask, vector);
29 } else
30 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector); 30 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector);
31} 31}
32 32
33static inline void __local_send_IPI_all(int vector) 33static inline void __local_send_IPI_all(int vector)
34{ 34{
35 if (no_broadcast || vector == NMI_VECTOR) 35 if (no_broadcast || vector == NMI_VECTOR)
36 send_IPI_mask(cpu_online_map, vector); 36 send_IPI_mask(cpu_online_mask, vector);
37 else 37 else
38 __send_IPI_shortcut(APIC_DEST_ALLINC, vector); 38 __send_IPI_shortcut(APIC_DEST_ALLINC, vector);
39} 39}
diff --git a/arch/x86/include/asm/mach-default/mach_mpparse.h b/arch/x86/include/asm/mach-default/mach_mpparse.h
index 8c1ea21238a7..c70a263d68cd 100644
--- a/arch/x86/include/asm/mach-default/mach_mpparse.h
+++ b/arch/x86/include/asm/mach-default/mach_mpparse.h
@@ -1,8 +1,8 @@
1#ifndef _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H 1#ifndef _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H
2#define _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H 2#define _ASM_X86_MACH_DEFAULT_MACH_MPPARSE_H
3 3
4static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, 4static inline int
5 char *productid) 5mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
6{ 6{
7 return 0; 7 return 0;
8} 8}
diff --git a/arch/x86/include/asm/mach-default/mach_wakecpu.h b/arch/x86/include/asm/mach-default/mach_wakecpu.h
index ceb013660146..89897a6a65b9 100644
--- a/arch/x86/include/asm/mach-default/mach_wakecpu.h
+++ b/arch/x86/include/asm/mach-default/mach_wakecpu.h
@@ -24,7 +24,13 @@ static inline void restore_NMI_vector(unsigned short *high, unsigned short *low)
24{ 24{
25} 25}
26 26
27#ifdef CONFIG_SMP
27extern void __inquire_remote_apic(int apicid); 28extern void __inquire_remote_apic(int apicid);
29#else /* CONFIG_SMP */
30static inline void __inquire_remote_apic(int apicid)
31{
32}
33#endif /* CONFIG_SMP */
28 34
29static inline void inquire_remote_apic(int apicid) 35static inline void inquire_remote_apic(int apicid)
30{ 36{
diff --git a/arch/x86/include/asm/mach-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index e430f47df667..48553e958ad5 100644
--- a/arch/x86/include/asm/mach-generic/mach_apic.h
+++ b/arch/x86/include/asm/mach-generic/mach_apic.h
@@ -24,6 +24,7 @@
24#define check_phys_apicid_present (genapic->check_phys_apicid_present) 24#define check_phys_apicid_present (genapic->check_phys_apicid_present)
25#define check_apicid_used (genapic->check_apicid_used) 25#define check_apicid_used (genapic->check_apicid_used)
26#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid) 26#define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid)
27#define cpu_mask_to_apicid_and (genapic->cpu_mask_to_apicid_and)
27#define vector_allocation_domain (genapic->vector_allocation_domain) 28#define vector_allocation_domain (genapic->vector_allocation_domain)
28#define enable_apic_mode (genapic->enable_apic_mode) 29#define enable_apic_mode (genapic->enable_apic_mode)
29#define phys_pkg_id (genapic->phys_pkg_id) 30#define phys_pkg_id (genapic->phys_pkg_id)
diff --git a/arch/x86/include/asm/mach-generic/mach_mpparse.h b/arch/x86/include/asm/mach-generic/mach_mpparse.h
index 048f1d468535..9444ab8dca94 100644
--- a/arch/x86/include/asm/mach-generic/mach_mpparse.h
+++ b/arch/x86/include/asm/mach-generic/mach_mpparse.h
@@ -2,9 +2,8 @@
2#define _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H 2#define _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H
3 3
4 4
5extern int mps_oem_check(struct mp_config_table *mpc, char *oem, 5extern int mps_oem_check(struct mpc_table *, char *, char *);
6 char *productid);
7 6
8extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id); 7extern int acpi_madt_oem_check(char *, char *);
9 8
10#endif /* _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H */ 9#endif /* _ASM_X86_MACH_GENERIC_MACH_MPPARSE_H */
diff --git a/arch/x86/include/asm/mach-generic/mach_mpspec.h b/arch/x86/include/asm/mach-generic/mach_mpspec.h
index bbab5ccfd4fe..3bc407226578 100644
--- a/arch/x86/include/asm/mach-generic/mach_mpspec.h
+++ b/arch/x86/include/asm/mach-generic/mach_mpspec.h
@@ -7,6 +7,6 @@
7/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */ 7/* Maximum 256 PCI busses, plus 1 ISA bus in each of 4 cabinets. */
8#define MAX_MP_BUSSES 260 8#define MAX_MP_BUSSES 260
9 9
10extern void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem, 10extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
11 char *productid); 11
12#endif /* _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H */ 12#endif /* _ASM_X86_MACH_GENERIC_MACH_MPSPEC_H */
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h
index 91885c28f66b..62d14ce3cd00 100644
--- a/arch/x86/include/asm/mpspec.h
+++ b/arch/x86/include/asm/mpspec.h
@@ -6,13 +6,13 @@
6#include <asm/mpspec_def.h> 6#include <asm/mpspec_def.h>
7 7
8extern int apic_version[MAX_APICS]; 8extern int apic_version[MAX_APICS];
9extern int pic_mode;
9 10
10#ifdef CONFIG_X86_32 11#ifdef CONFIG_X86_32
11#include <mach_mpspec.h> 12#include <mach_mpspec.h>
12 13
13extern unsigned int def_to_bigsmp; 14extern unsigned int def_to_bigsmp;
14extern u8 apicid_2_node[]; 15extern u8 apicid_2_node[];
15extern int pic_mode;
16 16
17#ifdef CONFIG_X86_NUMAQ 17#ifdef CONFIG_X86_NUMAQ
18extern int mp_bus_id_to_node[MAX_MP_BUSSES]; 18extern int mp_bus_id_to_node[MAX_MP_BUSSES];
diff --git a/arch/x86/include/asm/mpspec_def.h b/arch/x86/include/asm/mpspec_def.h
index e3ace7d1d35d..59568bc4767f 100644
--- a/arch/x86/include/asm/mpspec_def.h
+++ b/arch/x86/include/asm/mpspec_def.h
@@ -39,17 +39,17 @@ struct intel_mp_floating {
39 39
40#define MPC_SIGNATURE "PCMP" 40#define MPC_SIGNATURE "PCMP"
41 41
42struct mp_config_table { 42struct mpc_table {
43 char mpc_signature[4]; 43 char signature[4];
44 unsigned short mpc_length; /* Size of table */ 44 unsigned short length; /* Size of table */
45 char mpc_spec; /* 0x01 */ 45 char spec; /* 0x01 */
46 char mpc_checksum; 46 char checksum;
47 char mpc_oem[8]; 47 char oem[8];
48 char mpc_productid[12]; 48 char productid[12];
49 unsigned int mpc_oemptr; /* 0 if not present */ 49 unsigned int oemptr; /* 0 if not present */
50 unsigned short mpc_oemsize; /* 0 if not present */ 50 unsigned short oemsize; /* 0 if not present */
51 unsigned short mpc_oemcount; 51 unsigned short oemcount;
52 unsigned int mpc_lapic; /* APIC address */ 52 unsigned int lapic; /* APIC address */
53 unsigned int reserved; 53 unsigned int reserved;
54}; 54};
55 55
@@ -70,20 +70,20 @@ struct mp_config_table {
70#define CPU_MODEL_MASK 0x00F0 70#define CPU_MODEL_MASK 0x00F0
71#define CPU_FAMILY_MASK 0x0F00 71#define CPU_FAMILY_MASK 0x0F00
72 72
73struct mpc_config_processor { 73struct mpc_cpu {
74 unsigned char mpc_type; 74 unsigned char type;
75 unsigned char mpc_apicid; /* Local APIC number */ 75 unsigned char apicid; /* Local APIC number */
76 unsigned char mpc_apicver; /* Its versions */ 76 unsigned char apicver; /* Its versions */
77 unsigned char mpc_cpuflag; 77 unsigned char cpuflag;
78 unsigned int mpc_cpufeature; 78 unsigned int cpufeature;
79 unsigned int mpc_featureflag; /* CPUID feature value */ 79 unsigned int featureflag; /* CPUID feature value */
80 unsigned int mpc_reserved[2]; 80 unsigned int reserved[2];
81}; 81};
82 82
83struct mpc_config_bus { 83struct mpc_bus {
84 unsigned char mpc_type; 84 unsigned char type;
85 unsigned char mpc_busid; 85 unsigned char busid;
86 unsigned char mpc_bustype[6]; 86 unsigned char bustype[6];
87}; 87};
88 88
89/* List of Bus Type string values, Intel MP Spec. */ 89/* List of Bus Type string values, Intel MP Spec. */
@@ -108,22 +108,22 @@ struct mpc_config_bus {
108 108
109#define MPC_APIC_USABLE 0x01 109#define MPC_APIC_USABLE 0x01
110 110
111struct mpc_config_ioapic { 111struct mpc_ioapic {
112 unsigned char mpc_type; 112 unsigned char type;
113 unsigned char mpc_apicid; 113 unsigned char apicid;
114 unsigned char mpc_apicver; 114 unsigned char apicver;
115 unsigned char mpc_flags; 115 unsigned char flags;
116 unsigned int mpc_apicaddr; 116 unsigned int apicaddr;
117}; 117};
118 118
119struct mpc_config_intsrc { 119struct mpc_intsrc {
120 unsigned char mpc_type; 120 unsigned char type;
121 unsigned char mpc_irqtype; 121 unsigned char irqtype;
122 unsigned short mpc_irqflag; 122 unsigned short irqflag;
123 unsigned char mpc_srcbus; 123 unsigned char srcbus;
124 unsigned char mpc_srcbusirq; 124 unsigned char srcbusirq;
125 unsigned char mpc_dstapic; 125 unsigned char dstapic;
126 unsigned char mpc_dstirq; 126 unsigned char dstirq;
127}; 127};
128 128
129enum mp_irq_source_types { 129enum mp_irq_source_types {
@@ -139,24 +139,24 @@ enum mp_irq_source_types {
139 139
140#define MP_APIC_ALL 0xFF 140#define MP_APIC_ALL 0xFF
141 141
142struct mpc_config_lintsrc { 142struct mpc_lintsrc {
143 unsigned char mpc_type; 143 unsigned char type;
144 unsigned char mpc_irqtype; 144 unsigned char irqtype;
145 unsigned short mpc_irqflag; 145 unsigned short irqflag;
146 unsigned char mpc_srcbusid; 146 unsigned char srcbusid;
147 unsigned char mpc_srcbusirq; 147 unsigned char srcbusirq;
148 unsigned char mpc_destapic; 148 unsigned char destapic;
149 unsigned char mpc_destapiclint; 149 unsigned char destapiclint;
150}; 150};
151 151
152#define MPC_OEM_SIGNATURE "_OEM" 152#define MPC_OEM_SIGNATURE "_OEM"
153 153
154struct mp_config_oemtable { 154struct mpc_oemtable {
155 char oem_signature[4]; 155 char signature[4];
156 unsigned short oem_length; /* Size of table */ 156 unsigned short length; /* Size of table */
157 char oem_rev; /* 0x01 */ 157 char rev; /* 0x01 */
158 char oem_checksum; 158 char checksum;
159 char mpc_oem[8]; 159 char mpc[8];
160}; 160};
161 161
162/* 162/*
diff --git a/arch/x86/include/asm/mtrr.h b/arch/x86/include/asm/mtrr.h
index 7c1e4258b31e..14080d22edb3 100644
--- a/arch/x86/include/asm/mtrr.h
+++ b/arch/x86/include/asm/mtrr.h
@@ -57,6 +57,31 @@ struct mtrr_gentry {
57}; 57};
58#endif /* !__i386__ */ 58#endif /* !__i386__ */
59 59
60struct mtrr_var_range {
61 __u32 base_lo;
62 __u32 base_hi;
63 __u32 mask_lo;
64 __u32 mask_hi;
65};
66
67/* In the Intel processor's MTRR interface, the MTRR type is always held in
68 an 8 bit field: */
69typedef __u8 mtrr_type;
70
71#define MTRR_NUM_FIXED_RANGES 88
72#define MTRR_MAX_VAR_RANGES 256
73
74struct mtrr_state_type {
75 struct mtrr_var_range var_ranges[MTRR_MAX_VAR_RANGES];
76 mtrr_type fixed_ranges[MTRR_NUM_FIXED_RANGES];
77 unsigned char enabled;
78 unsigned char have_fixed;
79 mtrr_type def_type;
80};
81
82#define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
83#define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
84
60/* These are the various ioctls */ 85/* These are the various ioctls */
61#define MTRRIOC_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry) 86#define MTRRIOC_ADD_ENTRY _IOW(MTRR_IOCTL_BASE, 0, struct mtrr_sentry)
62#define MTRRIOC_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry) 87#define MTRRIOC_SET_ENTRY _IOW(MTRR_IOCTL_BASE, 1, struct mtrr_sentry)
diff --git a/arch/x86/include/asm/numaq/apic.h b/arch/x86/include/asm/numaq/apic.h
index 0bf2a06b7a4e..bf37bc49bd8e 100644
--- a/arch/x86/include/asm/numaq/apic.h
+++ b/arch/x86/include/asm/numaq/apic.h
@@ -7,9 +7,9 @@
7 7
8#define APIC_DFR_VALUE (APIC_DFR_CLUSTER) 8#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
9 9
10static inline cpumask_t target_cpus(void) 10static inline const cpumask_t *target_cpus(void)
11{ 11{
12 return CPU_MASK_ALL; 12 return &CPU_MASK_ALL;
13} 13}
14 14
15#define NO_BALANCE_IRQ (1) 15#define NO_BALANCE_IRQ (1)
@@ -63,8 +63,8 @@ static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_map)
63extern u8 cpu_2_logical_apicid[]; 63extern u8 cpu_2_logical_apicid[];
64static inline int cpu_to_logical_apicid(int cpu) 64static inline int cpu_to_logical_apicid(int cpu)
65{ 65{
66 if (cpu >= NR_CPUS) 66 if (cpu >= nr_cpu_ids)
67 return BAD_APICID; 67 return BAD_APICID;
68 return (int)cpu_2_logical_apicid[cpu]; 68 return (int)cpu_2_logical_apicid[cpu];
69} 69}
70 70
@@ -122,7 +122,13 @@ static inline void enable_apic_mode(void)
122 * We use physical apicids here, not logical, so just return the default 122 * We use physical apicids here, not logical, so just return the default
123 * physical broadcast to stop people from breaking us 123 * physical broadcast to stop people from breaking us
124 */ 124 */
125static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) 125static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
126{
127 return (int) 0xF;
128}
129
130static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *cpumask,
131 const struct cpumask *andmask)
126{ 132{
127 return (int) 0xF; 133 return (int) 0xF;
128} 134}
diff --git a/arch/x86/include/asm/numaq/ipi.h b/arch/x86/include/asm/numaq/ipi.h
index 935588d286cf..a8374c652778 100644
--- a/arch/x86/include/asm/numaq/ipi.h
+++ b/arch/x86/include/asm/numaq/ipi.h
@@ -1,25 +1,22 @@
1#ifndef __ASM_NUMAQ_IPI_H 1#ifndef __ASM_NUMAQ_IPI_H
2#define __ASM_NUMAQ_IPI_H 2#define __ASM_NUMAQ_IPI_H
3 3
4void send_IPI_mask_sequence(cpumask_t, int vector); 4void send_IPI_mask_sequence(const struct cpumask *mask, int vector);
5void send_IPI_mask_allbutself(const struct cpumask *mask, int vector);
5 6
6static inline void send_IPI_mask(cpumask_t mask, int vector) 7static inline void send_IPI_mask(const struct cpumask *mask, int vector)
7{ 8{
8 send_IPI_mask_sequence(mask, vector); 9 send_IPI_mask_sequence(mask, vector);
9} 10}
10 11
11static inline void send_IPI_allbutself(int vector) 12static inline void send_IPI_allbutself(int vector)
12{ 13{
13 cpumask_t mask = cpu_online_map; 14 send_IPI_mask_allbutself(cpu_online_mask, vector);
14 cpu_clear(smp_processor_id(), mask);
15
16 if (!cpus_empty(mask))
17 send_IPI_mask(mask, vector);
18} 15}
19 16
20static inline void send_IPI_all(int vector) 17static inline void send_IPI_all(int vector)
21{ 18{
22 send_IPI_mask(cpu_online_map, vector); 19 send_IPI_mask(cpu_online_mask, vector);
23} 20}
24 21
25#endif /* __ASM_NUMAQ_IPI_H */ 22#endif /* __ASM_NUMAQ_IPI_H */
diff --git a/arch/x86/include/asm/numaq/mpparse.h b/arch/x86/include/asm/numaq/mpparse.h
index 252292e077b6..a2eeefcd1cc7 100644
--- a/arch/x86/include/asm/numaq/mpparse.h
+++ b/arch/x86/include/asm/numaq/mpparse.h
@@ -1,7 +1,6 @@
1#ifndef __ASM_NUMAQ_MPPARSE_H 1#ifndef __ASM_NUMAQ_MPPARSE_H
2#define __ASM_NUMAQ_MPPARSE_H 2#define __ASM_NUMAQ_MPPARSE_H
3 3
4extern void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem, 4extern void numaq_mps_oem_check(struct mpc_table *, char *, char *);
5 char *productid);
6 5
7#endif /* __ASM_NUMAQ_MPPARSE_H */ 6#endif /* __ASM_NUMAQ_MPPARSE_H */
diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 66834c41c049..a977de23cb4d 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -102,9 +102,9 @@ extern void pci_iommu_alloc(void);
102 102
103#ifdef CONFIG_NUMA 103#ifdef CONFIG_NUMA
104/* Returns the node based on pci bus */ 104/* Returns the node based on pci bus */
105static inline int __pcibus_to_node(struct pci_bus *bus) 105static inline int __pcibus_to_node(const struct pci_bus *bus)
106{ 106{
107 struct pci_sysdata *sd = bus->sysdata; 107 const struct pci_sysdata *sd = bus->sysdata;
108 108
109 return sd->node; 109 return sd->node;
110} 110}
@@ -113,6 +113,12 @@ static inline cpumask_t __pcibus_to_cpumask(struct pci_bus *bus)
113{ 113{
114 return node_to_cpumask(__pcibus_to_node(bus)); 114 return node_to_cpumask(__pcibus_to_node(bus));
115} 115}
116
117static inline const struct cpumask *
118cpumask_of_pcibus(const struct pci_bus *bus)
119{
120 return cpumask_of_node(__pcibus_to_node(bus));
121}
116#endif 122#endif
117 123
118#endif /* _ASM_X86_PCI_H */ 124#endif /* _ASM_X86_PCI_H */
diff --git a/arch/x86/pci/pci.h b/arch/x86/include/asm/pci_x86.h
index 1959018aac02..e60fd3e14bdf 100644
--- a/arch/x86/pci/pci.h
+++ b/arch/x86/include/asm/pci_x86.h
@@ -57,7 +57,8 @@ extern struct pci_ops pci_root_ops;
57struct irq_info { 57struct irq_info {
58 u8 bus, devfn; /* Bus, device and function */ 58 u8 bus, devfn; /* Bus, device and function */
59 struct { 59 struct {
60 u8 link; /* IRQ line ID, chipset dependent, 0=not routed */ 60 u8 link; /* IRQ line ID, chipset dependent,
61 0 = not routed */
61 u16 bitmap; /* Available IRQs */ 62 u16 bitmap; /* Available IRQs */
62 } __attribute__((packed)) irq[4]; 63 } __attribute__((packed)) irq[4];
63 u8 slot; /* Slot number, 0=onboard */ 64 u8 slot; /* Slot number, 0=onboard */
@@ -69,11 +70,13 @@ struct irq_routing_table {
69 u16 version; /* PIRQ_VERSION */ 70 u16 version; /* PIRQ_VERSION */
70 u16 size; /* Table size in bytes */ 71 u16 size; /* Table size in bytes */
71 u8 rtr_bus, rtr_devfn; /* Where the interrupt router lies */ 72 u8 rtr_bus, rtr_devfn; /* Where the interrupt router lies */
72 u16 exclusive_irqs; /* IRQs devoted exclusively to PCI usage */ 73 u16 exclusive_irqs; /* IRQs devoted exclusively to
73 u16 rtr_vendor, rtr_device; /* Vendor and device ID of interrupt router */ 74 PCI usage */
75 u16 rtr_vendor, rtr_device; /* Vendor and device ID of
76 interrupt router */
74 u32 miniport_data; /* Crap */ 77 u32 miniport_data; /* Crap */
75 u8 rfu[11]; 78 u8 rfu[11];
76 u8 checksum; /* Modulo 256 checksum must give zero */ 79 u8 checksum; /* Modulo 256 checksum must give 0 */
77 struct irq_info slots[0]; 80 struct irq_info slots[0];
78} __attribute__((packed)); 81} __attribute__((packed));
79 82
@@ -148,15 +151,15 @@ static inline unsigned int mmio_config_readl(void __iomem *pos)
148 151
149static inline void mmio_config_writeb(void __iomem *pos, u8 val) 152static inline void mmio_config_writeb(void __iomem *pos, u8 val)
150{ 153{
151 asm volatile("movb %%al,(%1)" :: "a" (val), "r" (pos) : "memory"); 154 asm volatile("movb %%al,(%1)" : : "a" (val), "r" (pos) : "memory");
152} 155}
153 156
154static inline void mmio_config_writew(void __iomem *pos, u16 val) 157static inline void mmio_config_writew(void __iomem *pos, u16 val)
155{ 158{
156 asm volatile("movw %%ax,(%1)" :: "a" (val), "r" (pos) : "memory"); 159 asm volatile("movw %%ax,(%1)" : : "a" (val), "r" (pos) : "memory");
157} 160}
158 161
159static inline void mmio_config_writel(void __iomem *pos, u32 val) 162static inline void mmio_config_writel(void __iomem *pos, u32 val)
160{ 163{
161 asm volatile("movl %%eax,(%1)" :: "a" (val), "r" (pos) : "memory"); 164 asm volatile("movl %%eax,(%1)" : : "a" (val), "r" (pos) : "memory");
162} 165}
diff --git a/arch/x86/include/asm/setup.h b/arch/x86/include/asm/setup.h
index 4fcd53fd5f43..ebe858cdc8a3 100644
--- a/arch/x86/include/asm/setup.h
+++ b/arch/x86/include/asm/setup.h
@@ -25,9 +25,9 @@ extern int wakeup_secondary_cpu_via_init(int apicid, unsigned long start_eip);
25/* 25/*
26 * Any setup quirks to be performed? 26 * Any setup quirks to be performed?
27 */ 27 */
28struct mpc_config_processor; 28struct mpc_cpu;
29struct mpc_config_bus; 29struct mpc_bus;
30struct mp_config_oemtable; 30struct mpc_oemtable;
31struct x86_quirks { 31struct x86_quirks {
32 int (*arch_pre_time_init)(void); 32 int (*arch_pre_time_init)(void);
33 int (*arch_time_init)(void); 33 int (*arch_time_init)(void);
@@ -39,10 +39,10 @@ struct x86_quirks {
39 int (*mach_find_smp_config)(unsigned int reserve); 39 int (*mach_find_smp_config)(unsigned int reserve);
40 40
41 int *mpc_record; 41 int *mpc_record;
42 int (*mpc_apic_id)(struct mpc_config_processor *m); 42 int (*mpc_apic_id)(struct mpc_cpu *m);
43 void (*mpc_oem_bus_info)(struct mpc_config_bus *m, char *name); 43 void (*mpc_oem_bus_info)(struct mpc_bus *m, char *name);
44 void (*mpc_oem_pci_bus)(struct mpc_config_bus *m); 44 void (*mpc_oem_pci_bus)(struct mpc_bus *m);
45 void (*smp_read_mpc_oem)(struct mp_config_oemtable *oemtable, 45 void (*smp_read_mpc_oem)(struct mpc_oemtable *oemtable,
46 unsigned short oemsize); 46 unsigned short oemsize);
47 int (*setup_ioapic_ids)(void); 47 int (*setup_ioapic_ids)(void);
48 int (*update_genapic)(void); 48 int (*update_genapic)(void);
diff --git a/arch/x86/include/asm/smp.h b/arch/x86/include/asm/smp.h
index d12811ce51d9..19953df61c52 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -18,9 +18,26 @@
18#include <asm/pda.h> 18#include <asm/pda.h>
19#include <asm/thread_info.h> 19#include <asm/thread_info.h>
20 20
21#ifdef CONFIG_X86_64
22
23extern cpumask_var_t cpu_callin_mask;
24extern cpumask_var_t cpu_callout_mask;
25extern cpumask_var_t cpu_initialized_mask;
26extern cpumask_var_t cpu_sibling_setup_mask;
27
28#else /* CONFIG_X86_32 */
29
30extern cpumask_t cpu_callin_map;
21extern cpumask_t cpu_callout_map; 31extern cpumask_t cpu_callout_map;
22extern cpumask_t cpu_initialized; 32extern cpumask_t cpu_initialized;
23extern cpumask_t cpu_callin_map; 33extern cpumask_t cpu_sibling_setup_map;
34
35#define cpu_callin_mask ((struct cpumask *)&cpu_callin_map)
36#define cpu_callout_mask ((struct cpumask *)&cpu_callout_map)
37#define cpu_initialized_mask ((struct cpumask *)&cpu_initialized)
38#define cpu_sibling_setup_mask ((struct cpumask *)&cpu_sibling_setup_map)
39
40#endif /* CONFIG_X86_32 */
24 41
25extern void (*mtrr_hook)(void); 42extern void (*mtrr_hook)(void);
26extern void zap_low_mappings(void); 43extern void zap_low_mappings(void);
@@ -29,7 +46,6 @@ extern int __cpuinit get_local_pda(int cpu);
29 46
30extern int smp_num_siblings; 47extern int smp_num_siblings;
31extern unsigned int num_processors; 48extern unsigned int num_processors;
32extern cpumask_t cpu_initialized;
33 49
34DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); 50DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
35DECLARE_PER_CPU(cpumask_t, cpu_core_map); 51DECLARE_PER_CPU(cpumask_t, cpu_core_map);
@@ -38,6 +54,16 @@ DECLARE_PER_CPU(u16, cpu_llc_id);
38DECLARE_PER_CPU(int, cpu_number); 54DECLARE_PER_CPU(int, cpu_number);
39#endif 55#endif
40 56
57static inline struct cpumask *cpu_sibling_mask(int cpu)
58{
59 return &per_cpu(cpu_sibling_map, cpu);
60}
61
62static inline struct cpumask *cpu_core_mask(int cpu)
63{
64 return &per_cpu(cpu_core_map, cpu);
65}
66
41DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); 67DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid);
42DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); 68DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid);
43 69
@@ -60,7 +86,7 @@ struct smp_ops {
60 void (*cpu_die)(unsigned int cpu); 86 void (*cpu_die)(unsigned int cpu);
61 void (*play_dead)(void); 87 void (*play_dead)(void);
62 88
63 void (*send_call_func_ipi)(cpumask_t mask); 89 void (*send_call_func_ipi)(const struct cpumask *mask);
64 void (*send_call_func_single_ipi)(int cpu); 90 void (*send_call_func_single_ipi)(int cpu);
65}; 91};
66 92
@@ -125,7 +151,7 @@ static inline void arch_send_call_function_single_ipi(int cpu)
125 151
126static inline void arch_send_call_function_ipi(cpumask_t mask) 152static inline void arch_send_call_function_ipi(cpumask_t mask)
127{ 153{
128 smp_ops.send_call_func_ipi(mask); 154 smp_ops.send_call_func_ipi(&mask);
129} 155}
130 156
131void cpu_disable_common(void); 157void cpu_disable_common(void);
@@ -138,7 +164,7 @@ void native_cpu_die(unsigned int cpu);
138void native_play_dead(void); 164void native_play_dead(void);
139void play_dead_common(void); 165void play_dead_common(void);
140 166
141void native_send_call_func_ipi(cpumask_t mask); 167void native_send_call_func_ipi(const struct cpumask *mask);
142void native_send_call_func_single_ipi(int cpu); 168void native_send_call_func_single_ipi(int cpu);
143 169
144extern void prefill_possible_map(void); 170extern void prefill_possible_map(void);
@@ -149,7 +175,7 @@ void smp_store_cpu_info(int id);
149/* We don't mark CPUs online until __cpu_up(), so we need another measure */ 175/* We don't mark CPUs online until __cpu_up(), so we need another measure */
150static inline int num_booting_cpus(void) 176static inline int num_booting_cpus(void)
151{ 177{
152 return cpus_weight(cpu_callout_map); 178 return cpumask_weight(cpu_callout_mask);
153} 179}
154#else 180#else
155static inline void prefill_possible_map(void) 181static inline void prefill_possible_map(void)
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 9b3070f1c2ac..93d2c8667cfe 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -2,6 +2,7 @@
2#define __ASM_SUMMIT_APIC_H 2#define __ASM_SUMMIT_APIC_H
3 3
4#include <asm/smp.h> 4#include <asm/smp.h>
5#include <linux/gfp.h>
5 6
6#define esr_disable (1) 7#define esr_disable (1)
7#define NO_BALANCE_IRQ (0) 8#define NO_BALANCE_IRQ (0)
@@ -14,13 +15,13 @@
14 15
15#define APIC_DFR_VALUE (APIC_DFR_CLUSTER) 16#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
16 17
17static inline cpumask_t target_cpus(void) 18static inline const cpumask_t *target_cpus(void)
18{ 19{
19 /* CPU_MASK_ALL (0xff) has undefined behaviour with 20 /* CPU_MASK_ALL (0xff) has undefined behaviour with
20 * dest_LowestPrio mode logical clustered apic interrupt routing 21 * dest_LowestPrio mode logical clustered apic interrupt routing
21 * Just start on cpu 0. IRQ balancing will spread load 22 * Just start on cpu 0. IRQ balancing will spread load
22 */ 23 */
23 return cpumask_of_cpu(0); 24 return &cpumask_of_cpu(0);
24} 25}
25 26
26#define INT_DELIVERY_MODE (dest_LowestPrio) 27#define INT_DELIVERY_MODE (dest_LowestPrio)
@@ -52,7 +53,7 @@ static inline void init_apic_ldr(void)
52 int i; 53 int i;
53 54
54 /* Create logical APIC IDs by counting CPUs already in cluster. */ 55 /* Create logical APIC IDs by counting CPUs already in cluster. */
55 for (count = 0, i = NR_CPUS; --i >= 0; ) { 56 for (count = 0, i = nr_cpu_ids; --i >= 0; ) {
56 lid = cpu_2_logical_apicid[i]; 57 lid = cpu_2_logical_apicid[i];
57 if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster) 58 if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster)
58 ++count; 59 ++count;
@@ -97,8 +98,8 @@ static inline int apicid_to_node(int logical_apicid)
97static inline int cpu_to_logical_apicid(int cpu) 98static inline int cpu_to_logical_apicid(int cpu)
98{ 99{
99#ifdef CONFIG_SMP 100#ifdef CONFIG_SMP
100 if (cpu >= NR_CPUS) 101 if (cpu >= nr_cpu_ids)
101 return BAD_APICID; 102 return BAD_APICID;
102 return (int)cpu_2_logical_apicid[cpu]; 103 return (int)cpu_2_logical_apicid[cpu];
103#else 104#else
104 return logical_smp_processor_id(); 105 return logical_smp_processor_id();
@@ -107,7 +108,7 @@ static inline int cpu_to_logical_apicid(int cpu)
107 108
108static inline int cpu_present_to_apicid(int mps_cpu) 109static inline int cpu_present_to_apicid(int mps_cpu)
109{ 110{
110 if (mps_cpu < NR_CPUS) 111 if (mps_cpu < nr_cpu_ids)
111 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); 112 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
112 else 113 else
113 return BAD_APICID; 114 return BAD_APICID;
@@ -137,25 +138,25 @@ static inline void enable_apic_mode(void)
137{ 138{
138} 139}
139 140
140static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) 141static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
141{ 142{
142 int num_bits_set; 143 int num_bits_set;
143 int cpus_found = 0; 144 int cpus_found = 0;
144 int cpu; 145 int cpu;
145 int apicid; 146 int apicid;
146 147
147 num_bits_set = cpus_weight(cpumask); 148 num_bits_set = cpus_weight(*cpumask);
148 /* Return id to all */ 149 /* Return id to all */
149 if (num_bits_set == NR_CPUS) 150 if (num_bits_set >= nr_cpu_ids)
150 return (int) 0xFF; 151 return (int) 0xFF;
151 /* 152 /*
152 * The cpus in the mask must all be on the apic cluster. If are not 153 * The cpus in the mask must all be on the apic cluster. If are not
153 * on the same apicid cluster return default value of TARGET_CPUS. 154 * on the same apicid cluster return default value of TARGET_CPUS.
154 */ 155 */
155 cpu = first_cpu(cpumask); 156 cpu = first_cpu(*cpumask);
156 apicid = cpu_to_logical_apicid(cpu); 157 apicid = cpu_to_logical_apicid(cpu);
157 while (cpus_found < num_bits_set) { 158 while (cpus_found < num_bits_set) {
158 if (cpu_isset(cpu, cpumask)) { 159 if (cpu_isset(cpu, *cpumask)) {
159 int new_apicid = cpu_to_logical_apicid(cpu); 160 int new_apicid = cpu_to_logical_apicid(cpu);
160 if (apicid_cluster(apicid) != 161 if (apicid_cluster(apicid) !=
161 apicid_cluster(new_apicid)){ 162 apicid_cluster(new_apicid)){
@@ -170,6 +171,23 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
170 return apicid; 171 return apicid;
171} 172}
172 173
174static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
175 const struct cpumask *andmask)
176{
177 int apicid = cpu_to_logical_apicid(0);
178 cpumask_var_t cpumask;
179
180 if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
181 return apicid;
182
183 cpumask_and(cpumask, inmask, andmask);
184 cpumask_and(cpumask, cpumask, cpu_online_mask);
185 apicid = cpu_mask_to_apicid(cpumask);
186
187 free_cpumask_var(cpumask);
188 return apicid;
189}
190
173/* cpuid returns the value latched in the HW at reset, not the APIC ID 191/* cpuid returns the value latched in the HW at reset, not the APIC ID
174 * register's value. For any box whose BIOS changes APIC IDs, like 192 * register's value. For any box whose BIOS changes APIC IDs, like
175 * clustered APIC systems, we must use hard_smp_processor_id. 193 * clustered APIC systems, we must use hard_smp_processor_id.
diff --git a/arch/x86/include/asm/summit/ipi.h b/arch/x86/include/asm/summit/ipi.h
index 53bd1e7bd7b4..a8a2c24f50cc 100644
--- a/arch/x86/include/asm/summit/ipi.h
+++ b/arch/x86/include/asm/summit/ipi.h
@@ -1,9 +1,10 @@
1#ifndef __ASM_SUMMIT_IPI_H 1#ifndef __ASM_SUMMIT_IPI_H
2#define __ASM_SUMMIT_IPI_H 2#define __ASM_SUMMIT_IPI_H
3 3
4void send_IPI_mask_sequence(cpumask_t mask, int vector); 4void send_IPI_mask_sequence(const cpumask_t *mask, int vector);
5void send_IPI_mask_allbutself(const cpumask_t *mask, int vector);
5 6
6static inline void send_IPI_mask(cpumask_t mask, int vector) 7static inline void send_IPI_mask(const cpumask_t *mask, int vector)
7{ 8{
8 send_IPI_mask_sequence(mask, vector); 9 send_IPI_mask_sequence(mask, vector);
9} 10}
@@ -14,12 +15,12 @@ static inline void send_IPI_allbutself(int vector)
14 cpu_clear(smp_processor_id(), mask); 15 cpu_clear(smp_processor_id(), mask);
15 16
16 if (!cpus_empty(mask)) 17 if (!cpus_empty(mask))
17 send_IPI_mask(mask, vector); 18 send_IPI_mask(&mask, vector);
18} 19}
19 20
20static inline void send_IPI_all(int vector) 21static inline void send_IPI_all(int vector)
21{ 22{
22 send_IPI_mask(cpu_online_map, vector); 23 send_IPI_mask(&cpu_online_map, vector);
23} 24}
24 25
25#endif /* __ASM_SUMMIT_IPI_H */ 26#endif /* __ASM_SUMMIT_IPI_H */
diff --git a/arch/x86/include/asm/summit/mpparse.h b/arch/x86/include/asm/summit/mpparse.h
index 013ce6fab2d5..380e86c02363 100644
--- a/arch/x86/include/asm/summit/mpparse.h
+++ b/arch/x86/include/asm/summit/mpparse.h
@@ -11,7 +11,7 @@ extern void setup_summit(void);
11#define setup_summit() {} 11#define setup_summit() {}
12#endif 12#endif
13 13
14static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, 14static inline int mps_oem_check(struct mpc_table *mpc, char *oem,
15 char *productid) 15 char *productid)
16{ 16{
17 if (!strncmp(oem, "IBM ENSW", 8) && 17 if (!strncmp(oem, "IBM ENSW", 8) &&
diff --git a/arch/x86/kvm/svm.h b/arch/x86/include/asm/svm.h
index 1b8afa78e869..1b8afa78e869 100644
--- a/arch/x86/kvm/svm.h
+++ b/arch/x86/include/asm/svm.h
diff --git a/arch/x86/include/asm/swab.h b/arch/x86/include/asm/swab.h
new file mode 100644
index 000000000000..306d4178ffc9
--- /dev/null
+++ b/arch/x86/include/asm/swab.h
@@ -0,0 +1,61 @@
1#ifndef _ASM_X86_SWAB_H
2#define _ASM_X86_SWAB_H
3
4#include <asm/types.h>
5#include <linux/compiler.h>
6
7static inline __attribute_const__ __u32 __arch_swab32(__u32 val)
8{
9#ifdef __i386__
10# ifdef CONFIG_X86_BSWAP
11 asm("bswap %0" : "=r" (val) : "0" (val));
12# else
13 asm("xchgb %b0,%h0\n\t" /* swap lower bytes */
14 "rorl $16,%0\n\t" /* swap words */
15 "xchgb %b0,%h0" /* swap higher bytes */
16 : "=q" (val)
17 : "0" (val));
18# endif
19
20#else /* __i386__ */
21 asm("bswapl %0"
22 : "=r" (val)
23 : "0" (val));
24#endif
25 return val;
26}
27#define __arch_swab32 __arch_swab32
28
29static inline __attribute_const__ __u64 __arch_swab64(__u64 val)
30{
31#ifdef __i386__
32 union {
33 struct {
34 __u32 a;
35 __u32 b;
36 } s;
37 __u64 u;
38 } v;
39 v.u = val;
40# ifdef CONFIG_X86_BSWAP
41 asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
42 : "=r" (v.s.a), "=r" (v.s.b)
43 : "0" (v.s.a), "1" (v.s.b));
44# else
45 v.s.a = __arch_swab32(v.s.a);
46 v.s.b = __arch_swab32(v.s.b);
47 asm("xchgl %0,%1"
48 : "=r" (v.s.a), "=r" (v.s.b)
49 : "0" (v.s.a), "1" (v.s.b));
50# endif
51 return v.u;
52#else /* __i386__ */
53 asm("bswapq %0"
54 : "=r" (val)
55 : "0" (val));
56 return val;
57#endif
58}
59#define __arch_swab64 __arch_swab64
60
61#endif /* _ASM_X86_SWAB_H */
diff --git a/arch/x86/include/asm/swiotlb.h b/arch/x86/include/asm/swiotlb.h
index 51fb2c76ad74..b9e4e20174fb 100644
--- a/arch/x86/include/asm/swiotlb.h
+++ b/arch/x86/include/asm/swiotlb.h
@@ -1,46 +1,10 @@
1#ifndef _ASM_X86_SWIOTLB_H 1#ifndef _ASM_X86_SWIOTLB_H
2#define _ASM_X86_SWIOTLB_H 2#define _ASM_X86_SWIOTLB_H
3 3
4#include <asm/dma-mapping.h> 4#include <linux/swiotlb.h>
5 5
6/* SWIOTLB interface */ 6/* SWIOTLB interface */
7 7
8extern dma_addr_t swiotlb_map_single(struct device *hwdev, void *ptr,
9 size_t size, int dir);
10extern void *swiotlb_alloc_coherent(struct device *hwdev, size_t size,
11 dma_addr_t *dma_handle, gfp_t flags);
12extern void swiotlb_unmap_single(struct device *hwdev, dma_addr_t dev_addr,
13 size_t size, int dir);
14extern void swiotlb_sync_single_for_cpu(struct device *hwdev,
15 dma_addr_t dev_addr,
16 size_t size, int dir);
17extern void swiotlb_sync_single_for_device(struct device *hwdev,
18 dma_addr_t dev_addr,
19 size_t size, int dir);
20extern void swiotlb_sync_single_range_for_cpu(struct device *hwdev,
21 dma_addr_t dev_addr,
22 unsigned long offset,
23 size_t size, int dir);
24extern void swiotlb_sync_single_range_for_device(struct device *hwdev,
25 dma_addr_t dev_addr,
26 unsigned long offset,
27 size_t size, int dir);
28extern void swiotlb_sync_sg_for_cpu(struct device *hwdev,
29 struct scatterlist *sg, int nelems,
30 int dir);
31extern void swiotlb_sync_sg_for_device(struct device *hwdev,
32 struct scatterlist *sg, int nelems,
33 int dir);
34extern int swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg,
35 int nents, int direction);
36extern void swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sg,
37 int nents, int direction);
38extern int swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
39extern void swiotlb_free_coherent(struct device *hwdev, size_t size,
40 void *vaddr, dma_addr_t dma_handle);
41extern int swiotlb_dma_supported(struct device *hwdev, u64 mask);
42extern void swiotlb_init(void);
43
44extern int swiotlb_force; 8extern int swiotlb_force;
45 9
46#ifdef CONFIG_SWIOTLB 10#ifdef CONFIG_SWIOTLB
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
new file mode 100644
index 000000000000..ffb08be2a530
--- /dev/null
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -0,0 +1,101 @@
1/*
2 * sys_ia32.h - Linux ia32 syscall interfaces
3 *
4 * Copyright (c) 2008 Jaswinder Singh Rajput
5 *
6 * This file is released under the GPLv2.
7 * See the file COPYING for more details.
8 */
9
10#ifndef _ASM_X86_SYS_IA32_H
11#define _ASM_X86_SYS_IA32_H
12
13#include <linux/compiler.h>
14#include <linux/linkage.h>
15#include <linux/types.h>
16#include <linux/signal.h>
17#include <asm/compat.h>
18#include <asm/ia32.h>
19
20/* ia32/sys_ia32.c */
21asmlinkage long sys32_truncate64(char __user *, unsigned long, unsigned long);
22asmlinkage long sys32_ftruncate64(unsigned int, unsigned long, unsigned long);
23
24asmlinkage long sys32_stat64(char __user *, struct stat64 __user *);
25asmlinkage long sys32_lstat64(char __user *, struct stat64 __user *);
26asmlinkage long sys32_fstat64(unsigned int, struct stat64 __user *);
27asmlinkage long sys32_fstatat(unsigned int, char __user *,
28 struct stat64 __user *, int);
29struct mmap_arg_struct;
30asmlinkage long sys32_mmap(struct mmap_arg_struct __user *);
31asmlinkage long sys32_mprotect(unsigned long, size_t, unsigned long);
32
33asmlinkage long sys32_pipe(int __user *);
34struct sigaction32;
35struct old_sigaction32;
36asmlinkage long sys32_rt_sigaction(int, struct sigaction32 __user *,
37 struct sigaction32 __user *, unsigned int);
38asmlinkage long sys32_sigaction(int, struct old_sigaction32 __user *,
39 struct old_sigaction32 __user *);
40asmlinkage long sys32_rt_sigprocmask(int, compat_sigset_t __user *,
41 compat_sigset_t __user *, unsigned int);
42asmlinkage long sys32_alarm(unsigned int);
43
44struct sel_arg_struct;
45asmlinkage long sys32_old_select(struct sel_arg_struct __user *);
46asmlinkage long sys32_waitpid(compat_pid_t, unsigned int *, int);
47asmlinkage long sys32_sysfs(int, u32, u32);
48
49asmlinkage long sys32_sched_rr_get_interval(compat_pid_t,
50 struct compat_timespec __user *);
51asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t);
52asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *);
53
54#ifdef CONFIG_SYSCTL_SYSCALL
55struct sysctl_ia32;
56asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *);
57#endif
58
59asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32);
60asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32);
61
62asmlinkage long sys32_personality(unsigned long);
63asmlinkage long sys32_sendfile(int, int, compat_off_t __user *, s32);
64
65asmlinkage long sys32_mmap2(unsigned long, unsigned long, unsigned long,
66 unsigned long, unsigned long, unsigned long);
67
68struct oldold_utsname;
69struct old_utsname;
70asmlinkage long sys32_olduname(struct oldold_utsname __user *);
71long sys32_uname(struct old_utsname __user *);
72
73long sys32_ustat(unsigned, struct ustat32 __user *);
74
75asmlinkage long sys32_execve(char __user *, compat_uptr_t __user *,
76 compat_uptr_t __user *, struct pt_regs *);
77asmlinkage long sys32_clone(unsigned int, unsigned int, struct pt_regs *);
78
79long sys32_lseek(unsigned int, int, unsigned int);
80long sys32_kill(int, int);
81long sys32_fadvise64_64(int, __u32, __u32, __u32, __u32, int);
82long sys32_vm86_warning(void);
83long sys32_lookup_dcookie(u32, u32, char __user *, size_t);
84
85asmlinkage ssize_t sys32_readahead(int, unsigned, unsigned, size_t);
86asmlinkage long sys32_sync_file_range(int, unsigned, unsigned,
87 unsigned, unsigned, int);
88asmlinkage long sys32_fadvise64(int, unsigned, unsigned, size_t, int);
89asmlinkage long sys32_fallocate(int, int, unsigned,
90 unsigned, unsigned, unsigned);
91
92/* ia32/ia32_signal.c */
93asmlinkage long sys32_sigsuspend(int, int, old_sigset_t);
94asmlinkage long sys32_sigaltstack(const stack_ia32_t __user *,
95 stack_ia32_t __user *, struct pt_regs *);
96asmlinkage long sys32_sigreturn(struct pt_regs *);
97asmlinkage long sys32_rt_sigreturn(struct pt_regs *);
98
99/* ia32/ipc32.c */
100asmlinkage long sys32_ipc(u32, int, int, int, compat_uptr_t, u32);
101#endif /* _ASM_X86_SYS_IA32_H */
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index ff386ff50ed7..4e2f2e0aab27 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -61,13 +61,19 @@ static inline int cpu_to_node(int cpu)
61 * 61 *
62 * Side note: this function creates the returned cpumask on the stack 62 * Side note: this function creates the returned cpumask on the stack
63 * so with a high NR_CPUS count, excessive stack space is used. The 63 * so with a high NR_CPUS count, excessive stack space is used. The
64 * node_to_cpumask_ptr function should be used whenever possible. 64 * cpumask_of_node function should be used whenever possible.
65 */ 65 */
66static inline cpumask_t node_to_cpumask(int node) 66static inline cpumask_t node_to_cpumask(int node)
67{ 67{
68 return node_to_cpumask_map[node]; 68 return node_to_cpumask_map[node];
69} 69}
70 70
71/* Returns a bitmask of CPUs on Node 'node'. */
72static inline const struct cpumask *cpumask_of_node(int node)
73{
74 return &node_to_cpumask_map[node];
75}
76
71#else /* CONFIG_X86_64 */ 77#else /* CONFIG_X86_64 */
72 78
73/* Mappings between node number and cpus on that node. */ 79/* Mappings between node number and cpus on that node. */
@@ -82,7 +88,7 @@ DECLARE_EARLY_PER_CPU(int, x86_cpu_to_node_map);
82#ifdef CONFIG_DEBUG_PER_CPU_MAPS 88#ifdef CONFIG_DEBUG_PER_CPU_MAPS
83extern int cpu_to_node(int cpu); 89extern int cpu_to_node(int cpu);
84extern int early_cpu_to_node(int cpu); 90extern int early_cpu_to_node(int cpu);
85extern const cpumask_t *_node_to_cpumask_ptr(int node); 91extern const cpumask_t *cpumask_of_node(int node);
86extern cpumask_t node_to_cpumask(int node); 92extern cpumask_t node_to_cpumask(int node);
87 93
88#else /* !CONFIG_DEBUG_PER_CPU_MAPS */ 94#else /* !CONFIG_DEBUG_PER_CPU_MAPS */
@@ -103,7 +109,7 @@ static inline int early_cpu_to_node(int cpu)
103} 109}
104 110
105/* Returns a pointer to the cpumask of CPUs on Node 'node'. */ 111/* Returns a pointer to the cpumask of CPUs on Node 'node'. */
106static inline const cpumask_t *_node_to_cpumask_ptr(int node) 112static inline const cpumask_t *cpumask_of_node(int node)
107{ 113{
108 return &node_to_cpumask_map[node]; 114 return &node_to_cpumask_map[node];
109} 115}
@@ -116,12 +122,15 @@ static inline cpumask_t node_to_cpumask(int node)
116 122
117#endif /* !CONFIG_DEBUG_PER_CPU_MAPS */ 123#endif /* !CONFIG_DEBUG_PER_CPU_MAPS */
118 124
119/* Replace default node_to_cpumask_ptr with optimized version */ 125/*
126 * Replace default node_to_cpumask_ptr with optimized version
127 * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)"
128 */
120#define node_to_cpumask_ptr(v, node) \ 129#define node_to_cpumask_ptr(v, node) \
121 const cpumask_t *v = _node_to_cpumask_ptr(node) 130 const cpumask_t *v = cpumask_of_node(node)
122 131
123#define node_to_cpumask_ptr_next(v, node) \ 132#define node_to_cpumask_ptr_next(v, node) \
124 v = _node_to_cpumask_ptr(node) 133 v = cpumask_of_node(node)
125 134
126#endif /* CONFIG_X86_64 */ 135#endif /* CONFIG_X86_64 */
127 136
@@ -187,7 +196,7 @@ extern int __node_distance(int, int);
187#define cpu_to_node(cpu) 0 196#define cpu_to_node(cpu) 0
188#define early_cpu_to_node(cpu) 0 197#define early_cpu_to_node(cpu) 0
189 198
190static inline const cpumask_t *_node_to_cpumask_ptr(int node) 199static inline const cpumask_t *cpumask_of_node(int node)
191{ 200{
192 return &cpu_online_map; 201 return &cpu_online_map;
193} 202}
@@ -200,12 +209,15 @@ static inline int node_to_first_cpu(int node)
200 return first_cpu(cpu_online_map); 209 return first_cpu(cpu_online_map);
201} 210}
202 211
203/* Replace default node_to_cpumask_ptr with optimized version */ 212/*
213 * Replace default node_to_cpumask_ptr with optimized version
214 * Deprecated: use "const struct cpumask *mask = cpumask_of_node(node)"
215 */
204#define node_to_cpumask_ptr(v, node) \ 216#define node_to_cpumask_ptr(v, node) \
205 const cpumask_t *v = _node_to_cpumask_ptr(node) 217 const cpumask_t *v = cpumask_of_node(node)
206 218
207#define node_to_cpumask_ptr_next(v, node) \ 219#define node_to_cpumask_ptr_next(v, node) \
208 v = _node_to_cpumask_ptr(node) 220 v = cpumask_of_node(node)
209#endif 221#endif
210 222
211#include <asm-generic/topology.h> 223#include <asm-generic/topology.h>
@@ -214,18 +226,20 @@ static inline int node_to_first_cpu(int node)
214/* Returns the number of the first CPU on Node 'node'. */ 226/* Returns the number of the first CPU on Node 'node'. */
215static inline int node_to_first_cpu(int node) 227static inline int node_to_first_cpu(int node)
216{ 228{
217 node_to_cpumask_ptr(mask, node); 229 return cpumask_first(cpumask_of_node(node));
218 return first_cpu(*mask);
219} 230}
220#endif 231#endif
221 232
222extern cpumask_t cpu_coregroup_map(int cpu); 233extern cpumask_t cpu_coregroup_map(int cpu);
234extern const struct cpumask *cpu_coregroup_mask(int cpu);
223 235
224#ifdef ENABLE_TOPO_DEFINES 236#ifdef ENABLE_TOPO_DEFINES
225#define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id) 237#define topology_physical_package_id(cpu) (cpu_data(cpu).phys_proc_id)
226#define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id) 238#define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id)
227#define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu)) 239#define topology_core_siblings(cpu) (per_cpu(cpu_core_map, cpu))
228#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) 240#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
241#define topology_core_cpumask(cpu) (&per_cpu(cpu_core_map, cpu))
242#define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
229 243
230/* indicates that pointers to the topology cpumask_t maps are valid */ 244/* indicates that pointers to the topology cpumask_t maps are valid */
231#define arch_provides_topology_pointers yes 245#define arch_provides_topology_pointers yes
diff --git a/arch/x86/include/asm/unwind.h b/arch/x86/include/asm/unwind.h
deleted file mode 100644
index 8b064bd9c553..000000000000
--- a/arch/x86/include/asm/unwind.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _ASM_X86_UNWIND_H
2#define _ASM_X86_UNWIND_H
3
4#define UNW_PC(frame) ((void)(frame), 0UL)
5#define UNW_SP(frame) ((void)(frame), 0UL)
6#define UNW_FP(frame) ((void)(frame), 0UL)
7
8static inline int arch_unw_user_mode(const void *info)
9{
10 return 0;
11}
12
13#endif /* _ASM_X86_UNWIND_H */
diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h
index e2363253bbbf..50423c7b56b2 100644
--- a/arch/x86/include/asm/uv/uv_bau.h
+++ b/arch/x86/include/asm/uv/uv_bau.h
@@ -133,61 +133,61 @@ struct bau_msg_payload {
133 * see table 4.2.3.0.1 in broacast_assist spec. 133 * see table 4.2.3.0.1 in broacast_assist spec.
134 */ 134 */
135struct bau_msg_header { 135struct bau_msg_header {
136 int dest_subnodeid:6; /* must be zero */ 136 unsigned int dest_subnodeid:6; /* must be zero */
137 /* bits 5:0 */ 137 /* bits 5:0 */
138 int base_dest_nodeid:15; /* nasid>>1 (pnode) of first bit in node_map */ 138 unsigned int base_dest_nodeid:15; /* nasid>>1 (pnode) of */
139 /* bits 20:6 */ 139 /* bits 20:6 */ /* first bit in node_map */
140 int command:8; /* message type */ 140 unsigned int command:8; /* message type */
141 /* bits 28:21 */ 141 /* bits 28:21 */
142 /* 0x38: SN3net EndPoint Message */ 142 /* 0x38: SN3net EndPoint Message */
143 int rsvd_1:3; /* must be zero */ 143 unsigned int rsvd_1:3; /* must be zero */
144 /* bits 31:29 */ 144 /* bits 31:29 */
145 /* int will align on 32 bits */ 145 /* int will align on 32 bits */
146 int rsvd_2:9; /* must be zero */ 146 unsigned int rsvd_2:9; /* must be zero */
147 /* bits 40:32 */ 147 /* bits 40:32 */
148 /* Suppl_A is 56-41 */ 148 /* Suppl_A is 56-41 */
149 int payload_2a:8; /* becomes byte 16 of msg */ 149 unsigned int payload_2a:8;/* becomes byte 16 of msg */
150 /* bits 48:41 */ /* not currently using */ 150 /* bits 48:41 */ /* not currently using */
151 int payload_2b:8; /* becomes byte 17 of msg */ 151 unsigned int payload_2b:8;/* becomes byte 17 of msg */
152 /* bits 56:49 */ /* not currently using */ 152 /* bits 56:49 */ /* not currently using */
153 /* Address field (96:57) is never used as an 153 /* Address field (96:57) is never used as an
154 address (these are address bits 42:3) */ 154 address (these are address bits 42:3) */
155 int rsvd_3:1; /* must be zero */ 155 unsigned int rsvd_3:1; /* must be zero */
156 /* bit 57 */ 156 /* bit 57 */
157 /* address bits 27:4 are payload */ 157 /* address bits 27:4 are payload */
158 /* these 24 bits become bytes 12-14 of msg */ 158 /* these 24 bits become bytes 12-14 of msg */
159 int replied_to:1; /* sent as 0 by the source to byte 12 */ 159 unsigned int replied_to:1;/* sent as 0 by the source to byte 12 */
160 /* bit 58 */ 160 /* bit 58 */
161 161
162 int payload_1a:5; /* not currently used */ 162 unsigned int payload_1a:5;/* not currently used */
163 /* bits 63:59 */ 163 /* bits 63:59 */
164 int payload_1b:8; /* not currently used */ 164 unsigned int payload_1b:8;/* not currently used */
165 /* bits 71:64 */ 165 /* bits 71:64 */
166 int payload_1c:8; /* not currently used */ 166 unsigned int payload_1c:8;/* not currently used */
167 /* bits 79:72 */ 167 /* bits 79:72 */
168 int payload_1d:2; /* not currently used */ 168 unsigned int payload_1d:2;/* not currently used */
169 /* bits 81:80 */ 169 /* bits 81:80 */
170 170
171 int rsvd_4:7; /* must be zero */ 171 unsigned int rsvd_4:7; /* must be zero */
172 /* bits 88:82 */ 172 /* bits 88:82 */
173 int sw_ack_flag:1; /* software acknowledge flag */ 173 unsigned int sw_ack_flag:1;/* software acknowledge flag */
174 /* bit 89 */ 174 /* bit 89 */
175 /* INTD trasactions at destination are to 175 /* INTD trasactions at destination are to
176 wait for software acknowledge */ 176 wait for software acknowledge */
177 int rsvd_5:6; /* must be zero */ 177 unsigned int rsvd_5:6; /* must be zero */
178 /* bits 95:90 */ 178 /* bits 95:90 */
179 int rsvd_6:5; /* must be zero */ 179 unsigned int rsvd_6:5; /* must be zero */
180 /* bits 100:96 */ 180 /* bits 100:96 */
181 int int_both:1; /* if 1, interrupt both sockets on the blade */ 181 unsigned int int_both:1;/* if 1, interrupt both sockets on the blade */
182 /* bit 101*/ 182 /* bit 101*/
183 int fairness:3; /* usually zero */ 183 unsigned int fairness:3;/* usually zero */
184 /* bits 104:102 */ 184 /* bits 104:102 */
185 int multilevel:1; /* multi-level multicast format */ 185 unsigned int multilevel:1; /* multi-level multicast format */
186 /* bit 105 */ 186 /* bit 105 */
187 /* 0 for TLB: endpoint multi-unicast messages */ 187 /* 0 for TLB: endpoint multi-unicast messages */
188 int chaining:1; /* next descriptor is part of this activation*/ 188 unsigned int chaining:1;/* next descriptor is part of this activation*/
189 /* bit 106 */ 189 /* bit 106 */
190 int rsvd_7:21; /* must be zero */ 190 unsigned int rsvd_7:21; /* must be zero */
191 /* bits 127:107 */ 191 /* bits 127:107 */
192}; 192};
193 193
diff --git a/arch/x86/include/asm/virtext.h b/arch/x86/include/asm/virtext.h
new file mode 100644
index 000000000000..593636275238
--- /dev/null
+++ b/arch/x86/include/asm/virtext.h
@@ -0,0 +1,132 @@
1/* CPU virtualization extensions handling
2 *
3 * This should carry the code for handling CPU virtualization extensions
4 * that needs to live in the kernel core.
5 *
6 * Author: Eduardo Habkost <ehabkost@redhat.com>
7 *
8 * Copyright (C) 2008, Red Hat Inc.
9 *
10 * Contains code from KVM, Copyright (C) 2006 Qumranet, Inc.
11 *
12 * This work is licensed under the terms of the GNU GPL, version 2. See
13 * the COPYING file in the top-level directory.
14 */
15#ifndef _ASM_X86_VIRTEX_H
16#define _ASM_X86_VIRTEX_H
17
18#include <asm/processor.h>
19#include <asm/system.h>
20
21#include <asm/vmx.h>
22#include <asm/svm.h>
23
24/*
25 * VMX functions:
26 */
27
28static inline int cpu_has_vmx(void)
29{
30 unsigned long ecx = cpuid_ecx(1);
31 return test_bit(5, &ecx); /* CPUID.1:ECX.VMX[bit 5] -> VT */
32}
33
34
35/** Disable VMX on the current CPU
36 *
37 * vmxoff causes a undefined-opcode exception if vmxon was not run
38 * on the CPU previously. Only call this function if you know VMX
39 * is enabled.
40 */
41static inline void cpu_vmxoff(void)
42{
43 asm volatile (ASM_VMX_VMXOFF : : : "cc");
44 write_cr4(read_cr4() & ~X86_CR4_VMXE);
45}
46
47static inline int cpu_vmx_enabled(void)
48{
49 return read_cr4() & X86_CR4_VMXE;
50}
51
52/** Disable VMX if it is enabled on the current CPU
53 *
54 * You shouldn't call this if cpu_has_vmx() returns 0.
55 */
56static inline void __cpu_emergency_vmxoff(void)
57{
58 if (cpu_vmx_enabled())
59 cpu_vmxoff();
60}
61
62/** Disable VMX if it is supported and enabled on the current CPU
63 */
64static inline void cpu_emergency_vmxoff(void)
65{
66 if (cpu_has_vmx())
67 __cpu_emergency_vmxoff();
68}
69
70
71
72
73/*
74 * SVM functions:
75 */
76
77/** Check if the CPU has SVM support
78 *
79 * You can use the 'msg' arg to get a message describing the problem,
80 * if the function returns zero. Simply pass NULL if you are not interested
81 * on the messages; gcc should take care of not generating code for
82 * the messages on this case.
83 */
84static inline int cpu_has_svm(const char **msg)
85{
86 uint32_t eax, ebx, ecx, edx;
87
88 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
89 if (msg)
90 *msg = "not amd";
91 return 0;
92 }
93
94 cpuid(0x80000000, &eax, &ebx, &ecx, &edx);
95 if (eax < SVM_CPUID_FUNC) {
96 if (msg)
97 *msg = "can't execute cpuid_8000000a";
98 return 0;
99 }
100
101 cpuid(0x80000001, &eax, &ebx, &ecx, &edx);
102 if (!(ecx & (1 << SVM_CPUID_FEATURE_SHIFT))) {
103 if (msg)
104 *msg = "svm not available";
105 return 0;
106 }
107 return 1;
108}
109
110
111/** Disable SVM on the current CPU
112 *
113 * You should call this only if cpu_has_svm() returned true.
114 */
115static inline void cpu_svm_disable(void)
116{
117 uint64_t efer;
118
119 wrmsrl(MSR_VM_HSAVE_PA, 0);
120 rdmsrl(MSR_EFER, efer);
121 wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK);
122}
123
124/** Makes sure SVM is disabled, if it is supported on the CPU
125 */
126static inline void cpu_emergency_svm_disable(void)
127{
128 if (cpu_has_svm(NULL))
129 cpu_svm_disable();
130}
131
132#endif /* _ASM_X86_VIRTEX_H */
diff --git a/arch/x86/kvm/vmx.h b/arch/x86/include/asm/vmx.h
index ec5edc339da6..d0238e6151d8 100644
--- a/arch/x86/kvm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -63,10 +63,13 @@
63 63
64#define VM_EXIT_HOST_ADDR_SPACE_SIZE 0x00000200 64#define VM_EXIT_HOST_ADDR_SPACE_SIZE 0x00000200
65#define VM_EXIT_ACK_INTR_ON_EXIT 0x00008000 65#define VM_EXIT_ACK_INTR_ON_EXIT 0x00008000
66#define VM_EXIT_SAVE_IA32_PAT 0x00040000
67#define VM_EXIT_LOAD_IA32_PAT 0x00080000
66 68
67#define VM_ENTRY_IA32E_MODE 0x00000200 69#define VM_ENTRY_IA32E_MODE 0x00000200
68#define VM_ENTRY_SMM 0x00000400 70#define VM_ENTRY_SMM 0x00000400
69#define VM_ENTRY_DEACT_DUAL_MONITOR 0x00000800 71#define VM_ENTRY_DEACT_DUAL_MONITOR 0x00000800
72#define VM_ENTRY_LOAD_IA32_PAT 0x00004000
70 73
71/* VMCS Encodings */ 74/* VMCS Encodings */
72enum vmcs_field { 75enum vmcs_field {
@@ -112,6 +115,8 @@ enum vmcs_field {
112 VMCS_LINK_POINTER_HIGH = 0x00002801, 115 VMCS_LINK_POINTER_HIGH = 0x00002801,
113 GUEST_IA32_DEBUGCTL = 0x00002802, 116 GUEST_IA32_DEBUGCTL = 0x00002802,
114 GUEST_IA32_DEBUGCTL_HIGH = 0x00002803, 117 GUEST_IA32_DEBUGCTL_HIGH = 0x00002803,
118 GUEST_IA32_PAT = 0x00002804,
119 GUEST_IA32_PAT_HIGH = 0x00002805,
115 GUEST_PDPTR0 = 0x0000280a, 120 GUEST_PDPTR0 = 0x0000280a,
116 GUEST_PDPTR0_HIGH = 0x0000280b, 121 GUEST_PDPTR0_HIGH = 0x0000280b,
117 GUEST_PDPTR1 = 0x0000280c, 122 GUEST_PDPTR1 = 0x0000280c,
@@ -120,6 +125,8 @@ enum vmcs_field {
120 GUEST_PDPTR2_HIGH = 0x0000280f, 125 GUEST_PDPTR2_HIGH = 0x0000280f,
121 GUEST_PDPTR3 = 0x00002810, 126 GUEST_PDPTR3 = 0x00002810,
122 GUEST_PDPTR3_HIGH = 0x00002811, 127 GUEST_PDPTR3_HIGH = 0x00002811,
128 HOST_IA32_PAT = 0x00002c00,
129 HOST_IA32_PAT_HIGH = 0x00002c01,
123 PIN_BASED_VM_EXEC_CONTROL = 0x00004000, 130 PIN_BASED_VM_EXEC_CONTROL = 0x00004000,
124 CPU_BASED_VM_EXEC_CONTROL = 0x00004002, 131 CPU_BASED_VM_EXEC_CONTROL = 0x00004002,
125 EXCEPTION_BITMAP = 0x00004004, 132 EXCEPTION_BITMAP = 0x00004004,
@@ -331,8 +338,9 @@ enum vmcs_field {
331 338
332#define AR_RESERVD_MASK 0xfffe0f00 339#define AR_RESERVD_MASK 0xfffe0f00
333 340
334#define APIC_ACCESS_PAGE_PRIVATE_MEMSLOT 9 341#define TSS_PRIVATE_MEMSLOT (KVM_MEMORY_SLOTS + 0)
335#define IDENTITY_PAGETABLE_PRIVATE_MEMSLOT 10 342#define APIC_ACCESS_PAGE_PRIVATE_MEMSLOT (KVM_MEMORY_SLOTS + 1)
343#define IDENTITY_PAGETABLE_PRIVATE_MEMSLOT (KVM_MEMORY_SLOTS + 2)
336 344
337#define VMX_NR_VPIDS (1 << 16) 345#define VMX_NR_VPIDS (1 << 16)
338#define VMX_VPID_EXTENT_SINGLE_CONTEXT 1 346#define VMX_VPID_EXTENT_SINGLE_CONTEXT 1
@@ -356,4 +364,19 @@ enum vmcs_field {
356 364
357#define VMX_EPT_IDENTITY_PAGETABLE_ADDR 0xfffbc000ul 365#define VMX_EPT_IDENTITY_PAGETABLE_ADDR 0xfffbc000ul
358 366
367
368#define ASM_VMX_VMCLEAR_RAX ".byte 0x66, 0x0f, 0xc7, 0x30"
369#define ASM_VMX_VMLAUNCH ".byte 0x0f, 0x01, 0xc2"
370#define ASM_VMX_VMRESUME ".byte 0x0f, 0x01, 0xc3"
371#define ASM_VMX_VMPTRLD_RAX ".byte 0x0f, 0xc7, 0x30"
372#define ASM_VMX_VMREAD_RDX_RAX ".byte 0x0f, 0x78, 0xd0"
373#define ASM_VMX_VMWRITE_RAX_RDX ".byte 0x0f, 0x79, 0xd0"
374#define ASM_VMX_VMWRITE_RSP_RDX ".byte 0x0f, 0x79, 0xd4"
375#define ASM_VMX_VMXOFF ".byte 0x0f, 0x01, 0xc4"
376#define ASM_VMX_VMXON_RAX ".byte 0xf3, 0x0f, 0xc7, 0x30"
377#define ASM_VMX_INVEPT ".byte 0x66, 0x0f, 0x38, 0x80, 0x08"
378#define ASM_VMX_INVVPID ".byte 0x66, 0x0f, 0x38, 0x81, 0x08"
379
380
381
359#endif 382#endif
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 65d0b72777ea..d37593c2f438 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -47,7 +47,7 @@
47#endif 47#endif
48 48
49static int __initdata acpi_force = 0; 49static int __initdata acpi_force = 0;
50 50u32 acpi_rsdt_forced;
51#ifdef CONFIG_ACPI 51#ifdef CONFIG_ACPI
52int acpi_disabled = 0; 52int acpi_disabled = 0;
53#else 53#else
@@ -538,9 +538,10 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
538 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 538 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
539 union acpi_object *obj; 539 union acpi_object *obj;
540 struct acpi_madt_local_apic *lapic; 540 struct acpi_madt_local_apic *lapic;
541 cpumask_t tmp_map, new_map; 541 cpumask_var_t tmp_map, new_map;
542 u8 physid; 542 u8 physid;
543 int cpu; 543 int cpu;
544 int retval = -ENOMEM;
544 545
545 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer))) 546 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_MAT", NULL, &buffer)))
546 return -EINVAL; 547 return -EINVAL;
@@ -569,23 +570,37 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
569 buffer.length = ACPI_ALLOCATE_BUFFER; 570 buffer.length = ACPI_ALLOCATE_BUFFER;
570 buffer.pointer = NULL; 571 buffer.pointer = NULL;
571 572
572 tmp_map = cpu_present_map; 573 if (!alloc_cpumask_var(&tmp_map, GFP_KERNEL))
574 goto out;
575
576 if (!alloc_cpumask_var(&new_map, GFP_KERNEL))
577 goto free_tmp_map;
578
579 cpumask_copy(tmp_map, cpu_present_mask);
573 acpi_register_lapic(physid, lapic->lapic_flags & ACPI_MADT_ENABLED); 580 acpi_register_lapic(physid, lapic->lapic_flags & ACPI_MADT_ENABLED);
574 581
575 /* 582 /*
576 * If mp_register_lapic successfully generates a new logical cpu 583 * If mp_register_lapic successfully generates a new logical cpu
577 * number, then the following will get us exactly what was mapped 584 * number, then the following will get us exactly what was mapped
578 */ 585 */
579 cpus_andnot(new_map, cpu_present_map, tmp_map); 586 cpumask_andnot(new_map, cpu_present_mask, tmp_map);
580 if (cpus_empty(new_map)) { 587 if (cpumask_empty(new_map)) {
581 printk ("Unable to map lapic to logical cpu number\n"); 588 printk ("Unable to map lapic to logical cpu number\n");
582 return -EINVAL; 589 retval = -EINVAL;
590 goto free_new_map;
583 } 591 }
584 592
585 cpu = first_cpu(new_map); 593 cpu = cpumask_first(new_map);
586 594
587 *pcpu = cpu; 595 *pcpu = cpu;
588 return 0; 596 retval = 0;
597
598free_new_map:
599 free_cpumask_var(new_map);
600free_tmp_map:
601 free_cpumask_var(tmp_map);
602out:
603 return retval;
589} 604}
590 605
591/* wrapper to silence section mismatch warning */ 606/* wrapper to silence section mismatch warning */
@@ -598,7 +613,7 @@ EXPORT_SYMBOL(acpi_map_lsapic);
598int acpi_unmap_lsapic(int cpu) 613int acpi_unmap_lsapic(int cpu)
599{ 614{
600 per_cpu(x86_cpu_to_apicid, cpu) = -1; 615 per_cpu(x86_cpu_to_apicid, cpu) = -1;
601 cpu_clear(cpu, cpu_present_map); 616 set_cpu_present(cpu, false);
602 num_processors--; 617 num_processors--;
603 618
604 return (0); 619 return (0);
@@ -1359,6 +1374,17 @@ static void __init acpi_process_madt(void)
1359 "Invalid BIOS MADT, disabling ACPI\n"); 1374 "Invalid BIOS MADT, disabling ACPI\n");
1360 disable_acpi(); 1375 disable_acpi();
1361 } 1376 }
1377 } else {
1378 /*
1379 * ACPI found no MADT, and so ACPI wants UP PIC mode.
1380 * In the event an MPS table was found, forget it.
1381 * Boot with "acpi=off" to use MPS on such a system.
1382 */
1383 if (smp_found_config) {
1384 printk(KERN_WARNING PREFIX
1385 "No APIC-table, disabling MPS\n");
1386 smp_found_config = 0;
1387 }
1362 } 1388 }
1363 1389
1364 /* 1390 /*
@@ -1794,6 +1820,10 @@ static int __init parse_acpi(char *arg)
1794 disable_acpi(); 1820 disable_acpi();
1795 acpi_ht = 1; 1821 acpi_ht = 1;
1796 } 1822 }
1823 /* acpi=rsdt use RSDT instead of XSDT */
1824 else if (strcmp(arg, "rsdt") == 0) {
1825 acpi_rsdt_forced = 1;
1826 }
1797 /* "acpi=noirq" disables ACPI interrupt routing */ 1827 /* "acpi=noirq" disables ACPI interrupt routing */
1798 else if (strcmp(arg, "noirq") == 0) { 1828 else if (strcmp(arg, "noirq") == 0) {
1799 acpi_noirq_set(); 1829 acpi_noirq_set();
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index c2502eb9aa83..bbbe4bbb6f34 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -56,6 +56,7 @@ static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */
56static short mwait_supported[ACPI_PROCESSOR_MAX_POWER]; 56static short mwait_supported[ACPI_PROCESSOR_MAX_POWER];
57 57
58#define MWAIT_SUBSTATE_MASK (0xf) 58#define MWAIT_SUBSTATE_MASK (0xf)
59#define MWAIT_CSTATE_MASK (0xf)
59#define MWAIT_SUBSTATE_SIZE (4) 60#define MWAIT_SUBSTATE_SIZE (4)
60 61
61#define CPUID_MWAIT_LEAF (5) 62#define CPUID_MWAIT_LEAF (5)
@@ -66,39 +67,20 @@ static short mwait_supported[ACPI_PROCESSOR_MAX_POWER];
66 67
67#define NATIVE_CSTATE_BEYOND_HALT (2) 68#define NATIVE_CSTATE_BEYOND_HALT (2)
68 69
69int acpi_processor_ffh_cstate_probe(unsigned int cpu, 70static long acpi_processor_ffh_cstate_probe_cpu(void *_cx)
70 struct acpi_processor_cx *cx, struct acpi_power_register *reg)
71{ 71{
72 struct cstate_entry *percpu_entry; 72 struct acpi_processor_cx *cx = _cx;
73 struct cpuinfo_x86 *c = &cpu_data(cpu); 73 long retval;
74
75 cpumask_t saved_mask;
76 int retval;
77 unsigned int eax, ebx, ecx, edx; 74 unsigned int eax, ebx, ecx, edx;
78 unsigned int edx_part; 75 unsigned int edx_part;
79 unsigned int cstate_type; /* C-state type and not ACPI C-state type */ 76 unsigned int cstate_type; /* C-state type and not ACPI C-state type */
80 unsigned int num_cstate_subtype; 77 unsigned int num_cstate_subtype;
81 78
82 if (!cpu_cstate_entry || c->cpuid_level < CPUID_MWAIT_LEAF )
83 return -1;
84
85 if (reg->bit_offset != NATIVE_CSTATE_BEYOND_HALT)
86 return -1;
87
88 percpu_entry = per_cpu_ptr(cpu_cstate_entry, cpu);
89 percpu_entry->states[cx->index].eax = 0;
90 percpu_entry->states[cx->index].ecx = 0;
91
92 /* Make sure we are running on right CPU */
93 saved_mask = current->cpus_allowed;
94 retval = set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
95 if (retval)
96 return -1;
97
98 cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx); 79 cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx);
99 80
100 /* Check whether this particular cx_type (in CST) is supported or not */ 81 /* Check whether this particular cx_type (in CST) is supported or not */
101 cstate_type = (cx->address >> MWAIT_SUBSTATE_SIZE) + 1; 82 cstate_type = ((cx->address >> MWAIT_SUBSTATE_SIZE) &
83 MWAIT_CSTATE_MASK) + 1;
102 edx_part = edx >> (cstate_type * MWAIT_SUBSTATE_SIZE); 84 edx_part = edx >> (cstate_type * MWAIT_SUBSTATE_SIZE);
103 num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK; 85 num_cstate_subtype = edx_part & MWAIT_SUBSTATE_MASK;
104 86
@@ -114,21 +96,45 @@ int acpi_processor_ffh_cstate_probe(unsigned int cpu,
114 retval = -1; 96 retval = -1;
115 goto out; 97 goto out;
116 } 98 }
117 percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK;
118
119 /* Use the hint in CST */
120 percpu_entry->states[cx->index].eax = cx->address;
121 99
122 if (!mwait_supported[cstate_type]) { 100 if (!mwait_supported[cstate_type]) {
123 mwait_supported[cstate_type] = 1; 101 mwait_supported[cstate_type] = 1;
124 printk(KERN_DEBUG "Monitor-Mwait will be used to enter C-%d " 102 printk(KERN_DEBUG
125 "state\n", cx->type); 103 "Monitor-Mwait will be used to enter C-%d "
104 "state\n", cx->type);
126 } 105 }
127 snprintf(cx->desc, ACPI_CX_DESC_LEN, "ACPI FFH INTEL MWAIT 0x%x", 106 snprintf(cx->desc,
128 cx->address); 107 ACPI_CX_DESC_LEN, "ACPI FFH INTEL MWAIT 0x%x",
129 108 cx->address);
130out: 109out:
131 set_cpus_allowed_ptr(current, &saved_mask); 110 return retval;
111}
112
113int acpi_processor_ffh_cstate_probe(unsigned int cpu,
114 struct acpi_processor_cx *cx, struct acpi_power_register *reg)
115{
116 struct cstate_entry *percpu_entry;
117 struct cpuinfo_x86 *c = &cpu_data(cpu);
118 long retval;
119
120 if (!cpu_cstate_entry || c->cpuid_level < CPUID_MWAIT_LEAF)
121 return -1;
122
123 if (reg->bit_offset != NATIVE_CSTATE_BEYOND_HALT)
124 return -1;
125
126 percpu_entry = per_cpu_ptr(cpu_cstate_entry, cpu);
127 percpu_entry->states[cx->index].eax = 0;
128 percpu_entry->states[cx->index].ecx = 0;
129
130 /* Make sure we are running on right CPU */
131
132 retval = work_on_cpu(cpu, acpi_processor_ffh_cstate_probe_cpu, cx);
133 if (retval == 0) {
134 /* Use the hint in CST */
135 percpu_entry->states[cx->index].eax = cx->address;
136 percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK;
137 }
132 return retval; 138 return retval;
133} 139}
134EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); 140EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe);
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 806b4e9051b4..707c1f6f95fa 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -159,6 +159,8 @@ static int __init acpi_sleep_setup(char *str)
159#endif 159#endif
160 if (strncmp(str, "old_ordering", 12) == 0) 160 if (strncmp(str, "old_ordering", 12) == 0)
161 acpi_old_suspend_ordering(); 161 acpi_old_suspend_ordering();
162 if (strncmp(str, "s4_nonvs", 8) == 0)
163 acpi_s4_no_nvs();
162 str = strchr(str, ','); 164 str = strchr(str, ',');
163 if (str != NULL) 165 if (str != NULL)
164 str += strspn(str, ", \t"); 166 str += strspn(str, ", \t");
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 2e2da717b350..5113c080f0c4 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -20,8 +20,12 @@
20#include <linux/pci.h> 20#include <linux/pci.h>
21#include <linux/gfp.h> 21#include <linux/gfp.h>
22#include <linux/bitops.h> 22#include <linux/bitops.h>
23#include <linux/debugfs.h>
23#include <linux/scatterlist.h> 24#include <linux/scatterlist.h>
24#include <linux/iommu-helper.h> 25#include <linux/iommu-helper.h>
26#ifdef CONFIG_IOMMU_API
27#include <linux/iommu.h>
28#endif
25#include <asm/proto.h> 29#include <asm/proto.h>
26#include <asm/iommu.h> 30#include <asm/iommu.h>
27#include <asm/gart.h> 31#include <asm/gart.h>
@@ -38,6 +42,10 @@ static DEFINE_RWLOCK(amd_iommu_devtable_lock);
38static LIST_HEAD(iommu_pd_list); 42static LIST_HEAD(iommu_pd_list);
39static DEFINE_SPINLOCK(iommu_pd_list_lock); 43static DEFINE_SPINLOCK(iommu_pd_list_lock);
40 44
45#ifdef CONFIG_IOMMU_API
46static struct iommu_ops amd_iommu_ops;
47#endif
48
41/* 49/*
42 * general struct to manage commands send to an IOMMU 50 * general struct to manage commands send to an IOMMU
43 */ 51 */
@@ -47,6 +55,68 @@ struct iommu_cmd {
47 55
48static int dma_ops_unity_map(struct dma_ops_domain *dma_dom, 56static int dma_ops_unity_map(struct dma_ops_domain *dma_dom,
49 struct unity_map_entry *e); 57 struct unity_map_entry *e);
58static struct dma_ops_domain *find_protection_domain(u16 devid);
59
60
61#ifdef CONFIG_AMD_IOMMU_STATS
62
63/*
64 * Initialization code for statistics collection
65 */
66
67DECLARE_STATS_COUNTER(compl_wait);
68DECLARE_STATS_COUNTER(cnt_map_single);
69DECLARE_STATS_COUNTER(cnt_unmap_single);
70DECLARE_STATS_COUNTER(cnt_map_sg);
71DECLARE_STATS_COUNTER(cnt_unmap_sg);
72DECLARE_STATS_COUNTER(cnt_alloc_coherent);
73DECLARE_STATS_COUNTER(cnt_free_coherent);
74DECLARE_STATS_COUNTER(cross_page);
75DECLARE_STATS_COUNTER(domain_flush_single);
76DECLARE_STATS_COUNTER(domain_flush_all);
77DECLARE_STATS_COUNTER(alloced_io_mem);
78DECLARE_STATS_COUNTER(total_map_requests);
79
80static struct dentry *stats_dir;
81static struct dentry *de_isolate;
82static struct dentry *de_fflush;
83
84static void amd_iommu_stats_add(struct __iommu_counter *cnt)
85{
86 if (stats_dir == NULL)
87 return;
88
89 cnt->dent = debugfs_create_u64(cnt->name, 0444, stats_dir,
90 &cnt->value);
91}
92
93static void amd_iommu_stats_init(void)
94{
95 stats_dir = debugfs_create_dir("amd-iommu", NULL);
96 if (stats_dir == NULL)
97 return;
98
99 de_isolate = debugfs_create_bool("isolation", 0444, stats_dir,
100 (u32 *)&amd_iommu_isolate);
101
102 de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir,
103 (u32 *)&amd_iommu_unmap_flush);
104
105 amd_iommu_stats_add(&compl_wait);
106 amd_iommu_stats_add(&cnt_map_single);
107 amd_iommu_stats_add(&cnt_unmap_single);
108 amd_iommu_stats_add(&cnt_map_sg);
109 amd_iommu_stats_add(&cnt_unmap_sg);
110 amd_iommu_stats_add(&cnt_alloc_coherent);
111 amd_iommu_stats_add(&cnt_free_coherent);
112 amd_iommu_stats_add(&cross_page);
113 amd_iommu_stats_add(&domain_flush_single);
114 amd_iommu_stats_add(&domain_flush_all);
115 amd_iommu_stats_add(&alloced_io_mem);
116 amd_iommu_stats_add(&total_map_requests);
117}
118
119#endif
50 120
51/* returns !0 if the IOMMU is caching non-present entries in its TLB */ 121/* returns !0 if the IOMMU is caching non-present entries in its TLB */
52static int iommu_has_npcache(struct amd_iommu *iommu) 122static int iommu_has_npcache(struct amd_iommu *iommu)
@@ -189,13 +259,55 @@ static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)
189 spin_lock_irqsave(&iommu->lock, flags); 259 spin_lock_irqsave(&iommu->lock, flags);
190 ret = __iommu_queue_command(iommu, cmd); 260 ret = __iommu_queue_command(iommu, cmd);
191 if (!ret) 261 if (!ret)
192 iommu->need_sync = 1; 262 iommu->need_sync = true;
193 spin_unlock_irqrestore(&iommu->lock, flags); 263 spin_unlock_irqrestore(&iommu->lock, flags);
194 264
195 return ret; 265 return ret;
196} 266}
197 267
198/* 268/*
269 * This function waits until an IOMMU has completed a completion
270 * wait command
271 */
272static void __iommu_wait_for_completion(struct amd_iommu *iommu)
273{
274 int ready = 0;
275 unsigned status = 0;
276 unsigned long i = 0;
277
278 INC_STATS_COUNTER(compl_wait);
279
280 while (!ready && (i < EXIT_LOOP_COUNT)) {
281 ++i;
282 /* wait for the bit to become one */
283 status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
284 ready = status & MMIO_STATUS_COM_WAIT_INT_MASK;
285 }
286
287 /* set bit back to zero */
288 status &= ~MMIO_STATUS_COM_WAIT_INT_MASK;
289 writel(status, iommu->mmio_base + MMIO_STATUS_OFFSET);
290
291 if (unlikely(i == EXIT_LOOP_COUNT))
292 panic("AMD IOMMU: Completion wait loop failed\n");
293}
294
295/*
296 * This function queues a completion wait command into the command
297 * buffer of an IOMMU
298 */
299static int __iommu_completion_wait(struct amd_iommu *iommu)
300{
301 struct iommu_cmd cmd;
302
303 memset(&cmd, 0, sizeof(cmd));
304 cmd.data[0] = CMD_COMPL_WAIT_INT_MASK;
305 CMD_SET_TYPE(&cmd, CMD_COMPL_WAIT);
306
307 return __iommu_queue_command(iommu, &cmd);
308}
309
310/*
199 * This function is called whenever we need to ensure that the IOMMU has 311 * This function is called whenever we need to ensure that the IOMMU has
200 * completed execution of all commands we sent. It sends a 312 * completed execution of all commands we sent. It sends a
201 * COMPLETION_WAIT command and waits for it to finish. The IOMMU informs 313 * COMPLETION_WAIT command and waits for it to finish. The IOMMU informs
@@ -204,40 +316,22 @@ static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd)
204 */ 316 */
205static int iommu_completion_wait(struct amd_iommu *iommu) 317static int iommu_completion_wait(struct amd_iommu *iommu)
206{ 318{
207 int ret = 0, ready = 0; 319 int ret = 0;
208 unsigned status = 0; 320 unsigned long flags;
209 struct iommu_cmd cmd;
210 unsigned long flags, i = 0;
211
212 memset(&cmd, 0, sizeof(cmd));
213 cmd.data[0] = CMD_COMPL_WAIT_INT_MASK;
214 CMD_SET_TYPE(&cmd, CMD_COMPL_WAIT);
215 321
216 spin_lock_irqsave(&iommu->lock, flags); 322 spin_lock_irqsave(&iommu->lock, flags);
217 323
218 if (!iommu->need_sync) 324 if (!iommu->need_sync)
219 goto out; 325 goto out;
220 326
221 iommu->need_sync = 0; 327 ret = __iommu_completion_wait(iommu);
222 328
223 ret = __iommu_queue_command(iommu, &cmd); 329 iommu->need_sync = false;
224 330
225 if (ret) 331 if (ret)
226 goto out; 332 goto out;
227 333
228 while (!ready && (i < EXIT_LOOP_COUNT)) { 334 __iommu_wait_for_completion(iommu);
229 ++i;
230 /* wait for the bit to become one */
231 status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
232 ready = status & MMIO_STATUS_COM_WAIT_INT_MASK;
233 }
234
235 /* set bit back to zero */
236 status &= ~MMIO_STATUS_COM_WAIT_INT_MASK;
237 writel(status, iommu->mmio_base + MMIO_STATUS_OFFSET);
238
239 if (unlikely(i == EXIT_LOOP_COUNT))
240 panic("AMD IOMMU: Completion wait loop failed\n");
241 335
242out: 336out:
243 spin_unlock_irqrestore(&iommu->lock, flags); 337 spin_unlock_irqrestore(&iommu->lock, flags);
@@ -264,6 +358,21 @@ static int iommu_queue_inv_dev_entry(struct amd_iommu *iommu, u16 devid)
264 return ret; 358 return ret;
265} 359}
266 360
361static void __iommu_build_inv_iommu_pages(struct iommu_cmd *cmd, u64 address,
362 u16 domid, int pde, int s)
363{
364 memset(cmd, 0, sizeof(*cmd));
365 address &= PAGE_MASK;
366 CMD_SET_TYPE(cmd, CMD_INV_IOMMU_PAGES);
367 cmd->data[1] |= domid;
368 cmd->data[2] = lower_32_bits(address);
369 cmd->data[3] = upper_32_bits(address);
370 if (s) /* size bit - we flush more than one 4kb page */
371 cmd->data[2] |= CMD_INV_IOMMU_PAGES_SIZE_MASK;
372 if (pde) /* PDE bit - we wan't flush everything not only the PTEs */
373 cmd->data[2] |= CMD_INV_IOMMU_PAGES_PDE_MASK;
374}
375
267/* 376/*
268 * Generic command send function for invalidaing TLB entries 377 * Generic command send function for invalidaing TLB entries
269 */ 378 */
@@ -273,16 +382,7 @@ static int iommu_queue_inv_iommu_pages(struct amd_iommu *iommu,
273 struct iommu_cmd cmd; 382 struct iommu_cmd cmd;
274 int ret; 383 int ret;
275 384
276 memset(&cmd, 0, sizeof(cmd)); 385 __iommu_build_inv_iommu_pages(&cmd, address, domid, pde, s);
277 address &= PAGE_MASK;
278 CMD_SET_TYPE(&cmd, CMD_INV_IOMMU_PAGES);
279 cmd.data[1] |= domid;
280 cmd.data[2] = lower_32_bits(address);
281 cmd.data[3] = upper_32_bits(address);
282 if (s) /* size bit - we flush more than one 4kb page */
283 cmd.data[2] |= CMD_INV_IOMMU_PAGES_SIZE_MASK;
284 if (pde) /* PDE bit - we wan't flush everything not only the PTEs */
285 cmd.data[2] |= CMD_INV_IOMMU_PAGES_PDE_MASK;
286 386
287 ret = iommu_queue_command(iommu, &cmd); 387 ret = iommu_queue_command(iommu, &cmd);
288 388
@@ -321,9 +421,35 @@ static void iommu_flush_tlb(struct amd_iommu *iommu, u16 domid)
321{ 421{
322 u64 address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS; 422 u64 address = CMD_INV_IOMMU_ALL_PAGES_ADDRESS;
323 423
424 INC_STATS_COUNTER(domain_flush_single);
425
324 iommu_queue_inv_iommu_pages(iommu, address, domid, 0, 1); 426 iommu_queue_inv_iommu_pages(iommu, address, domid, 0, 1);
325} 427}
326 428
429/*
430 * This function is used to flush the IO/TLB for a given protection domain
431 * on every IOMMU in the system
432 */
433static void iommu_flush_domain(u16 domid)
434{
435 unsigned long flags;
436 struct amd_iommu *iommu;
437 struct iommu_cmd cmd;
438
439 INC_STATS_COUNTER(domain_flush_all);
440
441 __iommu_build_inv_iommu_pages(&cmd, CMD_INV_IOMMU_ALL_PAGES_ADDRESS,
442 domid, 1, 1);
443
444 list_for_each_entry(iommu, &amd_iommu_list, list) {
445 spin_lock_irqsave(&iommu->lock, flags);
446 __iommu_queue_command(iommu, &cmd);
447 __iommu_completion_wait(iommu);
448 __iommu_wait_for_completion(iommu);
449 spin_unlock_irqrestore(&iommu->lock, flags);
450 }
451}
452
327/**************************************************************************** 453/****************************************************************************
328 * 454 *
329 * The functions below are used the create the page table mappings for 455 * The functions below are used the create the page table mappings for
@@ -338,10 +464,10 @@ static void iommu_flush_tlb(struct amd_iommu *iommu, u16 domid)
338 * supporting all features of AMD IOMMU page tables like level skipping 464 * supporting all features of AMD IOMMU page tables like level skipping
339 * and full 64 bit address spaces. 465 * and full 64 bit address spaces.
340 */ 466 */
341static int iommu_map(struct protection_domain *dom, 467static int iommu_map_page(struct protection_domain *dom,
342 unsigned long bus_addr, 468 unsigned long bus_addr,
343 unsigned long phys_addr, 469 unsigned long phys_addr,
344 int prot) 470 int prot)
345{ 471{
346 u64 __pte, *pte, *page; 472 u64 __pte, *pte, *page;
347 473
@@ -388,6 +514,28 @@ static int iommu_map(struct protection_domain *dom,
388 return 0; 514 return 0;
389} 515}
390 516
517static void iommu_unmap_page(struct protection_domain *dom,
518 unsigned long bus_addr)
519{
520 u64 *pte;
521
522 pte = &dom->pt_root[IOMMU_PTE_L2_INDEX(bus_addr)];
523
524 if (!IOMMU_PTE_PRESENT(*pte))
525 return;
526
527 pte = IOMMU_PTE_PAGE(*pte);
528 pte = &pte[IOMMU_PTE_L1_INDEX(bus_addr)];
529
530 if (!IOMMU_PTE_PRESENT(*pte))
531 return;
532
533 pte = IOMMU_PTE_PAGE(*pte);
534 pte = &pte[IOMMU_PTE_L1_INDEX(bus_addr)];
535
536 *pte = 0;
537}
538
391/* 539/*
392 * This function checks if a specific unity mapping entry is needed for 540 * This function checks if a specific unity mapping entry is needed for
393 * this specific IOMMU. 541 * this specific IOMMU.
@@ -440,7 +588,7 @@ static int dma_ops_unity_map(struct dma_ops_domain *dma_dom,
440 588
441 for (addr = e->address_start; addr < e->address_end; 589 for (addr = e->address_start; addr < e->address_end;
442 addr += PAGE_SIZE) { 590 addr += PAGE_SIZE) {
443 ret = iommu_map(&dma_dom->domain, addr, addr, e->prot); 591 ret = iommu_map_page(&dma_dom->domain, addr, addr, e->prot);
444 if (ret) 592 if (ret)
445 return ret; 593 return ret;
446 /* 594 /*
@@ -571,6 +719,16 @@ static u16 domain_id_alloc(void)
571 return id; 719 return id;
572} 720}
573 721
722static void domain_id_free(int id)
723{
724 unsigned long flags;
725
726 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
727 if (id > 0 && id < MAX_DOMAIN_ID)
728 __clear_bit(id, amd_iommu_pd_alloc_bitmap);
729 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
730}
731
574/* 732/*
575 * Used to reserve address ranges in the aperture (e.g. for exclusion 733 * Used to reserve address ranges in the aperture (e.g. for exclusion
576 * ranges. 734 * ranges.
@@ -587,12 +745,12 @@ static void dma_ops_reserve_addresses(struct dma_ops_domain *dom,
587 iommu_area_reserve(dom->bitmap, start_page, pages); 745 iommu_area_reserve(dom->bitmap, start_page, pages);
588} 746}
589 747
590static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom) 748static void free_pagetable(struct protection_domain *domain)
591{ 749{
592 int i, j; 750 int i, j;
593 u64 *p1, *p2, *p3; 751 u64 *p1, *p2, *p3;
594 752
595 p1 = dma_dom->domain.pt_root; 753 p1 = domain->pt_root;
596 754
597 if (!p1) 755 if (!p1)
598 return; 756 return;
@@ -613,6 +771,8 @@ static void dma_ops_free_pagetable(struct dma_ops_domain *dma_dom)
613 } 771 }
614 772
615 free_page((unsigned long)p1); 773 free_page((unsigned long)p1);
774
775 domain->pt_root = NULL;
616} 776}
617 777
618/* 778/*
@@ -624,7 +784,7 @@ static void dma_ops_domain_free(struct dma_ops_domain *dom)
624 if (!dom) 784 if (!dom)
625 return; 785 return;
626 786
627 dma_ops_free_pagetable(dom); 787 free_pagetable(&dom->domain);
628 788
629 kfree(dom->pte_pages); 789 kfree(dom->pte_pages);
630 790
@@ -663,6 +823,7 @@ static struct dma_ops_domain *dma_ops_domain_alloc(struct amd_iommu *iommu,
663 goto free_dma_dom; 823 goto free_dma_dom;
664 dma_dom->domain.mode = PAGE_MODE_3_LEVEL; 824 dma_dom->domain.mode = PAGE_MODE_3_LEVEL;
665 dma_dom->domain.pt_root = (void *)get_zeroed_page(GFP_KERNEL); 825 dma_dom->domain.pt_root = (void *)get_zeroed_page(GFP_KERNEL);
826 dma_dom->domain.flags = PD_DMA_OPS_MASK;
666 dma_dom->domain.priv = dma_dom; 827 dma_dom->domain.priv = dma_dom;
667 if (!dma_dom->domain.pt_root) 828 if (!dma_dom->domain.pt_root)
668 goto free_dma_dom; 829 goto free_dma_dom;
@@ -725,6 +886,15 @@ free_dma_dom:
725} 886}
726 887
727/* 888/*
889 * little helper function to check whether a given protection domain is a
890 * dma_ops domain
891 */
892static bool dma_ops_domain(struct protection_domain *domain)
893{
894 return domain->flags & PD_DMA_OPS_MASK;
895}
896
897/*
728 * Find out the protection domain structure for a given PCI device. This 898 * Find out the protection domain structure for a given PCI device. This
729 * will give us the pointer to the page table root for example. 899 * will give us the pointer to the page table root for example.
730 */ 900 */
@@ -744,14 +914,15 @@ static struct protection_domain *domain_for_device(u16 devid)
744 * If a device is not yet associated with a domain, this function does 914 * If a device is not yet associated with a domain, this function does
745 * assigns it visible for the hardware 915 * assigns it visible for the hardware
746 */ 916 */
747static void set_device_domain(struct amd_iommu *iommu, 917static void attach_device(struct amd_iommu *iommu,
748 struct protection_domain *domain, 918 struct protection_domain *domain,
749 u16 devid) 919 u16 devid)
750{ 920{
751 unsigned long flags; 921 unsigned long flags;
752
753 u64 pte_root = virt_to_phys(domain->pt_root); 922 u64 pte_root = virt_to_phys(domain->pt_root);
754 923
924 domain->dev_cnt += 1;
925
755 pte_root |= (domain->mode & DEV_ENTRY_MODE_MASK) 926 pte_root |= (domain->mode & DEV_ENTRY_MODE_MASK)
756 << DEV_ENTRY_MODE_SHIFT; 927 << DEV_ENTRY_MODE_SHIFT;
757 pte_root |= IOMMU_PTE_IR | IOMMU_PTE_IW | IOMMU_PTE_P | IOMMU_PTE_TV; 928 pte_root |= IOMMU_PTE_IR | IOMMU_PTE_IW | IOMMU_PTE_P | IOMMU_PTE_TV;
@@ -767,6 +938,116 @@ static void set_device_domain(struct amd_iommu *iommu,
767 iommu_queue_inv_dev_entry(iommu, devid); 938 iommu_queue_inv_dev_entry(iommu, devid);
768} 939}
769 940
941/*
942 * Removes a device from a protection domain (unlocked)
943 */
944static void __detach_device(struct protection_domain *domain, u16 devid)
945{
946
947 /* lock domain */
948 spin_lock(&domain->lock);
949
950 /* remove domain from the lookup table */
951 amd_iommu_pd_table[devid] = NULL;
952
953 /* remove entry from the device table seen by the hardware */
954 amd_iommu_dev_table[devid].data[0] = IOMMU_PTE_P | IOMMU_PTE_TV;
955 amd_iommu_dev_table[devid].data[1] = 0;
956 amd_iommu_dev_table[devid].data[2] = 0;
957
958 /* decrease reference counter */
959 domain->dev_cnt -= 1;
960
961 /* ready */
962 spin_unlock(&domain->lock);
963}
964
965/*
966 * Removes a device from a protection domain (with devtable_lock held)
967 */
968static void detach_device(struct protection_domain *domain, u16 devid)
969{
970 unsigned long flags;
971
972 /* lock device table */
973 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
974 __detach_device(domain, devid);
975 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
976}
977
978static int device_change_notifier(struct notifier_block *nb,
979 unsigned long action, void *data)
980{
981 struct device *dev = data;
982 struct pci_dev *pdev = to_pci_dev(dev);
983 u16 devid = calc_devid(pdev->bus->number, pdev->devfn);
984 struct protection_domain *domain;
985 struct dma_ops_domain *dma_domain;
986 struct amd_iommu *iommu;
987 int order = amd_iommu_aperture_order;
988 unsigned long flags;
989
990 if (devid > amd_iommu_last_bdf)
991 goto out;
992
993 devid = amd_iommu_alias_table[devid];
994
995 iommu = amd_iommu_rlookup_table[devid];
996 if (iommu == NULL)
997 goto out;
998
999 domain = domain_for_device(devid);
1000
1001 if (domain && !dma_ops_domain(domain))
1002 WARN_ONCE(1, "AMD IOMMU WARNING: device %s already bound "
1003 "to a non-dma-ops domain\n", dev_name(dev));
1004
1005 switch (action) {
1006 case BUS_NOTIFY_BOUND_DRIVER:
1007 if (domain)
1008 goto out;
1009 dma_domain = find_protection_domain(devid);
1010 if (!dma_domain)
1011 dma_domain = iommu->default_dom;
1012 attach_device(iommu, &dma_domain->domain, devid);
1013 printk(KERN_INFO "AMD IOMMU: Using protection domain %d for "
1014 "device %s\n", dma_domain->domain.id, dev_name(dev));
1015 break;
1016 case BUS_NOTIFY_UNBIND_DRIVER:
1017 if (!domain)
1018 goto out;
1019 detach_device(domain, devid);
1020 break;
1021 case BUS_NOTIFY_ADD_DEVICE:
1022 /* allocate a protection domain if a device is added */
1023 dma_domain = find_protection_domain(devid);
1024 if (dma_domain)
1025 goto out;
1026 dma_domain = dma_ops_domain_alloc(iommu, order);
1027 if (!dma_domain)
1028 goto out;
1029 dma_domain->target_dev = devid;
1030
1031 spin_lock_irqsave(&iommu_pd_list_lock, flags);
1032 list_add_tail(&dma_domain->list, &iommu_pd_list);
1033 spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
1034
1035 break;
1036 default:
1037 goto out;
1038 }
1039
1040 iommu_queue_inv_dev_entry(iommu, devid);
1041 iommu_completion_wait(iommu);
1042
1043out:
1044 return 0;
1045}
1046
1047struct notifier_block device_nb = {
1048 .notifier_call = device_change_notifier,
1049};
1050
770/***************************************************************************** 1051/*****************************************************************************
771 * 1052 *
772 * The next functions belong to the dma_ops mapping/unmapping code. 1053 * The next functions belong to the dma_ops mapping/unmapping code.
@@ -802,7 +1083,6 @@ static struct dma_ops_domain *find_protection_domain(u16 devid)
802 list_for_each_entry(entry, &iommu_pd_list, list) { 1083 list_for_each_entry(entry, &iommu_pd_list, list) {
803 if (entry->target_dev == devid) { 1084 if (entry->target_dev == devid) {
804 ret = entry; 1085 ret = entry;
805 list_del(&ret->list);
806 break; 1086 break;
807 } 1087 }
808 } 1088 }
@@ -853,14 +1133,13 @@ static int get_device_resources(struct device *dev,
853 if (!dma_dom) 1133 if (!dma_dom)
854 dma_dom = (*iommu)->default_dom; 1134 dma_dom = (*iommu)->default_dom;
855 *domain = &dma_dom->domain; 1135 *domain = &dma_dom->domain;
856 set_device_domain(*iommu, *domain, *bdf); 1136 attach_device(*iommu, *domain, *bdf);
857 printk(KERN_INFO "AMD IOMMU: Using protection domain %d for " 1137 printk(KERN_INFO "AMD IOMMU: Using protection domain %d for "
858 "device ", (*domain)->id); 1138 "device %s\n", (*domain)->id, dev_name(dev));
859 print_devid(_bdf, 1);
860 } 1139 }
861 1140
862 if (domain_for_device(_bdf) == NULL) 1141 if (domain_for_device(_bdf) == NULL)
863 set_device_domain(*iommu, *domain, _bdf); 1142 attach_device(*iommu, *domain, _bdf);
864 1143
865 return 1; 1144 return 1;
866} 1145}
@@ -946,6 +1225,11 @@ static dma_addr_t __map_single(struct device *dev,
946 pages = iommu_num_pages(paddr, size, PAGE_SIZE); 1225 pages = iommu_num_pages(paddr, size, PAGE_SIZE);
947 paddr &= PAGE_MASK; 1226 paddr &= PAGE_MASK;
948 1227
1228 INC_STATS_COUNTER(total_map_requests);
1229
1230 if (pages > 1)
1231 INC_STATS_COUNTER(cross_page);
1232
949 if (align) 1233 if (align)
950 align_mask = (1UL << get_order(size)) - 1; 1234 align_mask = (1UL << get_order(size)) - 1;
951 1235
@@ -962,6 +1246,8 @@ static dma_addr_t __map_single(struct device *dev,
962 } 1246 }
963 address += offset; 1247 address += offset;
964 1248
1249 ADD_STATS_COUNTER(alloced_io_mem, size);
1250
965 if (unlikely(dma_dom->need_flush && !amd_iommu_unmap_flush)) { 1251 if (unlikely(dma_dom->need_flush && !amd_iommu_unmap_flush)) {
966 iommu_flush_tlb(iommu, dma_dom->domain.id); 1252 iommu_flush_tlb(iommu, dma_dom->domain.id);
967 dma_dom->need_flush = false; 1253 dma_dom->need_flush = false;
@@ -998,6 +1284,8 @@ static void __unmap_single(struct amd_iommu *iommu,
998 start += PAGE_SIZE; 1284 start += PAGE_SIZE;
999 } 1285 }
1000 1286
1287 SUB_STATS_COUNTER(alloced_io_mem, size);
1288
1001 dma_ops_free_addresses(dma_dom, dma_addr, pages); 1289 dma_ops_free_addresses(dma_dom, dma_addr, pages);
1002 1290
1003 if (amd_iommu_unmap_flush || dma_dom->need_flush) { 1291 if (amd_iommu_unmap_flush || dma_dom->need_flush) {
@@ -1019,6 +1307,8 @@ static dma_addr_t map_single(struct device *dev, phys_addr_t paddr,
1019 dma_addr_t addr; 1307 dma_addr_t addr;
1020 u64 dma_mask; 1308 u64 dma_mask;
1021 1309
1310 INC_STATS_COUNTER(cnt_map_single);
1311
1022 if (!check_device(dev)) 1312 if (!check_device(dev))
1023 return bad_dma_address; 1313 return bad_dma_address;
1024 1314
@@ -1030,6 +1320,9 @@ static dma_addr_t map_single(struct device *dev, phys_addr_t paddr,
1030 /* device not handled by any AMD IOMMU */ 1320 /* device not handled by any AMD IOMMU */
1031 return (dma_addr_t)paddr; 1321 return (dma_addr_t)paddr;
1032 1322
1323 if (!dma_ops_domain(domain))
1324 return bad_dma_address;
1325
1033 spin_lock_irqsave(&domain->lock, flags); 1326 spin_lock_irqsave(&domain->lock, flags);
1034 addr = __map_single(dev, iommu, domain->priv, paddr, size, dir, false, 1327 addr = __map_single(dev, iommu, domain->priv, paddr, size, dir, false,
1035 dma_mask); 1328 dma_mask);
@@ -1055,11 +1348,16 @@ static void unmap_single(struct device *dev, dma_addr_t dma_addr,
1055 struct protection_domain *domain; 1348 struct protection_domain *domain;
1056 u16 devid; 1349 u16 devid;
1057 1350
1351 INC_STATS_COUNTER(cnt_unmap_single);
1352
1058 if (!check_device(dev) || 1353 if (!check_device(dev) ||
1059 !get_device_resources(dev, &iommu, &domain, &devid)) 1354 !get_device_resources(dev, &iommu, &domain, &devid))
1060 /* device not handled by any AMD IOMMU */ 1355 /* device not handled by any AMD IOMMU */
1061 return; 1356 return;
1062 1357
1358 if (!dma_ops_domain(domain))
1359 return;
1360
1063 spin_lock_irqsave(&domain->lock, flags); 1361 spin_lock_irqsave(&domain->lock, flags);
1064 1362
1065 __unmap_single(iommu, domain->priv, dma_addr, size, dir); 1363 __unmap_single(iommu, domain->priv, dma_addr, size, dir);
@@ -1104,6 +1402,8 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
1104 int mapped_elems = 0; 1402 int mapped_elems = 0;
1105 u64 dma_mask; 1403 u64 dma_mask;
1106 1404
1405 INC_STATS_COUNTER(cnt_map_sg);
1406
1107 if (!check_device(dev)) 1407 if (!check_device(dev))
1108 return 0; 1408 return 0;
1109 1409
@@ -1114,6 +1414,9 @@ static int map_sg(struct device *dev, struct scatterlist *sglist,
1114 if (!iommu || !domain) 1414 if (!iommu || !domain)
1115 return map_sg_no_iommu(dev, sglist, nelems, dir); 1415 return map_sg_no_iommu(dev, sglist, nelems, dir);
1116 1416
1417 if (!dma_ops_domain(domain))
1418 return 0;
1419
1117 spin_lock_irqsave(&domain->lock, flags); 1420 spin_lock_irqsave(&domain->lock, flags);
1118 1421
1119 for_each_sg(sglist, s, nelems, i) { 1422 for_each_sg(sglist, s, nelems, i) {
@@ -1163,10 +1466,15 @@ static void unmap_sg(struct device *dev, struct scatterlist *sglist,
1163 u16 devid; 1466 u16 devid;
1164 int i; 1467 int i;
1165 1468
1469 INC_STATS_COUNTER(cnt_unmap_sg);
1470
1166 if (!check_device(dev) || 1471 if (!check_device(dev) ||
1167 !get_device_resources(dev, &iommu, &domain, &devid)) 1472 !get_device_resources(dev, &iommu, &domain, &devid))
1168 return; 1473 return;
1169 1474
1475 if (!dma_ops_domain(domain))
1476 return;
1477
1170 spin_lock_irqsave(&domain->lock, flags); 1478 spin_lock_irqsave(&domain->lock, flags);
1171 1479
1172 for_each_sg(sglist, s, nelems, i) { 1480 for_each_sg(sglist, s, nelems, i) {
@@ -1194,6 +1502,8 @@ static void *alloc_coherent(struct device *dev, size_t size,
1194 phys_addr_t paddr; 1502 phys_addr_t paddr;
1195 u64 dma_mask = dev->coherent_dma_mask; 1503 u64 dma_mask = dev->coherent_dma_mask;
1196 1504
1505 INC_STATS_COUNTER(cnt_alloc_coherent);
1506
1197 if (!check_device(dev)) 1507 if (!check_device(dev))
1198 return NULL; 1508 return NULL;
1199 1509
@@ -1212,6 +1522,9 @@ static void *alloc_coherent(struct device *dev, size_t size,
1212 return virt_addr; 1522 return virt_addr;
1213 } 1523 }
1214 1524
1525 if (!dma_ops_domain(domain))
1526 goto out_free;
1527
1215 if (!dma_mask) 1528 if (!dma_mask)
1216 dma_mask = *dev->dma_mask; 1529 dma_mask = *dev->dma_mask;
1217 1530
@@ -1220,18 +1533,20 @@ static void *alloc_coherent(struct device *dev, size_t size,
1220 *dma_addr = __map_single(dev, iommu, domain->priv, paddr, 1533 *dma_addr = __map_single(dev, iommu, domain->priv, paddr,
1221 size, DMA_BIDIRECTIONAL, true, dma_mask); 1534 size, DMA_BIDIRECTIONAL, true, dma_mask);
1222 1535
1223 if (*dma_addr == bad_dma_address) { 1536 if (*dma_addr == bad_dma_address)
1224 free_pages((unsigned long)virt_addr, get_order(size)); 1537 goto out_free;
1225 virt_addr = NULL;
1226 goto out;
1227 }
1228 1538
1229 iommu_completion_wait(iommu); 1539 iommu_completion_wait(iommu);
1230 1540
1231out:
1232 spin_unlock_irqrestore(&domain->lock, flags); 1541 spin_unlock_irqrestore(&domain->lock, flags);
1233 1542
1234 return virt_addr; 1543 return virt_addr;
1544
1545out_free:
1546
1547 free_pages((unsigned long)virt_addr, get_order(size));
1548
1549 return NULL;
1235} 1550}
1236 1551
1237/* 1552/*
@@ -1245,6 +1560,8 @@ static void free_coherent(struct device *dev, size_t size,
1245 struct protection_domain *domain; 1560 struct protection_domain *domain;
1246 u16 devid; 1561 u16 devid;
1247 1562
1563 INC_STATS_COUNTER(cnt_free_coherent);
1564
1248 if (!check_device(dev)) 1565 if (!check_device(dev))
1249 return; 1566 return;
1250 1567
@@ -1253,6 +1570,9 @@ static void free_coherent(struct device *dev, size_t size,
1253 if (!iommu || !domain) 1570 if (!iommu || !domain)
1254 goto free_mem; 1571 goto free_mem;
1255 1572
1573 if (!dma_ops_domain(domain))
1574 goto free_mem;
1575
1256 spin_lock_irqsave(&domain->lock, flags); 1576 spin_lock_irqsave(&domain->lock, flags);
1257 1577
1258 __unmap_single(iommu, domain->priv, dma_addr, size, DMA_BIDIRECTIONAL); 1578 __unmap_single(iommu, domain->priv, dma_addr, size, DMA_BIDIRECTIONAL);
@@ -1296,7 +1616,7 @@ static int amd_iommu_dma_supported(struct device *dev, u64 mask)
1296 * we don't need to preallocate the protection domains anymore. 1616 * we don't need to preallocate the protection domains anymore.
1297 * For now we have to. 1617 * For now we have to.
1298 */ 1618 */
1299void prealloc_protection_domains(void) 1619static void prealloc_protection_domains(void)
1300{ 1620{
1301 struct pci_dev *dev = NULL; 1621 struct pci_dev *dev = NULL;
1302 struct dma_ops_domain *dma_dom; 1622 struct dma_ops_domain *dma_dom;
@@ -1305,7 +1625,7 @@ void prealloc_protection_domains(void)
1305 u16 devid; 1625 u16 devid;
1306 1626
1307 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 1627 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
1308 devid = (dev->bus->number << 8) | dev->devfn; 1628 devid = calc_devid(dev->bus->number, dev->devfn);
1309 if (devid > amd_iommu_last_bdf) 1629 if (devid > amd_iommu_last_bdf)
1310 continue; 1630 continue;
1311 devid = amd_iommu_alias_table[devid]; 1631 devid = amd_iommu_alias_table[devid];
@@ -1352,6 +1672,7 @@ int __init amd_iommu_init_dma_ops(void)
1352 iommu->default_dom = dma_ops_domain_alloc(iommu, order); 1672 iommu->default_dom = dma_ops_domain_alloc(iommu, order);
1353 if (iommu->default_dom == NULL) 1673 if (iommu->default_dom == NULL)
1354 return -ENOMEM; 1674 return -ENOMEM;
1675 iommu->default_dom->domain.flags |= PD_DEFAULT_MASK;
1355 ret = iommu_init_unity_mappings(iommu); 1676 ret = iommu_init_unity_mappings(iommu);
1356 if (ret) 1677 if (ret)
1357 goto free_domains; 1678 goto free_domains;
@@ -1375,6 +1696,12 @@ int __init amd_iommu_init_dma_ops(void)
1375 /* Make the driver finally visible to the drivers */ 1696 /* Make the driver finally visible to the drivers */
1376 dma_ops = &amd_iommu_dma_ops; 1697 dma_ops = &amd_iommu_dma_ops;
1377 1698
1699 register_iommu(&amd_iommu_ops);
1700
1701 bus_register_notifier(&pci_bus_type, &device_nb);
1702
1703 amd_iommu_stats_init();
1704
1378 return 0; 1705 return 0;
1379 1706
1380free_domains: 1707free_domains:
@@ -1386,3 +1713,224 @@ free_domains:
1386 1713
1387 return ret; 1714 return ret;
1388} 1715}
1716
1717/*****************************************************************************
1718 *
1719 * The following functions belong to the exported interface of AMD IOMMU
1720 *
1721 * This interface allows access to lower level functions of the IOMMU
1722 * like protection domain handling and assignement of devices to domains
1723 * which is not possible with the dma_ops interface.
1724 *
1725 *****************************************************************************/
1726
1727static void cleanup_domain(struct protection_domain *domain)
1728{
1729 unsigned long flags;
1730 u16 devid;
1731
1732 write_lock_irqsave(&amd_iommu_devtable_lock, flags);
1733
1734 for (devid = 0; devid <= amd_iommu_last_bdf; ++devid)
1735 if (amd_iommu_pd_table[devid] == domain)
1736 __detach_device(domain, devid);
1737
1738 write_unlock_irqrestore(&amd_iommu_devtable_lock, flags);
1739}
1740
1741static int amd_iommu_domain_init(struct iommu_domain *dom)
1742{
1743 struct protection_domain *domain;
1744
1745 domain = kzalloc(sizeof(*domain), GFP_KERNEL);
1746 if (!domain)
1747 return -ENOMEM;
1748
1749 spin_lock_init(&domain->lock);
1750 domain->mode = PAGE_MODE_3_LEVEL;
1751 domain->id = domain_id_alloc();
1752 if (!domain->id)
1753 goto out_free;
1754 domain->pt_root = (void *)get_zeroed_page(GFP_KERNEL);
1755 if (!domain->pt_root)
1756 goto out_free;
1757
1758 dom->priv = domain;
1759
1760 return 0;
1761
1762out_free:
1763 kfree(domain);
1764
1765 return -ENOMEM;
1766}
1767
1768static void amd_iommu_domain_destroy(struct iommu_domain *dom)
1769{
1770 struct protection_domain *domain = dom->priv;
1771
1772 if (!domain)
1773 return;
1774
1775 if (domain->dev_cnt > 0)
1776 cleanup_domain(domain);
1777
1778 BUG_ON(domain->dev_cnt != 0);
1779
1780 free_pagetable(domain);
1781
1782 domain_id_free(domain->id);
1783
1784 kfree(domain);
1785
1786 dom->priv = NULL;
1787}
1788
1789static void amd_iommu_detach_device(struct iommu_domain *dom,
1790 struct device *dev)
1791{
1792 struct protection_domain *domain = dom->priv;
1793 struct amd_iommu *iommu;
1794 struct pci_dev *pdev;
1795 u16 devid;
1796
1797 if (dev->bus != &pci_bus_type)
1798 return;
1799
1800 pdev = to_pci_dev(dev);
1801
1802 devid = calc_devid(pdev->bus->number, pdev->devfn);
1803
1804 if (devid > 0)
1805 detach_device(domain, devid);
1806
1807 iommu = amd_iommu_rlookup_table[devid];
1808 if (!iommu)
1809 return;
1810
1811 iommu_queue_inv_dev_entry(iommu, devid);
1812 iommu_completion_wait(iommu);
1813}
1814
1815static int amd_iommu_attach_device(struct iommu_domain *dom,
1816 struct device *dev)
1817{
1818 struct protection_domain *domain = dom->priv;
1819 struct protection_domain *old_domain;
1820 struct amd_iommu *iommu;
1821 struct pci_dev *pdev;
1822 u16 devid;
1823
1824 if (dev->bus != &pci_bus_type)
1825 return -EINVAL;
1826
1827 pdev = to_pci_dev(dev);
1828
1829 devid = calc_devid(pdev->bus->number, pdev->devfn);
1830
1831 if (devid >= amd_iommu_last_bdf ||
1832 devid != amd_iommu_alias_table[devid])
1833 return -EINVAL;
1834
1835 iommu = amd_iommu_rlookup_table[devid];
1836 if (!iommu)
1837 return -EINVAL;
1838
1839 old_domain = domain_for_device(devid);
1840 if (old_domain)
1841 return -EBUSY;
1842
1843 attach_device(iommu, domain, devid);
1844
1845 iommu_completion_wait(iommu);
1846
1847 return 0;
1848}
1849
1850static int amd_iommu_map_range(struct iommu_domain *dom,
1851 unsigned long iova, phys_addr_t paddr,
1852 size_t size, int iommu_prot)
1853{
1854 struct protection_domain *domain = dom->priv;
1855 unsigned long i, npages = iommu_num_pages(paddr, size, PAGE_SIZE);
1856 int prot = 0;
1857 int ret;
1858
1859 if (iommu_prot & IOMMU_READ)
1860 prot |= IOMMU_PROT_IR;
1861 if (iommu_prot & IOMMU_WRITE)
1862 prot |= IOMMU_PROT_IW;
1863
1864 iova &= PAGE_MASK;
1865 paddr &= PAGE_MASK;
1866
1867 for (i = 0; i < npages; ++i) {
1868 ret = iommu_map_page(domain, iova, paddr, prot);
1869 if (ret)
1870 return ret;
1871
1872 iova += PAGE_SIZE;
1873 paddr += PAGE_SIZE;
1874 }
1875
1876 return 0;
1877}
1878
1879static void amd_iommu_unmap_range(struct iommu_domain *dom,
1880 unsigned long iova, size_t size)
1881{
1882
1883 struct protection_domain *domain = dom->priv;
1884 unsigned long i, npages = iommu_num_pages(iova, size, PAGE_SIZE);
1885
1886 iova &= PAGE_MASK;
1887
1888 for (i = 0; i < npages; ++i) {
1889 iommu_unmap_page(domain, iova);
1890 iova += PAGE_SIZE;
1891 }
1892
1893 iommu_flush_domain(domain->id);
1894}
1895
1896static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom,
1897 unsigned long iova)
1898{
1899 struct protection_domain *domain = dom->priv;
1900 unsigned long offset = iova & ~PAGE_MASK;
1901 phys_addr_t paddr;
1902 u64 *pte;
1903
1904 pte = &domain->pt_root[IOMMU_PTE_L2_INDEX(iova)];
1905
1906 if (!IOMMU_PTE_PRESENT(*pte))
1907 return 0;
1908
1909 pte = IOMMU_PTE_PAGE(*pte);
1910 pte = &pte[IOMMU_PTE_L1_INDEX(iova)];
1911
1912 if (!IOMMU_PTE_PRESENT(*pte))
1913 return 0;
1914
1915 pte = IOMMU_PTE_PAGE(*pte);
1916 pte = &pte[IOMMU_PTE_L0_INDEX(iova)];
1917
1918 if (!IOMMU_PTE_PRESENT(*pte))
1919 return 0;
1920
1921 paddr = *pte & IOMMU_PAGE_MASK;
1922 paddr |= offset;
1923
1924 return paddr;
1925}
1926
1927static struct iommu_ops amd_iommu_ops = {
1928 .domain_init = amd_iommu_domain_init,
1929 .domain_destroy = amd_iommu_domain_destroy,
1930 .attach_dev = amd_iommu_attach_device,
1931 .detach_dev = amd_iommu_detach_device,
1932 .map = amd_iommu_map_range,
1933 .unmap = amd_iommu_unmap_range,
1934 .iova_to_phys = amd_iommu_iova_to_phys,
1935};
1936
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index c625800c55ca..42c33cebf00f 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -122,7 +122,8 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have
122LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings 122LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings
123 we find in ACPI */ 123 we find in ACPI */
124unsigned amd_iommu_aperture_order = 26; /* size of aperture in power of 2 */ 124unsigned amd_iommu_aperture_order = 26; /* size of aperture in power of 2 */
125int amd_iommu_isolate = 1; /* if 1, device isolation is enabled */ 125bool amd_iommu_isolate = true; /* if true, device isolation is
126 enabled */
126bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ 127bool amd_iommu_unmap_flush; /* if true, flush on every unmap */
127 128
128LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the 129LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the
@@ -243,20 +244,16 @@ static void __init iommu_feature_disable(struct amd_iommu *iommu, u8 bit)
243} 244}
244 245
245/* Function to enable the hardware */ 246/* Function to enable the hardware */
246void __init iommu_enable(struct amd_iommu *iommu) 247static void __init iommu_enable(struct amd_iommu *iommu)
247{ 248{
248 printk(KERN_INFO "AMD IOMMU: Enabling IOMMU " 249 printk(KERN_INFO "AMD IOMMU: Enabling IOMMU at %s cap 0x%hx\n",
249 "at %02x:%02x.%x cap 0x%hx\n", 250 dev_name(&iommu->dev->dev), iommu->cap_ptr);
250 iommu->dev->bus->number,
251 PCI_SLOT(iommu->dev->devfn),
252 PCI_FUNC(iommu->dev->devfn),
253 iommu->cap_ptr);
254 251
255 iommu_feature_enable(iommu, CONTROL_IOMMU_EN); 252 iommu_feature_enable(iommu, CONTROL_IOMMU_EN);
256} 253}
257 254
258/* Function to enable IOMMU event logging and event interrupts */ 255/* Function to enable IOMMU event logging and event interrupts */
259void __init iommu_enable_event_logging(struct amd_iommu *iommu) 256static void __init iommu_enable_event_logging(struct amd_iommu *iommu)
260{ 257{
261 iommu_feature_enable(iommu, CONTROL_EVT_LOG_EN); 258 iommu_feature_enable(iommu, CONTROL_EVT_LOG_EN);
262 iommu_feature_enable(iommu, CONTROL_EVT_INT_EN); 259 iommu_feature_enable(iommu, CONTROL_EVT_INT_EN);
@@ -1218,9 +1215,9 @@ static int __init parse_amd_iommu_options(char *str)
1218{ 1215{
1219 for (; *str; ++str) { 1216 for (; *str; ++str) {
1220 if (strncmp(str, "isolate", 7) == 0) 1217 if (strncmp(str, "isolate", 7) == 0)
1221 amd_iommu_isolate = 1; 1218 amd_iommu_isolate = true;
1222 if (strncmp(str, "share", 5) == 0) 1219 if (strncmp(str, "share", 5) == 0)
1223 amd_iommu_isolate = 0; 1220 amd_iommu_isolate = false;
1224 if (strncmp(str, "fullflush", 9) == 0) 1221 if (strncmp(str, "fullflush", 9) == 0)
1225 amd_iommu_unmap_flush = true; 1222 amd_iommu_unmap_flush = true;
1226 } 1223 }
diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c
index b5229affb953..0f830e4f5675 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -31,9 +31,11 @@
31#include <linux/dmi.h> 31#include <linux/dmi.h>
32#include <linux/dmar.h> 32#include <linux/dmar.h>
33#include <linux/ftrace.h> 33#include <linux/ftrace.h>
34#include <linux/smp.h>
35#include <linux/nmi.h>
36#include <linux/timex.h>
34 37
35#include <asm/atomic.h> 38#include <asm/atomic.h>
36#include <asm/smp.h>
37#include <asm/mtrr.h> 39#include <asm/mtrr.h>
38#include <asm/mpspec.h> 40#include <asm/mpspec.h>
39#include <asm/desc.h> 41#include <asm/desc.h>
@@ -41,12 +43,11 @@
41#include <asm/hpet.h> 43#include <asm/hpet.h>
42#include <asm/pgalloc.h> 44#include <asm/pgalloc.h>
43#include <asm/i8253.h> 45#include <asm/i8253.h>
44#include <asm/nmi.h>
45#include <asm/idle.h> 46#include <asm/idle.h>
46#include <asm/proto.h> 47#include <asm/proto.h>
47#include <asm/timex.h>
48#include <asm/apic.h> 48#include <asm/apic.h>
49#include <asm/i8259.h> 49#include <asm/i8259.h>
50#include <asm/smp.h>
50 51
51#include <mach_apic.h> 52#include <mach_apic.h>
52#include <mach_apicdef.h> 53#include <mach_apicdef.h>
@@ -98,8 +99,8 @@ __setup("apicpmtimer", setup_apicpmtimer);
98#ifdef HAVE_X2APIC 99#ifdef HAVE_X2APIC
99int x2apic; 100int x2apic;
100/* x2apic enabled before OS handover */ 101/* x2apic enabled before OS handover */
101int x2apic_preenabled; 102static int x2apic_preenabled;
102int disable_x2apic; 103static int disable_x2apic;
103static __init int setup_nox2apic(char *str) 104static __init int setup_nox2apic(char *str)
104{ 105{
105 disable_x2apic = 1; 106 disable_x2apic = 1;
@@ -119,8 +120,6 @@ EXPORT_SYMBOL_GPL(local_apic_timer_c2_ok);
119 120
120int first_system_vector = 0xfe; 121int first_system_vector = 0xfe;
121 122
122char system_vectors[NR_VECTORS] = { [0 ... NR_VECTORS-1] = SYS_VECTOR_FREE};
123
124/* 123/*
125 * Debug level, exported for io_apic.c 124 * Debug level, exported for io_apic.c
126 */ 125 */
@@ -142,7 +141,7 @@ static int lapic_next_event(unsigned long delta,
142 struct clock_event_device *evt); 141 struct clock_event_device *evt);
143static void lapic_timer_setup(enum clock_event_mode mode, 142static void lapic_timer_setup(enum clock_event_mode mode,
144 struct clock_event_device *evt); 143 struct clock_event_device *evt);
145static void lapic_timer_broadcast(cpumask_t mask); 144static void lapic_timer_broadcast(const struct cpumask *mask);
146static void apic_pm_activate(void); 145static void apic_pm_activate(void);
147 146
148/* 147/*
@@ -228,7 +227,7 @@ void xapic_icr_write(u32 low, u32 id)
228 apic_write(APIC_ICR, low); 227 apic_write(APIC_ICR, low);
229} 228}
230 229
231u64 xapic_icr_read(void) 230static u64 xapic_icr_read(void)
232{ 231{
233 u32 icr1, icr2; 232 u32 icr1, icr2;
234 233
@@ -268,7 +267,7 @@ void x2apic_icr_write(u32 low, u32 id)
268 wrmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), ((__u64) id) << 32 | low); 267 wrmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), ((__u64) id) << 32 | low);
269} 268}
270 269
271u64 x2apic_icr_read(void) 270static u64 x2apic_icr_read(void)
272{ 271{
273 unsigned long val; 272 unsigned long val;
274 273
@@ -455,7 +454,7 @@ static void lapic_timer_setup(enum clock_event_mode mode,
455/* 454/*
456 * Local APIC timer broadcast function 455 * Local APIC timer broadcast function
457 */ 456 */
458static void lapic_timer_broadcast(cpumask_t mask) 457static void lapic_timer_broadcast(const struct cpumask *mask)
459{ 458{
460#ifdef CONFIG_SMP 459#ifdef CONFIG_SMP
461 send_IPI_mask(mask, LOCAL_TIMER_VECTOR); 460 send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
@@ -471,7 +470,7 @@ static void __cpuinit setup_APIC_timer(void)
471 struct clock_event_device *levt = &__get_cpu_var(lapic_events); 470 struct clock_event_device *levt = &__get_cpu_var(lapic_events);
472 471
473 memcpy(levt, &lapic_clockevent, sizeof(*levt)); 472 memcpy(levt, &lapic_clockevent, sizeof(*levt));
474 levt->cpumask = cpumask_of_cpu(smp_processor_id()); 473 levt->cpumask = cpumask_of(smp_processor_id());
475 474
476 clockevents_register_device(levt); 475 clockevents_register_device(levt);
477} 476}
@@ -689,7 +688,7 @@ static int __init calibrate_APIC_clock(void)
689 local_irq_enable(); 688 local_irq_enable();
690 689
691 if (levt->features & CLOCK_EVT_FEAT_DUMMY) { 690 if (levt->features & CLOCK_EVT_FEAT_DUMMY) {
692 pr_warning("APIC timer disabled due to verification failure.\n"); 691 pr_warning("APIC timer disabled due to verification failure\n");
693 return -1; 692 return -1;
694 } 693 }
695 694
@@ -1807,28 +1806,32 @@ void disconnect_bsp_APIC(int virt_wire_setup)
1807void __cpuinit generic_processor_info(int apicid, int version) 1806void __cpuinit generic_processor_info(int apicid, int version)
1808{ 1807{
1809 int cpu; 1808 int cpu;
1810 cpumask_t tmp_map;
1811 1809
1812 /* 1810 /*
1813 * Validate version 1811 * Validate version
1814 */ 1812 */
1815 if (version == 0x0) { 1813 if (version == 0x0) {
1816 pr_warning("BIOS bug, APIC version is 0 for CPU#%d! " 1814 pr_warning("BIOS bug, APIC version is 0 for CPU#%d! "
1817 "fixing up to 0x10. (tell your hw vendor)\n", 1815 "fixing up to 0x10. (tell your hw vendor)\n",
1818 version); 1816 version);
1819 version = 0x10; 1817 version = 0x10;
1820 } 1818 }
1821 apic_version[apicid] = version; 1819 apic_version[apicid] = version;
1822 1820
1823 if (num_processors >= NR_CPUS) { 1821 if (num_processors >= nr_cpu_ids) {
1824 pr_warning("WARNING: NR_CPUS limit of %i reached." 1822 int max = nr_cpu_ids;
1825 " Processor ignored.\n", NR_CPUS); 1823 int thiscpu = max + disabled_cpus;
1824
1825 pr_warning(
1826 "ACPI: NR_CPUS/possible_cpus limit of %i reached."
1827 " Processor %d/0x%x ignored.\n", max, thiscpu, apicid);
1828
1829 disabled_cpus++;
1826 return; 1830 return;
1827 } 1831 }
1828 1832
1829 num_processors++; 1833 num_processors++;
1830 cpus_complement(tmp_map, cpu_present_map); 1834 cpu = cpumask_next_zero(-1, cpu_present_mask);
1831 cpu = first_cpu(tmp_map);
1832 1835
1833 physid_set(apicid, phys_cpu_present_map); 1836 physid_set(apicid, phys_cpu_present_map);
1834 if (apicid == boot_cpu_physical_apicid) { 1837 if (apicid == boot_cpu_physical_apicid) {
@@ -1878,8 +1881,8 @@ void __cpuinit generic_processor_info(int apicid, int version)
1878 } 1881 }
1879#endif 1882#endif
1880 1883
1881 cpu_set(cpu, cpu_possible_map); 1884 set_cpu_possible(cpu, true);
1882 cpu_set(cpu, cpu_present_map); 1885 set_cpu_present(cpu, true);
1883} 1886}
1884 1887
1885#ifdef CONFIG_X86_64 1888#ifdef CONFIG_X86_64
@@ -2081,18 +2084,16 @@ __cpuinit int apic_is_clustered_box(void)
2081 bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid); 2084 bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid);
2082 bitmap_zero(clustermap, NUM_APIC_CLUSTERS); 2085 bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
2083 2086
2084 for (i = 0; i < NR_CPUS; i++) { 2087 for (i = 0; i < nr_cpu_ids; i++) {
2085 /* are we being called early in kernel startup? */ 2088 /* are we being called early in kernel startup? */
2086 if (bios_cpu_apicid) { 2089 if (bios_cpu_apicid) {
2087 id = bios_cpu_apicid[i]; 2090 id = bios_cpu_apicid[i];
2088 } 2091 } else if (i < nr_cpu_ids) {
2089 else if (i < nr_cpu_ids) {
2090 if (cpu_present(i)) 2092 if (cpu_present(i))
2091 id = per_cpu(x86_bios_cpu_apicid, i); 2093 id = per_cpu(x86_bios_cpu_apicid, i);
2092 else 2094 else
2093 continue; 2095 continue;
2094 } 2096 } else
2095 else
2096 break; 2097 break;
2097 2098
2098 if (id != BAD_APICID) 2099 if (id != BAD_APICID)
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 3a26525a3f31..98807bb095ad 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -160,9 +160,9 @@
160 * Work around byte swap bug in one of the Vaio's BIOS's 160 * Work around byte swap bug in one of the Vaio's BIOS's
161 * (Marc Boucher <marc@mbsi.ca>). 161 * (Marc Boucher <marc@mbsi.ca>).
162 * Exposed the disable flag to dmi so that we can handle known 162 * Exposed the disable flag to dmi so that we can handle known
163 * broken APM (Alan Cox <alan@redhat.com>). 163 * broken APM (Alan Cox <alan@lxorguk.ukuu.org.uk>).
164 * 1.14ac: If the BIOS says "I slowed the CPU down" then don't spin 164 * 1.14ac: If the BIOS says "I slowed the CPU down" then don't spin
165 * calling it - instead idle. (Alan Cox <alan@redhat.com>) 165 * calling it - instead idle. (Alan Cox <alan@lxorguk.ukuu.org.uk>)
166 * If an APM idle fails log it and idle sensibly 166 * If an APM idle fails log it and idle sensibly
167 * 1.15: Don't queue events to clients who open the device O_WRONLY. 167 * 1.15: Don't queue events to clients who open the device O_WRONLY.
168 * Don't expect replies from clients who open the device O_RDONLY. 168 * Don't expect replies from clients who open the device O_RDONLY.
diff --git a/arch/x86/kernel/bios_uv.c b/arch/x86/kernel/bios_uv.c
index 2a0a2a3cac26..f63882728d91 100644
--- a/arch/x86/kernel/bios_uv.c
+++ b/arch/x86/kernel/bios_uv.c
@@ -25,7 +25,7 @@
25#include <asm/uv/bios.h> 25#include <asm/uv/bios.h>
26#include <asm/uv/uv_hub.h> 26#include <asm/uv/uv_hub.h>
27 27
28struct uv_systab uv_systab; 28static struct uv_systab uv_systab;
29 29
30s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5) 30s64 uv_bios_call(enum uv_bios_cmd which, u64 a1, u64 a2, u64 a3, u64 a4, u64 a5)
31{ 31{
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 42e0853030cb..83492b1f93b1 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -40,6 +40,26 @@
40 40
41#include "cpu.h" 41#include "cpu.h"
42 42
43#ifdef CONFIG_X86_64
44
45/* all of these masks are initialized in setup_cpu_local_masks() */
46cpumask_var_t cpu_callin_mask;
47cpumask_var_t cpu_callout_mask;
48cpumask_var_t cpu_initialized_mask;
49
50/* representing cpus for which sibling maps can be computed */
51cpumask_var_t cpu_sibling_setup_mask;
52
53#else /* CONFIG_X86_32 */
54
55cpumask_t cpu_callin_map;
56cpumask_t cpu_callout_map;
57cpumask_t cpu_initialized;
58cpumask_t cpu_sibling_setup_map;
59
60#endif /* CONFIG_X86_32 */
61
62
43static struct cpu_dev *this_cpu __cpuinitdata; 63static struct cpu_dev *this_cpu __cpuinitdata;
44 64
45#ifdef CONFIG_X86_64 65#ifdef CONFIG_X86_64
@@ -355,7 +375,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
355 printk(KERN_INFO "CPU: Hyper-Threading is disabled\n"); 375 printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
356 } else if (smp_num_siblings > 1) { 376 } else if (smp_num_siblings > 1) {
357 377
358 if (smp_num_siblings > NR_CPUS) { 378 if (smp_num_siblings > nr_cpu_ids) {
359 printk(KERN_WARNING "CPU: Unsupported number of siblings %d", 379 printk(KERN_WARNING "CPU: Unsupported number of siblings %d",
360 smp_num_siblings); 380 smp_num_siblings);
361 smp_num_siblings = 1; 381 smp_num_siblings = 1;
@@ -856,8 +876,6 @@ static __init int setup_disablecpuid(char *arg)
856} 876}
857__setup("clearcpuid=", setup_disablecpuid); 877__setup("clearcpuid=", setup_disablecpuid);
858 878
859cpumask_t cpu_initialized __cpuinitdata = CPU_MASK_NONE;
860
861#ifdef CONFIG_X86_64 879#ifdef CONFIG_X86_64
862struct x8664_pda **_cpu_pda __read_mostly; 880struct x8664_pda **_cpu_pda __read_mostly;
863EXPORT_SYMBOL(_cpu_pda); 881EXPORT_SYMBOL(_cpu_pda);
@@ -976,7 +994,7 @@ void __cpuinit cpu_init(void)
976 994
977 me = current; 995 me = current;
978 996
979 if (cpu_test_and_set(cpu, cpu_initialized)) 997 if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask))
980 panic("CPU#%d already initialized!\n", cpu); 998 panic("CPU#%d already initialized!\n", cpu);
981 999
982 printk(KERN_INFO "Initializing CPU#%d\n", cpu); 1000 printk(KERN_INFO "Initializing CPU#%d\n", cpu);
@@ -1085,7 +1103,7 @@ void __cpuinit cpu_init(void)
1085 struct tss_struct *t = &per_cpu(init_tss, cpu); 1103 struct tss_struct *t = &per_cpu(init_tss, cpu);
1086 struct thread_struct *thread = &curr->thread; 1104 struct thread_struct *thread = &curr->thread;
1087 1105
1088 if (cpu_test_and_set(cpu, cpu_initialized)) { 1106 if (cpumask_test_and_set_cpu(cpu, cpu_initialized_mask)) {
1089 printk(KERN_WARNING "CPU#%d already initialized!\n", cpu); 1107 printk(KERN_WARNING "CPU#%d already initialized!\n", cpu);
1090 for (;;) local_irq_enable(); 1108 for (;;) local_irq_enable();
1091 } 1109 }
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index 88ea02dcb622..6f11e029e8c5 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -145,7 +145,7 @@ typedef union {
145 145
146struct drv_cmd { 146struct drv_cmd {
147 unsigned int type; 147 unsigned int type;
148 cpumask_t mask; 148 cpumask_var_t mask;
149 drv_addr_union addr; 149 drv_addr_union addr;
150 u32 val; 150 u32 val;
151}; 151};
@@ -193,7 +193,7 @@ static void drv_read(struct drv_cmd *cmd)
193 cpumask_t saved_mask = current->cpus_allowed; 193 cpumask_t saved_mask = current->cpus_allowed;
194 cmd->val = 0; 194 cmd->val = 0;
195 195
196 set_cpus_allowed_ptr(current, &cmd->mask); 196 set_cpus_allowed_ptr(current, cmd->mask);
197 do_drv_read(cmd); 197 do_drv_read(cmd);
198 set_cpus_allowed_ptr(current, &saved_mask); 198 set_cpus_allowed_ptr(current, &saved_mask);
199} 199}
@@ -203,8 +203,8 @@ static void drv_write(struct drv_cmd *cmd)
203 cpumask_t saved_mask = current->cpus_allowed; 203 cpumask_t saved_mask = current->cpus_allowed;
204 unsigned int i; 204 unsigned int i;
205 205
206 for_each_cpu_mask_nr(i, cmd->mask) { 206 for_each_cpu(i, cmd->mask) {
207 set_cpus_allowed_ptr(current, &cpumask_of_cpu(i)); 207 set_cpus_allowed_ptr(current, cpumask_of(i));
208 do_drv_write(cmd); 208 do_drv_write(cmd);
209 } 209 }
210 210
@@ -212,22 +212,22 @@ static void drv_write(struct drv_cmd *cmd)
212 return; 212 return;
213} 213}
214 214
215static u32 get_cur_val(const cpumask_t *mask) 215static u32 get_cur_val(const struct cpumask *mask)
216{ 216{
217 struct acpi_processor_performance *perf; 217 struct acpi_processor_performance *perf;
218 struct drv_cmd cmd; 218 struct drv_cmd cmd;
219 219
220 if (unlikely(cpus_empty(*mask))) 220 if (unlikely(cpumask_empty(mask)))
221 return 0; 221 return 0;
222 222
223 switch (per_cpu(drv_data, first_cpu(*mask))->cpu_feature) { 223 switch (per_cpu(drv_data, cpumask_first(mask))->cpu_feature) {
224 case SYSTEM_INTEL_MSR_CAPABLE: 224 case SYSTEM_INTEL_MSR_CAPABLE:
225 cmd.type = SYSTEM_INTEL_MSR_CAPABLE; 225 cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
226 cmd.addr.msr.reg = MSR_IA32_PERF_STATUS; 226 cmd.addr.msr.reg = MSR_IA32_PERF_STATUS;
227 break; 227 break;
228 case SYSTEM_IO_CAPABLE: 228 case SYSTEM_IO_CAPABLE:
229 cmd.type = SYSTEM_IO_CAPABLE; 229 cmd.type = SYSTEM_IO_CAPABLE;
230 perf = per_cpu(drv_data, first_cpu(*mask))->acpi_data; 230 perf = per_cpu(drv_data, cpumask_first(mask))->acpi_data;
231 cmd.addr.io.port = perf->control_register.address; 231 cmd.addr.io.port = perf->control_register.address;
232 cmd.addr.io.bit_width = perf->control_register.bit_width; 232 cmd.addr.io.bit_width = perf->control_register.bit_width;
233 break; 233 break;
@@ -235,7 +235,7 @@ static u32 get_cur_val(const cpumask_t *mask)
235 return 0; 235 return 0;
236 } 236 }
237 237
238 cmd.mask = *mask; 238 cpumask_copy(cmd.mask, mask);
239 239
240 drv_read(&cmd); 240 drv_read(&cmd);
241 241
@@ -244,6 +244,30 @@ static u32 get_cur_val(const cpumask_t *mask)
244 return cmd.val; 244 return cmd.val;
245} 245}
246 246
247struct perf_cur {
248 union {
249 struct {
250 u32 lo;
251 u32 hi;
252 } split;
253 u64 whole;
254 } aperf_cur, mperf_cur;
255};
256
257
258static long read_measured_perf_ctrs(void *_cur)
259{
260 struct perf_cur *cur = _cur;
261
262 rdmsr(MSR_IA32_APERF, cur->aperf_cur.split.lo, cur->aperf_cur.split.hi);
263 rdmsr(MSR_IA32_MPERF, cur->mperf_cur.split.lo, cur->mperf_cur.split.hi);
264
265 wrmsr(MSR_IA32_APERF, 0, 0);
266 wrmsr(MSR_IA32_MPERF, 0, 0);
267
268 return 0;
269}
270
247/* 271/*
248 * Return the measured active (C0) frequency on this CPU since last call 272 * Return the measured active (C0) frequency on this CPU since last call
249 * to this function. 273 * to this function.
@@ -260,31 +284,12 @@ static u32 get_cur_val(const cpumask_t *mask)
260static unsigned int get_measured_perf(struct cpufreq_policy *policy, 284static unsigned int get_measured_perf(struct cpufreq_policy *policy,
261 unsigned int cpu) 285 unsigned int cpu)
262{ 286{
263 union { 287 struct perf_cur cur;
264 struct {
265 u32 lo;
266 u32 hi;
267 } split;
268 u64 whole;
269 } aperf_cur, mperf_cur;
270
271 cpumask_t saved_mask;
272 unsigned int perf_percent; 288 unsigned int perf_percent;
273 unsigned int retval; 289 unsigned int retval;
274 290
275 saved_mask = current->cpus_allowed; 291 if (!work_on_cpu(cpu, read_measured_perf_ctrs, &cur))
276 set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
277 if (get_cpu() != cpu) {
278 /* We were not able to run on requested processor */
279 put_cpu();
280 return 0; 292 return 0;
281 }
282
283 rdmsr(MSR_IA32_APERF, aperf_cur.split.lo, aperf_cur.split.hi);
284 rdmsr(MSR_IA32_MPERF, mperf_cur.split.lo, mperf_cur.split.hi);
285
286 wrmsr(MSR_IA32_APERF, 0,0);
287 wrmsr(MSR_IA32_MPERF, 0,0);
288 293
289#ifdef __i386__ 294#ifdef __i386__
290 /* 295 /*
@@ -292,37 +297,39 @@ static unsigned int get_measured_perf(struct cpufreq_policy *policy,
292 * Get an approximate value. Return failure in case we cannot get 297 * Get an approximate value. Return failure in case we cannot get
293 * an approximate value. 298 * an approximate value.
294 */ 299 */
295 if (unlikely(aperf_cur.split.hi || mperf_cur.split.hi)) { 300 if (unlikely(cur.aperf_cur.split.hi || cur.mperf_cur.split.hi)) {
296 int shift_count; 301 int shift_count;
297 u32 h; 302 u32 h;
298 303
299 h = max_t(u32, aperf_cur.split.hi, mperf_cur.split.hi); 304 h = max_t(u32, cur.aperf_cur.split.hi, cur.mperf_cur.split.hi);
300 shift_count = fls(h); 305 shift_count = fls(h);
301 306
302 aperf_cur.whole >>= shift_count; 307 cur.aperf_cur.whole >>= shift_count;
303 mperf_cur.whole >>= shift_count; 308 cur.mperf_cur.whole >>= shift_count;
304 } 309 }
305 310
306 if (((unsigned long)(-1) / 100) < aperf_cur.split.lo) { 311 if (((unsigned long)(-1) / 100) < cur.aperf_cur.split.lo) {
307 int shift_count = 7; 312 int shift_count = 7;
308 aperf_cur.split.lo >>= shift_count; 313 cur.aperf_cur.split.lo >>= shift_count;
309 mperf_cur.split.lo >>= shift_count; 314 cur.mperf_cur.split.lo >>= shift_count;
310 } 315 }
311 316
312 if (aperf_cur.split.lo && mperf_cur.split.lo) 317 if (cur.aperf_cur.split.lo && cur.mperf_cur.split.lo)
313 perf_percent = (aperf_cur.split.lo * 100) / mperf_cur.split.lo; 318 perf_percent = (cur.aperf_cur.split.lo * 100) /
319 cur.mperf_cur.split.lo;
314 else 320 else
315 perf_percent = 0; 321 perf_percent = 0;
316 322
317#else 323#else
318 if (unlikely(((unsigned long)(-1) / 100) < aperf_cur.whole)) { 324 if (unlikely(((unsigned long)(-1) / 100) < cur.aperf_cur.whole)) {
319 int shift_count = 7; 325 int shift_count = 7;
320 aperf_cur.whole >>= shift_count; 326 cur.aperf_cur.whole >>= shift_count;
321 mperf_cur.whole >>= shift_count; 327 cur.mperf_cur.whole >>= shift_count;
322 } 328 }
323 329
324 if (aperf_cur.whole && mperf_cur.whole) 330 if (cur.aperf_cur.whole && cur.mperf_cur.whole)
325 perf_percent = (aperf_cur.whole * 100) / mperf_cur.whole; 331 perf_percent = (cur.aperf_cur.whole * 100) /
332 cur.mperf_cur.whole;
326 else 333 else
327 perf_percent = 0; 334 perf_percent = 0;
328 335
@@ -330,10 +337,6 @@ static unsigned int get_measured_perf(struct cpufreq_policy *policy,
330 337
331 retval = per_cpu(drv_data, policy->cpu)->max_freq * perf_percent / 100; 338 retval = per_cpu(drv_data, policy->cpu)->max_freq * perf_percent / 100;
332 339
333 put_cpu();
334 set_cpus_allowed_ptr(current, &saved_mask);
335
336 dprintk("cpu %d: performance percent %d\n", cpu, perf_percent);
337 return retval; 340 return retval;
338} 341}
339 342
@@ -351,7 +354,7 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu)
351 } 354 }
352 355
353 cached_freq = data->freq_table[data->acpi_data->state].frequency; 356 cached_freq = data->freq_table[data->acpi_data->state].frequency;
354 freq = extract_freq(get_cur_val(&cpumask_of_cpu(cpu)), data); 357 freq = extract_freq(get_cur_val(cpumask_of(cpu)), data);
355 if (freq != cached_freq) { 358 if (freq != cached_freq) {
356 /* 359 /*
357 * The dreaded BIOS frequency change behind our back. 360 * The dreaded BIOS frequency change behind our back.
@@ -386,7 +389,6 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
386 struct acpi_cpufreq_data *data = per_cpu(drv_data, policy->cpu); 389 struct acpi_cpufreq_data *data = per_cpu(drv_data, policy->cpu);
387 struct acpi_processor_performance *perf; 390 struct acpi_processor_performance *perf;
388 struct cpufreq_freqs freqs; 391 struct cpufreq_freqs freqs;
389 cpumask_t online_policy_cpus;
390 struct drv_cmd cmd; 392 struct drv_cmd cmd;
391 unsigned int next_state = 0; /* Index into freq_table */ 393 unsigned int next_state = 0; /* Index into freq_table */
392 unsigned int next_perf_state = 0; /* Index into perf table */ 394 unsigned int next_perf_state = 0; /* Index into perf table */
@@ -401,20 +403,18 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
401 return -ENODEV; 403 return -ENODEV;
402 } 404 }
403 405
406 if (unlikely(!alloc_cpumask_var(&cmd.mask, GFP_KERNEL)))
407 return -ENOMEM;
408
404 perf = data->acpi_data; 409 perf = data->acpi_data;
405 result = cpufreq_frequency_table_target(policy, 410 result = cpufreq_frequency_table_target(policy,
406 data->freq_table, 411 data->freq_table,
407 target_freq, 412 target_freq,
408 relation, &next_state); 413 relation, &next_state);
409 if (unlikely(result)) 414 if (unlikely(result)) {
410 return -ENODEV; 415 result = -ENODEV;
411 416 goto out;
412#ifdef CONFIG_HOTPLUG_CPU 417 }
413 /* cpufreq holds the hotplug lock, so we are safe from here on */
414 cpus_and(online_policy_cpus, cpu_online_map, policy->cpus);
415#else
416 online_policy_cpus = policy->cpus;
417#endif
418 418
419 next_perf_state = data->freq_table[next_state].index; 419 next_perf_state = data->freq_table[next_state].index;
420 if (perf->state == next_perf_state) { 420 if (perf->state == next_perf_state) {
@@ -425,7 +425,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
425 } else { 425 } else {
426 dprintk("Already at target state (P%d)\n", 426 dprintk("Already at target state (P%d)\n",
427 next_perf_state); 427 next_perf_state);
428 return 0; 428 goto out;
429 } 429 }
430 } 430 }
431 431
@@ -444,19 +444,19 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
444 cmd.val = (u32) perf->states[next_perf_state].control; 444 cmd.val = (u32) perf->states[next_perf_state].control;
445 break; 445 break;
446 default: 446 default:
447 return -ENODEV; 447 result = -ENODEV;
448 goto out;
448 } 449 }
449 450
450 cpus_clear(cmd.mask); 451 /* cpufreq holds the hotplug lock, so we are safe from here on */
451
452 if (policy->shared_type != CPUFREQ_SHARED_TYPE_ANY) 452 if (policy->shared_type != CPUFREQ_SHARED_TYPE_ANY)
453 cmd.mask = online_policy_cpus; 453 cpumask_and(cmd.mask, cpu_online_mask, policy->cpus);
454 else 454 else
455 cpu_set(policy->cpu, cmd.mask); 455 cpumask_copy(cmd.mask, cpumask_of(policy->cpu));
456 456
457 freqs.old = perf->states[perf->state].core_frequency * 1000; 457 freqs.old = perf->states[perf->state].core_frequency * 1000;
458 freqs.new = data->freq_table[next_state].frequency; 458 freqs.new = data->freq_table[next_state].frequency;
459 for_each_cpu_mask_nr(i, cmd.mask) { 459 for_each_cpu(i, cmd.mask) {
460 freqs.cpu = i; 460 freqs.cpu = i;
461 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 461 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
462 } 462 }
@@ -464,19 +464,22 @@ static int acpi_cpufreq_target(struct cpufreq_policy *policy,
464 drv_write(&cmd); 464 drv_write(&cmd);
465 465
466 if (acpi_pstate_strict) { 466 if (acpi_pstate_strict) {
467 if (!check_freqs(&cmd.mask, freqs.new, data)) { 467 if (!check_freqs(cmd.mask, freqs.new, data)) {
468 dprintk("acpi_cpufreq_target failed (%d)\n", 468 dprintk("acpi_cpufreq_target failed (%d)\n",
469 policy->cpu); 469 policy->cpu);
470 return -EAGAIN; 470 result = -EAGAIN;
471 goto out;
471 } 472 }
472 } 473 }
473 474
474 for_each_cpu_mask_nr(i, cmd.mask) { 475 for_each_cpu(i, cmd.mask) {
475 freqs.cpu = i; 476 freqs.cpu = i;
476 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 477 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
477 } 478 }
478 perf->state = next_perf_state; 479 perf->state = next_perf_state;
479 480
481out:
482 free_cpumask_var(cmd.mask);
480 return result; 483 return result;
481} 484}
482 485
@@ -517,6 +520,17 @@ acpi_cpufreq_guess_freq(struct acpi_cpufreq_data *data, unsigned int cpu)
517 } 520 }
518} 521}
519 522
523static void free_acpi_perf_data(void)
524{
525 unsigned int i;
526
527 /* Freeing a NULL pointer is OK, and alloc_percpu zeroes. */
528 for_each_possible_cpu(i)
529 free_cpumask_var(per_cpu_ptr(acpi_perf_data, i)
530 ->shared_cpu_map);
531 free_percpu(acpi_perf_data);
532}
533
520/* 534/*
521 * acpi_cpufreq_early_init - initialize ACPI P-States library 535 * acpi_cpufreq_early_init - initialize ACPI P-States library
522 * 536 *
@@ -527,6 +541,7 @@ acpi_cpufreq_guess_freq(struct acpi_cpufreq_data *data, unsigned int cpu)
527 */ 541 */
528static int __init acpi_cpufreq_early_init(void) 542static int __init acpi_cpufreq_early_init(void)
529{ 543{
544 unsigned int i;
530 dprintk("acpi_cpufreq_early_init\n"); 545 dprintk("acpi_cpufreq_early_init\n");
531 546
532 acpi_perf_data = alloc_percpu(struct acpi_processor_performance); 547 acpi_perf_data = alloc_percpu(struct acpi_processor_performance);
@@ -534,6 +549,16 @@ static int __init acpi_cpufreq_early_init(void)
534 dprintk("Memory allocation error for acpi_perf_data.\n"); 549 dprintk("Memory allocation error for acpi_perf_data.\n");
535 return -ENOMEM; 550 return -ENOMEM;
536 } 551 }
552 for_each_possible_cpu(i) {
553 if (!alloc_cpumask_var_node(
554 &per_cpu_ptr(acpi_perf_data, i)->shared_cpu_map,
555 GFP_KERNEL, cpu_to_node(i))) {
556
557 /* Freeing a NULL pointer is OK: alloc_percpu zeroes. */
558 free_acpi_perf_data();
559 return -ENOMEM;
560 }
561 }
537 562
538 /* Do initialization in ACPI core */ 563 /* Do initialization in ACPI core */
539 acpi_processor_preregister_performance(acpi_perf_data); 564 acpi_processor_preregister_performance(acpi_perf_data);
@@ -604,15 +629,15 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
604 */ 629 */
605 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || 630 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
606 policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { 631 policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) {
607 policy->cpus = perf->shared_cpu_map; 632 cpumask_copy(policy->cpus, perf->shared_cpu_map);
608 } 633 }
609 policy->related_cpus = perf->shared_cpu_map; 634 cpumask_copy(policy->related_cpus, perf->shared_cpu_map);
610 635
611#ifdef CONFIG_SMP 636#ifdef CONFIG_SMP
612 dmi_check_system(sw_any_bug_dmi_table); 637 dmi_check_system(sw_any_bug_dmi_table);
613 if (bios_with_sw_any_bug && cpus_weight(policy->cpus) == 1) { 638 if (bios_with_sw_any_bug && cpumask_weight(policy->cpus) == 1) {
614 policy->shared_type = CPUFREQ_SHARED_TYPE_ALL; 639 policy->shared_type = CPUFREQ_SHARED_TYPE_ALL;
615 policy->cpus = per_cpu(cpu_core_map, cpu); 640 cpumask_copy(policy->cpus, cpu_core_mask(cpu));
616 } 641 }
617#endif 642#endif
618 643
@@ -795,7 +820,7 @@ static int __init acpi_cpufreq_init(void)
795 820
796 ret = cpufreq_register_driver(&acpi_cpufreq_driver); 821 ret = cpufreq_register_driver(&acpi_cpufreq_driver);
797 if (ret) 822 if (ret)
798 free_percpu(acpi_perf_data); 823 free_acpi_perf_data();
799 824
800 return ret; 825 return ret;
801} 826}
diff --git a/arch/x86/kernel/cpu/cpufreq/longhaul.c b/arch/x86/kernel/cpu/cpufreq/longhaul.c
index b0461856acfb..a4cff5d6e380 100644
--- a/arch/x86/kernel/cpu/cpufreq/longhaul.c
+++ b/arch/x86/kernel/cpu/cpufreq/longhaul.c
@@ -982,7 +982,7 @@ static int __init longhaul_init(void)
982 case 10: 982 case 10:
983 printk(KERN_ERR PFX "Use acpi-cpufreq driver for VIA C7\n"); 983 printk(KERN_ERR PFX "Use acpi-cpufreq driver for VIA C7\n");
984 default: 984 default:
985 ;; 985 ;
986 } 986 }
987 987
988 return -ENODEV; 988 return -ENODEV;
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
index b8e05ee4f736..b585e04cbc9e 100644
--- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
@@ -122,7 +122,7 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
122 return 0; 122 return 0;
123 123
124 /* notifiers */ 124 /* notifiers */
125 for_each_cpu_mask_nr(i, policy->cpus) { 125 for_each_cpu(i, policy->cpus) {
126 freqs.cpu = i; 126 freqs.cpu = i;
127 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 127 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
128 } 128 }
@@ -130,11 +130,11 @@ static int cpufreq_p4_target(struct cpufreq_policy *policy,
130 /* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software 130 /* run on each logical CPU, see section 13.15.3 of IA32 Intel Architecture Software
131 * Developer's Manual, Volume 3 131 * Developer's Manual, Volume 3
132 */ 132 */
133 for_each_cpu_mask_nr(i, policy->cpus) 133 for_each_cpu(i, policy->cpus)
134 cpufreq_p4_setdc(i, p4clockmod_table[newstate].index); 134 cpufreq_p4_setdc(i, p4clockmod_table[newstate].index);
135 135
136 /* notifiers */ 136 /* notifiers */
137 for_each_cpu_mask_nr(i, policy->cpus) { 137 for_each_cpu(i, policy->cpus) {
138 freqs.cpu = i; 138 freqs.cpu = i;
139 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 139 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
140 } 140 }
@@ -160,6 +160,7 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
160 switch (c->x86_model) { 160 switch (c->x86_model) {
161 case 0x0E: /* Core */ 161 case 0x0E: /* Core */
162 case 0x0F: /* Core Duo */ 162 case 0x0F: /* Core Duo */
163 case 0x16: /* Celeron Core */
163 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS; 164 p4clockmod_driver.flags |= CPUFREQ_CONST_LOOPS;
164 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PCORE); 165 return speedstep_get_processor_frequency(SPEEDSTEP_PROCESSOR_PCORE);
165 case 0x0D: /* Pentium M (Dothan) */ 166 case 0x0D: /* Pentium M (Dothan) */
@@ -171,7 +172,9 @@ static unsigned int cpufreq_p4_get_frequency(struct cpuinfo_x86 *c)
171 } 172 }
172 173
173 if (c->x86 != 0xF) { 174 if (c->x86 != 0xF) {
174 printk(KERN_WARNING PFX "Unknown p4-clockmod-capable CPU. Please send an e-mail to <cpufreq@vger.kernel.org>\n"); 175 if (!cpu_has(c, X86_FEATURE_EST))
176 printk(KERN_WARNING PFX "Unknown p4-clockmod-capable CPU. "
177 "Please send an e-mail to <cpufreq@vger.kernel.org>\n");
175 return 0; 178 return 0;
176 } 179 }
177 180
@@ -200,7 +203,7 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
200 unsigned int i; 203 unsigned int i;
201 204
202#ifdef CONFIG_SMP 205#ifdef CONFIG_SMP
203 policy->cpus = per_cpu(cpu_sibling_map, policy->cpu); 206 cpumask_copy(policy->cpus, &per_cpu(cpu_sibling_map, policy->cpu));
204#endif 207#endif
205 208
206 /* Errata workaround */ 209 /* Errata workaround */
@@ -274,6 +277,7 @@ static struct cpufreq_driver p4clockmod_driver = {
274 .name = "p4-clockmod", 277 .name = "p4-clockmod",
275 .owner = THIS_MODULE, 278 .owner = THIS_MODULE,
276 .attr = p4clockmod_attr, 279 .attr = p4clockmod_attr,
280 .hide_interface = 1,
277}; 281};
278 282
279 283
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
index 7c7d56b43136..1b446d79a8fd 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c
@@ -310,6 +310,12 @@ static int powernow_acpi_init(void)
310 goto err0; 310 goto err0;
311 } 311 }
312 312
313 if (!alloc_cpumask_var(&acpi_processor_perf->shared_cpu_map,
314 GFP_KERNEL)) {
315 retval = -ENOMEM;
316 goto err05;
317 }
318
313 if (acpi_processor_register_performance(acpi_processor_perf, 0)) { 319 if (acpi_processor_register_performance(acpi_processor_perf, 0)) {
314 retval = -EIO; 320 retval = -EIO;
315 goto err1; 321 goto err1;
@@ -412,6 +418,8 @@ static int powernow_acpi_init(void)
412err2: 418err2:
413 acpi_processor_unregister_performance(acpi_processor_perf, 0); 419 acpi_processor_unregister_performance(acpi_processor_perf, 0);
414err1: 420err1:
421 free_cpumask_var(acpi_processor_perf->shared_cpu_map);
422err05:
415 kfree(acpi_processor_perf); 423 kfree(acpi_processor_perf);
416err0: 424err0:
417 printk(KERN_WARNING PFX "ACPI perflib can not be used in this platform\n"); 425 printk(KERN_WARNING PFX "ACPI perflib can not be used in this platform\n");
@@ -652,6 +660,7 @@ static int powernow_cpu_exit (struct cpufreq_policy *policy) {
652#ifdef CONFIG_X86_POWERNOW_K7_ACPI 660#ifdef CONFIG_X86_POWERNOW_K7_ACPI
653 if (acpi_processor_perf) { 661 if (acpi_processor_perf) {
654 acpi_processor_unregister_performance(acpi_processor_perf, 0); 662 acpi_processor_unregister_performance(acpi_processor_perf, 0);
663 free_cpumask_var(acpi_processor_perf->shared_cpu_map);
655 kfree(acpi_processor_perf); 664 kfree(acpi_processor_perf);
656 } 665 }
657#endif 666#endif
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 7f05f44b97e9..5c28b37dea11 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -766,7 +766,7 @@ static void powernow_k8_acpi_pst_values(struct powernow_k8_data *data, unsigned
766static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) 766static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
767{ 767{
768 struct cpufreq_frequency_table *powernow_table; 768 struct cpufreq_frequency_table *powernow_table;
769 int ret_val; 769 int ret_val = -ENODEV;
770 770
771 if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) { 771 if (acpi_processor_register_performance(&data->acpi_data, data->cpu)) {
772 dprintk("register performance failed: bad ACPI data\n"); 772 dprintk("register performance failed: bad ACPI data\n");
@@ -815,6 +815,13 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data)
815 /* notify BIOS that we exist */ 815 /* notify BIOS that we exist */
816 acpi_processor_notify_smm(THIS_MODULE); 816 acpi_processor_notify_smm(THIS_MODULE);
817 817
818 if (!alloc_cpumask_var(&data->acpi_data.shared_cpu_map, GFP_KERNEL)) {
819 printk(KERN_ERR PFX
820 "unable to alloc powernow_k8_data cpumask\n");
821 ret_val = -ENOMEM;
822 goto err_out_mem;
823 }
824
818 return 0; 825 return 0;
819 826
820err_out_mem: 827err_out_mem:
@@ -826,7 +833,7 @@ err_out:
826 /* data->acpi_data.state_count informs us at ->exit() whether ACPI was used */ 833 /* data->acpi_data.state_count informs us at ->exit() whether ACPI was used */
827 data->acpi_data.state_count = 0; 834 data->acpi_data.state_count = 0;
828 835
829 return -ENODEV; 836 return ret_val;
830} 837}
831 838
832static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table) 839static int fill_powernow_table_pstate(struct powernow_k8_data *data, struct cpufreq_frequency_table *powernow_table)
@@ -929,6 +936,7 @@ static void powernow_k8_cpu_exit_acpi(struct powernow_k8_data *data)
929{ 936{
930 if (data->acpi_data.state_count) 937 if (data->acpi_data.state_count)
931 acpi_processor_unregister_performance(&data->acpi_data, data->cpu); 938 acpi_processor_unregister_performance(&data->acpi_data, data->cpu);
939 free_cpumask_var(data->acpi_data.shared_cpu_map);
932} 940}
933 941
934#else 942#else
@@ -1134,7 +1142,8 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1134 data->cpu = pol->cpu; 1142 data->cpu = pol->cpu;
1135 data->currpstate = HW_PSTATE_INVALID; 1143 data->currpstate = HW_PSTATE_INVALID;
1136 1144
1137 if (powernow_k8_cpu_init_acpi(data)) { 1145 rc = powernow_k8_cpu_init_acpi(data);
1146 if (rc) {
1138 /* 1147 /*
1139 * Use the PSB BIOS structure. This is only availabe on 1148 * Use the PSB BIOS structure. This is only availabe on
1140 * an UP version, and is deprecated by AMD. 1149 * an UP version, and is deprecated by AMD.
@@ -1152,20 +1161,17 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1152 "ACPI maintainers and complain to your BIOS " 1161 "ACPI maintainers and complain to your BIOS "
1153 "vendor.\n"); 1162 "vendor.\n");
1154#endif 1163#endif
1155 kfree(data); 1164 goto err_out;
1156 return -ENODEV;
1157 } 1165 }
1158 if (pol->cpu != 0) { 1166 if (pol->cpu != 0) {
1159 printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " 1167 printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for "
1160 "CPU other than CPU0. Complain to your BIOS " 1168 "CPU other than CPU0. Complain to your BIOS "
1161 "vendor.\n"); 1169 "vendor.\n");
1162 kfree(data); 1170 goto err_out;
1163 return -ENODEV;
1164 } 1171 }
1165 rc = find_psb_table(data); 1172 rc = find_psb_table(data);
1166 if (rc) { 1173 if (rc) {
1167 kfree(data); 1174 goto err_out;
1168 return -ENODEV;
1169 } 1175 }
1170 } 1176 }
1171 1177
@@ -1193,10 +1199,10 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
1193 set_cpus_allowed_ptr(current, &oldmask); 1199 set_cpus_allowed_ptr(current, &oldmask);
1194 1200
1195 if (cpu_family == CPU_HW_PSTATE) 1201 if (cpu_family == CPU_HW_PSTATE)
1196 pol->cpus = cpumask_of_cpu(pol->cpu); 1202 cpumask_copy(pol->cpus, cpumask_of(pol->cpu));
1197 else 1203 else
1198 pol->cpus = per_cpu(cpu_core_map, pol->cpu); 1204 cpumask_copy(pol->cpus, &per_cpu(cpu_core_map, pol->cpu));
1199 data->available_cores = &(pol->cpus); 1205 data->available_cores = pol->cpus;
1200 1206
1201 /* Take a crude guess here. 1207 /* Take a crude guess here.
1202 * That guess was in microseconds, so multiply with 1000 */ 1208 * That guess was in microseconds, so multiply with 1000 */
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
index 65cfb5d7f77f..8ecc75b6c7c3 100644
--- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
+++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h
@@ -53,7 +53,7 @@ struct powernow_k8_data {
53 /* we need to keep track of associated cores, but let cpufreq 53 /* we need to keep track of associated cores, but let cpufreq
54 * handle hotplug events - so just point at cpufreq pol->cpus 54 * handle hotplug events - so just point at cpufreq pol->cpus
55 * structure */ 55 * structure */
56 cpumask_t *available_cores; 56 struct cpumask *available_cores;
57}; 57};
58 58
59 59
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
index 3b5f06423e77..f08998278a3a 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -458,13 +458,6 @@ static int centrino_verify (struct cpufreq_policy *policy)
458 * 458 *
459 * Sets a new CPUFreq policy. 459 * Sets a new CPUFreq policy.
460 */ 460 */
461struct allmasks {
462 cpumask_t online_policy_cpus;
463 cpumask_t saved_mask;
464 cpumask_t set_mask;
465 cpumask_t covered_cpus;
466};
467
468static int centrino_target (struct cpufreq_policy *policy, 461static int centrino_target (struct cpufreq_policy *policy,
469 unsigned int target_freq, 462 unsigned int target_freq,
470 unsigned int relation) 463 unsigned int relation)
@@ -474,14 +467,15 @@ static int centrino_target (struct cpufreq_policy *policy,
474 struct cpufreq_freqs freqs; 467 struct cpufreq_freqs freqs;
475 int retval = 0; 468 int retval = 0;
476 unsigned int j, k, first_cpu, tmp; 469 unsigned int j, k, first_cpu, tmp;
477 CPUMASK_ALLOC(allmasks); 470 cpumask_var_t saved_mask, covered_cpus;
478 CPUMASK_PTR(online_policy_cpus, allmasks);
479 CPUMASK_PTR(saved_mask, allmasks);
480 CPUMASK_PTR(set_mask, allmasks);
481 CPUMASK_PTR(covered_cpus, allmasks);
482 471
483 if (unlikely(allmasks == NULL)) 472 if (unlikely(!alloc_cpumask_var(&saved_mask, GFP_KERNEL)))
473 return -ENOMEM;
474 if (unlikely(!alloc_cpumask_var(&covered_cpus, GFP_KERNEL))) {
475 free_cpumask_var(saved_mask);
484 return -ENOMEM; 476 return -ENOMEM;
477 }
478 cpumask_copy(saved_mask, &current->cpus_allowed);
485 479
486 if (unlikely(per_cpu(centrino_model, cpu) == NULL)) { 480 if (unlikely(per_cpu(centrino_model, cpu) == NULL)) {
487 retval = -ENODEV; 481 retval = -ENODEV;
@@ -497,30 +491,26 @@ static int centrino_target (struct cpufreq_policy *policy,
497 goto out; 491 goto out;
498 } 492 }
499 493
500#ifdef CONFIG_HOTPLUG_CPU
501 /* cpufreq holds the hotplug lock, so we are safe from here on */
502 cpus_and(*online_policy_cpus, cpu_online_map, policy->cpus);
503#else
504 *online_policy_cpus = policy->cpus;
505#endif
506
507 *saved_mask = current->cpus_allowed;
508 first_cpu = 1; 494 first_cpu = 1;
509 cpus_clear(*covered_cpus); 495 for_each_cpu(j, policy->cpus) {
510 for_each_cpu_mask_nr(j, *online_policy_cpus) { 496 const struct cpumask *mask;
497
498 /* cpufreq holds the hotplug lock, so we are safe here */
499 if (!cpu_online(j))
500 continue;
501
511 /* 502 /*
512 * Support for SMP systems. 503 * Support for SMP systems.
513 * Make sure we are running on CPU that wants to change freq 504 * Make sure we are running on CPU that wants to change freq
514 */ 505 */
515 cpus_clear(*set_mask);
516 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) 506 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY)
517 cpus_or(*set_mask, *set_mask, *online_policy_cpus); 507 mask = policy->cpus;
518 else 508 else
519 cpu_set(j, *set_mask); 509 mask = cpumask_of(j);
520 510
521 set_cpus_allowed_ptr(current, set_mask); 511 set_cpus_allowed_ptr(current, mask);
522 preempt_disable(); 512 preempt_disable();
523 if (unlikely(!cpu_isset(smp_processor_id(), *set_mask))) { 513 if (unlikely(!cpu_isset(smp_processor_id(), *mask))) {
524 dprintk("couldn't limit to CPUs in this domain\n"); 514 dprintk("couldn't limit to CPUs in this domain\n");
525 retval = -EAGAIN; 515 retval = -EAGAIN;
526 if (first_cpu) { 516 if (first_cpu) {
@@ -548,7 +538,9 @@ static int centrino_target (struct cpufreq_policy *policy,
548 dprintk("target=%dkHz old=%d new=%d msr=%04x\n", 538 dprintk("target=%dkHz old=%d new=%d msr=%04x\n",
549 target_freq, freqs.old, freqs.new, msr); 539 target_freq, freqs.old, freqs.new, msr);
550 540
551 for_each_cpu_mask_nr(k, *online_policy_cpus) { 541 for_each_cpu(k, policy->cpus) {
542 if (!cpu_online(k))
543 continue;
552 freqs.cpu = k; 544 freqs.cpu = k;
553 cpufreq_notify_transition(&freqs, 545 cpufreq_notify_transition(&freqs,
554 CPUFREQ_PRECHANGE); 546 CPUFREQ_PRECHANGE);
@@ -571,7 +563,9 @@ static int centrino_target (struct cpufreq_policy *policy,
571 preempt_enable(); 563 preempt_enable();
572 } 564 }
573 565
574 for_each_cpu_mask_nr(k, *online_policy_cpus) { 566 for_each_cpu(k, policy->cpus) {
567 if (!cpu_online(k))
568 continue;
575 freqs.cpu = k; 569 freqs.cpu = k;
576 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 570 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
577 } 571 }
@@ -584,18 +578,17 @@ static int centrino_target (struct cpufreq_policy *policy,
584 * Best effort undo.. 578 * Best effort undo..
585 */ 579 */
586 580
587 if (!cpus_empty(*covered_cpus)) 581 for_each_cpu_mask_nr(j, *covered_cpus) {
588 for_each_cpu_mask_nr(j, *covered_cpus) { 582 set_cpus_allowed_ptr(current, &cpumask_of_cpu(j));
589 set_cpus_allowed_ptr(current, 583 wrmsr(MSR_IA32_PERF_CTL, oldmsr, h);
590 &cpumask_of_cpu(j)); 584 }
591 wrmsr(MSR_IA32_PERF_CTL, oldmsr, h);
592 }
593 585
594 tmp = freqs.new; 586 tmp = freqs.new;
595 freqs.new = freqs.old; 587 freqs.new = freqs.old;
596 freqs.old = tmp; 588 freqs.old = tmp;
597 for_each_cpu_mask_nr(j, *online_policy_cpus) { 589 for_each_cpu(j, policy->cpus) {
598 freqs.cpu = j; 590 if (!cpu_online(j))
591 continue;
599 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 592 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
600 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 593 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
601 } 594 }
@@ -608,7 +601,8 @@ migrate_end:
608 preempt_enable(); 601 preempt_enable();
609 set_cpus_allowed_ptr(current, saved_mask); 602 set_cpus_allowed_ptr(current, saved_mask);
610out: 603out:
611 CPUMASK_FREE(allmasks); 604 free_cpumask_var(saved_mask);
605 free_cpumask_var(covered_cpus);
612 return retval; 606 return retval;
613} 607}
614 608
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
index 04d0376b64b0..dedc1e98f168 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c
@@ -229,7 +229,7 @@ static unsigned int speedstep_detect_chipset (void)
229 return 0; 229 return 0;
230} 230}
231 231
232static unsigned int _speedstep_get(const cpumask_t *cpus) 232static unsigned int _speedstep_get(const struct cpumask *cpus)
233{ 233{
234 unsigned int speed; 234 unsigned int speed;
235 cpumask_t cpus_allowed; 235 cpumask_t cpus_allowed;
@@ -244,7 +244,7 @@ static unsigned int _speedstep_get(const cpumask_t *cpus)
244 244
245static unsigned int speedstep_get(unsigned int cpu) 245static unsigned int speedstep_get(unsigned int cpu)
246{ 246{
247 return _speedstep_get(&cpumask_of_cpu(cpu)); 247 return _speedstep_get(cpumask_of(cpu));
248} 248}
249 249
250/** 250/**
@@ -267,7 +267,7 @@ static int speedstep_target (struct cpufreq_policy *policy,
267 if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate)) 267 if (cpufreq_frequency_table_target(policy, &speedstep_freqs[0], target_freq, relation, &newstate))
268 return -EINVAL; 268 return -EINVAL;
269 269
270 freqs.old = _speedstep_get(&policy->cpus); 270 freqs.old = _speedstep_get(policy->cpus);
271 freqs.new = speedstep_freqs[newstate].frequency; 271 freqs.new = speedstep_freqs[newstate].frequency;
272 freqs.cpu = policy->cpu; 272 freqs.cpu = policy->cpu;
273 273
@@ -279,20 +279,20 @@ static int speedstep_target (struct cpufreq_policy *policy,
279 279
280 cpus_allowed = current->cpus_allowed; 280 cpus_allowed = current->cpus_allowed;
281 281
282 for_each_cpu_mask_nr(i, policy->cpus) { 282 for_each_cpu(i, policy->cpus) {
283 freqs.cpu = i; 283 freqs.cpu = i;
284 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 284 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
285 } 285 }
286 286
287 /* switch to physical CPU where state is to be changed */ 287 /* switch to physical CPU where state is to be changed */
288 set_cpus_allowed_ptr(current, &policy->cpus); 288 set_cpus_allowed_ptr(current, policy->cpus);
289 289
290 speedstep_set_state(newstate); 290 speedstep_set_state(newstate);
291 291
292 /* allow to be run on all CPUs */ 292 /* allow to be run on all CPUs */
293 set_cpus_allowed_ptr(current, &cpus_allowed); 293 set_cpus_allowed_ptr(current, &cpus_allowed);
294 294
295 for_each_cpu_mask_nr(i, policy->cpus) { 295 for_each_cpu(i, policy->cpus) {
296 freqs.cpu = i; 296 freqs.cpu = i;
297 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 297 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
298 } 298 }
@@ -322,11 +322,11 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
322 322
323 /* only run on CPU to be set, or on its sibling */ 323 /* only run on CPU to be set, or on its sibling */
324#ifdef CONFIG_SMP 324#ifdef CONFIG_SMP
325 policy->cpus = per_cpu(cpu_sibling_map, policy->cpu); 325 cpumask_copy(policy->cpus, &per_cpu(cpu_sibling_map, policy->cpu));
326#endif 326#endif
327 327
328 cpus_allowed = current->cpus_allowed; 328 cpus_allowed = current->cpus_allowed;
329 set_cpus_allowed_ptr(current, &policy->cpus); 329 set_cpus_allowed_ptr(current, policy->cpus);
330 330
331 /* detect low and high frequency and transition latency */ 331 /* detect low and high frequency and transition latency */
332 result = speedstep_get_freqs(speedstep_processor, 332 result = speedstep_get_freqs(speedstep_processor,
@@ -339,7 +339,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy)
339 return result; 339 return result;
340 340
341 /* get current speed setting */ 341 /* get current speed setting */
342 speed = _speedstep_get(&policy->cpus); 342 speed = _speedstep_get(policy->cpus);
343 if (!speed) 343 if (!speed)
344 return -EIO; 344 return -EIO;
345 345
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
index 98d4fdb7dc04..cdac7d62369b 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
@@ -139,6 +139,15 @@ static unsigned int pentium_core_get_frequency(void)
139 case 3: 139 case 3:
140 fsb = 166667; 140 fsb = 166667;
141 break; 141 break;
142 case 2:
143 fsb = 200000;
144 break;
145 case 0:
146 fsb = 266667;
147 break;
148 case 4:
149 fsb = 333333;
150 break;
142 default: 151 default:
143 printk(KERN_ERR "PCORE - MSR_FSB_FREQ undefined value"); 152 printk(KERN_ERR "PCORE - MSR_FSB_FREQ undefined value");
144 } 153 }
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 68b5d8681cbb..48533d77be78 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -534,31 +534,16 @@ static void __cpuinit free_cache_attributes(unsigned int cpu)
534 per_cpu(cpuid4_info, cpu) = NULL; 534 per_cpu(cpuid4_info, cpu) = NULL;
535} 535}
536 536
537static int __cpuinit detect_cache_attributes(unsigned int cpu) 537static void __cpuinit get_cpu_leaves(void *_retval)
538{ 538{
539 struct _cpuid4_info *this_leaf; 539 int j, *retval = _retval, cpu = smp_processor_id();
540 unsigned long j;
541 int retval;
542 cpumask_t oldmask;
543
544 if (num_cache_leaves == 0)
545 return -ENOENT;
546
547 per_cpu(cpuid4_info, cpu) = kzalloc(
548 sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL);
549 if (per_cpu(cpuid4_info, cpu) == NULL)
550 return -ENOMEM;
551
552 oldmask = current->cpus_allowed;
553 retval = set_cpus_allowed_ptr(current, &cpumask_of_cpu(cpu));
554 if (retval)
555 goto out;
556 540
557 /* Do cpuid and store the results */ 541 /* Do cpuid and store the results */
558 for (j = 0; j < num_cache_leaves; j++) { 542 for (j = 0; j < num_cache_leaves; j++) {
543 struct _cpuid4_info *this_leaf;
559 this_leaf = CPUID4_INFO_IDX(cpu, j); 544 this_leaf = CPUID4_INFO_IDX(cpu, j);
560 retval = cpuid4_cache_lookup(j, this_leaf); 545 *retval = cpuid4_cache_lookup(j, this_leaf);
561 if (unlikely(retval < 0)) { 546 if (unlikely(*retval < 0)) {
562 int i; 547 int i;
563 548
564 for (i = 0; i < j; i++) 549 for (i = 0; i < j; i++)
@@ -567,9 +552,21 @@ static int __cpuinit detect_cache_attributes(unsigned int cpu)
567 } 552 }
568 cache_shared_cpu_map_setup(cpu, j); 553 cache_shared_cpu_map_setup(cpu, j);
569 } 554 }
570 set_cpus_allowed_ptr(current, &oldmask); 555}
556
557static int __cpuinit detect_cache_attributes(unsigned int cpu)
558{
559 int retval;
560
561 if (num_cache_leaves == 0)
562 return -ENOENT;
563
564 per_cpu(cpuid4_info, cpu) = kzalloc(
565 sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL);
566 if (per_cpu(cpuid4_info, cpu) == NULL)
567 return -ENOMEM;
571 568
572out: 569 smp_call_function_single(cpu, get_cpu_leaves, &retval, true);
573 if (retval) { 570 if (retval) {
574 kfree(per_cpu(cpuid4_info, cpu)); 571 kfree(per_cpu(cpuid4_info, cpu));
575 per_cpu(cpuid4_info, cpu) = NULL; 572 per_cpu(cpuid4_info, cpu) = NULL;
@@ -626,8 +623,8 @@ static ssize_t show_shared_cpu_map_func(struct _cpuid4_info *this_leaf,
626 cpumask_t *mask = &this_leaf->shared_cpu_map; 623 cpumask_t *mask = &this_leaf->shared_cpu_map;
627 624
628 n = type? 625 n = type?
629 cpulist_scnprintf(buf, len-2, *mask): 626 cpulist_scnprintf(buf, len-2, mask) :
630 cpumask_scnprintf(buf, len-2, *mask); 627 cpumask_scnprintf(buf, len-2, mask);
631 buf[n++] = '\n'; 628 buf[n++] = '\n';
632 buf[n] = '\0'; 629 buf[n] = '\0';
633 } 630 }
diff --git a/arch/x86/kernel/cpu/mcheck/mce_32.c b/arch/x86/kernel/cpu/mcheck/mce_32.c
index 0ebf3fc6a610..dfaebce3633e 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_32.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_32.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * mce.c - x86 Machine Check Exception Reporting 2 * mce.c - x86 Machine Check Exception Reporting
3 * (c) 2002 Alan Cox <alan@redhat.com>, Dave Jones <davej@redhat.com> 3 * (c) 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>, Dave Jones <davej@redhat.com>
4 */ 4 */
5 5
6#include <linux/init.h> 6#include <linux/init.h>
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
index 748c8f9e7a05..8ae8c4ff094d 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
@@ -83,34 +83,41 @@ static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */
83 * CPU Initialization 83 * CPU Initialization
84 */ 84 */
85 85
86struct thresh_restart {
87 struct threshold_block *b;
88 int reset;
89 u16 old_limit;
90};
91
86/* must be called with correct cpu affinity */ 92/* must be called with correct cpu affinity */
87static void threshold_restart_bank(struct threshold_block *b, 93static long threshold_restart_bank(void *_tr)
88 int reset, u16 old_limit)
89{ 94{
95 struct thresh_restart *tr = _tr;
90 u32 mci_misc_hi, mci_misc_lo; 96 u32 mci_misc_hi, mci_misc_lo;
91 97
92 rdmsr(b->address, mci_misc_lo, mci_misc_hi); 98 rdmsr(tr->b->address, mci_misc_lo, mci_misc_hi);
93 99
94 if (b->threshold_limit < (mci_misc_hi & THRESHOLD_MAX)) 100 if (tr->b->threshold_limit < (mci_misc_hi & THRESHOLD_MAX))
95 reset = 1; /* limit cannot be lower than err count */ 101 tr->reset = 1; /* limit cannot be lower than err count */
96 102
97 if (reset) { /* reset err count and overflow bit */ 103 if (tr->reset) { /* reset err count and overflow bit */
98 mci_misc_hi = 104 mci_misc_hi =
99 (mci_misc_hi & ~(MASK_ERR_COUNT_HI | MASK_OVERFLOW_HI)) | 105 (mci_misc_hi & ~(MASK_ERR_COUNT_HI | MASK_OVERFLOW_HI)) |
100 (THRESHOLD_MAX - b->threshold_limit); 106 (THRESHOLD_MAX - tr->b->threshold_limit);
101 } else if (old_limit) { /* change limit w/o reset */ 107 } else if (tr->old_limit) { /* change limit w/o reset */
102 int new_count = (mci_misc_hi & THRESHOLD_MAX) + 108 int new_count = (mci_misc_hi & THRESHOLD_MAX) +
103 (old_limit - b->threshold_limit); 109 (tr->old_limit - tr->b->threshold_limit);
104 mci_misc_hi = (mci_misc_hi & ~MASK_ERR_COUNT_HI) | 110 mci_misc_hi = (mci_misc_hi & ~MASK_ERR_COUNT_HI) |
105 (new_count & THRESHOLD_MAX); 111 (new_count & THRESHOLD_MAX);
106 } 112 }
107 113
108 b->interrupt_enable ? 114 tr->b->interrupt_enable ?
109 (mci_misc_hi = (mci_misc_hi & ~MASK_INT_TYPE_HI) | INT_TYPE_APIC) : 115 (mci_misc_hi = (mci_misc_hi & ~MASK_INT_TYPE_HI) | INT_TYPE_APIC) :
110 (mci_misc_hi &= ~MASK_INT_TYPE_HI); 116 (mci_misc_hi &= ~MASK_INT_TYPE_HI);
111 117
112 mci_misc_hi |= MASK_COUNT_EN_HI; 118 mci_misc_hi |= MASK_COUNT_EN_HI;
113 wrmsr(b->address, mci_misc_lo, mci_misc_hi); 119 wrmsr(tr->b->address, mci_misc_lo, mci_misc_hi);
120 return 0;
114} 121}
115 122
116/* cpu init entry point, called from mce.c with preempt off */ 123/* cpu init entry point, called from mce.c with preempt off */
@@ -120,6 +127,7 @@ void __cpuinit mce_amd_feature_init(struct cpuinfo_x86 *c)
120 unsigned int cpu = smp_processor_id(); 127 unsigned int cpu = smp_processor_id();
121 u8 lvt_off; 128 u8 lvt_off;
122 u32 low = 0, high = 0, address = 0; 129 u32 low = 0, high = 0, address = 0;
130 struct thresh_restart tr;
123 131
124 for (bank = 0; bank < NR_BANKS; ++bank) { 132 for (bank = 0; bank < NR_BANKS; ++bank) {
125 for (block = 0; block < NR_BLOCKS; ++block) { 133 for (block = 0; block < NR_BLOCKS; ++block) {
@@ -162,7 +170,10 @@ void __cpuinit mce_amd_feature_init(struct cpuinfo_x86 *c)
162 wrmsr(address, low, high); 170 wrmsr(address, low, high);
163 171
164 threshold_defaults.address = address; 172 threshold_defaults.address = address;
165 threshold_restart_bank(&threshold_defaults, 0, 0); 173 tr.b = &threshold_defaults;
174 tr.reset = 0;
175 tr.old_limit = 0;
176 threshold_restart_bank(&tr);
166 } 177 }
167 } 178 }
168} 179}
@@ -251,20 +262,6 @@ struct threshold_attr {
251 ssize_t(*store) (struct threshold_block *, const char *, size_t count); 262 ssize_t(*store) (struct threshold_block *, const char *, size_t count);
252}; 263};
253 264
254static void affinity_set(unsigned int cpu, cpumask_t *oldmask,
255 cpumask_t *newmask)
256{
257 *oldmask = current->cpus_allowed;
258 cpus_clear(*newmask);
259 cpu_set(cpu, *newmask);
260 set_cpus_allowed_ptr(current, newmask);
261}
262
263static void affinity_restore(const cpumask_t *oldmask)
264{
265 set_cpus_allowed_ptr(current, oldmask);
266}
267
268#define SHOW_FIELDS(name) \ 265#define SHOW_FIELDS(name) \
269static ssize_t show_ ## name(struct threshold_block * b, char *buf) \ 266static ssize_t show_ ## name(struct threshold_block * b, char *buf) \
270{ \ 267{ \
@@ -277,15 +274,16 @@ static ssize_t store_interrupt_enable(struct threshold_block *b,
277 const char *buf, size_t count) 274 const char *buf, size_t count)
278{ 275{
279 char *end; 276 char *end;
280 cpumask_t oldmask, newmask; 277 struct thresh_restart tr;
281 unsigned long new = simple_strtoul(buf, &end, 0); 278 unsigned long new = simple_strtoul(buf, &end, 0);
282 if (end == buf) 279 if (end == buf)
283 return -EINVAL; 280 return -EINVAL;
284 b->interrupt_enable = !!new; 281 b->interrupt_enable = !!new;
285 282
286 affinity_set(b->cpu, &oldmask, &newmask); 283 tr.b = b;
287 threshold_restart_bank(b, 0, 0); 284 tr.reset = 0;
288 affinity_restore(&oldmask); 285 tr.old_limit = 0;
286 work_on_cpu(b->cpu, threshold_restart_bank, &tr);
289 287
290 return end - buf; 288 return end - buf;
291} 289}
@@ -294,8 +292,7 @@ static ssize_t store_threshold_limit(struct threshold_block *b,
294 const char *buf, size_t count) 292 const char *buf, size_t count)
295{ 293{
296 char *end; 294 char *end;
297 cpumask_t oldmask, newmask; 295 struct thresh_restart tr;
298 u16 old;
299 unsigned long new = simple_strtoul(buf, &end, 0); 296 unsigned long new = simple_strtoul(buf, &end, 0);
300 if (end == buf) 297 if (end == buf)
301 return -EINVAL; 298 return -EINVAL;
@@ -303,34 +300,36 @@ static ssize_t store_threshold_limit(struct threshold_block *b,
303 new = THRESHOLD_MAX; 300 new = THRESHOLD_MAX;
304 if (new < 1) 301 if (new < 1)
305 new = 1; 302 new = 1;
306 old = b->threshold_limit; 303 tr.old_limit = b->threshold_limit;
307 b->threshold_limit = new; 304 b->threshold_limit = new;
305 tr.b = b;
306 tr.reset = 0;
308 307
309 affinity_set(b->cpu, &oldmask, &newmask); 308 work_on_cpu(b->cpu, threshold_restart_bank, &tr);
310 threshold_restart_bank(b, 0, old);
311 affinity_restore(&oldmask);
312 309
313 return end - buf; 310 return end - buf;
314} 311}
315 312
316static ssize_t show_error_count(struct threshold_block *b, char *buf) 313static long local_error_count(void *_b)
317{ 314{
318 u32 high, low; 315 struct threshold_block *b = _b;
319 cpumask_t oldmask, newmask; 316 u32 low, high;
320 affinity_set(b->cpu, &oldmask, &newmask); 317
321 rdmsr(b->address, low, high); 318 rdmsr(b->address, low, high);
322 affinity_restore(&oldmask); 319 return (high & 0xFFF) - (THRESHOLD_MAX - b->threshold_limit);
323 return sprintf(buf, "%x\n", 320}
324 (high & 0xFFF) - (THRESHOLD_MAX - b->threshold_limit)); 321
322static ssize_t show_error_count(struct threshold_block *b, char *buf)
323{
324 return sprintf(buf, "%lx\n", work_on_cpu(b->cpu, local_error_count, b));
325} 325}
326 326
327static ssize_t store_error_count(struct threshold_block *b, 327static ssize_t store_error_count(struct threshold_block *b,
328 const char *buf, size_t count) 328 const char *buf, size_t count)
329{ 329{
330 cpumask_t oldmask, newmask; 330 struct thresh_restart tr = { .b = b, .reset = 1, .old_limit = 0 };
331 affinity_set(b->cpu, &oldmask, &newmask); 331
332 threshold_restart_bank(b, 1, 0); 332 work_on_cpu(b->cpu, threshold_restart_bank, &tr);
333 affinity_restore(&oldmask);
334 return 1; 333 return 1;
335} 334}
336 335
@@ -463,12 +462,19 @@ out_free:
463 return err; 462 return err;
464} 463}
465 464
465static __cpuinit long local_allocate_threshold_blocks(void *_bank)
466{
467 unsigned int *bank = _bank;
468
469 return allocate_threshold_blocks(smp_processor_id(), *bank, 0,
470 MSR_IA32_MC0_MISC + *bank * 4);
471}
472
466/* symlinks sibling shared banks to first core. first core owns dir/files. */ 473/* symlinks sibling shared banks to first core. first core owns dir/files. */
467static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank) 474static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
468{ 475{
469 int i, err = 0; 476 int i, err = 0;
470 struct threshold_bank *b = NULL; 477 struct threshold_bank *b = NULL;
471 cpumask_t oldmask, newmask;
472 char name[32]; 478 char name[32];
473 479
474 sprintf(name, "threshold_bank%i", bank); 480 sprintf(name, "threshold_bank%i", bank);
@@ -519,11 +525,7 @@ static __cpuinit int threshold_create_bank(unsigned int cpu, unsigned int bank)
519 525
520 per_cpu(threshold_banks, cpu)[bank] = b; 526 per_cpu(threshold_banks, cpu)[bank] = b;
521 527
522 affinity_set(cpu, &oldmask, &newmask); 528 err = work_on_cpu(cpu, local_allocate_threshold_blocks, &bank);
523 err = allocate_threshold_blocks(cpu, bank, 0,
524 MSR_IA32_MC0_MISC + bank * 4);
525 affinity_restore(&oldmask);
526
527 if (err) 529 if (err)
528 goto out_free; 530 goto out_free;
529 531
diff --git a/arch/x86/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mcheck/p5.c
index bfa5817afdda..c9f77ea69edc 100644
--- a/arch/x86/kernel/cpu/mcheck/p5.c
+++ b/arch/x86/kernel/cpu/mcheck/p5.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * P5 specific Machine Check Exception Reporting 2 * P5 specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Alan Cox <alan@redhat.com> 3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
4 */ 4 */
5 5
6#include <linux/init.h> 6#include <linux/init.h>
diff --git a/arch/x86/kernel/cpu/mcheck/p6.c b/arch/x86/kernel/cpu/mcheck/p6.c
index 62efc9c2b3af..2ac52d7b434b 100644
--- a/arch/x86/kernel/cpu/mcheck/p6.c
+++ b/arch/x86/kernel/cpu/mcheck/p6.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * P6 specific Machine Check Exception Reporting 2 * P6 specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Alan Cox <alan@redhat.com> 3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
4 */ 4 */
5 5
6#include <linux/init.h> 6#include <linux/init.h>
diff --git a/arch/x86/kernel/cpu/mcheck/winchip.c b/arch/x86/kernel/cpu/mcheck/winchip.c
index f2be3e190c6b..2a043d89811d 100644
--- a/arch/x86/kernel/cpu/mcheck/winchip.c
+++ b/arch/x86/kernel/cpu/mcheck/winchip.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * IDT Winchip specific Machine Check Exception Reporting 2 * IDT Winchip specific Machine Check Exception Reporting
3 * (C) Copyright 2002 Alan Cox <alan@redhat.com> 3 * (C) Copyright 2002 Alan Cox <alan@lxorguk.ukuu.org.uk>
4 */ 4 */
5 5
6#include <linux/init.h> 6#include <linux/init.h>
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 4e8d77f01eeb..b59ddcc88cd8 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -14,14 +14,6 @@
14#include <asm/pat.h> 14#include <asm/pat.h>
15#include "mtrr.h" 15#include "mtrr.h"
16 16
17struct mtrr_state {
18 struct mtrr_var_range var_ranges[MAX_VAR_RANGES];
19 mtrr_type fixed_ranges[NUM_FIXED_RANGES];
20 unsigned char enabled;
21 unsigned char have_fixed;
22 mtrr_type def_type;
23};
24
25struct fixed_range_block { 17struct fixed_range_block {
26 int base_msr; /* start address of an MTRR block */ 18 int base_msr; /* start address of an MTRR block */
27 int ranges; /* number of MTRRs in this block */ 19 int ranges; /* number of MTRRs in this block */
@@ -35,10 +27,12 @@ static struct fixed_range_block fixed_range_blocks[] = {
35}; 27};
36 28
37static unsigned long smp_changes_mask; 29static unsigned long smp_changes_mask;
38static struct mtrr_state mtrr_state = {};
39static int mtrr_state_set; 30static int mtrr_state_set;
40u64 mtrr_tom2; 31u64 mtrr_tom2;
41 32
33struct mtrr_state_type mtrr_state = {};
34EXPORT_SYMBOL_GPL(mtrr_state);
35
42#undef MODULE_PARAM_PREFIX 36#undef MODULE_PARAM_PREFIX
43#define MODULE_PARAM_PREFIX "mtrr." 37#define MODULE_PARAM_PREFIX "mtrr."
44 38
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c
index 1159e269e596..d259e5d2e054 100644
--- a/arch/x86/kernel/cpu/mtrr/main.c
+++ b/arch/x86/kernel/cpu/mtrr/main.c
@@ -49,7 +49,7 @@
49 49
50u32 num_var_ranges = 0; 50u32 num_var_ranges = 0;
51 51
52unsigned int mtrr_usage_table[MAX_VAR_RANGES]; 52unsigned int mtrr_usage_table[MTRR_MAX_VAR_RANGES];
53static DEFINE_MUTEX(mtrr_mutex); 53static DEFINE_MUTEX(mtrr_mutex);
54 54
55u64 size_or_mask, size_and_mask; 55u64 size_or_mask, size_and_mask;
@@ -574,7 +574,7 @@ struct mtrr_value {
574 unsigned long lsize; 574 unsigned long lsize;
575}; 575};
576 576
577static struct mtrr_value mtrr_state[MAX_VAR_RANGES]; 577static struct mtrr_value mtrr_state[MTRR_MAX_VAR_RANGES];
578 578
579static int mtrr_save(struct sys_device * sysdev, pm_message_t state) 579static int mtrr_save(struct sys_device * sysdev, pm_message_t state)
580{ 580{
@@ -824,16 +824,14 @@ static int enable_mtrr_cleanup __initdata =
824 824
825static int __init disable_mtrr_cleanup_setup(char *str) 825static int __init disable_mtrr_cleanup_setup(char *str)
826{ 826{
827 if (enable_mtrr_cleanup != -1) 827 enable_mtrr_cleanup = 0;
828 enable_mtrr_cleanup = 0;
829 return 0; 828 return 0;
830} 829}
831early_param("disable_mtrr_cleanup", disable_mtrr_cleanup_setup); 830early_param("disable_mtrr_cleanup", disable_mtrr_cleanup_setup);
832 831
833static int __init enable_mtrr_cleanup_setup(char *str) 832static int __init enable_mtrr_cleanup_setup(char *str)
834{ 833{
835 if (enable_mtrr_cleanup != -1) 834 enable_mtrr_cleanup = 1;
836 enable_mtrr_cleanup = 1;
837 return 0; 835 return 0;
838} 836}
839early_param("enable_mtrr_cleanup", enable_mtrr_cleanup_setup); 837early_param("enable_mtrr_cleanup", enable_mtrr_cleanup_setup);
diff --git a/arch/x86/kernel/cpu/mtrr/mtrr.h b/arch/x86/kernel/cpu/mtrr/mtrr.h
index 2dc4ec656b23..ffd60409cc6d 100644
--- a/arch/x86/kernel/cpu/mtrr/mtrr.h
+++ b/arch/x86/kernel/cpu/mtrr/mtrr.h
@@ -8,11 +8,6 @@
8#define MTRRcap_MSR 0x0fe 8#define MTRRcap_MSR 0x0fe
9#define MTRRdefType_MSR 0x2ff 9#define MTRRdefType_MSR 0x2ff
10 10
11#define MTRRphysBase_MSR(reg) (0x200 + 2 * (reg))
12#define MTRRphysMask_MSR(reg) (0x200 + 2 * (reg) + 1)
13
14#define NUM_FIXED_RANGES 88
15#define MAX_VAR_RANGES 256
16#define MTRRfix64K_00000_MSR 0x250 11#define MTRRfix64K_00000_MSR 0x250
17#define MTRRfix16K_80000_MSR 0x258 12#define MTRRfix16K_80000_MSR 0x258
18#define MTRRfix16K_A0000_MSR 0x259 13#define MTRRfix16K_A0000_MSR 0x259
@@ -29,11 +24,7 @@
29#define MTRR_CHANGE_MASK_VARIABLE 0x02 24#define MTRR_CHANGE_MASK_VARIABLE 0x02
30#define MTRR_CHANGE_MASK_DEFTYPE 0x04 25#define MTRR_CHANGE_MASK_DEFTYPE 0x04
31 26
32/* In the Intel processor's MTRR interface, the MTRR type is always held in 27extern unsigned int mtrr_usage_table[MTRR_MAX_VAR_RANGES];
33 an 8 bit field: */
34typedef u8 mtrr_type;
35
36extern unsigned int mtrr_usage_table[MAX_VAR_RANGES];
37 28
38struct mtrr_ops { 29struct mtrr_ops {
39 u32 vendor; 30 u32 vendor;
@@ -70,13 +61,6 @@ struct set_mtrr_context {
70 u32 ccr3; 61 u32 ccr3;
71}; 62};
72 63
73struct mtrr_var_range {
74 u32 base_lo;
75 u32 base_hi;
76 u32 mask_lo;
77 u32 mask_hi;
78};
79
80void set_mtrr_done(struct set_mtrr_context *ctxt); 64void set_mtrr_done(struct set_mtrr_context *ctxt);
81void set_mtrr_cache_disable(struct set_mtrr_context *ctxt); 65void set_mtrr_cache_disable(struct set_mtrr_context *ctxt);
82void set_mtrr_prepare_save(struct set_mtrr_context *ctxt); 66void set_mtrr_prepare_save(struct set_mtrr_context *ctxt);
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 72cefd1e649b..2ac1f0c2beb3 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -39,10 +39,10 @@
39#include <linux/device.h> 39#include <linux/device.h>
40#include <linux/cpu.h> 40#include <linux/cpu.h>
41#include <linux/notifier.h> 41#include <linux/notifier.h>
42#include <linux/uaccess.h>
42 43
43#include <asm/processor.h> 44#include <asm/processor.h>
44#include <asm/msr.h> 45#include <asm/msr.h>
45#include <asm/uaccess.h>
46#include <asm/system.h> 46#include <asm/system.h>
47 47
48static struct class *cpuid_class; 48static struct class *cpuid_class;
@@ -82,7 +82,7 @@ static loff_t cpuid_seek(struct file *file, loff_t offset, int orig)
82} 82}
83 83
84static ssize_t cpuid_read(struct file *file, char __user *buf, 84static ssize_t cpuid_read(struct file *file, char __user *buf,
85 size_t count, loff_t * ppos) 85 size_t count, loff_t *ppos)
86{ 86{
87 char __user *tmp = buf; 87 char __user *tmp = buf;
88 struct cpuid_regs cmd; 88 struct cpuid_regs cmd;
@@ -117,11 +117,11 @@ static int cpuid_open(struct inode *inode, struct file *file)
117 unsigned int cpu; 117 unsigned int cpu;
118 struct cpuinfo_x86 *c; 118 struct cpuinfo_x86 *c;
119 int ret = 0; 119 int ret = 0;
120 120
121 lock_kernel(); 121 lock_kernel();
122 122
123 cpu = iminor(file->f_path.dentry->d_inode); 123 cpu = iminor(file->f_path.dentry->d_inode);
124 if (cpu >= NR_CPUS || !cpu_online(cpu)) { 124 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
125 ret = -ENXIO; /* No such CPU */ 125 ret = -ENXIO; /* No such CPU */
126 goto out; 126 goto out;
127 } 127 }
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index d84a852e4cd7..c689d19e35ab 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -26,6 +26,7 @@
26#include <linux/kdebug.h> 26#include <linux/kdebug.h>
27#include <asm/smp.h> 27#include <asm/smp.h>
28#include <asm/reboot.h> 28#include <asm/reboot.h>
29#include <asm/virtext.h>
29 30
30#include <mach_ipi.h> 31#include <mach_ipi.h>
31 32
@@ -49,6 +50,15 @@ static void kdump_nmi_callback(int cpu, struct die_args *args)
49#endif 50#endif
50 crash_save_cpu(regs, cpu); 51 crash_save_cpu(regs, cpu);
51 52
53 /* Disable VMX or SVM if needed.
54 *
55 * We need to disable virtualization on all CPUs.
56 * Having VMX or SVM enabled on any CPU may break rebooting
57 * after the kdump kernel has finished its task.
58 */
59 cpu_emergency_vmxoff();
60 cpu_emergency_svm_disable();
61
52 disable_local_APIC(); 62 disable_local_APIC();
53} 63}
54 64
@@ -80,6 +90,14 @@ void native_machine_crash_shutdown(struct pt_regs *regs)
80 local_irq_disable(); 90 local_irq_disable();
81 91
82 kdump_nmi_shootdown_cpus(); 92 kdump_nmi_shootdown_cpus();
93
94 /* Booting kdump kernel with VMX or SVM enabled won't work,
95 * because (among other limitations) we can't disable paging
96 * with the virt flags.
97 */
98 cpu_emergency_vmxoff();
99 cpu_emergency_svm_disable();
100
83 lapic_shutdown(); 101 lapic_shutdown();
84#if defined(CONFIG_X86_IO_APIC) 102#if defined(CONFIG_X86_IO_APIC)
85 disable_IO_APIC(); 103 disable_IO_APIC();
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 65a13943e098..e85826829cf2 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -665,6 +665,27 @@ void __init e820_mark_nosave_regions(unsigned long limit_pfn)
665} 665}
666#endif 666#endif
667 667
668#ifdef CONFIG_HIBERNATION
669/**
670 * Mark ACPI NVS memory region, so that we can save/restore it during
671 * hibernation and the subsequent resume.
672 */
673static int __init e820_mark_nvs_memory(void)
674{
675 int i;
676
677 for (i = 0; i < e820.nr_map; i++) {
678 struct e820entry *ei = &e820.map[i];
679
680 if (ei->type == E820_NVS)
681 hibernate_nvs_register(ei->addr, ei->size);
682 }
683
684 return 0;
685}
686core_initcall(e820_mark_nvs_memory);
687#endif
688
668/* 689/*
669 * Early reserved memory areas. 690 * Early reserved memory areas.
670 */ 691 */
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c
index 744aa7fc49d5..76b8cd953dee 100644
--- a/arch/x86/kernel/early-quirks.c
+++ b/arch/x86/kernel/early-quirks.c
@@ -201,6 +201,12 @@ struct chipset {
201 void (*f)(int num, int slot, int func); 201 void (*f)(int num, int slot, int func);
202}; 202};
203 203
204/*
205 * Only works for devices on the root bus. If you add any devices
206 * not on bus 0 readd another loop level in early_quirks(). But
207 * be careful because at least the Nvidia quirk here relies on
208 * only matching on bus 0.
209 */
204static struct chipset early_qrk[] __initdata = { 210static struct chipset early_qrk[] __initdata = {
205 { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, 211 { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID,
206 PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, nvidia_bugs }, 212 PCI_CLASS_BRIDGE_PCI, PCI_ANY_ID, QFLAG_APPLY_ONCE, nvidia_bugs },
@@ -267,17 +273,17 @@ static int __init check_dev_quirk(int num, int slot, int func)
267 273
268void __init early_quirks(void) 274void __init early_quirks(void)
269{ 275{
270 int num, slot, func; 276 int slot, func;
271 277
272 if (!early_pci_allowed()) 278 if (!early_pci_allowed())
273 return; 279 return;
274 280
275 /* Poor man's PCI discovery */ 281 /* Poor man's PCI discovery */
276 for (num = 0; num < 32; num++) 282 /* Only scan the root bus */
277 for (slot = 0; slot < 32; slot++) 283 for (slot = 0; slot < 32; slot++)
278 for (func = 0; func < 8; func++) { 284 for (func = 0; func < 8; func++) {
279 /* Only probe function 0 on single fn devices */ 285 /* Only probe function 0 on single fn devices */
280 if (check_dev_quirk(num, slot, func)) 286 if (check_dev_quirk(0, slot, func))
281 break; 287 break;
282 } 288 }
283} 289}
diff --git a/arch/x86/kernel/early_printk.c b/arch/x86/kernel/early_printk.c
index 23b138e31e9c..504ad198e4ad 100644
--- a/arch/x86/kernel/early_printk.c
+++ b/arch/x86/kernel/early_printk.c
@@ -886,7 +886,7 @@ asmlinkage void early_printk(const char *fmt, ...)
886 va_list ap; 886 va_list ap;
887 887
888 va_start(ap, fmt); 888 va_start(ap, fmt);
889 n = vscnprintf(buf, 512, fmt, ap); 889 n = vscnprintf(buf, sizeof(buf), fmt, ap);
890 early_console->write(early_console, buf, n); 890 early_console->write(early_console, buf, n);
891 va_end(ap); 891 va_end(ap);
892} 892}
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c
index c0262791bda4..34185488e4fb 100644
--- a/arch/x86/kernel/genapic_flat_64.c
+++ b/arch/x86/kernel/genapic_flat_64.c
@@ -30,12 +30,12 @@ static int flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
30 return 1; 30 return 1;
31} 31}
32 32
33static cpumask_t flat_target_cpus(void) 33static const struct cpumask *flat_target_cpus(void)
34{ 34{
35 return cpu_online_map; 35 return cpu_online_mask;
36} 36}
37 37
38static cpumask_t flat_vector_allocation_domain(int cpu) 38static void flat_vector_allocation_domain(int cpu, struct cpumask *retmask)
39{ 39{
40 /* Careful. Some cpus do not strictly honor the set of cpus 40 /* Careful. Some cpus do not strictly honor the set of cpus
41 * specified in the interrupt destination when using lowest 41 * specified in the interrupt destination when using lowest
@@ -45,8 +45,8 @@ static cpumask_t flat_vector_allocation_domain(int cpu)
45 * deliver interrupts to the wrong hyperthread when only one 45 * deliver interrupts to the wrong hyperthread when only one
46 * hyperthread was specified in the interrupt desitination. 46 * hyperthread was specified in the interrupt desitination.
47 */ 47 */
48 cpumask_t domain = { { [0] = APIC_ALL_CPUS, } }; 48 cpumask_clear(retmask);
49 return domain; 49 cpumask_bits(retmask)[0] = APIC_ALL_CPUS;
50} 50}
51 51
52/* 52/*
@@ -69,9 +69,8 @@ static void flat_init_apic_ldr(void)
69 apic_write(APIC_LDR, val); 69 apic_write(APIC_LDR, val);
70} 70}
71 71
72static void flat_send_IPI_mask(cpumask_t cpumask, int vector) 72static inline void _flat_send_IPI_mask(unsigned long mask, int vector)
73{ 73{
74 unsigned long mask = cpus_addr(cpumask)[0];
75 unsigned long flags; 74 unsigned long flags;
76 75
77 local_irq_save(flags); 76 local_irq_save(flags);
@@ -79,20 +78,41 @@ static void flat_send_IPI_mask(cpumask_t cpumask, int vector)
79 local_irq_restore(flags); 78 local_irq_restore(flags);
80} 79}
81 80
81static void flat_send_IPI_mask(const struct cpumask *cpumask, int vector)
82{
83 unsigned long mask = cpumask_bits(cpumask)[0];
84
85 _flat_send_IPI_mask(mask, vector);
86}
87
88static void flat_send_IPI_mask_allbutself(const struct cpumask *cpumask,
89 int vector)
90{
91 unsigned long mask = cpumask_bits(cpumask)[0];
92 int cpu = smp_processor_id();
93
94 if (cpu < BITS_PER_LONG)
95 clear_bit(cpu, &mask);
96 _flat_send_IPI_mask(mask, vector);
97}
98
82static void flat_send_IPI_allbutself(int vector) 99static void flat_send_IPI_allbutself(int vector)
83{ 100{
101 int cpu = smp_processor_id();
84#ifdef CONFIG_HOTPLUG_CPU 102#ifdef CONFIG_HOTPLUG_CPU
85 int hotplug = 1; 103 int hotplug = 1;
86#else 104#else
87 int hotplug = 0; 105 int hotplug = 0;
88#endif 106#endif
89 if (hotplug || vector == NMI_VECTOR) { 107 if (hotplug || vector == NMI_VECTOR) {
90 cpumask_t allbutme = cpu_online_map; 108 if (!cpumask_equal(cpu_online_mask, cpumask_of(cpu))) {
109 unsigned long mask = cpumask_bits(cpu_online_mask)[0];
91 110
92 cpu_clear(smp_processor_id(), allbutme); 111 if (cpu < BITS_PER_LONG)
112 clear_bit(cpu, &mask);
93 113
94 if (!cpus_empty(allbutme)) 114 _flat_send_IPI_mask(mask, vector);
95 flat_send_IPI_mask(allbutme, vector); 115 }
96 } else if (num_online_cpus() > 1) { 116 } else if (num_online_cpus() > 1) {
97 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL); 117 __send_IPI_shortcut(APIC_DEST_ALLBUT, vector,APIC_DEST_LOGICAL);
98 } 118 }
@@ -101,7 +121,7 @@ static void flat_send_IPI_allbutself(int vector)
101static void flat_send_IPI_all(int vector) 121static void flat_send_IPI_all(int vector)
102{ 122{
103 if (vector == NMI_VECTOR) 123 if (vector == NMI_VECTOR)
104 flat_send_IPI_mask(cpu_online_map, vector); 124 flat_send_IPI_mask(cpu_online_mask, vector);
105 else 125 else
106 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); 126 __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL);
107} 127}
@@ -135,9 +155,18 @@ static int flat_apic_id_registered(void)
135 return physid_isset(read_xapic_id(), phys_cpu_present_map); 155 return physid_isset(read_xapic_id(), phys_cpu_present_map);
136} 156}
137 157
138static unsigned int flat_cpu_mask_to_apicid(cpumask_t cpumask) 158static unsigned int flat_cpu_mask_to_apicid(const struct cpumask *cpumask)
159{
160 return cpumask_bits(cpumask)[0] & APIC_ALL_CPUS;
161}
162
163static unsigned int flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
164 const struct cpumask *andmask)
139{ 165{
140 return cpus_addr(cpumask)[0] & APIC_ALL_CPUS; 166 unsigned long mask1 = cpumask_bits(cpumask)[0] & APIC_ALL_CPUS;
167 unsigned long mask2 = cpumask_bits(andmask)[0] & APIC_ALL_CPUS;
168
169 return mask1 & mask2;
141} 170}
142 171
143static unsigned int phys_pkg_id(int index_msb) 172static unsigned int phys_pkg_id(int index_msb)
@@ -157,8 +186,10 @@ struct genapic apic_flat = {
157 .send_IPI_all = flat_send_IPI_all, 186 .send_IPI_all = flat_send_IPI_all,
158 .send_IPI_allbutself = flat_send_IPI_allbutself, 187 .send_IPI_allbutself = flat_send_IPI_allbutself,
159 .send_IPI_mask = flat_send_IPI_mask, 188 .send_IPI_mask = flat_send_IPI_mask,
189 .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself,
160 .send_IPI_self = apic_send_IPI_self, 190 .send_IPI_self = apic_send_IPI_self,
161 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, 191 .cpu_mask_to_apicid = flat_cpu_mask_to_apicid,
192 .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and,
162 .phys_pkg_id = phys_pkg_id, 193 .phys_pkg_id = phys_pkg_id,
163 .get_apic_id = get_apic_id, 194 .get_apic_id = get_apic_id,
164 .set_apic_id = set_apic_id, 195 .set_apic_id = set_apic_id,
@@ -188,35 +219,39 @@ static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
188 return 0; 219 return 0;
189} 220}
190 221
191static cpumask_t physflat_target_cpus(void) 222static const struct cpumask *physflat_target_cpus(void)
192{ 223{
193 return cpu_online_map; 224 return cpu_online_mask;
194} 225}
195 226
196static cpumask_t physflat_vector_allocation_domain(int cpu) 227static void physflat_vector_allocation_domain(int cpu, struct cpumask *retmask)
197{ 228{
198 return cpumask_of_cpu(cpu); 229 cpumask_clear(retmask);
230 cpumask_set_cpu(cpu, retmask);
199} 231}
200 232
201static void physflat_send_IPI_mask(cpumask_t cpumask, int vector) 233static void physflat_send_IPI_mask(const struct cpumask *cpumask, int vector)
202{ 234{
203 send_IPI_mask_sequence(cpumask, vector); 235 send_IPI_mask_sequence(cpumask, vector);
204} 236}
205 237
206static void physflat_send_IPI_allbutself(int vector) 238static void physflat_send_IPI_mask_allbutself(const struct cpumask *cpumask,
239 int vector)
207{ 240{
208 cpumask_t allbutme = cpu_online_map; 241 send_IPI_mask_allbutself(cpumask, vector);
242}
209 243
210 cpu_clear(smp_processor_id(), allbutme); 244static void physflat_send_IPI_allbutself(int vector)
211 physflat_send_IPI_mask(allbutme, vector); 245{
246 send_IPI_mask_allbutself(cpu_online_mask, vector);
212} 247}
213 248
214static void physflat_send_IPI_all(int vector) 249static void physflat_send_IPI_all(int vector)
215{ 250{
216 physflat_send_IPI_mask(cpu_online_map, vector); 251 physflat_send_IPI_mask(cpu_online_mask, vector);
217} 252}
218 253
219static unsigned int physflat_cpu_mask_to_apicid(cpumask_t cpumask) 254static unsigned int physflat_cpu_mask_to_apicid(const struct cpumask *cpumask)
220{ 255{
221 int cpu; 256 int cpu;
222 257
@@ -224,13 +259,31 @@ static unsigned int physflat_cpu_mask_to_apicid(cpumask_t cpumask)
224 * We're using fixed IRQ delivery, can only return one phys APIC ID. 259 * We're using fixed IRQ delivery, can only return one phys APIC ID.
225 * May as well be the first. 260 * May as well be the first.
226 */ 261 */
227 cpu = first_cpu(cpumask); 262 cpu = cpumask_first(cpumask);
228 if ((unsigned)cpu < nr_cpu_ids) 263 if ((unsigned)cpu < nr_cpu_ids)
229 return per_cpu(x86_cpu_to_apicid, cpu); 264 return per_cpu(x86_cpu_to_apicid, cpu);
230 else 265 else
231 return BAD_APICID; 266 return BAD_APICID;
232} 267}
233 268
269static unsigned int
270physflat_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
271 const struct cpumask *andmask)
272{
273 int cpu;
274
275 /*
276 * We're using fixed IRQ delivery, can only return one phys APIC ID.
277 * May as well be the first.
278 */
279 for_each_cpu_and(cpu, cpumask, andmask)
280 if (cpumask_test_cpu(cpu, cpu_online_mask))
281 break;
282 if (cpu < nr_cpu_ids)
283 return per_cpu(x86_cpu_to_apicid, cpu);
284 return BAD_APICID;
285}
286
234struct genapic apic_physflat = { 287struct genapic apic_physflat = {
235 .name = "physical flat", 288 .name = "physical flat",
236 .acpi_madt_oem_check = physflat_acpi_madt_oem_check, 289 .acpi_madt_oem_check = physflat_acpi_madt_oem_check,
@@ -243,8 +296,10 @@ struct genapic apic_physflat = {
243 .send_IPI_all = physflat_send_IPI_all, 296 .send_IPI_all = physflat_send_IPI_all,
244 .send_IPI_allbutself = physflat_send_IPI_allbutself, 297 .send_IPI_allbutself = physflat_send_IPI_allbutself,
245 .send_IPI_mask = physflat_send_IPI_mask, 298 .send_IPI_mask = physflat_send_IPI_mask,
299 .send_IPI_mask_allbutself = physflat_send_IPI_mask_allbutself,
246 .send_IPI_self = apic_send_IPI_self, 300 .send_IPI_self = apic_send_IPI_self,
247 .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid, 301 .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid,
302 .cpu_mask_to_apicid_and = physflat_cpu_mask_to_apicid_and,
248 .phys_pkg_id = phys_pkg_id, 303 .phys_pkg_id = phys_pkg_id,
249 .get_apic_id = get_apic_id, 304 .get_apic_id = get_apic_id,
250 .set_apic_id = set_apic_id, 305 .set_apic_id = set_apic_id,
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c
index f6a2c8eb48a6..6ce497cc372d 100644
--- a/arch/x86/kernel/genx2apic_cluster.c
+++ b/arch/x86/kernel/genx2apic_cluster.c
@@ -22,19 +22,18 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
22 22
23/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ 23/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */
24 24
25static cpumask_t x2apic_target_cpus(void) 25static const struct cpumask *x2apic_target_cpus(void)
26{ 26{
27 return cpumask_of_cpu(0); 27 return cpumask_of(0);
28} 28}
29 29
30/* 30/*
31 * for now each logical cpu is in its own vector allocation domain. 31 * for now each logical cpu is in its own vector allocation domain.
32 */ 32 */
33static cpumask_t x2apic_vector_allocation_domain(int cpu) 33static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)
34{ 34{
35 cpumask_t domain = CPU_MASK_NONE; 35 cpumask_clear(retmask);
36 cpu_set(cpu, domain); 36 cpumask_set_cpu(cpu, retmask);
37 return domain;
38} 37}
39 38
40static void __x2apic_send_IPI_dest(unsigned int apicid, int vector, 39static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
@@ -56,32 +55,53 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
56 * at once. We have 16 cpu's in a cluster. This will minimize IPI register 55 * at once. We have 16 cpu's in a cluster. This will minimize IPI register
57 * writes. 56 * writes.
58 */ 57 */
59static void x2apic_send_IPI_mask(cpumask_t mask, int vector) 58static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
60{ 59{
61 unsigned long flags; 60 unsigned long flags;
62 unsigned long query_cpu; 61 unsigned long query_cpu;
63 62
64 local_irq_save(flags); 63 local_irq_save(flags);
65 for_each_cpu_mask(query_cpu, mask) { 64 for_each_cpu(query_cpu, mask)
66 __x2apic_send_IPI_dest(per_cpu(x86_cpu_to_logical_apicid, query_cpu), 65 __x2apic_send_IPI_dest(
67 vector, APIC_DEST_LOGICAL); 66 per_cpu(x86_cpu_to_logical_apicid, query_cpu),
68 } 67 vector, APIC_DEST_LOGICAL);
69 local_irq_restore(flags); 68 local_irq_restore(flags);
70} 69}
71 70
72static void x2apic_send_IPI_allbutself(int vector) 71static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,
72 int vector)
73{ 73{
74 cpumask_t mask = cpu_online_map; 74 unsigned long flags;
75 unsigned long query_cpu;
76 unsigned long this_cpu = smp_processor_id();
75 77
76 cpu_clear(smp_processor_id(), mask); 78 local_irq_save(flags);
79 for_each_cpu(query_cpu, mask)
80 if (query_cpu != this_cpu)
81 __x2apic_send_IPI_dest(
82 per_cpu(x86_cpu_to_logical_apicid, query_cpu),
83 vector, APIC_DEST_LOGICAL);
84 local_irq_restore(flags);
85}
86
87static void x2apic_send_IPI_allbutself(int vector)
88{
89 unsigned long flags;
90 unsigned long query_cpu;
91 unsigned long this_cpu = smp_processor_id();
77 92
78 if (!cpus_empty(mask)) 93 local_irq_save(flags);
79 x2apic_send_IPI_mask(mask, vector); 94 for_each_online_cpu(query_cpu)
95 if (query_cpu != this_cpu)
96 __x2apic_send_IPI_dest(
97 per_cpu(x86_cpu_to_logical_apicid, query_cpu),
98 vector, APIC_DEST_LOGICAL);
99 local_irq_restore(flags);
80} 100}
81 101
82static void x2apic_send_IPI_all(int vector) 102static void x2apic_send_IPI_all(int vector)
83{ 103{
84 x2apic_send_IPI_mask(cpu_online_map, vector); 104 x2apic_send_IPI_mask(cpu_online_mask, vector);
85} 105}
86 106
87static int x2apic_apic_id_registered(void) 107static int x2apic_apic_id_registered(void)
@@ -89,21 +109,38 @@ static int x2apic_apic_id_registered(void)
89 return 1; 109 return 1;
90} 110}
91 111
92static unsigned int x2apic_cpu_mask_to_apicid(cpumask_t cpumask) 112static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask)
93{ 113{
94 int cpu; 114 int cpu;
95 115
96 /* 116 /*
97 * We're using fixed IRQ delivery, can only return one phys APIC ID. 117 * We're using fixed IRQ delivery, can only return one logical APIC ID.
98 * May as well be the first. 118 * May as well be the first.
99 */ 119 */
100 cpu = first_cpu(cpumask); 120 cpu = cpumask_first(cpumask);
101 if ((unsigned)cpu < NR_CPUS) 121 if ((unsigned)cpu < nr_cpu_ids)
102 return per_cpu(x86_cpu_to_logical_apicid, cpu); 122 return per_cpu(x86_cpu_to_logical_apicid, cpu);
103 else 123 else
104 return BAD_APICID; 124 return BAD_APICID;
105} 125}
106 126
127static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
128 const struct cpumask *andmask)
129{
130 int cpu;
131
132 /*
133 * We're using fixed IRQ delivery, can only return one logical APIC ID.
134 * May as well be the first.
135 */
136 for_each_cpu_and(cpu, cpumask, andmask)
137 if (cpumask_test_cpu(cpu, cpu_online_mask))
138 break;
139 if (cpu < nr_cpu_ids)
140 return per_cpu(x86_cpu_to_logical_apicid, cpu);
141 return BAD_APICID;
142}
143
107static unsigned int get_apic_id(unsigned long x) 144static unsigned int get_apic_id(unsigned long x)
108{ 145{
109 unsigned int id; 146 unsigned int id;
@@ -150,8 +187,10 @@ struct genapic apic_x2apic_cluster = {
150 .send_IPI_all = x2apic_send_IPI_all, 187 .send_IPI_all = x2apic_send_IPI_all,
151 .send_IPI_allbutself = x2apic_send_IPI_allbutself, 188 .send_IPI_allbutself = x2apic_send_IPI_allbutself,
152 .send_IPI_mask = x2apic_send_IPI_mask, 189 .send_IPI_mask = x2apic_send_IPI_mask,
190 .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself,
153 .send_IPI_self = x2apic_send_IPI_self, 191 .send_IPI_self = x2apic_send_IPI_self,
154 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, 192 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid,
193 .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and,
155 .phys_pkg_id = phys_pkg_id, 194 .phys_pkg_id = phys_pkg_id,
156 .get_apic_id = get_apic_id, 195 .get_apic_id = get_apic_id,
157 .set_apic_id = set_apic_id, 196 .set_apic_id = set_apic_id,
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c
index d042211768b7..21bcc0e098ba 100644
--- a/arch/x86/kernel/genx2apic_phys.c
+++ b/arch/x86/kernel/genx2apic_phys.c
@@ -29,16 +29,15 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
29 29
30/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ 30/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */
31 31
32static cpumask_t x2apic_target_cpus(void) 32static const struct cpumask *x2apic_target_cpus(void)
33{ 33{
34 return cpumask_of_cpu(0); 34 return cpumask_of(0);
35} 35}
36 36
37static cpumask_t x2apic_vector_allocation_domain(int cpu) 37static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask)
38{ 38{
39 cpumask_t domain = CPU_MASK_NONE; 39 cpumask_clear(retmask);
40 cpu_set(cpu, domain); 40 cpumask_set_cpu(cpu, retmask);
41 return domain;
42} 41}
43 42
44static void __x2apic_send_IPI_dest(unsigned int apicid, int vector, 43static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
@@ -54,32 +53,54 @@ static void __x2apic_send_IPI_dest(unsigned int apicid, int vector,
54 x2apic_icr_write(cfg, apicid); 53 x2apic_icr_write(cfg, apicid);
55} 54}
56 55
57static void x2apic_send_IPI_mask(cpumask_t mask, int vector) 56static void x2apic_send_IPI_mask(const struct cpumask *mask, int vector)
58{ 57{
59 unsigned long flags; 58 unsigned long flags;
60 unsigned long query_cpu; 59 unsigned long query_cpu;
61 60
62 local_irq_save(flags); 61 local_irq_save(flags);
63 for_each_cpu_mask(query_cpu, mask) { 62 for_each_cpu(query_cpu, mask) {
64 __x2apic_send_IPI_dest(per_cpu(x86_cpu_to_apicid, query_cpu), 63 __x2apic_send_IPI_dest(per_cpu(x86_cpu_to_apicid, query_cpu),
65 vector, APIC_DEST_PHYSICAL); 64 vector, APIC_DEST_PHYSICAL);
66 } 65 }
67 local_irq_restore(flags); 66 local_irq_restore(flags);
68} 67}
69 68
70static void x2apic_send_IPI_allbutself(int vector) 69static void x2apic_send_IPI_mask_allbutself(const struct cpumask *mask,
70 int vector)
71{ 71{
72 cpumask_t mask = cpu_online_map; 72 unsigned long flags;
73 unsigned long query_cpu;
74 unsigned long this_cpu = smp_processor_id();
75
76 local_irq_save(flags);
77 for_each_cpu(query_cpu, mask) {
78 if (query_cpu != this_cpu)
79 __x2apic_send_IPI_dest(
80 per_cpu(x86_cpu_to_apicid, query_cpu),
81 vector, APIC_DEST_PHYSICAL);
82 }
83 local_irq_restore(flags);
84}
73 85
74 cpu_clear(smp_processor_id(), mask); 86static void x2apic_send_IPI_allbutself(int vector)
87{
88 unsigned long flags;
89 unsigned long query_cpu;
90 unsigned long this_cpu = smp_processor_id();
75 91
76 if (!cpus_empty(mask)) 92 local_irq_save(flags);
77 x2apic_send_IPI_mask(mask, vector); 93 for_each_online_cpu(query_cpu)
94 if (query_cpu != this_cpu)
95 __x2apic_send_IPI_dest(
96 per_cpu(x86_cpu_to_apicid, query_cpu),
97 vector, APIC_DEST_PHYSICAL);
98 local_irq_restore(flags);
78} 99}
79 100
80static void x2apic_send_IPI_all(int vector) 101static void x2apic_send_IPI_all(int vector)
81{ 102{
82 x2apic_send_IPI_mask(cpu_online_map, vector); 103 x2apic_send_IPI_mask(cpu_online_mask, vector);
83} 104}
84 105
85static int x2apic_apic_id_registered(void) 106static int x2apic_apic_id_registered(void)
@@ -87,7 +108,7 @@ static int x2apic_apic_id_registered(void)
87 return 1; 108 return 1;
88} 109}
89 110
90static unsigned int x2apic_cpu_mask_to_apicid(cpumask_t cpumask) 111static unsigned int x2apic_cpu_mask_to_apicid(const struct cpumask *cpumask)
91{ 112{
92 int cpu; 113 int cpu;
93 114
@@ -95,13 +116,30 @@ static unsigned int x2apic_cpu_mask_to_apicid(cpumask_t cpumask)
95 * We're using fixed IRQ delivery, can only return one phys APIC ID. 116 * We're using fixed IRQ delivery, can only return one phys APIC ID.
96 * May as well be the first. 117 * May as well be the first.
97 */ 118 */
98 cpu = first_cpu(cpumask); 119 cpu = cpumask_first(cpumask);
99 if ((unsigned)cpu < NR_CPUS) 120 if ((unsigned)cpu < nr_cpu_ids)
100 return per_cpu(x86_cpu_to_apicid, cpu); 121 return per_cpu(x86_cpu_to_apicid, cpu);
101 else 122 else
102 return BAD_APICID; 123 return BAD_APICID;
103} 124}
104 125
126static unsigned int x2apic_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
127 const struct cpumask *andmask)
128{
129 int cpu;
130
131 /*
132 * We're using fixed IRQ delivery, can only return one phys APIC ID.
133 * May as well be the first.
134 */
135 for_each_cpu_and(cpu, cpumask, andmask)
136 if (cpumask_test_cpu(cpu, cpu_online_mask))
137 break;
138 if (cpu < nr_cpu_ids)
139 return per_cpu(x86_cpu_to_apicid, cpu);
140 return BAD_APICID;
141}
142
105static unsigned int get_apic_id(unsigned long x) 143static unsigned int get_apic_id(unsigned long x)
106{ 144{
107 unsigned int id; 145 unsigned int id;
@@ -123,12 +161,12 @@ static unsigned int phys_pkg_id(int index_msb)
123 return current_cpu_data.initial_apicid >> index_msb; 161 return current_cpu_data.initial_apicid >> index_msb;
124} 162}
125 163
126void x2apic_send_IPI_self(int vector) 164static void x2apic_send_IPI_self(int vector)
127{ 165{
128 apic_write(APIC_SELF_IPI, vector); 166 apic_write(APIC_SELF_IPI, vector);
129} 167}
130 168
131void init_x2apic_ldr(void) 169static void init_x2apic_ldr(void)
132{ 170{
133 return; 171 return;
134} 172}
@@ -145,8 +183,10 @@ struct genapic apic_x2apic_phys = {
145 .send_IPI_all = x2apic_send_IPI_all, 183 .send_IPI_all = x2apic_send_IPI_all,
146 .send_IPI_allbutself = x2apic_send_IPI_allbutself, 184 .send_IPI_allbutself = x2apic_send_IPI_allbutself,
147 .send_IPI_mask = x2apic_send_IPI_mask, 185 .send_IPI_mask = x2apic_send_IPI_mask,
186 .send_IPI_mask_allbutself = x2apic_send_IPI_mask_allbutself,
148 .send_IPI_self = x2apic_send_IPI_self, 187 .send_IPI_self = x2apic_send_IPI_self,
149 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, 188 .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid,
189 .cpu_mask_to_apicid_and = x2apic_cpu_mask_to_apicid_and,
150 .phys_pkg_id = phys_pkg_id, 190 .phys_pkg_id = phys_pkg_id,
151 .get_apic_id = get_apic_id, 191 .get_apic_id = get_apic_id,
152 .set_apic_id = set_apic_id, 192 .set_apic_id = set_apic_id,
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index dece17289731..b193e082f6ce 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -79,16 +79,15 @@ EXPORT_SYMBOL(sn_rtc_cycles_per_second);
79 79
80/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ 80/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */
81 81
82static cpumask_t uv_target_cpus(void) 82static const struct cpumask *uv_target_cpus(void)
83{ 83{
84 return cpumask_of_cpu(0); 84 return cpumask_of(0);
85} 85}
86 86
87static cpumask_t uv_vector_allocation_domain(int cpu) 87static void uv_vector_allocation_domain(int cpu, struct cpumask *retmask)
88{ 88{
89 cpumask_t domain = CPU_MASK_NONE; 89 cpumask_clear(retmask);
90 cpu_set(cpu, domain); 90 cpumask_set_cpu(cpu, retmask);
91 return domain;
92} 91}
93 92
94int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip) 93int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip)
@@ -127,28 +126,37 @@ static void uv_send_IPI_one(int cpu, int vector)
127 uv_write_global_mmr64(pnode, UVH_IPI_INT, val); 126 uv_write_global_mmr64(pnode, UVH_IPI_INT, val);
128} 127}
129 128
130static void uv_send_IPI_mask(cpumask_t mask, int vector) 129static void uv_send_IPI_mask(const struct cpumask *mask, int vector)
131{ 130{
132 unsigned int cpu; 131 unsigned int cpu;
133 132
134 for_each_possible_cpu(cpu) 133 for_each_cpu(cpu, mask)
135 if (cpu_isset(cpu, mask)) 134 uv_send_IPI_one(cpu, vector);
135}
136
137static void uv_send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
138{
139 unsigned int cpu;
140 unsigned int this_cpu = smp_processor_id();
141
142 for_each_cpu(cpu, mask)
143 if (cpu != this_cpu)
136 uv_send_IPI_one(cpu, vector); 144 uv_send_IPI_one(cpu, vector);
137} 145}
138 146
139static void uv_send_IPI_allbutself(int vector) 147static void uv_send_IPI_allbutself(int vector)
140{ 148{
141 cpumask_t mask = cpu_online_map; 149 unsigned int cpu;
142 150 unsigned int this_cpu = smp_processor_id();
143 cpu_clear(smp_processor_id(), mask);
144 151
145 if (!cpus_empty(mask)) 152 for_each_online_cpu(cpu)
146 uv_send_IPI_mask(mask, vector); 153 if (cpu != this_cpu)
154 uv_send_IPI_one(cpu, vector);
147} 155}
148 156
149static void uv_send_IPI_all(int vector) 157static void uv_send_IPI_all(int vector)
150{ 158{
151 uv_send_IPI_mask(cpu_online_map, vector); 159 uv_send_IPI_mask(cpu_online_mask, vector);
152} 160}
153 161
154static int uv_apic_id_registered(void) 162static int uv_apic_id_registered(void)
@@ -160,7 +168,7 @@ static void uv_init_apic_ldr(void)
160{ 168{
161} 169}
162 170
163static unsigned int uv_cpu_mask_to_apicid(cpumask_t cpumask) 171static unsigned int uv_cpu_mask_to_apicid(const struct cpumask *cpumask)
164{ 172{
165 int cpu; 173 int cpu;
166 174
@@ -168,13 +176,30 @@ static unsigned int uv_cpu_mask_to_apicid(cpumask_t cpumask)
168 * We're using fixed IRQ delivery, can only return one phys APIC ID. 176 * We're using fixed IRQ delivery, can only return one phys APIC ID.
169 * May as well be the first. 177 * May as well be the first.
170 */ 178 */
171 cpu = first_cpu(cpumask); 179 cpu = cpumask_first(cpumask);
172 if ((unsigned)cpu < nr_cpu_ids) 180 if ((unsigned)cpu < nr_cpu_ids)
173 return per_cpu(x86_cpu_to_apicid, cpu); 181 return per_cpu(x86_cpu_to_apicid, cpu);
174 else 182 else
175 return BAD_APICID; 183 return BAD_APICID;
176} 184}
177 185
186static unsigned int uv_cpu_mask_to_apicid_and(const struct cpumask *cpumask,
187 const struct cpumask *andmask)
188{
189 int cpu;
190
191 /*
192 * We're using fixed IRQ delivery, can only return one phys APIC ID.
193 * May as well be the first.
194 */
195 for_each_cpu_and(cpu, cpumask, andmask)
196 if (cpumask_test_cpu(cpu, cpu_online_mask))
197 break;
198 if (cpu < nr_cpu_ids)
199 return per_cpu(x86_cpu_to_apicid, cpu);
200 return BAD_APICID;
201}
202
178static unsigned int get_apic_id(unsigned long x) 203static unsigned int get_apic_id(unsigned long x)
179{ 204{
180 unsigned int id; 205 unsigned int id;
@@ -222,8 +247,10 @@ struct genapic apic_x2apic_uv_x = {
222 .send_IPI_all = uv_send_IPI_all, 247 .send_IPI_all = uv_send_IPI_all,
223 .send_IPI_allbutself = uv_send_IPI_allbutself, 248 .send_IPI_allbutself = uv_send_IPI_allbutself,
224 .send_IPI_mask = uv_send_IPI_mask, 249 .send_IPI_mask = uv_send_IPI_mask,
250 .send_IPI_mask_allbutself = uv_send_IPI_mask_allbutself,
225 .send_IPI_self = uv_send_IPI_self, 251 .send_IPI_self = uv_send_IPI_self,
226 .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, 252 .cpu_mask_to_apicid = uv_cpu_mask_to_apicid,
253 .cpu_mask_to_apicid_and = uv_cpu_mask_to_apicid_and,
227 .phys_pkg_id = phys_pkg_id, 254 .phys_pkg_id = phys_pkg_id,
228 .get_apic_id = get_apic_id, 255 .get_apic_id = get_apic_id,
229 .set_apic_id = set_apic_id, 256 .set_apic_id = set_apic_id,
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index 388e05a5fc17..b9a4d8c4b935 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -27,7 +27,7 @@
27#include <asm/trampoline.h> 27#include <asm/trampoline.h>
28 28
29/* boot cpu pda */ 29/* boot cpu pda */
30static struct x8664_pda _boot_cpu_pda __read_mostly; 30static struct x8664_pda _boot_cpu_pda;
31 31
32#ifdef CONFIG_SMP 32#ifdef CONFIG_SMP
33/* 33/*
diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S
index 26cfdc1d7c7f..0e275d495563 100644
--- a/arch/x86/kernel/head_64.S
+++ b/arch/x86/kernel/head_64.S
@@ -305,7 +305,7 @@ ENTRY(early_idt_handler)
305 call dump_stack 305 call dump_stack
306#ifdef CONFIG_KALLSYMS 306#ifdef CONFIG_KALLSYMS
307 leaq early_idt_ripmsg(%rip),%rdi 307 leaq early_idt_ripmsg(%rip),%rdi
308 movq 8(%rsp),%rsi # get rip again 308 movq 0(%rsp),%rsi # get rip again
309 call __print_symbol 309 call __print_symbol
310#endif 310#endif
311#endif /* EARLY_PRINTK */ 311#endif /* EARLY_PRINTK */
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 845ea097383e..cd759ad90690 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -248,7 +248,7 @@ static void hpet_legacy_clockevent_register(void)
248 * Start hpet with the boot cpu mask and make it 248 * Start hpet with the boot cpu mask and make it
249 * global after the IO_APIC has been initialized. 249 * global after the IO_APIC has been initialized.
250 */ 250 */
251 hpet_clockevent.cpumask = cpumask_of_cpu(smp_processor_id()); 251 hpet_clockevent.cpumask = cpumask_of(smp_processor_id());
252 clockevents_register_device(&hpet_clockevent); 252 clockevents_register_device(&hpet_clockevent);
253 global_clock_event = &hpet_clockevent; 253 global_clock_event = &hpet_clockevent;
254 printk(KERN_DEBUG "hpet clockevent registered\n"); 254 printk(KERN_DEBUG "hpet clockevent registered\n");
@@ -303,7 +303,7 @@ static void hpet_set_mode(enum clock_event_mode mode,
303 struct hpet_dev *hdev = EVT_TO_HPET_DEV(evt); 303 struct hpet_dev *hdev = EVT_TO_HPET_DEV(evt);
304 hpet_setup_msi_irq(hdev->irq); 304 hpet_setup_msi_irq(hdev->irq);
305 disable_irq(hdev->irq); 305 disable_irq(hdev->irq);
306 irq_set_affinity(hdev->irq, cpumask_of_cpu(hdev->cpu)); 306 irq_set_affinity(hdev->irq, cpumask_of(hdev->cpu));
307 enable_irq(hdev->irq); 307 enable_irq(hdev->irq);
308 } 308 }
309 break; 309 break;
@@ -451,7 +451,7 @@ static int hpet_setup_irq(struct hpet_dev *dev)
451 return -1; 451 return -1;
452 452
453 disable_irq(dev->irq); 453 disable_irq(dev->irq);
454 irq_set_affinity(dev->irq, cpumask_of_cpu(dev->cpu)); 454 irq_set_affinity(dev->irq, cpumask_of(dev->cpu));
455 enable_irq(dev->irq); 455 enable_irq(dev->irq);
456 456
457 printk(KERN_DEBUG "hpet: %s irq %d for MSI\n", 457 printk(KERN_DEBUG "hpet: %s irq %d for MSI\n",
@@ -502,7 +502,7 @@ static void init_one_hpet_msi_clockevent(struct hpet_dev *hdev, int cpu)
502 /* 5 usec minimum reprogramming delta. */ 502 /* 5 usec minimum reprogramming delta. */
503 evt->min_delta_ns = 5000; 503 evt->min_delta_ns = 5000;
504 504
505 evt->cpumask = cpumask_of_cpu(hdev->cpu); 505 evt->cpumask = cpumask_of(hdev->cpu);
506 clockevents_register_device(evt); 506 clockevents_register_device(evt);
507} 507}
508 508
diff --git a/arch/x86/kernel/i8253.c b/arch/x86/kernel/i8253.c
index c1b5e3ece1f2..10f92fb532f3 100644
--- a/arch/x86/kernel/i8253.c
+++ b/arch/x86/kernel/i8253.c
@@ -114,7 +114,7 @@ void __init setup_pit_timer(void)
114 * Start pit with the boot cpu mask and make it global after the 114 * Start pit with the boot cpu mask and make it global after the
115 * IO_APIC has been initialized. 115 * IO_APIC has been initialized.
116 */ 116 */
117 pit_clockevent.cpumask = cpumask_of_cpu(smp_processor_id()); 117 pit_clockevent.cpumask = cpumask_of(smp_processor_id());
118 pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 118 pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
119 pit_clockevent.shift); 119 pit_clockevent.shift);
120 pit_clockevent.max_delta_ns = 120 pit_clockevent.max_delta_ns =
diff --git a/arch/x86/kernel/i8259.c b/arch/x86/kernel/i8259.c
index 4b8a53d841f7..11d5093eb281 100644
--- a/arch/x86/kernel/i8259.c
+++ b/arch/x86/kernel/i8259.c
@@ -11,15 +11,15 @@
11#include <linux/kernel_stat.h> 11#include <linux/kernel_stat.h>
12#include <linux/sysdev.h> 12#include <linux/sysdev.h>
13#include <linux/bitops.h> 13#include <linux/bitops.h>
14#include <linux/acpi.h>
15#include <linux/io.h>
16#include <linux/delay.h>
14 17
15#include <asm/acpi.h>
16#include <asm/atomic.h> 18#include <asm/atomic.h>
17#include <asm/system.h> 19#include <asm/system.h>
18#include <asm/io.h>
19#include <asm/timer.h> 20#include <asm/timer.h>
20#include <asm/hw_irq.h> 21#include <asm/hw_irq.h>
21#include <asm/pgtable.h> 22#include <asm/pgtable.h>
22#include <asm/delay.h>
23#include <asm/desc.h> 23#include <asm/desc.h>
24#include <asm/apic.h> 24#include <asm/apic.h>
25#include <asm/arch_hooks.h> 25#include <asm/arch_hooks.h>
@@ -323,7 +323,7 @@ void init_8259A(int auto_eoi)
323 outb_pic(0x11, PIC_MASTER_CMD); /* ICW1: select 8259A-1 init */ 323 outb_pic(0x11, PIC_MASTER_CMD); /* ICW1: select 8259A-1 init */
324 324
325 /* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 on x86-64, 325 /* ICW2: 8259A-1 IR0-7 mapped to 0x30-0x37 on x86-64,
326 to 0x20-0x27 on i386 */ 326 to 0x20-0x27 on i386 */
327 outb_pic(IRQ0_VECTOR, PIC_MASTER_IMR); 327 outb_pic(IRQ0_VECTOR, PIC_MASTER_IMR);
328 328
329 /* 8259A-1 (the master) has a slave on IR2 */ 329 /* 8259A-1 (the master) has a slave on IR2 */
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c
index 74917658b004..1c4a1302536c 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -129,15 +129,14 @@ static struct irq_pin_list *get_one_free_irq_2_pin(int cpu)
129 node = cpu_to_node(cpu); 129 node = cpu_to_node(cpu);
130 130
131 pin = kzalloc_node(sizeof(*pin), GFP_ATOMIC, node); 131 pin = kzalloc_node(sizeof(*pin), GFP_ATOMIC, node);
132 printk(KERN_DEBUG " alloc irq_2_pin on cpu %d node %d\n", cpu, node);
133 132
134 return pin; 133 return pin;
135} 134}
136 135
137struct irq_cfg { 136struct irq_cfg {
138 struct irq_pin_list *irq_2_pin; 137 struct irq_pin_list *irq_2_pin;
139 cpumask_t domain; 138 cpumask_var_t domain;
140 cpumask_t old_domain; 139 cpumask_var_t old_domain;
141 unsigned move_cleanup_count; 140 unsigned move_cleanup_count;
142 u8 vector; 141 u8 vector;
143 u8 move_in_progress : 1; 142 u8 move_in_progress : 1;
@@ -152,22 +151,22 @@ static struct irq_cfg irq_cfgx[] = {
152#else 151#else
153static struct irq_cfg irq_cfgx[NR_IRQS] = { 152static struct irq_cfg irq_cfgx[NR_IRQS] = {
154#endif 153#endif
155 [0] = { .domain = CPU_MASK_ALL, .vector = IRQ0_VECTOR, }, 154 [0] = { .vector = IRQ0_VECTOR, },
156 [1] = { .domain = CPU_MASK_ALL, .vector = IRQ1_VECTOR, }, 155 [1] = { .vector = IRQ1_VECTOR, },
157 [2] = { .domain = CPU_MASK_ALL, .vector = IRQ2_VECTOR, }, 156 [2] = { .vector = IRQ2_VECTOR, },
158 [3] = { .domain = CPU_MASK_ALL, .vector = IRQ3_VECTOR, }, 157 [3] = { .vector = IRQ3_VECTOR, },
159 [4] = { .domain = CPU_MASK_ALL, .vector = IRQ4_VECTOR, }, 158 [4] = { .vector = IRQ4_VECTOR, },
160 [5] = { .domain = CPU_MASK_ALL, .vector = IRQ5_VECTOR, }, 159 [5] = { .vector = IRQ5_VECTOR, },
161 [6] = { .domain = CPU_MASK_ALL, .vector = IRQ6_VECTOR, }, 160 [6] = { .vector = IRQ6_VECTOR, },
162 [7] = { .domain = CPU_MASK_ALL, .vector = IRQ7_VECTOR, }, 161 [7] = { .vector = IRQ7_VECTOR, },
163 [8] = { .domain = CPU_MASK_ALL, .vector = IRQ8_VECTOR, }, 162 [8] = { .vector = IRQ8_VECTOR, },
164 [9] = { .domain = CPU_MASK_ALL, .vector = IRQ9_VECTOR, }, 163 [9] = { .vector = IRQ9_VECTOR, },
165 [10] = { .domain = CPU_MASK_ALL, .vector = IRQ10_VECTOR, }, 164 [10] = { .vector = IRQ10_VECTOR, },
166 [11] = { .domain = CPU_MASK_ALL, .vector = IRQ11_VECTOR, }, 165 [11] = { .vector = IRQ11_VECTOR, },
167 [12] = { .domain = CPU_MASK_ALL, .vector = IRQ12_VECTOR, }, 166 [12] = { .vector = IRQ12_VECTOR, },
168 [13] = { .domain = CPU_MASK_ALL, .vector = IRQ13_VECTOR, }, 167 [13] = { .vector = IRQ13_VECTOR, },
169 [14] = { .domain = CPU_MASK_ALL, .vector = IRQ14_VECTOR, }, 168 [14] = { .vector = IRQ14_VECTOR, },
170 [15] = { .domain = CPU_MASK_ALL, .vector = IRQ15_VECTOR, }, 169 [15] = { .vector = IRQ15_VECTOR, },
171}; 170};
172 171
173int __init arch_early_irq_init(void) 172int __init arch_early_irq_init(void)
@@ -183,6 +182,10 @@ int __init arch_early_irq_init(void)
183 for (i = 0; i < count; i++) { 182 for (i = 0; i < count; i++) {
184 desc = irq_to_desc(i); 183 desc = irq_to_desc(i);
185 desc->chip_data = &cfg[i]; 184 desc->chip_data = &cfg[i];
185 alloc_bootmem_cpumask_var(&cfg[i].domain);
186 alloc_bootmem_cpumask_var(&cfg[i].old_domain);
187 if (i < NR_IRQS_LEGACY)
188 cpumask_setall(cfg[i].domain);
186 } 189 }
187 190
188 return 0; 191 return 0;
@@ -209,7 +212,20 @@ static struct irq_cfg *get_one_free_irq_cfg(int cpu)
209 node = cpu_to_node(cpu); 212 node = cpu_to_node(cpu);
210 213
211 cfg = kzalloc_node(sizeof(*cfg), GFP_ATOMIC, node); 214 cfg = kzalloc_node(sizeof(*cfg), GFP_ATOMIC, node);
212 printk(KERN_DEBUG " alloc irq_cfg on cpu %d node %d\n", cpu, node); 215 if (cfg) {
216 if (!alloc_cpumask_var_node(&cfg->domain, GFP_ATOMIC, node)) {
217 kfree(cfg);
218 cfg = NULL;
219 } else if (!alloc_cpumask_var_node(&cfg->old_domain,
220 GFP_ATOMIC, node)) {
221 free_cpumask_var(cfg->domain);
222 kfree(cfg);
223 cfg = NULL;
224 } else {
225 cpumask_clear(cfg->domain);
226 cpumask_clear(cfg->old_domain);
227 }
228 }
213 229
214 return cfg; 230 return cfg;
215} 231}
@@ -333,13 +349,14 @@ void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
333 } 349 }
334} 350}
335 351
336static void set_extra_move_desc(struct irq_desc *desc, cpumask_t mask) 352static void
353set_extra_move_desc(struct irq_desc *desc, const struct cpumask *mask)
337{ 354{
338 struct irq_cfg *cfg = desc->chip_data; 355 struct irq_cfg *cfg = desc->chip_data;
339 356
340 if (!cfg->move_in_progress) { 357 if (!cfg->move_in_progress) {
341 /* it means that domain is not changed */ 358 /* it means that domain is not changed */
342 if (!cpus_intersects(desc->affinity, mask)) 359 if (!cpumask_intersects(&desc->affinity, mask))
343 cfg->move_desc_pending = 1; 360 cfg->move_desc_pending = 1;
344 } 361 }
345} 362}
@@ -354,7 +371,8 @@ static struct irq_cfg *irq_cfg(unsigned int irq)
354#endif 371#endif
355 372
356#ifndef CONFIG_NUMA_MIGRATE_IRQ_DESC 373#ifndef CONFIG_NUMA_MIGRATE_IRQ_DESC
357static inline void set_extra_move_desc(struct irq_desc *desc, cpumask_t mask) 374static inline void
375set_extra_move_desc(struct irq_desc *desc, const struct cpumask *mask)
358{ 376{
359} 377}
360#endif 378#endif
@@ -485,6 +503,26 @@ static void ioapic_mask_entry(int apic, int pin)
485} 503}
486 504
487#ifdef CONFIG_SMP 505#ifdef CONFIG_SMP
506static void send_cleanup_vector(struct irq_cfg *cfg)
507{
508 cpumask_var_t cleanup_mask;
509
510 if (unlikely(!alloc_cpumask_var(&cleanup_mask, GFP_ATOMIC))) {
511 unsigned int i;
512 cfg->move_cleanup_count = 0;
513 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
514 cfg->move_cleanup_count++;
515 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
516 send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR);
517 } else {
518 cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask);
519 cfg->move_cleanup_count = cpumask_weight(cleanup_mask);
520 send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
521 free_cpumask_var(cleanup_mask);
522 }
523 cfg->move_in_progress = 0;
524}
525
488static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, struct irq_cfg *cfg) 526static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, struct irq_cfg *cfg)
489{ 527{
490 int apic, pin; 528 int apic, pin;
@@ -520,41 +558,55 @@ static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, struct irq
520 } 558 }
521} 559}
522 560
523static int assign_irq_vector(int irq, struct irq_cfg *cfg, cpumask_t mask); 561static int
562assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask);
524 563
525static void set_ioapic_affinity_irq_desc(struct irq_desc *desc, cpumask_t mask) 564/*
565 * Either sets desc->affinity to a valid value, and returns cpu_mask_to_apicid
566 * of that, or returns BAD_APICID and leaves desc->affinity untouched.
567 */
568static unsigned int
569set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
526{ 570{
527 struct irq_cfg *cfg; 571 struct irq_cfg *cfg;
528 unsigned long flags;
529 unsigned int dest;
530 cpumask_t tmp;
531 unsigned int irq; 572 unsigned int irq;
532 573
533 cpus_and(tmp, mask, cpu_online_map); 574 if (!cpumask_intersects(mask, cpu_online_mask))
534 if (cpus_empty(tmp)) 575 return BAD_APICID;
535 return;
536 576
537 irq = desc->irq; 577 irq = desc->irq;
538 cfg = desc->chip_data; 578 cfg = desc->chip_data;
539 if (assign_irq_vector(irq, cfg, mask)) 579 if (assign_irq_vector(irq, cfg, mask))
540 return; 580 return BAD_APICID;
541 581
582 cpumask_and(&desc->affinity, cfg->domain, mask);
542 set_extra_move_desc(desc, mask); 583 set_extra_move_desc(desc, mask);
584 return cpu_mask_to_apicid_and(&desc->affinity, cpu_online_mask);
585}
543 586
544 cpus_and(tmp, cfg->domain, mask); 587static void
545 dest = cpu_mask_to_apicid(tmp); 588set_ioapic_affinity_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
546 /* 589{
547 * Only the high 8 bits are valid. 590 struct irq_cfg *cfg;
548 */ 591 unsigned long flags;
549 dest = SET_APIC_LOGICAL_ID(dest); 592 unsigned int dest;
593 unsigned int irq;
594
595 irq = desc->irq;
596 cfg = desc->chip_data;
550 597
551 spin_lock_irqsave(&ioapic_lock, flags); 598 spin_lock_irqsave(&ioapic_lock, flags);
552 __target_IO_APIC_irq(irq, dest, cfg); 599 dest = set_desc_affinity(desc, mask);
553 desc->affinity = mask; 600 if (dest != BAD_APICID) {
601 /* Only the high 8 bits are valid. */
602 dest = SET_APIC_LOGICAL_ID(dest);
603 __target_IO_APIC_irq(irq, dest, cfg);
604 }
554 spin_unlock_irqrestore(&ioapic_lock, flags); 605 spin_unlock_irqrestore(&ioapic_lock, flags);
555} 606}
556 607
557static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) 608static void
609set_ioapic_affinity_irq(unsigned int irq, const struct cpumask *mask)
558{ 610{
559 struct irq_desc *desc; 611 struct irq_desc *desc;
560 612
@@ -652,7 +704,7 @@ static void __unmask_IO_APIC_irq(struct irq_cfg *cfg)
652} 704}
653 705
654#ifdef CONFIG_X86_64 706#ifdef CONFIG_X86_64
655void io_apic_sync(struct irq_pin_list *entry) 707static void io_apic_sync(struct irq_pin_list *entry)
656{ 708{
657 /* 709 /*
658 * Synchronize the IO-APIC and the CPU by doing 710 * Synchronize the IO-APIC and the CPU by doing
@@ -1222,7 +1274,8 @@ void unlock_vector_lock(void)
1222 spin_unlock(&vector_lock); 1274 spin_unlock(&vector_lock);
1223} 1275}
1224 1276
1225static int __assign_irq_vector(int irq, struct irq_cfg *cfg, cpumask_t mask) 1277static int
1278__assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1226{ 1279{
1227 /* 1280 /*
1228 * NOTE! The local APIC isn't very good at handling 1281 * NOTE! The local APIC isn't very good at handling
@@ -1237,49 +1290,49 @@ static int __assign_irq_vector(int irq, struct irq_cfg *cfg, cpumask_t mask)
1237 */ 1290 */
1238 static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0; 1291 static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0;
1239 unsigned int old_vector; 1292 unsigned int old_vector;
1240 int cpu; 1293 int cpu, err;
1294 cpumask_var_t tmp_mask;
1241 1295
1242 if ((cfg->move_in_progress) || cfg->move_cleanup_count) 1296 if ((cfg->move_in_progress) || cfg->move_cleanup_count)
1243 return -EBUSY; 1297 return -EBUSY;
1244 1298
1245 /* Only try and allocate irqs on cpus that are present */ 1299 if (!alloc_cpumask_var(&tmp_mask, GFP_ATOMIC))
1246 cpus_and(mask, mask, cpu_online_map); 1300 return -ENOMEM;
1247 1301
1248 old_vector = cfg->vector; 1302 old_vector = cfg->vector;
1249 if (old_vector) { 1303 if (old_vector) {
1250 cpumask_t tmp; 1304 cpumask_and(tmp_mask, mask, cpu_online_mask);
1251 cpus_and(tmp, cfg->domain, mask); 1305 cpumask_and(tmp_mask, cfg->domain, tmp_mask);
1252 if (!cpus_empty(tmp)) 1306 if (!cpumask_empty(tmp_mask)) {
1307 free_cpumask_var(tmp_mask);
1253 return 0; 1308 return 0;
1309 }
1254 } 1310 }
1255 1311
1256 for_each_cpu_mask_nr(cpu, mask) { 1312 /* Only try and allocate irqs on cpus that are present */
1257 cpumask_t domain, new_mask; 1313 err = -ENOSPC;
1314 for_each_cpu_and(cpu, mask, cpu_online_mask) {
1258 int new_cpu; 1315 int new_cpu;
1259 int vector, offset; 1316 int vector, offset;
1260 1317
1261 domain = vector_allocation_domain(cpu); 1318 vector_allocation_domain(cpu, tmp_mask);
1262 cpus_and(new_mask, domain, cpu_online_map);
1263 1319
1264 vector = current_vector; 1320 vector = current_vector;
1265 offset = current_offset; 1321 offset = current_offset;
1266next: 1322next:
1267 vector += 8; 1323 vector += 8;
1268 if (vector >= first_system_vector) { 1324 if (vector >= first_system_vector) {
1269 /* If we run out of vectors on large boxen, must share them. */ 1325 /* If out of vectors on large boxen, must share them. */
1270 offset = (offset + 1) % 8; 1326 offset = (offset + 1) % 8;
1271 vector = FIRST_DEVICE_VECTOR + offset; 1327 vector = FIRST_DEVICE_VECTOR + offset;
1272 } 1328 }
1273 if (unlikely(current_vector == vector)) 1329 if (unlikely(current_vector == vector))
1274 continue; 1330 continue;
1275#ifdef CONFIG_X86_64 1331
1276 if (vector == IA32_SYSCALL_VECTOR) 1332 if (test_bit(vector, used_vectors))
1277 goto next;
1278#else
1279 if (vector == SYSCALL_VECTOR)
1280 goto next; 1333 goto next;
1281#endif 1334
1282 for_each_cpu_mask_nr(new_cpu, new_mask) 1335 for_each_cpu_and(new_cpu, tmp_mask, cpu_online_mask)
1283 if (per_cpu(vector_irq, new_cpu)[vector] != -1) 1336 if (per_cpu(vector_irq, new_cpu)[vector] != -1)
1284 goto next; 1337 goto next;
1285 /* Found one! */ 1338 /* Found one! */
@@ -1287,18 +1340,21 @@ next:
1287 current_offset = offset; 1340 current_offset = offset;
1288 if (old_vector) { 1341 if (old_vector) {
1289 cfg->move_in_progress = 1; 1342 cfg->move_in_progress = 1;
1290 cfg->old_domain = cfg->domain; 1343 cpumask_copy(cfg->old_domain, cfg->domain);
1291 } 1344 }
1292 for_each_cpu_mask_nr(new_cpu, new_mask) 1345 for_each_cpu_and(new_cpu, tmp_mask, cpu_online_mask)
1293 per_cpu(vector_irq, new_cpu)[vector] = irq; 1346 per_cpu(vector_irq, new_cpu)[vector] = irq;
1294 cfg->vector = vector; 1347 cfg->vector = vector;
1295 cfg->domain = domain; 1348 cpumask_copy(cfg->domain, tmp_mask);
1296 return 0; 1349 err = 0;
1350 break;
1297 } 1351 }
1298 return -ENOSPC; 1352 free_cpumask_var(tmp_mask);
1353 return err;
1299} 1354}
1300 1355
1301static int assign_irq_vector(int irq, struct irq_cfg *cfg, cpumask_t mask) 1356static int
1357assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1302{ 1358{
1303 int err; 1359 int err;
1304 unsigned long flags; 1360 unsigned long flags;
@@ -1311,23 +1367,20 @@ static int assign_irq_vector(int irq, struct irq_cfg *cfg, cpumask_t mask)
1311 1367
1312static void __clear_irq_vector(int irq, struct irq_cfg *cfg) 1368static void __clear_irq_vector(int irq, struct irq_cfg *cfg)
1313{ 1369{
1314 cpumask_t mask;
1315 int cpu, vector; 1370 int cpu, vector;
1316 1371
1317 BUG_ON(!cfg->vector); 1372 BUG_ON(!cfg->vector);
1318 1373
1319 vector = cfg->vector; 1374 vector = cfg->vector;
1320 cpus_and(mask, cfg->domain, cpu_online_map); 1375 for_each_cpu_and(cpu, cfg->domain, cpu_online_mask)
1321 for_each_cpu_mask_nr(cpu, mask)
1322 per_cpu(vector_irq, cpu)[vector] = -1; 1376 per_cpu(vector_irq, cpu)[vector] = -1;
1323 1377
1324 cfg->vector = 0; 1378 cfg->vector = 0;
1325 cpus_clear(cfg->domain); 1379 cpumask_clear(cfg->domain);
1326 1380
1327 if (likely(!cfg->move_in_progress)) 1381 if (likely(!cfg->move_in_progress))
1328 return; 1382 return;
1329 cpus_and(mask, cfg->old_domain, cpu_online_map); 1383 for_each_cpu_and(cpu, cfg->old_domain, cpu_online_mask) {
1330 for_each_cpu_mask_nr(cpu, mask) {
1331 for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS; 1384 for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS;
1332 vector++) { 1385 vector++) {
1333 if (per_cpu(vector_irq, cpu)[vector] != irq) 1386 if (per_cpu(vector_irq, cpu)[vector] != irq)
@@ -1350,7 +1403,7 @@ void __setup_vector_irq(int cpu)
1350 /* Mark the inuse vectors */ 1403 /* Mark the inuse vectors */
1351 for_each_irq_desc(irq, desc) { 1404 for_each_irq_desc(irq, desc) {
1352 cfg = desc->chip_data; 1405 cfg = desc->chip_data;
1353 if (!cpu_isset(cpu, cfg->domain)) 1406 if (!cpumask_test_cpu(cpu, cfg->domain))
1354 continue; 1407 continue;
1355 vector = cfg->vector; 1408 vector = cfg->vector;
1356 per_cpu(vector_irq, cpu)[vector] = irq; 1409 per_cpu(vector_irq, cpu)[vector] = irq;
@@ -1362,7 +1415,7 @@ void __setup_vector_irq(int cpu)
1362 continue; 1415 continue;
1363 1416
1364 cfg = irq_cfg(irq); 1417 cfg = irq_cfg(irq);
1365 if (!cpu_isset(cpu, cfg->domain)) 1418 if (!cpumask_test_cpu(cpu, cfg->domain))
1366 per_cpu(vector_irq, cpu)[vector] = -1; 1419 per_cpu(vector_irq, cpu)[vector] = -1;
1367 } 1420 }
1368} 1421}
@@ -1498,18 +1551,17 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
1498{ 1551{
1499 struct irq_cfg *cfg; 1552 struct irq_cfg *cfg;
1500 struct IO_APIC_route_entry entry; 1553 struct IO_APIC_route_entry entry;
1501 cpumask_t mask; 1554 unsigned int dest;
1502 1555
1503 if (!IO_APIC_IRQ(irq)) 1556 if (!IO_APIC_IRQ(irq))
1504 return; 1557 return;
1505 1558
1506 cfg = desc->chip_data; 1559 cfg = desc->chip_data;
1507 1560
1508 mask = TARGET_CPUS; 1561 if (assign_irq_vector(irq, cfg, TARGET_CPUS))
1509 if (assign_irq_vector(irq, cfg, mask))
1510 return; 1562 return;
1511 1563
1512 cpus_and(mask, cfg->domain, mask); 1564 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS);
1513 1565
1514 apic_printk(APIC_VERBOSE,KERN_DEBUG 1566 apic_printk(APIC_VERBOSE,KERN_DEBUG
1515 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> " 1567 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
@@ -1519,8 +1571,7 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
1519 1571
1520 1572
1521 if (setup_ioapic_entry(mp_ioapics[apic].mp_apicid, irq, &entry, 1573 if (setup_ioapic_entry(mp_ioapics[apic].mp_apicid, irq, &entry,
1522 cpu_mask_to_apicid(mask), trigger, polarity, 1574 dest, trigger, polarity, cfg->vector)) {
1523 cfg->vector)) {
1524 printk("Failed to setup ioapic entry for ioapic %d, pin %d\n", 1575 printk("Failed to setup ioapic entry for ioapic %d, pin %d\n",
1525 mp_ioapics[apic].mp_apicid, pin); 1576 mp_ioapics[apic].mp_apicid, pin);
1526 __clear_irq_vector(irq, cfg); 1577 __clear_irq_vector(irq, cfg);
@@ -2240,7 +2291,7 @@ static int ioapic_retrigger_irq(unsigned int irq)
2240 unsigned long flags; 2291 unsigned long flags;
2241 2292
2242 spin_lock_irqsave(&vector_lock, flags); 2293 spin_lock_irqsave(&vector_lock, flags);
2243 send_IPI_mask(cpumask_of_cpu(first_cpu(cfg->domain)), cfg->vector); 2294 send_IPI_mask(cpumask_of(cpumask_first(cfg->domain)), cfg->vector);
2244 spin_unlock_irqrestore(&vector_lock, flags); 2295 spin_unlock_irqrestore(&vector_lock, flags);
2245 2296
2246 return 1; 2297 return 1;
@@ -2289,18 +2340,17 @@ static DECLARE_DELAYED_WORK(ir_migration_work, ir_irq_migration);
2289 * as simple as edge triggered migration and we can do the irq migration 2340 * as simple as edge triggered migration and we can do the irq migration
2290 * with a simple atomic update to IO-APIC RTE. 2341 * with a simple atomic update to IO-APIC RTE.
2291 */ 2342 */
2292static void migrate_ioapic_irq_desc(struct irq_desc *desc, cpumask_t mask) 2343static void
2344migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
2293{ 2345{
2294 struct irq_cfg *cfg; 2346 struct irq_cfg *cfg;
2295 cpumask_t tmp, cleanup_mask;
2296 struct irte irte; 2347 struct irte irte;
2297 int modify_ioapic_rte; 2348 int modify_ioapic_rte;
2298 unsigned int dest; 2349 unsigned int dest;
2299 unsigned long flags; 2350 unsigned long flags;
2300 unsigned int irq; 2351 unsigned int irq;
2301 2352
2302 cpus_and(tmp, mask, cpu_online_map); 2353 if (!cpumask_intersects(mask, cpu_online_mask))
2303 if (cpus_empty(tmp))
2304 return; 2354 return;
2305 2355
2306 irq = desc->irq; 2356 irq = desc->irq;
@@ -2313,8 +2363,7 @@ static void migrate_ioapic_irq_desc(struct irq_desc *desc, cpumask_t mask)
2313 2363
2314 set_extra_move_desc(desc, mask); 2364 set_extra_move_desc(desc, mask);
2315 2365
2316 cpus_and(tmp, cfg->domain, mask); 2366 dest = cpu_mask_to_apicid_and(cfg->domain, mask);
2317 dest = cpu_mask_to_apicid(tmp);
2318 2367
2319 modify_ioapic_rte = desc->status & IRQ_LEVEL; 2368 modify_ioapic_rte = desc->status & IRQ_LEVEL;
2320 if (modify_ioapic_rte) { 2369 if (modify_ioapic_rte) {
@@ -2331,14 +2380,10 @@ static void migrate_ioapic_irq_desc(struct irq_desc *desc, cpumask_t mask)
2331 */ 2380 */
2332 modify_irte(irq, &irte); 2381 modify_irte(irq, &irte);
2333 2382
2334 if (cfg->move_in_progress) { 2383 if (cfg->move_in_progress)
2335 cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map); 2384 send_cleanup_vector(cfg);
2336 cfg->move_cleanup_count = cpus_weight(cleanup_mask);
2337 send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
2338 cfg->move_in_progress = 0;
2339 }
2340 2385
2341 desc->affinity = mask; 2386 cpumask_copy(&desc->affinity, mask);
2342} 2387}
2343 2388
2344static int migrate_irq_remapped_level_desc(struct irq_desc *desc) 2389static int migrate_irq_remapped_level_desc(struct irq_desc *desc)
@@ -2360,11 +2405,11 @@ static int migrate_irq_remapped_level_desc(struct irq_desc *desc)
2360 } 2405 }
2361 2406
2362 /* everthing is clear. we have right of way */ 2407 /* everthing is clear. we have right of way */
2363 migrate_ioapic_irq_desc(desc, desc->pending_mask); 2408 migrate_ioapic_irq_desc(desc, &desc->pending_mask);
2364 2409
2365 ret = 0; 2410 ret = 0;
2366 desc->status &= ~IRQ_MOVE_PENDING; 2411 desc->status &= ~IRQ_MOVE_PENDING;
2367 cpus_clear(desc->pending_mask); 2412 cpumask_clear(&desc->pending_mask);
2368 2413
2369unmask: 2414unmask:
2370 unmask_IO_APIC_irq_desc(desc); 2415 unmask_IO_APIC_irq_desc(desc);
@@ -2389,7 +2434,7 @@ static void ir_irq_migration(struct work_struct *work)
2389 continue; 2434 continue;
2390 } 2435 }
2391 2436
2392 desc->chip->set_affinity(irq, desc->pending_mask); 2437 desc->chip->set_affinity(irq, &desc->pending_mask);
2393 spin_unlock_irqrestore(&desc->lock, flags); 2438 spin_unlock_irqrestore(&desc->lock, flags);
2394 } 2439 }
2395 } 2440 }
@@ -2398,18 +2443,20 @@ static void ir_irq_migration(struct work_struct *work)
2398/* 2443/*
2399 * Migrates the IRQ destination in the process context. 2444 * Migrates the IRQ destination in the process context.
2400 */ 2445 */
2401static void set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc, cpumask_t mask) 2446static void set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc,
2447 const struct cpumask *mask)
2402{ 2448{
2403 if (desc->status & IRQ_LEVEL) { 2449 if (desc->status & IRQ_LEVEL) {
2404 desc->status |= IRQ_MOVE_PENDING; 2450 desc->status |= IRQ_MOVE_PENDING;
2405 desc->pending_mask = mask; 2451 cpumask_copy(&desc->pending_mask, mask);
2406 migrate_irq_remapped_level_desc(desc); 2452 migrate_irq_remapped_level_desc(desc);
2407 return; 2453 return;
2408 } 2454 }
2409 2455
2410 migrate_ioapic_irq_desc(desc, mask); 2456 migrate_ioapic_irq_desc(desc, mask);
2411} 2457}
2412static void set_ir_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) 2458static void set_ir_ioapic_affinity_irq(unsigned int irq,
2459 const struct cpumask *mask)
2413{ 2460{
2414 struct irq_desc *desc = irq_to_desc(irq); 2461 struct irq_desc *desc = irq_to_desc(irq);
2415 2462
@@ -2444,7 +2491,7 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
2444 if (!cfg->move_cleanup_count) 2491 if (!cfg->move_cleanup_count)
2445 goto unlock; 2492 goto unlock;
2446 2493
2447 if ((vector == cfg->vector) && cpu_isset(me, cfg->domain)) 2494 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
2448 goto unlock; 2495 goto unlock;
2449 2496
2450 __get_cpu_var(vector_irq)[vector] = -1; 2497 __get_cpu_var(vector_irq)[vector] = -1;
@@ -2481,20 +2528,14 @@ static void irq_complete_move(struct irq_desc **descp)
2481 2528
2482 vector = ~get_irq_regs()->orig_ax; 2529 vector = ~get_irq_regs()->orig_ax;
2483 me = smp_processor_id(); 2530 me = smp_processor_id();
2484 if ((vector == cfg->vector) && cpu_isset(me, cfg->domain)) {
2485 cpumask_t cleanup_mask;
2486
2487#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC 2531#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
2488 *descp = desc = move_irq_desc(desc, me); 2532 *descp = desc = move_irq_desc(desc, me);
2489 /* get the new one */ 2533 /* get the new one */
2490 cfg = desc->chip_data; 2534 cfg = desc->chip_data;
2491#endif 2535#endif
2492 2536
2493 cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map); 2537 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
2494 cfg->move_cleanup_count = cpus_weight(cleanup_mask); 2538 send_cleanup_vector(cfg);
2495 send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
2496 cfg->move_in_progress = 0;
2497 }
2498} 2539}
2499#else 2540#else
2500static inline void irq_complete_move(struct irq_desc **descp) {} 2541static inline void irq_complete_move(struct irq_desc **descp) {}
@@ -3216,16 +3257,13 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3216 struct irq_cfg *cfg; 3257 struct irq_cfg *cfg;
3217 int err; 3258 int err;
3218 unsigned dest; 3259 unsigned dest;
3219 cpumask_t tmp;
3220 3260
3221 cfg = irq_cfg(irq); 3261 cfg = irq_cfg(irq);
3222 tmp = TARGET_CPUS; 3262 err = assign_irq_vector(irq, cfg, TARGET_CPUS);
3223 err = assign_irq_vector(irq, cfg, tmp);
3224 if (err) 3263 if (err)
3225 return err; 3264 return err;
3226 3265
3227 cpus_and(tmp, cfg->domain, tmp); 3266 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS);
3228 dest = cpu_mask_to_apicid(tmp);
3229 3267
3230#ifdef CONFIG_INTR_REMAP 3268#ifdef CONFIG_INTR_REMAP
3231 if (irq_remapped(irq)) { 3269 if (irq_remapped(irq)) {
@@ -3279,26 +3317,18 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3279} 3317}
3280 3318
3281#ifdef CONFIG_SMP 3319#ifdef CONFIG_SMP
3282static void set_msi_irq_affinity(unsigned int irq, cpumask_t mask) 3320static void set_msi_irq_affinity(unsigned int irq, const struct cpumask *mask)
3283{ 3321{
3284 struct irq_desc *desc = irq_to_desc(irq); 3322 struct irq_desc *desc = irq_to_desc(irq);
3285 struct irq_cfg *cfg; 3323 struct irq_cfg *cfg;
3286 struct msi_msg msg; 3324 struct msi_msg msg;
3287 unsigned int dest; 3325 unsigned int dest;
3288 cpumask_t tmp;
3289 3326
3290 cpus_and(tmp, mask, cpu_online_map); 3327 dest = set_desc_affinity(desc, mask);
3291 if (cpus_empty(tmp)) 3328 if (dest == BAD_APICID)
3292 return; 3329 return;
3293 3330
3294 cfg = desc->chip_data; 3331 cfg = desc->chip_data;
3295 if (assign_irq_vector(irq, cfg, mask))
3296 return;
3297
3298 set_extra_move_desc(desc, mask);
3299
3300 cpus_and(tmp, cfg->domain, mask);
3301 dest = cpu_mask_to_apicid(tmp);
3302 3332
3303 read_msi_msg_desc(desc, &msg); 3333 read_msi_msg_desc(desc, &msg);
3304 3334
@@ -3308,37 +3338,27 @@ static void set_msi_irq_affinity(unsigned int irq, cpumask_t mask)
3308 msg.address_lo |= MSI_ADDR_DEST_ID(dest); 3338 msg.address_lo |= MSI_ADDR_DEST_ID(dest);
3309 3339
3310 write_msi_msg_desc(desc, &msg); 3340 write_msi_msg_desc(desc, &msg);
3311 desc->affinity = mask;
3312} 3341}
3313#ifdef CONFIG_INTR_REMAP 3342#ifdef CONFIG_INTR_REMAP
3314/* 3343/*
3315 * Migrate the MSI irq to another cpumask. This migration is 3344 * Migrate the MSI irq to another cpumask. This migration is
3316 * done in the process context using interrupt-remapping hardware. 3345 * done in the process context using interrupt-remapping hardware.
3317 */ 3346 */
3318static void ir_set_msi_irq_affinity(unsigned int irq, cpumask_t mask) 3347static void
3348ir_set_msi_irq_affinity(unsigned int irq, const struct cpumask *mask)
3319{ 3349{
3320 struct irq_desc *desc = irq_to_desc(irq); 3350 struct irq_desc *desc = irq_to_desc(irq);
3321 struct irq_cfg *cfg; 3351 struct irq_cfg *cfg = desc->chip_data;
3322 unsigned int dest; 3352 unsigned int dest;
3323 cpumask_t tmp, cleanup_mask;
3324 struct irte irte; 3353 struct irte irte;
3325 3354
3326 cpus_and(tmp, mask, cpu_online_map);
3327 if (cpus_empty(tmp))
3328 return;
3329
3330 if (get_irte(irq, &irte)) 3355 if (get_irte(irq, &irte))
3331 return; 3356 return;
3332 3357
3333 cfg = desc->chip_data; 3358 dest = set_desc_affinity(desc, mask);
3334 if (assign_irq_vector(irq, cfg, mask)) 3359 if (dest == BAD_APICID)
3335 return; 3360 return;
3336 3361
3337 set_extra_move_desc(desc, mask);
3338
3339 cpus_and(tmp, cfg->domain, mask);
3340 dest = cpu_mask_to_apicid(tmp);
3341
3342 irte.vector = cfg->vector; 3362 irte.vector = cfg->vector;
3343 irte.dest_id = IRTE_DEST(dest); 3363 irte.dest_id = IRTE_DEST(dest);
3344 3364
@@ -3352,14 +3372,8 @@ static void ir_set_msi_irq_affinity(unsigned int irq, cpumask_t mask)
3352 * at the new destination. So, time to cleanup the previous 3372 * at the new destination. So, time to cleanup the previous
3353 * vector allocation. 3373 * vector allocation.
3354 */ 3374 */
3355 if (cfg->move_in_progress) { 3375 if (cfg->move_in_progress)
3356 cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map); 3376 send_cleanup_vector(cfg);
3357 cfg->move_cleanup_count = cpus_weight(cleanup_mask);
3358 send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
3359 cfg->move_in_progress = 0;
3360 }
3361
3362 desc->affinity = mask;
3363} 3377}
3364 3378
3365#endif 3379#endif
@@ -3550,26 +3564,18 @@ void arch_teardown_msi_irq(unsigned int irq)
3550 3564
3551#ifdef CONFIG_DMAR 3565#ifdef CONFIG_DMAR
3552#ifdef CONFIG_SMP 3566#ifdef CONFIG_SMP
3553static void dmar_msi_set_affinity(unsigned int irq, cpumask_t mask) 3567static void dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask)
3554{ 3568{
3555 struct irq_desc *desc = irq_to_desc(irq); 3569 struct irq_desc *desc = irq_to_desc(irq);
3556 struct irq_cfg *cfg; 3570 struct irq_cfg *cfg;
3557 struct msi_msg msg; 3571 struct msi_msg msg;
3558 unsigned int dest; 3572 unsigned int dest;
3559 cpumask_t tmp;
3560 3573
3561 cpus_and(tmp, mask, cpu_online_map); 3574 dest = set_desc_affinity(desc, mask);
3562 if (cpus_empty(tmp)) 3575 if (dest == BAD_APICID)
3563 return; 3576 return;
3564 3577
3565 cfg = desc->chip_data; 3578 cfg = desc->chip_data;
3566 if (assign_irq_vector(irq, cfg, mask))
3567 return;
3568
3569 set_extra_move_desc(desc, mask);
3570
3571 cpus_and(tmp, cfg->domain, mask);
3572 dest = cpu_mask_to_apicid(tmp);
3573 3579
3574 dmar_msi_read(irq, &msg); 3580 dmar_msi_read(irq, &msg);
3575 3581
@@ -3579,7 +3585,6 @@ static void dmar_msi_set_affinity(unsigned int irq, cpumask_t mask)
3579 msg.address_lo |= MSI_ADDR_DEST_ID(dest); 3585 msg.address_lo |= MSI_ADDR_DEST_ID(dest);
3580 3586
3581 dmar_msi_write(irq, &msg); 3587 dmar_msi_write(irq, &msg);
3582 desc->affinity = mask;
3583} 3588}
3584 3589
3585#endif /* CONFIG_SMP */ 3590#endif /* CONFIG_SMP */
@@ -3613,26 +3618,18 @@ int arch_setup_dmar_msi(unsigned int irq)
3613#ifdef CONFIG_HPET_TIMER 3618#ifdef CONFIG_HPET_TIMER
3614 3619
3615#ifdef CONFIG_SMP 3620#ifdef CONFIG_SMP
3616static void hpet_msi_set_affinity(unsigned int irq, cpumask_t mask) 3621static void hpet_msi_set_affinity(unsigned int irq, const struct cpumask *mask)
3617{ 3622{
3618 struct irq_desc *desc = irq_to_desc(irq); 3623 struct irq_desc *desc = irq_to_desc(irq);
3619 struct irq_cfg *cfg; 3624 struct irq_cfg *cfg;
3620 struct msi_msg msg; 3625 struct msi_msg msg;
3621 unsigned int dest; 3626 unsigned int dest;
3622 cpumask_t tmp;
3623 3627
3624 cpus_and(tmp, mask, cpu_online_map); 3628 dest = set_desc_affinity(desc, mask);
3625 if (cpus_empty(tmp)) 3629 if (dest == BAD_APICID)
3626 return; 3630 return;
3627 3631
3628 cfg = desc->chip_data; 3632 cfg = desc->chip_data;
3629 if (assign_irq_vector(irq, cfg, mask))
3630 return;
3631
3632 set_extra_move_desc(desc, mask);
3633
3634 cpus_and(tmp, cfg->domain, mask);
3635 dest = cpu_mask_to_apicid(tmp);
3636 3633
3637 hpet_msi_read(irq, &msg); 3634 hpet_msi_read(irq, &msg);
3638 3635
@@ -3642,7 +3639,6 @@ static void hpet_msi_set_affinity(unsigned int irq, cpumask_t mask)
3642 msg.address_lo |= MSI_ADDR_DEST_ID(dest); 3639 msg.address_lo |= MSI_ADDR_DEST_ID(dest);
3643 3640
3644 hpet_msi_write(irq, &msg); 3641 hpet_msi_write(irq, &msg);
3645 desc->affinity = mask;
3646} 3642}
3647 3643
3648#endif /* CONFIG_SMP */ 3644#endif /* CONFIG_SMP */
@@ -3697,28 +3693,19 @@ static void target_ht_irq(unsigned int irq, unsigned int dest, u8 vector)
3697 write_ht_irq_msg(irq, &msg); 3693 write_ht_irq_msg(irq, &msg);
3698} 3694}
3699 3695
3700static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask) 3696static void set_ht_irq_affinity(unsigned int irq, const struct cpumask *mask)
3701{ 3697{
3702 struct irq_desc *desc = irq_to_desc(irq); 3698 struct irq_desc *desc = irq_to_desc(irq);
3703 struct irq_cfg *cfg; 3699 struct irq_cfg *cfg;
3704 unsigned int dest; 3700 unsigned int dest;
3705 cpumask_t tmp;
3706 3701
3707 cpus_and(tmp, mask, cpu_online_map); 3702 dest = set_desc_affinity(desc, mask);
3708 if (cpus_empty(tmp)) 3703 if (dest == BAD_APICID)
3709 return; 3704 return;
3710 3705
3711 cfg = desc->chip_data; 3706 cfg = desc->chip_data;
3712 if (assign_irq_vector(irq, cfg, mask))
3713 return;
3714
3715 set_extra_move_desc(desc, mask);
3716
3717 cpus_and(tmp, cfg->domain, mask);
3718 dest = cpu_mask_to_apicid(tmp);
3719 3707
3720 target_ht_irq(irq, dest, cfg->vector); 3708 target_ht_irq(irq, dest, cfg->vector);
3721 desc->affinity = mask;
3722} 3709}
3723 3710
3724#endif 3711#endif
@@ -3738,17 +3725,14 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3738{ 3725{
3739 struct irq_cfg *cfg; 3726 struct irq_cfg *cfg;
3740 int err; 3727 int err;
3741 cpumask_t tmp;
3742 3728
3743 cfg = irq_cfg(irq); 3729 cfg = irq_cfg(irq);
3744 tmp = TARGET_CPUS; 3730 err = assign_irq_vector(irq, cfg, TARGET_CPUS);
3745 err = assign_irq_vector(irq, cfg, tmp);
3746 if (!err) { 3731 if (!err) {
3747 struct ht_irq_msg msg; 3732 struct ht_irq_msg msg;
3748 unsigned dest; 3733 unsigned dest;
3749 3734
3750 cpus_and(tmp, cfg->domain, tmp); 3735 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS);
3751 dest = cpu_mask_to_apicid(tmp);
3752 3736
3753 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest); 3737 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
3754 3738
@@ -3784,7 +3768,7 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3784int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade, 3768int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
3785 unsigned long mmr_offset) 3769 unsigned long mmr_offset)
3786{ 3770{
3787 const cpumask_t *eligible_cpu = get_cpu_mask(cpu); 3771 const struct cpumask *eligible_cpu = cpumask_of(cpu);
3788 struct irq_cfg *cfg; 3772 struct irq_cfg *cfg;
3789 int mmr_pnode; 3773 int mmr_pnode;
3790 unsigned long mmr_value; 3774 unsigned long mmr_value;
@@ -3794,7 +3778,7 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
3794 3778
3795 cfg = irq_cfg(irq); 3779 cfg = irq_cfg(irq);
3796 3780
3797 err = assign_irq_vector(irq, cfg, *eligible_cpu); 3781 err = assign_irq_vector(irq, cfg, eligible_cpu);
3798 if (err != 0) 3782 if (err != 0)
3799 return err; 3783 return err;
3800 3784
@@ -3813,7 +3797,7 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
3813 entry->polarity = 0; 3797 entry->polarity = 0;
3814 entry->trigger = 0; 3798 entry->trigger = 0;
3815 entry->mask = 0; 3799 entry->mask = 0;
3816 entry->dest = cpu_mask_to_apicid(*eligible_cpu); 3800 entry->dest = cpu_mask_to_apicid(eligible_cpu);
3817 3801
3818 mmr_pnode = uv_blade_to_pnode(mmr_blade); 3802 mmr_pnode = uv_blade_to_pnode(mmr_blade);
3819 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); 3803 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
@@ -4024,7 +4008,7 @@ void __init setup_ioapic_dest(void)
4024 int pin, ioapic, irq, irq_entry; 4008 int pin, ioapic, irq, irq_entry;
4025 struct irq_desc *desc; 4009 struct irq_desc *desc;
4026 struct irq_cfg *cfg; 4010 struct irq_cfg *cfg;
4027 cpumask_t mask; 4011 const struct cpumask *mask;
4028 4012
4029 if (skip_ioapic_setup == 1) 4013 if (skip_ioapic_setup == 1)
4030 return; 4014 return;
@@ -4055,7 +4039,7 @@ void __init setup_ioapic_dest(void)
4055 */ 4039 */
4056 if (desc->status & 4040 if (desc->status &
4057 (IRQ_NO_BALANCING | IRQ_AFFINITY_SET)) 4041 (IRQ_NO_BALANCING | IRQ_AFFINITY_SET))
4058 mask = desc->affinity; 4042 mask = &desc->affinity;
4059 else 4043 else
4060 mask = TARGET_CPUS; 4044 mask = TARGET_CPUS;
4061 4045
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c
index 191914302744..b12208f4dfee 100644
--- a/arch/x86/kernel/ioport.c
+++ b/arch/x86/kernel/ioport.c
@@ -35,8 +35,8 @@ static void set_bitmap(unsigned long *bitmap, unsigned int base,
35 */ 35 */
36asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on) 36asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int turn_on)
37{ 37{
38 struct thread_struct * t = &current->thread; 38 struct thread_struct *t = &current->thread;
39 struct tss_struct * tss; 39 struct tss_struct *tss;
40 unsigned int i, max_long, bytes, bytes_updated; 40 unsigned int i, max_long, bytes, bytes_updated;
41 41
42 if ((from + num <= from) || (from + num > IO_BITMAP_BITS)) 42 if ((from + num <= from) || (from + num > IO_BITMAP_BITS))
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c
index f1c688e46f35..285bbf8831fa 100644
--- a/arch/x86/kernel/ipi.c
+++ b/arch/x86/kernel/ipi.c
@@ -116,18 +116,18 @@ static inline void __send_IPI_dest_field(unsigned long mask, int vector)
116/* 116/*
117 * This is only used on smaller machines. 117 * This is only used on smaller machines.
118 */ 118 */
119void send_IPI_mask_bitmask(cpumask_t cpumask, int vector) 119void send_IPI_mask_bitmask(const struct cpumask *cpumask, int vector)
120{ 120{
121 unsigned long mask = cpus_addr(cpumask)[0]; 121 unsigned long mask = cpumask_bits(cpumask)[0];
122 unsigned long flags; 122 unsigned long flags;
123 123
124 local_irq_save(flags); 124 local_irq_save(flags);
125 WARN_ON(mask & ~cpus_addr(cpu_online_map)[0]); 125 WARN_ON(mask & ~cpumask_bits(cpu_online_mask)[0]);
126 __send_IPI_dest_field(mask, vector); 126 __send_IPI_dest_field(mask, vector);
127 local_irq_restore(flags); 127 local_irq_restore(flags);
128} 128}
129 129
130void send_IPI_mask_sequence(cpumask_t mask, int vector) 130void send_IPI_mask_sequence(const struct cpumask *mask, int vector)
131{ 131{
132 unsigned long flags; 132 unsigned long flags;
133 unsigned int query_cpu; 133 unsigned int query_cpu;
@@ -139,12 +139,24 @@ void send_IPI_mask_sequence(cpumask_t mask, int vector)
139 */ 139 */
140 140
141 local_irq_save(flags); 141 local_irq_save(flags);
142 for_each_possible_cpu(query_cpu) { 142 for_each_cpu(query_cpu, mask)
143 if (cpu_isset(query_cpu, mask)) { 143 __send_IPI_dest_field(cpu_to_logical_apicid(query_cpu), vector);
144 local_irq_restore(flags);
145}
146
147void send_IPI_mask_allbutself(const struct cpumask *mask, int vector)
148{
149 unsigned long flags;
150 unsigned int query_cpu;
151 unsigned int this_cpu = smp_processor_id();
152
153 /* See Hack comment above */
154
155 local_irq_save(flags);
156 for_each_cpu(query_cpu, mask)
157 if (query_cpu != this_cpu)
144 __send_IPI_dest_field(cpu_to_logical_apicid(query_cpu), 158 __send_IPI_dest_field(cpu_to_logical_apicid(query_cpu),
145 vector); 159 vector);
146 }
147 }
148 local_irq_restore(flags); 160 local_irq_restore(flags);
149} 161}
150 162
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index 3f1d9d18df67..3973e2df7f87 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -5,10 +5,11 @@
5#include <linux/interrupt.h> 5#include <linux/interrupt.h>
6#include <linux/kernel_stat.h> 6#include <linux/kernel_stat.h>
7#include <linux/seq_file.h> 7#include <linux/seq_file.h>
8#include <linux/smp.h>
8 9
9#include <asm/apic.h> 10#include <asm/apic.h>
10#include <asm/io_apic.h> 11#include <asm/io_apic.h>
11#include <asm/smp.h> 12#include <asm/irq.h>
12 13
13atomic_t irq_err_count; 14atomic_t irq_err_count;
14 15
@@ -190,3 +191,5 @@ u64 arch_irq_stat(void)
190#endif 191#endif
191 return sum; 192 return sum;
192} 193}
194
195EXPORT_SYMBOL_GPL(vector_used_by_percpu_irq);
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c
index 119fc9c8ff7f..74b9ff7341e9 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -15,9 +15,9 @@
15#include <linux/notifier.h> 15#include <linux/notifier.h>
16#include <linux/cpu.h> 16#include <linux/cpu.h>
17#include <linux/delay.h> 17#include <linux/delay.h>
18#include <linux/uaccess.h>
18 19
19#include <asm/apic.h> 20#include <asm/apic.h>
20#include <asm/uaccess.h>
21 21
22DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); 22DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
23EXPORT_PER_CPU_SYMBOL(irq_stat); 23EXPORT_PER_CPU_SYMBOL(irq_stat);
@@ -93,7 +93,7 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq)
93 return 0; 93 return 0;
94 94
95 /* build the stack frame on the IRQ stack */ 95 /* build the stack frame on the IRQ stack */
96 isp = (u32 *) ((char*)irqctx + sizeof(*irqctx)); 96 isp = (u32 *) ((char *)irqctx + sizeof(*irqctx));
97 irqctx->tinfo.task = curctx->tinfo.task; 97 irqctx->tinfo.task = curctx->tinfo.task;
98 irqctx->tinfo.previous_esp = current_stack_pointer; 98 irqctx->tinfo.previous_esp = current_stack_pointer;
99 99
@@ -137,7 +137,7 @@ void __cpuinit irq_ctx_init(int cpu)
137 137
138 hardirq_ctx[cpu] = irqctx; 138 hardirq_ctx[cpu] = irqctx;
139 139
140 irqctx = (union irq_ctx*) &softirq_stack[cpu*THREAD_SIZE]; 140 irqctx = (union irq_ctx *) &softirq_stack[cpu*THREAD_SIZE];
141 irqctx->tinfo.task = NULL; 141 irqctx->tinfo.task = NULL;
142 irqctx->tinfo.exec_domain = NULL; 142 irqctx->tinfo.exec_domain = NULL;
143 irqctx->tinfo.cpu = cpu; 143 irqctx->tinfo.cpu = cpu;
@@ -147,7 +147,7 @@ void __cpuinit irq_ctx_init(int cpu)
147 softirq_ctx[cpu] = irqctx; 147 softirq_ctx[cpu] = irqctx;
148 148
149 printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n", 149 printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n",
150 cpu,hardirq_ctx[cpu],softirq_ctx[cpu]); 150 cpu, hardirq_ctx[cpu], softirq_ctx[cpu]);
151} 151}
152 152
153void irq_ctx_exit(int cpu) 153void irq_ctx_exit(int cpu)
@@ -174,7 +174,7 @@ asmlinkage void do_softirq(void)
174 irqctx->tinfo.previous_esp = current_stack_pointer; 174 irqctx->tinfo.previous_esp = current_stack_pointer;
175 175
176 /* build the stack frame on the softirq stack */ 176 /* build the stack frame on the softirq stack */
177 isp = (u32*) ((char*)irqctx + sizeof(*irqctx)); 177 isp = (u32 *) ((char *)irqctx + sizeof(*irqctx));
178 178
179 call_on_stack(__do_softirq, isp); 179 call_on_stack(__do_softirq, isp);
180 /* 180 /*
@@ -233,27 +233,28 @@ unsigned int do_IRQ(struct pt_regs *regs)
233#ifdef CONFIG_HOTPLUG_CPU 233#ifdef CONFIG_HOTPLUG_CPU
234#include <mach_apic.h> 234#include <mach_apic.h>
235 235
236void fixup_irqs(cpumask_t map) 236/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
237void fixup_irqs(void)
237{ 238{
238 unsigned int irq; 239 unsigned int irq;
239 static int warned; 240 static int warned;
240 struct irq_desc *desc; 241 struct irq_desc *desc;
241 242
242 for_each_irq_desc(irq, desc) { 243 for_each_irq_desc(irq, desc) {
243 cpumask_t mask; 244 const struct cpumask *affinity;
244 245
245 if (!desc) 246 if (!desc)
246 continue; 247 continue;
247 if (irq == 2) 248 if (irq == 2)
248 continue; 249 continue;
249 250
250 cpus_and(mask, desc->affinity, map); 251 affinity = &desc->affinity;
251 if (any_online_cpu(mask) == NR_CPUS) { 252 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
252 printk("Breaking affinity for irq %i\n", irq); 253 printk("Breaking affinity for irq %i\n", irq);
253 mask = map; 254 affinity = cpu_all_mask;
254 } 255 }
255 if (desc->chip->set_affinity) 256 if (desc->chip->set_affinity)
256 desc->chip->set_affinity(irq, mask); 257 desc->chip->set_affinity(irq, affinity);
257 else if (desc->action && !(warned++)) 258 else if (desc->action && !(warned++))
258 printk("Cannot set affinity for irq %i\n", irq); 259 printk("Cannot set affinity for irq %i\n", irq);
259 } 260 }
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c
index a174a217eb1a..63c88e6ec025 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -14,10 +14,10 @@
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/ftrace.h> 16#include <linux/ftrace.h>
17#include <asm/uaccess.h> 17#include <linux/uaccess.h>
18#include <linux/smp.h>
18#include <asm/io_apic.h> 19#include <asm/io_apic.h>
19#include <asm/idle.h> 20#include <asm/idle.h>
20#include <asm/smp.h>
21 21
22/* 22/*
23 * Probabilistic stack overflow check: 23 * Probabilistic stack overflow check:
@@ -80,16 +80,17 @@ asmlinkage unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
80} 80}
81 81
82#ifdef CONFIG_HOTPLUG_CPU 82#ifdef CONFIG_HOTPLUG_CPU
83void fixup_irqs(cpumask_t map) 83/* A cpu has been removed from cpu_online_mask. Reset irq affinities. */
84void fixup_irqs(void)
84{ 85{
85 unsigned int irq; 86 unsigned int irq;
86 static int warned; 87 static int warned;
87 struct irq_desc *desc; 88 struct irq_desc *desc;
88 89
89 for_each_irq_desc(irq, desc) { 90 for_each_irq_desc(irq, desc) {
90 cpumask_t mask;
91 int break_affinity = 0; 91 int break_affinity = 0;
92 int set_affinity = 1; 92 int set_affinity = 1;
93 const struct cpumask *affinity;
93 94
94 if (!desc) 95 if (!desc)
95 continue; 96 continue;
@@ -99,23 +100,23 @@ void fixup_irqs(cpumask_t map)
99 /* interrupt's are disabled at this point */ 100 /* interrupt's are disabled at this point */
100 spin_lock(&desc->lock); 101 spin_lock(&desc->lock);
101 102
103 affinity = &desc->affinity;
102 if (!irq_has_action(irq) || 104 if (!irq_has_action(irq) ||
103 cpus_equal(desc->affinity, map)) { 105 cpumask_equal(affinity, cpu_online_mask)) {
104 spin_unlock(&desc->lock); 106 spin_unlock(&desc->lock);
105 continue; 107 continue;
106 } 108 }
107 109
108 cpus_and(mask, desc->affinity, map); 110 if (cpumask_any_and(affinity, cpu_online_mask) >= nr_cpu_ids) {
109 if (cpus_empty(mask)) {
110 break_affinity = 1; 111 break_affinity = 1;
111 mask = map; 112 affinity = cpu_all_mask;
112 } 113 }
113 114
114 if (desc->chip->mask) 115 if (desc->chip->mask)
115 desc->chip->mask(irq); 116 desc->chip->mask(irq);
116 117
117 if (desc->chip->set_affinity) 118 if (desc->chip->set_affinity)
118 desc->chip->set_affinity(irq, mask); 119 desc->chip->set_affinity(irq, affinity);
119 else if (!(warned++)) 120 else if (!(warned++))
120 set_affinity = 0; 121 set_affinity = 0;
121 122
@@ -141,18 +142,18 @@ extern void call_softirq(void);
141 142
142asmlinkage void do_softirq(void) 143asmlinkage void do_softirq(void)
143{ 144{
144 __u32 pending; 145 __u32 pending;
145 unsigned long flags; 146 unsigned long flags;
146 147
147 if (in_interrupt()) 148 if (in_interrupt())
148 return; 149 return;
149 150
150 local_irq_save(flags); 151 local_irq_save(flags);
151 pending = local_softirq_pending(); 152 pending = local_softirq_pending();
152 /* Switch to interrupt stack */ 153 /* Switch to interrupt stack */
153 if (pending) { 154 if (pending) {
154 call_softirq(); 155 call_softirq();
155 WARN_ON_ONCE(softirq_count()); 156 WARN_ON_ONCE(softirq_count());
156 } 157 }
157 local_irq_restore(flags); 158 local_irq_restore(flags);
158} 159}
diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c
index 203384ed2b5d..1507ad4e674d 100644
--- a/arch/x86/kernel/irqinit_32.c
+++ b/arch/x86/kernel/irqinit_32.c
@@ -9,18 +9,18 @@
9#include <linux/kernel_stat.h> 9#include <linux/kernel_stat.h>
10#include <linux/sysdev.h> 10#include <linux/sysdev.h>
11#include <linux/bitops.h> 11#include <linux/bitops.h>
12#include <linux/io.h>
13#include <linux/delay.h>
12 14
13#include <asm/atomic.h> 15#include <asm/atomic.h>
14#include <asm/system.h> 16#include <asm/system.h>
15#include <asm/io.h>
16#include <asm/timer.h> 17#include <asm/timer.h>
17#include <asm/pgtable.h> 18#include <asm/pgtable.h>
18#include <asm/delay.h>
19#include <asm/desc.h> 19#include <asm/desc.h>
20#include <asm/apic.h> 20#include <asm/apic.h>
21#include <asm/arch_hooks.h> 21#include <asm/arch_hooks.h>
22#include <asm/i8259.h> 22#include <asm/i8259.h>
23 23#include <asm/traps.h>
24 24
25 25
26/* 26/*
@@ -34,12 +34,10 @@
34 * leads to races. IBM designers who came up with it should 34 * leads to races. IBM designers who came up with it should
35 * be shot. 35 * be shot.
36 */ 36 */
37
38 37
39static irqreturn_t math_error_irq(int cpl, void *dev_id) 38static irqreturn_t math_error_irq(int cpl, void *dev_id)
40{ 39{
41 extern void math_error(void __user *); 40 outb(0, 0xF0);
42 outb(0,0xF0);
43 if (ignore_fpu_irq || !boot_cpu_data.hard_math) 41 if (ignore_fpu_irq || !boot_cpu_data.hard_math)
44 return IRQ_NONE; 42 return IRQ_NONE;
45 math_error((void __user *)get_irq_regs()->ip); 43 math_error((void __user *)get_irq_regs()->ip);
@@ -56,7 +54,7 @@ static struct irqaction fpu_irq = {
56 .name = "fpu", 54 .name = "fpu",
57}; 55};
58 56
59void __init init_ISA_irqs (void) 57void __init init_ISA_irqs(void)
60{ 58{
61 int i; 59 int i;
62 60
@@ -110,6 +108,18 @@ DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
110 [IRQ15_VECTOR + 1 ... NR_VECTORS - 1] = -1 108 [IRQ15_VECTOR + 1 ... NR_VECTORS - 1] = -1
111}; 109};
112 110
111int vector_used_by_percpu_irq(unsigned int vector)
112{
113 int cpu;
114
115 for_each_online_cpu(cpu) {
116 if (per_cpu(vector_irq, cpu)[vector] != -1)
117 return 1;
118 }
119
120 return 0;
121}
122
113/* Overridden in paravirt.c */ 123/* Overridden in paravirt.c */
114void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ"))); 124void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ")));
115 125
@@ -146,10 +156,12 @@ void __init native_init_IRQ(void)
146 alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); 156 alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);
147 157
148 /* IPI for single call function */ 158 /* IPI for single call function */
149 set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, call_function_single_interrupt); 159 alloc_intr_gate(CALL_FUNCTION_SINGLE_VECTOR,
160 call_function_single_interrupt);
150 161
151 /* Low priority IPI to cleanup after moving an irq */ 162 /* Low priority IPI to cleanup after moving an irq */
152 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt); 163 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
164 set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors);
153#endif 165#endif
154 166
155#ifdef CONFIG_X86_LOCAL_APIC 167#ifdef CONFIG_X86_LOCAL_APIC
diff --git a/arch/x86/kernel/irqinit_64.c b/arch/x86/kernel/irqinit_64.c
index 6190e6ef546c..da481a1e3f30 100644
--- a/arch/x86/kernel/irqinit_64.c
+++ b/arch/x86/kernel/irqinit_64.c
@@ -11,14 +11,14 @@
11#include <linux/kernel_stat.h> 11#include <linux/kernel_stat.h>
12#include <linux/sysdev.h> 12#include <linux/sysdev.h>
13#include <linux/bitops.h> 13#include <linux/bitops.h>
14#include <linux/acpi.h>
15#include <linux/io.h>
16#include <linux/delay.h>
14 17
15#include <asm/acpi.h>
16#include <asm/atomic.h> 18#include <asm/atomic.h>
17#include <asm/system.h> 19#include <asm/system.h>
18#include <asm/io.h>
19#include <asm/hw_irq.h> 20#include <asm/hw_irq.h>
20#include <asm/pgtable.h> 21#include <asm/pgtable.h>
21#include <asm/delay.h>
22#include <asm/desc.h> 22#include <asm/desc.h>
23#include <asm/apic.h> 23#include <asm/apic.h>
24#include <asm/i8259.h> 24#include <asm/i8259.h>
@@ -69,7 +69,19 @@ DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
69 [IRQ15_VECTOR + 1 ... NR_VECTORS - 1] = -1 69 [IRQ15_VECTOR + 1 ... NR_VECTORS - 1] = -1
70}; 70};
71 71
72void __init init_ISA_irqs(void) 72int vector_used_by_percpu_irq(unsigned int vector)
73{
74 int cpu;
75
76 for_each_online_cpu(cpu) {
77 if (per_cpu(vector_irq, cpu)[vector] != -1)
78 return 1;
79 }
80
81 return 0;
82}
83
84static void __init init_ISA_irqs(void)
73{ 85{
74 int i; 86 int i;
75 87
@@ -121,6 +133,7 @@ static void __init smp_intr_init(void)
121 133
122 /* Low priority IPI to cleanup after moving an irq */ 134 /* Low priority IPI to cleanup after moving an irq */
123 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt); 135 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
136 set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors);
124#endif 137#endif
125} 138}
126 139
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index 6c27679ec6aa..884d985b8b82 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -376,9 +376,10 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
376 376
377void __kprobes arch_remove_kprobe(struct kprobe *p) 377void __kprobes arch_remove_kprobe(struct kprobe *p)
378{ 378{
379 mutex_lock(&kprobe_mutex); 379 if (p->ainsn.insn) {
380 free_insn_slot(p->ainsn.insn, (p->ainsn.boostable == 1)); 380 free_insn_slot(p->ainsn.insn, (p->ainsn.boostable == 1));
381 mutex_unlock(&kprobe_mutex); 381 p->ainsn.insn = NULL;
382 }
382} 383}
383 384
384static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb) 385static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
@@ -694,7 +695,7 @@ static __used __kprobes void *trampoline_handler(struct pt_regs *regs)
694 /* 695 /*
695 * It is possible to have multiple instances associated with a given 696 * It is possible to have multiple instances associated with a given
696 * task either because multiple functions in the call path have 697 * task either because multiple functions in the call path have
697 * return probes installed on them, and/or more then one 698 * return probes installed on them, and/or more than one
698 * return probe was registered for a target function. 699 * return probe was registered for a target function.
699 * 700 *
700 * We can handle this because: 701 * We can handle this because:
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index e169ae9b6a62..652fce6d2cce 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -89,17 +89,17 @@ static cycle_t kvm_clock_read(void)
89 */ 89 */
90static unsigned long kvm_get_tsc_khz(void) 90static unsigned long kvm_get_tsc_khz(void)
91{ 91{
92 return preset_lpj; 92 struct pvclock_vcpu_time_info *src;
93 src = &per_cpu(hv_clock, 0);
94 return pvclock_tsc_khz(src);
93} 95}
94 96
95static void kvm_get_preset_lpj(void) 97static void kvm_get_preset_lpj(void)
96{ 98{
97 struct pvclock_vcpu_time_info *src;
98 unsigned long khz; 99 unsigned long khz;
99 u64 lpj; 100 u64 lpj;
100 101
101 src = &per_cpu(hv_clock, 0); 102 khz = kvm_get_tsc_khz();
102 khz = pvclock_tsc_khz(src);
103 103
104 lpj = ((u64)khz * 1000); 104 lpj = ((u64)khz * 1000);
105 do_div(lpj, HZ); 105 do_div(lpj, HZ);
@@ -194,5 +194,7 @@ void __init kvmclock_init(void)
194#endif 194#endif
195 kvm_get_preset_lpj(); 195 kvm_get_preset_lpj();
196 clocksource_register(&kvm_clock); 196 clocksource_register(&kvm_clock);
197 pv_info.paravirt_enabled = 1;
198 pv_info.name = "KVM";
197 } 199 }
198} 200}
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c
index eee32b43fee3..71f1d99a635d 100644
--- a/arch/x86/kernel/ldt.c
+++ b/arch/x86/kernel/ldt.c
@@ -12,8 +12,8 @@
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/smp.h> 13#include <linux/smp.h>
14#include <linux/vmalloc.h> 14#include <linux/vmalloc.h>
15#include <linux/uaccess.h>
15 16
16#include <asm/uaccess.h>
17#include <asm/system.h> 17#include <asm/system.h>
18#include <asm/ldt.h> 18#include <asm/ldt.h>
19#include <asm/desc.h> 19#include <asm/desc.h>
@@ -93,7 +93,7 @@ static inline int copy_ldt(mm_context_t *new, mm_context_t *old)
93 if (err < 0) 93 if (err < 0)
94 return err; 94 return err;
95 95
96 for(i = 0; i < old->size; i++) 96 for (i = 0; i < old->size; i++)
97 write_ldt_entry(new->ldt, i, old->ldt + i * LDT_ENTRY_SIZE); 97 write_ldt_entry(new->ldt, i, old->ldt + i * LDT_ENTRY_SIZE);
98 return 0; 98 return 0;
99} 99}
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
index 3b599518c322..8815f3c7fec7 100644
--- a/arch/x86/kernel/mfgpt_32.c
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -252,7 +252,7 @@ EXPORT_SYMBOL_GPL(geode_mfgpt_alloc_timer);
252/* 252/*
253 * The MFPGT timers on the CS5536 provide us with suitable timers to use 253 * The MFPGT timers on the CS5536 provide us with suitable timers to use
254 * as clock event sources - not as good as a HPET or APIC, but certainly 254 * as clock event sources - not as good as a HPET or APIC, but certainly
255 * better then the PIT. This isn't a general purpose MFGPT driver, but 255 * better than the PIT. This isn't a general purpose MFGPT driver, but
256 * a simplified one designed specifically to act as a clock event source. 256 * a simplified one designed specifically to act as a clock event source.
257 * For full details about the MFGPT, please consult the CS5536 data sheet. 257 * For full details about the MFGPT, please consult the CS5536 data sheet.
258 */ 258 */
@@ -287,7 +287,7 @@ static struct clock_event_device mfgpt_clockevent = {
287 .set_mode = mfgpt_set_mode, 287 .set_mode = mfgpt_set_mode,
288 .set_next_event = mfgpt_next_event, 288 .set_next_event = mfgpt_next_event,
289 .rating = 250, 289 .rating = 250,
290 .cpumask = CPU_MASK_ALL, 290 .cpumask = cpu_all_mask,
291 .shift = 32 291 .shift = 32
292}; 292};
293 293
diff --git a/arch/x86/kernel/mmconf-fam10h_64.c b/arch/x86/kernel/mmconf-fam10h_64.c
index efc2f361fe85..666e43df51f9 100644
--- a/arch/x86/kernel/mmconf-fam10h_64.c
+++ b/arch/x86/kernel/mmconf-fam10h_64.c
@@ -13,8 +13,7 @@
13#include <asm/msr.h> 13#include <asm/msr.h>
14#include <asm/acpi.h> 14#include <asm/acpi.h>
15#include <asm/mmconfig.h> 15#include <asm/mmconfig.h>
16 16#include <asm/pci_x86.h>
17#include "../pci/pci.h"
18 17
19struct pci_hostbridge_probe { 18struct pci_hostbridge_probe {
20 u32 bus; 19 u32 bus;
diff --git a/arch/x86/kernel/mpparse.c b/arch/x86/kernel/mpparse.c
index 45e3b69808ba..a649a4ccad43 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -2,7 +2,7 @@
2 * Intel Multiprocessor Specification 1.1 and 1.4 2 * Intel Multiprocessor Specification 1.1 and 1.4
3 * compliant MP-table parsing routines. 3 * compliant MP-table parsing routines.
4 * 4 *
5 * (c) 1995 Alan Cox, Building #3 <alan@redhat.com> 5 * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
6 * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com> 6 * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
7 * (c) 2008 Alexey Starikovskiy <astarikovskiy@suse.de> 7 * (c) 2008 Alexey Starikovskiy <astarikovskiy@suse.de>
8 */ 8 */
@@ -16,18 +16,18 @@
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/acpi.h> 17#include <linux/acpi.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/smp.h>
19 20
20#include <asm/smp.h>
21#include <asm/mtrr.h> 21#include <asm/mtrr.h>
22#include <asm/mpspec.h> 22#include <asm/mpspec.h>
23#include <asm/pgalloc.h> 23#include <asm/pgalloc.h>
24#include <asm/io_apic.h> 24#include <asm/io_apic.h>
25#include <asm/proto.h> 25#include <asm/proto.h>
26#include <asm/acpi.h>
27#include <asm/bios_ebda.h> 26#include <asm/bios_ebda.h>
28#include <asm/e820.h> 27#include <asm/e820.h>
29#include <asm/trampoline.h> 28#include <asm/trampoline.h>
30#include <asm/setup.h> 29#include <asm/setup.h>
30#include <asm/smp.h>
31 31
32#include <mach_apic.h> 32#include <mach_apic.h>
33#ifdef CONFIG_X86_32 33#ifdef CONFIG_X86_32
@@ -49,12 +49,12 @@ static int __init mpf_checksum(unsigned char *mp, int len)
49 return sum & 0xFF; 49 return sum & 0xFF;
50} 50}
51 51
52static void __init MP_processor_info(struct mpc_config_processor *m) 52static void __init MP_processor_info(struct mpc_cpu *m)
53{ 53{
54 int apicid; 54 int apicid;
55 char *bootup_cpu = ""; 55 char *bootup_cpu = "";
56 56
57 if (!(m->mpc_cpuflag & CPU_ENABLED)) { 57 if (!(m->cpuflag & CPU_ENABLED)) {
58 disabled_cpus++; 58 disabled_cpus++;
59 return; 59 return;
60 } 60 }
@@ -62,54 +62,54 @@ static void __init MP_processor_info(struct mpc_config_processor *m)
62 if (x86_quirks->mpc_apic_id) 62 if (x86_quirks->mpc_apic_id)
63 apicid = x86_quirks->mpc_apic_id(m); 63 apicid = x86_quirks->mpc_apic_id(m);
64 else 64 else
65 apicid = m->mpc_apicid; 65 apicid = m->apicid;
66 66
67 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) { 67 if (m->cpuflag & CPU_BOOTPROCESSOR) {
68 bootup_cpu = " (Bootup-CPU)"; 68 bootup_cpu = " (Bootup-CPU)";
69 boot_cpu_physical_apicid = m->mpc_apicid; 69 boot_cpu_physical_apicid = m->apicid;
70 } 70 }
71 71
72 printk(KERN_INFO "Processor #%d%s\n", m->mpc_apicid, bootup_cpu); 72 printk(KERN_INFO "Processor #%d%s\n", m->apicid, bootup_cpu);
73 generic_processor_info(apicid, m->mpc_apicver); 73 generic_processor_info(apicid, m->apicver);
74} 74}
75 75
76#ifdef CONFIG_X86_IO_APIC 76#ifdef CONFIG_X86_IO_APIC
77static void __init MP_bus_info(struct mpc_config_bus *m) 77static void __init MP_bus_info(struct mpc_bus *m)
78{ 78{
79 char str[7]; 79 char str[7];
80 memcpy(str, m->mpc_bustype, 6); 80 memcpy(str, m->bustype, 6);
81 str[6] = 0; 81 str[6] = 0;
82 82
83 if (x86_quirks->mpc_oem_bus_info) 83 if (x86_quirks->mpc_oem_bus_info)
84 x86_quirks->mpc_oem_bus_info(m, str); 84 x86_quirks->mpc_oem_bus_info(m, str);
85 else 85 else
86 apic_printk(APIC_VERBOSE, "Bus #%d is %s\n", m->mpc_busid, str); 86 apic_printk(APIC_VERBOSE, "Bus #%d is %s\n", m->busid, str);
87 87
88#if MAX_MP_BUSSES < 256 88#if MAX_MP_BUSSES < 256
89 if (m->mpc_busid >= MAX_MP_BUSSES) { 89 if (m->busid >= MAX_MP_BUSSES) {
90 printk(KERN_WARNING "MP table busid value (%d) for bustype %s " 90 printk(KERN_WARNING "MP table busid value (%d) for bustype %s "
91 " is too large, max. supported is %d\n", 91 " is too large, max. supported is %d\n",
92 m->mpc_busid, str, MAX_MP_BUSSES - 1); 92 m->busid, str, MAX_MP_BUSSES - 1);
93 return; 93 return;
94 } 94 }
95#endif 95#endif
96 96
97 if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) { 97 if (strncmp(str, BUSTYPE_ISA, sizeof(BUSTYPE_ISA) - 1) == 0) {
98 set_bit(m->mpc_busid, mp_bus_not_pci); 98 set_bit(m->busid, mp_bus_not_pci);
99#if defined(CONFIG_EISA) || defined (CONFIG_MCA) 99#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
100 mp_bus_id_to_type[m->mpc_busid] = MP_BUS_ISA; 100 mp_bus_id_to_type[m->busid] = MP_BUS_ISA;
101#endif 101#endif
102 } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI) - 1) == 0) { 102 } else if (strncmp(str, BUSTYPE_PCI, sizeof(BUSTYPE_PCI) - 1) == 0) {
103 if (x86_quirks->mpc_oem_pci_bus) 103 if (x86_quirks->mpc_oem_pci_bus)
104 x86_quirks->mpc_oem_pci_bus(m); 104 x86_quirks->mpc_oem_pci_bus(m);
105 105
106 clear_bit(m->mpc_busid, mp_bus_not_pci); 106 clear_bit(m->busid, mp_bus_not_pci);
107#if defined(CONFIG_EISA) || defined (CONFIG_MCA) 107#if defined(CONFIG_EISA) || defined(CONFIG_MCA)
108 mp_bus_id_to_type[m->mpc_busid] = MP_BUS_PCI; 108 mp_bus_id_to_type[m->busid] = MP_BUS_PCI;
109 } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA) - 1) == 0) { 109 } else if (strncmp(str, BUSTYPE_EISA, sizeof(BUSTYPE_EISA) - 1) == 0) {
110 mp_bus_id_to_type[m->mpc_busid] = MP_BUS_EISA; 110 mp_bus_id_to_type[m->busid] = MP_BUS_EISA;
111 } else if (strncmp(str, BUSTYPE_MCA, sizeof(BUSTYPE_MCA) - 1) == 0) { 111 } else if (strncmp(str, BUSTYPE_MCA, sizeof(BUSTYPE_MCA) - 1) == 0) {
112 mp_bus_id_to_type[m->mpc_busid] = MP_BUS_MCA; 112 mp_bus_id_to_type[m->busid] = MP_BUS_MCA;
113#endif 113#endif
114 } else 114 } else
115 printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str); 115 printk(KERN_WARNING "Unknown bustype %s - ignoring\n", str);
@@ -133,32 +133,31 @@ static int bad_ioapic(unsigned long address)
133 return 0; 133 return 0;
134} 134}
135 135
136static void __init MP_ioapic_info(struct mpc_config_ioapic *m) 136static void __init MP_ioapic_info(struct mpc_ioapic *m)
137{ 137{
138 if (!(m->mpc_flags & MPC_APIC_USABLE)) 138 if (!(m->flags & MPC_APIC_USABLE))
139 return; 139 return;
140 140
141 printk(KERN_INFO "I/O APIC #%d Version %d at 0x%X.\n", 141 printk(KERN_INFO "I/O APIC #%d Version %d at 0x%X.\n",
142 m->mpc_apicid, m->mpc_apicver, m->mpc_apicaddr); 142 m->apicid, m->apicver, m->apicaddr);
143 143
144 if (bad_ioapic(m->mpc_apicaddr)) 144 if (bad_ioapic(m->apicaddr))
145 return; 145 return;
146 146
147 mp_ioapics[nr_ioapics].mp_apicaddr = m->mpc_apicaddr; 147 mp_ioapics[nr_ioapics].mp_apicaddr = m->apicaddr;
148 mp_ioapics[nr_ioapics].mp_apicid = m->mpc_apicid; 148 mp_ioapics[nr_ioapics].mp_apicid = m->apicid;
149 mp_ioapics[nr_ioapics].mp_type = m->mpc_type; 149 mp_ioapics[nr_ioapics].mp_type = m->type;
150 mp_ioapics[nr_ioapics].mp_apicver = m->mpc_apicver; 150 mp_ioapics[nr_ioapics].mp_apicver = m->apicver;
151 mp_ioapics[nr_ioapics].mp_flags = m->mpc_flags; 151 mp_ioapics[nr_ioapics].mp_flags = m->flags;
152 nr_ioapics++; 152 nr_ioapics++;
153} 153}
154 154
155static void print_MP_intsrc_info(struct mpc_config_intsrc *m) 155static void print_MP_intsrc_info(struct mpc_intsrc *m)
156{ 156{
157 apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x," 157 apic_printk(APIC_VERBOSE, "Int: type %d, pol %d, trig %d, bus %02x,"
158 " IRQ %02x, APIC ID %x, APIC INT %02x\n", 158 " IRQ %02x, APIC ID %x, APIC INT %02x\n",
159 m->mpc_irqtype, m->mpc_irqflag & 3, 159 m->irqtype, m->irqflag & 3, (m->irqflag >> 2) & 3, m->srcbus,
160 (m->mpc_irqflag >> 2) & 3, m->mpc_srcbus, 160 m->srcbusirq, m->dstapic, m->dstirq);
161 m->mpc_srcbusirq, m->mpc_dstapic, m->mpc_dstirq);
162} 161}
163 162
164static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq) 163static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq)
@@ -170,52 +169,52 @@ static void __init print_mp_irq_info(struct mp_config_intsrc *mp_irq)
170 mp_irq->mp_srcbusirq, mp_irq->mp_dstapic, mp_irq->mp_dstirq); 169 mp_irq->mp_srcbusirq, mp_irq->mp_dstapic, mp_irq->mp_dstirq);
171} 170}
172 171
173static void __init assign_to_mp_irq(struct mpc_config_intsrc *m, 172static void __init assign_to_mp_irq(struct mpc_intsrc *m,
174 struct mp_config_intsrc *mp_irq) 173 struct mp_config_intsrc *mp_irq)
175{ 174{
176 mp_irq->mp_dstapic = m->mpc_dstapic; 175 mp_irq->mp_dstapic = m->dstapic;
177 mp_irq->mp_type = m->mpc_type; 176 mp_irq->mp_type = m->type;
178 mp_irq->mp_irqtype = m->mpc_irqtype; 177 mp_irq->mp_irqtype = m->irqtype;
179 mp_irq->mp_irqflag = m->mpc_irqflag; 178 mp_irq->mp_irqflag = m->irqflag;
180 mp_irq->mp_srcbus = m->mpc_srcbus; 179 mp_irq->mp_srcbus = m->srcbus;
181 mp_irq->mp_srcbusirq = m->mpc_srcbusirq; 180 mp_irq->mp_srcbusirq = m->srcbusirq;
182 mp_irq->mp_dstirq = m->mpc_dstirq; 181 mp_irq->mp_dstirq = m->dstirq;
183} 182}
184 183
185static void __init assign_to_mpc_intsrc(struct mp_config_intsrc *mp_irq, 184static void __init assign_to_mpc_intsrc(struct mp_config_intsrc *mp_irq,
186 struct mpc_config_intsrc *m) 185 struct mpc_intsrc *m)
187{ 186{
188 m->mpc_dstapic = mp_irq->mp_dstapic; 187 m->dstapic = mp_irq->mp_dstapic;
189 m->mpc_type = mp_irq->mp_type; 188 m->type = mp_irq->mp_type;
190 m->mpc_irqtype = mp_irq->mp_irqtype; 189 m->irqtype = mp_irq->mp_irqtype;
191 m->mpc_irqflag = mp_irq->mp_irqflag; 190 m->irqflag = mp_irq->mp_irqflag;
192 m->mpc_srcbus = mp_irq->mp_srcbus; 191 m->srcbus = mp_irq->mp_srcbus;
193 m->mpc_srcbusirq = mp_irq->mp_srcbusirq; 192 m->srcbusirq = mp_irq->mp_srcbusirq;
194 m->mpc_dstirq = mp_irq->mp_dstirq; 193 m->dstirq = mp_irq->mp_dstirq;
195} 194}
196 195
197static int __init mp_irq_mpc_intsrc_cmp(struct mp_config_intsrc *mp_irq, 196static int __init mp_irq_mpc_intsrc_cmp(struct mp_config_intsrc *mp_irq,
198 struct mpc_config_intsrc *m) 197 struct mpc_intsrc *m)
199{ 198{
200 if (mp_irq->mp_dstapic != m->mpc_dstapic) 199 if (mp_irq->mp_dstapic != m->dstapic)
201 return 1; 200 return 1;
202 if (mp_irq->mp_type != m->mpc_type) 201 if (mp_irq->mp_type != m->type)
203 return 2; 202 return 2;
204 if (mp_irq->mp_irqtype != m->mpc_irqtype) 203 if (mp_irq->mp_irqtype != m->irqtype)
205 return 3; 204 return 3;
206 if (mp_irq->mp_irqflag != m->mpc_irqflag) 205 if (mp_irq->mp_irqflag != m->irqflag)
207 return 4; 206 return 4;
208 if (mp_irq->mp_srcbus != m->mpc_srcbus) 207 if (mp_irq->mp_srcbus != m->srcbus)
209 return 5; 208 return 5;
210 if (mp_irq->mp_srcbusirq != m->mpc_srcbusirq) 209 if (mp_irq->mp_srcbusirq != m->srcbusirq)
211 return 6; 210 return 6;
212 if (mp_irq->mp_dstirq != m->mpc_dstirq) 211 if (mp_irq->mp_dstirq != m->dstirq)
213 return 7; 212 return 7;
214 213
215 return 0; 214 return 0;
216} 215}
217 216
218static void __init MP_intsrc_info(struct mpc_config_intsrc *m) 217static void __init MP_intsrc_info(struct mpc_intsrc *m)
219{ 218{
220 int i; 219 int i;
221 220
@@ -233,57 +232,55 @@ static void __init MP_intsrc_info(struct mpc_config_intsrc *m)
233 232
234#endif 233#endif
235 234
236static void __init MP_lintsrc_info(struct mpc_config_lintsrc *m) 235static void __init MP_lintsrc_info(struct mpc_lintsrc *m)
237{ 236{
238 apic_printk(APIC_VERBOSE, "Lint: type %d, pol %d, trig %d, bus %02x," 237 apic_printk(APIC_VERBOSE, "Lint: type %d, pol %d, trig %d, bus %02x,"
239 " IRQ %02x, APIC ID %x, APIC LINT %02x\n", 238 " IRQ %02x, APIC ID %x, APIC LINT %02x\n",
240 m->mpc_irqtype, m->mpc_irqflag & 3, 239 m->irqtype, m->irqflag & 3, (m->irqflag >> 2) & 3, m->srcbusid,
241 (m->mpc_irqflag >> 2) & 3, m->mpc_srcbusid, 240 m->srcbusirq, m->destapic, m->destapiclint);
242 m->mpc_srcbusirq, m->mpc_destapic, m->mpc_destapiclint);
243} 241}
244 242
245/* 243/*
246 * Read/parse the MPC 244 * Read/parse the MPC
247 */ 245 */
248 246
249static int __init smp_check_mpc(struct mp_config_table *mpc, char *oem, 247static int __init smp_check_mpc(struct mpc_table *mpc, char *oem, char *str)
250 char *str)
251{ 248{
252 249
253 if (memcmp(mpc->mpc_signature, MPC_SIGNATURE, 4)) { 250 if (memcmp(mpc->signature, MPC_SIGNATURE, 4)) {
254 printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n", 251 printk(KERN_ERR "MPTABLE: bad signature [%c%c%c%c]!\n",
255 mpc->mpc_signature[0], mpc->mpc_signature[1], 252 mpc->signature[0], mpc->signature[1],
256 mpc->mpc_signature[2], mpc->mpc_signature[3]); 253 mpc->signature[2], mpc->signature[3]);
257 return 0; 254 return 0;
258 } 255 }
259 if (mpf_checksum((unsigned char *)mpc, mpc->mpc_length)) { 256 if (mpf_checksum((unsigned char *)mpc, mpc->length)) {
260 printk(KERN_ERR "MPTABLE: checksum error!\n"); 257 printk(KERN_ERR "MPTABLE: checksum error!\n");
261 return 0; 258 return 0;
262 } 259 }
263 if (mpc->mpc_spec != 0x01 && mpc->mpc_spec != 0x04) { 260 if (mpc->spec != 0x01 && mpc->spec != 0x04) {
264 printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n", 261 printk(KERN_ERR "MPTABLE: bad table version (%d)!!\n",
265 mpc->mpc_spec); 262 mpc->spec);
266 return 0; 263 return 0;
267 } 264 }
268 if (!mpc->mpc_lapic) { 265 if (!mpc->lapic) {
269 printk(KERN_ERR "MPTABLE: null local APIC address!\n"); 266 printk(KERN_ERR "MPTABLE: null local APIC address!\n");
270 return 0; 267 return 0;
271 } 268 }
272 memcpy(oem, mpc->mpc_oem, 8); 269 memcpy(oem, mpc->oem, 8);
273 oem[8] = 0; 270 oem[8] = 0;
274 printk(KERN_INFO "MPTABLE: OEM ID: %s\n", oem); 271 printk(KERN_INFO "MPTABLE: OEM ID: %s\n", oem);
275 272
276 memcpy(str, mpc->mpc_productid, 12); 273 memcpy(str, mpc->productid, 12);
277 str[12] = 0; 274 str[12] = 0;
278 275
279 printk(KERN_INFO "MPTABLE: Product ID: %s\n", str); 276 printk(KERN_INFO "MPTABLE: Product ID: %s\n", str);
280 277
281 printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->mpc_lapic); 278 printk(KERN_INFO "MPTABLE: APIC at: 0x%X\n", mpc->lapic);
282 279
283 return 1; 280 return 1;
284} 281}
285 282
286static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early) 283static int __init smp_read_mpc(struct mpc_table *mpc, unsigned early)
287{ 284{
288 char str[16]; 285 char str[16];
289 char oem[10]; 286 char oem[10];
@@ -308,14 +305,14 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
308#endif 305#endif
309 /* save the local APIC address, it might be non-default */ 306 /* save the local APIC address, it might be non-default */
310 if (!acpi_lapic) 307 if (!acpi_lapic)
311 mp_lapic_addr = mpc->mpc_lapic; 308 mp_lapic_addr = mpc->lapic;
312 309
313 if (early) 310 if (early)
314 return 1; 311 return 1;
315 312
316 if (mpc->mpc_oemptr && x86_quirks->smp_read_mpc_oem) { 313 if (mpc->oemptr && x86_quirks->smp_read_mpc_oem) {
317 struct mp_config_oemtable *oem_table = (struct mp_config_oemtable *)(unsigned long)mpc->mpc_oemptr; 314 struct mpc_oemtable *oem_table = (void *)(long)mpc->oemptr;
318 x86_quirks->smp_read_mpc_oem(oem_table, mpc->mpc_oemsize); 315 x86_quirks->smp_read_mpc_oem(oem_table, mpc->oemsize);
319 } 316 }
320 317
321 /* 318 /*
@@ -324,12 +321,11 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
324 if (x86_quirks->mpc_record) 321 if (x86_quirks->mpc_record)
325 *x86_quirks->mpc_record = 0; 322 *x86_quirks->mpc_record = 0;
326 323
327 while (count < mpc->mpc_length) { 324 while (count < mpc->length) {
328 switch (*mpt) { 325 switch (*mpt) {
329 case MP_PROCESSOR: 326 case MP_PROCESSOR:
330 { 327 {
331 struct mpc_config_processor *m = 328 struct mpc_cpu *m = (struct mpc_cpu *)mpt;
332 (struct mpc_config_processor *)mpt;
333 /* ACPI may have already provided this data */ 329 /* ACPI may have already provided this data */
334 if (!acpi_lapic) 330 if (!acpi_lapic)
335 MP_processor_info(m); 331 MP_processor_info(m);
@@ -339,8 +335,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
339 } 335 }
340 case MP_BUS: 336 case MP_BUS:
341 { 337 {
342 struct mpc_config_bus *m = 338 struct mpc_bus *m = (struct mpc_bus *)mpt;
343 (struct mpc_config_bus *)mpt;
344#ifdef CONFIG_X86_IO_APIC 339#ifdef CONFIG_X86_IO_APIC
345 MP_bus_info(m); 340 MP_bus_info(m);
346#endif 341#endif
@@ -351,30 +346,28 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
351 case MP_IOAPIC: 346 case MP_IOAPIC:
352 { 347 {
353#ifdef CONFIG_X86_IO_APIC 348#ifdef CONFIG_X86_IO_APIC
354 struct mpc_config_ioapic *m = 349 struct mpc_ioapic *m = (struct mpc_ioapic *)mpt;
355 (struct mpc_config_ioapic *)mpt;
356 MP_ioapic_info(m); 350 MP_ioapic_info(m);
357#endif 351#endif
358 mpt += sizeof(struct mpc_config_ioapic); 352 mpt += sizeof(struct mpc_ioapic);
359 count += sizeof(struct mpc_config_ioapic); 353 count += sizeof(struct mpc_ioapic);
360 break; 354 break;
361 } 355 }
362 case MP_INTSRC: 356 case MP_INTSRC:
363 { 357 {
364#ifdef CONFIG_X86_IO_APIC 358#ifdef CONFIG_X86_IO_APIC
365 struct mpc_config_intsrc *m = 359 struct mpc_intsrc *m = (struct mpc_intsrc *)mpt;
366 (struct mpc_config_intsrc *)mpt;
367 360
368 MP_intsrc_info(m); 361 MP_intsrc_info(m);
369#endif 362#endif
370 mpt += sizeof(struct mpc_config_intsrc); 363 mpt += sizeof(struct mpc_intsrc);
371 count += sizeof(struct mpc_config_intsrc); 364 count += sizeof(struct mpc_intsrc);
372 break; 365 break;
373 } 366 }
374 case MP_LINTSRC: 367 case MP_LINTSRC:
375 { 368 {
376 struct mpc_config_lintsrc *m = 369 struct mpc_lintsrc *m =
377 (struct mpc_config_lintsrc *)mpt; 370 (struct mpc_lintsrc *)mpt;
378 MP_lintsrc_info(m); 371 MP_lintsrc_info(m);
379 mpt += sizeof(*m); 372 mpt += sizeof(*m);
380 count += sizeof(*m); 373 count += sizeof(*m);
@@ -385,8 +378,8 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early)
385 printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); 378 printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n");
386 printk(KERN_ERR "type %x\n", *mpt); 379 printk(KERN_ERR "type %x\n", *mpt);
387 print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, 380 print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
388 1, mpc, mpc->mpc_length, 1); 381 1, mpc, mpc->length, 1);
389 count = mpc->mpc_length; 382 count = mpc->length;
390 break; 383 break;
391 } 384 }
392 if (x86_quirks->mpc_record) 385 if (x86_quirks->mpc_record)
@@ -417,16 +410,16 @@ static int __init ELCR_trigger(unsigned int irq)
417 410
418static void __init construct_default_ioirq_mptable(int mpc_default_type) 411static void __init construct_default_ioirq_mptable(int mpc_default_type)
419{ 412{
420 struct mpc_config_intsrc intsrc; 413 struct mpc_intsrc intsrc;
421 int i; 414 int i;
422 int ELCR_fallback = 0; 415 int ELCR_fallback = 0;
423 416
424 intsrc.mpc_type = MP_INTSRC; 417 intsrc.type = MP_INTSRC;
425 intsrc.mpc_irqflag = 0; /* conforming */ 418 intsrc.irqflag = 0; /* conforming */
426 intsrc.mpc_srcbus = 0; 419 intsrc.srcbus = 0;
427 intsrc.mpc_dstapic = mp_ioapics[0].mp_apicid; 420 intsrc.dstapic = mp_ioapics[0].mp_apicid;
428 421
429 intsrc.mpc_irqtype = mp_INT; 422 intsrc.irqtype = mp_INT;
430 423
431 /* 424 /*
432 * If true, we have an ISA/PCI system with no IRQ entries 425 * If true, we have an ISA/PCI system with no IRQ entries
@@ -469,30 +462,30 @@ static void __init construct_default_ioirq_mptable(int mpc_default_type)
469 * irqflag field (level sensitive, active high polarity). 462 * irqflag field (level sensitive, active high polarity).
470 */ 463 */
471 if (ELCR_trigger(i)) 464 if (ELCR_trigger(i))
472 intsrc.mpc_irqflag = 13; 465 intsrc.irqflag = 13;
473 else 466 else
474 intsrc.mpc_irqflag = 0; 467 intsrc.irqflag = 0;
475 } 468 }
476 469
477 intsrc.mpc_srcbusirq = i; 470 intsrc.srcbusirq = i;
478 intsrc.mpc_dstirq = i ? i : 2; /* IRQ0 to INTIN2 */ 471 intsrc.dstirq = i ? i : 2; /* IRQ0 to INTIN2 */
479 MP_intsrc_info(&intsrc); 472 MP_intsrc_info(&intsrc);
480 } 473 }
481 474
482 intsrc.mpc_irqtype = mp_ExtINT; 475 intsrc.irqtype = mp_ExtINT;
483 intsrc.mpc_srcbusirq = 0; 476 intsrc.srcbusirq = 0;
484 intsrc.mpc_dstirq = 0; /* 8259A to INTIN0 */ 477 intsrc.dstirq = 0; /* 8259A to INTIN0 */
485 MP_intsrc_info(&intsrc); 478 MP_intsrc_info(&intsrc);
486} 479}
487 480
488 481
489static void __init construct_ioapic_table(int mpc_default_type) 482static void __init construct_ioapic_table(int mpc_default_type)
490{ 483{
491 struct mpc_config_ioapic ioapic; 484 struct mpc_ioapic ioapic;
492 struct mpc_config_bus bus; 485 struct mpc_bus bus;
493 486
494 bus.mpc_type = MP_BUS; 487 bus.type = MP_BUS;
495 bus.mpc_busid = 0; 488 bus.busid = 0;
496 switch (mpc_default_type) { 489 switch (mpc_default_type) {
497 default: 490 default:
498 printk(KERN_ERR "???\nUnknown standard configuration %d\n", 491 printk(KERN_ERR "???\nUnknown standard configuration %d\n",
@@ -500,29 +493,29 @@ static void __init construct_ioapic_table(int mpc_default_type)
500 /* fall through */ 493 /* fall through */
501 case 1: 494 case 1:
502 case 5: 495 case 5:
503 memcpy(bus.mpc_bustype, "ISA ", 6); 496 memcpy(bus.bustype, "ISA ", 6);
504 break; 497 break;
505 case 2: 498 case 2:
506 case 6: 499 case 6:
507 case 3: 500 case 3:
508 memcpy(bus.mpc_bustype, "EISA ", 6); 501 memcpy(bus.bustype, "EISA ", 6);
509 break; 502 break;
510 case 4: 503 case 4:
511 case 7: 504 case 7:
512 memcpy(bus.mpc_bustype, "MCA ", 6); 505 memcpy(bus.bustype, "MCA ", 6);
513 } 506 }
514 MP_bus_info(&bus); 507 MP_bus_info(&bus);
515 if (mpc_default_type > 4) { 508 if (mpc_default_type > 4) {
516 bus.mpc_busid = 1; 509 bus.busid = 1;
517 memcpy(bus.mpc_bustype, "PCI ", 6); 510 memcpy(bus.bustype, "PCI ", 6);
518 MP_bus_info(&bus); 511 MP_bus_info(&bus);
519 } 512 }
520 513
521 ioapic.mpc_type = MP_IOAPIC; 514 ioapic.type = MP_IOAPIC;
522 ioapic.mpc_apicid = 2; 515 ioapic.apicid = 2;
523 ioapic.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01; 516 ioapic.apicver = mpc_default_type > 4 ? 0x10 : 0x01;
524 ioapic.mpc_flags = MPC_APIC_USABLE; 517 ioapic.flags = MPC_APIC_USABLE;
525 ioapic.mpc_apicaddr = 0xFEC00000; 518 ioapic.apicaddr = 0xFEC00000;
526 MP_ioapic_info(&ioapic); 519 MP_ioapic_info(&ioapic);
527 520
528 /* 521 /*
@@ -536,8 +529,8 @@ static inline void __init construct_ioapic_table(int mpc_default_type) { }
536 529
537static inline void __init construct_default_ISA_mptable(int mpc_default_type) 530static inline void __init construct_default_ISA_mptable(int mpc_default_type)
538{ 531{
539 struct mpc_config_processor processor; 532 struct mpc_cpu processor;
540 struct mpc_config_lintsrc lintsrc; 533 struct mpc_lintsrc lintsrc;
541 int linttypes[2] = { mp_ExtINT, mp_NMI }; 534 int linttypes[2] = { mp_ExtINT, mp_NMI };
542 int i; 535 int i;
543 536
@@ -549,30 +542,30 @@ static inline void __init construct_default_ISA_mptable(int mpc_default_type)
549 /* 542 /*
550 * 2 CPUs, numbered 0 & 1. 543 * 2 CPUs, numbered 0 & 1.
551 */ 544 */
552 processor.mpc_type = MP_PROCESSOR; 545 processor.type = MP_PROCESSOR;
553 /* Either an integrated APIC or a discrete 82489DX. */ 546 /* Either an integrated APIC or a discrete 82489DX. */
554 processor.mpc_apicver = mpc_default_type > 4 ? 0x10 : 0x01; 547 processor.apicver = mpc_default_type > 4 ? 0x10 : 0x01;
555 processor.mpc_cpuflag = CPU_ENABLED; 548 processor.cpuflag = CPU_ENABLED;
556 processor.mpc_cpufeature = (boot_cpu_data.x86 << 8) | 549 processor.cpufeature = (boot_cpu_data.x86 << 8) |
557 (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask; 550 (boot_cpu_data.x86_model << 4) | boot_cpu_data.x86_mask;
558 processor.mpc_featureflag = boot_cpu_data.x86_capability[0]; 551 processor.featureflag = boot_cpu_data.x86_capability[0];
559 processor.mpc_reserved[0] = 0; 552 processor.reserved[0] = 0;
560 processor.mpc_reserved[1] = 0; 553 processor.reserved[1] = 0;
561 for (i = 0; i < 2; i++) { 554 for (i = 0; i < 2; i++) {
562 processor.mpc_apicid = i; 555 processor.apicid = i;
563 MP_processor_info(&processor); 556 MP_processor_info(&processor);
564 } 557 }
565 558
566 construct_ioapic_table(mpc_default_type); 559 construct_ioapic_table(mpc_default_type);
567 560
568 lintsrc.mpc_type = MP_LINTSRC; 561 lintsrc.type = MP_LINTSRC;
569 lintsrc.mpc_irqflag = 0; /* conforming */ 562 lintsrc.irqflag = 0; /* conforming */
570 lintsrc.mpc_srcbusid = 0; 563 lintsrc.srcbusid = 0;
571 lintsrc.mpc_srcbusirq = 0; 564 lintsrc.srcbusirq = 0;
572 lintsrc.mpc_destapic = MP_APIC_ALL; 565 lintsrc.destapic = MP_APIC_ALL;
573 for (i = 0; i < 2; i++) { 566 for (i = 0; i < 2; i++) {
574 lintsrc.mpc_irqtype = linttypes[i]; 567 lintsrc.irqtype = linttypes[i];
575 lintsrc.mpc_destapiclint = i; 568 lintsrc.destapiclint = i;
576 MP_lintsrc_info(&lintsrc); 569 MP_lintsrc_info(&lintsrc);
577 } 570 }
578} 571}
@@ -657,15 +650,15 @@ static void __init __get_smp_config(unsigned int early)
657 * ISA defaults and hope it will work. 650 * ISA defaults and hope it will work.
658 */ 651 */
659 if (!mp_irq_entries) { 652 if (!mp_irq_entries) {
660 struct mpc_config_bus bus; 653 struct mpc_bus bus;
661 654
662 printk(KERN_ERR "BIOS bug, no explicit IRQ entries, " 655 printk(KERN_ERR "BIOS bug, no explicit IRQ entries, "
663 "using default mptable. " 656 "using default mptable. "
664 "(tell your hw vendor)\n"); 657 "(tell your hw vendor)\n");
665 658
666 bus.mpc_type = MP_BUS; 659 bus.type = MP_BUS;
667 bus.mpc_busid = 0; 660 bus.busid = 0;
668 memcpy(bus.mpc_bustype, "ISA ", 6); 661 memcpy(bus.bustype, "ISA ", 6);
669 MP_bus_info(&bus); 662 MP_bus_info(&bus);
670 663
671 construct_default_ioirq_mptable(0); 664 construct_default_ioirq_mptable(0);
@@ -803,14 +796,14 @@ void __init find_smp_config(void)
803#ifdef CONFIG_X86_IO_APIC 796#ifdef CONFIG_X86_IO_APIC
804static u8 __initdata irq_used[MAX_IRQ_SOURCES]; 797static u8 __initdata irq_used[MAX_IRQ_SOURCES];
805 798
806static int __init get_MP_intsrc_index(struct mpc_config_intsrc *m) 799static int __init get_MP_intsrc_index(struct mpc_intsrc *m)
807{ 800{
808 int i; 801 int i;
809 802
810 if (m->mpc_irqtype != mp_INT) 803 if (m->irqtype != mp_INT)
811 return 0; 804 return 0;
812 805
813 if (m->mpc_irqflag != 0x0f) 806 if (m->irqflag != 0x0f)
814 return 0; 807 return 0;
815 808
816 /* not legacy */ 809 /* not legacy */
@@ -822,9 +815,9 @@ static int __init get_MP_intsrc_index(struct mpc_config_intsrc *m)
822 if (mp_irqs[i].mp_irqflag != 0x0f) 815 if (mp_irqs[i].mp_irqflag != 0x0f)
823 continue; 816 continue;
824 817
825 if (mp_irqs[i].mp_srcbus != m->mpc_srcbus) 818 if (mp_irqs[i].mp_srcbus != m->srcbus)
826 continue; 819 continue;
827 if (mp_irqs[i].mp_srcbusirq != m->mpc_srcbusirq) 820 if (mp_irqs[i].mp_srcbusirq != m->srcbusirq)
828 continue; 821 continue;
829 if (irq_used[i]) { 822 if (irq_used[i]) {
830 /* already claimed */ 823 /* already claimed */
@@ -840,10 +833,10 @@ static int __init get_MP_intsrc_index(struct mpc_config_intsrc *m)
840 833
841#define SPARE_SLOT_NUM 20 834#define SPARE_SLOT_NUM 20
842 835
843static struct mpc_config_intsrc __initdata *m_spare[SPARE_SLOT_NUM]; 836static struct mpc_intsrc __initdata *m_spare[SPARE_SLOT_NUM];
844#endif 837#endif
845 838
846static int __init replace_intsrc_all(struct mp_config_table *mpc, 839static int __init replace_intsrc_all(struct mpc_table *mpc,
847 unsigned long mpc_new_phys, 840 unsigned long mpc_new_phys,
848 unsigned long mpc_new_length) 841 unsigned long mpc_new_length)
849{ 842{
@@ -855,36 +848,33 @@ static int __init replace_intsrc_all(struct mp_config_table *mpc,
855 int count = sizeof(*mpc); 848 int count = sizeof(*mpc);
856 unsigned char *mpt = ((unsigned char *)mpc) + count; 849 unsigned char *mpt = ((unsigned char *)mpc) + count;
857 850
858 printk(KERN_INFO "mpc_length %x\n", mpc->mpc_length); 851 printk(KERN_INFO "mpc_length %x\n", mpc->length);
859 while (count < mpc->mpc_length) { 852 while (count < mpc->length) {
860 switch (*mpt) { 853 switch (*mpt) {
861 case MP_PROCESSOR: 854 case MP_PROCESSOR:
862 { 855 {
863 struct mpc_config_processor *m = 856 struct mpc_cpu *m = (struct mpc_cpu *)mpt;
864 (struct mpc_config_processor *)mpt;
865 mpt += sizeof(*m); 857 mpt += sizeof(*m);
866 count += sizeof(*m); 858 count += sizeof(*m);
867 break; 859 break;
868 } 860 }
869 case MP_BUS: 861 case MP_BUS:
870 { 862 {
871 struct mpc_config_bus *m = 863 struct mpc_bus *m = (struct mpc_bus *)mpt;
872 (struct mpc_config_bus *)mpt;
873 mpt += sizeof(*m); 864 mpt += sizeof(*m);
874 count += sizeof(*m); 865 count += sizeof(*m);
875 break; 866 break;
876 } 867 }
877 case MP_IOAPIC: 868 case MP_IOAPIC:
878 { 869 {
879 mpt += sizeof(struct mpc_config_ioapic); 870 mpt += sizeof(struct mpc_ioapic);
880 count += sizeof(struct mpc_config_ioapic); 871 count += sizeof(struct mpc_ioapic);
881 break; 872 break;
882 } 873 }
883 case MP_INTSRC: 874 case MP_INTSRC:
884 { 875 {
885#ifdef CONFIG_X86_IO_APIC 876#ifdef CONFIG_X86_IO_APIC
886 struct mpc_config_intsrc *m = 877 struct mpc_intsrc *m = (struct mpc_intsrc *)mpt;
887 (struct mpc_config_intsrc *)mpt;
888 878
889 printk(KERN_INFO "OLD "); 879 printk(KERN_INFO "OLD ");
890 print_MP_intsrc_info(m); 880 print_MP_intsrc_info(m);
@@ -905,14 +895,14 @@ static int __init replace_intsrc_all(struct mp_config_table *mpc,
905 nr_m_spare++; 895 nr_m_spare++;
906 } 896 }
907#endif 897#endif
908 mpt += sizeof(struct mpc_config_intsrc); 898 mpt += sizeof(struct mpc_intsrc);
909 count += sizeof(struct mpc_config_intsrc); 899 count += sizeof(struct mpc_intsrc);
910 break; 900 break;
911 } 901 }
912 case MP_LINTSRC: 902 case MP_LINTSRC:
913 { 903 {
914 struct mpc_config_lintsrc *m = 904 struct mpc_lintsrc *m =
915 (struct mpc_config_lintsrc *)mpt; 905 (struct mpc_lintsrc *)mpt;
916 mpt += sizeof(*m); 906 mpt += sizeof(*m);
917 count += sizeof(*m); 907 count += sizeof(*m);
918 break; 908 break;
@@ -922,7 +912,7 @@ static int __init replace_intsrc_all(struct mp_config_table *mpc,
922 printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n"); 912 printk(KERN_ERR "Your mptable is wrong, contact your HW vendor!\n");
923 printk(KERN_ERR "type %x\n", *mpt); 913 printk(KERN_ERR "type %x\n", *mpt);
924 print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16, 914 print_hex_dump(KERN_ERR, " ", DUMP_PREFIX_ADDRESS, 16,
925 1, mpc, mpc->mpc_length, 1); 915 1, mpc, mpc->length, 1);
926 goto out; 916 goto out;
927 } 917 }
928 } 918 }
@@ -944,9 +934,8 @@ static int __init replace_intsrc_all(struct mp_config_table *mpc,
944 assign_to_mpc_intsrc(&mp_irqs[i], m_spare[nr_m_spare]); 934 assign_to_mpc_intsrc(&mp_irqs[i], m_spare[nr_m_spare]);
945 m_spare[nr_m_spare] = NULL; 935 m_spare[nr_m_spare] = NULL;
946 } else { 936 } else {
947 struct mpc_config_intsrc *m = 937 struct mpc_intsrc *m = (struct mpc_intsrc *)mpt;
948 (struct mpc_config_intsrc *)mpt; 938 count += sizeof(struct mpc_intsrc);
949 count += sizeof(struct mpc_config_intsrc);
950 if (!mpc_new_phys) { 939 if (!mpc_new_phys) {
951 printk(KERN_INFO "No spare slots, try to append...take your risk, new mpc_length %x\n", count); 940 printk(KERN_INFO "No spare slots, try to append...take your risk, new mpc_length %x\n", count);
952 } else { 941 } else {
@@ -958,17 +947,16 @@ static int __init replace_intsrc_all(struct mp_config_table *mpc,
958 } 947 }
959 } 948 }
960 assign_to_mpc_intsrc(&mp_irqs[i], m); 949 assign_to_mpc_intsrc(&mp_irqs[i], m);
961 mpc->mpc_length = count; 950 mpc->length = count;
962 mpt += sizeof(struct mpc_config_intsrc); 951 mpt += sizeof(struct mpc_intsrc);
963 } 952 }
964 print_mp_irq_info(&mp_irqs[i]); 953 print_mp_irq_info(&mp_irqs[i]);
965 } 954 }
966#endif 955#endif
967out: 956out:
968 /* update checksum */ 957 /* update checksum */
969 mpc->mpc_checksum = 0; 958 mpc->checksum = 0;
970 mpc->mpc_checksum -= mpf_checksum((unsigned char *)mpc, 959 mpc->checksum -= mpf_checksum((unsigned char *)mpc, mpc->length);
971 mpc->mpc_length);
972 960
973 return 0; 961 return 0;
974} 962}
@@ -1014,8 +1002,7 @@ static int __init update_mp_table(void)
1014 char str[16]; 1002 char str[16];
1015 char oem[10]; 1003 char oem[10];
1016 struct intel_mp_floating *mpf; 1004 struct intel_mp_floating *mpf;
1017 struct mp_config_table *mpc; 1005 struct mpc_table *mpc, *mpc_new;
1018 struct mp_config_table *mpc_new;
1019 1006
1020 if (!enable_update_mptable) 1007 if (!enable_update_mptable)
1021 return 0; 1008 return 0;
@@ -1041,7 +1028,7 @@ static int __init update_mp_table(void)
1041 printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf)); 1028 printk(KERN_INFO "mpf: %lx\n", virt_to_phys(mpf));
1042 printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr); 1029 printk(KERN_INFO "mpf_physptr: %x\n", mpf->mpf_physptr);
1043 1030
1044 if (mpc_new_phys && mpc->mpc_length > mpc_new_length) { 1031 if (mpc_new_phys && mpc->length > mpc_new_length) {
1045 mpc_new_phys = 0; 1032 mpc_new_phys = 0;
1046 printk(KERN_INFO "mpc_new_length is %ld, please use alloc_mptable=8k\n", 1033 printk(KERN_INFO "mpc_new_length is %ld, please use alloc_mptable=8k\n",
1047 mpc_new_length); 1034 mpc_new_length);
@@ -1050,10 +1037,10 @@ static int __init update_mp_table(void)
1050 if (!mpc_new_phys) { 1037 if (!mpc_new_phys) {
1051 unsigned char old, new; 1038 unsigned char old, new;
1052 /* check if we can change the postion */ 1039 /* check if we can change the postion */
1053 mpc->mpc_checksum = 0; 1040 mpc->checksum = 0;
1054 old = mpf_checksum((unsigned char *)mpc, mpc->mpc_length); 1041 old = mpf_checksum((unsigned char *)mpc, mpc->length);
1055 mpc->mpc_checksum = 0xff; 1042 mpc->checksum = 0xff;
1056 new = mpf_checksum((unsigned char *)mpc, mpc->mpc_length); 1043 new = mpf_checksum((unsigned char *)mpc, mpc->length);
1057 if (old == new) { 1044 if (old == new) {
1058 printk(KERN_INFO "mpc is readonly, please try alloc_mptable instead\n"); 1045 printk(KERN_INFO "mpc is readonly, please try alloc_mptable instead\n");
1059 return 0; 1046 return 0;
@@ -1062,7 +1049,7 @@ static int __init update_mp_table(void)
1062 } else { 1049 } else {
1063 mpf->mpf_physptr = mpc_new_phys; 1050 mpf->mpf_physptr = mpc_new_phys;
1064 mpc_new = phys_to_virt(mpc_new_phys); 1051 mpc_new = phys_to_virt(mpc_new_phys);
1065 memcpy(mpc_new, mpc, mpc->mpc_length); 1052 memcpy(mpc_new, mpc, mpc->length);
1066 mpc = mpc_new; 1053 mpc = mpc_new;
1067 /* check if we can modify that */ 1054 /* check if we can modify that */
1068 if (mpc_new_phys - mpf->mpf_physptr) { 1055 if (mpc_new_phys - mpf->mpf_physptr) {
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 82a7c7ed6d45..726266695b2c 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -136,7 +136,7 @@ static int msr_open(struct inode *inode, struct file *file)
136 lock_kernel(); 136 lock_kernel();
137 cpu = iminor(file->f_path.dentry->d_inode); 137 cpu = iminor(file->f_path.dentry->d_inode);
138 138
139 if (cpu >= NR_CPUS || !cpu_online(cpu)) { 139 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
140 ret = -ENXIO; /* No such CPU */ 140 ret = -ENXIO; /* No such CPU */
141 goto out; 141 goto out;
142 } 142 }
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c
index 8bd1bf9622a7..7228979f1e7f 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -29,8 +29,6 @@
29 29
30#include <asm/i8259.h> 30#include <asm/i8259.h>
31#include <asm/io_apic.h> 31#include <asm/io_apic.h>
32#include <asm/smp.h>
33#include <asm/nmi.h>
34#include <asm/proto.h> 32#include <asm/proto.h>
35#include <asm/timer.h> 33#include <asm/timer.h>
36 34
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c
index 0deea37a53cf..f2191d4f2717 100644
--- a/arch/x86/kernel/numaq_32.c
+++ b/arch/x86/kernel/numaq_32.c
@@ -117,16 +117,15 @@ static inline int generate_logical_apicid(int quad, int phys_apicid)
117} 117}
118 118
119/* x86_quirks member */ 119/* x86_quirks member */
120static int mpc_apic_id(struct mpc_config_processor *m) 120static int mpc_apic_id(struct mpc_cpu *m)
121{ 121{
122 int quad = translation_table[mpc_record]->trans_quad; 122 int quad = translation_table[mpc_record]->trans_quad;
123 int logical_apicid = generate_logical_apicid(quad, m->mpc_apicid); 123 int logical_apicid = generate_logical_apicid(quad, m->apicid);
124 124
125 printk(KERN_DEBUG "Processor #%d %u:%u APIC version %d (quad %d, apic %d)\n", 125 printk(KERN_DEBUG "Processor #%d %u:%u APIC version %d (quad %d, apic %d)\n",
126 m->mpc_apicid, 126 m->apicid, (m->cpufeature & CPU_FAMILY_MASK) >> 8,
127 (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8, 127 (m->cpufeature & CPU_MODEL_MASK) >> 4,
128 (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4, 128 m->apicver, quad, logical_apicid);
129 m->mpc_apicver, quad, logical_apicid);
130 return logical_apicid; 129 return logical_apicid;
131} 130}
132 131
@@ -135,26 +134,26 @@ int mp_bus_id_to_node[MAX_MP_BUSSES];
135int mp_bus_id_to_local[MAX_MP_BUSSES]; 134int mp_bus_id_to_local[MAX_MP_BUSSES];
136 135
137/* x86_quirks member */ 136/* x86_quirks member */
138static void mpc_oem_bus_info(struct mpc_config_bus *m, char *name) 137static void mpc_oem_bus_info(struct mpc_bus *m, char *name)
139{ 138{
140 int quad = translation_table[mpc_record]->trans_quad; 139 int quad = translation_table[mpc_record]->trans_quad;
141 int local = translation_table[mpc_record]->trans_local; 140 int local = translation_table[mpc_record]->trans_local;
142 141
143 mp_bus_id_to_node[m->mpc_busid] = quad; 142 mp_bus_id_to_node[m->busid] = quad;
144 mp_bus_id_to_local[m->mpc_busid] = local; 143 mp_bus_id_to_local[m->busid] = local;
145 printk(KERN_INFO "Bus #%d is %s (node %d)\n", 144 printk(KERN_INFO "Bus #%d is %s (node %d)\n",
146 m->mpc_busid, name, quad); 145 m->busid, name, quad);
147} 146}
148 147
149int quad_local_to_mp_bus_id [NR_CPUS/4][4]; 148int quad_local_to_mp_bus_id [NR_CPUS/4][4];
150 149
151/* x86_quirks member */ 150/* x86_quirks member */
152static void mpc_oem_pci_bus(struct mpc_config_bus *m) 151static void mpc_oem_pci_bus(struct mpc_bus *m)
153{ 152{
154 int quad = translation_table[mpc_record]->trans_quad; 153 int quad = translation_table[mpc_record]->trans_quad;
155 int local = translation_table[mpc_record]->trans_local; 154 int local = translation_table[mpc_record]->trans_local;
156 155
157 quad_local_to_mp_bus_id[quad][local] = m->mpc_busid; 156 quad_local_to_mp_bus_id[quad][local] = m->busid;
158} 157}
159 158
160static void __init MP_translation_info(struct mpc_config_translation *m) 159static void __init MP_translation_info(struct mpc_config_translation *m)
@@ -186,7 +185,7 @@ static int __init mpf_checksum(unsigned char *mp, int len)
186 * Read/parse the MPC oem tables 185 * Read/parse the MPC oem tables
187 */ 186 */
188 187
189static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable, 188static void __init smp_read_mpc_oem(struct mpc_oemtable *oemtable,
190 unsigned short oemsize) 189 unsigned short oemsize)
191{ 190{
192 int count = sizeof(*oemtable); /* the header size */ 191 int count = sizeof(*oemtable); /* the header size */
@@ -195,18 +194,18 @@ static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable,
195 mpc_record = 0; 194 mpc_record = 0;
196 printk(KERN_INFO "Found an OEM MPC table at %8p - parsing it ... \n", 195 printk(KERN_INFO "Found an OEM MPC table at %8p - parsing it ... \n",
197 oemtable); 196 oemtable);
198 if (memcmp(oemtable->oem_signature, MPC_OEM_SIGNATURE, 4)) { 197 if (memcmp(oemtable->signature, MPC_OEM_SIGNATURE, 4)) {
199 printk(KERN_WARNING 198 printk(KERN_WARNING
200 "SMP mpc oemtable: bad signature [%c%c%c%c]!\n", 199 "SMP mpc oemtable: bad signature [%c%c%c%c]!\n",
201 oemtable->oem_signature[0], oemtable->oem_signature[1], 200 oemtable->signature[0], oemtable->signature[1],
202 oemtable->oem_signature[2], oemtable->oem_signature[3]); 201 oemtable->signature[2], oemtable->signature[3]);
203 return; 202 return;
204 } 203 }
205 if (mpf_checksum((unsigned char *)oemtable, oemtable->oem_length)) { 204 if (mpf_checksum((unsigned char *)oemtable, oemtable->length)) {
206 printk(KERN_WARNING "SMP oem mptable: checksum error!\n"); 205 printk(KERN_WARNING "SMP oem mptable: checksum error!\n");
207 return; 206 return;
208 } 207 }
209 while (count < oemtable->oem_length) { 208 while (count < oemtable->length) {
210 switch (*oemptr) { 209 switch (*oemptr) {
211 case MP_TRANSLATION: 210 case MP_TRANSLATION:
212 { 211 {
@@ -260,8 +259,7 @@ static struct x86_quirks numaq_x86_quirks __initdata = {
260 .update_genapic = numaq_update_genapic, 259 .update_genapic = numaq_update_genapic,
261}; 260};
262 261
263void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem, 262void numaq_mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
264 char *productid)
265{ 263{
266 if (strncmp(oem, "IBM NUMA", 8)) 264 if (strncmp(oem, "IBM NUMA", 8))
267 printk("Warning! Not a NUMA-Q system!\n"); 265 printk("Warning! Not a NUMA-Q system!\n");
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 19a1044a0cd9..b25428533141 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -38,7 +38,7 @@ EXPORT_SYMBOL(bad_dma_address);
38 be probably a smaller DMA mask, but this is bug-to-bug compatible 38 be probably a smaller DMA mask, but this is bug-to-bug compatible
39 to older i386. */ 39 to older i386. */
40struct device x86_dma_fallback_dev = { 40struct device x86_dma_fallback_dev = {
41 .bus_id = "fallback device", 41 .init_name = "fallback device",
42 .coherent_dma_mask = DMA_32BIT_MASK, 42 .coherent_dma_mask = DMA_32BIT_MASK,
43 .dma_mask = &x86_dma_fallback_dev.coherent_dma_mask, 43 .dma_mask = &x86_dma_fallback_dev.coherent_dma_mask,
44}; 44};
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c
index a35eaa379ff6..00c2bcd41463 100644
--- a/arch/x86/kernel/pci-gart_64.c
+++ b/arch/x86/kernel/pci-gart_64.c
@@ -52,7 +52,7 @@ static u32 *iommu_gatt_base; /* Remapping table */
52 * to trigger bugs with some popular PCI cards, in particular 3ware (but 52 * to trigger bugs with some popular PCI cards, in particular 3ware (but
53 * has been also also seen with Qlogic at least). 53 * has been also also seen with Qlogic at least).
54 */ 54 */
55int iommu_fullflush = 1; 55static int iommu_fullflush = 1;
56 56
57/* Allocation bitmap for the remapping area: */ 57/* Allocation bitmap for the remapping area: */
58static DEFINE_SPINLOCK(iommu_bitmap_lock); 58static DEFINE_SPINLOCK(iommu_bitmap_lock);
diff --git a/arch/x86/kernel/pci-swiotlb_64.c b/arch/x86/kernel/pci-swiotlb_64.c
index 242c3440687f..d59c91747665 100644
--- a/arch/x86/kernel/pci-swiotlb_64.c
+++ b/arch/x86/kernel/pci-swiotlb_64.c
@@ -13,7 +13,7 @@
13 13
14int swiotlb __read_mostly; 14int swiotlb __read_mostly;
15 15
16void *swiotlb_alloc_boot(size_t size, unsigned long nslabs) 16void * __init swiotlb_alloc_boot(size_t size, unsigned long nslabs)
17{ 17{
18 return alloc_bootmem_low_pages(size); 18 return alloc_bootmem_low_pages(size);
19} 19}
@@ -23,7 +23,7 @@ void *swiotlb_alloc(unsigned order, unsigned long nslabs)
23 return (void *)__get_free_pages(GFP_DMA | __GFP_NOWARN, order); 23 return (void *)__get_free_pages(GFP_DMA | __GFP_NOWARN, order);
24} 24}
25 25
26dma_addr_t swiotlb_phys_to_bus(phys_addr_t paddr) 26dma_addr_t swiotlb_phys_to_bus(struct device *hwdev, phys_addr_t paddr)
27{ 27{
28 return paddr; 28 return paddr;
29} 29}
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 3ba155d24884..a546f55c77b4 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -39,11 +39,12 @@
39#include <linux/prctl.h> 39#include <linux/prctl.h>
40#include <linux/dmi.h> 40#include <linux/dmi.h>
41#include <linux/ftrace.h> 41#include <linux/ftrace.h>
42#include <linux/uaccess.h>
43#include <linux/io.h>
44#include <linux/kdebug.h>
42 45
43#include <asm/uaccess.h>
44#include <asm/pgtable.h> 46#include <asm/pgtable.h>
45#include <asm/system.h> 47#include <asm/system.h>
46#include <asm/io.h>
47#include <asm/ldt.h> 48#include <asm/ldt.h>
48#include <asm/processor.h> 49#include <asm/processor.h>
49#include <asm/i387.h> 50#include <asm/i387.h>
@@ -56,10 +57,8 @@
56 57
57#include <asm/tlbflush.h> 58#include <asm/tlbflush.h>
58#include <asm/cpu.h> 59#include <asm/cpu.h>
59#include <asm/kdebug.h>
60#include <asm/idle.h> 60#include <asm/idle.h>
61#include <asm/syscalls.h> 61#include <asm/syscalls.h>
62#include <asm/smp.h>
63#include <asm/ds.h> 62#include <asm/ds.h>
64 63
65asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); 64asmlinkage void ret_from_fork(void) __asm__("ret_from_fork");
@@ -205,7 +204,7 @@ extern void kernel_thread_helper(void);
205/* 204/*
206 * Create a kernel thread 205 * Create a kernel thread
207 */ 206 */
208int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) 207int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
209{ 208{
210 struct pt_regs regs; 209 struct pt_regs regs;
211 210
@@ -266,7 +265,7 @@ void flush_thread(void)
266 tsk->thread.debugreg3 = 0; 265 tsk->thread.debugreg3 = 0;
267 tsk->thread.debugreg6 = 0; 266 tsk->thread.debugreg6 = 0;
268 tsk->thread.debugreg7 = 0; 267 tsk->thread.debugreg7 = 0;
269 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array)); 268 memset(tsk->thread.tls_array, 0, sizeof(tsk->thread.tls_array));
270 clear_tsk_thread_flag(tsk, TIF_DEBUG); 269 clear_tsk_thread_flag(tsk, TIF_DEBUG);
271 /* 270 /*
272 * Forget coprocessor state.. 271 * Forget coprocessor state..
@@ -293,9 +292,9 @@ void prepare_to_copy(struct task_struct *tsk)
293 292
294int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, 293int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
295 unsigned long unused, 294 unsigned long unused,
296 struct task_struct * p, struct pt_regs * regs) 295 struct task_struct *p, struct pt_regs *regs)
297{ 296{
298 struct pt_regs * childregs; 297 struct pt_regs *childregs;
299 struct task_struct *tsk; 298 struct task_struct *tsk;
300 int err; 299 int err;
301 300
@@ -347,7 +346,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
347void 346void
348start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp) 347start_thread(struct pt_regs *regs, unsigned long new_ip, unsigned long new_sp)
349{ 348{
350 __asm__("movl %0, %%gs" :: "r"(0)); 349 __asm__("movl %0, %%gs" : : "r"(0));
351 regs->fs = 0; 350 regs->fs = 0;
352 set_fs(USER_DS); 351 set_fs(USER_DS);
353 regs->ds = __USER_DS; 352 regs->ds = __USER_DS;
@@ -638,7 +637,7 @@ asmlinkage int sys_vfork(struct pt_regs regs)
638asmlinkage int sys_execve(struct pt_regs regs) 637asmlinkage int sys_execve(struct pt_regs regs)
639{ 638{
640 int error; 639 int error;
641 char * filename; 640 char *filename;
642 641
643 filename = getname((char __user *) regs.bx); 642 filename = getname((char __user *) regs.bx);
644 error = PTR_ERR(filename); 643 error = PTR_ERR(filename);
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 61f718df6eec..2b46eb41643b 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -12,6 +12,8 @@
12#include <asm/proto.h> 12#include <asm/proto.h>
13#include <asm/reboot_fixups.h> 13#include <asm/reboot_fixups.h>
14#include <asm/reboot.h> 14#include <asm/reboot.h>
15#include <asm/pci_x86.h>
16#include <asm/virtext.h>
15 17
16#ifdef CONFIG_X86_32 18#ifdef CONFIG_X86_32
17# include <linux/dmi.h> 19# include <linux/dmi.h>
@@ -23,7 +25,6 @@
23 25
24#include <mach_ipi.h> 26#include <mach_ipi.h>
25 27
26
27/* 28/*
28 * Power off function, if any 29 * Power off function, if any
29 */ 30 */
@@ -39,6 +40,12 @@ int reboot_force;
39static int reboot_cpu = -1; 40static int reboot_cpu = -1;
40#endif 41#endif
41 42
43/* This is set if we need to go through the 'emergency' path.
44 * When machine_emergency_restart() is called, we may be on
45 * an inconsistent state and won't be able to do a clean cleanup
46 */
47static int reboot_emergency;
48
42/* This is set by the PCI code if either type 1 or type 2 PCI is detected */ 49/* This is set by the PCI code if either type 1 or type 2 PCI is detected */
43bool port_cf9_safe = false; 50bool port_cf9_safe = false;
44 51
@@ -368,6 +375,48 @@ static inline void kb_wait(void)
368 } 375 }
369} 376}
370 377
378static void vmxoff_nmi(int cpu, struct die_args *args)
379{
380 cpu_emergency_vmxoff();
381}
382
383/* Use NMIs as IPIs to tell all CPUs to disable virtualization
384 */
385static void emergency_vmx_disable_all(void)
386{
387 /* Just make sure we won't change CPUs while doing this */
388 local_irq_disable();
389
390 /* We need to disable VMX on all CPUs before rebooting, otherwise
391 * we risk hanging up the machine, because the CPU ignore INIT
392 * signals when VMX is enabled.
393 *
394 * We can't take any locks and we may be on an inconsistent
395 * state, so we use NMIs as IPIs to tell the other CPUs to disable
396 * VMX and halt.
397 *
398 * For safety, we will avoid running the nmi_shootdown_cpus()
399 * stuff unnecessarily, but we don't have a way to check
400 * if other CPUs have VMX enabled. So we will call it only if the
401 * CPU we are running on has VMX enabled.
402 *
403 * We will miss cases where VMX is not enabled on all CPUs. This
404 * shouldn't do much harm because KVM always enable VMX on all
405 * CPUs anyway. But we can miss it on the small window where KVM
406 * is still enabling VMX.
407 */
408 if (cpu_has_vmx() && cpu_vmx_enabled()) {
409 /* Disable VMX on this CPU.
410 */
411 cpu_vmxoff();
412
413 /* Halt and disable VMX on the other CPUs */
414 nmi_shootdown_cpus(vmxoff_nmi);
415
416 }
417}
418
419
371void __attribute__((weak)) mach_reboot_fixups(void) 420void __attribute__((weak)) mach_reboot_fixups(void)
372{ 421{
373} 422}
@@ -376,6 +425,9 @@ static void native_machine_emergency_restart(void)
376{ 425{
377 int i; 426 int i;
378 427
428 if (reboot_emergency)
429 emergency_vmx_disable_all();
430
379 /* Tell the BIOS if we want cold or warm reboot */ 431 /* Tell the BIOS if we want cold or warm reboot */
380 *((unsigned short *)__va(0x472)) = reboot_mode; 432 *((unsigned short *)__va(0x472)) = reboot_mode;
381 433
@@ -449,7 +501,7 @@ void native_machine_shutdown(void)
449 501
450#ifdef CONFIG_X86_32 502#ifdef CONFIG_X86_32
451 /* See if there has been given a command line override */ 503 /* See if there has been given a command line override */
452 if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) && 504 if ((reboot_cpu != -1) && (reboot_cpu < nr_cpu_ids) &&
453 cpu_online(reboot_cpu)) 505 cpu_online(reboot_cpu))
454 reboot_cpu_id = reboot_cpu; 506 reboot_cpu_id = reboot_cpu;
455#endif 507#endif
@@ -459,7 +511,7 @@ void native_machine_shutdown(void)
459 reboot_cpu_id = smp_processor_id(); 511 reboot_cpu_id = smp_processor_id();
460 512
461 /* Make certain I only run on the appropriate processor */ 513 /* Make certain I only run on the appropriate processor */
462 set_cpus_allowed_ptr(current, &cpumask_of_cpu(reboot_cpu_id)); 514 set_cpus_allowed_ptr(current, cpumask_of(reboot_cpu_id));
463 515
464 /* O.K Now that I'm on the appropriate processor, 516 /* O.K Now that I'm on the appropriate processor,
465 * stop all of the others. 517 * stop all of the others.
@@ -482,13 +534,19 @@ void native_machine_shutdown(void)
482#endif 534#endif
483} 535}
484 536
537static void __machine_emergency_restart(int emergency)
538{
539 reboot_emergency = emergency;
540 machine_ops.emergency_restart();
541}
542
485static void native_machine_restart(char *__unused) 543static void native_machine_restart(char *__unused)
486{ 544{
487 printk("machine restart\n"); 545 printk("machine restart\n");
488 546
489 if (!reboot_force) 547 if (!reboot_force)
490 machine_shutdown(); 548 machine_shutdown();
491 machine_emergency_restart(); 549 __machine_emergency_restart(0);
492} 550}
493 551
494static void native_machine_halt(void) 552static void native_machine_halt(void)
@@ -532,7 +590,7 @@ void machine_shutdown(void)
532 590
533void machine_emergency_restart(void) 591void machine_emergency_restart(void)
534{ 592{
535 machine_ops.emergency_restart(); 593 __machine_emergency_restart(1);
536} 594}
537 595
538void machine_restart(char *cmd) 596void machine_restart(char *cmd)
@@ -592,10 +650,7 @@ static int crash_nmi_callback(struct notifier_block *self,
592 650
593static void smp_send_nmi_allbutself(void) 651static void smp_send_nmi_allbutself(void)
594{ 652{
595 cpumask_t mask = cpu_online_map; 653 send_IPI_allbutself(NMI_VECTOR);
596 cpu_clear(safe_smp_processor_id(), mask);
597 if (!cpus_empty(mask))
598 send_IPI_mask(mask, NMI_VECTOR);
599} 654}
600 655
601static struct notifier_block crash_nmi_nb = { 656static struct notifier_block crash_nmi_nb = {
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index ae0c0d3bb770..55c46074eba0 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -5,12 +5,11 @@
5#include <linux/percpu.h> 5#include <linux/percpu.h>
6#include <linux/kexec.h> 6#include <linux/kexec.h>
7#include <linux/crash_dump.h> 7#include <linux/crash_dump.h>
8#include <asm/smp.h> 8#include <linux/smp.h>
9#include <asm/percpu.h> 9#include <linux/topology.h>
10#include <asm/sections.h> 10#include <asm/sections.h>
11#include <asm/processor.h> 11#include <asm/processor.h>
12#include <asm/setup.h> 12#include <asm/setup.h>
13#include <asm/topology.h>
14#include <asm/mpspec.h> 13#include <asm/mpspec.h>
15#include <asm/apicdef.h> 14#include <asm/apicdef.h>
16#include <asm/highmem.h> 15#include <asm/highmem.h>
@@ -20,8 +19,8 @@ unsigned int num_processors;
20unsigned disabled_cpus __cpuinitdata; 19unsigned disabled_cpus __cpuinitdata;
21/* Processor that is doing the boot up */ 20/* Processor that is doing the boot up */
22unsigned int boot_cpu_physical_apicid = -1U; 21unsigned int boot_cpu_physical_apicid = -1U;
23unsigned int max_physical_apicid;
24EXPORT_SYMBOL(boot_cpu_physical_apicid); 22EXPORT_SYMBOL(boot_cpu_physical_apicid);
23unsigned int max_physical_apicid;
25 24
26/* Bitmask of physically existing CPUs */ 25/* Bitmask of physically existing CPUs */
27physid_mask_t phys_cpu_present_map; 26physid_mask_t phys_cpu_present_map;
@@ -131,7 +130,27 @@ static void __init setup_cpu_pda_map(void)
131 /* point to new pointer table */ 130 /* point to new pointer table */
132 _cpu_pda = new_cpu_pda; 131 _cpu_pda = new_cpu_pda;
133} 132}
134#endif 133
134#endif /* CONFIG_SMP && CONFIG_X86_64 */
135
136#ifdef CONFIG_X86_64
137
138/* correctly size the local cpu masks */
139static void setup_cpu_local_masks(void)
140{
141 alloc_bootmem_cpumask_var(&cpu_initialized_mask);
142 alloc_bootmem_cpumask_var(&cpu_callin_mask);
143 alloc_bootmem_cpumask_var(&cpu_callout_mask);
144 alloc_bootmem_cpumask_var(&cpu_sibling_setup_mask);
145}
146
147#else /* CONFIG_X86_32 */
148
149static inline void setup_cpu_local_masks(void)
150{
151}
152
153#endif /* CONFIG_X86_32 */
135 154
136/* 155/*
137 * Great future plan: 156 * Great future plan:
@@ -152,8 +171,11 @@ void __init setup_per_cpu_areas(void)
152 old_size = PERCPU_ENOUGH_ROOM; 171 old_size = PERCPU_ENOUGH_ROOM;
153 align = max_t(unsigned long, PAGE_SIZE, align); 172 align = max_t(unsigned long, PAGE_SIZE, align);
154 size = roundup(old_size, align); 173 size = roundup(old_size, align);
155 printk(KERN_INFO "PERCPU: Allocating %zd bytes of per cpu data\n", 174
156 size); 175 pr_info("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n",
176 NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids);
177
178 pr_info("PERCPU: Allocating %zd bytes of per cpu data\n", size);
157 179
158 for_each_possible_cpu(cpu) { 180 for_each_possible_cpu(cpu) {
159#ifndef CONFIG_NEED_MULTIPLE_NODES 181#ifndef CONFIG_NEED_MULTIPLE_NODES
@@ -164,33 +186,29 @@ void __init setup_per_cpu_areas(void)
164 if (!node_online(node) || !NODE_DATA(node)) { 186 if (!node_online(node) || !NODE_DATA(node)) {
165 ptr = __alloc_bootmem(size, align, 187 ptr = __alloc_bootmem(size, align,
166 __pa(MAX_DMA_ADDRESS)); 188 __pa(MAX_DMA_ADDRESS));
167 printk(KERN_INFO 189 pr_info("cpu %d has no node %d or node-local memory\n",
168 "cpu %d has no node %d or node-local memory\n",
169 cpu, node); 190 cpu, node);
170 if (ptr) 191 pr_debug("per cpu data for cpu%d at %016lx\n",
171 printk(KERN_DEBUG "per cpu data for cpu%d at %016lx\n", 192 cpu, __pa(ptr));
172 cpu, __pa(ptr)); 193 } else {
173 }
174 else {
175 ptr = __alloc_bootmem_node(NODE_DATA(node), size, align, 194 ptr = __alloc_bootmem_node(NODE_DATA(node), size, align,
176 __pa(MAX_DMA_ADDRESS)); 195 __pa(MAX_DMA_ADDRESS));
177 if (ptr) 196 pr_debug("per cpu data for cpu%d on node%d at %016lx\n",
178 printk(KERN_DEBUG "per cpu data for cpu%d on node%d at %016lx\n", 197 cpu, node, __pa(ptr));
179 cpu, node, __pa(ptr));
180 } 198 }
181#endif 199#endif
182 per_cpu_offset(cpu) = ptr - __per_cpu_start; 200 per_cpu_offset(cpu) = ptr - __per_cpu_start;
183 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); 201 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
184 } 202 }
185 203
186 printk(KERN_DEBUG "NR_CPUS: %d, nr_cpu_ids: %d, nr_node_ids %d\n",
187 NR_CPUS, nr_cpu_ids, nr_node_ids);
188
189 /* Setup percpu data maps */ 204 /* Setup percpu data maps */
190 setup_per_cpu_maps(); 205 setup_per_cpu_maps();
191 206
192 /* Setup node to cpumask map */ 207 /* Setup node to cpumask map */
193 setup_node_to_cpumask_map(); 208 setup_node_to_cpumask_map();
209
210 /* Setup cpu initialized, callin, callout masks */
211 setup_cpu_local_masks();
194} 212}
195 213
196#endif 214#endif
@@ -282,10 +300,10 @@ static void __cpuinit numa_set_cpumask(int cpu, int enable)
282 else 300 else
283 cpu_clear(cpu, *mask); 301 cpu_clear(cpu, *mask);
284 302
285 cpulist_scnprintf(buf, sizeof(buf), *mask); 303 cpulist_scnprintf(buf, sizeof(buf), mask);
286 printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n", 304 printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
287 enable? "numa_add_cpu":"numa_remove_cpu", cpu, node, buf); 305 enable ? "numa_add_cpu" : "numa_remove_cpu", cpu, node, buf);
288 } 306}
289 307
290void __cpuinit numa_add_cpu(int cpu) 308void __cpuinit numa_add_cpu(int cpu)
291{ 309{
@@ -334,25 +352,25 @@ static const cpumask_t cpu_mask_none;
334/* 352/*
335 * Returns a pointer to the bitmask of CPUs on Node 'node'. 353 * Returns a pointer to the bitmask of CPUs on Node 'node'.
336 */ 354 */
337const cpumask_t *_node_to_cpumask_ptr(int node) 355const cpumask_t *cpumask_of_node(int node)
338{ 356{
339 if (node_to_cpumask_map == NULL) { 357 if (node_to_cpumask_map == NULL) {
340 printk(KERN_WARNING 358 printk(KERN_WARNING
341 "_node_to_cpumask_ptr(%d): no node_to_cpumask_map!\n", 359 "cpumask_of_node(%d): no node_to_cpumask_map!\n",
342 node); 360 node);
343 dump_stack(); 361 dump_stack();
344 return (const cpumask_t *)&cpu_online_map; 362 return (const cpumask_t *)&cpu_online_map;
345 } 363 }
346 if (node >= nr_node_ids) { 364 if (node >= nr_node_ids) {
347 printk(KERN_WARNING 365 printk(KERN_WARNING
348 "_node_to_cpumask_ptr(%d): node > nr_node_ids(%d)\n", 366 "cpumask_of_node(%d): node > nr_node_ids(%d)\n",
349 node, nr_node_ids); 367 node, nr_node_ids);
350 dump_stack(); 368 dump_stack();
351 return &cpu_mask_none; 369 return &cpu_mask_none;
352 } 370 }
353 return &node_to_cpumask_map[node]; 371 return &node_to_cpumask_map[node];
354} 372}
355EXPORT_SYMBOL(_node_to_cpumask_ptr); 373EXPORT_SYMBOL(cpumask_of_node);
356 374
357/* 375/*
358 * Returns a bitmask of CPUs on Node 'node'. 376 * Returns a bitmask of CPUs on Node 'node'.
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 7e558db362c1..e6faa3316bd2 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Intel SMP support routines. 2 * Intel SMP support routines.
3 * 3 *
4 * (c) 1995 Alan Cox, Building #3 <alan@redhat.com> 4 * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
5 * (c) 1998-99, 2000 Ingo Molnar <mingo@redhat.com> 5 * (c) 1998-99, 2000 Ingo Molnar <mingo@redhat.com>
6 * (c) 2002,2003 Andi Kleen, SuSE Labs. 6 * (c) 2002,2003 Andi Kleen, SuSE Labs.
7 * 7 *
@@ -118,26 +118,33 @@ static void native_smp_send_reschedule(int cpu)
118 WARN_ON(1); 118 WARN_ON(1);
119 return; 119 return;
120 } 120 }
121 send_IPI_mask(cpumask_of_cpu(cpu), RESCHEDULE_VECTOR); 121 send_IPI_mask(cpumask_of(cpu), RESCHEDULE_VECTOR);
122} 122}
123 123
124void native_send_call_func_single_ipi(int cpu) 124void native_send_call_func_single_ipi(int cpu)
125{ 125{
126 send_IPI_mask(cpumask_of_cpu(cpu), CALL_FUNCTION_SINGLE_VECTOR); 126 send_IPI_mask(cpumask_of(cpu), CALL_FUNCTION_SINGLE_VECTOR);
127} 127}
128 128
129void native_send_call_func_ipi(cpumask_t mask) 129void native_send_call_func_ipi(const struct cpumask *mask)
130{ 130{
131 cpumask_t allbutself; 131 cpumask_var_t allbutself;
132 132
133 allbutself = cpu_online_map; 133 if (!alloc_cpumask_var(&allbutself, GFP_ATOMIC)) {
134 cpu_clear(smp_processor_id(), allbutself); 134 send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
135 return;
136 }
135 137
136 if (cpus_equal(mask, allbutself) && 138 cpumask_copy(allbutself, cpu_online_mask);
137 cpus_equal(cpu_online_map, cpu_callout_map)) 139 cpumask_clear_cpu(smp_processor_id(), allbutself);
140
141 if (cpumask_equal(mask, allbutself) &&
142 cpumask_equal(cpu_online_mask, cpu_callout_mask))
138 send_IPI_allbutself(CALL_FUNCTION_VECTOR); 143 send_IPI_allbutself(CALL_FUNCTION_VECTOR);
139 else 144 else
140 send_IPI_mask(mask, CALL_FUNCTION_VECTOR); 145 send_IPI_mask(mask, CALL_FUNCTION_VECTOR);
146
147 free_cpumask_var(allbutself);
141} 148}
142 149
143/* 150/*
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index f8500c969442..bb1a3b1fc87f 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * x86 SMP booting functions 2 * x86 SMP booting functions
3 * 3 *
4 * (c) 1995 Alan Cox, Building #3 <alan@redhat.com> 4 * (c) 1995 Alan Cox, Building #3 <alan@lxorguk.ukuu.org.uk>
5 * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com> 5 * (c) 1998, 1999, 2000 Ingo Molnar <mingo@redhat.com>
6 * Copyright 2001 Andi Kleen, SuSE Labs. 6 * Copyright 2001 Andi Kleen, SuSE Labs.
7 * 7 *
@@ -102,15 +102,6 @@ EXPORT_SYMBOL(smp_num_siblings);
102/* Last level cache ID of each logical CPU */ 102/* Last level cache ID of each logical CPU */
103DEFINE_PER_CPU(u16, cpu_llc_id) = BAD_APICID; 103DEFINE_PER_CPU(u16, cpu_llc_id) = BAD_APICID;
104 104
105/* bitmap of online cpus */
106cpumask_t cpu_online_map __read_mostly;
107EXPORT_SYMBOL(cpu_online_map);
108
109cpumask_t cpu_callin_map;
110cpumask_t cpu_callout_map;
111cpumask_t cpu_possible_map;
112EXPORT_SYMBOL(cpu_possible_map);
113
114/* representing HT siblings of each logical CPU */ 105/* representing HT siblings of each logical CPU */
115DEFINE_PER_CPU(cpumask_t, cpu_sibling_map); 106DEFINE_PER_CPU(cpumask_t, cpu_sibling_map);
116EXPORT_PER_CPU_SYMBOL(cpu_sibling_map); 107EXPORT_PER_CPU_SYMBOL(cpu_sibling_map);
@@ -126,9 +117,6 @@ EXPORT_PER_CPU_SYMBOL(cpu_info);
126static atomic_t init_deasserted; 117static atomic_t init_deasserted;
127 118
128 119
129/* representing cpus for which sibling maps can be computed */
130static cpumask_t cpu_sibling_setup_map;
131
132/* Set if we find a B stepping CPU */ 120/* Set if we find a B stepping CPU */
133static int __cpuinitdata smp_b_stepping; 121static int __cpuinitdata smp_b_stepping;
134 122
@@ -146,7 +134,7 @@ EXPORT_SYMBOL(cpu_to_node_map);
146static void map_cpu_to_node(int cpu, int node) 134static void map_cpu_to_node(int cpu, int node)
147{ 135{
148 printk(KERN_INFO "Mapping cpu %d to node %d\n", cpu, node); 136 printk(KERN_INFO "Mapping cpu %d to node %d\n", cpu, node);
149 cpu_set(cpu, node_to_cpumask_map[node]); 137 cpumask_set_cpu(cpu, &node_to_cpumask_map[node]);
150 cpu_to_node_map[cpu] = node; 138 cpu_to_node_map[cpu] = node;
151} 139}
152 140
@@ -157,7 +145,7 @@ static void unmap_cpu_to_node(int cpu)
157 145
158 printk(KERN_INFO "Unmapping cpu %d from all nodes\n", cpu); 146 printk(KERN_INFO "Unmapping cpu %d from all nodes\n", cpu);
159 for (node = 0; node < MAX_NUMNODES; node++) 147 for (node = 0; node < MAX_NUMNODES; node++)
160 cpu_clear(cpu, node_to_cpumask_map[node]); 148 cpumask_clear_cpu(cpu, &node_to_cpumask_map[node]);
161 cpu_to_node_map[cpu] = 0; 149 cpu_to_node_map[cpu] = 0;
162} 150}
163#else /* !(CONFIG_NUMA && CONFIG_X86_32) */ 151#else /* !(CONFIG_NUMA && CONFIG_X86_32) */
@@ -215,7 +203,7 @@ static void __cpuinit smp_callin(void)
215 */ 203 */
216 phys_id = read_apic_id(); 204 phys_id = read_apic_id();
217 cpuid = smp_processor_id(); 205 cpuid = smp_processor_id();
218 if (cpu_isset(cpuid, cpu_callin_map)) { 206 if (cpumask_test_cpu(cpuid, cpu_callin_mask)) {
219 panic("%s: phys CPU#%d, CPU#%d already present??\n", __func__, 207 panic("%s: phys CPU#%d, CPU#%d already present??\n", __func__,
220 phys_id, cpuid); 208 phys_id, cpuid);
221 } 209 }
@@ -237,7 +225,7 @@ static void __cpuinit smp_callin(void)
237 /* 225 /*
238 * Has the boot CPU finished it's STARTUP sequence? 226 * Has the boot CPU finished it's STARTUP sequence?
239 */ 227 */
240 if (cpu_isset(cpuid, cpu_callout_map)) 228 if (cpumask_test_cpu(cpuid, cpu_callout_mask))
241 break; 229 break;
242 cpu_relax(); 230 cpu_relax();
243 } 231 }
@@ -280,7 +268,7 @@ static void __cpuinit smp_callin(void)
280 /* 268 /*
281 * Allow the master to continue. 269 * Allow the master to continue.
282 */ 270 */
283 cpu_set(cpuid, cpu_callin_map); 271 cpumask_set_cpu(cpuid, cpu_callin_mask);
284} 272}
285 273
286static int __cpuinitdata unsafe_smp; 274static int __cpuinitdata unsafe_smp;
@@ -338,7 +326,7 @@ notrace static void __cpuinit start_secondary(void *unused)
338 ipi_call_lock(); 326 ipi_call_lock();
339 lock_vector_lock(); 327 lock_vector_lock();
340 __setup_vector_irq(smp_processor_id()); 328 __setup_vector_irq(smp_processor_id());
341 cpu_set(smp_processor_id(), cpu_online_map); 329 set_cpu_online(smp_processor_id(), true);
342 unlock_vector_lock(); 330 unlock_vector_lock();
343 ipi_call_unlock(); 331 ipi_call_unlock();
344 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE; 332 per_cpu(cpu_state, smp_processor_id()) = CPU_ONLINE;
@@ -444,50 +432,52 @@ void __cpuinit set_cpu_sibling_map(int cpu)
444 int i; 432 int i;
445 struct cpuinfo_x86 *c = &cpu_data(cpu); 433 struct cpuinfo_x86 *c = &cpu_data(cpu);
446 434
447 cpu_set(cpu, cpu_sibling_setup_map); 435 cpumask_set_cpu(cpu, cpu_sibling_setup_mask);
448 436
449 if (smp_num_siblings > 1) { 437 if (smp_num_siblings > 1) {
450 for_each_cpu_mask_nr(i, cpu_sibling_setup_map) { 438 for_each_cpu(i, cpu_sibling_setup_mask) {
451 if (c->phys_proc_id == cpu_data(i).phys_proc_id && 439 struct cpuinfo_x86 *o = &cpu_data(i);
452 c->cpu_core_id == cpu_data(i).cpu_core_id) { 440
453 cpu_set(i, per_cpu(cpu_sibling_map, cpu)); 441 if (c->phys_proc_id == o->phys_proc_id &&
454 cpu_set(cpu, per_cpu(cpu_sibling_map, i)); 442 c->cpu_core_id == o->cpu_core_id) {
455 cpu_set(i, per_cpu(cpu_core_map, cpu)); 443 cpumask_set_cpu(i, cpu_sibling_mask(cpu));
456 cpu_set(cpu, per_cpu(cpu_core_map, i)); 444 cpumask_set_cpu(cpu, cpu_sibling_mask(i));
457 cpu_set(i, c->llc_shared_map); 445 cpumask_set_cpu(i, cpu_core_mask(cpu));
458 cpu_set(cpu, cpu_data(i).llc_shared_map); 446 cpumask_set_cpu(cpu, cpu_core_mask(i));
447 cpumask_set_cpu(i, &c->llc_shared_map);
448 cpumask_set_cpu(cpu, &o->llc_shared_map);
459 } 449 }
460 } 450 }
461 } else { 451 } else {
462 cpu_set(cpu, per_cpu(cpu_sibling_map, cpu)); 452 cpumask_set_cpu(cpu, cpu_sibling_mask(cpu));
463 } 453 }
464 454
465 cpu_set(cpu, c->llc_shared_map); 455 cpumask_set_cpu(cpu, &c->llc_shared_map);
466 456
467 if (current_cpu_data.x86_max_cores == 1) { 457 if (current_cpu_data.x86_max_cores == 1) {
468 per_cpu(cpu_core_map, cpu) = per_cpu(cpu_sibling_map, cpu); 458 cpumask_copy(cpu_core_mask(cpu), cpu_sibling_mask(cpu));
469 c->booted_cores = 1; 459 c->booted_cores = 1;
470 return; 460 return;
471 } 461 }
472 462
473 for_each_cpu_mask_nr(i, cpu_sibling_setup_map) { 463 for_each_cpu(i, cpu_sibling_setup_mask) {
474 if (per_cpu(cpu_llc_id, cpu) != BAD_APICID && 464 if (per_cpu(cpu_llc_id, cpu) != BAD_APICID &&
475 per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) { 465 per_cpu(cpu_llc_id, cpu) == per_cpu(cpu_llc_id, i)) {
476 cpu_set(i, c->llc_shared_map); 466 cpumask_set_cpu(i, &c->llc_shared_map);
477 cpu_set(cpu, cpu_data(i).llc_shared_map); 467 cpumask_set_cpu(cpu, &cpu_data(i).llc_shared_map);
478 } 468 }
479 if (c->phys_proc_id == cpu_data(i).phys_proc_id) { 469 if (c->phys_proc_id == cpu_data(i).phys_proc_id) {
480 cpu_set(i, per_cpu(cpu_core_map, cpu)); 470 cpumask_set_cpu(i, cpu_core_mask(cpu));
481 cpu_set(cpu, per_cpu(cpu_core_map, i)); 471 cpumask_set_cpu(cpu, cpu_core_mask(i));
482 /* 472 /*
483 * Does this new cpu bringup a new core? 473 * Does this new cpu bringup a new core?
484 */ 474 */
485 if (cpus_weight(per_cpu(cpu_sibling_map, cpu)) == 1) { 475 if (cpumask_weight(cpu_sibling_mask(cpu)) == 1) {
486 /* 476 /*
487 * for each core in package, increment 477 * for each core in package, increment
488 * the booted_cores for this new cpu 478 * the booted_cores for this new cpu
489 */ 479 */
490 if (first_cpu(per_cpu(cpu_sibling_map, i)) == i) 480 if (cpumask_first(cpu_sibling_mask(i)) == i)
491 c->booted_cores++; 481 c->booted_cores++;
492 /* 482 /*
493 * increment the core count for all 483 * increment the core count for all
@@ -502,7 +492,7 @@ void __cpuinit set_cpu_sibling_map(int cpu)
502} 492}
503 493
504/* maps the cpu to the sched domain representing multi-core */ 494/* maps the cpu to the sched domain representing multi-core */
505cpumask_t cpu_coregroup_map(int cpu) 495const struct cpumask *cpu_coregroup_mask(int cpu)
506{ 496{
507 struct cpuinfo_x86 *c = &cpu_data(cpu); 497 struct cpuinfo_x86 *c = &cpu_data(cpu);
508 /* 498 /*
@@ -510,9 +500,14 @@ cpumask_t cpu_coregroup_map(int cpu)
510 * And for power savings, we return cpu_core_map 500 * And for power savings, we return cpu_core_map
511 */ 501 */
512 if (sched_mc_power_savings || sched_smt_power_savings) 502 if (sched_mc_power_savings || sched_smt_power_savings)
513 return per_cpu(cpu_core_map, cpu); 503 return cpu_core_mask(cpu);
514 else 504 else
515 return c->llc_shared_map; 505 return &c->llc_shared_map;
506}
507
508cpumask_t cpu_coregroup_map(int cpu)
509{
510 return *cpu_coregroup_mask(cpu);
516} 511}
517 512
518static void impress_friends(void) 513static void impress_friends(void)
@@ -524,7 +519,7 @@ static void impress_friends(void)
524 */ 519 */
525 pr_debug("Before bogomips.\n"); 520 pr_debug("Before bogomips.\n");
526 for_each_possible_cpu(cpu) 521 for_each_possible_cpu(cpu)
527 if (cpu_isset(cpu, cpu_callout_map)) 522 if (cpumask_test_cpu(cpu, cpu_callout_mask))
528 bogosum += cpu_data(cpu).loops_per_jiffy; 523 bogosum += cpu_data(cpu).loops_per_jiffy;
529 printk(KERN_INFO 524 printk(KERN_INFO
530 "Total of %d processors activated (%lu.%02lu BogoMIPS).\n", 525 "Total of %d processors activated (%lu.%02lu BogoMIPS).\n",
@@ -905,19 +900,19 @@ do_rest:
905 * allow APs to start initializing. 900 * allow APs to start initializing.
906 */ 901 */
907 pr_debug("Before Callout %d.\n", cpu); 902 pr_debug("Before Callout %d.\n", cpu);
908 cpu_set(cpu, cpu_callout_map); 903 cpumask_set_cpu(cpu, cpu_callout_mask);
909 pr_debug("After Callout %d.\n", cpu); 904 pr_debug("After Callout %d.\n", cpu);
910 905
911 /* 906 /*
912 * Wait 5s total for a response 907 * Wait 5s total for a response
913 */ 908 */
914 for (timeout = 0; timeout < 50000; timeout++) { 909 for (timeout = 0; timeout < 50000; timeout++) {
915 if (cpu_isset(cpu, cpu_callin_map)) 910 if (cpumask_test_cpu(cpu, cpu_callin_mask))
916 break; /* It has booted */ 911 break; /* It has booted */
917 udelay(100); 912 udelay(100);
918 } 913 }
919 914
920 if (cpu_isset(cpu, cpu_callin_map)) { 915 if (cpumask_test_cpu(cpu, cpu_callin_mask)) {
921 /* number CPUs logically, starting from 1 (BSP is 0) */ 916 /* number CPUs logically, starting from 1 (BSP is 0) */
922 pr_debug("OK.\n"); 917 pr_debug("OK.\n");
923 printk(KERN_INFO "CPU%d: ", cpu); 918 printk(KERN_INFO "CPU%d: ", cpu);
@@ -942,9 +937,14 @@ restore_state:
942 if (boot_error) { 937 if (boot_error) {
943 /* Try to put things back the way they were before ... */ 938 /* Try to put things back the way they were before ... */
944 numa_remove_cpu(cpu); /* was set by numa_add_cpu */ 939 numa_remove_cpu(cpu); /* was set by numa_add_cpu */
945 cpu_clear(cpu, cpu_callout_map); /* was set by do_boot_cpu() */ 940
946 cpu_clear(cpu, cpu_initialized); /* was set by cpu_init() */ 941 /* was set by do_boot_cpu() */
947 cpu_clear(cpu, cpu_present_map); 942 cpumask_clear_cpu(cpu, cpu_callout_mask);
943
944 /* was set by cpu_init() */
945 cpumask_clear_cpu(cpu, cpu_initialized_mask);
946
947 set_cpu_present(cpu, false);
948 per_cpu(x86_cpu_to_apicid, cpu) = BAD_APICID; 948 per_cpu(x86_cpu_to_apicid, cpu) = BAD_APICID;
949 } 949 }
950 950
@@ -978,7 +978,7 @@ int __cpuinit native_cpu_up(unsigned int cpu)
978 /* 978 /*
979 * Already booted CPU? 979 * Already booted CPU?
980 */ 980 */
981 if (cpu_isset(cpu, cpu_callin_map)) { 981 if (cpumask_test_cpu(cpu, cpu_callin_mask)) {
982 pr_debug("do_boot_cpu %d Already started\n", cpu); 982 pr_debug("do_boot_cpu %d Already started\n", cpu);
983 return -ENOSYS; 983 return -ENOSYS;
984 } 984 }
@@ -1033,8 +1033,9 @@ int __cpuinit native_cpu_up(unsigned int cpu)
1033 */ 1033 */
1034static __init void disable_smp(void) 1034static __init void disable_smp(void)
1035{ 1035{
1036 cpu_present_map = cpumask_of_cpu(0); 1036 /* use the read/write pointers to the present and possible maps */
1037 cpu_possible_map = cpumask_of_cpu(0); 1037 cpumask_copy(&cpu_present_map, cpumask_of(0));
1038 cpumask_copy(&cpu_possible_map, cpumask_of(0));
1038 smpboot_clear_io_apic_irqs(); 1039 smpboot_clear_io_apic_irqs();
1039 1040
1040 if (smp_found_config) 1041 if (smp_found_config)
@@ -1042,8 +1043,8 @@ static __init void disable_smp(void)
1042 else 1043 else
1043 physid_set_mask_of_physid(0, &phys_cpu_present_map); 1044 physid_set_mask_of_physid(0, &phys_cpu_present_map);
1044 map_cpu_to_logical_apicid(); 1045 map_cpu_to_logical_apicid();
1045 cpu_set(0, per_cpu(cpu_sibling_map, 0)); 1046 cpumask_set_cpu(0, cpu_sibling_mask(0));
1046 cpu_set(0, per_cpu(cpu_core_map, 0)); 1047 cpumask_set_cpu(0, cpu_core_mask(0));
1047} 1048}
1048 1049
1049/* 1050/*
@@ -1065,14 +1066,14 @@ static int __init smp_sanity_check(unsigned max_cpus)
1065 nr = 0; 1066 nr = 0;
1066 for_each_present_cpu(cpu) { 1067 for_each_present_cpu(cpu) {
1067 if (nr >= 8) 1068 if (nr >= 8)
1068 cpu_clear(cpu, cpu_present_map); 1069 set_cpu_present(cpu, false);
1069 nr++; 1070 nr++;
1070 } 1071 }
1071 1072
1072 nr = 0; 1073 nr = 0;
1073 for_each_possible_cpu(cpu) { 1074 for_each_possible_cpu(cpu) {
1074 if (nr >= 8) 1075 if (nr >= 8)
1075 cpu_clear(cpu, cpu_possible_map); 1076 set_cpu_possible(cpu, false);
1076 nr++; 1077 nr++;
1077 } 1078 }
1078 1079
@@ -1155,7 +1156,7 @@ static void __init smp_cpu_index_default(void)
1155 for_each_possible_cpu(i) { 1156 for_each_possible_cpu(i) {
1156 c = &cpu_data(i); 1157 c = &cpu_data(i);
1157 /* mark all to hotplug */ 1158 /* mark all to hotplug */
1158 c->cpu_index = NR_CPUS; 1159 c->cpu_index = nr_cpu_ids;
1159 } 1160 }
1160} 1161}
1161 1162
@@ -1168,7 +1169,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1168 preempt_disable(); 1169 preempt_disable();
1169 smp_cpu_index_default(); 1170 smp_cpu_index_default();
1170 current_cpu_data = boot_cpu_data; 1171 current_cpu_data = boot_cpu_data;
1171 cpu_callin_map = cpumask_of_cpu(0); 1172 cpumask_copy(cpu_callin_mask, cpumask_of(0));
1172 mb(); 1173 mb();
1173 /* 1174 /*
1174 * Setup boot CPU information 1175 * Setup boot CPU information
@@ -1243,8 +1244,8 @@ void __init native_smp_prepare_boot_cpu(void)
1243 init_gdt(me); 1244 init_gdt(me);
1244#endif 1245#endif
1245 switch_to_new_gdt(); 1246 switch_to_new_gdt();
1246 /* already set me in cpu_online_map in boot_cpu_init() */ 1247 /* already set me in cpu_online_mask in boot_cpu_init() */
1247 cpu_set(me, cpu_callout_map); 1248 cpumask_set_cpu(me, cpu_callout_mask);
1248 per_cpu(cpu_state, me) = CPU_ONLINE; 1249 per_cpu(cpu_state, me) = CPU_ONLINE;
1249} 1250}
1250 1251
@@ -1260,6 +1261,15 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1260 check_nmi_watchdog(); 1261 check_nmi_watchdog();
1261} 1262}
1262 1263
1264static int __initdata setup_possible_cpus = -1;
1265static int __init _setup_possible_cpus(char *str)
1266{
1267 get_option(&str, &setup_possible_cpus);
1268 return 0;
1269}
1270early_param("possible_cpus", _setup_possible_cpus);
1271
1272
1263/* 1273/*
1264 * cpu_possible_map should be static, it cannot change as cpu's 1274 * cpu_possible_map should be static, it cannot change as cpu's
1265 * are onlined, or offlined. The reason is per-cpu data-structures 1275 * are onlined, or offlined. The reason is per-cpu data-structures
@@ -1272,7 +1282,7 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1272 * 1282 *
1273 * Three ways to find out the number of additional hotplug CPUs: 1283 * Three ways to find out the number of additional hotplug CPUs:
1274 * - If the BIOS specified disabled CPUs in ACPI/mptables use that. 1284 * - If the BIOS specified disabled CPUs in ACPI/mptables use that.
1275 * - The user can overwrite it with additional_cpus=NUM 1285 * - The user can overwrite it with possible_cpus=NUM
1276 * - Otherwise don't reserve additional CPUs. 1286 * - Otherwise don't reserve additional CPUs.
1277 * We do this because additional CPUs waste a lot of memory. 1287 * We do this because additional CPUs waste a lot of memory.
1278 * -AK 1288 * -AK
@@ -1285,15 +1295,25 @@ __init void prefill_possible_map(void)
1285 if (!num_processors) 1295 if (!num_processors)
1286 num_processors = 1; 1296 num_processors = 1;
1287 1297
1288 possible = num_processors + disabled_cpus; 1298 if (setup_possible_cpus == -1)
1289 if (possible > NR_CPUS) 1299 possible = num_processors + disabled_cpus;
1290 possible = NR_CPUS; 1300 else
1301 possible = setup_possible_cpus;
1302
1303 total_cpus = max_t(int, possible, num_processors + disabled_cpus);
1304
1305 if (possible > CONFIG_NR_CPUS) {
1306 printk(KERN_WARNING
1307 "%d Processors exceeds NR_CPUS limit of %d\n",
1308 possible, CONFIG_NR_CPUS);
1309 possible = CONFIG_NR_CPUS;
1310 }
1291 1311
1292 printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", 1312 printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
1293 possible, max_t(int, possible - num_processors, 0)); 1313 possible, max_t(int, possible - num_processors, 0));
1294 1314
1295 for (i = 0; i < possible; i++) 1315 for (i = 0; i < possible; i++)
1296 cpu_set(i, cpu_possible_map); 1316 set_cpu_possible(i, true);
1297 1317
1298 nr_cpu_ids = possible; 1318 nr_cpu_ids = possible;
1299} 1319}
@@ -1305,31 +1325,31 @@ static void remove_siblinginfo(int cpu)
1305 int sibling; 1325 int sibling;
1306 struct cpuinfo_x86 *c = &cpu_data(cpu); 1326 struct cpuinfo_x86 *c = &cpu_data(cpu);
1307 1327
1308 for_each_cpu_mask_nr(sibling, per_cpu(cpu_core_map, cpu)) { 1328 for_each_cpu(sibling, cpu_core_mask(cpu)) {
1309 cpu_clear(cpu, per_cpu(cpu_core_map, sibling)); 1329 cpumask_clear_cpu(cpu, cpu_core_mask(sibling));
1310 /*/ 1330 /*/
1311 * last thread sibling in this cpu core going down 1331 * last thread sibling in this cpu core going down
1312 */ 1332 */
1313 if (cpus_weight(per_cpu(cpu_sibling_map, cpu)) == 1) 1333 if (cpumask_weight(cpu_sibling_mask(cpu)) == 1)
1314 cpu_data(sibling).booted_cores--; 1334 cpu_data(sibling).booted_cores--;
1315 } 1335 }
1316 1336
1317 for_each_cpu_mask_nr(sibling, per_cpu(cpu_sibling_map, cpu)) 1337 for_each_cpu(sibling, cpu_sibling_mask(cpu))
1318 cpu_clear(cpu, per_cpu(cpu_sibling_map, sibling)); 1338 cpumask_clear_cpu(cpu, cpu_sibling_mask(sibling));
1319 cpus_clear(per_cpu(cpu_sibling_map, cpu)); 1339 cpumask_clear(cpu_sibling_mask(cpu));
1320 cpus_clear(per_cpu(cpu_core_map, cpu)); 1340 cpumask_clear(cpu_core_mask(cpu));
1321 c->phys_proc_id = 0; 1341 c->phys_proc_id = 0;
1322 c->cpu_core_id = 0; 1342 c->cpu_core_id = 0;
1323 cpu_clear(cpu, cpu_sibling_setup_map); 1343 cpumask_clear_cpu(cpu, cpu_sibling_setup_mask);
1324} 1344}
1325 1345
1326static void __ref remove_cpu_from_maps(int cpu) 1346static void __ref remove_cpu_from_maps(int cpu)
1327{ 1347{
1328 cpu_clear(cpu, cpu_online_map); 1348 set_cpu_online(cpu, false);
1329 cpu_clear(cpu, cpu_callout_map); 1349 cpumask_clear_cpu(cpu, cpu_callout_mask);
1330 cpu_clear(cpu, cpu_callin_map); 1350 cpumask_clear_cpu(cpu, cpu_callin_mask);
1331 /* was set by cpu_init() */ 1351 /* was set by cpu_init() */
1332 cpu_clear(cpu, cpu_initialized); 1352 cpumask_clear_cpu(cpu, cpu_initialized_mask);
1333 numa_remove_cpu(cpu); 1353 numa_remove_cpu(cpu);
1334} 1354}
1335 1355
@@ -1352,7 +1372,7 @@ void cpu_disable_common(void)
1352 lock_vector_lock(); 1372 lock_vector_lock();
1353 remove_cpu_from_maps(cpu); 1373 remove_cpu_from_maps(cpu);
1354 unlock_vector_lock(); 1374 unlock_vector_lock();
1355 fixup_irqs(cpu_online_map); 1375 fixup_irqs();
1356} 1376}
1357 1377
1358int native_cpu_disable(void) 1378int native_cpu_disable(void)
diff --git a/arch/x86/kernel/time_32.c b/arch/x86/kernel/time_32.c
index 65309e4cb1c0..3985cac0ed47 100644
--- a/arch/x86/kernel/time_32.c
+++ b/arch/x86/kernel/time_32.c
@@ -105,8 +105,8 @@ irqreturn_t timer_interrupt(int irq, void *dev_id)
105 high bit of the PPI port B (0x61). Note that some PS/2s, 105 high bit of the PPI port B (0x61). Note that some PS/2s,
106 notably the 55SX, work fine if this is removed. */ 106 notably the 55SX, work fine if this is removed. */
107 107
108 u8 irq_v = inb_p( 0x61 ); /* read the current state */ 108 u8 irq_v = inb_p(0x61); /* read the current state */
109 outb_p( irq_v|0x80, 0x61 ); /* reset the IRQ */ 109 outb_p(irq_v | 0x80, 0x61); /* reset the IRQ */
110 } 110 }
111#endif 111#endif
112 112
diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c
index 891e7a7c4334..e6e695acd725 100644
--- a/arch/x86/kernel/time_64.c
+++ b/arch/x86/kernel/time_64.c
@@ -17,10 +17,10 @@
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/time.h> 18#include <linux/time.h>
19#include <linux/mca.h> 19#include <linux/mca.h>
20#include <linux/nmi.h>
20 21
21#include <asm/i8253.h> 22#include <asm/i8253.h>
22#include <asm/hpet.h> 23#include <asm/hpet.h>
23#include <asm/nmi.h>
24#include <asm/vgtod.h> 24#include <asm/vgtod.h>
25#include <asm/time.h> 25#include <asm/time.h>
26#include <asm/timer.h> 26#include <asm/timer.h>
diff --git a/arch/x86/kernel/tlb_32.c b/arch/x86/kernel/tlb_32.c
index 8da059f949be..ce5054642247 100644
--- a/arch/x86/kernel/tlb_32.c
+++ b/arch/x86/kernel/tlb_32.c
@@ -163,7 +163,7 @@ void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
163 * We have to send the IPI only to 163 * We have to send the IPI only to
164 * CPUs affected. 164 * CPUs affected.
165 */ 165 */
166 send_IPI_mask(cpumask, INVALIDATE_TLB_VECTOR); 166 send_IPI_mask(&cpumask, INVALIDATE_TLB_VECTOR);
167 167
168 while (!cpus_empty(flush_cpumask)) 168 while (!cpus_empty(flush_cpumask))
169 /* nothing. lockup detection does not belong here */ 169 /* nothing. lockup detection does not belong here */
diff --git a/arch/x86/kernel/tlb_64.c b/arch/x86/kernel/tlb_64.c
index 29887d7081a9..f8be6f1d2e48 100644
--- a/arch/x86/kernel/tlb_64.c
+++ b/arch/x86/kernel/tlb_64.c
@@ -191,7 +191,7 @@ void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm,
191 * We have to send the IPI only to 191 * We have to send the IPI only to
192 * CPUs affected. 192 * CPUs affected.
193 */ 193 */
194 send_IPI_mask(cpumask, INVALIDATE_TLB_VECTOR_START + sender); 194 send_IPI_mask(&cpumask, INVALIDATE_TLB_VECTOR_START + sender);
195 195
196 while (!cpus_empty(f->flush_cpumask)) 196 while (!cpus_empty(f->flush_cpumask))
197 cpu_relax(); 197 cpu_relax();
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c
index 6a00e5faaa74..f885023167e0 100644
--- a/arch/x86/kernel/tlb_uv.c
+++ b/arch/x86/kernel/tlb_uv.c
@@ -582,7 +582,6 @@ static int __init uv_ptc_init(void)
582static struct bau_control * __init uv_table_bases_init(int blade, int node) 582static struct bau_control * __init uv_table_bases_init(int blade, int node)
583{ 583{
584 int i; 584 int i;
585 int *ip;
586 struct bau_msg_status *msp; 585 struct bau_msg_status *msp;
587 struct bau_control *bau_tabp; 586 struct bau_control *bau_tabp;
588 587
@@ -599,13 +598,6 @@ static struct bau_control * __init uv_table_bases_init(int blade, int node)
599 bau_cpubits_clear(&msp->seen_by, (int) 598 bau_cpubits_clear(&msp->seen_by, (int)
600 uv_blade_nr_possible_cpus(blade)); 599 uv_blade_nr_possible_cpus(blade));
601 600
602 bau_tabp->watching =
603 kmalloc_node(sizeof(int) * DEST_NUM_RESOURCES, GFP_KERNEL, node);
604 BUG_ON(!bau_tabp->watching);
605
606 for (i = 0, ip = bau_tabp->watching; i < DEST_Q_SIZE; i++, ip++)
607 *ip = 0;
608
609 uv_bau_table_bases[blade] = bau_tabp; 601 uv_bau_table_bases[blade] = bau_tabp;
610 602
611 return bau_tabp; 603 return bau_tabp;
@@ -628,7 +620,6 @@ uv_table_bases_finish(int blade, int node, int cur_cpu,
628 bcp->bau_msg_head = bau_tablesp->va_queue_first; 620 bcp->bau_msg_head = bau_tablesp->va_queue_first;
629 bcp->va_queue_first = bau_tablesp->va_queue_first; 621 bcp->va_queue_first = bau_tablesp->va_queue_first;
630 bcp->va_queue_last = bau_tablesp->va_queue_last; 622 bcp->va_queue_last = bau_tablesp->va_queue_last;
631 bcp->watching = bau_tablesp->watching;
632 bcp->msg_statuses = bau_tablesp->msg_statuses; 623 bcp->msg_statuses = bau_tablesp->msg_statuses;
633 bcp->descriptor_base = adp; 624 bcp->descriptor_base = adp;
634 } 625 }
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 141907ab6e22..98c2d055284b 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -20,7 +20,6 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/ptrace.h> 21#include <linux/ptrace.h>
22#include <linux/string.h> 22#include <linux/string.h>
23#include <linux/unwind.h>
24#include <linux/delay.h> 23#include <linux/delay.h>
25#include <linux/errno.h> 24#include <linux/errno.h>
26#include <linux/kexec.h> 25#include <linux/kexec.h>
@@ -51,7 +50,6 @@
51#include <asm/debugreg.h> 50#include <asm/debugreg.h>
52#include <asm/atomic.h> 51#include <asm/atomic.h>
53#include <asm/system.h> 52#include <asm/system.h>
54#include <asm/unwind.h>
55#include <asm/traps.h> 53#include <asm/traps.h>
56#include <asm/desc.h> 54#include <asm/desc.h>
57#include <asm/i387.h> 55#include <asm/i387.h>
@@ -65,16 +63,10 @@
65#else 63#else
66#include <asm/processor-flags.h> 64#include <asm/processor-flags.h>
67#include <asm/arch_hooks.h> 65#include <asm/arch_hooks.h>
68#include <asm/nmi.h>
69#include <asm/smp.h>
70#include <asm/io.h>
71#include <asm/traps.h> 66#include <asm/traps.h>
72 67
73#include "cpu/mcheck/mce.h" 68#include "cpu/mcheck/mce.h"
74 69
75DECLARE_BITMAP(used_vectors, NR_VECTORS);
76EXPORT_SYMBOL_GPL(used_vectors);
77
78asmlinkage int system_call(void); 70asmlinkage int system_call(void);
79 71
80/* Do we ignore FPU interrupts ? */ 72/* Do we ignore FPU interrupts ? */
@@ -89,6 +81,9 @@ gate_desc idt_table[256]
89 __attribute__((__section__(".data.idt"))) = { { { { 0, 0 } } }, }; 81 __attribute__((__section__(".data.idt"))) = { { { { 0, 0 } } }, };
90#endif 82#endif
91 83
84DECLARE_BITMAP(used_vectors, NR_VECTORS);
85EXPORT_SYMBOL_GPL(used_vectors);
86
92static int ignore_nmis; 87static int ignore_nmis;
93 88
94static inline void conditional_sti(struct pt_regs *regs) 89static inline void conditional_sti(struct pt_regs *regs)
@@ -292,8 +287,10 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
292 tsk->thread.error_code = error_code; 287 tsk->thread.error_code = error_code;
293 tsk->thread.trap_no = 8; 288 tsk->thread.trap_no = 8;
294 289
295 /* This is always a kernel trap and never fixable (and thus must 290 /*
296 never return). */ 291 * This is always a kernel trap and never fixable (and thus must
292 * never return).
293 */
297 for (;;) 294 for (;;)
298 die(str, regs, error_code); 295 die(str, regs, error_code);
299} 296}
@@ -520,9 +517,11 @@ dotraplinkage void __kprobes do_int3(struct pt_regs *regs, long error_code)
520} 517}
521 518
522#ifdef CONFIG_X86_64 519#ifdef CONFIG_X86_64
523/* Help handler running on IST stack to switch back to user stack 520/*
524 for scheduling or signal handling. The actual stack switch is done in 521 * Help handler running on IST stack to switch back to user stack
525 entry.S */ 522 * for scheduling or signal handling. The actual stack switch is done in
523 * entry.S
524 */
526asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs) 525asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
527{ 526{
528 struct pt_regs *regs = eregs; 527 struct pt_regs *regs = eregs;
@@ -532,8 +531,10 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
532 /* Exception from user space */ 531 /* Exception from user space */
533 else if (user_mode(eregs)) 532 else if (user_mode(eregs))
534 regs = task_pt_regs(current); 533 regs = task_pt_regs(current);
535 /* Exception from kernel and interrupts are enabled. Move to 534 /*
536 kernel process stack. */ 535 * Exception from kernel and interrupts are enabled. Move to
536 * kernel process stack.
537 */
537 else if (eregs->flags & X86_EFLAGS_IF) 538 else if (eregs->flags & X86_EFLAGS_IF)
538 regs = (struct pt_regs *)(eregs->sp -= sizeof(struct pt_regs)); 539 regs = (struct pt_regs *)(eregs->sp -= sizeof(struct pt_regs));
539 if (eregs != regs) 540 if (eregs != regs)
@@ -685,12 +686,7 @@ void math_error(void __user *ip)
685 cwd = get_fpu_cwd(task); 686 cwd = get_fpu_cwd(task);
686 swd = get_fpu_swd(task); 687 swd = get_fpu_swd(task);
687 688
688 err = swd & ~cwd & 0x3f; 689 err = swd & ~cwd;
689
690#ifdef CONFIG_X86_32
691 if (!err)
692 return;
693#endif
694 690
695 if (err & 0x001) { /* Invalid op */ 691 if (err & 0x001) { /* Invalid op */
696 /* 692 /*
@@ -708,7 +704,11 @@ void math_error(void __user *ip)
708 } else if (err & 0x020) { /* Precision */ 704 } else if (err & 0x020) { /* Precision */
709 info.si_code = FPE_FLTRES; 705 info.si_code = FPE_FLTRES;
710 } else { 706 } else {
711 info.si_code = __SI_FAULT|SI_KERNEL; /* WTF? */ 707 /*
708 * If we're using IRQ 13, or supposedly even some trap 16
709 * implementations, it's possible we get a spurious trap...
710 */
711 return; /* Spurious trap, no error */
712 } 712 }
713 force_sig_info(SIGFPE, &info, task); 713 force_sig_info(SIGFPE, &info, task);
714} 714}
@@ -941,9 +941,7 @@ dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code)
941 941
942void __init trap_init(void) 942void __init trap_init(void)
943{ 943{
944#ifdef CONFIG_X86_32
945 int i; 944 int i;
946#endif
947 945
948#ifdef CONFIG_EISA 946#ifdef CONFIG_EISA
949 void __iomem *p = early_ioremap(0x0FFFD9, 4); 947 void __iomem *p = early_ioremap(0x0FFFD9, 4);
@@ -1000,11 +998,15 @@ void __init trap_init(void)
1000 } 998 }
1001 999
1002 set_system_trap_gate(SYSCALL_VECTOR, &system_call); 1000 set_system_trap_gate(SYSCALL_VECTOR, &system_call);
1001#endif
1003 1002
1004 /* Reserve all the builtin and the syscall vector: */ 1003 /* Reserve all the builtin and the syscall vector: */
1005 for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++) 1004 for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++)
1006 set_bit(i, used_vectors); 1005 set_bit(i, used_vectors);
1007 1006
1007#ifdef CONFIG_X86_64
1008 set_bit(IA32_SYSCALL_VECTOR, used_vectors);
1009#else
1008 set_bit(SYSCALL_VECTOR, used_vectors); 1010 set_bit(SYSCALL_VECTOR, used_vectors);
1009#endif 1011#endif
1010 /* 1012 /*
diff --git a/arch/x86/kernel/visws_quirks.c b/arch/x86/kernel/visws_quirks.c
index 0c9667f0752a..d801d06af068 100644
--- a/arch/x86/kernel/visws_quirks.c
+++ b/arch/x86/kernel/visws_quirks.c
@@ -176,33 +176,31 @@ static int __init visws_get_smp_config(unsigned int early)
176 * No problem for Linux. 176 * No problem for Linux.
177 */ 177 */
178 178
179static void __init MP_processor_info(struct mpc_config_processor *m) 179static void __init MP_processor_info(struct mpc_cpu *m)
180{ 180{
181 int ver, logical_apicid; 181 int ver, logical_apicid;
182 physid_mask_t apic_cpus; 182 physid_mask_t apic_cpus;
183 183
184 if (!(m->mpc_cpuflag & CPU_ENABLED)) 184 if (!(m->cpuflag & CPU_ENABLED))
185 return; 185 return;
186 186
187 logical_apicid = m->mpc_apicid; 187 logical_apicid = m->apicid;
188 printk(KERN_INFO "%sCPU #%d %u:%u APIC version %d\n", 188 printk(KERN_INFO "%sCPU #%d %u:%u APIC version %d\n",
189 m->mpc_cpuflag & CPU_BOOTPROCESSOR ? "Bootup " : "", 189 m->cpuflag & CPU_BOOTPROCESSOR ? "Bootup " : "",
190 m->mpc_apicid, 190 m->apicid, (m->cpufeature & CPU_FAMILY_MASK) >> 8,
191 (m->mpc_cpufeature & CPU_FAMILY_MASK) >> 8, 191 (m->cpufeature & CPU_MODEL_MASK) >> 4, m->apicver);
192 (m->mpc_cpufeature & CPU_MODEL_MASK) >> 4,
193 m->mpc_apicver);
194 192
195 if (m->mpc_cpuflag & CPU_BOOTPROCESSOR) 193 if (m->cpuflag & CPU_BOOTPROCESSOR)
196 boot_cpu_physical_apicid = m->mpc_apicid; 194 boot_cpu_physical_apicid = m->apicid;
197 195
198 ver = m->mpc_apicver; 196 ver = m->apicver;
199 if ((ver >= 0x14 && m->mpc_apicid >= 0xff) || m->mpc_apicid >= 0xf) { 197 if ((ver >= 0x14 && m->apicid >= 0xff) || m->apicid >= 0xf) {
200 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n", 198 printk(KERN_ERR "Processor #%d INVALID. (Max ID: %d).\n",
201 m->mpc_apicid, MAX_APICS); 199 m->apicid, MAX_APICS);
202 return; 200 return;
203 } 201 }
204 202
205 apic_cpus = apicid_to_cpu_present(m->mpc_apicid); 203 apic_cpus = apicid_to_cpu_present(m->apicid);
206 physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus); 204 physids_or(phys_cpu_present_map, phys_cpu_present_map, apic_cpus);
207 /* 205 /*
208 * Validate version 206 * Validate version
@@ -210,15 +208,15 @@ static void __init MP_processor_info(struct mpc_config_processor *m)
210 if (ver == 0x0) { 208 if (ver == 0x0) {
211 printk(KERN_ERR "BIOS bug, APIC version is 0 for CPU#%d! " 209 printk(KERN_ERR "BIOS bug, APIC version is 0 for CPU#%d! "
212 "fixing up to 0x10. (tell your hw vendor)\n", 210 "fixing up to 0x10. (tell your hw vendor)\n",
213 m->mpc_apicid); 211 m->apicid);
214 ver = 0x10; 212 ver = 0x10;
215 } 213 }
216 apic_version[m->mpc_apicid] = ver; 214 apic_version[m->apicid] = ver;
217} 215}
218 216
219static int __init visws_find_smp_config(unsigned int reserve) 217static int __init visws_find_smp_config(unsigned int reserve)
220{ 218{
221 struct mpc_config_processor *mp = phys_to_virt(CO_CPU_TAB_PHYS); 219 struct mpc_cpu *mp = phys_to_virt(CO_CPU_TAB_PHYS);
222 unsigned short ncpus = readw(phys_to_virt(CO_CPU_NUM_PHYS)); 220 unsigned short ncpus = readw(phys_to_virt(CO_CPU_NUM_PHYS));
223 221
224 if (ncpus > CO_CPU_MAX) { 222 if (ncpus > CO_CPU_MAX) {
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c
index 254ee07f8635..c4c1f9e09402 100644
--- a/arch/x86/kernel/vmiclock_32.c
+++ b/arch/x86/kernel/vmiclock_32.c
@@ -226,7 +226,7 @@ static void __devinit vmi_time_init_clockevent(void)
226 /* Upper bound is clockevent's use of ulong for cycle deltas. */ 226 /* Upper bound is clockevent's use of ulong for cycle deltas. */
227 evt->max_delta_ns = clockevent_delta2ns(ULONG_MAX, evt); 227 evt->max_delta_ns = clockevent_delta2ns(ULONG_MAX, evt);
228 evt->min_delta_ns = clockevent_delta2ns(1, evt); 228 evt->min_delta_ns = clockevent_delta2ns(1, evt);
229 evt->cpumask = cpumask_of_cpu(cpu); 229 evt->cpumask = cpumask_of(cpu);
230 230
231 printk(KERN_WARNING "vmi: registering clock event %s. mult=%lu shift=%u\n", 231 printk(KERN_WARNING "vmi: registering clock event %s. mult=%lu shift=%u\n",
232 evt->name, evt->mult, evt->shift); 232 evt->name, evt->mult, evt->shift);
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
index 15c3e6999182..2b54fe002e94 100644
--- a/arch/x86/kernel/xsave.c
+++ b/arch/x86/kernel/xsave.c
@@ -159,7 +159,7 @@ int save_i387_xstate(void __user *buf)
159 * Restore the extended state if present. Otherwise, restore the FP/SSE 159 * Restore the extended state if present. Otherwise, restore the FP/SSE
160 * state. 160 * state.
161 */ 161 */
162int restore_user_xstate(void __user *buf) 162static int restore_user_xstate(void __user *buf)
163{ 163{
164 struct _fpx_sw_bytes fx_sw_user; 164 struct _fpx_sw_bytes fx_sw_user;
165 u64 mask; 165 u64 mask;
diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile
index c02343594b4d..d3ec292f00f2 100644
--- a/arch/x86/kvm/Makefile
+++ b/arch/x86/kvm/Makefile
@@ -7,8 +7,8 @@ common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \
7ifeq ($(CONFIG_KVM_TRACE),y) 7ifeq ($(CONFIG_KVM_TRACE),y)
8common-objs += $(addprefix ../../../virt/kvm/, kvm_trace.o) 8common-objs += $(addprefix ../../../virt/kvm/, kvm_trace.o)
9endif 9endif
10ifeq ($(CONFIG_DMAR),y) 10ifeq ($(CONFIG_IOMMU_API),y)
11common-objs += $(addprefix ../../../virt/kvm/, vtd.o) 11common-objs += $(addprefix ../../../virt/kvm/, iommu.o)
12endif 12endif
13 13
14EXTRA_CFLAGS += -Ivirt/kvm -Iarch/x86/kvm 14EXTRA_CFLAGS += -Ivirt/kvm -Iarch/x86/kvm
diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
index 59ebd37ad79e..e665d1c623ca 100644
--- a/arch/x86/kvm/i8254.c
+++ b/arch/x86/kvm/i8254.c
@@ -603,10 +603,29 @@ void kvm_free_pit(struct kvm *kvm)
603 603
604static void __inject_pit_timer_intr(struct kvm *kvm) 604static void __inject_pit_timer_intr(struct kvm *kvm)
605{ 605{
606 struct kvm_vcpu *vcpu;
607 int i;
608
606 mutex_lock(&kvm->lock); 609 mutex_lock(&kvm->lock);
607 kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 1); 610 kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 1);
608 kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 0); 611 kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 0);
609 mutex_unlock(&kvm->lock); 612 mutex_unlock(&kvm->lock);
613
614 /*
615 * Provides NMI watchdog support via Virtual Wire mode.
616 * The route is: PIT -> PIC -> LVT0 in NMI mode.
617 *
618 * Note: Our Virtual Wire implementation is simplified, only
619 * propagating PIT interrupts to all VCPUs when they have set
620 * LVT0 to NMI delivery. Other PIC interrupts are just sent to
621 * VCPU0, and only if its LVT0 is in EXTINT mode.
622 */
623 if (kvm->arch.vapics_in_nmi_mode > 0)
624 for (i = 0; i < KVM_MAX_VCPUS; ++i) {
625 vcpu = kvm->vcpus[i];
626 if (vcpu)
627 kvm_apic_nmi_wd_deliver(vcpu);
628 }
610} 629}
611 630
612void kvm_inject_pit_timer_irqs(struct kvm_vcpu *vcpu) 631void kvm_inject_pit_timer_irqs(struct kvm_vcpu *vcpu)
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index 17e41e165f1a..179dcb0103fd 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -26,10 +26,40 @@
26 * Port from Qemu. 26 * Port from Qemu.
27 */ 27 */
28#include <linux/mm.h> 28#include <linux/mm.h>
29#include <linux/bitops.h>
29#include "irq.h" 30#include "irq.h"
30 31
31#include <linux/kvm_host.h> 32#include <linux/kvm_host.h>
32 33
34static void pic_lock(struct kvm_pic *s)
35{
36 spin_lock(&s->lock);
37}
38
39static void pic_unlock(struct kvm_pic *s)
40{
41 struct kvm *kvm = s->kvm;
42 unsigned acks = s->pending_acks;
43 bool wakeup = s->wakeup_needed;
44 struct kvm_vcpu *vcpu;
45
46 s->pending_acks = 0;
47 s->wakeup_needed = false;
48
49 spin_unlock(&s->lock);
50
51 while (acks) {
52 kvm_notify_acked_irq(kvm, __ffs(acks));
53 acks &= acks - 1;
54 }
55
56 if (wakeup) {
57 vcpu = s->kvm->vcpus[0];
58 if (vcpu)
59 kvm_vcpu_kick(vcpu);
60 }
61}
62
33static void pic_clear_isr(struct kvm_kpic_state *s, int irq) 63static void pic_clear_isr(struct kvm_kpic_state *s, int irq)
34{ 64{
35 s->isr &= ~(1 << irq); 65 s->isr &= ~(1 << irq);
@@ -136,17 +166,21 @@ static void pic_update_irq(struct kvm_pic *s)
136 166
137void kvm_pic_update_irq(struct kvm_pic *s) 167void kvm_pic_update_irq(struct kvm_pic *s)
138{ 168{
169 pic_lock(s);
139 pic_update_irq(s); 170 pic_update_irq(s);
171 pic_unlock(s);
140} 172}
141 173
142void kvm_pic_set_irq(void *opaque, int irq, int level) 174void kvm_pic_set_irq(void *opaque, int irq, int level)
143{ 175{
144 struct kvm_pic *s = opaque; 176 struct kvm_pic *s = opaque;
145 177
178 pic_lock(s);
146 if (irq >= 0 && irq < PIC_NUM_PINS) { 179 if (irq >= 0 && irq < PIC_NUM_PINS) {
147 pic_set_irq1(&s->pics[irq >> 3], irq & 7, level); 180 pic_set_irq1(&s->pics[irq >> 3], irq & 7, level);
148 pic_update_irq(s); 181 pic_update_irq(s);
149 } 182 }
183 pic_unlock(s);
150} 184}
151 185
152/* 186/*
@@ -172,6 +206,7 @@ int kvm_pic_read_irq(struct kvm *kvm)
172 int irq, irq2, intno; 206 int irq, irq2, intno;
173 struct kvm_pic *s = pic_irqchip(kvm); 207 struct kvm_pic *s = pic_irqchip(kvm);
174 208
209 pic_lock(s);
175 irq = pic_get_irq(&s->pics[0]); 210 irq = pic_get_irq(&s->pics[0]);
176 if (irq >= 0) { 211 if (irq >= 0) {
177 pic_intack(&s->pics[0], irq); 212 pic_intack(&s->pics[0], irq);
@@ -196,6 +231,7 @@ int kvm_pic_read_irq(struct kvm *kvm)
196 intno = s->pics[0].irq_base + irq; 231 intno = s->pics[0].irq_base + irq;
197 } 232 }
198 pic_update_irq(s); 233 pic_update_irq(s);
234 pic_unlock(s);
199 kvm_notify_acked_irq(kvm, irq); 235 kvm_notify_acked_irq(kvm, irq);
200 236
201 return intno; 237 return intno;
@@ -203,7 +239,7 @@ int kvm_pic_read_irq(struct kvm *kvm)
203 239
204void kvm_pic_reset(struct kvm_kpic_state *s) 240void kvm_pic_reset(struct kvm_kpic_state *s)
205{ 241{
206 int irq, irqbase; 242 int irq, irqbase, n;
207 struct kvm *kvm = s->pics_state->irq_request_opaque; 243 struct kvm *kvm = s->pics_state->irq_request_opaque;
208 struct kvm_vcpu *vcpu0 = kvm->vcpus[0]; 244 struct kvm_vcpu *vcpu0 = kvm->vcpus[0];
209 245
@@ -214,8 +250,10 @@ void kvm_pic_reset(struct kvm_kpic_state *s)
214 250
215 for (irq = 0; irq < PIC_NUM_PINS/2; irq++) { 251 for (irq = 0; irq < PIC_NUM_PINS/2; irq++) {
216 if (vcpu0 && kvm_apic_accept_pic_intr(vcpu0)) 252 if (vcpu0 && kvm_apic_accept_pic_intr(vcpu0))
217 if (s->irr & (1 << irq) || s->isr & (1 << irq)) 253 if (s->irr & (1 << irq) || s->isr & (1 << irq)) {
218 kvm_notify_acked_irq(kvm, irq+irqbase); 254 n = irq + irqbase;
255 s->pics_state->pending_acks |= 1 << n;
256 }
219 } 257 }
220 s->last_irr = 0; 258 s->last_irr = 0;
221 s->irr = 0; 259 s->irr = 0;
@@ -406,6 +444,7 @@ static void picdev_write(struct kvm_io_device *this,
406 printk(KERN_ERR "PIC: non byte write\n"); 444 printk(KERN_ERR "PIC: non byte write\n");
407 return; 445 return;
408 } 446 }
447 pic_lock(s);
409 switch (addr) { 448 switch (addr) {
410 case 0x20: 449 case 0x20:
411 case 0x21: 450 case 0x21:
@@ -418,6 +457,7 @@ static void picdev_write(struct kvm_io_device *this,
418 elcr_ioport_write(&s->pics[addr & 1], addr, data); 457 elcr_ioport_write(&s->pics[addr & 1], addr, data);
419 break; 458 break;
420 } 459 }
460 pic_unlock(s);
421} 461}
422 462
423static void picdev_read(struct kvm_io_device *this, 463static void picdev_read(struct kvm_io_device *this,
@@ -431,6 +471,7 @@ static void picdev_read(struct kvm_io_device *this,
431 printk(KERN_ERR "PIC: non byte read\n"); 471 printk(KERN_ERR "PIC: non byte read\n");
432 return; 472 return;
433 } 473 }
474 pic_lock(s);
434 switch (addr) { 475 switch (addr) {
435 case 0x20: 476 case 0x20:
436 case 0x21: 477 case 0x21:
@@ -444,6 +485,7 @@ static void picdev_read(struct kvm_io_device *this,
444 break; 485 break;
445 } 486 }
446 *(unsigned char *)val = data; 487 *(unsigned char *)val = data;
488 pic_unlock(s);
447} 489}
448 490
449/* 491/*
@@ -459,7 +501,7 @@ static void pic_irq_request(void *opaque, int level)
459 s->output = level; 501 s->output = level;
460 if (vcpu && level && (s->pics[0].isr_ack & (1 << irq))) { 502 if (vcpu && level && (s->pics[0].isr_ack & (1 << irq))) {
461 s->pics[0].isr_ack &= ~(1 << irq); 503 s->pics[0].isr_ack &= ~(1 << irq);
462 kvm_vcpu_kick(vcpu); 504 s->wakeup_needed = true;
463 } 505 }
464} 506}
465 507
@@ -469,6 +511,8 @@ struct kvm_pic *kvm_create_pic(struct kvm *kvm)
469 s = kzalloc(sizeof(struct kvm_pic), GFP_KERNEL); 511 s = kzalloc(sizeof(struct kvm_pic), GFP_KERNEL);
470 if (!s) 512 if (!s)
471 return NULL; 513 return NULL;
514 spin_lock_init(&s->lock);
515 s->kvm = kvm;
472 s->pics[0].elcr_mask = 0xf8; 516 s->pics[0].elcr_mask = 0xf8;
473 s->pics[1].elcr_mask = 0xde; 517 s->pics[1].elcr_mask = 0xde;
474 s->irq_request = pic_irq_request; 518 s->irq_request = pic_irq_request;
diff --git a/arch/x86/kvm/irq.h b/arch/x86/kvm/irq.h
index f17c8f5bbf31..2bf32a03ceec 100644
--- a/arch/x86/kvm/irq.h
+++ b/arch/x86/kvm/irq.h
@@ -25,6 +25,7 @@
25#include <linux/mm_types.h> 25#include <linux/mm_types.h>
26#include <linux/hrtimer.h> 26#include <linux/hrtimer.h>
27#include <linux/kvm_host.h> 27#include <linux/kvm_host.h>
28#include <linux/spinlock.h>
28 29
29#include "iodev.h" 30#include "iodev.h"
30#include "ioapic.h" 31#include "ioapic.h"
@@ -59,6 +60,10 @@ struct kvm_kpic_state {
59}; 60};
60 61
61struct kvm_pic { 62struct kvm_pic {
63 spinlock_t lock;
64 bool wakeup_needed;
65 unsigned pending_acks;
66 struct kvm *kvm;
62 struct kvm_kpic_state pics[2]; /* 0 is master pic, 1 is slave pic */ 67 struct kvm_kpic_state pics[2]; /* 0 is master pic, 1 is slave pic */
63 irq_request_func *irq_request; 68 irq_request_func *irq_request;
64 void *irq_request_opaque; 69 void *irq_request_opaque;
@@ -87,6 +92,7 @@ void kvm_pic_reset(struct kvm_kpic_state *s);
87void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec); 92void kvm_timer_intr_post(struct kvm_vcpu *vcpu, int vec);
88void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu); 93void kvm_inject_pending_timer_irqs(struct kvm_vcpu *vcpu);
89void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu); 94void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu);
95void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu);
90void __kvm_migrate_apic_timer(struct kvm_vcpu *vcpu); 96void __kvm_migrate_apic_timer(struct kvm_vcpu *vcpu);
91void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu); 97void __kvm_migrate_pit_timer(struct kvm_vcpu *vcpu);
92void __kvm_migrate_timers(struct kvm_vcpu *vcpu); 98void __kvm_migrate_timers(struct kvm_vcpu *vcpu);
diff --git a/arch/x86/kvm/kvm_svm.h b/arch/x86/kvm/kvm_svm.h
index 65ef0fc2c036..8e5ee99551f6 100644
--- a/arch/x86/kvm/kvm_svm.h
+++ b/arch/x86/kvm/kvm_svm.h
@@ -7,7 +7,7 @@
7#include <linux/kvm_host.h> 7#include <linux/kvm_host.h>
8#include <asm/msr.h> 8#include <asm/msr.h>
9 9
10#include "svm.h" 10#include <asm/svm.h>
11 11
12static const u32 host_save_user_msrs[] = { 12static const u32 host_save_user_msrs[] = {
13#ifdef CONFIG_X86_64 13#ifdef CONFIG_X86_64
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 0fc3cab48943..afac68c0815c 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -130,6 +130,11 @@ static inline int apic_lvtt_period(struct kvm_lapic *apic)
130 return apic_get_reg(apic, APIC_LVTT) & APIC_LVT_TIMER_PERIODIC; 130 return apic_get_reg(apic, APIC_LVTT) & APIC_LVT_TIMER_PERIODIC;
131} 131}
132 132
133static inline int apic_lvt_nmi_mode(u32 lvt_val)
134{
135 return (lvt_val & (APIC_MODE_MASK | APIC_LVT_MASKED)) == APIC_DM_NMI;
136}
137
133static unsigned int apic_lvt_mask[APIC_LVT_NUM] = { 138static unsigned int apic_lvt_mask[APIC_LVT_NUM] = {
134 LVT_MASK | APIC_LVT_TIMER_PERIODIC, /* LVTT */ 139 LVT_MASK | APIC_LVT_TIMER_PERIODIC, /* LVTT */
135 LVT_MASK | APIC_MODE_MASK, /* LVTTHMR */ 140 LVT_MASK | APIC_MODE_MASK, /* LVTTHMR */
@@ -354,6 +359,7 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
354 359
355 case APIC_DM_NMI: 360 case APIC_DM_NMI:
356 kvm_inject_nmi(vcpu); 361 kvm_inject_nmi(vcpu);
362 kvm_vcpu_kick(vcpu);
357 break; 363 break;
358 364
359 case APIC_DM_INIT: 365 case APIC_DM_INIT:
@@ -380,6 +386,14 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode,
380 } 386 }
381 break; 387 break;
382 388
389 case APIC_DM_EXTINT:
390 /*
391 * Should only be called by kvm_apic_local_deliver() with LVT0,
392 * before NMI watchdog was enabled. Already handled by
393 * kvm_apic_accept_pic_intr().
394 */
395 break;
396
383 default: 397 default:
384 printk(KERN_ERR "TODO: unsupported delivery mode %x\n", 398 printk(KERN_ERR "TODO: unsupported delivery mode %x\n",
385 delivery_mode); 399 delivery_mode);
@@ -663,6 +677,20 @@ static void start_apic_timer(struct kvm_lapic *apic)
663 apic->timer.period))); 677 apic->timer.period)));
664} 678}
665 679
680static void apic_manage_nmi_watchdog(struct kvm_lapic *apic, u32 lvt0_val)
681{
682 int nmi_wd_enabled = apic_lvt_nmi_mode(apic_get_reg(apic, APIC_LVT0));
683
684 if (apic_lvt_nmi_mode(lvt0_val)) {
685 if (!nmi_wd_enabled) {
686 apic_debug("Receive NMI setting on APIC_LVT0 "
687 "for cpu %d\n", apic->vcpu->vcpu_id);
688 apic->vcpu->kvm->arch.vapics_in_nmi_mode++;
689 }
690 } else if (nmi_wd_enabled)
691 apic->vcpu->kvm->arch.vapics_in_nmi_mode--;
692}
693
666static void apic_mmio_write(struct kvm_io_device *this, 694static void apic_mmio_write(struct kvm_io_device *this,
667 gpa_t address, int len, const void *data) 695 gpa_t address, int len, const void *data)
668{ 696{
@@ -743,10 +771,11 @@ static void apic_mmio_write(struct kvm_io_device *this,
743 apic_set_reg(apic, APIC_ICR2, val & 0xff000000); 771 apic_set_reg(apic, APIC_ICR2, val & 0xff000000);
744 break; 772 break;
745 773
774 case APIC_LVT0:
775 apic_manage_nmi_watchdog(apic, val);
746 case APIC_LVTT: 776 case APIC_LVTT:
747 case APIC_LVTTHMR: 777 case APIC_LVTTHMR:
748 case APIC_LVTPC: 778 case APIC_LVTPC:
749 case APIC_LVT0:
750 case APIC_LVT1: 779 case APIC_LVT1:
751 case APIC_LVTERR: 780 case APIC_LVTERR:
752 /* TODO: Check vector */ 781 /* TODO: Check vector */
@@ -961,12 +990,26 @@ int apic_has_pending_timer(struct kvm_vcpu *vcpu)
961 return 0; 990 return 0;
962} 991}
963 992
964static int __inject_apic_timer_irq(struct kvm_lapic *apic) 993static int kvm_apic_local_deliver(struct kvm_lapic *apic, int lvt_type)
994{
995 u32 reg = apic_get_reg(apic, lvt_type);
996 int vector, mode, trig_mode;
997
998 if (apic_hw_enabled(apic) && !(reg & APIC_LVT_MASKED)) {
999 vector = reg & APIC_VECTOR_MASK;
1000 mode = reg & APIC_MODE_MASK;
1001 trig_mode = reg & APIC_LVT_LEVEL_TRIGGER;
1002 return __apic_accept_irq(apic, mode, vector, 1, trig_mode);
1003 }
1004 return 0;
1005}
1006
1007void kvm_apic_nmi_wd_deliver(struct kvm_vcpu *vcpu)
965{ 1008{
966 int vector; 1009 struct kvm_lapic *apic = vcpu->arch.apic;
967 1010
968 vector = apic_lvt_vector(apic, APIC_LVTT); 1011 if (apic)
969 return __apic_accept_irq(apic, APIC_DM_FIXED, vector, 1, 0); 1012 kvm_apic_local_deliver(apic, APIC_LVT0);
970} 1013}
971 1014
972static enum hrtimer_restart apic_timer_fn(struct hrtimer *data) 1015static enum hrtimer_restart apic_timer_fn(struct hrtimer *data)
@@ -1061,9 +1104,8 @@ void kvm_inject_apic_timer_irqs(struct kvm_vcpu *vcpu)
1061{ 1104{
1062 struct kvm_lapic *apic = vcpu->arch.apic; 1105 struct kvm_lapic *apic = vcpu->arch.apic;
1063 1106
1064 if (apic && apic_lvt_enabled(apic, APIC_LVTT) && 1107 if (apic && atomic_read(&apic->timer.pending) > 0) {
1065 atomic_read(&apic->timer.pending) > 0) { 1108 if (kvm_apic_local_deliver(apic, APIC_LVTT))
1066 if (__inject_apic_timer_irq(apic))
1067 atomic_dec(&apic->timer.pending); 1109 atomic_dec(&apic->timer.pending);
1068 } 1110 }
1069} 1111}
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 410ddbc1aa2e..83f11c7474a1 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -17,7 +17,6 @@
17 * 17 *
18 */ 18 */
19 19
20#include "vmx.h"
21#include "mmu.h" 20#include "mmu.h"
22 21
23#include <linux/kvm_host.h> 22#include <linux/kvm_host.h>
@@ -33,6 +32,7 @@
33#include <asm/page.h> 32#include <asm/page.h>
34#include <asm/cmpxchg.h> 33#include <asm/cmpxchg.h>
35#include <asm/io.h> 34#include <asm/io.h>
35#include <asm/vmx.h>
36 36
37/* 37/*
38 * When setting this variable to true it enables Two-Dimensional-Paging 38 * When setting this variable to true it enables Two-Dimensional-Paging
@@ -168,6 +168,7 @@ static u64 __read_mostly shadow_x_mask; /* mutual exclusive with nx_mask */
168static u64 __read_mostly shadow_user_mask; 168static u64 __read_mostly shadow_user_mask;
169static u64 __read_mostly shadow_accessed_mask; 169static u64 __read_mostly shadow_accessed_mask;
170static u64 __read_mostly shadow_dirty_mask; 170static u64 __read_mostly shadow_dirty_mask;
171static u64 __read_mostly shadow_mt_mask;
171 172
172void kvm_mmu_set_nonpresent_ptes(u64 trap_pte, u64 notrap_pte) 173void kvm_mmu_set_nonpresent_ptes(u64 trap_pte, u64 notrap_pte)
173{ 174{
@@ -183,13 +184,14 @@ void kvm_mmu_set_base_ptes(u64 base_pte)
183EXPORT_SYMBOL_GPL(kvm_mmu_set_base_ptes); 184EXPORT_SYMBOL_GPL(kvm_mmu_set_base_ptes);
184 185
185void kvm_mmu_set_mask_ptes(u64 user_mask, u64 accessed_mask, 186void kvm_mmu_set_mask_ptes(u64 user_mask, u64 accessed_mask,
186 u64 dirty_mask, u64 nx_mask, u64 x_mask) 187 u64 dirty_mask, u64 nx_mask, u64 x_mask, u64 mt_mask)
187{ 188{
188 shadow_user_mask = user_mask; 189 shadow_user_mask = user_mask;
189 shadow_accessed_mask = accessed_mask; 190 shadow_accessed_mask = accessed_mask;
190 shadow_dirty_mask = dirty_mask; 191 shadow_dirty_mask = dirty_mask;
191 shadow_nx_mask = nx_mask; 192 shadow_nx_mask = nx_mask;
192 shadow_x_mask = x_mask; 193 shadow_x_mask = x_mask;
194 shadow_mt_mask = mt_mask;
193} 195}
194EXPORT_SYMBOL_GPL(kvm_mmu_set_mask_ptes); 196EXPORT_SYMBOL_GPL(kvm_mmu_set_mask_ptes);
195 197
@@ -384,7 +386,9 @@ static void account_shadowed(struct kvm *kvm, gfn_t gfn)
384{ 386{
385 int *write_count; 387 int *write_count;
386 388
387 write_count = slot_largepage_idx(gfn, gfn_to_memslot(kvm, gfn)); 389 gfn = unalias_gfn(kvm, gfn);
390 write_count = slot_largepage_idx(gfn,
391 gfn_to_memslot_unaliased(kvm, gfn));
388 *write_count += 1; 392 *write_count += 1;
389} 393}
390 394
@@ -392,16 +396,20 @@ static void unaccount_shadowed(struct kvm *kvm, gfn_t gfn)
392{ 396{
393 int *write_count; 397 int *write_count;
394 398
395 write_count = slot_largepage_idx(gfn, gfn_to_memslot(kvm, gfn)); 399 gfn = unalias_gfn(kvm, gfn);
400 write_count = slot_largepage_idx(gfn,
401 gfn_to_memslot_unaliased(kvm, gfn));
396 *write_count -= 1; 402 *write_count -= 1;
397 WARN_ON(*write_count < 0); 403 WARN_ON(*write_count < 0);
398} 404}
399 405
400static int has_wrprotected_page(struct kvm *kvm, gfn_t gfn) 406static int has_wrprotected_page(struct kvm *kvm, gfn_t gfn)
401{ 407{
402 struct kvm_memory_slot *slot = gfn_to_memslot(kvm, gfn); 408 struct kvm_memory_slot *slot;
403 int *largepage_idx; 409 int *largepage_idx;
404 410
411 gfn = unalias_gfn(kvm, gfn);
412 slot = gfn_to_memslot_unaliased(kvm, gfn);
405 if (slot) { 413 if (slot) {
406 largepage_idx = slot_largepage_idx(gfn, slot); 414 largepage_idx = slot_largepage_idx(gfn, slot);
407 return *largepage_idx; 415 return *largepage_idx;
@@ -613,7 +621,7 @@ static u64 *rmap_next(struct kvm *kvm, unsigned long *rmapp, u64 *spte)
613 return NULL; 621 return NULL;
614} 622}
615 623
616static void rmap_write_protect(struct kvm *kvm, u64 gfn) 624static int rmap_write_protect(struct kvm *kvm, u64 gfn)
617{ 625{
618 unsigned long *rmapp; 626 unsigned long *rmapp;
619 u64 *spte; 627 u64 *spte;
@@ -659,8 +667,7 @@ static void rmap_write_protect(struct kvm *kvm, u64 gfn)
659 spte = rmap_next(kvm, rmapp, spte); 667 spte = rmap_next(kvm, rmapp, spte);
660 } 668 }
661 669
662 if (write_protected) 670 return write_protected;
663 kvm_flush_remote_tlbs(kvm);
664} 671}
665 672
666static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp) 673static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp)
@@ -786,9 +793,11 @@ static struct kvm_mmu_page *kvm_mmu_alloc_page(struct kvm_vcpu *vcpu,
786 sp->gfns = mmu_memory_cache_alloc(&vcpu->arch.mmu_page_cache, PAGE_SIZE); 793 sp->gfns = mmu_memory_cache_alloc(&vcpu->arch.mmu_page_cache, PAGE_SIZE);
787 set_page_private(virt_to_page(sp->spt), (unsigned long)sp); 794 set_page_private(virt_to_page(sp->spt), (unsigned long)sp);
788 list_add(&sp->link, &vcpu->kvm->arch.active_mmu_pages); 795 list_add(&sp->link, &vcpu->kvm->arch.active_mmu_pages);
796 INIT_LIST_HEAD(&sp->oos_link);
789 ASSERT(is_empty_shadow_page(sp->spt)); 797 ASSERT(is_empty_shadow_page(sp->spt));
790 sp->slot_bitmap = 0; 798 bitmap_zero(sp->slot_bitmap, KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS);
791 sp->multimapped = 0; 799 sp->multimapped = 0;
800 sp->global = 1;
792 sp->parent_pte = parent_pte; 801 sp->parent_pte = parent_pte;
793 --vcpu->kvm->arch.n_free_mmu_pages; 802 --vcpu->kvm->arch.n_free_mmu_pages;
794 return sp; 803 return sp;
@@ -900,8 +909,9 @@ static void kvm_mmu_update_unsync_bitmap(u64 *spte)
900 struct kvm_mmu_page *sp = page_header(__pa(spte)); 909 struct kvm_mmu_page *sp = page_header(__pa(spte));
901 910
902 index = spte - sp->spt; 911 index = spte - sp->spt;
903 __set_bit(index, sp->unsync_child_bitmap); 912 if (!__test_and_set_bit(index, sp->unsync_child_bitmap))
904 sp->unsync_children = 1; 913 sp->unsync_children++;
914 WARN_ON(!sp->unsync_children);
905} 915}
906 916
907static void kvm_mmu_update_parents_unsync(struct kvm_mmu_page *sp) 917static void kvm_mmu_update_parents_unsync(struct kvm_mmu_page *sp)
@@ -928,7 +938,6 @@ static void kvm_mmu_update_parents_unsync(struct kvm_mmu_page *sp)
928 938
929static int unsync_walk_fn(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp) 939static int unsync_walk_fn(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
930{ 940{
931 sp->unsync_children = 1;
932 kvm_mmu_update_parents_unsync(sp); 941 kvm_mmu_update_parents_unsync(sp);
933 return 1; 942 return 1;
934} 943}
@@ -959,38 +968,66 @@ static void nonpaging_invlpg(struct kvm_vcpu *vcpu, gva_t gva)
959{ 968{
960} 969}
961 970
971#define KVM_PAGE_ARRAY_NR 16
972
973struct kvm_mmu_pages {
974 struct mmu_page_and_offset {
975 struct kvm_mmu_page *sp;
976 unsigned int idx;
977 } page[KVM_PAGE_ARRAY_NR];
978 unsigned int nr;
979};
980
962#define for_each_unsync_children(bitmap, idx) \ 981#define for_each_unsync_children(bitmap, idx) \
963 for (idx = find_first_bit(bitmap, 512); \ 982 for (idx = find_first_bit(bitmap, 512); \
964 idx < 512; \ 983 idx < 512; \
965 idx = find_next_bit(bitmap, 512, idx+1)) 984 idx = find_next_bit(bitmap, 512, idx+1))
966 985
967static int mmu_unsync_walk(struct kvm_mmu_page *sp, 986int mmu_pages_add(struct kvm_mmu_pages *pvec, struct kvm_mmu_page *sp,
968 struct kvm_unsync_walk *walker) 987 int idx)
969{ 988{
970 int i, ret; 989 int i;
971 990
972 if (!sp->unsync_children) 991 if (sp->unsync)
973 return 0; 992 for (i=0; i < pvec->nr; i++)
993 if (pvec->page[i].sp == sp)
994 return 0;
995
996 pvec->page[pvec->nr].sp = sp;
997 pvec->page[pvec->nr].idx = idx;
998 pvec->nr++;
999 return (pvec->nr == KVM_PAGE_ARRAY_NR);
1000}
1001
1002static int __mmu_unsync_walk(struct kvm_mmu_page *sp,
1003 struct kvm_mmu_pages *pvec)
1004{
1005 int i, ret, nr_unsync_leaf = 0;
974 1006
975 for_each_unsync_children(sp->unsync_child_bitmap, i) { 1007 for_each_unsync_children(sp->unsync_child_bitmap, i) {
976 u64 ent = sp->spt[i]; 1008 u64 ent = sp->spt[i];
977 1009
978 if (is_shadow_present_pte(ent)) { 1010 if (is_shadow_present_pte(ent) && !is_large_pte(ent)) {
979 struct kvm_mmu_page *child; 1011 struct kvm_mmu_page *child;
980 child = page_header(ent & PT64_BASE_ADDR_MASK); 1012 child = page_header(ent & PT64_BASE_ADDR_MASK);
981 1013
982 if (child->unsync_children) { 1014 if (child->unsync_children) {
983 ret = mmu_unsync_walk(child, walker); 1015 if (mmu_pages_add(pvec, child, i))
984 if (ret) 1016 return -ENOSPC;
1017
1018 ret = __mmu_unsync_walk(child, pvec);
1019 if (!ret)
1020 __clear_bit(i, sp->unsync_child_bitmap);
1021 else if (ret > 0)
1022 nr_unsync_leaf += ret;
1023 else
985 return ret; 1024 return ret;
986 __clear_bit(i, sp->unsync_child_bitmap);
987 } 1025 }
988 1026
989 if (child->unsync) { 1027 if (child->unsync) {
990 ret = walker->entry(child, walker); 1028 nr_unsync_leaf++;
991 __clear_bit(i, sp->unsync_child_bitmap); 1029 if (mmu_pages_add(pvec, child, i))
992 if (ret) 1030 return -ENOSPC;
993 return ret;
994 } 1031 }
995 } 1032 }
996 } 1033 }
@@ -998,7 +1035,17 @@ static int mmu_unsync_walk(struct kvm_mmu_page *sp,
998 if (find_first_bit(sp->unsync_child_bitmap, 512) == 512) 1035 if (find_first_bit(sp->unsync_child_bitmap, 512) == 512)
999 sp->unsync_children = 0; 1036 sp->unsync_children = 0;
1000 1037
1001 return 0; 1038 return nr_unsync_leaf;
1039}
1040
1041static int mmu_unsync_walk(struct kvm_mmu_page *sp,
1042 struct kvm_mmu_pages *pvec)
1043{
1044 if (!sp->unsync_children)
1045 return 0;
1046
1047 mmu_pages_add(pvec, sp, 0);
1048 return __mmu_unsync_walk(sp, pvec);
1002} 1049}
1003 1050
1004static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm *kvm, gfn_t gfn) 1051static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm *kvm, gfn_t gfn)
@@ -1021,10 +1068,18 @@ static struct kvm_mmu_page *kvm_mmu_lookup_page(struct kvm *kvm, gfn_t gfn)
1021 return NULL; 1068 return NULL;
1022} 1069}
1023 1070
1071static void kvm_unlink_unsync_global(struct kvm *kvm, struct kvm_mmu_page *sp)
1072{
1073 list_del(&sp->oos_link);
1074 --kvm->stat.mmu_unsync_global;
1075}
1076
1024static void kvm_unlink_unsync_page(struct kvm *kvm, struct kvm_mmu_page *sp) 1077static void kvm_unlink_unsync_page(struct kvm *kvm, struct kvm_mmu_page *sp)
1025{ 1078{
1026 WARN_ON(!sp->unsync); 1079 WARN_ON(!sp->unsync);
1027 sp->unsync = 0; 1080 sp->unsync = 0;
1081 if (sp->global)
1082 kvm_unlink_unsync_global(kvm, sp);
1028 --kvm->stat.mmu_unsync; 1083 --kvm->stat.mmu_unsync;
1029} 1084}
1030 1085
@@ -1037,7 +1092,8 @@ static int kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
1037 return 1; 1092 return 1;
1038 } 1093 }
1039 1094
1040 rmap_write_protect(vcpu->kvm, sp->gfn); 1095 if (rmap_write_protect(vcpu->kvm, sp->gfn))
1096 kvm_flush_remote_tlbs(vcpu->kvm);
1041 kvm_unlink_unsync_page(vcpu->kvm, sp); 1097 kvm_unlink_unsync_page(vcpu->kvm, sp);
1042 if (vcpu->arch.mmu.sync_page(vcpu, sp)) { 1098 if (vcpu->arch.mmu.sync_page(vcpu, sp)) {
1043 kvm_mmu_zap_page(vcpu->kvm, sp); 1099 kvm_mmu_zap_page(vcpu->kvm, sp);
@@ -1048,30 +1104,89 @@ static int kvm_sync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
1048 return 0; 1104 return 0;
1049} 1105}
1050 1106
1051struct sync_walker { 1107struct mmu_page_path {
1052 struct kvm_vcpu *vcpu; 1108 struct kvm_mmu_page *parent[PT64_ROOT_LEVEL-1];
1053 struct kvm_unsync_walk walker; 1109 unsigned int idx[PT64_ROOT_LEVEL-1];
1054}; 1110};
1055 1111
1056static int mmu_sync_fn(struct kvm_mmu_page *sp, struct kvm_unsync_walk *walk) 1112#define for_each_sp(pvec, sp, parents, i) \
1113 for (i = mmu_pages_next(&pvec, &parents, -1), \
1114 sp = pvec.page[i].sp; \
1115 i < pvec.nr && ({ sp = pvec.page[i].sp; 1;}); \
1116 i = mmu_pages_next(&pvec, &parents, i))
1117
1118int mmu_pages_next(struct kvm_mmu_pages *pvec, struct mmu_page_path *parents,
1119 int i)
1057{ 1120{
1058 struct sync_walker *sync_walk = container_of(walk, struct sync_walker, 1121 int n;
1059 walker);
1060 struct kvm_vcpu *vcpu = sync_walk->vcpu;
1061 1122
1062 kvm_sync_page(vcpu, sp); 1123 for (n = i+1; n < pvec->nr; n++) {
1063 return (need_resched() || spin_needbreak(&vcpu->kvm->mmu_lock)); 1124 struct kvm_mmu_page *sp = pvec->page[n].sp;
1125
1126 if (sp->role.level == PT_PAGE_TABLE_LEVEL) {
1127 parents->idx[0] = pvec->page[n].idx;
1128 return n;
1129 }
1130
1131 parents->parent[sp->role.level-2] = sp;
1132 parents->idx[sp->role.level-1] = pvec->page[n].idx;
1133 }
1134
1135 return n;
1064} 1136}
1065 1137
1066static void mmu_sync_children(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp) 1138void mmu_pages_clear_parents(struct mmu_page_path *parents)
1067{ 1139{
1068 struct sync_walker walker = { 1140 struct kvm_mmu_page *sp;
1069 .walker = { .entry = mmu_sync_fn, }, 1141 unsigned int level = 0;
1070 .vcpu = vcpu, 1142
1071 }; 1143 do {
1144 unsigned int idx = parents->idx[level];
1145
1146 sp = parents->parent[level];
1147 if (!sp)
1148 return;
1149
1150 --sp->unsync_children;
1151 WARN_ON((int)sp->unsync_children < 0);
1152 __clear_bit(idx, sp->unsync_child_bitmap);
1153 level++;
1154 } while (level < PT64_ROOT_LEVEL-1 && !sp->unsync_children);
1155}
1156
1157static void kvm_mmu_pages_init(struct kvm_mmu_page *parent,
1158 struct mmu_page_path *parents,
1159 struct kvm_mmu_pages *pvec)
1160{
1161 parents->parent[parent->role.level-1] = NULL;
1162 pvec->nr = 0;
1163}
1164
1165static void mmu_sync_children(struct kvm_vcpu *vcpu,
1166 struct kvm_mmu_page *parent)
1167{
1168 int i;
1169 struct kvm_mmu_page *sp;
1170 struct mmu_page_path parents;
1171 struct kvm_mmu_pages pages;
1172
1173 kvm_mmu_pages_init(parent, &parents, &pages);
1174 while (mmu_unsync_walk(parent, &pages)) {
1175 int protected = 0;
1072 1176
1073 while (mmu_unsync_walk(sp, &walker.walker)) 1177 for_each_sp(pages, sp, parents, i)
1178 protected |= rmap_write_protect(vcpu->kvm, sp->gfn);
1179
1180 if (protected)
1181 kvm_flush_remote_tlbs(vcpu->kvm);
1182
1183 for_each_sp(pages, sp, parents, i) {
1184 kvm_sync_page(vcpu, sp);
1185 mmu_pages_clear_parents(&parents);
1186 }
1074 cond_resched_lock(&vcpu->kvm->mmu_lock); 1187 cond_resched_lock(&vcpu->kvm->mmu_lock);
1188 kvm_mmu_pages_init(parent, &parents, &pages);
1189 }
1075} 1190}
1076 1191
1077static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu, 1192static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
@@ -1129,7 +1244,8 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
1129 sp->role = role; 1244 sp->role = role;
1130 hlist_add_head(&sp->hash_link, bucket); 1245 hlist_add_head(&sp->hash_link, bucket);
1131 if (!metaphysical) { 1246 if (!metaphysical) {
1132 rmap_write_protect(vcpu->kvm, gfn); 1247 if (rmap_write_protect(vcpu->kvm, gfn))
1248 kvm_flush_remote_tlbs(vcpu->kvm);
1133 account_shadowed(vcpu->kvm, gfn); 1249 account_shadowed(vcpu->kvm, gfn);
1134 } 1250 }
1135 if (shadow_trap_nonpresent_pte != shadow_notrap_nonpresent_pte) 1251 if (shadow_trap_nonpresent_pte != shadow_notrap_nonpresent_pte)
@@ -1153,6 +1269,8 @@ static int walk_shadow(struct kvm_shadow_walk *walker,
1153 if (level == PT32E_ROOT_LEVEL) { 1269 if (level == PT32E_ROOT_LEVEL) {
1154 shadow_addr = vcpu->arch.mmu.pae_root[(addr >> 30) & 3]; 1270 shadow_addr = vcpu->arch.mmu.pae_root[(addr >> 30) & 3];
1155 shadow_addr &= PT64_BASE_ADDR_MASK; 1271 shadow_addr &= PT64_BASE_ADDR_MASK;
1272 if (!shadow_addr)
1273 return 1;
1156 --level; 1274 --level;
1157 } 1275 }
1158 1276
@@ -1237,33 +1355,29 @@ static void kvm_mmu_unlink_parents(struct kvm *kvm, struct kvm_mmu_page *sp)
1237 } 1355 }
1238} 1356}
1239 1357
1240struct zap_walker { 1358static int mmu_zap_unsync_children(struct kvm *kvm,
1241 struct kvm_unsync_walk walker; 1359 struct kvm_mmu_page *parent)
1242 struct kvm *kvm;
1243 int zapped;
1244};
1245
1246static int mmu_zap_fn(struct kvm_mmu_page *sp, struct kvm_unsync_walk *walk)
1247{ 1360{
1248 struct zap_walker *zap_walk = container_of(walk, struct zap_walker, 1361 int i, zapped = 0;
1249 walker); 1362 struct mmu_page_path parents;
1250 kvm_mmu_zap_page(zap_walk->kvm, sp); 1363 struct kvm_mmu_pages pages;
1251 zap_walk->zapped = 1;
1252 return 0;
1253}
1254 1364
1255static int mmu_zap_unsync_children(struct kvm *kvm, struct kvm_mmu_page *sp) 1365 if (parent->role.level == PT_PAGE_TABLE_LEVEL)
1256{
1257 struct zap_walker walker = {
1258 .walker = { .entry = mmu_zap_fn, },
1259 .kvm = kvm,
1260 .zapped = 0,
1261 };
1262
1263 if (sp->role.level == PT_PAGE_TABLE_LEVEL)
1264 return 0; 1366 return 0;
1265 mmu_unsync_walk(sp, &walker.walker); 1367
1266 return walker.zapped; 1368 kvm_mmu_pages_init(parent, &parents, &pages);
1369 while (mmu_unsync_walk(parent, &pages)) {
1370 struct kvm_mmu_page *sp;
1371
1372 for_each_sp(pages, sp, parents, i) {
1373 kvm_mmu_zap_page(kvm, sp);
1374 mmu_pages_clear_parents(&parents);
1375 }
1376 zapped += pages.nr;
1377 kvm_mmu_pages_init(parent, &parents, &pages);
1378 }
1379
1380 return zapped;
1267} 1381}
1268 1382
1269static int kvm_mmu_zap_page(struct kvm *kvm, struct kvm_mmu_page *sp) 1383static int kvm_mmu_zap_page(struct kvm *kvm, struct kvm_mmu_page *sp)
@@ -1362,7 +1476,7 @@ static void page_header_update_slot(struct kvm *kvm, void *pte, gfn_t gfn)
1362 int slot = memslot_id(kvm, gfn_to_memslot(kvm, gfn)); 1476 int slot = memslot_id(kvm, gfn_to_memslot(kvm, gfn));
1363 struct kvm_mmu_page *sp = page_header(__pa(pte)); 1477 struct kvm_mmu_page *sp = page_header(__pa(pte));
1364 1478
1365 __set_bit(slot, &sp->slot_bitmap); 1479 __set_bit(slot, sp->slot_bitmap);
1366} 1480}
1367 1481
1368static void mmu_convert_notrap(struct kvm_mmu_page *sp) 1482static void mmu_convert_notrap(struct kvm_mmu_page *sp)
@@ -1393,6 +1507,110 @@ struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva)
1393 return page; 1507 return page;
1394} 1508}
1395 1509
1510/*
1511 * The function is based on mtrr_type_lookup() in
1512 * arch/x86/kernel/cpu/mtrr/generic.c
1513 */
1514static int get_mtrr_type(struct mtrr_state_type *mtrr_state,
1515 u64 start, u64 end)
1516{
1517 int i;
1518 u64 base, mask;
1519 u8 prev_match, curr_match;
1520 int num_var_ranges = KVM_NR_VAR_MTRR;
1521
1522 if (!mtrr_state->enabled)
1523 return 0xFF;
1524
1525 /* Make end inclusive end, instead of exclusive */
1526 end--;
1527
1528 /* Look in fixed ranges. Just return the type as per start */
1529 if (mtrr_state->have_fixed && (start < 0x100000)) {
1530 int idx;
1531
1532 if (start < 0x80000) {
1533 idx = 0;
1534 idx += (start >> 16);
1535 return mtrr_state->fixed_ranges[idx];
1536 } else if (start < 0xC0000) {
1537 idx = 1 * 8;
1538 idx += ((start - 0x80000) >> 14);
1539 return mtrr_state->fixed_ranges[idx];
1540 } else if (start < 0x1000000) {
1541 idx = 3 * 8;
1542 idx += ((start - 0xC0000) >> 12);
1543 return mtrr_state->fixed_ranges[idx];
1544 }
1545 }
1546
1547 /*
1548 * Look in variable ranges
1549 * Look of multiple ranges matching this address and pick type
1550 * as per MTRR precedence
1551 */
1552 if (!(mtrr_state->enabled & 2))
1553 return mtrr_state->def_type;
1554
1555 prev_match = 0xFF;
1556 for (i = 0; i < num_var_ranges; ++i) {
1557 unsigned short start_state, end_state;
1558
1559 if (!(mtrr_state->var_ranges[i].mask_lo & (1 << 11)))
1560 continue;
1561
1562 base = (((u64)mtrr_state->var_ranges[i].base_hi) << 32) +
1563 (mtrr_state->var_ranges[i].base_lo & PAGE_MASK);
1564 mask = (((u64)mtrr_state->var_ranges[i].mask_hi) << 32) +
1565 (mtrr_state->var_ranges[i].mask_lo & PAGE_MASK);
1566
1567 start_state = ((start & mask) == (base & mask));
1568 end_state = ((end & mask) == (base & mask));
1569 if (start_state != end_state)
1570 return 0xFE;
1571
1572 if ((start & mask) != (base & mask))
1573 continue;
1574
1575 curr_match = mtrr_state->var_ranges[i].base_lo & 0xff;
1576 if (prev_match == 0xFF) {
1577 prev_match = curr_match;
1578 continue;
1579 }
1580
1581 if (prev_match == MTRR_TYPE_UNCACHABLE ||
1582 curr_match == MTRR_TYPE_UNCACHABLE)
1583 return MTRR_TYPE_UNCACHABLE;
1584
1585 if ((prev_match == MTRR_TYPE_WRBACK &&
1586 curr_match == MTRR_TYPE_WRTHROUGH) ||
1587 (prev_match == MTRR_TYPE_WRTHROUGH &&
1588 curr_match == MTRR_TYPE_WRBACK)) {
1589 prev_match = MTRR_TYPE_WRTHROUGH;
1590 curr_match = MTRR_TYPE_WRTHROUGH;
1591 }
1592
1593 if (prev_match != curr_match)
1594 return MTRR_TYPE_UNCACHABLE;
1595 }
1596
1597 if (prev_match != 0xFF)
1598 return prev_match;
1599
1600 return mtrr_state->def_type;
1601}
1602
1603static u8 get_memory_type(struct kvm_vcpu *vcpu, gfn_t gfn)
1604{
1605 u8 mtrr;
1606
1607 mtrr = get_mtrr_type(&vcpu->arch.mtrr_state, gfn << PAGE_SHIFT,
1608 (gfn << PAGE_SHIFT) + PAGE_SIZE);
1609 if (mtrr == 0xfe || mtrr == 0xff)
1610 mtrr = MTRR_TYPE_WRBACK;
1611 return mtrr;
1612}
1613
1396static int kvm_unsync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp) 1614static int kvm_unsync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
1397{ 1615{
1398 unsigned index; 1616 unsigned index;
@@ -1409,9 +1627,15 @@ static int kvm_unsync_page(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
1409 if (s->role.word != sp->role.word) 1627 if (s->role.word != sp->role.word)
1410 return 1; 1628 return 1;
1411 } 1629 }
1412 kvm_mmu_mark_parents_unsync(vcpu, sp);
1413 ++vcpu->kvm->stat.mmu_unsync; 1630 ++vcpu->kvm->stat.mmu_unsync;
1414 sp->unsync = 1; 1631 sp->unsync = 1;
1632
1633 if (sp->global) {
1634 list_add(&sp->oos_link, &vcpu->kvm->arch.oos_global_pages);
1635 ++vcpu->kvm->stat.mmu_unsync_global;
1636 } else
1637 kvm_mmu_mark_parents_unsync(vcpu, sp);
1638
1415 mmu_convert_notrap(sp); 1639 mmu_convert_notrap(sp);
1416 return 0; 1640 return 0;
1417} 1641}
@@ -1437,11 +1661,24 @@ static int mmu_need_write_protect(struct kvm_vcpu *vcpu, gfn_t gfn,
1437static int set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte, 1661static int set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
1438 unsigned pte_access, int user_fault, 1662 unsigned pte_access, int user_fault,
1439 int write_fault, int dirty, int largepage, 1663 int write_fault, int dirty, int largepage,
1440 gfn_t gfn, pfn_t pfn, bool speculative, 1664 int global, gfn_t gfn, pfn_t pfn, bool speculative,
1441 bool can_unsync) 1665 bool can_unsync)
1442{ 1666{
1443 u64 spte; 1667 u64 spte;
1444 int ret = 0; 1668 int ret = 0;
1669 u64 mt_mask = shadow_mt_mask;
1670 struct kvm_mmu_page *sp = page_header(__pa(shadow_pte));
1671
1672 if (!(vcpu->arch.cr4 & X86_CR4_PGE))
1673 global = 0;
1674 if (!global && sp->global) {
1675 sp->global = 0;
1676 if (sp->unsync) {
1677 kvm_unlink_unsync_global(vcpu->kvm, sp);
1678 kvm_mmu_mark_parents_unsync(vcpu, sp);
1679 }
1680 }
1681
1445 /* 1682 /*
1446 * We don't set the accessed bit, since we sometimes want to see 1683 * We don't set the accessed bit, since we sometimes want to see
1447 * whether the guest actually used the pte (in order to detect 1684 * whether the guest actually used the pte (in order to detect
@@ -1460,6 +1697,11 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
1460 spte |= shadow_user_mask; 1697 spte |= shadow_user_mask;
1461 if (largepage) 1698 if (largepage)
1462 spte |= PT_PAGE_SIZE_MASK; 1699 spte |= PT_PAGE_SIZE_MASK;
1700 if (mt_mask) {
1701 mt_mask = get_memory_type(vcpu, gfn) <<
1702 kvm_x86_ops->get_mt_mask_shift();
1703 spte |= mt_mask;
1704 }
1463 1705
1464 spte |= (u64)pfn << PAGE_SHIFT; 1706 spte |= (u64)pfn << PAGE_SHIFT;
1465 1707
@@ -1474,6 +1716,15 @@ static int set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
1474 1716
1475 spte |= PT_WRITABLE_MASK; 1717 spte |= PT_WRITABLE_MASK;
1476 1718
1719 /*
1720 * Optimization: for pte sync, if spte was writable the hash
1721 * lookup is unnecessary (and expensive). Write protection
1722 * is responsibility of mmu_get_page / kvm_sync_page.
1723 * Same reasoning can be applied to dirty page accounting.
1724 */
1725 if (!can_unsync && is_writeble_pte(*shadow_pte))
1726 goto set_pte;
1727
1477 if (mmu_need_write_protect(vcpu, gfn, can_unsync)) { 1728 if (mmu_need_write_protect(vcpu, gfn, can_unsync)) {
1478 pgprintk("%s: found shadow page for %lx, marking ro\n", 1729 pgprintk("%s: found shadow page for %lx, marking ro\n",
1479 __func__, gfn); 1730 __func__, gfn);
@@ -1495,8 +1746,8 @@ set_pte:
1495static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte, 1746static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
1496 unsigned pt_access, unsigned pte_access, 1747 unsigned pt_access, unsigned pte_access,
1497 int user_fault, int write_fault, int dirty, 1748 int user_fault, int write_fault, int dirty,
1498 int *ptwrite, int largepage, gfn_t gfn, 1749 int *ptwrite, int largepage, int global,
1499 pfn_t pfn, bool speculative) 1750 gfn_t gfn, pfn_t pfn, bool speculative)
1500{ 1751{
1501 int was_rmapped = 0; 1752 int was_rmapped = 0;
1502 int was_writeble = is_writeble_pte(*shadow_pte); 1753 int was_writeble = is_writeble_pte(*shadow_pte);
@@ -1529,7 +1780,7 @@ static void mmu_set_spte(struct kvm_vcpu *vcpu, u64 *shadow_pte,
1529 } 1780 }
1530 } 1781 }
1531 if (set_spte(vcpu, shadow_pte, pte_access, user_fault, write_fault, 1782 if (set_spte(vcpu, shadow_pte, pte_access, user_fault, write_fault,
1532 dirty, largepage, gfn, pfn, speculative, true)) { 1783 dirty, largepage, global, gfn, pfn, speculative, true)) {
1533 if (write_fault) 1784 if (write_fault)
1534 *ptwrite = 1; 1785 *ptwrite = 1;
1535 kvm_x86_ops->tlb_flush(vcpu); 1786 kvm_x86_ops->tlb_flush(vcpu);
@@ -1586,7 +1837,7 @@ static int direct_map_entry(struct kvm_shadow_walk *_walk,
1586 || (walk->largepage && level == PT_DIRECTORY_LEVEL)) { 1837 || (walk->largepage && level == PT_DIRECTORY_LEVEL)) {
1587 mmu_set_spte(vcpu, sptep, ACC_ALL, ACC_ALL, 1838 mmu_set_spte(vcpu, sptep, ACC_ALL, ACC_ALL,
1588 0, walk->write, 1, &walk->pt_write, 1839 0, walk->write, 1, &walk->pt_write,
1589 walk->largepage, gfn, walk->pfn, false); 1840 walk->largepage, 0, gfn, walk->pfn, false);
1590 ++vcpu->stat.pf_fixed; 1841 ++vcpu->stat.pf_fixed;
1591 return 1; 1842 return 1;
1592 } 1843 }
@@ -1773,6 +2024,15 @@ static void mmu_sync_roots(struct kvm_vcpu *vcpu)
1773 } 2024 }
1774} 2025}
1775 2026
2027static void mmu_sync_global(struct kvm_vcpu *vcpu)
2028{
2029 struct kvm *kvm = vcpu->kvm;
2030 struct kvm_mmu_page *sp, *n;
2031
2032 list_for_each_entry_safe(sp, n, &kvm->arch.oos_global_pages, oos_link)
2033 kvm_sync_page(vcpu, sp);
2034}
2035
1776void kvm_mmu_sync_roots(struct kvm_vcpu *vcpu) 2036void kvm_mmu_sync_roots(struct kvm_vcpu *vcpu)
1777{ 2037{
1778 spin_lock(&vcpu->kvm->mmu_lock); 2038 spin_lock(&vcpu->kvm->mmu_lock);
@@ -1780,6 +2040,13 @@ void kvm_mmu_sync_roots(struct kvm_vcpu *vcpu)
1780 spin_unlock(&vcpu->kvm->mmu_lock); 2040 spin_unlock(&vcpu->kvm->mmu_lock);
1781} 2041}
1782 2042
2043void kvm_mmu_sync_global(struct kvm_vcpu *vcpu)
2044{
2045 spin_lock(&vcpu->kvm->mmu_lock);
2046 mmu_sync_global(vcpu);
2047 spin_unlock(&vcpu->kvm->mmu_lock);
2048}
2049
1783static gpa_t nonpaging_gva_to_gpa(struct kvm_vcpu *vcpu, gva_t vaddr) 2050static gpa_t nonpaging_gva_to_gpa(struct kvm_vcpu *vcpu, gva_t vaddr)
1784{ 2051{
1785 return vaddr; 2052 return vaddr;
@@ -2178,7 +2445,8 @@ static void kvm_mmu_access_page(struct kvm_vcpu *vcpu, gfn_t gfn)
2178} 2445}
2179 2446
2180void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa, 2447void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
2181 const u8 *new, int bytes) 2448 const u8 *new, int bytes,
2449 bool guest_initiated)
2182{ 2450{
2183 gfn_t gfn = gpa >> PAGE_SHIFT; 2451 gfn_t gfn = gpa >> PAGE_SHIFT;
2184 struct kvm_mmu_page *sp; 2452 struct kvm_mmu_page *sp;
@@ -2204,15 +2472,17 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
2204 kvm_mmu_free_some_pages(vcpu); 2472 kvm_mmu_free_some_pages(vcpu);
2205 ++vcpu->kvm->stat.mmu_pte_write; 2473 ++vcpu->kvm->stat.mmu_pte_write;
2206 kvm_mmu_audit(vcpu, "pre pte write"); 2474 kvm_mmu_audit(vcpu, "pre pte write");
2207 if (gfn == vcpu->arch.last_pt_write_gfn 2475 if (guest_initiated) {
2208 && !last_updated_pte_accessed(vcpu)) { 2476 if (gfn == vcpu->arch.last_pt_write_gfn
2209 ++vcpu->arch.last_pt_write_count; 2477 && !last_updated_pte_accessed(vcpu)) {
2210 if (vcpu->arch.last_pt_write_count >= 3) 2478 ++vcpu->arch.last_pt_write_count;
2211 flooded = 1; 2479 if (vcpu->arch.last_pt_write_count >= 3)
2212 } else { 2480 flooded = 1;
2213 vcpu->arch.last_pt_write_gfn = gfn; 2481 } else {
2214 vcpu->arch.last_pt_write_count = 1; 2482 vcpu->arch.last_pt_write_gfn = gfn;
2215 vcpu->arch.last_pte_updated = NULL; 2483 vcpu->arch.last_pt_write_count = 1;
2484 vcpu->arch.last_pte_updated = NULL;
2485 }
2216 } 2486 }
2217 index = kvm_page_table_hashfn(gfn); 2487 index = kvm_page_table_hashfn(gfn);
2218 bucket = &vcpu->kvm->arch.mmu_page_hash[index]; 2488 bucket = &vcpu->kvm->arch.mmu_page_hash[index];
@@ -2352,9 +2622,7 @@ EXPORT_SYMBOL_GPL(kvm_mmu_page_fault);
2352 2622
2353void kvm_mmu_invlpg(struct kvm_vcpu *vcpu, gva_t gva) 2623void kvm_mmu_invlpg(struct kvm_vcpu *vcpu, gva_t gva)
2354{ 2624{
2355 spin_lock(&vcpu->kvm->mmu_lock);
2356 vcpu->arch.mmu.invlpg(vcpu, gva); 2625 vcpu->arch.mmu.invlpg(vcpu, gva);
2357 spin_unlock(&vcpu->kvm->mmu_lock);
2358 kvm_mmu_flush_tlb(vcpu); 2626 kvm_mmu_flush_tlb(vcpu);
2359 ++vcpu->stat.invlpg; 2627 ++vcpu->stat.invlpg;
2360} 2628}
@@ -2451,7 +2719,7 @@ void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot)
2451 int i; 2719 int i;
2452 u64 *pt; 2720 u64 *pt;
2453 2721
2454 if (!test_bit(slot, &sp->slot_bitmap)) 2722 if (!test_bit(slot, sp->slot_bitmap))
2455 continue; 2723 continue;
2456 2724
2457 pt = sp->spt; 2725 pt = sp->spt;
@@ -2860,8 +3128,8 @@ static void audit_write_protection(struct kvm_vcpu *vcpu)
2860 if (sp->role.metaphysical) 3128 if (sp->role.metaphysical)
2861 continue; 3129 continue;
2862 3130
2863 slot = gfn_to_memslot(vcpu->kvm, sp->gfn);
2864 gfn = unalias_gfn(vcpu->kvm, sp->gfn); 3131 gfn = unalias_gfn(vcpu->kvm, sp->gfn);
3132 slot = gfn_to_memslot_unaliased(vcpu->kvm, sp->gfn);
2865 rmapp = &slot->rmap[gfn - slot->base_gfn]; 3133 rmapp = &slot->rmap[gfn - slot->base_gfn];
2866 if (*rmapp) 3134 if (*rmapp)
2867 printk(KERN_ERR "%s: (%s) shadow page has writable" 3135 printk(KERN_ERR "%s: (%s) shadow page has writable"
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
index 84eee43bbe74..9fd78b6e17ad 100644
--- a/arch/x86/kvm/paging_tmpl.h
+++ b/arch/x86/kvm/paging_tmpl.h
@@ -82,6 +82,7 @@ struct shadow_walker {
82 int *ptwrite; 82 int *ptwrite;
83 pfn_t pfn; 83 pfn_t pfn;
84 u64 *sptep; 84 u64 *sptep;
85 gpa_t pte_gpa;
85}; 86};
86 87
87static gfn_t gpte_to_gfn(pt_element_t gpte) 88static gfn_t gpte_to_gfn(pt_element_t gpte)
@@ -222,7 +223,7 @@ walk:
222 if (ret) 223 if (ret)
223 goto walk; 224 goto walk;
224 pte |= PT_DIRTY_MASK; 225 pte |= PT_DIRTY_MASK;
225 kvm_mmu_pte_write(vcpu, pte_gpa, (u8 *)&pte, sizeof(pte)); 226 kvm_mmu_pte_write(vcpu, pte_gpa, (u8 *)&pte, sizeof(pte), 0);
226 walker->ptes[walker->level - 1] = pte; 227 walker->ptes[walker->level - 1] = pte;
227 } 228 }
228 229
@@ -274,7 +275,8 @@ static void FNAME(update_pte)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *page,
274 return; 275 return;
275 kvm_get_pfn(pfn); 276 kvm_get_pfn(pfn);
276 mmu_set_spte(vcpu, spte, page->role.access, pte_access, 0, 0, 277 mmu_set_spte(vcpu, spte, page->role.access, pte_access, 0, 0,
277 gpte & PT_DIRTY_MASK, NULL, largepage, gpte_to_gfn(gpte), 278 gpte & PT_DIRTY_MASK, NULL, largepage,
279 gpte & PT_GLOBAL_MASK, gpte_to_gfn(gpte),
278 pfn, true); 280 pfn, true);
279} 281}
280 282
@@ -301,8 +303,9 @@ static int FNAME(shadow_walk_entry)(struct kvm_shadow_walk *_sw,
301 mmu_set_spte(vcpu, sptep, access, gw->pte_access & access, 303 mmu_set_spte(vcpu, sptep, access, gw->pte_access & access,
302 sw->user_fault, sw->write_fault, 304 sw->user_fault, sw->write_fault,
303 gw->ptes[gw->level-1] & PT_DIRTY_MASK, 305 gw->ptes[gw->level-1] & PT_DIRTY_MASK,
304 sw->ptwrite, sw->largepage, gw->gfn, sw->pfn, 306 sw->ptwrite, sw->largepage,
305 false); 307 gw->ptes[gw->level-1] & PT_GLOBAL_MASK,
308 gw->gfn, sw->pfn, false);
306 sw->sptep = sptep; 309 sw->sptep = sptep;
307 return 1; 310 return 1;
308 } 311 }
@@ -466,10 +469,22 @@ static int FNAME(shadow_invlpg_entry)(struct kvm_shadow_walk *_sw,
466 struct kvm_vcpu *vcpu, u64 addr, 469 struct kvm_vcpu *vcpu, u64 addr,
467 u64 *sptep, int level) 470 u64 *sptep, int level)
468{ 471{
472 struct shadow_walker *sw =
473 container_of(_sw, struct shadow_walker, walker);
469 474
470 if (level == PT_PAGE_TABLE_LEVEL) { 475 /* FIXME: properly handle invlpg on large guest pages */
471 if (is_shadow_present_pte(*sptep)) 476 if (level == PT_PAGE_TABLE_LEVEL ||
477 ((level == PT_DIRECTORY_LEVEL) && is_large_pte(*sptep))) {
478 struct kvm_mmu_page *sp = page_header(__pa(sptep));
479
480 sw->pte_gpa = (sp->gfn << PAGE_SHIFT);
481 sw->pte_gpa += (sptep - sp->spt) * sizeof(pt_element_t);
482
483 if (is_shadow_present_pte(*sptep)) {
472 rmap_remove(vcpu->kvm, sptep); 484 rmap_remove(vcpu->kvm, sptep);
485 if (is_large_pte(*sptep))
486 --vcpu->kvm->stat.lpages;
487 }
473 set_shadow_pte(sptep, shadow_trap_nonpresent_pte); 488 set_shadow_pte(sptep, shadow_trap_nonpresent_pte);
474 return 1; 489 return 1;
475 } 490 }
@@ -480,11 +495,26 @@ static int FNAME(shadow_invlpg_entry)(struct kvm_shadow_walk *_sw,
480 495
481static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva) 496static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva)
482{ 497{
498 pt_element_t gpte;
483 struct shadow_walker walker = { 499 struct shadow_walker walker = {
484 .walker = { .entry = FNAME(shadow_invlpg_entry), }, 500 .walker = { .entry = FNAME(shadow_invlpg_entry), },
501 .pte_gpa = -1,
485 }; 502 };
486 503
504 spin_lock(&vcpu->kvm->mmu_lock);
487 walk_shadow(&walker.walker, vcpu, gva); 505 walk_shadow(&walker.walker, vcpu, gva);
506 spin_unlock(&vcpu->kvm->mmu_lock);
507 if (walker.pte_gpa == -1)
508 return;
509 if (kvm_read_guest_atomic(vcpu->kvm, walker.pte_gpa, &gpte,
510 sizeof(pt_element_t)))
511 return;
512 if (is_present_pte(gpte) && (gpte & PT_ACCESSED_MASK)) {
513 if (mmu_topup_memory_caches(vcpu))
514 return;
515 kvm_mmu_pte_write(vcpu, walker.pte_gpa, (const u8 *)&gpte,
516 sizeof(pt_element_t), 0);
517 }
488} 518}
489 519
490static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr) 520static gpa_t FNAME(gva_to_gpa)(struct kvm_vcpu *vcpu, gva_t vaddr)
@@ -580,7 +610,7 @@ static int FNAME(sync_page)(struct kvm_vcpu *vcpu, struct kvm_mmu_page *sp)
580 nr_present++; 610 nr_present++;
581 pte_access = sp->role.access & FNAME(gpte_access)(vcpu, gpte); 611 pte_access = sp->role.access & FNAME(gpte_access)(vcpu, gpte);
582 set_spte(vcpu, &sp->spt[i], pte_access, 0, 0, 612 set_spte(vcpu, &sp->spt[i], pte_access, 0, 0,
583 is_dirty_pte(gpte), 0, gfn, 613 is_dirty_pte(gpte), 0, gpte & PT_GLOBAL_MASK, gfn,
584 spte_to_pfn(sp->spt[i]), true, false); 614 spte_to_pfn(sp->spt[i]), true, false);
585 } 615 }
586 616
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 9c4ce657d963..1452851ae258 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -28,6 +28,8 @@
28 28
29#include <asm/desc.h> 29#include <asm/desc.h>
30 30
31#include <asm/virtext.h>
32
31#define __ex(x) __kvm_handle_fault_on_reboot(x) 33#define __ex(x) __kvm_handle_fault_on_reboot(x)
32 34
33MODULE_AUTHOR("Qumranet"); 35MODULE_AUTHOR("Qumranet");
@@ -245,34 +247,19 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
245 247
246static int has_svm(void) 248static int has_svm(void)
247{ 249{
248 uint32_t eax, ebx, ecx, edx; 250 const char *msg;
249
250 if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) {
251 printk(KERN_INFO "has_svm: not amd\n");
252 return 0;
253 }
254 251
255 cpuid(0x80000000, &eax, &ebx, &ecx, &edx); 252 if (!cpu_has_svm(&msg)) {
256 if (eax < SVM_CPUID_FUNC) { 253 printk(KERN_INFO "has_svn: %s\n", msg);
257 printk(KERN_INFO "has_svm: can't execute cpuid_8000000a\n");
258 return 0; 254 return 0;
259 } 255 }
260 256
261 cpuid(0x80000001, &eax, &ebx, &ecx, &edx);
262 if (!(ecx & (1 << SVM_CPUID_FEATURE_SHIFT))) {
263 printk(KERN_DEBUG "has_svm: svm not available\n");
264 return 0;
265 }
266 return 1; 257 return 1;
267} 258}
268 259
269static void svm_hardware_disable(void *garbage) 260static void svm_hardware_disable(void *garbage)
270{ 261{
271 uint64_t efer; 262 cpu_svm_disable();
272
273 wrmsrl(MSR_VM_HSAVE_PA, 0);
274 rdmsrl(MSR_EFER, efer);
275 wrmsrl(MSR_EFER, efer & ~MSR_EFER_SVME_MASK);
276} 263}
277 264
278static void svm_hardware_enable(void *garbage) 265static void svm_hardware_enable(void *garbage)
@@ -772,6 +759,22 @@ static void svm_get_segment(struct kvm_vcpu *vcpu,
772 var->l = (s->attrib >> SVM_SELECTOR_L_SHIFT) & 1; 759 var->l = (s->attrib >> SVM_SELECTOR_L_SHIFT) & 1;
773 var->db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1; 760 var->db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1;
774 var->g = (s->attrib >> SVM_SELECTOR_G_SHIFT) & 1; 761 var->g = (s->attrib >> SVM_SELECTOR_G_SHIFT) & 1;
762
763 /*
764 * SVM always stores 0 for the 'G' bit in the CS selector in
765 * the VMCB on a VMEXIT. This hurts cross-vendor migration:
766 * Intel's VMENTRY has a check on the 'G' bit.
767 */
768 if (seg == VCPU_SREG_CS)
769 var->g = s->limit > 0xfffff;
770
771 /*
772 * Work around a bug where the busy flag in the tr selector
773 * isn't exposed
774 */
775 if (seg == VCPU_SREG_TR)
776 var->type |= 0x2;
777
775 var->unusable = !var->present; 778 var->unusable = !var->present;
776} 779}
777 780
@@ -1099,6 +1102,7 @@ static int io_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1099 rep = (io_info & SVM_IOIO_REP_MASK) != 0; 1102 rep = (io_info & SVM_IOIO_REP_MASK) != 0;
1100 down = (svm->vmcb->save.rflags & X86_EFLAGS_DF) != 0; 1103 down = (svm->vmcb->save.rflags & X86_EFLAGS_DF) != 0;
1101 1104
1105 skip_emulated_instruction(&svm->vcpu);
1102 return kvm_emulate_pio(&svm->vcpu, kvm_run, in, size, port); 1106 return kvm_emulate_pio(&svm->vcpu, kvm_run, in, size, port);
1103} 1107}
1104 1108
@@ -1912,6 +1916,11 @@ static int get_npt_level(void)
1912#endif 1916#endif
1913} 1917}
1914 1918
1919static int svm_get_mt_mask_shift(void)
1920{
1921 return 0;
1922}
1923
1915static struct kvm_x86_ops svm_x86_ops = { 1924static struct kvm_x86_ops svm_x86_ops = {
1916 .cpu_has_kvm_support = has_svm, 1925 .cpu_has_kvm_support = has_svm,
1917 .disabled_by_bios = is_disabled, 1926 .disabled_by_bios = is_disabled,
@@ -1967,6 +1976,7 @@ static struct kvm_x86_ops svm_x86_ops = {
1967 1976
1968 .set_tss_addr = svm_set_tss_addr, 1977 .set_tss_addr = svm_set_tss_addr,
1969 .get_tdp_level = get_npt_level, 1978 .get_tdp_level = get_npt_level,
1979 .get_mt_mask_shift = svm_get_mt_mask_shift,
1970}; 1980};
1971 1981
1972static int __init svm_init(void) 1982static int __init svm_init(void)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a4018b01e1f9..6259d7467648 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -16,7 +16,6 @@
16 */ 16 */
17 17
18#include "irq.h" 18#include "irq.h"
19#include "vmx.h"
20#include "mmu.h" 19#include "mmu.h"
21 20
22#include <linux/kvm_host.h> 21#include <linux/kvm_host.h>
@@ -31,6 +30,8 @@
31 30
32#include <asm/io.h> 31#include <asm/io.h>
33#include <asm/desc.h> 32#include <asm/desc.h>
33#include <asm/vmx.h>
34#include <asm/virtext.h>
34 35
35#define __ex(x) __kvm_handle_fault_on_reboot(x) 36#define __ex(x) __kvm_handle_fault_on_reboot(x)
36 37
@@ -90,6 +91,11 @@ struct vcpu_vmx {
90 } rmode; 91 } rmode;
91 int vpid; 92 int vpid;
92 bool emulation_required; 93 bool emulation_required;
94
95 /* Support for vnmi-less CPUs */
96 int soft_vnmi_blocked;
97 ktime_t entry_time;
98 s64 vnmi_blocked_time;
93}; 99};
94 100
95static inline struct vcpu_vmx *to_vmx(struct kvm_vcpu *vcpu) 101static inline struct vcpu_vmx *to_vmx(struct kvm_vcpu *vcpu)
@@ -122,7 +128,7 @@ static struct vmcs_config {
122 u32 vmentry_ctrl; 128 u32 vmentry_ctrl;
123} vmcs_config; 129} vmcs_config;
124 130
125struct vmx_capability { 131static struct vmx_capability {
126 u32 ept; 132 u32 ept;
127 u32 vpid; 133 u32 vpid;
128} vmx_capability; 134} vmx_capability;
@@ -957,6 +963,13 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
957 pr_unimpl(vcpu, "unimplemented perfctr wrmsr: 0x%x data 0x%llx\n", msr_index, data); 963 pr_unimpl(vcpu, "unimplemented perfctr wrmsr: 0x%x data 0x%llx\n", msr_index, data);
958 964
959 break; 965 break;
966 case MSR_IA32_CR_PAT:
967 if (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_IA32_PAT) {
968 vmcs_write64(GUEST_IA32_PAT, data);
969 vcpu->arch.pat = data;
970 break;
971 }
972 /* Otherwise falls through to kvm_set_msr_common */
960 default: 973 default:
961 vmx_load_host_state(vmx); 974 vmx_load_host_state(vmx);
962 msr = find_msr_entry(vmx, msr_index); 975 msr = find_msr_entry(vmx, msr_index);
@@ -1032,8 +1045,7 @@ static int vmx_get_irq(struct kvm_vcpu *vcpu)
1032 1045
1033static __init int cpu_has_kvm_support(void) 1046static __init int cpu_has_kvm_support(void)
1034{ 1047{
1035 unsigned long ecx = cpuid_ecx(1); 1048 return cpu_has_vmx();
1036 return test_bit(5, &ecx); /* CPUID.1:ECX.VMX[bit 5] -> VT */
1037} 1049}
1038 1050
1039static __init int vmx_disabled_by_bios(void) 1051static __init int vmx_disabled_by_bios(void)
@@ -1079,13 +1091,22 @@ static void vmclear_local_vcpus(void)
1079 __vcpu_clear(vmx); 1091 __vcpu_clear(vmx);
1080} 1092}
1081 1093
1082static void hardware_disable(void *garbage) 1094
1095/* Just like cpu_vmxoff(), but with the __kvm_handle_fault_on_reboot()
1096 * tricks.
1097 */
1098static void kvm_cpu_vmxoff(void)
1083{ 1099{
1084 vmclear_local_vcpus();
1085 asm volatile (__ex(ASM_VMX_VMXOFF) : : : "cc"); 1100 asm volatile (__ex(ASM_VMX_VMXOFF) : : : "cc");
1086 write_cr4(read_cr4() & ~X86_CR4_VMXE); 1101 write_cr4(read_cr4() & ~X86_CR4_VMXE);
1087} 1102}
1088 1103
1104static void hardware_disable(void *garbage)
1105{
1106 vmclear_local_vcpus();
1107 kvm_cpu_vmxoff();
1108}
1109
1089static __init int adjust_vmx_controls(u32 ctl_min, u32 ctl_opt, 1110static __init int adjust_vmx_controls(u32 ctl_min, u32 ctl_opt,
1090 u32 msr, u32 *result) 1111 u32 msr, u32 *result)
1091{ 1112{
@@ -1176,12 +1197,13 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf)
1176#ifdef CONFIG_X86_64 1197#ifdef CONFIG_X86_64
1177 min |= VM_EXIT_HOST_ADDR_SPACE_SIZE; 1198 min |= VM_EXIT_HOST_ADDR_SPACE_SIZE;
1178#endif 1199#endif
1179 opt = 0; 1200 opt = VM_EXIT_SAVE_IA32_PAT | VM_EXIT_LOAD_IA32_PAT;
1180 if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_EXIT_CTLS, 1201 if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_EXIT_CTLS,
1181 &_vmexit_control) < 0) 1202 &_vmexit_control) < 0)
1182 return -EIO; 1203 return -EIO;
1183 1204
1184 min = opt = 0; 1205 min = 0;
1206 opt = VM_ENTRY_LOAD_IA32_PAT;
1185 if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_ENTRY_CTLS, 1207 if (adjust_vmx_controls(min, opt, MSR_IA32_VMX_ENTRY_CTLS,
1186 &_vmentry_control) < 0) 1208 &_vmentry_control) < 0)
1187 return -EIO; 1209 return -EIO;
@@ -2087,8 +2109,9 @@ static void vmx_disable_intercept_for_msr(struct page *msr_bitmap, u32 msr)
2087 */ 2109 */
2088static int vmx_vcpu_setup(struct vcpu_vmx *vmx) 2110static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
2089{ 2111{
2090 u32 host_sysenter_cs; 2112 u32 host_sysenter_cs, msr_low, msr_high;
2091 u32 junk; 2113 u32 junk;
2114 u64 host_pat;
2092 unsigned long a; 2115 unsigned long a;
2093 struct descriptor_table dt; 2116 struct descriptor_table dt;
2094 int i; 2117 int i;
@@ -2176,6 +2199,20 @@ static int vmx_vcpu_setup(struct vcpu_vmx *vmx)
2176 rdmsrl(MSR_IA32_SYSENTER_EIP, a); 2199 rdmsrl(MSR_IA32_SYSENTER_EIP, a);
2177 vmcs_writel(HOST_IA32_SYSENTER_EIP, a); /* 22.2.3 */ 2200 vmcs_writel(HOST_IA32_SYSENTER_EIP, a); /* 22.2.3 */
2178 2201
2202 if (vmcs_config.vmexit_ctrl & VM_EXIT_LOAD_IA32_PAT) {
2203 rdmsr(MSR_IA32_CR_PAT, msr_low, msr_high);
2204 host_pat = msr_low | ((u64) msr_high << 32);
2205 vmcs_write64(HOST_IA32_PAT, host_pat);
2206 }
2207 if (vmcs_config.vmentry_ctrl & VM_ENTRY_LOAD_IA32_PAT) {
2208 rdmsr(MSR_IA32_CR_PAT, msr_low, msr_high);
2209 host_pat = msr_low | ((u64) msr_high << 32);
2210 /* Write the default value follow host pat */
2211 vmcs_write64(GUEST_IA32_PAT, host_pat);
2212 /* Keep arch.pat sync with GUEST_IA32_PAT */
2213 vmx->vcpu.arch.pat = host_pat;
2214 }
2215
2179 for (i = 0; i < NR_VMX_MSR; ++i) { 2216 for (i = 0; i < NR_VMX_MSR; ++i) {
2180 u32 index = vmx_msr_index[i]; 2217 u32 index = vmx_msr_index[i];
2181 u32 data_low, data_high; 2218 u32 data_low, data_high;
@@ -2230,6 +2267,8 @@ static int vmx_vcpu_reset(struct kvm_vcpu *vcpu)
2230 2267
2231 vmx->vcpu.arch.rmode.active = 0; 2268 vmx->vcpu.arch.rmode.active = 0;
2232 2269
2270 vmx->soft_vnmi_blocked = 0;
2271
2233 vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val(); 2272 vmx->vcpu.arch.regs[VCPU_REGS_RDX] = get_rdx_init_val();
2234 kvm_set_cr8(&vmx->vcpu, 0); 2273 kvm_set_cr8(&vmx->vcpu, 0);
2235 msr = 0xfee00000 | MSR_IA32_APICBASE_ENABLE; 2274 msr = 0xfee00000 | MSR_IA32_APICBASE_ENABLE;
@@ -2335,6 +2374,29 @@ out:
2335 return ret; 2374 return ret;
2336} 2375}
2337 2376
2377static void enable_irq_window(struct kvm_vcpu *vcpu)
2378{
2379 u32 cpu_based_vm_exec_control;
2380
2381 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
2382 cpu_based_vm_exec_control |= CPU_BASED_VIRTUAL_INTR_PENDING;
2383 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
2384}
2385
2386static void enable_nmi_window(struct kvm_vcpu *vcpu)
2387{
2388 u32 cpu_based_vm_exec_control;
2389
2390 if (!cpu_has_virtual_nmis()) {
2391 enable_irq_window(vcpu);
2392 return;
2393 }
2394
2395 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
2396 cpu_based_vm_exec_control |= CPU_BASED_VIRTUAL_NMI_PENDING;
2397 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
2398}
2399
2338static void vmx_inject_irq(struct kvm_vcpu *vcpu, int irq) 2400static void vmx_inject_irq(struct kvm_vcpu *vcpu, int irq)
2339{ 2401{
2340 struct vcpu_vmx *vmx = to_vmx(vcpu); 2402 struct vcpu_vmx *vmx = to_vmx(vcpu);
@@ -2358,10 +2420,54 @@ static void vmx_inject_irq(struct kvm_vcpu *vcpu, int irq)
2358 2420
2359static void vmx_inject_nmi(struct kvm_vcpu *vcpu) 2421static void vmx_inject_nmi(struct kvm_vcpu *vcpu)
2360{ 2422{
2423 struct vcpu_vmx *vmx = to_vmx(vcpu);
2424
2425 if (!cpu_has_virtual_nmis()) {
2426 /*
2427 * Tracking the NMI-blocked state in software is built upon
2428 * finding the next open IRQ window. This, in turn, depends on
2429 * well-behaving guests: They have to keep IRQs disabled at
2430 * least as long as the NMI handler runs. Otherwise we may
2431 * cause NMI nesting, maybe breaking the guest. But as this is
2432 * highly unlikely, we can live with the residual risk.
2433 */
2434 vmx->soft_vnmi_blocked = 1;
2435 vmx->vnmi_blocked_time = 0;
2436 }
2437
2438 ++vcpu->stat.nmi_injections;
2439 if (vcpu->arch.rmode.active) {
2440 vmx->rmode.irq.pending = true;
2441 vmx->rmode.irq.vector = NMI_VECTOR;
2442 vmx->rmode.irq.rip = kvm_rip_read(vcpu);
2443 vmcs_write32(VM_ENTRY_INTR_INFO_FIELD,
2444 NMI_VECTOR | INTR_TYPE_SOFT_INTR |
2445 INTR_INFO_VALID_MASK);
2446 vmcs_write32(VM_ENTRY_INSTRUCTION_LEN, 1);
2447 kvm_rip_write(vcpu, vmx->rmode.irq.rip - 1);
2448 return;
2449 }
2361 vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, 2450 vmcs_write32(VM_ENTRY_INTR_INFO_FIELD,
2362 INTR_TYPE_NMI_INTR | INTR_INFO_VALID_MASK | NMI_VECTOR); 2451 INTR_TYPE_NMI_INTR | INTR_INFO_VALID_MASK | NMI_VECTOR);
2363} 2452}
2364 2453
2454static void vmx_update_window_states(struct kvm_vcpu *vcpu)
2455{
2456 u32 guest_intr = vmcs_read32(GUEST_INTERRUPTIBILITY_INFO);
2457
2458 vcpu->arch.nmi_window_open =
2459 !(guest_intr & (GUEST_INTR_STATE_STI |
2460 GUEST_INTR_STATE_MOV_SS |
2461 GUEST_INTR_STATE_NMI));
2462 if (!cpu_has_virtual_nmis() && to_vmx(vcpu)->soft_vnmi_blocked)
2463 vcpu->arch.nmi_window_open = 0;
2464
2465 vcpu->arch.interrupt_window_open =
2466 ((vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) &&
2467 !(guest_intr & (GUEST_INTR_STATE_STI |
2468 GUEST_INTR_STATE_MOV_SS)));
2469}
2470
2365static void kvm_do_inject_irq(struct kvm_vcpu *vcpu) 2471static void kvm_do_inject_irq(struct kvm_vcpu *vcpu)
2366{ 2472{
2367 int word_index = __ffs(vcpu->arch.irq_summary); 2473 int word_index = __ffs(vcpu->arch.irq_summary);
@@ -2374,40 +2480,49 @@ static void kvm_do_inject_irq(struct kvm_vcpu *vcpu)
2374 kvm_queue_interrupt(vcpu, irq); 2480 kvm_queue_interrupt(vcpu, irq);
2375} 2481}
2376 2482
2377
2378static void do_interrupt_requests(struct kvm_vcpu *vcpu, 2483static void do_interrupt_requests(struct kvm_vcpu *vcpu,
2379 struct kvm_run *kvm_run) 2484 struct kvm_run *kvm_run)
2380{ 2485{
2381 u32 cpu_based_vm_exec_control; 2486 vmx_update_window_states(vcpu);
2382
2383 vcpu->arch.interrupt_window_open =
2384 ((vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) &&
2385 (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) & 3) == 0);
2386 2487
2387 if (vcpu->arch.interrupt_window_open && 2488 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) {
2388 vcpu->arch.irq_summary && !vcpu->arch.interrupt.pending) 2489 if (vcpu->arch.interrupt.pending) {
2389 kvm_do_inject_irq(vcpu); 2490 enable_nmi_window(vcpu);
2491 } else if (vcpu->arch.nmi_window_open) {
2492 vcpu->arch.nmi_pending = false;
2493 vcpu->arch.nmi_injected = true;
2494 } else {
2495 enable_nmi_window(vcpu);
2496 return;
2497 }
2498 }
2499 if (vcpu->arch.nmi_injected) {
2500 vmx_inject_nmi(vcpu);
2501 if (vcpu->arch.nmi_pending)
2502 enable_nmi_window(vcpu);
2503 else if (vcpu->arch.irq_summary
2504 || kvm_run->request_interrupt_window)
2505 enable_irq_window(vcpu);
2506 return;
2507 }
2390 2508
2391 if (vcpu->arch.interrupt_window_open && vcpu->arch.interrupt.pending) 2509 if (vcpu->arch.interrupt_window_open) {
2392 vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr); 2510 if (vcpu->arch.irq_summary && !vcpu->arch.interrupt.pending)
2511 kvm_do_inject_irq(vcpu);
2393 2512
2394 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL); 2513 if (vcpu->arch.interrupt.pending)
2514 vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr);
2515 }
2395 if (!vcpu->arch.interrupt_window_open && 2516 if (!vcpu->arch.interrupt_window_open &&
2396 (vcpu->arch.irq_summary || kvm_run->request_interrupt_window)) 2517 (vcpu->arch.irq_summary || kvm_run->request_interrupt_window))
2397 /* 2518 enable_irq_window(vcpu);
2398 * Interrupts blocked. Wait for unblock.
2399 */
2400 cpu_based_vm_exec_control |= CPU_BASED_VIRTUAL_INTR_PENDING;
2401 else
2402 cpu_based_vm_exec_control &= ~CPU_BASED_VIRTUAL_INTR_PENDING;
2403 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
2404} 2519}
2405 2520
2406static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr) 2521static int vmx_set_tss_addr(struct kvm *kvm, unsigned int addr)
2407{ 2522{
2408 int ret; 2523 int ret;
2409 struct kvm_userspace_memory_region tss_mem = { 2524 struct kvm_userspace_memory_region tss_mem = {
2410 .slot = 8, 2525 .slot = TSS_PRIVATE_MEMSLOT,
2411 .guest_phys_addr = addr, 2526 .guest_phys_addr = addr,
2412 .memory_size = PAGE_SIZE * 3, 2527 .memory_size = PAGE_SIZE * 3,
2413 .flags = 0, 2528 .flags = 0,
@@ -2492,7 +2607,7 @@ static int handle_exception(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2492 set_bit(irq / BITS_PER_LONG, &vcpu->arch.irq_summary); 2607 set_bit(irq / BITS_PER_LONG, &vcpu->arch.irq_summary);
2493 } 2608 }
2494 2609
2495 if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == 0x200) /* nmi */ 2610 if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR)
2496 return 1; /* already handled by vmx_vcpu_run() */ 2611 return 1; /* already handled by vmx_vcpu_run() */
2497 2612
2498 if (is_no_device(intr_info)) { 2613 if (is_no_device(intr_info)) {
@@ -2581,6 +2696,7 @@ static int handle_io(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2581 rep = (exit_qualification & 32) != 0; 2696 rep = (exit_qualification & 32) != 0;
2582 port = exit_qualification >> 16; 2697 port = exit_qualification >> 16;
2583 2698
2699 skip_emulated_instruction(vcpu);
2584 return kvm_emulate_pio(vcpu, kvm_run, in, size, port); 2700 return kvm_emulate_pio(vcpu, kvm_run, in, size, port);
2585} 2701}
2586 2702
@@ -2767,6 +2883,7 @@ static int handle_interrupt_window(struct kvm_vcpu *vcpu,
2767 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control); 2883 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
2768 2884
2769 KVMTRACE_0D(PEND_INTR, vcpu, handler); 2885 KVMTRACE_0D(PEND_INTR, vcpu, handler);
2886 ++vcpu->stat.irq_window_exits;
2770 2887
2771 /* 2888 /*
2772 * If the user space waits to inject interrupts, exit as soon as 2889 * If the user space waits to inject interrupts, exit as soon as
@@ -2775,7 +2892,6 @@ static int handle_interrupt_window(struct kvm_vcpu *vcpu,
2775 if (kvm_run->request_interrupt_window && 2892 if (kvm_run->request_interrupt_window &&
2776 !vcpu->arch.irq_summary) { 2893 !vcpu->arch.irq_summary) {
2777 kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN; 2894 kvm_run->exit_reason = KVM_EXIT_IRQ_WINDOW_OPEN;
2778 ++vcpu->stat.irq_window_exits;
2779 return 0; 2895 return 0;
2780 } 2896 }
2781 return 1; 2897 return 1;
@@ -2832,6 +2948,7 @@ static int handle_apic_access(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2832 2948
2833static int handle_task_switch(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) 2949static int handle_task_switch(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2834{ 2950{
2951 struct vcpu_vmx *vmx = to_vmx(vcpu);
2835 unsigned long exit_qualification; 2952 unsigned long exit_qualification;
2836 u16 tss_selector; 2953 u16 tss_selector;
2837 int reason; 2954 int reason;
@@ -2839,6 +2956,15 @@ static int handle_task_switch(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2839 exit_qualification = vmcs_readl(EXIT_QUALIFICATION); 2956 exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
2840 2957
2841 reason = (u32)exit_qualification >> 30; 2958 reason = (u32)exit_qualification >> 30;
2959 if (reason == TASK_SWITCH_GATE && vmx->vcpu.arch.nmi_injected &&
2960 (vmx->idt_vectoring_info & VECTORING_INFO_VALID_MASK) &&
2961 (vmx->idt_vectoring_info & VECTORING_INFO_TYPE_MASK)
2962 == INTR_TYPE_NMI_INTR) {
2963 vcpu->arch.nmi_injected = false;
2964 if (cpu_has_virtual_nmis())
2965 vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO,
2966 GUEST_INTR_STATE_NMI);
2967 }
2842 tss_selector = exit_qualification; 2968 tss_selector = exit_qualification;
2843 2969
2844 return kvm_task_switch(vcpu, tss_selector, reason); 2970 return kvm_task_switch(vcpu, tss_selector, reason);
@@ -2927,16 +3053,12 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
2927 while (!guest_state_valid(vcpu)) { 3053 while (!guest_state_valid(vcpu)) {
2928 err = emulate_instruction(vcpu, kvm_run, 0, 0, 0); 3054 err = emulate_instruction(vcpu, kvm_run, 0, 0, 0);
2929 3055
2930 switch (err) { 3056 if (err == EMULATE_DO_MMIO)
2931 case EMULATE_DONE: 3057 break;
2932 break; 3058
2933 case EMULATE_DO_MMIO: 3059 if (err != EMULATE_DONE) {
2934 kvm_report_emulation_failure(vcpu, "mmio"); 3060 kvm_report_emulation_failure(vcpu, "emulation failure");
2935 /* TODO: Handle MMIO */ 3061 return;
2936 return;
2937 default:
2938 kvm_report_emulation_failure(vcpu, "emulation failure");
2939 return;
2940 } 3062 }
2941 3063
2942 if (signal_pending(current)) 3064 if (signal_pending(current))
@@ -2948,8 +3070,10 @@ static void handle_invalid_guest_state(struct kvm_vcpu *vcpu,
2948 local_irq_disable(); 3070 local_irq_disable();
2949 preempt_disable(); 3071 preempt_disable();
2950 3072
2951 /* Guest state should be valid now, no more emulation should be needed */ 3073 /* Guest state should be valid now except if we need to
2952 vmx->emulation_required = 0; 3074 * emulate an MMIO */
3075 if (guest_state_valid(vcpu))
3076 vmx->emulation_required = 0;
2953} 3077}
2954 3078
2955/* 3079/*
@@ -2996,6 +3120,11 @@ static int kvm_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
2996 KVMTRACE_3D(VMEXIT, vcpu, exit_reason, (u32)kvm_rip_read(vcpu), 3120 KVMTRACE_3D(VMEXIT, vcpu, exit_reason, (u32)kvm_rip_read(vcpu),
2997 (u32)((u64)kvm_rip_read(vcpu) >> 32), entryexit); 3121 (u32)((u64)kvm_rip_read(vcpu) >> 32), entryexit);
2998 3122
3123 /* If we need to emulate an MMIO from handle_invalid_guest_state
3124 * we just return 0 */
3125 if (vmx->emulation_required && emulate_invalid_guest_state)
3126 return 0;
3127
2999 /* Access CR3 don't cause VMExit in paging mode, so we need 3128 /* Access CR3 don't cause VMExit in paging mode, so we need
3000 * to sync with guest real CR3. */ 3129 * to sync with guest real CR3. */
3001 if (vm_need_ept() && is_paging(vcpu)) { 3130 if (vm_need_ept() && is_paging(vcpu)) {
@@ -3012,9 +3141,32 @@ static int kvm_handle_exit(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
3012 3141
3013 if ((vectoring_info & VECTORING_INFO_VALID_MASK) && 3142 if ((vectoring_info & VECTORING_INFO_VALID_MASK) &&
3014 (exit_reason != EXIT_REASON_EXCEPTION_NMI && 3143 (exit_reason != EXIT_REASON_EXCEPTION_NMI &&
3015 exit_reason != EXIT_REASON_EPT_VIOLATION)) 3144 exit_reason != EXIT_REASON_EPT_VIOLATION &&
3016 printk(KERN_WARNING "%s: unexpected, valid vectoring info and " 3145 exit_reason != EXIT_REASON_TASK_SWITCH))
3017 "exit reason is 0x%x\n", __func__, exit_reason); 3146 printk(KERN_WARNING "%s: unexpected, valid vectoring info "
3147 "(0x%x) and exit reason is 0x%x\n",
3148 __func__, vectoring_info, exit_reason);
3149
3150 if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked)) {
3151 if (vcpu->arch.interrupt_window_open) {
3152 vmx->soft_vnmi_blocked = 0;
3153 vcpu->arch.nmi_window_open = 1;
3154 } else if (vmx->vnmi_blocked_time > 1000000000LL &&
3155 vcpu->arch.nmi_pending) {
3156 /*
3157 * This CPU don't support us in finding the end of an
3158 * NMI-blocked window if the guest runs with IRQs
3159 * disabled. So we pull the trigger after 1 s of
3160 * futile waiting, but inform the user about this.
3161 */
3162 printk(KERN_WARNING "%s: Breaking out of NMI-blocked "
3163 "state on VCPU %d after 1 s timeout\n",
3164 __func__, vcpu->vcpu_id);
3165 vmx->soft_vnmi_blocked = 0;
3166 vmx->vcpu.arch.nmi_window_open = 1;
3167 }
3168 }
3169
3018 if (exit_reason < kvm_vmx_max_exit_handlers 3170 if (exit_reason < kvm_vmx_max_exit_handlers
3019 && kvm_vmx_exit_handlers[exit_reason]) 3171 && kvm_vmx_exit_handlers[exit_reason])
3020 return kvm_vmx_exit_handlers[exit_reason](vcpu, kvm_run); 3172 return kvm_vmx_exit_handlers[exit_reason](vcpu, kvm_run);
@@ -3042,51 +3194,6 @@ static void update_tpr_threshold(struct kvm_vcpu *vcpu)
3042 vmcs_write32(TPR_THRESHOLD, (max_irr > tpr) ? tpr >> 4 : max_irr >> 4); 3194 vmcs_write32(TPR_THRESHOLD, (max_irr > tpr) ? tpr >> 4 : max_irr >> 4);
3043} 3195}
3044 3196
3045static void enable_irq_window(struct kvm_vcpu *vcpu)
3046{
3047 u32 cpu_based_vm_exec_control;
3048
3049 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
3050 cpu_based_vm_exec_control |= CPU_BASED_VIRTUAL_INTR_PENDING;
3051 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
3052}
3053
3054static void enable_nmi_window(struct kvm_vcpu *vcpu)
3055{
3056 u32 cpu_based_vm_exec_control;
3057
3058 if (!cpu_has_virtual_nmis())
3059 return;
3060
3061 cpu_based_vm_exec_control = vmcs_read32(CPU_BASED_VM_EXEC_CONTROL);
3062 cpu_based_vm_exec_control |= CPU_BASED_VIRTUAL_NMI_PENDING;
3063 vmcs_write32(CPU_BASED_VM_EXEC_CONTROL, cpu_based_vm_exec_control);
3064}
3065
3066static int vmx_nmi_enabled(struct kvm_vcpu *vcpu)
3067{
3068 u32 guest_intr = vmcs_read32(GUEST_INTERRUPTIBILITY_INFO);
3069 return !(guest_intr & (GUEST_INTR_STATE_NMI |
3070 GUEST_INTR_STATE_MOV_SS |
3071 GUEST_INTR_STATE_STI));
3072}
3073
3074static int vmx_irq_enabled(struct kvm_vcpu *vcpu)
3075{
3076 u32 guest_intr = vmcs_read32(GUEST_INTERRUPTIBILITY_INFO);
3077 return (!(guest_intr & (GUEST_INTR_STATE_MOV_SS |
3078 GUEST_INTR_STATE_STI)) &&
3079 (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF));
3080}
3081
3082static void enable_intr_window(struct kvm_vcpu *vcpu)
3083{
3084 if (vcpu->arch.nmi_pending)
3085 enable_nmi_window(vcpu);
3086 else if (kvm_cpu_has_interrupt(vcpu))
3087 enable_irq_window(vcpu);
3088}
3089
3090static void vmx_complete_interrupts(struct vcpu_vmx *vmx) 3197static void vmx_complete_interrupts(struct vcpu_vmx *vmx)
3091{ 3198{
3092 u32 exit_intr_info; 3199 u32 exit_intr_info;
@@ -3109,7 +3216,9 @@ static void vmx_complete_interrupts(struct vcpu_vmx *vmx)
3109 if (unblock_nmi && vector != DF_VECTOR) 3216 if (unblock_nmi && vector != DF_VECTOR)
3110 vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO, 3217 vmcs_set_bits(GUEST_INTERRUPTIBILITY_INFO,
3111 GUEST_INTR_STATE_NMI); 3218 GUEST_INTR_STATE_NMI);
3112 } 3219 } else if (unlikely(vmx->soft_vnmi_blocked))
3220 vmx->vnmi_blocked_time +=
3221 ktime_to_ns(ktime_sub(ktime_get(), vmx->entry_time));
3113 3222
3114 idt_vectoring_info = vmx->idt_vectoring_info; 3223 idt_vectoring_info = vmx->idt_vectoring_info;
3115 idtv_info_valid = idt_vectoring_info & VECTORING_INFO_VALID_MASK; 3224 idtv_info_valid = idt_vectoring_info & VECTORING_INFO_VALID_MASK;
@@ -3147,26 +3256,29 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu)
3147{ 3256{
3148 update_tpr_threshold(vcpu); 3257 update_tpr_threshold(vcpu);
3149 3258
3150 if (cpu_has_virtual_nmis()) { 3259 vmx_update_window_states(vcpu);
3151 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) { 3260
3152 if (vcpu->arch.interrupt.pending) { 3261 if (vcpu->arch.nmi_pending && !vcpu->arch.nmi_injected) {
3153 enable_nmi_window(vcpu); 3262 if (vcpu->arch.interrupt.pending) {
3154 } else if (vmx_nmi_enabled(vcpu)) { 3263 enable_nmi_window(vcpu);
3155 vcpu->arch.nmi_pending = false; 3264 } else if (vcpu->arch.nmi_window_open) {
3156 vcpu->arch.nmi_injected = true; 3265 vcpu->arch.nmi_pending = false;
3157 } else { 3266 vcpu->arch.nmi_injected = true;
3158 enable_intr_window(vcpu); 3267 } else {
3159 return; 3268 enable_nmi_window(vcpu);
3160 }
3161 }
3162 if (vcpu->arch.nmi_injected) {
3163 vmx_inject_nmi(vcpu);
3164 enable_intr_window(vcpu);
3165 return; 3269 return;
3166 } 3270 }
3167 } 3271 }
3272 if (vcpu->arch.nmi_injected) {
3273 vmx_inject_nmi(vcpu);
3274 if (vcpu->arch.nmi_pending)
3275 enable_nmi_window(vcpu);
3276 else if (kvm_cpu_has_interrupt(vcpu))
3277 enable_irq_window(vcpu);
3278 return;
3279 }
3168 if (!vcpu->arch.interrupt.pending && kvm_cpu_has_interrupt(vcpu)) { 3280 if (!vcpu->arch.interrupt.pending && kvm_cpu_has_interrupt(vcpu)) {
3169 if (vmx_irq_enabled(vcpu)) 3281 if (vcpu->arch.interrupt_window_open)
3170 kvm_queue_interrupt(vcpu, kvm_cpu_get_interrupt(vcpu)); 3282 kvm_queue_interrupt(vcpu, kvm_cpu_get_interrupt(vcpu));
3171 else 3283 else
3172 enable_irq_window(vcpu); 3284 enable_irq_window(vcpu);
@@ -3174,6 +3286,8 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu)
3174 if (vcpu->arch.interrupt.pending) { 3286 if (vcpu->arch.interrupt.pending) {
3175 vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr); 3287 vmx_inject_irq(vcpu, vcpu->arch.interrupt.nr);
3176 kvm_timer_intr_post(vcpu, vcpu->arch.interrupt.nr); 3288 kvm_timer_intr_post(vcpu, vcpu->arch.interrupt.nr);
3289 if (kvm_cpu_has_interrupt(vcpu))
3290 enable_irq_window(vcpu);
3177 } 3291 }
3178} 3292}
3179 3293
@@ -3213,6 +3327,10 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3213 struct vcpu_vmx *vmx = to_vmx(vcpu); 3327 struct vcpu_vmx *vmx = to_vmx(vcpu);
3214 u32 intr_info; 3328 u32 intr_info;
3215 3329
3330 /* Record the guest's net vcpu time for enforced NMI injections. */
3331 if (unlikely(!cpu_has_virtual_nmis() && vmx->soft_vnmi_blocked))
3332 vmx->entry_time = ktime_get();
3333
3216 /* Handle invalid guest state instead of entering VMX */ 3334 /* Handle invalid guest state instead of entering VMX */
3217 if (vmx->emulation_required && emulate_invalid_guest_state) { 3335 if (vmx->emulation_required && emulate_invalid_guest_state) {
3218 handle_invalid_guest_state(vcpu, kvm_run); 3336 handle_invalid_guest_state(vcpu, kvm_run);
@@ -3327,9 +3445,7 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3327 if (vmx->rmode.irq.pending) 3445 if (vmx->rmode.irq.pending)
3328 fixup_rmode_irq(vmx); 3446 fixup_rmode_irq(vmx);
3329 3447
3330 vcpu->arch.interrupt_window_open = 3448 vmx_update_window_states(vcpu);
3331 (vmcs_read32(GUEST_INTERRUPTIBILITY_INFO) &
3332 (GUEST_INTR_STATE_STI | GUEST_INTR_STATE_MOV_SS)) == 0;
3333 3449
3334 asm("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS)); 3450 asm("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS));
3335 vmx->launched = 1; 3451 vmx->launched = 1;
@@ -3337,7 +3453,7 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
3337 intr_info = vmcs_read32(VM_EXIT_INTR_INFO); 3453 intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
3338 3454
3339 /* We need to handle NMIs before interrupts are enabled */ 3455 /* We need to handle NMIs before interrupts are enabled */
3340 if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == 0x200 && 3456 if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR &&
3341 (intr_info & INTR_INFO_VALID_MASK)) { 3457 (intr_info & INTR_INFO_VALID_MASK)) {
3342 KVMTRACE_0D(NMI, vcpu, handler); 3458 KVMTRACE_0D(NMI, vcpu, handler);
3343 asm("int $2"); 3459 asm("int $2");
@@ -3455,6 +3571,11 @@ static int get_ept_level(void)
3455 return VMX_EPT_DEFAULT_GAW + 1; 3571 return VMX_EPT_DEFAULT_GAW + 1;
3456} 3572}
3457 3573
3574static int vmx_get_mt_mask_shift(void)
3575{
3576 return VMX_EPT_MT_EPTE_SHIFT;
3577}
3578
3458static struct kvm_x86_ops vmx_x86_ops = { 3579static struct kvm_x86_ops vmx_x86_ops = {
3459 .cpu_has_kvm_support = cpu_has_kvm_support, 3580 .cpu_has_kvm_support = cpu_has_kvm_support,
3460 .disabled_by_bios = vmx_disabled_by_bios, 3581 .disabled_by_bios = vmx_disabled_by_bios,
@@ -3510,6 +3631,7 @@ static struct kvm_x86_ops vmx_x86_ops = {
3510 3631
3511 .set_tss_addr = vmx_set_tss_addr, 3632 .set_tss_addr = vmx_set_tss_addr,
3512 .get_tdp_level = get_ept_level, 3633 .get_tdp_level = get_ept_level,
3634 .get_mt_mask_shift = vmx_get_mt_mask_shift,
3513}; 3635};
3514 3636
3515static int __init vmx_init(void) 3637static int __init vmx_init(void)
@@ -3566,10 +3688,10 @@ static int __init vmx_init(void)
3566 bypass_guest_pf = 0; 3688 bypass_guest_pf = 0;
3567 kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK | 3689 kvm_mmu_set_base_ptes(VMX_EPT_READABLE_MASK |
3568 VMX_EPT_WRITABLE_MASK | 3690 VMX_EPT_WRITABLE_MASK |
3569 VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT |
3570 VMX_EPT_IGMT_BIT); 3691 VMX_EPT_IGMT_BIT);
3571 kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull, 3692 kvm_mmu_set_mask_ptes(0ull, 0ull, 0ull, 0ull,
3572 VMX_EPT_EXECUTABLE_MASK); 3693 VMX_EPT_EXECUTABLE_MASK,
3694 VMX_EPT_DEFAULT_MT << VMX_EPT_MT_EPTE_SHIFT);
3573 kvm_enable_tdp(); 3695 kvm_enable_tdp();
3574 } else 3696 } else
3575 kvm_disable_tdp(); 3697 kvm_disable_tdp();
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index f1f8ff2f1fa2..cc17546a2406 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -34,11 +34,13 @@
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/mman.h> 35#include <linux/mman.h>
36#include <linux/highmem.h> 36#include <linux/highmem.h>
37#include <linux/iommu.h>
37#include <linux/intel-iommu.h> 38#include <linux/intel-iommu.h>
38 39
39#include <asm/uaccess.h> 40#include <asm/uaccess.h>
40#include <asm/msr.h> 41#include <asm/msr.h>
41#include <asm/desc.h> 42#include <asm/desc.h>
43#include <asm/mtrr.h>
42 44
43#define MAX_IO_MSRS 256 45#define MAX_IO_MSRS 256
44#define CR0_RESERVED_BITS \ 46#define CR0_RESERVED_BITS \
@@ -86,6 +88,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
86 { "halt_wakeup", VCPU_STAT(halt_wakeup) }, 88 { "halt_wakeup", VCPU_STAT(halt_wakeup) },
87 { "hypercalls", VCPU_STAT(hypercalls) }, 89 { "hypercalls", VCPU_STAT(hypercalls) },
88 { "request_irq", VCPU_STAT(request_irq_exits) }, 90 { "request_irq", VCPU_STAT(request_irq_exits) },
91 { "request_nmi", VCPU_STAT(request_nmi_exits) },
89 { "irq_exits", VCPU_STAT(irq_exits) }, 92 { "irq_exits", VCPU_STAT(irq_exits) },
90 { "host_state_reload", VCPU_STAT(host_state_reload) }, 93 { "host_state_reload", VCPU_STAT(host_state_reload) },
91 { "efer_reload", VCPU_STAT(efer_reload) }, 94 { "efer_reload", VCPU_STAT(efer_reload) },
@@ -93,6 +96,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
93 { "insn_emulation", VCPU_STAT(insn_emulation) }, 96 { "insn_emulation", VCPU_STAT(insn_emulation) },
94 { "insn_emulation_fail", VCPU_STAT(insn_emulation_fail) }, 97 { "insn_emulation_fail", VCPU_STAT(insn_emulation_fail) },
95 { "irq_injections", VCPU_STAT(irq_injections) }, 98 { "irq_injections", VCPU_STAT(irq_injections) },
99 { "nmi_injections", VCPU_STAT(nmi_injections) },
96 { "mmu_shadow_zapped", VM_STAT(mmu_shadow_zapped) }, 100 { "mmu_shadow_zapped", VM_STAT(mmu_shadow_zapped) },
97 { "mmu_pte_write", VM_STAT(mmu_pte_write) }, 101 { "mmu_pte_write", VM_STAT(mmu_pte_write) },
98 { "mmu_pte_updated", VM_STAT(mmu_pte_updated) }, 102 { "mmu_pte_updated", VM_STAT(mmu_pte_updated) },
@@ -101,6 +105,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
101 { "mmu_recycled", VM_STAT(mmu_recycled) }, 105 { "mmu_recycled", VM_STAT(mmu_recycled) },
102 { "mmu_cache_miss", VM_STAT(mmu_cache_miss) }, 106 { "mmu_cache_miss", VM_STAT(mmu_cache_miss) },
103 { "mmu_unsync", VM_STAT(mmu_unsync) }, 107 { "mmu_unsync", VM_STAT(mmu_unsync) },
108 { "mmu_unsync_global", VM_STAT(mmu_unsync_global) },
104 { "remote_tlb_flush", VM_STAT(remote_tlb_flush) }, 109 { "remote_tlb_flush", VM_STAT(remote_tlb_flush) },
105 { "largepages", VM_STAT(lpages) }, 110 { "largepages", VM_STAT(lpages) },
106 { NULL } 111 { NULL }
@@ -312,6 +317,7 @@ void kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
312 kvm_x86_ops->set_cr0(vcpu, cr0); 317 kvm_x86_ops->set_cr0(vcpu, cr0);
313 vcpu->arch.cr0 = cr0; 318 vcpu->arch.cr0 = cr0;
314 319
320 kvm_mmu_sync_global(vcpu);
315 kvm_mmu_reset_context(vcpu); 321 kvm_mmu_reset_context(vcpu);
316 return; 322 return;
317} 323}
@@ -355,6 +361,7 @@ void kvm_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
355 } 361 }
356 kvm_x86_ops->set_cr4(vcpu, cr4); 362 kvm_x86_ops->set_cr4(vcpu, cr4);
357 vcpu->arch.cr4 = cr4; 363 vcpu->arch.cr4 = cr4;
364 kvm_mmu_sync_global(vcpu);
358 kvm_mmu_reset_context(vcpu); 365 kvm_mmu_reset_context(vcpu);
359} 366}
360EXPORT_SYMBOL_GPL(kvm_set_cr4); 367EXPORT_SYMBOL_GPL(kvm_set_cr4);
@@ -449,7 +456,7 @@ static u32 msrs_to_save[] = {
449 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, 456 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR,
450#endif 457#endif
451 MSR_IA32_TIME_STAMP_COUNTER, MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK, 458 MSR_IA32_TIME_STAMP_COUNTER, MSR_KVM_SYSTEM_TIME, MSR_KVM_WALL_CLOCK,
452 MSR_IA32_PERF_STATUS, 459 MSR_IA32_PERF_STATUS, MSR_IA32_CR_PAT
453}; 460};
454 461
455static unsigned num_msrs_to_save; 462static unsigned num_msrs_to_save;
@@ -648,10 +655,38 @@ static bool msr_mtrr_valid(unsigned msr)
648 655
649static int set_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr, u64 data) 656static int set_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr, u64 data)
650{ 657{
658 u64 *p = (u64 *)&vcpu->arch.mtrr_state.fixed_ranges;
659
651 if (!msr_mtrr_valid(msr)) 660 if (!msr_mtrr_valid(msr))
652 return 1; 661 return 1;
653 662
654 vcpu->arch.mtrr[msr - 0x200] = data; 663 if (msr == MSR_MTRRdefType) {
664 vcpu->arch.mtrr_state.def_type = data;
665 vcpu->arch.mtrr_state.enabled = (data & 0xc00) >> 10;
666 } else if (msr == MSR_MTRRfix64K_00000)
667 p[0] = data;
668 else if (msr == MSR_MTRRfix16K_80000 || msr == MSR_MTRRfix16K_A0000)
669 p[1 + msr - MSR_MTRRfix16K_80000] = data;
670 else if (msr >= MSR_MTRRfix4K_C0000 && msr <= MSR_MTRRfix4K_F8000)
671 p[3 + msr - MSR_MTRRfix4K_C0000] = data;
672 else if (msr == MSR_IA32_CR_PAT)
673 vcpu->arch.pat = data;
674 else { /* Variable MTRRs */
675 int idx, is_mtrr_mask;
676 u64 *pt;
677
678 idx = (msr - 0x200) / 2;
679 is_mtrr_mask = msr - 0x200 - 2 * idx;
680 if (!is_mtrr_mask)
681 pt =
682 (u64 *)&vcpu->arch.mtrr_state.var_ranges[idx].base_lo;
683 else
684 pt =
685 (u64 *)&vcpu->arch.mtrr_state.var_ranges[idx].mask_lo;
686 *pt = data;
687 }
688
689 kvm_mmu_reset_context(vcpu);
655 return 0; 690 return 0;
656} 691}
657 692
@@ -747,10 +782,37 @@ int kvm_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
747 782
748static int get_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata) 783static int get_msr_mtrr(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
749{ 784{
785 u64 *p = (u64 *)&vcpu->arch.mtrr_state.fixed_ranges;
786
750 if (!msr_mtrr_valid(msr)) 787 if (!msr_mtrr_valid(msr))
751 return 1; 788 return 1;
752 789
753 *pdata = vcpu->arch.mtrr[msr - 0x200]; 790 if (msr == MSR_MTRRdefType)
791 *pdata = vcpu->arch.mtrr_state.def_type +
792 (vcpu->arch.mtrr_state.enabled << 10);
793 else if (msr == MSR_MTRRfix64K_00000)
794 *pdata = p[0];
795 else if (msr == MSR_MTRRfix16K_80000 || msr == MSR_MTRRfix16K_A0000)
796 *pdata = p[1 + msr - MSR_MTRRfix16K_80000];
797 else if (msr >= MSR_MTRRfix4K_C0000 && msr <= MSR_MTRRfix4K_F8000)
798 *pdata = p[3 + msr - MSR_MTRRfix4K_C0000];
799 else if (msr == MSR_IA32_CR_PAT)
800 *pdata = vcpu->arch.pat;
801 else { /* Variable MTRRs */
802 int idx, is_mtrr_mask;
803 u64 *pt;
804
805 idx = (msr - 0x200) / 2;
806 is_mtrr_mask = msr - 0x200 - 2 * idx;
807 if (!is_mtrr_mask)
808 pt =
809 (u64 *)&vcpu->arch.mtrr_state.var_ranges[idx].base_lo;
810 else
811 pt =
812 (u64 *)&vcpu->arch.mtrr_state.var_ranges[idx].mask_lo;
813 *pdata = *pt;
814 }
815
754 return 0; 816 return 0;
755} 817}
756 818
@@ -903,7 +965,6 @@ int kvm_dev_ioctl_check_extension(long ext)
903 case KVM_CAP_IRQCHIP: 965 case KVM_CAP_IRQCHIP:
904 case KVM_CAP_HLT: 966 case KVM_CAP_HLT:
905 case KVM_CAP_MMU_SHADOW_CACHE_CONTROL: 967 case KVM_CAP_MMU_SHADOW_CACHE_CONTROL:
906 case KVM_CAP_USER_MEMORY:
907 case KVM_CAP_SET_TSS_ADDR: 968 case KVM_CAP_SET_TSS_ADDR:
908 case KVM_CAP_EXT_CPUID: 969 case KVM_CAP_EXT_CPUID:
909 case KVM_CAP_CLOCKSOURCE: 970 case KVM_CAP_CLOCKSOURCE:
@@ -929,7 +990,7 @@ int kvm_dev_ioctl_check_extension(long ext)
929 r = !tdp_enabled; 990 r = !tdp_enabled;
930 break; 991 break;
931 case KVM_CAP_IOMMU: 992 case KVM_CAP_IOMMU:
932 r = intel_iommu_found(); 993 r = iommu_found();
933 break; 994 break;
934 default: 995 default:
935 r = 0; 996 r = 0;
@@ -1188,6 +1249,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
1188 int t, times = entry->eax & 0xff; 1249 int t, times = entry->eax & 0xff;
1189 1250
1190 entry->flags |= KVM_CPUID_FLAG_STATEFUL_FUNC; 1251 entry->flags |= KVM_CPUID_FLAG_STATEFUL_FUNC;
1252 entry->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT;
1191 for (t = 1; t < times && *nent < maxnent; ++t) { 1253 for (t = 1; t < times && *nent < maxnent; ++t) {
1192 do_cpuid_1_ent(&entry[t], function, 0); 1254 do_cpuid_1_ent(&entry[t], function, 0);
1193 entry[t].flags |= KVM_CPUID_FLAG_STATEFUL_FUNC; 1255 entry[t].flags |= KVM_CPUID_FLAG_STATEFUL_FUNC;
@@ -1218,7 +1280,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function,
1218 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX; 1280 entry->flags |= KVM_CPUID_FLAG_SIGNIFCANT_INDEX;
1219 /* read more entries until level_type is zero */ 1281 /* read more entries until level_type is zero */
1220 for (i = 1; *nent < maxnent; ++i) { 1282 for (i = 1; *nent < maxnent; ++i) {
1221 level_type = entry[i - 1].ecx & 0xff; 1283 level_type = entry[i - 1].ecx & 0xff00;
1222 if (!level_type) 1284 if (!level_type)
1223 break; 1285 break;
1224 do_cpuid_1_ent(&entry[i], function, i); 1286 do_cpuid_1_ent(&entry[i], function, i);
@@ -1318,6 +1380,15 @@ static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu,
1318 return 0; 1380 return 0;
1319} 1381}
1320 1382
1383static int kvm_vcpu_ioctl_nmi(struct kvm_vcpu *vcpu)
1384{
1385 vcpu_load(vcpu);
1386 kvm_inject_nmi(vcpu);
1387 vcpu_put(vcpu);
1388
1389 return 0;
1390}
1391
1321static int vcpu_ioctl_tpr_access_reporting(struct kvm_vcpu *vcpu, 1392static int vcpu_ioctl_tpr_access_reporting(struct kvm_vcpu *vcpu,
1322 struct kvm_tpr_access_ctl *tac) 1393 struct kvm_tpr_access_ctl *tac)
1323{ 1394{
@@ -1377,6 +1448,13 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
1377 r = 0; 1448 r = 0;
1378 break; 1449 break;
1379 } 1450 }
1451 case KVM_NMI: {
1452 r = kvm_vcpu_ioctl_nmi(vcpu);
1453 if (r)
1454 goto out;
1455 r = 0;
1456 break;
1457 }
1380 case KVM_SET_CPUID: { 1458 case KVM_SET_CPUID: {
1381 struct kvm_cpuid __user *cpuid_arg = argp; 1459 struct kvm_cpuid __user *cpuid_arg = argp;
1382 struct kvm_cpuid cpuid; 1460 struct kvm_cpuid cpuid;
@@ -1968,7 +2046,7 @@ int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa,
1968 ret = kvm_write_guest(vcpu->kvm, gpa, val, bytes); 2046 ret = kvm_write_guest(vcpu->kvm, gpa, val, bytes);
1969 if (ret < 0) 2047 if (ret < 0)
1970 return 0; 2048 return 0;
1971 kvm_mmu_pte_write(vcpu, gpa, val, bytes); 2049 kvm_mmu_pte_write(vcpu, gpa, val, bytes, 1);
1972 return 1; 2050 return 1;
1973} 2051}
1974 2052
@@ -2404,8 +2482,6 @@ int kvm_emulate_pio(struct kvm_vcpu *vcpu, struct kvm_run *run, int in,
2404 val = kvm_register_read(vcpu, VCPU_REGS_RAX); 2482 val = kvm_register_read(vcpu, VCPU_REGS_RAX);
2405 memcpy(vcpu->arch.pio_data, &val, 4); 2483 memcpy(vcpu->arch.pio_data, &val, 4);
2406 2484
2407 kvm_x86_ops->skip_emulated_instruction(vcpu);
2408
2409 pio_dev = vcpu_find_pio_dev(vcpu, port, size, !in); 2485 pio_dev = vcpu_find_pio_dev(vcpu, port, size, !in);
2410 if (pio_dev) { 2486 if (pio_dev) {
2411 kernel_pio(pio_dev, vcpu, vcpu->arch.pio_data); 2487 kernel_pio(pio_dev, vcpu, vcpu->arch.pio_data);
@@ -2541,7 +2617,7 @@ int kvm_arch_init(void *opaque)
2541 kvm_mmu_set_nonpresent_ptes(0ull, 0ull); 2617 kvm_mmu_set_nonpresent_ptes(0ull, 0ull);
2542 kvm_mmu_set_base_ptes(PT_PRESENT_MASK); 2618 kvm_mmu_set_base_ptes(PT_PRESENT_MASK);
2543 kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK, 2619 kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK,
2544 PT_DIRTY_MASK, PT64_NX_MASK, 0); 2620 PT_DIRTY_MASK, PT64_NX_MASK, 0, 0);
2545 return 0; 2621 return 0;
2546 2622
2547out: 2623out:
@@ -2729,7 +2805,7 @@ static int move_to_next_stateful_cpuid_entry(struct kvm_vcpu *vcpu, int i)
2729 2805
2730 e->flags &= ~KVM_CPUID_FLAG_STATE_READ_NEXT; 2806 e->flags &= ~KVM_CPUID_FLAG_STATE_READ_NEXT;
2731 /* when no next entry is found, the current entry[i] is reselected */ 2807 /* when no next entry is found, the current entry[i] is reselected */
2732 for (j = i + 1; j == i; j = (j + 1) % nent) { 2808 for (j = i + 1; ; j = (j + 1) % nent) {
2733 struct kvm_cpuid_entry2 *ej = &vcpu->arch.cpuid_entries[j]; 2809 struct kvm_cpuid_entry2 *ej = &vcpu->arch.cpuid_entries[j];
2734 if (ej->function == e->function) { 2810 if (ej->function == e->function) {
2735 ej->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT; 2811 ej->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT;
@@ -2973,7 +3049,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
2973 pr_debug("vcpu %d received sipi with vector # %x\n", 3049 pr_debug("vcpu %d received sipi with vector # %x\n",
2974 vcpu->vcpu_id, vcpu->arch.sipi_vector); 3050 vcpu->vcpu_id, vcpu->arch.sipi_vector);
2975 kvm_lapic_reset(vcpu); 3051 kvm_lapic_reset(vcpu);
2976 r = kvm_x86_ops->vcpu_reset(vcpu); 3052 r = kvm_arch_vcpu_reset(vcpu);
2977 if (r) 3053 if (r)
2978 return r; 3054 return r;
2979 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; 3055 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
@@ -3275,9 +3351,9 @@ static void seg_desct_to_kvm_desct(struct desc_struct *seg_desc, u16 selector,
3275 kvm_desct->padding = 0; 3351 kvm_desct->padding = 0;
3276} 3352}
3277 3353
3278static void get_segment_descritptor_dtable(struct kvm_vcpu *vcpu, 3354static void get_segment_descriptor_dtable(struct kvm_vcpu *vcpu,
3279 u16 selector, 3355 u16 selector,
3280 struct descriptor_table *dtable) 3356 struct descriptor_table *dtable)
3281{ 3357{
3282 if (selector & 1 << 2) { 3358 if (selector & 1 << 2) {
3283 struct kvm_segment kvm_seg; 3359 struct kvm_segment kvm_seg;
@@ -3302,7 +3378,7 @@ static int load_guest_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
3302 struct descriptor_table dtable; 3378 struct descriptor_table dtable;
3303 u16 index = selector >> 3; 3379 u16 index = selector >> 3;
3304 3380
3305 get_segment_descritptor_dtable(vcpu, selector, &dtable); 3381 get_segment_descriptor_dtable(vcpu, selector, &dtable);
3306 3382
3307 if (dtable.limit < index * 8 + 7) { 3383 if (dtable.limit < index * 8 + 7) {
3308 kvm_queue_exception_e(vcpu, GP_VECTOR, selector & 0xfffc); 3384 kvm_queue_exception_e(vcpu, GP_VECTOR, selector & 0xfffc);
@@ -3321,7 +3397,7 @@ static int save_guest_segment_descriptor(struct kvm_vcpu *vcpu, u16 selector,
3321 struct descriptor_table dtable; 3397 struct descriptor_table dtable;
3322 u16 index = selector >> 3; 3398 u16 index = selector >> 3;
3323 3399
3324 get_segment_descritptor_dtable(vcpu, selector, &dtable); 3400 get_segment_descriptor_dtable(vcpu, selector, &dtable);
3325 3401
3326 if (dtable.limit < index * 8 + 7) 3402 if (dtable.limit < index * 8 + 7)
3327 return 1; 3403 return 1;
@@ -3900,6 +3976,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
3900 /* We do fxsave: this must be aligned. */ 3976 /* We do fxsave: this must be aligned. */
3901 BUG_ON((unsigned long)&vcpu->arch.host_fx_image & 0xF); 3977 BUG_ON((unsigned long)&vcpu->arch.host_fx_image & 0xF);
3902 3978
3979 vcpu->arch.mtrr_state.have_fixed = 1;
3903 vcpu_load(vcpu); 3980 vcpu_load(vcpu);
3904 r = kvm_arch_vcpu_reset(vcpu); 3981 r = kvm_arch_vcpu_reset(vcpu);
3905 if (r == 0) 3982 if (r == 0)
@@ -3925,6 +4002,9 @@ void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu)
3925 4002
3926int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu) 4003int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu)
3927{ 4004{
4005 vcpu->arch.nmi_pending = false;
4006 vcpu->arch.nmi_injected = false;
4007
3928 return kvm_x86_ops->vcpu_reset(vcpu); 4008 return kvm_x86_ops->vcpu_reset(vcpu);
3929} 4009}
3930 4010
@@ -4012,6 +4092,7 @@ struct kvm *kvm_arch_create_vm(void)
4012 return ERR_PTR(-ENOMEM); 4092 return ERR_PTR(-ENOMEM);
4013 4093
4014 INIT_LIST_HEAD(&kvm->arch.active_mmu_pages); 4094 INIT_LIST_HEAD(&kvm->arch.active_mmu_pages);
4095 INIT_LIST_HEAD(&kvm->arch.oos_global_pages);
4015 INIT_LIST_HEAD(&kvm->arch.assigned_dev_head); 4096 INIT_LIST_HEAD(&kvm->arch.assigned_dev_head);
4016 4097
4017 /* Reserve bit 0 of irq_sources_bitmap for userspace irq source */ 4098 /* Reserve bit 0 of irq_sources_bitmap for userspace irq source */
@@ -4048,8 +4129,8 @@ static void kvm_free_vcpus(struct kvm *kvm)
4048 4129
4049void kvm_arch_destroy_vm(struct kvm *kvm) 4130void kvm_arch_destroy_vm(struct kvm *kvm)
4050{ 4131{
4051 kvm_iommu_unmap_guest(kvm);
4052 kvm_free_all_assigned_devices(kvm); 4132 kvm_free_all_assigned_devices(kvm);
4133 kvm_iommu_unmap_guest(kvm);
4053 kvm_free_pit(kvm); 4134 kvm_free_pit(kvm);
4054 kfree(kvm->arch.vpic); 4135 kfree(kvm->arch.vpic);
4055 kfree(kvm->arch.vioapic); 4136 kfree(kvm->arch.vioapic);
@@ -4127,7 +4208,8 @@ void kvm_arch_flush_shadow(struct kvm *kvm)
4127int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) 4208int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
4128{ 4209{
4129 return vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE 4210 return vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE
4130 || vcpu->arch.mp_state == KVM_MP_STATE_SIPI_RECEIVED; 4211 || vcpu->arch.mp_state == KVM_MP_STATE_SIPI_RECEIVED
4212 || vcpu->arch.nmi_pending;
4131} 4213}
4132 4214
4133static void vcpu_kick_intr(void *info) 4215static void vcpu_kick_intr(void *info)
diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c
index ea051173b0da..d174db7a3370 100644
--- a/arch/x86/kvm/x86_emulate.c
+++ b/arch/x86/kvm/x86_emulate.c
@@ -58,6 +58,7 @@
58#define SrcMem32 (4<<4) /* Memory operand (32-bit). */ 58#define SrcMem32 (4<<4) /* Memory operand (32-bit). */
59#define SrcImm (5<<4) /* Immediate operand. */ 59#define SrcImm (5<<4) /* Immediate operand. */
60#define SrcImmByte (6<<4) /* 8-bit sign-extended immediate operand. */ 60#define SrcImmByte (6<<4) /* 8-bit sign-extended immediate operand. */
61#define SrcOne (7<<4) /* Implied '1' */
61#define SrcMask (7<<4) 62#define SrcMask (7<<4)
62/* Generic ModRM decode. */ 63/* Generic ModRM decode. */
63#define ModRM (1<<7) 64#define ModRM (1<<7)
@@ -70,17 +71,23 @@
70#define Group (1<<14) /* Bits 3:5 of modrm byte extend opcode */ 71#define Group (1<<14) /* Bits 3:5 of modrm byte extend opcode */
71#define GroupDual (1<<15) /* Alternate decoding of mod == 3 */ 72#define GroupDual (1<<15) /* Alternate decoding of mod == 3 */
72#define GroupMask 0xff /* Group number stored in bits 0:7 */ 73#define GroupMask 0xff /* Group number stored in bits 0:7 */
74/* Source 2 operand type */
75#define Src2None (0<<29)
76#define Src2CL (1<<29)
77#define Src2ImmByte (2<<29)
78#define Src2One (3<<29)
79#define Src2Mask (7<<29)
73 80
74enum { 81enum {
75 Group1_80, Group1_81, Group1_82, Group1_83, 82 Group1_80, Group1_81, Group1_82, Group1_83,
76 Group1A, Group3_Byte, Group3, Group4, Group5, Group7, 83 Group1A, Group3_Byte, Group3, Group4, Group5, Group7,
77}; 84};
78 85
79static u16 opcode_table[256] = { 86static u32 opcode_table[256] = {
80 /* 0x00 - 0x07 */ 87 /* 0x00 - 0x07 */
81 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 88 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
82 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, 89 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
83 0, 0, 0, 0, 90 ByteOp | DstAcc | SrcImm, DstAcc | SrcImm, 0, 0,
84 /* 0x08 - 0x0F */ 91 /* 0x08 - 0x0F */
85 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 92 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM,
86 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM, 93 ByteOp | DstReg | SrcMem | ModRM, DstReg | SrcMem | ModRM,
@@ -195,7 +202,7 @@ static u16 opcode_table[256] = {
195 ImplicitOps, ImplicitOps, Group | Group4, Group | Group5, 202 ImplicitOps, ImplicitOps, Group | Group4, Group | Group5,
196}; 203};
197 204
198static u16 twobyte_table[256] = { 205static u32 twobyte_table[256] = {
199 /* 0x00 - 0x0F */ 206 /* 0x00 - 0x0F */
200 0, Group | GroupDual | Group7, 0, 0, 0, 0, ImplicitOps, 0, 207 0, Group | GroupDual | Group7, 0, 0, 0, 0, ImplicitOps, 0,
201 ImplicitOps, ImplicitOps, 0, 0, 0, ImplicitOps | ModRM, 0, 0, 208 ImplicitOps, ImplicitOps, 0, 0, 0, ImplicitOps | ModRM, 0, 0,
@@ -230,9 +237,14 @@ static u16 twobyte_table[256] = {
230 /* 0x90 - 0x9F */ 237 /* 0x90 - 0x9F */
231 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 238 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
232 /* 0xA0 - 0xA7 */ 239 /* 0xA0 - 0xA7 */
233 0, 0, 0, DstMem | SrcReg | ModRM | BitOp, 0, 0, 0, 0, 240 0, 0, 0, DstMem | SrcReg | ModRM | BitOp,
241 DstMem | SrcReg | Src2ImmByte | ModRM,
242 DstMem | SrcReg | Src2CL | ModRM, 0, 0,
234 /* 0xA8 - 0xAF */ 243 /* 0xA8 - 0xAF */
235 0, 0, 0, DstMem | SrcReg | ModRM | BitOp, 0, 0, ModRM, 0, 244 0, 0, 0, DstMem | SrcReg | ModRM | BitOp,
245 DstMem | SrcReg | Src2ImmByte | ModRM,
246 DstMem | SrcReg | Src2CL | ModRM,
247 ModRM, 0,
236 /* 0xB0 - 0xB7 */ 248 /* 0xB0 - 0xB7 */
237 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 0, 249 ByteOp | DstMem | SrcReg | ModRM, DstMem | SrcReg | ModRM, 0,
238 DstMem | SrcReg | ModRM | BitOp, 250 DstMem | SrcReg | ModRM | BitOp,
@@ -253,7 +265,7 @@ static u16 twobyte_table[256] = {
253 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 265 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
254}; 266};
255 267
256static u16 group_table[] = { 268static u32 group_table[] = {
257 [Group1_80*8] = 269 [Group1_80*8] =
258 ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, 270 ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM,
259 ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM, 271 ByteOp | DstMem | SrcImm | ModRM, ByteOp | DstMem | SrcImm | ModRM,
@@ -297,9 +309,9 @@ static u16 group_table[] = {
297 SrcMem16 | ModRM | Mov, SrcMem | ModRM | ByteOp, 309 SrcMem16 | ModRM | Mov, SrcMem | ModRM | ByteOp,
298}; 310};
299 311
300static u16 group2_table[] = { 312static u32 group2_table[] = {
301 [Group7*8] = 313 [Group7*8] =
302 SrcNone | ModRM, 0, 0, 0, 314 SrcNone | ModRM, 0, 0, SrcNone | ModRM,
303 SrcNone | ModRM | DstMem | Mov, 0, 315 SrcNone | ModRM | DstMem | Mov, 0,
304 SrcMem16 | ModRM | Mov, 0, 316 SrcMem16 | ModRM | Mov, 0,
305}; 317};
@@ -359,49 +371,48 @@ static u16 group2_table[] = {
359 "andl %"_msk",%"_LO32 _tmp"; " \ 371 "andl %"_msk",%"_LO32 _tmp"; " \
360 "orl %"_LO32 _tmp",%"_sav"; " 372 "orl %"_LO32 _tmp",%"_sav"; "
361 373
374#ifdef CONFIG_X86_64
375#define ON64(x) x
376#else
377#define ON64(x)
378#endif
379
380#define ____emulate_2op(_op, _src, _dst, _eflags, _x, _y, _suffix) \
381 do { \
382 __asm__ __volatile__ ( \
383 _PRE_EFLAGS("0", "4", "2") \
384 _op _suffix " %"_x"3,%1; " \
385 _POST_EFLAGS("0", "4", "2") \
386 : "=m" (_eflags), "=m" ((_dst).val), \
387 "=&r" (_tmp) \
388 : _y ((_src).val), "i" (EFLAGS_MASK)); \
389 } while (0)
390
391
362/* Raw emulation: instruction has two explicit operands. */ 392/* Raw emulation: instruction has two explicit operands. */
363#define __emulate_2op_nobyte(_op,_src,_dst,_eflags,_wx,_wy,_lx,_ly,_qx,_qy) \ 393#define __emulate_2op_nobyte(_op,_src,_dst,_eflags,_wx,_wy,_lx,_ly,_qx,_qy) \
364 do { \ 394 do { \
365 unsigned long _tmp; \ 395 unsigned long _tmp; \
366 \ 396 \
367 switch ((_dst).bytes) { \ 397 switch ((_dst).bytes) { \
368 case 2: \ 398 case 2: \
369 __asm__ __volatile__ ( \ 399 ____emulate_2op(_op,_src,_dst,_eflags,_wx,_wy,"w"); \
370 _PRE_EFLAGS("0", "4", "2") \ 400 break; \
371 _op"w %"_wx"3,%1; " \ 401 case 4: \
372 _POST_EFLAGS("0", "4", "2") \ 402 ____emulate_2op(_op,_src,_dst,_eflags,_lx,_ly,"l"); \
373 : "=m" (_eflags), "=m" ((_dst).val), \ 403 break; \
374 "=&r" (_tmp) \ 404 case 8: \
375 : _wy ((_src).val), "i" (EFLAGS_MASK)); \ 405 ON64(____emulate_2op(_op,_src,_dst,_eflags,_qx,_qy,"q")); \
376 break; \ 406 break; \
377 case 4: \ 407 } \
378 __asm__ __volatile__ ( \
379 _PRE_EFLAGS("0", "4", "2") \
380 _op"l %"_lx"3,%1; " \
381 _POST_EFLAGS("0", "4", "2") \
382 : "=m" (_eflags), "=m" ((_dst).val), \
383 "=&r" (_tmp) \
384 : _ly ((_src).val), "i" (EFLAGS_MASK)); \
385 break; \
386 case 8: \
387 __emulate_2op_8byte(_op, _src, _dst, \
388 _eflags, _qx, _qy); \
389 break; \
390 } \
391 } while (0) 408 } while (0)
392 409
393#define __emulate_2op(_op,_src,_dst,_eflags,_bx,_by,_wx,_wy,_lx,_ly,_qx,_qy) \ 410#define __emulate_2op(_op,_src,_dst,_eflags,_bx,_by,_wx,_wy,_lx,_ly,_qx,_qy) \
394 do { \ 411 do { \
395 unsigned long __tmp; \ 412 unsigned long _tmp; \
396 switch ((_dst).bytes) { \ 413 switch ((_dst).bytes) { \
397 case 1: \ 414 case 1: \
398 __asm__ __volatile__ ( \ 415 ____emulate_2op(_op,_src,_dst,_eflags,_bx,_by,"b"); \
399 _PRE_EFLAGS("0", "4", "2") \
400 _op"b %"_bx"3,%1; " \
401 _POST_EFLAGS("0", "4", "2") \
402 : "=m" (_eflags), "=m" ((_dst).val), \
403 "=&r" (__tmp) \
404 : _by ((_src).val), "i" (EFLAGS_MASK)); \
405 break; \ 416 break; \
406 default: \ 417 default: \
407 __emulate_2op_nobyte(_op, _src, _dst, _eflags, \ 418 __emulate_2op_nobyte(_op, _src, _dst, _eflags, \
@@ -425,71 +436,68 @@ static u16 group2_table[] = {
425 __emulate_2op_nobyte(_op, _src, _dst, _eflags, \ 436 __emulate_2op_nobyte(_op, _src, _dst, _eflags, \
426 "w", "r", _LO32, "r", "", "r") 437 "w", "r", _LO32, "r", "", "r")
427 438
428/* Instruction has only one explicit operand (no source operand). */ 439/* Instruction has three operands and one operand is stored in ECX register */
429#define emulate_1op(_op, _dst, _eflags) \ 440#define __emulate_2op_cl(_op, _cl, _src, _dst, _eflags, _suffix, _type) \
430 do { \ 441 do { \
431 unsigned long _tmp; \ 442 unsigned long _tmp; \
432 \ 443 _type _clv = (_cl).val; \
433 switch ((_dst).bytes) { \ 444 _type _srcv = (_src).val; \
434 case 1: \ 445 _type _dstv = (_dst).val; \
435 __asm__ __volatile__ ( \ 446 \
436 _PRE_EFLAGS("0", "3", "2") \ 447 __asm__ __volatile__ ( \
437 _op"b %1; " \ 448 _PRE_EFLAGS("0", "5", "2") \
438 _POST_EFLAGS("0", "3", "2") \ 449 _op _suffix " %4,%1 \n" \
439 : "=m" (_eflags), "=m" ((_dst).val), \ 450 _POST_EFLAGS("0", "5", "2") \
440 "=&r" (_tmp) \ 451 : "=m" (_eflags), "+r" (_dstv), "=&r" (_tmp) \
441 : "i" (EFLAGS_MASK)); \ 452 : "c" (_clv) , "r" (_srcv), "i" (EFLAGS_MASK) \
442 break; \ 453 ); \
443 case 2: \ 454 \
444 __asm__ __volatile__ ( \ 455 (_cl).val = (unsigned long) _clv; \
445 _PRE_EFLAGS("0", "3", "2") \ 456 (_src).val = (unsigned long) _srcv; \
446 _op"w %1; " \ 457 (_dst).val = (unsigned long) _dstv; \
447 _POST_EFLAGS("0", "3", "2") \
448 : "=m" (_eflags), "=m" ((_dst).val), \
449 "=&r" (_tmp) \
450 : "i" (EFLAGS_MASK)); \
451 break; \
452 case 4: \
453 __asm__ __volatile__ ( \
454 _PRE_EFLAGS("0", "3", "2") \
455 _op"l %1; " \
456 _POST_EFLAGS("0", "3", "2") \
457 : "=m" (_eflags), "=m" ((_dst).val), \
458 "=&r" (_tmp) \
459 : "i" (EFLAGS_MASK)); \
460 break; \
461 case 8: \
462 __emulate_1op_8byte(_op, _dst, _eflags); \
463 break; \
464 } \
465 } while (0) 458 } while (0)
466 459
467/* Emulate an instruction with quadword operands (x86/64 only). */ 460#define emulate_2op_cl(_op, _cl, _src, _dst, _eflags) \
468#if defined(CONFIG_X86_64) 461 do { \
469#define __emulate_2op_8byte(_op, _src, _dst, _eflags, _qx, _qy) \ 462 switch ((_dst).bytes) { \
470 do { \ 463 case 2: \
471 __asm__ __volatile__ ( \ 464 __emulate_2op_cl(_op, _cl, _src, _dst, _eflags, \
472 _PRE_EFLAGS("0", "4", "2") \ 465 "w", unsigned short); \
473 _op"q %"_qx"3,%1; " \ 466 break; \
474 _POST_EFLAGS("0", "4", "2") \ 467 case 4: \
475 : "=m" (_eflags), "=m" ((_dst).val), "=&r" (_tmp) \ 468 __emulate_2op_cl(_op, _cl, _src, _dst, _eflags, \
476 : _qy ((_src).val), "i" (EFLAGS_MASK)); \ 469 "l", unsigned int); \
470 break; \
471 case 8: \
472 ON64(__emulate_2op_cl(_op, _cl, _src, _dst, _eflags, \
473 "q", unsigned long)); \
474 break; \
475 } \
477 } while (0) 476 } while (0)
478 477
479#define __emulate_1op_8byte(_op, _dst, _eflags) \ 478#define __emulate_1op(_op, _dst, _eflags, _suffix) \
480 do { \ 479 do { \
481 __asm__ __volatile__ ( \ 480 unsigned long _tmp; \
482 _PRE_EFLAGS("0", "3", "2") \ 481 \
483 _op"q %1; " \ 482 __asm__ __volatile__ ( \
484 _POST_EFLAGS("0", "3", "2") \ 483 _PRE_EFLAGS("0", "3", "2") \
485 : "=m" (_eflags), "=m" ((_dst).val), "=&r" (_tmp) \ 484 _op _suffix " %1; " \
486 : "i" (EFLAGS_MASK)); \ 485 _POST_EFLAGS("0", "3", "2") \
486 : "=m" (_eflags), "+m" ((_dst).val), \
487 "=&r" (_tmp) \
488 : "i" (EFLAGS_MASK)); \
487 } while (0) 489 } while (0)
488 490
489#elif defined(__i386__) 491/* Instruction has only one explicit operand (no source operand). */
490#define __emulate_2op_8byte(_op, _src, _dst, _eflags, _qx, _qy) 492#define emulate_1op(_op, _dst, _eflags) \
491#define __emulate_1op_8byte(_op, _dst, _eflags) 493 do { \
492#endif /* __i386__ */ 494 switch ((_dst).bytes) { \
495 case 1: __emulate_1op(_op, _dst, _eflags, "b"); break; \
496 case 2: __emulate_1op(_op, _dst, _eflags, "w"); break; \
497 case 4: __emulate_1op(_op, _dst, _eflags, "l"); break; \
498 case 8: ON64(__emulate_1op(_op, _dst, _eflags, "q")); break; \
499 } \
500 } while (0)
493 501
494/* Fetch next part of the instruction being emulated. */ 502/* Fetch next part of the instruction being emulated. */
495#define insn_fetch(_type, _size, _eip) \ 503#define insn_fetch(_type, _size, _eip) \
@@ -1041,6 +1049,33 @@ done_prefixes:
1041 c->src.bytes = 1; 1049 c->src.bytes = 1;
1042 c->src.val = insn_fetch(s8, 1, c->eip); 1050 c->src.val = insn_fetch(s8, 1, c->eip);
1043 break; 1051 break;
1052 case SrcOne:
1053 c->src.bytes = 1;
1054 c->src.val = 1;
1055 break;
1056 }
1057
1058 /*
1059 * Decode and fetch the second source operand: register, memory
1060 * or immediate.
1061 */
1062 switch (c->d & Src2Mask) {
1063 case Src2None:
1064 break;
1065 case Src2CL:
1066 c->src2.bytes = 1;
1067 c->src2.val = c->regs[VCPU_REGS_RCX] & 0x8;
1068 break;
1069 case Src2ImmByte:
1070 c->src2.type = OP_IMM;
1071 c->src2.ptr = (unsigned long *)c->eip;
1072 c->src2.bytes = 1;
1073 c->src2.val = insn_fetch(u8, 1, c->eip);
1074 break;
1075 case Src2One:
1076 c->src2.bytes = 1;
1077 c->src2.val = 1;
1078 break;
1044 } 1079 }
1045 1080
1046 /* Decode and fetch the destination operand: register or memory. */ 1081 /* Decode and fetch the destination operand: register or memory. */
@@ -1100,20 +1135,33 @@ static inline void emulate_push(struct x86_emulate_ctxt *ctxt)
1100 c->regs[VCPU_REGS_RSP]); 1135 c->regs[VCPU_REGS_RSP]);
1101} 1136}
1102 1137
1103static inline int emulate_grp1a(struct x86_emulate_ctxt *ctxt, 1138static int emulate_pop(struct x86_emulate_ctxt *ctxt,
1104 struct x86_emulate_ops *ops) 1139 struct x86_emulate_ops *ops)
1105{ 1140{
1106 struct decode_cache *c = &ctxt->decode; 1141 struct decode_cache *c = &ctxt->decode;
1107 int rc; 1142 int rc;
1108 1143
1109 rc = ops->read_std(register_address(c, ss_base(ctxt), 1144 rc = ops->read_emulated(register_address(c, ss_base(ctxt),
1110 c->regs[VCPU_REGS_RSP]), 1145 c->regs[VCPU_REGS_RSP]),
1111 &c->dst.val, c->dst.bytes, ctxt->vcpu); 1146 &c->src.val, c->src.bytes, ctxt->vcpu);
1112 if (rc != 0) 1147 if (rc != 0)
1113 return rc; 1148 return rc;
1114 1149
1115 register_address_increment(c, &c->regs[VCPU_REGS_RSP], c->dst.bytes); 1150 register_address_increment(c, &c->regs[VCPU_REGS_RSP], c->src.bytes);
1151 return rc;
1152}
1153
1154static inline int emulate_grp1a(struct x86_emulate_ctxt *ctxt,
1155 struct x86_emulate_ops *ops)
1156{
1157 struct decode_cache *c = &ctxt->decode;
1158 int rc;
1116 1159
1160 c->src.bytes = c->dst.bytes;
1161 rc = emulate_pop(ctxt, ops);
1162 if (rc != 0)
1163 return rc;
1164 c->dst.val = c->src.val;
1117 return 0; 1165 return 0;
1118} 1166}
1119 1167
@@ -1415,24 +1463,15 @@ special_insn:
1415 emulate_1op("dec", c->dst, ctxt->eflags); 1463 emulate_1op("dec", c->dst, ctxt->eflags);
1416 break; 1464 break;
1417 case 0x50 ... 0x57: /* push reg */ 1465 case 0x50 ... 0x57: /* push reg */
1418 c->dst.type = OP_MEM; 1466 emulate_push(ctxt);
1419 c->dst.bytes = c->op_bytes;
1420 c->dst.val = c->src.val;
1421 register_address_increment(c, &c->regs[VCPU_REGS_RSP],
1422 -c->op_bytes);
1423 c->dst.ptr = (void *) register_address(
1424 c, ss_base(ctxt), c->regs[VCPU_REGS_RSP]);
1425 break; 1467 break;
1426 case 0x58 ... 0x5f: /* pop reg */ 1468 case 0x58 ... 0x5f: /* pop reg */
1427 pop_instruction: 1469 pop_instruction:
1428 if ((rc = ops->read_std(register_address(c, ss_base(ctxt), 1470 c->src.bytes = c->op_bytes;
1429 c->regs[VCPU_REGS_RSP]), c->dst.ptr, 1471 rc = emulate_pop(ctxt, ops);
1430 c->op_bytes, ctxt->vcpu)) != 0) 1472 if (rc != 0)
1431 goto done; 1473 goto done;
1432 1474 c->dst.val = c->src.val;
1433 register_address_increment(c, &c->regs[VCPU_REGS_RSP],
1434 c->op_bytes);
1435 c->dst.type = OP_NONE; /* Disable writeback. */
1436 break; 1475 break;
1437 case 0x63: /* movsxd */ 1476 case 0x63: /* movsxd */
1438 if (ctxt->mode != X86EMUL_MODE_PROT64) 1477 if (ctxt->mode != X86EMUL_MODE_PROT64)
@@ -1591,7 +1630,9 @@ special_insn:
1591 emulate_push(ctxt); 1630 emulate_push(ctxt);
1592 break; 1631 break;
1593 case 0x9d: /* popf */ 1632 case 0x9d: /* popf */
1633 c->dst.type = OP_REG;
1594 c->dst.ptr = (unsigned long *) &ctxt->eflags; 1634 c->dst.ptr = (unsigned long *) &ctxt->eflags;
1635 c->dst.bytes = c->op_bytes;
1595 goto pop_instruction; 1636 goto pop_instruction;
1596 case 0xa0 ... 0xa1: /* mov */ 1637 case 0xa0 ... 0xa1: /* mov */
1597 c->dst.ptr = (unsigned long *)&c->regs[VCPU_REGS_RAX]; 1638 c->dst.ptr = (unsigned long *)&c->regs[VCPU_REGS_RAX];
@@ -1689,7 +1730,9 @@ special_insn:
1689 emulate_grp2(ctxt); 1730 emulate_grp2(ctxt);
1690 break; 1731 break;
1691 case 0xc3: /* ret */ 1732 case 0xc3: /* ret */
1733 c->dst.type = OP_REG;
1692 c->dst.ptr = &c->eip; 1734 c->dst.ptr = &c->eip;
1735 c->dst.bytes = c->op_bytes;
1693 goto pop_instruction; 1736 goto pop_instruction;
1694 case 0xc6 ... 0xc7: /* mov (sole member of Grp11) */ 1737 case 0xc6 ... 0xc7: /* mov (sole member of Grp11) */
1695 mov: 1738 mov:
@@ -1778,7 +1821,7 @@ special_insn:
1778 c->eip = saved_eip; 1821 c->eip = saved_eip;
1779 goto cannot_emulate; 1822 goto cannot_emulate;
1780 } 1823 }
1781 return 0; 1824 break;
1782 case 0xf4: /* hlt */ 1825 case 0xf4: /* hlt */
1783 ctxt->vcpu->arch.halt_request = 1; 1826 ctxt->vcpu->arch.halt_request = 1;
1784 break; 1827 break;
@@ -1999,12 +2042,20 @@ twobyte_insn:
1999 c->src.val &= (c->dst.bytes << 3) - 1; 2042 c->src.val &= (c->dst.bytes << 3) - 1;
2000 emulate_2op_SrcV_nobyte("bt", c->src, c->dst, ctxt->eflags); 2043 emulate_2op_SrcV_nobyte("bt", c->src, c->dst, ctxt->eflags);
2001 break; 2044 break;
2045 case 0xa4: /* shld imm8, r, r/m */
2046 case 0xa5: /* shld cl, r, r/m */
2047 emulate_2op_cl("shld", c->src2, c->src, c->dst, ctxt->eflags);
2048 break;
2002 case 0xab: 2049 case 0xab:
2003 bts: /* bts */ 2050 bts: /* bts */
2004 /* only subword offset */ 2051 /* only subword offset */
2005 c->src.val &= (c->dst.bytes << 3) - 1; 2052 c->src.val &= (c->dst.bytes << 3) - 1;
2006 emulate_2op_SrcV_nobyte("bts", c->src, c->dst, ctxt->eflags); 2053 emulate_2op_SrcV_nobyte("bts", c->src, c->dst, ctxt->eflags);
2007 break; 2054 break;
2055 case 0xac: /* shrd imm8, r, r/m */
2056 case 0xad: /* shrd cl, r, r/m */
2057 emulate_2op_cl("shrd", c->src2, c->src, c->dst, ctxt->eflags);
2058 break;
2008 case 0xae: /* clflush */ 2059 case 0xae: /* clflush */
2009 break; 2060 break;
2010 case 0xb0 ... 0xb1: /* cmpxchg */ 2061 case 0xb0 ... 0xb1: /* cmpxchg */
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c
index 50a779264bb1..a7ed208f81e3 100644
--- a/arch/x86/lguest/boot.c
+++ b/arch/x86/lguest/boot.c
@@ -738,7 +738,7 @@ static void lguest_time_init(void)
738 738
739 /* We can't set cpumask in the initializer: damn C limitations! Set it 739 /* We can't set cpumask in the initializer: damn C limitations! Set it
740 * here and register our timer device. */ 740 * here and register our timer device. */
741 lguest_clockevent.cpumask = cpumask_of_cpu(0); 741 lguest_clockevent.cpumask = cpumask_of(0);
742 clockevents_register_device(&lguest_clockevent); 742 clockevents_register_device(&lguest_clockevent);
743 743
744 /* Finally, we unblock the timer interrupt. */ 744 /* Finally, we unblock the timer interrupt. */
diff --git a/arch/x86/mach-default/setup.c b/arch/x86/mach-default/setup.c
index 37b9ae4d44c5..df167f265622 100644
--- a/arch/x86/mach-default/setup.c
+++ b/arch/x86/mach-default/setup.c
@@ -133,29 +133,28 @@ void __init time_init_hook(void)
133 **/ 133 **/
134void mca_nmi_hook(void) 134void mca_nmi_hook(void)
135{ 135{
136 /* If I recall correctly, there's a whole bunch of other things that 136 /*
137 * If I recall correctly, there's a whole bunch of other things that
137 * we can do to check for NMI problems, but that's all I know about 138 * we can do to check for NMI problems, but that's all I know about
138 * at the moment. 139 * at the moment.
139 */ 140 */
140 141 pr_warning("NMI generated from unknown source!\n");
141 printk("NMI generated from unknown source!\n");
142} 142}
143#endif 143#endif
144 144
145static __init int no_ipi_broadcast(char *str) 145static __init int no_ipi_broadcast(char *str)
146{ 146{
147 get_option(&str, &no_broadcast); 147 get_option(&str, &no_broadcast);
148 printk ("Using %s mode\n", no_broadcast ? "No IPI Broadcast" : 148 pr_info("Using %s mode\n",
149 "IPI Broadcast"); 149 no_broadcast ? "No IPI Broadcast" : "IPI Broadcast");
150 return 1; 150 return 1;
151} 151}
152
153__setup("no_ipi_broadcast=", no_ipi_broadcast); 152__setup("no_ipi_broadcast=", no_ipi_broadcast);
154 153
155static int __init print_ipi_mode(void) 154static int __init print_ipi_mode(void)
156{ 155{
157 printk ("Using IPI %s mode\n", no_broadcast ? "No-Shortcut" : 156 pr_info("Using IPI %s mode\n",
158 "Shortcut"); 157 no_broadcast ? "No-Shortcut" : "Shortcut");
159 return 0; 158 return 0;
160} 159}
161 160
diff --git a/arch/x86/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c
index 3624a364b7f3..bc4c7840b2a8 100644
--- a/arch/x86/mach-generic/bigsmp.c
+++ b/arch/x86/mach-generic/bigsmp.c
@@ -42,9 +42,10 @@ static const struct dmi_system_id bigsmp_dmi_table[] = {
42 { } 42 { }
43}; 43};
44 44
45static cpumask_t vector_allocation_domain(int cpu) 45static void vector_allocation_domain(int cpu, cpumask_t *retmask)
46{ 46{
47 return cpumask_of_cpu(cpu); 47 cpus_clear(*retmask);
48 cpu_set(cpu, *retmask);
48} 49}
49 50
50static int probe_bigsmp(void) 51static int probe_bigsmp(void)
diff --git a/arch/x86/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c
index 7b4e6d0d1690..c2ded1448024 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -43,12 +43,12 @@ static void __init enable_apic_mode(void)
43 return; 43 return;
44} 44}
45 45
46static __init int mps_oem_check(struct mp_config_table *mpc, char *oem, 46static __init int
47 char *productid) 47mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
48{ 48{
49 if (mpc->mpc_oemptr) { 49 if (mpc->oemptr) {
50 struct mp_config_oemtable *oem_table = 50 struct mpc_oemtable *oem_table =
51 (struct mp_config_oemtable *)mpc->mpc_oemptr; 51 (struct mpc_oemtable *)mpc->oemptr;
52 if (!strncmp(oem, "UNISYS", 6)) 52 if (!strncmp(oem, "UNISYS", 6))
53 return parse_unisys_oem((char *)oem_table); 53 return parse_unisys_oem((char *)oem_table);
54 } 54 }
@@ -87,7 +87,7 @@ static int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id)
87} 87}
88#endif 88#endif
89 89
90static cpumask_t vector_allocation_domain(int cpu) 90static void vector_allocation_domain(int cpu, cpumask_t *retmask)
91{ 91{
92 /* Careful. Some cpus do not strictly honor the set of cpus 92 /* Careful. Some cpus do not strictly honor the set of cpus
93 * specified in the interrupt destination when using lowest 93 * specified in the interrupt destination when using lowest
@@ -97,8 +97,7 @@ static cpumask_t vector_allocation_domain(int cpu)
97 * deliver interrupts to the wrong hyperthread when only one 97 * deliver interrupts to the wrong hyperthread when only one
98 * hyperthread was specified in the interrupt desitination. 98 * hyperthread was specified in the interrupt desitination.
99 */ 99 */
100 cpumask_t domain = { { [0] = APIC_ALL_CPUS, } }; 100 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
101 return domain;
102} 101}
103 102
104struct genapic __initdata_refok apic_es7000 = APIC_INIT("es7000", probe_es7000); 103struct genapic __initdata_refok apic_es7000 = APIC_INIT("es7000", probe_es7000);
diff --git a/arch/x86/mach-generic/numaq.c b/arch/x86/mach-generic/numaq.c
index 71a309b122e6..3679e2255645 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -19,8 +19,7 @@
19#include <asm/numaq/wakecpu.h> 19#include <asm/numaq/wakecpu.h>
20#include <asm/numaq.h> 20#include <asm/numaq.h>
21 21
22static int mps_oem_check(struct mp_config_table *mpc, char *oem, 22static int mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
23 char *productid)
24{ 23{
25 numaq_mps_oem_check(mpc, oem, productid); 24 numaq_mps_oem_check(mpc, oem, productid);
26 return found_numaq; 25 return found_numaq;
@@ -38,7 +37,7 @@ static int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
38 return 0; 37 return 0;
39} 38}
40 39
41static cpumask_t vector_allocation_domain(int cpu) 40static void vector_allocation_domain(int cpu, cpumask_t *retmask)
42{ 41{
43 /* Careful. Some cpus do not strictly honor the set of cpus 42 /* Careful. Some cpus do not strictly honor the set of cpus
44 * specified in the interrupt destination when using lowest 43 * specified in the interrupt destination when using lowest
@@ -48,8 +47,7 @@ static cpumask_t vector_allocation_domain(int cpu)
48 * deliver interrupts to the wrong hyperthread when only one 47 * deliver interrupts to the wrong hyperthread when only one
49 * hyperthread was specified in the interrupt desitination. 48 * hyperthread was specified in the interrupt desitination.
50 */ 49 */
51 cpumask_t domain = { { [0] = APIC_ALL_CPUS, } }; 50 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
52 return domain;
53} 51}
54 52
55struct genapic apic_numaq = APIC_INIT("NUMAQ", probe_numaq); 53struct genapic apic_numaq = APIC_INIT("NUMAQ", probe_numaq);
diff --git a/arch/x86/mach-generic/probe.c b/arch/x86/mach-generic/probe.c
index c346d9d0226f..15a38daef1a8 100644
--- a/arch/x86/mach-generic/probe.c
+++ b/arch/x86/mach-generic/probe.c
@@ -110,8 +110,7 @@ void __init generic_apic_probe(void)
110 110
111/* These functions can switch the APIC even after the initial ->probe() */ 111/* These functions can switch the APIC even after the initial ->probe() */
112 112
113int __init mps_oem_check(struct mp_config_table *mpc, char *oem, 113int __init mps_oem_check(struct mpc_table *mpc, char *oem, char *productid)
114 char *productid)
115{ 114{
116 int i; 115 int i;
117 for (i = 0; apic_probe[i]; ++i) { 116 for (i = 0; apic_probe[i]; ++i) {
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 2c6d234e0009..2821ffc188b5 100644
--- a/arch/x86/mach-generic/summit.c
+++ b/arch/x86/mach-generic/summit.c
@@ -24,7 +24,7 @@ static int probe_summit(void)
24 return 0; 24 return 0;
25} 25}
26 26
27static cpumask_t vector_allocation_domain(int cpu) 27static void vector_allocation_domain(int cpu, cpumask_t *retmask)
28{ 28{
29 /* Careful. Some cpus do not strictly honor the set of cpus 29 /* Careful. Some cpus do not strictly honor the set of cpus
30 * specified in the interrupt destination when using lowest 30 * specified in the interrupt destination when using lowest
@@ -34,8 +34,7 @@ static cpumask_t vector_allocation_domain(int cpu)
34 * deliver interrupts to the wrong hyperthread when only one 34 * deliver interrupts to the wrong hyperthread when only one
35 * hyperthread was specified in the interrupt desitination. 35 * hyperthread was specified in the interrupt desitination.
36 */ 36 */
37 cpumask_t domain = { { [0] = APIC_ALL_CPUS, } }; 37 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
38 return domain;
39} 38}
40 39
41struct genapic apic_summit = APIC_INIT("summit", probe_summit); 40struct genapic apic_summit = APIC_INIT("summit", probe_summit);
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c
index 52145007bd7e..9840b7ec749a 100644
--- a/arch/x86/mach-voyager/voyager_smp.c
+++ b/arch/x86/mach-voyager/voyager_smp.c
@@ -63,11 +63,6 @@ static int voyager_extended_cpus = 1;
63/* Used for the invalidate map that's also checked in the spinlock */ 63/* Used for the invalidate map that's also checked in the spinlock */
64static volatile unsigned long smp_invalidate_needed; 64static volatile unsigned long smp_invalidate_needed;
65 65
66/* Bitmask of currently online CPUs - used by setup.c for
67 /proc/cpuinfo, visible externally but still physical */
68cpumask_t cpu_online_map = CPU_MASK_NONE;
69EXPORT_SYMBOL(cpu_online_map);
70
71/* Bitmask of CPUs present in the system - exported by i386_syms.c, used 66/* Bitmask of CPUs present in the system - exported by i386_syms.c, used
72 * by scheduler but indexed physically */ 67 * by scheduler but indexed physically */
73cpumask_t phys_cpu_present_map = CPU_MASK_NONE; 68cpumask_t phys_cpu_present_map = CPU_MASK_NONE;
@@ -218,8 +213,6 @@ static cpumask_t smp_commenced_mask = CPU_MASK_NONE;
218/* This is for the new dynamic CPU boot code */ 213/* This is for the new dynamic CPU boot code */
219cpumask_t cpu_callin_map = CPU_MASK_NONE; 214cpumask_t cpu_callin_map = CPU_MASK_NONE;
220cpumask_t cpu_callout_map = CPU_MASK_NONE; 215cpumask_t cpu_callout_map = CPU_MASK_NONE;
221cpumask_t cpu_possible_map = CPU_MASK_NONE;
222EXPORT_SYMBOL(cpu_possible_map);
223 216
224/* The per processor IRQ masks (these are usually kept in sync) */ 217/* The per processor IRQ masks (these are usually kept in sync) */
225static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned; 218static __u16 vic_irq_mask[NR_CPUS] __cacheline_aligned;
@@ -364,9 +357,8 @@ void __init find_smp_config(void)
364 printk("VOYAGER SMP: Boot cpu is %d\n", boot_cpu_id); 357 printk("VOYAGER SMP: Boot cpu is %d\n", boot_cpu_id);
365 358
366 /* initialize the CPU structures (moved from smp_boot_cpus) */ 359 /* initialize the CPU structures (moved from smp_boot_cpus) */
367 for (i = 0; i < NR_CPUS; i++) { 360 for (i = 0; i < nr_cpu_ids; i++)
368 cpu_irq_affinity[i] = ~0; 361 cpu_irq_affinity[i] = ~0;
369 }
370 cpu_online_map = cpumask_of_cpu(boot_cpu_id); 362 cpu_online_map = cpumask_of_cpu(boot_cpu_id);
371 363
372 /* The boot CPU must be extended */ 364 /* The boot CPU must be extended */
@@ -679,7 +671,7 @@ void __init smp_boot_cpus(void)
679 671
680 /* loop over all the extended VIC CPUs and boot them. The 672 /* loop over all the extended VIC CPUs and boot them. The
681 * Quad CPUs must be bootstrapped by their extended VIC cpu */ 673 * Quad CPUs must be bootstrapped by their extended VIC cpu */
682 for (i = 0; i < NR_CPUS; i++) { 674 for (i = 0; i < nr_cpu_ids; i++) {
683 if (i == boot_cpu_id || !cpu_isset(i, phys_cpu_present_map)) 675 if (i == boot_cpu_id || !cpu_isset(i, phys_cpu_present_map))
684 continue; 676 continue;
685 do_boot_cpu(i); 677 do_boot_cpu(i);
@@ -1234,7 +1226,7 @@ int setup_profiling_timer(unsigned int multiplier)
1234 * new values until the next timer interrupt in which they do process 1226 * new values until the next timer interrupt in which they do process
1235 * accounting. 1227 * accounting.
1236 */ 1228 */
1237 for (i = 0; i < NR_CPUS; ++i) 1229 for (i = 0; i < nr_cpu_ids; ++i)
1238 per_cpu(prof_multiplier, i) = multiplier; 1230 per_cpu(prof_multiplier, i) = multiplier;
1239 1231
1240 return 0; 1232 return 0;
@@ -1264,7 +1256,7 @@ void __init voyager_smp_intr_init(void)
1264 int i; 1256 int i;
1265 1257
1266 /* initialize the per cpu irq mask to all disabled */ 1258 /* initialize the per cpu irq mask to all disabled */
1267 for (i = 0; i < NR_CPUS; i++) 1259 for (i = 0; i < nr_cpu_ids; i++)
1268 vic_irq_mask[i] = 0xFFFF; 1260 vic_irq_mask[i] = 0xFFFF;
1269 1261
1270 VIC_SET_GATE(VIC_CPI_LEVEL0, vic_cpi_interrupt); 1262 VIC_SET_GATE(VIC_CPI_LEVEL0, vic_cpi_interrupt);
diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 57ec8c86a877..90dfae511a41 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -534,7 +534,7 @@ static int vmalloc_fault(unsigned long address)
534 happen within a race in page table update. In the later 534 happen within a race in page table update. In the later
535 case just flush. */ 535 case just flush. */
536 536
537 pgd = pgd_offset(current->mm ?: &init_mm, address); 537 pgd = pgd_offset(current->active_mm, address);
538 pgd_ref = pgd_offset_k(address); 538 pgd_ref = pgd_offset_k(address);
539 if (pgd_none(*pgd_ref)) 539 if (pgd_none(*pgd_ref))
540 return -1; 540 return -1;
@@ -667,7 +667,6 @@ void __kprobes do_page_fault(struct pt_regs *regs, unsigned long error_code)
667 if (unlikely(in_atomic() || !mm)) 667 if (unlikely(in_atomic() || !mm))
668 goto bad_area_nosemaphore; 668 goto bad_area_nosemaphore;
669 669
670again:
671 /* 670 /*
672 * When running in the kernel we expect faults to occur only to 671 * When running in the kernel we expect faults to occur only to
673 * addresses in user space. All other faults represent errors in the 672 * addresses in user space. All other faults represent errors in the
@@ -859,25 +858,14 @@ no_context:
859 oops_end(flags, regs, sig); 858 oops_end(flags, regs, sig);
860#endif 859#endif
861 860
862/*
863 * We ran out of memory, or some other thing happened to us that made
864 * us unable to handle the page fault gracefully.
865 */
866out_of_memory: 861out_of_memory:
862 /*
863 * We ran out of memory, call the OOM killer, and return the userspace
864 * (which will retry the fault, or kill us if we got oom-killed).
865 */
867 up_read(&mm->mmap_sem); 866 up_read(&mm->mmap_sem);
868 if (is_global_init(tsk)) { 867 pagefault_out_of_memory();
869 yield(); 868 return;
870 /*
871 * Re-lookup the vma - in theory the vma tree might
872 * have changed:
873 */
874 goto again;
875 }
876
877 printk("VM: killing process %s\n", tsk->comm);
878 if (error_code & PF_USER)
879 do_group_exit(SIGKILL);
880 goto no_context;
881 869
882do_sigbus: 870do_sigbus:
883 up_read(&mm->mmap_sem); 871 up_read(&mm->mmap_sem);
diff --git a/arch/x86/mm/init_32.c b/arch/x86/mm/init_32.c
index 8655b5bb0963..88f1b10de3be 100644
--- a/arch/x86/mm/init_32.c
+++ b/arch/x86/mm/init_32.c
@@ -328,6 +328,8 @@ int devmem_is_allowed(unsigned long pagenr)
328{ 328{
329 if (pagenr <= 256) 329 if (pagenr <= 256)
330 return 1; 330 return 1;
331 if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
332 return 0;
331 if (!page_is_ram(pagenr)) 333 if (!page_is_ram(pagenr))
332 return 1; 334 return 1;
333 return 0; 335 return 0;
@@ -435,8 +437,12 @@ static void __init set_highmem_pages_init(void)
435#endif /* !CONFIG_NUMA */ 437#endif /* !CONFIG_NUMA */
436 438
437#else 439#else
438# define permanent_kmaps_init(pgd_base) do { } while (0) 440static inline void permanent_kmaps_init(pgd_t *pgd_base)
439# define set_highmem_pages_init() do { } while (0) 441{
442}
443static inline void set_highmem_pages_init(void)
444{
445}
440#endif /* CONFIG_HIGHMEM */ 446#endif /* CONFIG_HIGHMEM */
441 447
442void __init native_pagetable_setup_start(pgd_t *base) 448void __init native_pagetable_setup_start(pgd_t *base)
@@ -1075,7 +1081,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
1075 unsigned long start_pfn = start >> PAGE_SHIFT; 1081 unsigned long start_pfn = start >> PAGE_SHIFT;
1076 unsigned long nr_pages = size >> PAGE_SHIFT; 1082 unsigned long nr_pages = size >> PAGE_SHIFT;
1077 1083
1078 return __add_pages(zone, start_pfn, nr_pages); 1084 return __add_pages(nid, zone, start_pfn, nr_pages);
1079} 1085}
1080#endif 1086#endif
1081 1087
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 9f7a0d24d42a..23f68e77ad1f 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -857,7 +857,7 @@ int arch_add_memory(int nid, u64 start, u64 size)
857 if (last_mapped_pfn > max_pfn_mapped) 857 if (last_mapped_pfn > max_pfn_mapped)
858 max_pfn_mapped = last_mapped_pfn; 858 max_pfn_mapped = last_mapped_pfn;
859 859
860 ret = __add_pages(zone, start_pfn, nr_pages); 860 ret = __add_pages(nid, zone, start_pfn, nr_pages);
861 WARN_ON_ONCE(ret); 861 WARN_ON_ONCE(ret);
862 862
863 return ret; 863 return ret;
@@ -888,6 +888,8 @@ int devmem_is_allowed(unsigned long pagenr)
888{ 888{
889 if (pagenr <= 256) 889 if (pagenr <= 256)
890 return 1; 890 return 1;
891 if (iomem_is_exclusive(pagenr << PAGE_SHIFT))
892 return 0;
891 if (!page_is_ram(pagenr)) 893 if (!page_is_ram(pagenr))
892 return 1; 894 return 1;
893 return 0; 895 return 0;
diff --git a/arch/x86/mm/k8topology_64.c b/arch/x86/mm/k8topology_64.c
index 41f1b5c00a1d..268f8255280f 100644
--- a/arch/x86/mm/k8topology_64.c
+++ b/arch/x86/mm/k8topology_64.c
@@ -81,7 +81,6 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
81 unsigned numnodes, cores, bits, apicid_base; 81 unsigned numnodes, cores, bits, apicid_base;
82 unsigned long prevbase; 82 unsigned long prevbase;
83 struct bootnode nodes[8]; 83 struct bootnode nodes[8];
84 unsigned char nodeids[8];
85 int i, j, nb, found = 0; 84 int i, j, nb, found = 0;
86 u32 nodeid, reg; 85 u32 nodeid, reg;
87 86
@@ -110,7 +109,6 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
110 limit = read_pci_config(0, nb, 1, 0x44 + i*8); 109 limit = read_pci_config(0, nb, 1, 0x44 + i*8);
111 110
112 nodeid = limit & 7; 111 nodeid = limit & 7;
113 nodeids[i] = nodeid;
114 if ((base & 3) == 0) { 112 if ((base & 3) == 0) {
115 if (i < numnodes) 113 if (i < numnodes)
116 printk("Skipping disabled node %d\n", i); 114 printk("Skipping disabled node %d\n", i);
@@ -179,9 +177,6 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
179 177
180 nodes[nodeid].start = base; 178 nodes[nodeid].start = base;
181 nodes[nodeid].end = limit; 179 nodes[nodeid].end = limit;
182 e820_register_active_regions(nodeid,
183 nodes[nodeid].start >> PAGE_SHIFT,
184 nodes[nodeid].end >> PAGE_SHIFT);
185 180
186 prevbase = base; 181 prevbase = base;
187 182
@@ -211,12 +206,15 @@ int __init k8_scan_nodes(unsigned long start, unsigned long end)
211 } 206 }
212 207
213 for (i = 0; i < 8; i++) { 208 for (i = 0; i < 8; i++) {
214 if (nodes[i].start != nodes[i].end) { 209 if (nodes[i].start == nodes[i].end)
215 nodeid = nodeids[i]; 210 continue;
216 for (j = apicid_base; j < cores + apicid_base; j++) 211
217 apicid_to_node[(nodeid << bits) + j] = i; 212 e820_register_active_regions(i,
218 setup_node_bootmem(i, nodes[i].start, nodes[i].end); 213 nodes[i].start >> PAGE_SHIFT,
219 } 214 nodes[i].end >> PAGE_SHIFT);
215 for (j = apicid_base; j < cores + apicid_base; j++)
216 apicid_to_node[(i << bits) + j] = i;
217 setup_node_bootmem(i, nodes[i].start, nodes[i].end);
220 } 218 }
221 219
222 numa_init_array(); 220 numa_init_array();
diff --git a/arch/x86/mm/numa_32.c b/arch/x86/mm/numa_32.c
index 8518c678d83f..d1f7439d173c 100644
--- a/arch/x86/mm/numa_32.c
+++ b/arch/x86/mm/numa_32.c
@@ -239,7 +239,7 @@ void resume_map_numa_kva(pgd_t *pgd_base)
239 start_pfn = node_remap_start_pfn[node]; 239 start_pfn = node_remap_start_pfn[node];
240 size = node_remap_size[node]; 240 size = node_remap_size[node];
241 241
242 printk(KERN_DEBUG "%s: node %d\n", __FUNCTION__, node); 242 printk(KERN_DEBUG "%s: node %d\n", __func__, node);
243 243
244 for (pfn = 0; pfn < size; pfn += PTRS_PER_PTE) { 244 for (pfn = 0; pfn < size; pfn += PTRS_PER_PTE) {
245 unsigned long vaddr = start_va + (pfn << PAGE_SHIFT); 245 unsigned long vaddr = start_va + (pfn << PAGE_SHIFT);
@@ -251,7 +251,7 @@ void resume_map_numa_kva(pgd_t *pgd_base)
251 PAGE_KERNEL_LARGE_EXEC)); 251 PAGE_KERNEL_LARGE_EXEC));
252 252
253 printk(KERN_DEBUG "%s: %08lx -> pfn %08lx\n", 253 printk(KERN_DEBUG "%s: %08lx -> pfn %08lx\n",
254 __FUNCTION__, vaddr, start_pfn + pfn); 254 __func__, vaddr, start_pfn + pfn);
255 } 255 }
256 } 256 }
257} 257}
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index cebcbf152d46..71a14f89f89e 100644
--- a/arch/x86/mm/numa_64.c
+++ b/arch/x86/mm/numa_64.c
@@ -278,7 +278,7 @@ void __init numa_init_array(void)
278 int rr, i; 278 int rr, i;
279 279
280 rr = first_node(node_online_map); 280 rr = first_node(node_online_map);
281 for (i = 0; i < NR_CPUS; i++) { 281 for (i = 0; i < nr_cpu_ids; i++) {
282 if (early_cpu_to_node(i) != NUMA_NO_NODE) 282 if (early_cpu_to_node(i) != NUMA_NO_NODE)
283 continue; 283 continue;
284 numa_set_node(i, rr); 284 numa_set_node(i, rr);
@@ -549,7 +549,7 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn)
549 memnodemap[0] = 0; 549 memnodemap[0] = 0;
550 node_set_online(0); 550 node_set_online(0);
551 node_set(0, node_possible_map); 551 node_set(0, node_possible_map);
552 for (i = 0; i < NR_CPUS; i++) 552 for (i = 0; i < nr_cpu_ids; i++)
553 numa_set_node(i, 0); 553 numa_set_node(i, 0);
554 e820_register_active_regions(0, start_pfn, last_pfn); 554 e820_register_active_regions(0, start_pfn, last_pfn);
555 setup_node_bootmem(0, start_pfn << PAGE_SHIFT, last_pfn << PAGE_SHIFT); 555 setup_node_bootmem(0, start_pfn << PAGE_SHIFT, last_pfn << PAGE_SHIFT);
diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
index 51c0a2fc14fe..09737c8af074 100644
--- a/arch/x86/mm/srat_64.c
+++ b/arch/x86/mm/srat_64.c
@@ -382,7 +382,7 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end)
382 if (!node_online(i)) 382 if (!node_online(i))
383 setup_node_bootmem(i, nodes[i].start, nodes[i].end); 383 setup_node_bootmem(i, nodes[i].start, nodes[i].end);
384 384
385 for (i = 0; i < NR_CPUS; i++) { 385 for (i = 0; i < nr_cpu_ids; i++) {
386 int node = early_cpu_to_node(i); 386 int node = early_cpu_to_node(i);
387 387
388 if (node == NUMA_NO_NODE) 388 if (node == NUMA_NO_NODE)
diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c
index 98658f25f542..8fdf06e4edf9 100644
--- a/arch/x86/oprofile/op_model_amd.c
+++ b/arch/x86/oprofile/op_model_amd.c
@@ -2,7 +2,7 @@
2 * @file op_model_amd.c 2 * @file op_model_amd.c
3 * athlon / K7 / K8 / Family 10h model-specific MSR operations 3 * athlon / K7 / K8 / Family 10h model-specific MSR operations
4 * 4 *
5 * @remark Copyright 2002-2008 OProfile authors 5 * @remark Copyright 2002-2009 OProfile authors
6 * @remark Read the file COPYING 6 * @remark Read the file COPYING
7 * 7 *
8 * @author John Levon 8 * @author John Levon
@@ -10,7 +10,7 @@
10 * @author Graydon Hoare 10 * @author Graydon Hoare
11 * @author Robert Richter <robert.richter@amd.com> 11 * @author Robert Richter <robert.richter@amd.com>
12 * @author Barry Kasindorf 12 * @author Barry Kasindorf
13*/ 13 */
14 14
15#include <linux/oprofile.h> 15#include <linux/oprofile.h>
16#include <linux/device.h> 16#include <linux/device.h>
@@ -60,53 +60,10 @@ static unsigned long reset_value[NUM_COUNTERS];
60#define IBS_OP_LOW_VALID_BIT (1ULL<<18) /* bit 18 */ 60#define IBS_OP_LOW_VALID_BIT (1ULL<<18) /* bit 18 */
61#define IBS_OP_LOW_ENABLE (1ULL<<17) /* bit 17 */ 61#define IBS_OP_LOW_ENABLE (1ULL<<17) /* bit 17 */
62 62
63/* Codes used in cpu_buffer.c */ 63#define IBS_FETCH_SIZE 6
64/* This produces duplicate code, need to be fixed */ 64#define IBS_OP_SIZE 12
65#define IBS_FETCH_BEGIN 3
66#define IBS_OP_BEGIN 4
67
68/*
69 * The function interface needs to be fixed, something like add
70 * data. Should then be added to linux/oprofile.h.
71 */
72extern void
73oprofile_add_ibs_sample(struct pt_regs * const regs,
74 unsigned int * const ibs_sample, int ibs_code);
75
76struct ibs_fetch_sample {
77 /* MSRC001_1031 IBS Fetch Linear Address Register */
78 unsigned int ibs_fetch_lin_addr_low;
79 unsigned int ibs_fetch_lin_addr_high;
80 /* MSRC001_1030 IBS Fetch Control Register */
81 unsigned int ibs_fetch_ctl_low;
82 unsigned int ibs_fetch_ctl_high;
83 /* MSRC001_1032 IBS Fetch Physical Address Register */
84 unsigned int ibs_fetch_phys_addr_low;
85 unsigned int ibs_fetch_phys_addr_high;
86};
87
88struct ibs_op_sample {
89 /* MSRC001_1034 IBS Op Logical Address Register (IbsRIP) */
90 unsigned int ibs_op_rip_low;
91 unsigned int ibs_op_rip_high;
92 /* MSRC001_1035 IBS Op Data Register */
93 unsigned int ibs_op_data1_low;
94 unsigned int ibs_op_data1_high;
95 /* MSRC001_1036 IBS Op Data 2 Register */
96 unsigned int ibs_op_data2_low;
97 unsigned int ibs_op_data2_high;
98 /* MSRC001_1037 IBS Op Data 3 Register */
99 unsigned int ibs_op_data3_low;
100 unsigned int ibs_op_data3_high;
101 /* MSRC001_1038 IBS DC Linear Address Register (IbsDcLinAd) */
102 unsigned int ibs_dc_linear_low;
103 unsigned int ibs_dc_linear_high;
104 /* MSRC001_1039 IBS DC Physical Address Register (IbsDcPhysAd) */
105 unsigned int ibs_dc_phys_low;
106 unsigned int ibs_dc_phys_high;
107};
108 65
109static int ibs_allowed; /* AMD Family10h and later */ 66static int has_ibs; /* AMD Family10h and later */
110 67
111struct op_ibs_config { 68struct op_ibs_config {
112 unsigned long op_enabled; 69 unsigned long op_enabled;
@@ -197,31 +154,29 @@ static inline int
197op_amd_handle_ibs(struct pt_regs * const regs, 154op_amd_handle_ibs(struct pt_regs * const regs,
198 struct op_msrs const * const msrs) 155 struct op_msrs const * const msrs)
199{ 156{
200 unsigned int low, high; 157 u32 low, high;
201 struct ibs_fetch_sample ibs_fetch; 158 u64 msr;
202 struct ibs_op_sample ibs_op; 159 struct op_entry entry;
203 160
204 if (!ibs_allowed) 161 if (!has_ibs)
205 return 1; 162 return 1;
206 163
207 if (ibs_config.fetch_enabled) { 164 if (ibs_config.fetch_enabled) {
208 rdmsr(MSR_AMD64_IBSFETCHCTL, low, high); 165 rdmsr(MSR_AMD64_IBSFETCHCTL, low, high);
209 if (high & IBS_FETCH_HIGH_VALID_BIT) { 166 if (high & IBS_FETCH_HIGH_VALID_BIT) {
210 ibs_fetch.ibs_fetch_ctl_high = high; 167 rdmsrl(MSR_AMD64_IBSFETCHLINAD, msr);
211 ibs_fetch.ibs_fetch_ctl_low = low; 168 oprofile_write_reserve(&entry, regs, msr,
212 rdmsr(MSR_AMD64_IBSFETCHLINAD, low, high); 169 IBS_FETCH_CODE, IBS_FETCH_SIZE);
213 ibs_fetch.ibs_fetch_lin_addr_high = high; 170 oprofile_add_data(&entry, (u32)msr);
214 ibs_fetch.ibs_fetch_lin_addr_low = low; 171 oprofile_add_data(&entry, (u32)(msr >> 32));
215 rdmsr(MSR_AMD64_IBSFETCHPHYSAD, low, high); 172 oprofile_add_data(&entry, low);
216 ibs_fetch.ibs_fetch_phys_addr_high = high; 173 oprofile_add_data(&entry, high);
217 ibs_fetch.ibs_fetch_phys_addr_low = low; 174 rdmsrl(MSR_AMD64_IBSFETCHPHYSAD, msr);
218 175 oprofile_add_data(&entry, (u32)msr);
219 oprofile_add_ibs_sample(regs, 176 oprofile_add_data(&entry, (u32)(msr >> 32));
220 (unsigned int *)&ibs_fetch, 177 oprofile_write_commit(&entry);
221 IBS_FETCH_BEGIN);
222 178
223 /* reenable the IRQ */ 179 /* reenable the IRQ */
224 rdmsr(MSR_AMD64_IBSFETCHCTL, low, high);
225 high &= ~IBS_FETCH_HIGH_VALID_BIT; 180 high &= ~IBS_FETCH_HIGH_VALID_BIT;
226 high |= IBS_FETCH_HIGH_ENABLE; 181 high |= IBS_FETCH_HIGH_ENABLE;
227 low &= IBS_FETCH_LOW_MAX_CNT_MASK; 182 low &= IBS_FETCH_LOW_MAX_CNT_MASK;
@@ -232,30 +187,29 @@ op_amd_handle_ibs(struct pt_regs * const regs,
232 if (ibs_config.op_enabled) { 187 if (ibs_config.op_enabled) {
233 rdmsr(MSR_AMD64_IBSOPCTL, low, high); 188 rdmsr(MSR_AMD64_IBSOPCTL, low, high);
234 if (low & IBS_OP_LOW_VALID_BIT) { 189 if (low & IBS_OP_LOW_VALID_BIT) {
235 rdmsr(MSR_AMD64_IBSOPRIP, low, high); 190 rdmsrl(MSR_AMD64_IBSOPRIP, msr);
236 ibs_op.ibs_op_rip_low = low; 191 oprofile_write_reserve(&entry, regs, msr,
237 ibs_op.ibs_op_rip_high = high; 192 IBS_OP_CODE, IBS_OP_SIZE);
238 rdmsr(MSR_AMD64_IBSOPDATA, low, high); 193 oprofile_add_data(&entry, (u32)msr);
239 ibs_op.ibs_op_data1_low = low; 194 oprofile_add_data(&entry, (u32)(msr >> 32));
240 ibs_op.ibs_op_data1_high = high; 195 rdmsrl(MSR_AMD64_IBSOPDATA, msr);
241 rdmsr(MSR_AMD64_IBSOPDATA2, low, high); 196 oprofile_add_data(&entry, (u32)msr);
242 ibs_op.ibs_op_data2_low = low; 197 oprofile_add_data(&entry, (u32)(msr >> 32));
243 ibs_op.ibs_op_data2_high = high; 198 rdmsrl(MSR_AMD64_IBSOPDATA2, msr);
244 rdmsr(MSR_AMD64_IBSOPDATA3, low, high); 199 oprofile_add_data(&entry, (u32)msr);
245 ibs_op.ibs_op_data3_low = low; 200 oprofile_add_data(&entry, (u32)(msr >> 32));
246 ibs_op.ibs_op_data3_high = high; 201 rdmsrl(MSR_AMD64_IBSOPDATA3, msr);
247 rdmsr(MSR_AMD64_IBSDCLINAD, low, high); 202 oprofile_add_data(&entry, (u32)msr);
248 ibs_op.ibs_dc_linear_low = low; 203 oprofile_add_data(&entry, (u32)(msr >> 32));
249 ibs_op.ibs_dc_linear_high = high; 204 rdmsrl(MSR_AMD64_IBSDCLINAD, msr);
250 rdmsr(MSR_AMD64_IBSDCPHYSAD, low, high); 205 oprofile_add_data(&entry, (u32)msr);
251 ibs_op.ibs_dc_phys_low = low; 206 oprofile_add_data(&entry, (u32)(msr >> 32));
252 ibs_op.ibs_dc_phys_high = high; 207 rdmsrl(MSR_AMD64_IBSDCPHYSAD, msr);
208 oprofile_add_data(&entry, (u32)msr);
209 oprofile_add_data(&entry, (u32)(msr >> 32));
210 oprofile_write_commit(&entry);
253 211
254 /* reenable the IRQ */ 212 /* reenable the IRQ */
255 oprofile_add_ibs_sample(regs,
256 (unsigned int *)&ibs_op,
257 IBS_OP_BEGIN);
258 rdmsr(MSR_AMD64_IBSOPCTL, low, high);
259 high = 0; 213 high = 0;
260 low &= ~IBS_OP_LOW_VALID_BIT; 214 low &= ~IBS_OP_LOW_VALID_BIT;
261 low |= IBS_OP_LOW_ENABLE; 215 low |= IBS_OP_LOW_ENABLE;
@@ -305,14 +259,14 @@ static void op_amd_start(struct op_msrs const * const msrs)
305 } 259 }
306 260
307#ifdef CONFIG_OPROFILE_IBS 261#ifdef CONFIG_OPROFILE_IBS
308 if (ibs_allowed && ibs_config.fetch_enabled) { 262 if (has_ibs && ibs_config.fetch_enabled) {
309 low = (ibs_config.max_cnt_fetch >> 4) & 0xFFFF; 263 low = (ibs_config.max_cnt_fetch >> 4) & 0xFFFF;
310 high = ((ibs_config.rand_en & 0x1) << 25) /* bit 57 */ 264 high = ((ibs_config.rand_en & 0x1) << 25) /* bit 57 */
311 + IBS_FETCH_HIGH_ENABLE; 265 + IBS_FETCH_HIGH_ENABLE;
312 wrmsr(MSR_AMD64_IBSFETCHCTL, low, high); 266 wrmsr(MSR_AMD64_IBSFETCHCTL, low, high);
313 } 267 }
314 268
315 if (ibs_allowed && ibs_config.op_enabled) { 269 if (has_ibs && ibs_config.op_enabled) {
316 low = ((ibs_config.max_cnt_op >> 4) & 0xFFFF) 270 low = ((ibs_config.max_cnt_op >> 4) & 0xFFFF)
317 + ((ibs_config.dispatched_ops & 0x1) << 19) /* bit 19 */ 271 + ((ibs_config.dispatched_ops & 0x1) << 19) /* bit 19 */
318 + IBS_OP_LOW_ENABLE; 272 + IBS_OP_LOW_ENABLE;
@@ -341,14 +295,14 @@ static void op_amd_stop(struct op_msrs const * const msrs)
341 } 295 }
342 296
343#ifdef CONFIG_OPROFILE_IBS 297#ifdef CONFIG_OPROFILE_IBS
344 if (ibs_allowed && ibs_config.fetch_enabled) { 298 if (has_ibs && ibs_config.fetch_enabled) {
345 /* clear max count and enable */ 299 /* clear max count and enable */
346 low = 0; 300 low = 0;
347 high = 0; 301 high = 0;
348 wrmsr(MSR_AMD64_IBSFETCHCTL, low, high); 302 wrmsr(MSR_AMD64_IBSFETCHCTL, low, high);
349 } 303 }
350 304
351 if (ibs_allowed && ibs_config.op_enabled) { 305 if (has_ibs && ibs_config.op_enabled) {
352 /* clear max count and enable */ 306 /* clear max count and enable */
353 low = 0; 307 low = 0;
354 high = 0; 308 high = 0;
@@ -409,6 +363,7 @@ static int init_ibs_nmi(void)
409 | IBSCTL_LVTOFFSETVAL); 363 | IBSCTL_LVTOFFSETVAL);
410 pci_read_config_dword(cpu_cfg, IBSCTL, &value); 364 pci_read_config_dword(cpu_cfg, IBSCTL, &value);
411 if (value != (ibs_eilvt_off | IBSCTL_LVTOFFSETVAL)) { 365 if (value != (ibs_eilvt_off | IBSCTL_LVTOFFSETVAL)) {
366 pci_dev_put(cpu_cfg);
412 printk(KERN_DEBUG "Failed to setup IBS LVT offset, " 367 printk(KERN_DEBUG "Failed to setup IBS LVT offset, "
413 "IBSCTL = 0x%08x", value); 368 "IBSCTL = 0x%08x", value);
414 return 1; 369 return 1;
@@ -436,20 +391,20 @@ static int init_ibs_nmi(void)
436/* uninitialize the APIC for the IBS interrupts if needed */ 391/* uninitialize the APIC for the IBS interrupts if needed */
437static void clear_ibs_nmi(void) 392static void clear_ibs_nmi(void)
438{ 393{
439 if (ibs_allowed) 394 if (has_ibs)
440 on_each_cpu(apic_clear_ibs_nmi_per_cpu, NULL, 1); 395 on_each_cpu(apic_clear_ibs_nmi_per_cpu, NULL, 1);
441} 396}
442 397
443/* initialize the APIC for the IBS interrupts if available */ 398/* initialize the APIC for the IBS interrupts if available */
444static void ibs_init(void) 399static void ibs_init(void)
445{ 400{
446 ibs_allowed = boot_cpu_has(X86_FEATURE_IBS); 401 has_ibs = boot_cpu_has(X86_FEATURE_IBS);
447 402
448 if (!ibs_allowed) 403 if (!has_ibs)
449 return; 404 return;
450 405
451 if (init_ibs_nmi()) { 406 if (init_ibs_nmi()) {
452 ibs_allowed = 0; 407 has_ibs = 0;
453 return; 408 return;
454 } 409 }
455 410
@@ -458,7 +413,7 @@ static void ibs_init(void)
458 413
459static void ibs_exit(void) 414static void ibs_exit(void)
460{ 415{
461 if (!ibs_allowed) 416 if (!has_ibs)
462 return; 417 return;
463 418
464 clear_ibs_nmi(); 419 clear_ibs_nmi();
@@ -478,7 +433,7 @@ static int setup_ibs_files(struct super_block *sb, struct dentry *root)
478 if (ret) 433 if (ret)
479 return ret; 434 return ret;
480 435
481 if (!ibs_allowed) 436 if (!has_ibs)
482 return ret; 437 return ret;
483 438
484 /* model specific files */ 439 /* model specific files */
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
index 1d88d2b39771..c0ecf250fe51 100644
--- a/arch/x86/pci/acpi.c
+++ b/arch/x86/pci/acpi.c
@@ -4,7 +4,7 @@
4#include <linux/irq.h> 4#include <linux/irq.h>
5#include <linux/dmi.h> 5#include <linux/dmi.h>
6#include <asm/numa.h> 6#include <asm/numa.h>
7#include "pci.h" 7#include <asm/pci_x86.h>
8 8
9struct pci_root_info { 9struct pci_root_info {
10 char *name; 10 char *name;
@@ -210,11 +210,10 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do
210 if (bus && node != -1) { 210 if (bus && node != -1) {
211#ifdef CONFIG_ACPI_NUMA 211#ifdef CONFIG_ACPI_NUMA
212 if (pxm >= 0) 212 if (pxm >= 0)
213 printk(KERN_DEBUG "bus %02x -> pxm %d -> node %d\n", 213 dev_printk(KERN_DEBUG, &bus->dev,
214 busnum, pxm, node); 214 "on NUMA node %d (pxm %d)\n", node, pxm);
215#else 215#else
216 printk(KERN_DEBUG "bus %02x -> node %d\n", 216 dev_printk(KERN_DEBUG, &bus->dev, "on NUMA node %d\n", node);
217 busnum, node);
218#endif 217#endif
219 } 218 }
220 219
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index 22e057665e55..9bb09823b362 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -2,7 +2,7 @@
2#include <linux/pci.h> 2#include <linux/pci.h>
3#include <linux/topology.h> 3#include <linux/topology.h>
4#include <linux/cpu.h> 4#include <linux/cpu.h>
5#include "pci.h" 5#include <asm/pci_x86.h>
6 6
7#ifdef CONFIG_X86_64 7#ifdef CONFIG_X86_64
8#include <asm/pci-direct.h> 8#include <asm/pci-direct.h>
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index bb1a01f089e2..82d22fc601ae 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -14,8 +14,7 @@
14#include <asm/segment.h> 14#include <asm/segment.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/smp.h> 16#include <asm/smp.h>
17 17#include <asm/pci_x86.h>
18#include "pci.h"
19 18
20unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | 19unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 |
21 PCI_PROBE_MMCONF; 20 PCI_PROBE_MMCONF;
@@ -552,17 +551,25 @@ int pcibios_enable_device(struct pci_dev *dev, int mask)
552 if ((err = pci_enable_resources(dev, mask)) < 0) 551 if ((err = pci_enable_resources(dev, mask)) < 0)
553 return err; 552 return err;
554 553
555 if (!dev->msi_enabled) 554 if (!pci_dev_msi_enabled(dev))
556 return pcibios_enable_irq(dev); 555 return pcibios_enable_irq(dev);
557 return 0; 556 return 0;
558} 557}
559 558
560void pcibios_disable_device (struct pci_dev *dev) 559void pcibios_disable_device (struct pci_dev *dev)
561{ 560{
562 if (!dev->msi_enabled && pcibios_disable_irq) 561 if (!pci_dev_msi_enabled(dev) && pcibios_disable_irq)
563 pcibios_disable_irq(dev); 562 pcibios_disable_irq(dev);
564} 563}
565 564
565int pci_ext_cfg_avail(struct pci_dev *dev)
566{
567 if (raw_pci_ext_ops)
568 return 1;
569 else
570 return 0;
571}
572
566struct pci_bus * __devinit pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node) 573struct pci_bus * __devinit pci_scan_bus_on_node(int busno, struct pci_ops *ops, int node)
567{ 574{
568 struct pci_bus *bus = NULL; 575 struct pci_bus *bus = NULL;
diff --git a/arch/x86/pci/direct.c b/arch/x86/pci/direct.c
index 9a5af6c8fbe9..bd13c3e4c6db 100644
--- a/arch/x86/pci/direct.c
+++ b/arch/x86/pci/direct.c
@@ -5,7 +5,7 @@
5#include <linux/pci.h> 5#include <linux/pci.h>
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/dmi.h> 7#include <linux/dmi.h>
8#include "pci.h" 8#include <asm/pci_x86.h>
9 9
10/* 10/*
11 * Functions for accessing PCI base (first 256 bytes) and extended 11 * Functions for accessing PCI base (first 256 bytes) and extended
diff --git a/arch/x86/pci/early.c b/arch/x86/pci/early.c
index 86631ccbc25a..f6adf2c6d751 100644
--- a/arch/x86/pci/early.c
+++ b/arch/x86/pci/early.c
@@ -2,7 +2,7 @@
2#include <linux/pci.h> 2#include <linux/pci.h>
3#include <asm/pci-direct.h> 3#include <asm/pci-direct.h>
4#include <asm/io.h> 4#include <asm/io.h>
5#include "pci.h" 5#include <asm/pci_x86.h>
6 6
7/* Direct PCI access. This is used for PCI accesses in early boot before 7/* Direct PCI access. This is used for PCI accesses in early boot before
8 the PCI subsystem works. */ 8 the PCI subsystem works. */
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c
index 2051dc96b8e9..7d388d5cf548 100644
--- a/arch/x86/pci/fixup.c
+++ b/arch/x86/pci/fixup.c
@@ -6,8 +6,7 @@
6#include <linux/dmi.h> 6#include <linux/dmi.h>
7#include <linux/pci.h> 7#include <linux/pci.h>
8#include <linux/init.h> 8#include <linux/init.h>
9#include "pci.h" 9#include <asm/pci_x86.h>
10
11 10
12static void __devinit pci_fixup_i450nx(struct pci_dev *d) 11static void __devinit pci_fixup_i450nx(struct pci_dev *d)
13{ 12{
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index 844df0cbbd3e..f884740da318 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -34,8 +34,8 @@
34 34
35#include <asm/pat.h> 35#include <asm/pat.h>
36#include <asm/e820.h> 36#include <asm/e820.h>
37#include <asm/pci_x86.h>
37 38
38#include "pci.h"
39 39
40static int 40static int
41skip_isa_ioresource_align(struct pci_dev *dev) { 41skip_isa_ioresource_align(struct pci_dev *dev) {
@@ -129,7 +129,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list)
129 pr = pci_find_parent_resource(dev, r); 129 pr = pci_find_parent_resource(dev, r);
130 if (!r->start || !pr || 130 if (!r->start || !pr ||
131 request_resource(pr, r) < 0) { 131 request_resource(pr, r) < 0) {
132 dev_err(&dev->dev, "BAR %d: can't allocate resource\n", idx); 132 dev_info(&dev->dev, "BAR %d: can't allocate resource\n", idx);
133 /* 133 /*
134 * Something is wrong with the region. 134 * Something is wrong with the region.
135 * Invalidate the resource to prevent 135 * Invalidate the resource to prevent
@@ -170,7 +170,7 @@ static void __init pcibios_allocate_resources(int pass)
170 r->flags, disabled, pass); 170 r->flags, disabled, pass);
171 pr = pci_find_parent_resource(dev, r); 171 pr = pci_find_parent_resource(dev, r);
172 if (!pr || request_resource(pr, r) < 0) { 172 if (!pr || request_resource(pr, r) < 0) {
173 dev_err(&dev->dev, "BAR %d: can't allocate resource\n", idx); 173 dev_info(&dev->dev, "BAR %d: can't allocate resource\n", idx);
174 /* We'll assign a new address later */ 174 /* We'll assign a new address later */
175 r->end -= r->start; 175 r->end -= r->start;
176 r->start = 0; 176 r->start = 0;
diff --git a/arch/x86/pci/init.c b/arch/x86/pci/init.c
index d6c950f81858..25a1f8efed4a 100644
--- a/arch/x86/pci/init.c
+++ b/arch/x86/pci/init.c
@@ -1,6 +1,6 @@
1#include <linux/pci.h> 1#include <linux/pci.h>
2#include <linux/init.h> 2#include <linux/init.h>
3#include "pci.h" 3#include <asm/pci_x86.h>
4 4
5/* arch_initcall has too random ordering, so call the initializers 5/* arch_initcall has too random ordering, so call the initializers
6 in the right sequence from here. */ 6 in the right sequence from here. */
@@ -12,7 +12,8 @@ static __init int pci_arch_init(void)
12 type = pci_direct_probe(); 12 type = pci_direct_probe();
13#endif 13#endif
14 14
15 pci_mmcfg_early_init(); 15 if (!(pci_probe & PCI_PROBE_NOEARLY))
16 pci_mmcfg_early_init();
16 17
17#ifdef CONFIG_PCI_OLPC 18#ifdef CONFIG_PCI_OLPC
18 if (!pci_olpc_init()) 19 if (!pci_olpc_init())
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index bf69dbe08bff..4064345cf144 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -16,8 +16,7 @@
16#include <asm/io_apic.h> 16#include <asm/io_apic.h>
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/acpi.h> 18#include <linux/acpi.h>
19 19#include <asm/pci_x86.h>
20#include "pci.h"
21 20
22#define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24)) 21#define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24))
23#define PIRQ_VERSION 0x0100 22#define PIRQ_VERSION 0x0100
@@ -534,7 +533,7 @@ static int pirq_bios_set(struct pci_dev *router, struct pci_dev *dev, int pirq,
534{ 533{
535 struct pci_dev *bridge; 534 struct pci_dev *bridge;
536 int pin = pci_get_interrupt_pin(dev, &bridge); 535 int pin = pci_get_interrupt_pin(dev, &bridge);
537 return pcibios_set_irq_routing(bridge, pin, irq); 536 return pcibios_set_irq_routing(bridge, pin - 1, irq);
538} 537}
539 538
540#endif 539#endif
@@ -888,7 +887,6 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
888 dev_dbg(&dev->dev, "no interrupt pin\n"); 887 dev_dbg(&dev->dev, "no interrupt pin\n");
889 return 0; 888 return 0;
890 } 889 }
891 pin = pin - 1;
892 890
893 /* Find IRQ routing entry */ 891 /* Find IRQ routing entry */
894 892
@@ -898,17 +896,17 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
898 info = pirq_get_info(dev); 896 info = pirq_get_info(dev);
899 if (!info) { 897 if (!info) {
900 dev_dbg(&dev->dev, "PCI INT %c not found in routing table\n", 898 dev_dbg(&dev->dev, "PCI INT %c not found in routing table\n",
901 'A' + pin); 899 'A' + pin - 1);
902 return 0; 900 return 0;
903 } 901 }
904 pirq = info->irq[pin].link; 902 pirq = info->irq[pin - 1].link;
905 mask = info->irq[pin].bitmap; 903 mask = info->irq[pin - 1].bitmap;
906 if (!pirq) { 904 if (!pirq) {
907 dev_dbg(&dev->dev, "PCI INT %c not routed\n", 'A' + pin); 905 dev_dbg(&dev->dev, "PCI INT %c not routed\n", 'A' + pin - 1);
908 return 0; 906 return 0;
909 } 907 }
910 dev_dbg(&dev->dev, "PCI INT %c -> PIRQ %02x, mask %04x, excl %04x", 908 dev_dbg(&dev->dev, "PCI INT %c -> PIRQ %02x, mask %04x, excl %04x",
911 'A' + pin, pirq, mask, pirq_table->exclusive_irqs); 909 'A' + pin - 1, pirq, mask, pirq_table->exclusive_irqs);
912 mask &= pcibios_irq_mask; 910 mask &= pcibios_irq_mask;
913 911
914 /* Work around broken HP Pavilion Notebooks which assign USB to 912 /* Work around broken HP Pavilion Notebooks which assign USB to
@@ -950,7 +948,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
950 newirq = i; 948 newirq = i;
951 } 949 }
952 } 950 }
953 dev_dbg(&dev->dev, "PCI INT %c -> newirq %d", 'A' + pin, newirq); 951 dev_dbg(&dev->dev, "PCI INT %c -> newirq %d", 'A' + pin - 1, newirq);
954 952
955 /* Check if it is hardcoded */ 953 /* Check if it is hardcoded */
956 if ((pirq & 0xf0) == 0xf0) { 954 if ((pirq & 0xf0) == 0xf0) {
@@ -978,18 +976,18 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
978 return 0; 976 return 0;
979 } 977 }
980 } 978 }
981 dev_info(&dev->dev, "%s PCI INT %c -> IRQ %d\n", msg, 'A' + pin, irq); 979 dev_info(&dev->dev, "%s PCI INT %c -> IRQ %d\n", msg, 'A' + pin - 1, irq);
982 980
983 /* Update IRQ for all devices with the same pirq value */ 981 /* Update IRQ for all devices with the same pirq value */
984 while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) { 982 while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) {
985 pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin); 983 pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin);
986 if (!pin) 984 if (!pin)
987 continue; 985 continue;
988 pin--; 986
989 info = pirq_get_info(dev2); 987 info = pirq_get_info(dev2);
990 if (!info) 988 if (!info)
991 continue; 989 continue;
992 if (info->irq[pin].link == pirq) { 990 if (info->irq[pin - 1].link == pirq) {
993 /* 991 /*
994 * We refuse to override the dev->irq 992 * We refuse to override the dev->irq
995 * information. Give a warning! 993 * information. Give a warning!
@@ -1043,6 +1041,9 @@ static void __init pcibios_fixup_irqs(void)
1043 dev = NULL; 1041 dev = NULL;
1044 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { 1042 while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
1045 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); 1043 pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
1044 if (!pin)
1045 continue;
1046
1046#ifdef CONFIG_X86_IO_APIC 1047#ifdef CONFIG_X86_IO_APIC
1047 /* 1048 /*
1048 * Recalculate IRQ numbers if we use the I/O APIC. 1049 * Recalculate IRQ numbers if we use the I/O APIC.
@@ -1050,15 +1051,11 @@ static void __init pcibios_fixup_irqs(void)
1050 if (io_apic_assign_pci_irqs) { 1051 if (io_apic_assign_pci_irqs) {
1051 int irq; 1052 int irq;
1052 1053
1053 if (!pin)
1054 continue;
1055
1056 /* 1054 /*
1057 * interrupt pins are numbered starting from 1 1055 * interrupt pins are numbered starting from 1
1058 */ 1056 */
1059 pin--;
1060 irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, 1057 irq = IO_APIC_get_PCI_irq_vector(dev->bus->number,
1061 PCI_SLOT(dev->devfn), pin); 1058 PCI_SLOT(dev->devfn), pin - 1);
1062 /* 1059 /*
1063 * Busses behind bridges are typically not listed in the 1060 * Busses behind bridges are typically not listed in the
1064 * MP-table. In this case we have to look up the IRQ 1061 * MP-table. In this case we have to look up the IRQ
@@ -1071,22 +1068,22 @@ static void __init pcibios_fixup_irqs(void)
1071 struct pci_dev *bridge = dev->bus->self; 1068 struct pci_dev *bridge = dev->bus->self;
1072 int bus; 1069 int bus;
1073 1070
1074 pin = (pin + PCI_SLOT(dev->devfn)) % 4; 1071 pin = pci_swizzle_interrupt_pin(dev, pin);
1075 bus = bridge->bus->number; 1072 bus = bridge->bus->number;
1076 irq = IO_APIC_get_PCI_irq_vector(bus, 1073 irq = IO_APIC_get_PCI_irq_vector(bus,
1077 PCI_SLOT(bridge->devfn), pin); 1074 PCI_SLOT(bridge->devfn), pin - 1);
1078 if (irq >= 0) 1075 if (irq >= 0)
1079 dev_warn(&dev->dev, 1076 dev_warn(&dev->dev,
1080 "using bridge %s INT %c to " 1077 "using bridge %s INT %c to "
1081 "get IRQ %d\n", 1078 "get IRQ %d\n",
1082 pci_name(bridge), 1079 pci_name(bridge),
1083 'A' + pin, irq); 1080 'A' + pin - 1, irq);
1084 } 1081 }
1085 if (irq >= 0) { 1082 if (irq >= 0) {
1086 dev_info(&dev->dev, 1083 dev_info(&dev->dev,
1087 "PCI->APIC IRQ transform: INT %c " 1084 "PCI->APIC IRQ transform: INT %c "
1088 "-> IRQ %d\n", 1085 "-> IRQ %d\n",
1089 'A' + pin, irq); 1086 'A' + pin - 1, irq);
1090 dev->irq = irq; 1087 dev->irq = irq;
1091 } 1088 }
1092 } 1089 }
@@ -1094,7 +1091,7 @@ static void __init pcibios_fixup_irqs(void)
1094 /* 1091 /*
1095 * Still no IRQ? Try to lookup one... 1092 * Still no IRQ? Try to lookup one...
1096 */ 1093 */
1097 if (pin && !dev->irq) 1094 if (!dev->irq)
1098 pcibios_lookup_irq(dev, 0); 1095 pcibios_lookup_irq(dev, 0);
1099 } 1096 }
1100} 1097}
@@ -1221,12 +1218,10 @@ static int pirq_enable_irq(struct pci_dev *dev)
1221 if (pin && !pcibios_lookup_irq(dev, 1) && !dev->irq) { 1218 if (pin && !pcibios_lookup_irq(dev, 1) && !dev->irq) {
1222 char *msg = ""; 1219 char *msg = "";
1223 1220
1224 pin--; /* interrupt pins are numbered starting from 1 */
1225
1226 if (io_apic_assign_pci_irqs) { 1221 if (io_apic_assign_pci_irqs) {
1227 int irq; 1222 int irq;
1228 1223
1229 irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin); 1224 irq = IO_APIC_get_PCI_irq_vector(dev->bus->number, PCI_SLOT(dev->devfn), pin - 1);
1230 /* 1225 /*
1231 * Busses behind bridges are typically not listed in the MP-table. 1226 * Busses behind bridges are typically not listed in the MP-table.
1232 * In this case we have to look up the IRQ based on the parent bus, 1227 * In this case we have to look up the IRQ based on the parent bus,
@@ -1237,20 +1232,20 @@ static int pirq_enable_irq(struct pci_dev *dev)
1237 while (irq < 0 && dev->bus->parent) { /* go back to the bridge */ 1232 while (irq < 0 && dev->bus->parent) { /* go back to the bridge */
1238 struct pci_dev *bridge = dev->bus->self; 1233 struct pci_dev *bridge = dev->bus->self;
1239 1234
1240 pin = (pin + PCI_SLOT(dev->devfn)) % 4; 1235 pin = pci_swizzle_interrupt_pin(dev, pin);
1241 irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, 1236 irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number,
1242 PCI_SLOT(bridge->devfn), pin); 1237 PCI_SLOT(bridge->devfn), pin - 1);
1243 if (irq >= 0) 1238 if (irq >= 0)
1244 dev_warn(&dev->dev, "using bridge %s " 1239 dev_warn(&dev->dev, "using bridge %s "
1245 "INT %c to get IRQ %d\n", 1240 "INT %c to get IRQ %d\n",
1246 pci_name(bridge), 'A' + pin, 1241 pci_name(bridge), 'A' + pin - 1,
1247 irq); 1242 irq);
1248 dev = bridge; 1243 dev = bridge;
1249 } 1244 }
1250 dev = temp_dev; 1245 dev = temp_dev;
1251 if (irq >= 0) { 1246 if (irq >= 0) {
1252 dev_info(&dev->dev, "PCI->APIC IRQ transform: " 1247 dev_info(&dev->dev, "PCI->APIC IRQ transform: "
1253 "INT %c -> IRQ %d\n", 'A' + pin, irq); 1248 "INT %c -> IRQ %d\n", 'A' + pin - 1, irq);
1254 dev->irq = irq; 1249 dev->irq = irq;
1255 return 0; 1250 return 0;
1256 } else 1251 } else
@@ -1269,7 +1264,7 @@ static int pirq_enable_irq(struct pci_dev *dev)
1269 return 0; 1264 return 0;
1270 1265
1271 dev_warn(&dev->dev, "can't find IRQ for PCI INT %c%s\n", 1266 dev_warn(&dev->dev, "can't find IRQ for PCI INT %c%s\n",
1272 'A' + pin, msg); 1267 'A' + pin - 1, msg);
1273 } 1268 }
1274 return 0; 1269 return 0;
1275} 1270}
diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c
index b722dd481b39..f1065b129e9c 100644
--- a/arch/x86/pci/legacy.c
+++ b/arch/x86/pci/legacy.c
@@ -3,7 +3,7 @@
3 */ 3 */
4#include <linux/init.h> 4#include <linux/init.h>
5#include <linux/pci.h> 5#include <linux/pci.h>
6#include "pci.h" 6#include <asm/pci_x86.h>
7 7
8/* 8/*
9 * Discover remaining PCI buses in case there are peer host bridges. 9 * Discover remaining PCI buses in case there are peer host bridges.
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index 654a2234f8f3..89bf9242c80a 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -15,8 +15,7 @@
15#include <linux/acpi.h> 15#include <linux/acpi.h>
16#include <linux/bitmap.h> 16#include <linux/bitmap.h>
17#include <asm/e820.h> 17#include <asm/e820.h>
18 18#include <asm/pci_x86.h>
19#include "pci.h"
20 19
21/* aperture is up to 256MB but BIOS may reserve less */ 20/* aperture is up to 256MB but BIOS may reserve less */
22#define MMCONFIG_APER_MIN (2 * 1024*1024) 21#define MMCONFIG_APER_MIN (2 * 1024*1024)
diff --git a/arch/x86/pci/mmconfig_32.c b/arch/x86/pci/mmconfig_32.c
index f3c761dce695..8b2d561046a3 100644
--- a/arch/x86/pci/mmconfig_32.c
+++ b/arch/x86/pci/mmconfig_32.c
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/acpi.h> 14#include <linux/acpi.h>
15#include <asm/e820.h> 15#include <asm/e820.h>
16#include "pci.h" 16#include <asm/pci_x86.h>
17 17
18/* Assume systems with more busses have correct MCFG */ 18/* Assume systems with more busses have correct MCFG */
19#define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG)) 19#define mmcfg_virt_addr ((void __iomem *) fix_to_virt(FIX_PCIE_MCFG))
diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c
index a1994163c99d..30007ffc8e11 100644
--- a/arch/x86/pci/mmconfig_64.c
+++ b/arch/x86/pci/mmconfig_64.c
@@ -10,8 +10,7 @@
10#include <linux/acpi.h> 10#include <linux/acpi.h>
11#include <linux/bitmap.h> 11#include <linux/bitmap.h>
12#include <asm/e820.h> 12#include <asm/e820.h>
13 13#include <asm/pci_x86.h>
14#include "pci.h"
15 14
16/* Static virtual mapping of the MMCONFIG aperture */ 15/* Static virtual mapping of the MMCONFIG aperture */
17struct mmcfg_virt { 16struct mmcfg_virt {
diff --git a/arch/x86/pci/numaq_32.c b/arch/x86/pci/numaq_32.c
index 1177845d3186..2089354968a2 100644
--- a/arch/x86/pci/numaq_32.c
+++ b/arch/x86/pci/numaq_32.c
@@ -7,7 +7,7 @@
7#include <linux/nodemask.h> 7#include <linux/nodemask.h>
8#include <mach_apic.h> 8#include <mach_apic.h>
9#include <asm/mpspec.h> 9#include <asm/mpspec.h>
10#include "pci.h" 10#include <asm/pci_x86.h>
11 11
12#define XQUAD_PORTIO_BASE 0xfe400000 12#define XQUAD_PORTIO_BASE 0xfe400000
13#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */ 13#define XQUAD_PORTIO_QUAD 0x40000 /* 256k per quad. */
diff --git a/arch/x86/pci/olpc.c b/arch/x86/pci/olpc.c
index e11e9e803d5f..b889d824f7c6 100644
--- a/arch/x86/pci/olpc.c
+++ b/arch/x86/pci/olpc.c
@@ -29,7 +29,7 @@
29#include <linux/init.h> 29#include <linux/init.h>
30#include <asm/olpc.h> 30#include <asm/olpc.h>
31#include <asm/geode.h> 31#include <asm/geode.h>
32#include "pci.h" 32#include <asm/pci_x86.h>
33 33
34/* 34/*
35 * In the tables below, the first two line (8 longwords) are the 35 * In the tables below, the first two line (8 longwords) are the
diff --git a/arch/x86/pci/pcbios.c b/arch/x86/pci/pcbios.c
index 37472fc6f729..b82cae970dfd 100644
--- a/arch/x86/pci/pcbios.c
+++ b/arch/x86/pci/pcbios.c
@@ -6,9 +6,8 @@
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/module.h> 7#include <linux/module.h>
8#include <linux/uaccess.h> 8#include <linux/uaccess.h>
9#include "pci.h" 9#include <asm/pci_x86.h>
10#include "pci-functions.h" 10#include <asm/mach-default/pci-functions.h>
11
12 11
13/* BIOS32 signature: "_32_" */ 12/* BIOS32 signature: "_32_" */
14#define BIOS32_SIGNATURE (('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24)) 13#define BIOS32_SIGNATURE (('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))
diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c
index 42f4cb19faca..bcead7a46871 100644
--- a/arch/x86/pci/visws.c
+++ b/arch/x86/pci/visws.c
@@ -9,11 +9,10 @@
9#include <linux/init.h> 9#include <linux/init.h>
10 10
11#include <asm/setup.h> 11#include <asm/setup.h>
12#include <asm/pci_x86.h>
12#include <asm/visws/cobalt.h> 13#include <asm/visws/cobalt.h>
13#include <asm/visws/lithium.h> 14#include <asm/visws/lithium.h>
14 15
15#include "pci.h"
16
17static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; } 16static int pci_visws_enable_irq(struct pci_dev *dev) { return 0; }
18static void pci_visws_disable_irq(struct pci_dev *dev) { } 17static void pci_visws_disable_irq(struct pci_dev *dev) { }
19 18
@@ -25,24 +24,6 @@ static void pci_visws_disable_irq(struct pci_dev *dev) { }
25 24
26unsigned int pci_bus0, pci_bus1; 25unsigned int pci_bus0, pci_bus1;
27 26
28static inline u8 bridge_swizzle(u8 pin, u8 slot)
29{
30 return (((pin - 1) + slot) % 4) + 1;
31}
32
33static u8 __init visws_swizzle(struct pci_dev *dev, u8 *pinp)
34{
35 u8 pin = *pinp;
36
37 while (dev->bus->self) { /* Move up the chain of bridges. */
38 pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn));
39 dev = dev->bus->self;
40 }
41 *pinp = pin;
42
43 return PCI_SLOT(dev->devfn);
44}
45
46static int __init visws_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 27static int __init visws_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
47{ 28{
48 int irq, bus = dev->bus->number; 29 int irq, bus = dev->bus->number;
@@ -107,7 +88,7 @@ int __init pci_visws_init(void)
107 raw_pci_ops = &pci_direct_conf1; 88 raw_pci_ops = &pci_direct_conf1;
108 pci_scan_bus_with_sysdata(pci_bus0); 89 pci_scan_bus_with_sysdata(pci_bus0);
109 pci_scan_bus_with_sysdata(pci_bus1); 90 pci_scan_bus_with_sysdata(pci_bus1);
110 pci_fixup_irqs(visws_swizzle, visws_map_irq); 91 pci_fixup_irqs(pci_common_swizzle, visws_map_irq);
111 pcibios_resource_survey(); 92 pcibios_resource_survey();
112 return 0; 93 return 0;
113} 94}
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index 773d68d3e912..503c240e26c7 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -1082,7 +1082,7 @@ static void drop_other_mm_ref(void *info)
1082 1082
1083static void xen_drop_mm_ref(struct mm_struct *mm) 1083static void xen_drop_mm_ref(struct mm_struct *mm)
1084{ 1084{
1085 cpumask_t mask; 1085 cpumask_var_t mask;
1086 unsigned cpu; 1086 unsigned cpu;
1087 1087
1088 if (current->active_mm == mm) { 1088 if (current->active_mm == mm) {
@@ -1094,7 +1094,16 @@ static void xen_drop_mm_ref(struct mm_struct *mm)
1094 } 1094 }
1095 1095
1096 /* Get the "official" set of cpus referring to our pagetable. */ 1096 /* Get the "official" set of cpus referring to our pagetable. */
1097 mask = mm->cpu_vm_mask; 1097 if (!alloc_cpumask_var(&mask, GFP_ATOMIC)) {
1098 for_each_online_cpu(cpu) {
1099 if (!cpumask_test_cpu(cpu, &mm->cpu_vm_mask)
1100 && per_cpu(xen_current_cr3, cpu) != __pa(mm->pgd))
1101 continue;
1102 smp_call_function_single(cpu, drop_other_mm_ref, mm, 1);
1103 }
1104 return;
1105 }
1106 cpumask_copy(mask, &mm->cpu_vm_mask);
1098 1107
1099 /* It's possible that a vcpu may have a stale reference to our 1108 /* It's possible that a vcpu may have a stale reference to our
1100 cr3, because its in lazy mode, and it hasn't yet flushed 1109 cr3, because its in lazy mode, and it hasn't yet flushed
@@ -1103,11 +1112,12 @@ static void xen_drop_mm_ref(struct mm_struct *mm)
1103 if needed. */ 1112 if needed. */
1104 for_each_online_cpu(cpu) { 1113 for_each_online_cpu(cpu) {
1105 if (per_cpu(xen_current_cr3, cpu) == __pa(mm->pgd)) 1114 if (per_cpu(xen_current_cr3, cpu) == __pa(mm->pgd))
1106 cpu_set(cpu, mask); 1115 cpumask_set_cpu(cpu, mask);
1107 } 1116 }
1108 1117
1109 if (!cpus_empty(mask)) 1118 if (!cpumask_empty(mask))
1110 smp_call_function_mask(mask, drop_other_mm_ref, mm, 1); 1119 smp_call_function_many(mask, drop_other_mm_ref, mm, 1);
1120 free_cpumask_var(mask);
1111} 1121}
1112#else 1122#else
1113static void xen_drop_mm_ref(struct mm_struct *mm) 1123static void xen_drop_mm_ref(struct mm_struct *mm)
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index acd9b6705e02..c44e2069c7c7 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -33,7 +33,7 @@
33#include "xen-ops.h" 33#include "xen-ops.h"
34#include "mmu.h" 34#include "mmu.h"
35 35
36cpumask_t xen_cpu_initialized_map; 36cpumask_var_t xen_cpu_initialized_map;
37 37
38static DEFINE_PER_CPU(int, resched_irq); 38static DEFINE_PER_CPU(int, resched_irq);
39static DEFINE_PER_CPU(int, callfunc_irq); 39static DEFINE_PER_CPU(int, callfunc_irq);
@@ -158,7 +158,7 @@ static void __init xen_fill_possible_map(void)
158{ 158{
159 int i, rc; 159 int i, rc;
160 160
161 for (i = 0; i < NR_CPUS; i++) { 161 for (i = 0; i < nr_cpu_ids; i++) {
162 rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL); 162 rc = HYPERVISOR_vcpu_op(VCPUOP_is_up, i, NULL);
163 if (rc >= 0) { 163 if (rc >= 0) {
164 num_processors++; 164 num_processors++;
@@ -192,11 +192,14 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus)
192 if (xen_smp_intr_init(0)) 192 if (xen_smp_intr_init(0))
193 BUG(); 193 BUG();
194 194
195 xen_cpu_initialized_map = cpumask_of_cpu(0); 195 if (!alloc_cpumask_var(&xen_cpu_initialized_map, GFP_KERNEL))
196 panic("could not allocate xen_cpu_initialized_map\n");
197
198 cpumask_copy(xen_cpu_initialized_map, cpumask_of(0));
196 199
197 /* Restrict the possible_map according to max_cpus. */ 200 /* Restrict the possible_map according to max_cpus. */
198 while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) { 201 while ((num_possible_cpus() > 1) && (num_possible_cpus() > max_cpus)) {
199 for (cpu = NR_CPUS - 1; !cpu_possible(cpu); cpu--) 202 for (cpu = nr_cpu_ids - 1; !cpu_possible(cpu); cpu--)
200 continue; 203 continue;
201 cpu_clear(cpu, cpu_possible_map); 204 cpu_clear(cpu, cpu_possible_map);
202 } 205 }
@@ -221,7 +224,7 @@ cpu_initialize_context(unsigned int cpu, struct task_struct *idle)
221 struct vcpu_guest_context *ctxt; 224 struct vcpu_guest_context *ctxt;
222 struct desc_struct *gdt; 225 struct desc_struct *gdt;
223 226
224 if (cpu_test_and_set(cpu, xen_cpu_initialized_map)) 227 if (cpumask_test_and_set_cpu(cpu, xen_cpu_initialized_map))
225 return 0; 228 return 0;
226 229
227 ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL); 230 ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
@@ -408,24 +411,23 @@ static void xen_smp_send_reschedule(int cpu)
408 xen_send_IPI_one(cpu, XEN_RESCHEDULE_VECTOR); 411 xen_send_IPI_one(cpu, XEN_RESCHEDULE_VECTOR);
409} 412}
410 413
411static void xen_send_IPI_mask(cpumask_t mask, enum ipi_vector vector) 414static void xen_send_IPI_mask(const struct cpumask *mask,
415 enum ipi_vector vector)
412{ 416{
413 unsigned cpu; 417 unsigned cpu;
414 418
415 cpus_and(mask, mask, cpu_online_map); 419 for_each_cpu_and(cpu, mask, cpu_online_mask)
416
417 for_each_cpu_mask_nr(cpu, mask)
418 xen_send_IPI_one(cpu, vector); 420 xen_send_IPI_one(cpu, vector);
419} 421}
420 422
421static void xen_smp_send_call_function_ipi(cpumask_t mask) 423static void xen_smp_send_call_function_ipi(const struct cpumask *mask)
422{ 424{
423 int cpu; 425 int cpu;
424 426
425 xen_send_IPI_mask(mask, XEN_CALL_FUNCTION_VECTOR); 427 xen_send_IPI_mask(mask, XEN_CALL_FUNCTION_VECTOR);
426 428
427 /* Make sure other vcpus get a chance to run if they need to. */ 429 /* Make sure other vcpus get a chance to run if they need to. */
428 for_each_cpu_mask_nr(cpu, mask) { 430 for_each_cpu(cpu, mask) {
429 if (xen_vcpu_stolen(cpu)) { 431 if (xen_vcpu_stolen(cpu)) {
430 HYPERVISOR_sched_op(SCHEDOP_yield, 0); 432 HYPERVISOR_sched_op(SCHEDOP_yield, 0);
431 break; 433 break;
@@ -435,7 +437,8 @@ static void xen_smp_send_call_function_ipi(cpumask_t mask)
435 437
436static void xen_smp_send_call_function_single_ipi(int cpu) 438static void xen_smp_send_call_function_single_ipi(int cpu)
437{ 439{
438 xen_send_IPI_mask(cpumask_of_cpu(cpu), XEN_CALL_FUNCTION_SINGLE_VECTOR); 440 xen_send_IPI_mask(cpumask_of(cpu),
441 XEN_CALL_FUNCTION_SINGLE_VECTOR);
439} 442}
440 443
441static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id) 444static irqreturn_t xen_call_function_interrupt(int irq, void *dev_id)
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index 2a234db5949b..212ffe012b76 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -35,7 +35,8 @@ void xen_post_suspend(int suspend_cancelled)
35 pfn_to_mfn(xen_start_info->console.domU.mfn); 35 pfn_to_mfn(xen_start_info->console.domU.mfn);
36 } else { 36 } else {
37#ifdef CONFIG_SMP 37#ifdef CONFIG_SMP
38 xen_cpu_initialized_map = cpu_online_map; 38 BUG_ON(xen_cpu_initialized_map == NULL);
39 cpumask_copy(xen_cpu_initialized_map, cpu_online_mask);
39#endif 40#endif
40 xen_vcpu_restore(); 41 xen_vcpu_restore();
41 } 42 }
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index c9f7cda48ed7..14f240623497 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -132,8 +132,7 @@ static void do_stolen_accounting(void)
132 *snap = state; 132 *snap = state;
133 133
134 /* Add the appropriate number of ticks of stolen time, 134 /* Add the appropriate number of ticks of stolen time,
135 including any left-overs from last time. Passing NULL to 135 including any left-overs from last time. */
136 account_steal_time accounts the time as stolen. */
137 stolen = runnable + offline + __get_cpu_var(residual_stolen); 136 stolen = runnable + offline + __get_cpu_var(residual_stolen);
138 137
139 if (stolen < 0) 138 if (stolen < 0)
@@ -141,11 +140,10 @@ static void do_stolen_accounting(void)
141 140
142 ticks = iter_div_u64_rem(stolen, NS_PER_TICK, &stolen); 141 ticks = iter_div_u64_rem(stolen, NS_PER_TICK, &stolen);
143 __get_cpu_var(residual_stolen) = stolen; 142 __get_cpu_var(residual_stolen) = stolen;
144 account_steal_time(NULL, ticks); 143 account_steal_ticks(ticks);
145 144
146 /* Add the appropriate number of ticks of blocked time, 145 /* Add the appropriate number of ticks of blocked time,
147 including any left-overs from last time. Passing idle to 146 including any left-overs from last time. */
148 account_steal_time accounts the time as idle/wait. */
149 blocked += __get_cpu_var(residual_blocked); 147 blocked += __get_cpu_var(residual_blocked);
150 148
151 if (blocked < 0) 149 if (blocked < 0)
@@ -153,7 +151,7 @@ static void do_stolen_accounting(void)
153 151
154 ticks = iter_div_u64_rem(blocked, NS_PER_TICK, &blocked); 152 ticks = iter_div_u64_rem(blocked, NS_PER_TICK, &blocked);
155 __get_cpu_var(residual_blocked) = blocked; 153 __get_cpu_var(residual_blocked) = blocked;
156 account_steal_time(idle_task(smp_processor_id()), ticks); 154 account_idle_ticks(ticks);
157} 155}
158 156
159/* 157/*
@@ -437,7 +435,7 @@ void xen_setup_timer(int cpu)
437 evt = &per_cpu(xen_clock_events, cpu); 435 evt = &per_cpu(xen_clock_events, cpu);
438 memcpy(evt, xen_clockevent, sizeof(*evt)); 436 memcpy(evt, xen_clockevent, sizeof(*evt));
439 437
440 evt->cpumask = cpumask_of_cpu(cpu); 438 evt->cpumask = cpumask_of(cpu);
441 evt->irq = irq; 439 evt->irq = irq;
442 440
443 setup_runstate_info(cpu); 441 setup_runstate_info(cpu);
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h
index 9e1afae8461f..c1f8faf0a2c5 100644
--- a/arch/x86/xen/xen-ops.h
+++ b/arch/x86/xen/xen-ops.h
@@ -58,7 +58,7 @@ void __init xen_init_spinlocks(void);
58__cpuinit void xen_init_lock_cpu(int cpu); 58__cpuinit void xen_init_lock_cpu(int cpu);
59void xen_uninit_lock_cpu(int cpu); 59void xen_uninit_lock_cpu(int cpu);
60 60
61extern cpumask_t xen_cpu_initialized_map; 61extern cpumask_var_t xen_cpu_initialized_map;
62#else 62#else
63static inline void xen_smp_init(void) {} 63static inline void xen_smp_init(void) {}
64#endif 64#endif
diff --git a/arch/xtensa/Makefile b/arch/xtensa/Makefile
index 015b6b2a26b9..1da55fe4beff 100644
--- a/arch/xtensa/Makefile
+++ b/arch/xtensa/Makefile
@@ -33,6 +33,15 @@ KBUILD_CFLAGS += -ffreestanding
33 33
34KBUILD_CFLAGS += -pipe -mlongcalls 34KBUILD_CFLAGS += -pipe -mlongcalls
35 35
36vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
37plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))
38
39ifeq ($(KBUILD_SRC),)
40KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(vardirs) $(plfdirs))
41else
42KBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(vardirs) $(plfdirs))
43endif
44
36KBUILD_DEFCONFIG := iss_defconfig 45KBUILD_DEFCONFIG := iss_defconfig
37 46
38# ramdisk/initrd support 47# ramdisk/initrd support
@@ -66,21 +75,6 @@ libs-y += arch/xtensa/lib/ $(LIBGCC)
66 75
67boot := arch/xtensa/boot 76boot := arch/xtensa/boot
68 77
69archinc := include/asm-xtensa
70
71archprepare: $(archinc)/.platform
72
73# Update processor variant and platform symlinks if something which affects
74# them changed.
75
76$(archinc)/.platform: $(wildcard include/config/arch/*.h) include/config/auto.conf
77 @echo ' SYMLINK $(archinc)/variant -> $(archinc)/variant-$(VARIANT)'
78 $(Q)mkdir -p $(archinc)
79 $(Q)ln -fsn $(srctree)/$(archinc)/variant-$(VARIANT) $(archinc)/variant
80 @echo ' SYMLINK $(archinc)/platform -> $(archinc)/platform-$(PLATFORM)'
81 $(Q)ln -fsn $(srctree)/$(archinc)/platform-$(PLATFORM) $(archinc)/platform
82 @touch $@
83
84 78
85all: zImage 79all: zImage
86 80
@@ -89,10 +83,6 @@ bzImage : zImage
89zImage zImage.initrd: vmlinux 83zImage zImage.initrd: vmlinux
90 $(Q)$(MAKE) $(build)=$(boot) $@ 84 $(Q)$(MAKE) $(build)=$(boot) $@
91 85
92CLEAN_FILES += arch/xtensa/vmlinux.lds \
93 $(archinc)/platform $(archinc)/variant \
94 $(archinc)/.platform
95
96define archhelp 86define archhelp
97 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)' 87 @echo '* zImage - Compressed kernel image (arch/xtensa/boot/images/zImage.*)'
98endef 88endef
diff --git a/arch/xtensa/boot/boot-elf/boot.lds.S b/arch/xtensa/boot/boot-elf/boot.lds.S
index 849dfcafd518..4e53b74dc44b 100644
--- a/arch/xtensa/boot/boot-elf/boot.lds.S
+++ b/arch/xtensa/boot/boot-elf/boot.lds.S
@@ -1,4 +1,4 @@
1#include <asm/variant/core.h> 1#include <variant/core.h>
2OUTPUT_ARCH(xtensa) 2OUTPUT_ARCH(xtensa)
3ENTRY(_ResetVector) 3ENTRY(_ResetVector)
4 4
diff --git a/arch/xtensa/boot/boot-redboot/bootstrap.S b/arch/xtensa/boot/boot-redboot/bootstrap.S
index 84848123e2a8..5582e8cfac8f 100644
--- a/arch/xtensa/boot/boot-redboot/bootstrap.S
+++ b/arch/xtensa/boot/boot-redboot/bootstrap.S
@@ -1,4 +1,4 @@
1#include <asm/variant/core.h> 1#include <variant/core.h>
2#include <asm/regs.h> 2#include <asm/regs.h>
3#include <asm/asmmacro.h> 3#include <asm/asmmacro.h>
4#include <asm/cacheasm.h> 4#include <asm/cacheasm.h>
diff --git a/arch/xtensa/include/asm/Kbuild b/arch/xtensa/include/asm/Kbuild
new file mode 100644
index 000000000000..58c02a454130
--- /dev/null
+++ b/arch/xtensa/include/asm/Kbuild
@@ -0,0 +1,3 @@
1include include/asm-generic/Kbuild.asm
2
3unifdef-y += swab.h
diff --git a/arch/xtensa/include/asm/asmmacro.h b/arch/xtensa/include/asm/asmmacro.h
new file mode 100644
index 000000000000..755320f6e0bc
--- /dev/null
+++ b/arch/xtensa/include/asm/asmmacro.h
@@ -0,0 +1,153 @@
1/*
2 * include/asm-xtensa/asmmacro.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_ASMMACRO_H
12#define _XTENSA_ASMMACRO_H
13
14#include <variant/core.h>
15
16/*
17 * Some little helpers for loops. Use zero-overhead-loops
18 * where applicable and if supported by the processor.
19 *
20 * __loopi ar, at, size, inc
21 * ar register initialized with the start address
22 * at scratch register used by macro
23 * size size immediate value
24 * inc increment
25 *
26 * __loops ar, as, at, inc_log2[, mask_log2][, cond][, ncond]
27 * ar register initialized with the start address
28 * as register initialized with the size
29 * at scratch register use by macro
30 * inc_log2 increment [in log2]
31 * mask_log2 mask [in log2]
32 * cond true condition (used in loop'cond')
33 * ncond false condition (used in b'ncond')
34 *
35 * __loop as
36 * restart loop. 'as' register must not have been modified!
37 *
38 * __endla ar, at, incr
39 * ar start address (modified)
40 * as scratch register used by macro
41 * inc increment
42 */
43
44/*
45 * loop for given size as immediate
46 */
47
48 .macro __loopi ar, at, size, incr
49
50#if XCHAL_HAVE_LOOPS
51 movi \at, ((\size + \incr - 1) / (\incr))
52 loop \at, 99f
53#else
54 addi \at, \ar, \size
55 98:
56#endif
57
58 .endm
59
60/*
61 * loop for given size in register
62 */
63
64 .macro __loops ar, as, at, incr_log2, mask_log2, cond, ncond
65
66#if XCHAL_HAVE_LOOPS
67 .ifgt \incr_log2 - 1
68 addi \at, \as, (1 << \incr_log2) - 1
69 .ifnc \mask_log2,
70 extui \at, \at, \incr_log2, \mask_log2
71 .else
72 srli \at, \at, \incr_log2
73 .endif
74 .endif
75 loop\cond \at, 99f
76#else
77 .ifnc \mask_log2,
78 extui \at, \as, \incr_log2, \mask_log2
79 .else
80 .ifnc \ncond,
81 srli \at, \as, \incr_log2
82 .endif
83 .endif
84 .ifnc \ncond,
85 b\ncond \at, 99f
86
87 .endif
88 .ifnc \mask_log2,
89 slli \at, \at, \incr_log2
90 add \at, \ar, \at
91 .else
92 add \at, \ar, \as
93 .endif
94#endif
95 98:
96
97 .endm
98
99/*
100 * loop from ar to ax
101 */
102
103 .macro __loopt ar, as, at, incr_log2
104
105#if XCHAL_HAVE_LOOPS
106 sub \at, \as, \ar
107 .ifgt \incr_log2 - 1
108 addi \at, \at, (1 << \incr_log2) - 1
109 srli \at, \at, \incr_log2
110 .endif
111 loop \at, 99f
112#else
113 98:
114#endif
115
116 .endm
117
118/*
119 * restart loop. registers must be unchanged
120 */
121
122 .macro __loop as
123
124#if XCHAL_HAVE_LOOPS
125 loop \as, 99f
126#else
127 98:
128#endif
129
130 .endm
131
132/*
133 * end of loop with no increment of the address.
134 */
135
136 .macro __endl ar, as
137#if !XCHAL_HAVE_LOOPS
138 bltu \ar, \as, 98b
139#endif
140 99:
141 .endm
142
143/*
144 * end of loop with increment of the address.
145 */
146
147 .macro __endla ar, as, incr
148 addi \ar, \ar, \incr
149 __endl \ar \as
150 .endm
151
152
153#endif /* _XTENSA_ASMMACRO_H */
diff --git a/arch/xtensa/include/asm/atomic.h b/arch/xtensa/include/asm/atomic.h
new file mode 100644
index 000000000000..67ad67bed8c1
--- /dev/null
+++ b/arch/xtensa/include/asm/atomic.h
@@ -0,0 +1,299 @@
1/*
2 * include/asm-xtensa/atomic.h
3 *
4 * Atomic operations that C can't guarantee us. Useful for resource counting..
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_ATOMIC_H
14#define _XTENSA_ATOMIC_H
15
16#include <linux/stringify.h>
17#include <linux/types.h>
18
19#ifdef __KERNEL__
20#include <asm/processor.h>
21#include <asm/system.h>
22
23#define ATOMIC_INIT(i) { (i) }
24
25/*
26 * This Xtensa implementation assumes that the right mechanism
27 * for exclusion is for locking interrupts to level 1.
28 *
29 * Locking interrupts looks like this:
30 *
31 * rsil a15, 1
32 * <code>
33 * wsr a15, PS
34 * rsync
35 *
36 * Note that a15 is used here because the register allocation
37 * done by the compiler is not guaranteed and a window overflow
38 * may not occur between the rsil and wsr instructions. By using
39 * a15 in the rsil, the machine is guaranteed to be in a state
40 * where no register reference will cause an overflow.
41 */
42
43/**
44 * atomic_read - read atomic variable
45 * @v: pointer of type atomic_t
46 *
47 * Atomically reads the value of @v.
48 */
49#define atomic_read(v) ((v)->counter)
50
51/**
52 * atomic_set - set atomic variable
53 * @v: pointer of type atomic_t
54 * @i: required value
55 *
56 * Atomically sets the value of @v to @i.
57 */
58#define atomic_set(v,i) ((v)->counter = (i))
59
60/**
61 * atomic_add - add integer to atomic variable
62 * @i: integer value to add
63 * @v: pointer of type atomic_t
64 *
65 * Atomically adds @i to @v.
66 */
67static inline void atomic_add(int i, atomic_t * v)
68{
69 unsigned int vval;
70
71 __asm__ __volatile__(
72 "rsil a15, "__stringify(LOCKLEVEL)"\n\t"
73 "l32i %0, %2, 0 \n\t"
74 "add %0, %0, %1 \n\t"
75 "s32i %0, %2, 0 \n\t"
76 "wsr a15, "__stringify(PS)" \n\t"
77 "rsync \n"
78 : "=&a" (vval)
79 : "a" (i), "a" (v)
80 : "a15", "memory"
81 );
82}
83
84/**
85 * atomic_sub - subtract the atomic variable
86 * @i: integer value to subtract
87 * @v: pointer of type atomic_t
88 *
89 * Atomically subtracts @i from @v.
90 */
91static inline void atomic_sub(int i, atomic_t *v)
92{
93 unsigned int vval;
94
95 __asm__ __volatile__(
96 "rsil a15, "__stringify(LOCKLEVEL)"\n\t"
97 "l32i %0, %2, 0 \n\t"
98 "sub %0, %0, %1 \n\t"
99 "s32i %0, %2, 0 \n\t"
100 "wsr a15, "__stringify(PS)" \n\t"
101 "rsync \n"
102 : "=&a" (vval)
103 : "a" (i), "a" (v)
104 : "a15", "memory"
105 );
106}
107
108/*
109 * We use atomic_{add|sub}_return to define other functions.
110 */
111
112static inline int atomic_add_return(int i, atomic_t * v)
113{
114 unsigned int vval;
115
116 __asm__ __volatile__(
117 "rsil a15,"__stringify(LOCKLEVEL)"\n\t"
118 "l32i %0, %2, 0 \n\t"
119 "add %0, %0, %1 \n\t"
120 "s32i %0, %2, 0 \n\t"
121 "wsr a15, "__stringify(PS)" \n\t"
122 "rsync \n"
123 : "=&a" (vval)
124 : "a" (i), "a" (v)
125 : "a15", "memory"
126 );
127
128 return vval;
129}
130
131static inline int atomic_sub_return(int i, atomic_t * v)
132{
133 unsigned int vval;
134
135 __asm__ __volatile__(
136 "rsil a15,"__stringify(LOCKLEVEL)"\n\t"
137 "l32i %0, %2, 0 \n\t"
138 "sub %0, %0, %1 \n\t"
139 "s32i %0, %2, 0 \n\t"
140 "wsr a15, "__stringify(PS)" \n\t"
141 "rsync \n"
142 : "=&a" (vval)
143 : "a" (i), "a" (v)
144 : "a15", "memory"
145 );
146
147 return vval;
148}
149
150/**
151 * atomic_sub_and_test - subtract value from variable and test result
152 * @i: integer value to subtract
153 * @v: pointer of type atomic_t
154 *
155 * Atomically subtracts @i from @v and returns
156 * true if the result is zero, or false for all
157 * other cases.
158 */
159#define atomic_sub_and_test(i,v) (atomic_sub_return((i),(v)) == 0)
160
161/**
162 * atomic_inc - increment atomic variable
163 * @v: pointer of type atomic_t
164 *
165 * Atomically increments @v by 1.
166 */
167#define atomic_inc(v) atomic_add(1,(v))
168
169/**
170 * atomic_inc - increment atomic variable
171 * @v: pointer of type atomic_t
172 *
173 * Atomically increments @v by 1.
174 */
175#define atomic_inc_return(v) atomic_add_return(1,(v))
176
177/**
178 * atomic_dec - decrement atomic variable
179 * @v: pointer of type atomic_t
180 *
181 * Atomically decrements @v by 1.
182 */
183#define atomic_dec(v) atomic_sub(1,(v))
184
185/**
186 * atomic_dec_return - decrement atomic variable
187 * @v: pointer of type atomic_t
188 *
189 * Atomically decrements @v by 1.
190 */
191#define atomic_dec_return(v) atomic_sub_return(1,(v))
192
193/**
194 * atomic_dec_and_test - decrement and test
195 * @v: pointer of type atomic_t
196 *
197 * Atomically decrements @v by 1 and
198 * returns true if the result is 0, or false for all other
199 * cases.
200 */
201#define atomic_dec_and_test(v) (atomic_sub_return(1,(v)) == 0)
202
203/**
204 * atomic_inc_and_test - increment and test
205 * @v: pointer of type atomic_t
206 *
207 * Atomically increments @v by 1
208 * and returns true if the result is zero, or false for all
209 * other cases.
210 */
211#define atomic_inc_and_test(v) (atomic_add_return(1,(v)) == 0)
212
213/**
214 * atomic_add_negative - add and test if negative
215 * @v: pointer of type atomic_t
216 * @i: integer value to add
217 *
218 * Atomically adds @i to @v and returns true
219 * if the result is negative, or false when
220 * result is greater than or equal to zero.
221 */
222#define atomic_add_negative(i,v) (atomic_add_return((i),(v)) < 0)
223
224#define atomic_cmpxchg(v, o, n) ((int)cmpxchg(&((v)->counter), (o), (n)))
225#define atomic_xchg(v, new) (xchg(&((v)->counter), new))
226
227/**
228 * atomic_add_unless - add unless the number is a given value
229 * @v: pointer of type atomic_t
230 * @a: the amount to add to v...
231 * @u: ...unless v is equal to u.
232 *
233 * Atomically adds @a to @v, so long as it was not @u.
234 * Returns non-zero if @v was not @u, and zero otherwise.
235 */
236static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
237{
238 int c, old;
239 c = atomic_read(v);
240 for (;;) {
241 if (unlikely(c == (u)))
242 break;
243 old = atomic_cmpxchg((v), c, c + (a));
244 if (likely(old == c))
245 break;
246 c = old;
247 }
248 return c != (u);
249}
250
251#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
252
253static inline void atomic_clear_mask(unsigned int mask, atomic_t *v)
254{
255 unsigned int all_f = -1;
256 unsigned int vval;
257
258 __asm__ __volatile__(
259 "rsil a15,"__stringify(LOCKLEVEL)"\n\t"
260 "l32i %0, %2, 0 \n\t"
261 "xor %1, %4, %3 \n\t"
262 "and %0, %0, %4 \n\t"
263 "s32i %0, %2, 0 \n\t"
264 "wsr a15, "__stringify(PS)" \n\t"
265 "rsync \n"
266 : "=&a" (vval), "=a" (mask)
267 : "a" (v), "a" (all_f), "1" (mask)
268 : "a15", "memory"
269 );
270}
271
272static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
273{
274 unsigned int vval;
275
276 __asm__ __volatile__(
277 "rsil a15,"__stringify(LOCKLEVEL)"\n\t"
278 "l32i %0, %2, 0 \n\t"
279 "or %0, %0, %1 \n\t"
280 "s32i %0, %2, 0 \n\t"
281 "wsr a15, "__stringify(PS)" \n\t"
282 "rsync \n"
283 : "=&a" (vval)
284 : "a" (mask), "a" (v)
285 : "a15", "memory"
286 );
287}
288
289/* Atomic operations are already serializing */
290#define smp_mb__before_atomic_dec() barrier()
291#define smp_mb__after_atomic_dec() barrier()
292#define smp_mb__before_atomic_inc() barrier()
293#define smp_mb__after_atomic_inc() barrier()
294
295#include <asm-generic/atomic.h>
296#endif /* __KERNEL__ */
297
298#endif /* _XTENSA_ATOMIC_H */
299
diff --git a/arch/xtensa/include/asm/auxvec.h b/arch/xtensa/include/asm/auxvec.h
new file mode 100644
index 000000000000..257dec75c5af
--- /dev/null
+++ b/arch/xtensa/include/asm/auxvec.h
@@ -0,0 +1,4 @@
1#ifndef __XTENSA_AUXVEC_H
2#define __XTENSA_AUXVEC_H
3
4#endif
diff --git a/arch/xtensa/include/asm/bitops.h b/arch/xtensa/include/asm/bitops.h
new file mode 100644
index 000000000000..6c3930397bd3
--- /dev/null
+++ b/arch/xtensa/include/asm/bitops.h
@@ -0,0 +1,132 @@
1/*
2 * include/asm-xtensa/bitops.h
3 *
4 * Atomic operations that C can't guarantee us.Useful for resource counting etc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2007 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_BITOPS_H
14#define _XTENSA_BITOPS_H
15
16#ifdef __KERNEL__
17
18#ifndef _LINUX_BITOPS_H
19#error only <linux/bitops.h> can be included directly
20#endif
21
22#include <asm/processor.h>
23#include <asm/byteorder.h>
24#include <asm/system.h>
25
26#ifdef CONFIG_SMP
27# error SMP not supported on this architecture
28#endif
29
30#define smp_mb__before_clear_bit() barrier()
31#define smp_mb__after_clear_bit() barrier()
32
33#include <asm-generic/bitops/atomic.h>
34#include <asm-generic/bitops/non-atomic.h>
35
36#if XCHAL_HAVE_NSA
37
38static inline unsigned long __cntlz (unsigned long x)
39{
40 int lz;
41 asm ("nsau %0, %1" : "=r" (lz) : "r" (x));
42 return lz;
43}
44
45/*
46 * ffz: Find first zero in word. Undefined if no zero exists.
47 * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
48 */
49
50static inline int ffz(unsigned long x)
51{
52 return 31 - __cntlz(~x & -~x);
53}
54
55/*
56 * __ffs: Find first bit set in word. Return 0 for bit 0
57 */
58
59static inline int __ffs(unsigned long x)
60{
61 return 31 - __cntlz(x & -x);
62}
63
64/*
65 * ffs: Find first bit set in word. This is defined the same way as
66 * the libc and compiler builtin ffs routines, therefore
67 * differs in spirit from the above ffz (man ffs).
68 */
69
70static inline int ffs(unsigned long x)
71{
72 return 32 - __cntlz(x & -x);
73}
74
75/*
76 * fls: Find last (most-significant) bit set in word.
77 * Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.
78 */
79
80static inline int fls (unsigned int x)
81{
82 return 32 - __cntlz(x);
83}
84
85/**
86 * __fls - find last (most-significant) set bit in a long word
87 * @word: the word to search
88 *
89 * Undefined if no set bit exists, so code should check against 0 first.
90 */
91static inline unsigned long __fls(unsigned long word)
92{
93 return 31 - __cntlz(word);
94}
95#else
96
97/* Use the generic implementation if we don't have the nsa/nsau instructions. */
98
99# include <asm-generic/bitops/ffs.h>
100# include <asm-generic/bitops/__ffs.h>
101# include <asm-generic/bitops/ffz.h>
102# include <asm-generic/bitops/fls.h>
103# include <asm-generic/bitops/__fls.h>
104
105#endif
106
107#include <asm-generic/bitops/fls64.h>
108#include <asm-generic/bitops/find.h>
109#include <asm-generic/bitops/ext2-non-atomic.h>
110
111#ifdef __XTENSA_EL__
112# define ext2_set_bit_atomic(lock,nr,addr) \
113 test_and_set_bit((nr), (unsigned long*)(addr))
114# define ext2_clear_bit_atomic(lock,nr,addr) \
115 test_and_clear_bit((nr), (unsigned long*)(addr))
116#elif defined(__XTENSA_EB__)
117# define ext2_set_bit_atomic(lock,nr,addr) \
118 test_and_set_bit((nr) ^ 0x18, (unsigned long*)(addr))
119# define ext2_clear_bit_atomic(lock,nr,addr) \
120 test_and_clear_bit((nr) ^ 0x18, (unsigned long*)(addr))
121#else
122# error processor byte order undefined!
123#endif
124
125#include <asm-generic/bitops/hweight.h>
126#include <asm-generic/bitops/lock.h>
127#include <asm-generic/bitops/sched.h>
128#include <asm-generic/bitops/minix.h>
129
130#endif /* __KERNEL__ */
131
132#endif /* _XTENSA_BITOPS_H */
diff --git a/arch/xtensa/include/asm/bootparam.h b/arch/xtensa/include/asm/bootparam.h
new file mode 100644
index 000000000000..9983f2c1b7ee
--- /dev/null
+++ b/arch/xtensa/include/asm/bootparam.h
@@ -0,0 +1,61 @@
1/*
2 * include/asm-xtensa/bootparam.h
3 *
4 * Definition of the Linux/Xtensa boot parameter structure
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 *
12 * (Concept borrowed from the 68K port)
13 */
14
15#ifndef _XTENSA_BOOTPARAM_H
16#define _XTENSA_BOOTPARAM_H
17
18#define BP_VERSION 0x0001
19
20#define BP_TAG_COMMAND_LINE 0x1001 /* command line (0-terminated string)*/
21#define BP_TAG_INITRD 0x1002 /* ramdisk addr and size (bp_meminfo) */
22#define BP_TAG_MEMORY 0x1003 /* memory addr and size (bp_meminfo) */
23#define BP_TAG_SERIAL_BAUSRATE 0x1004 /* baud rate of current console. */
24#define BP_TAG_SERIAL_PORT 0x1005 /* serial device of current console */
25
26#define BP_TAG_FIRST 0x7B0B /* first tag with a version number */
27#define BP_TAG_LAST 0x7E0B /* last tag */
28
29#ifndef __ASSEMBLY__
30
31/* All records are aligned to 4 bytes */
32
33typedef struct bp_tag {
34 unsigned short id; /* tag id */
35 unsigned short size; /* size of this record excluding the structure*/
36 unsigned long data[0]; /* data */
37} bp_tag_t;
38
39typedef struct meminfo {
40 unsigned long type;
41 unsigned long start;
42 unsigned long end;
43} meminfo_t;
44
45#define SYSMEM_BANKS_MAX 5
46
47#define MEMORY_TYPE_CONVENTIONAL 0x1000
48#define MEMORY_TYPE_NONE 0x2000
49
50typedef struct sysmem_info {
51 int nr_banks;
52 meminfo_t bank[SYSMEM_BANKS_MAX];
53} sysmem_info_t;
54
55extern sysmem_info_t sysmem;
56
57#endif
58#endif
59
60
61
diff --git a/arch/xtensa/include/asm/bug.h b/arch/xtensa/include/asm/bug.h
new file mode 100644
index 000000000000..3e52d72712f1
--- /dev/null
+++ b/arch/xtensa/include/asm/bug.h
@@ -0,0 +1,18 @@
1/*
2 * include/asm-xtensa/bug.h
3 *
4 * Macros to cause a 'bug' message.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_BUG_H
14#define _XTENSA_BUG_H
15
16#include <asm-generic/bug.h>
17
18#endif /* _XTENSA_BUG_H */
diff --git a/arch/xtensa/include/asm/bugs.h b/arch/xtensa/include/asm/bugs.h
new file mode 100644
index 000000000000..69b29d198249
--- /dev/null
+++ b/arch/xtensa/include/asm/bugs.h
@@ -0,0 +1,18 @@
1/*
2 * include/asm-xtensa/bugs.h
3 *
4 * This is included by init/main.c to check for architecture-dependent bugs.
5 *
6 * Xtensa processors don't have any bugs. :)
7 *
8 * This file is subject to the terms and conditions of the GNU General
9 * Public License. See the file "COPYING" in the main directory of
10 * this archive for more details.
11 */
12
13#ifndef _XTENSA_BUGS_H
14#define _XTENSA_BUGS_H
15
16static void check_bugs(void) { }
17
18#endif /* _XTENSA_BUGS_H */
diff --git a/arch/xtensa/include/asm/byteorder.h b/arch/xtensa/include/asm/byteorder.h
new file mode 100644
index 000000000000..329b94591ca4
--- /dev/null
+++ b/arch/xtensa/include/asm/byteorder.h
@@ -0,0 +1,14 @@
1#ifndef _XTENSA_BYTEORDER_H
2#define _XTENSA_BYTEORDER_H
3
4#include <asm/swab.h>
5
6#ifdef __XTENSA_EL__
7#include <linux/byteorder/little_endian.h>
8#elif defined(__XTENSA_EB__)
9#include <linux/byteorder/big_endian.h>
10#else
11# error processor byte order undefined!
12#endif
13
14#endif /* _XTENSA_BYTEORDER_H */
diff --git a/arch/xtensa/include/asm/cache.h b/arch/xtensa/include/asm/cache.h
new file mode 100644
index 000000000000..f04c9891142f
--- /dev/null
+++ b/arch/xtensa/include/asm/cache.h
@@ -0,0 +1,33 @@
1/*
2 * include/asm-xtensa/cache.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CACHE_H
12#define _XTENSA_CACHE_H
13
14#include <variant/core.h>
15
16#define L1_CACHE_SHIFT XCHAL_DCACHE_LINEWIDTH
17#define L1_CACHE_BYTES XCHAL_DCACHE_LINESIZE
18#define SMP_CACHE_BYTES L1_CACHE_BYTES
19
20#define DCACHE_WAY_SIZE (XCHAL_DCACHE_SIZE/XCHAL_DCACHE_WAYS)
21#define ICACHE_WAY_SIZE (XCHAL_ICACHE_SIZE/XCHAL_ICACHE_WAYS)
22#define DCACHE_WAY_SHIFT (XCHAL_DCACHE_SETWIDTH + XCHAL_DCACHE_LINEWIDTH)
23#define ICACHE_WAY_SHIFT (XCHAL_ICACHE_SETWIDTH + XCHAL_ICACHE_LINEWIDTH)
24
25/* Maximum cache size per way. */
26#if DCACHE_WAY_SIZE >= ICACHE_WAY_SIZE
27# define CACHE_WAY_SIZE DCACHE_WAY_SIZE
28#else
29# define CACHE_WAY_SIZE ICACHE_WAY_SIZE
30#endif
31
32
33#endif /* _XTENSA_CACHE_H */
diff --git a/arch/xtensa/include/asm/cacheasm.h b/arch/xtensa/include/asm/cacheasm.h
new file mode 100644
index 000000000000..2c20a58f94cd
--- /dev/null
+++ b/arch/xtensa/include/asm/cacheasm.h
@@ -0,0 +1,177 @@
1/*
2 * include/asm-xtensa/cacheasm.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2006 Tensilica Inc.
9 */
10
11#include <asm/cache.h>
12#include <asm/asmmacro.h>
13#include <linux/stringify.h>
14
15/*
16 * Define cache functions as macros here so that they can be used
17 * by the kernel and boot loader. We should consider moving them to a
18 * library that can be linked by both.
19 *
20 * Locking
21 *
22 * ___unlock_dcache_all
23 * ___unlock_icache_all
24 *
25 * Flush and invaldating
26 *
27 * ___flush_invalidate_dcache_{all|range|page}
28 * ___flush_dcache_{all|range|page}
29 * ___invalidate_dcache_{all|range|page}
30 * ___invalidate_icache_{all|range|page}
31 *
32 */
33
34 .macro __loop_cache_all ar at insn size line_width
35
36 movi \ar, 0
37
38 __loopi \ar, \at, \size, (4 << (\line_width))
39 \insn \ar, 0 << (\line_width)
40 \insn \ar, 1 << (\line_width)
41 \insn \ar, 2 << (\line_width)
42 \insn \ar, 3 << (\line_width)
43 __endla \ar, \at, 4 << (\line_width)
44
45 .endm
46
47
48 .macro __loop_cache_range ar as at insn line_width
49
50 extui \at, \ar, 0, \line_width
51 add \as, \as, \at
52
53 __loops \ar, \as, \at, \line_width
54 \insn \ar, 0
55 __endla \ar, \at, (1 << (\line_width))
56
57 .endm
58
59
60 .macro __loop_cache_page ar at insn line_width
61
62 __loopi \ar, \at, PAGE_SIZE, 4 << (\line_width)
63 \insn \ar, 0 << (\line_width)
64 \insn \ar, 1 << (\line_width)
65 \insn \ar, 2 << (\line_width)
66 \insn \ar, 3 << (\line_width)
67 __endla \ar, \at, 4 << (\line_width)
68
69 .endm
70
71
72#if XCHAL_DCACHE_LINE_LOCKABLE
73
74 .macro ___unlock_dcache_all ar at
75
76 __loop_cache_all \ar \at diu XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
77
78 .endm
79
80#endif
81
82#if XCHAL_ICACHE_LINE_LOCKABLE
83
84 .macro ___unlock_icache_all ar at
85
86 __loop_cache_all \ar \at iiu XCHAL_ICACHE_SIZE XCHAL_ICACHE_LINEWIDTH
87
88 .endm
89#endif
90
91 .macro ___flush_invalidate_dcache_all ar at
92
93 __loop_cache_all \ar \at diwbi XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
94
95 .endm
96
97
98 .macro ___flush_dcache_all ar at
99
100 __loop_cache_all \ar \at diwb XCHAL_DCACHE_SIZE XCHAL_DCACHE_LINEWIDTH
101
102 .endm
103
104
105 .macro ___invalidate_dcache_all ar at
106
107 __loop_cache_all \ar \at dii __stringify(DCACHE_WAY_SIZE) \
108 XCHAL_DCACHE_LINEWIDTH
109
110 .endm
111
112
113 .macro ___invalidate_icache_all ar at
114
115 __loop_cache_all \ar \at iii __stringify(ICACHE_WAY_SIZE) \
116 XCHAL_ICACHE_LINEWIDTH
117
118 .endm
119
120
121
122 .macro ___flush_invalidate_dcache_range ar as at
123
124 __loop_cache_range \ar \as \at dhwbi XCHAL_DCACHE_LINEWIDTH
125
126 .endm
127
128
129 .macro ___flush_dcache_range ar as at
130
131 __loop_cache_range \ar \as \at dhwb XCHAL_DCACHE_LINEWIDTH
132
133 .endm
134
135
136 .macro ___invalidate_dcache_range ar as at
137
138 __loop_cache_range \ar \as \at dhi XCHAL_DCACHE_LINEWIDTH
139
140 .endm
141
142
143 .macro ___invalidate_icache_range ar as at
144
145 __loop_cache_range \ar \as \at ihi XCHAL_ICACHE_LINEWIDTH
146
147 .endm
148
149
150
151 .macro ___flush_invalidate_dcache_page ar as
152
153 __loop_cache_page \ar \as dhwbi XCHAL_DCACHE_LINEWIDTH
154
155 .endm
156
157
158 .macro ___flush_dcache_page ar as
159
160 __loop_cache_page \ar \as dhwb XCHAL_DCACHE_LINEWIDTH
161
162 .endm
163
164
165 .macro ___invalidate_dcache_page ar as
166
167 __loop_cache_page \ar \as dhi XCHAL_DCACHE_LINEWIDTH
168
169 .endm
170
171
172 .macro ___invalidate_icache_page ar as
173
174 __loop_cache_page \ar \as ihi XCHAL_ICACHE_LINEWIDTH
175
176 .endm
177
diff --git a/arch/xtensa/include/asm/cacheflush.h b/arch/xtensa/include/asm/cacheflush.h
new file mode 100644
index 000000000000..94c4c53a099e
--- /dev/null
+++ b/arch/xtensa/include/asm/cacheflush.h
@@ -0,0 +1,155 @@
1/*
2 * include/asm-xtensa/cacheflush.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * (C) 2001 - 2007 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CACHEFLUSH_H
12#define _XTENSA_CACHEFLUSH_H
13
14#ifdef __KERNEL__
15
16#include <linux/mm.h>
17#include <asm/processor.h>
18#include <asm/page.h>
19
20/*
21 * Lo-level routines for cache flushing.
22 *
23 * invalidate data or instruction cache:
24 *
25 * __invalidate_icache_all()
26 * __invalidate_icache_page(adr)
27 * __invalidate_dcache_page(adr)
28 * __invalidate_icache_range(from,size)
29 * __invalidate_dcache_range(from,size)
30 *
31 * flush data cache:
32 *
33 * __flush_dcache_page(adr)
34 *
35 * flush and invalidate data cache:
36 *
37 * __flush_invalidate_dcache_all()
38 * __flush_invalidate_dcache_page(adr)
39 * __flush_invalidate_dcache_range(from,size)
40 *
41 * specials for cache aliasing:
42 *
43 * __flush_invalidate_dcache_page_alias(vaddr,paddr)
44 * __invalidate_icache_page_alias(vaddr,paddr)
45 */
46
47extern void __invalidate_dcache_all(void);
48extern void __invalidate_icache_all(void);
49extern void __invalidate_dcache_page(unsigned long);
50extern void __invalidate_icache_page(unsigned long);
51extern void __invalidate_icache_range(unsigned long, unsigned long);
52extern void __invalidate_dcache_range(unsigned long, unsigned long);
53
54
55#if XCHAL_DCACHE_IS_WRITEBACK
56extern void __flush_invalidate_dcache_all(void);
57extern void __flush_dcache_page(unsigned long);
58extern void __flush_dcache_range(unsigned long, unsigned long);
59extern void __flush_invalidate_dcache_page(unsigned long);
60extern void __flush_invalidate_dcache_range(unsigned long, unsigned long);
61#else
62# define __flush_dcache_range(p,s) do { } while(0)
63# define __flush_dcache_page(p) do { } while(0)
64# define __flush_invalidate_dcache_page(p) __invalidate_dcache_page(p)
65# define __flush_invalidate_dcache_range(p,s) __invalidate_dcache_range(p,s)
66#endif
67
68#if (DCACHE_WAY_SIZE > PAGE_SIZE)
69extern void __flush_invalidate_dcache_page_alias(unsigned long, unsigned long);
70#endif
71#if (ICACHE_WAY_SIZE > PAGE_SIZE)
72extern void __invalidate_icache_page_alias(unsigned long, unsigned long);
73#else
74# define __invalidate_icache_page_alias(v,p) do { } while(0)
75#endif
76
77/*
78 * We have physically tagged caches - nothing to do here -
79 * unless we have cache aliasing.
80 *
81 * Pages can get remapped. Because this might change the 'color' of that page,
82 * we have to flush the cache before the PTE is changed.
83 * (see also Documentation/cachetlb.txt)
84 */
85
86#if (DCACHE_WAY_SIZE > PAGE_SIZE)
87
88#define flush_cache_all() \
89 do { \
90 __flush_invalidate_dcache_all(); \
91 __invalidate_icache_all(); \
92 } while (0)
93
94#define flush_cache_mm(mm) flush_cache_all()
95#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
96
97#define flush_cache_vmap(start,end) flush_cache_all()
98#define flush_cache_vunmap(start,end) flush_cache_all()
99
100extern void flush_dcache_page(struct page*);
101extern void flush_cache_range(struct vm_area_struct*, ulong, ulong);
102extern void flush_cache_page(struct vm_area_struct*, unsigned long, unsigned long);
103
104#else
105
106#define flush_cache_all() do { } while (0)
107#define flush_cache_mm(mm) do { } while (0)
108#define flush_cache_dup_mm(mm) do { } while (0)
109
110#define flush_cache_vmap(start,end) do { } while (0)
111#define flush_cache_vunmap(start,end) do { } while (0)
112
113#define flush_dcache_page(page) do { } while (0)
114
115#define flush_cache_page(vma,addr,pfn) do { } while (0)
116#define flush_cache_range(vma,start,end) do { } while (0)
117
118#endif
119
120/* Ensure consistency between data and instruction cache. */
121#define flush_icache_range(start,end) \
122 do { \
123 __flush_dcache_range(start, (end) - (start)); \
124 __invalidate_icache_range(start,(end) - (start)); \
125 } while (0)
126
127/* This is not required, see Documentation/cachetlb.txt */
128#define flush_icache_page(vma,page) do { } while (0)
129
130#define flush_dcache_mmap_lock(mapping) do { } while (0)
131#define flush_dcache_mmap_unlock(mapping) do { } while (0)
132
133#if (DCACHE_WAY_SIZE > PAGE_SIZE)
134
135extern void copy_to_user_page(struct vm_area_struct*, struct page*,
136 unsigned long, void*, const void*, unsigned long);
137extern void copy_from_user_page(struct vm_area_struct*, struct page*,
138 unsigned long, void*, const void*, unsigned long);
139
140#else
141
142#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
143 do { \
144 memcpy(dst, src, len); \
145 __flush_dcache_range((unsigned long) dst, len); \
146 __invalidate_icache_range((unsigned long) dst, len); \
147 } while (0)
148
149#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
150 memcpy(dst, src, len)
151
152#endif
153
154#endif /* __KERNEL__ */
155#endif /* _XTENSA_CACHEFLUSH_H */
diff --git a/arch/xtensa/include/asm/checksum.h b/arch/xtensa/include/asm/checksum.h
new file mode 100644
index 000000000000..f84d3f00774a
--- /dev/null
+++ b/arch/xtensa/include/asm/checksum.h
@@ -0,0 +1,250 @@
1/*
2 * include/asm-xtensa/checksum.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CHECKSUM_H
12#define _XTENSA_CHECKSUM_H
13
14#include <linux/in6.h>
15#include <variant/core.h>
16
17/*
18 * computes the checksum of a memory block at buff, length len,
19 * and adds in "sum" (32-bit)
20 *
21 * returns a 32-bit number suitable for feeding into itself
22 * or csum_tcpudp_magic
23 *
24 * this function must be called with even lengths, except
25 * for the last fragment, which may be odd
26 *
27 * it's best to have buff aligned on a 32-bit boundary
28 */
29asmlinkage __wsum csum_partial(const void *buff, int len, __wsum sum);
30
31/*
32 * the same as csum_partial, but copies from src while it
33 * checksums, and handles user-space pointer exceptions correctly, when needed.
34 *
35 * here even more important to align src and dst on a 32-bit (or even
36 * better 64-bit) boundary
37 */
38
39asmlinkage __wsum csum_partial_copy_generic(const void *src, void *dst, int len, __wsum sum,
40 int *src_err_ptr, int *dst_err_ptr);
41
42/*
43 * Note: when you get a NULL pointer exception here this means someone
44 * passed in an incorrect kernel address to one of these functions.
45 *
46 * If you use these functions directly please don't forget the access_ok().
47 */
48static inline
49__wsum csum_partial_copy_nocheck(const void *src, void *dst,
50 int len, __wsum sum)
51{
52 return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL);
53}
54
55static inline
56__wsum csum_partial_copy_from_user(const void __user *src, void *dst,
57 int len, __wsum sum, int *err_ptr)
58{
59 return csum_partial_copy_generic((__force const void *)src, dst,
60 len, sum, err_ptr, NULL);
61}
62
63/*
64 * Fold a partial checksum
65 */
66
67static __inline__ __sum16 csum_fold(__wsum sum)
68{
69 unsigned int __dummy;
70 __asm__("extui %1, %0, 16, 16\n\t"
71 "extui %0 ,%0, 0, 16\n\t"
72 "add %0, %0, %1\n\t"
73 "slli %1, %0, 16\n\t"
74 "add %0, %0, %1\n\t"
75 "extui %0, %0, 16, 16\n\t"
76 "neg %0, %0\n\t"
77 "addi %0, %0, -1\n\t"
78 "extui %0, %0, 0, 16\n\t"
79 : "=r" (sum), "=&r" (__dummy)
80 : "0" (sum));
81 return (__force __sum16)sum;
82}
83
84/*
85 * This is a version of ip_compute_csum() optimized for IP headers,
86 * which always checksum on 4 octet boundaries.
87 */
88static __inline__ __sum16 ip_fast_csum(const void *iph, unsigned int ihl)
89{
90 unsigned int sum, tmp, endaddr;
91
92 __asm__ __volatile__(
93 "sub %0, %0, %0\n\t"
94#if XCHAL_HAVE_LOOPS
95 "loopgtz %2, 2f\n\t"
96#else
97 "beqz %2, 2f\n\t"
98 "slli %4, %2, 2\n\t"
99 "add %4, %4, %1\n\t"
100 "0:\t"
101#endif
102 "l32i %3, %1, 0\n\t"
103 "add %0, %0, %3\n\t"
104 "bgeu %0, %3, 1f\n\t"
105 "addi %0, %0, 1\n\t"
106 "1:\t"
107 "addi %1, %1, 4\n\t"
108#if !XCHAL_HAVE_LOOPS
109 "blt %1, %4, 0b\n\t"
110#endif
111 "2:\t"
112 /* Since the input registers which are loaded with iph and ihl
113 are modified, we must also specify them as outputs, or gcc
114 will assume they contain their original values. */
115 : "=r" (sum), "=r" (iph), "=r" (ihl), "=&r" (tmp), "=&r" (endaddr)
116 : "1" (iph), "2" (ihl));
117
118 return csum_fold(sum);
119}
120
121static __inline__ __wsum csum_tcpudp_nofold(__be32 saddr, __be32 daddr,
122 unsigned short len,
123 unsigned short proto,
124 __wsum sum)
125{
126
127#ifdef __XTENSA_EL__
128 unsigned long len_proto = (len + proto) << 8;
129#elif defined(__XTENSA_EB__)
130 unsigned long len_proto = len + proto;
131#else
132# error processor byte order undefined!
133#endif
134 __asm__("add %0, %0, %1\n\t"
135 "bgeu %0, %1, 1f\n\t"
136 "addi %0, %0, 1\n\t"
137 "1:\t"
138 "add %0, %0, %2\n\t"
139 "bgeu %0, %2, 1f\n\t"
140 "addi %0, %0, 1\n\t"
141 "1:\t"
142 "add %0, %0, %3\n\t"
143 "bgeu %0, %3, 1f\n\t"
144 "addi %0, %0, 1\n\t"
145 "1:\t"
146 : "=r" (sum), "=r" (len_proto)
147 : "r" (daddr), "r" (saddr), "1" (len_proto), "0" (sum));
148 return sum;
149}
150
151/*
152 * computes the checksum of the TCP/UDP pseudo-header
153 * returns a 16-bit checksum, already complemented
154 */
155static __inline__ __sum16 csum_tcpudp_magic(__be32 saddr, __be32 daddr,
156 unsigned short len,
157 unsigned short proto,
158 __wsum sum)
159{
160 return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum));
161}
162
163/*
164 * this routine is used for miscellaneous IP-like checksums, mainly
165 * in icmp.c
166 */
167
168static __inline__ __sum16 ip_compute_csum(const void *buff, int len)
169{
170 return csum_fold (csum_partial(buff, len, 0));
171}
172
173#define _HAVE_ARCH_IPV6_CSUM
174static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
175 const struct in6_addr *daddr,
176 __u32 len, unsigned short proto,
177 __wsum sum)
178{
179 unsigned int __dummy;
180 __asm__("l32i %1, %2, 0\n\t"
181 "add %0, %0, %1\n\t"
182 "bgeu %0, %1, 1f\n\t"
183 "addi %0, %0, 1\n\t"
184 "1:\t"
185 "l32i %1, %2, 4\n\t"
186 "add %0, %0, %1\n\t"
187 "bgeu %0, %1, 1f\n\t"
188 "addi %0, %0, 1\n\t"
189 "1:\t"
190 "l32i %1, %2, 8\n\t"
191 "add %0, %0, %1\n\t"
192 "bgeu %0, %1, 1f\n\t"
193 "addi %0, %0, 1\n\t"
194 "1:\t"
195 "l32i %1, %2, 12\n\t"
196 "add %0, %0, %1\n\t"
197 "bgeu %0, %1, 1f\n\t"
198 "addi %0, %0, 1\n\t"
199 "1:\t"
200 "l32i %1, %3, 0\n\t"
201 "add %0, %0, %1\n\t"
202 "bgeu %0, %1, 1f\n\t"
203 "addi %0, %0, 1\n\t"
204 "1:\t"
205 "l32i %1, %3, 4\n\t"
206 "add %0, %0, %1\n\t"
207 "bgeu %0, %1, 1f\n\t"
208 "addi %0, %0, 1\n\t"
209 "1:\t"
210 "l32i %1, %3, 8\n\t"
211 "add %0, %0, %1\n\t"
212 "bgeu %0, %1, 1f\n\t"
213 "addi %0, %0, 1\n\t"
214 "1:\t"
215 "l32i %1, %3, 12\n\t"
216 "add %0, %0, %1\n\t"
217 "bgeu %0, %1, 1f\n\t"
218 "addi %0, %0, 1\n\t"
219 "1:\t"
220 "add %0, %0, %4\n\t"
221 "bgeu %0, %4, 1f\n\t"
222 "addi %0, %0, 1\n\t"
223 "1:\t"
224 "add %0, %0, %5\n\t"
225 "bgeu %0, %5, 1f\n\t"
226 "addi %0, %0, 1\n\t"
227 "1:\t"
228 : "=r" (sum), "=&r" (__dummy)
229 : "r" (saddr), "r" (daddr),
230 "r" (htonl(len)), "r" (htonl(proto)), "0" (sum));
231
232 return csum_fold(sum);
233}
234
235/*
236 * Copy and checksum to user
237 */
238#define HAVE_CSUM_COPY_USER
239static __inline__ __wsum csum_and_copy_to_user(const void *src, void __user *dst,
240 int len, __wsum sum, int *err_ptr)
241{
242 if (access_ok(VERIFY_WRITE, dst, len))
243 return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr);
244
245 if (len)
246 *err_ptr = -EFAULT;
247
248 return (__force __wsum)-1; /* invalid checksum */
249}
250#endif
diff --git a/arch/xtensa/include/asm/coprocessor.h b/arch/xtensa/include/asm/coprocessor.h
new file mode 100644
index 000000000000..65a285d8d3fb
--- /dev/null
+++ b/arch/xtensa/include/asm/coprocessor.h
@@ -0,0 +1,177 @@
1/*
2 * include/asm-xtensa/coprocessor.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2007 Tensilica Inc.
9 */
10
11
12#ifndef _XTENSA_COPROCESSOR_H
13#define _XTENSA_COPROCESSOR_H
14
15#include <linux/stringify.h>
16#include <variant/tie.h>
17#include <asm/types.h>
18
19#ifdef __ASSEMBLY__
20# include <variant/tie-asm.h>
21
22.macro xchal_sa_start a b
23 .set .Lxchal_pofs_, 0
24 .set .Lxchal_ofs_, 0
25.endm
26
27.macro xchal_sa_align ptr minofs maxofs ofsalign totalign
28 .set .Lxchal_ofs_, .Lxchal_ofs_ + .Lxchal_pofs_ + \totalign - 1
29 .set .Lxchal_ofs_, (.Lxchal_ofs_ & -\totalign) - .Lxchal_pofs_
30.endm
31
32#define _SELECT ( XTHAL_SAS_TIE | XTHAL_SAS_OPT \
33 | XTHAL_SAS_CC \
34 | XTHAL_SAS_CALR | XTHAL_SAS_CALE )
35
36.macro save_xtregs_opt ptr clb at1 at2 at3 at4 offset
37 .if XTREGS_OPT_SIZE > 0
38 addi \clb, \ptr, \offset
39 xchal_ncp_store \clb \at1 \at2 \at3 \at4 select=_SELECT
40 .endif
41.endm
42
43.macro load_xtregs_opt ptr clb at1 at2 at3 at4 offset
44 .if XTREGS_OPT_SIZE > 0
45 addi \clb, \ptr, \offset
46 xchal_ncp_load \clb \at1 \at2 \at3 \at4 select=_SELECT
47 .endif
48.endm
49#undef _SELECT
50
51#define _SELECT ( XTHAL_SAS_TIE | XTHAL_SAS_OPT \
52 | XTHAL_SAS_NOCC \
53 | XTHAL_SAS_CALR | XTHAL_SAS_CALE | XTHAL_SAS_GLOB )
54
55.macro save_xtregs_user ptr clb at1 at2 at3 at4 offset
56 .if XTREGS_USER_SIZE > 0
57 addi \clb, \ptr, \offset
58 xchal_ncp_store \clb \at1 \at2 \at3 \at4 select=_SELECT
59 .endif
60.endm
61
62.macro load_xtregs_user ptr clb at1 at2 at3 at4 offset
63 .if XTREGS_USER_SIZE > 0
64 addi \clb, \ptr, \offset
65 xchal_ncp_load \clb \at1 \at2 \at3 \at4 select=_SELECT
66 .endif
67.endm
68#undef _SELECT
69
70
71
72#endif /* __ASSEMBLY__ */
73
74/*
75 * XTENSA_HAVE_COPROCESSOR(x) returns 1 if coprocessor x is configured.
76 *
77 * XTENSA_HAVE_IO_PORT(x) returns 1 if io-port x is configured.
78 *
79 */
80
81#define XTENSA_HAVE_COPROCESSOR(x) \
82 ((XCHAL_CP_MASK ^ XCHAL_CP_PORT_MASK) & (1 << (x)))
83#define XTENSA_HAVE_COPROCESSORS \
84 (XCHAL_CP_MASK ^ XCHAL_CP_PORT_MASK)
85#define XTENSA_HAVE_IO_PORT(x) \
86 (XCHAL_CP_PORT_MASK & (1 << (x)))
87#define XTENSA_HAVE_IO_PORTS \
88 XCHAL_CP_PORT_MASK
89
90#ifndef __ASSEMBLY__
91
92
93#if XCHAL_HAVE_CP
94
95#define RSR_CPENABLE(x) do { \
96 __asm__ __volatile__("rsr %0," __stringify(CPENABLE) : "=a" (x)); \
97 } while(0);
98#define WSR_CPENABLE(x) do { \
99 __asm__ __volatile__("wsr %0," __stringify(CPENABLE) "; rsync" \
100 :: "a" (x)); \
101 } while(0);
102
103#endif /* XCHAL_HAVE_CP */
104
105
106/*
107 * Additional registers.
108 * We define three types of additional registers:
109 * ext: extra registers that are used by the compiler
110 * cpn: optional registers that can be used by a user application
111 * cpX: coprocessor registers that can only be used if the corresponding
112 * CPENABLE bit is set.
113 */
114
115#define XCHAL_SA_REG(list,cc,abi,type,y,name,z,align,size,...) \
116 __REG ## list (cc, abi, type, name, size, align)
117
118#define __REG0(cc,abi,t,name,s,a) __REG0_ ## cc (abi,name)
119#define __REG1(cc,abi,t,name,s,a) __REG1_ ## cc (name)
120#define __REG2(cc,abi,type,...) __REG2_ ## type (__VA_ARGS__)
121
122#define __REG0_0(abi,name)
123#define __REG0_1(abi,name) __REG0_1 ## abi (name)
124#define __REG0_10(name) __u32 name;
125#define __REG0_11(name) __u32 name;
126#define __REG0_12(name)
127
128#define __REG1_0(name) __u32 name;
129#define __REG1_1(name)
130
131#define __REG2_0(n,s,a) __u32 name;
132#define __REG2_1(n,s,a) unsigned char n[s] __attribute__ ((aligned(a)));
133#define __REG2_2(n,s,a) unsigned char n[s] __attribute__ ((aligned(a)));
134
135typedef struct { XCHAL_NCP_SA_LIST(0) } xtregs_opt_t
136 __attribute__ ((aligned (XCHAL_NCP_SA_ALIGN)));
137typedef struct { XCHAL_NCP_SA_LIST(1) } xtregs_user_t
138 __attribute__ ((aligned (XCHAL_NCP_SA_ALIGN)));
139
140#if XTENSA_HAVE_COPROCESSORS
141
142typedef struct { XCHAL_CP0_SA_LIST(2) } xtregs_cp0_t
143 __attribute__ ((aligned (XCHAL_CP0_SA_ALIGN)));
144typedef struct { XCHAL_CP1_SA_LIST(2) } xtregs_cp1_t
145 __attribute__ ((aligned (XCHAL_CP1_SA_ALIGN)));
146typedef struct { XCHAL_CP2_SA_LIST(2) } xtregs_cp2_t
147 __attribute__ ((aligned (XCHAL_CP2_SA_ALIGN)));
148typedef struct { XCHAL_CP3_SA_LIST(2) } xtregs_cp3_t
149 __attribute__ ((aligned (XCHAL_CP3_SA_ALIGN)));
150typedef struct { XCHAL_CP4_SA_LIST(2) } xtregs_cp4_t
151 __attribute__ ((aligned (XCHAL_CP4_SA_ALIGN)));
152typedef struct { XCHAL_CP5_SA_LIST(2) } xtregs_cp5_t
153 __attribute__ ((aligned (XCHAL_CP5_SA_ALIGN)));
154typedef struct { XCHAL_CP6_SA_LIST(2) } xtregs_cp6_t
155 __attribute__ ((aligned (XCHAL_CP6_SA_ALIGN)));
156typedef struct { XCHAL_CP7_SA_LIST(2) } xtregs_cp7_t
157 __attribute__ ((aligned (XCHAL_CP7_SA_ALIGN)));
158
159extern struct thread_info* coprocessor_owner[XCHAL_CP_MAX];
160extern void coprocessor_save(void*, int);
161extern void coprocessor_load(void*, int);
162extern void coprocessor_flush(struct thread_info*, int);
163extern void coprocessor_restore(struct thread_info*, int);
164
165extern void coprocessor_release_all(struct thread_info*);
166extern void coprocessor_flush_all(struct thread_info*);
167
168static inline void coprocessor_clear_cpenable(void)
169{
170 unsigned long i = 0;
171 WSR_CPENABLE(i);
172}
173
174#endif /* XTENSA_HAVE_COPROCESSORS */
175
176#endif /* !__ASSEMBLY__ */
177#endif /* _XTENSA_COPROCESSOR_H */
diff --git a/arch/xtensa/include/asm/cpumask.h b/arch/xtensa/include/asm/cpumask.h
new file mode 100644
index 000000000000..ebeede397db3
--- /dev/null
+++ b/arch/xtensa/include/asm/cpumask.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/cpumask.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CPUMASK_H
12#define _XTENSA_CPUMASK_H
13
14#include <asm-generic/cpumask.h>
15
16#endif /* _XTENSA_CPUMASK_H */
diff --git a/arch/xtensa/include/asm/cputime.h b/arch/xtensa/include/asm/cputime.h
new file mode 100644
index 000000000000..a7fb864a50ae
--- /dev/null
+++ b/arch/xtensa/include/asm/cputime.h
@@ -0,0 +1,6 @@
1#ifndef _XTENSA_CPUTIME_H
2#define _XTENSA_CPUTIME_H
3
4#include <asm-generic/cputime.h>
5
6#endif /* _XTENSA_CPUTIME_H */
diff --git a/arch/xtensa/include/asm/current.h b/arch/xtensa/include/asm/current.h
new file mode 100644
index 000000000000..8d1eb5d78649
--- /dev/null
+++ b/arch/xtensa/include/asm/current.h
@@ -0,0 +1,38 @@
1/*
2 * include/asm-xtensa/current.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CURRENT_H
12#define _XTENSA_CURRENT_H
13
14#ifndef __ASSEMBLY__
15
16#include <linux/thread_info.h>
17
18struct task_struct;
19
20static inline struct task_struct *get_current(void)
21{
22 return current_thread_info()->task;
23}
24
25#define current get_current()
26
27#else
28
29#define CURRENT_SHIFT 13
30
31#define GET_CURRENT(reg,sp) \
32 GET_THREAD_INFO(reg,sp); \
33 l32i reg, reg, TI_TASK \
34
35#endif
36
37
38#endif /* XTENSA_CURRENT_H */
diff --git a/arch/xtensa/include/asm/delay.h b/arch/xtensa/include/asm/delay.h
new file mode 100644
index 000000000000..e1d8c9e010c1
--- /dev/null
+++ b/arch/xtensa/include/asm/delay.h
@@ -0,0 +1,49 @@
1/*
2 * include/asm-xtensa/delay.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 *
10 */
11
12#ifndef _XTENSA_DELAY_H
13#define _XTENSA_DELAY_H
14
15#include <asm/processor.h>
16#include <asm/param.h>
17
18extern unsigned long loops_per_jiffy;
19
20static inline void __delay(unsigned long loops)
21{
22 /* 2 cycles per loop. */
23 __asm__ __volatile__ ("1: addi %0, %0, -2; bgeui %0, 2, 1b"
24 : "=r" (loops) : "0" (loops));
25}
26
27static __inline__ u32 xtensa_get_ccount(void)
28{
29 u32 ccount;
30 asm volatile ("rsr %0, 234; # CCOUNT\n" : "=r" (ccount));
31 return ccount;
32}
33
34/* For SMP/NUMA systems, change boot_cpu_data to something like
35 * local_cpu_data->... where local_cpu_data points to the current
36 * cpu. */
37
38static __inline__ void udelay (unsigned long usecs)
39{
40 unsigned long start = xtensa_get_ccount();
41 unsigned long cycles = usecs * (loops_per_jiffy / (1000000UL / HZ));
42
43 /* Note: all variables are unsigned (can wrap around)! */
44 while (((unsigned long)xtensa_get_ccount()) - start < cycles)
45 ;
46}
47
48#endif
49
diff --git a/arch/xtensa/include/asm/device.h b/arch/xtensa/include/asm/device.h
new file mode 100644
index 000000000000..d8f9872b0e2d
--- /dev/null
+++ b/arch/xtensa/include/asm/device.h
@@ -0,0 +1,7 @@
1/*
2 * Arch specific extensions to struct device
3 *
4 * This file is released under the GPLv2
5 */
6#include <asm-generic/device.h>
7
diff --git a/arch/xtensa/include/asm/div64.h b/arch/xtensa/include/asm/div64.h
new file mode 100644
index 000000000000..f35678cb0a9b
--- /dev/null
+++ b/arch/xtensa/include/asm/div64.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/div64.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2007 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_DIV64_H
12#define _XTENSA_DIV64_H
13
14#include <asm-generic/div64.h>
15
16#endif /* _XTENSA_DIV64_H */
diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/asm/dma-mapping.h
new file mode 100644
index 000000000000..51882ae3db4d
--- /dev/null
+++ b/arch/xtensa/include/asm/dma-mapping.h
@@ -0,0 +1,179 @@
1/*
2 * include/asm-xtensa/dma-mapping.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_DMA_MAPPING_H
12#define _XTENSA_DMA_MAPPING_H
13
14#include <asm/cache.h>
15#include <asm/io.h>
16#include <linux/mm.h>
17#include <linux/scatterlist.h>
18
19/*
20 * DMA-consistent mapping functions.
21 */
22
23extern void *consistent_alloc(int, size_t, dma_addr_t, unsigned long);
24extern void consistent_free(void*, size_t, dma_addr_t);
25extern void consistent_sync(void*, size_t, int);
26
27#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
28#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
29
30void *dma_alloc_coherent(struct device *dev, size_t size,
31 dma_addr_t *dma_handle, gfp_t flag);
32
33void dma_free_coherent(struct device *dev, size_t size,
34 void *vaddr, dma_addr_t dma_handle);
35
36static inline dma_addr_t
37dma_map_single(struct device *dev, void *ptr, size_t size,
38 enum dma_data_direction direction)
39{
40 BUG_ON(direction == DMA_NONE);
41 consistent_sync(ptr, size, direction);
42 return virt_to_phys(ptr);
43}
44
45static inline void
46dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
47 enum dma_data_direction direction)
48{
49 BUG_ON(direction == DMA_NONE);
50}
51
52static inline int
53dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
54 enum dma_data_direction direction)
55{
56 int i;
57
58 BUG_ON(direction == DMA_NONE);
59
60 for (i = 0; i < nents; i++, sg++ ) {
61 BUG_ON(!sg_page(sg));
62
63 sg->dma_address = sg_phys(sg);
64 consistent_sync(sg_virt(sg), sg->length, direction);
65 }
66
67 return nents;
68}
69
70static inline dma_addr_t
71dma_map_page(struct device *dev, struct page *page, unsigned long offset,
72 size_t size, enum dma_data_direction direction)
73{
74 BUG_ON(direction == DMA_NONE);
75 return (dma_addr_t)(page_to_pfn(page)) * PAGE_SIZE + offset;
76}
77
78static inline void
79dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
80 enum dma_data_direction direction)
81{
82 BUG_ON(direction == DMA_NONE);
83}
84
85
86static inline void
87dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries,
88 enum dma_data_direction direction)
89{
90 BUG_ON(direction == DMA_NONE);
91}
92
93static inline void
94dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size,
95 enum dma_data_direction direction)
96{
97 consistent_sync((void *)bus_to_virt(dma_handle), size, direction);
98}
99
100static inline void
101dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size,
102 enum dma_data_direction direction)
103{
104 consistent_sync((void *)bus_to_virt(dma_handle), size, direction);
105}
106
107static inline void
108dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle,
109 unsigned long offset, size_t size,
110 enum dma_data_direction direction)
111{
112
113 consistent_sync((void *)bus_to_virt(dma_handle)+offset,size,direction);
114}
115
116static inline void
117dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle,
118 unsigned long offset, size_t size,
119 enum dma_data_direction direction)
120{
121
122 consistent_sync((void *)bus_to_virt(dma_handle)+offset,size,direction);
123}
124static inline void
125dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
126 enum dma_data_direction dir)
127{
128 int i;
129 for (i = 0; i < nelems; i++, sg++)
130 consistent_sync(sg_virt(sg), sg->length, dir);
131}
132
133static inline void
134dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems,
135 enum dma_data_direction dir)
136{
137 int i;
138 for (i = 0; i < nelems; i++, sg++)
139 consistent_sync(sg_virt(sg), sg->length, dir);
140}
141static inline int
142dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
143{
144 return 0;
145}
146
147static inline int
148dma_supported(struct device *dev, u64 mask)
149{
150 return 1;
151}
152
153static inline int
154dma_set_mask(struct device *dev, u64 mask)
155{
156 if(!dev->dma_mask || !dma_supported(dev, mask))
157 return -EIO;
158
159 *dev->dma_mask = mask;
160
161 return 0;
162}
163
164static inline int
165dma_get_cache_alignment(void)
166{
167 return L1_CACHE_BYTES;
168}
169
170#define dma_is_consistent(d, h) (1)
171
172static inline void
173dma_cache_sync(struct device *dev, void *vaddr, size_t size,
174 enum dma_data_direction direction)
175{
176 consistent_sync(vaddr, size, direction);
177}
178
179#endif /* _XTENSA_DMA_MAPPING_H */
diff --git a/arch/xtensa/include/asm/dma.h b/arch/xtensa/include/asm/dma.h
new file mode 100644
index 000000000000..e30f3abf48f0
--- /dev/null
+++ b/arch/xtensa/include/asm/dma.h
@@ -0,0 +1,61 @@
1/*
2 * include/asm-xtensa/dma.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_DMA_H
12#define _XTENSA_DMA_H
13
14#include <asm/io.h> /* need byte IO */
15
16/*
17 * This is only to be defined if we have PC-like DMA.
18 * By default this is not true on an Xtensa processor,
19 * however on boards with a PCI bus, such functionality
20 * might be emulated externally.
21 *
22 * NOTE: there still exists driver code that assumes
23 * this is defined, eg. drivers/sound/soundcard.c (as of 2.4).
24 */
25#define MAX_DMA_CHANNELS 8
26
27/*
28 * The maximum virtual address to which DMA transfers
29 * can be performed on this platform.
30 *
31 * NOTE: This is board (platform) specific, not processor-specific!
32 *
33 * NOTE: This assumes DMA transfers can only be performed on
34 * the section of physical memory contiguously mapped in virtual
35 * space for the kernel. For the Xtensa architecture, this
36 * means the maximum possible size of this DMA area is
37 * the size of the statically mapped kernel segment
38 * (XCHAL_KSEG_{CACHED,BYPASS}_SIZE), ie. 128 MB.
39 *
40 * NOTE: When the entire KSEG area is DMA capable, we substract
41 * one from the max address so that the virt_to_phys() macro
42 * works correctly on the address (otherwise the address
43 * enters another area, and virt_to_phys() may not return
44 * the value desired).
45 */
46
47#define MAX_DMA_ADDRESS (PAGE_OFFSET + XCHAL_KIO_SIZE - 1)
48
49
50/* Reserve and release a DMA channel */
51extern int request_dma(unsigned int dmanr, const char * device_id);
52extern void free_dma(unsigned int dmanr);
53
54#ifdef CONFIG_PCI
55extern int isa_dma_bridge_buggy;
56#else
57#define isa_dma_bridge_buggy (0)
58#endif
59
60
61#endif
diff --git a/arch/xtensa/include/asm/elf.h b/arch/xtensa/include/asm/elf.h
new file mode 100644
index 000000000000..c3f53e755ca5
--- /dev/null
+++ b/arch/xtensa/include/asm/elf.h
@@ -0,0 +1,205 @@
1/*
2 * include/asm-xtensa/elf.h
3 *
4 * ELF register definitions
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_ELF_H
14#define _XTENSA_ELF_H
15
16#include <asm/ptrace.h>
17
18/* Xtensa processor ELF architecture-magic number */
19
20#define EM_XTENSA 94
21#define EM_XTENSA_OLD 0xABC7
22
23/* Xtensa relocations defined by the ABIs */
24
25#define R_XTENSA_NONE 0
26#define R_XTENSA_32 1
27#define R_XTENSA_RTLD 2
28#define R_XTENSA_GLOB_DAT 3
29#define R_XTENSA_JMP_SLOT 4
30#define R_XTENSA_RELATIVE 5
31#define R_XTENSA_PLT 6
32#define R_XTENSA_OP0 8
33#define R_XTENSA_OP1 9
34#define R_XTENSA_OP2 10
35#define R_XTENSA_ASM_EXPAND 11
36#define R_XTENSA_ASM_SIMPLIFY 12
37#define R_XTENSA_GNU_VTINHERIT 15
38#define R_XTENSA_GNU_VTENTRY 16
39#define R_XTENSA_DIFF8 17
40#define R_XTENSA_DIFF16 18
41#define R_XTENSA_DIFF32 19
42#define R_XTENSA_SLOT0_OP 20
43#define R_XTENSA_SLOT1_OP 21
44#define R_XTENSA_SLOT2_OP 22
45#define R_XTENSA_SLOT3_OP 23
46#define R_XTENSA_SLOT4_OP 24
47#define R_XTENSA_SLOT5_OP 25
48#define R_XTENSA_SLOT6_OP 26
49#define R_XTENSA_SLOT7_OP 27
50#define R_XTENSA_SLOT8_OP 28
51#define R_XTENSA_SLOT9_OP 29
52#define R_XTENSA_SLOT10_OP 30
53#define R_XTENSA_SLOT11_OP 31
54#define R_XTENSA_SLOT12_OP 32
55#define R_XTENSA_SLOT13_OP 33
56#define R_XTENSA_SLOT14_OP 34
57#define R_XTENSA_SLOT0_ALT 35
58#define R_XTENSA_SLOT1_ALT 36
59#define R_XTENSA_SLOT2_ALT 37
60#define R_XTENSA_SLOT3_ALT 38
61#define R_XTENSA_SLOT4_ALT 39
62#define R_XTENSA_SLOT5_ALT 40
63#define R_XTENSA_SLOT6_ALT 41
64#define R_XTENSA_SLOT7_ALT 42
65#define R_XTENSA_SLOT8_ALT 43
66#define R_XTENSA_SLOT9_ALT 44
67#define R_XTENSA_SLOT10_ALT 45
68#define R_XTENSA_SLOT11_ALT 46
69#define R_XTENSA_SLOT12_ALT 47
70#define R_XTENSA_SLOT13_ALT 48
71#define R_XTENSA_SLOT14_ALT 49
72
73/* ELF register definitions. This is needed for core dump support. */
74
75typedef unsigned long elf_greg_t;
76
77typedef struct {
78 elf_greg_t pc;
79 elf_greg_t ps;
80 elf_greg_t lbeg;
81 elf_greg_t lend;
82 elf_greg_t lcount;
83 elf_greg_t sar;
84 elf_greg_t windowstart;
85 elf_greg_t windowbase;
86 elf_greg_t reserved[8+48];
87 elf_greg_t a[64];
88} xtensa_gregset_t;
89
90#define ELF_NGREG (sizeof(xtensa_gregset_t) / sizeof(elf_greg_t))
91
92typedef elf_greg_t elf_gregset_t[ELF_NGREG];
93
94#define ELF_NFPREG 18
95
96typedef unsigned int elf_fpreg_t;
97typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
98
99#define ELF_CORE_COPY_REGS(_eregs, _pregs) \
100 xtensa_elf_core_copy_regs ((xtensa_gregset_t*)&(_eregs), _pregs);
101
102extern void xtensa_elf_core_copy_regs (xtensa_gregset_t *, struct pt_regs *);
103
104/*
105 * This is used to ensure we don't load something for the wrong architecture.
106 */
107
108#define elf_check_arch(x) ( ( (x)->e_machine == EM_XTENSA ) || \
109 ( (x)->e_machine == EM_XTENSA_OLD ) )
110
111/*
112 * These are used to set parameters in the core dumps.
113 */
114
115#ifdef __XTENSA_EL__
116# define ELF_DATA ELFDATA2LSB
117#elif defined(__XTENSA_EB__)
118# define ELF_DATA ELFDATA2MSB
119#else
120# error processor byte order undefined!
121#endif
122
123#define ELF_CLASS ELFCLASS32
124#define ELF_ARCH EM_XTENSA
125
126#define USE_ELF_CORE_DUMP
127#define ELF_EXEC_PAGESIZE PAGE_SIZE
128
129/*
130 * This is the location that an ET_DYN program is loaded if exec'ed. Typical
131 * use of this is to invoke "./ld.so someprog" to test out a new version of
132 * the loader. We need to make sure that it is out of the way of the program
133 * that it will "exec", and that there is sufficient room for the brk.
134 */
135
136#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
137
138/*
139 * This yields a mask that user programs can use to figure out what
140 * instruction set this CPU supports. This could be done in user space,
141 * but it's not easy, and we've already done it here.
142 */
143
144#define ELF_HWCAP (0)
145
146/*
147 * This yields a string that ld.so will use to load implementation
148 * specific libraries for optimization. This is more specific in
149 * intent than poking at uname or /proc/cpuinfo.
150 * For the moment, we have only optimizations for the Intel generations,
151 * but that could change...
152 */
153
154#define ELF_PLATFORM (NULL)
155
156/*
157 * The Xtensa processor ABI says that when the program starts, a2
158 * contains a pointer to a function which might be registered using
159 * `atexit'. This provides a mean for the dynamic linker to call
160 * DT_FINI functions for shared libraries that have been loaded before
161 * the code runs.
162 *
163 * A value of 0 tells we have no such handler.
164 *
165 * We might as well make sure everything else is cleared too (except
166 * for the stack pointer in a1), just to make things more
167 * deterministic. Also, clearing a0 terminates debugger backtraces.
168 */
169
170#define ELF_PLAT_INIT(_r, load_addr) \
171 do { _r->areg[0]=0; /*_r->areg[1]=0;*/ _r->areg[2]=0; _r->areg[3]=0; \
172 _r->areg[4]=0; _r->areg[5]=0; _r->areg[6]=0; _r->areg[7]=0; \
173 _r->areg[8]=0; _r->areg[9]=0; _r->areg[10]=0; _r->areg[11]=0; \
174 _r->areg[12]=0; _r->areg[13]=0; _r->areg[14]=0; _r->areg[15]=0; \
175 } while (0)
176
177typedef struct {
178 xtregs_opt_t opt;
179 xtregs_user_t user;
180#if XTENSA_HAVE_COPROCESSORS
181 xtregs_cp0_t cp0;
182 xtregs_cp1_t cp1;
183 xtregs_cp2_t cp2;
184 xtregs_cp3_t cp3;
185 xtregs_cp4_t cp4;
186 xtregs_cp5_t cp5;
187 xtregs_cp6_t cp6;
188 xtregs_cp7_t cp7;
189#endif
190} elf_xtregs_t;
191
192#define SET_PERSONALITY(ex) set_personality(PER_LINUX_32BIT)
193
194struct task_struct;
195
196extern void do_copy_regs (xtensa_gregset_t*, struct pt_regs*,
197 struct task_struct*);
198extern void do_restore_regs (xtensa_gregset_t*, struct pt_regs*,
199 struct task_struct*);
200extern void do_save_fpregs (elf_fpregset_t*, struct pt_regs*,
201 struct task_struct*);
202extern int do_restore_fpregs (elf_fpregset_t*, struct pt_regs*,
203 struct task_struct*);
204
205#endif /* _XTENSA_ELF_H */
diff --git a/arch/xtensa/include/asm/emergency-restart.h b/arch/xtensa/include/asm/emergency-restart.h
new file mode 100644
index 000000000000..108d8c48e42e
--- /dev/null
+++ b/arch/xtensa/include/asm/emergency-restart.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_EMERGENCY_RESTART_H
2#define _ASM_EMERGENCY_RESTART_H
3
4#include <asm-generic/emergency-restart.h>
5
6#endif /* _ASM_EMERGENCY_RESTART_H */
diff --git a/arch/xtensa/include/asm/errno.h b/arch/xtensa/include/asm/errno.h
new file mode 100644
index 000000000000..a0f3b96b79b4
--- /dev/null
+++ b/arch/xtensa/include/asm/errno.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/errno.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2002 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_ERRNO_H
12#define _XTENSA_ERRNO_H
13
14#include <asm-generic/errno.h>
15
16#endif /* _XTENSA_ERRNO_H */
diff --git a/arch/xtensa/include/asm/fb.h b/arch/xtensa/include/asm/fb.h
new file mode 100644
index 000000000000..c7df38030992
--- /dev/null
+++ b/arch/xtensa/include/asm/fb.h
@@ -0,0 +1,12 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/arch/xtensa/include/asm/fcntl.h b/arch/xtensa/include/asm/fcntl.h
new file mode 100644
index 000000000000..46ab12db5739
--- /dev/null
+++ b/arch/xtensa/include/asm/fcntl.h
@@ -0,0 +1 @@
#include <asm-generic/fcntl.h>
diff --git a/arch/xtensa/include/asm/futex.h b/arch/xtensa/include/asm/futex.h
new file mode 100644
index 000000000000..0b745828f42b
--- /dev/null
+++ b/arch/xtensa/include/asm/futex.h
@@ -0,0 +1 @@
#include <asm-generic/futex.h>
diff --git a/arch/xtensa/include/asm/hardirq.h b/arch/xtensa/include/asm/hardirq.h
new file mode 100644
index 000000000000..87cb19d1b10c
--- /dev/null
+++ b/arch/xtensa/include/asm/hardirq.h
@@ -0,0 +1,28 @@
1/*
2 * include/asm-xtensa/hardirq.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2002 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_HARDIRQ_H
12#define _XTENSA_HARDIRQ_H
13
14#include <linux/cache.h>
15#include <asm/irq.h>
16
17/* headers.S is sensitive to the offsets of these fields */
18typedef struct {
19 unsigned int __softirq_pending;
20 unsigned int __syscall_count;
21 struct task_struct * __ksoftirqd_task; /* waitqueue is too large */
22 unsigned int __nmi_count; /* arch dependent */
23} ____cacheline_aligned irq_cpustat_t;
24
25void ack_bad_irq(unsigned int irq);
26#include <linux/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */
27
28#endif /* _XTENSA_HARDIRQ_H */
diff --git a/arch/xtensa/include/asm/highmem.h b/arch/xtensa/include/asm/highmem.h
new file mode 100644
index 000000000000..0a046ca5a687
--- /dev/null
+++ b/arch/xtensa/include/asm/highmem.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-xtensa/highmem.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_HIGHMEM_H
12#define _XTENSA_HIGHMEM_H
13
14extern void flush_cache_kmaps(void);
15
16#endif
17
diff --git a/arch/xtensa/include/asm/hw_irq.h b/arch/xtensa/include/asm/hw_irq.h
new file mode 100644
index 000000000000..3ddbea759b2b
--- /dev/null
+++ b/arch/xtensa/include/asm/hw_irq.h
@@ -0,0 +1,14 @@
1/*
2 * include/asm-xtensa/hw_irq.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2002 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_HW_IRQ_H
12#define _XTENSA_HW_IRQ_H
13
14#endif
diff --git a/arch/xtensa/include/asm/io.h b/arch/xtensa/include/asm/io.h
new file mode 100644
index 000000000000..07b7299dab20
--- /dev/null
+++ b/arch/xtensa/include/asm/io.h
@@ -0,0 +1,200 @@
1/*
2 * include/asm-xtensa/io.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_IO_H
12#define _XTENSA_IO_H
13
14#ifdef __KERNEL__
15#include <asm/byteorder.h>
16#include <asm/page.h>
17#include <linux/kernel.h>
18
19#include <linux/types.h>
20
21#define XCHAL_KIO_CACHED_VADDR 0xe0000000
22#define XCHAL_KIO_BYPASS_VADDR 0xf0000000
23#define XCHAL_KIO_PADDR 0xf0000000
24#define XCHAL_KIO_SIZE 0x10000000
25
26#define IOADDR(x) (XCHAL_KIO_BYPASS_VADDR + (x))
27
28/*
29 * swap functions to change byte order from little-endian to big-endian and
30 * vice versa.
31 */
32
33static inline unsigned short _swapw (unsigned short v)
34{
35 return (v << 8) | (v >> 8);
36}
37
38static inline unsigned int _swapl (unsigned int v)
39{
40 return (v << 24) | ((v & 0xff00) << 8) | ((v >> 8) & 0xff00) | (v >> 24);
41}
42
43/*
44 * Change virtual addresses to physical addresses and vv.
45 * These are trivial on the 1:1 Linux/Xtensa mapping
46 */
47
48static inline unsigned long virt_to_phys(volatile void * address)
49{
50 return __pa(address);
51}
52
53static inline void * phys_to_virt(unsigned long address)
54{
55 return __va(address);
56}
57
58/*
59 * virt_to_bus and bus_to_virt are deprecated.
60 */
61
62#define virt_to_bus(x) virt_to_phys(x)
63#define bus_to_virt(x) phys_to_virt(x)
64
65/*
66 * Return the virtual (cached) address for the specified bus memory.
67 * Note that we currently don't support any address outside the KIO segment.
68 */
69
70static inline void *ioremap(unsigned long offset, unsigned long size)
71{
72 if (offset >= XCHAL_KIO_PADDR
73 && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE)
74 return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_BYPASS_VADDR);
75
76 else
77 BUG();
78}
79
80static inline void *ioremap_nocache(unsigned long offset, unsigned long size)
81{
82 if (offset >= XCHAL_KIO_PADDR
83 && offset < XCHAL_KIO_PADDR + XCHAL_KIO_SIZE)
84 return (void*)(offset-XCHAL_KIO_PADDR+XCHAL_KIO_CACHED_VADDR);
85 else
86 BUG();
87}
88
89static inline void iounmap(void *addr)
90{
91}
92
93/*
94 * Generic I/O
95 */
96
97#define readb(addr) \
98 ({ unsigned char __v = (*(volatile unsigned char *)(addr)); __v; })
99#define readw(addr) \
100 ({ unsigned short __v = (*(volatile unsigned short *)(addr)); __v; })
101#define readl(addr) \
102 ({ unsigned int __v = (*(volatile unsigned int *)(addr)); __v; })
103#define writeb(b, addr) (void)((*(volatile unsigned char *)(addr)) = (b))
104#define writew(b, addr) (void)((*(volatile unsigned short *)(addr)) = (b))
105#define writel(b, addr) (void)((*(volatile unsigned int *)(addr)) = (b))
106
107static inline __u8 __raw_readb(const volatile void __iomem *addr)
108{
109 return *(__force volatile __u8 *)(addr);
110}
111static inline __u16 __raw_readw(const volatile void __iomem *addr)
112{
113 return *(__force volatile __u16 *)(addr);
114}
115static inline __u32 __raw_readl(const volatile void __iomem *addr)
116{
117 return *(__force volatile __u32 *)(addr);
118}
119static inline void __raw_writeb(__u8 b, volatile void __iomem *addr)
120{
121 *(__force volatile __u8 *)(addr) = b;
122}
123static inline void __raw_writew(__u16 b, volatile void __iomem *addr)
124{
125 *(__force volatile __u16 *)(addr) = b;
126}
127static inline void __raw_writel(__u32 b, volatile void __iomem *addr)
128{
129 *(__force volatile __u32 *)(addr) = b;
130}
131
132/* These are the definitions for the x86 IO instructions
133 * inb/inw/inl/outb/outw/outl, the "string" versions
134 * insb/insw/insl/outsb/outsw/outsl, and the "pausing" versions
135 * inb_p/inw_p/...
136 * The macros don't do byte-swapping.
137 */
138
139#define inb(port) readb((u8 *)((port)))
140#define outb(val, port) writeb((val),(u8 *)((unsigned long)(port)))
141#define inw(port) readw((u16 *)((port)))
142#define outw(val, port) writew((val),(u16 *)((unsigned long)(port)))
143#define inl(port) readl((u32 *)((port)))
144#define outl(val, port) writel((val),(u32 *)((unsigned long)(port)))
145
146#define inb_p(port) inb((port))
147#define outb_p(val, port) outb((val), (port))
148#define inw_p(port) inw((port))
149#define outw_p(val, port) outw((val), (port))
150#define inl_p(port) inl((port))
151#define outl_p(val, port) outl((val), (port))
152
153extern void insb (unsigned long port, void *dst, unsigned long count);
154extern void insw (unsigned long port, void *dst, unsigned long count);
155extern void insl (unsigned long port, void *dst, unsigned long count);
156extern void outsb (unsigned long port, const void *src, unsigned long count);
157extern void outsw (unsigned long port, const void *src, unsigned long count);
158extern void outsl (unsigned long port, const void *src, unsigned long count);
159
160#define IO_SPACE_LIMIT ~0
161
162#define memset_io(a,b,c) memset((void *)(a),(b),(c))
163#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
164#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
165
166/* At this point the Xtensa doesn't provide byte swap instructions */
167
168#ifdef __XTENSA_EB__
169# define in_8(addr) (*(u8*)(addr))
170# define in_le16(addr) _swapw(*(u16*)(addr))
171# define in_le32(addr) _swapl(*(u32*)(addr))
172# define out_8(b, addr) *(u8*)(addr) = (b)
173# define out_le16(b, addr) *(u16*)(addr) = _swapw(b)
174# define out_le32(b, addr) *(u32*)(addr) = _swapl(b)
175#elif defined(__XTENSA_EL__)
176# define in_8(addr) (*(u8*)(addr))
177# define in_le16(addr) (*(u16*)(addr))
178# define in_le32(addr) (*(u32*)(addr))
179# define out_8(b, addr) *(u8*)(addr) = (b)
180# define out_le16(b, addr) *(u16*)(addr) = (b)
181# define out_le32(b, addr) *(u32*)(addr) = (b)
182#else
183# error processor byte order undefined!
184#endif
185
186
187/*
188 * Convert a physical pointer to a virtual kernel pointer for /dev/mem access
189 */
190#define xlate_dev_mem_ptr(p) __va(p)
191
192/*
193 * Convert a virtual cached pointer to an uncached pointer
194 */
195#define xlate_dev_kmem_ptr(p) p
196
197
198#endif /* __KERNEL__ */
199
200#endif /* _XTENSA_IO_H */
diff --git a/arch/xtensa/include/asm/ioctl.h b/arch/xtensa/include/asm/ioctl.h
new file mode 100644
index 000000000000..b279fe06dfe5
--- /dev/null
+++ b/arch/xtensa/include/asm/ioctl.h
@@ -0,0 +1 @@
#include <asm-generic/ioctl.h>
diff --git a/arch/xtensa/include/asm/ioctls.h b/arch/xtensa/include/asm/ioctls.h
new file mode 100644
index 000000000000..0ffa942954b9
--- /dev/null
+++ b/arch/xtensa/include/asm/ioctls.h
@@ -0,0 +1,116 @@
1/*
2 * include/asm-xtensa/ioctls.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2003 - 2005 Tensilica Inc.
9 *
10 * Derived from "include/asm-i386/ioctls.h"
11 */
12
13#ifndef _XTENSA_IOCTLS_H
14#define _XTENSA_IOCTLS_H
15
16#include <asm/ioctl.h>
17
18#define FIOCLEX _IO('f', 1)
19#define FIONCLEX _IO('f', 2)
20#define FIOASYNC _IOW('f', 125, int)
21#define FIONBIO _IOW('f', 126, int)
22#define FIONREAD _IOR('f', 127, int)
23#define TIOCINQ FIONREAD
24#define FIOQSIZE _IOR('f', 128, loff_t)
25
26#define TCGETS 0x5401
27#define TCSETS 0x5402
28#define TCSETSW 0x5403
29#define TCSETSF 0x5404
30
31#define TCGETA _IOR('t', 23, struct termio)
32#define TCSETA _IOW('t', 24, struct termio)
33#define TCSETAW _IOW('t', 25, struct termio)
34#define TCSETAF _IOW('t', 28, struct termio)
35
36#define TCSBRK _IO('t', 29)
37#define TCXONC _IO('t', 30)
38#define TCFLSH _IO('t', 31)
39
40#define TIOCSWINSZ _IOW('t', 103, struct winsize)
41#define TIOCGWINSZ _IOR('t', 104, struct winsize)
42#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
43#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
44#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
45
46#define TIOCSPGRP _IOW('t', 118, int)
47#define TIOCGPGRP _IOR('t', 119, int)
48
49#define TIOCEXCL _IO('T', 12)
50#define TIOCNXCL _IO('T', 13)
51#define TIOCSCTTY _IO('T', 14)
52
53#define TIOCSTI _IOW('T', 18, char)
54#define TIOCMGET _IOR('T', 21, unsigned int)
55#define TIOCMBIS _IOW('T', 22, unsigned int)
56#define TIOCMBIC _IOW('T', 23, unsigned int)
57#define TIOCMSET _IOW('T', 24, unsigned int)
58# define TIOCM_LE 0x001
59# define TIOCM_DTR 0x002
60# define TIOCM_RTS 0x004
61# define TIOCM_ST 0x008
62# define TIOCM_SR 0x010
63# define TIOCM_CTS 0x020
64# define TIOCM_CAR 0x040
65# define TIOCM_RNG 0x080
66# define TIOCM_DSR 0x100
67# define TIOCM_CD TIOCM_CAR
68# define TIOCM_RI TIOCM_RNG
69
70#define TIOCGSOFTCAR _IOR('T', 25, unsigned int)
71#define TIOCSSOFTCAR _IOW('T', 26, unsigned int)
72#define TIOCLINUX _IOW('T', 28, char)
73#define TIOCCONS _IO('T', 29)
74#define TIOCGSERIAL _IOR('T', 30, struct serial_struct)
75#define TIOCSSERIAL _IOW('T', 31, struct serial_struct)
76#define TIOCPKT _IOW('T', 32, int)
77# define TIOCPKT_DATA 0
78# define TIOCPKT_FLUSHREAD 1
79# define TIOCPKT_FLUSHWRITE 2
80# define TIOCPKT_STOP 4
81# define TIOCPKT_START 8
82# define TIOCPKT_NOSTOP 16
83# define TIOCPKT_DOSTOP 32
84
85
86#define TIOCNOTTY _IO('T', 34)
87#define TIOCSETD _IOW('T', 35, int)
88#define TIOCGETD _IOR('T', 36, int)
89#define TCSBRKP _IOW('T', 37, int) /* Needed for POSIX tcsendbreak()*/
90#define TIOCTTYGSTRUCT _IOR('T', 38, struct tty_struct) /* For debugging only*/
91#define TIOCSBRK _IO('T', 39) /* BSD compatibility */
92#define TIOCCBRK _IO('T', 40) /* BSD compatibility */
93#define TIOCGSID _IOR('T', 41, pid_t) /* Return the session ID of FD*/
94#define TCGETS2 _IOR('T', 42, struct termios2)
95#define TCSETS2 _IOW('T', 43, struct termios2)
96#define TCSETSW2 _IOW('T', 44, struct termios2)
97#define TCSETSF2 _IOW('T', 45, struct termios2)
98#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
99#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
100
101#define TIOCSERCONFIG _IO('T', 83)
102#define TIOCSERGWILD _IOR('T', 84, int)
103#define TIOCSERSWILD _IOW('T', 85, int)
104#define TIOCGLCKTRMIOS 0x5456
105#define TIOCSLCKTRMIOS 0x5457
106#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
107#define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* Get line status reg. */
108 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
109# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
110#define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* Get multiport config */
111#define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* Set multiport config */
112
113#define TIOCMIWAIT _IO('T', 92) /* wait for a change on serial input line(s) */
114#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
115
116#endif /* _XTENSA_IOCTLS_H */
diff --git a/arch/xtensa/include/asm/ipcbuf.h b/arch/xtensa/include/asm/ipcbuf.h
new file mode 100644
index 000000000000..c33aa6a42145
--- /dev/null
+++ b/arch/xtensa/include/asm/ipcbuf.h
@@ -0,0 +1,37 @@
1/*
2 * include/asm-xtensa/ipcbuf.h
3 *
4 * The ipc64_perm structure for the Xtensa architecture.
5 * Note extra padding because this structure is passed back and forth
6 * between kernel and user space.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_IPCBUF_H
12#define _XTENSA_IPCBUF_H
13
14/*
15 * Pad space is left for:
16 * - 32-bit mode_t and seq
17 * - 2 miscellaneous 32-bit values
18 *
19 * This file is subject to the terms and conditions of the GNU General
20 * Public License. See the file "COPYING" in the main directory of
21 * this archive for more details.
22 */
23
24struct ipc64_perm
25{
26 __kernel_key_t key;
27 __kernel_uid32_t uid;
28 __kernel_gid32_t gid;
29 __kernel_uid32_t cuid;
30 __kernel_gid32_t cgid;
31 __kernel_mode_t mode;
32 unsigned long seq;
33 unsigned long __unused1;
34 unsigned long __unused2;
35};
36
37#endif /* _XTENSA_IPCBUF_H */
diff --git a/arch/xtensa/include/asm/irq.h b/arch/xtensa/include/asm/irq.h
new file mode 100644
index 000000000000..1620d1e0e695
--- /dev/null
+++ b/arch/xtensa/include/asm/irq.h
@@ -0,0 +1,30 @@
1/*
2 * include/asm-xtensa/irq.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_IRQ_H
12#define _XTENSA_IRQ_H
13
14#include <platform/hardware.h>
15#include <variant/core.h>
16
17#ifndef PLATFORM_NR_IRQS
18# define PLATFORM_NR_IRQS 0
19#endif
20#define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS
21#define NR_IRQS (XTENSA_NR_IRQS + PLATFORM_NR_IRQS)
22
23static __inline__ int irq_canonicalize(int irq)
24{
25 return (irq);
26}
27
28struct irqaction;
29
30#endif /* _XTENSA_IRQ_H */
diff --git a/arch/xtensa/include/asm/irq_regs.h b/arch/xtensa/include/asm/irq_regs.h
new file mode 100644
index 000000000000..3dd9c0b70270
--- /dev/null
+++ b/arch/xtensa/include/asm/irq_regs.h
@@ -0,0 +1 @@
#include <asm-generic/irq_regs.h>
diff --git a/arch/xtensa/include/asm/kdebug.h b/arch/xtensa/include/asm/kdebug.h
new file mode 100644
index 000000000000..6ece1b037665
--- /dev/null
+++ b/arch/xtensa/include/asm/kdebug.h
@@ -0,0 +1 @@
#include <asm-generic/kdebug.h>
diff --git a/arch/xtensa/include/asm/kmap_types.h b/arch/xtensa/include/asm/kmap_types.h
new file mode 100644
index 000000000000..9e822d2e3bce
--- /dev/null
+++ b/arch/xtensa/include/asm/kmap_types.h
@@ -0,0 +1,31 @@
1/*
2 * include/asm-xtensa/kmap_types.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_KMAP_TYPES_H
12#define _XTENSA_KMAP_TYPES_H
13
14enum km_type {
15 KM_BOUNCE_READ,
16 KM_SKB_SUNRPC_DATA,
17 KM_SKB_DATA_SOFTIRQ,
18 KM_USER0,
19 KM_USER1,
20 KM_BIO_SRC_IRQ,
21 KM_BIO_DST_IRQ,
22 KM_PTE0,
23 KM_PTE1,
24 KM_IRQ0,
25 KM_IRQ1,
26 KM_SOFTIRQ0,
27 KM_SOFTIRQ1,
28 KM_TYPE_NR
29};
30
31#endif /* _XTENSA_KMAP_TYPES_H */
diff --git a/arch/xtensa/include/asm/linkage.h b/arch/xtensa/include/asm/linkage.h
new file mode 100644
index 000000000000..bf2128a99d79
--- /dev/null
+++ b/arch/xtensa/include/asm/linkage.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/linkage.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_LINKAGE_H
12#define _XTENSA_LINKAGE_H
13
14/* Nothing to do here ... */
15
16#endif /* _XTENSA_LINKAGE_H */
diff --git a/arch/xtensa/include/asm/local.h b/arch/xtensa/include/asm/local.h
new file mode 100644
index 000000000000..48723e550d14
--- /dev/null
+++ b/arch/xtensa/include/asm/local.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/local.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_LOCAL_H
12#define _XTENSA_LOCAL_H
13
14#include <asm-generic/local.h>
15
16#endif /* _XTENSA_LOCAL_H */
diff --git a/arch/xtensa/include/asm/mman.h b/arch/xtensa/include/asm/mman.h
new file mode 100644
index 000000000000..9b92620c8a1e
--- /dev/null
+++ b/arch/xtensa/include/asm/mman.h
@@ -0,0 +1,84 @@
1/*
2 * include/asm-xtensa/mman.h
3 *
4 * Xtensa Processor memory-manager definitions
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1995 by Ralf Baechle
11 * Copyright (C) 2001 - 2005 Tensilica Inc.
12 */
13
14#ifndef _XTENSA_MMAN_H
15#define _XTENSA_MMAN_H
16
17/*
18 * Protections are chosen from these bits, OR'd together. The
19 * implementation does not necessarily support PROT_EXEC or PROT_WRITE
20 * without PROT_READ. The only guarantees are that no writing will be
21 * allowed without PROT_WRITE and no access will be allowed for PROT_NONE.
22 */
23
24#define PROT_NONE 0x0 /* page can not be accessed */
25#define PROT_READ 0x1 /* page can be read */
26#define PROT_WRITE 0x2 /* page can be written */
27#define PROT_EXEC 0x4 /* page can be executed */
28
29#define PROT_SEM 0x10 /* page may be used for atomic ops */
30#define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
31#define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end fo growsup vma */
32
33/*
34 * Flags for mmap
35 */
36#define MAP_SHARED 0x001 /* Share changes */
37#define MAP_PRIVATE 0x002 /* Changes are private */
38#define MAP_TYPE 0x00f /* Mask for type of mapping */
39#define MAP_FIXED 0x010 /* Interpret addr exactly */
40
41/* not used by linux, but here to make sure we don't clash with ABI defines */
42#define MAP_RENAME 0x020 /* Assign page to file */
43#define MAP_AUTOGROW 0x040 /* File may grow by writing */
44#define MAP_LOCAL 0x080 /* Copy on fork/sproc */
45#define MAP_AUTORSRV 0x100 /* Logical swap reserved on demand */
46
47/* These are linux-specific */
48#define MAP_NORESERVE 0x0400 /* don't check for reservations */
49#define MAP_ANONYMOUS 0x0800 /* don't use a file */
50#define MAP_GROWSDOWN 0x1000 /* stack-like segment */
51#define MAP_DENYWRITE 0x2000 /* ETXTBSY */
52#define MAP_EXECUTABLE 0x4000 /* mark it as an executable */
53#define MAP_LOCKED 0x8000 /* pages are locked */
54#define MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
55#define MAP_NONBLOCK 0x20000 /* do not block on IO */
56
57/*
58 * Flags for msync
59 */
60#define MS_ASYNC 0x0001 /* sync memory asynchronously */
61#define MS_INVALIDATE 0x0002 /* invalidate mappings & caches */
62#define MS_SYNC 0x0004 /* synchronous memory sync */
63
64/*
65 * Flags for mlockall
66 */
67#define MCL_CURRENT 1 /* lock all current mappings */
68#define MCL_FUTURE 2 /* lock all future mappings */
69
70#define MADV_NORMAL 0 /* no further special treatment */
71#define MADV_RANDOM 1 /* expect random page references */
72#define MADV_SEQUENTIAL 2 /* expect sequential page references */
73#define MADV_WILLNEED 3 /* will need these pages */
74#define MADV_DONTNEED 4 /* don't need these pages */
75
76/* common parameters: try to keep these consistent across architectures */
77#define MADV_REMOVE 9 /* remove these pages & resources */
78#define MADV_DONTFORK 10 /* don't inherit across fork */
79#define MADV_DOFORK 11 /* do inherit across fork */
80
81/* compatibility flags */
82#define MAP_FILE 0
83
84#endif /* _XTENSA_MMAN_H */
diff --git a/arch/xtensa/include/asm/mmu.h b/arch/xtensa/include/asm/mmu.h
new file mode 100644
index 000000000000..44c5bb04c55c
--- /dev/null
+++ b/arch/xtensa/include/asm/mmu.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-xtensa/mmu.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_MMU_H
12#define _XTENSA_MMU_H
13
14/* Default "unsigned long" context */
15typedef unsigned long mm_context_t;
16
17#endif /* _XTENSA_MMU_H */
diff --git a/arch/xtensa/include/asm/mmu_context.h b/arch/xtensa/include/asm/mmu_context.h
new file mode 100644
index 000000000000..c0fd8e5b4513
--- /dev/null
+++ b/arch/xtensa/include/asm/mmu_context.h
@@ -0,0 +1,136 @@
1/*
2 * include/asm-xtensa/mmu_context.h
3 *
4 * Switch an MMU context.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_MMU_CONTEXT_H
14#define _XTENSA_MMU_CONTEXT_H
15
16#include <linux/stringify.h>
17#include <linux/sched.h>
18
19#include <asm/pgtable.h>
20#include <asm/cacheflush.h>
21#include <asm/tlbflush.h>
22#include <asm-generic/mm_hooks.h>
23
24#define XCHAL_MMU_ASID_BITS 8
25
26#if (XCHAL_HAVE_TLBS != 1)
27# error "Linux must have an MMU!"
28#endif
29
30extern unsigned long asid_cache;
31
32/*
33 * NO_CONTEXT is the invalid ASID value that we don't ever assign to
34 * any user or kernel context.
35 *
36 * 0 invalid
37 * 1 kernel
38 * 2 reserved
39 * 3 reserved
40 * 4...255 available
41 */
42
43#define NO_CONTEXT 0
44#define ASID_USER_FIRST 4
45#define ASID_MASK ((1 << XCHAL_MMU_ASID_BITS) - 1)
46#define ASID_INSERT(x) (0x03020001 | (((x) & ASID_MASK) << 8))
47
48static inline void set_rasid_register (unsigned long val)
49{
50 __asm__ __volatile__ (" wsr %0, "__stringify(RASID)"\n\t"
51 " isync\n" : : "a" (val));
52}
53
54static inline unsigned long get_rasid_register (void)
55{
56 unsigned long tmp;
57 __asm__ __volatile__ (" rsr %0,"__stringify(RASID)"\n\t" : "=a" (tmp));
58 return tmp;
59}
60
61static inline void
62__get_new_mmu_context(struct mm_struct *mm)
63{
64 extern void flush_tlb_all(void);
65 if (! (++asid_cache & ASID_MASK) ) {
66 flush_tlb_all(); /* start new asid cycle */
67 asid_cache += ASID_USER_FIRST;
68 }
69 mm->context = asid_cache;
70}
71
72static inline void
73__load_mmu_context(struct mm_struct *mm)
74{
75 set_rasid_register(ASID_INSERT(mm->context));
76 invalidate_page_directory();
77}
78
79/*
80 * Initialize the context related info for a new mm_struct
81 * instance.
82 */
83
84static inline int
85init_new_context(struct task_struct *tsk, struct mm_struct *mm)
86{
87 mm->context = NO_CONTEXT;
88 return 0;
89}
90
91/*
92 * After we have set current->mm to a new value, this activates
93 * the context for the new mm so we see the new mappings.
94 */
95static inline void
96activate_mm(struct mm_struct *prev, struct mm_struct *next)
97{
98 /* Unconditionally get a new ASID. */
99
100 __get_new_mmu_context(next);
101 __load_mmu_context(next);
102}
103
104
105static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
106 struct task_struct *tsk)
107{
108 unsigned long asid = asid_cache;
109
110 /* Check if our ASID is of an older version and thus invalid */
111
112 if (next->context == NO_CONTEXT || ((next->context^asid) & ~ASID_MASK))
113 __get_new_mmu_context(next);
114
115 __load_mmu_context(next);
116}
117
118#define deactivate_mm(tsk, mm) do { } while(0)
119
120/*
121 * Destroy context related info for an mm_struct that is about
122 * to be put to rest.
123 */
124static inline void destroy_context(struct mm_struct *mm)
125{
126 invalidate_page_directory();
127}
128
129
130static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
131{
132 /* Nothing to do. */
133
134}
135
136#endif /* _XTENSA_MMU_CONTEXT_H */
diff --git a/arch/xtensa/include/asm/module.h b/arch/xtensa/include/asm/module.h
new file mode 100644
index 000000000000..d9b34bee4d42
--- /dev/null
+++ b/arch/xtensa/include/asm/module.h
@@ -0,0 +1,27 @@
1/*
2 * include/asm-xtensa/module.h
3 *
4 * This file contains the module code specific to the Xtensa architecture.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_MODULE_H
14#define _XTENSA_MODULE_H
15
16struct mod_arch_specific
17{
18 /* No special elements, yet. */
19};
20
21#define MODULE_ARCH_VERMAGIC "xtensa-" __stringify(XCHAL_CORE_ID) " "
22
23#define Elf_Shdr Elf32_Shdr
24#define Elf_Sym Elf32_Sym
25#define Elf_Ehdr Elf32_Ehdr
26
27#endif /* _XTENSA_MODULE_H */
diff --git a/arch/xtensa/include/asm/msgbuf.h b/arch/xtensa/include/asm/msgbuf.h
new file mode 100644
index 000000000000..693c96755280
--- /dev/null
+++ b/arch/xtensa/include/asm/msgbuf.h
@@ -0,0 +1,48 @@
1/*
2 * include/asm-xtensa/msgbuf.h
3 *
4 * The msqid64_ds structure for the Xtensa architecture.
5 * Note extra padding because this structure is passed back and forth
6 * between kernel and user space.
7 *
8 * Pad space is left for:
9 * - 64-bit time_t to solve y2038 problem
10 * - 2 miscellaneous 32-bit values
11 *
12 * This file is subject to the terms and conditions of the GNU General
13 * Public License. See the file "COPYING" in the main directory of
14 * this archive for more details.
15 */
16
17#ifndef _XTENSA_MSGBUF_H
18#define _XTENSA_MSGBUF_H
19
20struct msqid64_ds {
21 struct ipc64_perm msg_perm;
22#ifdef __XTENSA_EB__
23 unsigned int __unused1;
24 __kernel_time_t msg_stime; /* last msgsnd time */
25 unsigned int __unused2;
26 __kernel_time_t msg_rtime; /* last msgrcv time */
27 unsigned int __unused3;
28 __kernel_time_t msg_ctime; /* last change time */
29#elif defined(__XTENSA_EL__)
30 __kernel_time_t msg_stime; /* last msgsnd time */
31 unsigned int __unused1;
32 __kernel_time_t msg_rtime; /* last msgrcv time */
33 unsigned int __unused2;
34 __kernel_time_t msg_ctime; /* last change time */
35 unsigned int __unused3;
36#else
37# error processor byte order undefined!
38#endif
39 unsigned long msg_cbytes; /* current number of bytes on queue */
40 unsigned long msg_qnum; /* number of messages in queue */
41 unsigned long msg_qbytes; /* max number of bytes on queue */
42 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
43 __kernel_pid_t msg_lrpid; /* last receive pid */
44 unsigned long __unused4;
45 unsigned long __unused5;
46};
47
48#endif /* _XTENSA_MSGBUF_H */
diff --git a/arch/xtensa/include/asm/mutex.h b/arch/xtensa/include/asm/mutex.h
new file mode 100644
index 000000000000..458c1f7fbc18
--- /dev/null
+++ b/arch/xtensa/include/asm/mutex.h
@@ -0,0 +1,9 @@
1/*
2 * Pull in the generic implementation for the mutex fastpath.
3 *
4 * TODO: implement optimized primitives instead, or leave the generic
5 * implementation in place, or pick the atomic_xchg() based generic
6 * implementation. (see asm-generic/mutex-xchg.h for details)
7 */
8
9#include <asm-generic/mutex-dec.h>
diff --git a/arch/xtensa/include/asm/page.h b/arch/xtensa/include/asm/page.h
new file mode 100644
index 000000000000..11f7dc2dbec7
--- /dev/null
+++ b/arch/xtensa/include/asm/page.h
@@ -0,0 +1,174 @@
1/*
2 * include/asm-xtensa/page.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (C) 2001 - 2007 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PAGE_H
12#define _XTENSA_PAGE_H
13
14#include <asm/processor.h>
15#include <asm/types.h>
16#include <asm/cache.h>
17
18/*
19 * Fixed TLB translations in the processor.
20 */
21
22#define XCHAL_KSEG_CACHED_VADDR 0xd0000000
23#define XCHAL_KSEG_BYPASS_VADDR 0xd8000000
24#define XCHAL_KSEG_PADDR 0x00000000
25#define XCHAL_KSEG_SIZE 0x08000000
26
27/*
28 * PAGE_SHIFT determines the page size
29 */
30
31#define PAGE_SHIFT 12
32#define PAGE_SIZE (__XTENSA_UL_CONST(1) << PAGE_SHIFT)
33#define PAGE_MASK (~(PAGE_SIZE-1))
34
35#define PAGE_OFFSET XCHAL_KSEG_CACHED_VADDR
36#define MAX_MEM_PFN XCHAL_KSEG_SIZE
37#define PGTABLE_START 0x80000000
38
39/*
40 * Cache aliasing:
41 *
42 * If the cache size for one way is greater than the page size, we have to
43 * deal with cache aliasing. The cache index is wider than the page size:
44 *
45 * | |cache| cache index
46 * | pfn |off| virtual address
47 * |xxxx:X|zzz|
48 * | : | |
49 * | \ / | |
50 * |trans.| |
51 * | / \ | |
52 * |yyyy:Y|zzz| physical address
53 *
54 * When the page number is translated to the physical page address, the lowest
55 * bit(s) (X) that are part of the cache index are also translated (Y).
56 * If this translation changes bit(s) (X), the cache index is also afected,
57 * thus resulting in a different cache line than before.
58 * The kernel does not provide a mechanism to ensure that the page color
59 * (represented by this bit) remains the same when allocated or when pages
60 * are remapped. When user pages are mapped into kernel space, the color of
61 * the page might also change.
62 *
63 * We use the address space VMALLOC_END ... VMALLOC_END + DCACHE_WAY_SIZE * 2
64 * to temporarily map a patch so we can match the color.
65 */
66
67#if DCACHE_WAY_SIZE > PAGE_SIZE
68# define DCACHE_ALIAS_ORDER (DCACHE_WAY_SHIFT - PAGE_SHIFT)
69# define DCACHE_ALIAS_MASK (PAGE_MASK & (DCACHE_WAY_SIZE - 1))
70# define DCACHE_ALIAS(a) (((a) & DCACHE_ALIAS_MASK) >> PAGE_SHIFT)
71# define DCACHE_ALIAS_EQ(a,b) ((((a) ^ (b)) & DCACHE_ALIAS_MASK) == 0)
72#else
73# define DCACHE_ALIAS_ORDER 0
74#endif
75
76#if ICACHE_WAY_SIZE > PAGE_SIZE
77# define ICACHE_ALIAS_ORDER (ICACHE_WAY_SHIFT - PAGE_SHIFT)
78# define ICACHE_ALIAS_MASK (PAGE_MASK & (ICACHE_WAY_SIZE - 1))
79# define ICACHE_ALIAS(a) (((a) & ICACHE_ALIAS_MASK) >> PAGE_SHIFT)
80# define ICACHE_ALIAS_EQ(a,b) ((((a) ^ (b)) & ICACHE_ALIAS_MASK) == 0)
81#else
82# define ICACHE_ALIAS_ORDER 0
83#endif
84
85
86#ifdef __ASSEMBLY__
87
88#define __pgprot(x) (x)
89
90#else
91
92/*
93 * These are used to make use of C type-checking..
94 */
95
96typedef struct { unsigned long pte; } pte_t; /* page table entry */
97typedef struct { unsigned long pgd; } pgd_t; /* PGD table entry */
98typedef struct { unsigned long pgprot; } pgprot_t;
99typedef struct page *pgtable_t;
100
101#define pte_val(x) ((x).pte)
102#define pgd_val(x) ((x).pgd)
103#define pgprot_val(x) ((x).pgprot)
104
105#define __pte(x) ((pte_t) { (x) } )
106#define __pgd(x) ((pgd_t) { (x) } )
107#define __pgprot(x) ((pgprot_t) { (x) } )
108
109/*
110 * Pure 2^n version of get_order
111 * Use 'nsau' instructions if supported by the processor or the generic version.
112 */
113
114#if XCHAL_HAVE_NSA
115
116static inline __attribute_const__ int get_order(unsigned long size)
117{
118 int lz;
119 asm ("nsau %0, %1" : "=r" (lz) : "r" ((size - 1) >> PAGE_SHIFT));
120 return 32 - lz;
121}
122
123#else
124
125# include <asm-generic/page.h>
126
127#endif
128
129struct page;
130extern void clear_page(void *page);
131extern void copy_page(void *to, void *from);
132
133/*
134 * If we have cache aliasing and writeback caches, we might have to do
135 * some extra work
136 */
137
138#if DCACHE_WAY_SIZE > PAGE_SIZE
139extern void clear_user_page(void*, unsigned long, struct page*);
140extern void copy_user_page(void*, void*, unsigned long, struct page*);
141#else
142# define clear_user_page(page, vaddr, pg) clear_page(page)
143# define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
144#endif
145
146/*
147 * This handles the memory map. We handle pages at
148 * XCHAL_KSEG_CACHED_VADDR for kernels with 32 bit address space.
149 * These macros are for conversion of kernel address, not user
150 * addresses.
151 */
152
153#define __pa(x) ((unsigned long) (x) - PAGE_OFFSET)
154#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
155#define pfn_valid(pfn) ((unsigned long)pfn < max_mapnr)
156#ifdef CONFIG_DISCONTIGMEM
157# error CONFIG_DISCONTIGMEM not supported
158#endif
159
160#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
161#define page_to_virt(page) __va(page_to_pfn(page) << PAGE_SHIFT)
162#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
163#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
164
165#define WANT_PAGE_VIRTUAL
166
167
168#endif /* __ASSEMBLY__ */
169
170#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
171 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC)
172
173#include <asm-generic/memory_model.h>
174#endif /* _XTENSA_PAGE_H */
diff --git a/arch/xtensa/include/asm/param.h b/arch/xtensa/include/asm/param.h
new file mode 100644
index 000000000000..ba03d5aeab6b
--- /dev/null
+++ b/arch/xtensa/include/asm/param.h
@@ -0,0 +1,34 @@
1/*
2 * include/asm-xtensa/param.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PARAM_H
12#define _XTENSA_PARAM_H
13
14#ifdef __KERNEL__
15# define HZ CONFIG_HZ /* internal timer frequency */
16# define USER_HZ 100 /* for user interfaces in "ticks" */
17# define CLOCKS_PER_SEC (USER_HZ) /* frequnzy at which times() counts */
18#else
19# define HZ 100
20#endif
21
22#define EXEC_PAGESIZE 4096
23
24#ifndef NGROUPS
25#define NGROUPS 32
26#endif
27
28#ifndef NOGROUP
29#define NOGROUP (-1)
30#endif
31
32#define MAXHOSTNAMELEN 64 /* max length of hostname */
33
34#endif /* _XTENSA_PARAM_H */
diff --git a/arch/xtensa/include/asm/pci-bridge.h b/arch/xtensa/include/asm/pci-bridge.h
new file mode 100644
index 000000000000..00fcbd7c534a
--- /dev/null
+++ b/arch/xtensa/include/asm/pci-bridge.h
@@ -0,0 +1,88 @@
1/*
2 * include/asm-xtensa/pci-bridge.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PCI_BRIDGE_H
12#define _XTENSA_PCI_BRIDGE_H
13
14#ifdef __KERNEL__
15
16struct device_node;
17struct pci_controller;
18
19/*
20 * pciauto_bus_scan() enumerates the pci space.
21 */
22
23extern int pciauto_bus_scan(struct pci_controller *, int);
24
25struct pci_space {
26 unsigned long start;
27 unsigned long end;
28 unsigned long base;
29};
30
31/*
32 * Structure of a PCI controller (host bridge)
33 */
34
35struct pci_controller {
36 int index; /* used for pci_controller_num */
37 struct pci_controller *next;
38 struct pci_bus *bus;
39 void *arch_data;
40
41 int first_busno;
42 int last_busno;
43
44 struct pci_ops *ops;
45 volatile unsigned int *cfg_addr;
46 volatile unsigned char *cfg_data;
47
48 /* Currently, we limit ourselves to 1 IO range and 3 mem
49 * ranges since the common pci_bus structure can't handle more
50 */
51 struct resource io_resource;
52 struct resource mem_resources[3];
53 int mem_resource_count;
54
55 /* Host bridge I/O and Memory space
56 * Used for BAR placement algorithms
57 */
58 struct pci_space io_space;
59 struct pci_space mem_space;
60
61 /* Return the interrupt number fo a device. */
62 int (*map_irq)(struct pci_dev*, u8, u8);
63
64};
65
66static inline void pcibios_init_resource(struct resource *res,
67 unsigned long start, unsigned long end, int flags, char *name)
68{
69 res->start = start;
70 res->end = end;
71 res->flags = flags;
72 res->name = name;
73 res->parent = NULL;
74 res->sibling = NULL;
75 res->child = NULL;
76}
77
78
79/* These are used for config access before all the PCI probing has been done. */
80int early_read_config_byte(struct pci_controller*, int, int, int, u8*);
81int early_read_config_word(struct pci_controller*, int, int, int, u16*);
82int early_read_config_dword(struct pci_controller*, int, int, int, u32*);
83int early_write_config_byte(struct pci_controller*, int, int, int, u8);
84int early_write_config_word(struct pci_controller*, int, int, int, u16);
85int early_write_config_dword(struct pci_controller*, int, int, int, u32);
86
87#endif /* __KERNEL__ */
88#endif /* _XTENSA_PCI_BRIDGE_H */
diff --git a/arch/xtensa/include/asm/pci.h b/arch/xtensa/include/asm/pci.h
new file mode 100644
index 000000000000..66410acf18b4
--- /dev/null
+++ b/arch/xtensa/include/asm/pci.h
@@ -0,0 +1,82 @@
1/*
2 * linux/include/asm-xtensa/pci.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PCI_H
12#define _XTENSA_PCI_H
13
14#ifdef __KERNEL__
15
16/* Can be used to override the logic in pci_scan_bus for skipping
17 * already-configured bus numbers - to be used for buggy BIOSes
18 * or architectures with incomplete PCI setup by the loader
19 */
20
21#define pcibios_assign_all_busses() 0
22
23extern struct pci_controller* pcibios_alloc_controller(void);
24
25static inline void pcibios_set_master(struct pci_dev *dev)
26{
27 /* No special bus mastering setup handling */
28}
29
30static inline void pcibios_penalize_isa_irq(int irq)
31{
32 /* We don't do dynamic PCI IRQ allocation */
33}
34
35/* Assume some values. (We should revise them, if necessary) */
36
37#define PCIBIOS_MIN_IO 0x2000
38#define PCIBIOS_MIN_MEM 0x10000000
39
40/* Dynamic DMA mapping stuff.
41 * Xtensa has everything mapped statically like x86.
42 */
43
44#include <linux/types.h>
45#include <linux/slab.h>
46#include <asm/scatterlist.h>
47#include <linux/string.h>
48#include <asm/io.h>
49
50struct pci_dev;
51
52/* The PCI address space does equal the physical memory address space.
53 * The networking and block device layers use this boolean for bounce buffer
54 * decisions.
55 */
56
57#define PCI_DMA_BUS_IS_PHYS (1)
58
59/* pci_unmap_{page,single} is a no-op, so */
60#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
61#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
62#define pci_unmap_addr(PTR, ADDR_NAME) (0)
63#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
64#define pci_ubnmap_len(PTR, LEN_NAME) (0)
65#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
66
67/* Map a range of PCI memory or I/O space for a device into user space */
68int pci_mmap_page_range(struct pci_dev *pdev, struct vm_area_struct *vma,
69 enum pci_mmap_state mmap_state, int write_combine);
70
71/* Tell drivers/pci/proc.c that we have pci_mmap_page_range() */
72#define HAVE_PCI_MMAP 1
73
74#endif /* __KERNEL__ */
75
76/* Implement the pci_ DMA API in terms of the generic device dma_ one */
77#include <asm-generic/pci-dma-compat.h>
78
79/* Generic PCI */
80#include <asm-generic/pci.h>
81
82#endif /* _XTENSA_PCI_H */
diff --git a/arch/xtensa/include/asm/percpu.h b/arch/xtensa/include/asm/percpu.h
new file mode 100644
index 000000000000..6d2bc2ada9d1
--- /dev/null
+++ b/arch/xtensa/include/asm/percpu.h
@@ -0,0 +1,16 @@
1/*
2 * linux/include/asm-xtensa/percpu.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PERCPU__
12#define _XTENSA_PERCPU__
13
14#include <asm-generic/percpu.h>
15
16#endif /* _XTENSA_PERCPU__ */
diff --git a/arch/xtensa/include/asm/pgalloc.h b/arch/xtensa/include/asm/pgalloc.h
new file mode 100644
index 000000000000..4f4a7987eded
--- /dev/null
+++ b/arch/xtensa/include/asm/pgalloc.h
@@ -0,0 +1,73 @@
1/*
2 * include/asm-xtensa/pgalloc.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (C) 2001-2007 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PGALLOC_H
12#define _XTENSA_PGALLOC_H
13
14#ifdef __KERNEL__
15
16#include <linux/highmem.h>
17
18/*
19 * Allocating and freeing a pmd is trivial: the 1-entry pmd is
20 * inside the pgd, so has no extra memory associated with it.
21 */
22
23#define pmd_populate_kernel(mm, pmdp, ptep) \
24 (pmd_val(*(pmdp)) = ((unsigned long)ptep))
25#define pmd_populate(mm, pmdp, page) \
26 (pmd_val(*(pmdp)) = ((unsigned long)page_to_virt(page)))
27#define pmd_pgtable(pmd) pmd_page(pmd)
28
29static inline pgd_t*
30pgd_alloc(struct mm_struct *mm)
31{
32 return (pgd_t*) __get_free_pages(GFP_KERNEL | __GFP_ZERO, PGD_ORDER);
33}
34
35static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
36{
37 free_page((unsigned long)pgd);
38}
39
40/* Use a slab cache for the pte pages (see also sparc64 implementation) */
41
42extern struct kmem_cache *pgtable_cache;
43
44static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
45 unsigned long address)
46{
47 return kmem_cache_alloc(pgtable_cache, GFP_KERNEL|__GFP_REPEAT);
48}
49
50static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
51 unsigned long addr)
52{
53 struct page *page;
54
55 page = virt_to_page(pte_alloc_one_kernel(mm, addr));
56 pgtable_page_ctor(page);
57 return page;
58}
59
60static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
61{
62 kmem_cache_free(pgtable_cache, pte);
63}
64
65static inline void pte_free(struct mm_struct *mm, pgtable_t pte)
66{
67 pgtable_page_dtor(pte);
68 kmem_cache_free(pgtable_cache, page_address(pte));
69}
70#define pmd_pgtable(pmd) pmd_page(pmd)
71
72#endif /* __KERNEL__ */
73#endif /* _XTENSA_PGALLOC_H */
diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h
new file mode 100644
index 000000000000..8014d96b21f1
--- /dev/null
+++ b/arch/xtensa/include/asm/pgtable.h
@@ -0,0 +1,416 @@
1/*
2 * include/asm-xtensa/pgtable.h
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Copyright (C) 2001 - 2007 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PGTABLE_H
12#define _XTENSA_PGTABLE_H
13
14#include <asm-generic/pgtable-nopmd.h>
15#include <asm/page.h>
16
17/*
18 * We only use two ring levels, user and kernel space.
19 */
20
21#define USER_RING 1 /* user ring level */
22#define KERNEL_RING 0 /* kernel ring level */
23
24/*
25 * The Xtensa architecture port of Linux has a two-level page table system,
26 * i.e. the logical three-level Linux page table layout is folded.
27 * Each task has the following memory page tables:
28 *
29 * PGD table (page directory), ie. 3rd-level page table:
30 * One page (4 kB) of 1024 (PTRS_PER_PGD) pointers to PTE tables
31 * (Architectures that don't have the PMD folded point to the PMD tables)
32 *
33 * The pointer to the PGD table for a given task can be retrieved from
34 * the task structure (struct task_struct*) t, e.g. current():
35 * (t->mm ? t->mm : t->active_mm)->pgd
36 *
37 * PMD tables (page middle-directory), ie. 2nd-level page tables:
38 * Absent for the Xtensa architecture (folded, PTRS_PER_PMD == 1).
39 *
40 * PTE tables (page table entry), ie. 1st-level page tables:
41 * One page (4 kB) of 1024 (PTRS_PER_PTE) PTEs with a special PTE
42 * invalid_pte_table for absent mappings.
43 *
44 * The individual pages are 4 kB big with special pages for the empty_zero_page.
45 */
46
47#define PGDIR_SHIFT 22
48#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
49#define PGDIR_MASK (~(PGDIR_SIZE-1))
50
51/*
52 * Entries per page directory level: we use two-level, so
53 * we don't really have any PMD directory physically.
54 */
55#define PTRS_PER_PTE 1024
56#define PTRS_PER_PTE_SHIFT 10
57#define PTRS_PER_PGD 1024
58#define PGD_ORDER 0
59#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
60#define FIRST_USER_ADDRESS 0
61#define FIRST_USER_PGD_NR (FIRST_USER_ADDRESS >> PGDIR_SHIFT)
62
63/*
64 * Virtual memory area. We keep a distance to other memory regions to be
65 * on the safe side. We also use this area for cache aliasing.
66 */
67
68#define VMALLOC_START 0xC0000000
69#define VMALLOC_END 0xC7FEFFFF
70#define TLBTEMP_BASE_1 0xC7FF0000
71#define TLBTEMP_BASE_2 0xC7FF8000
72
73/*
74 * Xtensa Linux config PTE layout (when present):
75 * 31-12: PPN
76 * 11-6: Software
77 * 5-4: RING
78 * 3-0: CA
79 *
80 * Similar to the Alpha and MIPS ports, we need to keep track of the ref
81 * and mod bits in software. We have a software "you can read
82 * from this page" bit, and a hardware one which actually lets the
83 * process read from the page. On the same token we have a software
84 * writable bit and the real hardware one which actually lets the
85 * process write to the page.
86 *
87 * See further below for PTE layout for swapped-out pages.
88 */
89
90#define _PAGE_HW_EXEC (1<<0) /* hardware: page is executable */
91#define _PAGE_HW_WRITE (1<<1) /* hardware: page is writable */
92
93#define _PAGE_FILE (1<<1) /* non-linear mapping, if !present */
94#define _PAGE_PROTNONE (3<<0) /* special case for VM_PROT_NONE */
95
96/* None of these cache modes include MP coherency: */
97#define _PAGE_CA_BYPASS (0<<2) /* bypass, non-speculative */
98#define _PAGE_CA_WB (1<<2) /* write-back */
99#define _PAGE_CA_WT (2<<2) /* write-through */
100#define _PAGE_CA_MASK (3<<2)
101#define _PAGE_INVALID (3<<2)
102
103#define _PAGE_USER (1<<4) /* user access (ring=1) */
104
105/* Software */
106#define _PAGE_WRITABLE_BIT 6
107#define _PAGE_WRITABLE (1<<6) /* software: page writable */
108#define _PAGE_DIRTY (1<<7) /* software: page dirty */
109#define _PAGE_ACCESSED (1<<8) /* software: page accessed (read) */
110
111/* On older HW revisions, we always have to set bit 0 */
112#if XCHAL_HW_VERSION_MAJOR < 2000
113# define _PAGE_VALID (1<<0)
114#else
115# define _PAGE_VALID 0
116#endif
117
118#define _PAGE_CHG_MASK (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
119#define _PAGE_PRESENT (_PAGE_VALID | _PAGE_CA_WB | _PAGE_ACCESSED)
120
121#ifdef CONFIG_MMU
122
123#define PAGE_NONE __pgprot(_PAGE_INVALID | _PAGE_USER | _PAGE_PROTNONE)
124#define PAGE_COPY __pgprot(_PAGE_PRESENT | _PAGE_USER)
125#define PAGE_COPY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_HW_EXEC)
126#define PAGE_READONLY __pgprot(_PAGE_PRESENT | _PAGE_USER)
127#define PAGE_READONLY_EXEC __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_HW_EXEC)
128#define PAGE_SHARED __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_WRITABLE)
129#define PAGE_SHARED_EXEC \
130 __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_WRITABLE | _PAGE_HW_EXEC)
131#define PAGE_KERNEL __pgprot(_PAGE_PRESENT | _PAGE_HW_WRITE)
132#define PAGE_KERNEL_EXEC __pgprot(_PAGE_PRESENT|_PAGE_HW_WRITE|_PAGE_HW_EXEC)
133
134#if (DCACHE_WAY_SIZE > PAGE_SIZE)
135# define _PAGE_DIRECTORY (_PAGE_VALID | _PAGE_ACCESSED)
136#else
137# define _PAGE_DIRECTORY (_PAGE_VALID | _PAGE_ACCESSED | _PAGE_CA_WB)
138#endif
139
140#else /* no mmu */
141
142# define PAGE_NONE __pgprot(0)
143# define PAGE_SHARED __pgprot(0)
144# define PAGE_COPY __pgprot(0)
145# define PAGE_READONLY __pgprot(0)
146# define PAGE_KERNEL __pgprot(0)
147
148#endif
149
150/*
151 * On certain configurations of Xtensa MMUs (eg. the initial Linux config),
152 * the MMU can't do page protection for execute, and considers that the same as
153 * read. Also, write permissions may imply read permissions.
154 * What follows is the closest we can get by reasonable means..
155 * See linux/mm/mmap.c for protection_map[] array that uses these definitions.
156 */
157#define __P000 PAGE_NONE /* private --- */
158#define __P001 PAGE_READONLY /* private --r */
159#define __P010 PAGE_COPY /* private -w- */
160#define __P011 PAGE_COPY /* private -wr */
161#define __P100 PAGE_READONLY_EXEC /* private x-- */
162#define __P101 PAGE_READONLY_EXEC /* private x-r */
163#define __P110 PAGE_COPY_EXEC /* private xw- */
164#define __P111 PAGE_COPY_EXEC /* private xwr */
165
166#define __S000 PAGE_NONE /* shared --- */
167#define __S001 PAGE_READONLY /* shared --r */
168#define __S010 PAGE_SHARED /* shared -w- */
169#define __S011 PAGE_SHARED /* shared -wr */
170#define __S100 PAGE_READONLY_EXEC /* shared x-- */
171#define __S101 PAGE_READONLY_EXEC /* shared x-r */
172#define __S110 PAGE_SHARED_EXEC /* shared xw- */
173#define __S111 PAGE_SHARED_EXEC /* shared xwr */
174
175#ifndef __ASSEMBLY__
176
177#define pte_ERROR(e) \
178 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
179#define pgd_ERROR(e) \
180 printk("%s:%d: bad pgd entry %08lx.\n", __FILE__, __LINE__, pgd_val(e))
181
182extern unsigned long empty_zero_page[1024];
183
184#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
185
186extern pgd_t swapper_pg_dir[PAGE_SIZE/sizeof(pgd_t)];
187
188/*
189 * The pmd contains the kernel virtual address of the pte page.
190 */
191#define pmd_page_vaddr(pmd) ((unsigned long)(pmd_val(pmd) & PAGE_MASK))
192#define pmd_page(pmd) virt_to_page(pmd_val(pmd))
193
194/*
195 * pte status.
196 */
197#define pte_none(pte) (pte_val(pte) == _PAGE_INVALID)
198#define pte_present(pte) \
199 (((pte_val(pte) & _PAGE_CA_MASK) != _PAGE_INVALID) \
200 || ((pte_val(pte) & _PAGE_PROTNONE) == _PAGE_PROTNONE))
201#define pte_clear(mm,addr,ptep) \
202 do { update_pte(ptep, __pte(_PAGE_INVALID)); } while(0)
203
204#define pmd_none(pmd) (!pmd_val(pmd))
205#define pmd_present(pmd) (pmd_val(pmd) & PAGE_MASK)
206#define pmd_bad(pmd) (pmd_val(pmd) & ~PAGE_MASK)
207#define pmd_clear(pmdp) do { set_pmd(pmdp, __pmd(0)); } while (0)
208
209static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_WRITABLE; }
210static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
211static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
212static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
213static inline int pte_special(pte_t pte) { return 0; }
214
215static inline pte_t pte_wrprotect(pte_t pte)
216 { pte_val(pte) &= ~(_PAGE_WRITABLE | _PAGE_HW_WRITE); return pte; }
217static inline pte_t pte_mkclean(pte_t pte)
218 { pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HW_WRITE); return pte; }
219static inline pte_t pte_mkold(pte_t pte)
220 { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
221static inline pte_t pte_mkdirty(pte_t pte)
222 { pte_val(pte) |= _PAGE_DIRTY; return pte; }
223static inline pte_t pte_mkyoung(pte_t pte)
224 { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
225static inline pte_t pte_mkwrite(pte_t pte)
226 { pte_val(pte) |= _PAGE_WRITABLE; return pte; }
227static inline pte_t pte_mkspecial(pte_t pte)
228 { return pte; }
229
230/*
231 * Conversion functions: convert a page and protection to a page entry,
232 * and a page entry and page directory to the page they refer to.
233 */
234
235#define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT)
236#define pte_same(a,b) (pte_val(a) == pte_val(b))
237#define pte_page(x) pfn_to_page(pte_pfn(x))
238#define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))
239#define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot)
240
241static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
242{
243 return __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot));
244}
245
246/*
247 * Certain architectures need to do special things when pte's
248 * within a page table are directly modified. Thus, the following
249 * hook is made available.
250 */
251static inline void update_pte(pte_t *ptep, pte_t pteval)
252{
253 *ptep = pteval;
254#if (DCACHE_WAY_SIZE > PAGE_SIZE) && XCHAL_DCACHE_IS_WRITEBACK
255 __asm__ __volatile__ ("dhwb %0, 0" :: "a" (ptep));
256#endif
257
258}
259
260struct mm_struct;
261
262static inline void
263set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval)
264{
265 update_pte(ptep, pteval);
266}
267
268
269static inline void
270set_pmd(pmd_t *pmdp, pmd_t pmdval)
271{
272 *pmdp = pmdval;
273}
274
275struct vm_area_struct;
276
277static inline int
278ptep_test_and_clear_young(struct vm_area_struct *vma, unsigned long addr,
279 pte_t *ptep)
280{
281 pte_t pte = *ptep;
282 if (!pte_young(pte))
283 return 0;
284 update_pte(ptep, pte_mkold(pte));
285 return 1;
286}
287
288static inline pte_t
289ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
290{
291 pte_t pte = *ptep;
292 pte_clear(mm, addr, ptep);
293 return pte;
294}
295
296static inline void
297ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, pte_t *ptep)
298{
299 pte_t pte = *ptep;
300 update_pte(ptep, pte_wrprotect(pte));
301}
302
303/* to find an entry in a kernel page-table-directory */
304#define pgd_offset_k(address) pgd_offset(&init_mm, address)
305
306/* to find an entry in a page-table-directory */
307#define pgd_offset(mm,address) ((mm)->pgd + pgd_index(address))
308
309#define pgd_index(address) ((address) >> PGDIR_SHIFT)
310
311/* Find an entry in the second-level page table.. */
312#define pmd_offset(dir,address) ((pmd_t*)(dir))
313
314/* Find an entry in the third-level page table.. */
315#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
316#define pte_offset_kernel(dir,addr) \
317 ((pte_t*) pmd_page_vaddr(*(dir)) + pte_index(addr))
318#define pte_offset_map(dir,addr) pte_offset_kernel((dir),(addr))
319#define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir),(addr))
320
321#define pte_unmap(pte) do { } while (0)
322#define pte_unmap_nested(pte) do { } while (0)
323
324
325/*
326 * Encode and decode a swap entry.
327 *
328 * Format of swap pte:
329 * bit 0 MBZ
330 * bit 1 page-file (must be zero)
331 * bits 2 - 3 page hw access mode (must be 11: _PAGE_INVALID)
332 * bits 4 - 5 ring protection (must be 01: _PAGE_USER)
333 * bits 6 - 10 swap type (5 bits -> 32 types)
334 * bits 11 - 31 swap offset / PAGE_SIZE (21 bits -> 8GB)
335
336 * Format of file pte:
337 * bit 0 MBZ
338 * bit 1 page-file (must be one: _PAGE_FILE)
339 * bits 2 - 3 page hw access mode (must be 11: _PAGE_INVALID)
340 * bits 4 - 5 ring protection (must be 01: _PAGE_USER)
341 * bits 6 - 31 file offset / PAGE_SIZE
342 */
343
344#define __swp_type(entry) (((entry).val >> 6) & 0x1f)
345#define __swp_offset(entry) ((entry).val >> 11)
346#define __swp_entry(type,offs) \
347 ((swp_entry_t) {((type) << 6) | ((offs) << 11) | _PAGE_INVALID})
348#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
349#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
350
351#define PTE_FILE_MAX_BITS 28
352#define pte_to_pgoff(pte) (pte_val(pte) >> 4)
353#define pgoff_to_pte(off) \
354 ((pte_t) { ((off) << 4) | _PAGE_INVALID | _PAGE_FILE })
355
356#endif /* !defined (__ASSEMBLY__) */
357
358
359#ifdef __ASSEMBLY__
360
361/* Assembly macro _PGD_INDEX is the same as C pgd_index(unsigned long),
362 * _PGD_OFFSET as C pgd_offset(struct mm_struct*, unsigned long),
363 * _PMD_OFFSET as C pmd_offset(pgd_t*, unsigned long)
364 * _PTE_OFFSET as C pte_offset(pmd_t*, unsigned long)
365 *
366 * Note: We require an additional temporary register which can be the same as
367 * the register that holds the address.
368 *
369 * ((pte_t*) ((unsigned long)(pmd_val(*pmd) & PAGE_MASK)) + pte_index(addr))
370 *
371 */
372#define _PGD_INDEX(rt,rs) extui rt, rs, PGDIR_SHIFT, 32-PGDIR_SHIFT
373#define _PTE_INDEX(rt,rs) extui rt, rs, PAGE_SHIFT, PTRS_PER_PTE_SHIFT
374
375#define _PGD_OFFSET(mm,adr,tmp) l32i mm, mm, MM_PGD; \
376 _PGD_INDEX(tmp, adr); \
377 addx4 mm, tmp, mm
378
379#define _PTE_OFFSET(pmd,adr,tmp) _PTE_INDEX(tmp, adr); \
380 srli pmd, pmd, PAGE_SHIFT; \
381 slli pmd, pmd, PAGE_SHIFT; \
382 addx4 pmd, tmp, pmd
383
384#else
385
386extern void paging_init(void);
387
388#define kern_addr_valid(addr) (1)
389
390extern void update_mmu_cache(struct vm_area_struct * vma,
391 unsigned long address, pte_t pte);
392
393/*
394 * remap a physical page `pfn' of size `size' with page protection `prot'
395 * into virtual address `from'
396 */
397
398#define io_remap_pfn_range(vma,from,pfn,size,prot) \
399 remap_pfn_range(vma, from, pfn, size, prot)
400
401
402extern void pgtable_cache_init(void);
403
404typedef pte_t *pte_addr_t;
405
406#endif /* !defined (__ASSEMBLY__) */
407
408#define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG
409#define __HAVE_ARCH_PTEP_GET_AND_CLEAR
410#define __HAVE_ARCH_PTEP_SET_WRPROTECT
411#define __HAVE_ARCH_PTEP_MKDIRTY
412#define __HAVE_ARCH_PTE_SAME
413
414#include <asm-generic/pgtable.h>
415
416#endif /* _XTENSA_PGTABLE_H */
diff --git a/arch/xtensa/include/asm/platform.h b/arch/xtensa/include/asm/platform.h
new file mode 100644
index 000000000000..e3d5a48ad495
--- /dev/null
+++ b/arch/xtensa/include/asm/platform.h
@@ -0,0 +1,89 @@
1/*
2 * Platform specific functions
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PLATFORM_H
12#define _XTENSA_PLATFORM_H
13
14#include <linux/types.h>
15#include <linux/pci.h>
16
17#include <asm/bootparam.h>
18
19/*
20 * platform_init is called before the mmu is initialized to give the
21 * platform a early hook-up. bp_tag_t is a list of configuration tags
22 * passed from the boot-loader.
23 */
24extern void platform_init(bp_tag_t*);
25
26/*
27 * platform_setup is called from setup_arch with a pointer to the command-line
28 * string.
29 */
30extern void platform_setup (char **);
31
32/*
33 * platform_init_irq is called from init_IRQ.
34 */
35extern void platform_init_irq (void);
36
37/*
38 * platform_restart is called to restart the system.
39 */
40extern void platform_restart (void);
41
42/*
43 * platform_halt is called to stop the system and halt.
44 */
45extern void platform_halt (void);
46
47/*
48 * platform_power_off is called to stop the system and power it off.
49 */
50extern void platform_power_off (void);
51
52/*
53 * platform_idle is called from the idle function.
54 */
55extern void platform_idle (void);
56
57/*
58 * platform_heartbeat is called every HZ
59 */
60extern void platform_heartbeat (void);
61
62/*
63 * platform_pcibios_init is called to allow the platform to setup the pci bus.
64 */
65extern void platform_pcibios_init (void);
66
67/*
68 * platform_pcibios_fixup allows to modify the PCI configuration.
69 */
70extern int platform_pcibios_fixup (void);
71
72/*
73 * platform_calibrate_ccount calibrates cpu clock freq (CONFIG_XTENSA_CALIBRATE)
74 */
75extern void platform_calibrate_ccount (void);
76
77/*
78 * platform_get_rtc_time returns RTC seconds (returns 0 for no error)
79 */
80extern int platform_get_rtc_time(time_t*);
81
82/*
83 * platform_set_rtc_time set RTC seconds (returns 0 for no error)
84 */
85extern int platform_set_rtc_time(time_t);
86
87
88#endif /* _XTENSA_PLATFORM_H */
89
diff --git a/arch/xtensa/include/asm/poll.h b/arch/xtensa/include/asm/poll.h
new file mode 100644
index 000000000000..9d2d5993f068
--- /dev/null
+++ b/arch/xtensa/include/asm/poll.h
@@ -0,0 +1,20 @@
1/*
2 * include/asm-xtensa/poll.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_POLL_H
12#define _XTENSA_POLL_H
13
14#define POLLWRNORM POLLOUT
15#define POLLWRBAND 0x0100
16#define POLLREMOVE 0x0800
17
18#include <asm-generic/poll.h>
19
20#endif /* _XTENSA_POLL_H */
diff --git a/arch/xtensa/include/asm/posix_types.h b/arch/xtensa/include/asm/posix_types.h
new file mode 100644
index 000000000000..43f9dd1126a4
--- /dev/null
+++ b/arch/xtensa/include/asm/posix_types.h
@@ -0,0 +1,122 @@
1/*
2 * include/asm-xtensa/posix_types.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Largely copied from include/asm-ppc/posix_types.h
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_POSIX_TYPES_H
14#define _XTENSA_POSIX_TYPES_H
15
16/*
17 * This file is generally used by user-level software, so you need to
18 * be a little careful about namespace pollution etc. Also, we cannot
19 * assume GCC is being used.
20 */
21
22typedef unsigned long __kernel_ino_t;
23typedef unsigned int __kernel_mode_t;
24typedef unsigned long __kernel_nlink_t;
25typedef long __kernel_off_t;
26typedef int __kernel_pid_t;
27typedef unsigned short __kernel_ipc_pid_t;
28typedef unsigned int __kernel_uid_t;
29typedef unsigned int __kernel_gid_t;
30typedef unsigned int __kernel_size_t;
31typedef int __kernel_ssize_t;
32typedef long __kernel_ptrdiff_t;
33typedef long __kernel_time_t;
34typedef long __kernel_suseconds_t;
35typedef long __kernel_clock_t;
36typedef int __kernel_timer_t;
37typedef int __kernel_clockid_t;
38typedef int __kernel_daddr_t;
39typedef char * __kernel_caddr_t;
40typedef unsigned short __kernel_uid16_t;
41typedef unsigned short __kernel_gid16_t;
42typedef unsigned int __kernel_uid32_t;
43typedef unsigned int __kernel_gid32_t;
44
45typedef unsigned short __kernel_old_uid_t;
46typedef unsigned short __kernel_old_gid_t;
47typedef unsigned short __kernel_old_dev_t;
48
49#ifdef __GNUC__
50typedef long long __kernel_loff_t;
51#endif
52
53typedef struct {
54 int val[2];
55} __kernel_fsid_t;
56
57#ifndef __GNUC__
58
59#define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
60#define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d))
61#define __FD_ISSET(d, set) ((set)->fds_bits[__FDELT(d)] & __FDMASK(d))
62#define __FD_ZERO(set) \
63 ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set)))
64
65#else /* __GNUC__ */
66
67#if defined(__KERNEL__)
68/* With GNU C, use inline functions instead so args are evaluated only once: */
69
70#undef __FD_SET
71static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp)
72{
73 unsigned long _tmp = fd / __NFDBITS;
74 unsigned long _rem = fd % __NFDBITS;
75 fdsetp->fds_bits[_tmp] |= (1UL<<_rem);
76}
77
78#undef __FD_CLR
79static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp)
80{
81 unsigned long _tmp = fd / __NFDBITS;
82 unsigned long _rem = fd % __NFDBITS;
83 fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem);
84}
85
86#undef __FD_ISSET
87static __inline__ int __FD_ISSET(unsigned long fd, __kernel_fd_set *p)
88{
89 unsigned long _tmp = fd / __NFDBITS;
90 unsigned long _rem = fd % __NFDBITS;
91 return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0;
92}
93
94/*
95 * This will unroll the loop for the normal constant case (8 ints,
96 * for a 256-bit fd_set)
97 */
98#undef __FD_ZERO
99static __inline__ void __FD_ZERO(__kernel_fd_set *p)
100{
101 unsigned int *tmp = (unsigned int *)p->fds_bits;
102 int i;
103
104 if (__builtin_constant_p(__FDSET_LONGS)) {
105 switch (__FDSET_LONGS) {
106 case 8:
107 tmp[0] = 0; tmp[1] = 0; tmp[2] = 0; tmp[3] = 0;
108 tmp[4] = 0; tmp[5] = 0; tmp[6] = 0; tmp[7] = 0;
109 return;
110 }
111 }
112 i = __FDSET_LONGS;
113 while (i) {
114 i--;
115 *tmp = 0;
116 tmp++;
117 }
118}
119
120#endif /* defined(__KERNEL__) */
121#endif /* __GNUC__ */
122#endif /* _XTENSA_POSIX_TYPES_H */
diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
new file mode 100644
index 000000000000..07387d3b99f4
--- /dev/null
+++ b/arch/xtensa/include/asm/processor.h
@@ -0,0 +1,193 @@
1/*
2 * include/asm-xtensa/processor.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PROCESSOR_H
12#define _XTENSA_PROCESSOR_H
13
14#include <variant/core.h>
15#include <asm/coprocessor.h>
16
17#include <linux/compiler.h>
18#include <asm/ptrace.h>
19#include <asm/types.h>
20#include <asm/regs.h>
21
22/* Assertions. */
23
24#if (XCHAL_HAVE_WINDOWED != 1)
25# error Linux requires the Xtensa Windowed Registers Option.
26#endif
27
28/*
29 * User space process size: 1 GB.
30 * Windowed call ABI requires caller and callee to be located within the same
31 * 1 GB region. The C compiler places trampoline code on the stack for sources
32 * that take the address of a nested C function (a feature used by glibc), so
33 * the 1 GB requirement applies to the stack as well.
34 */
35
36#define TASK_SIZE __XTENSA_UL_CONST(0x40000000)
37#define STACK_TOP TASK_SIZE
38#define STACK_TOP_MAX STACK_TOP
39
40/*
41 * General exception cause assigned to debug exceptions. Debug exceptions go
42 * to their own vector, rather than the general exception vectors (user,
43 * kernel, double); and their specific causes are reported via DEBUGCAUSE
44 * rather than EXCCAUSE. However it is sometimes convenient to redirect debug
45 * exceptions to the general exception mechanism. To do this, an otherwise
46 * unused EXCCAUSE value was assigned to debug exceptions for this purpose.
47 */
48
49#define EXCCAUSE_MAPPED_DEBUG 63
50
51/*
52 * We use DEPC also as a flag to distinguish between double and regular
53 * exceptions. For performance reasons, DEPC might contain the value of
54 * EXCCAUSE for regular exceptions, so we use this definition to mark a
55 * valid double exception address.
56 * (Note: We use it in bgeui, so it should be 64, 128, or 256)
57 */
58
59#define VALID_DOUBLE_EXCEPTION_ADDRESS 64
60
61/* LOCKLEVEL defines the interrupt level that masks all
62 * general-purpose interrupts.
63 */
64#define LOCKLEVEL 1
65
66/* WSBITS and WBBITS are the width of the WINDOWSTART and WINDOWBASE
67 * registers
68 */
69#define WSBITS (XCHAL_NUM_AREGS / 4) /* width of WINDOWSTART in bits */
70#define WBBITS (XCHAL_NUM_AREGS_LOG2 - 2) /* width of WINDOWBASE in bits */
71
72#ifndef __ASSEMBLY__
73
74/* Build a valid return address for the specified call winsize.
75 * winsize must be 1 (call4), 2 (call8), or 3 (call12)
76 */
77#define MAKE_RA_FOR_CALL(ra,ws) (((ra) & 0x3fffffff) | (ws) << 30)
78
79/* Convert return address to a valid pc
80 * Note: We assume that the stack pointer is in the same 1GB ranges as the ra
81 */
82#define MAKE_PC_FROM_RA(ra,sp) (((ra) & 0x3fffffff) | ((sp) & 0xc0000000))
83
84typedef struct {
85 unsigned long seg;
86} mm_segment_t;
87
88struct thread_struct {
89
90 /* kernel's return address and stack pointer for context switching */
91 unsigned long ra; /* kernel's a0: return address and window call size */
92 unsigned long sp; /* kernel's a1: stack pointer */
93
94 mm_segment_t current_ds; /* see uaccess.h for example uses */
95
96 /* struct xtensa_cpuinfo info; */
97
98 unsigned long bad_vaddr; /* last user fault */
99 unsigned long bad_uaddr; /* last kernel fault accessing user space */
100 unsigned long error_code;
101
102 unsigned long ibreak[XCHAL_NUM_IBREAK];
103 unsigned long dbreaka[XCHAL_NUM_DBREAK];
104 unsigned long dbreakc[XCHAL_NUM_DBREAK];
105
106 /* Make structure 16 bytes aligned. */
107 int align[0] __attribute__ ((aligned(16)));
108};
109
110
111/*
112 * Default implementation of macro that returns current
113 * instruction pointer ("program counter").
114 */
115#define current_text_addr() ({ __label__ _l; _l: &&_l;})
116
117
118/* This decides where the kernel will search for a free chunk of vm
119 * space during mmap's.
120 */
121#define TASK_UNMAPPED_BASE (TASK_SIZE / 2)
122
123#define INIT_THREAD \
124{ \
125 ra: 0, \
126 sp: sizeof(init_stack) + (long) &init_stack, \
127 current_ds: {0}, \
128 /*info: {0}, */ \
129 bad_vaddr: 0, \
130 bad_uaddr: 0, \
131 error_code: 0, \
132}
133
134
135/*
136 * Do necessary setup to start up a newly executed thread.
137 * Note: We set-up ps as if we did a call4 to the new pc.
138 * set_thread_state in signal.c depends on it.
139 */
140#define USER_PS_VALUE ((1 << PS_WOE_BIT) | \
141 (1 << PS_CALLINC_SHIFT) | \
142 (USER_RING << PS_RING_SHIFT) | \
143 (1 << PS_UM_BIT) | \
144 (1 << PS_EXCM_BIT))
145
146/* Clearing a0 terminates the backtrace. */
147#define start_thread(regs, new_pc, new_sp) \
148 regs->pc = new_pc; \
149 regs->ps = USER_PS_VALUE; \
150 regs->areg[1] = new_sp; \
151 regs->areg[0] = 0; \
152 regs->wmask = 1; \
153 regs->depc = 0; \
154 regs->windowbase = 0; \
155 regs->windowstart = 1;
156
157/* Forward declaration */
158struct task_struct;
159struct mm_struct;
160
161/* Free all resources held by a thread. */
162#define release_thread(thread) do { } while(0)
163
164/* Prepare to copy thread state - unlazy all lazy status */
165extern void prepare_to_copy(struct task_struct*);
166
167/* Create a kernel thread without removing it from tasklists */
168extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
169
170/* Copy and release all segment info associated with a VM */
171#define copy_segments(p, mm) do { } while(0)
172#define release_segments(mm) do { } while(0)
173#define forget_segments() do { } while (0)
174
175#define thread_saved_pc(tsk) (task_pt_regs(tsk)->pc)
176
177extern unsigned long get_wchan(struct task_struct *p);
178
179#define KSTK_EIP(tsk) (task_pt_regs(tsk)->pc)
180#define KSTK_ESP(tsk) (task_pt_regs(tsk)->areg[1])
181
182#define cpu_relax() barrier()
183
184/* Special register access. */
185
186#define WSR(v,sr) __asm__ __volatile__ ("wsr %0,"__stringify(sr) :: "a"(v));
187#define RSR(v,sr) __asm__ __volatile__ ("rsr %0,"__stringify(sr) : "=a"(v));
188
189#define set_sr(x,sr) ({unsigned int v=(unsigned int)x; WSR(v,sr);})
190#define get_sr(sr) ({unsigned int v; RSR(v,sr); v; })
191
192#endif /* __ASSEMBLY__ */
193#endif /* _XTENSA_PROCESSOR_H */
diff --git a/arch/xtensa/include/asm/ptrace.h b/arch/xtensa/include/asm/ptrace.h
new file mode 100644
index 000000000000..905e1e619654
--- /dev/null
+++ b/arch/xtensa/include/asm/ptrace.h
@@ -0,0 +1,135 @@
1/*
2 * include/asm-xtensa/ptrace.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PTRACE_H
12#define _XTENSA_PTRACE_H
13
14/*
15 * Kernel stack
16 *
17 * +-----------------------+ -------- STACK_SIZE
18 * | register file | |
19 * +-----------------------+ |
20 * | struct pt_regs | |
21 * +-----------------------+ | ------ PT_REGS_OFFSET
22 * double : 16 bytes spill area : | ^
23 * excetion :- - - - - - - - - - - -: | |
24 * frame : struct pt_regs : | |
25 * :- - - - - - - - - - - -: | |
26 * | | | |
27 * | memory stack | | |
28 * | | | |
29 * ~ ~ ~ ~
30 * ~ ~ ~ ~
31 * | | | |
32 * | | | |
33 * +-----------------------+ | | --- STACK_BIAS
34 * | struct task_struct | | | ^
35 * current --> +-----------------------+ | | |
36 * | struct thread_info | | | |
37 * +-----------------------+ --------
38 */
39
40#define KERNEL_STACK_SIZE (2 * PAGE_SIZE)
41
42/* Offsets for exception_handlers[] (3 x 64-entries x 4-byte tables). */
43
44#define EXC_TABLE_KSTK 0x004 /* Kernel Stack */
45#define EXC_TABLE_DOUBLE_SAVE 0x008 /* Double exception save area for a0 */
46#define EXC_TABLE_FIXUP 0x00c /* Fixup handler */
47#define EXC_TABLE_PARAM 0x010 /* For passing a parameter to fixup */
48#define EXC_TABLE_SYSCALL_SAVE 0x014 /* For fast syscall handler */
49#define EXC_TABLE_FAST_USER 0x100 /* Fast user exception handler */
50#define EXC_TABLE_FAST_KERNEL 0x200 /* Fast kernel exception handler */
51#define EXC_TABLE_DEFAULT 0x300 /* Default C-Handler */
52#define EXC_TABLE_SIZE 0x400
53
54/* Registers used by strace */
55
56#define REG_A_BASE 0x0000
57#define REG_AR_BASE 0x0100
58#define REG_PC 0x0020
59#define REG_PS 0x02e6
60#define REG_WB 0x0248
61#define REG_WS 0x0249
62#define REG_LBEG 0x0200
63#define REG_LEND 0x0201
64#define REG_LCOUNT 0x0202
65#define REG_SAR 0x0203
66
67#define SYSCALL_NR 0x00ff
68
69/* Other PTRACE_ values defined in <linux/ptrace.h> using values 0-9,16,17,24 */
70
71#define PTRACE_GETREGS 12
72#define PTRACE_SETREGS 13
73#define PTRACE_GETXTREGS 18
74#define PTRACE_SETXTREGS 19
75
76#ifdef __KERNEL__
77
78#ifndef __ASSEMBLY__
79
80/*
81 * This struct defines the way the registers are stored on the
82 * kernel stack during a system call or other kernel entry.
83 */
84struct pt_regs {
85 unsigned long pc; /* 4 */
86 unsigned long ps; /* 8 */
87 unsigned long depc; /* 12 */
88 unsigned long exccause; /* 16 */
89 unsigned long excvaddr; /* 20 */
90 unsigned long debugcause; /* 24 */
91 unsigned long wmask; /* 28 */
92 unsigned long lbeg; /* 32 */
93 unsigned long lend; /* 36 */
94 unsigned long lcount; /* 40 */
95 unsigned long sar; /* 44 */
96 unsigned long windowbase; /* 48 */
97 unsigned long windowstart; /* 52 */
98 unsigned long syscall; /* 56 */
99 unsigned long icountlevel; /* 60 */
100 int reserved[1]; /* 64 */
101
102 /* Additional configurable registers that are used by the compiler. */
103 xtregs_opt_t xtregs_opt;
104
105 /* Make sure the areg field is 16 bytes aligned. */
106 int align[0] __attribute__ ((aligned(16)));
107
108 /* current register frame.
109 * Note: The ESF for kernel exceptions ends after 16 registers!
110 */
111 unsigned long areg[16]; /* 128 (64) */
112};
113
114#include <variant/core.h>
115
116# define task_pt_regs(tsk) ((struct pt_regs*) \
117 (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1)
118# define user_mode(regs) (((regs)->ps & 0x00000020)!=0)
119# define instruction_pointer(regs) ((regs)->pc)
120extern void show_regs(struct pt_regs *);
121
122# ifndef CONFIG_SMP
123# define profile_pc(regs) instruction_pointer(regs)
124# endif
125
126#else /* __ASSEMBLY__ */
127
128# include <asm/asm-offsets.h>
129#define PT_REGS_OFFSET (KERNEL_STACK_SIZE - PT_USER_SIZE)
130
131#endif /* !__ASSEMBLY__ */
132
133#endif /* __KERNEL__ */
134
135#endif /* _XTENSA_PTRACE_H */
diff --git a/arch/xtensa/include/asm/regs.h b/arch/xtensa/include/asm/regs.h
new file mode 100644
index 000000000000..d4baed246928
--- /dev/null
+++ b/arch/xtensa/include/asm/regs.h
@@ -0,0 +1,145 @@
1/*
2 * Copyright (c) 2006 Tensilica, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of version 2.1 of the GNU Lesser General Public
6 * License as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this program; if not, write the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307,
22 * USA.
23 */
24
25#ifndef _XTENSA_REGS_H
26#define _XTENSA_REGS_H
27
28/* Special registers. */
29
30#define LBEG 0
31#define LEND 1
32#define LCOUNT 2
33#define SAR 3
34#define BR 4
35#define SCOMPARE1 12
36#define ACCHI 16
37#define ACCLO 17
38#define MR 32
39#define WINDOWBASE 72
40#define WINDOWSTART 73
41#define PTEVADDR 83
42#define RASID 90
43#define ITLBCFG 91
44#define DTLBCFG 92
45#define IBREAKENABLE 96
46#define DDR 104
47#define IBREAKA 128
48#define DBREAKA 144
49#define DBREAKC 160
50#define EPC 176
51#define EPC_1 177
52#define DEPC 192
53#define EPS 192
54#define EPS_1 193
55#define EXCSAVE 208
56#define EXCSAVE_1 209
57#define INTERRUPT 226
58#define INTENABLE 228
59#define PS 230
60#define THREADPTR 231
61#define EXCCAUSE 232
62#define DEBUGCAUSE 233
63#define CCOUNT 234
64#define PRID 235
65#define ICOUNT 236
66#define ICOUNTLEVEL 237
67#define EXCVADDR 238
68#define CCOMPARE 240
69#define MISC 244
70
71/* Special names for read-only and write-only interrupt registers. */
72
73#define INTREAD 226
74#define INTSET 226
75#define INTCLEAR 227
76
77/* EXCCAUSE register fields */
78
79#define EXCCAUSE_EXCCAUSE_SHIFT 0
80#define EXCCAUSE_EXCCAUSE_MASK 0x3F
81
82#define EXCCAUSE_ILLEGAL_INSTRUCTION 0
83#define EXCCAUSE_SYSTEM_CALL 1
84#define EXCCAUSE_INSTRUCTION_FETCH_ERROR 2
85#define EXCCAUSE_LOAD_STORE_ERROR 3
86#define EXCCAUSE_LEVEL1_INTERRUPT 4
87#define EXCCAUSE_ALLOCA 5
88#define EXCCAUSE_INTEGER_DIVIDE_BY_ZERO 6
89#define EXCCAUSE_SPECULATION 7
90#define EXCCAUSE_PRIVILEGED 8
91#define EXCCAUSE_UNALIGNED 9
92#define EXCCAUSE_ITLB_MISS 16
93#define EXCCAUSE_ITLB_MULTIHIT 17
94#define EXCCAUSE_ITLB_PRIVILEGE 18
95#define EXCCAUSE_ITLB_SIZE_RESTRICTION 19
96#define EXCCAUSE_FETCH_CACHE_ATTRIBUTE 20
97#define EXCCAUSE_DTLB_MISS 24
98#define EXCCAUSE_DTLB_MULTIHIT 25
99#define EXCCAUSE_DTLB_PRIVILEGE 26
100#define EXCCAUSE_DTLB_SIZE_RESTRICTION 27
101#define EXCCAUSE_LOAD_CACHE_ATTRIBUTE 28
102#define EXCCAUSE_STORE_CACHE_ATTRIBUTE 29
103#define EXCCAUSE_COPROCESSOR0_DISABLED 32
104#define EXCCAUSE_COPROCESSOR1_DISABLED 33
105#define EXCCAUSE_COPROCESSOR2_DISABLED 34
106#define EXCCAUSE_COPROCESSOR3_DISABLED 35
107#define EXCCAUSE_COPROCESSOR4_DISABLED 36
108#define EXCCAUSE_COPROCESSOR5_DISABLED 37
109#define EXCCAUSE_COPROCESSOR6_DISABLED 38
110#define EXCCAUSE_COPROCESSOR7_DISABLED 39
111
112/* PS register fields. */
113
114#define PS_WOE_BIT 18
115#define PS_CALLINC_SHIFT 16
116#define PS_CALLINC_MASK 0x00030000
117#define PS_OWB_SHIFT 8
118#define PS_OWB_MASK 0x00000F00
119#define PS_RING_SHIFT 6
120#define PS_RING_MASK 0x000000C0
121#define PS_UM_BIT 5
122#define PS_EXCM_BIT 4
123#define PS_INTLEVEL_SHIFT 0
124#define PS_INTLEVEL_MASK 0x0000000F
125
126/* DBREAKCn register fields. */
127
128#define DBREAKC_MASK_BIT 0
129#define DBREAKC_MASK_MASK 0x0000003F
130#define DBREAKC_LOAD_BIT 30
131#define DBREAKC_LOAD_MASK 0x40000000
132#define DBREAKC_STOR_BIT 31
133#define DBREAKC_STOR_MASK 0x80000000
134
135/* DEBUGCAUSE register fields. */
136
137#define DEBUGCAUSE_DEBUGINT_BIT 5 /* External debug interrupt */
138#define DEBUGCAUSE_BREAKN_BIT 4 /* BREAK.N instruction */
139#define DEBUGCAUSE_BREAK_BIT 3 /* BREAK instruction */
140#define DEBUGCAUSE_DBREAK_BIT 2 /* DBREAK match */
141#define DEBUGCAUSE_IBREAK_BIT 1 /* IBREAK match */
142#define DEBUGCAUSE_ICOUNT_BIT 0 /* ICOUNT would incr. to zero */
143
144#endif /* _XTENSA_SPECREG_H */
145
diff --git a/arch/xtensa/include/asm/resource.h b/arch/xtensa/include/asm/resource.h
new file mode 100644
index 000000000000..17b5ab311771
--- /dev/null
+++ b/arch/xtensa/include/asm/resource.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/resource.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_RESOURCE_H
12#define _XTENSA_RESOURCE_H
13
14#include <asm-generic/resource.h>
15
16#endif /* _XTENSA_RESOURCE_H */
diff --git a/arch/xtensa/include/asm/rmap.h b/arch/xtensa/include/asm/rmap.h
new file mode 100644
index 000000000000..649588b7e9ad
--- /dev/null
+++ b/arch/xtensa/include/asm/rmap.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/rmap.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_RMAP_H
12#define _XTENSA_RMAP_H
13
14#include <asm-generic/rmap.h>
15
16#endif
diff --git a/arch/xtensa/include/asm/rwsem.h b/arch/xtensa/include/asm/rwsem.h
new file mode 100644
index 000000000000..e39edf5c86f2
--- /dev/null
+++ b/arch/xtensa/include/asm/rwsem.h
@@ -0,0 +1,168 @@
1/*
2 * include/asm-xtensa/rwsem.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Largely copied from include/asm-ppc/rwsem.h
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_RWSEM_H
14#define _XTENSA_RWSEM_H
15
16#ifndef _LINUX_RWSEM_H
17#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
18#endif
19
20#include <linux/list.h>
21#include <linux/spinlock.h>
22#include <asm/atomic.h>
23#include <asm/system.h>
24
25/*
26 * the semaphore definition
27 */
28struct rw_semaphore {
29 signed long count;
30#define RWSEM_UNLOCKED_VALUE 0x00000000
31#define RWSEM_ACTIVE_BIAS 0x00000001
32#define RWSEM_ACTIVE_MASK 0x0000ffff
33#define RWSEM_WAITING_BIAS (-0x00010000)
34#define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
35#define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
36 spinlock_t wait_lock;
37 struct list_head wait_list;
38};
39
40#define __RWSEM_INITIALIZER(name) \
41 { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \
42 LIST_HEAD_INIT((name).wait_list) }
43
44#define DECLARE_RWSEM(name) \
45 struct rw_semaphore name = __RWSEM_INITIALIZER(name)
46
47extern struct rw_semaphore *rwsem_down_read_failed(struct rw_semaphore *sem);
48extern struct rw_semaphore *rwsem_down_write_failed(struct rw_semaphore *sem);
49extern struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem);
50extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
51
52static inline void init_rwsem(struct rw_semaphore *sem)
53{
54 sem->count = RWSEM_UNLOCKED_VALUE;
55 spin_lock_init(&sem->wait_lock);
56 INIT_LIST_HEAD(&sem->wait_list);
57}
58
59/*
60 * lock for reading
61 */
62static inline void __down_read(struct rw_semaphore *sem)
63{
64 if (atomic_add_return(1,(atomic_t *)(&sem->count)) > 0)
65 smp_wmb();
66 else
67 rwsem_down_read_failed(sem);
68}
69
70static inline int __down_read_trylock(struct rw_semaphore *sem)
71{
72 int tmp;
73
74 while ((tmp = sem->count) >= 0) {
75 if (tmp == cmpxchg(&sem->count, tmp,
76 tmp + RWSEM_ACTIVE_READ_BIAS)) {
77 smp_wmb();
78 return 1;
79 }
80 }
81 return 0;
82}
83
84/*
85 * lock for writing
86 */
87static inline void __down_write(struct rw_semaphore *sem)
88{
89 int tmp;
90
91 tmp = atomic_add_return(RWSEM_ACTIVE_WRITE_BIAS,
92 (atomic_t *)(&sem->count));
93 if (tmp == RWSEM_ACTIVE_WRITE_BIAS)
94 smp_wmb();
95 else
96 rwsem_down_write_failed(sem);
97}
98
99static inline int __down_write_trylock(struct rw_semaphore *sem)
100{
101 int tmp;
102
103 tmp = cmpxchg(&sem->count, RWSEM_UNLOCKED_VALUE,
104 RWSEM_ACTIVE_WRITE_BIAS);
105 smp_wmb();
106 return tmp == RWSEM_UNLOCKED_VALUE;
107}
108
109/*
110 * unlock after reading
111 */
112static inline void __up_read(struct rw_semaphore *sem)
113{
114 int tmp;
115
116 smp_wmb();
117 tmp = atomic_sub_return(1,(atomic_t *)(&sem->count));
118 if (tmp < -1 && (tmp & RWSEM_ACTIVE_MASK) == 0)
119 rwsem_wake(sem);
120}
121
122/*
123 * unlock after writing
124 */
125static inline void __up_write(struct rw_semaphore *sem)
126{
127 smp_wmb();
128 if (atomic_sub_return(RWSEM_ACTIVE_WRITE_BIAS,
129 (atomic_t *)(&sem->count)) < 0)
130 rwsem_wake(sem);
131}
132
133/*
134 * implement atomic add functionality
135 */
136static inline void rwsem_atomic_add(int delta, struct rw_semaphore *sem)
137{
138 atomic_add(delta, (atomic_t *)(&sem->count));
139}
140
141/*
142 * downgrade write lock to read lock
143 */
144static inline void __downgrade_write(struct rw_semaphore *sem)
145{
146 int tmp;
147
148 smp_wmb();
149 tmp = atomic_add_return(-RWSEM_WAITING_BIAS, (atomic_t *)(&sem->count));
150 if (tmp < 0)
151 rwsem_downgrade_wake(sem);
152}
153
154/*
155 * implement exchange and add functionality
156 */
157static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
158{
159 smp_mb();
160 return atomic_add_return(delta, (atomic_t *)(&sem->count));
161}
162
163static inline int rwsem_is_locked(struct rw_semaphore *sem)
164{
165 return (sem->count != 0);
166}
167
168#endif /* _XTENSA_RWSEM_H */
diff --git a/arch/xtensa/include/asm/scatterlist.h b/arch/xtensa/include/asm/scatterlist.h
new file mode 100644
index 000000000000..810080bb0a2b
--- /dev/null
+++ b/arch/xtensa/include/asm/scatterlist.h
@@ -0,0 +1,39 @@
1/*
2 * include/asm-xtensa/scatterlist.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SCATTERLIST_H
12#define _XTENSA_SCATTERLIST_H
13
14#include <asm/types.h>
15
16struct scatterlist {
17#ifdef CONFIG_DEBUG_SG
18 unsigned long sg_magic;
19#endif
20 unsigned long page_link;
21 unsigned int offset;
22 dma_addr_t dma_address;
23 unsigned int length;
24};
25
26/*
27 * These macros should be used after a pci_map_sg call has been done
28 * to get bus addresses of each of the SG entries and their lengths.
29 * You should only work with the number of sg entries pci_map_sg
30 * returns, or alternatively stop on the first sg_dma_len(sg) which
31 * is 0.
32 */
33#define sg_dma_address(sg) ((sg)->dma_address)
34#define sg_dma_len(sg) ((sg)->length)
35
36
37#define ISA_DMA_THRESHOLD (~0UL)
38
39#endif /* _XTENSA_SCATTERLIST_H */
diff --git a/arch/xtensa/include/asm/sections.h b/arch/xtensa/include/asm/sections.h
new file mode 100644
index 000000000000..40b5191b55a2
--- /dev/null
+++ b/arch/xtensa/include/asm/sections.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/sections.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SECTIONS_H
12#define _XTENSA_SECTIONS_H
13
14#include <asm-generic/sections.h>
15
16#endif /* _XTENSA_SECTIONS_H */
diff --git a/arch/xtensa/include/asm/segment.h b/arch/xtensa/include/asm/segment.h
new file mode 100644
index 000000000000..a2eb547a1a75
--- /dev/null
+++ b/arch/xtensa/include/asm/segment.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/segment.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SEGMENT_H
12#define _XTENSA_SEGMENT_H
13
14#include <asm/uaccess.h>
15
16#endif /* _XTENSA_SEGEMENT_H */
diff --git a/arch/xtensa/include/asm/sembuf.h b/arch/xtensa/include/asm/sembuf.h
new file mode 100644
index 000000000000..c15870493b33
--- /dev/null
+++ b/arch/xtensa/include/asm/sembuf.h
@@ -0,0 +1,44 @@
1/*
2 * include/asm-xtensa/sembuf.h
3 *
4 * The semid64_ds structure for Xtensa architecture.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 *
12 * Note extra padding because this structure is passed back and forth
13 * between kernel and user space.
14 *
15 * Pad space is left for:
16 * - 64-bit time_t to solve y2038 problem
17 * - 2 miscellaneous 32-bit values
18 *
19 */
20
21#ifndef _XTENSA_SEMBUF_H
22#define _XTENSA_SEMBUF_H
23
24#include <asm/byteorder.h>
25
26struct semid64_ds {
27 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
28#ifdef __XTENSA_EL__
29 __kernel_time_t sem_otime; /* last semop time */
30 unsigned long __unused1;
31 __kernel_time_t sem_ctime; /* last change time */
32 unsigned long __unused2;
33#else
34 unsigned long __unused1;
35 __kernel_time_t sem_otime; /* last semop time */
36 unsigned long __unused2;
37 __kernel_time_t sem_ctime; /* last change time */
38#endif
39 unsigned long sem_nsems; /* no. of semaphores in array */
40 unsigned long __unused3;
41 unsigned long __unused4;
42};
43
44#endif /* __ASM_XTENSA_SEMBUF_H */
diff --git a/arch/xtensa/include/asm/serial.h b/arch/xtensa/include/asm/serial.h
new file mode 100644
index 000000000000..a8a2493260f6
--- /dev/null
+++ b/arch/xtensa/include/asm/serial.h
@@ -0,0 +1,18 @@
1/*
2 * include/asm-xtensa/serial.h
3 *
4 * Configuration details for 8250, 16450, 16550, etc. serial ports
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_SERIAL_H
14#define _XTENSA_SERIAL_H
15
16#include <platform/serial.h>
17
18#endif /* _XTENSA_SERIAL_H */
diff --git a/arch/xtensa/include/asm/setup.h b/arch/xtensa/include/asm/setup.h
new file mode 100644
index 000000000000..e3636520d8cc
--- /dev/null
+++ b/arch/xtensa/include/asm/setup.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/setup.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SETUP_H
12#define _XTENSA_SETUP_H
13
14#define COMMAND_LINE_SIZE 256
15
16#endif
diff --git a/arch/xtensa/include/asm/shmbuf.h b/arch/xtensa/include/asm/shmbuf.h
new file mode 100644
index 000000000000..ad4b0121782c
--- /dev/null
+++ b/arch/xtensa/include/asm/shmbuf.h
@@ -0,0 +1,71 @@
1/*
2 * include/asm-xtensa/shmbuf.h
3 *
4 * The shmid64_ds structure for Xtensa architecture.
5 * Note extra padding because this structure is passed back and forth
6 * between kernel and user space.
7 *
8 * Pad space is left for:
9 * - 64-bit time_t to solve y2038 problem
10 * - 2 miscellaneous 32-bit values
11 *
12 * This file is subject to the terms and conditions of the GNU General Public
13 * License. See the file "COPYING" in the main directory of this archive
14 * for more details.
15 *
16 * Copyright (C) 2001 - 2005 Tensilica Inc.
17 */
18
19#ifndef _XTENSA_SHMBUF_H
20#define _XTENSA_SHMBUF_H
21
22#if defined (__XTENSA_EL__)
23struct shmid64_ds {
24 struct ipc64_perm shm_perm; /* operation perms */
25 size_t shm_segsz; /* size of segment (bytes) */
26 __kernel_time_t shm_atime; /* last attach time */
27 unsigned long __unused1;
28 __kernel_time_t shm_dtime; /* last detach time */
29 unsigned long __unused2;
30 __kernel_time_t shm_ctime; /* last change time */
31 unsigned long __unused3;
32 __kernel_pid_t shm_cpid; /* pid of creator */
33 __kernel_pid_t shm_lpid; /* pid of last operator */
34 unsigned long shm_nattch; /* no. of current attaches */
35 unsigned long __unused4;
36 unsigned long __unused5;
37};
38#elif defined (__XTENSA_EB__)
39struct shmid64_ds {
40 struct ipc64_perm shm_perm; /* operation perms */
41 size_t shm_segsz; /* size of segment (bytes) */
42 __kernel_time_t shm_atime; /* last attach time */
43 unsigned long __unused1;
44 __kernel_time_t shm_dtime; /* last detach time */
45 unsigned long __unused2;
46 __kernel_time_t shm_ctime; /* last change time */
47 unsigned long __unused3;
48 __kernel_pid_t shm_cpid; /* pid of creator */
49 __kernel_pid_t shm_lpid; /* pid of last operator */
50 unsigned long shm_nattch; /* no. of current attaches */
51 unsigned long __unused4;
52 unsigned long __unused5;
53};
54#else
55# error endian order not defined
56#endif
57
58
59struct shminfo64 {
60 unsigned long shmmax;
61 unsigned long shmmin;
62 unsigned long shmmni;
63 unsigned long shmseg;
64 unsigned long shmall;
65 unsigned long __unused1;
66 unsigned long __unused2;
67 unsigned long __unused3;
68 unsigned long __unused4;
69};
70
71#endif /* _XTENSA_SHMBUF_H */
diff --git a/arch/xtensa/include/asm/shmparam.h b/arch/xtensa/include/asm/shmparam.h
new file mode 100644
index 000000000000..c8cc16c3da9e
--- /dev/null
+++ b/arch/xtensa/include/asm/shmparam.h
@@ -0,0 +1,21 @@
1/*
2 * include/asm-xtensa/shmparam.h
3 *
4 * This file is subject to the terms and conditions of the GNU General
5 * Public License. See the file "COPYING" in the main directory of
6 * this archive for more details.
7 */
8
9#ifndef _XTENSA_SHMPARAM_H
10#define _XTENSA_SHMPARAM_H
11
12/*
13 * Xtensa can have variable size caches, and if
14 * the size of single way is larger than the page size,
15 * then we have to start worrying about cache aliasing
16 * problems.
17 */
18
19#define SHMLBA ((PAGE_SIZE > DCACHE_WAY_SIZE)? PAGE_SIZE : DCACHE_WAY_SIZE)
20
21#endif /* _XTENSA_SHMPARAM_H */
diff --git a/arch/xtensa/include/asm/sigcontext.h b/arch/xtensa/include/asm/sigcontext.h
new file mode 100644
index 000000000000..03383af8c3b7
--- /dev/null
+++ b/arch/xtensa/include/asm/sigcontext.h
@@ -0,0 +1,28 @@
1/*
2 * include/asm-xtensa/sigcontext.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2007 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SIGCONTEXT_H
12#define _XTENSA_SIGCONTEXT_H
13
14
15struct sigcontext {
16 unsigned long sc_pc;
17 unsigned long sc_ps;
18 unsigned long sc_lbeg;
19 unsigned long sc_lend;
20 unsigned long sc_lcount;
21 unsigned long sc_sar;
22 unsigned long sc_acclo;
23 unsigned long sc_acchi;
24 unsigned long sc_a[16];
25 void *sc_xtregs;
26};
27
28#endif /* _XTENSA_SIGCONTEXT_H */
diff --git a/arch/xtensa/include/asm/siginfo.h b/arch/xtensa/include/asm/siginfo.h
new file mode 100644
index 000000000000..6916248295df
--- /dev/null
+++ b/arch/xtensa/include/asm/siginfo.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/siginfo.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SIGINFO_H
12#define _XTENSA_SIGINFO_H
13
14#include <asm-generic/siginfo.h>
15
16#endif /* _XTENSA_SIGINFO_H */
diff --git a/arch/xtensa/include/asm/signal.h b/arch/xtensa/include/asm/signal.h
new file mode 100644
index 000000000000..633ba73bc4d2
--- /dev/null
+++ b/arch/xtensa/include/asm/signal.h
@@ -0,0 +1,172 @@
1/*
2 * include/asm-xtensa/signal.h
3 *
4 * Swiped from SH.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_SIGNAL_H
14#define _XTENSA_SIGNAL_H
15
16
17#define _NSIG 64
18#define _NSIG_BPW 32
19#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
20
21#ifndef __ASSEMBLY__
22
23#include <linux/types.h>
24
25/* Avoid too many header ordering problems. */
26struct siginfo;
27typedef unsigned long old_sigset_t; /* at least 32 bits */
28typedef struct {
29 unsigned long sig[_NSIG_WORDS];
30} sigset_t;
31
32#endif
33
34#define SIGHUP 1
35#define SIGINT 2
36#define SIGQUIT 3
37#define SIGILL 4
38#define SIGTRAP 5
39#define SIGABRT 6
40#define SIGIOT 6
41#define SIGBUS 7
42#define SIGFPE 8
43#define SIGKILL 9
44#define SIGUSR1 10
45#define SIGSEGV 11
46#define SIGUSR2 12
47#define SIGPIPE 13
48#define SIGALRM 14
49#define SIGTERM 15
50#define SIGSTKFLT 16
51#define SIGCHLD 17
52#define SIGCONT 18
53#define SIGSTOP 19
54#define SIGTSTP 20
55#define SIGTTIN 21
56#define SIGTTOU 22
57#define SIGURG 23
58#define SIGXCPU 24
59#define SIGXFSZ 25
60#define SIGVTALRM 26
61#define SIGPROF 27
62#define SIGWINCH 28
63#define SIGIO 29
64#define SIGPOLL SIGIO
65/* #define SIGLOST 29 */
66#define SIGPWR 30
67#define SIGSYS 31
68#define SIGUNUSED 31
69
70/* These should not be considered constants from userland. */
71#define SIGRTMIN 32
72#define SIGRTMAX (_NSIG-1)
73
74/*
75 * SA_FLAGS values:
76 *
77 * SA_ONSTACK indicates that a registered stack_t will be used.
78 * SA_RESTART flag to get restarting signals (which were the default long ago)
79 * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
80 * SA_RESETHAND clears the handler when the signal is delivered.
81 * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
82 * SA_NODEFER prevents the current signal from being masked in the handler.
83 *
84 * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
85 * Unix names RESETHAND and NODEFER respectively.
86 */
87#define SA_NOCLDSTOP 0x00000001
88#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
89#define SA_SIGINFO 0x00000004
90#define SA_ONSTACK 0x08000000
91#define SA_RESTART 0x10000000
92#define SA_NODEFER 0x40000000
93#define SA_RESETHAND 0x80000000
94
95#define SA_NOMASK SA_NODEFER
96#define SA_ONESHOT SA_RESETHAND
97
98#define SA_RESTORER 0x04000000
99
100/*
101 * sigaltstack controls
102 */
103#define SS_ONSTACK 1
104#define SS_DISABLE 2
105
106#define MINSIGSTKSZ 2048
107#define SIGSTKSZ 8192
108
109#ifndef __ASSEMBLY__
110
111#define SIG_BLOCK 0 /* for blocking signals */
112#define SIG_UNBLOCK 1 /* for unblocking signals */
113#define SIG_SETMASK 2 /* for setting the signal mask */
114
115/* Type of a signal handler. */
116typedef void (*__sighandler_t)(int);
117
118#define SIG_DFL ((__sighandler_t)0) /* default signal handling */
119#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
120#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
121
122#ifdef __KERNEL__
123struct old_sigaction {
124 __sighandler_t sa_handler;
125 old_sigset_t sa_mask;
126 unsigned long sa_flags;
127 void (*sa_restorer)(void);
128};
129
130struct sigaction {
131 __sighandler_t sa_handler;
132 unsigned long sa_flags;
133 void (*sa_restorer)(void);
134 sigset_t sa_mask; /* mask last for extensibility */
135};
136
137struct k_sigaction {
138 struct sigaction sa;
139};
140
141#else
142
143/* Here we must cater to libcs that poke about in kernel headers. */
144
145struct sigaction {
146 union {
147 __sighandler_t _sa_handler;
148 void (*_sa_sigaction)(int, struct siginfo *, void *);
149 } _u;
150 sigset_t sa_mask;
151 unsigned long sa_flags;
152 void (*sa_restorer)(void);
153};
154
155#define sa_handler _u._sa_handler
156#define sa_sigaction _u._sa_sigaction
157
158#endif /* __KERNEL__ */
159
160typedef struct sigaltstack {
161 void *ss_sp;
162 int ss_flags;
163 size_t ss_size;
164} stack_t;
165
166#ifdef __KERNEL__
167#include <asm/sigcontext.h>
168#define ptrace_signal_deliver(regs, cookie) do { } while (0)
169
170#endif /* __KERNEL__ */
171#endif /* __ASSEMBLY__ */
172#endif /* _XTENSA_SIGNAL_H */
diff --git a/arch/xtensa/include/asm/smp.h b/arch/xtensa/include/asm/smp.h
new file mode 100644
index 000000000000..83c569e3bdbd
--- /dev/null
+++ b/arch/xtensa/include/asm/smp.h
@@ -0,0 +1,27 @@
1/*
2 * include/asm-xtensa/smp.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SMP_H
12#define _XTENSA_SMP_H
13
14extern struct xtensa_cpuinfo boot_cpu_data;
15
16#define cpu_data (&boot_cpu_data)
17#define current_cpu_data boot_cpu_data
18
19struct xtensa_cpuinfo {
20 unsigned long *pgd_cache;
21 unsigned long *pte_cache;
22 unsigned long pgtable_cache_sz;
23};
24
25#define cpu_logical_map(cpu) (cpu)
26
27#endif /* _XTENSA_SMP_H */
diff --git a/arch/xtensa/include/asm/socket.h b/arch/xtensa/include/asm/socket.h
new file mode 100644
index 000000000000..6100682b1da2
--- /dev/null
+++ b/arch/xtensa/include/asm/socket.h
@@ -0,0 +1,68 @@
1/*
2 * include/asm-xtensa/socket.h
3 *
4 * Copied from i386.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef _XTENSA_SOCKET_H
12#define _XTENSA_SOCKET_H
13
14#include <asm/sockios.h>
15
16/* For setsockoptions(2) */
17#define SOL_SOCKET 1
18
19#define SO_DEBUG 1
20#define SO_REUSEADDR 2
21#define SO_TYPE 3
22#define SO_ERROR 4
23#define SO_DONTROUTE 5
24#define SO_BROADCAST 6
25#define SO_SNDBUF 7
26#define SO_RCVBUF 8
27#define SO_SNDBUFFORCE 32
28#define SO_RCVBUFFORCE 33
29#define SO_KEEPALIVE 9
30#define SO_OOBINLINE 10
31#define SO_NO_CHECK 11
32#define SO_PRIORITY 12
33#define SO_LINGER 13
34#define SO_BSDCOMPAT 14
35/* To add :#define SO_REUSEPORT 15 */
36#define SO_PASSCRED 16
37#define SO_PEERCRED 17
38#define SO_RCVLOWAT 18
39#define SO_SNDLOWAT 19
40#define SO_RCVTIMEO 20
41#define SO_SNDTIMEO 21
42
43/* Security levels - as per NRL IPv6 - don't actually do anything */
44
45#define SO_SECURITY_AUTHENTICATION 22
46#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
47#define SO_SECURITY_ENCRYPTION_NETWORK 24
48
49#define SO_BINDTODEVICE 25
50
51/* Socket filtering */
52
53#define SO_ATTACH_FILTER 26
54#define SO_DETACH_FILTER 27
55
56#define SO_PEERNAME 28
57#define SO_TIMESTAMP 29
58#define SCM_TIMESTAMP SO_TIMESTAMP
59
60#define SO_ACCEPTCONN 30
61#define SO_PEERSEC 31
62#define SO_PASSSEC 34
63#define SO_TIMESTAMPNS 35
64#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
65
66#define SO_MARK 36
67
68#endif /* _XTENSA_SOCKET_H */
diff --git a/arch/xtensa/include/asm/sockios.h b/arch/xtensa/include/asm/sockios.h
new file mode 100644
index 000000000000..efe0af379f01
--- /dev/null
+++ b/arch/xtensa/include/asm/sockios.h
@@ -0,0 +1,31 @@
1/*
2 * include/asm-xtensa/sockios.h
3 *
4 * Socket-level I/O control calls. Copied from MIPS.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1995 by Ralf Baechle
11 * Copyright (C) 2001 Tensilica Inc.
12 */
13
14#ifndef _XTENSA_SOCKIOS_H
15#define _XTENSA_SOCKIOS_H
16
17#include <asm/ioctl.h>
18
19/* Socket-level I/O control calls. */
20
21#define FIOGETOWN _IOR('f', 123, int)
22#define FIOSETOWN _IOW('f', 124, int)
23
24#define SIOCATMARK _IOR('s', 7, int)
25#define SIOCSPGRP _IOW('s', 8, pid_t)
26#define SIOCGPGRP _IOR('s', 9, pid_t)
27
28#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
29#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
30
31#endif /* _XTENSA_SOCKIOS_H */
diff --git a/arch/xtensa/include/asm/spinlock.h b/arch/xtensa/include/asm/spinlock.h
new file mode 100644
index 000000000000..8ff23649581b
--- /dev/null
+++ b/arch/xtensa/include/asm/spinlock.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/spinlock.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SPINLOCK_H
12#define _XTENSA_SPINLOCK_H
13
14#include <linux/spinlock.h>
15
16#endif /* _XTENSA_SPINLOCK_H */
diff --git a/arch/xtensa/include/asm/stat.h b/arch/xtensa/include/asm/stat.h
new file mode 100644
index 000000000000..c4992038cee0
--- /dev/null
+++ b/arch/xtensa/include/asm/stat.h
@@ -0,0 +1,59 @@
1/*
2 * include/asm-xtensa/stat.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2007 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_STAT_H
12#define _XTENSA_STAT_H
13
14#define STAT_HAVE_NSEC 1
15
16struct stat {
17 unsigned long st_dev;
18 unsigned long st_ino;
19 unsigned int st_mode;
20 unsigned int st_nlink;
21 unsigned int st_uid;
22 unsigned int st_gid;
23 unsigned long st_rdev;
24 long st_size;
25 unsigned long st_blksize;
26 unsigned long st_blocks;
27 unsigned long st_atime;
28 unsigned long st_atime_nsec;
29 unsigned long st_mtime;
30 unsigned long st_mtime_nsec;
31 unsigned long st_ctime;
32 unsigned long st_ctime_nsec;
33 unsigned long __unused4;
34 unsigned long __unused5;
35};
36
37struct stat64 {
38 unsigned long long st_dev; /* Device */
39 unsigned long long st_ino; /* File serial number */
40 unsigned int st_mode; /* File mode. */
41 unsigned int st_nlink; /* Link count. */
42 unsigned int st_uid; /* User ID of the file's owner. */
43 unsigned int st_gid; /* Group ID of the file's group. */
44 unsigned long long st_rdev; /* Device number, if device. */
45 long long st_size; /* Size of file, in bytes. */
46 unsigned long st_blksize; /* Optimal block size for I/O. */
47 unsigned long __unused2;
48 unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
49 unsigned long st_atime; /* Time of last access. */
50 unsigned long st_atime_nsec;
51 unsigned long st_mtime; /* Time of last modification. */
52 unsigned long st_mtime_nsec;
53 unsigned long st_ctime; /* Time of last status change. */
54 unsigned long st_ctime_nsec;
55 unsigned long __unused4;
56 unsigned long __unused5;
57};
58
59#endif /* _XTENSA_STAT_H */
diff --git a/arch/xtensa/include/asm/statfs.h b/arch/xtensa/include/asm/statfs.h
new file mode 100644
index 000000000000..9c3d1a213136
--- /dev/null
+++ b/arch/xtensa/include/asm/statfs.h
@@ -0,0 +1,17 @@
1/*
2 * include/asm-xtensa/statfs.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_STATFS_H
12#define _XTENSA_STATFS_H
13
14#include <asm-generic/statfs.h>
15
16#endif /* _XTENSA_STATFS_H */
17
diff --git a/arch/xtensa/include/asm/string.h b/arch/xtensa/include/asm/string.h
new file mode 100644
index 000000000000..5fb8c27cbef5
--- /dev/null
+++ b/arch/xtensa/include/asm/string.h
@@ -0,0 +1,124 @@
1/*
2 * include/asm-xtensa/string.h
3 *
4 * These trivial string functions are considered part of the public domain.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13/* We should optimize these. See arch/xtensa/lib/strncpy_user.S */
14
15#ifndef _XTENSA_STRING_H
16#define _XTENSA_STRING_H
17
18#define __HAVE_ARCH_STRCPY
19static inline char *strcpy(char *__dest, const char *__src)
20{
21 register char *__xdest = __dest;
22 unsigned long __dummy;
23
24 __asm__ __volatile__("1:\n\t"
25 "l8ui %2, %1, 0\n\t"
26 "s8i %2, %0, 0\n\t"
27 "addi %1, %1, 1\n\t"
28 "addi %0, %0, 1\n\t"
29 "bnez %2, 1b\n\t"
30 : "=r" (__dest), "=r" (__src), "=&r" (__dummy)
31 : "0" (__dest), "1" (__src)
32 : "memory");
33
34 return __xdest;
35}
36
37#define __HAVE_ARCH_STRNCPY
38static inline char *strncpy(char *__dest, const char *__src, size_t __n)
39{
40 register char *__xdest = __dest;
41 unsigned long __dummy;
42
43 if (__n == 0)
44 return __xdest;
45
46 __asm__ __volatile__(
47 "1:\n\t"
48 "l8ui %2, %1, 0\n\t"
49 "s8i %2, %0, 0\n\t"
50 "addi %1, %1, 1\n\t"
51 "addi %0, %0, 1\n\t"
52 "beqz %2, 2f\n\t"
53 "bne %1, %5, 1b\n"
54 "2:"
55 : "=r" (__dest), "=r" (__src), "=&r" (__dummy)
56 : "0" (__dest), "1" (__src), "r" (__src+__n)
57 : "memory");
58
59 return __xdest;
60}
61
62#define __HAVE_ARCH_STRCMP
63static inline int strcmp(const char *__cs, const char *__ct)
64{
65 register int __res;
66 unsigned long __dummy;
67
68 __asm__ __volatile__(
69 "1:\n\t"
70 "l8ui %3, %1, 0\n\t"
71 "addi %1, %1, 1\n\t"
72 "l8ui %2, %0, 0\n\t"
73 "addi %0, %0, 1\n\t"
74 "beqz %2, 2f\n\t"
75 "beq %2, %3, 1b\n"
76 "2:\n\t"
77 "sub %2, %3, %2"
78 : "=r" (__cs), "=r" (__ct), "=&r" (__res), "=&r" (__dummy)
79 : "0" (__cs), "1" (__ct));
80
81 return __res;
82}
83
84#define __HAVE_ARCH_STRNCMP
85static inline int strncmp(const char *__cs, const char *__ct, size_t __n)
86{
87 register int __res;
88 unsigned long __dummy;
89
90 __asm__ __volatile__(
91 "mov %2, %3\n"
92 "1:\n\t"
93 "beq %0, %6, 2f\n\t"
94 "l8ui %3, %1, 0\n\t"
95 "addi %1, %1, 1\n\t"
96 "l8ui %2, %0, 0\n\t"
97 "addi %0, %0, 1\n\t"
98 "beqz %2, 2f\n\t"
99 "beqz %3, 2f\n\t"
100 "beq %2, %3, 1b\n"
101 "2:\n\t"
102 "sub %2, %3, %2"
103 : "=r" (__cs), "=r" (__ct), "=&r" (__res), "=&r" (__dummy)
104 : "0" (__cs), "1" (__ct), "r" (__cs+__n));
105
106 return __res;
107}
108
109#define __HAVE_ARCH_MEMSET
110extern void *memset(void *__s, int __c, size_t __count);
111
112#define __HAVE_ARCH_MEMCPY
113extern void *memcpy(void *__to, __const__ void *__from, size_t __n);
114
115#define __HAVE_ARCH_MEMMOVE
116extern void *memmove(void *__dest, __const__ void *__src, size_t __n);
117
118/* Don't build bcopy at all ... */
119#define __HAVE_ARCH_BCOPY
120
121#define __HAVE_ARCH_MEMSCAN
122#define memscan memchr
123
124#endif /* _XTENSA_STRING_H */
diff --git a/arch/xtensa/include/asm/swab.h b/arch/xtensa/include/asm/swab.h
new file mode 100644
index 000000000000..f50b697eb601
--- /dev/null
+++ b/arch/xtensa/include/asm/swab.h
@@ -0,0 +1,70 @@
1/*
2 * include/asm-xtensa/swab.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SWAB_H
12#define _XTENSA_SWAB_H
13
14#include <asm/types.h>
15#include <linux/compiler.h>
16
17#define __SWAB_64_THRU_32__
18
19static inline __attribute_const__ __u32 __arch_swab32(__u32 x)
20{
21 __u32 res;
22 /* instruction sequence from Xtensa ISA release 2/2000 */
23 __asm__("ssai 8 \n\t"
24 "srli %0, %1, 16 \n\t"
25 "src %0, %0, %1 \n\t"
26 "src %0, %0, %0 \n\t"
27 "src %0, %1, %0 \n"
28 : "=&a" (res)
29 : "a" (x)
30 );
31 return res;
32}
33#define __arch_swab32 __arch_swab32
34
35static inline __attribute_const__ __u16 __arch_swab16(__u16 x)
36{
37 /* Given that 'short' values are signed (i.e., can be negative),
38 * we cannot assume that the upper 16-bits of the register are
39 * zero. We are careful to mask values after shifting.
40 */
41
42 /* There exists an anomaly between xt-gcc and xt-xcc. xt-gcc
43 * inserts an extui instruction after putting this function inline
44 * to ensure that it uses only the least-significant 16 bits of
45 * the result. xt-xcc doesn't use an extui, but assumes the
46 * __asm__ macro follows convention that the upper 16 bits of an
47 * 'unsigned short' result are still zero. This macro doesn't
48 * follow convention; indeed, it leaves garbage in the upport 16
49 * bits of the register.
50
51 * Declaring the temporary variables 'res' and 'tmp' to be 32-bit
52 * types while the return type of the function is a 16-bit type
53 * forces both compilers to insert exactly one extui instruction
54 * (or equivalent) to mask off the upper 16 bits. */
55
56 __u32 res;
57 __u32 tmp;
58
59 __asm__("extui %1, %2, 8, 8\n\t"
60 "slli %0, %2, 8 \n\t"
61 "or %0, %0, %1 \n"
62 : "=&a" (res), "=&a" (tmp)
63 : "a" (x)
64 );
65
66 return res;
67}
68#define __arch_swab16 __arch_swab16
69
70#endif /* _XTENSA_SWAB_H */
diff --git a/arch/xtensa/include/asm/syscall.h b/arch/xtensa/include/asm/syscall.h
new file mode 100644
index 000000000000..05cebf8f62b1
--- /dev/null
+++ b/arch/xtensa/include/asm/syscall.h
@@ -0,0 +1,42 @@
1/*
2 * include/asm-xtensa/syscall.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2007 Tensilica Inc.
9 */
10
11struct pt_regs;
12struct sigaction;
13asmlinkage long xtensa_execve(char*, char**, char**, struct pt_regs*);
14asmlinkage long xtensa_clone(unsigned long, unsigned long, struct pt_regs*);
15asmlinkage long xtensa_pipe(int __user *);
16asmlinkage long xtensa_mmap2(unsigned long, unsigned long, unsigned long,
17 unsigned long, unsigned long, unsigned long);
18asmlinkage long xtensa_ptrace(long, long, long, long);
19asmlinkage long xtensa_sigreturn(struct pt_regs*);
20asmlinkage long xtensa_rt_sigreturn(struct pt_regs*);
21asmlinkage long xtensa_sigsuspend(struct pt_regs*);
22asmlinkage long xtensa_rt_sigsuspend(struct pt_regs*);
23asmlinkage long xtensa_sigaction(int, const struct old_sigaction*,
24 struct old_sigaction*);
25asmlinkage long xtensa_sigaltstack(struct pt_regs *regs);
26asmlinkage long sys_rt_sigaction(int,
27 const struct sigaction __user *,
28 struct sigaction __user *,
29 size_t);
30asmlinkage long xtensa_shmat(int, char __user *, int);
31asmlinkage long xtensa_fadvise64_64(int, int,
32 unsigned long long, unsigned long long);
33
34/* Should probably move to linux/syscalls.h */
35struct pollfd;
36asmlinkage long sys_pselect6(int n, fd_set __user *inp, fd_set __user *outp,
37 fd_set __user *exp, struct timespec __user *tsp, void __user *sig);
38asmlinkage long sys_ppoll(struct pollfd __user *ufds, unsigned int nfds,
39 struct timespec __user *tsp, const sigset_t __user *sigmask,
40 size_t sigsetsize);
41
42
diff --git a/arch/xtensa/include/asm/system.h b/arch/xtensa/include/asm/system.h
new file mode 100644
index 000000000000..62b1e8f3c13c
--- /dev/null
+++ b/arch/xtensa/include/asm/system.h
@@ -0,0 +1,215 @@
1/*
2 * include/asm-xtensa/system.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_SYSTEM_H
12#define _XTENSA_SYSTEM_H
13
14#include <linux/stringify.h>
15
16#include <asm/processor.h>
17
18/* interrupt control */
19
20#define local_save_flags(x) \
21 __asm__ __volatile__ ("rsr %0,"__stringify(PS) : "=a" (x));
22#define local_irq_restore(x) do { \
23 __asm__ __volatile__ ("wsr %0, "__stringify(PS)" ; rsync" \
24 :: "a" (x) : "memory"); } while(0);
25#define local_irq_save(x) do { \
26 __asm__ __volatile__ ("rsil %0, "__stringify(LOCKLEVEL) \
27 : "=a" (x) :: "memory");} while(0);
28
29static inline void local_irq_disable(void)
30{
31 unsigned long flags;
32 __asm__ __volatile__ ("rsil %0, "__stringify(LOCKLEVEL)
33 : "=a" (flags) :: "memory");
34}
35static inline void local_irq_enable(void)
36{
37 unsigned long flags;
38 __asm__ __volatile__ ("rsil %0, 0" : "=a" (flags) :: "memory");
39
40}
41
42static inline int irqs_disabled(void)
43{
44 unsigned long flags;
45 local_save_flags(flags);
46 return flags & 0xf;
47}
48
49
50#define smp_read_barrier_depends() do { } while(0)
51#define read_barrier_depends() do { } while(0)
52
53#define mb() barrier()
54#define rmb() mb()
55#define wmb() mb()
56
57#ifdef CONFIG_SMP
58#error smp_* not defined
59#else
60#define smp_mb() barrier()
61#define smp_rmb() barrier()
62#define smp_wmb() barrier()
63#endif
64
65#define set_mb(var, value) do { var = value; mb(); } while (0)
66
67#if !defined (__ASSEMBLY__)
68
69/* * switch_to(n) should switch tasks to task nr n, first
70 * checking that n isn't the current task, in which case it does nothing.
71 */
72extern void *_switch_to(void *last, void *next);
73
74#endif /* __ASSEMBLY__ */
75
76#define switch_to(prev,next,last) \
77do { \
78 (last) = _switch_to(prev, next); \
79} while(0)
80
81/*
82 * cmpxchg
83 */
84
85static inline unsigned long
86__cmpxchg_u32(volatile int *p, int old, int new)
87{
88 __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t"
89 "l32i %0, %1, 0 \n\t"
90 "bne %0, %2, 1f \n\t"
91 "s32i %3, %1, 0 \n\t"
92 "1: \n\t"
93 "wsr a15, "__stringify(PS)" \n\t"
94 "rsync \n\t"
95 : "=&a" (old)
96 : "a" (p), "a" (old), "r" (new)
97 : "a15", "memory");
98 return old;
99}
100/* This function doesn't exist, so you'll get a linker error
101 * if something tries to do an invalid cmpxchg(). */
102
103extern void __cmpxchg_called_with_bad_pointer(void);
104
105static __inline__ unsigned long
106__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
107{
108 switch (size) {
109 case 4: return __cmpxchg_u32(ptr, old, new);
110 default: __cmpxchg_called_with_bad_pointer();
111 return old;
112 }
113}
114
115#define cmpxchg(ptr,o,n) \
116 ({ __typeof__(*(ptr)) _o_ = (o); \
117 __typeof__(*(ptr)) _n_ = (n); \
118 (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
119 (unsigned long)_n_, sizeof (*(ptr))); \
120 })
121
122#include <asm-generic/cmpxchg-local.h>
123
124static inline unsigned long __cmpxchg_local(volatile void *ptr,
125 unsigned long old,
126 unsigned long new, int size)
127{
128 switch (size) {
129 case 4:
130 return __cmpxchg_u32(ptr, old, new);
131 default:
132 return __cmpxchg_local_generic(ptr, old, new, size);
133 }
134
135 return old;
136}
137
138/*
139 * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
140 * them available.
141 */
142#define cmpxchg_local(ptr, o, n) \
143 ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
144 (unsigned long)(n), sizeof(*(ptr))))
145#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
146
147/*
148 * xchg_u32
149 *
150 * Note that a15 is used here because the register allocation
151 * done by the compiler is not guaranteed and a window overflow
152 * may not occur between the rsil and wsr instructions. By using
153 * a15 in the rsil, the machine is guaranteed to be in a state
154 * where no register reference will cause an overflow.
155 */
156
157static inline unsigned long xchg_u32(volatile int * m, unsigned long val)
158{
159 unsigned long tmp;
160 __asm__ __volatile__("rsil a15, "__stringify(LOCKLEVEL)"\n\t"
161 "l32i %0, %1, 0 \n\t"
162 "s32i %2, %1, 0 \n\t"
163 "wsr a15, "__stringify(PS)" \n\t"
164 "rsync \n\t"
165 : "=&a" (tmp)
166 : "a" (m), "a" (val)
167 : "a15", "memory");
168 return tmp;
169}
170
171#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
172
173/*
174 * This only works if the compiler isn't horribly bad at optimizing.
175 * gcc-2.5.8 reportedly can't handle this, but I define that one to
176 * be dead anyway.
177 */
178
179extern void __xchg_called_with_bad_pointer(void);
180
181static __inline__ unsigned long
182__xchg(unsigned long x, volatile void * ptr, int size)
183{
184 switch (size) {
185 case 4:
186 return xchg_u32(ptr, x);
187 }
188 __xchg_called_with_bad_pointer();
189 return x;
190}
191
192extern void set_except_vector(int n, void *addr);
193
194static inline void spill_registers(void)
195{
196 unsigned int a0, ps;
197
198 __asm__ __volatile__ (
199 "movi a14," __stringify (PS_EXCM_BIT) " | 1\n\t"
200 "mov a12, a0\n\t"
201 "rsr a13," __stringify(SAR) "\n\t"
202 "xsr a14," __stringify(PS) "\n\t"
203 "movi a0, _spill_registers\n\t"
204 "rsync\n\t"
205 "callx0 a0\n\t"
206 "mov a0, a12\n\t"
207 "wsr a13," __stringify(SAR) "\n\t"
208 "wsr a14," __stringify(PS) "\n\t"
209 :: "a" (&a0), "a" (&ps)
210 : "a2", "a3", "a4", "a7", "a11", "a12", "a13", "a14", "a15", "memory");
211}
212
213#define arch_align_stack(x) (x)
214
215#endif /* _XTENSA_SYSTEM_H */
diff --git a/arch/xtensa/include/asm/termbits.h b/arch/xtensa/include/asm/termbits.h
new file mode 100644
index 000000000000..85aa6a3c0b6e
--- /dev/null
+++ b/arch/xtensa/include/asm/termbits.h
@@ -0,0 +1,219 @@
1/*
2 * include/asm-xtensa/termbits.h
3 *
4 * Copied from SH.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_TERMBITS_H
14#define _XTENSA_TERMBITS_H
15
16
17#include <linux/posix_types.h>
18
19typedef unsigned char cc_t;
20typedef unsigned int speed_t;
21typedef unsigned int tcflag_t;
22
23#define NCCS 19
24struct termios {
25 tcflag_t c_iflag; /* input mode flags */
26 tcflag_t c_oflag; /* output mode flags */
27 tcflag_t c_cflag; /* control mode flags */
28 tcflag_t c_lflag; /* local mode flags */
29 cc_t c_line; /* line discipline */
30 cc_t c_cc[NCCS]; /* control characters */
31};
32
33struct termios2 {
34 tcflag_t c_iflag; /* input mode flags */
35 tcflag_t c_oflag; /* output mode flags */
36 tcflag_t c_cflag; /* control mode flags */
37 tcflag_t c_lflag; /* local mode flags */
38 cc_t c_line; /* line discipline */
39 cc_t c_cc[NCCS]; /* control characters */
40 speed_t c_ispeed; /* input speed */
41 speed_t c_ospeed; /* output speed */
42};
43
44struct ktermios {
45 tcflag_t c_iflag; /* input mode flags */
46 tcflag_t c_oflag; /* output mode flags */
47 tcflag_t c_cflag; /* control mode flags */
48 tcflag_t c_lflag; /* local mode flags */
49 cc_t c_line; /* line discipline */
50 cc_t c_cc[NCCS]; /* control characters */
51 speed_t c_ispeed; /* input speed */
52 speed_t c_ospeed; /* output speed */
53};
54
55/* c_cc characters */
56
57#define VINTR 0
58#define VQUIT 1
59#define VERASE 2
60#define VKILL 3
61#define VEOF 4
62#define VTIME 5
63#define VMIN 6
64#define VSWTC 7
65#define VSTART 8
66#define VSTOP 9
67#define VSUSP 10
68#define VEOL 11
69#define VREPRINT 12
70#define VDISCARD 13
71#define VWERASE 14
72#define VLNEXT 15
73#define VEOL2 16
74
75/* c_iflag bits */
76
77#define IGNBRK 0000001
78#define BRKINT 0000002
79#define IGNPAR 0000004
80#define PARMRK 0000010
81#define INPCK 0000020
82#define ISTRIP 0000040
83#define INLCR 0000100
84#define IGNCR 0000200
85#define ICRNL 0000400
86#define IUCLC 0001000
87#define IXON 0002000
88#define IXANY 0004000
89#define IXOFF 0010000
90#define IMAXBEL 0020000
91#define IUTF8 0040000
92
93/* c_oflag bits */
94
95#define OPOST 0000001
96#define OLCUC 0000002
97#define ONLCR 0000004
98#define OCRNL 0000010
99#define ONOCR 0000020
100#define ONLRET 0000040
101#define OFILL 0000100
102#define OFDEL 0000200
103#define NLDLY 0000400
104#define NL0 0000000
105#define NL1 0000400
106#define CRDLY 0003000
107#define CR0 0000000
108#define CR1 0001000
109#define CR2 0002000
110#define CR3 0003000
111#define TABDLY 0014000
112#define TAB0 0000000
113#define TAB1 0004000
114#define TAB2 0010000
115#define TAB3 0014000
116#define XTABS 0014000
117#define BSDLY 0020000
118#define BS0 0000000
119#define BS1 0020000
120#define VTDLY 0040000
121#define VT0 0000000
122#define VT1 0040000
123#define FFDLY 0100000
124#define FF0 0000000
125#define FF1 0100000
126
127/* c_cflag bit meaning */
128
129#define CBAUD 0010017
130#define B0 0000000 /* hang up */
131#define B50 0000001
132#define B75 0000002
133#define B110 0000003
134#define B134 0000004
135#define B150 0000005
136#define B200 0000006
137#define B300 0000007
138#define B600 0000010
139#define B1200 0000011
140#define B1800 0000012
141#define B2400 0000013
142#define B4800 0000014
143#define B9600 0000015
144#define B19200 0000016
145#define B38400 0000017
146#define EXTA B19200
147#define EXTB B38400
148#define CSIZE 0000060
149#define CS5 0000000
150#define CS6 0000020
151#define CS7 0000040
152#define CS8 0000060
153#define CSTOPB 0000100
154#define CREAD 0000200
155#define PARENB 0000400
156#define PARODD 0001000
157#define HUPCL 0002000
158#define CLOCAL 0004000
159#define CBAUDEX 0010000
160#define BOTHER 0010000
161#define B57600 0010001
162#define B115200 0010002
163#define B230400 0010003
164#define B460800 0010004
165#define B500000 0010005
166#define B576000 0010006
167#define B921600 0010007
168#define B1000000 0010010
169#define B1152000 0010011
170#define B1500000 0010012
171#define B2000000 0010013
172#define B2500000 0010014
173#define B3000000 0010015
174#define B3500000 0010016
175#define B4000000 0010017
176#define CIBAUD 002003600000 /* input baud rate */
177#define CMSPAR 010000000000 /* mark or space (stick) parity */
178#define CRTSCTS 020000000000 /* flow control */
179
180#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
181
182/* c_lflag bits */
183
184#define ISIG 0000001
185#define ICANON 0000002
186#define XCASE 0000004
187#define ECHO 0000010
188#define ECHOE 0000020
189#define ECHOK 0000040
190#define ECHONL 0000100
191#define NOFLSH 0000200
192#define TOSTOP 0000400
193#define ECHOCTL 0001000
194#define ECHOPRT 0002000
195#define ECHOKE 0004000
196#define FLUSHO 0010000
197#define PENDIN 0040000
198#define IEXTEN 0100000
199
200/* tcflow() and TCXONC use these */
201
202#define TCOOFF 0
203#define TCOON 1
204#define TCIOFF 2
205#define TCION 3
206
207/* tcflush() and TCFLSH use these */
208
209#define TCIFLUSH 0
210#define TCOFLUSH 1
211#define TCIOFLUSH 2
212
213/* tcsetattr uses these */
214
215#define TCSANOW 0
216#define TCSADRAIN 1
217#define TCSAFLUSH 2
218
219#endif /* _XTENSA_TERMBITS_H */
diff --git a/arch/xtensa/include/asm/termios.h b/arch/xtensa/include/asm/termios.h
new file mode 100644
index 000000000000..4673f42f88a7
--- /dev/null
+++ b/arch/xtensa/include/asm/termios.h
@@ -0,0 +1,105 @@
1/*
2 * include/asm-xtensa/termios.h
3 *
4 * Copied from SH.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_TERMIOS_H
14#define _XTENSA_TERMIOS_H
15
16#include <asm/termbits.h>
17#include <asm/ioctls.h>
18
19struct winsize {
20 unsigned short ws_row;
21 unsigned short ws_col;
22 unsigned short ws_xpixel;
23 unsigned short ws_ypixel;
24};
25
26#define NCC 8
27struct termio {
28 unsigned short c_iflag; /* input mode flags */
29 unsigned short c_oflag; /* output mode flags */
30 unsigned short c_cflag; /* control mode flags */
31 unsigned short c_lflag; /* local mode flags */
32 unsigned char c_line; /* line discipline */
33 unsigned char c_cc[NCC]; /* control characters */
34};
35
36/* Modem lines */
37
38#define TIOCM_LE 0x001
39#define TIOCM_DTR 0x002
40#define TIOCM_RTS 0x004
41#define TIOCM_ST 0x008
42#define TIOCM_SR 0x010
43#define TIOCM_CTS 0x020
44#define TIOCM_CAR 0x040
45#define TIOCM_RNG 0x080
46#define TIOCM_DSR 0x100
47#define TIOCM_CD TIOCM_CAR
48#define TIOCM_RI TIOCM_RNG
49#define TIOCM_OUT1 0x2000
50#define TIOCM_OUT2 0x4000
51#define TIOCM_LOOP 0x8000
52
53/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
54
55#ifdef __KERNEL__
56
57/* intr=^C quit=^\ erase=del kill=^U
58 eof=^D vtime=\0 vmin=\1 sxtc=\0
59 start=^Q stop=^S susp=^Z eol=\0
60 reprint=^R discard=^U werase=^W lnext=^V
61 eol2=\0
62*/
63#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
64
65/*
66 * Translate a "termio" structure into a "termios". Ugh.
67 */
68
69#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \
70 unsigned short __tmp; \
71 get_user(__tmp,&(termio)->x); \
72 *(unsigned short *) &(termios)->x = __tmp; \
73}
74
75#define user_termio_to_kernel_termios(termios, termio) \
76({ \
77 SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \
78 SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \
79 SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \
80 SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \
81 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
82})
83
84/*
85 * Translate a "termios" structure into a "termio". Ugh.
86 */
87
88#define kernel_termios_to_user_termio(termio, termios) \
89({ \
90 put_user((termios)->c_iflag, &(termio)->c_iflag); \
91 put_user((termios)->c_oflag, &(termio)->c_oflag); \
92 put_user((termios)->c_cflag, &(termio)->c_cflag); \
93 put_user((termios)->c_lflag, &(termio)->c_lflag); \
94 put_user((termios)->c_line, &(termio)->c_line); \
95 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
96})
97
98#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
99#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
100#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
101#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
102
103#endif /* __KERNEL__ */
104
105#endif /* _XTENSA_TERMIOS_H */
diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h
new file mode 100644
index 000000000000..0f4fe1faf9ba
--- /dev/null
+++ b/arch/xtensa/include/asm/thread_info.h
@@ -0,0 +1,164 @@
1/*
2 * include/asm-xtensa/thread_info.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_THREAD_INFO_H
12#define _XTENSA_THREAD_INFO_H
13
14#ifdef __KERNEL__
15
16#ifndef __ASSEMBLY__
17# include <asm/processor.h>
18#endif
19
20/*
21 * low level task data that entry.S needs immediate access to
22 * - this struct should fit entirely inside of one cache line
23 * - this struct shares the supervisor stack pages
24 * - if the contents of this structure are changed, the assembly constants
25 * must also be changed
26 */
27
28#ifndef __ASSEMBLY__
29
30#if XTENSA_HAVE_COPROCESSORS
31
32typedef struct xtregs_coprocessor {
33 xtregs_cp0_t cp0;
34 xtregs_cp1_t cp1;
35 xtregs_cp2_t cp2;
36 xtregs_cp3_t cp3;
37 xtregs_cp4_t cp4;
38 xtregs_cp5_t cp5;
39 xtregs_cp6_t cp6;
40 xtregs_cp7_t cp7;
41} xtregs_coprocessor_t;
42
43#endif
44
45struct thread_info {
46 struct task_struct *task; /* main task structure */
47 struct exec_domain *exec_domain; /* execution domain */
48 unsigned long flags; /* low level flags */
49 unsigned long status; /* thread-synchronous flags */
50 __u32 cpu; /* current CPU */
51 __s32 preempt_count; /* 0 => preemptable,< 0 => BUG*/
52
53 mm_segment_t addr_limit; /* thread address space */
54 struct restart_block restart_block;
55
56 unsigned long cpenable;
57
58 /* Allocate storage for extra user states and coprocessor states. */
59#if XTENSA_HAVE_COPROCESSORS
60 xtregs_coprocessor_t xtregs_cp;
61#endif
62 xtregs_user_t xtregs_user;
63};
64
65#else /* !__ASSEMBLY__ */
66
67/* offsets into the thread_info struct for assembly code access */
68#define TI_TASK 0x00000000
69#define TI_EXEC_DOMAIN 0x00000004
70#define TI_FLAGS 0x00000008
71#define TI_STATUS 0x0000000C
72#define TI_CPU 0x00000010
73#define TI_PRE_COUNT 0x00000014
74#define TI_ADDR_LIMIT 0x00000018
75#define TI_RESTART_BLOCK 0x000001C
76
77#endif
78
79#define PREEMPT_ACTIVE 0x10000000
80
81/*
82 * macros/functions for gaining access to the thread information structure
83 *
84 * preempt_count needs to be 1 initially, until the scheduler is functional.
85 */
86
87#ifndef __ASSEMBLY__
88
89#define INIT_THREAD_INFO(tsk) \
90{ \
91 .task = &tsk, \
92 .exec_domain = &default_exec_domain, \
93 .flags = 0, \
94 .cpu = 0, \
95 .preempt_count = 1, \
96 .addr_limit = KERNEL_DS, \
97 .restart_block = { \
98 .fn = do_no_restart_syscall, \
99 }, \
100}
101
102#define init_thread_info (init_thread_union.thread_info)
103#define init_stack (init_thread_union.stack)
104
105/* how to get the thread information struct from C */
106static inline struct thread_info *current_thread_info(void)
107{
108 struct thread_info *ti;
109 __asm__("extui %0,a1,0,13\n\t"
110 "xor %0, a1, %0" : "=&r" (ti) : );
111 return ti;
112}
113
114#else /* !__ASSEMBLY__ */
115
116/* how to get the thread information struct from ASM */
117#define GET_THREAD_INFO(reg,sp) \
118 extui reg, sp, 0, 13; \
119 xor reg, sp, reg
120#endif
121
122
123/*
124 * thread information flags
125 * - these are process state flags that various assembly files may need to access
126 * - pending work-to-be-done flags are in LSW
127 * - other flags in MSW
128 */
129#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
130#define TIF_SIGPENDING 1 /* signal pending */
131#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
132#define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */
133#define TIF_IRET 4 /* return with iret */
134#define TIF_MEMDIE 5
135#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
136#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
137#define TIF_FREEZE 17 /* is freezing for suspend */
138
139#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
140#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
141#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
142#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
143#define _TIF_IRET (1<<TIF_IRET)
144#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
145#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
146#define _TIF_FREEZE (1<<TIF_FREEZE)
147
148#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
149#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
150
151/*
152 * Thread-synchronous status.
153 *
154 * This is different from the flags in that nobody else
155 * ever touches our thread-synchronous status, so we don't
156 * have to worry about atomic accesses.
157 */
158#define TS_USEDFPU 0x0001 /* FPU was used by this task this quantum (SMP) */
159
160#define THREAD_SIZE 8192 //(2*PAGE_SIZE)
161#define THREAD_SIZE_ORDER 1
162
163#endif /* __KERNEL__ */
164#endif /* _XTENSA_THREAD_INFO */
diff --git a/arch/xtensa/include/asm/timex.h b/arch/xtensa/include/asm/timex.h
new file mode 100644
index 000000000000..b83a8181d448
--- /dev/null
+++ b/arch/xtensa/include/asm/timex.h
@@ -0,0 +1,96 @@
1/*
2 * include/asm-xtensa/timex.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_TIMEX_H
12#define _XTENSA_TIMEX_H
13
14#ifdef __KERNEL__
15
16#include <asm/processor.h>
17#include <linux/stringify.h>
18
19#define _INTLEVEL(x) XCHAL_INT ## x ## _LEVEL
20#define INTLEVEL(x) _INTLEVEL(x)
21
22#if INTLEVEL(XCHAL_TIMER0_INTERRUPT) == 1
23# define LINUX_TIMER 0
24# define LINUX_TIMER_INT XCHAL_TIMER0_INTERRUPT
25#elif INTLEVEL(XCHAL_TIMER1_INTERRUPT) == 1
26# define LINUX_TIMER 1
27# define LINUX_TIMER_INT XCHAL_TIMER1_INTERRUPT
28#elif INTLEVEL(XCHAL_TIMER2_INTERRUPT) == 1
29# define LINUX_TIMER 2
30# define LINUX_TIMER_INT XCHAL_TIMER2_INTERRUPT
31#else
32# error "Bad timer number for Linux configurations!"
33#endif
34
35#define LINUX_TIMER_MASK (1L << LINUX_TIMER_INT)
36
37#define CLOCK_TICK_RATE 1193180 /* (everyone is using this value) */
38#define CLOCK_TICK_FACTOR 20 /* Factor of both 10^6 and CLOCK_TICK_RATE */
39
40#ifdef CONFIG_XTENSA_CALIBRATE_CCOUNT
41extern unsigned long ccount_per_jiffy;
42extern unsigned long ccount_nsec;
43#define CCOUNT_PER_JIFFY ccount_per_jiffy
44#define NSEC_PER_CCOUNT ccount_nsec
45#else
46#define CCOUNT_PER_JIFFY (CONFIG_XTENSA_CPU_CLOCK*(1000000UL/HZ))
47#define NSEC_PER_CCOUNT (1000UL / CONFIG_XTENSA_CPU_CLOCK)
48#endif
49
50
51typedef unsigned long long cycles_t;
52
53/*
54 * Only used for SMP.
55 */
56
57extern cycles_t cacheflush_time;
58
59#define get_cycles() (0)
60
61
62/*
63 * Register access.
64 */
65
66#define WSR_CCOUNT(r) asm volatile ("wsr %0,"__stringify(CCOUNT) :: "a" (r))
67#define RSR_CCOUNT(r) asm volatile ("rsr %0,"__stringify(CCOUNT) : "=a" (r))
68#define WSR_CCOMPARE(x,r) asm volatile ("wsr %0,"__stringify(CCOMPARE)"+"__stringify(x) :: "a"(r))
69#define RSR_CCOMPARE(x,r) asm volatile ("rsr %0,"__stringify(CCOMPARE)"+"__stringify(x) : "=a"(r))
70
71static inline unsigned long get_ccount (void)
72{
73 unsigned long ccount;
74 RSR_CCOUNT(ccount);
75 return ccount;
76}
77
78static inline void set_ccount (unsigned long ccount)
79{
80 WSR_CCOUNT(ccount);
81}
82
83static inline unsigned long get_linux_timer (void)
84{
85 unsigned ccompare;
86 RSR_CCOMPARE(LINUX_TIMER, ccompare);
87 return ccompare;
88}
89
90static inline void set_linux_timer (unsigned long ccompare)
91{
92 WSR_CCOMPARE(LINUX_TIMER, ccompare);
93}
94
95#endif /* __KERNEL__ */
96#endif /* _XTENSA_TIMEX_H */
diff --git a/arch/xtensa/include/asm/tlb.h b/arch/xtensa/include/asm/tlb.h
new file mode 100644
index 000000000000..31c220faca02
--- /dev/null
+++ b/arch/xtensa/include/asm/tlb.h
@@ -0,0 +1,47 @@
1/*
2 * include/asm-xtensa/tlb.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_TLB_H
12#define _XTENSA_TLB_H
13
14#include <asm/cache.h>
15#include <asm/page.h>
16
17#if (DCACHE_WAY_SIZE <= PAGE_SIZE)
18
19/* Note, read http://lkml.org/lkml/2004/1/15/6 */
20
21# define tlb_start_vma(tlb,vma) do { } while (0)
22# define tlb_end_vma(tlb,vma) do { } while (0)
23
24#else
25
26# define tlb_start_vma(tlb, vma) \
27 do { \
28 if (!tlb->fullmm) \
29 flush_cache_range(vma, vma->vm_start, vma->vm_end); \
30 } while(0)
31
32# define tlb_end_vma(tlb, vma) \
33 do { \
34 if (!tlb->fullmm) \
35 flush_tlb_range(vma, vma->vm_start, vma->vm_end); \
36 } while(0)
37
38#endif
39
40#define __tlb_remove_tlb_entry(tlb,pte,addr) do { } while (0)
41#define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
42
43#include <asm-generic/tlb.h>
44
45#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte)
46
47#endif /* _XTENSA_TLB_H */
diff --git a/arch/xtensa/include/asm/tlbflush.h b/arch/xtensa/include/asm/tlbflush.h
new file mode 100644
index 000000000000..46d240074f74
--- /dev/null
+++ b/arch/xtensa/include/asm/tlbflush.h
@@ -0,0 +1,191 @@
1/*
2 * include/asm-xtensa/tlbflush.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_TLBFLUSH_H
12#define _XTENSA_TLBFLUSH_H
13
14#ifdef __KERNEL__
15
16#include <linux/stringify.h>
17#include <asm/processor.h>
18
19#define DTLB_WAY_PGD 7
20
21#define ITLB_ARF_WAYS 4
22#define DTLB_ARF_WAYS 4
23
24#define ITLB_HIT_BIT 3
25#define DTLB_HIT_BIT 4
26
27#ifndef __ASSEMBLY__
28
29/* TLB flushing:
30 *
31 * - flush_tlb_all() flushes all processes TLB entries
32 * - flush_tlb_mm(mm) flushes the specified mm context TLB entries
33 * - flush_tlb_page(mm, vmaddr) flushes a single page
34 * - flush_tlb_range(mm, start, end) flushes a range of pages
35 */
36
37extern void flush_tlb_all(void);
38extern void flush_tlb_mm(struct mm_struct*);
39extern void flush_tlb_page(struct vm_area_struct*,unsigned long);
40extern void flush_tlb_range(struct vm_area_struct*,unsigned long,unsigned long);
41
42#define flush_tlb_kernel_range(start,end) flush_tlb_all()
43
44/* TLB operations. */
45
46static inline unsigned long itlb_probe(unsigned long addr)
47{
48 unsigned long tmp;
49 __asm__ __volatile__("pitlb %0, %1\n\t" : "=a" (tmp) : "a" (addr));
50 return tmp;
51}
52
53static inline unsigned long dtlb_probe(unsigned long addr)
54{
55 unsigned long tmp;
56 __asm__ __volatile__("pdtlb %0, %1\n\t" : "=a" (tmp) : "a" (addr));
57 return tmp;
58}
59
60static inline void invalidate_itlb_entry (unsigned long probe)
61{
62 __asm__ __volatile__("iitlb %0; isync\n\t" : : "a" (probe));
63}
64
65static inline void invalidate_dtlb_entry (unsigned long probe)
66{
67 __asm__ __volatile__("idtlb %0; dsync\n\t" : : "a" (probe));
68}
69
70/* Use the .._no_isync functions with caution. Generally, these are
71 * handy for bulk invalidates followed by a single 'isync'. The
72 * caller must follow up with an 'isync', which can be relatively
73 * expensive on some Xtensa implementations.
74 */
75static inline void invalidate_itlb_entry_no_isync (unsigned entry)
76{
77 /* Caller must follow up with 'isync'. */
78 __asm__ __volatile__ ("iitlb %0\n" : : "a" (entry) );
79}
80
81static inline void invalidate_dtlb_entry_no_isync (unsigned entry)
82{
83 /* Caller must follow up with 'isync'. */
84 __asm__ __volatile__ ("idtlb %0\n" : : "a" (entry) );
85}
86
87static inline void set_itlbcfg_register (unsigned long val)
88{
89 __asm__ __volatile__("wsr %0, "__stringify(ITLBCFG)"\n\t" "isync\n\t"
90 : : "a" (val));
91}
92
93static inline void set_dtlbcfg_register (unsigned long val)
94{
95 __asm__ __volatile__("wsr %0, "__stringify(DTLBCFG)"; dsync\n\t"
96 : : "a" (val));
97}
98
99static inline void set_ptevaddr_register (unsigned long val)
100{
101 __asm__ __volatile__(" wsr %0, "__stringify(PTEVADDR)"; isync\n"
102 : : "a" (val));
103}
104
105static inline unsigned long read_ptevaddr_register (void)
106{
107 unsigned long tmp;
108 __asm__ __volatile__("rsr %0, "__stringify(PTEVADDR)"\n\t" : "=a" (tmp));
109 return tmp;
110}
111
112static inline void write_dtlb_entry (pte_t entry, int way)
113{
114 __asm__ __volatile__("wdtlb %1, %0; dsync\n\t"
115 : : "r" (way), "r" (entry) );
116}
117
118static inline void write_itlb_entry (pte_t entry, int way)
119{
120 __asm__ __volatile__("witlb %1, %0; isync\n\t"
121 : : "r" (way), "r" (entry) );
122}
123
124static inline void invalidate_page_directory (void)
125{
126 invalidate_dtlb_entry (DTLB_WAY_PGD);
127 invalidate_dtlb_entry (DTLB_WAY_PGD+1);
128 invalidate_dtlb_entry (DTLB_WAY_PGD+2);
129}
130
131static inline void invalidate_itlb_mapping (unsigned address)
132{
133 unsigned long tlb_entry;
134 if (((tlb_entry = itlb_probe(address)) & (1 << ITLB_HIT_BIT)) != 0)
135 invalidate_itlb_entry(tlb_entry);
136}
137
138static inline void invalidate_dtlb_mapping (unsigned address)
139{
140 unsigned long tlb_entry;
141 if (((tlb_entry = dtlb_probe(address)) & (1 << DTLB_HIT_BIT)) != 0)
142 invalidate_dtlb_entry(tlb_entry);
143}
144
145#define check_pgt_cache() do { } while (0)
146
147
148/*
149 * DO NOT USE THESE FUNCTIONS. These instructions aren't part of the Xtensa
150 * ISA and exist only for test purposes..
151 * You may find it helpful for MMU debugging, however.
152 *
153 * 'at' is the unmodified input register
154 * 'as' is the output register, as follows (specific to the Linux config):
155 *
156 * as[31..12] contain the virtual address
157 * as[11..08] are meaningless
158 * as[07..00] contain the asid
159 */
160
161static inline unsigned long read_dtlb_virtual (int way)
162{
163 unsigned long tmp;
164 __asm__ __volatile__("rdtlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way));
165 return tmp;
166}
167
168static inline unsigned long read_dtlb_translation (int way)
169{
170 unsigned long tmp;
171 __asm__ __volatile__("rdtlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way));
172 return tmp;
173}
174
175static inline unsigned long read_itlb_virtual (int way)
176{
177 unsigned long tmp;
178 __asm__ __volatile__("ritlb0 %0, %1\n\t" : "=a" (tmp), "+a" (way));
179 return tmp;
180}
181
182static inline unsigned long read_itlb_translation (int way)
183{
184 unsigned long tmp;
185 __asm__ __volatile__("ritlb1 %0, %1\n\t" : "=a" (tmp), "+a" (way));
186 return tmp;
187}
188
189#endif /* __ASSEMBLY__ */
190#endif /* __KERNEL__ */
191#endif /* _XTENSA_TLBFLUSH_H */
diff --git a/arch/xtensa/include/asm/topology.h b/arch/xtensa/include/asm/topology.h
new file mode 100644
index 000000000000..7309e38a0ccb
--- /dev/null
+++ b/arch/xtensa/include/asm/topology.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/topology.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_TOPOLOGY_H
12#define _XTENSA_TOPOLOGY_H
13
14#include <asm-generic/topology.h>
15
16#endif /* _XTENSA_TOPOLOGY_H */
diff --git a/arch/xtensa/include/asm/types.h b/arch/xtensa/include/asm/types.h
new file mode 100644
index 000000000000..c89569a8da0c
--- /dev/null
+++ b/arch/xtensa/include/asm/types.h
@@ -0,0 +1,42 @@
1/*
2 * include/asm-xtensa/types.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_TYPES_H
12#define _XTENSA_TYPES_H
13
14#include <asm-generic/int-ll64.h>
15
16#ifdef __ASSEMBLY__
17# define __XTENSA_UL(x) (x)
18# define __XTENSA_UL_CONST(x) x
19#else
20# define __XTENSA_UL(x) ((unsigned long)(x))
21# define __XTENSA_UL_CONST(x) x##UL
22#endif
23
24#ifndef __ASSEMBLY__
25
26typedef unsigned short umode_t;
27
28/*
29 * These aren't exported outside the kernel to avoid name space clashes
30 */
31#ifdef __KERNEL__
32
33#define BITS_PER_LONG 32
34
35/* Dma addresses are 32-bits wide. */
36
37typedef u32 dma_addr_t;
38
39#endif /* __KERNEL__ */
40#endif
41
42#endif /* _XTENSA_TYPES_H */
diff --git a/arch/xtensa/include/asm/uaccess.h b/arch/xtensa/include/asm/uaccess.h
new file mode 100644
index 000000000000..b8528426ab1f
--- /dev/null
+++ b/arch/xtensa/include/asm/uaccess.h
@@ -0,0 +1,500 @@
1/*
2 * include/asm-xtensa/uaccess.h
3 *
4 * User space memory access functions
5 *
6 * These routines provide basic accessing functions to the user memory
7 * space for the kernel. This header file provides fuctions such as:
8 *
9 * This file is subject to the terms and conditions of the GNU General Public
10 * License. See the file "COPYING" in the main directory of this archive
11 * for more details.
12 *
13 * Copyright (C) 2001 - 2005 Tensilica Inc.
14 */
15
16#ifndef _XTENSA_UACCESS_H
17#define _XTENSA_UACCESS_H
18
19#include <linux/errno.h>
20
21#define VERIFY_READ 0
22#define VERIFY_WRITE 1
23
24#ifdef __ASSEMBLY__
25
26#include <asm/current.h>
27#include <asm/asm-offsets.h>
28#include <asm/processor.h>
29#include <asm/types.h>
30
31/*
32 * These assembly macros mirror the C macros that follow below. They
33 * should always have identical functionality. See
34 * arch/xtensa/kernel/sys.S for usage.
35 */
36
37#define KERNEL_DS 0
38#define USER_DS 1
39
40#define get_ds (KERNEL_DS)
41
42/*
43 * get_fs reads current->thread.current_ds into a register.
44 * On Entry:
45 * <ad> anything
46 * <sp> stack
47 * On Exit:
48 * <ad> contains current->thread.current_ds
49 */
50 .macro get_fs ad, sp
51 GET_CURRENT(\ad,\sp)
52 l32i \ad, \ad, THREAD_CURRENT_DS
53 .endm
54
55/*
56 * set_fs sets current->thread.current_ds to some value.
57 * On Entry:
58 * <at> anything (temp register)
59 * <av> value to write
60 * <sp> stack
61 * On Exit:
62 * <at> destroyed (actually, current)
63 * <av> preserved, value to write
64 */
65 .macro set_fs at, av, sp
66 GET_CURRENT(\at,\sp)
67 s32i \av, \at, THREAD_CURRENT_DS
68 .endm
69
70/*
71 * kernel_ok determines whether we should bypass addr/size checking.
72 * See the equivalent C-macro version below for clarity.
73 * On success, kernel_ok branches to a label indicated by parameter
74 * <success>. This implies that the macro falls through to the next
75 * insruction on an error.
76 *
77 * Note that while this macro can be used independently, we designed
78 * in for optimal use in the access_ok macro below (i.e., we fall
79 * through on error).
80 *
81 * On Entry:
82 * <at> anything (temp register)
83 * <success> label to branch to on success; implies
84 * fall-through macro on error
85 * <sp> stack pointer
86 * On Exit:
87 * <at> destroyed (actually, current->thread.current_ds)
88 */
89
90#if ((KERNEL_DS != 0) || (USER_DS == 0))
91# error Assembly macro kernel_ok fails
92#endif
93 .macro kernel_ok at, sp, success
94 get_fs \at, \sp
95 beqz \at, \success
96 .endm
97
98/*
99 * user_ok determines whether the access to user-space memory is allowed.
100 * See the equivalent C-macro version below for clarity.
101 *
102 * On error, user_ok branches to a label indicated by parameter
103 * <error>. This implies that the macro falls through to the next
104 * instruction on success.
105 *
106 * Note that while this macro can be used independently, we designed
107 * in for optimal use in the access_ok macro below (i.e., we fall
108 * through on success).
109 *
110 * On Entry:
111 * <aa> register containing memory address
112 * <as> register containing memory size
113 * <at> temp register
114 * <error> label to branch to on error; implies fall-through
115 * macro on success
116 * On Exit:
117 * <aa> preserved
118 * <as> preserved
119 * <at> destroyed (actually, (TASK_SIZE + 1 - size))
120 */
121 .macro user_ok aa, as, at, error
122 movi \at, __XTENSA_UL_CONST(TASK_SIZE)
123 bgeu \as, \at, \error
124 sub \at, \at, \as
125 bgeu \aa, \at, \error
126 .endm
127
128/*
129 * access_ok determines whether a memory access is allowed. See the
130 * equivalent C-macro version below for clarity.
131 *
132 * On error, access_ok branches to a label indicated by parameter
133 * <error>. This implies that the macro falls through to the next
134 * instruction on success.
135 *
136 * Note that we assume success is the common case, and we optimize the
137 * branch fall-through case on success.
138 *
139 * On Entry:
140 * <aa> register containing memory address
141 * <as> register containing memory size
142 * <at> temp register
143 * <sp>
144 * <error> label to branch to on error; implies fall-through
145 * macro on success
146 * On Exit:
147 * <aa> preserved
148 * <as> preserved
149 * <at> destroyed
150 */
151 .macro access_ok aa, as, at, sp, error
152 kernel_ok \at, \sp, .Laccess_ok_\@
153 user_ok \aa, \as, \at, \error
154.Laccess_ok_\@:
155 .endm
156
157#else /* __ASSEMBLY__ not defined */
158
159#include <linux/sched.h>
160#include <asm/types.h>
161
162/*
163 * The fs value determines whether argument validity checking should
164 * be performed or not. If get_fs() == USER_DS, checking is
165 * performed, with get_fs() == KERNEL_DS, checking is bypassed.
166 *
167 * For historical reasons (Data Segment Register?), these macros are
168 * grossly misnamed.
169 */
170
171#define KERNEL_DS ((mm_segment_t) { 0 })
172#define USER_DS ((mm_segment_t) { 1 })
173
174#define get_ds() (KERNEL_DS)
175#define get_fs() (current->thread.current_ds)
176#define set_fs(val) (current->thread.current_ds = (val))
177
178#define segment_eq(a,b) ((a).seg == (b).seg)
179
180#define __kernel_ok (segment_eq(get_fs(), KERNEL_DS))
181#define __user_ok(addr,size) (((size) <= TASK_SIZE)&&((addr) <= TASK_SIZE-(size)))
182#define __access_ok(addr,size) (__kernel_ok || __user_ok((addr),(size)))
183#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size))
184
185/*
186 * These are the main single-value transfer routines. They
187 * automatically use the right size if we just have the right pointer
188 * type.
189 *
190 * This gets kind of ugly. We want to return _two_ values in
191 * "get_user()" and yet we don't want to do any pointers, because that
192 * is too much of a performance impact. Thus we have a few rather ugly
193 * macros here, and hide all the uglyness from the user.
194 *
195 * Careful to not
196 * (a) re-use the arguments for side effects (sizeof is ok)
197 * (b) require any knowledge of processes at this stage
198 */
199#define put_user(x,ptr) __put_user_check((x),(ptr),sizeof(*(ptr)))
200#define get_user(x,ptr) __get_user_check((x),(ptr),sizeof(*(ptr)))
201
202/*
203 * The "__xxx" versions of the user access functions are versions that
204 * do not verify the address space, that must have been done previously
205 * with a separate "access_ok()" call (this is used when we do multiple
206 * accesses to the same area of user memory).
207 */
208#define __put_user(x,ptr) __put_user_nocheck((x),(ptr),sizeof(*(ptr)))
209#define __get_user(x,ptr) __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
210
211
212extern long __put_user_bad(void);
213
214#define __put_user_nocheck(x,ptr,size) \
215({ \
216 long __pu_err; \
217 __put_user_size((x),(ptr),(size),__pu_err); \
218 __pu_err; \
219})
220
221#define __put_user_check(x,ptr,size) \
222({ \
223 long __pu_err = -EFAULT; \
224 __typeof__(*(ptr)) *__pu_addr = (ptr); \
225 if (access_ok(VERIFY_WRITE,__pu_addr,size)) \
226 __put_user_size((x),__pu_addr,(size),__pu_err); \
227 __pu_err; \
228})
229
230#define __put_user_size(x,ptr,size,retval) \
231do { \
232 int __cb; \
233 retval = 0; \
234 switch (size) { \
235 case 1: __put_user_asm(x,ptr,retval,1,"s8i",__cb); break; \
236 case 2: __put_user_asm(x,ptr,retval,2,"s16i",__cb); break; \
237 case 4: __put_user_asm(x,ptr,retval,4,"s32i",__cb); break; \
238 case 8: { \
239 __typeof__(*ptr) __v64 = x; \
240 retval = __copy_to_user(ptr,&__v64,8); \
241 break; \
242 } \
243 default: __put_user_bad(); \
244 } \
245} while (0)
246
247
248/*
249 * Consider a case of a user single load/store would cause both an
250 * unaligned exception and an MMU-related exception (unaligned
251 * exceptions happen first):
252 *
253 * User code passes a bad variable ptr to a system call.
254 * Kernel tries to access the variable.
255 * Unaligned exception occurs.
256 * Unaligned exception handler tries to make aligned accesses.
257 * Double exception occurs for MMU-related cause (e.g., page not mapped).
258 * do_page_fault() thinks the fault address belongs to the kernel, not the
259 * user, and panics.
260 *
261 * The kernel currently prohibits user unaligned accesses. We use the
262 * __check_align_* macros to check for unaligned addresses before
263 * accessing user space so we don't crash the kernel. Both
264 * __put_user_asm and __get_user_asm use these alignment macros, so
265 * macro-specific labels such as 0f, 1f, %0, %2, and %3 must stay in
266 * sync.
267 */
268
269#define __check_align_1 ""
270
271#define __check_align_2 \
272 " _bbci.l %3, 0, 1f \n" \
273 " movi %0, %4 \n" \
274 " _j 2f \n"
275
276#define __check_align_4 \
277 " _bbsi.l %3, 0, 0f \n" \
278 " _bbci.l %3, 1, 1f \n" \
279 "0: movi %0, %4 \n" \
280 " _j 2f \n"
281
282
283/*
284 * We don't tell gcc that we are accessing memory, but this is OK
285 * because we do not write to any memory gcc knows about, so there
286 * are no aliasing issues.
287 *
288 * WARNING: If you modify this macro at all, verify that the
289 * __check_align_* macros still work.
290 */
291#define __put_user_asm(x, addr, err, align, insn, cb) \
292 __asm__ __volatile__( \
293 __check_align_##align \
294 "1: "insn" %2, %3, 0 \n" \
295 "2: \n" \
296 " .section .fixup,\"ax\" \n" \
297 " .align 4 \n" \
298 "4: \n" \
299 " .long 2b \n" \
300 "5: \n" \
301 " l32r %1, 4b \n" \
302 " movi %0, %4 \n" \
303 " jx %1 \n" \
304 " .previous \n" \
305 " .section __ex_table,\"a\" \n" \
306 " .long 1b, 5b \n" \
307 " .previous" \
308 :"=r" (err), "=r" (cb) \
309 :"r" ((int)(x)), "r" (addr), "i" (-EFAULT), "0" (err))
310
311#define __get_user_nocheck(x,ptr,size) \
312({ \
313 long __gu_err, __gu_val; \
314 __get_user_size(__gu_val,(ptr),(size),__gu_err); \
315 (x) = (__typeof__(*(ptr)))__gu_val; \
316 __gu_err; \
317})
318
319#define __get_user_check(x,ptr,size) \
320({ \
321 long __gu_err = -EFAULT, __gu_val = 0; \
322 const __typeof__(*(ptr)) *__gu_addr = (ptr); \
323 if (access_ok(VERIFY_READ,__gu_addr,size)) \
324 __get_user_size(__gu_val,__gu_addr,(size),__gu_err); \
325 (x) = (__typeof__(*(ptr)))__gu_val; \
326 __gu_err; \
327})
328
329extern long __get_user_bad(void);
330
331#define __get_user_size(x,ptr,size,retval) \
332do { \
333 int __cb; \
334 retval = 0; \
335 switch (size) { \
336 case 1: __get_user_asm(x,ptr,retval,1,"l8ui",__cb); break; \
337 case 2: __get_user_asm(x,ptr,retval,2,"l16ui",__cb); break; \
338 case 4: __get_user_asm(x,ptr,retval,4,"l32i",__cb); break; \
339 case 8: retval = __copy_from_user(&x,ptr,8); break; \
340 default: (x) = __get_user_bad(); \
341 } \
342} while (0)
343
344
345/*
346 * WARNING: If you modify this macro at all, verify that the
347 * __check_align_* macros still work.
348 */
349#define __get_user_asm(x, addr, err, align, insn, cb) \
350 __asm__ __volatile__( \
351 __check_align_##align \
352 "1: "insn" %2, %3, 0 \n" \
353 "2: \n" \
354 " .section .fixup,\"ax\" \n" \
355 " .align 4 \n" \
356 "4: \n" \
357 " .long 2b \n" \
358 "5: \n" \
359 " l32r %1, 4b \n" \
360 " movi %2, 0 \n" \
361 " movi %0, %4 \n" \
362 " jx %1 \n" \
363 " .previous \n" \
364 " .section __ex_table,\"a\" \n" \
365 " .long 1b, 5b \n" \
366 " .previous" \
367 :"=r" (err), "=r" (cb), "=r" (x) \
368 :"r" (addr), "i" (-EFAULT), "0" (err))
369
370
371/*
372 * Copy to/from user space
373 */
374
375/*
376 * We use a generic, arbitrary-sized copy subroutine. The Xtensa
377 * architecture would cause heavy code bloat if we tried to inline
378 * these functions and provide __constant_copy_* equivalents like the
379 * i386 versions. __xtensa_copy_user is quite efficient. See the
380 * .fixup section of __xtensa_copy_user for a discussion on the
381 * X_zeroing equivalents for Xtensa.
382 */
383
384extern unsigned __xtensa_copy_user(void *to, const void *from, unsigned n);
385#define __copy_user(to,from,size) __xtensa_copy_user(to,from,size)
386
387
388static inline unsigned long
389__generic_copy_from_user_nocheck(void *to, const void *from, unsigned long n)
390{
391 return __copy_user(to,from,n);
392}
393
394static inline unsigned long
395__generic_copy_to_user_nocheck(void *to, const void *from, unsigned long n)
396{
397 return __copy_user(to,from,n);
398}
399
400static inline unsigned long
401__generic_copy_to_user(void *to, const void *from, unsigned long n)
402{
403 prefetch(from);
404 if (access_ok(VERIFY_WRITE, to, n))
405 return __copy_user(to,from,n);
406 return n;
407}
408
409static inline unsigned long
410__generic_copy_from_user(void *to, const void *from, unsigned long n)
411{
412 prefetchw(to);
413 if (access_ok(VERIFY_READ, from, n))
414 return __copy_user(to,from,n);
415 else
416 memset(to, 0, n);
417 return n;
418}
419
420#define copy_to_user(to,from,n) __generic_copy_to_user((to),(from),(n))
421#define copy_from_user(to,from,n) __generic_copy_from_user((to),(from),(n))
422#define __copy_to_user(to,from,n) __generic_copy_to_user_nocheck((to),(from),(n))
423#define __copy_from_user(to,from,n) __generic_copy_from_user_nocheck((to),(from),(n))
424#define __copy_to_user_inatomic __copy_to_user
425#define __copy_from_user_inatomic __copy_from_user
426
427
428/*
429 * We need to return the number of bytes not cleared. Our memset()
430 * returns zero if a problem occurs while accessing user-space memory.
431 * In that event, return no memory cleared. Otherwise, zero for
432 * success.
433 */
434
435static inline unsigned long
436__xtensa_clear_user(void *addr, unsigned long size)
437{
438 if ( ! memset(addr, 0, size) )
439 return size;
440 return 0;
441}
442
443static inline unsigned long
444clear_user(void *addr, unsigned long size)
445{
446 if (access_ok(VERIFY_WRITE, addr, size))
447 return __xtensa_clear_user(addr, size);
448 return size ? -EFAULT : 0;
449}
450
451#define __clear_user __xtensa_clear_user
452
453
454extern long __strncpy_user(char *, const char *, long);
455#define __strncpy_from_user __strncpy_user
456
457static inline long
458strncpy_from_user(char *dst, const char *src, long count)
459{
460 if (access_ok(VERIFY_READ, src, 1))
461 return __strncpy_from_user(dst, src, count);
462 return -EFAULT;
463}
464
465
466#define strlen_user(str) strnlen_user((str), TASK_SIZE - 1)
467
468/*
469 * Return the size of a string (including the ending 0!)
470 */
471extern long __strnlen_user(const char *, long);
472
473static inline long strnlen_user(const char *str, long len)
474{
475 unsigned long top = __kernel_ok ? ~0UL : TASK_SIZE - 1;
476
477 if ((unsigned long)str > top)
478 return 0;
479 return __strnlen_user(str, len);
480}
481
482
483struct exception_table_entry
484{
485 unsigned long insn, fixup;
486};
487
488/* Returns 0 if exception not found and fixup.unit otherwise. */
489
490extern unsigned long search_exception_table(unsigned long addr);
491extern void sort_exception_table(void);
492
493/* Returns the new pc */
494#define fixup_exception(map_reg, fixup_unit, pc) \
495({ \
496 fixup_unit; \
497})
498
499#endif /* __ASSEMBLY__ */
500#endif /* _XTENSA_UACCESS_H */
diff --git a/arch/xtensa/include/asm/ucontext.h b/arch/xtensa/include/asm/ucontext.h
new file mode 100644
index 000000000000..94c94ed3e00a
--- /dev/null
+++ b/arch/xtensa/include/asm/ucontext.h
@@ -0,0 +1,22 @@
1/*
2 * include/asm-xtensa/ucontext.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_UCONTEXT_H
12#define _XTENSA_UCONTEXT_H
13
14struct ucontext {
15 unsigned long uc_flags;
16 struct ucontext *uc_link;
17 stack_t uc_stack;
18 struct sigcontext uc_mcontext;
19 sigset_t uc_sigmask; /* mask last for extensibility */
20};
21
22#endif /* _XTENSA_UCONTEXT_H */
diff --git a/arch/xtensa/include/asm/unaligned.h b/arch/xtensa/include/asm/unaligned.h
new file mode 100644
index 000000000000..8e7ed046bfed
--- /dev/null
+++ b/arch/xtensa/include/asm/unaligned.h
@@ -0,0 +1,29 @@
1/*
2 * Xtensa doesn't handle unaligned accesses efficiently.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10#ifndef _ASM_XTENSA_UNALIGNED_H
11#define _ASM_XTENSA_UNALIGNED_H
12
13#include <asm/byteorder.h>
14
15#ifdef __LITTLE_ENDIAN
16# include <linux/unaligned/le_struct.h>
17# include <linux/unaligned/be_byteshift.h>
18# include <linux/unaligned/generic.h>
19# define get_unaligned __get_unaligned_le
20# define put_unaligned __put_unaligned_le
21#else
22# include <linux/unaligned/be_struct.h>
23# include <linux/unaligned/le_byteshift.h>
24# include <linux/unaligned/generic.h>
25# define get_unaligned __get_unaligned_be
26# define put_unaligned __put_unaligned_be
27#endif
28
29#endif /* _ASM_XTENSA_UNALIGNED_H */
diff --git a/arch/xtensa/include/asm/unistd.h b/arch/xtensa/include/asm/unistd.h
new file mode 100644
index 000000000000..c092c8fbb2cf
--- /dev/null
+++ b/arch/xtensa/include/asm/unistd.h
@@ -0,0 +1,735 @@
1/*
2 * include/asm-xtensa/unistd.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_UNISTD_H
12#define _XTENSA_UNISTD_H
13
14#ifndef __SYSCALL
15# define __SYSCALL(nr,func,nargs)
16#endif
17
18#define __NR_spill 0
19__SYSCALL( 0, sys_ni_syscall, 0)
20#define __NR_xtensa 1
21__SYSCALL( 1, sys_ni_syscall, 0)
22#define __NR_available4 2
23__SYSCALL( 2, sys_ni_syscall, 0)
24#define __NR_available5 3
25__SYSCALL( 3, sys_ni_syscall, 0)
26#define __NR_available6 4
27__SYSCALL( 4, sys_ni_syscall, 0)
28#define __NR_available7 5
29__SYSCALL( 5, sys_ni_syscall, 0)
30#define __NR_available8 6
31__SYSCALL( 6, sys_ni_syscall, 0)
32#define __NR_available9 7
33__SYSCALL( 7, sys_ni_syscall, 0)
34
35/* File Operations */
36
37#define __NR_open 8
38__SYSCALL( 8, sys_open, 3)
39#define __NR_close 9
40__SYSCALL( 9, sys_close, 1)
41#define __NR_dup 10
42__SYSCALL( 10, sys_dup, 1)
43#define __NR_dup2 11
44__SYSCALL( 11, sys_dup2, 2)
45#define __NR_read 12
46__SYSCALL( 12, sys_read, 3)
47#define __NR_write 13
48__SYSCALL( 13, sys_write, 3)
49#define __NR_select 14
50__SYSCALL( 14, sys_select, 5)
51#define __NR_lseek 15
52__SYSCALL( 15, sys_lseek, 3)
53#define __NR_poll 16
54__SYSCALL( 16, sys_poll, 3)
55#define __NR__llseek 17
56__SYSCALL( 17, sys_llseek, 5)
57#define __NR_epoll_wait 18
58__SYSCALL( 18, sys_epoll_wait, 4)
59#define __NR_epoll_ctl 19
60__SYSCALL( 19, sys_epoll_ctl, 4)
61#define __NR_epoll_create 20
62__SYSCALL( 20, sys_epoll_create, 1)
63#define __NR_creat 21
64__SYSCALL( 21, sys_creat, 2)
65#define __NR_truncate 22
66__SYSCALL( 22, sys_truncate, 2)
67#define __NR_ftruncate 23
68__SYSCALL( 23, sys_ftruncate, 2)
69#define __NR_readv 24
70__SYSCALL( 24, sys_readv, 3)
71#define __NR_writev 25
72__SYSCALL( 25, sys_writev, 3)
73#define __NR_fsync 26
74__SYSCALL( 26, sys_fsync, 1)
75#define __NR_fdatasync 27
76__SYSCALL( 27, sys_fdatasync, 1)
77#define __NR_truncate64 28
78__SYSCALL( 28, sys_truncate64, 2)
79#define __NR_ftruncate64 29
80__SYSCALL( 29, sys_ftruncate64, 2)
81#define __NR_pread64 30
82__SYSCALL( 30, sys_pread64, 6)
83#define __NR_pwrite64 31
84__SYSCALL( 31, sys_pwrite64, 6)
85
86#define __NR_link 32
87__SYSCALL( 32, sys_link, 2)
88#define __NR_rename 33
89__SYSCALL( 33, sys_rename, 2)
90#define __NR_symlink 34
91__SYSCALL( 34, sys_symlink, 2)
92#define __NR_readlink 35
93__SYSCALL( 35, sys_readlink, 3)
94#define __NR_mknod 36
95__SYSCALL( 36, sys_mknod, 3)
96#define __NR_pipe 37
97__SYSCALL( 37, xtensa_pipe, 1)
98#define __NR_unlink 38
99__SYSCALL( 38, sys_unlink, 1)
100#define __NR_rmdir 39
101__SYSCALL( 39, sys_rmdir, 1)
102
103#define __NR_mkdir 40
104__SYSCALL( 40, sys_mkdir, 2)
105#define __NR_chdir 41
106__SYSCALL( 41, sys_chdir, 1)
107#define __NR_fchdir 42
108__SYSCALL( 42, sys_fchdir, 1)
109#define __NR_getcwd 43
110__SYSCALL( 43, sys_getcwd, 2)
111
112#define __NR_chmod 44
113__SYSCALL( 44, sys_chmod, 2)
114#define __NR_chown 45
115__SYSCALL( 45, sys_chown, 3)
116#define __NR_stat 46
117__SYSCALL( 46, sys_newstat, 2)
118#define __NR_stat64 47
119__SYSCALL( 47, sys_stat64, 2)
120
121#define __NR_lchown 48
122__SYSCALL( 48, sys_lchown, 3)
123#define __NR_lstat 49
124__SYSCALL( 49, sys_newlstat, 2)
125#define __NR_lstat64 50
126__SYSCALL( 50, sys_lstat64, 2)
127#define __NR_available51 51
128__SYSCALL( 51, sys_ni_syscall, 0)
129
130#define __NR_fchmod 52
131__SYSCALL( 52, sys_fchmod, 2)
132#define __NR_fchown 53
133__SYSCALL( 53, sys_fchown, 3)
134#define __NR_fstat 54
135__SYSCALL( 54, sys_newfstat, 2)
136#define __NR_fstat64 55
137__SYSCALL( 55, sys_fstat64, 2)
138
139#define __NR_flock 56
140__SYSCALL( 56, sys_flock, 2)
141#define __NR_access 57
142__SYSCALL( 57, sys_access, 2)
143#define __NR_umask 58
144__SYSCALL( 58, sys_umask, 1)
145#define __NR_getdents 59
146__SYSCALL( 59, sys_getdents, 3)
147#define __NR_getdents64 60
148__SYSCALL( 60, sys_getdents64, 3)
149#define __NR_fcntl64 61
150__SYSCALL( 61, sys_fcntl64, 3)
151#define __NR_available62 62
152__SYSCALL( 62, sys_ni_syscall, 0)
153#define __NR_fadvise64_64 63
154__SYSCALL( 63, xtensa_fadvise64_64, 6)
155#define __NR_utime 64 /* glibc 2.3.3 ?? */
156__SYSCALL( 64, sys_utime, 2)
157#define __NR_utimes 65
158__SYSCALL( 65, sys_utimes, 2)
159#define __NR_ioctl 66
160__SYSCALL( 66, sys_ioctl, 3)
161#define __NR_fcntl 67
162__SYSCALL( 67, sys_fcntl, 3)
163
164#define __NR_setxattr 68
165__SYSCALL( 68, sys_setxattr, 5)
166#define __NR_getxattr 69
167__SYSCALL( 69, sys_getxattr, 4)
168#define __NR_listxattr 70
169__SYSCALL( 70, sys_listxattr, 3)
170#define __NR_removexattr 71
171__SYSCALL( 71, sys_removexattr, 2)
172#define __NR_lsetxattr 72
173__SYSCALL( 72, sys_lsetxattr, 5)
174#define __NR_lgetxattr 73
175__SYSCALL( 73, sys_lgetxattr, 4)
176#define __NR_llistxattr 74
177__SYSCALL( 74, sys_llistxattr, 3)
178#define __NR_lremovexattr 75
179__SYSCALL( 75, sys_lremovexattr, 2)
180#define __NR_fsetxattr 76
181__SYSCALL( 76, sys_fsetxattr, 5)
182#define __NR_fgetxattr 77
183__SYSCALL( 77, sys_fgetxattr, 4)
184#define __NR_flistxattr 78
185__SYSCALL( 78, sys_flistxattr, 3)
186#define __NR_fremovexattr 79
187__SYSCALL( 79, sys_fremovexattr, 2)
188
189/* File Map / Shared Memory Operations */
190
191#define __NR_mmap2 80
192__SYSCALL( 80, xtensa_mmap2, 6)
193#define __NR_munmap 81
194__SYSCALL( 81, sys_munmap, 2)
195#define __NR_mprotect 82
196__SYSCALL( 82, sys_mprotect, 3)
197#define __NR_brk 83
198__SYSCALL( 83, sys_brk, 1)
199#define __NR_mlock 84
200__SYSCALL( 84, sys_mlock, 2)
201#define __NR_munlock 85
202__SYSCALL( 85, sys_munlock, 2)
203#define __NR_mlockall 86
204__SYSCALL( 86, sys_mlockall, 1)
205#define __NR_munlockall 87
206__SYSCALL( 87, sys_munlockall, 0)
207#define __NR_mremap 88
208__SYSCALL( 88, sys_mremap, 4)
209#define __NR_msync 89
210__SYSCALL( 89, sys_msync, 3)
211#define __NR_mincore 90
212__SYSCALL( 90, sys_mincore, 3)
213#define __NR_madvise 91
214__SYSCALL( 91, sys_madvise, 3)
215#define __NR_shmget 92
216__SYSCALL( 92, sys_shmget, 4)
217#define __NR_shmat 93
218__SYSCALL( 93, xtensa_shmat, 4)
219#define __NR_shmctl 94
220__SYSCALL( 94, sys_shmctl, 4)
221#define __NR_shmdt 95
222__SYSCALL( 95, sys_shmdt, 4)
223
224/* Socket Operations */
225
226#define __NR_socket 96
227__SYSCALL( 96, sys_socket, 3)
228#define __NR_setsockopt 97
229__SYSCALL( 97, sys_setsockopt, 5)
230#define __NR_getsockopt 98
231__SYSCALL( 98, sys_getsockopt, 5)
232#define __NR_shutdown 99
233__SYSCALL( 99, sys_shutdown, 2)
234
235#define __NR_bind 100
236__SYSCALL(100, sys_bind, 3)
237#define __NR_connect 101
238__SYSCALL(101, sys_connect, 3)
239#define __NR_listen 102
240__SYSCALL(102, sys_listen, 2)
241#define __NR_accept 103
242__SYSCALL(103, sys_accept, 3)
243
244#define __NR_getsockname 104
245__SYSCALL(104, sys_getsockname, 3)
246#define __NR_getpeername 105
247__SYSCALL(105, sys_getpeername, 3)
248#define __NR_sendmsg 106
249__SYSCALL(106, sys_sendmsg, 3)
250#define __NR_recvmsg 107
251__SYSCALL(107, sys_recvmsg, 3)
252#define __NR_send 108
253__SYSCALL(108, sys_send, 4)
254#define __NR_recv 109
255__SYSCALL(109, sys_recv, 4)
256#define __NR_sendto 110
257__SYSCALL(110, sys_sendto, 6)
258#define __NR_recvfrom 111
259__SYSCALL(111, sys_recvfrom, 6)
260
261#define __NR_socketpair 112
262__SYSCALL(112, sys_socketpair, 4)
263#define __NR_sendfile 113
264__SYSCALL(113, sys_sendfile, 4)
265#define __NR_sendfile64 114
266__SYSCALL(114, sys_sendfile64, 4)
267#define __NR_available115 115
268__SYSCALL(115, sys_ni_syscall, 0)
269
270/* Process Operations */
271
272#define __NR_clone 116
273__SYSCALL(116, xtensa_clone, 5)
274#define __NR_execve 117
275__SYSCALL(117, xtensa_execve, 3)
276#define __NR_exit 118
277__SYSCALL(118, sys_exit, 1)
278#define __NR_exit_group 119
279__SYSCALL(119, sys_exit_group, 1)
280#define __NR_getpid 120
281__SYSCALL(120, sys_getpid, 0)
282#define __NR_wait4 121
283__SYSCALL(121, sys_wait4, 4)
284#define __NR_waitid 122
285__SYSCALL(122, sys_waitid, 5)
286#define __NR_kill 123
287__SYSCALL(123, sys_kill, 2)
288#define __NR_tkill 124
289__SYSCALL(124, sys_tkill, 2)
290#define __NR_tgkill 125
291__SYSCALL(125, sys_tgkill, 3)
292#define __NR_set_tid_address 126
293__SYSCALL(126, sys_set_tid_address, 1)
294#define __NR_gettid 127
295__SYSCALL(127, sys_gettid, 0)
296#define __NR_setsid 128
297__SYSCALL(128, sys_setsid, 0)
298#define __NR_getsid 129
299__SYSCALL(129, sys_getsid, 1)
300#define __NR_prctl 130
301__SYSCALL(130, sys_prctl, 5)
302#define __NR_personality 131
303__SYSCALL(131, sys_personality, 1)
304#define __NR_getpriority 132
305__SYSCALL(132, sys_getpriority, 2)
306#define __NR_setpriority 133
307__SYSCALL(133, sys_setpriority, 3)
308#define __NR_setitimer 134
309__SYSCALL(134, sys_setitimer, 3)
310#define __NR_getitimer 135
311__SYSCALL(135, sys_getitimer, 2)
312#define __NR_setuid 136
313__SYSCALL(136, sys_setuid, 1)
314#define __NR_getuid 137
315__SYSCALL(137, sys_getuid, 0)
316#define __NR_setgid 138
317__SYSCALL(138, sys_setgid, 1)
318#define __NR_getgid 139
319__SYSCALL(139, sys_getgid, 0)
320#define __NR_geteuid 140
321__SYSCALL(140, sys_geteuid, 0)
322#define __NR_getegid 141
323__SYSCALL(141, sys_getegid, 0)
324#define __NR_setreuid 142
325__SYSCALL(142, sys_setreuid, 2)
326#define __NR_setregid 143
327__SYSCALL(143, sys_setregid, 2)
328#define __NR_setresuid 144
329__SYSCALL(144, sys_setresuid, 3)
330#define __NR_getresuid 145
331__SYSCALL(145, sys_getresuid, 3)
332#define __NR_setresgid 146
333__SYSCALL(146, sys_setresgid, 3)
334#define __NR_getresgid 147
335__SYSCALL(147, sys_getresgid, 3)
336#define __NR_setpgid 148
337__SYSCALL(148, sys_setpgid, 2)
338#define __NR_getpgid 149
339__SYSCALL(149, sys_getpgid, 1)
340#define __NR_getppid 150
341__SYSCALL(150, sys_getppid, 0)
342#define __NR_getpgrp 151
343__SYSCALL(151, sys_getpgrp, 0)
344
345#define __NR_reserved152 152 /* set_thread_area */
346__SYSCALL(152, sys_ni_syscall, 0)
347#define __NR_reserved153 153 /* get_thread_area */
348__SYSCALL(153, sys_ni_syscall, 0)
349#define __NR_times 154
350__SYSCALL(154, sys_times, 1)
351#define __NR_acct 155
352__SYSCALL(155, sys_acct, 1)
353#define __NR_sched_setaffinity 156
354__SYSCALL(156, sys_sched_setaffinity, 3)
355#define __NR_sched_getaffinity 157
356__SYSCALL(157, sys_sched_getaffinity, 3)
357#define __NR_capget 158
358__SYSCALL(158, sys_capget, 2)
359#define __NR_capset 159
360__SYSCALL(159, sys_capset, 2)
361#define __NR_ptrace 160
362__SYSCALL(160, sys_ptrace, 4)
363#define __NR_semtimedop 161
364__SYSCALL(161, sys_semtimedop, 5)
365#define __NR_semget 162
366__SYSCALL(162, sys_semget, 4)
367#define __NR_semop 163
368__SYSCALL(163, sys_semop, 4)
369#define __NR_semctl 164
370__SYSCALL(164, sys_semctl, 4)
371#define __NR_available165 165
372__SYSCALL(165, sys_ni_syscall, 0)
373#define __NR_msgget 166
374__SYSCALL(166, sys_msgget, 4)
375#define __NR_msgsnd 167
376__SYSCALL(167, sys_msgsnd, 4)
377#define __NR_msgrcv 168
378__SYSCALL(168, sys_msgrcv, 4)
379#define __NR_msgctl 169
380__SYSCALL(169, sys_msgctl, 4)
381#define __NR_available170 170
382__SYSCALL(170, sys_ni_syscall, 0)
383#define __NR_available171 171
384__SYSCALL(171, sys_ni_syscall, 0)
385
386/* File System */
387
388#define __NR_mount 172
389__SYSCALL(172, sys_mount, 5)
390#define __NR_swapon 173
391__SYSCALL(173, sys_swapon, 2)
392#define __NR_chroot 174
393__SYSCALL(174, sys_chroot, 1)
394#define __NR_pivot_root 175
395__SYSCALL(175, sys_pivot_root, 2)
396#define __NR_umount 176
397__SYSCALL(176, sys_umount, 2)
398#define __NR_swapoff 177
399__SYSCALL(177, sys_swapoff, 1)
400#define __NR_sync 178
401__SYSCALL(178, sys_sync, 0)
402#define __NR_available179 179
403__SYSCALL(179, sys_ni_syscall, 0)
404#define __NR_setfsuid 180
405__SYSCALL(180, sys_setfsuid, 1)
406#define __NR_setfsgid 181
407__SYSCALL(181, sys_setfsgid, 1)
408#define __NR_sysfs 182
409__SYSCALL(182, sys_sysfs, 3)
410#define __NR_ustat 183
411__SYSCALL(183, sys_ustat, 2)
412#define __NR_statfs 184
413__SYSCALL(184, sys_statfs, 2)
414#define __NR_fstatfs 185
415__SYSCALL(185, sys_fstatfs, 2)
416#define __NR_statfs64 186
417__SYSCALL(186, sys_statfs64, 3)
418#define __NR_fstatfs64 187
419__SYSCALL(187, sys_fstatfs64, 3)
420
421/* System */
422
423#define __NR_setrlimit 188
424__SYSCALL(188, sys_setrlimit, 2)
425#define __NR_getrlimit 189
426__SYSCALL(189, sys_getrlimit, 2)
427#define __NR_getrusage 190
428__SYSCALL(190, sys_getrusage, 2)
429#define __NR_futex 191
430__SYSCALL(191, sys_futex, 5)
431#define __NR_gettimeofday 192
432__SYSCALL(192, sys_gettimeofday, 2)
433#define __NR_settimeofday 193
434__SYSCALL(193, sys_settimeofday, 2)
435#define __NR_adjtimex 194
436__SYSCALL(194, sys_adjtimex, 1)
437#define __NR_nanosleep 195
438__SYSCALL(195, sys_nanosleep, 2)
439#define __NR_getgroups 196
440__SYSCALL(196, sys_getgroups, 2)
441#define __NR_setgroups 197
442__SYSCALL(197, sys_setgroups, 2)
443#define __NR_sethostname 198
444__SYSCALL(198, sys_sethostname, 2)
445#define __NR_setdomainname 199
446__SYSCALL(199, sys_setdomainname, 2)
447#define __NR_syslog 200
448__SYSCALL(200, sys_syslog, 3)
449#define __NR_vhangup 201
450__SYSCALL(201, sys_vhangup, 0)
451#define __NR_uselib 202
452__SYSCALL(202, sys_uselib, 1)
453#define __NR_reboot 203
454__SYSCALL(203, sys_reboot, 3)
455#define __NR_quotactl 204
456__SYSCALL(204, sys_quotactl, 4)
457#define __NR_nfsservctl 205
458__SYSCALL(205, sys_nfsservctl, 3)
459#define __NR__sysctl 206
460__SYSCALL(206, sys_sysctl, 1)
461#define __NR_bdflush 207
462__SYSCALL(207, sys_bdflush, 2)
463#define __NR_uname 208
464__SYSCALL(208, sys_newuname, 1)
465#define __NR_sysinfo 209
466__SYSCALL(209, sys_sysinfo, 1)
467#define __NR_init_module 210
468__SYSCALL(210, sys_init_module, 2)
469#define __NR_delete_module 211
470__SYSCALL(211, sys_delete_module, 1)
471
472#define __NR_sched_setparam 212
473__SYSCALL(212, sys_sched_setparam, 2)
474#define __NR_sched_getparam 213
475__SYSCALL(213, sys_sched_getparam, 2)
476#define __NR_sched_setscheduler 214
477__SYSCALL(214, sys_sched_setscheduler, 3)
478#define __NR_sched_getscheduler 215
479__SYSCALL(215, sys_sched_getscheduler, 1)
480#define __NR_sched_get_priority_max 216
481__SYSCALL(216, sys_sched_get_priority_max, 1)
482#define __NR_sched_get_priority_min 217
483__SYSCALL(217, sys_sched_get_priority_min, 1)
484#define __NR_sched_rr_get_interval 218
485__SYSCALL(218, sys_sched_rr_get_interval, 2)
486#define __NR_sched_yield 219
487__SYSCALL(219, sys_sched_yield, 0)
488#define __NR_available222 222
489__SYSCALL(222, sys_ni_syscall, 0)
490
491/* Signal Handling */
492
493#define __NR_restart_syscall 223
494__SYSCALL(223, sys_restart_syscall, 0)
495#define __NR_sigaltstack 224
496__SYSCALL(224, xtensa_sigaltstack, 2)
497#define __NR_rt_sigreturn 225
498__SYSCALL(225, xtensa_rt_sigreturn, 1)
499#define __NR_rt_sigaction 226
500__SYSCALL(226, sys_rt_sigaction, 4)
501#define __NR_rt_sigprocmask 227
502__SYSCALL(227, sys_rt_sigprocmask, 4)
503#define __NR_rt_sigpending 228
504__SYSCALL(228, sys_rt_sigpending, 2)
505#define __NR_rt_sigtimedwait 229
506__SYSCALL(229, sys_rt_sigtimedwait, 4)
507#define __NR_rt_sigqueueinfo 230
508__SYSCALL(230, sys_rt_sigqueueinfo, 3)
509#define __NR_rt_sigsuspend 231
510__SYSCALL(231, xtensa_rt_sigsuspend, 2)
511
512/* Message */
513
514#define __NR_mq_open 232
515__SYSCALL(232, sys_mq_open, 4)
516#define __NR_mq_unlink 233
517__SYSCALL(233, sys_mq_unlink, 1)
518#define __NR_mq_timedsend 234
519__SYSCALL(234, sys_mq_timedsend, 5)
520#define __NR_mq_timedreceive 235
521__SYSCALL(235, sys_mq_timedreceive, 5)
522#define __NR_mq_notify 236
523__SYSCALL(236, sys_mq_notify, 2)
524#define __NR_mq_getsetattr 237
525__SYSCALL(237, sys_mq_getsetattr, 3)
526#define __NR_available238 238
527__SYSCALL(238, sys_ni_syscall, 0)
528
529/* IO */
530
531#define __NR_io_setup 239
532__SYSCALL(239, sys_io_setup, 2)
533#define __NR_io_destroy 240
534__SYSCALL(240, sys_io_destroy, 1)
535#define __NR_io_submit 241
536__SYSCALL(241, sys_io_submit, 3)
537#define __NR_io_getevents 242
538__SYSCALL(242, sys_io_getevents, 5)
539#define __NR_io_cancel 243
540__SYSCALL(243, sys_io_cancel, 3)
541#define __NR_clock_settime 244
542__SYSCALL(244, sys_clock_settime, 2)
543#define __NR_clock_gettime 245
544__SYSCALL(245, sys_clock_gettime, 2)
545#define __NR_clock_getres 246
546__SYSCALL(246, sys_clock_getres, 2)
547#define __NR_clock_nanosleep 247
548__SYSCALL(247, sys_clock_nanosleep, 4)
549
550/* Timer */
551
552#define __NR_timer_create 248
553__SYSCALL(248, sys_timer_create, 3)
554#define __NR_timer_delete 249
555__SYSCALL(249, sys_timer_delete, 1)
556#define __NR_timer_settime 250
557__SYSCALL(250, sys_timer_settime, 4)
558#define __NR_timer_gettime 251
559__SYSCALL(251, sys_timer_gettime, 2)
560#define __NR_timer_getoverrun 252
561__SYSCALL(252, sys_timer_getoverrun, 1)
562
563/* System */
564
565#define __NR_reserved244 253
566__SYSCALL(253, sys_ni_syscall, 0)
567#define __NR_lookup_dcookie 254
568__SYSCALL(254, sys_lookup_dcookie, 4)
569#define __NR_available255 255
570__SYSCALL(255, sys_ni_syscall, 0)
571#define __NR_add_key 256
572__SYSCALL(256, sys_add_key, 5)
573#define __NR_request_key 257
574__SYSCALL(257, sys_request_key, 5)
575#define __NR_keyctl 258
576__SYSCALL(258, sys_keyctl, 5)
577#define __NR_available259 259
578__SYSCALL(259, sys_ni_syscall, 0)
579
580
581#define __NR_readahead 260
582__SYSCALL(260, sys_readahead, 5)
583#define __NR_remap_file_pages 261
584__SYSCALL(261, sys_remap_file_pages, 5)
585#define __NR_migrate_pages 262
586__SYSCALL(262, sys_migrate_pages, 0)
587#define __NR_mbind 263
588__SYSCALL(263, sys_mbind, 6)
589#define __NR_get_mempolicy 264
590__SYSCALL(264, sys_get_mempolicy, 5)
591#define __NR_set_mempolicy 265
592__SYSCALL(265, sys_set_mempolicy, 3)
593#define __NR_unshare 266
594__SYSCALL(266, sys_unshare, 1)
595#define __NR_move_pages 267
596__SYSCALL(267, sys_move_pages, 0)
597#define __NR_splice 268
598__SYSCALL(268, sys_splice, 0)
599#define __NR_tee 269
600__SYSCALL(269, sys_tee, 0)
601#define __NR_vmsplice 270
602__SYSCALL(270, sys_vmsplice, 0)
603#define __NR_available271 271
604__SYSCALL(271, sys_ni_syscall, 0)
605
606#define __NR_pselect6 272
607__SYSCALL(272, sys_pselect6, 0)
608#define __NR_ppoll 273
609__SYSCALL(273, sys_ppoll, 0)
610#define __NR_epoll_pwait 274
611__SYSCALL(274, sys_epoll_pwait, 0)
612#define __NR_available275 275
613__SYSCALL(275, sys_ni_syscall, 0)
614
615#define __NR_inotify_init 276
616__SYSCALL(276, sys_inotify_init, 0)
617#define __NR_inotify_add_watch 277
618__SYSCALL(277, sys_inotify_add_watch, 3)
619#define __NR_inotify_rm_watch 278
620__SYSCALL(278, sys_inotify_rm_watch, 2)
621#define __NR_available279 279
622__SYSCALL(279, sys_ni_syscall, 0)
623
624#define __NR_getcpu 280
625__SYSCALL(280, sys_getcpu, 0)
626#define __NR_kexec_load 281
627__SYSCALL(281, sys_ni_syscall, 0)
628
629#define __NR_ioprio_set 282
630__SYSCALL(282, sys_ioprio_set, 2)
631#define __NR_ioprio_get 283
632__SYSCALL(283, sys_ioprio_get, 3)
633
634#define __NR_set_robust_list 284
635__SYSCALL(284, sys_set_robust_list, 3)
636#define __NR_get_robust_list 285
637__SYSCALL(285, sys_get_robust_list, 3)
638#define __NR_reserved286 286 /* sync_file_rangeX */
639__SYSCALL(286, sys_ni_syscall, 3)
640#define __NR_available287 287
641__SYSCALL(287, sys_faccessat, 0)
642
643/* Relative File Operations */
644
645#define __NR_openat 288
646__SYSCALL(288, sys_openat, 4)
647#define __NR_mkdirat 289
648__SYSCALL(289, sys_mkdirat, 3)
649#define __NR_mknodat 290
650__SYSCALL(290, sys_mknodat, 4)
651#define __NR_unlinkat 291
652__SYSCALL(291, sys_unlinkat, 3)
653#define __NR_renameat 292
654__SYSCALL(292, sys_renameat, 4)
655#define __NR_linkat 293
656__SYSCALL(293, sys_linkat, 5)
657#define __NR_symlinkat 294
658__SYSCALL(294, sys_symlinkat, 3)
659#define __NR_readlinkat 295
660__SYSCALL(295, sys_readlinkat, 4)
661#define __NR_utimensat 296
662__SYSCALL(296, sys_utimensat, 0)
663#define __NR_fchownat 297
664__SYSCALL(297, sys_fchownat, 5)
665#define __NR_futimesat 298
666__SYSCALL(298, sys_futimesat, 4)
667#define __NR_fstatat64 299
668__SYSCALL(299, sys_fstatat64, 0)
669#define __NR_fchmodat 300
670__SYSCALL(300, sys_fchmodat, 4)
671#define __NR_faccessat 301
672__SYSCALL(301, sys_faccessat, 4)
673#define __NR_available302 302
674__SYSCALL(302, sys_ni_syscall, 0)
675#define __NR_available303 303
676__SYSCALL(303, sys_ni_syscall, 0)
677
678#define __NR_signalfd 304
679__SYSCALL(304, sys_signalfd, 3)
680/* 305 was __NR_timerfd */
681__SYSCALL(305, sys_ni_syscall, 0)
682#define __NR_eventfd 306
683__SYSCALL(306, sys_eventfd, 1)
684
685#define __NR_syscall_count 307
686
687/*
688 * sysxtensa syscall handler
689 *
690 * int sysxtensa (SYS_XTENSA_ATOMIC_SET, ptr, val, unused);
691 * int sysxtensa (SYS_XTENSA_ATOMIC_ADD, ptr, val, unused);
692 * int sysxtensa (SYS_XTENSA_ATOMIC_EXG_ADD, ptr, val, unused);
693 * int sysxtensa (SYS_XTENSA_ATOMIC_CMP_SWP, ptr, oldval, newval);
694 * a2 a6 a3 a4 a5
695 */
696
697#define SYS_XTENSA_RESERVED 0 /* don't use this */
698#define SYS_XTENSA_ATOMIC_SET 1 /* set variable */
699#define SYS_XTENSA_ATOMIC_EXG_ADD 2 /* exchange memory and add */
700#define SYS_XTENSA_ATOMIC_ADD 3 /* add to memory */
701#define SYS_XTENSA_ATOMIC_CMP_SWP 4 /* compare and swap */
702
703#define SYS_XTENSA_COUNT 5 /* count */
704
705#ifdef __KERNEL__
706
707/*
708 * "Conditional" syscalls
709 *
710 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
711 * but it doesn't work on all toolchains, so we just do it by hand
712 */
713#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
714
715#define __ARCH_WANT_STAT64
716#define __ARCH_WANT_SYS_UTIME
717#define __ARCH_WANT_SYS_LLSEEK
718#define __ARCH_WANT_SYS_RT_SIGACTION
719#define __ARCH_WANT_SYS_RT_SIGSUSPEND
720#define __ARCH_WANT_SYS_GETPGRP
721
722/*
723 * Ignore legacy system calls in the checksyscalls.sh script
724 */
725
726#define __IGNORE_fork /* use clone */
727#define __IGNORE_time
728#define __IGNORE_alarm /* use setitimer */
729#define __IGNORE_pause
730#define __IGNORE_mmap /* use mmap2 */
731#define __IGNORE_vfork /* use clone */
732#define __IGNORE_fadvise64 /* use fadvise64_64 */
733
734#endif /* __KERNEL__ */
735#endif /* _XTENSA_UNISTD_H */
diff --git a/arch/xtensa/include/asm/user.h b/arch/xtensa/include/asm/user.h
new file mode 100644
index 000000000000..2c3ed23354a8
--- /dev/null
+++ b/arch/xtensa/include/asm/user.h
@@ -0,0 +1,20 @@
1/*
2 * include/asm-xtensa/user.h
3 *
4 * Xtensa Processor version.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 2001 - 2005 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_USER_H
14#define _XTENSA_USER_H
15
16/* This file usually defines a 'struct user' structure. However, it it only
17 * used for a.out file, which are not supported on Xtensa.
18 */
19
20#endif /* _XTENSA_USER_H */
diff --git a/arch/xtensa/include/asm/vga.h b/arch/xtensa/include/asm/vga.h
new file mode 100644
index 000000000000..1fd8cab3a297
--- /dev/null
+++ b/arch/xtensa/include/asm/vga.h
@@ -0,0 +1,19 @@
1/*
2 * include/asm-xtensa/vga.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_VGA_H
12#define _XTENSA_VGA_H
13
14#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x)
15
16#define vga_readb(x) (*(x))
17#define vga_writeb(x,y) (*(y) = (x))
18
19#endif
diff --git a/arch/xtensa/include/asm/xor.h b/arch/xtensa/include/asm/xor.h
new file mode 100644
index 000000000000..e7b1f083991d
--- /dev/null
+++ b/arch/xtensa/include/asm/xor.h
@@ -0,0 +1,16 @@
1/*
2 * include/asm-xtensa/xor.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 - 2005 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_XOR_H
12#define _XTENSA_XOR_H
13
14#include <asm-generic/xor.h>
15
16#endif
diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S
index dfd35dcc1cb5..a51d36a27389 100644
--- a/arch/xtensa/kernel/entry.S
+++ b/arch/xtensa/kernel/entry.S
@@ -25,7 +25,7 @@
25#include <asm/page.h> 25#include <asm/page.h>
26#include <asm/signal.h> 26#include <asm/signal.h>
27#include <asm/tlbflush.h> 27#include <asm/tlbflush.h>
28#include <asm/variant/tie-asm.h> 28#include <variant/tie-asm.h>
29 29
30/* Unimplemented features. */ 30/* Unimplemented features. */
31 31
diff --git a/arch/xtensa/kernel/vmlinux.lds.S b/arch/xtensa/kernel/vmlinux.lds.S
index 51f4fb6f16f9..d506774f4b05 100644
--- a/arch/xtensa/kernel/vmlinux.lds.S
+++ b/arch/xtensa/kernel/vmlinux.lds.S
@@ -16,7 +16,7 @@
16 16
17#include <asm-generic/vmlinux.lds.h> 17#include <asm-generic/vmlinux.lds.h>
18 18
19#include <asm/variant/core.h> 19#include <variant/core.h>
20OUTPUT_ARCH(xtensa) 20OUTPUT_ARCH(xtensa)
21ENTRY(_start) 21ENTRY(_start)
22 22
diff --git a/arch/xtensa/lib/checksum.S b/arch/xtensa/lib/checksum.S
index 9d9cd990afa6..df397f932d0e 100644
--- a/arch/xtensa/lib/checksum.S
+++ b/arch/xtensa/lib/checksum.S
@@ -16,7 +16,7 @@
16 16
17#include <asm/errno.h> 17#include <asm/errno.h>
18#include <linux/linkage.h> 18#include <linux/linkage.h>
19#include <asm/variant/core.h> 19#include <variant/core.h>
20 20
21/* 21/*
22 * computes a partial checksum, e.g. for TCP/UDP fragments 22 * computes a partial checksum, e.g. for TCP/UDP fragments
diff --git a/arch/xtensa/lib/memcopy.S b/arch/xtensa/lib/memcopy.S
index ddda8f4bc862..ea59dcd03866 100644
--- a/arch/xtensa/lib/memcopy.S
+++ b/arch/xtensa/lib/memcopy.S
@@ -9,7 +9,7 @@
9 * Copyright (C) 2002 - 2005 Tensilica Inc. 9 * Copyright (C) 2002 - 2005 Tensilica Inc.
10 */ 10 */
11 11
12#include <asm/variant/core.h> 12#include <variant/core.h>
13 13
14 .macro src_b r, w0, w1 14 .macro src_b r, w0, w1
15#ifdef __XTENSA_EB__ 15#ifdef __XTENSA_EB__
diff --git a/arch/xtensa/lib/memset.S b/arch/xtensa/lib/memset.S
index 56a17495b2db..10b8c400f175 100644
--- a/arch/xtensa/lib/memset.S
+++ b/arch/xtensa/lib/memset.S
@@ -11,7 +11,7 @@
11 * Copyright (C) 2002 Tensilica Inc. 11 * Copyright (C) 2002 Tensilica Inc.
12 */ 12 */
13 13
14#include <asm/variant/core.h> 14#include <variant/core.h>
15 15
16/* 16/*
17 * void *memset(void *dst, int c, size_t length) 17 * void *memset(void *dst, int c, size_t length)
diff --git a/arch/xtensa/lib/strncpy_user.S b/arch/xtensa/lib/strncpy_user.S
index b2655d94558d..9f603cdaaa68 100644
--- a/arch/xtensa/lib/strncpy_user.S
+++ b/arch/xtensa/lib/strncpy_user.S
@@ -11,7 +11,7 @@
11 * Copyright (C) 2002 Tensilica Inc. 11 * Copyright (C) 2002 Tensilica Inc.
12 */ 12 */
13 13
14#include <asm/variant/core.h> 14#include <variant/core.h>
15#include <linux/errno.h> 15#include <linux/errno.h>
16 16
17/* Load or store instructions that may cause exceptions use the EX macro. */ 17/* Load or store instructions that may cause exceptions use the EX macro. */
diff --git a/arch/xtensa/lib/strnlen_user.S b/arch/xtensa/lib/strnlen_user.S
index ad3f616322ca..23f2a89816a1 100644
--- a/arch/xtensa/lib/strnlen_user.S
+++ b/arch/xtensa/lib/strnlen_user.S
@@ -11,7 +11,7 @@
11 * Copyright (C) 2002 Tensilica Inc. 11 * Copyright (C) 2002 Tensilica Inc.
12 */ 12 */
13 13
14#include <asm/variant/core.h> 14#include <variant/core.h>
15 15
16/* Load or store instructions that may cause exceptions use the EX macro. */ 16/* Load or store instructions that may cause exceptions use the EX macro. */
17 17
diff --git a/arch/xtensa/lib/usercopy.S b/arch/xtensa/lib/usercopy.S
index a8ab1d4fe0ae..46d60314bb16 100644
--- a/arch/xtensa/lib/usercopy.S
+++ b/arch/xtensa/lib/usercopy.S
@@ -53,7 +53,7 @@
53 * a11/ original length 53 * a11/ original length
54 */ 54 */
55 55
56#include <asm/variant/core.h> 56#include <variant/core.h>
57 57
58#ifdef __XTENSA_EB__ 58#ifdef __XTENSA_EB__
59#define ALIGN(R, W0, W1) src R, W0, W1 59#define ALIGN(R, W0, W1) src R, W0, W1
diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c
index 9141e3690731..efed8897bef3 100644
--- a/arch/xtensa/platforms/iss/console.c
+++ b/arch/xtensa/platforms/iss/console.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/xtensa/platform-iss/console.c 2 * arch/xtensa/platforms/iss/console.c
3 * 3 *
4 * This file is subject to the terms and conditions of the GNU General Public 4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive 5 * License. See the file "COPYING" in the main directory of this archive
@@ -24,7 +24,7 @@
24#include <asm/uaccess.h> 24#include <asm/uaccess.h>
25#include <asm/irq.h> 25#include <asm/irq.h>
26 26
27#include <asm/platform/simcall.h> 27#include <platform/simcall.h>
28 28
29#include <linux/tty.h> 29#include <linux/tty.h>
30#include <linux/tty_flip.h> 30#include <linux/tty_flip.h>
diff --git a/arch/xtensa/platforms/iss/include/platform/hardware.h b/arch/xtensa/platforms/iss/include/platform/hardware.h
new file mode 100644
index 000000000000..6930c12adc16
--- /dev/null
+++ b/arch/xtensa/platforms/iss/include/platform/hardware.h
@@ -0,0 +1,29 @@
1/*
2 * include/asm-xtensa/platform-iss/hardware.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 Tensilica Inc.
9 */
10
11/*
12 * This file contains the default configuration of ISS.
13 */
14
15#ifndef _XTENSA_PLATFORM_ISS_HARDWARE_H
16#define _XTENSA_PLATFORM_ISS_HARDWARE_H
17
18/*
19 * Memory configuration.
20 */
21
22#define PLATFORM_DEFAULT_MEM_START 0x00000000
23#define PLATFORM_DEFAULT_MEM_SIZE 0x08000000
24
25/*
26 * Interrupt configuration.
27 */
28
29#endif /* _XTENSA_PLATFORM_ISS_HARDWARE_H */
diff --git a/arch/xtensa/platforms/iss/include/platform/simcall.h b/arch/xtensa/platforms/iss/include/platform/simcall.h
new file mode 100644
index 000000000000..b7952c06a2b7
--- /dev/null
+++ b/arch/xtensa/platforms/iss/include/platform/simcall.h
@@ -0,0 +1,62 @@
1/*
2 * include/asm-xtensa/platform-iss/simcall.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_PLATFORM_ISS_SIMCALL_H
12#define _XTENSA_PLATFORM_ISS_SIMCALL_H
13
14
15/*
16 * System call like services offered by the simulator host.
17 */
18
19#define SYS_nop 0 /* unused */
20#define SYS_exit 1 /*x*/
21#define SYS_fork 2
22#define SYS_read 3 /*x*/
23#define SYS_write 4 /*x*/
24#define SYS_open 5 /*x*/
25#define SYS_close 6 /*x*/
26#define SYS_rename 7 /*x 38 - waitpid */
27#define SYS_creat 8 /*x*/
28#define SYS_link 9 /*x (not implemented on WIN32) */
29#define SYS_unlink 10 /*x*/
30#define SYS_execv 11 /* n/a - execve */
31#define SYS_execve 12 /* 11 - chdir */
32#define SYS_pipe 13 /* 42 - time */
33#define SYS_stat 14 /* 106 - mknod */
34#define SYS_chmod 15
35#define SYS_chown 16 /* 202 - lchown */
36#define SYS_utime 17 /* 30 - break */
37#define SYS_wait 18 /* n/a - oldstat */
38#define SYS_lseek 19 /*x*/
39#define SYS_getpid 20
40#define SYS_isatty 21 /* n/a - mount */
41#define SYS_fstat 22 /* 108 - oldumount */
42#define SYS_time 23 /* 13 - setuid */
43#define SYS_gettimeofday 24 /*x 78 - getuid (not implemented on WIN32) */
44#define SYS_times 25 /*X 43 - stime (Xtensa-specific implementation) */
45#define SYS_socket 26
46#define SYS_sendto 27
47#define SYS_recvfrom 28
48#define SYS_select_one 29 /* not compitible select, one file descriptor at the time */
49#define SYS_bind 30
50#define SYS_ioctl 31
51
52/*
53 * SYS_select_one specifiers
54 */
55
56#define XTISS_SELECT_ONE_READ 1
57#define XTISS_SELECT_ONE_WRITE 2
58#define XTISS_SELECT_ONE_EXCEPT 3
59
60
61#endif /* _XTENSA_PLATFORM_ISS_SIMCALL_H */
62
diff --git a/arch/xtensa/platforms/iss/io.c b/arch/xtensa/platforms/iss/io.c
index 5b161a5cb65f..571d0b24f895 100644
--- a/arch/xtensa/platforms/iss/io.c
+++ b/arch/xtensa/platforms/iss/io.c
@@ -3,7 +3,7 @@
3#if 0 3#if 0
4 4
5#include <asm/io.h> 5#include <asm/io.h>
6#include <xtensa/simcall.h> 6#include <platform/platform-iss/simcall.h>
7 7
8extern int __simc (); 8extern int __simc ();
9 9
diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c
index 64f057d89e73..edad4156d89a 100644
--- a/arch/xtensa/platforms/iss/network.c
+++ b/arch/xtensa/platforms/iss/network.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * arch/xtensa/platform-iss/network.c 3 * arch/xtensa/platforms/iss/network.c
4 * 4 *
5 * Platform specific initialization. 5 * Platform specific initialization.
6 * 6 *
@@ -33,7 +33,7 @@
33#include <linux/rtnetlink.h> 33#include <linux/rtnetlink.h>
34#include <linux/platform_device.h> 34#include <linux/platform_device.h>
35 35
36#include <asm/platform/simcall.h> 36#include <platform/simcall.h>
37 37
38#define DRIVER_NAME "iss-netdev" 38#define DRIVER_NAME "iss-netdev"
39#define ETH_MAX_PACKET 1500 39#define ETH_MAX_PACKET 1500
diff --git a/arch/xtensa/platforms/xt2000/Makefile b/arch/xtensa/platforms/xt2000/Makefile
new file mode 100644
index 000000000000..54d018e45bfc
--- /dev/null
+++ b/arch/xtensa/platforms/xt2000/Makefile
@@ -0,0 +1,5 @@
1#
2# Makefile for the Tensilica XT2000 Emulation Board
3#
4
5obj-y = setup.o
diff --git a/arch/xtensa/platforms/xt2000/include/platform/hardware.h b/arch/xtensa/platforms/xt2000/include/platform/hardware.h
new file mode 100644
index 000000000000..41459ad07766
--- /dev/null
+++ b/arch/xtensa/platforms/xt2000/include/platform/hardware.h
@@ -0,0 +1,55 @@
1/*
2 * platform/hardware.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 Tensilica Inc.
9 */
10
11/*
12 * This file contains the hardware configuration of the XT2000 board.
13 */
14
15#ifndef _XTENSA_XT2000_HARDWARE_H
16#define _XTENSA_XT2000_HARDWARE_H
17
18#include <variant/core.h>
19#include <asm/io.h>
20
21/*
22 * Memory configuration.
23 */
24
25#define PLATFORM_DEFAULT_MEM_START 0x00000000
26#define PLATFORM_DEFAULT_MEM_SIZE 0x08000000
27
28/*
29 * Number of platform IRQs
30 */
31#define PLATFORM_NR_IRQS 3
32/*
33 * On-board components.
34 */
35
36#define SONIC83934_INTNUM XCHAL_EXTINT3_NUM
37#define SONIC83934_ADDR IOADDR(0x0d030000)
38
39/*
40 * V3-PCI
41 */
42
43/* The XT2000 uses the V3 as a cascaded interrupt controller for the PCI bus */
44
45#define IRQ_PCI_A (XCHAL_NUM_INTERRUPTS + 0)
46#define IRQ_PCI_B (XCHAL_NUM_INTERRUPTS + 1)
47#define IRQ_PCI_C (XCHAL_NUM_INTERRUPTS + 2)
48
49/*
50 * Various other components.
51 */
52
53#define XT2000_LED_ADDR IOADDR(0x0d040000)
54
55#endif /* _XTENSA_XT2000_HARDWARE_H */
diff --git a/arch/xtensa/platforms/xt2000/include/platform/serial.h b/arch/xtensa/platforms/xt2000/include/platform/serial.h
new file mode 100644
index 000000000000..7226cf732b47
--- /dev/null
+++ b/arch/xtensa/platforms/xt2000/include/platform/serial.h
@@ -0,0 +1,28 @@
1/*
2 * platform/serial.h
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 2001 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_XT2000_SERIAL_H
12#define _XTENSA_XT2000_SERIAL_H
13
14#include <variant/core.h>
15#include <asm/io.h>
16
17/* National-Semi PC16552D DUART: */
18
19#define DUART16552_1_INTNUM XCHAL_EXTINT4_NUM
20#define DUART16552_2_INTNUM XCHAL_EXTINT5_NUM
21
22#define DUART16552_1_ADDR IOADDR(0x0d050020) /* channel 1 */
23#define DUART16552_2_ADDR IOADDR(0x0d050000) /* channel 2 */
24
25#define DUART16552_XTAL_FREQ 18432000 /* crystal frequency in Hz */
26#define BASE_BAUD ( DUART16552_XTAL_FREQ / 16 )
27
28#endif /* _XTENSA_XT2000_SERIAL_H */
diff --git a/arch/xtensa/platforms/xt2000/setup.c b/arch/xtensa/platforms/xt2000/setup.c
new file mode 100644
index 000000000000..9e83940ac265
--- /dev/null
+++ b/arch/xtensa/platforms/xt2000/setup.c
@@ -0,0 +1,181 @@
1/*
2 * arch/xtensa/platforms/xt2000/setup.c
3 *
4 * Platform specific functions for the XT2000 board.
5 *
6 * Authors: Chris Zankel <chris@zankel.net>
7 * Joe Taylor <joe@tensilica.com>
8 *
9 * Copyright 2001 - 2004 Tensilica Inc.
10 *
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at your
14 * option) any later version.
15 *
16 */
17#include <linux/stddef.h>
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/errno.h>
21#include <linux/reboot.h>
22#include <linux/kdev_t.h>
23#include <linux/types.h>
24#include <linux/major.h>
25#include <linux/console.h>
26#include <linux/delay.h>
27#include <linux/stringify.h>
28#include <linux/platform_device.h>
29#include <linux/serial.h>
30#include <linux/serial_8250.h>
31
32#include <asm/processor.h>
33#include <asm/platform.h>
34#include <asm/bootparam.h>
35#include <platform/hardware.h>
36#include <platform/serial.h>
37
38/* Assumes s points to an 8-chr string. No checking for NULL. */
39
40static void led_print (int f, char *s)
41{
42 unsigned long* led_addr = (unsigned long*) (XT2000_LED_ADDR + 0xE0) + f;
43 int i;
44 for (i = f; i < 8; i++)
45 if ((*led_addr++ = *s++) == 0)
46 break;
47}
48
49void platform_halt(void)
50{
51 led_print (0, " HALT ");
52 local_irq_disable();
53 while (1);
54}
55
56void platform_power_off(void)
57{
58 led_print (0, "POWEROFF");
59 local_irq_disable();
60 while (1);
61}
62
63void platform_restart(void)
64{
65 /* Flush and reset the mmu, simulate a processor reset, and
66 * jump to the reset vector. */
67
68 __asm__ __volatile__ ("movi a2, 15\n\t"
69 "wsr a2, " __stringify(ICOUNTLEVEL) "\n\t"
70 "movi a2, 0\n\t"
71 "wsr a2, " __stringify(ICOUNT) "\n\t"
72 "wsr a2, " __stringify(IBREAKENABLE) "\n\t"
73 "wsr a2, " __stringify(LCOUNT) "\n\t"
74 "movi a2, 0x1f\n\t"
75 "wsr a2, " __stringify(PS) "\n\t"
76 "isync\n\t"
77 "jx %0\n\t"
78 :
79 : "a" (XCHAL_RESET_VECTOR_VADDR)
80 : "a2"
81 );
82
83 /* control never gets here */
84}
85
86void __init platform_setup(char** cmdline)
87{
88 led_print (0, "LINUX ");
89}
90
91/* early initialization */
92
93extern sysmem_info_t __initdata sysmem;
94
95void platform_init(bp_tag_t* first)
96{
97 /* Set default memory block if not provided by the bootloader. */
98
99 if (sysmem.nr_banks == 0) {
100 sysmem.nr_banks = 1;
101 sysmem.bank[0].start = PLATFORM_DEFAULT_MEM_START;
102 sysmem.bank[0].end = PLATFORM_DEFAULT_MEM_START
103 + PLATFORM_DEFAULT_MEM_SIZE;
104 }
105}
106
107/* Heartbeat. Let the LED blink. */
108
109void platform_heartbeat(void)
110{
111 static int i=0, t = 0;
112
113 if (--t < 0)
114 {
115 t = 59;
116 led_print(7, i ? ".": " ");
117 i ^= 1;
118 }
119}
120
121//#define RS_TABLE_SIZE 2
122//#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF|ASYNC_SKIP_TEST)
123
124#define _SERIAL_PORT(_base,_irq) \
125{ \
126 .mapbase = (_base), \
127 .membase = (void*)(_base), \
128 .irq = (_irq), \
129 .uartclk = DUART16552_XTAL_FREQ, \
130 .iotype = UPIO_MEM, \
131 .flags = UPF_BOOT_AUTOCONF, \
132 .regshift = 2, \
133}
134
135static struct plat_serial8250_port xt2000_serial_data[] = {
136#if XCHAL_HAVE_BE
137 _SERIAL_PORT(DUART16552_1_ADDR + 3, DUART16552_1_INTNUM),
138 _SERIAL_PORT(DUART16552_2_ADDR + 3, DUART16552_2_INTNUM),
139#else
140 _SERIAL_PORT(DUART16552_1_ADDR, DUART16552_1_INTNUM),
141 _SERIAL_PORT(DUART16552_2_ADDR, DUART16552_2_INTNUM),
142#endif
143 { }
144};
145
146static struct platform_device xt2000_serial8250_device = {
147 .name = "serial8250",
148 .id = PLAT8250_DEV_PLATFORM,
149 .dev = {
150 .platform_data = xt2000_serial_data,
151 },
152};
153
154static struct resource xt2000_sonic_res[] = {
155 {
156 .start = SONIC83934_ADDR,
157 .end = SONIC83934_ADDR + 0xff,
158 .flags = IORESOURCE_MEM,
159 },
160 {
161 .start = SONIC83934_INTNUM,
162 .end = SONIC83934_INTNUM,
163 .flags = IORESOURCE_IRQ,
164 },
165};
166
167static struct platform_device xt2000_sonic_device = {
168 .name = "xtsonic",
169 .num_resources = ARRAY_SIZE(xt2000_sonic_res),
170 .resource = xt2000_sonic_res,
171};
172
173static int __init xt2000_setup_devinit(void)
174{
175 platform_device_register(&xt2000_serial8250_device);
176 platform_device_register(&xt2000_sonic_device);
177
178 return 0;
179}
180
181device_initcall(xt2000_setup_devinit);
diff --git a/arch/xtensa/variants/dc232b/include/variant/core.h b/arch/xtensa/variants/dc232b/include/variant/core.h
new file mode 100644
index 000000000000..525bd3d90154
--- /dev/null
+++ b/arch/xtensa/variants/dc232b/include/variant/core.h
@@ -0,0 +1,424 @@
1/*
2 * Xtensa processor core configuration information.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (c) 1999-2007 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CORE_CONFIGURATION_H
12#define _XTENSA_CORE_CONFIGURATION_H
13
14
15/****************************************************************************
16 Parameters Useful for Any Code, USER or PRIVILEGED
17 ****************************************************************************/
18
19/*
20 * Note: Macros of the form XCHAL_HAVE_*** have a value of 1 if the option is
21 * configured, and a value of 0 otherwise. These macros are always defined.
22 */
23
24
25/*----------------------------------------------------------------------
26 ISA
27 ----------------------------------------------------------------------*/
28
29#define XCHAL_HAVE_BE 0 /* big-endian byte ordering */
30#define XCHAL_HAVE_WINDOWED 1 /* windowed registers option */
31#define XCHAL_NUM_AREGS 32 /* num of physical addr regs */
32#define XCHAL_NUM_AREGS_LOG2 5 /* log2(XCHAL_NUM_AREGS) */
33#define XCHAL_MAX_INSTRUCTION_SIZE 3 /* max instr bytes (3..8) */
34#define XCHAL_HAVE_DEBUG 1 /* debug option */
35#define XCHAL_HAVE_DENSITY 1 /* 16-bit instructions */
36#define XCHAL_HAVE_LOOPS 1 /* zero-overhead loops */
37#define XCHAL_HAVE_NSA 1 /* NSA/NSAU instructions */
38#define XCHAL_HAVE_MINMAX 1 /* MIN/MAX instructions */
39#define XCHAL_HAVE_SEXT 1 /* SEXT instruction */
40#define XCHAL_HAVE_CLAMPS 1 /* CLAMPS instruction */
41#define XCHAL_HAVE_MUL16 1 /* MUL16S/MUL16U instructions */
42#define XCHAL_HAVE_MUL32 1 /* MULL instruction */
43#define XCHAL_HAVE_MUL32_HIGH 0 /* MULUH/MULSH instructions */
44#define XCHAL_HAVE_DIV32 1 /* QUOS/QUOU/REMS/REMU instructions */
45#define XCHAL_HAVE_L32R 1 /* L32R instruction */
46#define XCHAL_HAVE_ABSOLUTE_LITERALS 1 /* non-PC-rel (extended) L32R */
47#define XCHAL_HAVE_CONST16 0 /* CONST16 instruction */
48#define XCHAL_HAVE_ADDX 1 /* ADDX#/SUBX# instructions */
49#define XCHAL_HAVE_WIDE_BRANCHES 0 /* B*.W18 or B*.W15 instr's */
50#define XCHAL_HAVE_PREDICTED_BRANCHES 0 /* B[EQ/EQZ/NE/NEZ]T instr's */
51#define XCHAL_HAVE_CALL4AND12 1 /* (obsolete option) */
52#define XCHAL_HAVE_ABS 1 /* ABS instruction */
53/*#define XCHAL_HAVE_POPC 0*/ /* POPC instruction */
54/*#define XCHAL_HAVE_CRC 0*/ /* CRC instruction */
55#define XCHAL_HAVE_RELEASE_SYNC 1 /* L32AI/S32RI instructions */
56#define XCHAL_HAVE_S32C1I 1 /* S32C1I instruction */
57#define XCHAL_HAVE_SPECULATION 0 /* speculation */
58#define XCHAL_HAVE_FULL_RESET 1 /* all regs/state reset */
59#define XCHAL_NUM_CONTEXTS 1 /* */
60#define XCHAL_NUM_MISC_REGS 2 /* num of scratch regs (0..4) */
61#define XCHAL_HAVE_TAP_MASTER 0 /* JTAG TAP control instr's */
62#define XCHAL_HAVE_PRID 1 /* processor ID register */
63#define XCHAL_HAVE_THREADPTR 1 /* THREADPTR register */
64#define XCHAL_HAVE_BOOLEANS 0 /* boolean registers */
65#define XCHAL_HAVE_CP 1 /* CPENABLE reg (coprocessor) */
66#define XCHAL_CP_MAXCFG 8 /* max allowed cp id plus one */
67#define XCHAL_HAVE_MAC16 1 /* MAC16 package */
68#define XCHAL_HAVE_VECTORFPU2005 0 /* vector floating-point pkg */
69#define XCHAL_HAVE_FP 0 /* floating point pkg */
70#define XCHAL_HAVE_VECTRA1 0 /* Vectra I pkg */
71#define XCHAL_HAVE_VECTRALX 0 /* Vectra LX pkg */
72#define XCHAL_HAVE_HIFI2 0 /* HiFi2 Audio Engine pkg */
73
74
75/*----------------------------------------------------------------------
76 MISC
77 ----------------------------------------------------------------------*/
78
79#define XCHAL_NUM_WRITEBUFFER_ENTRIES 8 /* size of write buffer */
80#define XCHAL_INST_FETCH_WIDTH 4 /* instr-fetch width in bytes */
81#define XCHAL_DATA_WIDTH 4 /* data width in bytes */
82/* In T1050, applies to selected core load and store instructions (see ISA): */
83#define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* unaligned loads cause exc. */
84#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* unaligned stores cause exc.*/
85
86#define XCHAL_SW_VERSION 701001 /* sw version of this header */
87
88#define XCHAL_CORE_ID "dc232b" /* alphanum core name
89 (CoreID) set in the Xtensa
90 Processor Generator */
91
92#define XCHAL_CORE_DESCRIPTION "Diamond 232L Standard Core Rev.B (LE)"
93#define XCHAL_BUILD_UNIQUE_ID 0x0000BEEF /* 22-bit sw build ID */
94
95/*
96 * These definitions describe the hardware targeted by this software.
97 */
98#define XCHAL_HW_CONFIGID0 0xC56307FE /* ConfigID hi 32 bits*/
99#define XCHAL_HW_CONFIGID1 0x0D40BEEF /* ConfigID lo 32 bits*/
100#define XCHAL_HW_VERSION_NAME "LX2.1.1" /* full version name */
101#define XCHAL_HW_VERSION_MAJOR 2210 /* major ver# of targeted hw */
102#define XCHAL_HW_VERSION_MINOR 1 /* minor ver# of targeted hw */
103#define XCHAL_HW_VERSION 221001 /* major*100+minor */
104#define XCHAL_HW_REL_LX2 1
105#define XCHAL_HW_REL_LX2_1 1
106#define XCHAL_HW_REL_LX2_1_1 1
107#define XCHAL_HW_CONFIGID_RELIABLE 1
108/* If software targets a *range* of hardware versions, these are the bounds: */
109#define XCHAL_HW_MIN_VERSION_MAJOR 2210 /* major v of earliest tgt hw */
110#define XCHAL_HW_MIN_VERSION_MINOR 1 /* minor v of earliest tgt hw */
111#define XCHAL_HW_MIN_VERSION 221001 /* earliest targeted hw */
112#define XCHAL_HW_MAX_VERSION_MAJOR 2210 /* major v of latest tgt hw */
113#define XCHAL_HW_MAX_VERSION_MINOR 1 /* minor v of latest tgt hw */
114#define XCHAL_HW_MAX_VERSION 221001 /* latest targeted hw */
115
116
117/*----------------------------------------------------------------------
118 CACHE
119 ----------------------------------------------------------------------*/
120
121#define XCHAL_ICACHE_LINESIZE 32 /* I-cache line size in bytes */
122#define XCHAL_DCACHE_LINESIZE 32 /* D-cache line size in bytes */
123#define XCHAL_ICACHE_LINEWIDTH 5 /* log2(I line size in bytes) */
124#define XCHAL_DCACHE_LINEWIDTH 5 /* log2(D line size in bytes) */
125
126#define XCHAL_ICACHE_SIZE 16384 /* I-cache size in bytes or 0 */
127#define XCHAL_DCACHE_SIZE 16384 /* D-cache size in bytes or 0 */
128
129#define XCHAL_DCACHE_IS_WRITEBACK 1 /* writeback feature */
130
131
132
133
134/****************************************************************************
135 Parameters Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code
136 ****************************************************************************/
137
138
139#ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY
140
141/*----------------------------------------------------------------------
142 CACHE
143 ----------------------------------------------------------------------*/
144
145#define XCHAL_HAVE_PIF 1 /* any outbound PIF present */
146
147/* If present, cache size in bytes == (ways * 2^(linewidth + setwidth)). */
148
149/* Number of cache sets in log2(lines per way): */
150#define XCHAL_ICACHE_SETWIDTH 7
151#define XCHAL_DCACHE_SETWIDTH 7
152
153/* Cache set associativity (number of ways): */
154#define XCHAL_ICACHE_WAYS 4
155#define XCHAL_DCACHE_WAYS 4
156
157/* Cache features: */
158#define XCHAL_ICACHE_LINE_LOCKABLE 1
159#define XCHAL_DCACHE_LINE_LOCKABLE 1
160#define XCHAL_ICACHE_ECC_PARITY 0
161#define XCHAL_DCACHE_ECC_PARITY 0
162
163/* Number of encoded cache attr bits (see <xtensa/hal.h> for decoded bits): */
164#define XCHAL_CA_BITS 4
165
166
167/*----------------------------------------------------------------------
168 INTERNAL I/D RAM/ROMs and XLMI
169 ----------------------------------------------------------------------*/
170
171#define XCHAL_NUM_INSTROM 0 /* number of core instr. ROMs */
172#define XCHAL_NUM_INSTRAM 0 /* number of core instr. RAMs */
173#define XCHAL_NUM_DATAROM 0 /* number of core data ROMs */
174#define XCHAL_NUM_DATARAM 0 /* number of core data RAMs */
175#define XCHAL_NUM_URAM 0 /* number of core unified RAMs*/
176#define XCHAL_NUM_XLMI 0 /* number of core XLMI ports */
177
178
179/*----------------------------------------------------------------------
180 INTERRUPTS and TIMERS
181 ----------------------------------------------------------------------*/
182
183#define XCHAL_HAVE_INTERRUPTS 1 /* interrupt option */
184#define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* med/high-pri. interrupts */
185#define XCHAL_HAVE_NMI 1 /* non-maskable interrupt */
186#define XCHAL_HAVE_CCOUNT 1 /* CCOUNT reg. (timer option) */
187#define XCHAL_NUM_TIMERS 3 /* number of CCOMPAREn regs */
188#define XCHAL_NUM_INTERRUPTS 22 /* number of interrupts */
189#define XCHAL_NUM_INTERRUPTS_LOG2 5 /* ceil(log2(NUM_INTERRUPTS)) */
190#define XCHAL_NUM_EXTINTERRUPTS 17 /* num of external interrupts */
191#define XCHAL_NUM_INTLEVELS 6 /* number of interrupt levels
192 (not including level zero) */
193#define XCHAL_EXCM_LEVEL 3 /* level masked by PS.EXCM */
194 /* (always 1 in XEA1; levels 2 .. EXCM_LEVEL are "medium priority") */
195
196/* Masks of interrupts at each interrupt level: */
197#define XCHAL_INTLEVEL1_MASK 0x001F80FF
198#define XCHAL_INTLEVEL2_MASK 0x00000100
199#define XCHAL_INTLEVEL3_MASK 0x00200E00
200#define XCHAL_INTLEVEL4_MASK 0x00001000
201#define XCHAL_INTLEVEL5_MASK 0x00002000
202#define XCHAL_INTLEVEL6_MASK 0x00000000
203#define XCHAL_INTLEVEL7_MASK 0x00004000
204
205/* Masks of interrupts at each range 1..n of interrupt levels: */
206#define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x001F80FF
207#define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x001F81FF
208#define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x003F8FFF
209#define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x003F9FFF
210#define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x003FBFFF
211#define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x003FBFFF
212#define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x003FFFFF
213
214/* Level of each interrupt: */
215#define XCHAL_INT0_LEVEL 1
216#define XCHAL_INT1_LEVEL 1
217#define XCHAL_INT2_LEVEL 1
218#define XCHAL_INT3_LEVEL 1
219#define XCHAL_INT4_LEVEL 1
220#define XCHAL_INT5_LEVEL 1
221#define XCHAL_INT6_LEVEL 1
222#define XCHAL_INT7_LEVEL 1
223#define XCHAL_INT8_LEVEL 2
224#define XCHAL_INT9_LEVEL 3
225#define XCHAL_INT10_LEVEL 3
226#define XCHAL_INT11_LEVEL 3
227#define XCHAL_INT12_LEVEL 4
228#define XCHAL_INT13_LEVEL 5
229#define XCHAL_INT14_LEVEL 7
230#define XCHAL_INT15_LEVEL 1
231#define XCHAL_INT16_LEVEL 1
232#define XCHAL_INT17_LEVEL 1
233#define XCHAL_INT18_LEVEL 1
234#define XCHAL_INT19_LEVEL 1
235#define XCHAL_INT20_LEVEL 1
236#define XCHAL_INT21_LEVEL 3
237#define XCHAL_DEBUGLEVEL 6 /* debug interrupt level */
238#define XCHAL_HAVE_DEBUG_EXTERN_INT 1 /* OCD external db interrupt */
239#define XCHAL_NMILEVEL 7 /* NMI "level" (for use with
240 EXCSAVE/EPS/EPC_n, RFI n) */
241
242/* Type of each interrupt: */
243#define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
244#define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
245#define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
246#define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
247#define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
248#define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
249#define XCHAL_INT6_TYPE XTHAL_INTTYPE_TIMER
250#define XCHAL_INT7_TYPE XTHAL_INTTYPE_SOFTWARE
251#define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
252#define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
253#define XCHAL_INT10_TYPE XTHAL_INTTYPE_TIMER
254#define XCHAL_INT11_TYPE XTHAL_INTTYPE_SOFTWARE
255#define XCHAL_INT12_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
256#define XCHAL_INT13_TYPE XTHAL_INTTYPE_TIMER
257#define XCHAL_INT14_TYPE XTHAL_INTTYPE_NMI
258#define XCHAL_INT15_TYPE XTHAL_INTTYPE_EXTERN_EDGE
259#define XCHAL_INT16_TYPE XTHAL_INTTYPE_EXTERN_EDGE
260#define XCHAL_INT17_TYPE XTHAL_INTTYPE_EXTERN_EDGE
261#define XCHAL_INT18_TYPE XTHAL_INTTYPE_EXTERN_EDGE
262#define XCHAL_INT19_TYPE XTHAL_INTTYPE_EXTERN_EDGE
263#define XCHAL_INT20_TYPE XTHAL_INTTYPE_EXTERN_EDGE
264#define XCHAL_INT21_TYPE XTHAL_INTTYPE_EXTERN_EDGE
265
266/* Masks of interrupts for each type of interrupt: */
267#define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xFFC00000
268#define XCHAL_INTTYPE_MASK_SOFTWARE 0x00000880
269#define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x003F8000
270#define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x0000133F
271#define XCHAL_INTTYPE_MASK_TIMER 0x00002440
272#define XCHAL_INTTYPE_MASK_NMI 0x00004000
273#define XCHAL_INTTYPE_MASK_WRITE_ERROR 0x00000000
274
275/* Interrupt numbers assigned to specific interrupt sources: */
276#define XCHAL_TIMER0_INTERRUPT 6 /* CCOMPARE0 */
277#define XCHAL_TIMER1_INTERRUPT 10 /* CCOMPARE1 */
278#define XCHAL_TIMER2_INTERRUPT 13 /* CCOMPARE2 */
279#define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED
280#define XCHAL_NMI_INTERRUPT 14 /* non-maskable interrupt */
281
282/* Interrupt numbers for levels at which only one interrupt is configured: */
283#define XCHAL_INTLEVEL2_NUM 8
284#define XCHAL_INTLEVEL4_NUM 12
285#define XCHAL_INTLEVEL5_NUM 13
286#define XCHAL_INTLEVEL7_NUM 14
287/* (There are many interrupts each at level(s) 1, 3.) */
288
289
290/*
291 * External interrupt vectors/levels.
292 * These macros describe how Xtensa processor interrupt numbers
293 * (as numbered internally, eg. in INTERRUPT and INTENABLE registers)
294 * map to external BInterrupt<n> pins, for those interrupts
295 * configured as external (level-triggered, edge-triggered, or NMI).
296 * See the Xtensa processor databook for more details.
297 */
298
299/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */
300#define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */
301#define XCHAL_EXTINT1_NUM 1 /* (intlevel 1) */
302#define XCHAL_EXTINT2_NUM 2 /* (intlevel 1) */
303#define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */
304#define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */
305#define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */
306#define XCHAL_EXTINT6_NUM 8 /* (intlevel 2) */
307#define XCHAL_EXTINT7_NUM 9 /* (intlevel 3) */
308#define XCHAL_EXTINT8_NUM 12 /* (intlevel 4) */
309#define XCHAL_EXTINT9_NUM 14 /* (intlevel 7) */
310#define XCHAL_EXTINT10_NUM 15 /* (intlevel 1) */
311#define XCHAL_EXTINT11_NUM 16 /* (intlevel 1) */
312#define XCHAL_EXTINT12_NUM 17 /* (intlevel 1) */
313#define XCHAL_EXTINT13_NUM 18 /* (intlevel 1) */
314#define XCHAL_EXTINT14_NUM 19 /* (intlevel 1) */
315#define XCHAL_EXTINT15_NUM 20 /* (intlevel 1) */
316#define XCHAL_EXTINT16_NUM 21 /* (intlevel 3) */
317
318
319/*----------------------------------------------------------------------
320 EXCEPTIONS and VECTORS
321 ----------------------------------------------------------------------*/
322
323#define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture
324 number: 1 == XEA1 (old)
325 2 == XEA2 (new)
326 0 == XEAX (extern) */
327#define XCHAL_HAVE_XEA1 0 /* Exception Architecture 1 */
328#define XCHAL_HAVE_XEA2 1 /* Exception Architecture 2 */
329#define XCHAL_HAVE_XEAX 0 /* External Exception Arch. */
330#define XCHAL_HAVE_EXCEPTIONS 1 /* exception option */
331#define XCHAL_HAVE_MEM_ECC_PARITY 0 /* local memory ECC/parity */
332#define XCHAL_HAVE_VECTOR_SELECT 1 /* relocatable vectors */
333#define XCHAL_HAVE_VECBASE 1 /* relocatable vectors */
334#define XCHAL_VECBASE_RESET_VADDR 0xD0000000 /* VECBASE reset value */
335#define XCHAL_VECBASE_RESET_PADDR 0x00000000
336#define XCHAL_RESET_VECBASE_OVERLAP 0
337
338#define XCHAL_RESET_VECTOR0_VADDR 0xFE000000
339#define XCHAL_RESET_VECTOR0_PADDR 0xFE000000
340#define XCHAL_RESET_VECTOR1_VADDR 0xD8000500
341#define XCHAL_RESET_VECTOR1_PADDR 0x00000500
342#define XCHAL_RESET_VECTOR_VADDR 0xFE000000
343#define XCHAL_RESET_VECTOR_PADDR 0xFE000000
344#define XCHAL_USER_VECOFS 0x00000340
345#define XCHAL_USER_VECTOR_VADDR 0xD0000340
346#define XCHAL_USER_VECTOR_PADDR 0x00000340
347#define XCHAL_KERNEL_VECOFS 0x00000300
348#define XCHAL_KERNEL_VECTOR_VADDR 0xD0000300
349#define XCHAL_KERNEL_VECTOR_PADDR 0x00000300
350#define XCHAL_DOUBLEEXC_VECOFS 0x000003C0
351#define XCHAL_DOUBLEEXC_VECTOR_VADDR 0xD00003C0
352#define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x000003C0
353#define XCHAL_WINDOW_OF4_VECOFS 0x00000000
354#define XCHAL_WINDOW_UF4_VECOFS 0x00000040
355#define XCHAL_WINDOW_OF8_VECOFS 0x00000080
356#define XCHAL_WINDOW_UF8_VECOFS 0x000000C0
357#define XCHAL_WINDOW_OF12_VECOFS 0x00000100
358#define XCHAL_WINDOW_UF12_VECOFS 0x00000140
359#define XCHAL_WINDOW_VECTORS_VADDR 0xD0000000
360#define XCHAL_WINDOW_VECTORS_PADDR 0x00000000
361#define XCHAL_INTLEVEL2_VECOFS 0x00000180
362#define XCHAL_INTLEVEL2_VECTOR_VADDR 0xD0000180
363#define XCHAL_INTLEVEL2_VECTOR_PADDR 0x00000180
364#define XCHAL_INTLEVEL3_VECOFS 0x000001C0
365#define XCHAL_INTLEVEL3_VECTOR_VADDR 0xD00001C0
366#define XCHAL_INTLEVEL3_VECTOR_PADDR 0x000001C0
367#define XCHAL_INTLEVEL4_VECOFS 0x00000200
368#define XCHAL_INTLEVEL4_VECTOR_VADDR 0xD0000200
369#define XCHAL_INTLEVEL4_VECTOR_PADDR 0x00000200
370#define XCHAL_INTLEVEL5_VECOFS 0x00000240
371#define XCHAL_INTLEVEL5_VECTOR_VADDR 0xD0000240
372#define XCHAL_INTLEVEL5_VECTOR_PADDR 0x00000240
373#define XCHAL_INTLEVEL6_VECOFS 0x00000280
374#define XCHAL_INTLEVEL6_VECTOR_VADDR 0xD0000280
375#define XCHAL_INTLEVEL6_VECTOR_PADDR 0x00000280
376#define XCHAL_DEBUG_VECOFS XCHAL_INTLEVEL6_VECOFS
377#define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL6_VECTOR_VADDR
378#define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL6_VECTOR_PADDR
379#define XCHAL_NMI_VECOFS 0x000002C0
380#define XCHAL_NMI_VECTOR_VADDR 0xD00002C0
381#define XCHAL_NMI_VECTOR_PADDR 0x000002C0
382#define XCHAL_INTLEVEL7_VECOFS XCHAL_NMI_VECOFS
383#define XCHAL_INTLEVEL7_VECTOR_VADDR XCHAL_NMI_VECTOR_VADDR
384#define XCHAL_INTLEVEL7_VECTOR_PADDR XCHAL_NMI_VECTOR_PADDR
385
386
387/*----------------------------------------------------------------------
388 DEBUG
389 ----------------------------------------------------------------------*/
390
391#define XCHAL_HAVE_OCD 1 /* OnChipDebug option */
392#define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */
393#define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */
394#define XCHAL_HAVE_OCD_DIR_ARRAY 1 /* faster OCD option */
395
396
397/*----------------------------------------------------------------------
398 MMU
399 ----------------------------------------------------------------------*/
400
401/* See core-matmap.h header file for more details. */
402
403#define XCHAL_HAVE_TLBS 1 /* inverse of HAVE_CACHEATTR */
404#define XCHAL_HAVE_SPANNING_WAY 0 /* one way maps I+D 4GB vaddr */
405#define XCHAL_HAVE_IDENTITY_MAP 0 /* vaddr == paddr always */
406#define XCHAL_HAVE_CACHEATTR 0 /* CACHEATTR register present */
407#define XCHAL_HAVE_MIMIC_CACHEATTR 0 /* region protection */
408#define XCHAL_HAVE_XLT_CACHEATTR 0 /* region prot. w/translation */
409#define XCHAL_HAVE_PTP_MMU 1 /* full MMU (with page table
410 [autorefill] and protection)
411 usable for an MMU-based OS */
412/* If none of the above last 4 are set, it's a custom TLB configuration. */
413#define XCHAL_ITLB_ARF_ENTRIES_LOG2 2 /* log2(autorefill way size) */
414#define XCHAL_DTLB_ARF_ENTRIES_LOG2 2 /* log2(autorefill way size) */
415
416#define XCHAL_MMU_ASID_BITS 8 /* number of bits in ASIDs */
417#define XCHAL_MMU_RINGS 4 /* number of rings (1..4) */
418#define XCHAL_MMU_RING_BITS 2 /* num of bits in RING field */
419
420#endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */
421
422
423#endif /* _XTENSA_CORE_CONFIGURATION_H */
424
diff --git a/arch/xtensa/variants/dc232b/include/variant/tie-asm.h b/arch/xtensa/variants/dc232b/include/variant/tie-asm.h
new file mode 100644
index 000000000000..ed4f53f529db
--- /dev/null
+++ b/arch/xtensa/variants/dc232b/include/variant/tie-asm.h
@@ -0,0 +1,122 @@
1/*
2 * This header file contains assembly-language definitions (assembly
3 * macros, etc.) for this specific Xtensa processor's TIE extensions
4 * and options. It is customized to this Xtensa processor configuration.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1999-2007 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_CORE_TIE_ASM_H
14#define _XTENSA_CORE_TIE_ASM_H
15
16/* Selection parameter values for save-area save/restore macros: */
17/* Option vs. TIE: */
18#define XTHAL_SAS_TIE 0x0001 /* custom extension or coprocessor */
19#define XTHAL_SAS_OPT 0x0002 /* optional (and not a coprocessor) */
20/* Whether used automatically by compiler: */
21#define XTHAL_SAS_NOCC 0x0004 /* not used by compiler w/o special opts/code */
22#define XTHAL_SAS_CC 0x0008 /* used by compiler without special opts/code */
23/* ABI handling across function calls: */
24#define XTHAL_SAS_CALR 0x0010 /* caller-saved */
25#define XTHAL_SAS_CALE 0x0020 /* callee-saved */
26#define XTHAL_SAS_GLOB 0x0040 /* global across function calls (in thread) */
27/* Misc */
28#define XTHAL_SAS_ALL 0xFFFF /* include all default NCP contents */
29
30
31
32/* Macro to save all non-coprocessor (extra) custom TIE and optional state
33 * (not including zero-overhead loop registers).
34 * Save area ptr (clobbered): ptr (1 byte aligned)
35 * Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed)
36 */
37 .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL
38 xchal_sa_start \continue, \ofs
39 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~\select
40 xchal_sa_align \ptr, 0, 1024-8, 4, 4
41 rsr \at1, ACCLO // MAC16 accumulator
42 rsr \at2, ACCHI
43 s32i \at1, \ptr, .Lxchal_ofs_ + 0
44 s32i \at2, \ptr, .Lxchal_ofs_ + 4
45 .set .Lxchal_ofs_, .Lxchal_ofs_ + 8
46 .endif
47 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select
48 xchal_sa_align \ptr, 0, 1024-16, 4, 4
49 rsr \at1, M0 // MAC16 registers
50 rsr \at2, M1
51 s32i \at1, \ptr, .Lxchal_ofs_ + 0
52 s32i \at2, \ptr, .Lxchal_ofs_ + 4
53 rsr \at1, M2
54 rsr \at2, M3
55 s32i \at1, \ptr, .Lxchal_ofs_ + 8
56 s32i \at2, \ptr, .Lxchal_ofs_ + 12
57 .set .Lxchal_ofs_, .Lxchal_ofs_ + 16
58 .endif
59 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select
60 xchal_sa_align \ptr, 0, 1024-4, 4, 4
61 rsr \at1, SCOMPARE1 // conditional store option
62 s32i \at1, \ptr, .Lxchal_ofs_ + 0
63 .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
64 .endif
65 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~\select
66 xchal_sa_align \ptr, 0, 1024-4, 4, 4
67 rur \at1, THREADPTR // threadptr option
68 s32i \at1, \ptr, .Lxchal_ofs_ + 0
69 .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
70 .endif
71 .endm // xchal_ncp_store
72
73/* Macro to save all non-coprocessor (extra) custom TIE and optional state
74 * (not including zero-overhead loop registers).
75 * Save area ptr (clobbered): ptr (1 byte aligned)
76 * Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed)
77 */
78 .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL
79 xchal_sa_start \continue, \ofs
80 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_CALR) & ~\select
81 xchal_sa_align \ptr, 0, 1024-8, 4, 4
82 l32i \at1, \ptr, .Lxchal_ofs_ + 0
83 l32i \at2, \ptr, .Lxchal_ofs_ + 4
84 wsr \at1, ACCLO // MAC16 accumulator
85 wsr \at2, ACCHI
86 .set .Lxchal_ofs_, .Lxchal_ofs_ + 8
87 .endif
88 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select
89 xchal_sa_align \ptr, 0, 1024-16, 4, 4
90 l32i \at1, \ptr, .Lxchal_ofs_ + 0
91 l32i \at2, \ptr, .Lxchal_ofs_ + 4
92 wsr \at1, M0 // MAC16 registers
93 wsr \at2, M1
94 l32i \at1, \ptr, .Lxchal_ofs_ + 8
95 l32i \at2, \ptr, .Lxchal_ofs_ + 12
96 wsr \at1, M2
97 wsr \at2, M3
98 .set .Lxchal_ofs_, .Lxchal_ofs_ + 16
99 .endif
100 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_NOCC | XTHAL_SAS_CALR) & ~\select
101 xchal_sa_align \ptr, 0, 1024-4, 4, 4
102 l32i \at1, \ptr, .Lxchal_ofs_ + 0
103 wsr \at1, SCOMPARE1 // conditional store option
104 .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
105 .endif
106 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~\select
107 xchal_sa_align \ptr, 0, 1024-4, 4, 4
108 l32i \at1, \ptr, .Lxchal_ofs_ + 0
109 wur \at1, THREADPTR // threadptr option
110 .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
111 .endif
112 .endm // xchal_ncp_load
113
114
115
116#define XCHAL_NCP_NUM_ATMPS 2
117
118
119#define XCHAL_SA_NUM_ATMPS 2
120
121#endif /*_XTENSA_CORE_TIE_ASM_H*/
122
diff --git a/arch/xtensa/variants/dc232b/include/variant/tie.h b/arch/xtensa/variants/dc232b/include/variant/tie.h
new file mode 100644
index 000000000000..018e81af4393
--- /dev/null
+++ b/arch/xtensa/variants/dc232b/include/variant/tie.h
@@ -0,0 +1,131 @@
1/*
2 * This header file describes this specific Xtensa processor's TIE extensions
3 * that extend basic Xtensa core functionality. It is customized to this
4 * Xtensa processor configuration.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1999-2007 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_CORE_TIE_H
14#define _XTENSA_CORE_TIE_H
15
16#define XCHAL_CP_NUM 1 /* number of coprocessors */
17#define XCHAL_CP_MAX 8 /* max CP ID + 1 (0 if none) */
18#define XCHAL_CP_MASK 0x80 /* bitmask of all CPs by ID */
19#define XCHAL_CP_PORT_MASK 0x80 /* bitmask of only port CPs */
20
21/* Basic parameters of each coprocessor: */
22#define XCHAL_CP7_NAME "XTIOP"
23#define XCHAL_CP7_IDENT XTIOP
24#define XCHAL_CP7_SA_SIZE 0 /* size of state save area */
25#define XCHAL_CP7_SA_ALIGN 1 /* min alignment of save area */
26#define XCHAL_CP_ID_XTIOP 7 /* coprocessor ID (0..7) */
27
28/* Filler info for unassigned coprocessors, to simplify arrays etc: */
29#define XCHAL_CP0_SA_SIZE 0
30#define XCHAL_CP0_SA_ALIGN 1
31#define XCHAL_CP1_SA_SIZE 0
32#define XCHAL_CP1_SA_ALIGN 1
33#define XCHAL_CP2_SA_SIZE 0
34#define XCHAL_CP2_SA_ALIGN 1
35#define XCHAL_CP3_SA_SIZE 0
36#define XCHAL_CP3_SA_ALIGN 1
37#define XCHAL_CP4_SA_SIZE 0
38#define XCHAL_CP4_SA_ALIGN 1
39#define XCHAL_CP5_SA_SIZE 0
40#define XCHAL_CP5_SA_ALIGN 1
41#define XCHAL_CP6_SA_SIZE 0
42#define XCHAL_CP6_SA_ALIGN 1
43
44/* Save area for non-coprocessor optional and custom (TIE) state: */
45#define XCHAL_NCP_SA_SIZE 32
46#define XCHAL_NCP_SA_ALIGN 4
47
48/* Total save area for optional and custom state (NCP + CPn): */
49#define XCHAL_TOTAL_SA_SIZE 32 /* with 16-byte align padding */
50#define XCHAL_TOTAL_SA_ALIGN 4 /* actual minimum alignment */
51
52/*
53 * Detailed contents of save areas.
54 * NOTE: caller must define the XCHAL_SA_REG macro (not defined here)
55 * before expanding the XCHAL_xxx_SA_LIST() macros.
56 *
57 * XCHAL_SA_REG(s,ccused,abikind,kind,opt,name,galign,align,asize,
58 * dbnum,base,regnum,bitsz,gapsz,reset,x...)
59 *
60 * s = passed from XCHAL_*_LIST(s), eg. to select how to expand
61 * ccused = set if used by compiler without special options or code
62 * abikind = 0 (caller-saved), 1 (callee-saved), or 2 (thread-global)
63 * kind = 0 (special reg), 1 (TIE user reg), or 2 (TIE regfile reg)
64 * opt = 0 (custom TIE extension or coprocessor), or 1 (optional reg)
65 * name = lowercase reg name (no quotes)
66 * galign = group byte alignment (power of 2) (galign >= align)
67 * align = register byte alignment (power of 2)
68 * asize = allocated size in bytes (asize*8 == bitsz + gapsz + padsz)
69 * (not including any pad bytes required to galign this or next reg)
70 * dbnum = unique target number f/debug (see <xtensa-libdb-macros.h>)
71 * base = reg shortname w/o index (or sr=special, ur=TIE user reg)
72 * regnum = reg index in regfile, or special/TIE-user reg number
73 * bitsz = number of significant bits (regfile width, or ur/sr mask bits)
74 * gapsz = intervening bits, if bitsz bits not stored contiguously
75 * (padsz = pad bits at end [TIE regfile] or at msbits [ur,sr] of asize)
76 * reset = register reset value (or 0 if undefined at reset)
77 * x = reserved for future use (0 until then)
78 *
79 * To filter out certain registers, e.g. to expand only the non-global
80 * registers used by the compiler, you can do something like this:
81 *
82 * #define XCHAL_SA_REG(s,ccused,p...) SELCC##ccused(p)
83 * #define SELCC0(p...)
84 * #define SELCC1(abikind,p...) SELAK##abikind(p)
85 * #define SELAK0(p...) REG(p)
86 * #define SELAK1(p...) REG(p)
87 * #define SELAK2(p...)
88 * #define REG(kind,tie,name,galn,aln,asz,csz,dbnum,base,rnum,bsz,rst,x...) \
89 * ...what you want to expand...
90 */
91
92#define XCHAL_NCP_SA_NUM 8
93#define XCHAL_NCP_SA_LIST(s) \
94 XCHAL_SA_REG(s,1,0,0,1, acclo, 4, 4, 4,0x0210, sr,16 , 32,0,0,0) \
95 XCHAL_SA_REG(s,1,0,0,1, acchi, 4, 4, 4,0x0211, sr,17 , 8,0,0,0) \
96 XCHAL_SA_REG(s,0,0,0,1, m0, 4, 4, 4,0x0220, sr,32 , 32,0,0,0) \
97 XCHAL_SA_REG(s,0,0,0,1, m1, 4, 4, 4,0x0221, sr,33 , 32,0,0,0) \
98 XCHAL_SA_REG(s,0,0,0,1, m2, 4, 4, 4,0x0222, sr,34 , 32,0,0,0) \
99 XCHAL_SA_REG(s,0,0,0,1, m3, 4, 4, 4,0x0223, sr,35 , 32,0,0,0) \
100 XCHAL_SA_REG(s,0,0,0,1, scompare1, 4, 4, 4,0x020C, sr,12 , 32,0,0,0) \
101 XCHAL_SA_REG(s,1,2,1,1, threadptr, 4, 4, 4,0x03E7, ur,231, 32,0,0,0)
102
103#define XCHAL_CP0_SA_NUM 0
104#define XCHAL_CP0_SA_LIST(s) /* empty */
105
106#define XCHAL_CP1_SA_NUM 0
107#define XCHAL_CP1_SA_LIST(s) /* empty */
108
109#define XCHAL_CP2_SA_NUM 0
110#define XCHAL_CP2_SA_LIST(s) /* empty */
111
112#define XCHAL_CP3_SA_NUM 0
113#define XCHAL_CP3_SA_LIST(s) /* empty */
114
115#define XCHAL_CP4_SA_NUM 0
116#define XCHAL_CP4_SA_LIST(s) /* empty */
117
118#define XCHAL_CP5_SA_NUM 0
119#define XCHAL_CP5_SA_LIST(s) /* empty */
120
121#define XCHAL_CP6_SA_NUM 0
122#define XCHAL_CP6_SA_LIST(s) /* empty */
123
124#define XCHAL_CP7_SA_NUM 0
125#define XCHAL_CP7_SA_LIST(s) /* empty */
126
127/* Byte length of instruction from its first nibble (op0 field), per FLIX. */
128#define XCHAL_OP0_FORMAT_LENGTHS 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3
129
130#endif /*_XTENSA_CORE_TIE_H*/
131
diff --git a/arch/xtensa/variants/fsf/include/variant/core.h b/arch/xtensa/variants/fsf/include/variant/core.h
new file mode 100644
index 000000000000..2f337605c744
--- /dev/null
+++ b/arch/xtensa/variants/fsf/include/variant/core.h
@@ -0,0 +1,359 @@
1/*
2 * Xtensa processor core configuration information.
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1999-2006 Tensilica Inc.
9 */
10
11#ifndef _XTENSA_CORE_H
12#define _XTENSA_CORE_H
13
14
15/****************************************************************************
16 Parameters Useful for Any Code, USER or PRIVILEGED
17 ****************************************************************************/
18
19/*
20 * Note: Macros of the form XCHAL_HAVE_*** have a value of 1 if the option is
21 * configured, and a value of 0 otherwise. These macros are always defined.
22 */
23
24
25/*----------------------------------------------------------------------
26 ISA
27 ----------------------------------------------------------------------*/
28
29#define XCHAL_HAVE_BE 1 /* big-endian byte ordering */
30#define XCHAL_HAVE_WINDOWED 1 /* windowed registers option */
31#define XCHAL_NUM_AREGS 64 /* num of physical addr regs */
32#define XCHAL_NUM_AREGS_LOG2 6 /* log2(XCHAL_NUM_AREGS) */
33#define XCHAL_MAX_INSTRUCTION_SIZE 3 /* max instr bytes (3..8) */
34#define XCHAL_HAVE_DEBUG 1 /* debug option */
35#define XCHAL_HAVE_DENSITY 1 /* 16-bit instructions */
36#define XCHAL_HAVE_LOOPS 1 /* zero-overhead loops */
37#define XCHAL_HAVE_NSA 1 /* NSA/NSAU instructions */
38#define XCHAL_HAVE_MINMAX 0 /* MIN/MAX instructions */
39#define XCHAL_HAVE_SEXT 0 /* SEXT instruction */
40#define XCHAL_HAVE_CLAMPS 0 /* CLAMPS instruction */
41#define XCHAL_HAVE_MUL16 0 /* MUL16S/MUL16U instructions */
42#define XCHAL_HAVE_MUL32 0 /* MULL instruction */
43#define XCHAL_HAVE_MUL32_HIGH 0 /* MULUH/MULSH instructions */
44#define XCHAL_HAVE_L32R 1 /* L32R instruction */
45#define XCHAL_HAVE_ABSOLUTE_LITERALS 1 /* non-PC-rel (extended) L32R */
46#define XCHAL_HAVE_CONST16 0 /* CONST16 instruction */
47#define XCHAL_HAVE_ADDX 1 /* ADDX#/SUBX# instructions */
48#define XCHAL_HAVE_WIDE_BRANCHES 0 /* B*.W18 or B*.W15 instr's */
49#define XCHAL_HAVE_PREDICTED_BRANCHES 0 /* B[EQ/EQZ/NE/NEZ]T instr's */
50#define XCHAL_HAVE_CALL4AND12 1 /* (obsolete option) */
51#define XCHAL_HAVE_ABS 1 /* ABS instruction */
52/*#define XCHAL_HAVE_POPC 0*/ /* POPC instruction */
53/*#define XCHAL_HAVE_CRC 0*/ /* CRC instruction */
54#define XCHAL_HAVE_RELEASE_SYNC 0 /* L32AI/S32RI instructions */
55#define XCHAL_HAVE_S32C1I 0 /* S32C1I instruction */
56#define XCHAL_HAVE_SPECULATION 0 /* speculation */
57#define XCHAL_HAVE_FULL_RESET 1 /* all regs/state reset */
58#define XCHAL_NUM_CONTEXTS 1 /* */
59#define XCHAL_NUM_MISC_REGS 2 /* num of scratch regs (0..4) */
60#define XCHAL_HAVE_TAP_MASTER 0 /* JTAG TAP control instr's */
61#define XCHAL_HAVE_PRID 1 /* processor ID register */
62#define XCHAL_HAVE_THREADPTR 1 /* THREADPTR register */
63#define XCHAL_HAVE_BOOLEANS 0 /* boolean registers */
64#define XCHAL_HAVE_CP 0 /* CPENABLE reg (coprocessor) */
65#define XCHAL_CP_MAXCFG 0 /* max allowed cp id plus one */
66#define XCHAL_HAVE_MAC16 0 /* MAC16 package */
67#define XCHAL_HAVE_VECTORFPU2005 0 /* vector floating-point pkg */
68#define XCHAL_HAVE_FP 0 /* floating point pkg */
69#define XCHAL_HAVE_VECTRA1 0 /* Vectra I pkg */
70#define XCHAL_HAVE_VECTRALX 0 /* Vectra LX pkg */
71#define XCHAL_HAVE_HIFI2 0 /* HiFi2 Audio Engine pkg */
72
73
74/*----------------------------------------------------------------------
75 MISC
76 ----------------------------------------------------------------------*/
77
78#define XCHAL_NUM_WRITEBUFFER_ENTRIES 4 /* size of write buffer */
79#define XCHAL_INST_FETCH_WIDTH 4 /* instr-fetch width in bytes */
80#define XCHAL_DATA_WIDTH 4 /* data width in bytes */
81/* In T1050, applies to selected core load and store instructions (see ISA): */
82#define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* unaligned loads cause exc. */
83#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* unaligned stores cause exc.*/
84
85#define XCHAL_CORE_ID "fsf" /* alphanum core name
86 (CoreID) set in the Xtensa
87 Processor Generator */
88
89#define XCHAL_BUILD_UNIQUE_ID 0x00006700 /* 22-bit sw build ID */
90
91/*
92 * These definitions describe the hardware targeted by this software.
93 */
94#define XCHAL_HW_CONFIGID0 0xC103C3FF /* ConfigID hi 32 bits*/
95#define XCHAL_HW_CONFIGID1 0x0C006700 /* ConfigID lo 32 bits*/
96#define XCHAL_HW_VERSION_NAME "LX2.0.0" /* full version name */
97#define XCHAL_HW_VERSION_MAJOR 2200 /* major ver# of targeted hw */
98#define XCHAL_HW_VERSION_MINOR 0 /* minor ver# of targeted hw */
99#define XTHAL_HW_REL_LX2 1
100#define XTHAL_HW_REL_LX2_0 1
101#define XTHAL_HW_REL_LX2_0_0 1
102#define XCHAL_HW_CONFIGID_RELIABLE 1
103/* If software targets a *range* of hardware versions, these are the bounds: */
104#define XCHAL_HW_MIN_VERSION_MAJOR 2200 /* major v of earliest tgt hw */
105#define XCHAL_HW_MIN_VERSION_MINOR 0 /* minor v of earliest tgt hw */
106#define XCHAL_HW_MAX_VERSION_MAJOR 2200 /* major v of latest tgt hw */
107#define XCHAL_HW_MAX_VERSION_MINOR 0 /* minor v of latest tgt hw */
108
109
110/*----------------------------------------------------------------------
111 CACHE
112 ----------------------------------------------------------------------*/
113
114#define XCHAL_ICACHE_LINESIZE 16 /* I-cache line size in bytes */
115#define XCHAL_DCACHE_LINESIZE 16 /* D-cache line size in bytes */
116#define XCHAL_ICACHE_LINEWIDTH 4 /* log2(I line size in bytes) */
117#define XCHAL_DCACHE_LINEWIDTH 4 /* log2(D line size in bytes) */
118
119#define XCHAL_ICACHE_SIZE 8192 /* I-cache size in bytes or 0 */
120#define XCHAL_DCACHE_SIZE 8192 /* D-cache size in bytes or 0 */
121
122#define XCHAL_DCACHE_IS_WRITEBACK 0 /* writeback feature */
123
124
125
126
127/****************************************************************************
128 Parameters Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code
129 ****************************************************************************/
130
131
132#ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY
133
134/*----------------------------------------------------------------------
135 CACHE
136 ----------------------------------------------------------------------*/
137
138#define XCHAL_HAVE_PIF 1 /* any outbound PIF present */
139
140/* If present, cache size in bytes == (ways * 2^(linewidth + setwidth)). */
141
142/* Number of cache sets in log2(lines per way): */
143#define XCHAL_ICACHE_SETWIDTH 8
144#define XCHAL_DCACHE_SETWIDTH 8
145
146/* Cache set associativity (number of ways): */
147#define XCHAL_ICACHE_WAYS 2
148#define XCHAL_DCACHE_WAYS 2
149
150/* Cache features: */
151#define XCHAL_ICACHE_LINE_LOCKABLE 0
152#define XCHAL_DCACHE_LINE_LOCKABLE 0
153#define XCHAL_ICACHE_ECC_PARITY 0
154#define XCHAL_DCACHE_ECC_PARITY 0
155
156/* Number of encoded cache attr bits (see <xtensa/hal.h> for decoded bits): */
157#define XCHAL_CA_BITS 4
158
159
160/*----------------------------------------------------------------------
161 INTERNAL I/D RAM/ROMs and XLMI
162 ----------------------------------------------------------------------*/
163
164#define XCHAL_NUM_INSTROM 0 /* number of core instr. ROMs */
165#define XCHAL_NUM_INSTRAM 0 /* number of core instr. RAMs */
166#define XCHAL_NUM_DATAROM 0 /* number of core data ROMs */
167#define XCHAL_NUM_DATARAM 0 /* number of core data RAMs */
168#define XCHAL_NUM_URAM 0 /* number of core unified RAMs*/
169#define XCHAL_NUM_XLMI 0 /* number of core XLMI ports */
170
171
172/*----------------------------------------------------------------------
173 INTERRUPTS and TIMERS
174 ----------------------------------------------------------------------*/
175
176#define XCHAL_HAVE_INTERRUPTS 1 /* interrupt option */
177#define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* med/high-pri. interrupts */
178#define XCHAL_HAVE_NMI 0 /* non-maskable interrupt */
179#define XCHAL_HAVE_CCOUNT 1 /* CCOUNT reg. (timer option) */
180#define XCHAL_NUM_TIMERS 3 /* number of CCOMPAREn regs */
181#define XCHAL_NUM_INTERRUPTS 17 /* number of interrupts */
182#define XCHAL_NUM_INTERRUPTS_LOG2 5 /* ceil(log2(NUM_INTERRUPTS)) */
183#define XCHAL_NUM_EXTINTERRUPTS 10 /* num of external interrupts */
184#define XCHAL_NUM_INTLEVELS 4 /* number of interrupt levels
185 (not including level zero) */
186#define XCHAL_EXCM_LEVEL 1 /* level masked by PS.EXCM */
187 /* (always 1 in XEA1; levels 2 .. EXCM_LEVEL are "medium priority") */
188
189/* Masks of interrupts at each interrupt level: */
190#define XCHAL_INTLEVEL1_MASK 0x000064F9
191#define XCHAL_INTLEVEL2_MASK 0x00008902
192#define XCHAL_INTLEVEL3_MASK 0x00011204
193#define XCHAL_INTLEVEL4_MASK 0x00000000
194#define XCHAL_INTLEVEL5_MASK 0x00000000
195#define XCHAL_INTLEVEL6_MASK 0x00000000
196#define XCHAL_INTLEVEL7_MASK 0x00000000
197
198/* Masks of interrupts at each range 1..n of interrupt levels: */
199#define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x000064F9
200#define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x0000EDFB
201#define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x0001FFFF
202#define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x0001FFFF
203#define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x0001FFFF
204#define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x0001FFFF
205#define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x0001FFFF
206
207/* Level of each interrupt: */
208#define XCHAL_INT0_LEVEL 1
209#define XCHAL_INT1_LEVEL 2
210#define XCHAL_INT2_LEVEL 3
211#define XCHAL_INT3_LEVEL 1
212#define XCHAL_INT4_LEVEL 1
213#define XCHAL_INT5_LEVEL 1
214#define XCHAL_INT6_LEVEL 1
215#define XCHAL_INT7_LEVEL 1
216#define XCHAL_INT8_LEVEL 2
217#define XCHAL_INT9_LEVEL 3
218#define XCHAL_INT10_LEVEL 1
219#define XCHAL_INT11_LEVEL 2
220#define XCHAL_INT12_LEVEL 3
221#define XCHAL_INT13_LEVEL 1
222#define XCHAL_INT14_LEVEL 1
223#define XCHAL_INT15_LEVEL 2
224#define XCHAL_INT16_LEVEL 3
225#define XCHAL_DEBUGLEVEL 4 /* debug interrupt level */
226#define XCHAL_HAVE_DEBUG_EXTERN_INT 0 /* OCD external db interrupt */
227
228/* Type of each interrupt: */
229#define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
230#define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
231#define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
232#define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
233#define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
234#define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
235#define XCHAL_INT6_TYPE XTHAL_INTTYPE_EXTERN_LEVEL
236#define XCHAL_INT7_TYPE XTHAL_INTTYPE_EXTERN_EDGE
237#define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_EDGE
238#define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_EDGE
239#define XCHAL_INT10_TYPE XTHAL_INTTYPE_TIMER
240#define XCHAL_INT11_TYPE XTHAL_INTTYPE_TIMER
241#define XCHAL_INT12_TYPE XTHAL_INTTYPE_TIMER
242#define XCHAL_INT13_TYPE XTHAL_INTTYPE_SOFTWARE
243#define XCHAL_INT14_TYPE XTHAL_INTTYPE_SOFTWARE
244#define XCHAL_INT15_TYPE XTHAL_INTTYPE_SOFTWARE
245#define XCHAL_INT16_TYPE XTHAL_INTTYPE_SOFTWARE
246
247/* Masks of interrupts for each type of interrupt: */
248#define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xFFFE0000
249#define XCHAL_INTTYPE_MASK_SOFTWARE 0x0001E000
250#define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x00000380
251#define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x0000007F
252#define XCHAL_INTTYPE_MASK_TIMER 0x00001C00
253#define XCHAL_INTTYPE_MASK_NMI 0x00000000
254#define XCHAL_INTTYPE_MASK_WRITE_ERROR 0x00000000
255
256/* Interrupt numbers assigned to specific interrupt sources: */
257#define XCHAL_TIMER0_INTERRUPT 10 /* CCOMPARE0 */
258#define XCHAL_TIMER1_INTERRUPT 11 /* CCOMPARE1 */
259#define XCHAL_TIMER2_INTERRUPT 12 /* CCOMPARE2 */
260#define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED
261
262/* Interrupt numbers for levels at which only one interrupt is configured: */
263/* (There are many interrupts each at level(s) 1, 2, 3.) */
264
265
266/*
267 * External interrupt vectors/levels.
268 * These macros describe how Xtensa processor interrupt numbers
269 * (as numbered internally, eg. in INTERRUPT and INTENABLE registers)
270 * map to external BInterrupt<n> pins, for those interrupts
271 * configured as external (level-triggered, edge-triggered, or NMI).
272 * See the Xtensa processor databook for more details.
273 */
274
275/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */
276#define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */
277#define XCHAL_EXTINT1_NUM 1 /* (intlevel 2) */
278#define XCHAL_EXTINT2_NUM 2 /* (intlevel 3) */
279#define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */
280#define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */
281#define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */
282#define XCHAL_EXTINT6_NUM 6 /* (intlevel 1) */
283#define XCHAL_EXTINT7_NUM 7 /* (intlevel 1) */
284#define XCHAL_EXTINT8_NUM 8 /* (intlevel 2) */
285#define XCHAL_EXTINT9_NUM 9 /* (intlevel 3) */
286
287
288/*----------------------------------------------------------------------
289 EXCEPTIONS and VECTORS
290 ----------------------------------------------------------------------*/
291
292#define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture
293 number: 1 == XEA1 (old)
294 2 == XEA2 (new)
295 0 == XEAX (extern) */
296#define XCHAL_HAVE_XEA1 0 /* Exception Architecture 1 */
297#define XCHAL_HAVE_XEA2 1 /* Exception Architecture 2 */
298#define XCHAL_HAVE_XEAX 0 /* External Exception Arch. */
299#define XCHAL_HAVE_EXCEPTIONS 1 /* exception option */
300#define XCHAL_HAVE_MEM_ECC_PARITY 0 /* local memory ECC/parity */
301
302#define XCHAL_RESET_VECTOR_VADDR 0xFE000020
303#define XCHAL_RESET_VECTOR_PADDR 0xFE000020
304#define XCHAL_USER_VECTOR_VADDR 0xD0000220
305#define XCHAL_USER_VECTOR_PADDR 0x00000220
306#define XCHAL_KERNEL_VECTOR_VADDR 0xD0000200
307#define XCHAL_KERNEL_VECTOR_PADDR 0x00000200
308#define XCHAL_DOUBLEEXC_VECTOR_VADDR 0xD0000290
309#define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x00000290
310#define XCHAL_WINDOW_VECTORS_VADDR 0xD0000000
311#define XCHAL_WINDOW_VECTORS_PADDR 0x00000000
312#define XCHAL_INTLEVEL2_VECTOR_VADDR 0xD0000240
313#define XCHAL_INTLEVEL2_VECTOR_PADDR 0x00000240
314#define XCHAL_INTLEVEL3_VECTOR_VADDR 0xD0000250
315#define XCHAL_INTLEVEL3_VECTOR_PADDR 0x00000250
316#define XCHAL_INTLEVEL4_VECTOR_VADDR 0xFE000520
317#define XCHAL_INTLEVEL4_VECTOR_PADDR 0xFE000520
318#define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL4_VECTOR_VADDR
319#define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL4_VECTOR_PADDR
320
321
322/*----------------------------------------------------------------------
323 DEBUG
324 ----------------------------------------------------------------------*/
325
326#define XCHAL_HAVE_OCD 1 /* OnChipDebug option */
327#define XCHAL_NUM_IBREAK 2 /* number of IBREAKn regs */
328#define XCHAL_NUM_DBREAK 2 /* number of DBREAKn regs */
329#define XCHAL_HAVE_OCD_DIR_ARRAY 1 /* faster OCD option */
330
331
332/*----------------------------------------------------------------------
333 MMU
334 ----------------------------------------------------------------------*/
335
336/* See <xtensa/config/core-matmap.h> header file for more details. */
337
338#define XCHAL_HAVE_TLBS 1 /* inverse of HAVE_CACHEATTR */
339#define XCHAL_HAVE_SPANNING_WAY 0 /* one way maps I+D 4GB vaddr */
340#define XCHAL_HAVE_IDENTITY_MAP 0 /* vaddr == paddr always */
341#define XCHAL_HAVE_CACHEATTR 0 /* CACHEATTR register present */
342#define XCHAL_HAVE_MIMIC_CACHEATTR 0 /* region protection */
343#define XCHAL_HAVE_XLT_CACHEATTR 0 /* region prot. w/translation */
344#define XCHAL_HAVE_PTP_MMU 1 /* full MMU (with page table
345 [autorefill] and protection)
346 usable for an MMU-based OS */
347/* If none of the above last 4 are set, it's a custom TLB configuration. */
348#define XCHAL_ITLB_ARF_ENTRIES_LOG2 2 /* log2(autorefill way size) */
349#define XCHAL_DTLB_ARF_ENTRIES_LOG2 2 /* log2(autorefill way size) */
350
351#define XCHAL_MMU_ASID_BITS 8 /* number of bits in ASIDs */
352#define XCHAL_MMU_RINGS 4 /* number of rings (1..4) */
353#define XCHAL_MMU_RING_BITS 2 /* num of bits in RING field */
354
355#endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */
356
357
358#endif /* _XTENSA_CORE_CONFIGURATION_H */
359
diff --git a/arch/xtensa/variants/fsf/include/variant/tie-asm.h b/arch/xtensa/variants/fsf/include/variant/tie-asm.h
new file mode 100644
index 000000000000..68a73bf4ffc5
--- /dev/null
+++ b/arch/xtensa/variants/fsf/include/variant/tie-asm.h
@@ -0,0 +1,70 @@
1/*
2 * This header file contains assembly-language definitions (assembly
3 * macros, etc.) for this specific Xtensa processor's TIE extensions
4 * and options. It is customized to this Xtensa processor configuration.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1999-2008 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_CORE_TIE_ASM_H
14#define _XTENSA_CORE_TIE_ASM_H
15
16/* Selection parameter values for save-area save/restore macros: */
17/* Option vs. TIE: */
18#define XTHAL_SAS_TIE 0x0001 /* custom extension or coprocessor */
19#define XTHAL_SAS_OPT 0x0002 /* optional (and not a coprocessor) */
20/* Whether used automatically by compiler: */
21#define XTHAL_SAS_NOCC 0x0004 /* not used by compiler w/o special opts/code */
22#define XTHAL_SAS_CC 0x0008 /* used by compiler without special opts/code */
23/* ABI handling across function calls: */
24#define XTHAL_SAS_CALR 0x0010 /* caller-saved */
25#define XTHAL_SAS_CALE 0x0020 /* callee-saved */
26#define XTHAL_SAS_GLOB 0x0040 /* global across function calls (in thread) */
27/* Misc */
28#define XTHAL_SAS_ALL 0xFFFF /* include all default NCP contents */
29
30
31
32/* Macro to save all non-coprocessor (extra) custom TIE and optional state
33 * (not including zero-overhead loop registers).
34 * Save area ptr (clobbered): ptr (1 byte aligned)
35 * Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed)
36 */
37 .macro xchal_ncp_store ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL
38 xchal_sa_start \continue, \ofs
39 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~\select
40 xchal_sa_align \ptr, 0, 1024-4, 4, 4
41 rur \at1, THREADPTR // threadptr option
42 s32i \at1, \ptr, .Lxchal_ofs_ + 0
43 .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
44 .endif
45 .endm // xchal_ncp_store
46
47/* Macro to save all non-coprocessor (extra) custom TIE and optional state
48 * (not including zero-overhead loop registers).
49 * Save area ptr (clobbered): ptr (1 byte aligned)
50 * Scratch regs (clobbered): at1..at4 (only first XCHAL_NCP_NUM_ATMPS needed)
51 */
52 .macro xchal_ncp_load ptr at1 at2 at3 at4 continue=0 ofs=-1 select=XTHAL_SAS_ALL
53 xchal_sa_start \continue, \ofs
54 .ifeq (XTHAL_SAS_OPT | XTHAL_SAS_CC | XTHAL_SAS_GLOB) & ~\select
55 xchal_sa_align \ptr, 0, 1024-4, 4, 4
56 l32i \at1, \ptr, .Lxchal_ofs_ + 0
57 wur \at1, THREADPTR // threadptr option
58 .set .Lxchal_ofs_, .Lxchal_ofs_ + 4
59 .endif
60 .endm // xchal_ncp_load
61
62
63
64#define XCHAL_NCP_NUM_ATMPS 1
65
66
67#define XCHAL_SA_NUM_ATMPS 1
68
69#endif /*_XTENSA_CORE_TIE_ASM_H*/
70
diff --git a/arch/xtensa/variants/fsf/include/variant/tie.h b/arch/xtensa/variants/fsf/include/variant/tie.h
new file mode 100644
index 000000000000..bf4020116df5
--- /dev/null
+++ b/arch/xtensa/variants/fsf/include/variant/tie.h
@@ -0,0 +1,77 @@
1/*
2 * This header file describes this specific Xtensa processor's TIE extensions
3 * that extend basic Xtensa core functionality. It is customized to this
4 * Xtensa processor configuration.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 *
10 * Copyright (C) 1999-2007 Tensilica Inc.
11 */
12
13#ifndef _XTENSA_CORE_TIE_H
14#define _XTENSA_CORE_TIE_H
15
16#define XCHAL_CP_NUM 0 /* number of coprocessors */
17#define XCHAL_CP_MAX 0 /* max CP ID + 1 (0 if none) */
18#define XCHAL_CP_MASK 0x00 /* bitmask of all CPs by ID */
19#define XCHAL_CP_PORT_MASK 0x00 /* bitmask of only port CPs */
20
21/* Basic parameters of each coprocessor: */
22#define XCHAL_CP7_NAME "XTIOP"
23#define XCHAL_CP7_IDENT XTIOP
24#define XCHAL_CP7_SA_SIZE 0 /* size of state save area */
25#define XCHAL_CP7_SA_ALIGN 1 /* min alignment of save area */
26#define XCHAL_CP_ID_XTIOP 7 /* coprocessor ID (0..7) */
27
28/* Filler info for unassigned coprocessors, to simplify arrays etc: */
29#define XCHAL_NCP_SA_SIZE 0
30#define XCHAL_NCP_SA_ALIGN 1
31#define XCHAL_CP0_SA_SIZE 0
32#define XCHAL_CP0_SA_ALIGN 1
33#define XCHAL_CP1_SA_SIZE 0
34#define XCHAL_CP1_SA_ALIGN 1
35#define XCHAL_CP2_SA_SIZE 0
36#define XCHAL_CP2_SA_ALIGN 1
37#define XCHAL_CP3_SA_SIZE 0
38#define XCHAL_CP3_SA_ALIGN 1
39#define XCHAL_CP4_SA_SIZE 0
40#define XCHAL_CP4_SA_ALIGN 1
41#define XCHAL_CP5_SA_SIZE 0
42#define XCHAL_CP5_SA_ALIGN 1
43#define XCHAL_CP6_SA_SIZE 0
44#define XCHAL_CP6_SA_ALIGN 1
45
46/* Save area for non-coprocessor optional and custom (TIE) state: */
47#define XCHAL_NCP_SA_SIZE 0
48#define XCHAL_NCP_SA_ALIGN 1
49
50/* Total save area for optional and custom state (NCP + CPn): */
51#define XCHAL_TOTAL_SA_SIZE 0 /* with 16-byte align padding */
52#define XCHAL_TOTAL_SA_ALIGN 1 /* actual minimum alignment */
53
54#define XCHAL_NCP_SA_NUM 0
55#define XCHAL_NCP_SA_LIST(s)
56#define XCHAL_CP0_SA_NUM 0
57#define XCHAL_CP0_SA_LIST(s)
58#define XCHAL_CP1_SA_NUM 0
59#define XCHAL_CP1_SA_LIST(s)
60#define XCHAL_CP2_SA_NUM 0
61#define XCHAL_CP2_SA_LIST(s)
62#define XCHAL_CP3_SA_NUM 0
63#define XCHAL_CP3_SA_LIST(s)
64#define XCHAL_CP4_SA_NUM 0
65#define XCHAL_CP4_SA_LIST(s)
66#define XCHAL_CP5_SA_NUM 0
67#define XCHAL_CP5_SA_LIST(s)
68#define XCHAL_CP6_SA_NUM 0
69#define XCHAL_CP6_SA_LIST(s)
70#define XCHAL_CP7_SA_NUM 0
71#define XCHAL_CP7_SA_LIST(s)
72
73/* Byte length of instruction from its first nibble (op0 field), per FLIX. */
74#define XCHAL_OP0_FORMAT_LENGTHS 3,3,3,3,3,3,3,3,2,2,2,2,2,2,3,3
75
76#endif /*_XTENSA_CORE_TIE_H*/
77