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/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/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/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/at91rm9200_time.c3
-rw-r--r--arch/arm/mach-at91/at91sam926x_time.c2
-rw-r--r--arch/arm/mach-davinci/time.c2
-rw-r--r--arch/arm/mach-ep93xx/core.c6
-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-lh7a40x/clcd.c2
-rw-r--r--arch/arm/mach-msm/timer.c2
-rw-r--r--arch/arm/mach-netx/fb.c2
-rw-r--r--arch/arm/mach-ns9xxx/time-ns9360.c2
-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/timer-gp.c2
-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/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-s3c2410/include/mach/spi.h2
-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/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/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/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.c6
-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_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.c17
-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.c75
-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/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/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/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/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.c3
-rw-r--r--arch/ia64/kernel/iosapic.c35
-rw-r--r--arch/ia64/kernel/irq.c13
-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/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/kernel/traps.c2
-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/swab.h24
-rw-r--r--arch/m68knommu/platform/coldfire/pit.c2
-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/irq.h3
-rw-r--r--arch/mips/include/asm/mach-ip27/topology.h5
-rw-r--r--arch/mips/include/asm/smp.h3
-rw-r--r--arch/mips/include/asm/swab.h55
-rw-r--r--arch/mips/jazz/irq.c2
-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.c2
-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/i8253.c2
-rw-r--r--arch/mips/kernel/irq-gic.c6
-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/vpe.c2
-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/include/asm/atomic.h11
-rw-r--r--arch/parisc/include/asm/module.h6
-rw-r--r--arch/parisc/include/asm/smp.h2
-rw-r--r--arch/parisc/kernel/irq.c6
-rw-r--r--arch/parisc/kernel/module.c216
-rw-r--r--arch/parisc/kernel/smp.c15
-rw-r--r--arch/powerpc/boot/Makefile2
-rw-r--r--arch/powerpc/boot/dts/sequoia.dts2
-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/disassemble.h80
-rw-r--r--arch/powerpc/include/asm/hugetlb.h6
-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/swab.h90
-rw-r--r--arch/powerpc/include/asm/topology.h13
-rw-r--r--arch/powerpc/kernel/asm-offsets.c21
-rw-r--r--arch/powerpc/kernel/irq.c2
-rw-r--r--arch/powerpc/kernel/kprobes.c9
-rw-r--r--arch/powerpc/kernel/process.c1
-rw-r--r--arch/powerpc/kernel/prom_parse.c7
-rw-r--r--arch/powerpc/kernel/smp.c4
-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/oprofile/cell/spu_profiler.c2
-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/pseries/xics.c4
-rw-r--r--arch/powerpc/sysdev/mpic.c4
-rw-r--r--arch/powerpc/sysdev/mpic.h2
-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/cpu.h7
-rw-r--r--arch/s390/include/asm/cputime.h42
-rw-r--r--arch/s390/include/asm/lowcore.h49
-rw-r--r--arch/s390/include/asm/s390_rdev.h15
-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/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/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.c40
-rw-r--r--arch/s390/kernel/time.c2
-rw-r--r--arch/s390/kernel/topology.c5
-rw-r--r--arch/s390/kernel/vdso.c123
-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/kvm-s390.c41
-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/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/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/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.h212
-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.h13
-rw-r--r--arch/sparc/include/asm/traps.h11
-rw-r--r--arch/sparc/include/asm/types.h2
-rw-r--r--arch/sparc/kernel/ds.c34
-rw-r--r--arch/sparc/kernel/iommu.c2
-rw-r--r--arch/sparc/kernel/irq_32.c2
-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.c2
-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/power.c2
-rw-r--r--arch/sparc/kernel/process_32.c16
-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.c14
-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.c4
-rw-r--r--arch/sparc/kernel/time_64.c14
-rw-r--r--arch/sparc/kernel/traps_32.c4
-rw-r--r--arch/sparc/kernel/traps_64.c20
-rw-r--r--arch/sparc/kernel/unaligned_32.c12
-rw-r--r--arch/sparc/kernel/unaligned_64.c8
-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/mm/fault_32.c3
-rw-r--r--arch/sparc/mm/init_64.c48
-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/Kconfig26
-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/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.h60
-rw-r--r--arch/x86/include/asm/es7000/ipi.h12
-rw-r--r--arch/x86/include/asm/genapic_32.h13
-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-generic/mach_apic.h1
-rw-r--r--arch/x86/include/asm/mpspec.h2
-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/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/smp.h6
-rw-r--r--arch/x86/include/asm/summit/apic.h39
-rw-r--r--arch/x86/include/asm/summit/ipi.h9
-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.c31
-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.c42
-rw-r--r--arch/x86/kernel/bios_uv.c2
-rw-r--r--arch/x86/kernel/cpu/common.c2
-rw-r--r--arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c28
-rw-r--r--arch/x86/kernel/cpu/cpufreq/p4-clockmod.c6
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k7.c9
-rw-r--r--arch/x86/kernel/cpu/cpufreq/powernow-k8.c24
-rw-r--r--arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c51
-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_amd_64.c108
-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/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/hpet.c8
-rw-r--r--arch/x86/kernel/i8253.c2
-rw-r--r--arch/x86/kernel/io_apic.c372
-rw-r--r--arch/x86/kernel/ipi.c28
-rw-r--r--arch/x86/kernel/irq.c3
-rw-r--r--arch/x86/kernel/irq_32.c13
-rw-r--r--arch/x86/kernel/irq_64.c15
-rw-r--r--arch/x86/kernel/irqinit_32.c16
-rw-r--r--arch/x86/kernel/irqinit_64.c13
-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.c10
-rw-r--r--arch/x86/kernel/msr.c2
-rw-r--r--arch/x86/kernel/nmi.c3
-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/reboot.c73
-rw-r--r--arch/x86/kernel/setup_percpu.c36
-rw-r--r--arch/x86/kernel/smp.c8
-rw-r--r--arch/x86/kernel/smpboot.c48
-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.c47
-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.c5
-rw-r--r--arch/x86/mach-generic/numaq.c5
-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.c24
-rw-r--r--arch/x86/mm/init_32.c12
-rw-r--r--arch/x86/mm/init_64.c4
-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/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
926 files changed, 52556 insertions, 17948 deletions
diff --git a/arch/alpha/include/asm/Kbuild b/arch/alpha/include/asm/Kbuild
index b7c8f188b31..4dad2736057 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 ca88e54dec9..62b363584b2 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 58e958fc7f1..6772f316870 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 544c69af816..547e90951ce 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 00000000000..68e7089e02d
--- /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 149532e162c..b4f284c72ff 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 ac706c1d7ad..b4697759a12 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 00000000000..4a0af906b00
--- /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 c626a821cdc..703731accda 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 ff8cb638472..a3b93881140 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 f8b74995a00..00edd04b585 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 351407e07e7..f238370c907 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 a449e999027..02bee6983ce 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 cf7da10097b..d953e510f68 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 c71b0fd7a61..9c9d1fd4155 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 7ef3b6fb370..baf60f36cbd 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 910b43cd63e..61ccd95579e 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 eb2a1d63f48..538876b6244 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 5b99cf3cd69..f15a329b601 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 a4555f49763..d232e42be01 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 52c91ccc164..27f840a4ad3 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 d6ebe39934b..dbfdf87f993 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 7fc9860a97d..c6884ba1d5e 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/include/asm/Kbuild b/arch/arm/include/asm/Kbuild
index 73237bd130a..43b0b2ba392 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 325f881ccb5..ee99723b3a6 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 4fbfb22f65a..c02b6fc28e1 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 32da1ae17e0..a38bdc7afa3 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/swab.h b/arch/arm/include/asm/swab.h
new file mode 100644
index 00000000000..27a689be085
--- /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 17a59b6e521..809681900ec 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 60c079d8535..eed2f795e1b 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 2f3eb795fa6..7141cee1fab 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/kprobes.c b/arch/arm/kernel/kprobes.c
index 3f9abe0e9af..f692efddd44 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 019237d2162..55fa7ff96a3 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 50e13965dfe..b5c5fc6ba3a 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/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index d140eae53de..1ff1bda0a89 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/at91sam926x_time.c b/arch/arm/mach-at91/at91sam926x_time.c
index 122fd77ed58..b63e1d5f1ba 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-davinci/time.c b/arch/arm/mach-davinci/time.c
index 3b9a296b5c4..f8bcd29d17a 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 4781f323703..6d9152de607 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-imx/time.c b/arch/arm/mach-imx/time.c
index a11765f5f23..aff0ebcfa84 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 c89c949b4d4..6f887291307 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 427c2d8dc12..4ac04055c2e 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 af7d3ff013e..2fdb95433f0 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 7766f469456..f4656d2ac8a 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-lh7a40x/clcd.c b/arch/arm/mach-lh7a40x/clcd.c
index a2a543258fc..c472b9e8b37 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/timer.c b/arch/arm/mach-msm/timer.c
index 345a14cb73c..444d9c0f5ca 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-netx/fb.c b/arch/arm/mach-netx/fb.c
index 8f1f992f002..ea8fa8898fe 100644
--- a/arch/arm/mach-netx/fb.c
+++ b/arch/arm/mach-netx/fb.c
@@ -91,7 +91,7 @@ void clk_put(struct clk *clk)
91 91
92static struct amba_device fb_device = { 92static struct amba_device fb_device = {
93 .dev = { 93 .dev = {
94 .bus_id = "fb", 94 .init_name = "fb",
95 .coherent_dma_mask = ~0, 95 .coherent_dma_mask = ~0,
96 }, 96 },
97 .res = { 97 .res = {
diff --git a/arch/arm/mach-ns9xxx/time-ns9360.c b/arch/arm/mach-ns9xxx/time-ns9360.c
index a63424d083d..41df6972176 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/time.c b/arch/arm/mach-omap1/time.c
index 2cf7e32bd29..495a32c287b 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 705367ece17..fd3f7396e16 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 ff6cd14d254..ad6d98d177c 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/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c
index 589393bedad..ae6036300f6 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-pxa/include/mach/pxa930_rotary.h b/arch/arm/mach-pxa/include/mach/pxa930_rotary.h
new file mode 100644
index 00000000000..053587caffd
--- /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 00000000000..5e0789bc472
--- /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/time.c b/arch/arm/mach-pxa/time.c
index 00162415851..95656a72268 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 5f1d55963ce..bd2aa4f1614 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 63be2abdc19..44269b162d4 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 9019ef2e561..67d6d9cc68b 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-s3c2410/include/mach/spi.h b/arch/arm/mach-s3c2410/include/mach/spi.h
index 774f3adfe8a..1d300fb112b 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-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 8c5e727f3b7..711c0295c66 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 df25aa13850..1c43494f5c4 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 afcaa858eb1..9d39886a835 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/oprofile/op_model_mpcore.c b/arch/arm/oprofile/op_model_mpcore.c
index 4de366e8b4c..6d6bd589924 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 00000000000..2dacb3086f1
--- /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 fd28f5194f7..758a1293bcf 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/include/mach/memory.h b/arch/arm/plat-omap/include/mach/memory.h
index 211c9f6619e..d6b5ca6c7da 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 67ca1e216df..add0485703b 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 544d6b327f3..6fa2923e6dc 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/avr32/Kconfig b/arch/avr32/Kconfig
index 26eca87f673..b189680d18b 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 b088e103e75..f3ef3bbf797 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 32fb9ba0fbd..05d3722fff1 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 5c5cdf3b464..1f33a106905 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 134b566630b..b3a23c88bcf 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 cb32eb844aa..29b35aca96c 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 1ee4faf0742..745c408c2ac 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 00000000000..fda2331f978
--- /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 00000000000..c740aa11675
--- /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 00000000000..a98c6dd3a02
--- /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 00000000000..ea70c626587
--- /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 00000000000..4d2fe82b202
--- /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 397cbb8f44c..2b58d61f0af 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 541520912c5..164e2814ae7 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 69fce6b6a78..c9dc64832a1 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 5477ed3183b..29ea1327b49 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 6c45a3b77aa..361c31c2af1 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 00000000000..0d3d2982c8f
--- /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 3136628ba8d..219822c8ad1 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 59f3fadd0b6..00000000000
--- 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 7ef3862a73d..31881510774 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 1a50b69b1a1..f7dd5f71edf 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 8e3af02076d..2aba64b4e12 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 ca4f9542365..f930ce28680 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 00000000000..a14aa5b46d9
--- /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 00000000000..483d666c27c
--- /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 134d5302b6d..43ae555ecb3 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 c5b11f9067f..803d7be0938 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 8e8911e55c8..5d2daeaf356 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 283481d74a5..0ff46bf873b 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 0d987373bc0..d547c8df157 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 066252eebf6..ea7bc1e8562 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
diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c
index 138a00a2a2d..442f08c5e64 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 623bf0e9a1e..4c7ebbdc6df 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 a77d372f6f3..5c4c971eed8 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 21c79373b53..4873024e3b9 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 ed81a8bcb22..09a274c9d0b 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 15a4e5e142c..24a74d1ca7d 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 fa92ff6d95f..e819fa69a90 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 29e71ed6b8a..a949c4fbbdd 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 3ad25983ec9..5f981d9ca62 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 6bf50977850..e550c8d4606 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 00000000000..e0b3f242b55
--- /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 4443a47e516..69f66c35b2a 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 4a2a660a6b3..f92668af00b 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 deeb5e45eff..92afd988449 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 c23267ed880..49eabb41e9e 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 63a0f854745..332142f7f9b 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 00000000000..ed15934c67c
--- /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 bf63660815b..d4ed9ce1f62 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 3c70d6230a1..1ecb7a38c90 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 2921f9952d5..9683b2e1309 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 b6a14635fb9..a041e7eba77 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 c3ba9066b93..085211b9e4e 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 cdc6b7feb59..750203e27a4 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 f074bdcd1ce..dec8a7d5cc0 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 5c44fdb8e6e..efd68bc78f3 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 086fe5dda49..346bc7af8f4 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 1fc31f1b762..5d3901d23fd 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 285d2241df2..e66f5daaa82 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 bffca7de65d..ce5dde9de9d 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 b1309f878fc..7c8250d6fa6 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 c482ee171f9..9af522c7dad 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 606ecfdcc96..d0d1ac43554 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 7cf50871860..94b2a9b1945 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 77295666c34..daffc0684e7 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 9fa19158e38..1306e6b2294 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 00000000000..d61d5497c59
--- /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 c76ed8def30..fe88a2c1921 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 cfe8024c3b2..9e4be5e5e76 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 b39a175c79c..21b036eadab 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 8749b0e321a..8bb2cb13975 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 6a673d42da1..b9e797a497b 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 023d72133b5..86637814cf2 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 4403415583f..1b040f5b4fe 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 6f6af2b8e9e..f67289a0d8d 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 c0e630edfb9..16561ab18b3 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 75c67b99d60..00000000000
--- 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 9e8b4035fce..ad566ff9ad1 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 f845b41147b..05b14a631d0 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 00000000000..c2594ef877f
--- /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 6509733bb0f..e4f7b8043f0 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 c4f721e0d00..b30a2968e27 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 ad33ac271fd..9477d82fcad 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 b6b19f1b9da..717181a1749 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 7dc77a21fdf..63b2d8c7857 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 00000000000..76f53d8b9a0
--- /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 00000000000..cb1025aeabc
--- /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 89f59e18af9..3d977909ce7 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 c13ded77782..79dbefaa5be 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 cbe03f4a569..255a9316ad3 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 88d04a70770..e92b31051bb 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_context.h b/arch/blackfin/include/asm/mmu_context.h
index 35593dda2a4..944e29faae4 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 00000000000..0134151656a
--- /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 458c1f7fbc1..5d399256bf0 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 00000000000..bd8d4a7efeb
--- /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 78dd61f6b39..797c0c16506 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 f11684e4ade..783c8f7f8f8 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 e3e9b41fa8d..0eece23b41c 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 6d448b5f598..4856d62b746 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 00000000000..4a724b37897
--- /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 994dd869558..3a47606c858 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 00000000000..118deeeae7c
--- /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 64e908a5064..0249ac31947 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 00000000000..b1e3c4c7b38
--- /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 00000000000..69a051b612b
--- /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 8f1627d8bf0..a4c8254bec5 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 642769329d1..e721ce55956 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 d928b809905..3248033531e 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 00000000000..c82eb12a5b1
--- /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 606adc78aa8..38a233374f0 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 9bb85dd5ccb..b5df9459d6d 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 339293d677c..07e02c0d1c0 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 5c0800adb4d..4c14331978f 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 4367330909b..01f917d58b5 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 286b69357f9..7d70d3bf321 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 a8b712a24c5..c6ff947f9d3 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 822beefa3a4..00000000000
--- 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 55af729f849..bdb958486e7 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 baa52e261f0..87463ce87f5 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 d36ea9b5382..7d70d3bf321 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 bd0831592c2..c6ff947f9d3 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 ecbabc0a1fe..00000000000
--- 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 1e74f0b9799..00000000000
--- 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 2debc900e24..0e28f759573 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 f5cf3accef3..00000000000
--- 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 00000000000..376249ab269
--- /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 00000000000..64d78300dd0
--- /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 1f4e3d2e090..c8ad051742e 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 faea88ebb2e..a9cfba9946b 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 4b03ba02548..0d2d9e0968c 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 00000000000..339be5a3ae6
--- /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 07402f57c9d..ab8209cbbad 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 b795a207742..b163f6d3330 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 00000000000..3dba9c17304
--- /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 00000000000..edcfb3865f4
--- /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 e1bebc80a5b..1bd7f2d018a 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 0c3ea118b65..33e2e8993f7 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 140bf00e997..d2d38853663 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
@@ -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 ae97ca407b0..eeee8cb4336 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 71a9a8c53ce..b2a811347b6 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 e887efc86c2..0ed2badfd74 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 eb235232045..172b4c58846 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 bef025b0744..17d8e417289 100644
--- a/arch/blackfin/kernel/traps.c
+++ b/arch/blackfin/kernel/traps.c
@@ -75,16 +75,6 @@ void __init trap_init(void)
75 CSYNC(); 75 CSYNC();
76} 76}
77 77
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) 78static void decode_address(char *buf, unsigned long address)
89{ 79{
90#ifdef CONFIG_DEBUG_VERBOSE 80#ifdef CONFIG_DEBUG_VERBOSE
@@ -211,18 +201,18 @@ asmlinkage void double_fault_c(struct pt_regs *fp)
211 printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n"); 201 printk(KERN_EMERG "\n" KERN_EMERG "Double Fault\n");
212#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT 202#ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT
213 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) { 203 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) {
204 unsigned int cpu = smp_processor_id();
214 char buf[150]; 205 char buf[150];
215 decode_address(buf, saved_retx); 206 decode_address(buf, cpu_pda[cpu].retx);
216 printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n", 207 printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n",
217 (int)saved_seqstat & SEQSTAT_EXCAUSE, buf); 208 (unsigned int)cpu_pda[cpu].seqstat & SEQSTAT_EXCAUSE, buf);
218 decode_address(buf, saved_dcplb_fault_addr); 209 decode_address(buf, cpu_pda[cpu].dcplb_fault_addr);
219 printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n", buf); 210 printk(KERN_NOTICE " DCPLB_FAULT_ADDR: %s\n", buf);
220 decode_address(buf, saved_icplb_fault_addr); 211 decode_address(buf, cpu_pda[cpu].icplb_fault_addr);
221 printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n", buf); 212 printk(KERN_NOTICE " ICPLB_FAULT_ADDR: %s\n", buf);
222 213
223 decode_address(buf, fp->retx); 214 decode_address(buf, fp->retx);
224 printk(KERN_NOTICE "The instruction at %s caused a double exception\n", 215 printk(KERN_NOTICE "The instruction at %s caused a double exception\n", buf);
225 buf);
226 } else 216 } else
227#endif 217#endif
228 { 218 {
@@ -240,6 +230,9 @@ asmlinkage void trap_c(struct pt_regs *fp)
240#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON 230#ifdef CONFIG_DEBUG_BFIN_HWTRACE_ON
241 int j; 231 int j;
242#endif 232#endif
233#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
234 unsigned int cpu = smp_processor_id();
235#endif
243 int sig = 0; 236 int sig = 0;
244 siginfo_t info; 237 siginfo_t info;
245 unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE; 238 unsigned long trapnr = fp->seqstat & SEQSTAT_EXCAUSE;
@@ -417,7 +410,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
417 info.si_code = ILL_CPLB_MULHIT; 410 info.si_code = ILL_CPLB_MULHIT;
418 sig = SIGSEGV; 411 sig = SIGSEGV;
419#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO 412#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
420 if (saved_dcplb_fault_addr < FIXED_CODE_START) 413 if (cpu_pda[cpu].dcplb_fault_addr < FIXED_CODE_START)
421 verbose_printk(KERN_NOTICE "NULL pointer access\n"); 414 verbose_printk(KERN_NOTICE "NULL pointer access\n");
422 else 415 else
423#endif 416#endif
@@ -471,7 +464,7 @@ asmlinkage void trap_c(struct pt_regs *fp)
471 info.si_code = ILL_CPLB_MULHIT; 464 info.si_code = ILL_CPLB_MULHIT;
472 sig = SIGSEGV; 465 sig = SIGSEGV;
473#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO 466#ifdef CONFIG_DEBUG_HUNT_FOR_ZERO
474 if (saved_icplb_fault_addr < FIXED_CODE_START) 467 if (cpu_pda[cpu].icplb_fault_addr < FIXED_CODE_START)
475 verbose_printk(KERN_NOTICE "Jump to NULL address\n"); 468 verbose_printk(KERN_NOTICE "Jump to NULL address\n");
476 else 469 else
477#endif 470#endif
@@ -584,10 +577,15 @@ asmlinkage void trap_c(struct pt_regs *fp)
584 } 577 }
585 } 578 }
586 579
587 info.si_signo = sig; 580#ifdef CONFIG_IPIPE
588 info.si_errno = 0; 581 if (!ipipe_trap_notify(fp->seqstat & 0x3f, fp))
589 info.si_addr = (void __user *)fp->pc; 582#endif
590 force_sig_info(sig, &info, current); 583 {
584 info.si_signo = sig;
585 info.si_errno = 0;
586 info.si_addr = (void __user *)fp->pc;
587 force_sig_info(sig, &info, current);
588 }
591 589
592 trace_buffer_restore(j); 590 trace_buffer_restore(j);
593 return; 591 return;
@@ -656,13 +654,13 @@ static bool get_instruction(unsigned short *val, unsigned short *address)
656 return false; 654 return false;
657} 655}
658 656
659/* 657/*
660 * decode the instruction if we are printing out the trace, as it 658 * decode the instruction if we are printing out the trace, as it
661 * makes things easier to follow, without running it through objdump 659 * makes things easier to follow, without running it through objdump
662 * These are the normal instructions which cause change of flow, which 660 * These are the normal instructions which cause change of flow, which
663 * would be at the source of the trace buffer 661 * would be at the source of the trace buffer
664 */ 662 */
665#ifdef CONFIG_DEBUG_VERBOSE 663#if defined(CONFIG_DEBUG_VERBOSE) && defined(CONFIG_DEBUG_BFIN_HWTRACE_ON)
666static void decode_instruction(unsigned short *address) 664static void decode_instruction(unsigned short *address)
667{ 665{
668 unsigned short opcode; 666 unsigned short opcode;
@@ -846,7 +844,7 @@ void show_stack(struct task_struct *task, unsigned long *stack)
846 } 844 }
847 if (fp) { 845 if (fp) {
848 frame = fp; 846 frame = fp;
849 printk(" FP: (0x%p)\n", fp); 847 printk(KERN_NOTICE " FP: (0x%p)\n", fp);
850 } else 848 } else
851 frame = 0; 849 frame = 0;
852 850
@@ -960,6 +958,7 @@ void dump_bfin_process(struct pt_regs *fp)
960 else 958 else
961 verbose_printk(KERN_NOTICE "COMM= invalid\n"); 959 verbose_printk(KERN_NOTICE "COMM= invalid\n");
962 960
961 printk(KERN_NOTICE "CPU = %d\n", current_thread_info()->cpu);
963 if (!((unsigned long)current->mm & 0x3) && (unsigned long)current->mm >= FIXED_CODE_START) 962 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" 963 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" 964 KERN_NOTICE " BSS = 0x%p-0x%p USER-STACK = 0x%p\n"
@@ -1053,6 +1052,7 @@ void show_regs(struct pt_regs *fp)
1053 struct irqaction *action; 1052 struct irqaction *action;
1054 unsigned int i; 1053 unsigned int i;
1055 unsigned long flags; 1054 unsigned long flags;
1055 unsigned int cpu = smp_processor_id();
1056 1056
1057 verbose_printk(KERN_NOTICE "\n" KERN_NOTICE "SEQUENCER STATUS:\t\t%s\n", print_tainted()); 1057 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", 1058 verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx SYSCFG: %04lx\n",
@@ -1112,9 +1112,9 @@ unlock:
1112 1112
1113 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) && 1113 if (((long)fp->seqstat & SEQSTAT_EXCAUSE) &&
1114 (((long)fp->seqstat & SEQSTAT_EXCAUSE) != VEC_HWERR)) { 1114 (((long)fp->seqstat & SEQSTAT_EXCAUSE) != VEC_HWERR)) {
1115 decode_address(buf, saved_dcplb_fault_addr); 1115 decode_address(buf, cpu_pda[cpu].dcplb_fault_addr);
1116 verbose_printk(KERN_NOTICE "DCPLB_FAULT_ADDR: %s\n", buf); 1116 verbose_printk(KERN_NOTICE "DCPLB_FAULT_ADDR: %s\n", buf);
1117 decode_address(buf, saved_icplb_fault_addr); 1117 decode_address(buf, cpu_pda[cpu].icplb_fault_addr);
1118 verbose_printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf); 1118 verbose_printk(KERN_NOTICE "ICPLB_FAULT_ADDR: %s\n", buf);
1119 } 1119 }
1120 1120
@@ -1153,20 +1153,21 @@ unlock:
1153asmlinkage int sys_bfin_spinlock(int *spinlock)__attribute__((l1_text)); 1153asmlinkage int sys_bfin_spinlock(int *spinlock)__attribute__((l1_text));
1154#endif 1154#endif
1155 1155
1156asmlinkage int sys_bfin_spinlock(int *spinlock) 1156static DEFINE_SPINLOCK(bfin_spinlock_lock);
1157
1158asmlinkage int sys_bfin_spinlock(int *p)
1157{ 1159{
1158 int ret = 0; 1160 int ret, tmp = 0;
1159 int tmp = 0;
1160 1161
1161 local_irq_disable(); 1162 spin_lock(&bfin_spinlock_lock); /* This would also hold kernel preemption. */
1162 ret = get_user(tmp, spinlock); 1163 ret = get_user(tmp, p);
1163 if (ret == 0) { 1164 if (likely(ret == 0)) {
1164 if (tmp) 1165 if (unlikely(tmp))
1165 ret = 1; 1166 ret = 1;
1166 tmp = 1; 1167 else
1167 put_user(tmp, spinlock); 1168 put_user(1, p);
1168 } 1169 }
1169 local_irq_enable(); 1170 spin_unlock(&bfin_spinlock_lock);
1170 return ret; 1171 return ret;
1171} 1172}
1172 1173
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 7d12c6692a6..4b4341da058 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 5c87505165d..762a7f02970 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 d60554dce87..1863a6ba507 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 00000000000..abde120ee23
--- /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 303d0c6a6db..00000000000
--- 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 00000000000..f397ede006b
--- /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 00000000000..168a193f9f9
--- /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 00000000000..96163514ed2
--- /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 00000000000..172e859c3a7
--- /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 00000000000..15f1351c864
--- /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 00000000000..698e88ca510
--- /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 00000000000..e5b4bef0eda
--- /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 00000000000..78da1a07ee7
--- /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 00000000000..b50a63b975a
--- /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 00000000000..d1a2b9ca622
--- /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 00000000000..820c13c4daa
--- /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 00000000000..9521e178fb2
--- /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 00000000000..4e26ccfcef9
--- /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 00000000000..bafb370cfb3
--- /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 00000000000..ee3d4733369
--- /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 00000000000..a96ca90154d
--- /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 00000000000..543f2913b3f
--- /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 00000000000..149a269306c
--- /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 00000000000..6e982abf4ed
--- /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 00000000000..1bec8d1c2a7
--- /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 00000000000..bbd33c1706e
--- /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 00000000000..9757683c394
--- /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 00000000000..3ff0f093313
--- /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 00000000000..62bcc781bfa
--- /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 00000000000..ac16d54734d
--- /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 00000000000..3151fd5501c
--- /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 3cde4beeb21..8438ec6d667 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 4eddb580319..4a6cdafab8c 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 9ea440bbb13..a2c3578f4b6 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 36c87b6fbde..0314bd3355e 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 8ee2b744e23..9454fb7b18c 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 dfd080cda78..23187757824 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 0eb1da85db7..00000000000
--- 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 62373e61c58..035e8d83505 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 144f08d3f8e..3832aab11e9 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 cfd8ad4f1f2..00000000000
--- 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 9a814b9a12b..1fe76d8e040 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 49dd693223e..eb287da101a 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 00000000000..06b6eebf0d4
--- /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 4e2b3f2020e..8ea660d8151 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 ef46dc991cd..019e0017ad8 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 8a2367403d2..f8c8acd73e3 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 76beb75f12d..14427de7d77 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 aa9f2647ee0..874840f7602 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 72ac3ac8ef7..0c66bf44cfa 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 d064ded8771..6ee607c259a 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 575843f6d9e..e7061c7e8c4 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 cc2e7eeb1d5..08cd0969de4 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 82b1f6a60e3..986eeec53b1 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 5864892de31..e30b1b7d144 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 050ffca5353..07f9ad1e189 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 28655c1cb7d..0a6eb8f24d9 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 9fc95aaca43..00000000000
--- 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 f544fc56959..0d3a03429fb 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 dfc8c1ad2d7..cf4427cd3f7 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 9bb87e9e2e9..00000000000
--- 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 d80971b4e3a..045184f81a2 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 3d8978a52c1..bbc3c8386d4 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 bd9d5e94307..fb34934c5ba 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 00000000000..e45c17077af
--- /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 5aa38e5da6b..db1e346cd1a 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 ed2034bf10e..00000000000
--- 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 581fc6eea78..fc33b7cb993 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 8255374c04a..bbc08fd4f12 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 68e5478e95a..56994b675f9 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 dde14720b0e..6ac8e4d5bd3 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 78a13d5bfd5..dd6e6bfb98e 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 48c4cd2d1be..bb795341cb1 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 f9174c11cbd..89de94f4545 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 8d394393201..d812e2514a2 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 d5ff705a512..2f4b066153c 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 4edb363ff99..81185051de9 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 f5c94bf80e3..00000000000
--- 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 c68992494f9..9cb39121d1c 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 24d5c9d4232..f194a848ae8 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 cfd8ad4f1f2..00000000000
--- 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 cffc786b2a2..7d6069c886f 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 88d491cd9f3..5f8b5f845be 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 7a964040870..5ae83b1183a 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 00000000000..d77a31e45a3
--- /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 2e68a8a1e73..b2a71d5d4e5 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 f67698f670c..00000000000
--- 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 5078b669431..f9010c4b4bf 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 b1300b3f181..51c48087e03 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 00000000000..f068c3523cd
--- /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 00000000000..8cd2719684d
--- /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 00000000000..215249ba58b
--- /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 00000000000..6143b320d58
--- /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 00000000000..e37cb937888
--- /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 00000000000..d6837fbf94e
--- /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 00000000000..e130b4f8a05
--- /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 00000000000..9c8abb30790
--- /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 00000000000..40503b6b89a
--- /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 00000000000..ea25371a922
--- /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 00000000000..241725bc698
--- /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 00000000000..198c4bbc8e5
--- /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 00000000000..6adbfcc65a3
--- /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 00000000000..eb05cacbf4d
--- /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 00000000000..30f4f723f7c
--- /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 00000000000..fdc87fe2c17
--- /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 00000000000..76811966690
--- /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 00000000000..1e031b588b4
--- /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 00000000000..70d17e550e0
--- /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 1bfcd8f646a..dcf65715905 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 68e5478e95a..56994b675f9 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 24192aaa927..f53ad682530 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 5288187a3ac..309c16014ca 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 74730eb8ae1..535980652bf 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 93b361dff27..00000000000
--- 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 816b09278f6..3b5430999f4 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 49f9b403d45..f0e56998481 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 c41f9cf0026..00000000000
--- 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 d6ee74ac046..0c0e3e2c3c2 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 57ac8cb9b1f..6e636c418cb 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 36a2ef7e784..a30d242c739 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 ad380d1f587..60299a71e09 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 ab0b863eee6..00000000000
--- 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 a2228428dc0..70b9c119402 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 3f4895450be..638ec38ca47 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 f39235a5578..59e18afe28c 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 00000000000..9439bc6bd01
--- /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 8f40990eea2..6880d1ebfe6 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 50b4cdceccf..0e2178a1aec 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 2faa0072d61..0ba366a0e69 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 c9174b39f98..6f77dbe952f 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 24415eb8269..42b0037afe6 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 31a777a9e69..00000000000
--- 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 22990df04ae..1a9e1756282 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 18b1b3a223a..9968362a2ee 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 9bb87e9e2e9..00000000000
--- 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 0ea8666e676..f79f6626b7e 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 c14d63402e7..95d609f11c9 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 4eca2026bb9..d7c50975965 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 8bc46cd89a0..13647c71f1c 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 00000000000..7882f79e1ad
--- /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 e163260bca1..00000000000
--- 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 f1d4c0637bd..419dffdc96e 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 00000000000..f9e65ebe81b
--- /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 00000000000..35280f06b7b
--- /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 00000000000..9b27e698c0b
--- /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 e6ed57c56d4..1f3228ed713 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 00000000000..e6ab1f81512
--- /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 a028e945041..3c98dacbf28 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 00000000000..5d182abefc7
--- /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 dda5443b37e..72e16605ca0 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 ad5431e2cd0..4da50bcd930 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 bde6dc4e261..fae77465137 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 f123a62e245..e1e42c029e1 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 4a2ec7a9675..473df0f7fa7 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 34e8a726ffd..1bba6030dce 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 606ded9ff4e..05004df0f78 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 9daf01201e9..6c5f5f0ea7f 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 e28c6af1f41..d3d70fd67c1 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 00000000000..77c99284709
--- /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 bc240abb874..d0532b72bba 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 cc6f336e731..834cab7438a 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 634e300d67e..c70af3a0129 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 00000000000..c3b9713b23f
--- /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 0f6d303a889..00000000000
--- 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 05dd08c9d15..00000000000
--- 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 d1c698bb9ee..00000000000
--- 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 6c6f8606af4..00000000000
--- 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 b17aeea8d62..3462245fe9f 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 3b3857ec1f1..2f8ea0f7a63 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 173c141ac9b..295131fee71 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 da7d2be000b..372d0ca6efb 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 52e16c6436f..9dac1733464 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 f71ea686a2e..5718dd8902a 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 c0e62f811e0..9e69cfb7f13 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 dba33aba3e9..c615a06dd75 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/h8300/Kconfig b/arch/h8300/Kconfig
index 28f06fd9b7b..9420648352b 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 c68e1680da0..27b108a86b3 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 b4cf0ea97ed..833186c8dc3 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 cb18e3b0aa9..cb9ddf5fc54 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 36e597d6161..c36b80a3dd8 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/swab.h b/arch/h8300/include/asm/swab.h
new file mode 100644
index 00000000000..c108f39b8bc
--- /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 7fa8f615ba6..3d31636cbaf 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 c2f58ff364e..cc0a3182db3 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 ccbe8ae47a6..3b25bd9dca9 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/atomic.h b/arch/ia64/include/asm/atomic.h
index 50c2b83fd5a..d37292bd987 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 69bd41d7c26..0f84c5cb703 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 3627116fb0e..36429a53263 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(cpumask_var_t 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 f38472ac226..68aa6da807c 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 c60d324da54..34866366165 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 12d96e0cd51..21c402365d0 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/swab.h b/arch/ia64/include/asm/swab.h
new file mode 100644
index 00000000000..6aa58b699ee
--- /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 fb79423834d..dcbaea7ce12 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 35bcb641c9e..76a33a91ca6 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_from_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 bd7acc71e8a..0553648b759 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -202,7 +202,6 @@ char *__init __acpi_map_table(unsigned long phys_addr, unsigned long size)
202 Boot-time Table Parsing 202 Boot-time Table Parsing
203 -------------------------------------------------------------------------- */ 203 -------------------------------------------------------------------------- */
204 204
205static int total_cpus __initdata;
206static int available_cpus __initdata; 205static int available_cpus __initdata;
207struct acpi_table_madt *acpi_madt __initdata; 206struct acpi_table_madt *acpi_madt __initdata;
208static u8 has_8259; 207static u8 has_8259;
@@ -1001,7 +1000,7 @@ acpi_map_iosapic(acpi_handle handle, u32 depth, void *context, void **ret)
1001 node = pxm_to_node(pxm); 1000 node = pxm_to_node(pxm);
1002 1001
1003 if (node >= MAX_NUMNODES || !node_online(node) || 1002 if (node >= MAX_NUMNODES || !node_online(node) ||
1004 cpus_empty(node_to_cpumask(node))) 1003 cpumask_empty(cpumask_of_node(node)))
1005 return AE_OK; 1004 return AE_OK;
1006 1005
1007 /* We know a gsi to node mapping! */ 1006 /* We know a gsi to node mapping! */
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c
index 5c4674ae8ae..5cfd3d91001 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 7fd18f54c05..95ff16cb05d 100644
--- a/arch/ia64/kernel/irq.c
+++ b/arch/ia64/kernel/irq.c
@@ -112,11 +112,11 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir)
112 } 112 }
113} 113}
114 114
115bool is_affinity_mask_valid(cpumask_t cpumask) 115bool is_affinity_mask_valid(cpumask_var_t cpumask)
116{ 116{
117 if (ia64_platform_is("sn2")) { 117 if (ia64_platform_is("sn2")) {
118 /* Only allow one CPU to be specified in the smp_affinity mask */ 118 /* Only allow one CPU to be specified in the smp_affinity mask */
119 if (cpus_weight(cpumask) != 1) 119 if (cpumask_weight(cpumask) != 1)
120 return false; 120 return false;
121 } 121 }
122 return true; 122 return true;
@@ -133,7 +133,6 @@ unsigned int vectors_in_migration[NR_IRQS];
133 */ 133 */
134static void migrate_irqs(void) 134static void migrate_irqs(void)
135{ 135{
136 cpumask_t mask;
137 irq_desc_t *desc; 136 irq_desc_t *desc;
138 int irq, new_cpu; 137 int irq, new_cpu;
139 138
@@ -152,15 +151,14 @@ static void migrate_irqs(void)
152 if (desc->status == IRQ_PER_CPU) 151 if (desc->status == IRQ_PER_CPU)
153 continue; 152 continue;
154 153
155 cpus_and(mask, irq_desc[irq].affinity, cpu_online_map); 154 if (cpumask_any_and(&irq_desc[irq].affinity, cpu_online_mask)
156 if (any_online_cpu(mask) == NR_CPUS) { 155 >= nr_cpu_ids) {
157 /* 156 /*
158 * Save it for phase 2 processing 157 * Save it for phase 2 processing
159 */ 158 */
160 vectors_in_migration[irq] = irq; 159 vectors_in_migration[irq] = irq;
161 160
162 new_cpu = any_online_cpu(cpu_online_map); 161 new_cpu = any_online_cpu(cpu_online_map);
163 mask = cpumask_of_cpu(new_cpu);
164 162
165 /* 163 /*
166 * Al three are essential, currently WARN_ON.. maybe panic? 164 * Al three are essential, currently WARN_ON.. maybe panic?
@@ -168,7 +166,8 @@ static void migrate_irqs(void)
168 if (desc->chip && desc->chip->disable && 166 if (desc->chip && desc->chip->disable &&
169 desc->chip->enable && desc->chip->set_affinity) { 167 desc->chip->enable && desc->chip->set_affinity) {
170 desc->chip->disable(irq); 168 desc->chip->disable(irq);
171 desc->chip->set_affinity(irq, mask); 169 desc->chip->set_affinity(irq,
170 cpumask_of(new_cpu));
172 desc->chip->enable(irq); 171 desc->chip->enable(irq);
173 } else { 172 } else {
174 WARN_ON((!(desc->chip) || !(desc->chip->disable) || 173 WARN_ON((!(desc->chip) || !(desc->chip->disable) ||
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index f07688da947..f90be51b112 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 702a09c1323..89033933903 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 2a92f637431..d0ada067a4a 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 1dcbb85fc4e..11463994a7d 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 65c10a42c88..f0ebb342409 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 c75b914f2d6..a8d61a3e9a9 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 92cef66ca26..0bb99b73290 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 4e3dc13a619..0c3564a7a03 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 af1464f7a6a..4e586f6110a 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 00000000000..a85cb611ecd
--- /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 2cc41d17cf9..b2bcaa2787a 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 e585c460734..dd979e00b57 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 7f1a858bc69..21f63fffc37 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 800817307b7..552d0772420 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 e44027ce566..ecd526b5532 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 e9b2a4e121c..b2f12a562bd 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 2275bf4e681..9eee5c04bac 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 c1d7251a148..3ef1a017a31 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 e22b93361e0..6b6307a3bd5 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 054bcd9439a..56e12903973 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/irq.c b/arch/ia64/sn/kernel/irq.c
index 0c66dbdd1d7..66fd705e82c 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 83f190ffe35..ca553b0429c 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 636588e7e06..be339477f90 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 a88eba3314d..3f864238566 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 29047d5c259..cabba332cc4 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 39cb6da72dc..2547d6c4a82 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 836fb66f080..fb87c08c6b5 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/kernel/traps.c b/arch/m68k/kernel/traps.c
index 6d813de2baf..184acc90808 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/m68knommu/include/asm/Kbuild b/arch/m68knommu/include/asm/Kbuild
index c68e1680da0..58c02a45413 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 d5632a305da..6bb674855a3 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 6f3685eab44..9d3cbe5fad1 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 20bb4426b61..a6f0b8f7f62 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/swab.h b/arch/m68knommu/include/asm/swab.h
new file mode 100644
index 00000000000..e582257db30
--- /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 c5b916700b2..2a12e7fa974 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/include/asm/Kbuild b/arch/mips/include/asm/Kbuild
index 7897f05e316..023866c0c10 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 1232be3885b..c996c3b4d07 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 33790b9e0cc..607b7183070 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/irq.h b/arch/mips/include/asm/irq.h
index a58f0eecc68..abc62aa744a 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-ip27/topology.h b/arch/mips/include/asm/mach-ip27/topology.h
index 7785bec732f..55d481569a1 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/smp.h b/arch/mips/include/asm/smp.h
index 0ff5b523ea7..86557b5d1b3 100644
--- a/arch/mips/include/asm/smp.h
+++ b/arch/mips/include/asm/smp.h
@@ -38,9 +38,6 @@ extern int __cpu_logical_map[NR_CPUS];
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 40
41extern cpumask_t phys_cpu_present_map;
42#define cpu_possible_map phys_cpu_present_map
43
44extern void asmlinkage smp_bootstrap(void); 41extern void asmlinkage smp_bootstrap(void);
45 42
46/* 43/*
diff --git a/arch/mips/include/asm/swab.h b/arch/mips/include/asm/swab.h
new file mode 100644
index 00000000000..88f1f7d555c
--- /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/jazz/irq.c b/arch/mips/jazz/irq.c
index d7f8a782aae..03965cb1b25 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/cevt-bcm1480.c b/arch/mips/kernel/cevt-bcm1480.c
index 0a57f86945f..b820661678b 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 df4acb68bfb..1ada45ea070 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 6e2f58520af..e9b787feedc 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 4a4c59f2737..e1ec83b6803 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -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 63ac3ad462b..a2eebaafda5 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 5162fe4b595..6d45e24db5b 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 b5fc4eb412d..eccf7d6096b 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/i8253.c b/arch/mips/kernel/i8253.c
index b6ac55162b9..f4d187825f9 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 f0a4bb19e09..494a49a317e 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/smp-cmp.c b/arch/mips/kernel/smp-cmp.c
index ca476c4f62a..f27beca4b26 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 87a1816c1f4..6f7ee5ac46e 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 8bf88faf5af..3da94704f81 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 897fb2b4751..b6cca01ff82 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 0632e2a849c..58f5cd76c8c 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/vpe.c b/arch/mips/kernel/vpe.c
index 010b27e01f7..3ca5f42e819 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/mti-malta/malta-smtc.c b/arch/mips/mti-malta/malta-smtc.c
index f84a46a8ae6..aabd7274507 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 62f495b57f9..cf293b27909 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 f97ab146101..dda6f205866 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 62cae740e25..b0eb9e75c68 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 97862f45496..caf5e9a0acc 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 3a7df647ca7..f78c29b68d7 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 ba5cdebeaf0..5b47d6b6527 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 1327c2746fb..f024057a35f 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 a35818ed426..12b465d404d 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 bd9eeb43ed0..dddfda8e829 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 a5158483986..808ac2959b8 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 0734b933e96..5950a288a7d 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 796e3ce2872..69f5f88711c 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 644a70b1b04..aacf11d3372 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/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h
index 57fcc4a5ebb..edbfe25c5fc 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/module.h b/arch/parisc/include/asm/module.h
index c2cb49e934c..1f4123427ea 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/smp.h b/arch/parisc/include/asm/smp.h
index 409e698f436..6ef4b7867b1 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/kernel/irq.c b/arch/parisc/kernel/irq.c
index 23ef950df00..4cea935e2f9 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
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
index 44138c3e6ea..9013243cecc 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/smp.c b/arch/parisc/kernel/smp.c
index d47f3975c9c..80bc000523f 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -67,21 +67,6 @@ static volatile int cpu_now_booting __read_mostly = 0; /* track which CPU is boo
67 67
68static int parisc_max_cpus __read_mostly = 1; 68static int parisc_max_cpus __read_mostly = 1;
69 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
85DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED; 70DEFINE_PER_CPU(spinlock_t, ipi_lock) = SPIN_LOCK_UNLOCKED;
86 71
87enum ipi_message_type { 72enum ipi_message_type {
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index f32829937aa..ab6dda37243 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
diff --git a/arch/powerpc/boot/dts/sequoia.dts b/arch/powerpc/boot/dts/sequoia.dts
index 3b295e8df53..43cc68bd319 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/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index 5ab7d7fe198..9268602de5d 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 499be5bdd6f..b401950f525 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 d5de325472e..5cca27a4153 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/disassemble.h b/arch/powerpc/include/asm/disassemble.h
new file mode 100644
index 00000000000..9b198d1b3b2
--- /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 26f0d0ab27a..b1dafb6a974 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/kvm_44x.h b/arch/powerpc/include/asm/kvm_44x.h
new file mode 100644
index 00000000000..f49031b632c
--- /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 34b52b7180c..c1e436fe773 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 bb62ad876de..36d2a50a848 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 8a97cfb08b7..27cc6fdcd3b 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/swab.h b/arch/powerpc/include/asm/swab.h
new file mode 100644
index 00000000000..ef824ae4b79
--- /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 c32da6f9799..375258559ae 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/asm-offsets.c b/arch/powerpc/kernel/asm-offsets.c
index 661d07d2146..9937fe44555 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/irq.c b/arch/powerpc/kernel/irq.c
index ac222d0ab12..23b8b5e36f9 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 de79915452c..c9329786073 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/process.c b/arch/powerpc/kernel/process.c
index 51b201ddf9a..fb7049c054c 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_parse.c b/arch/powerpc/kernel/prom_parse.c
index 8c133556608..8f0856f312d 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 8ac3f721d23..65484b2200b 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/time.c b/arch/powerpc/kernel/time.c
index e1f3a514042..c9564031a2a 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 00000000000..a66bec57265
--- /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 00000000000..82489a743a6
--- /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 ad72c6f9811..9a34b8edb9e 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 2ccd46b6f6b..772191f29e6 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 53aaa66b25e..6dbdc4817d8 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 2a5d4397ac4..df7ba59e6d5 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 7b2591e26ba..35485dd6927 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 00000000000..cf7c94ca24b
--- /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 b480341bc31..00000000000
--- 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 95e165baf85..084ebcd7dd8 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 0fce4fbdc20..d1d38daa93f 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 8bef0efcdfe..2822c8ccfaa 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 00000000000..47ee603f558
--- /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 00000000000..bb13b1f3cd5
--- /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 201c7a5486c..9920d6a7cf2 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 53b06ebb3f2..f00f09a77f1 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/oprofile/cell/spu_profiler.c b/arch/powerpc/oprofile/cell/spu_profiler.c
index dd499c3e9da..83faa958b9d 100644
--- a/arch/powerpc/oprofile/cell/spu_profiler.c
+++ b/arch/powerpc/oprofile/cell/spu_profiler.c
@@ -49,7 +49,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. 49 * of precision. This is close enough for the purpose at hand.
50 * 50 *
51 * The value of the timeout should be small enough that the hw 51 * 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 52 * trace buffer will not get more than about 1/3 full for the
53 * maximum user specified (the LFSR value) hw sampling frequency. 53 * maximum user specified (the LFSR value) hw sampling frequency.
54 * This is to ensure the trace buffer will never fill even if the 54 * This is to ensure the trace buffer will never fill even if the
55 * kernel thread scheduling varies under a heavy system load. 55 * kernel thread scheduling varies under a heavy system load.
diff --git a/arch/powerpc/platforms/cell/spu_priv1_mmio.c b/arch/powerpc/platforms/cell/spu_priv1_mmio.c
index 906a0a2a9fe..1410443731e 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 6296bfd9cb0..e309ef70a53 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 2ad914c4749..6a0ad196aeb 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/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index f7a69021b7b..84e058f1e1c 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/mpic.c b/arch/powerpc/sysdev/mpic.c
index c82babb7007..3e0d89dcdba 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 6209c62a426..3cef2af10f4 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/s390/Kconfig b/arch/s390/Kconfig
index 8152fefc97b..a94a3c3ae93 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 9d4f8e6c080..5a805df216b 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 63a23415fba..f2af4167bd5 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 2d184655bc5..de432f2de2d 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 8bcf277c846..b95a2b2933f 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/cpu.h b/arch/s390/include/asm/cpu.h
index e5a6a9ba3ad..d60a2eefb17 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 133ce054fc8..521726430af 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/lowcore.h b/arch/s390/include/asm/lowcore.h
index 0bc51d52a89..ffdef5fe858 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/s390_rdev.h b/arch/s390/include/asm/s390_rdev.h
deleted file mode 100644
index 6fa20442a48..00000000000
--- 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/swab.h b/arch/s390/include/asm/swab.h
new file mode 100644
index 00000000000..bd9321aa55a
--- /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 <asm/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 024ef42ed6d..3a8b26eb1f2 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 c1eaf9604da..c544aa52453 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 61705d60f99..e4bcab739c1 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 d96c9164345..c93eb50e1d0 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/vdso.h b/arch/s390/include/asm/vdso.h
index a44f4fe16a3..7bdd7c8ebc9 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 e641f60bac9..67a60016bab 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 55de521aef7..1268aa2991b 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/entry64.S b/arch/s390/kernel/entry64.S
index 16bb4fd1a40..c6fbde13971 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 3ccd36b24b8..f9f70aa1524 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 569079ec4ff..a01cf0284db 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 04f8c67a610..b6110bdf8dc 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 e019b419efc..a0d2d55d7fb 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 b7a1efd5522..d825f4950e4 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 6fc78541dc5..9c0ccb532a4 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,8 @@ 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 BUG_ON(vdso_alloc_per_cpu(smp_processor_id(), lowcore));
686#endif 689#endif
687 set_prefix((u32)(unsigned long) lowcore); 690 set_prefix((u32)(unsigned long) lowcore);
688 local_mcck_enable(); 691 local_mcck_enable();
@@ -851,9 +854,11 @@ static ssize_t show_idle_count(struct sys_device *dev,
851 unsigned long long idle_count; 854 unsigned long long idle_count;
852 855
853 idle = &per_cpu(s390_idle, dev->id); 856 idle = &per_cpu(s390_idle, dev->id);
854 spin_lock_irq(&idle->lock); 857 spin_lock(&idle->lock);
855 idle_count = idle->idle_count; 858 idle_count = idle->idle_count;
856 spin_unlock_irq(&idle->lock); 859 if (idle->idle_enter)
860 idle_count++;
861 spin_unlock(&idle->lock);
857 return sprintf(buf, "%llu\n", idle_count); 862 return sprintf(buf, "%llu\n", idle_count);
858} 863}
859static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL); 864static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL);
@@ -862,18 +867,17 @@ static ssize_t show_idle_time(struct sys_device *dev,
862 struct sysdev_attribute *attr, char *buf) 867 struct sysdev_attribute *attr, char *buf)
863{ 868{
864 struct s390_idle_data *idle; 869 struct s390_idle_data *idle;
865 unsigned long long new_time; 870 unsigned long long now, idle_time, idle_enter;
866 871
867 idle = &per_cpu(s390_idle, dev->id); 872 idle = &per_cpu(s390_idle, dev->id);
868 spin_lock_irq(&idle->lock); 873 spin_lock(&idle->lock);
869 if (idle->in_idle) { 874 now = get_clock();
870 new_time = get_clock(); 875 idle_time = idle->idle_time;
871 idle->idle_time += new_time - idle->idle_enter; 876 idle_enter = idle->idle_enter;
872 idle->idle_enter = new_time; 877 if (idle_enter != 0ULL && idle_enter < now)
873 } 878 idle_time += now - idle_enter;
874 new_time = idle->idle_time; 879 spin_unlock(&idle->lock);
875 spin_unlock_irq(&idle->lock); 880 return sprintf(buf, "%llu\n", idle_time >> 12);
876 return sprintf(buf, "%llu\n", new_time >> 12);
877} 881}
878static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL); 882static SYSDEV_ATTR(idle_time_us, 0444, show_idle_time, NULL);
879 883
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 5be981a36c3..d649600df5b 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 90e9ba11eba..cc362c9ea8f 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 10a6ccef441..25a6a82f1c0 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,10 @@ 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 BUG_ON(vdso_alloc_per_cpu(0, S390_lowcore));
326#endif
327 vdso_init_cr5();
211#endif /* CONFIG_64BIT */ 328#endif /* CONFIG_64BIT */
212 329
213 get_page(virt_to_page(vdso_data)); 330 get_page(virt_to_page(vdso_data));
diff --git a/arch/s390/kernel/vdso64/clock_getres.S b/arch/s390/kernel/vdso64/clock_getres.S
index 488e31a3c0e..9ce8caafdb4 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 738a410b7eb..79dbfee831e 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 75a6e62ea97..2fb36e46219 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/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 8b00eb2ddf5..be8497186b9 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/mm/init.c b/arch/s390/mm/init.c
index 158b0d6d704..f0258ca3b17 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 5ccf9ea3a9d..38ef76207af 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 d3839e609aa..e36c7b87086 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 43910cdf78a..f1a2a0d1c79 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 c043ef00302..6327ffbb199 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 f5fa0653ebc..e95c41a5c8c 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/smp.h b/arch/sh/include/asm/smp.h
index 85b660c17eb..c24e9c6a173 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 00000000000..e6931593510
--- /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 95f0085e098..066f0fba590 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 3c5ad1660bb..8f402741261 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 c2317635230..96e8eaea1e6 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 3c61ddd4d43..0db3f951033 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 88807a2aacc..c0aa3d83ec0 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 6cbef8caeb5..3edf297c829 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 0a94d9c9cde..de58c02633b 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/sparc64_defconfig b/arch/sparc/configs/sparc64_defconfig
index 05d19a3e590..cde19ae78f5 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 89c260aab45..95e38a43dff 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 5c944b5a804..ce465975a6a 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 5982c5ae7f0..a0a70649269 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 5a70f137f1f..48a047cd6fa 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 17d6ef7b23a..66013b4fe10 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 6387209518f..00000000000
--- 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 a44b855b98d..00000000000
--- 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 3457f29bd73..0717d9e39d2 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 aaeae905ed3..963e1a45c35 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 875da3552d8..00000000000
--- 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 b69e4a8c917..00000000000
--- 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/posix_types.h b/arch/sparc/include/asm/posix_types.h
index 03a0e091a88..98d6ebb922f 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 6bb6eb1ca0f..00000000000
--- 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 ba8f9329576..00000000000
--- 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 2ae67a2e7f3..09521c6a5ed 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 6dcbe2eed2e..30b0b797dc0 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 4cef450167d..00000000000
--- 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 cd6fbfc2043..00000000000
--- 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 0c16e19cae4..00000000000
--- 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 1efb056fb3d..00000000000
--- 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 6f277d7c7d8..00000000000
--- 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 e92de7e286b..a1607d18035 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 c5fb60dcbd7..00000000000
--- 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 1c868d680cf..00000000000
--- 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 bd81f8d7f5c..988e5d8ed11 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 3c71af135c5..00000000000
--- 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 c96e6c30f8b..00000000000
--- 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 27ab05dc203..41535e77b25 100644
--- a/arch/sparc/include/asm/signal.h
+++ b/arch/sparc/include/asm/signal.h
@@ -1,8 +1,210 @@
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#define _NSIG_BPW 64
88#define _NSIG_WORDS (__NEW_NSIG / _NSIG_BPW)
89
90#define SIGRTMIN 32
91#define SIGRTMAX __NEW_NSIG
92
93#if defined(__KERNEL__) || defined(__WANT_POSIX1B_SIGNALS__)
94#define _NSIG __NEW_NSIG
95#define __new_sigset_t sigset_t
96#define __new_sigaction sigaction
97#define __new_sigaction32 sigaction32
98#define __old_sigset_t old_sigset_t
99#define __old_sigaction old_sigaction
100#define __old_sigaction32 old_sigaction32
5#else 101#else
6#include <asm/signal_32.h> 102#define _NSIG __OLD_NSIG
103#define NSIG _NSIG
104#define __old_sigset_t sigset_t
105#define __old_sigaction sigaction
106#define __old_sigaction32 sigaction32
7#endif 107#endif
108
109#ifndef __ASSEMBLY__
110
111typedef unsigned long __old_sigset_t; /* at least 32 bits */
112
113typedef struct {
114 unsigned long sig[_NSIG_WORDS];
115} __new_sigset_t;
116
117/* A SunOS sigstack */
118struct sigstack {
119 /* XXX 32-bit pointers pinhead XXX */
120 char *the_stack;
121 int cur_status;
122};
123
124/* Sigvec flags */
125#define _SV_SSTACK 1u /* This signal handler should use sig-stack */
126#define _SV_INTR 2u /* Sig return should not restart system call */
127#define _SV_RESET 4u /* Set handler to SIG_DFL upon taken signal */
128#define _SV_IGNCHILD 8u /* Do not send SIGCHLD */
129
130/*
131 * sa_flags values: SA_STACK is not currently supported, but will allow the
132 * usage of signal stacks by using the (now obsolete) sa_restorer field in
133 * the sigaction structure as a stack pointer. This is now possible due to
134 * the changes in signal handling. LBT 010493.
135 * SA_RESTART flag to get restarting signals (which were the default long ago)
136 */
137#define SA_NOCLDSTOP _SV_IGNCHILD
138#define SA_STACK _SV_SSTACK
139#define SA_ONSTACK _SV_SSTACK
140#define SA_RESTART _SV_INTR
141#define SA_ONESHOT _SV_RESET
142#define SA_NOMASK 0x20u
143#define SA_NOCLDWAIT 0x100u
144#define SA_SIGINFO 0x200u
145
146
147#define SIG_BLOCK 0x01 /* for blocking signals */
148#define SIG_UNBLOCK 0x02 /* for unblocking signals */
149#define SIG_SETMASK 0x04 /* for setting the signal mask */
150
151/*
152 * sigaltstack controls
153 */
154#define SS_ONSTACK 1
155#define SS_DISABLE 2
156
157#define MINSIGSTKSZ 4096
158#define SIGSTKSZ 16384
159
160#ifdef __KERNEL__
161/*
162 * DJHR
163 * SA_STATIC_ALLOC is used for the sparc32 system to indicate that this
164 * interrupt handler's irq structure should be statically allocated
165 * by the request_irq routine.
166 * The alternative is that arch/sparc/kernel/irq.c has carnal knowledge
167 * of interrupt usage and that sucks. Also without a flag like this
168 * it may be possible for the free_irq routine to attempt to free
169 * statically allocated data.. which is NOT GOOD.
170 *
171 */
172#define SA_STATIC_ALLOC 0x8000
8#endif 173#endif
174
175#include <asm-generic/signal.h>
176
177struct __new_sigaction {
178 __sighandler_t sa_handler;
179 unsigned long sa_flags;
180 __sigrestore_t sa_restorer; /* not used by Linux/SPARC yet */
181 __new_sigset_t sa_mask;
182};
183
184struct __old_sigaction {
185 __sighandler_t sa_handler;
186 __old_sigset_t sa_mask;
187 unsigned long sa_flags;
188 void (*sa_restorer)(void); /* not used by Linux/SPARC yet */
189};
190
191typedef struct sigaltstack {
192 void __user *ss_sp;
193 int ss_flags;
194 size_t ss_size;
195} stack_t;
196
197#ifdef __KERNEL__
198
199struct k_sigaction {
200 struct __new_sigaction sa;
201 void __user *ka_restorer;
202};
203
204#define ptrace_signal_deliver(regs, cookie) do { } while (0)
205
206#endif /* !(__KERNEL__) */
207
208#endif /* !(__ASSEMBLY__) */
209
210#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 96a60ab03ca..00000000000
--- 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 ab1509a101c..00000000000
--- 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 a8180e546a4..58101dc7049 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 d8153013df7..55db5eca08e 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 2299e1d5d94..00000000000
--- 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 9650fdea847..00000000000
--- 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 00000000000..a34ad079487
--- /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 80fe547c3f4..0f7b0e5fb1c 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 5b779fd1f78..ef3c3682deb 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 001c04027c8..b8a65b64e1d 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;
@@ -77,10 +79,13 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
77#define topology_core_id(cpu) (cpu_data(cpu).core_id) 79#define topology_core_id(cpu) (cpu_data(cpu).core_id)
78#define topology_core_siblings(cpu) (cpu_core_map[cpu]) 80#define topology_core_siblings(cpu) (cpu_core_map[cpu])
79#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu)) 81#define topology_thread_siblings(cpu) (per_cpu(cpu_sibling_map, cpu))
82#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
83#define topology_thread_cpumask(cpu) (&per_cpu(cpu_sibling_map, cpu))
80#define mc_capable() (sparc64_multi_core) 84#define mc_capable() (sparc64_multi_core)
81#define smt_capable() (sparc64_multi_core) 85#define smt_capable() (sparc64_multi_core)
82#endif /* CONFIG_SMP */ 86#endif /* CONFIG_SMP */
83 87
84#define cpu_coregroup_map(cpu) (cpu_core_map[cpu]) 88#define cpu_coregroup_map(cpu) (cpu_core_map[cpu])
89#define cpu_coregroup_mask(cpu) (&cpu_core_map[cpu])
85 90
86#endif /* _ASM_SPARC64_TOPOLOGY_H */ 91#endif /* _ASM_SPARC64_TOPOLOGY_H */
diff --git a/arch/sparc/include/asm/traps.h b/arch/sparc/include/asm/traps.h
index bebdbf8f43a..3aa62dde343 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 8c28fde5eaa..2237118825d 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/ds.c b/arch/sparc/kernel/ds.c
index f52e0534d91..57c39843fb2 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/iommu.c b/arch/sparc/kernel/iommu.c
index 1cc1995531e..d8900e1d5aa 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/irq_32.c b/arch/sparc/kernel/irq_32.c
index f3488c45d57..1eff942fe22 100644
--- a/arch/sparc/kernel/irq_32.c
+++ b/arch/sparc/kernel/irq_32.c
@@ -669,7 +669,9 @@ void __init init_IRQ(void)
669 btfixup(); 669 btfixup();
670} 670}
671 671
672#ifdef CONFIG_PROC_FS
672void init_irq_proc(void) 673void init_irq_proc(void)
673{ 674{
674 /* For now, nothing... */ 675 /* For now, nothing... */
675} 676}
677#endif /* CONFIG_PROC_FS */
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c
index a3ea2bcb95d..cab8e028687 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 757805ce02e..04df4edc007 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 201a6e547e4..3bc6527c95a 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 d68982330f6..6ce5d2598a0 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 3c539a6d7c1..3f79f0c23a0 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 ba960c02bb5..6ce1021d487 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 46e231f7c5c..b4a12c9aa5f 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 bdb7c0a6d83..923e9bbb9fe 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) {
diff --git a/arch/sparc/kernel/pci_common.c b/arch/sparc/kernel/pci_common.c
index 23b88082d0b..64e6edf17b9 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 2e680f34f72..f1be37a7b12 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 dfb3ec89298..3b34344082e 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 45d9dba1ba1..2b5cdde77af 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 34a1fded394..0ef0ab3d476 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/power.c b/arch/sparc/kernel/power.c
index 076cad7f975..ae88f06a7ec 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 69d9315f4a9..5a8d8ced33d 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -180,13 +180,13 @@ static DEFINE_SPINLOCK(sparc_backtrace_lock);
180 180
181void __show_backtrace(unsigned long fp) 181void __show_backtrace(unsigned long fp)
182{ 182{
183 struct reg_window *rw; 183 struct reg_window32 *rw;
184 unsigned long flags; 184 unsigned long flags;
185 int cpu = smp_processor_id(); 185 int cpu = smp_processor_id();
186 186
187 spin_lock_irqsave(&sparc_backtrace_lock, flags); 187 spin_lock_irqsave(&sparc_backtrace_lock, flags);
188 188
189 rw = (struct reg_window *)fp; 189 rw = (struct reg_window32 *)fp;
190 while(rw && (((unsigned long) rw) >= PAGE_OFFSET) && 190 while(rw && (((unsigned long) rw) >= PAGE_OFFSET) &&
191 !(((unsigned long) rw) & 0x7)) { 191 !(((unsigned long) rw) & 0x7)) {
192 printk("CPU[%d]: ARGS[%08lx,%08lx,%08lx,%08lx,%08lx,%08lx] " 192 printk("CPU[%d]: ARGS[%08lx,%08lx,%08lx,%08lx,%08lx,%08lx] "
@@ -196,7 +196,7 @@ void __show_backtrace(unsigned long fp)
196 rw->ins[6], 196 rw->ins[6],
197 rw->ins[7]); 197 rw->ins[7]);
198 printk("%pS\n", (void *) rw->ins[7]); 198 printk("%pS\n", (void *) rw->ins[7]);
199 rw = (struct reg_window *) rw->ins[6]; 199 rw = (struct reg_window32 *) rw->ins[6];
200 } 200 }
201 spin_unlock_irqrestore(&sparc_backtrace_lock, flags); 201 spin_unlock_irqrestore(&sparc_backtrace_lock, flags);
202} 202}
@@ -258,7 +258,7 @@ void show_stackframe(struct sparc_stackf *sf)
258 258
259void show_regs(struct pt_regs *r) 259void show_regs(struct pt_regs *r)
260{ 260{
261 struct reg_window *rw = (struct reg_window *) r->u_regs[14]; 261 struct reg_window32 *rw = (struct reg_window32 *) r->u_regs[14];
262 262
263 printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n", 263 printk("PSR: %08lx PC: %08lx NPC: %08lx Y: %08lx %s\n",
264 r->psr, r->pc, r->npc, r->y, print_tainted()); 264 r->psr, r->pc, r->npc, r->y, print_tainted());
@@ -287,7 +287,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
287{ 287{
288 unsigned long pc, fp; 288 unsigned long pc, fp;
289 unsigned long task_base; 289 unsigned long task_base;
290 struct reg_window *rw; 290 struct reg_window32 *rw;
291 int count = 0; 291 int count = 0;
292 292
293 if (tsk != NULL) 293 if (tsk != NULL)
@@ -301,7 +301,7 @@ void show_stack(struct task_struct *tsk, unsigned long *_ksp)
301 if (fp < (task_base + sizeof(struct thread_info)) || 301 if (fp < (task_base + sizeof(struct thread_info)) ||
302 fp >= (task_base + (PAGE_SIZE << 1))) 302 fp >= (task_base + (PAGE_SIZE << 1)))
303 break; 303 break;
304 rw = (struct reg_window *) fp; 304 rw = (struct reg_window32 *) fp;
305 pc = rw->ins[7]; 305 pc = rw->ins[7];
306 printk("[%08lx : ", pc); 306 printk("[%08lx : ", pc);
307 printk("%pS ] ", (void *) pc); 307 printk("%pS ] ", (void *) pc);
@@ -679,7 +679,7 @@ unsigned long get_wchan(struct task_struct *task)
679 unsigned long pc, fp, bias = 0; 679 unsigned long pc, fp, bias = 0;
680 unsigned long task_base = (unsigned long) task; 680 unsigned long task_base = (unsigned long) task;
681 unsigned long ret = 0; 681 unsigned long ret = 0;
682 struct reg_window *rw; 682 struct reg_window32 *rw;
683 int count = 0; 683 int count = 0;
684 684
685 if (!task || task == current || 685 if (!task || task == current ||
@@ -692,7 +692,7 @@ unsigned long get_wchan(struct task_struct *task)
692 if (fp < (task_base + sizeof(struct thread_info)) || 692 if (fp < (task_base + sizeof(struct thread_info)) ||
693 fp >= (task_base + (2 * PAGE_SIZE))) 693 fp >= (task_base + (2 * PAGE_SIZE)))
694 break; 694 break;
695 rw = (struct reg_window *) fp; 695 rw = (struct reg_window32 *) fp;
696 pc = rw->ins[7]; 696 pc = rw->ins[7];
697 if (!in_sched_functions(pc)) { 697 if (!in_sched_functions(pc)) {
698 ret = pc; 698 ret = pc;
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
index 4e9af593db4..ff7b591c894 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 96958c4dce8..5702ad4710c 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 790996428c1..40689ae3c9b 100644
--- a/arch/sparc/kernel/psycho_common.c
+++ b/arch/sparc/kernel/psycho_common.c
@@ -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),
@@ -179,14 +179,14 @@ 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),
@@ -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/signal_32.c b/arch/sparc/kernel/signal_32.c
index c94f91c8b6e..181d069a2d4 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 e396c1f17a9..1e5ac4e282e 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 bfe99d82d45..6cd1a5b6506 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 a4d45fc29b2..e1e97639231 100644
--- a/arch/sparc/kernel/sparc_ksyms_32.c
+++ b/arch/sparc/kernel/sparc_ksyms_32.c
@@ -112,10 +112,6 @@ EXPORT_PER_CPU_SYMBOL(__cpu_data);
112#ifdef CONFIG_SMP 112#ifdef CONFIG_SMP
113/* IRQ implementation. */ 113/* IRQ implementation. */
114EXPORT_SYMBOL(synchronize_irq); 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 115#endif
120 116
121EXPORT_SYMBOL(__udelay); 117EXPORT_SYMBOL(__udelay);
diff --git a/arch/sparc/kernel/time_64.c b/arch/sparc/kernel/time_64.c
index 141da375909..54405d36214 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
@@ -208,7 +208,7 @@ static void stick_init_tick(void)
208 stick_disable_irq(); 208 stick_disable_irq();
209} 209}
210 210
211static unsigned long stick_get_tick(void) 211static unsigned long long stick_get_tick(void)
212{ 212{
213 unsigned long ret; 213 unsigned long ret;
214 214
@@ -352,7 +352,7 @@ static void hbtick_init_tick(void)
352 hbtick_disable_irq(); 352 hbtick_disable_irq();
353} 353}
354 354
355static unsigned long hbtick_get_tick(void) 355static unsigned long long hbtick_get_tick(void)
356{ 356{
357 return __hbird_read_stick() & ~TICK_PRIV_BIT; 357 return __hbird_read_stick() & ~TICK_PRIV_BIT;
358} 358}
@@ -422,7 +422,7 @@ static int __devinit rtc_probe(struct of_device *op, const struct of_device_id *
422{ 422{
423 struct resource *r; 423 struct resource *r;
424 424
425 printk(KERN_INFO "%s: RTC regs at 0x%lx\n", 425 printk(KERN_INFO "%s: RTC regs at 0x%llx\n",
426 op->node->full_name, op->resource[0].start); 426 op->node->full_name, op->resource[0].start);
427 427
428 /* The CMOS RTC driver only accepts IORESOURCE_IO, so cons 428 /* The CMOS RTC driver only accepts IORESOURCE_IO, so cons
@@ -478,7 +478,7 @@ static struct platform_device rtc_bq4802_device = {
478static int __devinit bq4802_probe(struct of_device *op, const struct of_device_id *match) 478static int __devinit bq4802_probe(struct of_device *op, const struct of_device_id *match)
479{ 479{
480 480
481 printk(KERN_INFO "%s: BQ4802 regs at 0x%lx\n", 481 printk(KERN_INFO "%s: BQ4802 regs at 0x%llx\n",
482 op->node->full_name, op->resource[0].start); 482 op->node->full_name, op->resource[0].start);
483 483
484 rtc_bq4802_device.resource = &op->resource[0]; 484 rtc_bq4802_device.resource = &op->resource[0];
@@ -542,7 +542,7 @@ static int __devinit mostek_probe(struct of_device *op, const struct of_device_i
542 strcmp(dp->parent->parent->name, "central") != 0) 542 strcmp(dp->parent->parent->name, "central") != 0)
543 return -ENODEV; 543 return -ENODEV;
544 544
545 printk(KERN_INFO "%s: Mostek regs at 0x%lx\n", 545 printk(KERN_INFO "%s: Mostek regs at 0x%llx\n",
546 dp->full_name, op->resource[0].start); 546 dp->full_name, op->resource[0].start);
547 547
548 m48t59_rtc.resource = &op->resource[0]; 548 m48t59_rtc.resource = &op->resource[0];
@@ -763,7 +763,7 @@ void __devinit setup_sparc64_timer(void)
763 sevt = &__get_cpu_var(sparc64_events); 763 sevt = &__get_cpu_var(sparc64_events);
764 764
765 memcpy(sevt, &sparc64_clockevent, sizeof(*sevt)); 765 memcpy(sevt, &sparc64_clockevent, sizeof(*sevt));
766 sevt->cpumask = cpumask_of_cpu(smp_processor_id()); 766 sevt->cpumask = cpumask_of(smp_processor_id());
767 767
768 clockevents_register_device(sevt); 768 clockevents_register_device(sevt);
769} 769}
diff --git a/arch/sparc/kernel/traps_32.c b/arch/sparc/kernel/traps_32.c
index 716f3946c49..213645be6e9 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:");
diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index 4638af2f55a..bca3b4e09c4 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
@@ -1168,20 +1168,20 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in
1168 } 1168 }
1169 1169
1170 /* Now dump the cache snapshots. */ 1170 /* Now dump the cache snapshots. */
1171 printk("%s" "ERROR(%d): D-cache idx[%x] tag[%016lx] utag[%016lx] stag[%016lx]\n", 1171 printk("%s" "ERROR(%d): D-cache idx[%x] tag[%016llx] utag[%016llx] stag[%016llx]\n",
1172 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1172 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1173 (int) info->dcache_index, 1173 (int) info->dcache_index,
1174 info->dcache_tag, 1174 info->dcache_tag,
1175 info->dcache_utag, 1175 info->dcache_utag,
1176 info->dcache_stag); 1176 info->dcache_stag);
1177 printk("%s" "ERROR(%d): D-cache data0[%016lx] data1[%016lx] data2[%016lx] data3[%016lx]\n", 1177 printk("%s" "ERROR(%d): D-cache data0[%016llx] data1[%016llx] data2[%016llx] data3[%016llx]\n",
1178 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1178 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1179 info->dcache_data[0], 1179 info->dcache_data[0],
1180 info->dcache_data[1], 1180 info->dcache_data[1],
1181 info->dcache_data[2], 1181 info->dcache_data[2],
1182 info->dcache_data[3]); 1182 info->dcache_data[3]);
1183 printk("%s" "ERROR(%d): I-cache idx[%x] tag[%016lx] utag[%016lx] stag[%016lx] " 1183 printk("%s" "ERROR(%d): I-cache idx[%x] tag[%016llx] utag[%016llx] stag[%016llx] "
1184 "u[%016lx] l[%016lx]\n", 1184 "u[%016llx] l[%016llx]\n",
1185 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1185 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1186 (int) info->icache_index, 1186 (int) info->icache_index,
1187 info->icache_tag, 1187 info->icache_tag,
@@ -1189,22 +1189,22 @@ static void cheetah_log_errors(struct pt_regs *regs, struct cheetah_err_info *in
1189 info->icache_stag, 1189 info->icache_stag,
1190 info->icache_upper, 1190 info->icache_upper,
1191 info->icache_lower); 1191 info->icache_lower);
1192 printk("%s" "ERROR(%d): I-cache INSN0[%016lx] INSN1[%016lx] INSN2[%016lx] INSN3[%016lx]\n", 1192 printk("%s" "ERROR(%d): I-cache INSN0[%016llx] INSN1[%016llx] INSN2[%016llx] INSN3[%016llx]\n",
1193 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1193 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1194 info->icache_data[0], 1194 info->icache_data[0],
1195 info->icache_data[1], 1195 info->icache_data[1],
1196 info->icache_data[2], 1196 info->icache_data[2],
1197 info->icache_data[3]); 1197 info->icache_data[3]);
1198 printk("%s" "ERROR(%d): I-cache INSN4[%016lx] INSN5[%016lx] INSN6[%016lx] INSN7[%016lx]\n", 1198 printk("%s" "ERROR(%d): I-cache INSN4[%016llx] INSN5[%016llx] INSN6[%016llx] INSN7[%016llx]\n",
1199 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1199 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1200 info->icache_data[4], 1200 info->icache_data[4],
1201 info->icache_data[5], 1201 info->icache_data[5],
1202 info->icache_data[6], 1202 info->icache_data[6],
1203 info->icache_data[7]); 1203 info->icache_data[7]);
1204 printk("%s" "ERROR(%d): E-cache idx[%x] tag[%016lx]\n", 1204 printk("%s" "ERROR(%d): E-cache idx[%x] tag[%016llx]\n",
1205 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1205 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1206 (int) info->ecache_index, info->ecache_tag); 1206 (int) info->ecache_index, info->ecache_tag);
1207 printk("%s" "ERROR(%d): E-cache data0[%016lx] data1[%016lx] data2[%016lx] data3[%016lx]\n", 1207 printk("%s" "ERROR(%d): E-cache data0[%016llx] data1[%016llx] data2[%016llx] data3[%016llx]\n",
1208 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(), 1208 (recoverable ? KERN_WARNING : KERN_CRIT), smp_processor_id(),
1209 info->ecache_data[0], 1209 info->ecache_data[0],
1210 info->ecache_data[1], 1210 info->ecache_data[1],
@@ -1794,7 +1794,7 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
1794 int cnt; 1794 int cnt;
1795 1795
1796 printk("%s: Reporting on cpu %d\n", pfx, cpu); 1796 printk("%s: Reporting on cpu %d\n", pfx, cpu);
1797 printk("%s: err_handle[%lx] err_stick[%lx] err_type[%08x:%s]\n", 1797 printk("%s: err_handle[%llx] err_stick[%llx] err_type[%08x:%s]\n",
1798 pfx, 1798 pfx,
1799 ent->err_handle, ent->err_stick, 1799 ent->err_handle, ent->err_stick,
1800 ent->err_type, 1800 ent->err_type,
@@ -1818,7 +1818,7 @@ static void sun4v_log_error(struct pt_regs *regs, struct sun4v_error_entry *ent,
1818 "privileged" : ""), 1818 "privileged" : ""),
1819 ((ent->err_attrs & SUN4V_ERR_ATTRS_RES_QUEUE_FULL) ? 1819 ((ent->err_attrs & SUN4V_ERR_ATTRS_RES_QUEUE_FULL) ?
1820 "queue-full" : "")); 1820 "queue-full" : ""));
1821 printk("%s: err_raddr[%016lx] err_size[%u] err_cpu[%u]\n", 1821 printk("%s: err_raddr[%016llx] err_size[%u] err_cpu[%u]\n",
1822 pfx, 1822 pfx,
1823 ent->err_raddr, ent->err_size, ent->err_cpu); 1823 ent->err_raddr, ent->err_size, ent->err_cpu);
1824 1824
diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c
index c2a28c5ad65..6b1e6cde6ff 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 203ddfad9f2..f164d5a850f 100644
--- a/arch/sparc/kernel/unaligned_64.c
+++ b/arch/sparc/kernel/unaligned_64.c
@@ -601,11 +601,15 @@ void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
601 pc = (u32)pc; 601 pc = (u32)pc;
602 if (get_user(insn, (u32 __user *) pc) != -EFAULT) { 602 if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
603 int asi = decode_asi(insn, regs); 603 int asi = decode_asi(insn, regs);
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 err = get_user(first, (u32 __user *)sfar);
608 get_user(second, (u32 __user *)(sfar + 4))) { 610 if (!err)
611 err = get_user(second, (u32 __user *)(sfar + 4));
612 if (err) {
609 if (asi & 0x2) /* NF */ { 613 if (asi & 0x2) /* NF */ {
610 first = 0; second = 0; 614 first = 0; second = 0;
611 } else 615 } else
diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
index 92b1f8ec01d..753d128ed15 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 708fa1705fb..aa6ac70d4fd 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 9cc93eaa4ab..f24d298bda2 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/mm/fault_32.c b/arch/sparc/mm/fault_32.c
index a507e117466..12e447fc854 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/init_64.c b/arch/sparc/mm/init_64.c
index 6ea73da2931..c77c7ef5d5d 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -258,21 +258,16 @@ static inline void tsb_insert(struct tsb *ent, unsigned long tag, unsigned long
258unsigned long _PAGE_ALL_SZ_BITS __read_mostly; 258unsigned long _PAGE_ALL_SZ_BITS __read_mostly;
259unsigned long _PAGE_SZBITS __read_mostly; 259unsigned long _PAGE_SZBITS __read_mostly;
260 260
261void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) 261static void flush_dcache(unsigned long pfn)
262{ 262{
263 struct mm_struct *mm; 263 struct page *page;
264 struct tsb *tsb;
265 unsigned long tag, flags;
266 unsigned long tsb_index, tsb_hash_shift;
267 264
268 if (tlb_type != hypervisor) { 265 page = pfn_to_page(pfn);
269 unsigned long pfn = pte_pfn(pte); 266 if (page && page_mapping(page)) {
270 unsigned long pg_flags; 267 unsigned long pg_flags;
271 struct page *page;
272 268
273 if (pfn_valid(pfn) && 269 pg_flags = page->flags;
274 (page = pfn_to_page(pfn), page_mapping(page)) && 270 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) & 271 int cpu = ((pg_flags >> PG_dcache_cpu_shift) &
277 PG_dcache_cpu_mask); 272 PG_dcache_cpu_mask);
278 int this_cpu = get_cpu(); 273 int this_cpu = get_cpu();
@@ -290,6 +285,21 @@ void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t p
290 put_cpu(); 285 put_cpu();
291 } 286 }
292 } 287 }
288}
289
290void update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte)
291{
292 struct mm_struct *mm;
293 struct tsb *tsb;
294 unsigned long tag, flags;
295 unsigned long tsb_index, tsb_hash_shift;
296
297 if (tlb_type != hypervisor) {
298 unsigned long pfn = pte_pfn(pte);
299
300 if (pfn_valid(pfn))
301 flush_dcache(pfn);
302 }
293 303
294 mm = vma->vm_mm; 304 mm = vma->vm_mm;
295 305
@@ -769,8 +779,8 @@ static int find_node(unsigned long addr)
769 return -1; 779 return -1;
770} 780}
771 781
772static unsigned long nid_range(unsigned long start, unsigned long end, 782static unsigned long long nid_range(unsigned long long start,
773 int *nid) 783 unsigned long long end, int *nid)
774{ 784{
775 *nid = find_node(start); 785 *nid = find_node(start);
776 start += PAGE_SIZE; 786 start += PAGE_SIZE;
@@ -788,8 +798,8 @@ static unsigned long nid_range(unsigned long start, unsigned long end,
788 return start; 798 return start;
789} 799}
790#else 800#else
791static unsigned long nid_range(unsigned long start, unsigned long end, 801static unsigned long long nid_range(unsigned long long start,
792 int *nid) 802 unsigned long long end, int *nid)
793{ 803{
794 *nid = 0; 804 *nid = 0;
795 return end; 805 return end;
@@ -1016,8 +1026,8 @@ static int __init grab_mlgroups(struct mdesc_handle *md)
1016 val = mdesc_get_property(md, node, "address-mask", NULL); 1026 val = mdesc_get_property(md, node, "address-mask", NULL);
1017 m->mask = *val; 1027 m->mask = *val;
1018 1028
1019 numadbg("MLGROUP[%d]: node[%lx] latency[%lx] " 1029 numadbg("MLGROUP[%d]: node[%llx] latency[%llx] "
1020 "match[%lx] mask[%lx]\n", 1030 "match[%llx] mask[%llx]\n",
1021 count - 1, m->node, m->latency, m->match, m->mask); 1031 count - 1, m->node, m->latency, m->match, m->mask);
1022 } 1032 }
1023 1033
@@ -1056,7 +1066,7 @@ static int __init grab_mblocks(struct mdesc_handle *md)
1056 "address-congruence-offset", NULL); 1066 "address-congruence-offset", NULL);
1057 m->offset = *val; 1067 m->offset = *val;
1058 1068
1059 numadbg("MBLOCK[%d]: base[%lx] size[%lx] offset[%lx]\n", 1069 numadbg("MBLOCK[%d]: base[%llx] size[%llx] offset[%llx]\n",
1060 count - 1, m->base, m->size, m->offset); 1070 count - 1, m->base, m->size, m->offset);
1061 } 1071 }
1062 1072
@@ -1127,7 +1137,7 @@ static int __init numa_attach_mlgroup(struct mdesc_handle *md, u64 grp,
1127 n->mask = candidate->mask; 1137 n->mask = candidate->mask;
1128 n->val = candidate->match; 1138 n->val = candidate->match;
1129 1139
1130 numadbg("NUMA NODE[%d]: mask[%lx] val[%lx] (latency[%lx])\n", 1140 numadbg("NUMA NODE[%d]: mask[%lx] val[%lx] (latency[%llx])\n",
1131 index, n->mask, n->val, candidate->latency); 1141 index, n->mask, n->val, candidate->latency);
1132 1142
1133 return 0; 1143 return 0;
diff --git a/arch/um/Makefile b/arch/um/Makefile
index d944c343acd..0728def3223 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 ae5f94d6317..753346e2cdf 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 04577214284..98351c78bc8 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 47f04f4a346..b13a87a3ec9 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 44e49041949..7384d8accfe 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 0f44add3e0b..862adb9bf0d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -586,6 +586,16 @@ config AMD_IOMMU
586 your BIOS for an option to enable it or if you have an IVRS ACPI 586 your BIOS for an option to enable it or if you have an IVRS ACPI
587 table. 587 table.
588 588
589config AMD_IOMMU_STATS
590 bool "Export AMD IOMMU statistics to debugfs"
591 depends on AMD_IOMMU
592 select DEBUG_FS
593 help
594 This option enables code in the AMD IOMMU driver to collect various
595 statistics about whats happening in the driver and exports that
596 information to userspace via debugfs.
597 If unsure, say N.
598
589# need this always selected by IOMMU for the VIA workaround 599# need this always selected by IOMMU for the VIA workaround
590config SWIOTLB 600config SWIOTLB
591 def_bool y if X86_64 601 def_bool y if X86_64
@@ -599,21 +609,25 @@ config SWIOTLB
599config IOMMU_HELPER 609config IOMMU_HELPER
600 def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU) 610 def_bool (CALGARY_IOMMU || GART_IOMMU || SWIOTLB || AMD_IOMMU)
601 611
612config IOMMU_API
613 def_bool (AMD_IOMMU || DMAR)
614
602config MAXSMP 615config MAXSMP
603 bool "Configure Maximum number of SMP Processors and NUMA Nodes" 616 bool "Configure Maximum number of SMP Processors and NUMA Nodes"
604 depends on X86_64 && SMP && BROKEN 617 depends on X86_64 && SMP && DEBUG_KERNEL && EXPERIMENTAL
618 select CPUMASK_OFFSTACK
605 default n 619 default n
606 help 620 help
607 Configure maximum number of CPUS and NUMA Nodes for this architecture. 621 Configure maximum number of CPUS and NUMA Nodes for this architecture.
608 If unsure, say N. 622 If unsure, say N.
609 623
610config NR_CPUS 624config NR_CPUS
611 int "Maximum number of CPUs (2-512)" if !MAXSMP 625 int "Maximum number of CPUs" if SMP && !MAXSMP
612 range 2 512 626 range 2 512 if SMP && !MAXSMP
613 depends on SMP 627 default "1" if !SMP
614 default "4096" if MAXSMP 628 default "4096" if MAXSMP
615 default "32" if X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000 629 default "32" if SMP && (X86_NUMAQ || X86_SUMMIT || X86_BIGSMP || X86_ES7000)
616 default "8" 630 default "8" if SMP
617 help 631 help
618 This allows you to specify the maximum number of CPUs which this 632 This allows you to specify the maximum number of CPUs which this
619 kernel will support. The maximum supported value is 512 and the 633 kernel will support. The maximum supported value is 512 and the
diff --git a/arch/x86/Kconfig.cpu b/arch/x86/Kconfig.cpu
index 85a78575956..8078955845a 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 b195f85526e..9dabd00e980 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 d21991ce606..29cdcd02ead 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 2e09dcd3c0a..6c0d7f6231a 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 4a8e80cdcfa..a9f8a814a1f 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 ac302a2fa33..95c8cd9d22b 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 25caa0738af..ab1d51a8855 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 ad5b9f6ecdd..85b46fba422 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 279d2a731f3..8c21731984d 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 ce547f24a1c..d8dd9f53791 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 9404c535b7e..27fcd01b3ae 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/byteorder.h b/arch/x86/include/asm/byteorder.h
index f110ad417df..7c49917e3d9 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 e6b82b17b07..dc27705f544 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 a2e545c91c3..ca5ffb2856b 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 e24ef876915..bc53d5ef138 100644
--- a/arch/x86/include/asm/es7000/apic.h
+++ b/arch/x86/include/asm/es7000/apic.h
@@ -9,14 +9,14 @@ static inline int apic_id_registered(void)
9 return (1); 9 return (1);
10} 10}
11 11
12static inline cpumask_t target_cpus_cluster(void) 12static inline const cpumask_t *target_cpus_cluster(void)
13{ 13{
14 return CPU_MASK_ALL; 14 return &CPU_MASK_ALL;
15} 15}
16 16
17static inline cpumask_t target_cpus(void) 17static inline const cpumask_t *target_cpus(void)
18{ 18{
19 return cpumask_of_cpu(smp_processor_id()); 19 return &cpumask_of_cpu(smp_processor_id());
20} 20}
21 21
22#define APIC_DFR_VALUE_CLUSTER (APIC_DFR_CLUSTER) 22#define APIC_DFR_VALUE_CLUSTER (APIC_DFR_CLUSTER)
@@ -80,9 +80,10 @@ extern int apic_version [MAX_APICS];
80static inline void setup_apic_routing(void) 80static inline void setup_apic_routing(void)
81{ 81{
82 int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id()); 82 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", 83 printk("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n",
84 (apic_version[apic] == 0x14) ? 84 (apic_version[apic] == 0x14) ?
85 "Physical Cluster" : "Logical Cluster", nr_ioapics, cpus_addr(target_cpus())[0]); 85 "Physical Cluster" : "Logical Cluster",
86 nr_ioapics, cpus_addr(*target_cpus())[0]);
86} 87}
87 88
88static inline int multi_timer_check(int apic, int irq) 89static inline int multi_timer_check(int apic, int irq)
@@ -100,7 +101,7 @@ static inline int cpu_present_to_apicid(int mps_cpu)
100{ 101{
101 if (!mps_cpu) 102 if (!mps_cpu)
102 return boot_cpu_physical_apicid; 103 return boot_cpu_physical_apicid;
103 else if (mps_cpu < NR_CPUS) 104 else if (mps_cpu < nr_cpu_ids)
104 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu); 105 return (int) per_cpu(x86_bios_cpu_apicid, mps_cpu);
105 else 106 else
106 return BAD_APICID; 107 return BAD_APICID;
@@ -120,9 +121,9 @@ extern u8 cpu_2_logical_apicid[];
120static inline int cpu_to_logical_apicid(int cpu) 121static inline int cpu_to_logical_apicid(int cpu)
121{ 122{
122#ifdef CONFIG_SMP 123#ifdef CONFIG_SMP
123 if (cpu >= NR_CPUS) 124 if (cpu >= nr_cpu_ids)
124 return BAD_APICID; 125 return BAD_APICID;
125 return (int)cpu_2_logical_apicid[cpu]; 126 return (int)cpu_2_logical_apicid[cpu];
126#else 127#else
127 return logical_smp_processor_id(); 128 return logical_smp_processor_id();
128#endif 129#endif
@@ -146,25 +147,26 @@ static inline int check_phys_apicid_present(int cpu_physical_apicid)
146 return (1); 147 return (1);
147} 148}
148 149
149static inline unsigned int cpu_mask_to_apicid_cluster(cpumask_t cpumask) 150static inline unsigned int
151cpu_mask_to_apicid_cluster(const struct cpumask *cpumask)
150{ 152{
151 int num_bits_set; 153 int num_bits_set;
152 int cpus_found = 0; 154 int cpus_found = 0;
153 int cpu; 155 int cpu;
154 int apicid; 156 int apicid;
155 157
156 num_bits_set = cpus_weight(cpumask); 158 num_bits_set = cpumask_weight(cpumask);
157 /* Return id to all */ 159 /* Return id to all */
158 if (num_bits_set == NR_CPUS) 160 if (num_bits_set == nr_cpu_ids)
159 return 0xFF; 161 return 0xFF;
160 /* 162 /*
161 * The cpus in the mask must all be on the apic cluster. If are not 163 * 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. 164 * on the same apicid cluster return default value of TARGET_CPUS.
163 */ 165 */
164 cpu = first_cpu(cpumask); 166 cpu = cpumask_first(cpumask);
165 apicid = cpu_to_logical_apicid(cpu); 167 apicid = cpu_to_logical_apicid(cpu);
166 while (cpus_found < num_bits_set) { 168 while (cpus_found < num_bits_set) {
167 if (cpu_isset(cpu, cpumask)) { 169 if (cpumask_test_cpu(cpu, cpumask)) {
168 int new_apicid = cpu_to_logical_apicid(cpu); 170 int new_apicid = cpu_to_logical_apicid(cpu);
169 if (apicid_cluster(apicid) != 171 if (apicid_cluster(apicid) !=
170 apicid_cluster(new_apicid)){ 172 apicid_cluster(new_apicid)){
@@ -179,25 +181,25 @@ static inline unsigned int cpu_mask_to_apicid_cluster(cpumask_t cpumask)
179 return apicid; 181 return apicid;
180} 182}
181 183
182static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) 184static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
183{ 185{
184 int num_bits_set; 186 int num_bits_set;
185 int cpus_found = 0; 187 int cpus_found = 0;
186 int cpu; 188 int cpu;
187 int apicid; 189 int apicid;
188 190
189 num_bits_set = cpus_weight(cpumask); 191 num_bits_set = cpus_weight(*cpumask);
190 /* Return id to all */ 192 /* Return id to all */
191 if (num_bits_set == NR_CPUS) 193 if (num_bits_set == nr_cpu_ids)
192 return cpu_to_logical_apicid(0); 194 return cpu_to_logical_apicid(0);
193 /* 195 /*
194 * The cpus in the mask must all be on the apic cluster. If are not 196 * 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. 197 * on the same apicid cluster return default value of TARGET_CPUS.
196 */ 198 */
197 cpu = first_cpu(cpumask); 199 cpu = first_cpu(*cpumask);
198 apicid = cpu_to_logical_apicid(cpu); 200 apicid = cpu_to_logical_apicid(cpu);
199 while (cpus_found < num_bits_set) { 201 while (cpus_found < num_bits_set) {
200 if (cpu_isset(cpu, cpumask)) { 202 if (cpu_isset(cpu, *cpumask)) {
201 int new_apicid = cpu_to_logical_apicid(cpu); 203 int new_apicid = cpu_to_logical_apicid(cpu);
202 if (apicid_cluster(apicid) != 204 if (apicid_cluster(apicid) !=
203 apicid_cluster(new_apicid)){ 205 apicid_cluster(new_apicid)){
@@ -212,6 +214,24 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
212 return apicid; 214 return apicid;
213} 215}
214 216
217
218static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
219 const struct cpumask *andmask)
220{
221 int apicid = cpu_to_logical_apicid(0);
222 cpumask_var_t cpumask;
223
224 if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
225 return apicid;
226
227 cpumask_and(cpumask, inmask, andmask);
228 cpumask_and(cpumask, cpumask, cpu_online_mask);
229 apicid = cpu_mask_to_apicid(cpumask);
230
231 free_cpumask_var(cpumask);
232 return apicid;
233}
234
215static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) 235static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb)
216{ 236{
217 return cpuid_apic >> index_msb; 237 return cpuid_apic >> index_msb;
diff --git a/arch/x86/include/asm/es7000/ipi.h b/arch/x86/include/asm/es7000/ipi.h
index 632a955fcc0..7e8ed24d4b8 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/genapic_32.h b/arch/x86/include/asm/genapic_32.h
index 0ac17d33a8c..746f37a7963 100644
--- a/arch/x86/include/asm/genapic_32.h
+++ b/arch/x86/include/asm/genapic_32.h
@@ -24,7 +24,7 @@ struct genapic {
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;
@@ -57,12 +57,16 @@ struct genapic {
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 2cae011668b..adf32fb56aa 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 f89dffb28aa..c745a306f7d 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 28e409fc73f..592688ed04d 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 8346be87cfa..730843d1d2f 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 25179a29f20..6a159732881 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 d28a507cef3..1caf57628b9 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 6cb3a467e06..cc09cbbee27 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 fabca01ebac..191312d155d 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-generic/mach_apic.h b/arch/x86/include/asm/mach-generic/mach_apic.h
index e430f47df66..48553e958ad 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/mpspec.h b/arch/x86/include/asm/mpspec.h
index 91885c28f66..62d14ce3cd0 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/mtrr.h b/arch/x86/include/asm/mtrr.h
index 7c1e4258b31..cb988aab716 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 0bf2a06b7a4..bf37bc49bd8 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 935588d286c..a8374c65277 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/pci.h b/arch/x86/include/asm/pci.h
index 66834c41c04..a977de23cb4 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 1959018aac0..e60fd3e14bd 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/smp.h b/arch/x86/include/asm/smp.h
index d12811ce51d..830b9fcb642 100644
--- a/arch/x86/include/asm/smp.h
+++ b/arch/x86/include/asm/smp.h
@@ -60,7 +60,7 @@ struct smp_ops {
60 void (*cpu_die)(unsigned int cpu); 60 void (*cpu_die)(unsigned int cpu);
61 void (*play_dead)(void); 61 void (*play_dead)(void);
62 62
63 void (*send_call_func_ipi)(cpumask_t mask); 63 void (*send_call_func_ipi)(const struct cpumask *mask);
64 void (*send_call_func_single_ipi)(int cpu); 64 void (*send_call_func_single_ipi)(int cpu);
65}; 65};
66 66
@@ -125,7 +125,7 @@ static inline void arch_send_call_function_single_ipi(int cpu)
125 125
126static inline void arch_send_call_function_ipi(cpumask_t mask) 126static inline void arch_send_call_function_ipi(cpumask_t mask)
127{ 127{
128 smp_ops.send_call_func_ipi(mask); 128 smp_ops.send_call_func_ipi(&mask);
129} 129}
130 130
131void cpu_disable_common(void); 131void cpu_disable_common(void);
@@ -138,7 +138,7 @@ void native_cpu_die(unsigned int cpu);
138void native_play_dead(void); 138void native_play_dead(void);
139void play_dead_common(void); 139void play_dead_common(void);
140 140
141void native_send_call_func_ipi(cpumask_t mask); 141void native_send_call_func_ipi(const struct cpumask *mask);
142void native_send_call_func_single_ipi(int cpu); 142void native_send_call_func_single_ipi(int cpu);
143 143
144extern void prefill_possible_map(void); 144extern void prefill_possible_map(void);
diff --git a/arch/x86/include/asm/summit/apic.h b/arch/x86/include/asm/summit/apic.h
index 9b3070f1c2a..4bb5fb34f03 100644
--- a/arch/x86/include/asm/summit/apic.h
+++ b/arch/x86/include/asm/summit/apic.h
@@ -14,13 +14,13 @@
14 14
15#define APIC_DFR_VALUE (APIC_DFR_CLUSTER) 15#define APIC_DFR_VALUE (APIC_DFR_CLUSTER)
16 16
17static inline cpumask_t target_cpus(void) 17static inline const cpumask_t *target_cpus(void)
18{ 18{
19 /* CPU_MASK_ALL (0xff) has undefined behaviour with 19 /* CPU_MASK_ALL (0xff) has undefined behaviour with
20 * dest_LowestPrio mode logical clustered apic interrupt routing 20 * dest_LowestPrio mode logical clustered apic interrupt routing
21 * Just start on cpu 0. IRQ balancing will spread load 21 * Just start on cpu 0. IRQ balancing will spread load
22 */ 22 */
23 return cpumask_of_cpu(0); 23 return &cpumask_of_cpu(0);
24} 24}
25 25
26#define INT_DELIVERY_MODE (dest_LowestPrio) 26#define INT_DELIVERY_MODE (dest_LowestPrio)
@@ -52,7 +52,7 @@ static inline void init_apic_ldr(void)
52 int i; 52 int i;
53 53
54 /* Create logical APIC IDs by counting CPUs already in cluster. */ 54 /* Create logical APIC IDs by counting CPUs already in cluster. */
55 for (count = 0, i = NR_CPUS; --i >= 0; ) { 55 for (count = 0, i = nr_cpu_ids; --i >= 0; ) {
56 lid = cpu_2_logical_apicid[i]; 56 lid = cpu_2_logical_apicid[i];
57 if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster) 57 if (lid != BAD_APICID && apicid_cluster(lid) == my_cluster)
58 ++count; 58 ++count;
@@ -97,8 +97,8 @@ static inline int apicid_to_node(int logical_apicid)
97static inline int cpu_to_logical_apicid(int cpu) 97static inline int cpu_to_logical_apicid(int cpu)
98{ 98{
99#ifdef CONFIG_SMP 99#ifdef CONFIG_SMP
100 if (cpu >= NR_CPUS) 100 if (cpu >= nr_cpu_ids)
101 return BAD_APICID; 101 return BAD_APICID;
102 return (int)cpu_2_logical_apicid[cpu]; 102 return (int)cpu_2_logical_apicid[cpu];
103#else 103#else
104 return logical_smp_processor_id(); 104 return logical_smp_processor_id();
@@ -107,7 +107,7 @@ static inline int cpu_to_logical_apicid(int cpu)
107 107
108static inline int cpu_present_to_apicid(int mps_cpu) 108static inline int cpu_present_to_apicid(int mps_cpu)
109{ 109{
110 if (mps_cpu < NR_CPUS) 110 if (mps_cpu < nr_cpu_ids)
111 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu); 111 return (int)per_cpu(x86_bios_cpu_apicid, mps_cpu);
112 else 112 else
113 return BAD_APICID; 113 return BAD_APICID;
@@ -137,25 +137,25 @@ static inline void enable_apic_mode(void)
137{ 137{
138} 138}
139 139
140static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) 140static inline unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
141{ 141{
142 int num_bits_set; 142 int num_bits_set;
143 int cpus_found = 0; 143 int cpus_found = 0;
144 int cpu; 144 int cpu;
145 int apicid; 145 int apicid;
146 146
147 num_bits_set = cpus_weight(cpumask); 147 num_bits_set = cpus_weight(*cpumask);
148 /* Return id to all */ 148 /* Return id to all */
149 if (num_bits_set == NR_CPUS) 149 if (num_bits_set >= nr_cpu_ids)
150 return (int) 0xFF; 150 return (int) 0xFF;
151 /* 151 /*
152 * The cpus in the mask must all be on the apic cluster. If are not 152 * 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. 153 * on the same apicid cluster return default value of TARGET_CPUS.
154 */ 154 */
155 cpu = first_cpu(cpumask); 155 cpu = first_cpu(*cpumask);
156 apicid = cpu_to_logical_apicid(cpu); 156 apicid = cpu_to_logical_apicid(cpu);
157 while (cpus_found < num_bits_set) { 157 while (cpus_found < num_bits_set) {
158 if (cpu_isset(cpu, cpumask)) { 158 if (cpu_isset(cpu, *cpumask)) {
159 int new_apicid = cpu_to_logical_apicid(cpu); 159 int new_apicid = cpu_to_logical_apicid(cpu);
160 if (apicid_cluster(apicid) != 160 if (apicid_cluster(apicid) !=
161 apicid_cluster(new_apicid)){ 161 apicid_cluster(new_apicid)){
@@ -170,6 +170,23 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask)
170 return apicid; 170 return apicid;
171} 171}
172 172
173static inline unsigned int cpu_mask_to_apicid_and(const struct cpumask *inmask,
174 const struct cpumask *andmask)
175{
176 int apicid = cpu_to_logical_apicid(0);
177 cpumask_var_t cpumask;
178
179 if (!alloc_cpumask_var(&cpumask, GFP_ATOMIC))
180 return apicid;
181
182 cpumask_and(cpumask, inmask, andmask);
183 cpumask_and(cpumask, cpumask, cpu_online_mask);
184 apicid = cpu_mask_to_apicid(cpumask);
185
186 free_cpumask_var(cpumask);
187 return apicid;
188}
189
173/* cpuid returns the value latched in the HW at reset, not the APIC ID 190/* 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 191 * register's value. For any box whose BIOS changes APIC IDs, like
175 * clustered APIC systems, we must use hard_smp_processor_id. 192 * 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 53bd1e7bd7b..a8a2c24f50c 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/kvm/svm.h b/arch/x86/include/asm/svm.h
index 1b8afa78e86..1b8afa78e86 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 00000000000..306d4178ffc
--- /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 51fb2c76ad7..b9e4e20174f 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 00000000000..ffb08be2a53
--- /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 ff386ff50ed..4e2f2e0aab2 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 8b064bd9c55..00000000000
--- 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 e2363253bbb..50423c7b56b 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 00000000000..59363627523
--- /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 ec5edc339da..d0238e6151d 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 65d0b72777e..29dc0c89d4a 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -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);
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index 2e2da717b35..5113c080f0c 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 c625800c55c..42c33cebf00 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 b5229affb95..b13d3c4dbd4 100644
--- a/arch/x86/kernel/apic.c
+++ b/arch/x86/kernel/apic.c
@@ -98,8 +98,8 @@ __setup("apicpmtimer", setup_apicpmtimer);
98#ifdef HAVE_X2APIC 98#ifdef HAVE_X2APIC
99int x2apic; 99int x2apic;
100/* x2apic enabled before OS handover */ 100/* x2apic enabled before OS handover */
101int x2apic_preenabled; 101static int x2apic_preenabled;
102int disable_x2apic; 102static int disable_x2apic;
103static __init int setup_nox2apic(char *str) 103static __init int setup_nox2apic(char *str)
104{ 104{
105 disable_x2apic = 1; 105 disable_x2apic = 1;
@@ -119,8 +119,6 @@ EXPORT_SYMBOL_GPL(local_apic_timer_c2_ok);
119 119
120int first_system_vector = 0xfe; 120int first_system_vector = 0xfe;
121 121
122char system_vectors[NR_VECTORS] = { [0 ... NR_VECTORS-1] = SYS_VECTOR_FREE};
123
124/* 122/*
125 * Debug level, exported for io_apic.c 123 * Debug level, exported for io_apic.c
126 */ 124 */
@@ -142,7 +140,7 @@ static int lapic_next_event(unsigned long delta,
142 struct clock_event_device *evt); 140 struct clock_event_device *evt);
143static void lapic_timer_setup(enum clock_event_mode mode, 141static void lapic_timer_setup(enum clock_event_mode mode,
144 struct clock_event_device *evt); 142 struct clock_event_device *evt);
145static void lapic_timer_broadcast(cpumask_t mask); 143static void lapic_timer_broadcast(const struct cpumask *mask);
146static void apic_pm_activate(void); 144static void apic_pm_activate(void);
147 145
148/* 146/*
@@ -228,7 +226,7 @@ void xapic_icr_write(u32 low, u32 id)
228 apic_write(APIC_ICR, low); 226 apic_write(APIC_ICR, low);
229} 227}
230 228
231u64 xapic_icr_read(void) 229static u64 xapic_icr_read(void)
232{ 230{
233 u32 icr1, icr2; 231 u32 icr1, icr2;
234 232
@@ -268,7 +266,7 @@ void x2apic_icr_write(u32 low, u32 id)
268 wrmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), ((__u64) id) << 32 | low); 266 wrmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), ((__u64) id) << 32 | low);
269} 267}
270 268
271u64 x2apic_icr_read(void) 269static u64 x2apic_icr_read(void)
272{ 270{
273 unsigned long val; 271 unsigned long val;
274 272
@@ -455,7 +453,7 @@ static void lapic_timer_setup(enum clock_event_mode mode,
455/* 453/*
456 * Local APIC timer broadcast function 454 * Local APIC timer broadcast function
457 */ 455 */
458static void lapic_timer_broadcast(cpumask_t mask) 456static void lapic_timer_broadcast(const struct cpumask *mask)
459{ 457{
460#ifdef CONFIG_SMP 458#ifdef CONFIG_SMP
461 send_IPI_mask(mask, LOCAL_TIMER_VECTOR); 459 send_IPI_mask(mask, LOCAL_TIMER_VECTOR);
@@ -471,7 +469,7 @@ static void __cpuinit setup_APIC_timer(void)
471 struct clock_event_device *levt = &__get_cpu_var(lapic_events); 469 struct clock_event_device *levt = &__get_cpu_var(lapic_events);
472 470
473 memcpy(levt, &lapic_clockevent, sizeof(*levt)); 471 memcpy(levt, &lapic_clockevent, sizeof(*levt));
474 levt->cpumask = cpumask_of_cpu(smp_processor_id()); 472 levt->cpumask = cpumask_of(smp_processor_id());
475 473
476 clockevents_register_device(levt); 474 clockevents_register_device(levt);
477} 475}
@@ -1807,28 +1805,32 @@ void disconnect_bsp_APIC(int virt_wire_setup)
1807void __cpuinit generic_processor_info(int apicid, int version) 1805void __cpuinit generic_processor_info(int apicid, int version)
1808{ 1806{
1809 int cpu; 1807 int cpu;
1810 cpumask_t tmp_map;
1811 1808
1812 /* 1809 /*
1813 * Validate version 1810 * Validate version
1814 */ 1811 */
1815 if (version == 0x0) { 1812 if (version == 0x0) {
1816 pr_warning("BIOS bug, APIC version is 0 for CPU#%d! " 1813 pr_warning("BIOS bug, APIC version is 0 for CPU#%d! "
1817 "fixing up to 0x10. (tell your hw vendor)\n", 1814 "fixing up to 0x10. (tell your hw vendor)\n",
1818 version); 1815 version);
1819 version = 0x10; 1816 version = 0x10;
1820 } 1817 }
1821 apic_version[apicid] = version; 1818 apic_version[apicid] = version;
1822 1819
1823 if (num_processors >= NR_CPUS) { 1820 if (num_processors >= nr_cpu_ids) {
1824 pr_warning("WARNING: NR_CPUS limit of %i reached." 1821 int max = nr_cpu_ids;
1825 " Processor ignored.\n", NR_CPUS); 1822 int thiscpu = max + disabled_cpus;
1823
1824 pr_warning(
1825 "ACPI: NR_CPUS/possible_cpus limit of %i reached."
1826 " Processor %d/0x%x ignored.\n", max, thiscpu, apicid);
1827
1828 disabled_cpus++;
1826 return; 1829 return;
1827 } 1830 }
1828 1831
1829 num_processors++; 1832 num_processors++;
1830 cpus_complement(tmp_map, cpu_present_map); 1833 cpu = cpumask_next_zero(-1, cpu_present_mask);
1831 cpu = first_cpu(tmp_map);
1832 1834
1833 physid_set(apicid, phys_cpu_present_map); 1835 physid_set(apicid, phys_cpu_present_map);
1834 if (apicid == boot_cpu_physical_apicid) { 1836 if (apicid == boot_cpu_physical_apicid) {
@@ -1878,8 +1880,8 @@ void __cpuinit generic_processor_info(int apicid, int version)
1878 } 1880 }
1879#endif 1881#endif
1880 1882
1881 cpu_set(cpu, cpu_possible_map); 1883 set_cpu_possible(cpu, true);
1882 cpu_set(cpu, cpu_present_map); 1884 set_cpu_present(cpu, true);
1883} 1885}
1884 1886
1885#ifdef CONFIG_X86_64 1887#ifdef CONFIG_X86_64
@@ -2081,7 +2083,7 @@ __cpuinit int apic_is_clustered_box(void)
2081 bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid); 2083 bios_cpu_apicid = early_per_cpu_ptr(x86_bios_cpu_apicid);
2082 bitmap_zero(clustermap, NUM_APIC_CLUSTERS); 2084 bitmap_zero(clustermap, NUM_APIC_CLUSTERS);
2083 2085
2084 for (i = 0; i < NR_CPUS; i++) { 2086 for (i = 0; i < nr_cpu_ids; i++) {
2085 /* are we being called early in kernel startup? */ 2087 /* are we being called early in kernel startup? */
2086 if (bios_cpu_apicid) { 2088 if (bios_cpu_apicid) {
2087 id = bios_cpu_apicid[i]; 2089 id = bios_cpu_apicid[i];
diff --git a/arch/x86/kernel/bios_uv.c b/arch/x86/kernel/bios_uv.c
index 2a0a2a3cac2..f63882728d9 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 42e0853030c..3f95a40f718 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -355,7 +355,7 @@ void __cpuinit detect_ht(struct cpuinfo_x86 *c)
355 printk(KERN_INFO "CPU: Hyper-Threading is disabled\n"); 355 printk(KERN_INFO "CPU: Hyper-Threading is disabled\n");
356 } else if (smp_num_siblings > 1) { 356 } else if (smp_num_siblings > 1) {
357 357
358 if (smp_num_siblings > NR_CPUS) { 358 if (smp_num_siblings > nr_cpu_ids) {
359 printk(KERN_WARNING "CPU: Unsupported number of siblings %d", 359 printk(KERN_WARNING "CPU: Unsupported number of siblings %d",
360 smp_num_siblings); 360 smp_num_siblings);
361 smp_num_siblings = 1; 361 smp_num_siblings = 1;
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
index 88ea02dcb62..28102ad1a36 100644
--- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -517,6 +517,17 @@ acpi_cpufreq_guess_freq(struct acpi_cpufreq_data *data, unsigned int cpu)
517 } 517 }
518} 518}
519 519
520static void free_acpi_perf_data(void)
521{
522 unsigned int i;
523
524 /* Freeing a NULL pointer is OK, and alloc_percpu zeroes. */
525 for_each_possible_cpu(i)
526 free_cpumask_var(per_cpu_ptr(acpi_perf_data, i)
527 ->shared_cpu_map);
528 free_percpu(acpi_perf_data);
529}
530
520/* 531/*
521 * acpi_cpufreq_early_init - initialize ACPI P-States library 532 * acpi_cpufreq_early_init - initialize ACPI P-States library
522 * 533 *
@@ -527,6 +538,7 @@ acpi_cpufreq_guess_freq(struct acpi_cpufreq_data *data, unsigned int cpu)
527 */ 538 */
528static int __init acpi_cpufreq_early_init(void) 539static int __init acpi_cpufreq_early_init(void)
529{ 540{
541 unsigned int i;
530 dprintk("acpi_cpufreq_early_init\n"); 542 dprintk("acpi_cpufreq_early_init\n");
531 543
532 acpi_perf_data = alloc_percpu(struct acpi_processor_performance); 544 acpi_perf_data = alloc_percpu(struct acpi_processor_performance);
@@ -534,6 +546,16 @@ static int __init acpi_cpufreq_early_init(void)
534 dprintk("Memory allocation error for acpi_perf_data.\n"); 546 dprintk("Memory allocation error for acpi_perf_data.\n");
535 return -ENOMEM; 547 return -ENOMEM;
536 } 548 }
549 for_each_possible_cpu(i) {
550 if (!alloc_cpumask_var_node(
551 &per_cpu_ptr(acpi_perf_data, i)->shared_cpu_map,
552 GFP_KERNEL, cpu_to_node(i))) {
553
554 /* Freeing a NULL pointer is OK: alloc_percpu zeroes. */
555 free_acpi_perf_data();
556 return -ENOMEM;
557 }
558 }
537 559
538 /* Do initialization in ACPI core */ 560 /* Do initialization in ACPI core */
539 acpi_processor_preregister_performance(acpi_perf_data); 561 acpi_processor_preregister_performance(acpi_perf_data);
@@ -604,9 +626,9 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
604 */ 626 */
605 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL || 627 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ALL ||
606 policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) { 628 policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) {
607 policy->cpus = perf->shared_cpu_map; 629 cpumask_copy(&policy->cpus, perf->shared_cpu_map);
608 } 630 }
609 policy->related_cpus = perf->shared_cpu_map; 631 cpumask_copy(&policy->related_cpus, perf->shared_cpu_map);
610 632
611#ifdef CONFIG_SMP 633#ifdef CONFIG_SMP
612 dmi_check_system(sw_any_bug_dmi_table); 634 dmi_check_system(sw_any_bug_dmi_table);
@@ -795,7 +817,7 @@ static int __init acpi_cpufreq_init(void)
795 817
796 ret = cpufreq_register_driver(&acpi_cpufreq_driver); 818 ret = cpufreq_register_driver(&acpi_cpufreq_driver);
797 if (ret) 819 if (ret)
798 free_percpu(acpi_perf_data); 820 free_acpi_perf_data();
799 821
800 return ret; 822 return ret;
801} 823}
diff --git a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
index b8e05ee4f73..beea4466b06 100644
--- a/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
+++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
@@ -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
@@ -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 7c7d56b4313..1b446d79a8f 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 7f05f44b97e..c3c9adbaa26 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
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
index 3b5f06423e7..f0ea6fa2f53 100644
--- a/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
+++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
@@ -459,9 +459,7 @@ static int centrino_verify (struct cpufreq_policy *policy)
459 * Sets a new CPUFreq policy. 459 * Sets a new CPUFreq policy.
460 */ 460 */
461struct allmasks { 461struct allmasks {
462 cpumask_t online_policy_cpus;
463 cpumask_t saved_mask; 462 cpumask_t saved_mask;
464 cpumask_t set_mask;
465 cpumask_t covered_cpus; 463 cpumask_t covered_cpus;
466}; 464};
467 465
@@ -475,9 +473,7 @@ static int centrino_target (struct cpufreq_policy *policy,
475 int retval = 0; 473 int retval = 0;
476 unsigned int j, k, first_cpu, tmp; 474 unsigned int j, k, first_cpu, tmp;
477 CPUMASK_ALLOC(allmasks); 475 CPUMASK_ALLOC(allmasks);
478 CPUMASK_PTR(online_policy_cpus, allmasks);
479 CPUMASK_PTR(saved_mask, allmasks); 476 CPUMASK_PTR(saved_mask, allmasks);
480 CPUMASK_PTR(set_mask, allmasks);
481 CPUMASK_PTR(covered_cpus, allmasks); 477 CPUMASK_PTR(covered_cpus, allmasks);
482 478
483 if (unlikely(allmasks == NULL)) 479 if (unlikely(allmasks == NULL))
@@ -497,30 +493,28 @@ static int centrino_target (struct cpufreq_policy *policy,
497 goto out; 493 goto out;
498 } 494 }
499 495
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; 496 *saved_mask = current->cpus_allowed;
508 first_cpu = 1; 497 first_cpu = 1;
509 cpus_clear(*covered_cpus); 498 cpus_clear(*covered_cpus);
510 for_each_cpu_mask_nr(j, *online_policy_cpus) { 499 for_each_cpu_mask_nr(j, policy->cpus) {
500 const cpumask_t *mask;
501
502 /* cpufreq holds the hotplug lock, so we are safe here */
503 if (!cpu_online(j))
504 continue;
505
511 /* 506 /*
512 * Support for SMP systems. 507 * Support for SMP systems.
513 * Make sure we are running on CPU that wants to change freq 508 * Make sure we are running on CPU that wants to change freq
514 */ 509 */
515 cpus_clear(*set_mask);
516 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) 510 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY)
517 cpus_or(*set_mask, *set_mask, *online_policy_cpus); 511 mask = &policy->cpus;
518 else 512 else
519 cpu_set(j, *set_mask); 513 mask = &cpumask_of_cpu(j);
520 514
521 set_cpus_allowed_ptr(current, set_mask); 515 set_cpus_allowed_ptr(current, mask);
522 preempt_disable(); 516 preempt_disable();
523 if (unlikely(!cpu_isset(smp_processor_id(), *set_mask))) { 517 if (unlikely(!cpu_isset(smp_processor_id(), *mask))) {
524 dprintk("couldn't limit to CPUs in this domain\n"); 518 dprintk("couldn't limit to CPUs in this domain\n");
525 retval = -EAGAIN; 519 retval = -EAGAIN;
526 if (first_cpu) { 520 if (first_cpu) {
@@ -548,7 +542,9 @@ static int centrino_target (struct cpufreq_policy *policy,
548 dprintk("target=%dkHz old=%d new=%d msr=%04x\n", 542 dprintk("target=%dkHz old=%d new=%d msr=%04x\n",
549 target_freq, freqs.old, freqs.new, msr); 543 target_freq, freqs.old, freqs.new, msr);
550 544
551 for_each_cpu_mask_nr(k, *online_policy_cpus) { 545 for_each_cpu_mask_nr(k, policy->cpus) {
546 if (!cpu_online(k))
547 continue;
552 freqs.cpu = k; 548 freqs.cpu = k;
553 cpufreq_notify_transition(&freqs, 549 cpufreq_notify_transition(&freqs,
554 CPUFREQ_PRECHANGE); 550 CPUFREQ_PRECHANGE);
@@ -571,7 +567,9 @@ static int centrino_target (struct cpufreq_policy *policy,
571 preempt_enable(); 567 preempt_enable();
572 } 568 }
573 569
574 for_each_cpu_mask_nr(k, *online_policy_cpus) { 570 for_each_cpu_mask_nr(k, policy->cpus) {
571 if (!cpu_online(k))
572 continue;
575 freqs.cpu = k; 573 freqs.cpu = k;
576 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 574 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
577 } 575 }
@@ -584,18 +582,17 @@ static int centrino_target (struct cpufreq_policy *policy,
584 * Best effort undo.. 582 * Best effort undo..
585 */ 583 */
586 584
587 if (!cpus_empty(*covered_cpus)) 585 for_each_cpu_mask_nr(j, *covered_cpus) {
588 for_each_cpu_mask_nr(j, *covered_cpus) { 586 set_cpus_allowed_ptr(current, &cpumask_of_cpu(j));
589 set_cpus_allowed_ptr(current, 587 wrmsr(MSR_IA32_PERF_CTL, oldmsr, h);
590 &cpumask_of_cpu(j)); 588 }
591 wrmsr(MSR_IA32_PERF_CTL, oldmsr, h);
592 }
593 589
594 tmp = freqs.new; 590 tmp = freqs.new;
595 freqs.new = freqs.old; 591 freqs.new = freqs.old;
596 freqs.old = tmp; 592 freqs.old = tmp;
597 for_each_cpu_mask_nr(j, *online_policy_cpus) { 593 for_each_cpu_mask_nr(j, policy->cpus) {
598 freqs.cpu = j; 594 if (!cpu_online(j))
595 continue;
599 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); 596 cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE);
600 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); 597 cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE);
601 } 598 }
diff --git a/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
index 98d4fdb7dc0..cdac7d62369 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 68b5d8681cb..48533d77be7 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_amd_64.c b/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
index 748c8f9e7a0..a5a5e053037 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 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/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index 4e8d77f01ee..b59ddcc88cd 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 1159e269e59..d259e5d2e05 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 2dc4ec656b2..ffd60409cc6 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 72cefd1e649..2ac1f0c2beb 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 d84a852e4cd..c689d19e35a 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/early_printk.c b/arch/x86/kernel/early_printk.c
index 23b138e31e9..504ad198e4a 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 c0262791bda..34185488e4f 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 f6a2c8eb48a..6ce497cc372 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 d042211768b..21bcc0e098b 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 dece1728973..b193e082f6c 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 388e05a5fc1..b9a4d8c4b93 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/hpet.c b/arch/x86/kernel/hpet.c
index 845ea097383..cd759ad9069 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 c1b5e3ece1f..10f92fb532f 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/io_apic.c b/arch/x86/kernel/io_apic.c
index 74917658b00..3639442aa7a 100644
--- a/arch/x86/kernel/io_apic.c
+++ b/arch/x86/kernel/io_apic.c
@@ -136,8 +136,8 @@ static struct irq_pin_list *get_one_free_irq_2_pin(int cpu)
136 136
137struct irq_cfg { 137struct irq_cfg {
138 struct irq_pin_list *irq_2_pin; 138 struct irq_pin_list *irq_2_pin;
139 cpumask_t domain; 139 cpumask_var_t domain;
140 cpumask_t old_domain; 140 cpumask_var_t old_domain;
141 unsigned move_cleanup_count; 141 unsigned move_cleanup_count;
142 u8 vector; 142 u8 vector;
143 u8 move_in_progress : 1; 143 u8 move_in_progress : 1;
@@ -152,22 +152,22 @@ static struct irq_cfg irq_cfgx[] = {
152#else 152#else
153static struct irq_cfg irq_cfgx[NR_IRQS] = { 153static struct irq_cfg irq_cfgx[NR_IRQS] = {
154#endif 154#endif
155 [0] = { .domain = CPU_MASK_ALL, .vector = IRQ0_VECTOR, }, 155 [0] = { .vector = IRQ0_VECTOR, },
156 [1] = { .domain = CPU_MASK_ALL, .vector = IRQ1_VECTOR, }, 156 [1] = { .vector = IRQ1_VECTOR, },
157 [2] = { .domain = CPU_MASK_ALL, .vector = IRQ2_VECTOR, }, 157 [2] = { .vector = IRQ2_VECTOR, },
158 [3] = { .domain = CPU_MASK_ALL, .vector = IRQ3_VECTOR, }, 158 [3] = { .vector = IRQ3_VECTOR, },
159 [4] = { .domain = CPU_MASK_ALL, .vector = IRQ4_VECTOR, }, 159 [4] = { .vector = IRQ4_VECTOR, },
160 [5] = { .domain = CPU_MASK_ALL, .vector = IRQ5_VECTOR, }, 160 [5] = { .vector = IRQ5_VECTOR, },
161 [6] = { .domain = CPU_MASK_ALL, .vector = IRQ6_VECTOR, }, 161 [6] = { .vector = IRQ6_VECTOR, },
162 [7] = { .domain = CPU_MASK_ALL, .vector = IRQ7_VECTOR, }, 162 [7] = { .vector = IRQ7_VECTOR, },
163 [8] = { .domain = CPU_MASK_ALL, .vector = IRQ8_VECTOR, }, 163 [8] = { .vector = IRQ8_VECTOR, },
164 [9] = { .domain = CPU_MASK_ALL, .vector = IRQ9_VECTOR, }, 164 [9] = { .vector = IRQ9_VECTOR, },
165 [10] = { .domain = CPU_MASK_ALL, .vector = IRQ10_VECTOR, }, 165 [10] = { .vector = IRQ10_VECTOR, },
166 [11] = { .domain = CPU_MASK_ALL, .vector = IRQ11_VECTOR, }, 166 [11] = { .vector = IRQ11_VECTOR, },
167 [12] = { .domain = CPU_MASK_ALL, .vector = IRQ12_VECTOR, }, 167 [12] = { .vector = IRQ12_VECTOR, },
168 [13] = { .domain = CPU_MASK_ALL, .vector = IRQ13_VECTOR, }, 168 [13] = { .vector = IRQ13_VECTOR, },
169 [14] = { .domain = CPU_MASK_ALL, .vector = IRQ14_VECTOR, }, 169 [14] = { .vector = IRQ14_VECTOR, },
170 [15] = { .domain = CPU_MASK_ALL, .vector = IRQ15_VECTOR, }, 170 [15] = { .vector = IRQ15_VECTOR, },
171}; 171};
172 172
173int __init arch_early_irq_init(void) 173int __init arch_early_irq_init(void)
@@ -183,6 +183,10 @@ int __init arch_early_irq_init(void)
183 for (i = 0; i < count; i++) { 183 for (i = 0; i < count; i++) {
184 desc = irq_to_desc(i); 184 desc = irq_to_desc(i);
185 desc->chip_data = &cfg[i]; 185 desc->chip_data = &cfg[i];
186 alloc_bootmem_cpumask_var(&cfg[i].domain);
187 alloc_bootmem_cpumask_var(&cfg[i].old_domain);
188 if (i < NR_IRQS_LEGACY)
189 cpumask_setall(cfg[i].domain);
186 } 190 }
187 191
188 return 0; 192 return 0;
@@ -209,6 +213,20 @@ static struct irq_cfg *get_one_free_irq_cfg(int cpu)
209 node = cpu_to_node(cpu); 213 node = cpu_to_node(cpu);
210 214
211 cfg = kzalloc_node(sizeof(*cfg), GFP_ATOMIC, node); 215 cfg = kzalloc_node(sizeof(*cfg), GFP_ATOMIC, node);
216 if (cfg) {
217 if (!alloc_cpumask_var_node(&cfg->domain, GFP_ATOMIC, node)) {
218 kfree(cfg);
219 cfg = NULL;
220 } else if (!alloc_cpumask_var_node(&cfg->old_domain,
221 GFP_ATOMIC, node)) {
222 free_cpumask_var(cfg->domain);
223 kfree(cfg);
224 cfg = NULL;
225 } else {
226 cpumask_clear(cfg->domain);
227 cpumask_clear(cfg->old_domain);
228 }
229 }
212 printk(KERN_DEBUG " alloc irq_cfg on cpu %d node %d\n", cpu, node); 230 printk(KERN_DEBUG " alloc irq_cfg on cpu %d node %d\n", cpu, node);
213 231
214 return cfg; 232 return cfg;
@@ -333,13 +351,14 @@ void arch_free_chip_data(struct irq_desc *old_desc, struct irq_desc *desc)
333 } 351 }
334} 352}
335 353
336static void set_extra_move_desc(struct irq_desc *desc, cpumask_t mask) 354static void
355set_extra_move_desc(struct irq_desc *desc, const struct cpumask *mask)
337{ 356{
338 struct irq_cfg *cfg = desc->chip_data; 357 struct irq_cfg *cfg = desc->chip_data;
339 358
340 if (!cfg->move_in_progress) { 359 if (!cfg->move_in_progress) {
341 /* it means that domain is not changed */ 360 /* it means that domain is not changed */
342 if (!cpus_intersects(desc->affinity, mask)) 361 if (!cpumask_intersects(&desc->affinity, mask))
343 cfg->move_desc_pending = 1; 362 cfg->move_desc_pending = 1;
344 } 363 }
345} 364}
@@ -354,7 +373,8 @@ static struct irq_cfg *irq_cfg(unsigned int irq)
354#endif 373#endif
355 374
356#ifndef CONFIG_NUMA_MIGRATE_IRQ_DESC 375#ifndef CONFIG_NUMA_MIGRATE_IRQ_DESC
357static inline void set_extra_move_desc(struct irq_desc *desc, cpumask_t mask) 376static inline void
377set_extra_move_desc(struct irq_desc *desc, const struct cpumask *mask)
358{ 378{
359} 379}
360#endif 380#endif
@@ -485,6 +505,26 @@ static void ioapic_mask_entry(int apic, int pin)
485} 505}
486 506
487#ifdef CONFIG_SMP 507#ifdef CONFIG_SMP
508static void send_cleanup_vector(struct irq_cfg *cfg)
509{
510 cpumask_var_t cleanup_mask;
511
512 if (unlikely(!alloc_cpumask_var(&cleanup_mask, GFP_ATOMIC))) {
513 unsigned int i;
514 cfg->move_cleanup_count = 0;
515 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
516 cfg->move_cleanup_count++;
517 for_each_cpu_and(i, cfg->old_domain, cpu_online_mask)
518 send_IPI_mask(cpumask_of(i), IRQ_MOVE_CLEANUP_VECTOR);
519 } else {
520 cpumask_and(cleanup_mask, cfg->old_domain, cpu_online_mask);
521 cfg->move_cleanup_count = cpumask_weight(cleanup_mask);
522 send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
523 free_cpumask_var(cleanup_mask);
524 }
525 cfg->move_in_progress = 0;
526}
527
488static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, struct irq_cfg *cfg) 528static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, struct irq_cfg *cfg)
489{ 529{
490 int apic, pin; 530 int apic, pin;
@@ -520,41 +560,55 @@ static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, struct irq
520 } 560 }
521} 561}
522 562
523static int assign_irq_vector(int irq, struct irq_cfg *cfg, cpumask_t mask); 563static int
564assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask);
524 565
525static void set_ioapic_affinity_irq_desc(struct irq_desc *desc, cpumask_t mask) 566/*
567 * Either sets desc->affinity to a valid value, and returns cpu_mask_to_apicid
568 * of that, or returns BAD_APICID and leaves desc->affinity untouched.
569 */
570static unsigned int
571set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask)
526{ 572{
527 struct irq_cfg *cfg; 573 struct irq_cfg *cfg;
528 unsigned long flags;
529 unsigned int dest;
530 cpumask_t tmp;
531 unsigned int irq; 574 unsigned int irq;
532 575
533 cpus_and(tmp, mask, cpu_online_map); 576 if (!cpumask_intersects(mask, cpu_online_mask))
534 if (cpus_empty(tmp)) 577 return BAD_APICID;
535 return;
536 578
537 irq = desc->irq; 579 irq = desc->irq;
538 cfg = desc->chip_data; 580 cfg = desc->chip_data;
539 if (assign_irq_vector(irq, cfg, mask)) 581 if (assign_irq_vector(irq, cfg, mask))
540 return; 582 return BAD_APICID;
541 583
584 cpumask_and(&desc->affinity, cfg->domain, mask);
542 set_extra_move_desc(desc, mask); 585 set_extra_move_desc(desc, mask);
586 return cpu_mask_to_apicid_and(&desc->affinity, cpu_online_mask);
587}
543 588
544 cpus_and(tmp, cfg->domain, mask); 589static void
545 dest = cpu_mask_to_apicid(tmp); 590set_ioapic_affinity_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
546 /* 591{
547 * Only the high 8 bits are valid. 592 struct irq_cfg *cfg;
548 */ 593 unsigned long flags;
549 dest = SET_APIC_LOGICAL_ID(dest); 594 unsigned int dest;
595 unsigned int irq;
596
597 irq = desc->irq;
598 cfg = desc->chip_data;
550 599
551 spin_lock_irqsave(&ioapic_lock, flags); 600 spin_lock_irqsave(&ioapic_lock, flags);
552 __target_IO_APIC_irq(irq, dest, cfg); 601 dest = set_desc_affinity(desc, mask);
553 desc->affinity = mask; 602 if (dest != BAD_APICID) {
603 /* Only the high 8 bits are valid. */
604 dest = SET_APIC_LOGICAL_ID(dest);
605 __target_IO_APIC_irq(irq, dest, cfg);
606 }
554 spin_unlock_irqrestore(&ioapic_lock, flags); 607 spin_unlock_irqrestore(&ioapic_lock, flags);
555} 608}
556 609
557static void set_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) 610static void
611set_ioapic_affinity_irq(unsigned int irq, const struct cpumask *mask)
558{ 612{
559 struct irq_desc *desc; 613 struct irq_desc *desc;
560 614
@@ -652,7 +706,7 @@ static void __unmask_IO_APIC_irq(struct irq_cfg *cfg)
652} 706}
653 707
654#ifdef CONFIG_X86_64 708#ifdef CONFIG_X86_64
655void io_apic_sync(struct irq_pin_list *entry) 709static void io_apic_sync(struct irq_pin_list *entry)
656{ 710{
657 /* 711 /*
658 * Synchronize the IO-APIC and the CPU by doing 712 * Synchronize the IO-APIC and the CPU by doing
@@ -1222,7 +1276,8 @@ void unlock_vector_lock(void)
1222 spin_unlock(&vector_lock); 1276 spin_unlock(&vector_lock);
1223} 1277}
1224 1278
1225static int __assign_irq_vector(int irq, struct irq_cfg *cfg, cpumask_t mask) 1279static int
1280__assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1226{ 1281{
1227 /* 1282 /*
1228 * NOTE! The local APIC isn't very good at handling 1283 * NOTE! The local APIC isn't very good at handling
@@ -1237,49 +1292,49 @@ static int __assign_irq_vector(int irq, struct irq_cfg *cfg, cpumask_t mask)
1237 */ 1292 */
1238 static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0; 1293 static int current_vector = FIRST_DEVICE_VECTOR, current_offset = 0;
1239 unsigned int old_vector; 1294 unsigned int old_vector;
1240 int cpu; 1295 int cpu, err;
1296 cpumask_var_t tmp_mask;
1241 1297
1242 if ((cfg->move_in_progress) || cfg->move_cleanup_count) 1298 if ((cfg->move_in_progress) || cfg->move_cleanup_count)
1243 return -EBUSY; 1299 return -EBUSY;
1244 1300
1245 /* Only try and allocate irqs on cpus that are present */ 1301 if (!alloc_cpumask_var(&tmp_mask, GFP_ATOMIC))
1246 cpus_and(mask, mask, cpu_online_map); 1302 return -ENOMEM;
1247 1303
1248 old_vector = cfg->vector; 1304 old_vector = cfg->vector;
1249 if (old_vector) { 1305 if (old_vector) {
1250 cpumask_t tmp; 1306 cpumask_and(tmp_mask, mask, cpu_online_mask);
1251 cpus_and(tmp, cfg->domain, mask); 1307 cpumask_and(tmp_mask, cfg->domain, tmp_mask);
1252 if (!cpus_empty(tmp)) 1308 if (!cpumask_empty(tmp_mask)) {
1309 free_cpumask_var(tmp_mask);
1253 return 0; 1310 return 0;
1311 }
1254 } 1312 }
1255 1313
1256 for_each_cpu_mask_nr(cpu, mask) { 1314 /* Only try and allocate irqs on cpus that are present */
1257 cpumask_t domain, new_mask; 1315 err = -ENOSPC;
1316 for_each_cpu_and(cpu, mask, cpu_online_mask) {
1258 int new_cpu; 1317 int new_cpu;
1259 int vector, offset; 1318 int vector, offset;
1260 1319
1261 domain = vector_allocation_domain(cpu); 1320 vector_allocation_domain(cpu, tmp_mask);
1262 cpus_and(new_mask, domain, cpu_online_map);
1263 1321
1264 vector = current_vector; 1322 vector = current_vector;
1265 offset = current_offset; 1323 offset = current_offset;
1266next: 1324next:
1267 vector += 8; 1325 vector += 8;
1268 if (vector >= first_system_vector) { 1326 if (vector >= first_system_vector) {
1269 /* If we run out of vectors on large boxen, must share them. */ 1327 /* If out of vectors on large boxen, must share them. */
1270 offset = (offset + 1) % 8; 1328 offset = (offset + 1) % 8;
1271 vector = FIRST_DEVICE_VECTOR + offset; 1329 vector = FIRST_DEVICE_VECTOR + offset;
1272 } 1330 }
1273 if (unlikely(current_vector == vector)) 1331 if (unlikely(current_vector == vector))
1274 continue; 1332 continue;
1275#ifdef CONFIG_X86_64 1333
1276 if (vector == IA32_SYSCALL_VECTOR) 1334 if (test_bit(vector, used_vectors))
1277 goto next;
1278#else
1279 if (vector == SYSCALL_VECTOR)
1280 goto next; 1335 goto next;
1281#endif 1336
1282 for_each_cpu_mask_nr(new_cpu, new_mask) 1337 for_each_cpu_and(new_cpu, tmp_mask, cpu_online_mask)
1283 if (per_cpu(vector_irq, new_cpu)[vector] != -1) 1338 if (per_cpu(vector_irq, new_cpu)[vector] != -1)
1284 goto next; 1339 goto next;
1285 /* Found one! */ 1340 /* Found one! */
@@ -1287,18 +1342,21 @@ next:
1287 current_offset = offset; 1342 current_offset = offset;
1288 if (old_vector) { 1343 if (old_vector) {
1289 cfg->move_in_progress = 1; 1344 cfg->move_in_progress = 1;
1290 cfg->old_domain = cfg->domain; 1345 cpumask_copy(cfg->old_domain, cfg->domain);
1291 } 1346 }
1292 for_each_cpu_mask_nr(new_cpu, new_mask) 1347 for_each_cpu_and(new_cpu, tmp_mask, cpu_online_mask)
1293 per_cpu(vector_irq, new_cpu)[vector] = irq; 1348 per_cpu(vector_irq, new_cpu)[vector] = irq;
1294 cfg->vector = vector; 1349 cfg->vector = vector;
1295 cfg->domain = domain; 1350 cpumask_copy(cfg->domain, tmp_mask);
1296 return 0; 1351 err = 0;
1352 break;
1297 } 1353 }
1298 return -ENOSPC; 1354 free_cpumask_var(tmp_mask);
1355 return err;
1299} 1356}
1300 1357
1301static int assign_irq_vector(int irq, struct irq_cfg *cfg, cpumask_t mask) 1358static int
1359assign_irq_vector(int irq, struct irq_cfg *cfg, const struct cpumask *mask)
1302{ 1360{
1303 int err; 1361 int err;
1304 unsigned long flags; 1362 unsigned long flags;
@@ -1311,23 +1369,20 @@ static int assign_irq_vector(int irq, struct irq_cfg *cfg, cpumask_t mask)
1311 1369
1312static void __clear_irq_vector(int irq, struct irq_cfg *cfg) 1370static void __clear_irq_vector(int irq, struct irq_cfg *cfg)
1313{ 1371{
1314 cpumask_t mask;
1315 int cpu, vector; 1372 int cpu, vector;
1316 1373
1317 BUG_ON(!cfg->vector); 1374 BUG_ON(!cfg->vector);
1318 1375
1319 vector = cfg->vector; 1376 vector = cfg->vector;
1320 cpus_and(mask, cfg->domain, cpu_online_map); 1377 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; 1378 per_cpu(vector_irq, cpu)[vector] = -1;
1323 1379
1324 cfg->vector = 0; 1380 cfg->vector = 0;
1325 cpus_clear(cfg->domain); 1381 cpumask_clear(cfg->domain);
1326 1382
1327 if (likely(!cfg->move_in_progress)) 1383 if (likely(!cfg->move_in_progress))
1328 return; 1384 return;
1329 cpus_and(mask, cfg->old_domain, cpu_online_map); 1385 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; 1386 for (vector = FIRST_EXTERNAL_VECTOR; vector < NR_VECTORS;
1332 vector++) { 1387 vector++) {
1333 if (per_cpu(vector_irq, cpu)[vector] != irq) 1388 if (per_cpu(vector_irq, cpu)[vector] != irq)
@@ -1350,7 +1405,7 @@ void __setup_vector_irq(int cpu)
1350 /* Mark the inuse vectors */ 1405 /* Mark the inuse vectors */
1351 for_each_irq_desc(irq, desc) { 1406 for_each_irq_desc(irq, desc) {
1352 cfg = desc->chip_data; 1407 cfg = desc->chip_data;
1353 if (!cpu_isset(cpu, cfg->domain)) 1408 if (!cpumask_test_cpu(cpu, cfg->domain))
1354 continue; 1409 continue;
1355 vector = cfg->vector; 1410 vector = cfg->vector;
1356 per_cpu(vector_irq, cpu)[vector] = irq; 1411 per_cpu(vector_irq, cpu)[vector] = irq;
@@ -1362,7 +1417,7 @@ void __setup_vector_irq(int cpu)
1362 continue; 1417 continue;
1363 1418
1364 cfg = irq_cfg(irq); 1419 cfg = irq_cfg(irq);
1365 if (!cpu_isset(cpu, cfg->domain)) 1420 if (!cpumask_test_cpu(cpu, cfg->domain))
1366 per_cpu(vector_irq, cpu)[vector] = -1; 1421 per_cpu(vector_irq, cpu)[vector] = -1;
1367 } 1422 }
1368} 1423}
@@ -1498,18 +1553,17 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
1498{ 1553{
1499 struct irq_cfg *cfg; 1554 struct irq_cfg *cfg;
1500 struct IO_APIC_route_entry entry; 1555 struct IO_APIC_route_entry entry;
1501 cpumask_t mask; 1556 unsigned int dest;
1502 1557
1503 if (!IO_APIC_IRQ(irq)) 1558 if (!IO_APIC_IRQ(irq))
1504 return; 1559 return;
1505 1560
1506 cfg = desc->chip_data; 1561 cfg = desc->chip_data;
1507 1562
1508 mask = TARGET_CPUS; 1563 if (assign_irq_vector(irq, cfg, TARGET_CPUS))
1509 if (assign_irq_vector(irq, cfg, mask))
1510 return; 1564 return;
1511 1565
1512 cpus_and(mask, cfg->domain, mask); 1566 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS);
1513 1567
1514 apic_printk(APIC_VERBOSE,KERN_DEBUG 1568 apic_printk(APIC_VERBOSE,KERN_DEBUG
1515 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> " 1569 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> "
@@ -1519,8 +1573,7 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, struct irq_de
1519 1573
1520 1574
1521 if (setup_ioapic_entry(mp_ioapics[apic].mp_apicid, irq, &entry, 1575 if (setup_ioapic_entry(mp_ioapics[apic].mp_apicid, irq, &entry,
1522 cpu_mask_to_apicid(mask), trigger, polarity, 1576 dest, trigger, polarity, cfg->vector)) {
1523 cfg->vector)) {
1524 printk("Failed to setup ioapic entry for ioapic %d, pin %d\n", 1577 printk("Failed to setup ioapic entry for ioapic %d, pin %d\n",
1525 mp_ioapics[apic].mp_apicid, pin); 1578 mp_ioapics[apic].mp_apicid, pin);
1526 __clear_irq_vector(irq, cfg); 1579 __clear_irq_vector(irq, cfg);
@@ -2240,7 +2293,7 @@ static int ioapic_retrigger_irq(unsigned int irq)
2240 unsigned long flags; 2293 unsigned long flags;
2241 2294
2242 spin_lock_irqsave(&vector_lock, flags); 2295 spin_lock_irqsave(&vector_lock, flags);
2243 send_IPI_mask(cpumask_of_cpu(first_cpu(cfg->domain)), cfg->vector); 2296 send_IPI_mask(cpumask_of(cpumask_first(cfg->domain)), cfg->vector);
2244 spin_unlock_irqrestore(&vector_lock, flags); 2297 spin_unlock_irqrestore(&vector_lock, flags);
2245 2298
2246 return 1; 2299 return 1;
@@ -2289,18 +2342,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 2342 * as simple as edge triggered migration and we can do the irq migration
2290 * with a simple atomic update to IO-APIC RTE. 2343 * with a simple atomic update to IO-APIC RTE.
2291 */ 2344 */
2292static void migrate_ioapic_irq_desc(struct irq_desc *desc, cpumask_t mask) 2345static void
2346migrate_ioapic_irq_desc(struct irq_desc *desc, const struct cpumask *mask)
2293{ 2347{
2294 struct irq_cfg *cfg; 2348 struct irq_cfg *cfg;
2295 cpumask_t tmp, cleanup_mask;
2296 struct irte irte; 2349 struct irte irte;
2297 int modify_ioapic_rte; 2350 int modify_ioapic_rte;
2298 unsigned int dest; 2351 unsigned int dest;
2299 unsigned long flags; 2352 unsigned long flags;
2300 unsigned int irq; 2353 unsigned int irq;
2301 2354
2302 cpus_and(tmp, mask, cpu_online_map); 2355 if (!cpumask_intersects(mask, cpu_online_mask))
2303 if (cpus_empty(tmp))
2304 return; 2356 return;
2305 2357
2306 irq = desc->irq; 2358 irq = desc->irq;
@@ -2313,8 +2365,7 @@ static void migrate_ioapic_irq_desc(struct irq_desc *desc, cpumask_t mask)
2313 2365
2314 set_extra_move_desc(desc, mask); 2366 set_extra_move_desc(desc, mask);
2315 2367
2316 cpus_and(tmp, cfg->domain, mask); 2368 dest = cpu_mask_to_apicid_and(cfg->domain, mask);
2317 dest = cpu_mask_to_apicid(tmp);
2318 2369
2319 modify_ioapic_rte = desc->status & IRQ_LEVEL; 2370 modify_ioapic_rte = desc->status & IRQ_LEVEL;
2320 if (modify_ioapic_rte) { 2371 if (modify_ioapic_rte) {
@@ -2331,14 +2382,10 @@ static void migrate_ioapic_irq_desc(struct irq_desc *desc, cpumask_t mask)
2331 */ 2382 */
2332 modify_irte(irq, &irte); 2383 modify_irte(irq, &irte);
2333 2384
2334 if (cfg->move_in_progress) { 2385 if (cfg->move_in_progress)
2335 cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map); 2386 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 2387
2341 desc->affinity = mask; 2388 cpumask_copy(&desc->affinity, mask);
2342} 2389}
2343 2390
2344static int migrate_irq_remapped_level_desc(struct irq_desc *desc) 2391static int migrate_irq_remapped_level_desc(struct irq_desc *desc)
@@ -2360,11 +2407,11 @@ static int migrate_irq_remapped_level_desc(struct irq_desc *desc)
2360 } 2407 }
2361 2408
2362 /* everthing is clear. we have right of way */ 2409 /* everthing is clear. we have right of way */
2363 migrate_ioapic_irq_desc(desc, desc->pending_mask); 2410 migrate_ioapic_irq_desc(desc, &desc->pending_mask);
2364 2411
2365 ret = 0; 2412 ret = 0;
2366 desc->status &= ~IRQ_MOVE_PENDING; 2413 desc->status &= ~IRQ_MOVE_PENDING;
2367 cpus_clear(desc->pending_mask); 2414 cpumask_clear(&desc->pending_mask);
2368 2415
2369unmask: 2416unmask:
2370 unmask_IO_APIC_irq_desc(desc); 2417 unmask_IO_APIC_irq_desc(desc);
@@ -2389,7 +2436,7 @@ static void ir_irq_migration(struct work_struct *work)
2389 continue; 2436 continue;
2390 } 2437 }
2391 2438
2392 desc->chip->set_affinity(irq, desc->pending_mask); 2439 desc->chip->set_affinity(irq, &desc->pending_mask);
2393 spin_unlock_irqrestore(&desc->lock, flags); 2440 spin_unlock_irqrestore(&desc->lock, flags);
2394 } 2441 }
2395 } 2442 }
@@ -2398,18 +2445,20 @@ static void ir_irq_migration(struct work_struct *work)
2398/* 2445/*
2399 * Migrates the IRQ destination in the process context. 2446 * Migrates the IRQ destination in the process context.
2400 */ 2447 */
2401static void set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc, cpumask_t mask) 2448static void set_ir_ioapic_affinity_irq_desc(struct irq_desc *desc,
2449 const struct cpumask *mask)
2402{ 2450{
2403 if (desc->status & IRQ_LEVEL) { 2451 if (desc->status & IRQ_LEVEL) {
2404 desc->status |= IRQ_MOVE_PENDING; 2452 desc->status |= IRQ_MOVE_PENDING;
2405 desc->pending_mask = mask; 2453 cpumask_copy(&desc->pending_mask, mask);
2406 migrate_irq_remapped_level_desc(desc); 2454 migrate_irq_remapped_level_desc(desc);
2407 return; 2455 return;
2408 } 2456 }
2409 2457
2410 migrate_ioapic_irq_desc(desc, mask); 2458 migrate_ioapic_irq_desc(desc, mask);
2411} 2459}
2412static void set_ir_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) 2460static void set_ir_ioapic_affinity_irq(unsigned int irq,
2461 const struct cpumask *mask)
2413{ 2462{
2414 struct irq_desc *desc = irq_to_desc(irq); 2463 struct irq_desc *desc = irq_to_desc(irq);
2415 2464
@@ -2444,7 +2493,7 @@ asmlinkage void smp_irq_move_cleanup_interrupt(void)
2444 if (!cfg->move_cleanup_count) 2493 if (!cfg->move_cleanup_count)
2445 goto unlock; 2494 goto unlock;
2446 2495
2447 if ((vector == cfg->vector) && cpu_isset(me, cfg->domain)) 2496 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
2448 goto unlock; 2497 goto unlock;
2449 2498
2450 __get_cpu_var(vector_irq)[vector] = -1; 2499 __get_cpu_var(vector_irq)[vector] = -1;
@@ -2481,20 +2530,14 @@ static void irq_complete_move(struct irq_desc **descp)
2481 2530
2482 vector = ~get_irq_regs()->orig_ax; 2531 vector = ~get_irq_regs()->orig_ax;
2483 me = smp_processor_id(); 2532 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 2533#ifdef CONFIG_NUMA_MIGRATE_IRQ_DESC
2488 *descp = desc = move_irq_desc(desc, me); 2534 *descp = desc = move_irq_desc(desc, me);
2489 /* get the new one */ 2535 /* get the new one */
2490 cfg = desc->chip_data; 2536 cfg = desc->chip_data;
2491#endif 2537#endif
2492 2538
2493 cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map); 2539 if (vector == cfg->vector && cpumask_test_cpu(me, cfg->domain))
2494 cfg->move_cleanup_count = cpus_weight(cleanup_mask); 2540 send_cleanup_vector(cfg);
2495 send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR);
2496 cfg->move_in_progress = 0;
2497 }
2498} 2541}
2499#else 2542#else
2500static inline void irq_complete_move(struct irq_desc **descp) {} 2543static inline void irq_complete_move(struct irq_desc **descp) {}
@@ -3216,16 +3259,13 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3216 struct irq_cfg *cfg; 3259 struct irq_cfg *cfg;
3217 int err; 3260 int err;
3218 unsigned dest; 3261 unsigned dest;
3219 cpumask_t tmp;
3220 3262
3221 cfg = irq_cfg(irq); 3263 cfg = irq_cfg(irq);
3222 tmp = TARGET_CPUS; 3264 err = assign_irq_vector(irq, cfg, TARGET_CPUS);
3223 err = assign_irq_vector(irq, cfg, tmp);
3224 if (err) 3265 if (err)
3225 return err; 3266 return err;
3226 3267
3227 cpus_and(tmp, cfg->domain, tmp); 3268 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS);
3228 dest = cpu_mask_to_apicid(tmp);
3229 3269
3230#ifdef CONFIG_INTR_REMAP 3270#ifdef CONFIG_INTR_REMAP
3231 if (irq_remapped(irq)) { 3271 if (irq_remapped(irq)) {
@@ -3279,26 +3319,18 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms
3279} 3319}
3280 3320
3281#ifdef CONFIG_SMP 3321#ifdef CONFIG_SMP
3282static void set_msi_irq_affinity(unsigned int irq, cpumask_t mask) 3322static void set_msi_irq_affinity(unsigned int irq, const struct cpumask *mask)
3283{ 3323{
3284 struct irq_desc *desc = irq_to_desc(irq); 3324 struct irq_desc *desc = irq_to_desc(irq);
3285 struct irq_cfg *cfg; 3325 struct irq_cfg *cfg;
3286 struct msi_msg msg; 3326 struct msi_msg msg;
3287 unsigned int dest; 3327 unsigned int dest;
3288 cpumask_t tmp;
3289 3328
3290 cpus_and(tmp, mask, cpu_online_map); 3329 dest = set_desc_affinity(desc, mask);
3291 if (cpus_empty(tmp)) 3330 if (dest == BAD_APICID)
3292 return; 3331 return;
3293 3332
3294 cfg = desc->chip_data; 3333 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 3334
3303 read_msi_msg_desc(desc, &msg); 3335 read_msi_msg_desc(desc, &msg);
3304 3336
@@ -3308,37 +3340,27 @@ static void set_msi_irq_affinity(unsigned int irq, cpumask_t mask)
3308 msg.address_lo |= MSI_ADDR_DEST_ID(dest); 3340 msg.address_lo |= MSI_ADDR_DEST_ID(dest);
3309 3341
3310 write_msi_msg_desc(desc, &msg); 3342 write_msi_msg_desc(desc, &msg);
3311 desc->affinity = mask;
3312} 3343}
3313#ifdef CONFIG_INTR_REMAP 3344#ifdef CONFIG_INTR_REMAP
3314/* 3345/*
3315 * Migrate the MSI irq to another cpumask. This migration is 3346 * Migrate the MSI irq to another cpumask. This migration is
3316 * done in the process context using interrupt-remapping hardware. 3347 * done in the process context using interrupt-remapping hardware.
3317 */ 3348 */
3318static void ir_set_msi_irq_affinity(unsigned int irq, cpumask_t mask) 3349static void
3350ir_set_msi_irq_affinity(unsigned int irq, const struct cpumask *mask)
3319{ 3351{
3320 struct irq_desc *desc = irq_to_desc(irq); 3352 struct irq_desc *desc = irq_to_desc(irq);
3321 struct irq_cfg *cfg; 3353 struct irq_cfg *cfg = desc->chip_data;
3322 unsigned int dest; 3354 unsigned int dest;
3323 cpumask_t tmp, cleanup_mask;
3324 struct irte irte; 3355 struct irte irte;
3325 3356
3326 cpus_and(tmp, mask, cpu_online_map);
3327 if (cpus_empty(tmp))
3328 return;
3329
3330 if (get_irte(irq, &irte)) 3357 if (get_irte(irq, &irte))
3331 return; 3358 return;
3332 3359
3333 cfg = desc->chip_data; 3360 dest = set_desc_affinity(desc, mask);
3334 if (assign_irq_vector(irq, cfg, mask)) 3361 if (dest == BAD_APICID)
3335 return; 3362 return;
3336 3363
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; 3364 irte.vector = cfg->vector;
3343 irte.dest_id = IRTE_DEST(dest); 3365 irte.dest_id = IRTE_DEST(dest);
3344 3366
@@ -3352,14 +3374,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 3374 * at the new destination. So, time to cleanup the previous
3353 * vector allocation. 3375 * vector allocation.
3354 */ 3376 */
3355 if (cfg->move_in_progress) { 3377 if (cfg->move_in_progress)
3356 cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map); 3378 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} 3379}
3364 3380
3365#endif 3381#endif
@@ -3550,26 +3566,18 @@ void arch_teardown_msi_irq(unsigned int irq)
3550 3566
3551#ifdef CONFIG_DMAR 3567#ifdef CONFIG_DMAR
3552#ifdef CONFIG_SMP 3568#ifdef CONFIG_SMP
3553static void dmar_msi_set_affinity(unsigned int irq, cpumask_t mask) 3569static void dmar_msi_set_affinity(unsigned int irq, const struct cpumask *mask)
3554{ 3570{
3555 struct irq_desc *desc = irq_to_desc(irq); 3571 struct irq_desc *desc = irq_to_desc(irq);
3556 struct irq_cfg *cfg; 3572 struct irq_cfg *cfg;
3557 struct msi_msg msg; 3573 struct msi_msg msg;
3558 unsigned int dest; 3574 unsigned int dest;
3559 cpumask_t tmp;
3560 3575
3561 cpus_and(tmp, mask, cpu_online_map); 3576 dest = set_desc_affinity(desc, mask);
3562 if (cpus_empty(tmp)) 3577 if (dest == BAD_APICID)
3563 return; 3578 return;
3564 3579
3565 cfg = desc->chip_data; 3580 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 3581
3574 dmar_msi_read(irq, &msg); 3582 dmar_msi_read(irq, &msg);
3575 3583
@@ -3579,7 +3587,6 @@ static void dmar_msi_set_affinity(unsigned int irq, cpumask_t mask)
3579 msg.address_lo |= MSI_ADDR_DEST_ID(dest); 3587 msg.address_lo |= MSI_ADDR_DEST_ID(dest);
3580 3588
3581 dmar_msi_write(irq, &msg); 3589 dmar_msi_write(irq, &msg);
3582 desc->affinity = mask;
3583} 3590}
3584 3591
3585#endif /* CONFIG_SMP */ 3592#endif /* CONFIG_SMP */
@@ -3613,26 +3620,18 @@ int arch_setup_dmar_msi(unsigned int irq)
3613#ifdef CONFIG_HPET_TIMER 3620#ifdef CONFIG_HPET_TIMER
3614 3621
3615#ifdef CONFIG_SMP 3622#ifdef CONFIG_SMP
3616static void hpet_msi_set_affinity(unsigned int irq, cpumask_t mask) 3623static void hpet_msi_set_affinity(unsigned int irq, const struct cpumask *mask)
3617{ 3624{
3618 struct irq_desc *desc = irq_to_desc(irq); 3625 struct irq_desc *desc = irq_to_desc(irq);
3619 struct irq_cfg *cfg; 3626 struct irq_cfg *cfg;
3620 struct msi_msg msg; 3627 struct msi_msg msg;
3621 unsigned int dest; 3628 unsigned int dest;
3622 cpumask_t tmp;
3623 3629
3624 cpus_and(tmp, mask, cpu_online_map); 3630 dest = set_desc_affinity(desc, mask);
3625 if (cpus_empty(tmp)) 3631 if (dest == BAD_APICID)
3626 return; 3632 return;
3627 3633
3628 cfg = desc->chip_data; 3634 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 3635
3637 hpet_msi_read(irq, &msg); 3636 hpet_msi_read(irq, &msg);
3638 3637
@@ -3642,7 +3641,6 @@ static void hpet_msi_set_affinity(unsigned int irq, cpumask_t mask)
3642 msg.address_lo |= MSI_ADDR_DEST_ID(dest); 3641 msg.address_lo |= MSI_ADDR_DEST_ID(dest);
3643 3642
3644 hpet_msi_write(irq, &msg); 3643 hpet_msi_write(irq, &msg);
3645 desc->affinity = mask;
3646} 3644}
3647 3645
3648#endif /* CONFIG_SMP */ 3646#endif /* CONFIG_SMP */
@@ -3697,28 +3695,19 @@ static void target_ht_irq(unsigned int irq, unsigned int dest, u8 vector)
3697 write_ht_irq_msg(irq, &msg); 3695 write_ht_irq_msg(irq, &msg);
3698} 3696}
3699 3697
3700static void set_ht_irq_affinity(unsigned int irq, cpumask_t mask) 3698static void set_ht_irq_affinity(unsigned int irq, const struct cpumask *mask)
3701{ 3699{
3702 struct irq_desc *desc = irq_to_desc(irq); 3700 struct irq_desc *desc = irq_to_desc(irq);
3703 struct irq_cfg *cfg; 3701 struct irq_cfg *cfg;
3704 unsigned int dest; 3702 unsigned int dest;
3705 cpumask_t tmp;
3706 3703
3707 cpus_and(tmp, mask, cpu_online_map); 3704 dest = set_desc_affinity(desc, mask);
3708 if (cpus_empty(tmp)) 3705 if (dest == BAD_APICID)
3709 return; 3706 return;
3710 3707
3711 cfg = desc->chip_data; 3708 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 3709
3720 target_ht_irq(irq, dest, cfg->vector); 3710 target_ht_irq(irq, dest, cfg->vector);
3721 desc->affinity = mask;
3722} 3711}
3723 3712
3724#endif 3713#endif
@@ -3738,17 +3727,14 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
3738{ 3727{
3739 struct irq_cfg *cfg; 3728 struct irq_cfg *cfg;
3740 int err; 3729 int err;
3741 cpumask_t tmp;
3742 3730
3743 cfg = irq_cfg(irq); 3731 cfg = irq_cfg(irq);
3744 tmp = TARGET_CPUS; 3732 err = assign_irq_vector(irq, cfg, TARGET_CPUS);
3745 err = assign_irq_vector(irq, cfg, tmp);
3746 if (!err) { 3733 if (!err) {
3747 struct ht_irq_msg msg; 3734 struct ht_irq_msg msg;
3748 unsigned dest; 3735 unsigned dest;
3749 3736
3750 cpus_and(tmp, cfg->domain, tmp); 3737 dest = cpu_mask_to_apicid_and(cfg->domain, TARGET_CPUS);
3751 dest = cpu_mask_to_apicid(tmp);
3752 3738
3753 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest); 3739 msg.address_hi = HT_IRQ_HIGH_DEST_ID(dest);
3754 3740
@@ -3784,7 +3770,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, 3770int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
3785 unsigned long mmr_offset) 3771 unsigned long mmr_offset)
3786{ 3772{
3787 const cpumask_t *eligible_cpu = get_cpu_mask(cpu); 3773 const struct cpumask *eligible_cpu = cpumask_of(cpu);
3788 struct irq_cfg *cfg; 3774 struct irq_cfg *cfg;
3789 int mmr_pnode; 3775 int mmr_pnode;
3790 unsigned long mmr_value; 3776 unsigned long mmr_value;
@@ -3794,7 +3780,7 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
3794 3780
3795 cfg = irq_cfg(irq); 3781 cfg = irq_cfg(irq);
3796 3782
3797 err = assign_irq_vector(irq, cfg, *eligible_cpu); 3783 err = assign_irq_vector(irq, cfg, eligible_cpu);
3798 if (err != 0) 3784 if (err != 0)
3799 return err; 3785 return err;
3800 3786
@@ -3813,7 +3799,7 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade,
3813 entry->polarity = 0; 3799 entry->polarity = 0;
3814 entry->trigger = 0; 3800 entry->trigger = 0;
3815 entry->mask = 0; 3801 entry->mask = 0;
3816 entry->dest = cpu_mask_to_apicid(*eligible_cpu); 3802 entry->dest = cpu_mask_to_apicid(eligible_cpu);
3817 3803
3818 mmr_pnode = uv_blade_to_pnode(mmr_blade); 3804 mmr_pnode = uv_blade_to_pnode(mmr_blade);
3819 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); 3805 uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value);
@@ -4024,7 +4010,7 @@ void __init setup_ioapic_dest(void)
4024 int pin, ioapic, irq, irq_entry; 4010 int pin, ioapic, irq, irq_entry;
4025 struct irq_desc *desc; 4011 struct irq_desc *desc;
4026 struct irq_cfg *cfg; 4012 struct irq_cfg *cfg;
4027 cpumask_t mask; 4013 const struct cpumask *mask;
4028 4014
4029 if (skip_ioapic_setup == 1) 4015 if (skip_ioapic_setup == 1)
4030 return; 4016 return;
@@ -4055,7 +4041,7 @@ void __init setup_ioapic_dest(void)
4055 */ 4041 */
4056 if (desc->status & 4042 if (desc->status &
4057 (IRQ_NO_BALANCING | IRQ_AFFINITY_SET)) 4043 (IRQ_NO_BALANCING | IRQ_AFFINITY_SET))
4058 mask = desc->affinity; 4044 mask = &desc->affinity;
4059 else 4045 else
4060 mask = TARGET_CPUS; 4046 mask = TARGET_CPUS;
4061 4047
diff --git a/arch/x86/kernel/ipi.c b/arch/x86/kernel/ipi.c
index f1c688e46f3..285bbf8831f 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 3f1d9d18df6..bce53e1352a 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -9,6 +9,7 @@
9#include <asm/apic.h> 9#include <asm/apic.h>
10#include <asm/io_apic.h> 10#include <asm/io_apic.h>
11#include <asm/smp.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 119fc9c8ff7..9dc5588f336 100644
--- a/arch/x86/kernel/irq_32.c
+++ b/arch/x86/kernel/irq_32.c
@@ -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 a174a217eb1..6383d50f82e 100644
--- a/arch/x86/kernel/irq_64.c
+++ b/arch/x86/kernel/irq_64.c
@@ -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
diff --git a/arch/x86/kernel/irqinit_32.c b/arch/x86/kernel/irqinit_32.c
index 203384ed2b5..84723295f88 100644
--- a/arch/x86/kernel/irqinit_32.c
+++ b/arch/x86/kernel/irqinit_32.c
@@ -110,6 +110,18 @@ DEFINE_PER_CPU(vector_irq_t, vector_irq) = {
110 [IRQ15_VECTOR + 1 ... NR_VECTORS - 1] = -1 110 [IRQ15_VECTOR + 1 ... NR_VECTORS - 1] = -1
111}; 111};
112 112
113int vector_used_by_percpu_irq(unsigned int vector)
114{
115 int cpu;
116
117 for_each_online_cpu(cpu) {
118 if (per_cpu(vector_irq, cpu)[vector] != -1)
119 return 1;
120 }
121
122 return 0;
123}
124
113/* Overridden in paravirt.c */ 125/* Overridden in paravirt.c */
114void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ"))); 126void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ")));
115 127
@@ -146,10 +158,12 @@ void __init native_init_IRQ(void)
146 alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); 158 alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);
147 159
148 /* IPI for single call function */ 160 /* IPI for single call function */
149 set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, call_function_single_interrupt); 161 alloc_intr_gate(CALL_FUNCTION_SINGLE_VECTOR,
162 call_function_single_interrupt);
150 163
151 /* Low priority IPI to cleanup after moving an irq */ 164 /* Low priority IPI to cleanup after moving an irq */
152 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt); 165 set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
166 set_bit(IRQ_MOVE_CLEANUP_VECTOR, used_vectors);
153#endif 167#endif
154 168
155#ifdef CONFIG_X86_LOCAL_APIC 169#ifdef CONFIG_X86_LOCAL_APIC
diff --git a/arch/x86/kernel/irqinit_64.c b/arch/x86/kernel/irqinit_64.c
index 6190e6ef546..31ebfe38e96 100644
--- a/arch/x86/kernel/irqinit_64.c
+++ b/arch/x86/kernel/irqinit_64.c
@@ -69,6 +69,18 @@ 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
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
72void __init init_ISA_irqs(void) 84void __init init_ISA_irqs(void)
73{ 85{
74 int i; 86 int i;
@@ -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 6c27679ec6a..884d985b8b8 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 e169ae9b6a6..652fce6d2cc 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 eee32b43fee..71f1d99a635 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 3b599518c32..8815f3c7fec 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 efc2f361fe8..666e43df51f 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 45e3b69808b..c5c5b8df1db 100644
--- a/arch/x86/kernel/mpparse.c
+++ b/arch/x86/kernel/mpparse.c
@@ -16,14 +16,14 @@
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>
20#include <linux/acpi.h>
19 21
20#include <asm/smp.h>
21#include <asm/mtrr.h> 22#include <asm/mtrr.h>
22#include <asm/mpspec.h> 23#include <asm/mpspec.h>
23#include <asm/pgalloc.h> 24#include <asm/pgalloc.h>
24#include <asm/io_apic.h> 25#include <asm/io_apic.h>
25#include <asm/proto.h> 26#include <asm/proto.h>
26#include <asm/acpi.h>
27#include <asm/bios_ebda.h> 27#include <asm/bios_ebda.h>
28#include <asm/e820.h> 28#include <asm/e820.h>
29#include <asm/trampoline.h> 29#include <asm/trampoline.h>
@@ -95,8 +95,8 @@ static void __init MP_bus_info(struct mpc_config_bus *m)
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->mpc_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->mpc_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) {
@@ -104,7 +104,7 @@ static void __init MP_bus_info(struct mpc_config_bus *m)
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->mpc_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->mpc_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->mpc_busid] = MP_BUS_EISA;
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 82a7c7ed6d4..726266695b2 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 8bd1bf9622a..45a09ccdc21 100644
--- a/arch/x86/kernel/nmi.c
+++ b/arch/x86/kernel/nmi.c
@@ -26,11 +26,10 @@
26#include <linux/kernel_stat.h> 26#include <linux/kernel_stat.h>
27#include <linux/kdebug.h> 27#include <linux/kdebug.h>
28#include <linux/smp.h> 28#include <linux/smp.h>
29#include <linux/nmi.h>
29 30
30#include <asm/i8259.h> 31#include <asm/i8259.h>
31#include <asm/io_apic.h> 32#include <asm/io_apic.h>
32#include <asm/smp.h>
33#include <asm/nmi.h>
34#include <asm/proto.h> 33#include <asm/proto.h>
35#include <asm/timer.h> 34#include <asm/timer.h>
36 35
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 19a1044a0cd..b2542853314 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 a35eaa379ff..00c2bcd4146 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 242c3440687..d59c9174766 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/reboot.c b/arch/x86/kernel/reboot.c
index 61f718df6ee..2b46eb41643 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 ae0c0d3bb77..a4b619c3310 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -152,8 +152,11 @@ void __init setup_per_cpu_areas(void)
152 old_size = PERCPU_ENOUGH_ROOM; 152 old_size = PERCPU_ENOUGH_ROOM;
153 align = max_t(unsigned long, PAGE_SIZE, align); 153 align = max_t(unsigned long, PAGE_SIZE, align);
154 size = roundup(old_size, align); 154 size = roundup(old_size, align);
155 printk(KERN_INFO "PERCPU: Allocating %zd bytes of per cpu data\n", 155
156 size); 156 pr_info("NR_CPUS:%d nr_cpumask_bits:%d nr_cpu_ids:%d nr_node_ids:%d\n",
157 NR_CPUS, nr_cpumask_bits, nr_cpu_ids, nr_node_ids);
158
159 pr_info("PERCPU: Allocating %zd bytes of per cpu data\n", size);
157 160
158 for_each_possible_cpu(cpu) { 161 for_each_possible_cpu(cpu) {
159#ifndef CONFIG_NEED_MULTIPLE_NODES 162#ifndef CONFIG_NEED_MULTIPLE_NODES
@@ -164,28 +167,21 @@ void __init setup_per_cpu_areas(void)
164 if (!node_online(node) || !NODE_DATA(node)) { 167 if (!node_online(node) || !NODE_DATA(node)) {
165 ptr = __alloc_bootmem(size, align, 168 ptr = __alloc_bootmem(size, align,
166 __pa(MAX_DMA_ADDRESS)); 169 __pa(MAX_DMA_ADDRESS));
167 printk(KERN_INFO 170 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); 171 cpu, node);
170 if (ptr) 172 pr_debug("per cpu data for cpu%d at %016lx\n",
171 printk(KERN_DEBUG "per cpu data for cpu%d at %016lx\n", 173 cpu, __pa(ptr));
172 cpu, __pa(ptr)); 174 } else {
173 }
174 else {
175 ptr = __alloc_bootmem_node(NODE_DATA(node), size, align, 175 ptr = __alloc_bootmem_node(NODE_DATA(node), size, align,
176 __pa(MAX_DMA_ADDRESS)); 176 __pa(MAX_DMA_ADDRESS));
177 if (ptr) 177 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", 178 cpu, node, __pa(ptr));
179 cpu, node, __pa(ptr));
180 } 179 }
181#endif 180#endif
182 per_cpu_offset(cpu) = ptr - __per_cpu_start; 181 per_cpu_offset(cpu) = ptr - __per_cpu_start;
183 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); 182 memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start);
184 } 183 }
185 184
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 */ 185 /* Setup percpu data maps */
190 setup_per_cpu_maps(); 186 setup_per_cpu_maps();
191 187
@@ -282,7 +278,7 @@ static void __cpuinit numa_set_cpumask(int cpu, int enable)
282 else 278 else
283 cpu_clear(cpu, *mask); 279 cpu_clear(cpu, *mask);
284 280
285 cpulist_scnprintf(buf, sizeof(buf), *mask); 281 cpulist_scnprintf(buf, sizeof(buf), mask);
286 printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n", 282 printk(KERN_DEBUG "%s cpu %d node %d: mask now %s\n",
287 enable? "numa_add_cpu":"numa_remove_cpu", cpu, node, buf); 283 enable? "numa_add_cpu":"numa_remove_cpu", cpu, node, buf);
288 } 284 }
@@ -334,25 +330,25 @@ static const cpumask_t cpu_mask_none;
334/* 330/*
335 * Returns a pointer to the bitmask of CPUs on Node 'node'. 331 * Returns a pointer to the bitmask of CPUs on Node 'node'.
336 */ 332 */
337const cpumask_t *_node_to_cpumask_ptr(int node) 333const cpumask_t *cpumask_of_node(int node)
338{ 334{
339 if (node_to_cpumask_map == NULL) { 335 if (node_to_cpumask_map == NULL) {
340 printk(KERN_WARNING 336 printk(KERN_WARNING
341 "_node_to_cpumask_ptr(%d): no node_to_cpumask_map!\n", 337 "cpumask_of_node(%d): no node_to_cpumask_map!\n",
342 node); 338 node);
343 dump_stack(); 339 dump_stack();
344 return (const cpumask_t *)&cpu_online_map; 340 return (const cpumask_t *)&cpu_online_map;
345 } 341 }
346 if (node >= nr_node_ids) { 342 if (node >= nr_node_ids) {
347 printk(KERN_WARNING 343 printk(KERN_WARNING
348 "_node_to_cpumask_ptr(%d): node > nr_node_ids(%d)\n", 344 "cpumask_of_node(%d): node > nr_node_ids(%d)\n",
349 node, nr_node_ids); 345 node, nr_node_ids);
350 dump_stack(); 346 dump_stack();
351 return &cpu_mask_none; 347 return &cpu_mask_none;
352 } 348 }
353 return &node_to_cpumask_map[node]; 349 return &node_to_cpumask_map[node];
354} 350}
355EXPORT_SYMBOL(_node_to_cpumask_ptr); 351EXPORT_SYMBOL(cpumask_of_node);
356 352
357/* 353/*
358 * Returns a bitmask of CPUs on Node 'node'. 354 * Returns a bitmask of CPUs on Node 'node'.
diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c
index 7e558db362c..beea2649a24 100644
--- a/arch/x86/kernel/smp.c
+++ b/arch/x86/kernel/smp.c
@@ -118,22 +118,22 @@ 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_t allbutself;
132 132
133 allbutself = cpu_online_map; 133 allbutself = cpu_online_map;
134 cpu_clear(smp_processor_id(), allbutself); 134 cpu_clear(smp_processor_id(), allbutself);
135 135
136 if (cpus_equal(mask, allbutself) && 136 if (cpus_equal(*mask, allbutself) &&
137 cpus_equal(cpu_online_map, cpu_callout_map)) 137 cpus_equal(cpu_online_map, cpu_callout_map))
138 send_IPI_allbutself(CALL_FUNCTION_VECTOR); 138 send_IPI_allbutself(CALL_FUNCTION_VECTOR);
139 else 139 else
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index f8500c96944..6bd4d9b7387 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -102,14 +102,8 @@ 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; 105cpumask_t cpu_callin_map;
110cpumask_t cpu_callout_map; 106cpumask_t cpu_callout_map;
111cpumask_t cpu_possible_map;
112EXPORT_SYMBOL(cpu_possible_map);
113 107
114/* representing HT siblings of each logical CPU */ 108/* representing HT siblings of each logical CPU */
115DEFINE_PER_CPU(cpumask_t, cpu_sibling_map); 109DEFINE_PER_CPU(cpumask_t, cpu_sibling_map);
@@ -502,7 +496,7 @@ void __cpuinit set_cpu_sibling_map(int cpu)
502} 496}
503 497
504/* maps the cpu to the sched domain representing multi-core */ 498/* maps the cpu to the sched domain representing multi-core */
505cpumask_t cpu_coregroup_map(int cpu) 499const struct cpumask *cpu_coregroup_mask(int cpu)
506{ 500{
507 struct cpuinfo_x86 *c = &cpu_data(cpu); 501 struct cpuinfo_x86 *c = &cpu_data(cpu);
508 /* 502 /*
@@ -510,9 +504,14 @@ cpumask_t cpu_coregroup_map(int cpu)
510 * And for power savings, we return cpu_core_map 504 * And for power savings, we return cpu_core_map
511 */ 505 */
512 if (sched_mc_power_savings || sched_smt_power_savings) 506 if (sched_mc_power_savings || sched_smt_power_savings)
513 return per_cpu(cpu_core_map, cpu); 507 return &per_cpu(cpu_core_map, cpu);
514 else 508 else
515 return c->llc_shared_map; 509 return &c->llc_shared_map;
510}
511
512cpumask_t cpu_coregroup_map(int cpu)
513{
514 return *cpu_coregroup_mask(cpu);
516} 515}
517 516
518static void impress_friends(void) 517static void impress_friends(void)
@@ -1155,7 +1154,7 @@ static void __init smp_cpu_index_default(void)
1155 for_each_possible_cpu(i) { 1154 for_each_possible_cpu(i) {
1156 c = &cpu_data(i); 1155 c = &cpu_data(i);
1157 /* mark all to hotplug */ 1156 /* mark all to hotplug */
1158 c->cpu_index = NR_CPUS; 1157 c->cpu_index = nr_cpu_ids;
1159 } 1158 }
1160} 1159}
1161 1160
@@ -1260,6 +1259,15 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1260 check_nmi_watchdog(); 1259 check_nmi_watchdog();
1261} 1260}
1262 1261
1262static int __initdata setup_possible_cpus = -1;
1263static int __init _setup_possible_cpus(char *str)
1264{
1265 get_option(&str, &setup_possible_cpus);
1266 return 0;
1267}
1268early_param("possible_cpus", _setup_possible_cpus);
1269
1270
1263/* 1271/*
1264 * cpu_possible_map should be static, it cannot change as cpu's 1272 * cpu_possible_map should be static, it cannot change as cpu's
1265 * are onlined, or offlined. The reason is per-cpu data-structures 1273 * are onlined, or offlined. The reason is per-cpu data-structures
@@ -1272,7 +1280,7 @@ void __init native_smp_cpus_done(unsigned int max_cpus)
1272 * 1280 *
1273 * Three ways to find out the number of additional hotplug CPUs: 1281 * Three ways to find out the number of additional hotplug CPUs:
1274 * - If the BIOS specified disabled CPUs in ACPI/mptables use that. 1282 * - If the BIOS specified disabled CPUs in ACPI/mptables use that.
1275 * - The user can overwrite it with additional_cpus=NUM 1283 * - The user can overwrite it with possible_cpus=NUM
1276 * - Otherwise don't reserve additional CPUs. 1284 * - Otherwise don't reserve additional CPUs.
1277 * We do this because additional CPUs waste a lot of memory. 1285 * We do this because additional CPUs waste a lot of memory.
1278 * -AK 1286 * -AK
@@ -1285,9 +1293,19 @@ __init void prefill_possible_map(void)
1285 if (!num_processors) 1293 if (!num_processors)
1286 num_processors = 1; 1294 num_processors = 1;
1287 1295
1288 possible = num_processors + disabled_cpus; 1296 if (setup_possible_cpus == -1)
1289 if (possible > NR_CPUS) 1297 possible = num_processors + disabled_cpus;
1290 possible = NR_CPUS; 1298 else
1299 possible = setup_possible_cpus;
1300
1301 total_cpus = max_t(int, possible, num_processors + disabled_cpus);
1302
1303 if (possible > CONFIG_NR_CPUS) {
1304 printk(KERN_WARNING
1305 "%d Processors exceeds NR_CPUS limit of %d\n",
1306 possible, CONFIG_NR_CPUS);
1307 possible = CONFIG_NR_CPUS;
1308 }
1291 1309
1292 printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", 1310 printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
1293 possible, max_t(int, possible - num_processors, 0)); 1311 possible, max_t(int, possible - num_processors, 0));
@@ -1352,7 +1370,7 @@ void cpu_disable_common(void)
1352 lock_vector_lock(); 1370 lock_vector_lock();
1353 remove_cpu_from_maps(cpu); 1371 remove_cpu_from_maps(cpu);
1354 unlock_vector_lock(); 1372 unlock_vector_lock();
1355 fixup_irqs(cpu_online_map); 1373 fixup_irqs();
1356} 1374}
1357 1375
1358int native_cpu_disable(void) 1376int native_cpu_disable(void)
diff --git a/arch/x86/kernel/tlb_32.c b/arch/x86/kernel/tlb_32.c
index 8da059f949b..ce505464224 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 29887d7081a..f8be6f1d2e4 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 6a00e5faaa7..f885023167e 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 141907ab6e2..c9a666cdd3d 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>
@@ -72,9 +70,6 @@
72 70
73#include "cpu/mcheck/mce.h" 71#include "cpu/mcheck/mce.h"
74 72
75DECLARE_BITMAP(used_vectors, NR_VECTORS);
76EXPORT_SYMBOL_GPL(used_vectors);
77
78asmlinkage int system_call(void); 73asmlinkage int system_call(void);
79 74
80/* Do we ignore FPU interrupts ? */ 75/* Do we ignore FPU interrupts ? */
@@ -89,6 +84,9 @@ gate_desc idt_table[256]
89 __attribute__((__section__(".data.idt"))) = { { { { 0, 0 } } }, }; 84 __attribute__((__section__(".data.idt"))) = { { { { 0, 0 } } }, };
90#endif 85#endif
91 86
87DECLARE_BITMAP(used_vectors, NR_VECTORS);
88EXPORT_SYMBOL_GPL(used_vectors);
89
92static int ignore_nmis; 90static int ignore_nmis;
93 91
94static inline void conditional_sti(struct pt_regs *regs) 92static inline void conditional_sti(struct pt_regs *regs)
@@ -292,8 +290,10 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
292 tsk->thread.error_code = error_code; 290 tsk->thread.error_code = error_code;
293 tsk->thread.trap_no = 8; 291 tsk->thread.trap_no = 8;
294 292
295 /* This is always a kernel trap and never fixable (and thus must 293 /*
296 never return). */ 294 * This is always a kernel trap and never fixable (and thus must
295 * never return).
296 */
297 for (;;) 297 for (;;)
298 die(str, regs, error_code); 298 die(str, regs, error_code);
299} 299}
@@ -520,9 +520,11 @@ dotraplinkage void __kprobes do_int3(struct pt_regs *regs, long error_code)
520} 520}
521 521
522#ifdef CONFIG_X86_64 522#ifdef CONFIG_X86_64
523/* Help handler running on IST stack to switch back to user stack 523/*
524 for scheduling or signal handling. The actual stack switch is done in 524 * Help handler running on IST stack to switch back to user stack
525 entry.S */ 525 * for scheduling or signal handling. The actual stack switch is done in
526 * entry.S
527 */
526asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs) 528asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
527{ 529{
528 struct pt_regs *regs = eregs; 530 struct pt_regs *regs = eregs;
@@ -532,8 +534,10 @@ asmlinkage __kprobes struct pt_regs *sync_regs(struct pt_regs *eregs)
532 /* Exception from user space */ 534 /* Exception from user space */
533 else if (user_mode(eregs)) 535 else if (user_mode(eregs))
534 regs = task_pt_regs(current); 536 regs = task_pt_regs(current);
535 /* Exception from kernel and interrupts are enabled. Move to 537 /*
536 kernel process stack. */ 538 * Exception from kernel and interrupts are enabled. Move to
539 * kernel process stack.
540 */
537 else if (eregs->flags & X86_EFLAGS_IF) 541 else if (eregs->flags & X86_EFLAGS_IF)
538 regs = (struct pt_regs *)(eregs->sp -= sizeof(struct pt_regs)); 542 regs = (struct pt_regs *)(eregs->sp -= sizeof(struct pt_regs));
539 if (eregs != regs) 543 if (eregs != regs)
@@ -685,12 +689,7 @@ void math_error(void __user *ip)
685 cwd = get_fpu_cwd(task); 689 cwd = get_fpu_cwd(task);
686 swd = get_fpu_swd(task); 690 swd = get_fpu_swd(task);
687 691
688 err = swd & ~cwd & 0x3f; 692 err = swd & ~cwd;
689
690#ifdef CONFIG_X86_32
691 if (!err)
692 return;
693#endif
694 693
695 if (err & 0x001) { /* Invalid op */ 694 if (err & 0x001) { /* Invalid op */
696 /* 695 /*
@@ -708,7 +707,11 @@ void math_error(void __user *ip)
708 } else if (err & 0x020) { /* Precision */ 707 } else if (err & 0x020) { /* Precision */
709 info.si_code = FPE_FLTRES; 708 info.si_code = FPE_FLTRES;
710 } else { 709 } else {
711 info.si_code = __SI_FAULT|SI_KERNEL; /* WTF? */ 710 /*
711 * If we're using IRQ 13, or supposedly even some trap 16
712 * implementations, it's possible we get a spurious trap...
713 */
714 return; /* Spurious trap, no error */
712 } 715 }
713 force_sig_info(SIGFPE, &info, task); 716 force_sig_info(SIGFPE, &info, task);
714} 717}
@@ -941,9 +944,7 @@ dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code)
941 944
942void __init trap_init(void) 945void __init trap_init(void)
943{ 946{
944#ifdef CONFIG_X86_32
945 int i; 947 int i;
946#endif
947 948
948#ifdef CONFIG_EISA 949#ifdef CONFIG_EISA
949 void __iomem *p = early_ioremap(0x0FFFD9, 4); 950 void __iomem *p = early_ioremap(0x0FFFD9, 4);
@@ -1000,11 +1001,15 @@ void __init trap_init(void)
1000 } 1001 }
1001 1002
1002 set_system_trap_gate(SYSCALL_VECTOR, &system_call); 1003 set_system_trap_gate(SYSCALL_VECTOR, &system_call);
1004#endif
1003 1005
1004 /* Reserve all the builtin and the syscall vector: */ 1006 /* Reserve all the builtin and the syscall vector: */
1005 for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++) 1007 for (i = 0; i < FIRST_EXTERNAL_VECTOR; i++)
1006 set_bit(i, used_vectors); 1008 set_bit(i, used_vectors);
1007 1009
1010#ifdef CONFIG_X86_64
1011 set_bit(IA32_SYSCALL_VECTOR, used_vectors);
1012#else
1008 set_bit(SYSCALL_VECTOR, used_vectors); 1013 set_bit(SYSCALL_VECTOR, used_vectors);
1009#endif 1014#endif
1010 /* 1015 /*
diff --git a/arch/x86/kernel/vmiclock_32.c b/arch/x86/kernel/vmiclock_32.c
index 254ee07f863..c4c1f9e0940 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 15c3e699918..2b54fe002e9 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 c02343594b4..d3ec292f00f 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 59ebd37ad79..e665d1c623c 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 17e41e165f1..179dcb0103f 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 f17c8f5bbf3..2bf32a03cee 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 65ef0fc2c03..8e5ee99551f 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 0fc3cab4894..afac68c0815 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 410ddbc1aa2..83f11c7474a 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 84eee43bbe7..9fd78b6e17a 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 9c4ce657d96..1452851ae25 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 a4018b01e1f..6259d746764 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 f1f8ff2f1fa..cc17546a240 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 ea051173b0d..d174db7a337 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 50a779264bb..a7ed208f81e 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 37b9ae4d44c..df167f26562 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 3624a364b7f..bc4c7840b2a 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 7b4e6d0d169..4ba5ccaa158 100644
--- a/arch/x86/mach-generic/es7000.c
+++ b/arch/x86/mach-generic/es7000.c
@@ -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 71a309b122e..511d7941364 100644
--- a/arch/x86/mach-generic/numaq.c
+++ b/arch/x86/mach-generic/numaq.c
@@ -38,7 +38,7 @@ static int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
38 return 0; 38 return 0;
39} 39}
40 40
41static cpumask_t vector_allocation_domain(int cpu) 41static void vector_allocation_domain(int cpu, cpumask_t *retmask)
42{ 42{
43 /* Careful. Some cpus do not strictly honor the set of cpus 43 /* Careful. Some cpus do not strictly honor the set of cpus
44 * specified in the interrupt destination when using lowest 44 * specified in the interrupt destination when using lowest
@@ -48,8 +48,7 @@ static cpumask_t vector_allocation_domain(int cpu)
48 * deliver interrupts to the wrong hyperthread when only one 48 * deliver interrupts to the wrong hyperthread when only one
49 * hyperthread was specified in the interrupt desitination. 49 * hyperthread was specified in the interrupt desitination.
50 */ 50 */
51 cpumask_t domain = { { [0] = APIC_ALL_CPUS, } }; 51 *retmask = (cpumask_t){ { [0] = APIC_ALL_CPUS, } };
52 return domain;
53} 52}
54 53
55struct genapic apic_numaq = APIC_INIT("NUMAQ", probe_numaq); 54struct genapic apic_numaq = APIC_INIT("NUMAQ", probe_numaq);
diff --git a/arch/x86/mach-generic/summit.c b/arch/x86/mach-generic/summit.c
index 2c6d234e000..2821ffc188b 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 52145007bd7..9840b7ec749 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 57ec8c86a87..9e268b6b204 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -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 8655b5bb096..88f1b10de3b 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 9f7a0d24d42..23f68e77ad1 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/numa_32.c b/arch/x86/mm/numa_32.c
index 8518c678d83..d1f7439d173 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 cebcbf152d4..71a14f89f89 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 51c0a2fc14f..09737c8af07 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/pci/acpi.c b/arch/x86/pci/acpi.c
index 1d88d2b3977..c0ecf250fe5 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 22e057665e5..9bb09823b36 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 bb1a01f089e..82d22fc601a 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 9a5af6c8fbe..bd13c3e4c6d 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 86631ccbc25..f6adf2c6d75 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 2051dc96b8e..7d388d5cf54 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 844df0cbbd3..f884740da31 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 d6c950f8185..25a1f8efed4 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 bf69dbe08bf..4064345cf14 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 b722dd481b3..f1065b129e9 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 654a2234f8f..89bf9242c80 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 f3c761dce69..8b2d561046a 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 a1994163c99..30007ffc8e1 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 1177845d318..2089354968a 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 e11e9e803d5..b889d824f7c 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 37472fc6f72..b82cae970df 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 42f4cb19fac..bcead7a4687 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 773d68d3e91..503c240e26c 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 acd9b6705e0..c44e2069c7c 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 2a234db5949..212ffe012b7 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 c9f7cda48ed..14f24062349 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 9e1afae8461..c1f8faf0a2c 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 015b6b2a26b..1da55fe4bef 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 849dfcafd51..4e53b74dc44 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 84848123e2a..5582e8cfac8 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 00000000000..58c02a45413
--- /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 00000000000..755320f6e0b
--- /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 00000000000..67ad67bed8c
--- /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 00000000000..257dec75c5a
--- /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 00000000000..6c3930397bd
--- /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 00000000000..9983f2c1b7e
--- /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 00000000000..3e52d72712f
--- /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 00000000000..69b29d19824
--- /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 00000000000..329b94591ca
--- /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 00000000000..f04c9891142
--- /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 00000000000..2c20a58f94c
--- /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 00000000000..94c4c53a099
--- /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 00000000000..f84d3f00774
--- /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 00000000000..65a285d8d3f
--- /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 00000000000..ebeede397db
--- /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 00000000000..a7fb864a50a
--- /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 00000000000..8d1eb5d7864
--- /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 00000000000..e1d8c9e010c
--- /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 00000000000..d8f9872b0e2
--- /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 00000000000..f35678cb0a9
--- /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 00000000000..51882ae3db4
--- /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 00000000000..e30f3abf48f
--- /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 00000000000..c3f53e755ca
--- /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 00000000000..108d8c48e42
--- /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 00000000000..a0f3b96b79b
--- /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 00000000000..c7df3803099
--- /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 00000000000..46ab12db573
--- /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 00000000000..0b745828f42
--- /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 00000000000..87cb19d1b10
--- /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 00000000000..0a046ca5a68
--- /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 00000000000..3ddbea759b2
--- /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 00000000000..07b7299dab2
--- /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 00000000000..b279fe06dfe
--- /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 00000000000..0ffa942954b
--- /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 00000000000..c33aa6a4214
--- /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 00000000000..1620d1e0e69
--- /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 00000000000..3dd9c0b7027
--- /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 00000000000..6ece1b03766
--- /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 00000000000..9e822d2e3bc
--- /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 00000000000..bf2128a99d7
--- /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 00000000000..48723e550d1
--- /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 00000000000..9b92620c8a1
--- /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 00000000000..44c5bb04c55
--- /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 00000000000..c0fd8e5b451
--- /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 00000000000..d9b34bee4d4
--- /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 00000000000..693c9675528
--- /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 00000000000..458c1f7fbc1
--- /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 00000000000..11f7dc2dbec
--- /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 00000000000..ba03d5aeab6
--- /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 00000000000..00fcbd7c534
--- /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 00000000000..66410acf18b
--- /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 00000000000..6d2bc2ada9d
--- /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 00000000000..4f4a7987ede
--- /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 00000000000..8014d96b21f
--- /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 00000000000..e3d5a48ad49
--- /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 00000000000..9d2d5993f06
--- /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 00000000000..43f9dd1126a
--- /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 00000000000..07387d3b99f
--- /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 00000000000..905e1e61965
--- /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 00000000000..d4baed24692
--- /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 00000000000..17b5ab31177
--- /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 00000000000..649588b7e9a
--- /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 00000000000..e39edf5c86f
--- /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 00000000000..810080bb0a2
--- /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 00000000000..40b5191b55a
--- /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 00000000000..a2eb547a1a7
--- /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 00000000000..c15870493b3
--- /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 00000000000..a8a2493260f
--- /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 00000000000..e3636520d8c
--- /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 00000000000..ad4b0121782
--- /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 00000000000..c8cc16c3da9
--- /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 00000000000..03383af8c3b
--- /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 00000000000..6916248295d
--- /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 00000000000..633ba73bc4d
--- /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 00000000000..83c569e3bdb
--- /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 00000000000..6100682b1da
--- /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 00000000000..efe0af379f0
--- /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 00000000000..8ff23649581
--- /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 00000000000..c4992038cee
--- /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 00000000000..9c3d1a21313
--- /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 00000000000..5fb8c27cbef
--- /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 00000000000..f50b697eb60
--- /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 00000000000..05cebf8f62b
--- /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 00000000000..62b1e8f3c13
--- /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 00000000000..85aa6a3c0b6
--- /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 00000000000..4673f42f88a
--- /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 00000000000..0f4fe1faf9b
--- /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 00000000000..b83a8181d44
--- /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 00000000000..31c220faca0
--- /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 00000000000..46d240074f7
--- /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 00000000000..7309e38a0cc
--- /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 00000000000..c89569a8da0
--- /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 00000000000..b8528426ab1
--- /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 00000000000..94c94ed3e00
--- /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 00000000000..8e7ed046bfe
--- /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 00000000000..c092c8fbb2c
--- /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 00000000000..2c3ed23354a
--- /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 00000000000..1fd8cab3a29
--- /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 00000000000..e7b1f083991
--- /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 dfd35dcc1cb..a51d36a2738 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 51f4fb6f16f..d506774f4b0 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 9d9cd990afa..df397f932d0 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 ddda8f4bc86..ea59dcd0386 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 56a17495b2d..10b8c400f17 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 b2655d94558..9f603cdaaa6 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 ad3f616322c..23f2a89816a 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 a8ab1d4fe0a..46d60314bb1 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 9141e369073..efed8897bef 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 00000000000..6930c12adc1
--- /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 00000000000..b7952c06a2b
--- /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 5b161a5cb65..571d0b24f89 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 64f057d89e7..edad4156d89 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 00000000000..54d018e45bf
--- /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 00000000000..41459ad0776
--- /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 00000000000..7226cf732b4
--- /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 00000000000..9e83940ac26
--- /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 00000000000..525bd3d9015
--- /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 00000000000..ed4f53f529d
--- /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 00000000000..018e81af439
--- /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 00000000000..2f337605c74
--- /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 00000000000..68a73bf4ffc
--- /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 00000000000..bf4020116df
--- /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